add FunctionCall instruction and the missing puts (stub)

This commit is contained in:
Torsten Ruger
2014-08-22 15:08:46 +03:00
parent e19b7be111
commit 91ce05364a
7 changed files with 20 additions and 5 deletions

View File

@ -34,7 +34,7 @@ module Virtual
end
# replace a code with an array of new codes. This is what happens in passes all the time
def replace_with code , new_codes
def replace code , new_codes
index = @codes.index code
raise "Code not found #{code} in #{self}" unless index
@codes.delete_at(index)

View File

@ -75,6 +75,13 @@ module Virtual
attr_reader :name , :me , :args
end
class FunctionCall < Instruction
def initialize method
@method = method
end
attr_reader :method
end
# class for Set instructions, A set is basically a mem move.
# to and from are indexes into the known objects(frame,message,self and new_message), or from may be a constant
class Set < Instruction