Class: EXEL::ASTNode
- Inherits:
-
Object
show all
- Defined in:
- lib/exel/ast_node.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(instruction, children = []) ⇒ ASTNode
5
6
7
8
|
# File 'lib/exel/ast_node.rb', line 5
def initialize(instruction, children = [])
@instruction = instruction
@children = children
end
|
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
3
4
5
|
# File 'lib/exel/ast_node.rb', line 3
def children
@children
end
|
#instruction ⇒ Object
Returns the value of attribute instruction.
3
4
5
|
# File 'lib/exel/ast_node.rb', line 3
def instruction
@instruction
end
|
Instance Method Details
#add_child(node) ⇒ Object
18
19
20
|
# File 'lib/exel/ast_node.rb', line 18
def add_child(node)
@children << node
end
|
#run(_context) ⇒ Object
14
15
16
|
# File 'lib/exel/ast_node.rb', line 14
def run(_context)
fail "#{self.class} does not implement #process"
end
|
#start(context) ⇒ Object
10
11
12
|
# File 'lib/exel/ast_node.rb', line 10
def start(context)
fail_silently { run(context) }
end
|