RoseTranslateTypes.Mesa
Last Edited by: Spreitzer, July 9, 1983 5:26 pm
Last Edited by: Barth, March 8, 1983 10:43 am
DIRECTORY
OrderedSymbolTableRef, Rope, TextNode;
RoseTranslateTypes: CEDAR DEFINITIONS =
BEGIN
Familiar Types:
LORA: TYPE = LIST OF REF ANY;
ROPE: TYPE = Rope.ROPE;
SymbolTable: TYPE = OrderedSymbolTableRef.Table;
Parse Tree Types:
SymbolTableEntry: TYPE = REF SymbolTableEntryRep;
SymbolTableEntryRep: TYPE = RECORD [
name: ROPE,
value: SELECT type: SymbolTableEntryType FROM
signalTypeConstructor => [stc: SignalTypeConstructor],
cellClass => [
definedIn: ROPE,
cd: CellDef],
node => [signalType: SignalType],
ENDCASE];
SymbolTableEntryType: TYPE = {signalTypeConstructor, cellClass, node};
stcEntry: TYPE = REF SymbolTableEntryRep[signalTypeConstructor];
ccEntry: TYPE = REF SymbolTableEntryRep[cellClass];
nodeEntry: TYPE = REF SymbolTableEntryRep[node];
DigestedInterface: TYPE = REF DigestedInterfaceRep;
DigestedInterfaceRep: TYPE = RECORD [
asTable: SymbolTable,
asList: InterfaceEltList];
InterfaceEltList: TYPE = LIST OF InterfaceElt;
InterfaceElt: TYPE = REF InterfaceEltRep;
InterfaceEltRep: TYPE = RECORD [
name: ROPE,
sti: SignalTypeInvocation,
input, output, spare: BOOLEANFALSE];
Invocation: TYPE = RECORD [
name: ROPE,
parms: REF ANY--UNION [BindingList, Args]
];
SignalTypeInvocation: TYPE = REF SignalTypeInvocationRep;
SignalTypeInvocationRep: TYPE = RECORD [
st: SignalType,
invocation: Invocation];
Application: TYPE = REF ApplicationRep;
ApplicationRep: TYPE = RECORD [
fn: ROPE,
args: REF ANY, --UNION [BindingList, Args]
initData: ROPENIL];
Args: TYPE = REF ArgsRep;
ArgsRep: TYPE = RECORD [
args: LIST OF Arg];
Arg: TYPE = REF ANY; --UNION [ROPE, Quoted, REF INT]
CellDef: TYPE = REF CellDefRep;
CellDefRep: TYPE = RECORD [
interface: DigestedInterface ← NIL,
stateInittable: BOOLEANFALSE,
defaultInitDataGiven, initDataGiven, stateGiven, initializerGiven, evalGiven, testGiven, expandGiven, defaultInitExprGiven: BOOLFALSE,
defaultInitDataSource, initDataSource, stateSource, initializerSource, evalSource, testSource: CedarSource ← NIL,
expandCode: Statements ← NIL,
defaultInitExpr: ROPENIL,
portCount: CARDINAL ← 0];
CedarSource: TYPE = REF CedarSourceRep;
CedarSourceRep: TYPE = RECORD [parent: TextNode.Ref];
CedarLiteral: TYPE = REF CedarLiteralRep;
CedarLiteralRep: TYPE = RECORD [cedar: ROPE];
BindingList: TYPE = LIST OF Binding;
Binding: TYPE = REF BindingRep;
BindingRep: TYPE = RECORD [
name: ROPE,
value: REF ANY];
Quoted: TYPE = REF QuotedRep;
QuotedRep: TYPE = RECORD [rope: ROPE];
Statements: TYPE = REF StatementsRep;
StatementsRep: TYPE = RECORD [
statements: LORA];
SquareBracketed: TYPE = REF SquareBracketedRep;
SquareBracketedRep: TYPE = RECORD [iel: InterfaceEltList];
Vars:
error, ignoreMe: REF ANY;
Defining Signal Types:
SignalTypeConstructor: TYPE = PROC [parms: REF ANY --UNION [BindingList, Args]--]
RETURNS [type: SignalType];
--ERRORS TypeConstructionError[msg: ROPE]
TypeConstructionError: ERROR [msg: ROPE];
GetParm: PROC [n: [1..LAST[INTEGER]], name: ROPE, parms: REF ANY, default: REF ANY ← noDefault] RETURNS [it: REF ANY];
noDefault: REF ANY;
SignalType: TYPE = REF SignalTypeRep;
SignalTypeRep: TYPE = RECORD [
procs: SignalTypeProcs,
data: REF ANY
];
SignalTypeProcs: TYPE = REF SignalTypeProcsRep;
SignalTypeProcsRep: TYPE = RECORD [
Info: PROC [data: REF ANY] RETURNS [bitWidth: INT, roseType, mesaType: ROPE],
Describe: PROC [data: REF ANY] RETURNS [description: ROPE --suitable for printing to users--],
Cannonize: PROC [data: REF ANY] RETURNS [cannonized: REF ANY],
MesaTypeDecl: PROC [data: REF ANY] RETURNS [mesaTypeDecl: ROPE]];
RegisterSignalTypeConstructor: PROC [name: ROPE, stc: SignalTypeConstructor];
SetDefaultSignalType: PROC [st: SignalType];
END.