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