SaffronContextInvariantsImpl.Mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
James Rauen, July 19, 1988 4:03:37 pm PDT
This file defines the representation invariants of the declarations in SaffronContextPrivateTypes.
DIRECTORY
Rope USING [ROPE];
SaffronContextInvariants USING [],
SaffronContextPrivateTypes,
SaffronErrorHandling USING [Message];
SaffronContextInvariantsImpl: CEDAR PROGRAM
EXPORTS SaffronContextInvariants = BEGIN
OPEN SaffronContextPrivateTypes;
Violation: PUBLIC ERROR [message: Rope.ROPE, value: REF ANY] = CODE;
Environments
Verify: PUBLIC PROC [env: EnvironmentNode] = BEGIN
fileNames: LIST OF Rope.ROPENIL;
includedCells: IncludedFileCell ← env.firstIncludedFile
DoFile: PROC [fileName: Rope.ROPE, contextTree: ContextTreeNode] = BEGIN
FOR fns: LIST OF Rope.ROPE ← fileNames, fns.rest DO
IF Rope.Compare[fileName, fns.first] = equal
THEN ERROR Violation[IO.PutFR["Duplicate file name %g in environment", IO.rope[fileName]]];
ENDLOOP;
fileNames: ← CONS[fileName, fileNames];
VerifyContextTree[contextTree];
END;
DoFile[env.mainFileName, env.mainContextTree];
WHILE includedCells # NIL DO
DoFile[includedCells.fileName, includedCells.contextTree];
includedCells ← includedCells.next;
ENDLOOP;
END;
Context Trees