Class: ElseNode
Instance Attribute Summary collapse
-
#argument ⇒ Object
Returns the value of attribute argument.
-
#node ⇒ Object
Returns the value of attribute node.
Attributes inherited from Node
Instance Method Summary collapse
- #create_tree_entry ⇒ Object
- #evaluate ⇒ Object
-
#initialize(node) ⇒ ElseNode
constructor
A new instance of ElseNode.
Methods inherited from Node
Constructor Details
#initialize(node) ⇒ ElseNode
Returns a new instance of ElseNode.
210 211 212 213 |
# File 'lib/nodes/stmtnodes.rb', line 210 def initialize(node) @node = node @argument = BoolNode.new(ScopeManager.true_value) end |
Instance Attribute Details
#argument ⇒ Object
Returns the value of attribute argument.
208 209 210 |
# File 'lib/nodes/stmtnodes.rb', line 208 def argument @argument end |
#node ⇒ Object
Returns the value of attribute node.
208 209 210 |
# File 'lib/nodes/stmtnodes.rb', line 208 def node @node end |
Instance Method Details
#create_tree_entry ⇒ Object
215 216 217 218 219 |
# File 'lib/nodes/stmtnodes.rb', line 215 def create_tree_entry result = set_up_scope_header result += "Else statement is used." TREE_ARRAY << result unless TREE_ARRAY[-1] == result end |
#evaluate ⇒ Object
221 222 223 224 225 |
# File 'lib/nodes/stmtnodes.rb', line 221 def evaluate @value = @node.evaluate create_tree_entry if PRINT_TREE_FLAG @value end |