binary code to its own class
makes linking easier
This commit is contained in:
14
lib/parfait/binary_code.rb
Normal file
14
lib/parfait/binary_code.rb
Normal file
@ -0,0 +1,14 @@
|
||||
# A method object is a description of the method, it's name etc
|
||||
#
|
||||
# But the code that the method represents, the binary, is held as an array
|
||||
# in one of these.
|
||||
#
|
||||
# The BinaryCode is really just a name to make sure that when we call a method
|
||||
# it is really the code we call.
|
||||
|
||||
module Parfait
|
||||
# obviously not a "Word" but a ByteArray , but no such class yet
|
||||
# As on the other hand has no encoding (yet) it is close enough
|
||||
class BinaryCode < Word
|
||||
end
|
||||
end
|
@ -24,12 +24,12 @@ module Parfait
|
||||
raise "No class #{name}" unless clazz
|
||||
@for_class = clazz
|
||||
@name = name
|
||||
@code = Word.new_object 0
|
||||
@code = BinaryCode.new_object 0
|
||||
@arg_names = arg_names
|
||||
@locals = []
|
||||
@tmps = []
|
||||
end
|
||||
attr_reader :name , :arg_names , :for_class
|
||||
attr_reader :name , :arg_names , :for_class , :code
|
||||
|
||||
|
||||
# determine whether this method has a variable by the given name
|
||||
|
Reference in New Issue
Block a user