rubyx-debugger/lib/debugger.rb

45 lines
1.2 KiB
Ruby
Raw Normal View History

2015-07-14 13:08:28 +02:00
require "opal"
2015-07-14 15:03:06 +02:00
require "opal-parser"
2015-08-24 01:49:41 +02:00
require 'browser'
require 'browser/http'
2015-08-24 01:49:41 +02:00
require 'native'
require "salama"
2015-10-02 19:25:54 +02:00
require "salama-reader"
require "ast"
2015-08-24 01:49:41 +02:00
require "interpreter/interpreter"
2015-10-07 11:24:02 +02:00
# the base, our own litle framework, allows for child and parent views and handles updates
2015-08-24 01:49:41 +02:00
require "base/list_view"
2015-10-07 11:24:02 +02:00
# each seperate view is in it's own class.
require "views/switch_view"
2015-10-19 18:56:35 +02:00
require "views/status_view"
require "views/file_view"
require "views/blocks_view"
require "views/instruction_view"
require "views/registers_view"
2015-08-24 01:49:41 +02:00
class MainView < ListView
2015-10-27 11:44:02 +01:00
include AST::Sexp
2015-08-24 01:49:41 +02:00
def initialize
2015-10-27 11:44:02 +01:00
machine = Register.machine.boot
code = s(:statements, s(:class, :Foo, s(:derives, nil),
s(:statements, s(:class_field, :Integer, :x))))
2015-10-27 11:44:02 +01:00
Soml::Compiler.compile( code )
2015-10-19 18:56:35 +02:00
machine.collect
2015-08-24 01:49:41 +02:00
@interpreter = Interpreter::Interpreter.new
super( [SwitchView.new(@interpreter) ,
2015-08-24 01:49:41 +02:00
FileView.new ,
BlocksView.new(@interpreter) ,
InstructionView.new(@interpreter) ,
StatusView.new(@interpreter) ,
RegistersView.new(@interpreter) ] )
end
end
2015-07-14 13:08:28 +02:00
2015-08-20 19:40:47 +02:00
view = MainView.new()
view.draw.append_to($document.body)