DIRECTORY
	ThreeC4BaseDecl1Def,
	Rope,
	ThreeC4MiscAbGramDef,
	ThreeC4Support,
	ThreeC4BaseDecl2Def,
	ThreeC4BasicAbTypesDef;

ThreeC4MiscImplImpl: CEDAR PROGRAM IMPORTS ThreeC4BaseDecl1Def, ThreeC4Support, ThreeC4BaseDecl2Def, ThreeC4BasicAbTypesDef EXPORTS ThreeC4MiscAbGramDef= 
BEGIN
OPEN ThreeC4BaseDecl1Def, Rope, ThreeC4MiscAbGramDef, ThreeC4Support, ThreeC4BaseDecl2Def, ThreeC4BasicAbTypesDef;
ModIdoneIdProdFormTypeEarly: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: TypeNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdoneIdProdData ← NARROW[tree.data];
temp0 ← FindType[context, BuildName[treeData.Identifier]];
END
END;

ModIdoneIdProdFormTypeUse: PUBLIC PROC[ref: REF ANY, usage: UsageNode, context: LookupContextNode] RETURNS[temp0: UsageNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdoneIdProdData ← NARROW[tree.data];
temp0 ← RecordTypeUse[usage, LookUpType[context, BuildName[treeData.Identifier]]];
END
END;

ModIdoneIdProdFormExpCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode, usage: UsageNode] RETURNS[temp0: MesaCodeNode, temp1: TypeNode, temp2: UsageNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdoneIdProdData ← NARROW[tree.data];
BEGIN
code: MesaCodeNode;
type1: TypeNode;
check: BOOLEAN;
type: TypeNode;
name: NameNode;
name ← tree.procs.FormName[tree];
type ← LookUpRightSideSymbol[context, name];
check ← BPrintBadName[FoundType[type], name, "undefined or out of context -- expected RightSideSymbol"];
IF FoundType[type] THEN {type1 ← type;
} ELSE {type1 ← BuildErrorType[];
};
code ← RopeCode1["%g", NameFill[name]];
temp2 ← FakeUsageCopy[usage];
temp1 ← type1;
temp0 ← code;
END;
END
END;

ModIdoneIdProdFormValueInfo: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: TypeNode, temp1: MesaCodeNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdoneIdProdData ← NARROW[tree.data];
[temp0, temp1] ← LookUpSimpleValue[context, treeData.Identifier];
END
END;

ModIdoneIdProdFormType: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: TypeNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdoneIdProdData ← NARROW[tree.data];
temp0 ← LookUpType[context, BuildName[treeData.Identifier]];
END
END;

ModIdoneIdProdFormFirstId: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: IdentifierNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdoneIdProdData ← NARROW[tree.data];
temp0 ← treeData.Identifier;
END
END;

ModIdoneIdProdFormName: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: NameNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdoneIdProdData ← NARROW[tree.data];
temp0 ← BuildName[treeData.Identifier];
END
END;

ModIdtwoIdsProdFormTypeEarly: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: TypeNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdtwoIdsProdData ← NARROW[tree.data];
temp0 ← FindType[context, BuildName[treeData.Identifierleft]];
END
END;

ModIdtwoIdsProdFormTypeUse: PUBLIC PROC[ref: REF ANY, usage: UsageNode, context: LookupContextNode] RETURNS[temp0: UsageNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdtwoIdsProdData ← NARROW[tree.data];
temp0 ← RecordTypeUse[usage, LookUpType[context, BuildName[treeData.Identifierleft]]];
END
END;

ModIdtwoIdsProdFormExpCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode, usage: UsageNode] RETURNS[temp0: MesaCodeNode, temp1: TypeNode, temp2: UsageNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdtwoIdsProdData ← NARROW[tree.data];
BEGIN
type1: TypeNode;
name1: NameNode;
name1 ← tree.procs.FormName[tree];
type1 ← LookUpRightSideSymbol[context, name1];
IF FoundType[type1] THEN {temp2 ← FakeUsageCopy[usage];
temp1 ← type1;
temp0 ← RopeCode1["%g", NameFill[name1]];
} ELSE {BEGIN
use2: UsageNode;
type2: TypeNode;
code2: MesaCodeNode;
[type2, code2] ← LookUpEnumTypeVal[context, BuildName[treeData.Identifierleft], BuildName[treeData.Identifierright]];
use2 ← RecordTypeUse[usage, type2];
temp2 ← use2;
temp1 ← type2;
temp0 ← code2;
END;
};
END;
END
END;

ModIdtwoIdsProdFormValueInfo: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: TypeNode, temp1: MesaCodeNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdtwoIdsProdData ← NARROW[tree.data];
[temp0, temp1] ← LookUpValue2[context, treeData.Identifierleft, treeData.Identifierright];
END
END;

ModIdtwoIdsProdFormType: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: TypeNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdtwoIdsProdData ← NARROW[tree.data];
temp0 ← LookUpType[context, BuildName[treeData.Identifierleft]];
END
END;

ModIdtwoIdsProdFormFirstId: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: IdentifierNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdtwoIdsProdData ← NARROW[tree.data];
temp0 ← treeData.Identifierleft;
END
END;

ModIdtwoIdsProdFormName: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: NameNode] =
BEGIN
tree: ModIdNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdtwoIdsProdData ← NARROW[tree.data];
temp0 ← BuildName2[treeData.Identifierleft, treeData.Identifierright];
END
END;

ModIdListEmptyProdFormTypesCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode, usage: UsageNode] RETURNS[temp0: MesaCodeNode, temp1: UsageNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp1 ← FakeUsageCopy[usage];
temp0 ← BuildEmptyCode[];
END
END;

ModIdListEmptyProdFormTypeListEarly: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: TypeListNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← BuildEmptyTypeList[];
END
END;

ModIdListEmptyProdProdBuildDataRcdCode: PUBLIC PROC[ref: REF ANY, typeNameCode: MesaCodeNode, prodNameCode: MesaCodeNode] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← BuildErrorCode["GetRidOf ProdBuildDataRcdCode as it is never used"];
END
END;

ModIdListEmptyProdDataBodyFieldTypeCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← BuildEmptyCode[];
END
END;

ModIdListEmptyProdProdDataTypeDefCode: PUBLIC PROC[ref: REF ANY, prodNameCode: MesaCodeNode, context: LookupContextNode] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← BuildErrorCode["GetRidOf ProdDataTypeDefCode as it is never used"];
END
END;

ModIdListEmptyProdFormTypeUse: PUBLIC PROC[ref: REF ANY, usage: UsageNode, context: LookupContextNode] RETURNS[temp0: UsageNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← FakeUsageCopy[usage];
END
END;

ModIdListEmptyProdFormAbstRightSideContext: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← FakeCopyContextForConditional[context];
END
END;

ModIdListEmptyProdFormTypeList: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: TypeListNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← BuildEmptyTypeList[];
END
END;

ModIdListEmptyProdFormNameList: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: NameListNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← BuildEmptyNameList[];
END
END;

ModIdListManyProdFormTypesCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode, usage: UsageNode] RETURNS[temp0: MesaCodeNode, temp1: UsageNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdListManyProdData ← NARROW[tree.data];
BEGIN
code: MesaCodeNode;
temp2: BOOLEAN;
use: UsageNode;
type: TypeNode;
listCode: MesaCodeNode;
use1: UsageNode;
[listCode, use1] ← treeData.ModIdList.procs.FormTypesCode[treeData.ModIdList, context, usage];
type ← treeData.ModId.procs.FormType[treeData.ModId, context];
use ← RecordTypeUse[use1, type];
IF temp2 ← TestEmptyCode[listCode] THEN { NULL;
} ELSE {NULL;
};
code ← ConcatCode2[(IF temp2 THEN BuildEmptyCode[] ELSE RopeCode1["%g, ", CodeFill[listCode]]), GetTypeCodeName[type]];
temp1 ← use;
temp0 ← code;
END;
END
END;

ModIdListManyProdFormTypeListEarly: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: TypeListNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdListManyProdData ← NARROW[tree.data];
temp0 ← AppendToTypeList[treeData.ModIdList.procs.FormTypeListEarly[treeData.ModIdList, context], treeData.ModId.procs.FormTypeEarly[treeData.ModId, context]];
END
END;

ModIdListManyProdProdBuildDataRcdCode: PUBLIC PROC[ref: REF ANY, typeNameCode: MesaCodeNode, prodNameCode: MesaCodeNode] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdListManyProdData ← NARROW[tree.data];
temp0 ← BuildErrorCode["GetRidOf ProdBuildDataRcdCode as it is never used"];
END
END;

ModIdListManyProdDataBodyFieldTypeCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdListManyProdData ← NARROW[tree.data];
BEGIN
names: NameListNode;
types: TypeListNode;
types ← tree.procs.FormTypeList[tree, context];
names ← tree.procs.FormNameList[tree];
temp0 ← RopeCode1[", %g", CodeFill[BuildArgNameTypeCode[names, types]]];
END;
END
END;

ModIdListManyProdProdDataTypeDefCode: PUBLIC PROC[ref: REF ANY, prodNameCode: MesaCodeNode, context: LookupContextNode] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdListManyProdData ← NARROW[tree.data];
temp0 ← BuildErrorCode["GetRidOf ProdDataTypeDefCode as it is never used"];
END
END;

ModIdListManyProdFormTypeUse: PUBLIC PROC[ref: REF ANY, usage: UsageNode, context: LookupContextNode] RETURNS[temp0: UsageNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdListManyProdData ← NARROW[tree.data];
temp0 ← treeData.ModId.procs.FormTypeUse[treeData.ModId, treeData.ModIdList.procs.FormTypeUse[treeData.ModIdList, usage, context], context];
END
END;

ModIdListManyProdFormAbstRightSideContext: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdListManyProdData ← NARROW[tree.data];
temp0 ← RecordAbstRightSideSymbol[treeData.ModIdList.procs.FormAbstRightSideContext[treeData.ModIdList, context], treeData.ModId.procs.FormName[treeData.ModId], BuildName[treeData.ModId.procs.FormFirstId[treeData.ModId]]];
END
END;

ModIdListManyProdFormTypeList: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: TypeListNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdListManyProdData ← NARROW[tree.data];
temp0 ← AppendToTypeList[treeData.ModIdList.procs.FormTypeList[treeData.ModIdList, context], treeData.ModId.procs.FormType[treeData.ModId, context]];
END
END;

ModIdListManyProdFormNameList: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: NameListNode] =
BEGIN
tree: ModIdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ModIdListManyProdData ← NARROW[tree.data];
temp0 ← AppendToNameList[treeData.ModIdList.procs.FormNameList[treeData.ModIdList], treeData.ModId.procs.FormName[treeData.ModId]];
END
END;

IdListEmptyProdSyntaxFileCodes: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: MesaCodeNode, temp1: MesaCodeNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp1 ← BuildEmptyCode[];
temp0 ← BuildEmptyCode[];
END
END;

IdListEmptyProdFormLinkCallCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode, usage: UsageNode] RETURNS[temp0: MesaCodeNode, temp1: UsageNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp1 ← FakeUsageCopy[usage];
temp0 ← BuildEmptyCode[];
END
END;

IdListEmptyProdFormVarDeclCode: PUBLIC PROC[ref: REF ANY, types: TypeListNode] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← BuildEmptyCode[];
END
END;

IdListEmptyProdFormRecFcnsDeclCode: PUBLIC PROC[ref: REF ANY, prodNameCode: MesaCodeNode, context: LookupContextNode, usage: UsageNode] RETURNS[temp0: MesaCodeNode, temp1: UsageNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp1 ← FakeUsageCopy[usage];
temp0 ← BuildEmptyCode[];
END
END;

IdListEmptyProdFormTypesCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode, usage: UsageNode] RETURNS[temp0: MesaCodeNode, temp1: UsageNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp1 ← FakeUsageCopy[usage];
temp0 ← BuildEmptyCode[];
END
END;

IdListEmptyProdFormProcsNamesCode: PUBLIC PROC[ref: REF ANY, prodNameCode: MesaCodeNode] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← BuildEmptyCode[];
END
END;

IdListEmptyProdBaseDeclCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← BuildEmptyCode[];
END
END;

IdListEmptyProdProcFieldTypeCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode, usage: UsageNode] RETURNS[temp0: MesaCodeNode, temp1: UsageNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp1 ← FakeUsageCopy[usage];
temp0 ← BuildEmptyCode[];
END
END;

IdListEmptyProdRecordMultipleBaseTypes: PUBLIC PROC[ref: REF ANY, file: ROPE, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← FakeCopyContextForConditional[context];
END
END;

IdListEmptyProdCollectRightSideSymbols: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← FakeCopyContextForConditional[context];
END
END;

IdListEmptyProdCollectFunctionTypes: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← FakeCopyContextForConditional[context];
END
END;

IdListEmptyProdCollectValueTypes: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← FakeCopyContextForConditional[context];
END
END;

IdListEmptyProdFormNameList: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: NameListNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← BuildEmptyNameList[];
END
END;

IdListEmptyProdFormTypeListEarly: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: TypeListNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← BuildEmptyTypeList[];
END
END;

IdListEmptyProdRecordCedarTypes: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← FakeCopyContextForConditional[context];
END
END;

IdListEmptyProdRecordCedarTypesFrom: PUBLIC PROC[ref: REF ANY, defFileName: ROPE, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← FakeCopyContextForConditional[context];
END
END;

IdListnonEmptyProdSyntaxFileCodes: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: MesaCodeNode, temp1: MesaCodeNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
BEGIN
temp4: MesaCodeNode;
temp5: MesaCodeNode;
temp2: MesaCodeNode;
temp3: MesaCodeNode;
fileTree: WholeFileNode;
fileTree ← LookUpParseTree[context, BuildName[treeData.Identifier]];
[temp4, temp5] ← treeData.IdList.procs.SyntaxFileCodes[treeData.IdList, context];
[temp2, temp3] ← fileTree.procs.SyntaxFileCodes[fileTree, context];
[temp0, temp1] ← ConcatCodePairs2[temp2, temp3, temp4, temp5];
END;
END
END;

IdListnonEmptyProdFormLinkCallCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode, usage: UsageNode] RETURNS[temp0: MesaCodeNode, temp1: UsageNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
BEGIN
manyCode: MesaCodeNode;
use2: UsageNode;
oneCode: MesaCodeNode;
use1: UsageNode;
fileTree: WholeFileNode;
fileTree ← LookUpParseTree[context, BuildName[treeData.Identifier]];
[oneCode, use1] ← fileTree.procs.FormLinkCallCode[fileTree, context, usage];
[manyCode, use2] ← treeData.IdList.procs.FormLinkCallCode[treeData.IdList, context, use1];
temp1 ← use2;
temp0 ← ConcatCode2[oneCode, manyCode];
END;
END
END;

IdListnonEmptyProdFormVarDeclCode: PUBLIC PROC[ref: REF ANY, types: TypeListNode] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
BEGIN
firstType: TypeNode;
restTypes: TypeListNode;
[firstType, restTypes] ← PartitionFirstType[types];
temp0 ← ConcatCode2[RopeCode2["%g: %g;\N", IdFill[treeData.Identifier], CodeFill[GetTypeCodeName[firstType]]], treeData.IdList.procs.FormVarDeclCode[treeData.IdList, restTypes]];
END;
END
END;

IdListnonEmptyProdFormRecFcnsDeclCode: PUBLIC PROC[ref: REF ANY, prodNameCode: MesaCodeNode, context: LookupContextNode, usage: UsageNode] RETURNS[temp0: MesaCodeNode, temp1: UsageNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
BEGIN
code: MesaCodeNode;
use: UsageNode;
idListCode: MesaCodeNode;
use1: UsageNode;
[idListCode, use1] ← treeData.IdList.procs.FormRecFcnsDeclCode[treeData.IdList, prodNameCode, context, usage];
use ← RecordFcnUse[use1, BuildName[treeData.Identifier], Use.ref, context];
code ← ConcatCode2[RopeCode3["%g%g: %gProcType;\N", CodeFill[prodNameCode], IdFill[treeData.Identifier], IdFill[treeData.Identifier]], idListCode];
temp1 ← use;
temp0 ← code;
END;
END
END;

IdListnonEmptyProdFormTypesCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode, usage: UsageNode] RETURNS[temp0: MesaCodeNode, temp1: UsageNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
BEGIN
code: MesaCodeNode;
temp2: BOOLEAN;
use: UsageNode;
type: TypeNode;
idListCode: MesaCodeNode;
use1: UsageNode;
[idListCode, use1] ← treeData.IdList.procs.FormTypesCode[treeData.IdList, context, usage];
type ← LookUpType[context, BuildName[treeData.Identifier]];
use ← RecordTypeUse[use1, type];
IF temp2 ← TestEmptyCode[idListCode] THEN { NULL;
} ELSE {NULL;
};
code ← ConcatCode2[GetTypeCodeName[type], (IF temp2 THEN BuildEmptyCode[] ELSE RopeCode1[", %g", CodeFill[idListCode]])];
temp1 ← use;
temp0 ← code;
END;
END
END;

IdListnonEmptyProdFormProcsNamesCode: PUBLIC PROC[ref: REF ANY, prodNameCode: MesaCodeNode] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
BEGIN
temp1: BOOLEAN;
idListCode: MesaCodeNode;
idListCode ← treeData.IdList.procs.FormProcsNamesCode[treeData.IdList, prodNameCode];
IF temp1 ← TestEmptyCode[idListCode] THEN { NULL;
} ELSE {NULL;
};
temp0 ← ConcatCode2[RopeCode2["%g%g", CodeFill[prodNameCode], IdFill[treeData.Identifier]], (IF temp1 THEN BuildEmptyCode[] ELSE RopeCode1[", %g", CodeFill[idListCode]])];
END;
END
END;

IdListnonEmptyProdBaseDeclCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
BEGIN
codeName: MesaCodeNode;
codeName ← GetTypeCodeName[LookUpType[context, BuildName[treeData.Identifier]]];
temp0 ← ConcatCode2[ConcatCode2[RopeCode2["%g: TYPE = REF %gBody;\N", CodeFill[codeName], CodeFill[codeName]], RopeCode1["%gBody: TYPE;\N\N", CodeFill[codeName]]], treeData.IdList.procs.BaseDeclCode[treeData.IdList, context]];
END;
END
END;

IdListnonEmptyProdProcFieldTypeCode: PUBLIC PROC[ref: REF ANY, context: LookupContextNode, usage: UsageNode] RETURNS[temp0: MesaCodeNode, temp1: UsageNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
BEGIN
code: MesaCodeNode;
use: UsageNode;
tailCode: MesaCodeNode;
idListCode: MesaCodeNode;
use1: UsageNode;
[idListCode, use1] ← treeData.IdList.procs.ProcFieldTypeCode[treeData.IdList, context, usage];
IF TestEmptyCode[idListCode] THEN {tailCode ← BuildEmptyCode[];
} ELSE {tailCode ← ConcatCode2[RopeCode[", "], idListCode];
};
use ← RecordFcnUse[use1, BuildName[treeData.Identifier], Use.ref, context];
code ← ConcatCode2[RopeCode2["\N\T%g: %gProcType", IdFill[treeData.Identifier], IdFill[treeData.Identifier]], tailCode];
temp1 ← use;
temp0 ← code;
END;
END
END;

IdListnonEmptyProdRecordMultipleBaseTypes: PUBLIC PROC[ref: REF ANY, file: ROPE, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
BEGIN
name: NameNode;
codeName: MesaCodeNode;
context1: ContextNode;
context1 ← treeData.IdList.procs.RecordMultipleBaseTypes[treeData.IdList, file, context];
codeName ← RopeCode1["%gNode", IdFill[treeData.Identifier]];
name ← BuildName[treeData.Identifier];
temp0 ← RecordSimpleBaseType[context1, name, file, codeName];
END;
END
END;

IdListnonEmptyProdCollectRightSideSymbols: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
BEGIN
fileTree: WholeFileNode;
context1: ContextNode;
context1 ← treeData.IdList.procs.CollectRightSideSymbols[treeData.IdList, context];
fileTree ← FindParseTree[context1, BuildName[treeData.Identifier]];
temp0 ← fileTree.procs.CollectRightSideSymbols[fileTree, context1];
END;
END
END;

IdListnonEmptyProdCollectFunctionTypes: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
BEGIN
fileTree: WholeFileNode;
context1: ContextNode;
context1 ← treeData.IdList.procs.CollectFunctionTypes[treeData.IdList, context];
fileTree ← FindParseTree[context1, BuildName[treeData.Identifier]];
temp0 ← fileTree.procs.CollectFunctionTypes[fileTree, context1];
END;
END
END;

IdListnonEmptyProdCollectValueTypes: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
BEGIN
context2: ContextNode;
fileTree: WholeFileNode;
context1: ContextNode;
context1 ← treeData.IdList.procs.CollectValueTypes[treeData.IdList, context];
[context2, fileTree] ← FindOrReadAndParseTree[context1, BuildName[treeData.Identifier]];
temp0 ← fileTree.procs.CollectValueTypes[fileTree, context2];
END;
END
END;

IdListnonEmptyProdFormNameList: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: NameListNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
temp0 ← PrefixToNameList[BuildName[treeData.Identifier], treeData.IdList.procs.FormNameList[treeData.IdList]];
END
END;

IdListnonEmptyProdFormTypeListEarly: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: TypeListNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
temp0 ← PrefixToTypeList[FindType[context, BuildName[treeData.Identifier]], treeData.IdList.procs.FormTypeListEarly[treeData.IdList, context]];
END
END;

IdListnonEmptyProdRecordCedarTypes: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
temp1: ContextNode;
BEGIN
codeName: MesaCodeNode;
codeName ← RopeCode1["%g", IdFill[treeData.Identifier]];
temp1 ← RecordPreDefinedCedarType[context, BuildName[treeData.Identifier], codeName];
END;
temp0 ← treeData.IdList.procs.RecordCedarTypes[treeData.IdList, temp1];
END
END;

IdListnonEmptyProdRecordCedarTypesFrom: PUBLIC PROC[ref: REF ANY, defFileName: ROPE, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: IdListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: IdListnonEmptyProdData ← NARROW[tree.data];
temp1: ContextNode;
BEGIN
codeName: MesaCodeNode;
codeName ← RopeCode1["%g", IdFill[treeData.Identifier]];
temp1 ← RecordCedarType[context, BuildName[treeData.Identifier], defFileName, codeName];
END;
temp0 ← treeData.IdList.procs.RecordCedarTypesFrom[treeData.IdList, defFileName, temp1];
END
END;

RopeListOneProdSpecialSyntaxTokenFileCode: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: RopeListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: RopeListOneProdData ← NARROW[tree.data];
IF EqualRopes[";", RopeFromRopeNode[treeData.Rope]] THEN {temp0 ← RopeCode["SpelledTerminals: semiColon ; ;\N"];
} ELSE {temp0 ← BuildEmptyCode[];
};
END
END;

RopeListOneProdSyntaxFileCodes: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: MesaCodeNode, temp1: MesaCodeNode] =
BEGIN
tree: RopeListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: RopeListOneProdData ← NARROW[tree.data];
BEGIN
tkn: MesaCodeNode;
tkn ← RopeCode1["\"%g\"", CodeFill[RopeCode[RopeFromRopeNode[treeData.Rope]]]];
temp1 ← BuildEmptyCode[];
temp0 ← tkn;
END;
END
END;

RopeListOneProdCollectRightSideSymbols: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: RopeListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: RopeListOneProdData ← NARROW[tree.data];
temp0 ← RecordRopeToken[context, treeData.Rope];
END
END;

RopeListManyProdSpecialSyntaxTokenFileCode: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: MesaCodeNode] =
BEGIN
tree: RopeListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: RopeListManyProdData ← NARROW[tree.data];
temp1: BOOLEAN;
IF temp1 ← EqualRopes[";", RopeFromRopeNode[treeData.Rope]] THEN { NULL;
} ELSE {NULL;
};
temp0 ← ConcatCode2[treeData.RopeList.procs.SpecialSyntaxTokenFileCode[treeData.RopeList], (IF temp1 THEN RopeCode["SpelledTerminals: semiColon ; ;\N"] ELSE BuildEmptyCode[])];
END
END;

RopeListManyProdSyntaxFileCodes: PUBLIC PROC[ref: REF ANY, context: LookupContextNode] RETURNS[temp0: MesaCodeNode, temp1: MesaCodeNode] =
BEGIN
tree: RopeListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: RopeListManyProdData ← NARROW[tree.data];
BEGIN
tkn: MesaCodeNode;
listCode: MesaCodeNode;
unused: MesaCodeNode;
[listCode, unused] ← treeData.RopeList.procs.SyntaxFileCodes[treeData.RopeList, context];
tkn ← ConcatCode3[listCode, RopeCode[" "], RopeCode1["\"%g\"", CodeFill[RopeCode[RopeFromRopeNode[treeData.Rope]]]]];
temp1 ← BuildEmptyCode[];
temp0 ← tkn;
END;
END
END;

RopeListManyProdCollectRightSideSymbols: PUBLIC PROC[ref: REF ANY, context: ContextNode] RETURNS[temp0: ContextNode] =
BEGIN
tree: RopeListNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: RopeListManyProdData ← NARROW[tree.data];
temp0 ← RecordRopeToken[treeData.RopeList.procs.CollectRightSideSymbols[treeData.RopeList, context], treeData.Rope];
END
END;

END..