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.
9 10 11 12 |
# File 'lib/rley/sppf/epsilon_node.rb', line 9 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.
23 24 25 |
# File 'lib/rley/sppf/epsilon_node.rb', line 23 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.
17 18 19 |
# File 'lib/rley/sppf/epsilon_node.rb', line 17 def to_string(indentation) return "_#{range.to_string(indentation)}" end |