update to use new ast

soml was updated to have a typed ast layer to make programatic creation
easier
this brings LOTS of syntax change with it, that does not really mean
anything at all
All tests pass again so back to the same
This commit is contained in:
Torsten Ruger
2016-03-07 11:55:28 +02:00
parent d7b210d63a
commit 229f5896c6
22 changed files with 126 additions and 118 deletions

View File

@ -18,10 +18,10 @@ module Register
def div10 context
s = "div_10"
compiler = Soml::Compiler.new.create_method(:Integer,:div10 ).init_method
me = compiler.process( s(:name , :self) )
tmp = compiler.process( s(:name , :self) )
q = compiler.process( s(:name , :self) )
const = compiler.process( s(:int , 1) )
me = compiler.process( Soml::NameExpression.new( :self) )
tmp = compiler.process( Soml::NameExpression.new( :self) )
q = compiler.process( Soml::NameExpression.new( :self) )
const = compiler.process( Soml::IntegerExpression.new(1) )
# int tmp = self >> 1
compiler.add_code Register.op( s , ">>" , tmp , const)
# int q = self >> 2

View File

@ -13,7 +13,7 @@ module Register
compiler = Soml::Compiler.new.create_method(:Object , :get_internal_word , {:index => :Integer}).init_method
source = "get_internal_word"
#Load self by "calling" on_name
me = compiler.process( s(:name , :self) )
me = compiler.process( Soml::NameExpression.new( :self) )
# Load the argument
index = compiler.use_reg :Integer
compiler.add_code Register.get_slot(source , :message , Parfait::Message.get_indexed(1), index )
@ -31,7 +31,7 @@ module Register
{:index => :Integer, :value => :Object} ).init_method
source = "set_internal_word"
#Load self by "calling" on_name
me = compiler.process( s(:name , :self) )
me = compiler.process( Soml::NameExpression.new( :self) )
# Load the index
index = compiler.use_reg :Integer
compiler.add_code Register.get_slot(source , :message , Parfait::Message.get_indexed(1), index )

View File

@ -13,14 +13,14 @@ module Register
Kernel.emit_syscall( compiler , :putstring )
compiler.method
end
# self[index] basically. Index is the first arg > 0
# return (and word sized int) is stored in return_value
def get_internal_byte context
compiler = Soml::Compiler.new.create_method(:Word , :get_internal_byte , {:index => :Integer }).init_method
source = "get_internal_word"
#Load self by "calling" on_name
me = compiler.process( s(:name , :self) )
me = compiler.process( Soml::NameExpression.new( :self) )
# Load the argument
index = compiler.use_reg :Integer
compiler.add_code Register.get_slot(source , :message , Parfait::Message.get_indexed(1), index )
@ -39,7 +39,7 @@ module Register
{:index => :Integer, :value => :Integer } ).init_method
source = "set_internal_word"
#Load self by "calling" on_name
me = compiler.process( s(:name , :self) )
me = compiler.process( Soml::NameExpression.new( :self) )
# Load the index
index = compiler.use_reg :Integer
compiler.add_code Register.get_slot(source , :message , Parfait::Message.get_indexed(1), index )