PPP1.Mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Russ Atkinson, February 12, 1985 2:59:16 pm PST
Paul Rovner, July 19, 1983 11:07 pm
DIRECTORY
IO USING [STREAM],
PPParseTable USING [ActionEntry, Handle, ProdDataHandle, TSymbol],
PPLeaves USING [HTIndex],
Rope USING [ROPE];
PPP1: CEDAR DEFINITIONS = BEGIN OPEN PPParseTable, PPLeaves, Rope;
Value: TYPE = RECORD [ -- type of the value stack
s: WORD ← 0, -- scalars only
r: REF ANYNIL];
ValueSeq: TYPE = RECORD [SEQUENCE length: NAT OF Value];
ValueStack: TYPE = REF ValueSeq;
INTSeq: TYPE = RECORD [SEQUENCE length: CARDINAL OF INT];
ActionEntrySeq: TYPE = RECORD [SEQUENCE length: CARDINAL OF ActionEntry];
NullValue: Value = [s:0, r:NIL];
NullId: Value = NullValue;
Token: TYPE = RECORD [
class: TSymbol,  -- the token class
value: Value,
index: INT];  -- source line index
implemented by Scanner
Atom: PROC [errPut: IO.STREAM] RETURNS [Token];
ErrorContext: PROC [message: ROPE, tokenIndex: INT, put: IO.STREAM];
IdOfFirst: PROC RETURNS [HTIndex];
IdOfLock: PROC RETURNS [HTIndex];
IdOfRest: PROC RETURNS [HTIndex];
ResetScanIndex: PROC [INT] RETURNS [success: BOOL];
ScanInit: UNSAFE PROC [table: Handle, source: ROPE];
ScanReset: PROC RETURNS [nTokens, nErrors: CARDINAL];
implemented by Parser
Parse: PROC [source: ROPE, pth: Handle, errPut: IO.STREAM]
RETURNS [complete: BOOL, nTokens, nErrors: CARDINAL];
ParserID: PROC RETURNS [ROPE];
InputLoc: PROC RETURNS [INT];
implemented by Pass1T
AssignDescriptors: UNSAFE PROC [
qd: REF ActionEntrySeq,
vd: ValueStack,
ld: REF INTSeq,
pp: ProdDataHandle];
ProcessQueue: UNSAFE PROC [qI, top: CARDINAL];
TokenValue: UNSAFE PROC [TSymbol] RETURNS [Value];
the global frames
Scanner, Parser, Pass1T: PROGRAM;
END.