Class: Rubasteme::AST::SequenceNode

Inherits:
ListNode show all
Defined in:
lib/rubasteme/ast/branch_node.rb

Instance Method Summary collapse

Methods inherited from ListNode

#elements, #empty?, #first, #rest

Methods inherited from BranchNode

#<<, #[], #[]=, #each, #size, #to_a

Methods inherited from Node

#to_a, #to_s, #type

Constructor Details

#initialize(_ = nil) ⇒ SequenceNode

Returns a new instance of SequenceNode.



185
186
187
188
# File 'lib/rubasteme/ast/branch_node.rb', line 185

def initialize(_ = nil)
  # @nodes = [<expression 1>, <expression 2>, ... ]
  super(0, _)
end

Instance Method Details

#add_expression(node) ⇒ Object



190
191
192
# File 'lib/rubasteme/ast/branch_node.rb', line 190

def add_expression(node)
  @nodes << node
end