65 #define YYMAXDEPTH 150
77 static const short yyexca
[] =
86 #define YYPRIVATE 57344
88 static const short yyact
[] =
90 4, 103, 119, 45, 27, 118, 104, 2, 102, 41,
91 42, 43, 44, 65, 80, 81, 79, 66, 67, 68,
92 69, 70, 50, 49, 74, 75, 76, 77, 105, 73,
93 40, 80, 81, 80, 81, 114, 61, 64, 54, 62,
94 57, 58, 59, 60, 55, 56, 63, 78, 91, 92,
95 82, 26, 83, 85, 86, 87, 88, 90, 51, 52,
96 48, 124, 50, 49, 117, 25, 45, 117, 72, 71,
97 80, 81, 113, 24, 45, 23, 61, 64, 54, 62,
98 57, 58, 59, 60, 55, 56, 63, 53, 89, 100,
99 84, 22, 96, 95, 106, 107, 108, 109, 99, 110,
100 111, 41, 42, 43, 44, 45, 98, 115, 21, 94,
101 93, 18, 130, 123, 17, 116, 121, 46, 112, 125,
102 127, 128, 1, 129, 126, 0, 0, 45, 8, 7,
103 9, 10, 11, 28, 41, 42, 43, 44, 0, 16,
104 47, 12, 34, 13, 14, 15, 61, 64, 54, 62,
105 57, 58, 59, 60, 55, 56, 63, 0, 0, 20,
106 0, 0, 29, 33, 30, 31, 32, 19, 37, 39,
107 38, 36, 35, 0, 0, 0, 0, 0, 0, 0,
108 0, 0, 0, 0, 0, 6, 97, 8, 7, 9,
109 10, 11, 28, 41, 42, 43, 44, 0, 16, 47,
110 12, 34, 13, 14, 15, 0, 0, 0, 0, 0,
111 0, 0, 0, 0, 0, 0, 0, 0, 20, 0,
112 0, 29, 33, 30, 31, 32, 19, 37, 39, 38,
113 36, 35, 101, 0, 0, 0, 0, 0, 0, 0,
114 0, 0, 0, 3, 6, 8, 7, 9, 10, 11,
115 28, 41, 42, 43, 44, 0, 16, 5, 12, 34,
116 13, 14, 15, 0, 0, 0, 0, 0, 0, 0,
117 0, 0, 0, 0, 0, 0, 20, 0, 0, 29,
118 33, 30, 31, 32, 19, 37, 39, 38, 36, 35,
119 0, 0, 8, 7, 9, 10, 11, 28, 41, 42,
120 43, 44, 6, 16, 47, 12, 34, 13, 14, 15,
121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
122 0, 0, 0, 20, 0, 0, 29, 33, 30, 31,
123 32, 19, 37, 39, 38, 36, 35, 0, 0, 8,
124 7, 9, 10, 11, 28, 41, 42, 43, 44, 6,
125 16, 5, 12, 34, 13, 14, 15, 0, 0, 0,
126 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
127 20, 0, 0, 29, 33, 30, 31, 32, 19, 37,
128 39, 38, 36, 35, 8, 7, 9, 10, 11, 28,
129 41, 42, 43, 44, 0, 16, 6, 12, 34, 13,
130 14, 15, 0, 0, 0, 0, 0, 0, 0, 0,
131 0, 0, 0, 0, 0, 20, 0, 0, 29, 33,
132 30, 31, 32, 19, 37, 39, 38, 36, 35, 51,
133 122, 48, 0, 50, 49, 0, 0, 0, 0, 0,
134 0, 6, 0, 0, 120, 49, 0, 61, 64, 54,
135 62, 57, 58, 59, 60, 55, 56, 63, 61, 64,
136 54, 62, 57, 58, 59, 60, 55, 56, 63
138 static const short yypact
[] =
140 241,-1000, 288,-1000, 26,-1000, 335,-1000,-1000,-1000,
141 -1000,-1000,-1000,-1000,-1000,-1000, 380, 380, 380, 380,
142 380, 32, 335, 380, 380, 380, 380,-1000,-1000, 66,
143 -1000,-1000,-1000, 66,-1000, 29, 66, 66, 66, 66,
144 27,-1000,-1000,-1000,-1000, 26,-1000, 380, 380,-1000,
145 -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
146 -1000,-1000,-1000,-1000,-1000, 124, 26, 96, 96, 96,
147 -14,-1000,-1000, 183, 96, 96, 96, 96, -53,-1000,
148 -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, 335,
149 -1000, 26, -14, 380, 380, 380, 380,-1000, 380, 380,
150 -1000, 10, 91, 53, 288, -56, 408, -14, 397, 26,
151 408, -14,-1000,-1000, -1,-1000,-1000, 335, 335,-1000,
152 380,-1000, 380,-1000,-1000,-1000, 288, 50, -14, 26,
155 static const short yypgo
[] =
157 0, 122, 6, 0, 117, 2, 116, 114, 111, 110,
158 109, 108, 106, 98, 93, 92, 91, 89, 87, 75,
159 73, 65, 51, 4, 47, 35, 16, 30, 1, 28
161 static const short yyr1
[] =
163 0, 1, 1, 1, 2, 2, 2, 2, 4, 5,
164 5, 6, 6, 3, 3, 3, 3, 3, 3, 3,
165 3, 3, 3, 3, 3, 3, 3, 3, 3, 9,
166 3, 10, 3, 12, 3, 13, 3, 3, 14, 3,
167 15, 3, 3, 3, 3, 3, 3, 3, 3, 3,
168 24, 3, 11, 19, 20, 21, 22, 18, 18, 18,
169 18, 18, 18, 18, 18, 18, 18, 18, 16, 16,
170 17, 17, 25, 25, 23, 29, 23, 27, 27, 27,
171 27, 28, 28, 7, 8, 8, 8, 8, 26, 26
173 static const short yyr2
[] =
175 0, 1, 1, 0, 1, 2, 2, 1, 2, 2,
176 0, 2, 0, 3, 1, 1, 1, 1, 1, 1,
177 1, 1, 1, 3, 2, 2, 2, 2, 2, 0,
178 5, 0, 4, 0, 5, 0, 4, 1, 0, 5,
179 0, 4, 3, 2, 2, 2, 2, 2, 2, 1,
180 0, 5, 1, 2, 2, 2, 2, 1, 1, 1,
181 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
182 2, 2, 1, 2, 4, 0, 6, 1, 1, 1,
183 1, 1, 3, 2, 1, 1, 1, 2, 1, 1
185 static const short yychk
[] =
187 -1000, -1, -2, 2, -3, 16, 61, 5, 4, 6,
188 7, 8, 17, 19, 20, 21, 15, -7, -8, 43,
189 35, -11, -16, -19, -20, -21, -22, -23, 9, 38,
190 40, 41, 42, 39, 18, 48, 47, 44, 46, 45,
191 -27, 10, 11, 12, 13, -3, -4, 16, 34, 37,
192 36, 32, 33, -18, 52, 58, 59, 54, 55, 56,
193 57, 50, 53, 60, 51, -2, -3, -3, -3, -3,
194 -3, 37, 36, -2, -3, -3, -3, -3, -24, -26,
195 4, 5, -26, -26, 61, -26, -26, -26, -26, 61,
196 -26, -3, -3, -9, -10, -14, -15, 62, -12, -13,
197 -17, 49, 61, -28, -2, -29, -3, -3, -3, -3,
198 -3, -3, -26, 62, -25, -23, 62, 14, 61, -5,
199 36, -6, 33, -5, 62, -23, -2, -28, -3, -3,
202 static const short yydef
[] =
204 -2, -2, 1, 2, 4, 7, 0, 14, 15, 16,
205 17, 18, 19, 20, 21, 22, 0, 0, 0, 0,
206 0, 37, 0, 0, 0, 0, 0, 49, 50, 0,
207 84, 85, 86, 0, 52, 0, 0, 0, 0, 0,
208 0, 77, 78, 79, 80, 5, 6, 0, 0, 29,
209 31, 38, 40, 44, 57, 58, 59, 60, 61, 62,
210 63, 64, 65, 66, 67, 0, 24, 25, 26, 27,
211 28, 33, 35, 43, 45, 46, 47, 48, 0, 83,
212 88, 89, 87, 68, 69, 53, 54, 55, 56, 0,
213 75, 8, 23, 0, 0, 0, 0, 13, 0, 0,
214 42, 0, 0, 0, 81, 0, 10, 32, 12, 41,
215 10, 36, 70, 71, 0, 72, 74, 0, 0, 30,
216 0, 39, 0, 34, 51, 73, 82, 0, 9, 11,
219 static const short yytok1
[] =
221 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
222 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
223 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
224 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
225 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
226 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
227 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
228 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
229 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
230 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
231 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
232 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
235 static const short yytok2
[] =
237 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
238 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
239 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
240 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
241 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
242 52, 53, 54, 55, 56, 57, 58, 59, 60
244 static const long yytok3
[] =
249 #define YYERROR goto yyerrlab
250 #define YYACCEPT return(0)
251 #define YYABORT return(1)
252 #define yyclearin yychar = -1
253 #define yyerrok yyerrflag = 0
259 static const char* yytoknames
[1]; /* for debugging */
260 static const char* yystates
[1]; /* for debugging */
263 /* parser for yacc output */
265 #define yynerrs yyarg->yynerrs
266 #define yyerrflag yyarg->yyerrflag
267 #define yyval yyarg->yyval
268 #define yylval yyarg->yylval
270 int yynerrs
= 0; /* number of errors */
271 int yyerrflag
= 0; /* error recovery flag */
279 if(yyc
> 0 && yyc
<= sizeof(yytoknames
)/sizeof(yytoknames
[0]))
280 if(yytoknames
[yyc
-1])
281 return yytoknames
[yyc
-1];
282 sprintf(x
, "<%d>", yyc
);
291 if(yys
>= 0 && yys
< sizeof(yystates
)/sizeof(yystates
[0]))
293 return yystates
[yys
];
294 sprintf(x
, "<%d>\n", yys
);
300 yylex1(struct Yyarg
*yyarg
)
310 yychar
= yylex(yyarg
);
318 if(yychar
< sizeof(yytok1
)/sizeof(yytok1
[0])) {
322 if(yychar
>= YYPRIVATE
)
323 if(yychar
< YYPRIVATE
+sizeof(yytok2
)/sizeof(yytok2
[0])) {
324 c
= yytok2
[yychar
-YYPRIVATE
];
327 for(t3p
=yytok3
;; t3p
+=2) {
340 c
= yytok2
[1]; /* unknown char */
342 fprintf(stderr
, "lex %.4lux %s\n", yychar
, yytokname(c
));
348 yyparse(struct Yyarg
*yyarg
)
357 } yys
[YYMAXDEPTH
], *yyp
, *yypt
;
359 int yyj
, yym
, yystate
, yyn
, yyg
;
362 YYSTYPE save1
, save2
;
396 /* put a state and value onto the stack */
398 fprintf(stderr
, "char %s in %s", yytokname(yychar
), yystatname(yystate
));
401 if(yyp
>= &yys
[YYMAXDEPTH
]) {
402 yyerror("yacc stack overflow");
409 yyn
= yypact
[yystate
];
411 goto yydefault
; /* simple state */
414 yychar
= yylex1(yyarg
);
419 if(yyn
< 0 || yyn
>= YYLAST
)
422 if(yychk
[yyn
] == yychar
) { /* valid shift */
432 /* default state action */
433 yyn
= yydef
[yystate
];
437 yychar
= yylex1(yyarg
);
442 /* look through exception table */
443 for(yyxi
=yyexca
;; yyxi
+=2)
444 if(yyxi
[0] == -1 && yyxi
[1] == yystate
)
446 for(yyxi
+= 2;; yyxi
+= 2) {
448 if(yyn
< 0 || yyn
== yychar
)
456 /* error ... attempt to resume parsing */
458 case 0: /* brand new error */
459 yyerror("syntax error");
461 fprintf(stderr
, "%s", yystatname(yystate
));
462 fprintf(stderr
, "saw %s\n", yytokname(yychar
));
469 case 2: /* incompletely recovered error ... try again */
472 /* find a state where "error" is a legal shift action */
474 yyn
= yypact
[yyp
->yys
] + YYERRCODE
;
475 if(yyn
>= 0 && yyn
< YYLAST
) {
476 yystate
= yyact
[yyn
]; /* simulate a shift of "error" */
477 if(yychk
[yystate
] == YYERRCODE
)
481 /* the current yyp has no shift onn "error", pop stack */
483 fprintf(stderr
, "error recovery pops state %d, uncovers %d\n",
484 yyp
->yys
, (yyp
-1)->yys
);
487 /* there is no state on the stack with an error shift ... abort */
490 case 3: /* no shift yet; clobber input char */
492 fprintf(stderr
, "error recovery discards %s\n", yytokname(yychar
));
493 if(yychar
== YYEOFCODE
)
496 goto yynewstate
; /* try again in the same state */
500 /* reduction by production yyn */
502 fprintf(stderr
, "reduce %d in:\n\t%s", yyn
, yystatname(yystate
));
506 yyval
= (yyp
+1)->yyv
;
509 /* consult goto table to find next state */
512 yyj
= yyg
+ yyp
->yys
+ 1;
514 if(yyj
>= YYLAST
|| yychk
[yystate
=yyact
[yyj
]] != -yyn
)
515 yystate
= yyact
[yyg
];
520 { putout(yypt
[-0].yyv
); } break;
523 { ERROR
"syntax error" WARNING
; } break;
526 { eqnreg
= 0; } break;
529 { eqnbox(yypt
[-1].yyv
, yypt
[-0].yyv
, 0); } break;
532 { eqnbox(yypt
[-1].yyv
, yypt
[-0].yyv
, 1); } break;
535 { lineup(0); } break;
538 { yyval
= yypt
[-0].yyv
; lineup(1); } break;
541 { yyval
= yypt
[-0].yyv
; } break;
544 { yyval
= 0; } break;
547 { yyval
= yypt
[-0].yyv
; } break;
550 { yyval
= 0; } break;
553 { yyval
= yypt
[-1].yyv
; } break;
556 { text(QTEXT
, (char *) yypt
[-0].yyv
); } break;
559 { text(CONTIG
, (char *) yypt
[-0].yyv
); } break;
562 { text(SPACE
, (char *) 0); } break;
565 { text(THIN
, (char *) 0); } break;
568 { text(TAB
, (char *) 0); } break;
571 { funny(SUM
); } break;
574 { funny(PROD
); } break;
577 { funny(UNION
); } break;
580 { funny(INTER
); } break;
583 { boverb(yypt
[-2].yyv
, yypt
[-0].yyv
); } break;
586 { mark(yypt
[-0].yyv
); } break;
589 { size(yypt
[-1].yyv
, yypt
[-0].yyv
); } break;
592 { font(yypt
[-1].yyv
, yypt
[-0].yyv
); } break;
595 { fatbox(yypt
[-0].yyv
); } break;
598 { sqrt(yypt
[-0].yyv
); } break;
601 {ps
-= deltaps
;} break;
604 { subsup(yypt
[-4].yyv
, yypt
[-1].yyv
, yypt
[-0].yyv
); } break;
607 {ps
-= deltaps
;} break;
610 { subsup(yypt
[-3].yyv
, 0, yypt
[-0].yyv
); } break;
613 {ps
-= deltaps
;} break;
616 { integral(yypt
[-4].yyv
, yypt
[-1].yyv
, yypt
[-0].yyv
); } break;
619 {ps
-= deltaps
;} break;
622 { integral(yypt
[-3].yyv
, 0, yypt
[-0].yyv
); } break;
625 { integral(yypt
[-0].yyv
, 0, 0); } break;
628 {ps
-= deltaps
;} break;
631 { fromto(yypt
[-4].yyv
, yypt
[-1].yyv
, yypt
[-0].yyv
); } break;
634 {ps
-= deltaps
;} break;
637 { fromto(yypt
[-3].yyv
, 0, yypt
[-0].yyv
); } break;
640 { paren(yypt
[-2].yyv
, yypt
[-1].yyv
, yypt
[-0].yyv
); } break;
643 { paren(yypt
[-1].yyv
, yypt
[-0].yyv
, 0); } break;
646 { diacrit(yypt
[-1].yyv
, yypt
[-0].yyv
); } break;
649 { move(FWD
, yypt
[-1].yyv
, yypt
[-0].yyv
); } break;
652 { move(UP
, yypt
[-1].yyv
, yypt
[-0].yyv
); } break;
655 { move(BACK
, yypt
[-1].yyv
, yypt
[-0].yyv
); } break;
658 { move(DOWN
, yypt
[-1].yyv
, yypt
[-0].yyv
); } break;
661 { pile(yypt
[-0].yyv
); ct
= yypt
[-0].yyv
; } break;
667 { matrix(yypt
[-3].yyv
); ct
= yypt
[-3].yyv
; } break;
670 { setintegral(); } break;
673 { yyval
= atoi((char *) yypt
[-1].yyv
); } break;
676 { yyval
= atoi((char *) yypt
[-1].yyv
); } break;
679 { yyval
= atoi((char *) yypt
[-1].yyv
); } break;
682 { yyval
= atoi((char *) yypt
[-1].yyv
); } break;
685 { yyval
= HAT
; } break;
688 { yyval
= VEC
; } break;
691 { yyval
= DYAD
; } break;
694 { yyval
= BAR
; } break;
697 { yyval
= LOWBAR
; } break;
700 { yyval
= HIGHBAR
; } break;
703 { yyval
= UNDER
; } break;
706 { yyval
= DOT
; } break;
709 { yyval
= TILDE
; } break;
712 { yyval
= UTILDE
; } break;
715 { yyval
= DOTDOT
; } break;
718 { yyval
= ((char *)yypt
[-0].yyv
)[0]; } break;
721 { yyval
= '{'; } break;
724 { yyval
= ((char *)yypt
[-0].yyv
)[0]; } break;
727 { yyval
= '}'; } break;
730 { column(yypt
[-3].yyv
, DEFGAP
); } break;
733 {yyval
=atoi((char*)yypt
[-0].yyv
);} break;
736 { column(yypt
[-5].yyv
, yypt
[-3].yyv
); } break;
739 { yyval
= startcol(LCOL
); } break;
742 { yyval
= startcol(CCOL
); } break;
745 { yyval
= startcol(RCOL
); } break;
748 { yyval
= startcol(COL
); } break;
751 { lp
[ct
++] = yypt
[-0].yyv
; } break;
754 { lp
[ct
++] = yypt
[-0].yyv
; } break;
757 { yyval
= ps
; setsize((char *) yypt
[-0].yyv
); } break;
760 { static char R
[]="R"; setfont(R
); } break;
763 { static char I
[]="I"; setfont(I
); } break;
766 { static char B
[]="B"; setfont(B
); } break;
769 { setfont((char *)yypt
[-0].yyv
); } break;
771 goto yystack
; /* stack new state and value */