salaam boots and classes are shown

This commit is contained in:
Torsten Ruger 2015-07-29 20:50:39 +03:00
parent 264a52c184
commit 9383f0d75e
5 changed files with 32 additions and 7 deletions

View File

@ -1,5 +1,5 @@
require "eventable"
require_relative "eventable"
class Interpreter
# fire events for changed pc and register contents

View File

@ -1,11 +1,12 @@
# By default Volt generates this controller for your Main component
require "salama"
require_relative "interpreter"
module Main
class MainController < Volt::ModelController
def index
# 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"
# interpreter.start machine.init
init_machine
init_classes
end
def about
@ -13,7 +14,22 @@ module Main
end
private
def init_machine
machine = Virtual.machine.boot
machine.run_before "Register::CallImplementation"
code = Ast::ExpressionList.new( [Ast::CallSiteExpression.new(:putstring, [] ,Ast::StringExpression.new("Hello again"))])
Virtual::Compiler.compile( code , machine.space.get_main )
@interpreter = Interpreter.new
@interpreter.start machine.init
end
def init_classes
page._classes!.clear
Virtual.machine.space.classes.each do |name , claz|
next if [:Kernel,:Module,:MetaClass,:BinaryCode].index name
c = Volt::Model.new :name => name
page._classes << c
end
end
# The main template contains a #template binding that shows another
# template. This is the path to that template. It may change based
# on the params._component, params._controller, and params._action values.

View File

@ -2,8 +2,15 @@
Home
<:Body>
<div class="classes">
<h4> Classes </h4>
{{page._classes!.each do |clas| }}
<div class="one-class">
{{ clas._name }}
</div>
{{end}}
</div>
ClassView classes: machine.space.classes
<div class="file-view">
"Future Source code view"
</div>

View File

@ -0,0 +1,2 @@
Opal.use_gem "salama"
Opal.use_gem "salama-arm"