Stands terminal and nonterminal symbols.
# File lib/racc/grammar.rb, line 971
971: def initialize(value, dummyp)
972: @ident = nil
973: @value = value
974: @dummyp = dummyp
975:
976: @term = nil
977: @nterm = nil
978: @should_terminal = false
979: @precedence = nil
980: case value
981: when Symbol
982: @to_s = value.to_s
983: @serialized = value.inspect
984: @string = false
985: when String
986: @to_s = value.inspect
987: @serialized = value.dump
988: @string = true
989: when false
990: @to_s = '$end'
991: @serialized = 'false'
992: @string = false
993: when ErrorSymbolValue
994: @to_s = 'error'
995: @serialized = 'Object.new'
996: @string = false
997: else
998: raise ArgumentError, "unknown symbol value: #{value.class}"
999: end
1000:
1001: @heads = []
1002: @locate = []
1003: @snull = nil
1004: @null = nil
1005: @expand = nil
1006: @useless = nil
1007: end
# File lib/racc/grammar.rb, line 1028
1028: def dummy?
1029: @dummyp
1030: end
# File lib/racc/grammar.rb, line 1036
1036: def nonterminal?
1037: @nterm
1038: end
# File lib/racc/grammar.rb, line 1098
1098: def null=(n)
1099: @null = n
1100: end
# File lib/racc/grammar.rb, line 1094
1094: def nullable?
1095: @null
1096: end
# File lib/racc/grammar.rb, line 1077
1077: def rule
1078: Rule.new(nil, [self], UserAction.empty)
1079: end
# File lib/racc/grammar.rb, line 1088
1088: def self_null?
1089: @snull
1090: end
# File lib/racc/grammar.rb, line 1058
1058: def serialize
1059: @serialized
1060: end
# File lib/racc/grammar.rb, line 1046
1046: def should_terminal
1047: @should_terminal = true
1048: end
# File lib/racc/grammar.rb, line 1050
1050: def should_terminal?
1051: @should_terminal
1052: end
# File lib/racc/grammar.rb, line 1054
1054: def string_symbol?
1055: @string
1056: end
# File lib/racc/grammar.rb, line 1040
1040: def term=(t)
1041: raise 'racc: fatal: term= called twice' unless @term.nil?
1042: @term = t
1043: @nterm = !t
1044: end
# File lib/racc/grammar.rb, line 1032
1032: def terminal?
1033: @term
1034: end
# File lib/racc/grammar.rb, line 1067
1067: def to_s
1068: @to_s.dup
1069: end
# File lib/racc/grammar.rb, line 1109
1109: def useless=(f)
1110: @useless = f
1111: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.