human readable error messages
[unix-history] / usr / src / old / lex / once.c
CommitLineData
ba3ad067
SL
1/* once.c 4.1 83/08/11 */
2 /* because of external definitions, this code should occur only once */
3# ifdef ASCII
4int ctable[2*NCH] = {
5 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
6 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
7 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
8 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
9 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
10 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
11 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
12 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
13 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
14 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
15100,101,102,103,104,105,106,107,108,109,
16110,111,112,113,114,115,116,117,118,119,
17120,121,122,123,124,125,126,127};
18# endif
19# ifdef EBCDIC
20int ctable[2*NCH] = {
21 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
22 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
23 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
24 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
25 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
26 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
27 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
28 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
29 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
30 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
31100,101,102,103,104,105,106,107,108,109,
32110,111,112,113,114,115,116,117,118,119,
33120,121,122,123,124,125,126,127,128,129,
34130,131,132,133,134,135,136,137,138,139,
35140,141,142,143,144,145,146,147,148,149,
36150,151,152,153,154,155,156,157,158,159,
37160,161,162,163,164,165,166,167,168,169,
38170,171,172,173,174,175,176,177,178,179,
39180,181,182,183,184,185,186,187,188,189,
40190,191,192,193,194,195,196,197,198,199,
41200,201,202,203,204,205,206,207,208,209,
42210,211,212,213,214,215,216,217,218,219,
43220,221,222,223,224,225,226,227,228,229,
44230,231,232,233,234,235,236,237,238,239,
45240,241,242,243,244,245,246,247,248,249,
46250,251,252,253,254,255};
47# endif
48int ZCH = NCH;
49FILE *fout = NULL, *errorf = {stdout};
50int sect = DEFSECTION;
51int prev = '\n'; /* previous input character */
52int pres = '\n'; /* present input character */
53int peek = '\n'; /* next input character */
54char *pushptr = pushc;
55char *slptr = slist;
56
57# if (unix || ibm)
58char *cname = "/usr/lib/lex/ncform";
59char *ratname = "/usr/lib/lex/nrform";
60# endif
61
62# ifdef gcos
63char *cname = "pounce/lexcform";
64char *ratname = "pounce/lexrform";
65# endif
66int ccount = 1;
67int casecount = 1;
68int aptr = 1;
69int nstates = NSTATES, maxpos = MAXPOS;
70int treesize = TREESIZE, ntrans = NTRANS;
71int yytop;
72int outsize = NOUTPUT;
73int sptr = 1;
74int optim = TRUE;
75int report = 2;
76int debug; /* 1 = on */
77int charc;
78int sargc;
79char **sargv;
80char buf[520];
81int ratfor; /* 1 = ratfor, 0 = C */
82int yyline; /* line number of file */
83int eof;
84int lgatflg;
85int divflg;
86int funcflag;
87int pflag;
88int chset; /* 1 = char set modified */
89FILE *fin, *fother;
90int fptr;
91int *name;
92int *left;
93int *right;
94int *parent;
95char *nullstr;
96int tptr;
97char pushc[TOKENSIZE];
98char slist[STARTSIZE];
99char **def, **subs, *dchar;
100char **sname, *schar;
101char *ccl;
102char *ccptr;
103char *dp, *sp;
104int dptr;
105char *bptr; /* store input position */
106char *tmpstat;
107int count;
108int **foll;
109int *nxtpos;
110int *positions;
111int *gotof;
112int *nexts;
113char *nchar;
114int **state;
115int *sfall; /* fallback state num */
116char *cpackflg; /* true if state has been character packed */
117int *atable;
118int nptr;
119char symbol[NCH];
120char cindex[NCH];
121int xstate;
122int stnum;
123char match[NCH];
124char extra[NACTIONS];
125char *pchar, *pcptr;
126int pchlen = TOKENSIZE;
127 long rcount;
128int *verify, *advance, *stoff;
129int scon;
130char *psave;
131int buserr(), segviol();