-- BcdParseDefs.mesa -- Last edited by Satterthwaite on November 23, 1982 9:42 am DIRECTORY ParseTable: TYPE USING [ActionEntry, ProdDataRef, State, TableRef, TSymbol], Stream: TYPE USING [Handle], Strings: TYPE USING [String]; P1: DEFINITIONS={ OPEN ParseTable; -- pointer types ValueStack: TYPE~LONG POINTER TO P1.ValueSeq; StateStack: TYPE~LONG POINTER TO StateSeq; LinkStack: TYPE~LONG POINTER TO LinkSeq; ActionStack: TYPE~LONG POINTER TO ActionSeq; -- record structures (LONG does not occur past this point) Value: TYPE~RECORD [ -- type of the value stack SELECT OVERLAID * FROM scalar => [s: UNSPECIFIED], ref => [r: UNSPECIFIED] ENDCASE]; NullValue: P1.Value~[scalar[0]]; NullId: P1.Value~[ref[0]]; ValueSeq: TYPE~RECORD [SEQUENCE length: NAT OF P1.Value]; StateSeq: TYPE~RECORD [SEQUENCE length: NAT OF State]; LinkSeq: TYPE~RECORD [SEQUENCE length: NAT OF CARDINAL]; -- links to source text ActionSeq: TYPE~RECORD [SEQUENCE length: NAT OF ActionEntry]; Token: TYPE~RECORD [ class: TSymbol, -- the token class value: P1.Value, index: CARDINAL]; -- source line index -- implemented by BcdScan Atom: PROC RETURNS [Token]; ErrorContext: PROC [to: Stream.Handle, message: Strings.String, tokenIndex: CARDINAL]; ResetScanIndex: PROC [CARDINAL] RETURNS [success: BOOL]; ScanInit: PROC [table: ParseTable.TableRef]; ScanReset: PROC RETURNS [nTokens, nErrors: CARDINAL]; -- implemented by BcdParse Parse: PROC RETURNS [complete: BOOL, nTokens, nErrors: CARDINAL]; ParserID: PROC RETURNS [Strings.String]; InputLoc: PROC RETURNS [CARDINAL]; -- implemented by BcdTreeBuild AssignDescriptors: PROC [ qd: P1.ActionStack, vd: P1.ValueStack, ld: P1.LinkStack, pp: ParseTable.ProdDataRef]; ProcessQueue: PROC [qI, top: CARDINAL]; TokenValue: PROC [TSymbol] RETURNS [P1.Value]; }.