Class: Gisele::VM::Kernel::Runner
- Inherits:
-
Object
- Object
- Gisele::VM::Kernel::Runner
- Includes:
- Opcodes
- Defined in:
- lib/gisele/vm/kernel/runner.rb
Instance Attribute Summary collapse
-
#opcodes ⇒ Object
readonly
Returns the value of attribute opcodes.
-
#prog ⇒ Object
readonly
Returns the value of attribute prog.
-
#vm ⇒ Object
readonly
Returns the value of attribute vm.
Instance Method Summary collapse
-
#initialize(vm = VM.new, prog = nil) ⇒ Runner
constructor
A new instance of Runner.
- #run(at = nil, stack = []) ⇒ Object
Constructor Details
Instance Attribute Details
#opcodes ⇒ Object (readonly)
Returns the value of attribute opcodes.
8 9 10 |
# File 'lib/gisele/vm/kernel/runner.rb', line 8 def opcodes @opcodes end |
#prog ⇒ Object (readonly)
Returns the value of attribute prog.
9 10 11 |
# File 'lib/gisele/vm/kernel/runner.rb', line 9 def prog @prog end |
#vm ⇒ Object (readonly)
Returns the value of attribute vm.
7 8 9 |
# File 'lib/gisele/vm/kernel/runner.rb', line 7 def vm @vm end |
Instance Method Details
#run(at = nil, stack = []) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/gisele/vm/kernel/runner.rb', line 18 def run(at = nil, stack = []) @stack = stack enlist_bytecode_at(at) if at until @opcodes.empty? op = @opcodes.shift send :"op_#{op.first}", *op[1..-1] end @stack end |