rubyx-debugger/app/debugger.rb

38 lines
1.0 KiB
Ruby
Raw Normal View History

2015-07-22 15:17:25 +02:00
2015-07-26 11:51:57 +02:00
require "register_view"
require "class_view"
require "source_view"
require "block_view"
2015-07-28 15:16:09 +02:00
require "status_view"
2015-07-26 11:51:57 +02:00
2015-07-22 15:17:25 +02:00
class Debugger
include React::Component
2015-07-23 15:23:10 +02:00
required_param :machine , :type => Virtual::Machine
define_state :interpreter => Interpreter.new
2015-07-22 15:17:25 +02:00
before_mount do
code = Ast::ExpressionList.new( [Ast::CallSiteExpression.new(:putstring, [] ,Ast::StringExpression.new("Hello again"))])
Virtual::Compiler.compile( code , machine.space.get_main )
machine.run_before "Register::CallImplementation"
2015-07-23 19:08:40 +02:00
interpreter.start machine.init
end
2015-07-22 15:17:25 +02:00
def render
div.debugger_view do
ClassView classes: machine.space.classes
div.file_view do
"Future Source code view"
end
SourceView :interpreter => interpreter
BlockView :interpreter => interpreter
2015-07-28 15:16:09 +02:00
StatusView :interpreter => interpreter
div.registers_view do
interpreter.registers.each do |r , oid|
RegisterView interpreter: interpreter , register: r
2015-07-22 21:05:31 +02:00
end
end
2015-07-22 15:17:25 +02:00
end
2015-07-22 22:08:36 +02:00
2015-07-22 15:17:25 +02:00
end
end