DIRECTORY
	Rope,
	ThreeC4Support;

ThreeC4BaseDecl1Def: CEDAR DEFINITIONS = 
BEGIN
OPEN Rope, ThreeC4Support;
ThreeC4BaseDecl1LinkProc: PROC[SeeProdLinkArray, TokenLinkArray];

--Identifier

IdentifierNode: TYPE = REF IdentifierNodeBody;
IdentifierNodeBody: TYPE = RECORD[
	text: Rope.ROPE,
	position, length: INT];


--Rope

RopeNode: TYPE = REF RopeNodeBody;
RopeNodeBody: TYPE = RECORD[
	text: Rope.ROPE,
	position, length: INT];


--NonNegInteger

NonNegIntegerNode: TYPE = REF NonNegIntegerNodeBody;
NonNegIntegerNodeBody: TYPE = RECORD[
	text: Rope.ROPE,
	position, length: INT];

IntegerNode: TYPE = REF IntegerNodeBody;
IntegerNodeBody: TYPE;

TreeCallFlag: TYPE = {yes, no};
ConcatRopes2: PROC[ROPE, ROPE] RETURNS[ROPE];

EqualRopes: PROC[ROPE, ROPE] RETURNS[BOOLEAN];

RopeFromRopeNode: PROC[RopeNode] RETURNS[ROPE];

RopeFromNonNegIntegerNode: PROC[NonNegIntegerNode] RETURNS[ROPE];

RopeFromIdentifierNode: PROC[IdentifierNode] RETURNS[ROPE];

IntegerFromRope: PROC[ROPE] RETURNS[IntegerNode];

Add1: PROC[IntegerNode] RETURNS[IntegerNode];

Add1ToInt: PROC[INT] RETURNS[INT];

Add: PROC[IntegerNode, IntegerNode] RETURNS[IntegerNode];

FakeCopyInt: PROC[INT] RETURNS[INT];

Check: PROC[BOOLEAN] RETURNS[BOOLEAN];

Not: PROC[BOOLEAN] RETURNS[BOOLEAN];

AndLogical: PROC[BOOLEAN, BOOLEAN] RETURNS[BOOLEAN];

Or: PROC[BOOLEAN, BOOLEAN] RETURNS[BOOLEAN];

FakeCopyInteger: PROC[IntegerNode] RETURNS[IntegerNode];

EqualInteger: PROC[IntegerNode, IntegerNode] RETURNS[BOOLEAN];

EqualTreeCallFlags: PROC[TreeCallFlag, TreeCallFlag] RETURNS[BOOLEAN];

NameNode: TYPE = REF NameNodeBody;
NameNodeBody: TYPE;

BuildName: PROC[IdentifierNode] RETURNS[NameNode];

BuildName2: PROC[IdentifierNode, IdentifierNode] RETURNS[NameNode];

BuildRopeName: PROC[ROPE] RETURNS[NameNode];

NameListNode: TYPE = REF NameListNodeBody;
NameListNodeBody: TYPE;

BuildEmptyNameList: PROC RETURNS[NameListNode];

FakeCopyNameList: PROC[NameListNode] RETURNS[NameListNode];

BuildOneNameList: PROC[NameNode] RETURNS[NameListNode];

ConcatNameLists: PROC[NameListNode, NameListNode] RETURNS[NameListNode];

AppendToNameList: PROC[NameListNode, NameNode] RETURNS[NameListNode];

PrefixToNameList: PROC[NameNode, NameListNode] RETURNS[NameListNode];

InventTemps: PROC[IntegerNode, IntegerNode] RETURNS[NameListNode, IntegerNode];

CompareNameLists: PROC[NameListNode, NameListNode] RETURNS[BOOLEAN];

PartitionFirstName: PROC[NameListNode] RETURNS[NameNode, NameListNode];

PartitionNames: PROC[IntegerNode, NameListNode] RETURNS[NameListNode, NameListNode];

TheOneName: PROC[NameListNode] RETURNS[NameNode];

TestEmptyNameList: PROC[NameListNode] RETURNS[BOOLEAN];

TypeNode: TYPE = REF TypeNodeBody;
TypeNodeBody: TYPE;

GetTypeCodeName: PROC[TypeNode] RETURNS[MesaCodeNode];

CompareValTypeWithVarType: PROC[TypeNode, TypeNode] RETURNS[BOOLEAN];

FoundType: PROC[TypeNode] RETURNS[BOOLEAN];

TypeListNode: TYPE = REF TypeListNodeBody;
TypeListNodeBody: TYPE;

BuildEmptyTypeList: PROC RETURNS[TypeListNode];

BuildOneTypeList: PROC[TypeNode] RETURNS[TypeListNode];

AppendToTypeList: PROC[TypeListNode, TypeNode] RETURNS[TypeListNode];

PrefixToTypeList: PROC[TypeNode, TypeListNode] RETURNS[TypeListNode];

ConcatTypeLists: PROC[TypeListNode, TypeListNode] RETURNS[TypeListNode];

CompareValTypesWithVarTypes: PROC[TypeListNode, TypeListNode] RETURNS[BOOLEAN];

GetTheOneType: PROC[TypeListNode] RETURNS[TypeNode];

GetFirstType: PROC[TypeListNode] RETURNS[TypeNode];

PartitionLastType: PROC[TypeListNode] RETURNS[TypeListNode, TypeNode];

PartitionFirstType: PROC[TypeListNode] RETURNS[TypeNode, TypeListNode];

CountTypes: PROC[TypeListNode] RETURNS[IntegerNode];

CheckForOneBoolean: PROC[TypeListNode] RETURNS[BOOLEAN];

CheckForEqualTypeLists: PROC[TypeListNode, TypeListNode] RETURNS[BOOLEAN];

MesaCodeNode: TYPE = REF MesaCodeNodeBody;
MesaCodeNodeBody: TYPE;

CodeFillerNode: TYPE = REF CodeFillerNodeBody;
CodeFillerNodeBody: TYPE;

BuildEmptyCode: PROC RETURNS[MesaCodeNode];

BuildErrorCode: PROC[ROPE] RETURNS[MesaCodeNode];

TestEmptyCode: PROC[MesaCodeNode] RETURNS[BOOLEAN];

FakeCopyCodeForConditional: PROC[MesaCodeNode] RETURNS[MesaCodeNode];

RopeCode: PROC[ROPE] RETURNS[MesaCodeNode];

RopeCode1: PROC[ROPE, CodeFillerNode] RETURNS[MesaCodeNode];

RopeCode2: PROC[ROPE, CodeFillerNode, CodeFillerNode] RETURNS[MesaCodeNode];

RopeCode3: PROC[ROPE, CodeFillerNode, CodeFillerNode, CodeFillerNode] RETURNS[MesaCodeNode];

RopeCode4: PROC[ROPE, CodeFillerNode, CodeFillerNode, CodeFillerNode, CodeFillerNode] RETURNS[MesaCodeNode];

ConcatCode2: PROC[MesaCodeNode, MesaCodeNode] RETURNS[MesaCodeNode];

ConcatCode3: PROC[MesaCodeNode, MesaCodeNode, MesaCodeNode] RETURNS[MesaCodeNode];

ConcatCode4: PROC[MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode] RETURNS[MesaCodeNode];

ConcatCode5: PROC[MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode] RETURNS[MesaCodeNode];

ConcatCode6: PROC[MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode] RETURNS[MesaCodeNode];

ConcatCode7: PROC[MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode] RETURNS[MesaCodeNode];

ConcatCode8: PROC[MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode] RETURNS[MesaCodeNode];

ConcatCode9: PROC[MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode] RETURNS[MesaCodeNode];

ConcatCodePairs2: PROC[MesaCodeNode, MesaCodeNode, MesaCodeNode, MesaCodeNode] RETURNS[MesaCodeNode, MesaCodeNode];

IdFill: PROC[IdentifierNode] RETURNS[CodeFillerNode];

IdFill2: PROC[IdentifierNode, IdentifierNode] RETURNS[CodeFillerNode];

CodeFill: PROC[MesaCodeNode] RETURNS[CodeFillerNode];

NameFill: PROC[NameNode] RETURNS[CodeFillerNode];

IntegerFill: PROC[IntegerNode] RETURNS[CodeFillerNode];

IntFill: PROC[INT] RETURNS[CodeFillerNode];

BuildNameSeqArgCode: PROC[NameListNode] RETURNS[MesaCodeNode];

BuildResultTypeCode: PROC[TypeListNode] RETURNS[MesaCodeNode];

BuildArgNameTypeCode: PROC[NameListNode, TypeListNode] RETURNS[MesaCodeNode];

BuildVarDeclCode: PROC[NameListNode, TypeListNode] RETURNS[MesaCodeNode];

FileSeqNode: TYPE = REF FileSeqNodeBody;
FileSeqNodeBody: TYPE;

BuildEmptyFileSeq: PROC RETURNS[FileSeqNode];

BuildOneFileSeq: PROC[MesaCodeNode, MesaCodeNode] RETURNS[FileSeqNode];

AppendToFileSeq: PROC[FileSeqNode, MesaCodeNode, MesaCodeNode] RETURNS[FileSeqNode];

ConcatFileSeq: PROC[FileSeqNode, FileSeqNode] RETURNS[FileSeqNode];

FakeCopyFileSeqForConditional: PROC[FileSeqNode] RETURNS[FileSeqNode];

END..