Splitting NameExpression into three, Known,Local,Argument

The decision which to use can be made higher up, in ruby, and so it
should.
This commit is contained in:
Torsten Ruger
2017-01-16 09:33:49 +02:00
parent 96f19d18c0
commit 5f7ea08a43
6 changed files with 47 additions and 21 deletions

View File

@ -4,7 +4,7 @@ module Register
module CompileHelper
def self_and_int_arg(compiler , source)
me = compiler.process( Vm::Tree::NameExpression.new( :self) )
me = compiler.process( Vm::Tree::KnownName.new( :self) )
int_arg = load_int_arg_at(compiler , source , 1 )
return me , int_arg
end

View File

@ -18,9 +18,9 @@ module Register
def div10 context
s = "div_10"
compiler = Vm::MethodCompiler.new.create_method(:Integer,:div10 ).init_method
me = compiler.process( Vm::Tree::NameExpression.new( :self) )
tmp = compiler.process( Vm::Tree::NameExpression.new( :self) )
q = compiler.process( Vm::Tree::NameExpression.new( :self) )
me = compiler.process( Vm::Tree::KnownName.new( :self) )
tmp = compiler.process( Vm::Tree::KnownName.new( :self) )
q = compiler.process( Vm::Tree::KnownName.new( :self) )
const = compiler.process( Vm::Tree::IntegerExpression.new(1) )
# int tmp = self >> 1
compiler.add_code Register.op( s , ">>" , tmp , const)