CodeDefs:
DEFINITIONS = {
OPEN Symbols;
WordSize: NAT = 32;
PtrSize: NAT = 32;
CharSize: NAT = 8;
ProcSize: NAT = WordSize;
SignalSize: NAT = WordSize;
ProcessSize: NAT = PtrSize;
Byte: TYPE = [0..256);
bitsPerWord: NAT = 16;
OpWordCount: TYPE = CARDINAL; -- size of operands for builtins
Base: TYPE = Alloc.Base;
Limit: CARDINAL = 77777B;
z: ZONE;
NodeRep: TYPE = IntCodeDefs.NodeRep;
Node: TYPE = IntCodeDefs.Node;
NodeList: TYPE = IntCodeDefs.NodeList;
Var: TYPE = IntCodeDefs.Var;
ConstNode: TYPE = REF const NodeRep;
AllNode: TYPE = REF all NodeRep;
BlockNode: TYPE = REF block NodeRep;
DeclNode: TYPE = REF decl NodeRep;
EnableNode: TYPE = REF enable NodeRep;
AssignNode: TYPE = REF assign NodeRep;
CondNode: TYPE = REF cond NodeRep;
LabelNode: TYPE = REF label NodeRep;
GotoNode: TYPE = REF goto NodeRep;
ApplyNode: TYPE = REF apply NodeRep;
LambdaNode: TYPE = REF lambda NodeRep;
ReturnNode: TYPE = REF return NodeRep;
OperNode: TYPE = REF oper NodeRep;
MachineCodeNode: TYPE = REF machineCode NodeRep;
ModuleNode: TYPE = REF module NodeRep;
SourceNode: TYPE = REF source NodeRep;
CommentNode: TYPE = REF comment NodeRep;
LocationRep: TYPE = IntCodeDefs.LocationRep;
Location: TYPE = IntCodeDefs.Location;
SystemLocation: TYPE = REF system LocationRep;
GlobalVarLocation: TYPE = REF globalVar LocationRep;
LocalVarLocation: TYPE = REF localVar LocationRep;
RegisterLocation: TYPE = REF register LocationRep;
LinkLocation: TYPE = REF link LocationRep;
StackLocation: TYPE = REF stack LocationRep;
DerefLocation: TYPE = REF deref LocationRep;
IndexedLocation: TYPE = REF indexed LocationRep;
FieldLocation: TYPE = REF field LocationRep;
UpLevelLocation: TYPE = REF upLevel LocationRep;
CompositeLocation: TYPE = REF composite LocationRep;
CodeLocation: TYPE = REF code LocationRep;
EscapeLocation: TYPE = REF escape LocationRep;
DummyLocation: TYPE = REF dummy LocationRep;
CodeList: TYPE = REF CodeListRep;
CodeListRep: TYPE = RECORD [head, tail: NodeList ← NIL];
ArithTypeIndex: TYPE = {shortSigned, longSigned, shortUnsigned, longUnsigned, shortReal, longReal};
VLoc:
TYPE =
RECORD [disp:
INT, size: Symbols.BitCount];
RelativePC: TYPE = [0..177777B];
RelSourceLoc: TYPE = [0..7777B];
CompareClass: TYPE = {word, byte};
LabelInfoRecord:
TYPE =
RECORD [
free: BOOL ← FALSE,
thread: LabelInfoIndex,
catchLevel: [0..37777b],
body:
SELECT tag:*
FROM
named => [hti: HTIndex, cci: IntCodeDefs.Label],
loop => [exit, loop: IntCodeDefs.Label],
stmt => [retry, continue: IntCodeDefs.Label]
ENDCASE];
LabelInfoIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO LabelInfoRecord;
NamedLabelInfoIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO LabelInfoRecord.named;
LabelInfoNull: LabelInfoIndex = LabelInfoIndex.LAST;
TempAddr: TYPE = [0..PrincOps.MaxFrameSize);
TempSize: TYPE = [0..PrincOps.MaxFrameSize);
TempStateRecord:
TYPE =
RECORD[pendtemplist, heaplist: ISEIndex];
FrameStateRecord:
TYPE =
RECORD[
pendtemplist, heaplist: ISEIndex,
tempctxlvl: ContextLevel,
firstTemp, tempstart, framesz: INTEGER];
CaseCVState: TYPE = {single, singleLoaded, multi, none};
StoreOptions:
TYPE =
RECORD [
expr: BOOL ← FALSE,
init: BOOL ← FALSE,
counted: BOOL ← FALSE,
composite: BOOL ← FALSE];
ConsDestination:
TYPE =
RECORD [
ignoreSafen: BOOL ← FALSE,
cl: CodeList ← NIL,
destNode: IntCodeDefs.Node ← NIL,
options: StoreOptions ← []];
StatementStateRecord:
TYPE =
RECORD [
retLabel, comRetLabel: IntCodeDefs.Label,
outRecord: RecordSEIndex,
pendtemplist: ISEIndex,
stkPtr: UNSPECIFIED,
inlineFileLoc: SourceMap.Loc];
ChunkIndex: TYPE = Base RELATIVE POINTER [0..Limit);
codeType: Table.Selector = SymbolSegment.Tables.LAST+1;
AddressNotify, CallsNotify, ConstructorNotify, CountingNotify,
CrossJumpNotify, DJumpsNotify, ExpressionNotify, FinalNotify,
FlowNotify, FlowExpressionNotify, OutCodeNotify, PeepholeNotify,
StatementNotify, SelectionNotify, StoreNotify, TempNotify,
VarBasicsNotify, VarMoveNotify, VarUtilsNotify:
Alloc.Notifier;
}.