Bool.html
001| '''
001| BOOL Objects.
001|
001| A BOOL 'Cell' is a 32-bit value. BOOL Objects are made from BOOL Cells.
001|
001| A BOOL Address Space is a (large) array of BOOL Cells.
001|
001| A BOOL Module is a package of BOOL Address Spaces (NS, AS, DS).
001|
001| A BOOL Application is a package of BOOL Modules.
001|
001| A BOOL Workspace is a run time platform for BOOL Applications.
001|
001| February 2012
001| Chris@Sonnack.com
001| '''
002|
003| from datetime import datetime
004|
005|
006| class Bool (object):
007| ''' Class to hold basic BOOL Objects. '''
008|
009| class BoolMetaObjectType:
010| TypeNames = ["Object", "Message", "Model", "Actor", "Action", "Resource", "External"]
011| BoolObject = 0
012| BoolMessage = 1
013| BoolModel = 2
014| BoolActor = 3
015| BoolAction = 4
016| BoolResource = 5
017| BoolExternal = 6
018|
019| def GenerateHeader(objType):
020| return objType
021|
022|
023|
024|
025| class BoolCell (object):
026| ''' A BOOL Cell Class. '''
027| space = None
028| value = None
029|
030| def __init__(self, addrspc, offset):
031| self.space = addrspc
032| self.value = offset
033|
034| def __repr__(self):
035| return self.space.get(self.value)
036|
037| def __str__(self):
038| return str(repr(self))
039|
040| def __cmp__(self, that):
041| a = repr(self)
042| b = repr(that)
043| return cmp(a, b)
044|
045|
046|
047|
048|