DIRECTORY AMTypes USING [TV], SymTab USING [Ref], Rope USING [ROPE]; ExprRead: CEDAR DEFINITIONS = BEGIN Error: ERROR [ec: ErrorCode, msg: Rope.ROPE]; ErrorCode: TYPE = {Null, -- never raised CouldNotEval, -- could not evaluate expression NoValue, -- expression didn't return a value Syntax, -- bad expression syntax FileError, -- could not read from file MarkNotInTile, -- the Mark is not in the specified cell or design PlacedTileNotInDesign, -- the PlacedTile is not in the specified design ObjectMustBeTileOrDesign -- something else was passed }; Eval: PROC [expr: Rope.ROPE, symTab: SymTab.Ref] RETURNS [AMTypes.TV]; Assign: PROC [line: Rope.ROPE, symTab: SymTab.Ref]; ReadFile: PROC [fileName: Rope.ROPE, symTab: SymTab.Ref]; TVToRope: PROC [tv: AMTypes.TV] RETURNS[Rope.ROPE]; TVToListOfRope: PROC [tv: AMTypes.TV] RETURNS[LIST OF Rope.ROPE]; TVToInt: PROC [tv: AMTypes.TV] RETURNS[REF INT]; TVToCardinal: PROC [tv: AMTypes.TV] RETURNS[REF CARDINAL]; -- value must be non-negative TVToAtom: PROC [tv: AMTypes.TV] RETURNS[ATOM]; END. øFile: ExprRead.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. Created by: Mayo, July 23, 1984 3:50:47 pm PDT Last Edited by: Mayo, July 23, 1984 6:06:17 pm PDT -- ExprRead: Read expressions of the form 'var _ expr' or 'var ~ expr'. If the operator is '_ then the expr is evaluated using symbols in a symbol table, or things in the global naming context. See Interpreter.mesa for more details. If the operator is '~ then expr is simply treated as a rope which is then assigned to var. -- This module uses the slot named '&' in the passed symbol tables as a temporary placeholder. Anything that the caller places there might be destroyed. Evaluate one expression and return a TV for it's result. Evaluate one assignment statement of the form 'var _ expr', and update var in the symbol table. Read a file that contains one assignment statement per line. These procedures return NIL if the operation couldn't be done, and a pointer otherwise. They don't raise errors intentionally. Êœ™Jšœ Ïmœ1™Jš¡œžœžœ˜:J™Jš ¡œžœžœžœžœ˜3Jš¡œžœžœžœžœžœžœ˜AJš ¡œžœžœžœžœžœ˜0Jš ¡ œžœžœžœžœžœ ˜ZJš ¡œžœžœžœžœ˜.J˜Jšžœ˜—J˜J˜J˜—…—R 9