|
|
1.1 ! root 1: /* (c) 1979 Regents of the University of California */ ! 2: #include <stdio.h> ! 3: # define _actsize 2500 ! 4: # define _memsize 3000 ! 5: # define _nstates 700 ! 6: # define _nterms 95 ! 7: # define _nprod 300 ! 8: # define _nnonterm 150 ! 9: # define _tempsize 700 ! 10: # define _cnamsz 3500 ! 11: # define _lsetsize 600 ! 12: # define _wsetsize 400 ! 13: ! 14: # define _tbitset 6 ! 15: ! 16: int tbitset; /* size of lookahed sets */ ! 17: int nolook = 0; /* flag to suppress lookahead computations */ ! 18: struct looksets { int lset[ _tbitset ]; } ; ! 19: struct item { int *pitem; } ; ! 20: ! 21: /* this file contains the definitions for most externally known data */ ! 22: ! 23: int nstate = 0; /* number of states */ ! 24: struct item *pstate[_nstates]; /* pointers to the descriptions of the states */ ! 25: int apstate[_nstates]; /* index to the actions for the states */ ! 26: int tystate[_nstates]; /* contains type information about the states */ ! 27: int stsize = _nstates; /* maximum number of states, at present */ ! 28: int memsiz = _memsize; /* maximum size for productions and states */ ! 29: int mem0[_memsize] ; /* production storage */ ! 30: int *mem = mem0; ! 31: int amem[_actsize]; /* action table storage */ ! 32: int actsiz = _actsize; /* action table size */ ! 33: int memact = 0; /* next free action table position */ ! 34: int nprod = 1; /* number of productions */ ! 35: int *prdptr[_nprod]; /* pointers to descriptions of productions */ ! 36: int prdlim = _nprod ; /* the maximum number of productions */ ! 37: /* levprd - productions levels to break conflicts */ ! 38: int levprd[_nprod] = {0,0}; ! 39: /* last two bits code associativity: ! 40: 0 = no definition ! 41: 1 = left associative ! 42: 2 = binary ! 43: 3 = right associative ! 44: bit 04 is 1 if the production has an action ! 45: the high 13 bits have the production level ! 46: */ ! 47: int nterms = 0; /* number of terminals */ ! 48: int tlim = _nterms ; /* the maximum number of terminals */ ! 49: /* the ascii representations of the terminals */ ! 50: int extval = 0; /* start of output values */ ! 51: struct sxxx1 {char *name; int value;} trmset[_nterms]; ! 52: char cnames[_cnamsz]; ! 53: int cnamsz = _cnamsz; ! 54: char *cnamp; ! 55: int maxtmp = _tempsize; /* the size of the temp1 array */ ! 56: int temp1[_tempsize]; /* temporary storage, indexed by terms + nterms or states */ ! 57: int temp2[_nnonterm]; /* temporary storage indexed by nonterminals */ ! 58: int trmlev[_nterms]; /* vector with the precedence of the terminals */ ! 59: /* The levels are the same as for levprd, but bit 04 is always 0 */ ! 60: /* the ascii representations of the nonterminals */ ! 61: struct sxxx2 { char *name; } nontrst[_nnonterm]; ! 62: int ntlim = _nnonterm ; /* limit to the number of nonterminals */ ! 63: int indgo[_nstates]; /* index to the stored goto table */ ! 64: int ***pres; /* vector of pointers to the productions yielding each nonterminal */ ! 65: struct looksets **pfirst; /* vector of pointers to first sets for each nonterminal */ ! 66: int *pempty = 0 ; /* table of nonterminals nontrivially deriving e */ ! 67: int nnonter = -1; /* the number of nonterminals */ ! 68: int lastred = 0; /* the number of the last reduction of a state */ ! 69: FILE *ftable; /* y.tab.c file */ ! 70: FILE *foutput; /* y.output file */ ! 71: int arrndx; /* used in the output of arrays on y.tab.c */ ! 72: int zzcwset = 0; ! 73: int zzpairs = 0; ! 74: int zzgoent = 0; ! 75: int zzgobest = 0; ! 76: int zzacent = 0; ! 77: int zzacsave = 0; ! 78: int zznsave = 0; ! 79: int zzclose = 0; ! 80: int zzsrconf = 0; ! 81: int zzrrconf = 0; ! 82: char *ctokn; ! 83: int lineno = 1; /* current input line number */ ! 84: int peekc = -1; /* look-ahead character */ ! 85: int tstates[ _nterms ]; /* states generated by terminal gotos */ ! 86: int ntstates[ _nnonterm ]; /* states generated by nonterminal gotos */ ! 87: int mstates[ _nstates ]; /* chain of overflows of term/nonterm generation lists */ ! 88: ! 89: struct looksets clset; ! 90: struct looksets lkst [ _lsetsize ]; ! 91: int nlset = 0; /* next lookahead set index */ ! 92: int lsetsz = _lsetsize; /* number of lookahead sets */ ! 93: ! 94: struct wset { int *pitem, flag, ws[_tbitset]; } wsets[ _wsetsize ]; ! 95: int cwset; ! 96: int wssize = _wsetsize; ! 97: ! 98: int numbval; /* the value of an input number */ ! 99: int rflag = 0; /* ratfor flag */ ! 100: int oflag = 0; /* optimization flag */ ! 101: ! 102: int ndefout = 3; /* number of defined symbols output */ ! 103: int nerrors = 0; /* number of errors */ ! 104: int fatfl = 1; /* if on, error is fatal */ ! 105: int machine; /* has a number describing the machine */ ! 106:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.