2015-07-15 18:26:11 +02:00
|
|
|
|
2015-07-09 21:43:07 +02:00
|
|
|
require "salama"
|
2015-07-06 20:55:34 +02:00
|
|
|
|
2015-07-13 22:11:00 +02:00
|
|
|
require_relative "registers_view"
|
|
|
|
require_relative "object_view"
|
|
|
|
require_relative "space_view"
|
|
|
|
|
2015-07-09 14:23:36 +02:00
|
|
|
class MainView
|
2015-07-09 11:32:29 +02:00
|
|
|
|
2015-07-06 20:55:34 +02:00
|
|
|
def initialize
|
|
|
|
|
2015-07-14 18:59:21 +02:00
|
|
|
registers = RegisterView.new(max)
|
2015-07-13 14:14:34 +02:00
|
|
|
|
|
|
|
ParseTask.parse(1).then do |result|
|
|
|
|
is = Ast::Expression.from_basic(result)
|
|
|
|
Virtual::Compiler.compile( is , Virtual.machine.space.get_main )
|
2015-07-14 12:07:28 +02:00
|
|
|
Virtual.machine.run_before Virtual::Machine::FIRST_PASS
|
2015-07-13 14:14:34 +02:00
|
|
|
end.fail do |error|
|
2015-07-13 17:49:46 +02:00
|
|
|
raise "Error: #{error}"
|
2015-07-13 14:14:34 +02:00
|
|
|
end
|
2015-07-14 18:59:21 +02:00
|
|
|
space = SpaceView.new(max)
|
2015-07-06 20:55:34 +02:00
|
|
|
|
2015-07-09 14:23:36 +02:00
|
|
|
|
2015-07-06 20:55:34 +02:00
|
|
|
end
|
2015-07-09 14:23:36 +02:00
|
|
|
|
2015-07-06 20:55:34 +02:00
|
|
|
end
|