Class: SyntaxTree::Bf::Root
Overview
The root node of the syntax tree.
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(nodes:, location:) ⇒ Root
constructor
A new instance of Root.
Methods inherited from Node
Constructor Details
#initialize(nodes:, location:) ⇒ Root
Returns a new instance of Root.
19 20 21 22 |
# File 'lib/syntax_tree/bf/nodes.rb', line 19 def initialize(nodes:, location:) @nodes = nodes @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
17 18 19 |
# File 'lib/syntax_tree/bf/nodes.rb', line 17 def location @location end |
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
17 18 19 |
# File 'lib/syntax_tree/bf/nodes.rb', line 17 def nodes @nodes end |
Instance Method Details
#accept(visitor) ⇒ Object
24 25 26 |
# File 'lib/syntax_tree/bf/nodes.rb', line 24 def accept(visitor) visitor.visit_root(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
28 29 30 |
# File 'lib/syntax_tree/bf/nodes.rb', line 28 def child_nodes nodes end |
#deconstruct_keys(keys) ⇒ Object
34 35 36 |
# File 'lib/syntax_tree/bf/nodes.rb', line 34 def deconstruct_keys(keys) { nodes: nodes, location: location } end |