rename method
This commit is contained in:
@ -29,7 +29,7 @@ module Virtual
|
||||
end
|
||||
|
||||
# following classes are stubs. currently in brainstorming mode, so anything may change anytime
|
||||
class MethodEnter < Instruction
|
||||
class MethodDefinitionEnter < Instruction
|
||||
end
|
||||
|
||||
class FrameGet < Instruction
|
||||
|
@ -52,7 +52,7 @@ end
|
||||
|
||||
require_relative "list"
|
||||
require_relative "instruction"
|
||||
require_relative "method"
|
||||
require_relative "method_definition"
|
||||
require_relative "frame"
|
||||
require_relative "value"
|
||||
require_relative "type"
|
||||
|
@ -9,15 +9,15 @@ module Virtual
|
||||
# known local variable names
|
||||
# temp variables (numbered)
|
||||
#
|
||||
class Method < Virtual::Object
|
||||
class MethodDefinition < Virtual::Object
|
||||
#return the main function (the top level) into which code is compiled
|
||||
def Method.main
|
||||
Method.new(:main , [] , Virtual::SelfReference )
|
||||
def MethodDefinition.main
|
||||
MethodDefinition.new(:main , [] , Virtual::SelfReference )
|
||||
end
|
||||
def attributes
|
||||
[:name , :args , :receiver , :return_type , :start]
|
||||
end
|
||||
def initialize name , args , receiver = Virtual::SelfReference.new , return_type = Virtual::Mystery , start = MethodEnter.new
|
||||
def initialize name , args , receiver = Virtual::SelfReference.new , return_type = Virtual::Mystery , start = MethodDefinitionEnter.new
|
||||
@name = name.to_sym
|
||||
@args = args
|
||||
@locals = []
|
Reference in New Issue
Block a user