Class: Rley::SPPF::EpsilonNode
- Defined in:
- lib/rley/sppf/epsilon_node.rb
Overview
A leaf node in a parse forest that matches an empty string from the input
Instance Attribute Summary
Attributes inherited from SPPFNode
Instance Method Summary collapse
-
#accept(aVisitor) ⇒ Object
Part of the 'visitee' role in Visitor design pattern.
-
#initialize(aPosition) ⇒ EpsilonNode
constructor
aPosition [Integer] is the position of the token in the input stream.
-
#to_string(indentation) ⇒ String
Emit a (formatted) string representation of the node.
Methods inherited from LeafNode
Methods inherited from SPPFNode
Constructor Details
#initialize(aPosition) ⇒ EpsilonNode
aPosition [Integer] is the position of the token in the input stream.
11 12 13 14 |
# File 'lib/rley/sppf/epsilon_node.rb', line 11 def initialize(aPosition) range = { low: aPosition, high: aPosition } super(range) end |
Instance Method Details
#accept(aVisitor) ⇒ Object
Part of the 'visitee' role in Visitor design pattern.
25 26 27 |
# File 'lib/rley/sppf/epsilon_node.rb', line 25 def accept(aVisitor) aVisitor.visit_epsilon(self) end |
#to_string(indentation) ⇒ String
Emit a (formatted) string representation of the node. Mainly used for diagnosis/debugging purposes.
19 20 21 |
# File 'lib/rley/sppf/epsilon_node.rb', line 19 def to_string(indentation) "_#{range.to_string(indentation)}" end |