Class: Treetop::Runtime::TerminalSyntaxNode

Inherits:
SyntaxNode show all
Defined in:
lib/gems/treetop-1.2.4/lib/treetop/runtime/terminal_syntax_node.rb

Instance Attribute Summary

Attributes inherited from SyntaxNode

#elements, #input, #interval, #parent

Instance Method Summary collapse

Methods inherited from SyntaxNode

#empty?, #extension_modules, #nonterminal?, #terminal?, #text_value

Constructor Details

#initialize(input, interval) ⇒ TerminalSyntaxNode

Returns a new instance of TerminalSyntaxNode.



5
6
7
# File 'lib/gems/treetop-1.2.4/lib/treetop/runtime/terminal_syntax_node.rb', line 5

def initialize(input, interval)
  super(input, interval, [])
end

Instance Method Details

#inspect(indent = "") ⇒ Object



9
10
11
12
13
14
# File 'lib/gems/treetop-1.2.4/lib/treetop/runtime/terminal_syntax_node.rb', line 9

def inspect(indent="")
	indent+
	  self.class.to_s.sub(/.*:/,'') +
	  " offset=#{interval.first}" +
	  " #{text_value.inspect}"
end