SaffronMakeTypeImpl.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Generated by BJackson.pa at April 27, 1987 11:24:12 pm PDT
using ThreeCasabaFour [1.1] of April 14, 1987 6:34:07 pm PDT
DIRECTORY
CedarBaseContext,
SaffronAG6Def,
CedarBaseMisc,
CedarBaseTypeAux,
ThreeC4Support,
SaffronATDef,
CedarBaseType;
SaffronMakeTypeImpl: CEDAR PROGRAM IMPORTS CedarBaseContext, CedarBaseMisc, CedarBaseTypeAux, ThreeC4Support, CedarBaseType EXPORTS SaffronAG6Def=
BEGIN
OPEN CedarBaseContext, SaffronAG6Def, CedarBaseMisc, CedarBaseTypeAux, ThreeC4Support, SaffronATDef, CedarBaseType;
SubrangenamedProdMakeType: PUBLIC PROC[ref: REF ANY, localContext: LocalContext, ribContext: RibContext, typeGraph: TypeGraph, optTypeIndex: TypeIndex] RETURNS[temp0: TypeIndex, temp1: LocalContext, temp2: TypeGraph] =
BEGIN
tree: SubrangeNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: SubrangenamedProdData ← NARROW[tree.data];
BEGIN
typeGraph3: TypeGraph;
resultTypeIndex: TypeIndex;
newTypeNode: TypeNode;
typeNode: TypeNode;
bounds: TypeBounds;
localContext2: LocalContext;
typeGraph2: TypeGraph;
typeIndex: TypeIndex;
localContext1: LocalContext;
typeGraph1: TypeGraph;
[typeIndex, localContext1, typeGraph1] ← treeData.TypeId.procs.MakeType[treeData.TypeId, localContext, ribContext, typeGraph, UndefinedTypeIndex[]];
[typeNode, bounds, localContext2, typeGraph2] ← treeData.Interval.procs.MakeTypeInterval[treeData.Interval, typeIndex, localContext1, ribContext, typeGraph1];
newTypeNode ← BuildSubrangeType[typeNode, bounds];
[typeGraph3, resultTypeIndex] ← AddOrSetType[typeGraph2, newTypeNode, optTypeIndex];
temp2 ← typeGraph3;
temp1 ← localContext2;
temp0 ← resultTypeIndex;
END;
END
END;
TypeExpenumProdMakeType: PUBLIC PROC[ref: REF ANY, localContext: LocalContext, ribContext: RibContext, typeGraph: TypeGraph, optTypeIndex: TypeIndex] RETURNS[temp0: TypeIndex, temp1: LocalContext, temp2: TypeGraph] =
BEGIN
tree: TypeExpNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: TypeExpenumProdData ← NARROW[tree.data];
BEGIN
typeGraph2: TypeGraph;
typeIndex: TypeIndex;
typeNode: TypeNode;
typeGraph1: TypeGraph;
paint: Paint;
eltList: EltList;
eltList ← treeData.ElementList.procs.MakeEltList[treeData.ElementList];
[typeGraph1, paint] ← NewPaint[typeGraph];
typeNode ← BuildEnumType[paint, eltList];
[typeGraph2, typeIndex] ← AddOrSetType[typeGraph1, typeNode, optTypeIndex];
temp2 ← typeGraph2;
temp1 ← XLocalContext[localContext];
temp0 ← typeIndex;
END;
END
END;
TypeExprecordProdMakeType: PUBLIC PROC[ref: REF ANY, localContext: LocalContext, ribContext: RibContext, typeGraph: TypeGraph, optTypeIndex: TypeIndex] RETURNS[temp0: TypeIndex, temp1: LocalContext, temp2: TypeGraph] =
BEGIN
tree: TypeExpNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: TypeExprecordProdData ← NARROW[tree.data];
BEGIN
typeGraph2: TypeGraph;
typeIndex: TypeIndex;
typeNode: TypeNode;
fieldList: FieldList;
localContext1: LocalContext;
typeGraph1: TypeGraph;
[fieldList, localContext1, typeGraph1] ← treeData.RecList.procs.MakeFieldList[treeData.RecList, localContext, ribContext, typeGraph];
typeNode ← BuildRecordType[fieldList];
[typeGraph2, typeIndex] ← AddOrSetType[typeGraph1, typeNode, optTypeIndex];
temp2 ← typeGraph2;
temp1 ← localContext1;
temp0 ← typeIndex;
END;
END
END;
TypeExprefProdMakeType: PUBLIC PROC[ref: REF ANY, localContext: LocalContext, ribContext: RibContext, typeGraph: TypeGraph, optTypeIndex: TypeIndex] RETURNS[temp0: TypeIndex, temp1: LocalContext, temp2: TypeGraph] =
BEGIN
tree: TypeExpNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: TypeExprefProdData ← NARROW[tree.data];
BEGIN
typeGraph2: TypeGraph;
typeIndex: TypeIndex;
typeNode: TypeNode;
referentTypeIndex: TypeIndex;
localContext1: LocalContext;
typeGraph1: TypeGraph;
[referentTypeIndex, localContext1, typeGraph1] ← treeData.TypeExp.procs.MakeType[treeData.TypeExp, localContext, ribContext, typeGraph, UndefinedTypeIndex[]];
typeNode ← BuildRefType[referentTypeIndex];
[typeGraph2, typeIndex] ← AddOrSetType[typeGraph1, typeNode, optTypeIndex];
temp2 ← typeGraph2;
temp1 ← localContext1;
temp0 ← typeIndex;
END;
END
END;
TypeExpsubrangeProdMakeType: PUBLIC PROC[ref: REF ANY, localContext: LocalContext, ribContext: RibContext, typeGraph: TypeGraph, optTypeIndex: TypeIndex] RETURNS[temp0: TypeIndex, temp1: LocalContext, temp2: TypeGraph] =
BEGIN
tree: TypeExpNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: TypeExpsubrangeProdData ← NARROW[tree.data];
[temp0, temp1, temp2] ← treeData.Subrange.procs.MakeType[treeData.Subrange, localContext, ribContext, typeGraph, optTypeIndex];
END
END;
TypeExptypeidProdMakeType: PUBLIC PROC[ref: REF ANY, localContext: LocalContext, ribContext: RibContext, typeGraph: TypeGraph, optTypeIndex: TypeIndex] RETURNS[temp0: TypeIndex, temp1: LocalContext, temp2: TypeGraph] =
BEGIN
tree: TypeExpNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: TypeExptypeidProdData ← NARROW[tree.data];
[temp0, temp1, temp2] ← treeData.TypeId.procs.MakeType[treeData.TypeId, localContext, ribContext, typeGraph, optTypeIndex];
END
END;
TypeIdidProdMakeType: PUBLIC PROC[ref: REF ANY, localContext: LocalContext, ribContext: RibContext, typeGraph: TypeGraph, optTypeIndex: TypeIndex] RETURNS[temp0: TypeIndex, temp1: LocalContext, temp2: TypeGraph] =
BEGIN
tree: TypeIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: TypeIdidProdData ← NARROW[tree.data];
BEGIN
typeIndex: TypeIndex;
assert2: BOOLEAN;
assert1: BOOLEAN;
descriptor: Descriptor;
descriptor ← Lookup[ribContext, localContext, treeData.id];
assert1 ← Assert[Not[IsUndefinedDescriptor[descriptor]], "undeclared id", BotchAction.quit];
assert2 ← Assert[IsTypeDescriptor[descriptor], "type id expected", BotchAction.quit];
typeIndex ← GetType[descriptor];
IF IsUndefinedTypeIndex[optTypeIndex] THEN {temp2 ← XTypeGraph[typeGraph];
temp1 ← XLocalContext[localContext];
temp0 ← typeIndex;
} ELSE {BEGIN
typeGraph2: TypeGraph;
typeNode: TypeNode;
localContext1: LocalContext;
typeGraph1: TypeGraph;
[typeNode, localContext1, typeGraph1] ← FetchType[typeGraph, typeIndex, localContext, ribContext];
typeGraph2 ← SetType[typeGraph1, typeNode, optTypeIndex];
temp2 ← typeGraph2;
temp1 ← localContext1;
temp0 ← XTypeIndex[optTypeIndex];
END;
};
END;
END
END;
END..