remove unknown type

This commit is contained in:
Torsten Ruger
2015-09-23 18:35:37 +03:00
parent 4b613fb632
commit 9fe01c7b31
15 changed files with 49 additions and 38 deletions

View File

@ -4,7 +4,7 @@ module Register
module Integer
module ClassMethods
def plus c
plus_function = Virtual::MethodSource.create_method(:Integer,:plus , [:Integer] )
plus_function = Virtual::MethodSource.create_method(:Integer,:int,:plus , [:Integer] )
plus_function.source.return_type = Virtual::Integer
plus_function.source.receiver = Virtual::Integer
@ -43,7 +43,7 @@ module Register
# end
def putint context
putint_function = Virtual::MethodSource.create_method(:Integer,:putint , [] )
putint_function = Virtual::MethodSource.create_method(:Integer,:int,:putint , [] )
putint_function.source.return_type = Virtual::Integer
putint_function.source.receiver = Virtual::Integer
return putint_function
@ -72,7 +72,7 @@ module Register
# a hand coded version of the fibonachi numbers
# not my hand off course, found in the net http://www.peter-cockerell.net/aalp/html/ch-5.html
def fibo context
fibo_function = Virtual::MethodSource.create_method(:Integer,:fibo , [] )
fibo_function = Virtual::MethodSource.create_method(:Integer,:int,:fibo , [] )
fibo_function.source.return_type = Virtual::Integer
fibo_function.source.receiver = Virtual::Integer
return fibo_function

View File

@ -6,7 +6,7 @@ module Register
# it isn't really a function, ie it is jumped to (not called), exits and may not return
# so it is responsible for initial setup
def __init__ context
function = Virtual::MethodSource.create_method(:Kernel,:__init__ , [])
function = Virtual::MethodSource.create_method(:Kernel,:int,:__init__ , [])
function.source.return_type = Virtual::Integer
# no method enter or return (automatically added), remove
function.source.blocks.first.codes.pop # no Method enter
@ -25,7 +25,7 @@ module Register
return function
end
def exit context
function = Virtual::MethodSource.create_method(:Kernel,:exit , [])
function = Virtual::MethodSource.create_method(:Kernel,:int,:exit , [])
function.source.return_type = Virtual::Integer
return function
ret = Virtual::RegisterMachine.instance.exit(function)
@ -33,7 +33,7 @@ module Register
function
end
def __send context
function = Virtual::MethodSource.create_method(:Kernel ,:__send , [] )
function = Virtual::MethodSource.create_method(:Kernel,:int ,:__send , [] )
function.source.return_type = Virtual::Integer
return function
end

View File

@ -6,7 +6,7 @@ module Register
# main entry point, ie __init__ calls this
# defined here as empty, to be redefined
def main context
function = Virtual::MethodSource.create_method(:Object,:main , [])
function = Virtual::MethodSource.create_method(:Object, :int , :main , [])
return function
end
@ -18,7 +18,7 @@ module Register
# The at_index is just "below" the api, something we need but don't want to expose,
# so we can't code the above in ruby
def _get_instance_variable context , name = Virtual::Integer
get_function = Virtual::MethodSource.create_method(:Object,:_get_instance_variable , [ ] )
get_function = Virtual::MethodSource.create_method(:Object,:int, :_get_instance_variable , [ ] )
return get_function
# me = get_function.receiver
# var_name = get_function.args.first
@ -39,7 +39,7 @@ module Register
end
def _set_instance_variable(context , name = Virtual::Integer , value = Virtual::Integer )
set_function = Virtual::MethodSource.create_method(:Object,:_set_instance_variable ,[] )
set_function = Virtual::MethodSource.create_method(:Object,:int,:_set_instance_variable ,[] )
return set_function
# receiver set_function
# me = set_function.receiver

View File

@ -3,7 +3,7 @@ module Register
module Word
module ClassMethods
def putstring context
function = Virtual::MethodSource.create_method(:Word , :putstring , [] )
function = Virtual::MethodSource.create_method(:Word,:int , :putstring , [] )
Kernel.emit_syscall( function , :putstring )
function
end