07ed16d765
especially positioning makes the previous interpreter approach to fragile (too far off the real thing) Interpreter should be it’s own platform (still use the risc instructions), get a translator and use positions
25 lines
603 B
Ruby
25 lines
603 B
Ruby
require_relative "ruby_compiler"
|
|
|
|
module Vool
|
|
class VoolCompiler
|
|
|
|
def self.ruby_to_vool( ruby_source )
|
|
statements = RubyCompiler.compile( ruby_source )
|
|
statements = statements.normalize
|
|
statements.create_objects
|
|
statements
|
|
end
|
|
def self.ruby_to_mom(source)
|
|
statements = self.ruby_to_vool(source)
|
|
statements.to_mom(nil)
|
|
end
|
|
def self.ruby_to_binary(source , platform = :arm)
|
|
machine = Risc.machine.boot
|
|
self.ruby_to_vool(source)
|
|
machine.translate(platform)
|
|
machine.position_all
|
|
machine.create_binary
|
|
end
|
|
end
|
|
end
|