Class: Twostroke::Runtime::VM
- Inherits:
-
Object
- Object
- Twostroke::Runtime::VM
- Defined in:
- lib/twostroke/runtime/vm.rb
Defined Under Namespace
Classes: Frame
Instance Attribute Summary collapse
-
#bytecode ⇒ Object
Returns the value of attribute bytecode.
-
#global_scope ⇒ Object
readonly
Returns the value of attribute global_scope.
-
#lib ⇒ Object
readonly
Returns the value of attribute lib.
Instance Method Summary collapse
- #execute(section = :main, scope = nil) ⇒ Object
-
#initialize(bytecode) ⇒ VM
constructor
A new instance of VM.
- #throw_error(type, message) ⇒ Object
Constructor Details
#initialize(bytecode) ⇒ VM
Returns a new instance of VM.
6 7 8 9 10 |
# File 'lib/twostroke/runtime/vm.rb', line 6 def initialize(bytecode) @bytecode = bytecode @global_scope = GlobalScope.new self @lib = {} end |
Instance Attribute Details
#bytecode ⇒ Object
Returns the value of attribute bytecode.
3 4 5 |
# File 'lib/twostroke/runtime/vm.rb', line 3 def bytecode @bytecode end |
#global_scope ⇒ Object (readonly)
Returns the value of attribute global_scope.
4 5 6 |
# File 'lib/twostroke/runtime/vm.rb', line 4 def global_scope @global_scope end |
#lib ⇒ Object (readonly)
Returns the value of attribute lib.
4 5 6 |
# File 'lib/twostroke/runtime/vm.rb', line 4 def lib @lib end |