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