Class: Hoozuki::VM::Compiler
- Inherits:
-
Object
- Object
- Hoozuki::VM::Compiler
- Defined in:
- lib/hoozuki/vm/compiler.rb
Instance Attribute Summary collapse
-
#instructions ⇒ Object
readonly
Returns the value of attribute instructions.
Instance Method Summary collapse
- #compile(ast) ⇒ Object
-
#initialize ⇒ Compiler
constructor
A new instance of Compiler.
Constructor Details
#initialize ⇒ Compiler
Returns a new instance of Compiler.
8 9 10 11 |
# File 'lib/hoozuki/vm/compiler.rb', line 8 def initialize @pc = 0 @instructions = [] end |
Instance Attribute Details
#instructions ⇒ Object (readonly)
Returns the value of attribute instructions.
6 7 8 |
# File 'lib/hoozuki/vm/compiler.rb', line 6 def instructions @instructions end |
Instance Method Details
#compile(ast) ⇒ Object
13 14 15 16 |
# File 'lib/hoozuki/vm/compiler.rb', line 13 def compile(ast) compile_node(ast) emit_match end |