]> pd.if.org Git - pccts/blob - dlg/dlg_a.c
auto commit for import
[pccts] / dlg / dlg_a.c
1
2 /* parser.dlg -- DLG Description of scanner
3  *
4  * Generated from: dlg_p.g
5  *
6  * Terence Parr, Will Cohen, and Hank Dietz: 1989-1994
7  * Purdue University Electrical Engineering
8  * With AHPCRC, University of Minnesota
9  * ANTLR Version 1.32
10  */
11
12 #include <stdio.h>
13 #define ANTLR_VERSION   132
14
15 #include <ctype.h>
16 #include "dlg.h"
17 #ifdef MEMCHK
18 #include "trax.h"
19 #endif
20 #include "antlr.h"
21 #include "tokens.h"
22 #include "dlgdef.h"
23 LOOKAHEAD
24 void zzerraction()
25 {
26         (*zzerr)("invalid token");
27         zzadvance();
28         zzskip();
29 }
30 /*
31  * D L G tables
32  *
33  * Generated from: parser.dlg
34  *
35  * 1989-1994 by  Will Cohen, Terence Parr, and Hank Dietz
36  * Purdue University Electrical Engineering
37  * DLG Version 1.32
38  */
39
40 #include "mode.h"
41
42
43
44
45 int     func_action;            /* should actions be turned into functions?*/
46 int     lex_mode_counter = 0;   /* keeps track of the number of %%names */
47
48 static void act1()
49
50                 NLA = 1;
51         }
52
53
54 static void act2()
55
56                 NLA = 2;
57                 zzskip();   
58         }
59
60
61 static void act3()
62
63                 NLA = 3;
64                 zzline++; zzskip(); DAWDLE;   
65         }
66
67
68 static void act4()
69
70                 NLA = L_EOF;
71         }
72
73
74 static void act5()
75
76                 NLA = PER_PER;
77         }
78
79
80 static void act6()
81
82                 NLA = NAME_PER_PER;
83                 p_mode_def(&zzlextext[2],lex_mode_counter++);   
84         }
85
86
87 static void act7()
88
89                 NLA = ACTION;
90                 if (func_action)
91                 fprintf(OUT,"\n%s %sact%d()\n{ ",
92                 gen_cpp?"ANTLRTokenType":"static void",
93                 gen_cpp?ClassName("::"):"", ++action_no);
94                 zzmode(ACT); zzskip();
95         }
96
97
98 static void act8()
99
100                 NLA = GREAT_GREAT;
101         }
102
103
104 static void act9()
105
106                 NLA = L_BRACE;
107         }
108
109
110 static void act10()
111
112                 NLA = R_BRACE;
113         }
114
115
116 static void act11()
117
118                 NLA = L_PAR;
119         }
120
121
122 static void act12()
123
124                 NLA = R_PAR;
125         }
126
127
128 static void act13()
129
130                 NLA = L_BRACK;
131         }
132
133
134 static void act14()
135
136                 NLA = R_BRACK;
137         }
138
139
140 static void act15()
141
142                 NLA = ZERO_MORE;
143         }
144
145
146 static void act16()
147
148                 NLA = ONE_MORE;
149         }
150
151
152 static void act17()
153
154                 NLA = OR;
155         }
156
157
158 static void act18()
159
160                 NLA = RANGE;
161         }
162
163
164 static void act19()
165
166                 NLA = NOT;
167         }
168
169
170 static void act20()
171
172                 NLA = OCTAL_VALUE;
173                 {int t; sscanf(&zzlextext[1],"%o",&t); zzlextext[0] = t;}  
174         }
175
176
177 static void act21()
178
179                 NLA = HEX_VALUE;
180                 {int t; sscanf(&zzlextext[3],"%x",&t); zzlextext[0] = t;}  
181         }
182
183
184 static void act22()
185
186                 NLA = DEC_VALUE;
187                 {int t; sscanf(&zzlextext[1],"%d",&t); zzlextext[0] = t;}  
188         }
189
190
191 static void act23()
192
193                 NLA = TAB;
194                 zzlextext[0] = '\t';  
195         }
196
197
198 static void act24()
199
200                 NLA = NL;
201                 zzlextext[0] = '\n';  
202         }
203
204
205 static void act25()
206
207                 NLA = CR;
208                 zzlextext[0] = '\r';  
209         }
210
211
212 static void act26()
213
214                 NLA = BS;
215                 zzlextext[0] = '\b';  
216         }
217
218
219 static void act27()
220
221                 NLA = LIT;
222                 zzlextext[0] = zzlextext[1];  
223         }
224
225
226 static void act28()
227
228                 NLA = REGCHAR;
229         }
230
231 static unsigned char shift0[257] = {
232   0, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
233   1, 2, 29, 29, 1, 29, 29, 29, 29, 29, 
234   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
235   29, 29, 29, 1, 29, 29, 29, 29, 4, 29, 
236   29, 19, 20, 23, 24, 29, 26, 29, 29, 12, 
237   13, 13, 13, 13, 13, 13, 13, 14, 14, 29, 
238   29, 15, 29, 16, 29, 3, 7, 7, 7, 7, 
239   7, 7, 11, 11, 11, 11, 11, 11, 11, 11, 
240   11, 11, 11, 11, 11, 11, 11, 11, 11, 5, 
241   11, 11, 21, 28, 22, 29, 11, 29, 7, 6, 
242   7, 7, 7, 7, 11, 11, 11, 11, 11, 11, 
243   11, 9, 11, 11, 11, 10, 11, 8, 11, 11, 
244   11, 5, 11, 11, 17, 25, 18, 27, 29, 29, 
245   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
246   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
247   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
248   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
249   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
250   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
251   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
252   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
253   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
254   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
255   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
256   29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
257   29, 29, 29, 29, 29, 29, 29
258 };
259
260
261 static void act29()
262
263                 NLA = 1;
264                 error("unterminated action", zzline); zzmode(START);   
265         }
266
267
268 static void act30()
269
270                 NLA = ACTION;
271                 if (func_action) fprintf(OUT,"}\n\n");
272                 zzmode(START);
273         }
274
275
276 static void act31()
277
278                 NLA = 29;
279                 putc(zzlextext[0], OUT); zzskip();   
280         }
281
282
283 static void act32()
284
285                 NLA = 30;
286                 putc('>', OUT); zzskip();   
287         }
288
289
290 static void act33()
291
292                 NLA = 31;
293                 putc('\\', OUT); zzskip();   
294         }
295
296
297 static void act34()
298
299                 NLA = 32;
300                 putc(zzlextext[0], OUT); ++zzline; zzskip();   
301         }
302
303
304 static void act35()
305
306                 NLA = 33;
307                 fprintf(OUT, "%s", &(zzlextext[0])); zzskip();   
308         }
309
310 static unsigned char shift1[257] = {
311   0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
312   4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 
313   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
314   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
315   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
316   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
317   4, 4, 4, 1, 4, 4, 4, 4, 4, 4, 
318   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
319   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
320   4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 
321   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
322   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
323   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
324   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
325   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
326   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
327   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
328   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
329   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
330   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
331   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
332   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
333   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
334   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
335   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
336   4, 4, 4, 4, 4, 4, 4
337 };
338
339 #define DfaStates       46
340 typedef unsigned char DfaState;
341
342 static DfaState st0[31] = {
343   1, 2, 3, 4, 5, 6, 6, 6, 6, 6, 
344   6, 6, 6, 6, 6, 7, 8, 9, 10, 11, 
345   12, 13, 14, 15, 16, 17, 18, 19, 20, 6, 
346   46
347 };
348
349 static DfaState st1[31] = {
350   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
351   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
352   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
353   46
354 };
355
356 static DfaState st2[31] = {
357   46, 21, 46, 46, 46, 46, 46, 46, 46, 46, 
358   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
359   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
360   46
361 };
362
363 static DfaState st3[31] = {
364   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
365   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
366   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
367   46
368 };
369
370 static DfaState st4[31] = {
371   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
372   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
373   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
374   46
375 };
376
377 static DfaState st5[31] = {
378   46, 46, 46, 46, 22, 46, 46, 46, 46, 46, 
379   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
380   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
381   46
382 };
383
384 static DfaState st6[31] = {
385   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
386   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
387   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
388   46
389 };
390
391 static DfaState st7[31] = {
392   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
393   46, 46, 46, 46, 46, 23, 46, 46, 46, 46, 
394   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
395   46
396 };
397
398 static DfaState st8[31] = {
399   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
400   46, 46, 46, 46, 46, 46, 24, 46, 46, 46, 
401   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
402   46
403 };
404
405 static DfaState st9[31] = {
406   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
407   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
408   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
409   46
410 };
411
412 static DfaState st10[31] = {
413   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
414   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
415   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
416   46
417 };
418
419 static DfaState st11[31] = {
420   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
421   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
422   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
423   46
424 };
425
426 static DfaState st12[31] = {
427   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
428   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
429   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
430   46
431 };
432
433 static DfaState st13[31] = {
434   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
435   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
436   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
437   46
438 };
439
440 static DfaState st14[31] = {
441   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
442   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
443   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
444   46
445 };
446
447 static DfaState st15[31] = {
448   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
449   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
450   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
451   46
452 };
453
454 static DfaState st16[31] = {
455   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
456   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
457   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
458   46
459 };
460
461 static DfaState st17[31] = {
462   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
463   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
464   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
465   46
466 };
467
468 static DfaState st18[31] = {
469   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
470   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
471   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
472   46
473 };
474
475 static DfaState st19[31] = {
476   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
477   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
478   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
479   46
480 };
481
482 static DfaState st20[31] = {
483   46, 25, 25, 25, 25, 25, 26, 25, 27, 28, 
484   29, 25, 30, 31, 31, 25, 25, 25, 25, 25, 
485   25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 
486   46
487 };
488
489 static DfaState st21[31] = {
490   46, 21, 46, 46, 46, 46, 46, 46, 46, 46, 
491   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
492   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
493   46
494 };
495
496 static DfaState st22[31] = {
497   46, 46, 46, 46, 46, 32, 32, 32, 32, 32, 
498   32, 32, 46, 46, 46, 46, 46, 46, 46, 46, 
499   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
500   46
501 };
502
503 static DfaState st23[31] = {
504   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
505   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
506   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
507   46
508 };
509
510 static DfaState st24[31] = {
511   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
512   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
513   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
514   46
515 };
516
517 static DfaState st25[31] = {
518   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
519   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
520   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
521   46
522 };
523
524 static DfaState st26[31] = {
525   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
526   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
527   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
528   46
529 };
530
531 static DfaState st27[31] = {
532   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
533   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
534   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
535   46
536 };
537
538 static DfaState st28[31] = {
539   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
540   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
541   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
542   46
543 };
544
545 static DfaState st29[31] = {
546   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
547   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
548   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
549   46
550 };
551
552 static DfaState st30[31] = {
553   46, 46, 46, 46, 46, 33, 46, 46, 46, 46, 
554   46, 46, 34, 34, 46, 46, 46, 46, 46, 46, 
555   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
556   46
557 };
558
559 static DfaState st31[31] = {
560   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
561   46, 46, 35, 35, 35, 46, 46, 46, 46, 46, 
562   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
563   46
564 };
565
566 static DfaState st32[31] = {
567   46, 46, 46, 46, 46, 36, 36, 36, 36, 36, 
568   36, 36, 36, 36, 36, 46, 46, 46, 46, 46, 
569   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
570   46
571 };
572
573 static DfaState st33[31] = {
574   46, 46, 46, 46, 46, 46, 37, 37, 46, 46, 
575   46, 46, 37, 37, 37, 46, 46, 46, 46, 46, 
576   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
577   46
578 };
579
580 static DfaState st34[31] = {
581   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
582   46, 46, 34, 34, 46, 46, 46, 46, 46, 46, 
583   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
584   46
585 };
586
587 static DfaState st35[31] = {
588   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
589   46, 46, 35, 35, 35, 46, 46, 46, 46, 46, 
590   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
591   46
592 };
593
594 static DfaState st36[31] = {
595   46, 46, 46, 46, 46, 36, 36, 36, 36, 36, 
596   36, 36, 36, 36, 36, 46, 46, 46, 46, 46, 
597   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
598   46
599 };
600
601 static DfaState st37[31] = {
602   46, 46, 46, 46, 46, 46, 37, 37, 46, 46, 
603   46, 46, 37, 37, 37, 46, 46, 46, 46, 46, 
604   46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
605   46
606 };
607
608 static DfaState st38[6] = {
609   39, 40, 41, 42, 43, 46
610 };
611
612 static DfaState st39[6] = {
613   46, 46, 46, 46, 46, 46
614 };
615
616 static DfaState st40[6] = {
617   46, 44, 46, 46, 46, 46
618 };
619
620 static DfaState st41[6] = {
621   46, 45, 46, 46, 46, 46
622 };
623
624 static DfaState st42[6] = {
625   46, 46, 46, 46, 46, 46
626 };
627
628 static DfaState st43[6] = {
629   46, 46, 46, 46, 43, 46
630 };
631
632 static DfaState st44[6] = {
633   46, 46, 46, 46, 46, 46
634 };
635
636 static DfaState st45[6] = {
637   46, 46, 46, 46, 46, 46
638 };
639
640
641 DfaState *dfa[46] = {
642         st0,
643         st1,
644         st2,
645         st3,
646         st4,
647         st5,
648         st6,
649         st7,
650         st8,
651         st9,
652         st10,
653         st11,
654         st12,
655         st13,
656         st14,
657         st15,
658         st16,
659         st17,
660         st18,
661         st19,
662         st20,
663         st21,
664         st22,
665         st23,
666         st24,
667         st25,
668         st26,
669         st27,
670         st28,
671         st29,
672         st30,
673         st31,
674         st32,
675         st33,
676         st34,
677         st35,
678         st36,
679         st37,
680         st38,
681         st39,
682         st40,
683         st41,
684         st42,
685         st43,
686         st44,
687         st45
688 };
689
690
691 DfaState accepts[47] = {
692   0, 1, 2, 3, 4, 28, 28, 28, 28, 9, 
693   10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 
694   0, 2, 5, 7, 8, 27, 26, 23, 24, 25, 
695   20, 22, 6, 0, 20, 22, 6, 21, 0, 29, 
696   31, 33, 34, 35, 30, 32, 0
697 };
698
699 void (*actions[36])() = {
700         zzerraction,
701         act1,
702         act2,
703         act3,
704         act4,
705         act5,
706         act6,
707         act7,
708         act8,
709         act9,
710         act10,
711         act11,
712         act12,
713         act13,
714         act14,
715         act15,
716         act16,
717         act17,
718         act18,
719         act19,
720         act20,
721         act21,
722         act22,
723         act23,
724         act24,
725         act25,
726         act26,
727         act27,
728         act28,
729         act29,
730         act30,
731         act31,
732         act32,
733         act33,
734         act34,
735         act35
736 };
737
738 static DfaState dfa_base[] = {
739         0,
740         38
741 };
742
743 static unsigned char *b_class_no[] = {
744         shift0,
745         shift1
746 };
747
748
749
750 #define ZZSHIFT(c) (b_class_no[zzauto][1+c])
751 #define MAX_MODE 2
752 #include "dlgauto.h"