moving vool_method to parfait

This commit is contained in:
Torsten Ruger
2017-12-10 20:47:26 +02:00
parent b7701d0d5e
commit bc5906fb83
10 changed files with 55 additions and 28 deletions

View File

@ -31,9 +31,16 @@ module Vool
def create_objects
args_type = make_type
locals_type = make_locals
method = Vool::VoolMethod.new(name , args_type , locals_type , body )
method = Parfait::VoolMethod.new(name , args_type , locals_type , body )
@clazz.add_method( method )
# compile_methods(clazz,methods)
end
def compile_methods(clazz , methods)
methods.each do |method|
code = Passes::MethodCompiler.new(method).get_code
typed_method = method.create_parfait_method(clazz.instance_type)
Vm::MethodCompiler.new( typed_method ).init_method.process( code )
end
end
private
@ -52,23 +59,5 @@ module Vool
Parfait::NamedList.type_for( type_hash )
end
def create_methods(clazz , body)
methods = Passes::MethodCollector.new.collect(body)
methods.each do |method|
clazz.add_method( method )
normalizer = Passes::Normalizer.new(method)
method.normalize_source { |sourc| normalizer.process( sourc ) }
end
methods
end
def compile_methods(clazz , methods)
methods.each do |method|
code = Passes::MethodCompiler.new(method).get_code
typed_method = method.create_parfait_method(clazz.instance_type)
Vm::MethodCompiler.new( typed_method ).init_method.process( code )
end
end
end
end