Stands terminal and nonterminal symbols.
# File lib/racc/grammar.rb, line 971 def initialize(value, dummyp) @ident = nil @value = value @dummyp = dummyp @term = nil @nterm = nil @should_terminal = false @precedence = nil case value when Symbol @to_s = value.to_s @serialized = value.inspect @string = false when String @to_s = value.inspect @serialized = value.dump @string = true when false @to_s = '$end' @serialized = 'false' @string = false when ErrorSymbolValue @to_s = 'error' @serialized = 'Object.new' @string = false else raise ArgumentError, "unknown symbol value: #{value.class}" end @heads = [] @locate = [] @snull = nil @null = nil @expand = nil @useless = nil end
# File lib/racc/grammar.rb, line 1036 def nonterminal? @nterm end
# File lib/racc/grammar.rb, line 1077 def rule Rule.new(nil, [self], UserAction.empty) end
# File lib/racc/grammar.rb, line 1058 def serialize @serialized end
# File lib/racc/grammar.rb, line 1046 def should_terminal @should_terminal = true end
# File lib/racc/grammar.rb, line 1050 def should_terminal? @should_terminal end
# File lib/racc/grammar.rb, line 1054 def string_symbol? @string end
# File lib/racc/grammar.rb, line 1040 def term=(t) raise 'racc: fatal: term= called twice' unless @term.nil? @term = t @nterm = !t end
# File lib/racc/grammar.rb, line 1067 def to_s @to_s.dup end
Generated with the Darkfish Rdoc Generator 2.