Class: EXEL::SequenceNode

Inherits:
ASTNode
  • Object
show all
Defined in:
lib/exel/sequence_node.rb

Overview

A node in the AST that has as its children a sequence of nodes to be run sequentially

Instance Attribute Summary

Attributes inherited from ASTNode

#children, #instruction

Instance Method Summary collapse

Methods inherited from ASTNode

#add_child, #start

Constructor Details

#initialize(*children) ⇒ SequenceNode

Returns a new instance of SequenceNode.



8
9
10
11
# File 'lib/exel/sequence_node.rb', line 8

def initialize(*children)
  @instruction = NullInstruction.new
  @children = children
end

Instance Method Details

#run(context) ⇒ Object



13
14
15
# File 'lib/exel/sequence_node.rb', line 13

def run(context)
  @children.each { |child| child.run(context) }
end