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; Verify: PUBLIC PROC [env: EnvironmentNode] = BEGIN fileNames: LIST OF Rope.ROPE _ NIL; 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; 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. Environments Context Trees ΚΉ˜™!Icode™