|
|
1.1 root 1: # include "stdio.h"
2: # define U(x) x
3: # define NLSTATE yyprevious=YYNEWLINE
4: # define BEGIN yybgin = yysvec + 1 +
5: # define INITIAL 0
6: # define YYLERR yysvec
7: # define YYSTATE (yyestate-yysvec-1)
8: # define YYOPTIM 1
1.1.1.2 ! root 9: # define YYLMAX BUFSIZ
1.1 root 10: # define output(c) putc(c,yyout)
11: # define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
12: # define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
13: # define yymore() (yymorfg=1)
14: # define ECHO fprintf(yyout, "%s",yytext)
15: # define REJECT { nstr = yyreject(); goto yyfussy;}
16: int yyleng; extern char yytext[];
17: int yymorfg;
18: extern char *yysptr, yysbuf[];
19: int yytchar;
1.1.1.2 ! root 20: FILE *yyin = {stdin}, *yyout = {stdout};
1.1 root 21: extern int yylineno;
22: struct yysvf {
23: struct yywork *yystoff;
24: struct yysvf *yyother;
25: int *yystops;};
26: struct yysvf *yyestate;
27: extern struct yysvf yysvec[], *yybgin;
28: int skipping;
29: # define YYNEWLINE 10
30: yylex(){
31: int nstr; extern int yyprevious;
32: while((nstr = yylook()) >= 0)
33: yyfussy: switch(nstr){
34: case 0:
35: if(yywrap()) return(0); break;
36: case 1:
37: {skipping = 1;}
38: break;
39: case 2:
40: {skipping = 0;}
41: break;
42: case 3:
43: {extern int brkcount;
44: if (! skipping)
45: if (++brkcount == 2)
46: return(0); /* end-of-file */
47: else
48: return(DEFBRK);
49: }
50: break;
51: case 4:
52: {if (! skipping) return(COLON);}
53: break;
54: case 5:
55: {if (! skipping) return(OCTAL);}
56: break;
57: case 6:
58: {if (! skipping) return(INTEGER);}
59: break;
60: case 7:
61: {if (! skipping) return(IS);}
62: break;
63: case 8:
64: {if (! skipping) return(ON);}
65: break;
66: case 9:
67: ;
68: break;
69: case 10:
70: {if (! skipping) return(IINT);}
71: break;
72: case 11:
73: {if (! skipping) return(IINT);}
74: break;
75: case 12:
76: {if (! skipping) return(OINT);}
77: break;
78: case 13:
79: {if (! skipping) return(OINT);}
80: break;
81: case 14:
82: {if (! skipping) return(CSR);}
83: break;
84: case 15:
85: {if (! skipping) return(CSR);}
86: break;
87: case 16:
88: {if (! skipping) return(IVEC);}
89: break;
90: case 17:
91: {if (! skipping) return(IVEC);}
92: break;
93: case 18:
94: {if (! skipping) return(OVEC);}
95: break;
96: case 19:
97: {if (! skipping) return(OVEC);}
98: break;
99: case 20:
100: {if (! skipping) return(INIT);}
101: break;
102: case 21:
103: {if (! skipping) return(INIT);}
104: break;
105: case 22:
106: {if (! skipping) return(OPEN);}
107: break;
108: case 23:
109: {if (! skipping) return(OPEN);}
110: break;
111: case 24:
112: {if (! skipping) return(CLOSE);}
113: break;
114: case 25:
115: {if (! skipping) return(CLOSE);}
116: break;
117: case 26:
118: {if (! skipping) return(READ);}
119: break;
120: case 27:
121: {if (! skipping) return(READ);}
122: break;
123: case 28:
124: {if (! skipping) return(GETC);}
125: break;
126: case 29:
127: {if (! skipping) return(GETC);}
128: break;
129: case 30:
130: {if (! skipping) return(PUTC);}
131: break;
132: case 31:
133: {if (! skipping) return(PUTC);}
134: break;
135: case 32:
136: {if (! skipping) return(WRITE);}
137: break;
138: case 33:
139: {if (! skipping) return(WRITE);}
140: break;
141: case 34:
142: {if (! skipping) return(SEEK);}
143: break;
144: case 35:
145: {if (! skipping) return(SEEK);}
146: break;
147: case 36:
148: {if (! skipping) return(CNTL);}
149: break;
150: case 37:
151: {if (! skipping) return(CNTL);}
152: break;
153: case 38:
154: ;
155: break;
156: case 39:
157: {extern int linectr;
158: linectr++;
159: }
160: break;
161: case 40:
162: {if (! skipping) return(IDENT);}
163: break;
164: case 41:
165: {if (! skipping) return(yytext[0]);}
166: break;
167: case -1:
168: break;
169: default:
170: fprintf(yyout,"bad switch yylook %d",nstr);
171: } return(0); }
172: /* end of yylex */
1.1.1.2 ! root 173: int yyvstop[] = {
1.1 root 174: 0,
175:
176: 41,
177: 0,
178:
179: 38,
180: 41,
181: 0,
182:
183: 39,
184: 0,
185:
186: 3,
187: 41,
188: 0,
189:
190: 41,
191: 0,
192:
193: 41,
194: 0,
195:
196: 41,
197: 0,
198:
199: 5,
200: 41,
201: 0,
202:
203: 41,
204: 0,
205:
206: 4,
207: 41,
208: 0,
209:
210: 9,
211: 41,
212: 0,
213:
214: 40,
215: 41,
216: 0,
217:
218: 25,
219: 40,
220: 41,
221: 0,
222:
223: 29,
224: 40,
225: 41,
226: 0,
227:
228: 21,
229: 40,
230: 41,
231: 0,
232:
233: 37,
234: 40,
235: 41,
236: 0,
237:
238: 23,
239: 40,
240: 41,
241: 0,
242:
243: 31,
244: 40,
245: 41,
246: 0,
247:
248: 27,
249: 40,
250: 41,
251: 0,
252:
253: 35,
254: 40,
255: 41,
256: 0,
257:
258: 33,
259: 40,
260: 41,
261: 0,
262:
263: 38,
264: 0,
265:
266: 2,
267: 0,
268:
269: 24,
270: 0,
271:
272: 28,
273: 0,
274:
275: 20,
276: 0,
277:
278: 36,
279: 0,
280:
281: 22,
282: 0,
283:
284: 30,
285: 0,
286:
287: 26,
288: 0,
289:
290: 34,
291: 0,
292:
293: 32,
294: 0,
295:
296: 1,
297: 0,
298:
299: 5,
300: 0,
301:
302: 6,
303: 0,
304:
305: 40,
306: 0,
307:
308: 40,
309: 0,
310:
311: 40,
312: 0,
313:
314: 7,
315: 40,
316: 0,
317:
318: 40,
319: 0,
320:
321: 40,
322: 0,
323:
324: 8,
325: 40,
326: 0,
327:
328: 40,
329: 0,
330:
331: 15,
332: 40,
333: 0,
334:
335: 40,
336: 0,
337:
338: 40,
339: 0,
340:
341: 40,
342: 0,
343:
344: 40,
345: 0,
346:
347: 14,
348: 0,
349:
350: 10,
351: 40,
352: 0,
353:
354: 17,
355: 40,
356: 0,
357:
358: 12,
359: 40,
360: 0,
361:
362: 19,
363: 40,
364: 0,
365:
366: 11,
367: 0,
368:
369: 16,
370: 0,
371:
372: 13,
373: 0,
374:
375: 18,
376: 0,
377: 0};
378: # define YYTYPE char
1.1.1.2 ! root 379: struct yywork { YYTYPE verify, advance; } yycrank[] = {
1.1 root 380: 0,0, 0,0, 1,3, 0,0,
381: 0,0, 0,0, 0,0, 0,0,
382: 0,0, 0,0, 1,4, 1,5,
383: 0,0, 4,24, 0,0, 0,0,
384: 0,0, 0,0, 0,0, 0,0,
385: 0,0, 0,0, 0,0, 0,0,
386: 0,0, 0,0, 0,0, 0,0,
387: 0,0, 0,0, 0,0, 0,0,
388: 0,0, 0,0, 0,0, 0,0,
389: 4,24, 0,0, 1,6, 0,0,
390: 0,0, 0,0, 0,0, 1,7,
391: 0,0, 0,0, 1,8, 9,35,
392: 1,9, 1,10, 1,11, 7,25,
393: 0,0, 0,0, 0,0, 2,6,
394: 0,0, 0,0, 0,0, 1,12,
395: 2,7, 0,0, 1,13, 2,8,
396: 0,0, 2,9, 1,14, 0,0,
397: 0,0, 0,0, 0,0, 0,0,
398: 0,0, 0,0, 0,0, 0,0,
399: 2,12, 0,0, 0,0, 2,13,
400: 10,36, 10,36, 10,36, 10,36,
401: 10,36, 10,36, 10,36, 10,36,
402: 10,36, 10,36, 11,37, 11,37,
403: 11,37, 11,37, 11,37, 11,37,
404: 11,37, 11,37, 11,37, 11,37,
405: 1,15, 0,0, 0,0, 0,0,
406: 1,16, 0,0, 1,17, 0,0,
407: 0,0, 0,0, 0,0, 1,18,
408: 1,19, 1,20, 17,40, 1,21,
409: 1,22, 2,15, 42,53, 15,39,
410: 1,23, 2,16, 28,47, 2,17,
411: 17,41, 26,46, 19,43, 17,42,
412: 2,18, 2,19, 2,20, 19,44,
413: 2,21, 2,22, 8,26, 28,48,
414: 39,51, 2,23, 8,27, 19,45,
415: 8,28, 40,52, 43,54, 45,55,
416: 46,56, 8,29, 8,30, 8,31,
417: 47,57, 8,32, 8,33, 48,58,
418: 30,49, 49,59, 8,34, 14,38,
419: 14,38, 14,38, 14,38, 14,38,
420: 14,38, 14,38, 14,38, 14,38,
421: 14,38, 30,50, 50,60, 52,61,
422: 53,62, 54,63, 55,64, 57,65,
423: 14,38, 14,38, 14,38, 14,38,
424: 14,38, 14,38, 14,38, 14,38,
425: 14,38, 14,38, 14,38, 14,38,
426: 14,38, 14,38, 14,38, 14,38,
427: 14,38, 14,38, 14,38, 14,38,
428: 14,38, 14,38, 14,38, 14,38,
429: 14,38, 14,38, 58,66, 59,67,
430: 60,68, 0,0, 14,38, 0,0,
431: 14,38, 14,38, 14,38, 14,38,
432: 14,38, 14,38, 14,38, 14,38,
433: 14,38, 14,38, 14,38, 14,38,
434: 14,38, 14,38, 14,38, 14,38,
435: 14,38, 14,38, 14,38, 14,38,
436: 14,38, 14,38, 14,38, 14,38,
437: 14,38, 14,38, 0,0, 0,0,
438: 0,0};
1.1.1.2 ! root 439: struct yysvf yysvec[] = {
1.1 root 440: 0, 0, 0,
441: yycrank+-1, 0, 0,
442: yycrank+-18, yysvec+1, 0,
443: yycrank+0, 0, yyvstop+1,
444: yycrank+4, 0, yyvstop+3,
445: yycrank+0, 0, yyvstop+6,
446: yycrank+0, 0, yyvstop+8,
447: yycrank+4, 0, yyvstop+11,
448: yycrank+35, 0, yyvstop+13,
449: yycrank+5, 0, yyvstop+15,
450: yycrank+32, 0, yyvstop+17,
451: yycrank+42, 0, yyvstop+20,
452: yycrank+0, 0, yyvstop+22,
453: yycrank+0, 0, yyvstop+25,
454: yycrank+107, 0, yyvstop+28,
455: yycrank+4, yysvec+14, yyvstop+31,
456: yycrank+0, yysvec+14, yyvstop+35,
457: yycrank+9, yysvec+14, yyvstop+39,
458: yycrank+0, yysvec+14, yyvstop+43,
459: yycrank+21, yysvec+14, yyvstop+47,
460: yycrank+0, yysvec+14, yyvstop+51,
461: yycrank+0, yysvec+14, yyvstop+55,
462: yycrank+0, yysvec+14, yyvstop+59,
463: yycrank+0, yysvec+14, yyvstop+63,
464: yycrank+0, yysvec+4, yyvstop+67,
465: yycrank+0, 0, yyvstop+69,
466: yycrank+10, 0, yyvstop+71,
467: yycrank+0, 0, yyvstop+73,
468: yycrank+17, 0, yyvstop+75,
469: yycrank+0, 0, yyvstop+77,
470: yycrank+47, 0, yyvstop+79,
471: yycrank+0, 0, yyvstop+81,
472: yycrank+0, 0, yyvstop+83,
473: yycrank+0, 0, yyvstop+85,
474: yycrank+0, 0, yyvstop+87,
475: yycrank+0, 0, yyvstop+89,
476: yycrank+0, yysvec+10, yyvstop+91,
477: yycrank+0, yysvec+11, yyvstop+93,
478: yycrank+0, yysvec+14, yyvstop+95,
479: yycrank+22, yysvec+14, yyvstop+97,
480: yycrank+31, yysvec+14, yyvstop+99,
481: yycrank+0, yysvec+14, yyvstop+101,
482: yycrank+17, yysvec+14, yyvstop+104,
483: yycrank+32, yysvec+14, yyvstop+106,
484: yycrank+0, yysvec+14, yyvstop+108,
485: yycrank+42, yysvec+14, yyvstop+111,
486: yycrank+30, 0, 0,
487: yycrank+38, 0, 0,
488: yycrank+50, 0, 0,
489: yycrank+43, 0, 0,
490: yycrank+65, 0, 0,
491: yycrank+0, yysvec+14, yyvstop+113,
492: yycrank+51, yysvec+14, yyvstop+116,
493: yycrank+69, yysvec+14, yyvstop+118,
494: yycrank+53, yysvec+14, yyvstop+120,
495: yycrank+71, yysvec+14, yyvstop+122,
496: yycrank+0, 0, yyvstop+124,
497: yycrank+55, 0, 0,
498: yycrank+99, 0, 0,
499: yycrank+83, 0, 0,
500: yycrank+101, 0, 0,
501: yycrank+0, yysvec+14, yyvstop+126,
502: yycrank+0, yysvec+14, yyvstop+129,
503: yycrank+0, yysvec+14, yyvstop+132,
504: yycrank+0, yysvec+14, yyvstop+135,
505: yycrank+0, 0, yyvstop+138,
506: yycrank+0, 0, yyvstop+140,
507: yycrank+0, 0, yyvstop+142,
508: yycrank+0, 0, yyvstop+144,
509: 0, 0, 0};
510: struct yywork *yytop = yycrank+229;
511: struct yysvf *yybgin = yysvec+1;
1.1.1.2 ! root 512: char yymatch[] = {
1.1 root 513: 00 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
514: 01 ,011 ,012 ,01 ,01 ,01 ,01 ,01 ,
515: 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
516: 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
517: 011 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
518: 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
519: '0' ,'1' ,'1' ,'1' ,'1' ,'1' ,'1' ,'1' ,
520: '1' ,'1' ,01 ,01 ,01 ,01 ,01 ,01 ,
521: 01 ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
522: 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
523: 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
524: 'A' ,'A' ,'A' ,01 ,01 ,01 ,01 ,'A' ,
525: 01 ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
526: 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
527: 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
528: 'A' ,'A' ,'A' ,01 ,01 ,01 ,01 ,01 ,
529: 0};
1.1.1.2 ! root 530: char yyextra[] = {
1.1 root 531: 0,0,0,0,0,0,0,0,
532: 0,0,0,0,0,0,0,0,
533: 0,0,0,0,0,0,0,0,
534: 0,0,0,0,0,0,0,0,
535: 0,0,0,0,0,0,0,0,
536: 0,0,0,0,0,0,0,0,
537: 0};
1.1.1.2 ! root 538: #ifndef lint
! 539: static char ncform_sccsid[] = "@(#)ncform 1.1 86/07/08 SMI"; /* from S5R2 1.2 */
! 540: #endif
1.1 root 541:
542: int yylineno =1;
543: # define YYU(x) x
544: # define NLSTATE yyprevious=YYNEWLINE
545: char yytext[YYLMAX];
546: struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
547: char yysbuf[YYLMAX];
548: char *yysptr = yysbuf;
549: int *yyfnd;
550: extern struct yysvf *yyestate;
551: int yyprevious = YYNEWLINE;
552: yylook(){
553: register struct yysvf *yystate, **lsp;
554: register struct yywork *yyt;
555: struct yysvf *yyz;
1.1.1.2 ! root 556: int yych, yyfirst;
1.1 root 557: struct yywork *yyr;
558: # ifdef LEXDEBUG
559: int debug;
560: # endif
561: char *yylastch;
562: /* start off machines */
563: # ifdef LEXDEBUG
564: debug = 0;
565: # endif
1.1.1.2 ! root 566: yyfirst=1;
1.1 root 567: if (!yymorfg)
568: yylastch = yytext;
569: else {
570: yymorfg=0;
571: yylastch = yytext+yyleng;
572: }
573: for(;;){
574: lsp = yylstate;
575: yyestate = yystate = yybgin;
576: if (yyprevious==YYNEWLINE) yystate++;
577: for (;;){
578: # ifdef LEXDEBUG
579: if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
580: # endif
581: yyt = yystate->yystoff;
1.1.1.2 ! root 582: if(yyt == yycrank && !yyfirst){ /* may not be any transitions */
1.1 root 583: yyz = yystate->yyother;
584: if(yyz == 0)break;
585: if(yyz->yystoff == yycrank)break;
586: }
587: *yylastch++ = yych = input();
1.1.1.2 ! root 588: yyfirst=0;
1.1 root 589: tryagain:
590: # ifdef LEXDEBUG
591: if(debug){
592: fprintf(yyout,"char ");
593: allprint(yych);
594: putchar('\n');
595: }
596: # endif
597: yyr = yyt;
598: if ( (int)yyt > (int)yycrank){
599: yyt = yyr + yych;
600: if (yyt <= yytop && yyt->verify+yysvec == yystate){
601: if(yyt->advance+yysvec == YYLERR) /* error transitions */
602: {unput(*--yylastch);break;}
603: *lsp++ = yystate = yyt->advance+yysvec;
604: goto contin;
605: }
606: }
607: # ifdef YYOPTIM
608: else if((int)yyt < (int)yycrank) { /* r < yycrank */
609: yyt = yyr = yycrank+(yycrank-yyt);
610: # ifdef LEXDEBUG
611: if(debug)fprintf(yyout,"compressed state\n");
612: # endif
613: yyt = yyt + yych;
614: if(yyt <= yytop && yyt->verify+yysvec == yystate){
615: if(yyt->advance+yysvec == YYLERR) /* error transitions */
616: {unput(*--yylastch);break;}
617: *lsp++ = yystate = yyt->advance+yysvec;
618: goto contin;
619: }
620: yyt = yyr + YYU(yymatch[yych]);
621: # ifdef LEXDEBUG
622: if(debug){
623: fprintf(yyout,"try fall back character ");
624: allprint(YYU(yymatch[yych]));
625: putchar('\n');
626: }
627: # endif
628: if(yyt <= yytop && yyt->verify+yysvec == yystate){
629: if(yyt->advance+yysvec == YYLERR) /* error transition */
630: {unput(*--yylastch);break;}
631: *lsp++ = yystate = yyt->advance+yysvec;
632: goto contin;
633: }
634: }
635: if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
636: # ifdef LEXDEBUG
637: if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
638: # endif
639: goto tryagain;
640: }
641: # endif
642: else
643: {unput(*--yylastch);break;}
644: contin:
645: # ifdef LEXDEBUG
646: if(debug){
647: fprintf(yyout,"state %d char ",yystate-yysvec-1);
648: allprint(yych);
649: putchar('\n');
650: }
651: # endif
652: ;
653: }
654: # ifdef LEXDEBUG
655: if(debug){
656: fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
657: allprint(yych);
658: putchar('\n');
659: }
660: # endif
661: while (lsp-- > yylstate){
662: *yylastch-- = 0;
663: if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
664: yyolsp = lsp;
665: if(yyextra[*yyfnd]){ /* must backup */
666: while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
667: lsp--;
668: unput(*yylastch--);
669: }
670: }
671: yyprevious = YYU(*yylastch);
672: yylsp = lsp;
673: yyleng = yylastch-yytext+1;
674: yytext[yyleng] = 0;
675: # ifdef LEXDEBUG
676: if(debug){
677: fprintf(yyout,"\nmatch ");
678: sprint(yytext);
679: fprintf(yyout," action %d\n",*yyfnd);
680: }
681: # endif
682: return(*yyfnd++);
683: }
684: unput(*yylastch);
685: }
686: if (yytext[0] == 0 /* && feof(yyin) */)
687: {
688: yysptr=yysbuf;
689: return(0);
690: }
691: yyprevious = yytext[0] = input();
692: if (yyprevious>0)
693: output(yyprevious);
694: yylastch=yytext;
695: # ifdef LEXDEBUG
696: if(debug)putchar('\n');
697: # endif
698: }
699: }
700: yyback(p, m)
701: int *p;
702: {
703: if (p==0) return(0);
704: while (*p)
705: {
706: if (*p++ == m)
707: return(1);
708: }
709: return(0);
710: }
711: /* the following are only used in the lex library */
712: yyinput(){
713: return(input());
714: }
715: yyoutput(c)
716: int c; {
717: output(c);
718: }
719: yyunput(c)
720: int c; {
721: unput(c);
722: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.