DIRECTORY PrincOps: TYPE USING [zLI4, zRFSL, zSHIFT, zWFSL]; PGSTypes: DEFINITIONS = { LongDes: TYPE = LONG DESCRIPTOR FOR ARRAY OF UNSPECIFIED; LongPointer: TYPE = LONG POINTER; Bit: PRIVATE TYPE = [0..1]; GetBit: PROC [word: LongPointer, bit: CARDINAL] RETURNS [Bit] = MACHINE CODE {PrincOps.zLI4; PrincOps.zSHIFT; PrincOps.zRFSL}; SetBit: PROC [v: Bit, word: LongPointer, bit: CARDINAL] = MACHINE CODE {PrincOps.zLI4; PrincOps.zSHIFT; PrincOps.zWFSL}; alternateLim: CARDINAL = 31; maxProd: CARDINAL = 500; maxRhsSymbols: CARDINAL = 2*maxProd; -- empirical relation maxRule: CARDINAL = 2047; --this is the current ProdInfo/PGSTab limit pssLim: CARDINAL = 1023; -- 10 bit field in itemrec to hold production, symbol rhsLim: CARDINAL = 15; --this is the current PGSTab limit, change the grammar? symTabSize: CARDINAL = 350; --symbol table size tokenSize: CARDINAL = 14; SymTab: TYPE = LONG DESCRIPTOR FOR PACKED ARRAY OF CHAR; SymTabEntry: TYPE = RECORD [ link: [0..symTabSize], length: [0..tokenSize], used: BOOL]; SymInfo: TYPE = LONG DESCRIPTOR FOR ARRAY OF SymTabEntry; AliasEntry: TYPE = RECORD [terminal, alias: CARDINAL]; Aliases: TYPE = LONG DESCRIPTOR FOR ARRAY OF AliasEntry; -- [0..63] TokenEntry: TYPE = RECORD [ count: [0..alternateLim], empty: BOOL, index: [0..maxProd]]; TokenInfo: TYPE = LONG DESCRIPTOR FOR ARRAY OF TokenEntry; ProdEntry: TYPE = RECORD [ count: [0..rhsLim], rule: [0..maxRule], chain: BOOL, lhs: [0..symTabSize], index: [0..maxRhsSymbols]]; ProdInfo: TYPE = LONG DESCRIPTOR FOR ARRAY OF ProdEntry; RhsChar: TYPE = LONG DESCRIPTOR FOR ARRAY OF CARDINAL; Options: TYPE = {echo, chain, lists, printLR, printLALR, first, ids}; StateInfoRec: TYPE = RECORD [link, nucleus, entries: CARDINAL]; StateInfo: TYPE = LONG DESCRIPTOR FOR ARRAY OF StateInfoRec; --[0,maxstatenum+1]; ItemRec: TYPE = RECORD [tag: [0..3], jf: [0..15], pss: [0..pssLim]]; Table: TYPE = LONG DESCRIPTOR FOR ARRAY OF ItemRec; --[0..maxtabentries] ChainRec: TYPE = RECORD [state, link: CARDINAL]; BackChain: TYPE= LONG DESCRIPTOR FOR ARRAY OF ChainRec; --[0..totalshifts] initially Stack: TYPE = LONG DESCRIPTOR FOR ARRAY OF CARDINAL; --[0..30) initially ChainStack: TYPE = LONG DESCRIPTOR FOR ARRAY OF CARDINAL; --[0..90) initially ContextRec: TYPE = RECORD [state, status, link: CARDINAL, item: ItemRec]; BitsInfo: TYPE = LONG DESCRIPTOR FOR ARRAY OF ContextRec; --[0..maxcontexts) BitString: TYPE = LONG DESCRIPTOR FOR ARRAY OF UNSPECIFIED; --[0..maxcontexts) FirstBits: TYPE = LONG DESCRIPTOR FOR ARRAY OF UNSPECIFIED; --[eofile+1..totaltokens] AttrVec: TYPE = LONG DESCRIPTOR FOR ARRAY OF CARDINAL; --[eofile+1..totaltokens] HashHeads: TYPE = ARRAY [0..60] OF CARDINAL; HashHeadsRef: TYPE = LONG POINTER TO HashHeads; HashTabRec: TYPE = MACHINE DEPENDENT RECORD [symPtr: [0..255], link: [0..255]]; HashTab: TYPE = LONG DESCRIPTOR FOR ARRAY OF HashTabRec; --[0..hashval] TabRec: TYPE = RECORD [symbol: CARDINAL, item: ItemRec]; TTab: TYPE = LONG DESCRIPTOR FOR ARRAY OF TabRec; --[0..tentries-1]; NTab: TYPE = LONG DESCRIPTOR FOR ARRAY OF TabRec; --[0..ntentries-1]; ColumnRec: TYPE = RECORD [link, count: CARDINAL, item: ItemRec]; Column: TYPE = LONG DESCRIPTOR FOR ARRAY OF ColumnRec; --[0..ntentries]; StateDataRec: TYPE = RECORD [tIndex, ntIndex: CARDINAL, tLink, ntLink: INTEGER]; StateData: TYPE = LONG DESCRIPTOR FOR ARRAY OF StateDataRec; --[0..slim-1]; NTDefaultRec: TYPE = RECORD [count: CARDINAL, item: ItemRec]; NTDefaults: TYPE = LONG DESCRIPTOR FOR ARRAY OF NTDefaultRec; Renumber: TYPE = LONG DESCRIPTOR FOR ARRAY OF CARDINAL; --[0..slim-1] VocabIndex: TYPE = LONG DESCRIPTOR FOR ARRAY OF CARDINAL; --[0..eofile-1] SInfoRec: TYPE = RECORD [symPtr, link, lhsHead: CARDINAL]; SInfo: TYPE = LONG DESCRIPTOR FOR ARRAY OF SInfoRec; --[0..symTabSize+1]; PInfoRec: TYPE = RECORD [rule: [0..77777B], chain: BOOL, link, rhsPtr: CARDINAL]; PInfo: TYPE = LONG DESCRIPTOR FOR ARRAY OF PInfoRec; --[0..maxProd+1]; }. Ìfile PGSTypes.Mesa last modified by Satterthwaite, November 2, 1982 10:38 am Last Edited by: Maxwell, August 8, 1983 11:15 am long/short differences appear here and in PGSParseTable uninterpreted pointers pointer-sensitive inlines data structures and associated types data structtures using the following types are built by PGSScan or state numbers, PGSTab allows an 11 bit field [0..(symTabSize+1)*tokensize) [0..symtabsize] (eofile..totaltokens] [0..maxProd] [0..maxRhsSymbols] types for LR(0) tables in PGSLALR after table is built, tag = 3 => pss is a nonterminal symbol, such an entry is followed by an entry: tag = 0 => pss is a next state number tag = 1 => pss is production number, scanreduce, jf=n[p] tag = 2 => pss is production number, reduce, jf=n[p] types for LALR(1) lookahead sets in PGSLALR types used internally by PGSLALR types used by PGSTab [0..totaltokens-eofile+1]; types used by PGSFormat (also uses SymTab, RhsChar, HashHeads, HashHeadsRef) Ê5˜Jšœ™Jšœ9™9J™0J˜šÏk ˜ Jšœ œœ˜2J˜—Jšœ œ˜˜Jšœ7™7J˜Jšœ™˜Jšœ œœ œœœœ œ˜9Jšœ œœœ˜!J˜—Jšœ™˜Jšœœœ ˜šÏnœœœœ˜?Jšœœ2˜>—šžœœ"œ˜9Jšœœ2˜>J˜J˜———Jšœ$™$˜Jšœ?™?˜Jšœœ˜Jšœ œ˜JšœœÏc˜;Jšœ œ Ÿ+˜Ešœœ Ÿ5˜NJšœ/™/—JšœœŸ7˜NJšœ œŸ˜/Jšœ œ˜J˜šœœœ œœœœœœ˜8Jšœ™—šœ œœ˜J˜J˜Jšœœ˜ —š œ œœ œœœœ ˜9Jšœ™J˜—Jšœ œœœ˜6Jšœ œœ œœœœ Ÿ ˜CJ˜šœ œœ˜J˜Jšœœ˜ J˜—š œ œœ œœœœ ˜:Jšœ™J˜—šœ œœ˜J˜J˜Jšœœ˜ J˜J˜—š œ œœ œœœœ ˜8Jšœ ™ J˜—šœ œœ œœœœœ˜6Jšœ™J˜—Jšœ œ8˜EJ˜—Jšœ!™!˜Jšœœœœ˜?Jšœ œœ œœœœŸ˜QJ˜Jšœ œœ.˜Dšœœœ œœœœ Ÿ˜HJšœ™JšœN™NJšœ%™%Jšœ8™8Jšœ4™4J˜—Jšœ+™+J˜Jšœ œœœ˜0Jšœ œœ œœœœ Ÿ˜TJ˜Jšœœœ œœœœœŸ˜IJšœ œœ œœœœœŸ˜PJ˜Jšœ œœœ˜IJšœ œœ œœœœŸ˜MJšœ œœ œœœœ œŸ˜OJšœ œœ œœœœ œŸ˜UJ˜Jšœ ™ J˜Jšœ œœ œœœœœŸ˜PJš œ œœ œœ˜,Jš œœœœœ ˜/J˜Jšœ™J˜Jš œ œœ œœ$˜OJšœ œœ œœœœ Ÿ˜HJ˜Jšœœœ œ˜8Jšœœœ œœœœ Ÿ˜EJšœœœ œœœœ Ÿ˜FJ˜Jšœ œœœ˜@Jšœœœ œœœœ Ÿ˜IJ˜Jš œœœœœ˜PJšœ œœ œœœœŸ˜LJ˜Jšœœœ œ˜=š œ œœ œœœœ˜=Jšœ™—Jšœ œœ œœœœœŸ ˜FJšœ œœ œœœœœŸ˜JJ˜JšœL™LJ˜Jšœ œœœ˜:Jšœœœ œœœœ Ÿ˜JJš œ œœœœ˜QJšœœœ œœœœ Ÿ˜GJ˜J˜J˜J˜———…—†‡