adjust to rubyx layers
no global machine and positions also small layout changes
This commit is contained in:
parent
24961e2e10
commit
11cdb5872a
@ -24,7 +24,8 @@ body
|
||||
.mom_view
|
||||
width: 16%
|
||||
margin-left: 1%
|
||||
|
||||
overflow-x: hidden
|
||||
|
||||
.risc_view
|
||||
width: 34%
|
||||
margin-left: 1%
|
||||
|
@ -40,8 +40,9 @@ class MainView < ListView
|
||||
include AST::Sexp
|
||||
|
||||
def initialize
|
||||
Risc.machine.boot
|
||||
@interpreter = Risc::Interpreter.new
|
||||
input = "class Space;def main(arg); return 1; end; end"
|
||||
linker = RubyX::RubyXCompiler.new(input).ruby_to_binary(:interpreter)
|
||||
@interpreter = Risc::Interpreter.new(linker)
|
||||
super( [LeftView.new(@interpreter) ,
|
||||
VoolView.new(@interpreter) ,
|
||||
MomView.new(@interpreter) ,
|
||||
|
@ -57,13 +57,11 @@ class SelectView < ElementView
|
||||
|
||||
def select( code )
|
||||
puts "selecting #{code}"
|
||||
Risc.machine.boot
|
||||
@interpreter.set_state :stopped
|
||||
@element.at_css(".selected").text = code
|
||||
ruby = get_codes[code]
|
||||
Risc.machine.boot
|
||||
Vool::VoolCompiler.ruby_to_binary( as_main(ruby) , :interpreter )
|
||||
@interpreter.start_machine
|
||||
linker = RubyX::RubyXCompiler.new(as_main(ruby)).ruby_to_binary(:interpreter)
|
||||
@interpreter.start_program(linker)
|
||||
end
|
||||
def as_main(statements)
|
||||
"class Space ;def main(arg) ; #{statements}; end; end"
|
||||
|
@ -40,8 +40,7 @@ class ObjectView < ListView
|
||||
end
|
||||
|
||||
def class_header
|
||||
pos = Risc::Position.set?(@object)
|
||||
str = pos ? pos.to_s : @object.object_id.to_s(16)
|
||||
str = Risc::Position.set?(@object).to_s
|
||||
clazz = @object.class.name.split("::").last
|
||||
[clazz, str].join " : "
|
||||
end
|
||||
|
@ -58,11 +58,7 @@ class RefView < ListView
|
||||
if is_string?
|
||||
str = @value
|
||||
elsif is_object?
|
||||
var = @value
|
||||
str = var.class.name.split("::").last[0,2]
|
||||
pos = Risc::Position.set?(@value)
|
||||
str += pos ? pos.to_s : @value.object_id.to_s(16)
|
||||
str + " : #{@value.object_id.to_s(16)}"
|
||||
str = Risc::Position.get(@value).to_s
|
||||
elsif is_label?
|
||||
str = "Label"
|
||||
else
|
||||
|
@ -19,9 +19,8 @@ class VoolView < ElementView
|
||||
return "" unless i
|
||||
if i.is_a?(Risc::FunctionReturn)
|
||||
link = @interpreter.get_register( i.register )
|
||||
puts "Link #{link}:#{link.source}"
|
||||
puts "Link #{link}:#{link.class}"
|
||||
raise "No link method" unless link
|
||||
i = link
|
||||
end
|
||||
method = nil
|
||||
case i.source
|
||||
|
Loading…
Reference in New Issue
Block a user