summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-01 14:48:41 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-01 14:48:41 +0900
commit72c77f8a5a5aeaca87e922e2920d9ce8404e4a0b (patch)
tree0824fa4a2fff6d83ec2040f247b4f8a62f4ccf76 /test
parent5eef5e9a1c52f9ec438967247437c0201c4f3db1 (diff)
downloadbyacc-72c77f8a5a5aeaca87e922e2920d9ce8404e4a0b.tar.gz
byacc-72c77f8a5a5aeaca87e922e2920d9ce8404e4a0b.tar.bz2
byacc-72c77f8a5a5aeaca87e922e2920d9ce8404e4a0b.zip
Imported Upstream version 20180510upstream/20180510
Diffstat (limited to 'test')
-rw-r--r--test/btyacc/btyacc_calc1.tab.c9
-rw-r--r--test/btyacc/btyacc_calc1.tab.h1
-rw-r--r--test/btyacc/btyacc_demo.tab.c121
-rw-r--r--test/btyacc/btyacc_demo2.error1
-rw-r--r--test/btyacc/btyacc_demo2.output0
-rw-r--r--test/btyacc/btyacc_demo2.tab.c15
-rw-r--r--test/btyacc/btyacc_demo2.tab.h0
-rw-r--r--test/btyacc/btyacc_destroy1.tab.c11
-rw-r--r--test/btyacc/btyacc_destroy2.tab.c11
-rw-r--r--test/btyacc/btyacc_destroy3.tab.c11
-rw-r--r--test/btyacc/calc.tab.c9
-rw-r--r--test/btyacc/calc1.tab.c9
-rw-r--r--test/btyacc/calc2.tab.c9
-rw-r--r--test/btyacc/calc3.tab.c9
-rw-r--r--test/btyacc/code_calc.code.c9
-rw-r--r--test/btyacc/code_debug.c1125
-rw-r--r--test/btyacc/code_debug.error0
-rw-r--r--test/btyacc/code_debug.h6
-rw-r--r--test/btyacc/code_debug.i60
-rw-r--r--test/btyacc/code_debug.output34
-rw-r--r--test/btyacc/code_error.code.c7
-rw-r--r--test/btyacc/empty.tab.c7
-rw-r--r--test/btyacc/err_inherit3.tab.c15
-rw-r--r--test/btyacc/err_inherit4.tab.c15
-rw-r--r--test/btyacc/err_syntax10.tab.c7
-rw-r--r--test/btyacc/err_syntax11.tab.c7
-rw-r--r--test/btyacc/err_syntax12.tab.c7
-rw-r--r--test/btyacc/err_syntax18.tab.c9
-rw-r--r--test/btyacc/err_syntax20.tab.c9
-rw-r--r--test/btyacc/error.tab.c7
-rw-r--r--test/btyacc/expr.oxout.tab.c9
-rw-r--r--test/btyacc/grammar.tab.c210
-rw-r--r--test/btyacc/inherit0.tab.c9
-rw-r--r--test/btyacc/inherit1.tab.c9
-rw-r--r--test/btyacc/inherit2.tab.c15
-rw-r--r--test/btyacc/ok_syntax1.tab.c9
-rw-r--r--test/btyacc/ok_syntax1.tab.h1
-rw-r--r--test/btyacc/pure_calc.tab.c9
-rw-r--r--test/btyacc/pure_error.tab.c7
-rw-r--r--test/btyacc/quote_calc-s.tab.c9
-rw-r--r--test/btyacc/quote_calc.tab.c9
-rw-r--r--test/btyacc/quote_calc2-s.tab.c9
-rw-r--r--test/btyacc/quote_calc2.tab.c9
-rw-r--r--test/btyacc/quote_calc3-s.tab.c9
-rw-r--r--test/btyacc/quote_calc3.tab.c9
-rw-r--r--test/btyacc/quote_calc4-s.tab.c9
-rw-r--r--test/btyacc/quote_calc4.tab.c9
-rw-r--r--test/btyacc/rename_debug.c7
-rw-r--r--test/btyacc/rename_debug.i13
-rw-r--r--test/btyacc/varsyntax_calc1.tab.c9
-rw-r--r--test/calc.tab.c668
-rw-r--r--test/grammar.y35
-rw-r--r--test/yacc/calc.tab.c8
-rw-r--r--test/yacc/calc1.tab.c8
-rw-r--r--test/yacc/calc2.tab.c8
-rw-r--r--test/yacc/calc3.tab.c8
-rw-r--r--test/yacc/code_calc.code.c8
-rw-r--r--test/yacc/code_error.code.c6
-rw-r--r--test/yacc/empty.tab.c6
-rw-r--r--test/yacc/err_syntax10.tab.c6
-rw-r--r--test/yacc/err_syntax11.tab.c6
-rw-r--r--test/yacc/err_syntax12.tab.c6
-rw-r--r--test/yacc/err_syntax18.tab.c8
-rw-r--r--test/yacc/err_syntax20.tab.c8
-rw-r--r--test/yacc/error.tab.c6
-rw-r--r--test/yacc/expr.oxout.tab.c8
-rw-r--r--test/yacc/grammar.tab.c209
-rw-r--r--test/yacc/ok_syntax1.tab.c8
-rw-r--r--test/yacc/ok_syntax1.tab.h1
-rw-r--r--test/yacc/pure_calc.tab.c8
-rw-r--r--test/yacc/pure_error.tab.c6
-rw-r--r--test/yacc/quote_calc-s.tab.c8
-rw-r--r--test/yacc/quote_calc.tab.c8
-rw-r--r--test/yacc/quote_calc2-s.tab.c8
-rw-r--r--test/yacc/quote_calc2.tab.c8
-rw-r--r--test/yacc/quote_calc3-s.tab.c8
-rw-r--r--test/yacc/quote_calc3.tab.c8
-rw-r--r--test/yacc/quote_calc4-s.tab.c8
-rw-r--r--test/yacc/quote_calc4.tab.c8
-rw-r--r--test/yacc/rename_debug.c6
-rw-r--r--test/yacc/rename_debug.i12
-rw-r--r--test/yacc/varsyntax_calc1.tab.c8
82 files changed, 1331 insertions, 1713 deletions
diff --git a/test/btyacc/btyacc_calc1.tab.c b/test/btyacc/btyacc_calc1.tab.c
index 6142a13..5994869 100644
--- a/test/btyacc/btyacc_calc1.tab.c
+++ b/test/btyacc/btyacc_calc1.tab.c
@@ -389,8 +389,9 @@ static const char *const calc1_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
#ifndef YYLLOC_DEFAULT
@@ -615,7 +616,7 @@ vdiv(double a, double b, INTERVAL v)
{
return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
}
-#line 619 "btyacc_calc1.tab.c"
+#line 620 "btyacc_calc1.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -752,6 +753,8 @@ YYPARSE_DECL()
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+ int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -1537,7 +1540,7 @@ case 28:
yyval.vval = yystack.l_mark[-1].vval;
}
break;
-#line 1541 "btyacc_calc1.tab.c"
+#line 1544 "btyacc_calc1.tab.c"
default:
break;
}
diff --git a/test/btyacc/btyacc_calc1.tab.h b/test/btyacc/btyacc_calc1.tab.h
index 1802350..9cf4e75 100644
--- a/test/btyacc/btyacc_calc1.tab.h
+++ b/test/btyacc/btyacc_calc1.tab.h
@@ -18,6 +18,5 @@ typedef union
INTERVAL vval;
} YYSTYPE;
#endif /* !YYSTYPE_IS_DECLARED */
-extern YYSTYPE calc1_lval;
#endif /* _calc1__defines_h_ */
diff --git a/test/btyacc/btyacc_demo.tab.c b/test/btyacc/btyacc_demo.tab.c
index eff738c..a588bbc 100644
--- a/test/btyacc/btyacc_demo.tab.c
+++ b/test/btyacc/btyacc_demo.tab.c
@@ -508,13 +508,16 @@ static const char *const demo_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -660,7 +663,7 @@ extern Expr * var_expr(Scope *scope, char *id);
extern Code * build_expr_code(Expr *expr);
extern Code * build_if(Expr *cond_expr, Code *then_stmt, Code *else_stmt);
extern Code * code_append(Code *stmt_list, Code *stmt);
-#line 664 "btyacc_demo.tab.c"
+#line 667 "btyacc_demo.tab.c"
/* Release memory associated with symbol. */
#if ! defined YYDESTRUCT_IS_DECLARED
@@ -677,7 +680,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 681 "btyacc_demo.tab.c"
+#line 684 "btyacc_demo.tab.c"
case 45:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -686,7 +689,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 690 "btyacc_demo.tab.c"
+#line 693 "btyacc_demo.tab.c"
case 42:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -695,7 +698,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 699 "btyacc_demo.tab.c"
+#line 702 "btyacc_demo.tab.c"
case 47:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -704,7 +707,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 708 "btyacc_demo.tab.c"
+#line 711 "btyacc_demo.tab.c"
case 37:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -713,7 +716,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 717 "btyacc_demo.tab.c"
+#line 720 "btyacc_demo.tab.c"
case 257:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -722,7 +725,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 726 "btyacc_demo.tab.c"
+#line 729 "btyacc_demo.tab.c"
case 258:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -731,7 +734,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 735 "btyacc_demo.tab.c"
+#line 738 "btyacc_demo.tab.c"
case 40:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -740,7 +743,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 744 "btyacc_demo.tab.c"
+#line 747 "btyacc_demo.tab.c"
case 91:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -749,7 +752,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 753 "btyacc_demo.tab.c"
+#line 756 "btyacc_demo.tab.c"
case 46:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -758,7 +761,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 762 "btyacc_demo.tab.c"
+#line 765 "btyacc_demo.tab.c"
case 259:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -767,7 +770,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).id); }
break;
-#line 771 "btyacc_demo.tab.c"
+#line 774 "btyacc_demo.tab.c"
case 260:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -776,7 +779,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).expr); }
break;
-#line 780 "btyacc_demo.tab.c"
+#line 783 "btyacc_demo.tab.c"
case 261:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -785,7 +788,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 789 "btyacc_demo.tab.c"
+#line 792 "btyacc_demo.tab.c"
case 262:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -794,7 +797,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 798 "btyacc_demo.tab.c"
+#line 801 "btyacc_demo.tab.c"
case 263:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -803,7 +806,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 807 "btyacc_demo.tab.c"
+#line 810 "btyacc_demo.tab.c"
case 264:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -812,7 +815,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 816 "btyacc_demo.tab.c"
+#line 819 "btyacc_demo.tab.c"
case 265:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -821,7 +824,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 825 "btyacc_demo.tab.c"
+#line 828 "btyacc_demo.tab.c"
case 266:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -830,7 +833,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 834 "btyacc_demo.tab.c"
+#line 837 "btyacc_demo.tab.c"
case 267:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -839,7 +842,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 843 "btyacc_demo.tab.c"
+#line 846 "btyacc_demo.tab.c"
case 268:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -848,7 +851,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 852 "btyacc_demo.tab.c"
+#line 855 "btyacc_demo.tab.c"
case 269:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -857,7 +860,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 861 "btyacc_demo.tab.c"
+#line 864 "btyacc_demo.tab.c"
case 59:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -866,7 +869,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 870 "btyacc_demo.tab.c"
+#line 873 "btyacc_demo.tab.c"
case 44:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -875,7 +878,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 879 "btyacc_demo.tab.c"
+#line 882 "btyacc_demo.tab.c"
case 41:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -884,7 +887,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 888 "btyacc_demo.tab.c"
+#line 891 "btyacc_demo.tab.c"
case 93:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -893,7 +896,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 897 "btyacc_demo.tab.c"
+#line 900 "btyacc_demo.tab.c"
case 123:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -902,7 +905,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 906 "btyacc_demo.tab.c"
+#line 909 "btyacc_demo.tab.c"
case 125:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -911,7 +914,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 915 "btyacc_demo.tab.c"
+#line 918 "btyacc_demo.tab.c"
case 270:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -920,7 +923,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 924 "btyacc_demo.tab.c"
+#line 927 "btyacc_demo.tab.c"
case 271:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -929,7 +932,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 933 "btyacc_demo.tab.c"
+#line 936 "btyacc_demo.tab.c"
case 272:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -938,7 +941,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).expr); }
break;
-#line 942 "btyacc_demo.tab.c"
+#line 945 "btyacc_demo.tab.c"
case 273:
#line 67 "btyacc_demo.y"
{ /* 'msg' is a 'char *' indicating the context of destructor invocation*/
@@ -948,7 +951,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).decl->scope); free((*val).decl->type); }
break;
-#line 952 "btyacc_demo.tab.c"
+#line 955 "btyacc_demo.tab.c"
case 274:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -957,7 +960,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 961 "btyacc_demo.tab.c"
+#line 964 "btyacc_demo.tab.c"
case 275:
#line 83 "btyacc_demo.y"
{ printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
@@ -966,7 +969,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
/* in this example, we don't know what to do here */ }
break;
-#line 970 "btyacc_demo.tab.c"
+#line 973 "btyacc_demo.tab.c"
case 276:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -975,7 +978,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).code); }
break;
-#line 979 "btyacc_demo.tab.c"
+#line 982 "btyacc_demo.tab.c"
case 277:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -984,7 +987,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).code); }
break;
-#line 988 "btyacc_demo.tab.c"
+#line 991 "btyacc_demo.tab.c"
case 278:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -993,7 +996,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).code); }
break;
-#line 997 "btyacc_demo.tab.c"
+#line 1000 "btyacc_demo.tab.c"
case 279:
#line 73 "btyacc_demo.y"
{ printf("%s accessed by symbol with type <decl> (case s.b. 279 & 280) @ position[%d,%d..%d,%d]\n",
@@ -1002,7 +1005,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).decl); }
break;
-#line 1006 "btyacc_demo.tab.c"
+#line 1009 "btyacc_demo.tab.c"
case 280:
#line 73 "btyacc_demo.y"
{ printf("%s accessed by symbol with type <decl> (case s.b. 279 & 280) @ position[%d,%d..%d,%d]\n",
@@ -1011,7 +1014,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).decl); }
break;
-#line 1015 "btyacc_demo.tab.c"
+#line 1018 "btyacc_demo.tab.c"
case 281:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1020,7 +1023,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).type); }
break;
-#line 1024 "btyacc_demo.tab.c"
+#line 1027 "btyacc_demo.tab.c"
case 282:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1029,7 +1032,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).type); }
break;
-#line 1033 "btyacc_demo.tab.c"
+#line 1036 "btyacc_demo.tab.c"
case 283:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1038,7 +1041,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).type); }
break;
-#line 1042 "btyacc_demo.tab.c"
+#line 1045 "btyacc_demo.tab.c"
case 284:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1047,7 +1050,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).type); }
break;
-#line 1051 "btyacc_demo.tab.c"
+#line 1054 "btyacc_demo.tab.c"
case 285:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1056,7 +1059,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).type); }
break;
-#line 1060 "btyacc_demo.tab.c"
+#line 1063 "btyacc_demo.tab.c"
case 286:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1065,7 +1068,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).scope); }
break;
-#line 1069 "btyacc_demo.tab.c"
+#line 1072 "btyacc_demo.tab.c"
case 287:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1074,7 +1077,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).dlist); }
break;
-#line 1078 "btyacc_demo.tab.c"
+#line 1081 "btyacc_demo.tab.c"
case 288:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1083,7 +1086,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).dlist); }
break;
-#line 1087 "btyacc_demo.tab.c"
+#line 1090 "btyacc_demo.tab.c"
case 289:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1092,7 +1095,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).scope); }
break;
-#line 1096 "btyacc_demo.tab.c"
+#line 1099 "btyacc_demo.tab.c"
case 290:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1101,7 +1104,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).scope); }
break;
-#line 1105 "btyacc_demo.tab.c"
+#line 1108 "btyacc_demo.tab.c"
case 291:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1110,7 +1113,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).scope); }
break;
-#line 1114 "btyacc_demo.tab.c"
+#line 1117 "btyacc_demo.tab.c"
case 292:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1119,7 +1122,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).scope); }
break;
-#line 1123 "btyacc_demo.tab.c"
+#line 1126 "btyacc_demo.tab.c"
case 293:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1128,7 +1131,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).type); }
break;
-#line 1132 "btyacc_demo.tab.c"
+#line 1135 "btyacc_demo.tab.c"
case 294:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1137,7 +1140,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).scope); }
break;
-#line 1141 "btyacc_demo.tab.c"
+#line 1144 "btyacc_demo.tab.c"
case 295:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1146,7 +1149,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).type); }
break;
-#line 1150 "btyacc_demo.tab.c"
+#line 1153 "btyacc_demo.tab.c"
case 296:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1155,7 +1158,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).scope); }
break;
-#line 1159 "btyacc_demo.tab.c"
+#line 1162 "btyacc_demo.tab.c"
case 297:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1164,7 +1167,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).scope); }
break;
-#line 1168 "btyacc_demo.tab.c"
+#line 1171 "btyacc_demo.tab.c"
case 298:
#line 78 "btyacc_demo.y"
{ printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
@@ -1173,7 +1176,7 @@ YYDESTRUCT_DECL()
(*loc).last_line, (*loc).last_column);
free((*val).scope); }
break;
-#line 1177 "btyacc_demo.tab.c"
+#line 1180 "btyacc_demo.tab.c"
}
}
#define YYDESTRUCT_IS_DECLARED 1
@@ -2106,7 +2109,7 @@ case 59:
#line 197 "btyacc_demo.y"
{ yyval.code = yystack.l_mark[-1].code; }
break;
-#line 2110 "btyacc_demo.tab.c"
+#line 2113 "btyacc_demo.tab.c"
default:
break;
}
diff --git a/test/btyacc/btyacc_demo2.error b/test/btyacc/btyacc_demo2.error
deleted file mode 100644
index 554dd5a..0000000
--- a/test/btyacc/btyacc_demo2.error
+++ /dev/null
@@ -1 +0,0 @@
-YACC: e - line 82 of "./btyacc_demo2.y", $$ is untyped
diff --git a/test/btyacc/btyacc_demo2.output b/test/btyacc/btyacc_demo2.output
deleted file mode 100644
index e69de29..0000000
--- a/test/btyacc/btyacc_demo2.output
+++ /dev/null
diff --git a/test/btyacc/btyacc_demo2.tab.c b/test/btyacc/btyacc_demo2.tab.c
deleted file mode 100644
index 6c35f23..0000000
--- a/test/btyacc/btyacc_demo2.tab.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* original parser id follows */
-/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
-/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
-
-#define YYBYACC 1
-#define YYMAJOR 1
-#define YYMINOR 9
-#define YYCHECK "yyyymmdd"
-
-#define YYEMPTY (-1)
-#define yyclearin (yychar = YYEMPTY)
-#define yyerrok (yyerrflag = 0)
-#define YYRECOVERING() (yyerrflag != 0)
-#define YYENOMEM (-2)
-#define YYEOF 0
diff --git a/test/btyacc/btyacc_demo2.tab.h b/test/btyacc/btyacc_demo2.tab.h
deleted file mode 100644
index e69de29..0000000
--- a/test/btyacc/btyacc_demo2.tab.h
+++ /dev/null
diff --git a/test/btyacc/btyacc_destroy1.tab.c b/test/btyacc/btyacc_destroy1.tab.c
index 74c32b1..ee4aea1 100644
--- a/test/btyacc/btyacc_destroy1.tab.c
+++ b/test/btyacc/btyacc_destroy1.tab.c
@@ -357,13 +357,16 @@ static const char *const destroy1_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -485,7 +488,7 @@ static YYINT *yylexemes = 0;
extern int YYLEX_DECL();
extern void YYERROR_DECL();
-#line 489 "btyacc_destroy1.tab.c"
+#line 492 "btyacc_destroy1.tab.c"
/* Release memory associated with symbol. */
#if ! defined YYDESTRUCT_IS_DECLARED
@@ -505,7 +508,7 @@ YYDESTRUCT_DECL()
}
}
break;
-#line 509 "btyacc_destroy1.tab.c"
+#line 512 "btyacc_destroy1.tab.c"
}
}
#define YYDESTRUCT_IS_DECLARED 1
@@ -1228,7 +1231,7 @@ case 9:
#line 86 "btyacc_destroy1.y"
{ yyval.nlist = yystack.l_mark[-5].nlist; }
break;
-#line 1232 "btyacc_destroy1.tab.c"
+#line 1235 "btyacc_destroy1.tab.c"
default:
break;
}
diff --git a/test/btyacc/btyacc_destroy2.tab.c b/test/btyacc/btyacc_destroy2.tab.c
index 55705ee..f83151a 100644
--- a/test/btyacc/btyacc_destroy2.tab.c
+++ b/test/btyacc/btyacc_destroy2.tab.c
@@ -357,13 +357,16 @@ static const char *const destroy2_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -485,7 +488,7 @@ static YYINT *yylexemes = 0;
extern int YYLEX_DECL();
extern void YYERROR_DECL();
-#line 489 "btyacc_destroy2.tab.c"
+#line 492 "btyacc_destroy2.tab.c"
/* Release memory associated with symbol. */
#if ! defined YYDESTRUCT_IS_DECLARED
@@ -505,7 +508,7 @@ YYDESTRUCT_DECL()
}
}
break;
-#line 509 "btyacc_destroy2.tab.c"
+#line 512 "btyacc_destroy2.tab.c"
}
}
#define YYDESTRUCT_IS_DECLARED 1
@@ -1228,7 +1231,7 @@ case 9:
#line 86 "btyacc_destroy2.y"
{ yyval.nlist = yystack.l_mark[-5].nlist; }
break;
-#line 1232 "btyacc_destroy2.tab.c"
+#line 1235 "btyacc_destroy2.tab.c"
default:
break;
}
diff --git a/test/btyacc/btyacc_destroy3.tab.c b/test/btyacc/btyacc_destroy3.tab.c
index c6b08b8..07e3d0f 100644
--- a/test/btyacc/btyacc_destroy3.tab.c
+++ b/test/btyacc/btyacc_destroy3.tab.c
@@ -357,13 +357,16 @@ static const char *const destroy3_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -485,7 +488,7 @@ static YYINT *yylexemes = 0;
extern int YYLEX_DECL();
extern void YYERROR_DECL();
-#line 489 "btyacc_destroy3.tab.c"
+#line 492 "btyacc_destroy3.tab.c"
/* Release memory associated with symbol. */
#if ! defined YYDESTRUCT_IS_DECLARED
@@ -505,7 +508,7 @@ YYDESTRUCT_DECL()
}
}
break;
-#line 509 "btyacc_destroy3.tab.c"
+#line 512 "btyacc_destroy3.tab.c"
}
}
#define YYDESTRUCT_IS_DECLARED 1
@@ -1228,7 +1231,7 @@ case 9:
#line 89 "btyacc_destroy3.y"
{ yyval.nlist = yystack.l_mark[-5].nlist; }
break;
-#line 1232 "btyacc_destroy3.tab.c"
+#line 1235 "btyacc_destroy3.tab.c"
default:
break;
}
diff --git a/test/btyacc/calc.tab.c b/test/btyacc/calc.tab.c
index 052c7ad..356316e 100644
--- a/test/btyacc/calc.tab.c
+++ b/test/btyacc/calc.tab.c
@@ -338,13 +338,16 @@ static const char *const calc_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -504,7 +507,7 @@ yylex(void)
}
return( c );
}
-#line 508 "calc.tab.c"
+#line 511 "calc.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1234,7 +1237,7 @@ case 18:
#line 63 "calc.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1238 "calc.tab.c"
+#line 1241 "calc.tab.c"
default:
break;
}
diff --git a/test/btyacc/calc1.tab.c b/test/btyacc/calc1.tab.c
index 2773144..6c996b8 100644
--- a/test/btyacc/calc1.tab.c
+++ b/test/btyacc/calc1.tab.c
@@ -393,13 +393,16 @@ static const char *const calc1_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -648,7 +651,7 @@ vdiv(double a, double b, INTERVAL v)
{
return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
}
-#line 652 "calc1.tab.c"
+#line 655 "calc1.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1481,7 +1484,7 @@ case 28:
yyval.vval = yystack.l_mark[-1].vval;
}
break;
-#line 1485 "calc1.tab.c"
+#line 1488 "calc1.tab.c"
default:
break;
}
diff --git a/test/btyacc/calc2.tab.c b/test/btyacc/calc2.tab.c
index 4b4550d..0823c7c 100644
--- a/test/btyacc/calc2.tab.c
+++ b/test/btyacc/calc2.tab.c
@@ -340,13 +340,16 @@ static const char *const calc2_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -517,7 +520,7 @@ YYLEX_DECL()
}
return( c );
}
-#line 521 "calc2.tab.c"
+#line 524 "calc2.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1247,7 +1250,7 @@ case 18:
#line 70 "calc2.y"
{ yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1251 "calc2.tab.c"
+#line 1254 "calc2.tab.c"
default:
break;
}
diff --git a/test/btyacc/calc3.tab.c b/test/btyacc/calc3.tab.c
index 199c245..b3d9bad 100644
--- a/test/btyacc/calc3.tab.c
+++ b/test/btyacc/calc3.tab.c
@@ -345,8 +345,9 @@ static const char *const calc3_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
#ifndef YYLLOC_DEFAULT
@@ -472,7 +473,7 @@ YYLEX_DECL()
}
return( c );
}
-#line 476 "calc3.tab.c"
+#line 477 "calc3.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -609,6 +610,8 @@ YYPARSE_DECL()
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+ int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -1261,7 +1264,7 @@ case 18:
#line 73 "calc3.y"
{ yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1265 "calc3.tab.c"
+#line 1268 "calc3.tab.c"
default:
break;
}
diff --git a/test/btyacc/code_calc.code.c b/test/btyacc/code_calc.code.c
index e2e4c12..c5b1f72 100644
--- a/test/btyacc/code_calc.code.c
+++ b/test/btyacc/code_calc.code.c
@@ -207,13 +207,16 @@ extern const char *const yyname[];
extern const char *const yyrule[];
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -377,7 +380,7 @@ yylex(void)
}
return( c );
}
-#line 381 "code_calc.code.c"
+#line 384 "code_calc.code.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1107,7 +1110,7 @@ case 18:
#line 67 "code_calc.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1111 "code_calc.code.c"
+#line 1114 "code_calc.code.c"
default:
break;
}
diff --git a/test/btyacc/code_debug.c b/test/btyacc/code_debug.c
deleted file mode 100644
index bf00257..0000000
--- a/test/btyacc/code_debug.c
+++ /dev/null
@@ -1,1125 +0,0 @@
-/* original parser id follows */
-/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
-/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
-
-#define YYBYACC 1
-#define YYMAJOR 1
-#define YYMINOR 9
-#define YYCHECK "yyyymmdd"
-
-#define YYEMPTY (-1)
-#define yyclearin (yychar = YYEMPTY)
-#define yyerrok (yyerrflag = 0)
-#define YYRECOVERING() (yyerrflag != 0)
-#define YYENOMEM (-2)
-#define YYEOF 0
-#undef YYBTYACC
-#define YYBTYACC 0
-#define YYDEBUGSTR YYPREFIX "debug"
-#line 20 "code_debug.c"
-#include "rename_debug.i"
-#include "rename_debug.h"
-typedef short YYINT;
-static const YYINT yylhs[] = { -1,
- 0,
-};
-static const YYINT yylen[] = { 2,
- 1,
-};
-static const YYINT yydefred[] = { 0,
- 1, 0,
-};
-static const YYINT yystos[] = { 0,
- 256, 258,
-};
-static const YYINT yydgoto[] = { 2,
-};
-static const YYINT yysindex[] = { -256,
- 0, 0,
-};
-static const YYINT yyrindex[] = { 0,
- 0, 0,
-};
-#if YYBTYACC
-static const YYINT yycindex[] = { 0,
- 0, 0,
-};
-#endif
-static const YYINT yygindex[] = { 0,
-};
-#define YYTABLESIZE 0
-static const YYINT yytable[] = { 1,
-};
-static const YYINT yycheck[] = { 256,
-};
-#if YYBTYACC
-static const YYINT yyctable[] = { 0,
-};
-#endif
-#define YYFINAL 2
-#ifndef YYDEBUG
-#define YYDEBUG 1
-#endif
-#define YYMAXTOKEN 256
-#define YYUNDFTOKEN 259
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
-#if YYDEBUG
-static const char *const yyname[] = {
-
-"$end",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,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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error","$accept","S","illegal-symbol",
-};
-static const char *const yyrule[] = {
-"$accept : S",
-"S : error",
-
-};
-#endif
-
-int yydebug;
-int yynerrs;
-
-int yyerrflag;
-int yychar;
-YYSTYPE yyval;
-YYSTYPE yylval;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
-YYLTYPE yyloc; /* position returned by actions */
-YYLTYPE yylloc; /* position from the lexer */
-#endif
-
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
-#ifndef YYLLOC_DEFAULT
-#define YYLLOC_DEFAULT(loc, rhs, n) \
-do \
-{ \
- if (n == 0) \
- { \
- (loc).first_line = ((rhs)[-1]).last_line; \
- (loc).first_column = ((rhs)[-1]).last_column; \
- (loc).last_line = ((rhs)[-1]).last_line; \
- (loc).last_column = ((rhs)[-1]).last_column; \
- } \
- else \
- { \
- (loc).first_line = ((rhs)[ 0 ]).first_line; \
- (loc).first_column = ((rhs)[ 0 ]).first_column; \
- (loc).last_line = ((rhs)[n-1]).last_line; \
- (loc).last_column = ((rhs)[n-1]).last_column; \
- } \
-} while (0)
-#endif /* YYLLOC_DEFAULT */
-#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
-#if YYBTYACC
-
-#ifndef YYLVQUEUEGROWTH
-#define YYLVQUEUEGROWTH 32
-#endif
-#endif /* YYBTYACC */
-
-/* define the initial stack-sizes */
-#ifdef YYSTACKSIZE
-#undef YYMAXDEPTH
-#define YYMAXDEPTH YYSTACKSIZE
-#else
-#ifdef YYMAXDEPTH
-#define YYSTACKSIZE YYMAXDEPTH
-#else
-#define YYSTACKSIZE 10000
-#define YYMAXDEPTH 10000
-#endif
-#endif
-
-#ifndef YYINITSTACKSIZE
-#define YYINITSTACKSIZE 200
-#endif
-
-typedef struct {
- unsigned stacksize;
- short *s_base;
- short *s_mark;
- short *s_last;
- YYSTYPE *l_base;
- YYSTYPE *l_mark;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- YYLTYPE *p_base;
- YYLTYPE *p_mark;
-#endif
-} YYSTACKDATA;
-#if YYBTYACC
-
-struct YYParseState_s
-{
- struct YYParseState_s *save; /* Previously saved parser state */
- YYSTACKDATA yystack; /* saved parser stack */
- int state; /* saved parser state */
- int errflag; /* saved error recovery status */
- int lexeme; /* saved index of the conflict lexeme in the lexical queue */
- YYINT ctry; /* saved index in yyctable[] for this conflict */
-};
-typedef struct YYParseState_s YYParseState;
-#endif /* YYBTYACC */
-/* variables for the parser stack */
-static YYSTACKDATA yystack;
-#if YYBTYACC
-
-/* Current parser state */
-static YYParseState *yyps = 0;
-
-/* yypath != NULL: do the full parse, starting at *yypath parser state. */
-static YYParseState *yypath = 0;
-
-/* Base of the lexical value queue */
-static YYSTYPE *yylvals = 0;
-
-/* Current position at lexical value queue */
-static YYSTYPE *yylvp = 0;
-
-/* End position of lexical value queue */
-static YYSTYPE *yylve = 0;
-
-/* The last allocated position at the lexical value queue */
-static YYSTYPE *yylvlim = 0;
-
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
-/* Base of the lexical position queue */
-static YYLTYPE *yylpsns = 0;
-
-/* Current position at lexical position queue */
-static YYLTYPE *yylpp = 0;
-
-/* End position of lexical position queue */
-static YYLTYPE *yylpe = 0;
-
-/* The last allocated position at the lexical position queue */
-static YYLTYPE *yylplim = 0;
-#endif
-
-/* Current position at lexical token queue */
-static short *yylexp = 0;
-
-static short *yylexemes = 0;
-#endif /* YYBTYACC */
-#line 12 "code_debug.y"
-
-#include <stdio.h>
-
-#ifdef YYBYACC
-extern int YYLEX_DECL();
-#endif
-
-int
-main(void)
-{
- printf("yyparse() = %d\n", yyparse());
- return 0;
-}
-
-int
-yylex(void)
-{
- return -1;
-}
-
-static void
-yyerror(const char* s)
-{
- printf("%s\n", s);
-}
-#line 236 "code_debug.c"
-
-/* For use in generated program */
-#define yydepth (int)(yystack.s_mark - yystack.s_base)
-#if YYBTYACC
-#define yytrial (yyps->save)
-#endif /* YYBTYACC */
-
-#if YYDEBUG
-#include <stdio.h> /* needed for printf */
-#endif
-
-#include <stdlib.h> /* needed for malloc, etc */
-#include <string.h> /* needed for memset */
-
-/* allocate initial stack or double stack size, up to YYMAXDEPTH */
-static int yygrowstack(YYSTACKDATA *data)
-{
- int i;
- unsigned newsize;
- short *newss;
- YYSTYPE *newvs;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- YYLTYPE *newps;
-#endif
-
- if ((newsize = data->stacksize) == 0)
- newsize = YYINITSTACKSIZE;
- else if (newsize >= YYMAXDEPTH)
- return YYENOMEM;
- else if ((newsize *= 2) > YYMAXDEPTH)
- newsize = YYMAXDEPTH;
-
- i = (int) (data->s_mark - data->s_base);
- newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
- if (newss == 0)
- return YYENOMEM;
-
- data->s_base = newss;
- data->s_mark = newss + i;
-
- newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
- if (newvs == 0)
- return YYENOMEM;
-
- data->l_base = newvs;
- data->l_mark = newvs + i;
-
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
- if (newps == 0)
- return YYENOMEM;
-
- data->p_base = newps;
- data->p_mark = newps + i;
-#endif
-
- data->stacksize = newsize;
- data->s_last = data->s_base + newsize - 1;
-
-#if YYDEBUG
- if (yydebug)
- fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
-#endif
- return 0;
-}
-
-#if YYPURE || defined(YY_NO_LEAKS)
-static void yyfreestack(YYSTACKDATA *data)
-{
- free(data->s_base);
- free(data->l_base);
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- free(data->p_base);
-#endif
- memset(data, 0, sizeof(*data));
-}
-#else
-#define yyfreestack(data) /* nothing */
-#endif /* YYPURE || defined(YY_NO_LEAKS) */
-#if YYBTYACC
-
-static YYParseState *
-yyNewState(unsigned size)
-{
- YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
- if (p == NULL) return NULL;
-
- p->yystack.stacksize = size;
- if (size == 0)
- {
- p->yystack.s_base = NULL;
- p->yystack.l_base = NULL;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- p->yystack.p_base = NULL;
-#endif
- return p;
- }
- p->yystack.s_base = (short *) malloc(size * sizeof(short));
- if (p->yystack.s_base == NULL) return NULL;
- p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
- if (p->yystack.l_base == NULL) return NULL;
- memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
- if (p->yystack.p_base == NULL) return NULL;
- memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
-#endif
-
- return p;
-}
-
-static void
-yyFreeState(YYParseState *p)
-{
- yyfreestack(&p->yystack);
- free(p);
-}
-#endif /* YYBTYACC */
-
-#define YYABORT goto yyabort
-#define YYREJECT goto yyabort
-#define YYACCEPT goto yyaccept
-#define YYERROR goto yyerrlab
-#if YYBTYACC
-#define YYVALID do { if (yyps->save) goto yyvalid; } while(0)
-#define YYVALID_NESTED do { if (yyps->save && \
- yyps->save->save == 0) goto yyvalid; } while(0)
-#endif /* YYBTYACC */
-
-int
-YYPARSE_DECL()
-{
- int yym, yyn, yystate, yyresult;
-#if YYBTYACC
- int yynewerrflag;
- YYParseState *yyerrctx = NULL;
-#endif /* YYBTYACC */
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- YYLTYPE yyerror_loc_range[2]; /* position of error start & end */
-#endif
-#if YYDEBUG
- const char *yys;
-
- if ((yys = getenv("YYDEBUG")) != 0)
- {
- yyn = *yys;
- if (yyn >= '0' && yyn <= '9')
- yydebug = yyn - '0';
- }
- if (yydebug)
- fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
-#endif
-
-#if YYBTYACC
- yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
- yyps->save = 0;
-#endif /* YYBTYACC */
- yynerrs = 0;
- yyerrflag = 0;
- yychar = YYEMPTY;
- yystate = 0;
-
-#if YYPURE
- memset(&yystack, 0, sizeof(yystack));
-#endif
-
- if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
- yystack.s_mark = yystack.s_base;
- yystack.l_mark = yystack.l_base;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yystack.p_mark = yystack.p_base;
-#endif
- yystate = 0;
- *yystack.s_mark = 0;
-
-yyloop:
- if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
- if (yychar < 0)
- {
-#if YYBTYACC
- do {
- if (yylvp < yylve)
- {
- /* we're currently re-reading tokens */
- yylval = *yylvp++;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yylloc = *yylpp++;
-#endif
- yychar = *yylexp++;
- break;
- }
- if (yyps->save)
- {
- /* in trial mode; save scanner results for future parse attempts */
- if (yylvp == yylvlim)
- { /* Enlarge lexical value queue */
- int p = yylvp - yylvals;
- int s = yylvlim - yylvals;
-
- s += YYLVQUEUEGROWTH;
- if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem;
- if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
-#endif
- yylvp = yylve = yylvals + p;
- yylvlim = yylvals + s;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yylpp = yylpe = yylpsns + p;
- yylplim = yylpsns + s;
-#endif
- yylexp = yylexemes + p;
- }
- *yylexp = (short) YYLEX;
- *yylvp++ = yylval;
- yylve++;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- *yylpp++ = yylloc;
- yylpe++;
-#endif
- yychar = *yylexp++;
- break;
- }
- /* normal operation, no conflict encountered */
-#endif /* YYBTYACC */
- yychar = YYLEX;
-#if YYBTYACC
- } while (0);
-#endif /* YYBTYACC */
- if (yychar < 0) yychar = YYEOF;
- /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
-#if YYDEBUG
- if (yydebug)
- {
- yys = yyname[YYTRANSLATE(yychar)];
- fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
- YYDEBUGSTR, yydepth, yystate, yychar, yys);
-#ifdef YYSTYPE_TOSTRING
-#if YYBTYACC
- if (!yytrial)
-#endif /* YYBTYACC */
- fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
-#endif
- fputc('\n', stderr);
- }
-#endif
- }
-#if YYBTYACC
-
- /* Do we have a conflict? */
- if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
- yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
- {
- YYINT ctry;
-
- if (yypath)
- {
- YYParseState *save;
-#if YYDEBUG
- if (yydebug)
- fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
- YYDEBUGSTR, yydepth, yystate);
-#endif
- /* Switch to the next conflict context */
- save = yypath;
- yypath = save->save;
- save->save = NULL;
- ctry = save->ctry;
- if (save->state != yystate) YYABORT;
- yyFreeState(save);
-
- }
- else
- {
-
- /* Unresolved conflict - start/continue trial parse */
- YYParseState *save;
-#if YYDEBUG
- if (yydebug)
- {
- fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
- if (yyps->save)
- fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
- else
- fputs("Starting trial parse.\n", stderr);
- }
-#endif
- save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
- if (save == NULL) goto yyenomem;
- save->save = yyps->save;
- save->state = yystate;
- save->errflag = yyerrflag;
- save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
- memcpy (save->yystack.s_base, yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
- save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
- memcpy (save->yystack.l_base, yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
- memcpy (save->yystack.p_base, yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
-#endif
- ctry = yytable[yyn];
- if (yyctable[ctry] == -1)
- {
-#if YYDEBUG
- if (yydebug && yychar >= YYEOF)
- fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
-#endif
- ctry++;
- }
- save->ctry = ctry;
- if (yyps->save == NULL)
- {
- /* If this is a first conflict in the stack, start saving lexemes */
- if (!yylexemes)
- {
- yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short));
- if (yylexemes == NULL) goto yyenomem;
- yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
- if (yylvals == NULL) goto yyenomem;
- yylvlim = yylvals + YYLVQUEUEGROWTH;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
- if (yylpsns == NULL) goto yyenomem;
- yylplim = yylpsns + YYLVQUEUEGROWTH;
-#endif
- }
- if (yylvp == yylve)
- {
- yylvp = yylve = yylvals;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yylpp = yylpe = yylpsns;
-#endif
- yylexp = yylexemes;
- if (yychar >= YYEOF)
- {
- *yylve++ = yylval;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- *yylpe++ = yylloc;
-#endif
- *yylexp = (short) yychar;
- yychar = YYEMPTY;
- }
- }
- }
- if (yychar >= YYEOF)
- {
- yylvp--;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yylpp--;
-#endif
- yylexp--;
- yychar = YYEMPTY;
- }
- save->lexeme = yylvp - yylvals;
- yyps->save = save;
- }
- if (yytable[yyn] == ctry)
- {
-#if YYDEBUG
- if (yydebug)
- fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
- YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
-#endif
- if (yychar < 0)
- {
- yylvp++;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yylpp++;
-#endif
- yylexp++;
- }
- if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
- goto yyoverflow;
- yystate = yyctable[ctry];
- *++yystack.s_mark = (short) yystate;
- *++yystack.l_mark = yylval;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- *++yystack.p_mark = yylloc;
-#endif
- yychar = YYEMPTY;
- if (yyerrflag > 0) --yyerrflag;
- goto yyloop;
- }
- else
- {
- yyn = yyctable[ctry];
- goto yyreduce;
- }
- } /* End of code dealing with conflicts */
-#endif /* YYBTYACC */
- if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
- yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
- {
-#if YYDEBUG
- if (yydebug)
- fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
- YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
-#endif
- if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
- yystate = yytable[yyn];
- *++yystack.s_mark = yytable[yyn];
- *++yystack.l_mark = yylval;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- *++yystack.p_mark = yylloc;
-#endif
- yychar = YYEMPTY;
- if (yyerrflag > 0) --yyerrflag;
- goto yyloop;
- }
- if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
- yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
- {
- yyn = yytable[yyn];
- goto yyreduce;
- }
- if (yyerrflag != 0) goto yyinrecovery;
-#if YYBTYACC
-
- yynewerrflag = 1;
- goto yyerrhandler;
- goto yyerrlab;
-
-yyerrlab:
- yynewerrflag = 0;
-yyerrhandler:
- while (yyps->save)
- {
- int ctry;
- YYParseState *save = yyps->save;
-#if YYDEBUG
- if (yydebug)
- fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
- YYDEBUGSTR, yydepth, yystate, yyps->save->state,
- (int)(yylvp - yylvals - yyps->save->lexeme));
-#endif
- /* Memorize most forward-looking error state in case it's really an error. */
- if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
- {
- /* Free old saved error context state */
- if (yyerrctx) yyFreeState(yyerrctx);
- /* Create and fill out new saved error context state */
- yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
- if (yyerrctx == NULL) goto yyenomem;
- yyerrctx->save = yyps->save;
- yyerrctx->state = yystate;
- yyerrctx->errflag = yyerrflag;
- yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
- memcpy (yyerrctx->yystack.s_base, yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
- yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
- memcpy (yyerrctx->yystack.l_base, yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
- memcpy (yyerrctx->yystack.p_base, yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
-#endif
- yyerrctx->lexeme = yylvp - yylvals;
- }
- yylvp = yylvals + save->lexeme;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yylpp = yylpsns + save->lexeme;
-#endif
- yylexp = yylexemes + save->lexeme;
- yychar = YYEMPTY;
- yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
- memcpy (yystack.s_base, save->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
- yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
- memcpy (yystack.l_base, save->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
- memcpy (yystack.p_base, save->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
-#endif
- ctry = ++save->ctry;
- yystate = save->state;
- /* We tried shift, try reduce now */
- if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
- yyps->save = save->save;
- save->save = NULL;
- yyFreeState(save);
-
- /* Nothing left on the stack -- error */
- if (!yyps->save)
- {
-#if YYDEBUG
- if (yydebug)
- fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
- YYPREFIX, yydepth);
-#endif
- /* Restore state as it was in the most forward-advanced error */
- yylvp = yylvals + yyerrctx->lexeme;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yylpp = yylpsns + yyerrctx->lexeme;
-#endif
- yylexp = yylexemes + yyerrctx->lexeme;
- yychar = yylexp[-1];
- yylval = yylvp[-1];
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yylloc = yylpp[-1];
-#endif
- yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
- memcpy (yystack.s_base, yyerrctx->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
- yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
- memcpy (yystack.l_base, yyerrctx->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
- memcpy (yystack.p_base, yyerrctx->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
-#endif
- yystate = yyerrctx->state;
- yyFreeState(yyerrctx);
- yyerrctx = NULL;
- }
- yynewerrflag = 1;
- }
- if (yynewerrflag == 0) goto yyinrecovery;
-#endif /* YYBTYACC */
-
- YYERROR_CALL("syntax error");
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
-#endif
-
-#if !YYBTYACC
- goto yyerrlab;
-yyerrlab:
-#endif
- ++yynerrs;
-
-yyinrecovery:
- if (yyerrflag < 3)
- {
- yyerrflag = 3;
- for (;;)
- {
- if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
- yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
- {
-#if YYDEBUG
- if (yydebug)
- fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
- YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
-#endif
- if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
- yystate = yytable[yyn];
- *++yystack.s_mark = yytable[yyn];
- *++yystack.l_mark = yylval;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- /* lookahead position is error end position */
- yyerror_loc_range[1] = yylloc;
- YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
- *++yystack.p_mark = yyloc;
-#endif
- goto yyloop;
- }
- else
- {
-#if YYDEBUG
- if (yydebug)
- fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
- YYDEBUGSTR, yydepth, *yystack.s_mark);
-#endif
- if (yystack.s_mark <= yystack.s_base) goto yyabort;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- /* the current TOS position is the error start position */
- yyerror_loc_range[0] = *yystack.p_mark;
-#endif
-#if defined(YYDESTRUCT_CALL)
-#if YYBTYACC
- if (!yytrial)
-#endif /* YYBTYACC */
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- YYDESTRUCT_CALL("error: discarding state",
- yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
-#else
- YYDESTRUCT_CALL("error: discarding state",
- yystos[*yystack.s_mark], yystack.l_mark);
-#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
-#endif /* defined(YYDESTRUCT_CALL) */
- --yystack.s_mark;
- --yystack.l_mark;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- --yystack.p_mark;
-#endif
- }
- }
- }
- else
- {
- if (yychar == YYEOF) goto yyabort;
-#if YYDEBUG
- if (yydebug)
- {
- yys = yyname[YYTRANSLATE(yychar)];
- fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
- YYDEBUGSTR, yydepth, yystate, yychar, yys);
- }
-#endif
-#if defined(YYDESTRUCT_CALL)
-#if YYBTYACC
- if (!yytrial)
-#endif /* YYBTYACC */
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
-#else
- YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
-#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
-#endif /* defined(YYDESTRUCT_CALL) */
- yychar = YYEMPTY;
- goto yyloop;
- }
-
-yyreduce:
- yym = yylen[yyn];
-#if YYDEBUG
- if (yydebug)
- {
- fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
- YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
-#ifdef YYSTYPE_TOSTRING
-#if YYBTYACC
- if (!yytrial)
-#endif /* YYBTYACC */
- if (yym > 0)
- {
- int i;
- fputc('<', stderr);
- for (i = yym; i > 0; i--)
- {
- if (i != yym) fputs(", ", stderr);
- fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
- yystack.l_mark[1-i]), stderr);
- }
- fputc('>', stderr);
- }
-#endif
- fputc('\n', stderr);
- }
-#endif
- if (yym > 0)
- yyval = yystack.l_mark[1-yym];
- else
- memset(&yyval, 0, sizeof yyval);
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
-
- /* Perform position reduction */
- memset(&yyloc, 0, sizeof(yyloc));
-#if YYBTYACC
- if (!yytrial)
-#endif /* YYBTYACC */
- {
- YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
- /* just in case YYERROR is invoked within the action, save
- the start of the rhs as the error start position */
- yyerror_loc_range[0] = yystack.p_mark[1-yym];
- }
-#endif
-
- switch (yyn)
- {
- default:
- break;
- }
- yystack.s_mark -= yym;
- yystate = *yystack.s_mark;
- yystack.l_mark -= yym;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yystack.p_mark -= yym;
-#endif
- yym = yylhs[yyn];
- if (yystate == 0 && yym == 0)
- {
-#if YYDEBUG
- if (yydebug)
- {
- fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
-#ifdef YYSTYPE_TOSTRING
-#if YYBTYACC
- if (!yytrial)
-#endif /* YYBTYACC */
- fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
-#endif
- fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
- }
-#endif
- yystate = YYFINAL;
- *++yystack.s_mark = YYFINAL;
- *++yystack.l_mark = yyval;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- *++yystack.p_mark = yyloc;
-#endif
- if (yychar < 0)
- {
-#if YYBTYACC
- do {
- if (yylvp < yylve)
- {
- /* we're currently re-reading tokens */
- yylval = *yylvp++;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yylloc = *yylpp++;
-#endif
- yychar = *yylexp++;
- break;
- }
- if (yyps->save)
- {
- /* in trial mode; save scanner results for future parse attempts */
- if (yylvp == yylvlim)
- { /* Enlarge lexical value queue */
- int p = yylvp - yylvals;
- int s = yylvlim - yylvals;
-
- s += YYLVQUEUEGROWTH;
- if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL)
- goto yyenomem;
- if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
- goto yyenomem;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
- goto yyenomem;
-#endif
- yylvp = yylve = yylvals + p;
- yylvlim = yylvals + s;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yylpp = yylpe = yylpsns + p;
- yylplim = yylpsns + s;
-#endif
- yylexp = yylexemes + p;
- }
- *yylexp = (short) YYLEX;
- *yylvp++ = yylval;
- yylve++;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- *yylpp++ = yylloc;
- yylpe++;
-#endif
- yychar = *yylexp++;
- break;
- }
- /* normal operation, no conflict encountered */
-#endif /* YYBTYACC */
- yychar = YYLEX;
-#if YYBTYACC
- } while (0);
-#endif /* YYBTYACC */
- if (yychar < 0) yychar = YYEOF;
- /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
-#if YYDEBUG
- if (yydebug)
- {
- yys = yyname[YYTRANSLATE(yychar)];
- fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
- YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
- }
-#endif
- }
- if (yychar == YYEOF) goto yyaccept;
- goto yyloop;
- }
- if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
- yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
- yystate = yytable[yyn];
- else
- yystate = yydgoto[yym];
-#if YYDEBUG
- if (yydebug)
- {
- fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
-#ifdef YYSTYPE_TOSTRING
-#if YYBTYACC
- if (!yytrial)
-#endif /* YYBTYACC */
- fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
-#endif
- fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
- }
-#endif
- if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
- *++yystack.s_mark = (short) yystate;
- *++yystack.l_mark = yyval;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- *++yystack.p_mark = yyloc;
-#endif
- goto yyloop;
-#if YYBTYACC
-
- /* Reduction declares that this path is valid. Set yypath and do a full parse */
-yyvalid:
- if (yypath) YYABORT;
- while (yyps->save)
- {
- YYParseState *save = yyps->save;
- yyps->save = save->save;
- save->save = yypath;
- yypath = save;
- }
-#if YYDEBUG
- if (yydebug)
- fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
- YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
-#endif
- if (yyerrctx)
- {
- yyFreeState(yyerrctx);
- yyerrctx = NULL;
- }
- yylvp = yylvals + yypath->lexeme;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yylpp = yylpsns + yypath->lexeme;
-#endif
- yylexp = yylexemes + yypath->lexeme;
- yychar = YYEMPTY;
- yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
- memcpy (yystack.s_base, yypath->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
- yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
- memcpy (yystack.l_base, yypath->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
- memcpy (yystack.p_base, yypath->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
-#endif
- yystate = yypath->state;
- goto yyloop;
-#endif /* YYBTYACC */
-
-yyoverflow:
- YYERROR_CALL("yacc stack overflow");
-#if YYBTYACC
- goto yyabort_nomem;
-yyenomem:
- YYERROR_CALL("memory exhausted");
-yyabort_nomem:
-#endif /* YYBTYACC */
- yyresult = 2;
- goto yyreturn;
-
-yyabort:
- yyresult = 1;
- goto yyreturn;
-
-yyaccept:
-#if YYBTYACC
- if (yyps->save) goto yyvalid;
-#endif /* YYBTYACC */
- yyresult = 0;
-
-yyreturn:
-#if defined(YYDESTRUCT_CALL)
- if (yychar != YYEOF && yychar != YYEMPTY)
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
-#else
- YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
-#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
-
- {
- YYSTYPE *pv;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- YYLTYPE *pp;
-
- for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
- YYDESTRUCT_CALL("cleanup: discarding state",
- yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
-#else
- for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
- YYDESTRUCT_CALL("cleanup: discarding state",
- yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
-#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
- }
-#endif /* defined(YYDESTRUCT_CALL) */
-
-#if YYBTYACC
- if (yyerrctx)
- {
- yyFreeState(yyerrctx);
- yyerrctx = NULL;
- }
- while (yyps)
- {
- YYParseState *save = yyps;
- yyps = save->save;
- save->save = NULL;
- yyFreeState(save);
- }
- while (yypath)
- {
- YYParseState *save = yypath;
- yypath = save->save;
- save->save = NULL;
- yyFreeState(save);
- }
-#endif /* YYBTYACC */
- yyfreestack(&yystack);
- return (yyresult);
-}
diff --git a/test/btyacc/code_debug.error b/test/btyacc/code_debug.error
deleted file mode 100644
index e69de29..0000000
--- a/test/btyacc/code_debug.error
+++ /dev/null
diff --git a/test/btyacc/code_debug.h b/test/btyacc/code_debug.h
deleted file mode 100644
index ba44e7d..0000000
--- a/test/btyacc/code_debug.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _yy_defines_h_
-#define _yy_defines_h_
-
-#define YYERRCODE 256
-
-#endif /* _yy_defines_h_ */
diff --git a/test/btyacc/code_debug.i b/test/btyacc/code_debug.i
deleted file mode 100644
index b8f2144..0000000
--- a/test/btyacc/code_debug.i
+++ /dev/null
@@ -1,60 +0,0 @@
-#define YYPREFIX "yy"
-
-#define YYPURE 0
-
-#line 2 "code_debug.y"
-
-#ifdef YYBISON
-int yylex(void);
-static void yyerror(const char *);
-#endif
-
-
-#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
-/* Default: YYSTYPE is the semantic value type. */
-typedef int YYSTYPE;
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-/* compatibility with bison */
-#ifdef YYPARSE_PARAM
-/* compatibility with FreeBSD */
-# ifdef YYPARSE_PARAM_TYPE
-# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
-# else
-# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
-# endif
-#else
-# define YYPARSE_DECL() yyparse(void)
-#endif
-
-/* Parameters sent to lex. */
-#ifdef YYLEX_PARAM
-# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
-# define YYLEX yylex(YYLEX_PARAM)
-#else
-# define YYLEX_DECL() yylex(void)
-# define YYLEX yylex()
-#endif
-
-/* Parameters sent to yyerror. */
-#ifndef YYERROR_DECL
-#define YYERROR_DECL() yyerror(const char *s)
-#endif
-#ifndef YYERROR_CALL
-#define YYERROR_CALL(msg) yyerror(msg)
-#endif
-
-extern int YYPARSE_DECL();
-
-extern int yydebug;
-extern int yynerrs;
-
-extern int yyerrflag;
-extern int yychar;
-extern YYSTYPE yyval;
-extern YYSTYPE yylval;
-#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
-extern YYLTYPE yyloc; /* position returned by actions */
-extern YYLTYPE yylloc; /* position from the lexer */
-#endif
diff --git a/test/btyacc/code_debug.output b/test/btyacc/code_debug.output
deleted file mode 100644
index 1e56c21..0000000
--- a/test/btyacc/code_debug.output
+++ /dev/null
@@ -1,34 +0,0 @@
- 0 $accept : S $end
-
- 1 S : error
-
-state 0
- $accept : . S $end (0)
-
- error shift 1
- . error
-
- S goto 2
-
-
-state 1
- S : error . (1)
-
- . reduce 1
-
-
-state 2
- $accept : S . $end (0)
-
- $end accept
-
-
-2 terminals, 2 nonterminals
-2 grammar rules, 3 states
-
-grammar parser grammar
-symbol# value# symbol
- 0 0 $end
- 1 256 error
- 2 257 $accept
- 3 258 S
diff --git a/test/btyacc/code_error.code.c b/test/btyacc/code_error.code.c
index 6169071..32c81e6 100644
--- a/test/btyacc/code_error.code.c
+++ b/test/btyacc/code_error.code.c
@@ -197,13 +197,16 @@ extern const char *const yyname[];
extern const char *const yyrule[];
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -347,7 +350,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 351 "code_error.code.c"
+#line 354 "code_error.code.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
diff --git a/test/btyacc/empty.tab.c b/test/btyacc/empty.tab.c
index 11c252d..5b5df13 100644
--- a/test/btyacc/empty.tab.c
+++ b/test/btyacc/empty.tab.c
@@ -229,13 +229,16 @@ static const char *const empty_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -366,7 +369,7 @@ static void
YYERROR_DECL() {
printf("%s\n",s);
}
-#line 370 "empty.tab.c"
+#line 373 "empty.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
diff --git a/test/btyacc/err_inherit3.tab.c b/test/btyacc/err_inherit3.tab.c
index 9ccaa5b..5e9dd49 100644
--- a/test/btyacc/err_inherit3.tab.c
+++ b/test/btyacc/err_inherit3.tab.c
@@ -290,13 +290,16 @@ static const char *const err_inherit3_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -418,7 +421,7 @@ static YYINT *yylexemes = 0;
extern int YYLEX_DECL();
extern void YYERROR_DECL();
-#line 422 "err_inherit3.tab.c"
+#line 425 "err_inherit3.tab.c"
/* Release memory associated with symbol. */
#if ! defined YYDESTRUCT_IS_DECLARED
@@ -438,7 +441,7 @@ YYDESTRUCT_DECL()
}
}
break;
-#line 442 "err_inherit3.tab.c"
+#line 445 "err_inherit3.tab.c"
case 264:
#line 30 "err_inherit3.y"
{
@@ -450,7 +453,7 @@ YYDESTRUCT_DECL()
}
}
break;
-#line 454 "err_inherit3.tab.c"
+#line 457 "err_inherit3.tab.c"
case 265:
#line 30 "err_inherit3.y"
{
@@ -462,7 +465,7 @@ YYDESTRUCT_DECL()
}
}
break;
-#line 466 "err_inherit3.tab.c"
+#line 469 "err_inherit3.tab.c"
}
}
#define YYDESTRUCT_IS_DECLARED 1
@@ -1192,7 +1195,7 @@ case 13:
#line 75 "err_inherit3.y"
{ yyval.nlist = yystack.l_mark[0].nlist; }
break;
-#line 1196 "err_inherit3.tab.c"
+#line 1199 "err_inherit3.tab.c"
default:
break;
}
diff --git a/test/btyacc/err_inherit4.tab.c b/test/btyacc/err_inherit4.tab.c
index 6c553b8..fa5692f 100644
--- a/test/btyacc/err_inherit4.tab.c
+++ b/test/btyacc/err_inherit4.tab.c
@@ -309,13 +309,16 @@ static const char *const err_inherit4_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -437,7 +440,7 @@ static YYINT *yylexemes = 0;
extern int YYLEX_DECL();
extern void YYERROR_DECL();
-#line 441 "err_inherit4.tab.c"
+#line 444 "err_inherit4.tab.c"
/* Release memory associated with symbol. */
#if ! defined YYDESTRUCT_IS_DECLARED
@@ -450,17 +453,17 @@ YYDESTRUCT_DECL()
#line 28 "err_inherit4.y"
{ }
break;
-#line 454 "err_inherit4.tab.c"
+#line 457 "err_inherit4.tab.c"
case 264:
#line 28 "err_inherit4.y"
{ }
break;
-#line 459 "err_inherit4.tab.c"
+#line 462 "err_inherit4.tab.c"
case 265:
#line 28 "err_inherit4.y"
{ }
break;
-#line 464 "err_inherit4.tab.c"
+#line 467 "err_inherit4.tab.c"
}
}
#define YYDESTRUCT_IS_DECLARED 1
@@ -1182,7 +1185,7 @@ case 11:
#line 77 "err_inherit4.y"
{ yyval.nlist = yystack.l_mark[0].nlist; yyloc = yystack.p_mark[1]; }
break;
-#line 1186 "err_inherit4.tab.c"
+#line 1189 "err_inherit4.tab.c"
default:
break;
}
diff --git a/test/btyacc/err_syntax10.tab.c b/test/btyacc/err_syntax10.tab.c
index ef93d6d..15c770d 100644
--- a/test/btyacc/err_syntax10.tab.c
+++ b/test/btyacc/err_syntax10.tab.c
@@ -219,13 +219,16 @@ static const char *const err_syntax10_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -365,7 +368,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 369 "err_syntax10.tab.c"
+#line 372 "err_syntax10.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
diff --git a/test/btyacc/err_syntax11.tab.c b/test/btyacc/err_syntax11.tab.c
index a6a618b..23c6e49 100644
--- a/test/btyacc/err_syntax11.tab.c
+++ b/test/btyacc/err_syntax11.tab.c
@@ -225,13 +225,16 @@ static const char *const err_syntax11_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -371,7 +374,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 375 "err_syntax11.tab.c"
+#line 378 "err_syntax11.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
diff --git a/test/btyacc/err_syntax12.tab.c b/test/btyacc/err_syntax12.tab.c
index 5cef02b..c7f92ba 100644
--- a/test/btyacc/err_syntax12.tab.c
+++ b/test/btyacc/err_syntax12.tab.c
@@ -231,13 +231,16 @@ static const char *const err_syntax12_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -377,7 +380,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 381 "err_syntax12.tab.c"
+#line 384 "err_syntax12.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
diff --git a/test/btyacc/err_syntax18.tab.c b/test/btyacc/err_syntax18.tab.c
index 8c81319..671ebf7 100644
--- a/test/btyacc/err_syntax18.tab.c
+++ b/test/btyacc/err_syntax18.tab.c
@@ -228,13 +228,16 @@ static const char *const err_syntax18_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -374,7 +377,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 378 "err_syntax18.tab.c"
+#line 381 "err_syntax18.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1048,7 +1051,7 @@ case 1:
#line 9 "err_syntax18.y"
{ yyval = yystack.l_mark[1]; }
break;
-#line 1052 "err_syntax18.tab.c"
+#line 1055 "err_syntax18.tab.c"
default:
break;
}
diff --git a/test/btyacc/err_syntax20.tab.c b/test/btyacc/err_syntax20.tab.c
index f9ccc2a..83b3ec5 100644
--- a/test/btyacc/err_syntax20.tab.c
+++ b/test/btyacc/err_syntax20.tab.c
@@ -223,13 +223,16 @@ static const char *const err_syntax20_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -369,7 +372,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 373 "err_syntax20.tab.c"
+#line 376 "err_syntax20.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1043,7 +1046,7 @@ case 1:
#line 12 "err_syntax20.y"
{ yystack.l_mark[-1].rechk = 3; }
break;
-#line 1047 "err_syntax20.tab.c"
+#line 1050 "err_syntax20.tab.c"
default:
break;
}
diff --git a/test/btyacc/error.tab.c b/test/btyacc/error.tab.c
index 051f78e..dc6bec3 100644
--- a/test/btyacc/error.tab.c
+++ b/test/btyacc/error.tab.c
@@ -224,13 +224,16 @@ static const char *const error_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -370,7 +373,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 374 "error.tab.c"
+#line 377 "error.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
diff --git a/test/btyacc/expr.oxout.tab.c b/test/btyacc/expr.oxout.tab.c
index 6485717..f0b5997 100644
--- a/test/btyacc/expr.oxout.tab.c
+++ b/test/btyacc/expr.oxout.tab.c
@@ -345,13 +345,16 @@ static const char *const expr.oxout_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -1790,7 +1793,7 @@ void yyyUnsolvedInstSearchTrav(yyyGNT *pNode)
-#line 1794 "expr.oxout.tab.c"
+#line 1797 "expr.oxout.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -2518,7 +2521,7 @@ case 10:
yyyGenIntNode(8,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
yyyAdjustINRC(8,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
break;
-#line 2522 "expr.oxout.tab.c"
+#line 2525 "expr.oxout.tab.c"
default:
break;
}
diff --git a/test/btyacc/grammar.tab.c b/test/btyacc/grammar.tab.c
index d28354d..852e153 100644
--- a/test/btyacc/grammar.tab.c
+++ b/test/btyacc/grammar.tab.c
@@ -144,6 +144,7 @@ static void yyerror(const char *s);
/* #include "cproto.h" */
#define MAX_TEXT_SIZE 1024
+#define TEXT_LEN (MAX_TEXT_SIZE / 2 - 3)
/* Prototype styles */
#if OPT_LINTLIBRARY
@@ -404,7 +405,7 @@ haveAnsiParam (void)
}
return FALSE;
}
-#line 408 "grammar.tab.c"
+#line 409 "grammar.tab.c"
/* compatibility with bison */
#ifdef YYPARSE_PARAM
@@ -1048,13 +1049,16 @@ static const char *const grammar_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -1172,7 +1176,7 @@ static YYINT *yylexp = 0;
static YYINT *yylexemes = 0;
#endif /* YYBTYACC */
-#line 1014 "grammar.y"
+#line 1015 "grammar.y"
/* lex.yy.c */
#define BEGIN yy_start = 1 + 2 *
@@ -1343,7 +1347,7 @@ free_parser(void)
#endif
}
#endif
-#line 1347 "grammar.tab.c"
+#line 1351 "grammar.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -2014,19 +2018,19 @@ yyreduce:
switch (yyn)
{
case 10:
-#line 377 "grammar.y"
+#line 378 "grammar.y"
{
yyerrok;
}
break;
case 11:
-#line 381 "grammar.y"
+#line 382 "grammar.y"
{
yyerrok;
}
break;
case 13:
-#line 392 "grammar.y"
+#line 393 "grammar.y"
{
/* Provide an empty action here so bison will not complain about
* incompatible types in the default action it normally would
@@ -2035,13 +2039,13 @@ case 13:
}
break;
case 14:
-#line 399 "grammar.y"
+#line 400 "grammar.y"
{
/* empty */
}
break;
case 15:
-#line 406 "grammar.y"
+#line 407 "grammar.y"
{
#if OPT_LINTLIBRARY
if (types_out && want_typedef()) {
@@ -2054,7 +2058,7 @@ case 15:
}
break;
case 16:
-#line 417 "grammar.y"
+#line 418 "grammar.y"
{
if (func_params != NULL) {
set_param_types(func_params, &yystack.l_mark[-2].decl_spec, &yystack.l_mark[-1].decl_list);
@@ -2070,32 +2074,32 @@ case 16:
}
break;
case 17:
-#line 431 "grammar.y"
+#line 432 "grammar.y"
{
cur_decl_spec_flags = yystack.l_mark[0].decl_spec.flags;
free_decl_spec(&yystack.l_mark[0].decl_spec);
}
break;
case 18:
-#line 436 "grammar.y"
+#line 437 "grammar.y"
{
end_typedef();
}
break;
case 19:
-#line 443 "grammar.y"
+#line 444 "grammar.y"
{
begin_typedef();
}
break;
case 20:
-#line 447 "grammar.y"
+#line 448 "grammar.y"
{
begin_typedef();
}
break;
case 23:
-#line 459 "grammar.y"
+#line 460 "grammar.y"
{
int flags = cur_decl_spec_flags;
@@ -2109,7 +2113,7 @@ case 23:
}
break;
case 24:
-#line 471 "grammar.y"
+#line 472 "grammar.y"
{
int flags = cur_decl_spec_flags;
@@ -2120,7 +2124,7 @@ case 24:
}
break;
case 25:
-#line 483 "grammar.y"
+#line 484 "grammar.y"
{
check_untagged(&yystack.l_mark[-1].decl_spec);
if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) {
@@ -2133,7 +2137,7 @@ case 25:
}
break;
case 26:
-#line 494 "grammar.y"
+#line 495 "grammar.y"
{
/* If we're converting to K&R and we've got a nominally K&R
* function which has a parameter which is ANSI (i.e., a prototyped
@@ -2159,7 +2163,7 @@ case 26:
}
break;
case 28:
-#line 519 "grammar.y"
+#line 520 "grammar.y"
{
if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) {
yyerror("syntax error");
@@ -2171,7 +2175,7 @@ case 28:
}
break;
case 29:
-#line 529 "grammar.y"
+#line 530 "grammar.y"
{
DeclSpec decl_spec;
@@ -2189,7 +2193,7 @@ case 29:
}
break;
case 36:
-#line 560 "grammar.y"
+#line 561 "grammar.y"
{
join_decl_specs(&yyval.decl_spec, &yystack.l_mark[-1].decl_spec, &yystack.l_mark[0].decl_spec);
free(yystack.l_mark[-1].decl_spec.text);
@@ -2197,115 +2201,115 @@ case 36:
}
break;
case 40:
-#line 575 "grammar.y"
+#line 576 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 41:
-#line 579 "grammar.y"
+#line 580 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_EXTERN);
}
break;
case 42:
-#line 583 "grammar.y"
+#line 584 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 43:
-#line 587 "grammar.y"
+#line 588 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_STATIC);
}
break;
case 44:
-#line 591 "grammar.y"
+#line 592 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_INLINE);
}
break;
case 45:
-#line 595 "grammar.y"
+#line 596 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_JUNK);
}
break;
case 46:
-#line 602 "grammar.y"
+#line 603 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR);
}
break;
case 47:
-#line 606 "grammar.y"
+#line 607 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 48:
-#line 610 "grammar.y"
+#line 611 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_FLOAT);
}
break;
case 49:
-#line 614 "grammar.y"
+#line 615 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 50:
-#line 618 "grammar.y"
+#line 619 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 51:
-#line 622 "grammar.y"
+#line 623 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_SHORT);
}
break;
case 52:
-#line 626 "grammar.y"
+#line 627 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 53:
-#line 630 "grammar.y"
+#line 631 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 54:
-#line 634 "grammar.y"
+#line 635 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 55:
-#line 638 "grammar.y"
+#line 639 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR);
}
break;
case 56:
-#line 642 "grammar.y"
+#line 643 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 57:
-#line 646 "grammar.y"
+#line 647 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 58:
-#line 650 "grammar.y"
+#line 651 "grammar.y"
{
Symbol *s;
s = find_symbol(typedef_names, yystack.l_mark[0].text.text);
@@ -2314,13 +2318,13 @@ case 58:
}
break;
case 61:
-#line 662 "grammar.y"
+#line 663 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 62:
-#line 666 "grammar.y"
+#line 667 "grammar.y"
{
/* This rule allows the <pointer> nonterminal to scan #define
* names as if they were type modifiers.
@@ -2332,56 +2336,56 @@ case 62:
}
break;
case 63:
-#line 679 "grammar.y"
+#line 680 "grammar.y"
{
char *s;
if ((s = implied_typedef()) == 0)
- (void)sprintf(s = buf, "%s %s", yystack.l_mark[-2].text.text, yystack.l_mark[-1].text.text);
+ (void)sprintf(s = buf, "%.*s %.*s", TEXT_LEN, yystack.l_mark[-2].text.text, TEXT_LEN, yystack.l_mark[-1].text.text);
new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE);
}
break;
case 64:
-#line 686 "grammar.y"
+#line 687 "grammar.y"
{
char *s;
if ((s = implied_typedef()) == 0)
- (void)sprintf(s = buf, "%s {}", yystack.l_mark[-1].text.text);
+ (void)sprintf(s = buf, "%.*s {}", TEXT_LEN, yystack.l_mark[-1].text.text);
new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE);
}
break;
case 65:
-#line 693 "grammar.y"
+#line 694 "grammar.y"
{
- (void)sprintf(buf, "%s %s", yystack.l_mark[-1].text.text, yystack.l_mark[0].text.text);
+ (void)sprintf(buf, "%.*s %.*s", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yystack.l_mark[0].text.text);
new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE);
}
break;
case 66:
-#line 701 "grammar.y"
+#line 702 "grammar.y"
{
imply_typedef(yyval.text.text);
}
break;
case 67:
-#line 705 "grammar.y"
+#line 706 "grammar.y"
{
imply_typedef(yyval.text.text);
}
break;
case 68:
-#line 712 "grammar.y"
+#line 713 "grammar.y"
{
new_decl_list(&yyval.decl_list, yystack.l_mark[0].declarator);
}
break;
case 69:
-#line 716 "grammar.y"
+#line 717 "grammar.y"
{
add_decl_list(&yyval.decl_list, &yystack.l_mark[-2].decl_list, yystack.l_mark[0].declarator);
}
break;
case 70:
-#line 723 "grammar.y"
+#line 724 "grammar.y"
{
if (yystack.l_mark[0].declarator->func_def != FUNC_NONE && func_params == NULL &&
func_style == FUNC_TRADITIONAL && cur_file->convert) {
@@ -2392,7 +2396,7 @@ case 70:
}
break;
case 71:
-#line 732 "grammar.y"
+#line 733 "grammar.y"
{
if (yystack.l_mark[-1].declarator->func_def != FUNC_NONE && func_params == NULL &&
func_style == FUNC_TRADITIONAL && cur_file->convert) {
@@ -2402,42 +2406,42 @@ case 71:
}
break;
case 73:
-#line 744 "grammar.y"
+#line 745 "grammar.y"
{
char *s;
if ((s = implied_typedef()) == 0)
- (void)sprintf(s = buf, "enum %s", yystack.l_mark[-1].text.text);
+ (void)sprintf(s = buf, "enum %.*s", TEXT_LEN, yystack.l_mark[-1].text.text);
new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE);
}
break;
case 74:
-#line 751 "grammar.y"
+#line 752 "grammar.y"
{
char *s;
if ((s = implied_typedef()) == 0)
- (void)sprintf(s = buf, "%s {}", yystack.l_mark[-1].text.text);
+ (void)sprintf(s = buf, "%.*s {}", TEXT_LEN, yystack.l_mark[-1].text.text);
new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE);
}
break;
case 75:
-#line 758 "grammar.y"
+#line 759 "grammar.y"
{
- (void)sprintf(buf, "enum %s", yystack.l_mark[0].text.text);
+ (void)sprintf(buf, "enum %.*s", TEXT_LEN, yystack.l_mark[0].text.text);
new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE);
}
break;
case 76:
-#line 766 "grammar.y"
+#line 767 "grammar.y"
{
imply_typedef("enum");
yyval.text = yystack.l_mark[0].text;
}
break;
case 79:
-#line 779 "grammar.y"
+#line 780 "grammar.y"
{
yyval.declarator = yystack.l_mark[0].declarator;
- (void)sprintf(buf, "%s%s", yystack.l_mark[-1].text.text, yyval.declarator->text);
+ (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yyval.declarator->text);
free(yyval.declarator->text);
yyval.declarator->text = xstrdup(buf);
yyval.declarator->begin = yystack.l_mark[-1].text.begin;
@@ -2445,32 +2449,32 @@ case 79:
}
break;
case 81:
-#line 792 "grammar.y"
+#line 793 "grammar.y"
{
yyval.declarator = new_declarator(yystack.l_mark[0].text.text, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin);
}
break;
case 82:
-#line 796 "grammar.y"
+#line 797 "grammar.y"
{
yyval.declarator = yystack.l_mark[-1].declarator;
- (void)sprintf(buf, "(%s)", yyval.declarator->text);
+ (void)sprintf(buf, "(%.*s)", TEXT_LEN, yyval.declarator->text);
free(yyval.declarator->text);
yyval.declarator->text = xstrdup(buf);
yyval.declarator->begin = yystack.l_mark[-2].text.begin;
}
break;
case 83:
-#line 804 "grammar.y"
+#line 805 "grammar.y"
{
yyval.declarator = yystack.l_mark[-1].declarator;
- (void)sprintf(buf, "%s%s", yyval.declarator->text, yystack.l_mark[0].text.text);
+ (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, yyval.declarator->text, TEXT_LEN, yystack.l_mark[0].text.text);
free(yyval.declarator->text);
yyval.declarator->text = xstrdup(buf);
}
break;
case 84:
-#line 811 "grammar.y"
+#line 812 "grammar.y"
{
yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin);
yyval.declarator->params = yystack.l_mark[-1].param_list;
@@ -2480,7 +2484,7 @@ case 84:
}
break;
case 85:
-#line 819 "grammar.y"
+#line 820 "grammar.y"
{
yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin);
yyval.declarator->params = yystack.l_mark[-1].param_list;
@@ -2490,28 +2494,28 @@ case 85:
}
break;
case 86:
-#line 830 "grammar.y"
+#line 831 "grammar.y"
{
- (void)sprintf(yyval.text.text, "*%s", yystack.l_mark[0].text.text);
+ (void)sprintf(yyval.text.text, "*%.*s", TEXT_LEN, yystack.l_mark[0].text.text);
yyval.text.begin = yystack.l_mark[-1].text.begin;
}
break;
case 87:
-#line 835 "grammar.y"
+#line 836 "grammar.y"
{
- (void)sprintf(yyval.text.text, "*%s%s", yystack.l_mark[-1].text.text, yystack.l_mark[0].text.text);
+ (void)sprintf(yyval.text.text, "*%.*s%.*s", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yystack.l_mark[0].text.text);
yyval.text.begin = yystack.l_mark[-2].text.begin;
}
break;
case 88:
-#line 843 "grammar.y"
+#line 844 "grammar.y"
{
strcpy(yyval.text.text, "");
yyval.text.begin = 0L;
}
break;
case 90:
-#line 852 "grammar.y"
+#line 853 "grammar.y"
{
(void)sprintf(yyval.text.text, "%s ", yystack.l_mark[0].decl_spec.text);
yyval.text.begin = yystack.l_mark[0].decl_spec.begin;
@@ -2519,132 +2523,132 @@ case 90:
}
break;
case 91:
-#line 858 "grammar.y"
+#line 859 "grammar.y"
{
- (void)sprintf(yyval.text.text, "%s%s ", yystack.l_mark[-1].text.text, yystack.l_mark[0].decl_spec.text);
+ (void)sprintf(yyval.text.text, "%.*s%.*s ", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yystack.l_mark[0].decl_spec.text);
yyval.text.begin = yystack.l_mark[-1].text.begin;
free(yystack.l_mark[0].decl_spec.text);
}
break;
case 93:
-#line 868 "grammar.y"
+#line 869 "grammar.y"
{
add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, "...");
}
break;
case 94:
-#line 875 "grammar.y"
+#line 876 "grammar.y"
{
new_param_list(&yyval.param_list, yystack.l_mark[0].parameter);
}
break;
case 95:
-#line 879 "grammar.y"
+#line 880 "grammar.y"
{
add_param_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].parameter);
}
break;
case 96:
-#line 886 "grammar.y"
+#line 887 "grammar.y"
{
check_untagged(&yystack.l_mark[-1].decl_spec);
yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator);
}
break;
case 97:
-#line 891 "grammar.y"
+#line 892 "grammar.y"
{
check_untagged(&yystack.l_mark[-1].decl_spec);
yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator);
}
break;
case 98:
-#line 896 "grammar.y"
+#line 897 "grammar.y"
{
check_untagged(&yystack.l_mark[0].decl_spec);
yyval.parameter = new_parameter(&yystack.l_mark[0].decl_spec, (Declarator *)0);
}
break;
case 99:
-#line 904 "grammar.y"
+#line 905 "grammar.y"
{
new_ident_list(&yyval.param_list);
}
break;
case 101:
-#line 912 "grammar.y"
+#line 913 "grammar.y"
{
new_ident_list(&yyval.param_list);
add_ident_list(&yyval.param_list, &yyval.param_list, yystack.l_mark[0].text.text);
}
break;
case 102:
-#line 917 "grammar.y"
+#line 918 "grammar.y"
{
add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].text.text);
}
break;
case 103:
-#line 924 "grammar.y"
+#line 925 "grammar.y"
{
yyval.text = yystack.l_mark[0].text;
}
break;
case 104:
-#line 928 "grammar.y"
+#line 929 "grammar.y"
{
#if OPT_LINTLIBRARY
if (lintLibrary()) { /* Lint doesn't grok C++ ref variables */
yyval.text = yystack.l_mark[0].text;
} else
#endif
- (void)sprintf(yyval.text.text, "&%s", yystack.l_mark[0].text.text);
+ (void)sprintf(yyval.text.text, "&%.*s", TEXT_LEN, yystack.l_mark[0].text.text);
yyval.text.begin = yystack.l_mark[-1].text.begin;
}
break;
case 105:
-#line 941 "grammar.y"
+#line 942 "grammar.y"
{
yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin);
}
break;
case 106:
-#line 945 "grammar.y"
+#line 946 "grammar.y"
{
yyval.declarator = yystack.l_mark[0].declarator;
- (void)sprintf(buf, "%s%s", yystack.l_mark[-1].text.text, yyval.declarator->text);
+ (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yyval.declarator->text);
free(yyval.declarator->text);
yyval.declarator->text = xstrdup(buf);
yyval.declarator->begin = yystack.l_mark[-1].text.begin;
}
break;
case 108:
-#line 957 "grammar.y"
+#line 958 "grammar.y"
{
yyval.declarator = yystack.l_mark[-1].declarator;
- (void)sprintf(buf, "(%s)", yyval.declarator->text);
+ (void)sprintf(buf, "(%.*s)", TEXT_LEN, yyval.declarator->text);
free(yyval.declarator->text);
yyval.declarator->text = xstrdup(buf);
yyval.declarator->begin = yystack.l_mark[-2].text.begin;
}
break;
case 109:
-#line 965 "grammar.y"
+#line 966 "grammar.y"
{
yyval.declarator = yystack.l_mark[-1].declarator;
- (void)sprintf(buf, "%s%s", yyval.declarator->text, yystack.l_mark[0].text.text);
+ (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, yyval.declarator->text, TEXT_LEN, yystack.l_mark[0].text.text);
free(yyval.declarator->text);
yyval.declarator->text = xstrdup(buf);
}
break;
case 110:
-#line 972 "grammar.y"
+#line 973 "grammar.y"
{
yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin);
}
break;
case 111:
-#line 976 "grammar.y"
+#line 977 "grammar.y"
{
yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-3].declarator->begin);
yyval.declarator->params = yystack.l_mark[-1].param_list;
@@ -2654,7 +2658,7 @@ case 111:
}
break;
case 112:
-#line 984 "grammar.y"
+#line 985 "grammar.y"
{
yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-2].declarator->begin);
yyval.declarator->func_stack = yystack.l_mark[-2].declarator;
@@ -2663,7 +2667,7 @@ case 112:
}
break;
case 113:
-#line 991 "grammar.y"
+#line 992 "grammar.y"
{
Declarator *d;
@@ -2676,7 +2680,7 @@ case 113:
}
break;
case 114:
-#line 1002 "grammar.y"
+#line 1003 "grammar.y"
{
Declarator *d;
@@ -2687,7 +2691,7 @@ case 114:
yyval.declarator->func_def = FUNC_ANSI;
}
break;
-#line 2691 "grammar.tab.c"
+#line 2695 "grammar.tab.c"
default:
break;
}
diff --git a/test/btyacc/inherit0.tab.c b/test/btyacc/inherit0.tab.c
index 058f623..0fec52c 100644
--- a/test/btyacc/inherit0.tab.c
+++ b/test/btyacc/inherit0.tab.c
@@ -261,13 +261,16 @@ static const char *const inherit0_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -389,7 +392,7 @@ static YYINT *yylexemes = 0;
extern int YYLEX_DECL();
extern void YYERROR_DECL();
-#line 393 "inherit0.tab.c"
+#line 396 "inherit0.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1103,7 +1106,7 @@ case 11:
#line 43 "inherit0.y"
{ yyval = yystack.l_mark[0]; }
break;
-#line 1107 "inherit0.tab.c"
+#line 1110 "inherit0.tab.c"
default:
break;
}
diff --git a/test/btyacc/inherit1.tab.c b/test/btyacc/inherit1.tab.c
index 5ff8f34..c5db4b7 100644
--- a/test/btyacc/inherit1.tab.c
+++ b/test/btyacc/inherit1.tab.c
@@ -282,13 +282,16 @@ static const char *const inherit1_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -410,7 +413,7 @@ static YYINT *yylexemes = 0;
extern int YYLEX_DECL();
extern void YYERROR_DECL();
-#line 414 "inherit1.tab.c"
+#line 417 "inherit1.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1128,7 +1131,7 @@ case 11:
#line 71 "inherit1.y"
{ yyval.nlist = yystack.l_mark[0].nlist; }
break;
-#line 1132 "inherit1.tab.c"
+#line 1135 "inherit1.tab.c"
default:
break;
}
diff --git a/test/btyacc/inherit2.tab.c b/test/btyacc/inherit2.tab.c
index f06dda4..b6894d6 100644
--- a/test/btyacc/inherit2.tab.c
+++ b/test/btyacc/inherit2.tab.c
@@ -289,13 +289,16 @@ static const char *const inherit2_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -417,7 +420,7 @@ static YYINT *yylexemes = 0;
extern int YYLEX_DECL();
extern void YYERROR_DECL();
-#line 421 "inherit2.tab.c"
+#line 424 "inherit2.tab.c"
/* Release memory associated with symbol. */
#if ! defined YYDESTRUCT_IS_DECLARED
@@ -437,7 +440,7 @@ YYDESTRUCT_DECL()
}
}
break;
-#line 441 "inherit2.tab.c"
+#line 444 "inherit2.tab.c"
case 264:
#line 30 "inherit2.y"
{
@@ -449,7 +452,7 @@ YYDESTRUCT_DECL()
}
}
break;
-#line 453 "inherit2.tab.c"
+#line 456 "inherit2.tab.c"
case 265:
#line 30 "inherit2.y"
{
@@ -461,7 +464,7 @@ YYDESTRUCT_DECL()
}
}
break;
-#line 465 "inherit2.tab.c"
+#line 468 "inherit2.tab.c"
}
}
#define YYDESTRUCT_IS_DECLARED 1
@@ -1187,7 +1190,7 @@ case 12:
#line 75 "inherit2.y"
{ yyval.nlist = yystack.l_mark[0].nlist; }
break;
-#line 1191 "inherit2.tab.c"
+#line 1194 "inherit2.tab.c"
default:
break;
}
diff --git a/test/btyacc/ok_syntax1.tab.c b/test/btyacc/ok_syntax1.tab.c
index 087a3d0..8d1ef9c 100644
--- a/test/btyacc/ok_syntax1.tab.c
+++ b/test/btyacc/ok_syntax1.tab.c
@@ -368,8 +368,9 @@ static const char *const ok_syntax1_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
#ifndef YYLLOC_DEFAULT
@@ -495,7 +496,7 @@ YYLEX_DECL()
}
return( c );
}
-#line 499 "ok_syntax1.tab.c"
+#line 500 "ok_syntax1.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -632,6 +633,8 @@ YYPARSE_DECL()
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+ int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -1284,7 +1287,7 @@ case 18:
#line 101 "ok_syntax1.y"
{ yyval.ival = (*base) * yystack.l_mark[-1].ival + yystack.l_mark[0].ival; }
break;
-#line 1288 "ok_syntax1.tab.c"
+#line 1291 "ok_syntax1.tab.c"
default:
break;
}
diff --git a/test/btyacc/ok_syntax1.tab.h b/test/btyacc/ok_syntax1.tab.h
index 75e9a96..44b8dc3 100644
--- a/test/btyacc/ok_syntax1.tab.h
+++ b/test/btyacc/ok_syntax1.tab.h
@@ -30,6 +30,5 @@ typedef union
double dval;
} YYSTYPE;
#endif /* !YYSTYPE_IS_DECLARED */
-extern YYSTYPE ok_syntax1_lval;
#endif /* _ok_syntax1__defines_h_ */
diff --git a/test/btyacc/pure_calc.tab.c b/test/btyacc/pure_calc.tab.c
index 8c9cfce..ee267b0 100644
--- a/test/btyacc/pure_calc.tab.c
+++ b/test/btyacc/pure_calc.tab.c
@@ -348,8 +348,9 @@ static const char *const calc_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
#ifndef YYLLOC_DEFAULT
@@ -468,7 +469,7 @@ YYLEX_DECL()
}
return( c );
}
-#line 472 "pure_calc.tab.c"
+#line 473 "pure_calc.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -605,6 +606,8 @@ YYPARSE_DECL()
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+ int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -1257,7 +1260,7 @@ case 18:
#line 69 "pure_calc.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1261 "pure_calc.tab.c"
+#line 1264 "pure_calc.tab.c"
default:
break;
}
diff --git a/test/btyacc/pure_error.tab.c b/test/btyacc/pure_error.tab.c
index 2c334b5..34d4f8c 100644
--- a/test/btyacc/pure_error.tab.c
+++ b/test/btyacc/pure_error.tab.c
@@ -236,8 +236,9 @@ static const char *const error_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
#ifndef YYLLOC_DEFAULT
@@ -336,7 +337,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 340 "pure_error.tab.c"
+#line 341 "pure_error.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -473,6 +474,8 @@ YYPARSE_DECL()
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+ int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
diff --git a/test/btyacc/quote_calc-s.tab.c b/test/btyacc/quote_calc-s.tab.c
index 25305be..b6e9ebd 100644
--- a/test/btyacc/quote_calc-s.tab.c
+++ b/test/btyacc/quote_calc-s.tab.c
@@ -357,13 +357,16 @@ static const char *const quote_calc_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -522,7 +525,7 @@ yylex(void) {
}
return( c );
}
-#line 526 "quote_calc-s.tab.c"
+#line 529 "quote_calc-s.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1252,7 +1255,7 @@ case 18:
#line 70 "quote_calc.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1256 "quote_calc-s.tab.c"
+#line 1259 "quote_calc-s.tab.c"
default:
break;
}
diff --git a/test/btyacc/quote_calc.tab.c b/test/btyacc/quote_calc.tab.c
index 092129c..af45d5d 100644
--- a/test/btyacc/quote_calc.tab.c
+++ b/test/btyacc/quote_calc.tab.c
@@ -363,13 +363,16 @@ static const char *const quote_calc_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -528,7 +531,7 @@ yylex(void) {
}
return( c );
}
-#line 532 "quote_calc.tab.c"
+#line 535 "quote_calc.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1258,7 +1261,7 @@ case 18:
#line 70 "quote_calc.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1262 "quote_calc.tab.c"
+#line 1265 "quote_calc.tab.c"
default:
break;
}
diff --git a/test/btyacc/quote_calc2-s.tab.c b/test/btyacc/quote_calc2-s.tab.c
index fb14a95..a9b2bce 100644
--- a/test/btyacc/quote_calc2-s.tab.c
+++ b/test/btyacc/quote_calc2-s.tab.c
@@ -357,13 +357,16 @@ static const char *const quote_calc2_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -522,7 +525,7 @@ yylex(void) {
}
return( c );
}
-#line 526 "quote_calc2-s.tab.c"
+#line 529 "quote_calc2-s.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1252,7 +1255,7 @@ case 18:
#line 70 "quote_calc2.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1256 "quote_calc2-s.tab.c"
+#line 1259 "quote_calc2-s.tab.c"
default:
break;
}
diff --git a/test/btyacc/quote_calc2.tab.c b/test/btyacc/quote_calc2.tab.c
index f983204..25ba4ad 100644
--- a/test/btyacc/quote_calc2.tab.c
+++ b/test/btyacc/quote_calc2.tab.c
@@ -363,13 +363,16 @@ static const char *const quote_calc2_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -528,7 +531,7 @@ yylex(void) {
}
return( c );
}
-#line 532 "quote_calc2.tab.c"
+#line 535 "quote_calc2.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1258,7 +1261,7 @@ case 18:
#line 70 "quote_calc2.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1262 "quote_calc2.tab.c"
+#line 1265 "quote_calc2.tab.c"
default:
break;
}
diff --git a/test/btyacc/quote_calc3-s.tab.c b/test/btyacc/quote_calc3-s.tab.c
index 15fbd67..1ffbb07 100644
--- a/test/btyacc/quote_calc3-s.tab.c
+++ b/test/btyacc/quote_calc3-s.tab.c
@@ -358,13 +358,16 @@ static const char *const quote_calc3_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -523,7 +526,7 @@ yylex(void) {
}
return( c );
}
-#line 527 "quote_calc3-s.tab.c"
+#line 530 "quote_calc3-s.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1253,7 +1256,7 @@ case 18:
#line 70 "quote_calc3.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1257 "quote_calc3-s.tab.c"
+#line 1260 "quote_calc3-s.tab.c"
default:
break;
}
diff --git a/test/btyacc/quote_calc3.tab.c b/test/btyacc/quote_calc3.tab.c
index ef26f74..87d7ce0 100644
--- a/test/btyacc/quote_calc3.tab.c
+++ b/test/btyacc/quote_calc3.tab.c
@@ -358,13 +358,16 @@ static const char *const quote_calc3_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -523,7 +526,7 @@ yylex(void) {
}
return( c );
}
-#line 527 "quote_calc3.tab.c"
+#line 530 "quote_calc3.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1253,7 +1256,7 @@ case 18:
#line 70 "quote_calc3.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1257 "quote_calc3.tab.c"
+#line 1260 "quote_calc3.tab.c"
default:
break;
}
diff --git a/test/btyacc/quote_calc4-s.tab.c b/test/btyacc/quote_calc4-s.tab.c
index a5ebdbc..39acf45 100644
--- a/test/btyacc/quote_calc4-s.tab.c
+++ b/test/btyacc/quote_calc4-s.tab.c
@@ -358,13 +358,16 @@ static const char *const quote_calc4_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -523,7 +526,7 @@ yylex(void) {
}
return( c );
}
-#line 527 "quote_calc4-s.tab.c"
+#line 530 "quote_calc4-s.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1253,7 +1256,7 @@ case 18:
#line 70 "quote_calc4.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1257 "quote_calc4-s.tab.c"
+#line 1260 "quote_calc4-s.tab.c"
default:
break;
}
diff --git a/test/btyacc/quote_calc4.tab.c b/test/btyacc/quote_calc4.tab.c
index 14ed4ed..1ec7822 100644
--- a/test/btyacc/quote_calc4.tab.c
+++ b/test/btyacc/quote_calc4.tab.c
@@ -358,13 +358,16 @@ static const char *const quote_calc4_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -523,7 +526,7 @@ yylex(void) {
}
return( c );
}
-#line 527 "quote_calc4.tab.c"
+#line 530 "quote_calc4.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1253,7 +1256,7 @@ case 18:
#line 70 "quote_calc4.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 1257 "quote_calc4.tab.c"
+#line 1260 "quote_calc4.tab.c"
default:
break;
}
diff --git a/test/btyacc/rename_debug.c b/test/btyacc/rename_debug.c
index 5681f91..3cd08d7 100644
--- a/test/btyacc/rename_debug.c
+++ b/test/btyacc/rename_debug.c
@@ -83,13 +83,16 @@ static const char *const yyrule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -233,7 +236,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 238 "rename_debug.c"
+#line 241 "rename_debug.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
diff --git a/test/btyacc/rename_debug.i b/test/btyacc/rename_debug.i
index b8f2144..ce4871a 100644
--- a/test/btyacc/rename_debug.i
+++ b/test/btyacc/rename_debug.i
@@ -37,6 +37,10 @@ typedef int YYSTYPE;
# define YYLEX yylex()
#endif
+#if !(defined(yylex) || defined(YYSTATE))
+int YYLEX_DECL();
+#endif
+
/* Parameters sent to yyerror. */
#ifndef YYERROR_DECL
#define YYERROR_DECL() yyerror(const char *s)
@@ -47,13 +51,20 @@ typedef int YYSTYPE;
extern int YYPARSE_DECL();
+#ifndef YYDEBUG
+#define YYDEBUG 1
+#endif
+
+#if YYDEBUG
extern int yydebug;
-extern int yynerrs;
+#endif
extern int yyerrflag;
extern int yychar;
extern YYSTYPE yyval;
extern YYSTYPE yylval;
+extern int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
extern YYLTYPE yyloc; /* position returned by actions */
extern YYLTYPE yylloc; /* position from the lexer */
diff --git a/test/btyacc/varsyntax_calc1.tab.c b/test/btyacc/varsyntax_calc1.tab.c
index 3f37ddf..2a7f442 100644
--- a/test/btyacc/varsyntax_calc1.tab.c
+++ b/test/btyacc/varsyntax_calc1.tab.c
@@ -394,13 +394,16 @@ static const char *const varsyntax_calc1_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
+
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE yyloc; /* position returned by actions */
YYLTYPE yylloc; /* position from the lexer */
@@ -649,7 +652,7 @@ vdiv(double a, double b, INTERVAL v)
{
return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
}
-#line 653 "varsyntax_calc1.tab.c"
+#line 656 "varsyntax_calc1.tab.c"
/* For use in generated program */
#define yydepth (int)(yystack.s_mark - yystack.s_base)
@@ -1482,7 +1485,7 @@ case 28:
yyval.vval = yystack.l_mark[-1].vval;
}
break;
-#line 1486 "varsyntax_calc1.tab.c"
+#line 1489 "varsyntax_calc1.tab.c"
default:
break;
}
diff --git a/test/calc.tab.c b/test/calc.tab.c
new file mode 100644
index 0000000..1f3a81f
--- /dev/null
+++ b/test/calc.tab.c
@@ -0,0 +1,668 @@
+#ifndef lint
+static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
+#endif
+
+#define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+
+#define YYEMPTY (-1)
+#define yyclearin (yychar = YYEMPTY)
+#define yyerrok (yyerrflag = 0)
+#define YYRECOVERING() (yyerrflag != 0)
+
+
+#ifndef yyparse
+#define yyparse calc_parse
+#endif /* yyparse */
+
+#ifndef yylex
+#define yylex calc_lex
+#endif /* yylex */
+
+#ifndef yyerror
+#define yyerror calc_error
+#endif /* yyerror */
+
+#ifndef yychar
+#define yychar calc_char
+#endif /* yychar */
+
+#ifndef yyval
+#define yyval calc_val
+#endif /* yyval */
+
+#ifndef yylval
+#define yylval calc_lval
+#endif /* yylval */
+
+#ifndef yydebug
+#define yydebug calc_debug
+#endif /* yydebug */
+
+#ifndef yynerrs
+#define yynerrs calc_nerrs
+#endif /* yynerrs */
+
+#ifndef yyerrflag
+#define yyerrflag calc_errflag
+#endif /* yyerrflag */
+
+#ifndef yylhs
+#define yylhs calc_lhs
+#endif /* yylhs */
+
+#ifndef yylen
+#define yylen calc_len
+#endif /* yylen */
+
+#ifndef yydefred
+#define yydefred calc_defred
+#endif /* yydefred */
+
+#ifndef yydgoto
+#define yydgoto calc_dgoto
+#endif /* yydgoto */
+
+#ifndef yysindex
+#define yysindex calc_sindex
+#endif /* yysindex */
+
+#ifndef yyrindex
+#define yyrindex calc_rindex
+#endif /* yyrindex */
+
+#ifndef yygindex
+#define yygindex calc_gindex
+#endif /* yygindex */
+
+#ifndef yytable
+#define yytable calc_table
+#endif /* yytable */
+
+#ifndef yycheck
+#define yycheck calc_check
+#endif /* yycheck */
+
+#ifndef yyname
+#define yyname calc_name
+#endif /* yyname */
+
+#ifndef yyrule
+#define yyrule calc_rule
+#endif /* yyrule */
+#define YYPREFIX "calc_"
+
+#define YYPURE 0
+
+#line 2 "calc.y"
+# include <stdio.h>
+# include <ctype.h>
+
+int regs[26];
+int base;
+
+extern int yylex(void);
+static void yyerror(const char *s);
+
+#line 109 "calc.tab.c"
+
+#ifndef YYSTYPE
+typedef int YYSTYPE;
+#endif
+
+/* compatibility with bison */
+#ifdef YYPARSE_PARAM
+/* compatibility with FreeBSD */
+# ifdef YYPARSE_PARAM_TYPE
+# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
+# else
+# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
+# endif
+#else
+# define YYPARSE_DECL() yyparse(void)
+#endif
+
+/* Parameters sent to lex. */
+#ifdef YYLEX_PARAM
+# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
+# define YYLEX yylex(YYLEX_PARAM)
+#else
+# define YYLEX_DECL() yylex(void)
+# define YYLEX yylex()
+#endif
+
+/* Parameters sent to yyerror. */
+#ifndef YYERROR_DECL
+#define YYERROR_DECL() yyerror(const char *s)
+#endif
+#ifndef YYERROR_CALL
+#define YYERROR_CALL(msg) yyerror(msg)
+#endif
+
+extern int YYPARSE_DECL();
+
+#define DIGIT 257
+#define LETTER 258
+#define UMINUS 259
+#define YYERRCODE 256
+static const short calc_lhs[] = { -1,
+ 0, 0, 0, 1, 1, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 3, 3,
+};
+static const short calc_len[] = { 2,
+ 0, 3, 3, 1, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 2, 1, 1, 1, 2,
+};
+static const short calc_defred[] = { 1,
+ 0, 0, 17, 0, 0, 0, 0, 0, 0, 3,
+ 0, 15, 14, 0, 2, 0, 0, 0, 0, 0,
+ 0, 0, 18, 0, 6, 0, 0, 0, 0, 9,
+ 10, 11,
+};
+static const short calc_dgoto[] = { 1,
+ 7, 8, 9,
+};
+static const short calc_sindex[] = { 0,
+ -40, -7, 0, -55, -38, -38, 1, -29, -247, 0,
+ -38, 0, 0, 22, 0, -38, -38, -38, -38, -38,
+ -38, -38, 0, -29, 0, 51, 60, -20, -20, 0,
+ 0, 0,
+};
+static const short calc_rindex[] = { 0,
+ 0, 0, 0, 2, 0, 0, 0, 9, -9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 10, 0, -6, 14, 5, 13, 0,
+ 0, 0,
+};
+static const short calc_gindex[] = { 0,
+ 0, 65, 0,
+};
+#define YYTABLESIZE 220
+static const short calc_table[] = { 6,
+ 16, 6, 10, 13, 5, 11, 5, 22, 17, 23,
+ 15, 15, 20, 18, 7, 19, 22, 21, 4, 5,
+ 0, 20, 8, 12, 0, 0, 21, 16, 16, 0,
+ 0, 16, 16, 16, 13, 16, 0, 16, 15, 15,
+ 0, 0, 7, 15, 15, 7, 15, 7, 15, 7,
+ 8, 12, 0, 8, 12, 8, 0, 8, 22, 17,
+ 0, 0, 25, 20, 18, 0, 19, 0, 21, 13,
+ 14, 0, 0, 0, 0, 24, 0, 0, 0, 0,
+ 26, 27, 28, 29, 30, 31, 32, 22, 17, 0,
+ 0, 0, 20, 18, 16, 19, 22, 21, 0, 0,
+ 0, 20, 18, 0, 19, 0, 21, 0, 0, 0,
+ 0, 0, 0, 0, 16, 0, 0, 13, 0, 0,
+ 0, 0, 0, 0, 0, 15, 0, 0, 7, 0,
+ 0, 0, 0, 0, 0, 0, 8, 12, 0, 0,
+ 0, 0, 0, 0, 0, 16, 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, 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, 2, 3, 4, 3, 12,
+};
+static const short calc_check[] = { 40,
+ 10, 40, 10, 10, 45, 61, 45, 37, 38, 257,
+ 10, 10, 42, 43, 10, 45, 37, 47, 10, 10,
+ -1, 42, 10, 10, -1, -1, 47, 37, 38, -1,
+ -1, 41, 42, 43, 41, 45, -1, 47, 37, 38,
+ -1, -1, 38, 42, 43, 41, 45, 43, 47, 45,
+ 38, 38, -1, 41, 41, 43, -1, 45, 37, 38,
+ -1, -1, 41, 42, 43, -1, 45, -1, 47, 5,
+ 6, -1, -1, -1, -1, 11, -1, -1, -1, -1,
+ 16, 17, 18, 19, 20, 21, 22, 37, 38, -1,
+ -1, -1, 42, 43, 124, 45, 37, 47, -1, -1,
+ -1, 42, 43, -1, 45, -1, 47, -1, -1, -1,
+ -1, -1, -1, -1, 124, -1, -1, 124, -1, -1,
+ -1, -1, -1, -1, -1, 124, -1, -1, 124, -1,
+ -1, -1, -1, -1, -1, -1, 124, 124, -1, -1,
+ -1, -1, -1, -1, -1, 124, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 256, 257, 258, 257, 258,
+};
+#define YYFINAL 1
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#define YYMAXTOKEN 259
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
+#if YYDEBUG
+static const char *yyname[] = {
+
+"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,
+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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol",
+};
+static const char *yyrule[] = {
+"$accept : list",
+"list :",
+"list : list stat '\\n'",
+"list : list error '\\n'",
+"stat : expr",
+"stat : LETTER '=' expr",
+"expr : '(' expr ')'",
+"expr : expr '+' expr",
+"expr : expr '-' expr",
+"expr : expr '*' expr",
+"expr : expr '/' expr",
+"expr : expr '%' expr",
+"expr : expr '&' expr",
+"expr : expr '|' expr",
+"expr : '-' expr",
+"expr : LETTER",
+"expr : number",
+"number : DIGIT",
+"number : number DIGIT",
+
+};
+#endif
+
+int yydebug;
+int yynerrs;
+
+int yyerrflag;
+int yychar;
+YYSTYPE yyval;
+YYSTYPE yylval;
+
+/* define the initial stack-sizes */
+#ifdef YYSTACKSIZE
+#undef YYMAXDEPTH
+#define YYMAXDEPTH YYSTACKSIZE
+#else
+#ifdef YYMAXDEPTH
+#define YYSTACKSIZE YYMAXDEPTH
+#else
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH 10000
+#endif
+#endif
+
+#define YYINITSTACKSIZE 200
+
+typedef struct {
+ unsigned stacksize;
+ short *s_base;
+ short *s_mark;
+ short *s_last;
+ YYSTYPE *l_base;
+ YYSTYPE *l_mark;
+} YYSTACKDATA;
+/* variables for the parser stack */
+static YYSTACKDATA yystack;
+#line 66 "calc.y"
+ /* start of programs */
+
+int
+main (void)
+{
+ while(!feof(stdin)) {
+ yyparse();
+ }
+ return 0;
+}
+
+static void
+yyerror(const char *s)
+{
+ fprintf(stderr, "%s\n", s);
+}
+
+int
+yylex(void)
+{
+ /* lexical analysis routine */
+ /* returns LETTER for a lower case letter, yylval = 0 through 25 */
+ /* return DIGIT for a digit, yylval = 0 through 9 */
+ /* all other characters are returned immediately */
+
+ int c;
+
+ while( (c=getchar()) == ' ' ) { /* skip blanks */ }
+
+ /* c is now nonblank */
+
+ if( islower( c )) {
+ yylval = c - 'a';
+ return ( LETTER );
+ }
+ if( isdigit( c )) {
+ yylval = c - '0';
+ return ( DIGIT );
+ }
+ return( c );
+}
+#line 347 "calc.tab.c"
+
+#if YYDEBUG
+#include <stdio.h> /* needed for printf */
+#endif
+
+#include <stdlib.h> /* needed for malloc, etc */
+#include <string.h> /* needed for memset */
+
+/* allocate initial stack or double stack size, up to YYMAXDEPTH */
+static int yygrowstack(YYSTACKDATA *data)
+{
+ int i;
+ unsigned newsize;
+ short *newss;
+ YYSTYPE *newvs;
+
+ if ((newsize = data->stacksize) == 0)
+ newsize = YYINITSTACKSIZE;
+ else if (newsize >= YYMAXDEPTH)
+ return -1;
+ else if ((newsize *= 2) > YYMAXDEPTH)
+ newsize = YYMAXDEPTH;
+
+ i = (int) (data->s_mark - data->s_base);
+ newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+ if (newss == 0)
+ return -1;
+
+ data->s_base = newss;
+ data->s_mark = newss + i;
+
+ newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
+ if (newvs == 0)
+ return -1;
+
+ data->l_base = newvs;
+ data->l_mark = newvs + i;
+
+ data->stacksize = newsize;
+ data->s_last = data->s_base + newsize - 1;
+ return 0;
+}
+
+#if YYPURE || defined(YY_NO_LEAKS)
+static void yyfreestack(YYSTACKDATA *data)
+{
+ free(data->s_base);
+ free(data->l_base);
+ memset(data, 0, sizeof(*data));
+}
+#else
+#define yyfreestack(data) /* nothing */
+#endif
+
+#define YYABORT goto yyabort
+#define YYREJECT goto yyabort
+#define YYACCEPT goto yyaccept
+#define YYERROR goto yyerrlab
+
+int
+YYPARSE_DECL()
+{
+ int yym, yyn, yystate;
+#if YYDEBUG
+ const char *yys;
+
+ if ((yys = getenv("YYDEBUG")) != 0)
+ {
+ yyn = *yys;
+ if (yyn >= '0' && yyn <= '9')
+ yydebug = yyn - '0';
+ }
+#endif
+
+ yynerrs = 0;
+ yyerrflag = 0;
+ yychar = YYEMPTY;
+ yystate = 0;
+
+#if YYPURE
+ memset(&yystack, 0, sizeof(yystack));
+#endif
+
+ if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+ yystack.s_mark = yystack.s_base;
+ yystack.l_mark = yystack.l_base;
+ yystate = 0;
+ *yystack.s_mark = 0;
+
+yyloop:
+ if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
+ if (yychar < 0)
+ {
+ if ((yychar = YYLEX) < 0) yychar = 0;
+#if YYDEBUG
+ if (yydebug)
+ {
+ yys = yyname[YYTRANSLATE(yychar)];
+ printf("%sdebug: state %d, reading %d (%s)\n",
+ YYPREFIX, yystate, yychar, yys);
+ }
+#endif
+ }
+ if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
+ yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
+ {
+#if YYDEBUG
+ if (yydebug)
+ printf("%sdebug: state %d, shifting to state %d\n",
+ YYPREFIX, yystate, yytable[yyn]);
+#endif
+ if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+ {
+ goto yyoverflow;
+ }
+ yystate = yytable[yyn];
+ *++yystack.s_mark = yytable[yyn];
+ *++yystack.l_mark = yylval;
+ yychar = YYEMPTY;
+ if (yyerrflag > 0) --yyerrflag;
+ goto yyloop;
+ }
+ if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
+ yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
+ {
+ yyn = yytable[yyn];
+ goto yyreduce;
+ }
+ if (yyerrflag) goto yyinrecovery;
+
+ yyerror("syntax error");
+
+ goto yyerrlab;
+
+yyerrlab:
+ ++yynerrs;
+
+yyinrecovery:
+ if (yyerrflag < 3)
+ {
+ yyerrflag = 3;
+ for (;;)
+ {
+ if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
+ yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
+ {
+#if YYDEBUG
+ if (yydebug)
+ printf("%sdebug: state %d, error recovery shifting\
+ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
+#endif
+ if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+ {
+ goto yyoverflow;
+ }
+ yystate = yytable[yyn];
+ *++yystack.s_mark = yytable[yyn];
+ *++yystack.l_mark = yylval;
+ goto yyloop;
+ }
+ else
+ {
+#if YYDEBUG
+ if (yydebug)
+ printf("%sdebug: error recovery discarding state %d\n",
+ YYPREFIX, *yystack.s_mark);
+#endif
+ if (yystack.s_mark <= yystack.s_base) goto yyabort;
+ --yystack.s_mark;
+ --yystack.l_mark;
+ }
+ }
+ }
+ else
+ {
+ if (yychar == 0) goto yyabort;
+#if YYDEBUG
+ if (yydebug)
+ {
+ yys = yyname[YYTRANSLATE(yychar)];
+ printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
+ YYPREFIX, yystate, yychar, yys);
+ }
+#endif
+ yychar = YYEMPTY;
+ goto yyloop;
+ }
+
+yyreduce:
+#if YYDEBUG
+ if (yydebug)
+ printf("%sdebug: state %d, reducing by rule %d (%s)\n",
+ YYPREFIX, yystate, yyn, yyrule[yyn]);
+#endif
+ yym = yylen[yyn];
+ if (yym)
+ yyval = yystack.l_mark[1-yym];
+ else
+ memset(&yyval, 0, sizeof yyval);
+ switch (yyn)
+ {
+case 3:
+#line 28 "calc.y"
+ { yyerrok ; }
+break;
+case 4:
+#line 32 "calc.y"
+ { printf("%d\n",yystack.l_mark[0]);}
+break;
+case 5:
+#line 34 "calc.y"
+ { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; }
+break;
+case 6:
+#line 38 "calc.y"
+ { yyval = yystack.l_mark[-1]; }
+break;
+case 7:
+#line 40 "calc.y"
+ { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; }
+break;
+case 8:
+#line 42 "calc.y"
+ { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; }
+break;
+case 9:
+#line 44 "calc.y"
+ { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; }
+break;
+case 10:
+#line 46 "calc.y"
+ { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; }
+break;
+case 11:
+#line 48 "calc.y"
+ { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; }
+break;
+case 12:
+#line 50 "calc.y"
+ { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; }
+break;
+case 13:
+#line 52 "calc.y"
+ { yyval = yystack.l_mark[-2] | yystack.l_mark[0]; }
+break;
+case 14:
+#line 54 "calc.y"
+ { yyval = - yystack.l_mark[0]; }
+break;
+case 15:
+#line 56 "calc.y"
+ { yyval = regs[yystack.l_mark[0]]; }
+break;
+case 17:
+#line 61 "calc.y"
+ { yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; }
+break;
+case 18:
+#line 63 "calc.y"
+ { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
+break;
+#line 609 "calc.tab.c"
+ }
+ yystack.s_mark -= yym;
+ yystate = *yystack.s_mark;
+ yystack.l_mark -= yym;
+ yym = yylhs[yyn];
+ if (yystate == 0 && yym == 0)
+ {
+#if YYDEBUG
+ if (yydebug)
+ printf("%sdebug: after reduction, shifting from state 0 to\
+ state %d\n", YYPREFIX, YYFINAL);
+#endif
+ yystate = YYFINAL;
+ *++yystack.s_mark = YYFINAL;
+ *++yystack.l_mark = yyval;
+ if (yychar < 0)
+ {
+ if ((yychar = YYLEX) < 0) yychar = 0;
+#if YYDEBUG
+ if (yydebug)
+ {
+ yys = yyname[YYTRANSLATE(yychar)];
+ printf("%sdebug: state %d, reading %d (%s)\n",
+ YYPREFIX, YYFINAL, yychar, yys);
+ }
+#endif
+ }
+ if (yychar == 0) goto yyaccept;
+ goto yyloop;
+ }
+ if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
+ yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
+ yystate = yytable[yyn];
+ else
+ yystate = yydgoto[yym];
+#if YYDEBUG
+ if (yydebug)
+ printf("%sdebug: after reduction, shifting from state %d \
+to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
+#endif
+ if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+ {
+ goto yyoverflow;
+ }
+ *++yystack.s_mark = (short) yystate;
+ *++yystack.l_mark = yyval;
+ goto yyloop;
+
+yyoverflow:
+ yyerror("yacc stack overflow");
+
+yyabort:
+ yyfreestack(&yystack);
+ return (1);
+
+yyaccept:
+ yyfreestack(&yystack);
+ return (0);
+}
diff --git a/test/grammar.y b/test/grammar.y
index 6755522..7b7216f 100644
--- a/test/grammar.y
+++ b/test/grammar.y
@@ -1,4 +1,4 @@
-/* $Id: grammar.y,v 1.5 2012/01/15 20:00:59 tom Exp $
+/* $Id: grammar.y,v 1.6 2018/05/09 00:59:02 tom Exp $
*
* yacc grammar for C function prototype generator
* This was derived from the grammar in Appendix A of
@@ -94,6 +94,7 @@ static void yyerror(const char *s);
/* #include "cproto.h" */
#define MAX_TEXT_SIZE 1024
+#define TEXT_LEN (MAX_TEXT_SIZE / 2 - 3)
/* Prototype styles */
#if OPT_LINTLIBRARY
@@ -679,19 +680,19 @@ struct_or_union_specifier
{
char *s;
if ((s = implied_typedef()) == 0)
- (void)sprintf(s = buf, "%s %s", $1.text, $2.text);
+ (void)sprintf(s = buf, "%.*s %.*s", TEXT_LEN, $1.text, TEXT_LEN, $2.text);
new_decl_spec(&$$, s, $1.begin, DS_NONE);
}
| struct_or_union braces
{
char *s;
if ((s = implied_typedef()) == 0)
- (void)sprintf(s = buf, "%s {}", $1.text);
+ (void)sprintf(s = buf, "%.*s {}", TEXT_LEN, $1.text);
new_decl_spec(&$$, s, $1.begin, DS_NONE);
}
| struct_or_union any_id
{
- (void)sprintf(buf, "%s %s", $1.text, $2.text);
+ (void)sprintf(buf, "%.*s %.*s", TEXT_LEN, $1.text, TEXT_LEN, $2.text);
new_decl_spec(&$$, buf, $1.begin, DS_NONE);
}
;
@@ -744,19 +745,19 @@ enum_specifier
{
char *s;
if ((s = implied_typedef()) == 0)
- (void)sprintf(s = buf, "enum %s", $2.text);
+ (void)sprintf(s = buf, "enum %.*s", TEXT_LEN, $2.text);
new_decl_spec(&$$, s, $1.begin, DS_NONE);
}
| enumeration braces
{
char *s;
if ((s = implied_typedef()) == 0)
- (void)sprintf(s = buf, "%s {}", $1.text);
+ (void)sprintf(s = buf, "%.*s {}", TEXT_LEN, $1.text);
new_decl_spec(&$$, s, $1.begin, DS_NONE);
}
| enumeration any_id
{
- (void)sprintf(buf, "enum %s", $2.text);
+ (void)sprintf(buf, "enum %.*s", TEXT_LEN, $2.text);
new_decl_spec(&$$, buf, $1.begin, DS_NONE);
}
;
@@ -778,7 +779,7 @@ declarator
: pointer direct_declarator
{
$$ = $2;
- (void)sprintf(buf, "%s%s", $1.text, $$->text);
+ (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, $1.text, TEXT_LEN, $$->text);
free($$->text);
$$->text = xstrdup(buf);
$$->begin = $1.begin;
@@ -795,7 +796,7 @@ direct_declarator
| '(' declarator ')'
{
$$ = $2;
- (void)sprintf(buf, "(%s)", $$->text);
+ (void)sprintf(buf, "(%.*s)", TEXT_LEN, $$->text);
free($$->text);
$$->text = xstrdup(buf);
$$->begin = $1.begin;
@@ -803,7 +804,7 @@ direct_declarator
| direct_declarator T_BRACKETS
{
$$ = $1;
- (void)sprintf(buf, "%s%s", $$->text, $2.text);
+ (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, $$->text, TEXT_LEN, $2.text);
free($$->text);
$$->text = xstrdup(buf);
}
@@ -828,12 +829,12 @@ direct_declarator
pointer
: '*' opt_type_qualifiers
{
- (void)sprintf($$.text, "*%s", $2.text);
+ (void)sprintf($$.text, "*%.*s", TEXT_LEN, $2.text);
$$.begin = $1.begin;
}
| '*' opt_type_qualifiers pointer
{
- (void)sprintf($$.text, "*%s%s", $2.text, $3.text);
+ (void)sprintf($$.text, "*%.*s%.*s", TEXT_LEN, $2.text, TEXT_LEN, $3.text);
$$.begin = $1.begin;
}
;
@@ -856,7 +857,7 @@ type_qualifier_list
}
| type_qualifier_list type_qualifier
{
- (void)sprintf($$.text, "%s%s ", $1.text, $2.text);
+ (void)sprintf($$.text, "%.*s%.*s ", TEXT_LEN, $1.text, TEXT_LEN, $2.text);
$$.begin = $1.begin;
free($2.text);
}
@@ -931,7 +932,7 @@ identifier_or_ref
$$ = $2;
} else
#endif
- (void)sprintf($$.text, "&%s", $2.text);
+ (void)sprintf($$.text, "&%.*s", TEXT_LEN, $2.text);
$$.begin = $1.begin;
}
;
@@ -944,7 +945,7 @@ abs_declarator
| pointer direct_abs_declarator
{
$$ = $2;
- (void)sprintf(buf, "%s%s", $1.text, $$->text);
+ (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, $1.text, TEXT_LEN, $$->text);
free($$->text);
$$->text = xstrdup(buf);
$$->begin = $1.begin;
@@ -956,7 +957,7 @@ direct_abs_declarator
: '(' abs_declarator ')'
{
$$ = $2;
- (void)sprintf(buf, "(%s)", $$->text);
+ (void)sprintf(buf, "(%.*s)", TEXT_LEN, $$->text);
free($$->text);
$$->text = xstrdup(buf);
$$->begin = $1.begin;
@@ -964,7 +965,7 @@ direct_abs_declarator
| direct_abs_declarator T_BRACKETS
{
$$ = $1;
- (void)sprintf(buf, "%s%s", $$->text, $2.text);
+ (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, $$->text, TEXT_LEN, $2.text);
free($$->text);
$$->text = xstrdup(buf);
}
diff --git a/test/yacc/calc.tab.c b/test/yacc/calc.tab.c
index 6ce2cd4..817bd00 100644
--- a/test/yacc/calc.tab.c
+++ b/test/yacc/calc.tab.c
@@ -275,13 +275,15 @@ static const char *const calc_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -350,7 +352,7 @@ yylex(void)
}
return( c );
}
-#line 354 "calc.tab.c"
+#line 356 "calc.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -609,7 +611,7 @@ case 18:
#line 63 "calc.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 613 "calc.tab.c"
+#line 615 "calc.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/calc1.tab.c b/test/yacc/calc1.tab.c
index 0da4fde..eda1d00 100644
--- a/test/yacc/calc1.tab.c
+++ b/test/yacc/calc1.tab.c
@@ -323,13 +323,15 @@ static const char *const calc1_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -487,7 +489,7 @@ vdiv(double a, double b, INTERVAL v)
{
return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
}
-#line 491 "calc1.tab.c"
+#line 493 "calc1.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -849,7 +851,7 @@ case 28:
yyval.vval = yystack.l_mark[-1].vval;
}
break;
-#line 853 "calc1.tab.c"
+#line 855 "calc1.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/calc2.tab.c b/test/yacc/calc2.tab.c
index 8c82aa8..e2ab6f0 100644
--- a/test/yacc/calc2.tab.c
+++ b/test/yacc/calc2.tab.c
@@ -277,13 +277,15 @@ static const char *const calc2_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -363,7 +365,7 @@ YYLEX_DECL()
}
return( c );
}
-#line 367 "calc2.tab.c"
+#line 369 "calc2.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -622,7 +624,7 @@ case 18:
#line 70 "calc2.y"
{ yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 626 "calc2.tab.c"
+#line 628 "calc2.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/calc3.tab.c b/test/yacc/calc3.tab.c
index 0869f32..bfabb4a 100644
--- a/test/yacc/calc3.tab.c
+++ b/test/yacc/calc3.tab.c
@@ -282,8 +282,9 @@ static const char *const calc3_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -361,7 +362,7 @@ YYLEX_DECL()
}
return( c );
}
-#line 365 "calc3.tab.c"
+#line 366 "calc3.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -428,6 +429,7 @@ YYPARSE_DECL()
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+ int yynerrs;
/* variables for the parser stack */
YYSTACKDATA yystack;
@@ -630,7 +632,7 @@ case 18:
#line 73 "calc3.y"
{ yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 634 "calc3.tab.c"
+#line 636 "calc3.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/code_calc.code.c b/test/yacc/code_calc.code.c
index 2c04715..a1d4f4b 100644
--- a/test/yacc/code_calc.code.c
+++ b/test/yacc/code_calc.code.c
@@ -180,13 +180,15 @@ extern char *yyname[];
extern char *yyrule[];
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -259,7 +261,7 @@ yylex(void)
}
return( c );
}
-#line 263 "code_calc.code.c"
+#line 265 "code_calc.code.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -518,7 +520,7 @@ case 18:
#line 67 "code_calc.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 522 "code_calc.code.c"
+#line 524 "code_calc.code.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/code_error.code.c b/test/yacc/code_error.code.c
index a22464c..b117ce6 100644
--- a/test/yacc/code_error.code.c
+++ b/test/yacc/code_error.code.c
@@ -170,13 +170,15 @@ extern char *yyname[];
extern char *yyrule[];
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -229,7 +231,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 233 "code_error.code.c"
+#line 235 "code_error.code.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
diff --git a/test/yacc/empty.tab.c b/test/yacc/empty.tab.c
index 465a0a3..e338655 100644
--- a/test/yacc/empty.tab.c
+++ b/test/yacc/empty.tab.c
@@ -194,13 +194,15 @@ static const char *const empty_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -240,7 +242,7 @@ static void
YYERROR_DECL() {
printf("%s\n",s);
}
-#line 244 "empty.tab.c"
+#line 246 "empty.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
diff --git a/test/yacc/err_syntax10.tab.c b/test/yacc/err_syntax10.tab.c
index bbfe2e6..e4b1578 100644
--- a/test/yacc/err_syntax10.tab.c
+++ b/test/yacc/err_syntax10.tab.c
@@ -184,13 +184,15 @@ static const char *const err_syntax10_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -239,7 +241,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 243 "err_syntax10.tab.c"
+#line 245 "err_syntax10.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
diff --git a/test/yacc/err_syntax11.tab.c b/test/yacc/err_syntax11.tab.c
index 4da7c62..070661e 100644
--- a/test/yacc/err_syntax11.tab.c
+++ b/test/yacc/err_syntax11.tab.c
@@ -190,13 +190,15 @@ static const char *const err_syntax11_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -245,7 +247,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 249 "err_syntax11.tab.c"
+#line 251 "err_syntax11.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
diff --git a/test/yacc/err_syntax12.tab.c b/test/yacc/err_syntax12.tab.c
index af33ee2..7c6c63e 100644
--- a/test/yacc/err_syntax12.tab.c
+++ b/test/yacc/err_syntax12.tab.c
@@ -196,13 +196,15 @@ static const char *const err_syntax12_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -251,7 +253,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 255 "err_syntax12.tab.c"
+#line 257 "err_syntax12.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
diff --git a/test/yacc/err_syntax18.tab.c b/test/yacc/err_syntax18.tab.c
index 15f7a7a..6038c14 100644
--- a/test/yacc/err_syntax18.tab.c
+++ b/test/yacc/err_syntax18.tab.c
@@ -192,13 +192,15 @@ static const char *const err_syntax18_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -247,7 +249,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 251 "err_syntax18.tab.c"
+#line 253 "err_syntax18.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -450,7 +452,7 @@ case 1:
#line 9 "err_syntax18.y"
{ yyval = yystack.l_mark[1]; }
break;
-#line 454 "err_syntax18.tab.c"
+#line 456 "err_syntax18.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/err_syntax20.tab.c b/test/yacc/err_syntax20.tab.c
index 526adde..ea9fc87 100644
--- a/test/yacc/err_syntax20.tab.c
+++ b/test/yacc/err_syntax20.tab.c
@@ -188,13 +188,15 @@ static const char *const err_syntax20_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -243,7 +245,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 247 "err_syntax20.tab.c"
+#line 249 "err_syntax20.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -446,7 +448,7 @@ case 1:
#line 12 "err_syntax20.y"
{ yystack.l_mark[-1].rechk = 3; }
break;
-#line 450 "err_syntax20.tab.c"
+#line 452 "err_syntax20.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/error.tab.c b/test/yacc/error.tab.c
index 47a39d8..93d9011 100644
--- a/test/yacc/error.tab.c
+++ b/test/yacc/error.tab.c
@@ -190,13 +190,15 @@ static const char *const error_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -245,7 +247,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 249 "error.tab.c"
+#line 251 "error.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
diff --git a/test/yacc/expr.oxout.tab.c b/test/yacc/expr.oxout.tab.c
index b4b7ec4..0edef3a 100644
--- a/test/yacc/expr.oxout.tab.c
+++ b/test/yacc/expr.oxout.tab.c
@@ -287,13 +287,15 @@ static const char *const expr.oxout_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -1641,7 +1643,7 @@ void yyyUnsolvedInstSearchTrav(yyyGNT *pNode)
-#line 1645 "expr.oxout.tab.c"
+#line 1647 "expr.oxout.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -1898,7 +1900,7 @@ case 10:
yyyGenIntNode(8,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
yyyAdjustINRC(8,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
break;
-#line 1902 "expr.oxout.tab.c"
+#line 1904 "expr.oxout.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/grammar.tab.c b/test/yacc/grammar.tab.c
index c4aee12..d281440 100644
--- a/test/yacc/grammar.tab.c
+++ b/test/yacc/grammar.tab.c
@@ -124,6 +124,7 @@ static void yyerror(const char *s);
/* #include "cproto.h" */
#define MAX_TEXT_SIZE 1024
+#define TEXT_LEN (MAX_TEXT_SIZE / 2 - 3)
/* Prototype styles */
#if OPT_LINTLIBRARY
@@ -384,7 +385,7 @@ haveAnsiParam (void)
}
return FALSE;
}
-#line 388 "grammar.tab.c"
+#line 389 "grammar.tab.c"
/* compatibility with bison */
#ifdef YYPARSE_PARAM
@@ -884,13 +885,15 @@ static const char *const grammar_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -917,7 +920,7 @@ typedef struct {
} YYSTACKDATA;
/* variables for the parser stack */
static YYSTACKDATA yystack;
-#line 1014 "grammar.y"
+#line 1015 "grammar.y"
/* lex.yy.c */
#define BEGIN yy_start = 1 + 2 *
@@ -1088,7 +1091,7 @@ free_parser(void)
#endif
}
#endif
-#line 1092 "grammar.tab.c"
+#line 1095 "grammar.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -1288,19 +1291,19 @@ yyreduce:
switch (yyn)
{
case 10:
-#line 377 "grammar.y"
+#line 378 "grammar.y"
{
yyerrok;
}
break;
case 11:
-#line 381 "grammar.y"
+#line 382 "grammar.y"
{
yyerrok;
}
break;
case 13:
-#line 392 "grammar.y"
+#line 393 "grammar.y"
{
/* Provide an empty action here so bison will not complain about
* incompatible types in the default action it normally would
@@ -1309,13 +1312,13 @@ case 13:
}
break;
case 14:
-#line 399 "grammar.y"
+#line 400 "grammar.y"
{
/* empty */
}
break;
case 15:
-#line 406 "grammar.y"
+#line 407 "grammar.y"
{
#if OPT_LINTLIBRARY
if (types_out && want_typedef()) {
@@ -1328,7 +1331,7 @@ case 15:
}
break;
case 16:
-#line 417 "grammar.y"
+#line 418 "grammar.y"
{
if (func_params != NULL) {
set_param_types(func_params, &yystack.l_mark[-2].decl_spec, &yystack.l_mark[-1].decl_list);
@@ -1344,32 +1347,32 @@ case 16:
}
break;
case 17:
-#line 431 "grammar.y"
+#line 432 "grammar.y"
{
cur_decl_spec_flags = yystack.l_mark[0].decl_spec.flags;
free_decl_spec(&yystack.l_mark[0].decl_spec);
}
break;
case 18:
-#line 436 "grammar.y"
+#line 437 "grammar.y"
{
end_typedef();
}
break;
case 19:
-#line 443 "grammar.y"
+#line 444 "grammar.y"
{
begin_typedef();
}
break;
case 20:
-#line 447 "grammar.y"
+#line 448 "grammar.y"
{
begin_typedef();
}
break;
case 23:
-#line 459 "grammar.y"
+#line 460 "grammar.y"
{
int flags = cur_decl_spec_flags;
@@ -1383,7 +1386,7 @@ case 23:
}
break;
case 24:
-#line 471 "grammar.y"
+#line 472 "grammar.y"
{
int flags = cur_decl_spec_flags;
@@ -1394,7 +1397,7 @@ case 24:
}
break;
case 25:
-#line 483 "grammar.y"
+#line 484 "grammar.y"
{
check_untagged(&yystack.l_mark[-1].decl_spec);
if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) {
@@ -1407,7 +1410,7 @@ case 25:
}
break;
case 26:
-#line 494 "grammar.y"
+#line 495 "grammar.y"
{
/* If we're converting to K&R and we've got a nominally K&R
* function which has a parameter which is ANSI (i.e., a prototyped
@@ -1433,7 +1436,7 @@ case 26:
}
break;
case 28:
-#line 519 "grammar.y"
+#line 520 "grammar.y"
{
if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) {
yyerror("syntax error");
@@ -1445,7 +1448,7 @@ case 28:
}
break;
case 29:
-#line 529 "grammar.y"
+#line 530 "grammar.y"
{
DeclSpec decl_spec;
@@ -1463,7 +1466,7 @@ case 29:
}
break;
case 36:
-#line 560 "grammar.y"
+#line 561 "grammar.y"
{
join_decl_specs(&yyval.decl_spec, &yystack.l_mark[-1].decl_spec, &yystack.l_mark[0].decl_spec);
free(yystack.l_mark[-1].decl_spec.text);
@@ -1471,115 +1474,115 @@ case 36:
}
break;
case 40:
-#line 575 "grammar.y"
+#line 576 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 41:
-#line 579 "grammar.y"
+#line 580 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_EXTERN);
}
break;
case 42:
-#line 583 "grammar.y"
+#line 584 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 43:
-#line 587 "grammar.y"
+#line 588 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_STATIC);
}
break;
case 44:
-#line 591 "grammar.y"
+#line 592 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_INLINE);
}
break;
case 45:
-#line 595 "grammar.y"
+#line 596 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_JUNK);
}
break;
case 46:
-#line 602 "grammar.y"
+#line 603 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR);
}
break;
case 47:
-#line 606 "grammar.y"
+#line 607 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 48:
-#line 610 "grammar.y"
+#line 611 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_FLOAT);
}
break;
case 49:
-#line 614 "grammar.y"
+#line 615 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 50:
-#line 618 "grammar.y"
+#line 619 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 51:
-#line 622 "grammar.y"
+#line 623 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_SHORT);
}
break;
case 52:
-#line 626 "grammar.y"
+#line 627 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 53:
-#line 630 "grammar.y"
+#line 631 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 54:
-#line 634 "grammar.y"
+#line 635 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 55:
-#line 638 "grammar.y"
+#line 639 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR);
}
break;
case 56:
-#line 642 "grammar.y"
+#line 643 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 57:
-#line 646 "grammar.y"
+#line 647 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 58:
-#line 650 "grammar.y"
+#line 651 "grammar.y"
{
Symbol *s;
s = find_symbol(typedef_names, yystack.l_mark[0].text.text);
@@ -1588,13 +1591,13 @@ case 58:
}
break;
case 61:
-#line 662 "grammar.y"
+#line 663 "grammar.y"
{
new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
}
break;
case 62:
-#line 666 "grammar.y"
+#line 667 "grammar.y"
{
/* This rule allows the <pointer> nonterminal to scan #define
* names as if they were type modifiers.
@@ -1606,56 +1609,56 @@ case 62:
}
break;
case 63:
-#line 679 "grammar.y"
+#line 680 "grammar.y"
{
char *s;
if ((s = implied_typedef()) == 0)
- (void)sprintf(s = buf, "%s %s", yystack.l_mark[-2].text.text, yystack.l_mark[-1].text.text);
+ (void)sprintf(s = buf, "%.*s %.*s", TEXT_LEN, yystack.l_mark[-2].text.text, TEXT_LEN, yystack.l_mark[-1].text.text);
new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE);
}
break;
case 64:
-#line 686 "grammar.y"
+#line 687 "grammar.y"
{
char *s;
if ((s = implied_typedef()) == 0)
- (void)sprintf(s = buf, "%s {}", yystack.l_mark[-1].text.text);
+ (void)sprintf(s = buf, "%.*s {}", TEXT_LEN, yystack.l_mark[-1].text.text);
new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE);
}
break;
case 65:
-#line 693 "grammar.y"
+#line 694 "grammar.y"
{
- (void)sprintf(buf, "%s %s", yystack.l_mark[-1].text.text, yystack.l_mark[0].text.text);
+ (void)sprintf(buf, "%.*s %.*s", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yystack.l_mark[0].text.text);
new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE);
}
break;
case 66:
-#line 701 "grammar.y"
+#line 702 "grammar.y"
{
imply_typedef(yyval.text.text);
}
break;
case 67:
-#line 705 "grammar.y"
+#line 706 "grammar.y"
{
imply_typedef(yyval.text.text);
}
break;
case 68:
-#line 712 "grammar.y"
+#line 713 "grammar.y"
{
new_decl_list(&yyval.decl_list, yystack.l_mark[0].declarator);
}
break;
case 69:
-#line 716 "grammar.y"
+#line 717 "grammar.y"
{
add_decl_list(&yyval.decl_list, &yystack.l_mark[-2].decl_list, yystack.l_mark[0].declarator);
}
break;
case 70:
-#line 723 "grammar.y"
+#line 724 "grammar.y"
{
if (yystack.l_mark[0].declarator->func_def != FUNC_NONE && func_params == NULL &&
func_style == FUNC_TRADITIONAL && cur_file->convert) {
@@ -1666,7 +1669,7 @@ case 70:
}
break;
case 71:
-#line 732 "grammar.y"
+#line 733 "grammar.y"
{
if (yystack.l_mark[-1].declarator->func_def != FUNC_NONE && func_params == NULL &&
func_style == FUNC_TRADITIONAL && cur_file->convert) {
@@ -1676,42 +1679,42 @@ case 71:
}
break;
case 73:
-#line 744 "grammar.y"
+#line 745 "grammar.y"
{
char *s;
if ((s = implied_typedef()) == 0)
- (void)sprintf(s = buf, "enum %s", yystack.l_mark[-1].text.text);
+ (void)sprintf(s = buf, "enum %.*s", TEXT_LEN, yystack.l_mark[-1].text.text);
new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE);
}
break;
case 74:
-#line 751 "grammar.y"
+#line 752 "grammar.y"
{
char *s;
if ((s = implied_typedef()) == 0)
- (void)sprintf(s = buf, "%s {}", yystack.l_mark[-1].text.text);
+ (void)sprintf(s = buf, "%.*s {}", TEXT_LEN, yystack.l_mark[-1].text.text);
new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE);
}
break;
case 75:
-#line 758 "grammar.y"
+#line 759 "grammar.y"
{
- (void)sprintf(buf, "enum %s", yystack.l_mark[0].text.text);
+ (void)sprintf(buf, "enum %.*s", TEXT_LEN, yystack.l_mark[0].text.text);
new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE);
}
break;
case 76:
-#line 766 "grammar.y"
+#line 767 "grammar.y"
{
imply_typedef("enum");
yyval.text = yystack.l_mark[0].text;
}
break;
case 79:
-#line 779 "grammar.y"
+#line 780 "grammar.y"
{
yyval.declarator = yystack.l_mark[0].declarator;
- (void)sprintf(buf, "%s%s", yystack.l_mark[-1].text.text, yyval.declarator->text);
+ (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yyval.declarator->text);
free(yyval.declarator->text);
yyval.declarator->text = xstrdup(buf);
yyval.declarator->begin = yystack.l_mark[-1].text.begin;
@@ -1719,32 +1722,32 @@ case 79:
}
break;
case 81:
-#line 792 "grammar.y"
+#line 793 "grammar.y"
{
yyval.declarator = new_declarator(yystack.l_mark[0].text.text, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin);
}
break;
case 82:
-#line 796 "grammar.y"
+#line 797 "grammar.y"
{
yyval.declarator = yystack.l_mark[-1].declarator;
- (void)sprintf(buf, "(%s)", yyval.declarator->text);
+ (void)sprintf(buf, "(%.*s)", TEXT_LEN, yyval.declarator->text);
free(yyval.declarator->text);
yyval.declarator->text = xstrdup(buf);
yyval.declarator->begin = yystack.l_mark[-2].text.begin;
}
break;
case 83:
-#line 804 "grammar.y"
+#line 805 "grammar.y"
{
yyval.declarator = yystack.l_mark[-1].declarator;
- (void)sprintf(buf, "%s%s", yyval.declarator->text, yystack.l_mark[0].text.text);
+ (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, yyval.declarator->text, TEXT_LEN, yystack.l_mark[0].text.text);
free(yyval.declarator->text);
yyval.declarator->text = xstrdup(buf);
}
break;
case 84:
-#line 811 "grammar.y"
+#line 812 "grammar.y"
{
yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin);
yyval.declarator->params = yystack.l_mark[-1].param_list;
@@ -1754,7 +1757,7 @@ case 84:
}
break;
case 85:
-#line 819 "grammar.y"
+#line 820 "grammar.y"
{
yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin);
yyval.declarator->params = yystack.l_mark[-1].param_list;
@@ -1764,28 +1767,28 @@ case 85:
}
break;
case 86:
-#line 830 "grammar.y"
+#line 831 "grammar.y"
{
- (void)sprintf(yyval.text.text, "*%s", yystack.l_mark[0].text.text);
+ (void)sprintf(yyval.text.text, "*%.*s", TEXT_LEN, yystack.l_mark[0].text.text);
yyval.text.begin = yystack.l_mark[-1].text.begin;
}
break;
case 87:
-#line 835 "grammar.y"
+#line 836 "grammar.y"
{
- (void)sprintf(yyval.text.text, "*%s%s", yystack.l_mark[-1].text.text, yystack.l_mark[0].text.text);
+ (void)sprintf(yyval.text.text, "*%.*s%.*s", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yystack.l_mark[0].text.text);
yyval.text.begin = yystack.l_mark[-2].text.begin;
}
break;
case 88:
-#line 843 "grammar.y"
+#line 844 "grammar.y"
{
strcpy(yyval.text.text, "");
yyval.text.begin = 0L;
}
break;
case 90:
-#line 852 "grammar.y"
+#line 853 "grammar.y"
{
(void)sprintf(yyval.text.text, "%s ", yystack.l_mark[0].decl_spec.text);
yyval.text.begin = yystack.l_mark[0].decl_spec.begin;
@@ -1793,132 +1796,132 @@ case 90:
}
break;
case 91:
-#line 858 "grammar.y"
+#line 859 "grammar.y"
{
- (void)sprintf(yyval.text.text, "%s%s ", yystack.l_mark[-1].text.text, yystack.l_mark[0].decl_spec.text);
+ (void)sprintf(yyval.text.text, "%.*s%.*s ", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yystack.l_mark[0].decl_spec.text);
yyval.text.begin = yystack.l_mark[-1].text.begin;
free(yystack.l_mark[0].decl_spec.text);
}
break;
case 93:
-#line 868 "grammar.y"
+#line 869 "grammar.y"
{
add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, "...");
}
break;
case 94:
-#line 875 "grammar.y"
+#line 876 "grammar.y"
{
new_param_list(&yyval.param_list, yystack.l_mark[0].parameter);
}
break;
case 95:
-#line 879 "grammar.y"
+#line 880 "grammar.y"
{
add_param_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].parameter);
}
break;
case 96:
-#line 886 "grammar.y"
+#line 887 "grammar.y"
{
check_untagged(&yystack.l_mark[-1].decl_spec);
yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator);
}
break;
case 97:
-#line 891 "grammar.y"
+#line 892 "grammar.y"
{
check_untagged(&yystack.l_mark[-1].decl_spec);
yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator);
}
break;
case 98:
-#line 896 "grammar.y"
+#line 897 "grammar.y"
{
check_untagged(&yystack.l_mark[0].decl_spec);
yyval.parameter = new_parameter(&yystack.l_mark[0].decl_spec, (Declarator *)0);
}
break;
case 99:
-#line 904 "grammar.y"
+#line 905 "grammar.y"
{
new_ident_list(&yyval.param_list);
}
break;
case 101:
-#line 912 "grammar.y"
+#line 913 "grammar.y"
{
new_ident_list(&yyval.param_list);
add_ident_list(&yyval.param_list, &yyval.param_list, yystack.l_mark[0].text.text);
}
break;
case 102:
-#line 917 "grammar.y"
+#line 918 "grammar.y"
{
add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].text.text);
}
break;
case 103:
-#line 924 "grammar.y"
+#line 925 "grammar.y"
{
yyval.text = yystack.l_mark[0].text;
}
break;
case 104:
-#line 928 "grammar.y"
+#line 929 "grammar.y"
{
#if OPT_LINTLIBRARY
if (lintLibrary()) { /* Lint doesn't grok C++ ref variables */
yyval.text = yystack.l_mark[0].text;
} else
#endif
- (void)sprintf(yyval.text.text, "&%s", yystack.l_mark[0].text.text);
+ (void)sprintf(yyval.text.text, "&%.*s", TEXT_LEN, yystack.l_mark[0].text.text);
yyval.text.begin = yystack.l_mark[-1].text.begin;
}
break;
case 105:
-#line 941 "grammar.y"
+#line 942 "grammar.y"
{
yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin);
}
break;
case 106:
-#line 945 "grammar.y"
+#line 946 "grammar.y"
{
yyval.declarator = yystack.l_mark[0].declarator;
- (void)sprintf(buf, "%s%s", yystack.l_mark[-1].text.text, yyval.declarator->text);
+ (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yyval.declarator->text);
free(yyval.declarator->text);
yyval.declarator->text = xstrdup(buf);
yyval.declarator->begin = yystack.l_mark[-1].text.begin;
}
break;
case 108:
-#line 957 "grammar.y"
+#line 958 "grammar.y"
{
yyval.declarator = yystack.l_mark[-1].declarator;
- (void)sprintf(buf, "(%s)", yyval.declarator->text);
+ (void)sprintf(buf, "(%.*s)", TEXT_LEN, yyval.declarator->text);
free(yyval.declarator->text);
yyval.declarator->text = xstrdup(buf);
yyval.declarator->begin = yystack.l_mark[-2].text.begin;
}
break;
case 109:
-#line 965 "grammar.y"
+#line 966 "grammar.y"
{
yyval.declarator = yystack.l_mark[-1].declarator;
- (void)sprintf(buf, "%s%s", yyval.declarator->text, yystack.l_mark[0].text.text);
+ (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, yyval.declarator->text, TEXT_LEN, yystack.l_mark[0].text.text);
free(yyval.declarator->text);
yyval.declarator->text = xstrdup(buf);
}
break;
case 110:
-#line 972 "grammar.y"
+#line 973 "grammar.y"
{
yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin);
}
break;
case 111:
-#line 976 "grammar.y"
+#line 977 "grammar.y"
{
yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-3].declarator->begin);
yyval.declarator->params = yystack.l_mark[-1].param_list;
@@ -1928,7 +1931,7 @@ case 111:
}
break;
case 112:
-#line 984 "grammar.y"
+#line 985 "grammar.y"
{
yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-2].declarator->begin);
yyval.declarator->func_stack = yystack.l_mark[-2].declarator;
@@ -1937,7 +1940,7 @@ case 112:
}
break;
case 113:
-#line 991 "grammar.y"
+#line 992 "grammar.y"
{
Declarator *d;
@@ -1950,7 +1953,7 @@ case 113:
}
break;
case 114:
-#line 1002 "grammar.y"
+#line 1003 "grammar.y"
{
Declarator *d;
@@ -1961,7 +1964,7 @@ case 114:
yyval.declarator->func_def = FUNC_ANSI;
}
break;
-#line 1965 "grammar.tab.c"
+#line 1968 "grammar.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/ok_syntax1.tab.c b/test/yacc/ok_syntax1.tab.c
index 0b1267e..c1bbc4f 100644
--- a/test/yacc/ok_syntax1.tab.c
+++ b/test/yacc/ok_syntax1.tab.c
@@ -306,8 +306,9 @@ static const char *const ok_syntax1_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -385,7 +386,7 @@ YYLEX_DECL()
}
return( c );
}
-#line 389 "ok_syntax1.tab.c"
+#line 390 "ok_syntax1.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -452,6 +453,7 @@ YYPARSE_DECL()
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+ int yynerrs;
/* variables for the parser stack */
YYSTACKDATA yystack;
@@ -654,7 +656,7 @@ case 18:
#line 101 "ok_syntax1.y"
{ yyval.ival = (*base) * yystack.l_mark[-1].ival + yystack.l_mark[0].ival; }
break;
-#line 658 "ok_syntax1.tab.c"
+#line 660 "ok_syntax1.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/ok_syntax1.tab.h b/test/yacc/ok_syntax1.tab.h
index 8a51fa0..892b211 100644
--- a/test/yacc/ok_syntax1.tab.h
+++ b/test/yacc/ok_syntax1.tab.h
@@ -27,4 +27,3 @@ typedef union
double dval;
} YYSTYPE;
#endif /* !YYSTYPE_IS_DECLARED */
-extern YYSTYPE ok_syntax1_lval;
diff --git a/test/yacc/pure_calc.tab.c b/test/yacc/pure_calc.tab.c
index 95afec1..ee47ce6 100644
--- a/test/yacc/pure_calc.tab.c
+++ b/test/yacc/pure_calc.tab.c
@@ -285,8 +285,9 @@ static const char *const calc_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -357,7 +358,7 @@ YYLEX_DECL()
}
return( c );
}
-#line 361 "pure_calc.tab.c"
+#line 362 "pure_calc.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -424,6 +425,7 @@ YYPARSE_DECL()
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+ int yynerrs;
/* variables for the parser stack */
YYSTACKDATA yystack;
@@ -626,7 +628,7 @@ case 18:
#line 69 "pure_calc.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 630 "pure_calc.tab.c"
+#line 632 "pure_calc.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/pure_error.tab.c b/test/yacc/pure_error.tab.c
index a52a160..91bbed6 100644
--- a/test/yacc/pure_error.tab.c
+++ b/test/yacc/pure_error.tab.c
@@ -202,8 +202,9 @@ static const char *const error_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -254,7 +255,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 258 "pure_error.tab.c"
+#line 259 "pure_error.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -321,6 +322,7 @@ YYPARSE_DECL()
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+ int yynerrs;
/* variables for the parser stack */
YYSTACKDATA yystack;
diff --git a/test/yacc/quote_calc-s.tab.c b/test/yacc/quote_calc-s.tab.c
index fa8fd00..fa9d703 100644
--- a/test/yacc/quote_calc-s.tab.c
+++ b/test/yacc/quote_calc-s.tab.c
@@ -291,13 +291,15 @@ static const char *const quote_calc_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -365,7 +367,7 @@ yylex(void) {
}
return( c );
}
-#line 369 "quote_calc-s.tab.c"
+#line 371 "quote_calc-s.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -624,7 +626,7 @@ case 18:
#line 70 "quote_calc.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 628 "quote_calc-s.tab.c"
+#line 630 "quote_calc-s.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/quote_calc.tab.c b/test/yacc/quote_calc.tab.c
index c6a1220..3ddf2ff 100644
--- a/test/yacc/quote_calc.tab.c
+++ b/test/yacc/quote_calc.tab.c
@@ -297,13 +297,15 @@ static const char *const quote_calc_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -371,7 +373,7 @@ yylex(void) {
}
return( c );
}
-#line 375 "quote_calc.tab.c"
+#line 377 "quote_calc.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -630,7 +632,7 @@ case 18:
#line 70 "quote_calc.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 634 "quote_calc.tab.c"
+#line 636 "quote_calc.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/quote_calc2-s.tab.c b/test/yacc/quote_calc2-s.tab.c
index 505200e..43d2682 100644
--- a/test/yacc/quote_calc2-s.tab.c
+++ b/test/yacc/quote_calc2-s.tab.c
@@ -291,13 +291,15 @@ static const char *const quote_calc2_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -365,7 +367,7 @@ yylex(void) {
}
return( c );
}
-#line 369 "quote_calc2-s.tab.c"
+#line 371 "quote_calc2-s.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -624,7 +626,7 @@ case 18:
#line 70 "quote_calc2.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 628 "quote_calc2-s.tab.c"
+#line 630 "quote_calc2-s.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/quote_calc2.tab.c b/test/yacc/quote_calc2.tab.c
index 3ff3dd1..1699b7f 100644
--- a/test/yacc/quote_calc2.tab.c
+++ b/test/yacc/quote_calc2.tab.c
@@ -297,13 +297,15 @@ static const char *const quote_calc2_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -371,7 +373,7 @@ yylex(void) {
}
return( c );
}
-#line 375 "quote_calc2.tab.c"
+#line 377 "quote_calc2.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -630,7 +632,7 @@ case 18:
#line 70 "quote_calc2.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 634 "quote_calc2.tab.c"
+#line 636 "quote_calc2.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/quote_calc3-s.tab.c b/test/yacc/quote_calc3-s.tab.c
index 1132ea3..351d530 100644
--- a/test/yacc/quote_calc3-s.tab.c
+++ b/test/yacc/quote_calc3-s.tab.c
@@ -292,13 +292,15 @@ static const char *const quote_calc3_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -366,7 +368,7 @@ yylex(void) {
}
return( c );
}
-#line 370 "quote_calc3-s.tab.c"
+#line 372 "quote_calc3-s.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -625,7 +627,7 @@ case 18:
#line 70 "quote_calc3.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 629 "quote_calc3-s.tab.c"
+#line 631 "quote_calc3-s.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/quote_calc3.tab.c b/test/yacc/quote_calc3.tab.c
index aff287b..7479855 100644
--- a/test/yacc/quote_calc3.tab.c
+++ b/test/yacc/quote_calc3.tab.c
@@ -292,13 +292,15 @@ static const char *const quote_calc3_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -366,7 +368,7 @@ yylex(void) {
}
return( c );
}
-#line 370 "quote_calc3.tab.c"
+#line 372 "quote_calc3.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -625,7 +627,7 @@ case 18:
#line 70 "quote_calc3.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 629 "quote_calc3.tab.c"
+#line 631 "quote_calc3.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/quote_calc4-s.tab.c b/test/yacc/quote_calc4-s.tab.c
index 16a0ebe..d3e6adc 100644
--- a/test/yacc/quote_calc4-s.tab.c
+++ b/test/yacc/quote_calc4-s.tab.c
@@ -292,13 +292,15 @@ static const char *const quote_calc4_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -366,7 +368,7 @@ yylex(void) {
}
return( c );
}
-#line 370 "quote_calc4-s.tab.c"
+#line 372 "quote_calc4-s.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -625,7 +627,7 @@ case 18:
#line 70 "quote_calc4.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 629 "quote_calc4-s.tab.c"
+#line 631 "quote_calc4-s.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/quote_calc4.tab.c b/test/yacc/quote_calc4.tab.c
index e442e1b..db3aef2 100644
--- a/test/yacc/quote_calc4.tab.c
+++ b/test/yacc/quote_calc4.tab.c
@@ -292,13 +292,15 @@ static const char *const quote_calc4_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -366,7 +368,7 @@ yylex(void) {
}
return( c );
}
-#line 370 "quote_calc4.tab.c"
+#line 372 "quote_calc4.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -625,7 +627,7 @@ case 18:
#line 70 "quote_calc4.y"
{ yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
break;
-#line 629 "quote_calc4.tab.c"
+#line 631 "quote_calc4.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/test/yacc/rename_debug.c b/test/yacc/rename_debug.c
index e94d216..909063a 100644
--- a/test/yacc/rename_debug.c
+++ b/test/yacc/rename_debug.c
@@ -66,13 +66,15 @@ static const char *const yyrule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -125,7 +127,7 @@ yyerror(const char* s)
{
printf("%s\n", s);
}
-#line 130 "rename_debug.c"
+#line 132 "rename_debug.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
diff --git a/test/yacc/rename_debug.i b/test/yacc/rename_debug.i
index b7b8014..1e81e02 100644
--- a/test/yacc/rename_debug.i
+++ b/test/yacc/rename_debug.i
@@ -37,6 +37,10 @@ typedef int YYSTYPE;
# define YYLEX yylex()
#endif
+#if !(defined(yylex) || defined(YYSTATE))
+int YYLEX_DECL();
+#endif
+
/* Parameters sent to yyerror. */
#ifndef YYERROR_DECL
#define YYERROR_DECL() yyerror(const char *s)
@@ -47,10 +51,16 @@ typedef int YYSTYPE;
extern int YYPARSE_DECL();
+#ifndef YYDEBUG
+#define YYDEBUG 1
+#endif
+
+#if YYDEBUG
extern int yydebug;
-extern int yynerrs;
+#endif
extern int yyerrflag;
extern int yychar;
extern YYSTYPE yyval;
extern YYSTYPE yylval;
+extern int yynerrs;
diff --git a/test/yacc/varsyntax_calc1.tab.c b/test/yacc/varsyntax_calc1.tab.c
index fe78c83..b66d44f 100644
--- a/test/yacc/varsyntax_calc1.tab.c
+++ b/test/yacc/varsyntax_calc1.tab.c
@@ -324,13 +324,15 @@ static const char *const varsyntax_calc1_rule[] = {
};
#endif
+#if YYDEBUG
int yydebug;
-int yynerrs;
+#endif
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
+int yynerrs;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
@@ -488,7 +490,7 @@ vdiv(double a, double b, INTERVAL v)
{
return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
}
-#line 492 "varsyntax_calc1.tab.c"
+#line 494 "varsyntax_calc1.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -850,7 +852,7 @@ case 28:
yyval.vval = yystack.l_mark[-1].vval;
}
break;
-#line 854 "varsyntax_calc1.tab.c"
+#line 856 "varsyntax_calc1.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;