rubyx/lib/vool/vool_compiler.rb

22 lines
463 B
Ruby
Raw Normal View History

2017-04-08 12:11:52 +03:00
require_relative "ruby_compiler"
module Vool
class VoolCompiler
2017-08-30 17:21:13 +03:00
2018-03-12 17:23:16 +05:30
def self.ruby_to_vool( ruby_source )
vool = RubyCompiler.compile( ruby_source )
vool = vool.normalize
vool
2017-04-08 12:11:52 +03:00
end
2018-06-29 11:36:14 +03:00
def self.ruby_to_binary(source , platform = :arm)
2018-03-29 20:37:25 +03:00
machine = Risc.machine.boot
vool = self.ruby_to_vool(source)
vool.to_mom(nil)
machine.translate(platform)
2018-03-29 20:37:25 +03:00
machine.position_all
machine.create_binary
2018-03-29 20:37:25 +03:00
end
2017-04-08 12:11:52 +03:00
end
end