CHOpsP2V3AuxImpl:
CEDAR
PROGRAM
IMPORTS Convert, Rope, AuthenticationP14V2Aux, CHNameP2V0Aux
EXPORTS CHOpsP2V3Aux ~ {
OPEN CHOpsP2V3, CHOpsP2V3Aux;
ROPE: TYPE ~ Rope.ROPE;
ExposeObjectNameSequence:
PUBLIC
PROC [arg: ObjectNameSequence, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ← Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, CHNameP2V0Aux.ExposeThreePartName[arg.body[i], (level+1)]];
ENDLOOP;
res ← Rope.Concat[res, "]"];
};
ExposeWhichArgument:
PUBLIC
PROC [arg: WhichArgument, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
first => res ← "first";
second => res ← "second";
ENDCASE => ERROR
};
ExposeStreamOfThreePartName:
PUBLIC
PROC [arg: StreamOfThreePartName, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← Rope.Cat["StreamOfThreePartName(", ExposeStreamKind[arg.type, (level+1)], "): "];
WITH arg
SELECT
FROM
it:
REF StreamOfThreePartNameObject.nextSegment => {
res ← Rope.Concat[res, ExposeThreePartNameList[it.nextSegment, (level+1)]] };
it:
REF StreamOfThreePartNameObject.lastSegment => {
res ← Rope.Concat[res, ExposeThreePartNameSequence[it.lastSegment, (level+1)]] };
ENDCASE => ERROR
};
ExposeStreamOfDomain:
PUBLIC
PROC [arg: StreamOfDomain, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← Rope.Cat["StreamOfDomain(", ExposeStreamKind[arg.type, (level+1)], "): "];
WITH arg
SELECT
FROM
it:
REF StreamOfDomainObject.nextSegment => {
res ← Rope.Concat[res, ExposeDomainList[it.nextSegment, (level+1)]] };
it:
REF StreamOfDomainObject.lastSegment => {
res ← Rope.Concat[res, ExposeDomainSequence[it.lastSegment, (level+1)]] };
ENDCASE => ERROR
};
ExposeDomainNameSequence:
PUBLIC
PROC [arg: DomainNameSequence, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ← Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, CHNameP2V0Aux.ExposeTwoPartName[arg.body[i], (level+1)]];
ENDLOOP;
res ← Rope.Concat[res, "]"];
};
ExposeStreamOfOrganization:
PUBLIC
PROC [arg: StreamOfOrganization, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← Rope.Cat["StreamOfOrganization(", ExposeStreamKind[arg.type, (level+1)], "): "];
WITH arg
SELECT
FROM
it:
REF StreamOfOrganizationObject.nextSegment => {
res ← Rope.Concat[res, ExposeOrganizationList[it.nextSegment, (level+1)]] };
it:
REF StreamOfOrganizationObject.lastSegment => {
res ← Rope.Concat[res, ExposeOrganizationSequence[it.lastSegment, (level+1)]] };
ENDCASE => ERROR
};
ExposeStreamOfDomainName:
PUBLIC
PROC [arg: StreamOfDomainName, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← Rope.Cat["StreamOfDomainName(", ExposeStreamKind[arg.type, (level+1)], "): "];
WITH arg
SELECT
FROM
it:
REF StreamOfDomainNameObject.nextSegment => {
res ← Rope.Concat[res, ExposeDomainNameList[it.nextSegment, (level+1)]] };
it:
REF StreamOfDomainNameObject.lastSegment => {
res ← Rope.Concat[res, ExposeDomainNameSequence[it.lastSegment, (level+1)]] };
ENDCASE => ERROR
};
ExposeArgumentProblem:
PUBLIC
PROC [arg: ArgumentProblem, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
illegalProperty => res ← "illegalProperty";
illegalOrganizationName => res ← "illegalOrganizationName";
illegalDomainName => res ← "illegalDomainName";
illegalObjectName => res ← "illegalObjectName";
noSuchOrganization => res ← "noSuchOrganization";
noSuchDomain => res ← "noSuchDomain";
noSuchObject => res ← "noSuchObject";
ENDCASE => ERROR
};
ExposeDomainList:
PUBLIC
PROC [arg: DomainList, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
res ← Rope.Cat[res, "segment~", ExposeDomainSequence[arg.segment, (level+1)], "]"];
};
ExposeDomainSequence:
PUBLIC
PROC [arg: DomainSequence, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ← Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, arg.body[i]];
ENDLOOP;
res ← Rope.Concat[res, "]"];
};
ExposeThreePartNameSequence:
PUBLIC
PROC [arg: ThreePartNameSequence, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ← Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, CHNameP2V0Aux.ExposeThreePartName[arg.body[i], (level+1)]];
ENDLOOP;
res ← Rope.Concat[res, "]"];
};
ExposeObjectNameList:
PUBLIC
PROC [arg: ObjectNameList, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
res ← Rope.Cat[res, "segment~", ExposeObjectNameSequence[arg.segment, (level+1)], "]"];
};
ExposeStreamKind:
PUBLIC
PROC [arg: StreamKind, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
nextSegment => res ← "nextSegment";
lastSegment => res ← "lastSegment";
ENDCASE => ERROR
};
ExposeNetworkNumber:
PUBLIC
PROC [arg: NetworkNumber, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
FOR i:
CARDINAL
IN [0..2)
DO
res ← Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, Convert.RopeFromCard[arg[i]]];
ENDLOOP;
res ← Rope.Concat[res, "]"];
};
ExposeHostNumber:
PUBLIC
PROC [arg: HostNumber, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
FOR i:
CARDINAL
IN [0..3)
DO
res ← Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, Convert.RopeFromCard[arg[i]]];
ENDLOOP;
res ← Rope.Concat[res, "]"];
};
ExposeNetworkAddress:
PUBLIC
PROC [arg: NetworkAddress, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
res ← Rope.Cat[res, "network~", ExposeNetworkNumber[arg.network, (level+1)], ", "];
res ← Rope.Cat[res, "host~", ExposeHostNumber[arg.host, (level+1)], ", "];
res ← Rope.Cat[res, "socket~", Convert.RopeFromCard[arg.socket], "]"];
};
ExposeCallProblem:
PUBLIC
PROC [arg: CallProblem, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
accessRightsInsufficient => res ← "accessRightsInsufficient";
tooBusy => res ← "tooBusy";
serverDown => res ← "serverDown";
useCourier => res ← "useCourier";
other => res ← "other";
ENDCASE => ERROR
};
ExposeAuthenticator:
PUBLIC
PROC [arg: Authenticator, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
res ← Rope.Cat[res, "credentials~", AuthenticationP14V2Aux.ExposeCredentials[arg.credentials, (level+1)], ", "];
res ← Rope.Cat[res, "verifier~", AuthenticationP14V2Aux.ExposeSeqWords[arg.verifier, (level+1)], "]"];
};
ExposeDomainNameList:
PUBLIC
PROC [arg: DomainNameList, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
res ← Rope.Cat[res, "segment~", ExposeDomainNameSequence[arg.segment, (level+1)], "]"];
};
ExposeNetworkAddressList:
PUBLIC
PROC [arg: NetworkAddressList, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ← Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, ExposeNetworkAddress[arg.body[i], (level+1)]];
ENDLOOP;
res ← Rope.Concat[res, "]"];
};
ExposeStreamOfObject:
PUBLIC
PROC [arg: StreamOfObject, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← Rope.Cat["StreamOfObject(", ExposeStreamKind[arg.type, (level+1)], "): "];
WITH arg
SELECT
FROM
it:
REF StreamOfObjectObject.nextSegment => {
res ← Rope.Concat[res, ExposeObjectList[it.nextSegment, (level+1)]] };
it:
REF StreamOfObjectObject.lastSegment => {
res ← Rope.Concat[res, ExposeObjectSequence[it.lastSegment, (level+1)]] };
ENDCASE => ERROR
};
ExposeItem:
PUBLIC
PROC [arg: Item, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ← Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, Convert.RopeFromCard[arg.body[i]]];
ENDLOOP;
res ← Rope.Concat[res, "]"];
};
ExposeOrganizationList:
PUBLIC
PROC [arg: OrganizationList, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
res ← Rope.Cat[res, "segment~", ExposeOrganizationSequence[arg.segment, (level+1)], "]"];
};
ExposeOrganizationSequence:
PUBLIC
PROC [arg: OrganizationSequence, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ← Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, arg.body[i]];
ENDLOOP;
res ← Rope.Concat[res, "]"];
};
ExposeThreePartNameList:
PUBLIC
PROC [arg: ThreePartNameList, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
res ← Rope.Cat[res, "segment~", ExposeThreePartNameSequence[arg.segment, (level+1)], "]"];
};
ExposeStreamOfObjectName:
PUBLIC
PROC [arg: StreamOfObjectName, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← Rope.Cat["StreamOfObjectName(", ExposeStreamKind[arg.type, (level+1)], "): "];
WITH arg
SELECT
FROM
it:
REF StreamOfObjectNameObject.nextSegment => {
res ← Rope.Concat[res, ExposeObjectNameList[it.nextSegment, (level+1)]] };
it:
REF StreamOfObjectNameObject.lastSegment => {
res ← Rope.Concat[res, ExposeObjectNameSequence[it.lastSegment, (level+1)]] };
ENDCASE => ERROR
};
ExposeObjectList:
PUBLIC
PROC [arg: ObjectList, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
res ← Rope.Cat[res, "segment~", ExposeObjectSequence[arg.segment, (level+1)], "]"];
};
ExposeProperties:
PUBLIC
PROC [arg: Properties, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ← Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, Convert.RopeFromCard[arg.body[i]]];
ENDLOOP;
res ← Rope.Concat[res, "]"];
};
ExposePropertyProblem:
PUBLIC
PROC [arg: PropertyProblem, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
missing => res ← "missing";
wrongType => res ← "wrongType";
ENDCASE => ERROR
};
ExposeUpdateProblem:
PUBLIC
PROC [arg: UpdateProblem, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
noChange => res ← "noChange";
outOfDate => res ← "outOfDate";
objectOverflow => res ← "objectOverflow";
databaseOverflow => res ← "databaseOverflow";
ENDCASE => ERROR
};
ExposeObjectSequence:
PUBLIC
PROC [arg: ObjectSequence, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ← "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ← Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, arg.body[i]];
ENDLOOP;
res ← Rope.Concat[res, "]"];
};
}...