class Rley::SPPF::SPPFNode
Abstract class. The generalization for all kinds of nodes occurring in a shared packed parse forest (SPPF
).
Attributes
@return [Lexical::TokenRange] A range of token indices corresponding to this node.
Public Class Methods
Source
# File lib/rley/sppf/sppf_node.rb, line 16 def initialize(aRange) @range = Lexical::TokenRange.new(aRange) end
Constructor @param aRange [Lexical::TokenRange]
Public Instance Methods
Source
# File lib/rley/sppf/sppf_node.rb, line 37 def accept(aVisitor) raise NotImplementedError end
Part of the ‘visitee’ role in Visitor design pattern. @param aVisitor the visitor
Source
# File lib/rley/sppf/sppf_node.rb, line 23 def origin # steep:ignore MethodBodyTypeMismatch range.low end
Return the origin, that is, the index of the first token matched by this node. @return [Integer]
Source
# File lib/rley/sppf/sppf_node.rb, line 31 def to_string(indentation) raise NotImplementedError end
Emit a (formatted) string representation of the node. Mainly used for diagnosis/debugging purposes. @param indentation [Integer] @return [String]