Class: YARP::ProgramNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::ProgramNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
The top level node of any parse tree.
Instance Attribute Summary collapse
-
#locals ⇒ Object
readonly
attr_reader locals: Array.
-
#statements ⇒ Object
readonly
attr_reader statements: Node.
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(locals, statements, location) ⇒ ProgramNode
constructor
def initialize: (locals: Array, statements: Node, location: Location) -> void.
Constructor Details
#initialize(locals, statements, location) ⇒ ProgramNode
def initialize: (locals: Array, statements: Node, location: Location) -> void
4889 4890 4891 4892 4893 |
# File 'lib/yarp/node.rb', line 4889 def initialize(locals, statements, location) @locals = locals @statements = statements @location = location end |
Instance Attribute Details
#locals ⇒ Object (readonly)
attr_reader locals: Array
4883 4884 4885 |
# File 'lib/yarp/node.rb', line 4883 def locals @locals end |
#statements ⇒ Object (readonly)
attr_reader statements: Node
4886 4887 4888 |
# File 'lib/yarp/node.rb', line 4886 def statements @statements end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
4896 4897 4898 |
# File 'lib/yarp/node.rb', line 4896 def accept(visitor) visitor.visit_program_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
4902 4903 4904 |
# File 'lib/yarp/node.rb', line 4902 def child_nodes [statements] end |