Class: TPPlus::Nodes::JumpNode

Inherits:
BaseNode
  • Object
show all
Defined in:
lib/tp_plus/nodes/jump_node.rb

Instance Method Summary collapse

Constructor Details

#initialize(identifier) ⇒ JumpNode

Returns a new instance of JumpNode.



4
5
6
# File 'lib/tp_plus/nodes/jump_node.rb', line 4

def initialize(identifier)
  @identifier = identifier
end

Instance Method Details

#can_be_inlined?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/tp_plus/nodes/jump_node.rb', line 12

def can_be_inlined?
  true
end

#eval(context, options = {}) ⇒ Object



16
17
18
19
20
# File 'lib/tp_plus/nodes/jump_node.rb', line 16

def eval(context,options={})
  raise "Label (#{@identifier}) not found" if context.labels[@identifier.to_sym].nil?

  "JMP LBL[#{context.labels[@identifier.to_sym]}]"
end

#requires_mixed_logic?(context) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/tp_plus/nodes/jump_node.rb', line 8

def requires_mixed_logic?(context)
  false
end