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;
28 /* This Lex script acts as a filter to pre-process Latex files.
29 It surrounds groups of lines beginning with a ">" sign, and
30 preceded and followed by a blank line, with \begin{verbatim}
31 and \end{verbatim}. The ">" may be preceded by a digit or digit
32 range (eg 4>, 2-5>, 3->); in this case the digits are removed.
33 They are meant to be used for filtering out versions.
34 It takes words surrounded with @ signs (thus @letrec@) and makes them
35 come out in typewriter font, regardless of the current mode.
41 # define VERBATIMSIM 10
42 #define PUSH states[top++] =
43 #define POP BEGIN states[--top]
47 int nstr; extern int yyprevious;
52 while((nstr = yylook()) >= 0)
53 yyfussy: switch(nstr){
55 if(yywrap()) return(0); break;
60 { printf ("\\mbox{\\tt "); PUSH NORM; BEGIN VERB; }
63 { printf ("}"); POP; }
66 { printf ("}\\\\{}\n\\mbox{\\tt "); }
75 { printf ("{\\char'43}"); }
78 { printf ("{\\char'44}"); }
81 { printf ("{\\char'45}"); }
84 { printf ("{\\char'46}"); }
87 { printf ("{\\char'176}"); }
90 { printf ("{\\char'137}"); }
93 { printf ("{\\char'136}"); }
96 { printf ("{\\char'134}"); }
99 { printf ("{\\char'173}"); }
102 { printf ("{\\char'175}"); }
105 { printf( "\\begin{verbatim}\n" );
106 PUSH NORM; BEGIN VERBATIMSIM; }
109 { printf( "\\end{verbatim}\n" ); POP; }
112 { printf( "\\begin{verbatim}" );
113 PUSH NORM; BEGIN VERBATIM; }
116 { printf( "\\end{verbatim}" ); POP; }
119 { printf ("\\begin{verbatim}\n>" );
120 PUSH NORM; BEGIN MIRANDA; }
126 { printf ("\\end{verbatim}\n"); POP; }
131 fprintf(yyout,"bad switch yylook %d",nstr);
216 struct yywork { YYTYPE verify, advance; } yycrank[] = {
220 4,15, 5,17, 7,30, 8,31,
221 33,43, 0,0, 0,0, 0,0,
223 0,0, 0,0, 16,38, 0,0,
226 0,0, 0,0, 5,19, 5,20,
227 5,21, 5,22, 0,0, 0,0,
229 36,45, 40,46, 0,0, 45,45,
230 45,45, 45,45, 45,45, 45,45,
231 45,45, 45,45, 45,45, 45,45,
232 45,45, 0,0, 0,0, 0,0,
233 0,0, 3,13, 4,16, 5,23,
234 12,33, 13,34, 15,36, 15,36,
235 15,36, 15,36, 15,36, 15,36,
236 15,36, 15,36, 15,36, 15,36,
237 16,34, 23,39, 0,0, 0,0,
238 15,37, 0,0, 0,0, 0,0,
240 0,0, 3,14, 4,14, 5,24,
241 9,32, 5,25, 5,26, 0,0,
242 0,0, 14,35, 30,40, 30,40,
243 30,40, 30,40, 30,40, 30,40,
244 30,40, 30,40, 30,40, 30,40,
245 32,42, 35,44, 42,47, 44,48,
246 30,41, 47,49, 48,50, 53,55,
247 56,58, 57,59, 59,61, 60,62,
248 50,52, 62,64, 5,27, 63,65,
249 5,28, 5,29, 46,46, 46,46,
250 46,46, 46,46, 46,46, 46,46,
251 46,46, 46,46, 46,46, 46,46,
252 49,51, 51,53, 52,54, 54,56,
253 55,57, 58,60, 61,63, 64,66,
254 65,67, 66,68, 67,69, 68,70,
255 70,71, 0,0, 0,0, 0,0,
257 struct yysvf yysvec[] = {
264 yycrank+0, yysvec+5, 0,
268 yycrank+0, yysvec+9, 0,
271 yycrank+5, 0, yyvstop+1,
274 yycrank+16, 0, yyvstop+3,
275 yycrank+0, 0, yyvstop+5,
276 yycrank+0, 0, yyvstop+7,
277 yycrank+0, 0, yyvstop+9,
278 yycrank+0, 0, yyvstop+11,
279 yycrank+0, 0, yyvstop+13,
280 yycrank+0, 0, yyvstop+15,
281 yycrank+17, 0, yyvstop+17,
282 yycrank+0, 0, yyvstop+19,
283 yycrank+0, 0, yyvstop+21,
284 yycrank+0, 0, yyvstop+23,
285 yycrank+0, 0, yyvstop+25,
286 yycrank+0, 0, yyvstop+27,
287 yycrank+0, 0, yyvstop+29,
289 yycrank+0, yysvec+30, yyvstop+31,
292 yycrank+0, 0, yyvstop+33,
294 yycrank+3, yysvec+15, 0,
295 yycrank+0, 0, yyvstop+35,
296 yycrank+0, 0, yyvstop+37,
297 yycrank+0, 0, yyvstop+39,
298 yycrank+4, yysvec+30, 0,
299 yycrank+0, 0, yyvstop+41,
301 yycrank+0, 0, yyvstop+43,
303 yycrank+3, yysvec+15, 0,
304 yycrank+82, yysvec+30, 0,
327 yycrank+0, 0, yyvstop+45,
329 yycrank+0, 0, yyvstop+47,
331 struct yywork *yytop = yycrank+152;
332 struct yysvf *yybgin = yysvec+1;
334 00 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
335 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
336 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
337 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
338 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
339 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
340 '0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,
341 '0' ,'0' ,01 ,01 ,01 ,01 ,01 ,01 ,
342 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
343 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
344 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
345 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
346 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
347 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
348 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
349 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
357 static char ncform_sccsid[] = "@(#)ncform 1.6 88/02/08 SMI"; /* from S5R2 1.2 */
362 # define NLSTATE yyprevious=YYNEWLINE
364 struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
366 char *yysptr = yysbuf;
368 extern struct yysvf *yyestate;
369 int yyprevious = YYNEWLINE;
371 register struct yysvf *yystate, **lsp;
372 register struct yywork *yyt;
380 /* start off machines */
389 yylastch = yytext+yyleng;
393 yyestate = yystate = yybgin;
394 if (yyprevious==YYNEWLINE) yystate++;
397 if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
399 yyt = yystate->yystoff;
400 if(yyt == yycrank && !yyfirst){ /* may not be any transitions */
401 yyz = yystate->yyother;
403 if(yyz->yystoff == yycrank)break;
405 *yylastch++ = yych = input();
410 fprintf(yyout,"char ");
416 if ( (int)yyt > (int)yycrank){
418 if (yyt <= yytop && yyt->verify+yysvec == yystate){
419 if(yyt->advance+yysvec == YYLERR) /* error transitions */
420 {unput(*--yylastch);break;}
421 *lsp++ = yystate = yyt->advance+yysvec;
426 else if((int)yyt < (int)yycrank) { /* r < yycrank */
427 yyt = yyr = yycrank+(yycrank-yyt);
429 if(debug)fprintf(yyout,"compressed state\n");
432 if(yyt <= yytop && yyt->verify+yysvec == yystate){
433 if(yyt->advance+yysvec == YYLERR) /* error transitions */
434 {unput(*--yylastch);break;}
435 *lsp++ = yystate = yyt->advance+yysvec;
438 yyt = yyr + YYU(yymatch[yych]);
441 fprintf(yyout,"try fall back character ");
442 allprint(YYU(yymatch[yych]));
446 if(yyt <= yytop && yyt->verify+yysvec == yystate){
447 if(yyt->advance+yysvec == YYLERR) /* error transition */
448 {unput(*--yylastch);break;}
449 *lsp++ = yystate = yyt->advance+yysvec;
453 if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
455 if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
461 {unput(*--yylastch);break;}
465 fprintf(yyout,"state %d char ",yystate-yysvec-1);
474 fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
479 while (lsp-- > yylstate){
481 if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
483 if(yyextra[*yyfnd]){ /* must backup */
484 while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
489 yyprevious = YYU(*yylastch);
491 yyleng = yylastch-yytext+1;
495 fprintf(yyout,"\nmatch ");
497 fprintf(yyout," action %d\n",*yyfnd);
504 if (yytext[0] == 0 /* && feof(yyin) */)
509 yyprevious = yytext[0] = input();
514 if(debug)putchar('\n');
529 /* the following are only used in the lex library */