]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - usr.bin/yacc/tests/regress.02.out
MFC: r264832
[FreeBSD/stable/10.git] / usr.bin / yacc / tests / regress.02.out
1 #ifndef lint
2 static const char yysccsid[] = "@(#)yaccpar     1.9 (Berkeley) 02/21/93";
3 #endif
4
5 #define YYBYACC 1
6 #define YYMAJOR 1
7 #define YYMINOR 9
8 #define YYPATCH 20140101
9
10 #define YYEMPTY        (-1)
11 #define yyclearin      (yychar = YYEMPTY)
12 #define yyerrok        (yyerrflag = 0)
13 #define YYRECOVERING() (yyerrflag != 0)
14
15 #define YYPREFIX "yy"
16
17 #define YYPURE 0
18
19 #line 2 "calc1.y"
20
21 /* http://dinosaur.compilertools.net/yacc/index.html */
22
23 #include <stdlib.h>
24 #include <stdio.h>
25 #include <ctype.h>
26 #include <math.h>
27
28 typedef struct interval
29 {
30     double lo, hi;
31 }
32 INTERVAL;
33
34 INTERVAL vmul(double, double, INTERVAL);
35 INTERVAL vdiv(double, double, INTERVAL);
36
37 extern int yylex(void);
38 static void yyerror(const char *s);
39
40 int dcheck(INTERVAL);
41
42 double dreg[26];
43 INTERVAL vreg[26];
44
45 #line 31 "calc1.y"
46 #ifdef YYSTYPE
47 #undef  YYSTYPE_IS_DECLARED
48 #define YYSTYPE_IS_DECLARED 1
49 #endif
50 #ifndef YYSTYPE_IS_DECLARED
51 #define YYSTYPE_IS_DECLARED 1
52 typedef union
53 {
54         int ival;
55         double dval;
56         INTERVAL vval;
57 } YYSTYPE;
58 #endif /* !YYSTYPE_IS_DECLARED */
59 #line 59 "/dev/stdout"
60
61 /* compatibility with bison */
62 #ifdef YYPARSE_PARAM
63 /* compatibility with FreeBSD */
64 # ifdef YYPARSE_PARAM_TYPE
65 #  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
66 # else
67 #  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
68 # endif
69 #else
70 # define YYPARSE_DECL() yyparse(void)
71 #endif
72
73 /* Parameters sent to lex. */
74 #ifdef YYLEX_PARAM
75 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
76 # define YYLEX yylex(YYLEX_PARAM)
77 #else
78 # define YYLEX_DECL() yylex(void)
79 # define YYLEX yylex()
80 #endif
81
82 /* Parameters sent to yyerror. */
83 #ifndef YYERROR_DECL
84 #define YYERROR_DECL() yyerror(const char *s)
85 #endif
86 #ifndef YYERROR_CALL
87 #define YYERROR_CALL(msg) yyerror(msg)
88 #endif
89
90 extern int YYPARSE_DECL();
91
92 #define DREG 257
93 #define VREG 258
94 #define CONST 259
95 #define UMINUS 260
96 #define YYERRCODE 256
97 static const short yylhs[] = {                           -1,
98     3,    3,    0,    0,    0,    0,    0,    1,    1,    1,
99     1,    1,    1,    1,    1,    2,    2,    2,    2,    2,
100     2,    2,    2,    2,    2,    2,    2,    2,
101 };
102 static const short yylen[] = {                            2,
103     0,    2,    2,    2,    4,    4,    2,    1,    1,    3,
104     3,    3,    3,    2,    3,    1,    5,    1,    3,    3,
105     3,    3,    3,    3,    3,    3,    2,    3,
106 };
107 static const short yydefred[] = {                         0,
108     0,    0,    0,    8,    0,    0,    0,    0,    0,    7,
109     0,    0,    9,   18,   14,   27,    0,    0,    0,    0,
110     0,    0,    3,    0,    0,    0,    0,    4,    0,    0,
111     0,    0,    0,   15,    0,   28,    0,    0,    0,    0,
112    12,   24,   13,   26,    0,    0,   23,   25,   14,    0,
113     0,    0,    0,    0,    5,    6,    0,    0,    0,   12,
114    13,   17,
115 };
116 static const short yydgoto[] = {                          7,
117    32,    9,    0,
118 };
119 static const short yysindex[] = {                       -40,
120    -8,  -48,  -47,    0,  -37,  -37,    0,    2,   17,    0,
121   -34,  -37,    0,    0,    0,    0,  -25,   90,  -37,  -37,
122   -37,  -37,    0,  -37,  -37,  -37,  -37,    0,  -34,  -34,
123    25,  125,   31,    0,  -34,    0,  -11,   37,  -11,   37,
124     0,    0,    0,    0,   37,   37,    0,    0,    0,  111,
125   -34,  -34,  -34,  -34,    0,    0,  118,   69,   69,    0,
126     0,    0,
127 };
128 static const short yyrindex[] = {                         0,
129     0,   38,   44,    0,    0,    0,    0,    0,    0,    0,
130     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
131     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
132     0,   -9,    0,    0,    0,    0,   51,   -3,   56,   61,
133     0,    0,    0,    0,   67,   72,    0,    0,    0,    0,
134     0,    0,    0,    0,    0,    0,    0,   78,   83,    0,
135     0,    0,
136 };
137 static const short yygindex[] = {                         0,
138     4,  124,    0,
139 };
140 #define YYTABLESIZE 225
141 static const short yytable[] = {                          6,
142    16,   10,    6,    8,    5,   30,   20,    5,   15,   17,
143    29,   23,   11,   12,   31,   34,   21,   19,   35,   20,
144     0,   22,   37,   39,   41,   43,   28,    0,    0,    0,
145    21,   16,   49,   50,   55,   22,    0,   20,   57,   20,
146    56,   20,    0,   21,   19,    0,   20,    9,   22,    0,
147     0,    0,    0,   18,   58,   59,   60,   61,   26,   24,
148    10,   25,    0,   27,    0,   11,   53,   51,    0,   52,
149    22,   54,   26,   24,    0,   25,   19,   27,   26,    9,
150     9,   21,    9,   27,    9,   18,   18,   10,   18,    0,
151    18,   10,   11,   10,   10,   10,   11,    0,   11,   11,
152    11,   22,    0,   22,    0,   22,    0,   19,    0,   19,
153    53,   19,   21,    0,   21,   54,   21,    0,   10,    0,
154    10,    0,   10,   11,    0,   11,    0,   11,   16,   18,
155    36,   26,   24,    0,   25,   33,   27,    0,    0,    0,
156     0,    0,   38,   40,   42,   44,    0,   45,   46,   47,
157    48,   34,   53,   51,    0,   52,    0,   54,   62,   53,
158    51,    0,   52,    0,   54,    0,   21,   19,    0,   20,
159     0,   22,    0,    0,    0,    0,    0,    0,    0,    0,
160     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
161     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
162     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
163     0,    0,    0,    0,    0,    1,    2,    3,    4,   13,
164    14,    4,   13,    0,    4,
165 };
166 static const short yycheck[] = {                         40,
167    10,   10,   40,    0,   45,   40,   10,   45,    5,    6,
168    45,   10,   61,   61,   11,   41,   42,   43,   44,   45,
169    -1,   47,   19,   20,   21,   22,   10,   -1,   -1,   -1,
170    42,   41,   29,   30,   10,   47,   -1,   41,   35,   43,
171    10,   45,   -1,   42,   43,   -1,   45,   10,   47,   -1,
172    -1,   -1,   -1,   10,   51,   52,   53,   54,   42,   43,
173    10,   45,   -1,   47,   -1,   10,   42,   43,   -1,   45,
174    10,   47,   42,   43,   -1,   45,   10,   47,   42,   42,
175    43,   10,   45,   47,   47,   42,   43,   10,   45,   -1,
176    47,   41,   10,   43,   44,   45,   41,   -1,   43,   44,
177    45,   41,   -1,   43,   -1,   45,   -1,   41,   -1,   43,
178    42,   45,   41,   -1,   43,   47,   45,   -1,   41,   -1,
179    43,   -1,   45,   41,   -1,   43,   -1,   45,    5,    6,
180    41,   42,   43,   -1,   45,   12,   47,   -1,   -1,   -1,
181    -1,   -1,   19,   20,   21,   22,   -1,   24,   25,   26,
182    27,   41,   42,   43,   -1,   45,   -1,   47,   41,   42,
183    43,   -1,   45,   -1,   47,   -1,   42,   43,   -1,   45,
184    -1,   47,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
185    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
186    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
187    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
188    -1,   -1,   -1,   -1,   -1,  256,  257,  258,  259,  257,
189   258,  259,  257,   -1,  259,
190 };
191 #define YYFINAL 7
192 #ifndef YYDEBUG
193 #define YYDEBUG 0
194 #endif
195 #define YYMAXTOKEN 260
196 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
197 #if YYDEBUG
198 static const char *yyname[] = {
199
200 "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
201 0,0,0,0,0,0,0,0,0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,0,0,0,0,
202 0,0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
203 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
204 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
205 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
206 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
207 0,0,"DREG","VREG","CONST","UMINUS","illegal-symbol",
208 };
209 static const char *yyrule[] = {
210 "$accept : line",
211 "lines :",
212 "lines : lines line",
213 "line : dexp '\\n'",
214 "line : vexp '\\n'",
215 "line : DREG '=' dexp '\\n'",
216 "line : VREG '=' vexp '\\n'",
217 "line : error '\\n'",
218 "dexp : CONST",
219 "dexp : DREG",
220 "dexp : dexp '+' dexp",
221 "dexp : dexp '-' dexp",
222 "dexp : dexp '*' dexp",
223 "dexp : dexp '/' dexp",
224 "dexp : '-' dexp",
225 "dexp : '(' dexp ')'",
226 "vexp : dexp",
227 "vexp : '(' dexp ',' dexp ')'",
228 "vexp : VREG",
229 "vexp : vexp '+' vexp",
230 "vexp : dexp '+' vexp",
231 "vexp : vexp '-' vexp",
232 "vexp : dexp '-' vexp",
233 "vexp : vexp '*' vexp",
234 "vexp : dexp '*' vexp",
235 "vexp : vexp '/' vexp",
236 "vexp : dexp '/' vexp",
237 "vexp : '-' vexp",
238 "vexp : '(' vexp ')'",
239
240 };
241 #endif
242
243 int      yydebug;
244 int      yynerrs;
245
246 int      yyerrflag;
247 int      yychar;
248 YYSTYPE  yyval;
249 YYSTYPE  yylval;
250
251 /* define the initial stack-sizes */
252 #ifdef YYSTACKSIZE
253 #undef YYMAXDEPTH
254 #define YYMAXDEPTH  YYSTACKSIZE
255 #else
256 #ifdef YYMAXDEPTH
257 #define YYSTACKSIZE YYMAXDEPTH
258 #else
259 #define YYSTACKSIZE 10000
260 #define YYMAXDEPTH  10000
261 #endif
262 #endif
263
264 #define YYINITSTACKSIZE 200
265
266 typedef struct {
267     unsigned stacksize;
268     short    *s_base;
269     short    *s_mark;
270     short    *s_last;
271     YYSTYPE  *l_base;
272     YYSTYPE  *l_mark;
273 } YYSTACKDATA;
274 /* variables for the parser stack */
275 static YYSTACKDATA yystack;
276 #line 176 "calc1.y"
277         /* beginning of subroutines section */
278
279 #define BSZ 50                  /* buffer size for floating point numbers */
280
281         /* lexical analysis */
282
283 static void
284 yyerror(const char *s)
285 {
286     fprintf(stderr, "%s\n", s);
287 }
288
289 int
290 yylex(void)
291 {
292     int c;
293
294     while ((c = getchar()) == ' ')
295     {                           /* skip over blanks */
296     }
297
298     if (isupper(c))
299     {
300         yylval.ival = c - 'A';
301         return (VREG);
302     }
303     if (islower(c))
304     {
305         yylval.ival = c - 'a';
306         return (DREG);
307     }
308
309     if (isdigit(c) || c == '.')
310     {
311         /* gobble up digits, points, exponents */
312         char buf[BSZ + 1], *cp = buf;
313         int dot = 0, expr = 0;
314
315         for (; (cp - buf) < BSZ; ++cp, c = getchar())
316         {
317
318             *cp = c;
319             if (isdigit(c))
320                 continue;
321             if (c == '.')
322             {
323                 if (dot++ || expr)
324                     return ('.');       /* will cause syntax error */
325                 continue;
326             }
327
328             if (c == 'e')
329             {
330                 if (expr++)
331                     return ('e');       /*  will  cause  syntax  error  */
332                 continue;
333             }
334
335             /*  end  of  number  */
336             break;
337         }
338         *cp = '\0';
339
340         if ((cp - buf) >= BSZ)
341             printf("constant  too  long:  truncated\n");
342         else
343             ungetc(c, stdin);   /*  push  back  last  char  read  */
344         yylval.dval = atof(buf);
345         return (CONST);
346     }
347     return (c);
348 }
349
350 static INTERVAL
351 hilo(double a, double b, double c, double d)
352 {
353     /*  returns  the  smallest  interval  containing  a,  b,  c,  and  d  */
354     /*  used  by  *,  /  routines  */
355     INTERVAL v;
356
357     if (a > b)
358     {
359         v.hi = a;
360         v.lo = b;
361     }
362     else
363     {
364         v.hi = b;
365         v.lo = a;
366     }
367
368     if (c > d)
369     {
370         if (c > v.hi)
371             v.hi = c;
372         if (d < v.lo)
373             v.lo = d;
374     }
375     else
376     {
377         if (d > v.hi)
378             v.hi = d;
379         if (c < v.lo)
380             v.lo = c;
381     }
382     return (v);
383 }
384
385 INTERVAL
386 vmul(double a, double b, INTERVAL v)
387 {
388     return (hilo(a * v.hi, a * v.lo, b * v.hi, b * v.lo));
389 }
390
391 int
392 dcheck(INTERVAL v)
393 {
394     if (v.hi >= 0. && v.lo <= 0.)
395     {
396         printf("divisor  interval  contains  0.\n");
397         return (1);
398     }
399     return (0);
400 }
401
402 INTERVAL
403 vdiv(double a, double b, INTERVAL v)
404 {
405     return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
406 }
407 #line 406 "/dev/stdout"
408
409 #if YYDEBUG
410 #include <stdio.h>              /* needed for printf */
411 #endif
412
413 #include <stdlib.h>     /* needed for malloc, etc */
414 #include <string.h>     /* needed for memset */
415
416 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
417 static int yygrowstack(YYSTACKDATA *data)
418 {
419     int i;
420     unsigned newsize;
421     short *newss;
422     YYSTYPE *newvs;
423
424     if ((newsize = data->stacksize) == 0)
425         newsize = YYINITSTACKSIZE;
426     else if (newsize >= YYMAXDEPTH)
427         return -1;
428     else if ((newsize *= 2) > YYMAXDEPTH)
429         newsize = YYMAXDEPTH;
430
431     i = (int) (data->s_mark - data->s_base);
432     newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
433     if (newss == 0)
434         return -1;
435
436     data->s_base = newss;
437     data->s_mark = newss + i;
438
439     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
440     if (newvs == 0)
441         return -1;
442
443     data->l_base = newvs;
444     data->l_mark = newvs + i;
445
446     data->stacksize = newsize;
447     data->s_last = data->s_base + newsize - 1;
448     return 0;
449 }
450
451 #if YYPURE || defined(YY_NO_LEAKS)
452 static void yyfreestack(YYSTACKDATA *data)
453 {
454     free(data->s_base);
455     free(data->l_base);
456     memset(data, 0, sizeof(*data));
457 }
458 #else
459 #define yyfreestack(data) /* nothing */
460 #endif
461
462 #define YYABORT  goto yyabort
463 #define YYREJECT goto yyabort
464 #define YYACCEPT goto yyaccept
465 #define YYERROR  goto yyerrlab
466
467 int
468 YYPARSE_DECL()
469 {
470     int yym, yyn, yystate;
471 #if YYDEBUG
472     const char *yys;
473
474     if ((yys = getenv("YYDEBUG")) != 0)
475     {
476         yyn = *yys;
477         if (yyn >= '0' && yyn <= '9')
478             yydebug = yyn - '0';
479     }
480 #endif
481
482     yynerrs = 0;
483     yyerrflag = 0;
484     yychar = YYEMPTY;
485     yystate = 0;
486
487 #if YYPURE
488     memset(&yystack, 0, sizeof(yystack));
489 #endif
490
491     if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
492     yystack.s_mark = yystack.s_base;
493     yystack.l_mark = yystack.l_base;
494     yystate = 0;
495     *yystack.s_mark = 0;
496
497 yyloop:
498     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
499     if (yychar < 0)
500     {
501         if ((yychar = YYLEX) < 0) yychar = 0;
502 #if YYDEBUG
503         if (yydebug)
504         {
505             yys = yyname[YYTRANSLATE(yychar)];
506             printf("%sdebug: state %d, reading %d (%s)\n",
507                     YYPREFIX, yystate, yychar, yys);
508         }
509 #endif
510     }
511     if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
512             yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
513     {
514 #if YYDEBUG
515         if (yydebug)
516             printf("%sdebug: state %d, shifting to state %d\n",
517                     YYPREFIX, yystate, yytable[yyn]);
518 #endif
519         if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
520         {
521             goto yyoverflow;
522         }
523         yystate = yytable[yyn];
524         *++yystack.s_mark = yytable[yyn];
525         *++yystack.l_mark = yylval;
526         yychar = YYEMPTY;
527         if (yyerrflag > 0)  --yyerrflag;
528         goto yyloop;
529     }
530     if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
531             yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
532     {
533         yyn = yytable[yyn];
534         goto yyreduce;
535     }
536     if (yyerrflag) goto yyinrecovery;
537
538     yyerror("syntax error");
539
540     goto yyerrlab;
541
542 yyerrlab:
543     ++yynerrs;
544
545 yyinrecovery:
546     if (yyerrflag < 3)
547     {
548         yyerrflag = 3;
549         for (;;)
550         {
551             if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
552                     yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
553             {
554 #if YYDEBUG
555                 if (yydebug)
556                     printf("%sdebug: state %d, error recovery shifting\
557  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
558 #endif
559                 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
560                 {
561                     goto yyoverflow;
562                 }
563                 yystate = yytable[yyn];
564                 *++yystack.s_mark = yytable[yyn];
565                 *++yystack.l_mark = yylval;
566                 goto yyloop;
567             }
568             else
569             {
570 #if YYDEBUG
571                 if (yydebug)
572                     printf("%sdebug: error recovery discarding state %d\n",
573                             YYPREFIX, *yystack.s_mark);
574 #endif
575                 if (yystack.s_mark <= yystack.s_base) goto yyabort;
576                 --yystack.s_mark;
577                 --yystack.l_mark;
578             }
579         }
580     }
581     else
582     {
583         if (yychar == 0) goto yyabort;
584 #if YYDEBUG
585         if (yydebug)
586         {
587             yys = yyname[YYTRANSLATE(yychar)];
588             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
589                     YYPREFIX, yystate, yychar, yys);
590         }
591 #endif
592         yychar = YYEMPTY;
593         goto yyloop;
594     }
595
596 yyreduce:
597 #if YYDEBUG
598     if (yydebug)
599         printf("%sdebug: state %d, reducing by rule %d (%s)\n",
600                 YYPREFIX, yystate, yyn, yyrule[yyn]);
601 #endif
602     yym = yylen[yyn];
603     if (yym)
604         yyval = yystack.l_mark[1-yym];
605     else
606         memset(&yyval, 0, sizeof yyval);
607     switch (yyn)
608     {
609 case 3:
610 #line 57 "calc1.y"
611         {
612                 (void) printf("%15.8f\n", yystack.l_mark[-1].dval);
613         }
614 break;
615 case 4:
616 #line 61 "calc1.y"
617         {
618                 (void) printf("(%15.8f, %15.8f)\n", yystack.l_mark[-1].vval.lo, yystack.l_mark[-1].vval.hi);
619         }
620 break;
621 case 5:
622 #line 65 "calc1.y"
623         {
624                 dreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].dval;
625         }
626 break;
627 case 6:
628 #line 69 "calc1.y"
629         {
630                 vreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].vval;
631         }
632 break;
633 case 7:
634 #line 73 "calc1.y"
635         {
636                 yyerrok;
637         }
638 break;
639 case 9:
640 #line 80 "calc1.y"
641         {
642                 yyval.dval = dreg[yystack.l_mark[0].ival];
643         }
644 break;
645 case 10:
646 #line 84 "calc1.y"
647         {
648                 yyval.dval = yystack.l_mark[-2].dval + yystack.l_mark[0].dval;
649         }
650 break;
651 case 11:
652 #line 88 "calc1.y"
653         {
654                 yyval.dval = yystack.l_mark[-2].dval - yystack.l_mark[0].dval;
655         }
656 break;
657 case 12:
658 #line 92 "calc1.y"
659         {
660                 yyval.dval = yystack.l_mark[-2].dval * yystack.l_mark[0].dval;
661         }
662 break;
663 case 13:
664 #line 96 "calc1.y"
665         {
666                 yyval.dval = yystack.l_mark[-2].dval / yystack.l_mark[0].dval;
667         }
668 break;
669 case 14:
670 #line 100 "calc1.y"
671         {
672                 yyval.dval = -yystack.l_mark[0].dval;
673         }
674 break;
675 case 15:
676 #line 104 "calc1.y"
677         {
678                 yyval.dval = yystack.l_mark[-1].dval;
679         }
680 break;
681 case 16:
682 #line 110 "calc1.y"
683         {
684                 yyval.vval.hi = yyval.vval.lo = yystack.l_mark[0].dval;
685         }
686 break;
687 case 17:
688 #line 114 "calc1.y"
689         {
690                 yyval.vval.lo = yystack.l_mark[-3].dval;
691                 yyval.vval.hi = yystack.l_mark[-1].dval;
692                 if ( yyval.vval.lo > yyval.vval.hi ) 
693                 {
694                         (void) printf("interval out of order\n");
695                         YYERROR;
696                 }
697         }
698 break;
699 case 18:
700 #line 124 "calc1.y"
701         {
702                 yyval.vval = vreg[yystack.l_mark[0].ival];
703         }
704 break;
705 case 19:
706 #line 128 "calc1.y"
707         {
708                 yyval.vval.hi = yystack.l_mark[-2].vval.hi + yystack.l_mark[0].vval.hi;
709                 yyval.vval.lo = yystack.l_mark[-2].vval.lo + yystack.l_mark[0].vval.lo;
710         }
711 break;
712 case 20:
713 #line 133 "calc1.y"
714         {
715                 yyval.vval.hi = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.hi;
716                 yyval.vval.lo = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.lo;
717         }
718 break;
719 case 21:
720 #line 138 "calc1.y"
721         {
722                 yyval.vval.hi = yystack.l_mark[-2].vval.hi - yystack.l_mark[0].vval.lo;
723                 yyval.vval.lo = yystack.l_mark[-2].vval.lo - yystack.l_mark[0].vval.hi;
724         }
725 break;
726 case 22:
727 #line 143 "calc1.y"
728         {
729                 yyval.vval.hi = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.lo;
730                 yyval.vval.lo = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.hi;
731         }
732 break;
733 case 23:
734 #line 148 "calc1.y"
735         {
736                 yyval.vval = vmul( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
737         }
738 break;
739 case 24:
740 #line 152 "calc1.y"
741         {
742                 yyval.vval = vmul (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
743         }
744 break;
745 case 25:
746 #line 156 "calc1.y"
747         {
748                 if (dcheck(yystack.l_mark[0].vval)) YYERROR;
749                 yyval.vval = vdiv ( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
750         }
751 break;
752 case 26:
753 #line 161 "calc1.y"
754         {
755                 if (dcheck ( yystack.l_mark[0].vval )) YYERROR;
756                 yyval.vval = vdiv (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
757         }
758 break;
759 case 27:
760 #line 166 "calc1.y"
761         {
762                 yyval.vval.hi = -yystack.l_mark[0].vval.lo;
763                 yyval.vval.lo = -yystack.l_mark[0].vval.hi;
764         }
765 break;
766 case 28:
767 #line 171 "calc1.y"
768         {
769                 yyval.vval = yystack.l_mark[-1].vval;
770         }
771 break;
772 #line 771 "/dev/stdout"
773     }
774     yystack.s_mark -= yym;
775     yystate = *yystack.s_mark;
776     yystack.l_mark -= yym;
777     yym = yylhs[yyn];
778     if (yystate == 0 && yym == 0)
779     {
780 #if YYDEBUG
781         if (yydebug)
782             printf("%sdebug: after reduction, shifting from state 0 to\
783  state %d\n", YYPREFIX, YYFINAL);
784 #endif
785         yystate = YYFINAL;
786         *++yystack.s_mark = YYFINAL;
787         *++yystack.l_mark = yyval;
788         if (yychar < 0)
789         {
790             if ((yychar = YYLEX) < 0) yychar = 0;
791 #if YYDEBUG
792             if (yydebug)
793             {
794                 yys = yyname[YYTRANSLATE(yychar)];
795                 printf("%sdebug: state %d, reading %d (%s)\n",
796                         YYPREFIX, YYFINAL, yychar, yys);
797             }
798 #endif
799         }
800         if (yychar == 0) goto yyaccept;
801         goto yyloop;
802     }
803     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
804             yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
805         yystate = yytable[yyn];
806     else
807         yystate = yydgoto[yym];
808 #if YYDEBUG
809     if (yydebug)
810         printf("%sdebug: after reduction, shifting from state %d \
811 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
812 #endif
813     if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
814     {
815         goto yyoverflow;
816     }
817     *++yystack.s_mark = (short) yystate;
818     *++yystack.l_mark = yyval;
819     goto yyloop;
820
821 yyoverflow:
822     yyerror("yacc stack overflow");
823
824 yyabort:
825     yyfreestack(&yystack);
826     return (1);
827
828 yyaccept:
829     yyfreestack(&yystack);
830     return (0);
831 }