DIRECTORY
	ThreeC4RecFcnDeclDef,
	ThreeC4BaseDecl1Def,
	ThreeC4BasicAbTypesDef,
	ThreeC4BaseDecl2Def;

ThreeC4CProdAbGramDef: CEDAR DEFINITIONS = 
BEGIN
OPEN ThreeC4RecFcnDeclDef, ThreeC4BaseDecl1Def, ThreeC4BasicAbTypesDef, ThreeC4BaseDecl2Def;
IntervalForm: TYPE = {closed, leftOpen, rightOpen, fullOpen};
EqualIntervalForm: PROC[IntervalForm, IntervalForm] RETURNS[BOOLEAN];

DotedNameFill: PROC[NameNode] RETURNS[CodeFillerNode];

FormBuildExpCodeProcType: TYPE = PROC[REF ANY, BOOLEAN, LookupContextNode, UsageNode] RETURNS[MesaCodeNode, TypeNode, UsageNode];

FormBuildExpListCodeProcType: TYPE = PROC[REF ANY, LookupContextNode, UsageNode] RETURNS[MesaCodeNode, TypeListNode, UsageNode];

FormBuildPositionCodeProcType: TYPE = PROC[REF ANY, BOOLEAN, LookupContextNode, UsageNode] RETURNS[MesaCodeNode, UsageNode];

FormBuildLengthCodeProcType: TYPE = PROC[REF ANY, BOOLEAN, LookupContextNode, UsageNode] RETURNS[MesaCodeNode, UsageNode];

FormIntervalBuildPositionCodeProcType: TYPE = PROC[REF ANY, BuildExpListNode, BOOLEAN, LookupContextNode, UsageNode] RETURNS[MesaCodeNode, UsageNode];

FormIntervalBuildLengthCodeProcType: TYPE = PROC[REF ANY, BuildExpListNode, BOOLEAN, LookupContextNode, UsageNode] RETURNS[MesaCodeNode, UsageNode];


-- ConcreteProductionProd

ConcreteProductionProdData: TYPE = REF ConcreteProductionProdDataBody;
ConcreteProductionProdDataBody: TYPE = RECORD[
ModId: ModIdNode, ConcreteRightSideList: ConcreteRightSideListNode, BuildExp: BuildExpNode];

ConcreteProductionProdProcs: ConcreteProductionNodeProcs;

BuildConcreteProductionProdNode: PROC[position: INT, length: INT, ModId: ModIdNode, ConcreteRightSideList: ConcreteRightSideListNode, BuildExp: BuildExpNode]
	RETURNS[ConcreteProductionNode];

ConcreteProductionProdCollectProductions: CollectProductionsProcType;
ConcreteProductionProdImplFileCode: ImplFileCodeProcType;
ConcreteProductionProdLinkFileCode: LinkFileCodeProcType;
ConcreteProductionProdSyntaxFileCodes: SyntaxFileCodesProcType;

--ConcreteRightSideList

ConcreteRightSideListNode: TYPE = REF ConcreteRightSideListNodeBody;
ConcreteRightSideListNodeBody: TYPE = RECORD[
	position: INT, length: INT,
	procs: ConcreteRightSideListNodeProcs,
	data: REF ANY];

ConcreteRightSideListNodeProcs: TYPE = REF ConcreteRightSideListNodeProcsBody;
ConcreteRightSideListNodeProcsBody: TYPE = RECORD[

	FormRightSideContext: FormRightSideContextProcType, 
	FormNameList: FormNameListProcType, 
	FormTypeList: FormTypeListProcType, 
	FormNodeVarAssignCode: FormNodeVarAssignCodeProcType, 
	SyntaxRightSideFileCode: SyntaxRightSideFileCodeProcType];


-- ConcreteRightSideListemptyProd

ConcreteRightSideListemptyProdData: TYPE = REF ConcreteRightSideListemptyProdDataBody;
ConcreteRightSideListemptyProdDataBody: TYPE = RECORD[
];

ConcreteRightSideListemptyProdProcs: ConcreteRightSideListNodeProcs;

BuildConcreteRightSideListemptyProdNode: PROC[position: INT, length: INT]
	RETURNS[ConcreteRightSideListNode];

ConcreteRightSideListemptyProdFormRightSideContext: FormRightSideContextProcType;
ConcreteRightSideListemptyProdFormNameList: FormNameListProcType;
ConcreteRightSideListemptyProdFormTypeList: FormTypeListProcType;
ConcreteRightSideListemptyProdFormNodeVarAssignCode: FormNodeVarAssignCodeProcType;
ConcreteRightSideListemptyProdSyntaxRightSideFileCode: SyntaxRightSideFileCodeProcType;

-- ConcreteRightSideListoneProd

ConcreteRightSideListoneProdData: TYPE = REF ConcreteRightSideListoneProdDataBody;
ConcreteRightSideListoneProdDataBody: TYPE = RECORD[
ConcreteRightSideItem: ConcreteRightSideItemNode];

ConcreteRightSideListoneProdProcs: ConcreteRightSideListNodeProcs;

BuildConcreteRightSideListoneProdNode: PROC[position: INT, length: INT, ConcreteRightSideItem: ConcreteRightSideItemNode]
	RETURNS[ConcreteRightSideListNode];

ConcreteRightSideListoneProdFormRightSideContext: FormRightSideContextProcType;
ConcreteRightSideListoneProdFormNameList: FormNameListProcType;
ConcreteRightSideListoneProdFormTypeList: FormTypeListProcType;
ConcreteRightSideListoneProdFormNodeVarAssignCode: FormNodeVarAssignCodeProcType;
ConcreteRightSideListoneProdSyntaxRightSideFileCode: SyntaxRightSideFileCodeProcType;

-- ConcreteRightSideListmanyProd

ConcreteRightSideListmanyProdData: TYPE = REF ConcreteRightSideListmanyProdDataBody;
ConcreteRightSideListmanyProdDataBody: TYPE = RECORD[
ConcreteRightSideList: ConcreteRightSideListNode, ConcreteRightSideItem: ConcreteRightSideItemNode];

ConcreteRightSideListmanyProdProcs: ConcreteRightSideListNodeProcs;

BuildConcreteRightSideListmanyProdNode: PROC[position: INT, length: INT, ConcreteRightSideList: ConcreteRightSideListNode, ConcreteRightSideItem: ConcreteRightSideItemNode]
	RETURNS[ConcreteRightSideListNode];

ConcreteRightSideListmanyProdFormRightSideContext: FormRightSideContextProcType;
ConcreteRightSideListmanyProdFormNameList: FormNameListProcType;
ConcreteRightSideListmanyProdFormTypeList: FormTypeListProcType;
ConcreteRightSideListmanyProdFormNodeVarAssignCode: FormNodeVarAssignCodeProcType;
ConcreteRightSideListmanyProdSyntaxRightSideFileCode: SyntaxRightSideFileCodeProcType;

--ConcreteRightSideItem

ConcreteRightSideItemNode: TYPE = REF ConcreteRightSideItemNodeBody;
ConcreteRightSideItemNodeBody: TYPE = RECORD[
	position: INT, length: INT,
	procs: ConcreteRightSideItemNodeProcs,
	data: REF ANY];

ConcreteRightSideItemNodeProcs: TYPE = REF ConcreteRightSideItemNodeProcsBody;
ConcreteRightSideItemNodeProcsBody: TYPE = RECORD[

	FormRightSideContext: FormRightSideContextProcType, 
	FormNameList: FormNameListProcType, 
	FormTypeList: FormTypeListProcType, 
	FormNodeVarAssignCode: FormNodeVarAssignCodeProcType, 
	SyntaxRightSideFileCode: SyntaxRightSideFileCodeProcType];


-- ConcreteRightSideItemropeProd

ConcreteRightSideItemropeProdData: TYPE = REF ConcreteRightSideItemropeProdDataBody;
ConcreteRightSideItemropeProdDataBody: TYPE = RECORD[
Rope: RopeNode];

ConcreteRightSideItemropeProdProcs: ConcreteRightSideItemNodeProcs;

BuildConcreteRightSideItemropeProdNode: PROC[position: INT, length: INT, Rope: RopeNode]
	RETURNS[ConcreteRightSideItemNode];

ConcreteRightSideItemropeProdFormRightSideContext: FormRightSideContextProcType;
ConcreteRightSideItemropeProdFormNameList: FormNameListProcType;
ConcreteRightSideItemropeProdFormTypeList: FormTypeListProcType;
ConcreteRightSideItemropeProdFormNodeVarAssignCode: FormNodeVarAssignCodeProcType;
ConcreteRightSideItemropeProdSyntaxRightSideFileCode: SyntaxRightSideFileCodeProcType;

-- ConcreteRightSideItemmodIdProd

ConcreteRightSideItemmodIdProdData: TYPE = REF ConcreteRightSideItemmodIdProdDataBody;
ConcreteRightSideItemmodIdProdDataBody: TYPE = RECORD[
ModId: ModIdNode];

ConcreteRightSideItemmodIdProdProcs: ConcreteRightSideItemNodeProcs;

BuildConcreteRightSideItemmodIdProdNode: PROC[position: INT, length: INT, ModId: ModIdNode]
	RETURNS[ConcreteRightSideItemNode];

ConcreteRightSideItemmodIdProdFormRightSideContext: FormRightSideContextProcType;
ConcreteRightSideItemmodIdProdFormNameList: FormNameListProcType;
ConcreteRightSideItemmodIdProdFormTypeList: FormTypeListProcType;
ConcreteRightSideItemmodIdProdFormNodeVarAssignCode: FormNodeVarAssignCodeProcType;
ConcreteRightSideItemmodIdProdSyntaxRightSideFileCode: SyntaxRightSideFileCodeProcType;

--BuildExp

BuildExpNode: TYPE = REF BuildExpNodeBody;
BuildExpNodeBody: TYPE = RECORD[
	position: INT, length: INT,
	procs: BuildExpNodeProcs,
	data: REF ANY];

BuildExpNodeProcs: TYPE = REF BuildExpNodeProcsBody;
BuildExpNodeProcsBody: TYPE = RECORD[

	FormBuildExpCode: FormBuildExpCodeProcType, 
	FormBuildPositionCode: FormBuildPositionCodeProcType, 
	FormBuildLengthCode: FormBuildLengthCodeProcType];


-- BuildExpmodIdProd

BuildExpmodIdProdData: TYPE = REF BuildExpmodIdProdDataBody;
BuildExpmodIdProdDataBody: TYPE = RECORD[
ModId: ModIdNode];

BuildExpmodIdProdProcs: BuildExpNodeProcs;

BuildBuildExpmodIdProdNode: PROC[position: INT, length: INT, ModId: ModIdNode]
	RETURNS[BuildExpNode];

BuildExpmodIdProdFormBuildExpCode: FormBuildExpCodeProcType;
BuildExpmodIdProdFormBuildPositionCode: FormBuildPositionCodeProcType;
BuildExpmodIdProdFormBuildLengthCode: FormBuildLengthCodeProcType;

-- BuildExpbuildNodeProd

BuildExpbuildNodeProdData: TYPE = REF BuildExpbuildNodeProdDataBody;
BuildExpbuildNodeProdDataBody: TYPE = RECORD[
ModId: ModIdNode, IntervalExp: IntervalExpNode, BuildExpList: BuildExpListNode];

BuildExpbuildNodeProdProcs: BuildExpNodeProcs;

BuildBuildExpbuildNodeProdNode: PROC[position: INT, length: INT, ModId: ModIdNode, IntervalExp: IntervalExpNode, BuildExpList: BuildExpListNode]
	RETURNS[BuildExpNode];

BuildExpbuildNodeProdFormBuildExpCode: FormBuildExpCodeProcType;
BuildExpbuildNodeProdFormBuildPositionCode: FormBuildPositionCodeProcType;
BuildExpbuildNodeProdFormBuildLengthCode: FormBuildLengthCodeProcType;

--BuildExpList

BuildExpListNode: TYPE = REF BuildExpListNodeBody;
BuildExpListNodeBody: TYPE = RECORD[
	position: INT, length: INT,
	procs: BuildExpListNodeProcs,
	data: REF ANY];

BuildExpListNodeProcs: TYPE = REF BuildExpListNodeProcsBody;
BuildExpListNodeProcsBody: TYPE = RECORD[

	FormBuildExpListCode: FormBuildExpListCodeProcType, 
	FormBuildPositionCode: FormBuildPositionCodeProcType, 
	FormBuildLengthCode: FormBuildLengthCodeProcType];


-- BuildExpListemptyProd

BuildExpListemptyProdData: TYPE = REF BuildExpListemptyProdDataBody;
BuildExpListemptyProdDataBody: TYPE = RECORD[
];

BuildExpListemptyProdProcs: BuildExpListNodeProcs;

BuildBuildExpListemptyProdNode: PROC[position: INT, length: INT]
	RETURNS[BuildExpListNode];

BuildExpListemptyProdFormBuildExpListCode: FormBuildExpListCodeProcType;
BuildExpListemptyProdFormBuildPositionCode: FormBuildPositionCodeProcType;
BuildExpListemptyProdFormBuildLengthCode: FormBuildLengthCodeProcType;

-- BuildExpListoneProd

BuildExpListoneProdData: TYPE = REF BuildExpListoneProdDataBody;
BuildExpListoneProdDataBody: TYPE = RECORD[
BuildExp: BuildExpNode];

BuildExpListoneProdProcs: BuildExpListNodeProcs;

BuildBuildExpListoneProdNode: PROC[position: INT, length: INT, BuildExp: BuildExpNode]
	RETURNS[BuildExpListNode];

BuildExpListoneProdFormBuildExpListCode: FormBuildExpListCodeProcType;
BuildExpListoneProdFormBuildPositionCode: FormBuildPositionCodeProcType;
BuildExpListoneProdFormBuildLengthCode: FormBuildLengthCodeProcType;

-- BuildExpListmanyProd

BuildExpListmanyProdData: TYPE = REF BuildExpListmanyProdDataBody;
BuildExpListmanyProdDataBody: TYPE = RECORD[
BuildExpList: BuildExpListNode, BuildExp: BuildExpNode];

BuildExpListmanyProdProcs: BuildExpListNodeProcs;

BuildBuildExpListmanyProdNode: PROC[position: INT, length: INT, BuildExpList: BuildExpListNode, BuildExp: BuildExpNode]
	RETURNS[BuildExpListNode];

BuildExpListmanyProdFormBuildExpListCode: FormBuildExpListCodeProcType;
BuildExpListmanyProdFormBuildPositionCode: FormBuildPositionCodeProcType;
BuildExpListmanyProdFormBuildLengthCode: FormBuildLengthCodeProcType;

--IntervalExp

IntervalExpNode: TYPE = REF IntervalExpNodeBody;
IntervalExpNodeBody: TYPE = RECORD[
	position: INT, length: INT,
	procs: IntervalExpNodeProcs,
	data: REF ANY];

IntervalExpNodeProcs: TYPE = REF IntervalExpNodeProcsBody;
IntervalExpNodeProcsBody: TYPE = RECORD[

	FormIntervalBuildPositionCode: FormIntervalBuildPositionCodeProcType, 
	FormIntervalBuildLengthCode: FormIntervalBuildLengthCodeProcType];


-- IntervalExpnoneProd

IntervalExpnoneProdData: TYPE = REF IntervalExpnoneProdDataBody;
IntervalExpnoneProdDataBody: TYPE = RECORD[
];

IntervalExpnoneProdProcs: IntervalExpNodeProcs;

BuildIntervalExpnoneProdNode: PROC[position: INT, length: INT]
	RETURNS[IntervalExpNode];

IntervalExpnoneProdFormIntervalBuildPositionCode: FormIntervalBuildPositionCodeProcType;
IntervalExpnoneProdFormIntervalBuildLengthCode: FormIntervalBuildLengthCodeProcType;

-- IntervalExppresentProd

IntervalExppresentProdData: TYPE = REF IntervalExppresentProdDataBody;
IntervalExppresentProdDataBody: TYPE = RECORD[
IntervalFormform: IntervalForm, ModIdleft: ModIdNode, ModIdright: ModIdNode];

IntervalExppresentProdProcs: IntervalExpNodeProcs;

BuildIntervalExppresentProdNode: PROC[position: INT, length: INT, IntervalFormform: IntervalForm, ModIdleft: ModIdNode, ModIdright: ModIdNode]
	RETURNS[IntervalExpNode];

IntervalExppresentProdFormIntervalBuildPositionCode: FormIntervalBuildPositionCodeProcType;
IntervalExppresentProdFormIntervalBuildLengthCode: FormIntervalBuildLengthCodeProcType;
END..