Class: Treetop::Runtime::TerminalSyntaxNode

Inherits:
SyntaxNode
  • Object
show all
Defined in:
lib/treetop/runtime/terminal_syntax_node.rb

Instance Attribute Summary

Attributes inherited from SyntaxNode

#input, #interval, #parent

Instance Method Summary collapse

Methods inherited from SyntaxNode

#<=>, #dot_id, #elements, #empty?, #extension_modules, #nonterminal?, #terminal?, #text_value, #write_dot, #write_dot_file

Constructor Details

#initialize(input, interval) ⇒ TerminalSyntaxNode

Returns a new instance of TerminalSyntaxNode


5
6
7
# File '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/treetop/runtime/terminal_syntax_node.rb', line 9

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