3 # define NLSTATE yyprevious=YYNEWLINE
4 # define BEGIN yybgin = yysvec + 1 +
7 # define YYSTATE (yyestate-yysvec-1)
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[];
18 extern char *yysptr, yysbuf[];
20 FILE *yyin = {stdin}, *yyout = {stdout};
23 struct yywork *yystoff;
24 struct yysvf *yyother;
26 struct yysvf *yyestate;
27 extern struct yysvf yysvec[], *yybgin;
36 # include "syntax.tab.h"
41 extern YYSTYPE yylval;
42 extern FILE *fc, *fhs;
43 #undef ECHO /* partain */
44 #define ECHO /*fprintf(stderr, "%s", yytext)*/
48 int nstr; extern int yyprevious;
49 while((nstr = yylook()) >= 0)
50 yyfussy: switch(nstr){
52 if(yywrap()) return(0); break;
54 { ECHO; return(SEMICOL); }
57 { ECHO; return(COLON); }
60 { ECHO; return(STDEF); }
63 { ECHO; return(ENDDEF); }
66 { ECHO; return(TYPE); }
69 { ECHO; return(END); }
74 yylval = (YYSTYPE) installid(yytext);
88 { /* partain: for Haskell includes */
90 yytext[yyleng-3] = '\0';
91 fprintf(fhs, "\n%s", &yytext[3]);
97 yytext[yyleng-2] = '\0';
98 fprintf(fc, "\n%s", &yytext[2]);
104 fprintf(yyout,"bad switch yylook %d",nstr);
188 struct yywork { YYTYPE verify, advance; } yycrank[] = {
200 6,15, 0,0, 0,0, 15,15,
201 1,6, 1,3, 20,19, 26,21,
203 15,15, 22,15, 0,0, 1,7,
204 1,8, 1,9, 22,27, 1,10,
209 0,0, 0,0, 0,0, 15,15,
211 15,22, 0,0, 0,0, 0,0,
212 0,0, 15,15, 15,15, 0,0,
216 0,0, 0,0, 2,12, 15,15,
217 17,23, 24,28, 0,0, 0,0,
219 12,17, 0,0, 0,0, 18,24,
220 5,14, 2,13, 1,3, 11,16,
221 11,16, 11,16, 11,16, 11,16,
222 11,16, 11,16, 11,16, 11,16,
223 11,16, 13,18, 20,25, 26,29,
224 29,30, 0,0, 0,0, 0,0,
225 11,16, 11,16, 11,16, 11,16,
226 11,16, 11,16, 11,16, 11,16,
227 11,16, 11,16, 11,16, 11,16,
228 11,16, 11,16, 11,16, 11,16,
229 11,16, 11,16, 11,16, 11,16,
230 11,16, 11,16, 11,16, 11,16,
231 11,16, 11,16, 0,0, 15,15,
232 0,0, 0,0, 11,16, 0,0,
233 11,16, 11,16, 11,16, 11,16,
234 11,16, 11,16, 11,16, 11,16,
235 11,16, 11,16, 11,16, 11,16,
236 11,16, 11,16, 11,16, 11,16,
237 11,16, 11,16, 11,16, 11,16,
238 11,16, 11,16, 11,16, 11,16,
239 11,16, 11,16, 14,19, 0,0,
240 19,19, 0,0, 21,21, 0,0,
241 0,0, 0,0, 0,0, 14,19,
242 0,0, 19,19, 0,0, 21,21,
248 0,0, 0,0, 14,20, 0,0,
249 19,20, 0,0, 21,26, 14,19,
250 0,0, 19,19, 0,0, 21,21,
251 14,19, 14,19, 19,19, 19,19,
252 21,21, 21,21, 0,0, 0,0,
255 0,0, 0,0, 14,19, 0,0,
256 19,19, 0,0, 21,21, 0,0,
270 14,21, 0,0, 14,19, 0,0,
271 19,19, 0,0, 21,21, 0,0,
273 struct yysvf yysvec[] = {
276 yycrank+-9, yysvec+1, 0,
277 yycrank+0, 0, yyvstop+1,
278 yycrank+0, 0, yyvstop+3,
279 yycrank+1, 0, yyvstop+5,
280 yycrank+2, 0, yyvstop+7,
281 yycrank+0, 0, yyvstop+9,
282 yycrank+0, 0, yyvstop+12,
283 yycrank+0, 0, yyvstop+15,
284 yycrank+0, 0, yyvstop+18,
285 yycrank+79, 0, yyvstop+21,
286 yycrank+10, yysvec+11, yyvstop+24,
287 yycrank+16, yysvec+11, yyvstop+27,
290 yycrank+0, yysvec+11, yyvstop+30,
291 yycrank+12, yysvec+11, yyvstop+32,
292 yycrank+11, yysvec+11, yyvstop+34,
294 yycrank+-13, yysvec+19, 0,
296 yycrank+-15, yysvec+15, 0,
297 yycrank+0, yysvec+11, yyvstop+36,
298 yycrank+12, yysvec+11, yyvstop+39,
299 yycrank+0, 0, yyvstop+41,
300 yycrank+-14, yysvec+21, 0,
301 yycrank+0, 0, yyvstop+43,
302 yycrank+0, yysvec+11, yyvstop+45,
303 yycrank+15, 0, yyvstop+48,
304 yycrank+0, 0, yyvstop+50,
306 struct yywork *yytop = yycrank+330;
307 struct yysvf *yybgin = yysvec+1;
309 00 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
310 01 ,01 ,012 ,01 ,01 ,01 ,01 ,01 ,
311 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
312 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
313 01 ,01 ,01 ,01 ,01 ,'%' ,01 ,01 ,
314 01 ,01 ,'*' ,01 ,01 ,01 ,01 ,'/' ,
315 '0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,
316 '0' ,'0' ,01 ,01 ,01 ,01 ,01 ,01 ,
317 01 ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
318 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
319 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
320 'A' ,'A' ,'A' ,01 ,01 ,01 ,01 ,'0' ,
321 01 ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
322 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
323 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
324 'A' ,'A' ,'A' ,01 ,01 ,'}' ,01 ,01 ,
331 static char ncform_sccsid[] = "@(#)ncform 1.6 88/02/08 SMI"; /* from S5R2 1.2 */
336 # define NLSTATE yyprevious=YYNEWLINE
338 struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
340 char *yysptr = yysbuf;
342 extern struct yysvf *yyestate;
343 int yyprevious = YYNEWLINE;
345 register struct yysvf *yystate, **lsp;
346 register struct yywork *yyt;
354 /* start off machines */
363 yylastch = yytext+yyleng;
367 yyestate = yystate = yybgin;
368 if (yyprevious==YYNEWLINE) yystate++;
371 if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
373 yyt = yystate->yystoff;
374 if(yyt == yycrank && !yyfirst){ /* may not be any transitions */
375 yyz = yystate->yyother;
377 if(yyz->yystoff == yycrank)break;
379 *yylastch++ = yych = input();
384 fprintf(yyout,"char ");
390 if ( (int)yyt > (int)yycrank){
392 if (yyt <= yytop && yyt->verify+yysvec == yystate){
393 if(yyt->advance+yysvec == YYLERR) /* error transitions */
394 {unput(*--yylastch);break;}
395 *lsp++ = yystate = yyt->advance+yysvec;
400 else if((int)yyt < (int)yycrank) { /* r < yycrank */
401 yyt = yyr = yycrank+(yycrank-yyt);
403 if(debug)fprintf(yyout,"compressed state\n");
406 if(yyt <= yytop && yyt->verify+yysvec == yystate){
407 if(yyt->advance+yysvec == YYLERR) /* error transitions */
408 {unput(*--yylastch);break;}
409 *lsp++ = yystate = yyt->advance+yysvec;
412 yyt = yyr + YYU(yymatch[yych]);
415 fprintf(yyout,"try fall back character ");
416 allprint(YYU(yymatch[yych]));
420 if(yyt <= yytop && yyt->verify+yysvec == yystate){
421 if(yyt->advance+yysvec == YYLERR) /* error transition */
422 {unput(*--yylastch);break;}
423 *lsp++ = yystate = yyt->advance+yysvec;
427 if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
429 if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
435 {unput(*--yylastch);break;}
439 fprintf(yyout,"state %d char ",yystate-yysvec-1);
448 fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
453 while (lsp-- > yylstate){
455 if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
457 if(yyextra[*yyfnd]){ /* must backup */
458 while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
463 yyprevious = YYU(*yylastch);
465 yyleng = yylastch-yytext+1;
469 fprintf(yyout,"\nmatch ");
471 fprintf(yyout," action %d\n",*yyfnd);
478 if (yytext[0] == 0 /* && feof(yyin) */)
483 yyprevious = yytext[0] = input();
488 if(debug)putchar('\n');
503 /* the following are only used in the lex library */