class Rley::RGN::SymbolNode
A syntax node for a grammar symbol occurring in rhs of a rule. symbol nodes are leaf nodes of RRN parse trees.
Attributes
@return [String] name of grammar symbol
@return [Rley::Lexical::Position] Position of the entry in the input stream.
Public Class Methods
Source
# File lib/rley/rgn/symbol_node.rb, line 18 def initialize(aPosition, aName) super() @position = aPosition @name = aName end
@param aPosition [Rley::Lexical::Position] Position of the entry in the input stream. @param aName [String] name of grammar symbol
Calls superclass method
Rley::RGN::ASTNode::new
Public Instance Methods
Source
# File lib/rley/rgn/symbol_node.rb, line 32 def accept(visitor) visitor.visit_symbol_node(self) end
Abstract method (must be overriden in subclasses). Part of the ‘visitee’ role in Visitor design pattern. @param visitor [RGN::ASTVisitor] the visitor
Source
# File lib/rley/rgn/symbol_node.rb, line 25 def to_text annotation.empty? ? name : "#{name} #{annotation_to_text}" end
@return [String] name of grammar symbol