TabGen:
PUBLIC
PROC [cedar:
BOOL, cusp: BOOL]
RETURNS [success:
BOOL←
TRUE] = {
Error:
PROC [sel:
CARDINAL] = {
OutString["\nFAIL - "];
OutString[
SELECT sel
FROM
1 => "more than 255 terminal symbols",
2 => "more than 254 nonterminal symbols",
3 => "more than 2047 states or productions",
4 => "more than 15 symbols in a production right part",
ENDCASE => "NPGS error"];
NPGSConDefs.outeol[1]; success ← FALSE;
};
PrefixItem:
PROC [init:
CARDINAL, nItems:
CARDINAL] = {
IO.PutF1[st, " i: CARDINAL ← %d;\n", [cardinal[init]] ];
IO.PutRope[st, " dup: PROC = {tab[i] ← tab[i-1]; i ← i + 1};\n"];
IO.PutRope[st, " app0: PROC [transition: CARDINAL] = {\n"];
IO.PutRope[st, " tab[i] ← [[FALSE, 0], transition];\n"];
IO.PutRope[st, " i ← i + 1;\n"];
IO.PutRope[st, " };\n"];
IO.PutRope[st, " app1: PROC [pLength: CARDINAL, transition: CARDINAL] = {\n"];
IO.PutRope[st, " tab[i] ← [[FALSE, pLength], transition];\n"];
IO.PutRope[st, " i ← i + 1;\n"];
IO.PutRope[st, " };\n"];
IO.PutRope[st, " app1t: PROC [transition: CARDINAL] = {\n"];
IO.PutRope[st, " tab[i] ← [[FALSE, 1], transition];\n"];
IO.PutRope[st, " i ← i + 1;\n"];
IO.PutRope[st, " };\n"];
IO.PutRope[st, " app2: PROC [pLength: CARDINAL, transition: CARDINAL] = {\n"];
IO.PutRope[st, " tab[i] ← [[TRUE, pLength], transition];\n"];
IO.PutRope[st, " i ← i + 1;\n"];
IO.PutRope[st, " };\n"];
lagItem ← NPGSTypes.nullItemRec;
needSplits ← nItems >= splitTrigger;
splitNum ← 0;
};
PutItem:
PROC [i:
CARDINAL, item: NPGSTypes.ItemRec, first:
CARDINAL] = {
IF (i
MOD 5) = 0
OR i = first
THEN {
IF needSplits THEN
IF i = first
OR sinceSplit >= splitTrigger
THEN {
IF splitNum # 0 THEN IO.PutRope[st, "\n };"];
IO.PutF1[st, "\n split%d: PROC = {", [cardinal[splitNum]]];
sinceSplit ← 0;
splitNum ← splitNum + 1;
};
IO.PutRope[st, "\n"];
};
IF needSplits THEN IO.PutRope[st, " "] ELSE IO.PutRope[st, " "];
IF (i
MOD 20) = 0
THEN {
IO.PutF1[st, "-- %d\n", [cardinal[i]] ];
IF needSplits THEN IO.PutRope[st, " "] ELSE IO.PutRope[st, " "];
};
SELECT
TRUE
FROM
item = NPGSTypes.nullItemRec => IO.PutRope[st, "i ← i + 1;"];
item = lagItem => IO.PutRope[st, "dup[];"];
ENDCASE =>
SELECT item.tag
FROM
0 =>
IO.PutF1[st, "app0[%d];", [cardinal[item.pss]] ];
1 =>
IF item.jf = 1
THEN IO.PutF1[st, "app1t[%d];", [cardinal[item.pss]] ]
ELSE IO.PutF[st, "app1[%d, %d];", [cardinal[item.jf]], [cardinal[item.pss]] ];
2 =>
IO.PutF[st, "app2[%d, %d];", [cardinal[item.jf]], [cardinal[item.pss]] ];
ENDCASE => ERROR;
lagItem ← item;
sinceSplit ← sinceSplit + 1;
};
PostfixItem:
PROC = {
IF needSplits
THEN {
IO.PutRope[st, "\n };"];
FOR i:
NAT
IN [0..splitNum)
DO
IO.PutF1[st, "\n split%d[];", [cardinal[i]]];
ENDLOOP;
};
IO.PutRope[st, "\n RETURN [tab];\n };\n"];
};
PutProc:
PROC [type:
ROPE] = {
IO.PutRope[st, "\nInit"];
IO.PutRope[st, type];
IF cedar
THEN IO.PutRope[st, ": PUBLIC PROC RETURNS ["]
ELSE IO.PutRope[st, ": PUBLIC PROC [uz: UNCOUNTED ZONE] RETURNS ["];
IO.PutRope[st, type];
IO.PutRope[st, "Ref] = {\n"];
};
PutAlloc:
PROC [type:
ROPE, cons:
BOOL ←
FALSE, count:
CARDINAL ← 0, all:
ROPE ←
NIL] = {
IO.PutF[st, " tab: %gRef ← %gNEW[%g", [rope[type]], [rope[zone]], [rope[type]] ];
IF cons
THEN {
IO.PutRope[st, " ← [\n"];
IF count # 0 THEN IO.PutF1[st, " -- %d entries\n", [cardinal[count]] ];
RETURN;
};
IF all = NIL
THEN {
IF count # 0 THEN IO.PutF1[st, "[%d]", [cardinal[count]] ];
IO.PutRope[st, "];\n"];
}
ELSE {
IO.PutF1[st, " ← ALL[%g]];\n", [rope[all]] ];
IF count # 0 THEN IO.PutF1[st, " -- %d entries\n", [cardinal[count]] ];
};
};
PutRtn:
PROC [cons:
BOOL ←
TRUE] = {
IF cons THEN IO.PutRope[st, "]];\n"];
IO.PutRope[st, " RETURN [tab];\n };\n"];
};
PutWord:
PROC [i:
CARDINAL, w:
WORD] = {
IF i # 0 THEN IO.PutChar[st, ',];
IF (i MOD 10) = 0 THEN IO.PutF1[st, "\n -- %d\n ", [cardinal[i]]]
ELSE IO.PutChar[st, ' ];
IO.Put[st, [cardinal[w]]];
};
PutErrorMsg:
PROC [i:
CARDINAL, e: NPGSTypes.ErrorType] = {
IF i # 0 THEN IO.PutChar[st, ',];
IF (i MOD 10) = 0 THEN IO.PutF1[st, "\n -- %d\n ", [cardinal[i]]]
ELSE IO.PutChar[st, ' ];
IO.PutRope[st, errMsgStr[e]];
};
st: IO.STREAM;
defaultLim: CARDINAL;
lagItem: NPGSTypes.ItemRec;
needSplits: BOOL ← FALSE;
sinceSplit: CARDINAL ← 0;
splitNum: CARDINAL ← 0;
zone: ROPE ← IF cedar THEN NIL ELSE "uz.";
IF NPGSConDefs.eofMark > 255 THEN Error[1];
defaultLim ← NPGSConDefs.totalTokens-NPGSConDefs.eofMark+1;
IF defaultLim > 255 THEN Error[2];
IF NPGSConDefs.pssLim > 2047 THEN Error[3];
IF NPGSConDefs.rhsLim > 15 THEN Error[4];
IF ~success THEN RETURN [success];
ntab ← NPGSConDefs.MakeTab[NPGSConDefs.ntEntries];
ttab ← NPGSConDefs.MakeTab[NPGSConDefs.tEntries];
statedata ← NPGSConDefs.MakeStateData[NPGSConDefs.sLim];
ntdefaults ← NPGSConDefs.MakeNTDefaults[defaultLim+1];
column ← NPGSConDefs.MakeColumn[NPGSConDefs.ntEntries+1];
TableSetup[]; NPGSConDefs.closewordstream[]; SquashNTab[];
OutString["\nParse Table Data\n"];
IF NPGSConDefs.flags[printLALR] THEN {PrintNDef[]; TableOverlays[]};
vocabindex ← NPGSConDefs.MakeVocabIndex[NPGSConDefs.eofMark+1];
hashval ← 3*NPGSConDefs.eofMark/2;
hashval ← MIN[251, IF hashval MOD 2 = 0 THEN hashval+1 ELSE hashval];
hashtab ← NPGSConDefs.MakeHashTab[hashval+1];
HashTabSetup[];
start output file
NPGSConDefs.openwordstream[scratch: FALSE];
Output header of the implementation file
st ← NPGSConDefs.tabStream;
IO.PutF1[st, "-- %gImpl.mesa\n", [rope[NPGSConDefs.typeName]] ];
IO.PutF[st, " -- an NPGS production from %g, %g.\n\n",
[rope[NPGSConDefs.sourceName]], [time[BasicTime.Now[]]] ];
IO.PutF1[st, "DIRECTORY %g;\n\n", [rope[NPGSConDefs.typeName]] ];
IO.PutF1[st, "%gImpl: ", [rope[NPGSConDefs.typeName]]];
IF cedar THEN IO.PutF1[st, "CEDAR "];
IO.PutF1[st, "PROGRAM\n EXPORTS %g\n", [rope[NPGSConDefs.typeName]] ];
IO.PutF1[st, " = { OPEN %g;\n", [rope[NPGSConDefs.typeName]] ];
StatePartition[]; -- compute lastntstate
PutProc["ScanTable"];
PutAlloc[type: "ScanTable", count: ScanTabIndex.LAST-ScanTabIndex.FIRST-1, all: "0"];
FOR i: ScanTabIndex
IN ScanTabIndex
DO
w: WORD ← scantab[i];
IF w # 0 THEN IO.PutF[st, " tab[%bC] ← %d;\n", [cardinal[i]], [cardinal[w]]];
ENDLOOP;
PutRtn[FALSE];
PutProc["HashTable"];
IO.PutRope[st, " null: VocabHashEntry = [0, 0];\n"];
PutAlloc[type: "HashTable", count: hashval+1, all: "null"];
FOR i:
CARDINAL
IN [0..hashval]
DO
w: NPGSTypes.HashTabRec ← hashtab[i];
IF w # [0, 0] THEN
IO.PutF[st, " tab[%d] ← [%d, %d];\n",
[cardinal[i]], [cardinal[w.symPtr]], [cardinal[w.link]]];
ENDLOOP;
PutRtn[FALSE];
PutProc["IndexTable"];
PutAlloc[type: "IndexTable", cons: TRUE, count: NPGSConDefs.eofMark+1];
IO.PutF1[st, " %d", [cardinal[vocabindex[0]]]];
FOR i:
CARDINAL
IN [1..NPGSConDefs.eofMark]
DO
w: WORD ← vocabindex[i];
PutWord[i, w];
ENDLOOP;
PutRtn[];
PutProc["Vocabulary"];
IO.PutRope[st, " i: CARDINAL ← 0;\n"];
IF cedar
THEN IO.PutRope[st, " appText: PROC [r: REF TEXT] = {\n"]
ELSE IO.PutRope[st, " appText: PROC [r: STRING] = {\n"];
IO.PutRope[st, " FOR k: NAT IN [0..r.length) DO tab[i+k] ← r[k]; ENDLOOP;\n"];
IO.PutRope[st, " i ← i + r.length;\n"];
IO.PutRope[st, " };\n"];
PutAlloc[type: "Vocabulary", count: vocabspace];
IO.PutF1[st, " -- %d chars\n", [cardinal[vocabspace]]];
FOR i:
CARDINAL
IN [0..vocabspace)
DO
c: CHAR ← NPGSConDefs.symTab[i];
IF (i
MOD 50) = 0
THEN {
IF i # 0 THEN IO.PutRope[st, "\"];\n"];
IO.PutF1[st, " -- %d\n", [cardinal[i]]];
IO.PutRope[st, " appText[\""];
};
SELECT c
FROM
< 10C => IO.PutF1[st, "\\00%b", [cardinal[c.ORD]]];
< 40C => IO.PutF1[st, "\\0%b", [cardinal[c.ORD]]];
< 177C => IO.PutChar[st, c];
ENDCASE => IO.PutF1[st, "\\%b", [cardinal[c.ORD]]];
ENDLOOP;
IO.PutRope[st, "\"];\n tab.length ← i;\n"];
PutRtn[FALSE];
hashtab ← NIL;
vocabindex ← NIL;
NPGSConDefs.symInfo ← NIL;
renumber ← NPGSConDefs.MakeRenumber[NPGSConDefs.sLim];
StateRenumber[cusp];
PutProc["ProdData"];
IO.PutRope[st, " i: CARDINAL ← 1;\n"];
IO.PutRope[st, " lag: ProductionInfo ← [0, 0];\n"];
IO.PutRope[st, " dup: PROC = {tab[i] ← lag; i ← i + 1};\n"];
IO.PutRope[st, " appR: PROC [r: CARDINAL] = {lag.rule ← r; tab[i] ← lag; i ← i + 1};\n"];
IO.PutRope[st, " appL: PROC [lhs: CARDINAL] = {lag.lhs ← lhs; tab[i] ← lag; i ← i + 1};\n"];
IO.PutRope[st, " appRL: PROC [r, lhs: CARDINAL] = {tab[i] ← lag ← [r, lhs]; i ← i + 1};\n"];
PutAlloc[type: "ProdData", count: NPGSConDefs.numProd+1, all: "lag"];
IO.PutRope[st, " "];
{
lag: NPGSTypes.ProdEntry ← NPGSTypes.nullProdEntry;
FOR i:
CARDINAL
IN [1..NPGSConDefs.numProd]
DO
w: NPGSTypes.ProdEntry = NPGSConDefs.prodInfo[i];
wr: CARDINAL ← w.rule;
wl: CARDINAL ← w.lhs-NPGSConDefs.eofMark+1;
IF i MOD 5 = 0 THEN
IO.PutF1[st, "\n -- %d\n ", [cardinal[i]] ];
SELECT
TRUE
FROM
lag.rule # w.rule AND lag.lhs # w.lhs =>
IO.PutF[st, " appRL[%d, %d];", [cardinal[wr]], [cardinal[wl]] ];
lag.rule # w.rule =>
IO.PutF1[st, " appR[%d];", [cardinal[wr]] ];
lag.lhs # w.lhs =>
IO.PutF1[st, " appL[%d];", [cardinal[wl]] ];
ENDCASE =>
IO.PutRope[st, " dup[];"];
lag ← w;
ENDLOOP;
};
PutRtn[FALSE];
PutProc["NStarts"];
PutAlloc[type: "NStarts", cons: TRUE, count: lastntstate+1];
IO.PutF1[st, " %d", [cardinal[0]]];
FOR i:
CARDINAL
IN [1..lastntstate]
DO
w: WORD = statedata[i].ntIndex;
PutWord[i, w];
ENDLOOP;
PutRtn[];
PutProc["NLengths"];
PutAlloc[type: "NLengths", cons: TRUE, count: lastntstate+1];
IO.PutF1[st, " %d", [cardinal[0]] ];
FOR i:
CARDINAL
IN [1..lastntstate]
DO
w: WORD = statedata[i].ntLink;
PutWord[i, w];
ENDLOOP;
PutRtn[];
PutProc["NSymbols"];
PutAlloc[type: "NSymbols", cons: TRUE, count: nlim];
IO.PutF1[st, " %d", [cardinal[ntab[0].symbol]]];
FOR i:
CARDINAL
IN [1..nlim)
DO
w: WORD ← ntab[i].symbol;
PutWord[i, w];
ENDLOOP;
PutRtn[];
PutProc["NActions"];
PrefixItem[0, nlim];
IO.PutRope[st, " null: ActionEntry ← [[FALSE, 0], 0];\n"];
PutAlloc[type: "NActions", count: nlim, all: "null"];
FOR i:
CARDINAL
IN [0..nlim)
DO
PutItem[i, ntab[i].item, 0];
ENDLOOP;
PostfixItem[];
PutProc["NTDefaults"];
PrefixItem[2, defaultLim+1];
IO.PutRope[st, " null: ActionEntry ← [[FALSE, 0], 0];\n"];
PutAlloc[type: "NTDefaults", count: defaultLim+1, all: "null"];
<<IO.PutF1[st, " -- %d entries", [cardinal[defaultLim+1]]];>>
FOR i:
CARDINAL
IN [2..defaultLim]
DO
PutItem[i, ntdefaults[i].item, 2];
ENDLOOP;
PostfixItem[];
PutProc["TStarts"];
PutAlloc[type: "TStarts", cons: TRUE, count: NPGSConDefs.sLim];
IO.PutRope[st, " 0"];
FOR i:
CARDINAL
IN [1..NPGSConDefs.sLim)
DO
w: WORD ← statedata[i].tIndex;
PutWord[i, w];
ENDLOOP;
PutRtn[];
PutProc["TLengths"];
PutAlloc[type: "TLengths", cons: TRUE, count: NPGSConDefs.sLim];
IO.PutRope[st, " 0"];
FOR i:
CARDINAL
IN [1..NPGSConDefs.sLim)
DO
w: WORD ← statedata[i].tLink;
PutWord[i, w];
ENDLOOP;
PutRtn[];
-- new for CUSP
IF cusp THEN {
PutProc["ErrorMsgs"];
PutAlloc[type: "ErrorMsgs", cons: TRUE, count: NPGSConDefs.sLim];
IO.PutRope[st, " tl"];
FOR i:
CARDINAL
IN [1..NPGSConDefs.sLim)
DO
e: NPGSTypes.ErrorType ← NPGSConDefs.CuspPreGetErrorMsg[i];
PutErrorMsg[i, e];
ENDLOOP;
NPGSConDefs.CuspPreClearErrorMsgArray[];
PutRtn[];
};
-- end of CUSP additions
PutProc["TSymbols"];
PutAlloc[type: "TSymbols", cons: TRUE, count: tlim];
IO.PutF1[st, " %d", [cardinal[ttab[0].symbol]]];
FOR i:
CARDINAL
IN [1..tlim)
DO
w: WORD ← ttab[i].symbol;
PutWord[i, w];
ENDLOOP;
PutRtn[];
PutProc["TActions"];
PrefixItem[0, tlim];
IO.PutRope[st, " null: ActionEntry ← [[FALSE, 0], 0];\n"];
PutAlloc[type: "TActions", count: tlim, all: "null"];
FOR i:
CARDINAL
IN [0..tlim)
DO
PutItem[i, ttab[i].item, 0];
ENDLOOP;
PostfixItem[];
IO.PutRope[st, "\n}.\n"];
NPGSConDefs.prodInfo ← NIL; ntab ← NIL;
ntdefaults ← NIL; renumber ← NIL;
statedata ← NIL; ttab ← NIL;
scantab ← NIL;
};
OutModule:
PUBLIC
PROC [cedar:
BOOL, cusp:
BOOL] = {
i,j,k: CARDINAL;
OutCuspErrorType:
PROC = {
OutString[" ErrorType: TYPE = {MAgg, MCalled, MDotLB, MExpr, MId, MOpd,\n"];
OutString[" MOptn, MRArrow, MThe, MTxt, MTypeId, MFieldTypeId, CloseIconExpr,\n"];
OutString[" CopyIconExpr, MoveIconExpr, SelectIconExpr, IconExpr,\n"];
OutString[" Stmt, MSecs, tl};\n"];
};
OutRange:
PROC [id, cover: Rope.
ROPE, ulim:
CARDINAL] = {
NPGSConDefs.outchar[' ,2]; NPGSConDefs.outstring[id]; OutString[": TYPE = "];
IF cover = NIL THEN OutString["CARDINAL"] ELSE NPGSConDefs.outstring[cover];
OutString["[0.."]; NPGSConDefs.outnum[ulim,1]; OutString["];\n"];
};
OutArray:
PROC [id, index, range: Rope.
ROPE] = {
NPGSConDefs.outchar[' ,2]; NPGSConDefs.outstring[id]; OutString[": TYPE = ARRAY "];
NPGSConDefs.outstring[index]; OutString[" OF "]; NPGSConDefs.outstring[range];
NPGSConDefs.outchar[';,1]; NPGSConDefs.outeol[1];
};
OutRefProc:
PROC [referent: Rope.
ROPE] = {
First, output the type definition
NPGSConDefs.outchar[' ,2];
NPGSConDefs.outstring[referent];
IF cedar
THEN OutString["Ref: TYPE = REF "]
ELSE OutString["Ref: TYPE = LONG POINTER TO "];
NPGSConDefs.outstring[referent];
OutString[";"];
NPGSConDefs.outeol[1];
Second output the procedure to call for initialization
NPGSConDefs.outchar[' ,2];
OutString["Init"];
NPGSConDefs.outstring[referent];
IF cedar
THEN OutString[": PROC RETURNS ["]
ELSE OutString[": PROC [uz: UNCOUNTED ZONE] RETURNS ["];
NPGSConDefs.outstring[referent];
OutString["Ref];"];
NPGSConDefs.outeol[2];
};
Output header of the definitions file
OutString["-- "];
NPGSConDefs.outstring[NPGSConDefs.modName];
NPGSConDefs.outeol[1];
OutString["-- an NPGS production from "];
NPGSConDefs.outstring[NPGSConDefs.sourceName];
OutString[", "];
NPGSConDefs.outtime[];
NPGSConDefs.outeol[2];
NPGSConDefs.outstring[NPGSConDefs.typeName];
IF cedar
THEN OutString[": CEDAR DEFINITIONS = {\n\n"]
ELSE OutString[": DEFINITIONS = {\n\n"];
OutRange["Symbol", NIL, NPGSConDefs.maxSymbolIndex];
OutRange["TSymbol", "Symbol", NPGSConDefs.eofMark];
OutRange["NTSymbol", "Symbol", NPGSConDefs.totalTokens-NPGSConDefs.eofMark+1];
OutString["\n-- Token indices for the scanner and parser\n"];
FOR i
IN [0..NPGSConDefs.nextAlias)
DO
NPGSConDefs.outchar[' ,2]; k ← NPGSConDefs.aliases[i].alias*NPGSConDefs.tokenSize;
FOR j IN [k..k+NPGSConDefs.tokenSize) WHILE NPGSConDefs.symTab[j]#0c DO NPGSConDefs.outchar[NPGSConDefs.symTab[j],1] ENDLOOP;
OutString[": TSymbol ="]; NPGSConDefs.outnum[NPGSConDefs.aliases[i].terminal,3]; NPGSConDefs.outchar[';,1]; NPGSConDefs.outeol[1];
ENDLOOP;
NPGSConDefs.symTab ← NIL; NPGSConDefs.aliases ← NIL;
OutString["\n defaultMarker: TSymbol = TSymbol.FIRST;"];
OutString["\n endMarker: TSymbol = TSymbol.LAST;"];
NPGSConDefs.outeol[2];
OutRange["HashIndex", NIL, hashval];
OutRange["VIndex", NIL, vocabspace-1];
NPGSConDefs.outeol[1];
OutString["\n VocabHashEntry: TYPE = RECORD ["];
OutString["\n symbol: TSymbol, -- symbol index"];
OutString["\n link: HashIndex]; -- link to next entry"];
NPGSConDefs.outeol[2];
OutRange["State", NIL, NPGSConDefs.sLim-1];
OutRange["NTState", "State", lastntstate];
OutRange["TIndex", NIL, tlim-1];
OutRange["NTIndex", NIL, nlim-1];
OutRange["Production", NIL, NPGSConDefs.numProd];
OutRange["Rule", NIL, NPGSConDefs.numRules];
IF cusp THEN OutCuspErrorType[]; -- New for CUSP
OutString["\n ActionTag: TYPE = RECORD ["];
OutString["\n reduce: BOOL, -- TRUE iff reduce entry"];
OutString["\n pLength: [0..15]]; -- number of symbols in production rhs\n"];
OutString["\n ActionEntry: TYPE = RECORD ["];
OutString["\n tag: ActionTag, -- [FALSE,0] if a shift entry"];
OutString["\n transition: [0..2047]]; -- production number / next state\n"];
OutString["\n ProductionInfo: TYPE = RECORD ["];
OutString["\n rule: Rule, -- reduction rule"];
OutString["\n lhs: NTSymbol]; -- production lhs symbol\n\n"];
OutArray["ScanTable", "CHAR['\\040..'\\177]", "TSymbol"];
OutArray["HashTable", "HashIndex", "VocabHashEntry"];
OutArray["IndexTable", "TSymbol", "CARDINAL"];
OutString[" Vocabulary: TYPE = TEXT;\n"];
OutArray["ProdData","Production","ProductionInfo"];
OutArray["NStarts", "NTState", "NTIndex"];
OutArray["NLengths", "NTState", "CARDINAL"];
OutArray["NSymbols", "NTIndex", "NTSymbol"];
OutArray["NActions", "NTIndex", "ActionEntry"];
OutArray["NTDefaults", "NTSymbol", "ActionEntry"];
OutArray["TStarts", "State", "TIndex"];
OutArray["TLengths", "State", "CARDINAL"];
IF cusp THEN OutArray["ErrorMsgs", "State", "ErrorType"];
OutArray["TSymbols", "TIndex", "TSymbol"];
OutArray["TActions", "TIndex", "ActionEntry"];
NPGSConDefs.outeol[1];
OutString[" initialState: State = "]; NPGSConDefs.outnum[1,1]; NPGSConDefs.outchar[';,1];
NPGSConDefs.outeol[1];
OutString[" finalState: State = "]; NPGSConDefs.outnum[0,1]; NPGSConDefs.outchar[';,1];
NPGSConDefs.outeol[2];
OutRefProc["ScanTable"];
OutRefProc["HashTable"];
OutRefProc["IndexTable"];
OutRefProc["Vocabulary"];
OutRefProc["ProdData"];
OutRefProc["NStarts"];
OutRefProc["NLengths"];
OutRefProc["NSymbols"];
OutRefProc["NActions"];
OutRefProc["NTDefaults"];
OutRefProc["TStarts"];
OutRefProc["TLengths"];
IF cusp THEN OutRefProc["ErrorMsgs"];
OutRefProc["TSymbols"];
OutRefProc["TActions"];
OutString["\n}.\n"];
};
}.