rename method

This commit is contained in:
Torsten Ruger
2014-07-16 19:24:41 +03:00
parent 55cb6bd2d6
commit 1ff7ae2b0a
13 changed files with 45 additions and 45 deletions

View File

@ -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

View File

@ -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"

View File

@ -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 = []