use rubyc_compiler as instance
not as before class methods so we can carry the state around
This commit is contained in:
@ -2,24 +2,30 @@ require_relative "ruby_compiler"
|
||||
|
||||
module RubyX
|
||||
class RubyXCompiler
|
||||
attr_reader :source
|
||||
|
||||
def self.ruby_to_vool( ruby_source )
|
||||
vool = RubyCompiler.compile( ruby_source )
|
||||
def initialize(source)
|
||||
@source = source
|
||||
end
|
||||
|
||||
def ruby_to_vool
|
||||
vool = RubyCompiler.compile( source )
|
||||
vool = vool.normalize
|
||||
vool
|
||||
end
|
||||
|
||||
def self.ruby_to_mom( ruby_source )
|
||||
vool = self.ruby_to_vool(ruby_source)
|
||||
def ruby_to_mom
|
||||
vool = ruby_to_vool
|
||||
vool.to_mom(nil)
|
||||
end
|
||||
|
||||
def self.ruby_to_binary(source , platform = :arm)
|
||||
def ruby_to_binary(platform = :arm)
|
||||
Parfait.boot!
|
||||
machine = Risc.machine.boot
|
||||
mom = ruby_to_mom(source)
|
||||
#mom.translate(platform)
|
||||
machine.translate(platform)
|
||||
mom = ruby_to_mom
|
||||
puts "MOM #{mom.class}"
|
||||
mom.translate(platform)
|
||||
#machine.translate(platform)
|
||||
machine.position_all
|
||||
machine.create_binary
|
||||
end
|
||||
|
Reference in New Issue
Block a user