Class: Braingasm::Compiler::Loop

Inherits:
Object
  • Object
show all
Defined in:
lib/braingasm/compiler.rb

Direct Known Subclasses

FixedLoop

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#start_indexObject

Returns the value of attribute start_index.



179
180
181
# File 'lib/braingasm/compiler.rb', line 179

def start_index
  @start_index
end

#stop_indexObject

Returns the value of attribute stop_index.



179
180
181
# File 'lib/braingasm/compiler.rb', line 179

def stop_index
  @stop_index
end

Instance Method Details

#call(machine) ⇒ Object



181
182
183
# File 'lib/braingasm/compiler.rb', line 181

def call(machine)
  machine.inst_jump_if_data_zero(stop_index + 1)
end