Class: Rley::Notation::SymbolNode
- Defined in:
- lib/rley/notation/symbol_node.rb
Overview
A syntax node for a grammar symbol occurring in rhs of a rule
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
Name of grammar symbol.
Attributes inherited from ASTNode
#annotation, #position, #repetition
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
Abstract method (must be overriden in subclasses).
-
#initialize(aPosition, aName, theRepetition = nil) ⇒ SymbolNode
constructor
A new instance of SymbolNode.
Methods inherited from ASTNode
Constructor Details
#initialize(aPosition, aName, theRepetition = nil) ⇒ SymbolNode
Returns a new instance of SymbolNode.
15 16 17 18 19 |
# File 'lib/rley/notation/symbol_node.rb', line 15 def initialize(aPosition, aName, theRepetition = nil) super(aPosition) @name = aName self.repetition = theRepetition if theRepetition end |
Instance Attribute Details
#name ⇒ String (readonly)
Returns name of grammar symbol.
10 11 12 |
# File 'lib/rley/notation/symbol_node.rb', line 10 def name @name end |
Instance Method Details
#accept(visitor) ⇒ Object
Abstract method (must be overriden in subclasses). Part of the 'visitee' role in Visitor design pattern.
24 25 26 |
# File 'lib/rley/notation/symbol_node.rb', line 24 def accept(visitor) visitor.visit_symbol_node(self) end |