Class: CodeTools::Compiler::Bytecode

Inherits:
Stage
  • Object
show all
Defined in:
lib/rubinius/code/compiler/stages.rb

Overview

AST -> symbolic bytecode

Instance Attribute Summary collapse

Attributes inherited from Stage

#next_stage, #printer

Instance Method Summary collapse

Methods inherited from Stage

#create_next_stage, #input, #insert, next_stage, next_stage_class, #processor, #run_next, stage, stage_name

Constructor Details

#initialize(compiler, last) ⇒ Bytecode

Returns a new instance of Bytecode.



143
144
145
146
147
148
# File 'lib/rubinius/code/compiler/stages.rb', line 143

def initialize(compiler, last)
  super
  @variable_scope = nil
  compiler.generator = self
  @processor = Generator
end

Instance Attribute Details

#variable_scopeObject

Returns the value of attribute variable_scope.



141
142
143
# File 'lib/rubinius/code/compiler/stages.rb', line 141

def variable_scope
  @variable_scope
end

Instance Method Details

#runObject



150
151
152
153
154
155
156
# File 'lib/rubinius/code/compiler/stages.rb', line 150

def run
  @output = @processor.new
  @input.variable_scope = @variable_scope
  @input.bytecode @output
  @output.close
  run_next
end