home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / alde_c / misc / comm / yaccunx / y1imp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1983-12-23  |  2.2 KB  |  64 lines

  1. /* Impure data used by modules originally in Y1.C. External declarations in Y1.H */
  2.  
  3. #define y1imp yes
  4. #include "dtxtrn.h"
  5.  
  6. /* lookahead computations */
  7.  
  8. int tbitset;  /* size of lookahead sets */
  9. struct looksets lkst [ LSETSIZE ];
  10. int nlset = 0; /* next lookahead set index */
  11. int nolook = 0; /* flag to suppress lookahead computations */
  12. struct looksets clset;  /* temporary storage for lookahead computations */
  13.  
  14. /* working set computations */
  15.  
  16. struct wset wsets[ WSETSIZE ];
  17. struct wset *cwp;
  18.  
  19. /* state information */
  20.  
  21. int nstate = 0;         /* number of states */
  22. struct item *pstate[NSTATES+2]; /* pointers to the descriptions of the states */
  23. int tystate[NSTATES];   /* contains type information about the states */
  24. int indgo[NSTATES];             /* index to the stored goto table */
  25. int tstates[ NTERMS ]; /* states generated by terminal gotos */
  26. int ntstates[ NNONTERM ]; /* states generated by nonterminal gotos */
  27. int mstates[ NSTATES ]; /* chain of overflows of term/nonterm generation lists  */
  28.  
  29. /* storage for the actions in the parser */
  30.  
  31. int amem[ACTSIZE];      /* action table storage */
  32. int *memp = amem;       /* next free action table position */
  33.  
  34. /* other storage areas */
  35.  
  36. int temp1[TEMPSIZE]; /* temporary storage, indexed by terms + ntokens or states */
  37. int lineno= 1; /* current input line number */
  38. int fatfl = 1;          /* if on, error is fatal */
  39. int nerrors = 0;        /* number of errors */
  40.  
  41. /* storage for information about the nonterminals */
  42.  
  43. int **pres[NNONTERM+2];  /* vector of pointers to productions yielding each nonterminal */
  44. struct looksets *pfirst[NNONTERM+2];  /* vector of pointers to first sets for each nonterminal */
  45. int pempty[NNONTERM+1];  /* vector of nonterminals nontrivially deriving e */
  46.  
  47. /* accumulators for statistics information */
  48.  
  49. struct wset *zzcwp = wsets;
  50. int zzgoent = 0;
  51. int zzgobest = 0;
  52. int zzacent = 0;
  53. int zzexcp = 0;
  54. int zzclose = 0;
  55. int zzsrconf = 0;
  56. int * zzmemsz = mem0;
  57. int zzrrconf = 0;
  58.  
  59. /* data pulled from internal static to here */
  60. /* declared external only in user module    */
  61.  
  62. int *pyield[NPROD];             /* from ycpres */
  63. char sarr[ISIZE];               /* from ywritm */
  64.