-- SMOps.mesa -- last edit by Schmidt, May 17, 1983 4:35 pm -- last edit by Satterthwaite, July 25, 1983 12:07 pm -- object record for Cedar modeller DIRECTORY IO: TYPE USING [STREAM], SMCommentTableOps: TYPE USING [CommentM], SMLDriver: TYPE USING [LS], SMTree: TYPE Tree USING [Info, Link], SMTreeOps: TYPE --TreeOps-- USING [TM]; SMOps: CEDAR DEFINITIONS ~ { OPEN Tree~~SMTree, TreeOps~~SMTreeOps; -- A ModelState object contains the global state of an instance of a modeller. -- In addition to this record, other modules with global state use monitors to -- protect multiple use. -- Examples: -- SMReaderImpl (protects SMParserImpl, SMScannerImpl, SMTreeBuildImpl), -- SMCompImpl (protects compiler) -- SMFIImpl, SMProjImpl (protect caches) -- this object cannot hold things that are not compatible with multiple -- levels of models for an instance of the modeller, e.g. the source file input stream MS: TYPE~REF ModelState; ModelState: TYPE~RECORD[ in: IO.STREAM_NIL, -- input stream for typeScript out: IO.STREAM_NIL, -- output stream for typeScript msgOut: IO.STREAM_NIL, -- output stream for compiler progress messages -- z: ZONE_NIL, -- use this zone to allocate all REF's -- loc: Tree.Info, -- location in source errors: BOOL_FALSE, -- cumulative error flag debugFlag: BOOL_FALSE, -- tree: Tree.Link_NIL, -- the root node of the (source) parse tree val: Tree.Link_NIL, -- the root node of the evaluated tree -- state information used by SMTreeImpl tm: TreeOps.TM_NIL, -- state information used by SMCommentTableImpl comments: SMCommentTableOps.CommentM_NIL, -- state information used by the modeller loader ls: SMLDriver.LS_NIL ]; -- procedures NewModel: PROC[in, out, msgout: IO.STREAM] RETURNS[m: MS]; }.