OneCasabaParserData: MODULE =
BEGIN
TokenKind: CEDAR TYPE FROM IO = {tokenERROR, tokenID, tokenDECIMAL, tokenOCTAL, tokenHEX, tokenREAL, tokenROPE, tokenCHAR, tokenATOM, tokenSINGLE, tokenDOUBLE, tokenCOMMENT, tokenEOF};
State: CEDAR TYPE FROM OneCasabaParser = CARDINAL;
ParserTable: CEDAR TYPE FROM OneCasabaParserPrivate = REF ParserTableBody;
ParserTableBody: CEDAR TYPE FROM OneCasabaParserPrivate = RECORD[
unAnalyzedSymbols: SymbolCell,
nSymbols: CARDINAL,
unAnalyzedTokens: TokenCell,
nTokens: CARDINAL,
unAnalyzedActions: ActionCell,
nActions: CARDINAL,
startState: State,
symbolTable: SymbolTable,
tokenTable: TokenTable,
actionTable: ActionTable];
SymbolTable: CEDAR TYPE FROM OneCasabaParserPrivate = REF SymbolTableBody;
SymbolTableBody: CEDAR TYPE FROM OneCasabaParserPrivate = RECORD[
symbols: SEQUENCE nSlots: CARDINAL OF SymbolCell];
SymbolCell: CEDAR TYPE FROM OneCasabaParserPrivate = REF SymbolCellBody;
SymbolCellBody: CEDAR TYPE FROM OneCasabaParserPrivate = RECORD[
name: ROPE,
code: CARDINAL,
next: SymbolCell];
TokenTable: CEDAR TYPE FROM OneCasabaParserPrivate = REF TokenTableBody;
TokenTableBody: CEDAR TYPE FROM OneCasabaParserPrivate = RECORD[
idToken: TokenCell,
tokens: SEQUENCE nSlots: CARDINAL OF TokenCell];
TokenCell: CEDAR TYPE FROM OneCasabaParserPrivate = REF TokenCellBody;
TokenCellBody: CEDAR TYPE FROM OneCasabaParserPrivate = RECORD[
name: ROPE,
symbolCode: CARDINAL,
kind: TokenKind,
spelling: ROPE,
case: TokenCase,
next: TokenCell];
TokenCase: CEDAR TYPE FROM OneCasabaParserPrivate = {unique, generic};
ActionTable: CEDAR TYPE FROM OneCasabaParserPrivate = REF ActionTableBody;
ActionTableBody: CEDAR TYPE FROM OneCasabaParserPrivate = RECORD[
actions: SEQUENCE nSlots: CARDINAL OF ActionCell];
ActionCell: CEDAR TYPE FROM OneCasabaParserPrivate = REF ActionCellBody; -- not the most compact representation
ActionCellBody: CEDAR TYPE FROM OneCasabaParserPrivate = RECORD[
state: State,
terminal: CARDINAL, -- symbol code
action: Action,
nextState: State, -- for shifts
ruleNumber: CARDINAL, -- for reductions
leftSide: CARDINAL, -- symbol code for left side non terminal
ruleSize: CARDINAL, -- number of right side symbols
next: ActionCell];
Action: CEDAR TYPE FROM OneCasabaParserPrivate = {shift, reduce, accept};
END.