summaryrefslogtreecommitdiff
path: root/test/calc1.tab.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/calc1.tab.c')
-rw-r--r--test/calc1.tab.c75
1 files changed, 38 insertions, 37 deletions
diff --git a/test/calc1.tab.c b/test/calc1.tab.c
index 0597b94..e55e64a 100644
--- a/test/calc1.tab.c
+++ b/test/calc1.tab.c
@@ -112,12 +112,13 @@ INTERVAL;
INTERVAL vmul(double, double, INTERVAL);
INTERVAL vdiv(double, double, INTERVAL);
+
int dcheck(INTERVAL);
double dreg[26];
INTERVAL vreg[26];
-#line 27 "calc1.y"
+#line 28 "calc1.y"
#ifdef YYSTYPE
#undef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
@@ -131,7 +132,7 @@ typedef union
INTERVAL vval;
} YYSTYPE;
#endif /* !YYSTYPE_IS_DECLARED */
-#line 135 "calc1.tab.c"
+#line 136 "calc1.tab.c"
/* compatibility with bison */
#ifdef YYPARSE_PARAM
/* compatibility with FreeBSD */
@@ -158,7 +159,6 @@ typedef union
#define YYERROR_CALL(msg) yyerror(msg)
extern int YYPARSE_DECL();
-extern int YYLEX_DECL();
#define DREG 257
#define VREG 258
@@ -342,9 +342,14 @@ YYSTYPE yylval;
/* variables for the parser stack */
static YYSTACKDATA yystack;
-#line 172 "calc1.y"
+#line 173 "calc1.y"
/* beginning of subroutines section */
+#ifdef YYBYACC
+extern int YYLEX_DECL();
+static void YYERROR_DECL();
+#endif
+
#define BSZ 50 /* buffer size for floating point numbers */
/* lexical analysis */
@@ -473,7 +478,7 @@ vdiv(double a, double b, INTERVAL v)
{
return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
}
-#line 477 "calc1.tab.c"
+#line 482 "calc1.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -498,18 +503,14 @@ static int yygrowstack(YYSTACKDATA *data)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
- newss = (data->s_base != 0)
- ? (short *)realloc(data->s_base, newsize * sizeof(*newss))
- : (short *)malloc(newsize * sizeof(*newss));
+ newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;
data->s_base = newss;
data->s_mark = newss + i;
- newvs = (data->l_base != 0)
- ? (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs))
- : (YYSTYPE *)malloc(newsize * sizeof(*newvs));
+ newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
if (newvs == 0)
return -1;
@@ -684,85 +685,85 @@ yyreduce:
switch (yyn)
{
case 3:
-#line 53 "calc1.y"
+#line 54 "calc1.y"
{
(void) printf("%15.8f\n", yystack.l_mark[-1].dval);
}
break;
case 4:
-#line 57 "calc1.y"
+#line 58 "calc1.y"
{
(void) printf("(%15.8f, %15.8f)\n", yystack.l_mark[-1].vval.lo, yystack.l_mark[-1].vval.hi);
}
break;
case 5:
-#line 61 "calc1.y"
+#line 62 "calc1.y"
{
dreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].dval;
}
break;
case 6:
-#line 65 "calc1.y"
+#line 66 "calc1.y"
{
vreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].vval;
}
break;
case 7:
-#line 69 "calc1.y"
+#line 70 "calc1.y"
{
yyerrok;
}
break;
case 9:
-#line 76 "calc1.y"
+#line 77 "calc1.y"
{
yyval.dval = dreg[yystack.l_mark[0].ival];
}
break;
case 10:
-#line 80 "calc1.y"
+#line 81 "calc1.y"
{
yyval.dval = yystack.l_mark[-2].dval + yystack.l_mark[0].dval;
}
break;
case 11:
-#line 84 "calc1.y"
+#line 85 "calc1.y"
{
yyval.dval = yystack.l_mark[-2].dval - yystack.l_mark[0].dval;
}
break;
case 12:
-#line 88 "calc1.y"
+#line 89 "calc1.y"
{
yyval.dval = yystack.l_mark[-2].dval * yystack.l_mark[0].dval;
}
break;
case 13:
-#line 92 "calc1.y"
+#line 93 "calc1.y"
{
yyval.dval = yystack.l_mark[-2].dval / yystack.l_mark[0].dval;
}
break;
case 14:
-#line 96 "calc1.y"
+#line 97 "calc1.y"
{
yyval.dval = -yystack.l_mark[0].dval;
}
break;
case 15:
-#line 100 "calc1.y"
+#line 101 "calc1.y"
{
yyval.dval = yystack.l_mark[-1].dval;
}
break;
case 16:
-#line 106 "calc1.y"
+#line 107 "calc1.y"
{
yyval.vval.hi = yyval.vval.lo = yystack.l_mark[0].dval;
}
break;
case 17:
-#line 110 "calc1.y"
+#line 111 "calc1.y"
{
yyval.vval.lo = yystack.l_mark[-3].dval;
yyval.vval.hi = yystack.l_mark[-1].dval;
@@ -774,79 +775,79 @@ case 17:
}
break;
case 18:
-#line 120 "calc1.y"
+#line 121 "calc1.y"
{
yyval.vval = vreg[yystack.l_mark[0].ival];
}
break;
case 19:
-#line 124 "calc1.y"
+#line 125 "calc1.y"
{
yyval.vval.hi = yystack.l_mark[-2].vval.hi + yystack.l_mark[0].vval.hi;
yyval.vval.lo = yystack.l_mark[-2].vval.lo + yystack.l_mark[0].vval.lo;
}
break;
case 20:
-#line 129 "calc1.y"
+#line 130 "calc1.y"
{
yyval.vval.hi = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.hi;
yyval.vval.lo = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.lo;
}
break;
case 21:
-#line 134 "calc1.y"
+#line 135 "calc1.y"
{
yyval.vval.hi = yystack.l_mark[-2].vval.hi - yystack.l_mark[0].vval.lo;
yyval.vval.lo = yystack.l_mark[-2].vval.lo - yystack.l_mark[0].vval.hi;
}
break;
case 22:
-#line 139 "calc1.y"
+#line 140 "calc1.y"
{
yyval.vval.hi = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.lo;
yyval.vval.lo = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.hi;
}
break;
case 23:
-#line 144 "calc1.y"
+#line 145 "calc1.y"
{
yyval.vval = vmul( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
}
break;
case 24:
-#line 148 "calc1.y"
+#line 149 "calc1.y"
{
yyval.vval = vmul (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
}
break;
case 25:
-#line 152 "calc1.y"
+#line 153 "calc1.y"
{
if (dcheck(yystack.l_mark[0].vval)) YYERROR;
yyval.vval = vdiv ( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
}
break;
case 26:
-#line 157 "calc1.y"
+#line 158 "calc1.y"
{
if (dcheck ( yystack.l_mark[0].vval )) YYERROR;
yyval.vval = vdiv (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
}
break;
case 27:
-#line 162 "calc1.y"
+#line 163 "calc1.y"
{
yyval.vval.hi = -yystack.l_mark[0].vval.lo;
yyval.vval.lo = -yystack.l_mark[0].vval.hi;
}
break;
case 28:
-#line 167 "calc1.y"
+#line 168 "calc1.y"
{
yyval.vval = yystack.l_mark[-1].vval;
}
break;
-#line 850 "calc1.tab.c"
+#line 851 "calc1.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;