start on class compiler

idea is to get cleaner layer seperation
reduce machine and rework builtin boot
This commit is contained in:
Torsten Ruger
2018-06-30 19:20:17 +03:00
parent 4a7cc72732
commit daf1b56062
11 changed files with 51 additions and 12 deletions

View File

@ -20,6 +20,7 @@ module Parfait
raise "args_type must be type" unless args_type.is_a?(Parfait::Type)
raise "frame_type must be type" unless frame_type.is_a?(Parfait::Type)
raise "source must be vool" unless source.is_a?(Vool::Statement)
raise "Empty bod" if(source.is_a?(Vool::Statements) and source.empty?)
end
def create_typed_method( type )
@ -27,6 +28,11 @@ module Parfait
type.create_method( @name , @args_type , @frame_type)
end
def compile_to_mom(for_type)
typed_method = create_typed_method(for_type)
source.to_mom( typed_method )
end
def compile_to_risc(for_type)
typed_method = create_typed_method(for_type)
head = source.to_mom( typed_method )