renamed program to boot_space, as in object_space at boot time. thats the way its going
This commit is contained in:
5
lib/vm/boot_class.rb
Normal file
5
lib/vm/boot_class.rb
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
module Vm
|
||||
class BootClass
|
||||
end
|
||||
end
|
0
lib/vm/boot_memory.rb
Normal file
0
lib/vm/boot_memory.rb
Normal file
@ -5,8 +5,8 @@ require "arm/arm_machine"
|
||||
require "core/kernel"
|
||||
|
||||
module Vm
|
||||
# A Program represents an executable that we want to build
|
||||
# it has a list of functions and (global) objects
|
||||
# The BootSpace is contains all objects for a program. In functional terms it is a program, but on oo
|
||||
# it is a collection of objects, some of which are data, some classes, some functions
|
||||
|
||||
# The main entry is a function called (of all things) "main", This _must be supplied by the compling
|
||||
# There is a start and exit block that call main, which receives an array of strings
|
||||
@ -18,7 +18,7 @@ module Vm
|
||||
|
||||
# throwing in a context for unspecified use (well one is to pass the programm/globals around)
|
||||
|
||||
class Program < Code
|
||||
class BootSpace < Code
|
||||
|
||||
# Initialize with a string for cpu. Naming conventions are: for Machine XXX there exists a module XXX
|
||||
# with a XXXMachine in it that derives from Vm::RegisterMachine
|
||||
@ -44,6 +44,7 @@ module Vm
|
||||
|
||||
def add_object o
|
||||
return if @objects.include? o
|
||||
raise "must be derived from Code #{o.inspect}" unless o.is_a? Code
|
||||
@objects << o # TODO check type , no basic values allowed (must be wrapped)
|
||||
end
|
||||
|
@ -1,14 +1,14 @@
|
||||
require "support/hash_attributes"
|
||||
module Vm
|
||||
|
||||
#currently just holding the program in here so we can have global access
|
||||
#currently just holding the object_space in here so we can have global access
|
||||
class Context
|
||||
# Make hash attributes to object attributes
|
||||
include Support::HashAttributes
|
||||
|
||||
def initialize program
|
||||
def initialize object_space
|
||||
@attributes = {}
|
||||
@attributes[:program] = program
|
||||
@attributes[:object_space] = object_space
|
||||
end
|
||||
attr_reader :attributes
|
||||
end
|
||||
|
Reference in New Issue
Block a user