[ivy]<Satterthwaite>SML>SMOps.mesa!9

SMOps.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
last edit by Satterthwaite, May 12, 1986 11:46:33 am PDT
object state for each instance of the Cedar modeller
DIRECTORY
IO: TYPE USING [STREAM],
Rope: TYPE USING [ROPE],
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 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 REFs
wDir: Rope.ROPE←NIL,-- working directory for files
loc: Tree.Info,-- location in source
errors: BOOL←FALSE,-- cumulative error flag
debugFlag: BOOL←FALSE,
tree: Tree.Link←NIL,-- the root of the (source) parse tree
val: Tree.Link←NIL,-- the root of the evaluated tree
patches: PatchList←NIL, -- patches to leaf nodes (for file updates)
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
];
PatchItem: TYPE~RECORD[old, new: Tree.Link];
PatchList: TYPE~LIST OF PatchItem;
procedures
NewModel: PROC[in, out, msgout: IO.STREAM] RETURNS[m: MS];
}.