Class: Rley::RGN::CompositeNode
- Defined in:
- lib/rley/rgn/composite_node.rb
Overview
Abstract class for a syntax node that is the parent of one or more subnodes.
Direct Known Subclasses
Instance Attribute Summary collapse
Attributes inherited from ASTNode
Instance Method Summary collapse
-
#initialize(children) ⇒ CompositeNode
constructor
A new instance of CompositeNode.
- #size ⇒ Object
Methods inherited from ASTNode
#accept, #annotation_to_text, #done!
Constructor Details
#initialize(children) ⇒ CompositeNode
Returns a new instance of CompositeNode.
17 18 19 20 21 |
# File 'lib/rley/rgn/composite_node.rb', line 17 def initialize(children) super() @subnodes = children @constraints = [] end |
Instance Attribute Details
#constraints ⇒ Hash
14 15 16 |
# File 'lib/rley/rgn/composite_node.rb', line 14 def constraints @constraints end |
#subnodes ⇒ Array<ASTNode> (readonly)
11 12 13 |
# File 'lib/rley/rgn/composite_node.rb', line 11 def subnodes @subnodes end |
Instance Method Details
#size ⇒ Object
23 24 25 |
# File 'lib/rley/rgn/composite_node.rb', line 23 def size subnodes.size end |