Class: Rley::RGN::SequenceNode
- Inherits:
-
CompositeNode
- Object
- ASTNode
- CompositeNode
- Rley::RGN::SequenceNode
- Defined in:
- lib/rley/rgn/sequence_node.rb
Overview
A syntax node for a sequence of AST nodes
Instance Attribute Summary
Attributes inherited from CompositeNode
Attributes inherited from ASTNode
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
Part of the 'visitee' role in Visitor design pattern.
- #name ⇒ Object
- #to_text ⇒ Object
Methods inherited from CompositeNode
Methods inherited from ASTNode
#annotation_to_text, #done!, #initialize
Constructor Details
This class inherits a constructor from Rley::RGN::CompositeNode
Instance Method Details
#accept(visitor) ⇒ Object
Part of the 'visitee' role in Visitor design pattern.
25 26 27 |
# File 'lib/rley/rgn/sequence_node.rb', line 25 def accept(visitor) visitor.visit_sequence_node(self) end |
#name ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/rley/rgn/sequence_node.rb', line 9 def name result = +'' subnodes.each do |sn| result << "_#{sn.name}" end "seq#{result}" end |
#to_text ⇒ Object
18 19 20 21 |
# File 'lib/rley/rgn/sequence_node.rb', line 18 def to_text arr = subnodes.map(&:to_text) arr.join(' ') end |