<< JunoNewParser.mesa (was Parser.mesa)>> <<>> <> <> <> <> << Simple operator precedence parser for operators of the following types: infix, prefix, postfix, matchfix (like "begin" or left grouping parenthesis), subfix (like "[" in Mesa or "(" in f(x)) and closefix (like "end" or ")").>> << The symbolic expression constructed by the parser is represented as in Lisp, by a nest of ordered pairs; the list cells employed are those of Mesa's LIST OF REF ANY.>> DIRECTORY List, Atom, IO, Rope, JunoLexer, JunoParseTable; JunoNewParser: DEFINITIONS = BEGIN OPEN PT: JunoParseTable, Lexer: JunoLexer; Handle: TYPE = REF HandleRec; HandleRec: TYPE = RECORD [error: Rope.ROPE, -- initially NIL, set to error message on lexical error eof: BOOL, -- initially FALSE, set to TRUE on end of input. result: REF ANY, -- contains last thing produced by Parse. openCount: INT, -- number of unmatched matchfixs or subfixs in last thing parsed in: Lexer.Handle, -- Source of lexemes to be parsed. -- WARNING The initial value of in.a is relevant; see "Parse" below table: PT.Handle]; -- associates operator types with operators. NewHandle: PROC RETURNS [h: Handle]; Parse: PUBLIC PROC[h: Handle]; <> END.