svn commit: r262960 - head/tools/regression/usr.bin/yacc

Julio Merino jmmv at FreeBSD.org
Sun Mar 9 22:05:25 UTC 2014


Author: jmmv
Date: Sun Mar  9 22:05:23 2014
New Revision: 262960
URL: http://svnweb.freebsd.org/changeset/base/262960

Log:
  Fix yacc tests so that they run cleanly with prove.
  
  First, change the driver to run the installed yacc instead of the one from
  /usr/obj (which might not be there), just as we (intend to) do with all
  other tests.
  
  Second, regenerate the expected output files from scratch.  Based on visual
  inspection, the differences seem OK.  But this highlights that the tests in
  here are too fragile and, possibly, useless: we should be testing the
  behavior of the generated program, not the literal output.  Something to be
  addressed later.

Modified:
  head/tools/regression/usr.bin/yacc/regress.00.out
  head/tools/regression/usr.bin/yacc/regress.01.out
  head/tools/regression/usr.bin/yacc/regress.02.out
  head/tools/regression/usr.bin/yacc/regress.03.out
  head/tools/regression/usr.bin/yacc/regress.04.out
  head/tools/regression/usr.bin/yacc/regress.05.out
  head/tools/regression/usr.bin/yacc/regress.06.out
  head/tools/regression/usr.bin/yacc/regress.07.out
  head/tools/regression/usr.bin/yacc/regress.08.out
  head/tools/regression/usr.bin/yacc/regress.09.out
  head/tools/regression/usr.bin/yacc/regress.10.out
  head/tools/regression/usr.bin/yacc/regress.11.out
  head/tools/regression/usr.bin/yacc/regress.12.out
  head/tools/regression/usr.bin/yacc/regress.13.out
  head/tools/regression/usr.bin/yacc/regress.14.out
  head/tools/regression/usr.bin/yacc/regress.sh

Modified: head/tools/regression/usr.bin/yacc/regress.00.out
==============================================================================
--- head/tools/regression/usr.bin/yacc/regress.00.out	Sun Mar  9 21:56:29 2014	(r262959)
+++ head/tools/regression/usr.bin/yacc/regress.00.out	Sun Mar  9 22:05:23 2014	(r262960)
@@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc
 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
+#define YYPATCH 20140101
 
 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
@@ -77,10 +78,11 @@ static const short yycheck[] = {        
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 0
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
 #if YYDEBUG
 static const char *yyname[] = {
 
-"end-of-file",
+"end-of-file","illegal-symbol",
 };
 static const char *yyrule[] = {
 "$accept : rule",
@@ -105,12 +107,12 @@ YYSTYPE  yylval;
 #ifdef YYMAXDEPTH
 #define YYSTACKSIZE YYMAXDEPTH
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH  500
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH  10000
 #endif
 #endif
 
-#define YYINITSTACKSIZE 500
+#define YYINITSTACKSIZE 200
 
 typedef struct {
     unsigned stacksize;
@@ -145,7 +147,7 @@ static int yygrowstack(YYSTACKDATA *data
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;
 
-    i = data->s_mark - data->s_base;
+    i = (int) (data->s_mark - data->s_base);
     newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
         return -1;
@@ -219,9 +221,7 @@ yyloop:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, reading %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -303,9 +303,7 @@ yyinrecovery:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -348,9 +346,7 @@ yyreduce:
 #if YYDEBUG
             if (yydebug)
             {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
+                yys = yyname[YYTRANSLATE(yychar)];
                 printf("%sdebug: state %d, reading %d (%s)\n",
                         YYPREFIX, YYFINAL, yychar, yys);
             }

Modified: head/tools/regression/usr.bin/yacc/regress.01.out
==============================================================================
--- head/tools/regression/usr.bin/yacc/regress.01.out	Sun Mar  9 21:56:29 2014	(r262959)
+++ head/tools/regression/usr.bin/yacc/regress.01.out	Sun Mar  9 22:05:23 2014	(r262960)
@@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc
 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
+#define YYPATCH 20140101
 
 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
@@ -25,7 +26,7 @@ int base;
 extern int yylex(void);
 static void yyerror(const char *s);
 
-#line 28 "/dev/stdout"
+#line 29 "/dev/stdout"
 
 #ifndef YYSTYPE
 typedef int YYSTYPE;
@@ -152,6 +153,7 @@ static const short yycheck[] = {        
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 259
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
 #if YYDEBUG
 static const char *yyname[] = {
 
@@ -162,7 +164,7 @@ static const char *yyname[] = {
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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",
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol",
 };
 static const char *yyrule[] = {
 "$accept : list",
@@ -204,12 +206,12 @@ YYSTYPE  yylval;
 #ifdef YYMAXDEPTH
 #define YYSTACKSIZE YYMAXDEPTH
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH  500
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH  10000
 #endif
 #endif
 
-#define YYINITSTACKSIZE 500
+#define YYINITSTACKSIZE 200
 
 typedef struct {
     unsigned stacksize;
@@ -263,7 +265,7 @@ yylex(void)
     }
     return( c );
 }
-#line 266 "/dev/stdout"
+#line 267 "/dev/stdout"
 
 #if YYDEBUG
 #include <stdio.h>		/* needed for printf */
@@ -287,7 +289,7 @@ static int yygrowstack(YYSTACKDATA *data
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;
 
-    i = data->s_mark - data->s_base;
+    i = (int) (data->s_mark - data->s_base);
     newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
         return -1;
@@ -361,9 +363,7 @@ yyloop:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, reading %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -445,9 +445,7 @@ yyinrecovery:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -529,7 +527,7 @@ case 18:
 #line 63 "calc.y"
 	{  yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
 break;
-#line 532 "/dev/stdout"
+#line 529 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -551,9 +549,7 @@ break;
 #if YYDEBUG
             if (yydebug)
             {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
+                yys = yyname[YYTRANSLATE(yychar)];
                 printf("%sdebug: state %d, reading %d (%s)\n",
                         YYPREFIX, YYFINAL, yychar, yys);
             }

Modified: head/tools/regression/usr.bin/yacc/regress.02.out
==============================================================================
--- head/tools/regression/usr.bin/yacc/regress.02.out	Sun Mar  9 21:56:29 2014	(r262959)
+++ head/tools/regression/usr.bin/yacc/regress.02.out	Sun Mar  9 22:05:23 2014	(r262960)
@@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc
 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
+#define YYPATCH 20140101
 
 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
@@ -55,7 +56,7 @@ typedef union
 	INTERVAL vval;
 } YYSTYPE;
 #endif /* !YYSTYPE_IS_DECLARED */
-#line 58 "/dev/stdout"
+#line 59 "/dev/stdout"
 
 /* compatibility with bison */
 #ifdef YYPARSE_PARAM
@@ -192,6 +193,7 @@ static const short yycheck[] = {        
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 260
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
 #if YYDEBUG
 static const char *yyname[] = {
 
@@ -202,7 +204,7 @@ static const char *yyname[] = {
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,"DREG","VREG","CONST","UMINUS",
+0,0,"DREG","VREG","CONST","UMINUS","illegal-symbol",
 };
 static const char *yyrule[] = {
 "$accept : line",
@@ -254,12 +256,12 @@ YYSTYPE  yylval;
 #ifdef YYMAXDEPTH
 #define YYSTACKSIZE YYMAXDEPTH
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH  500
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH  10000
 #endif
 #endif
 
-#define YYINITSTACKSIZE 500
+#define YYINITSTACKSIZE 200
 
 typedef struct {
     unsigned stacksize;
@@ -402,7 +404,7 @@ vdiv(double a, double b, INTERVAL v)
 {
     return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
 }
-#line 405 "/dev/stdout"
+#line 406 "/dev/stdout"
 
 #if YYDEBUG
 #include <stdio.h>		/* needed for printf */
@@ -426,7 +428,7 @@ static int yygrowstack(YYSTACKDATA *data
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;
 
-    i = data->s_mark - data->s_base;
+    i = (int) (data->s_mark - data->s_base);
     newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
         return -1;
@@ -500,9 +502,7 @@ yyloop:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, reading %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -584,9 +584,7 @@ yyinrecovery:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -771,7 +769,7 @@ case 28:
 		yyval.vval = yystack.l_mark[-1].vval;
 	}
 break;
-#line 774 "/dev/stdout"
+#line 771 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -793,9 +791,7 @@ break;
 #if YYDEBUG
             if (yydebug)
             {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
+                yys = yyname[YYTRANSLATE(yychar)];
                 printf("%sdebug: state %d, reading %d (%s)\n",
                         YYPREFIX, YYFINAL, yychar, yys);
             }

Modified: head/tools/regression/usr.bin/yacc/regress.03.out
==============================================================================
--- head/tools/regression/usr.bin/yacc/regress.03.out	Sun Mar  9 21:56:29 2014	(r262959)
+++ head/tools/regression/usr.bin/yacc/regress.03.out	Sun Mar  9 22:05:23 2014	(r262960)
@@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc
 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
+#define YYPATCH 20140101
 
 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
@@ -28,7 +29,7 @@ int YYLEX_DECL();
 static void YYERROR_DECL();
 #endif
 
-#line 31 "/dev/stdout"
+#line 32 "/dev/stdout"
 
 #ifndef YYSTYPE
 typedef int YYSTYPE;
@@ -159,6 +160,7 @@ static const short yycheck[] = {        
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 259
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
 #if YYDEBUG
 static const char *yyname[] = {
 
@@ -169,7 +171,7 @@ static const char *yyname[] = {
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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",
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol",
 };
 static const char *yyrule[] = {
 "$accept : list",
@@ -206,12 +208,12 @@ int      yynerrs;
 #ifdef YYMAXDEPTH
 #define YYSTACKSIZE YYMAXDEPTH
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH  500
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH  10000
 #endif
 #endif
 
-#define YYINITSTACKSIZE 500
+#define YYINITSTACKSIZE 200
 
 typedef struct {
     unsigned stacksize;
@@ -270,7 +272,7 @@ YYLEX_DECL()
     }
     return( c );
 }
-#line 273 "/dev/stdout"
+#line 274 "/dev/stdout"
 
 #if YYDEBUG
 #include <stdio.h>		/* needed for printf */
@@ -294,7 +296,7 @@ static int yygrowstack(YYSTACKDATA *data
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;
 
-    i = data->s_mark - data->s_base;
+    i = (int) (data->s_mark - data->s_base);
     newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
         return -1;
@@ -375,9 +377,7 @@ yyloop:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, reading %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -459,9 +459,7 @@ yyinrecovery:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -543,7 +541,7 @@ case 18:
 #line 73 "calc3.y"
 	{  yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; }
 break;
-#line 546 "/dev/stdout"
+#line 543 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -565,9 +563,7 @@ break;
 #if YYDEBUG
             if (yydebug)
             {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
+                yys = yyname[YYTRANSLATE(yychar)];
                 printf("%sdebug: state %d, reading %d (%s)\n",
                         YYPREFIX, YYFINAL, yychar, yys);
             }

Modified: head/tools/regression/usr.bin/yacc/regress.04.out
==============================================================================
--- head/tools/regression/usr.bin/yacc/regress.04.out	Sun Mar  9 21:56:29 2014	(r262959)
+++ head/tools/regression/usr.bin/yacc/regress.04.out	Sun Mar  9 22:05:23 2014	(r262960)
@@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc
 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
+#define YYPATCH 20140101
 
 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
@@ -27,7 +28,7 @@ int yylex(void);
 static void yyerror(const char *s);
 #endif
 
-#line 30 "/dev/stdout"
+#line 31 "/dev/stdout"
 
 #ifndef YYSTYPE
 typedef int YYSTYPE;
@@ -154,6 +155,7 @@ static const short yycheck[] = {        
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 259
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
 #if YYDEBUG
 static const char *yyname[] = {
 
@@ -164,7 +166,7 @@ static const char *yyname[] = {
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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",
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol",
 };
 static const char *yyrule[] = {
 "$accept : list",
@@ -206,12 +208,12 @@ YYSTYPE  yylval;
 #ifdef YYMAXDEPTH
 #define YYSTACKSIZE YYMAXDEPTH
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH  500
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH  10000
 #endif
 #endif
 
-#define YYINITSTACKSIZE 500
+#define YYINITSTACKSIZE 200
 
 typedef struct {
     unsigned stacksize;
@@ -269,7 +271,7 @@ yylex(void)
     }
     return( c );
 }
-#line 272 "/dev/stdout"
+#line 273 "/dev/stdout"
 
 #if YYDEBUG
 #include <stdio.h>		/* needed for printf */
@@ -293,7 +295,7 @@ static int yygrowstack(YYSTACKDATA *data
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;
 
-    i = data->s_mark - data->s_base;
+    i = (int) (data->s_mark - data->s_base);
     newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
         return -1;
@@ -367,9 +369,7 @@ yyloop:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, reading %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -451,9 +451,7 @@ yyinrecovery:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -535,7 +533,7 @@ case 18:
 #line 65 "code_calc.y"
 	{  yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
 break;
-#line 538 "/dev/stdout"
+#line 535 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -557,9 +555,7 @@ break;
 #if YYDEBUG
             if (yydebug)
             {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
+                yys = yyname[YYTRANSLATE(yychar)];
                 printf("%sdebug: state %d, reading %d (%s)\n",
                         YYPREFIX, YYFINAL, yychar, yys);
             }

Modified: head/tools/regression/usr.bin/yacc/regress.05.out
==============================================================================
--- head/tools/regression/usr.bin/yacc/regress.05.out	Sun Mar  9 21:56:29 2014	(r262959)
+++ head/tools/regression/usr.bin/yacc/regress.05.out	Sun Mar  9 22:05:23 2014	(r262960)
@@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc
 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
+#define YYPATCH 20140101
 
 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
@@ -22,7 +23,7 @@ int yylex(void);
 static void yyerror(const char *);
 #endif
 
-#line 25 "/dev/stdout"
+#line 26 "/dev/stdout"
 
 #ifndef YYSTYPE
 typedef int YYSTYPE;
@@ -89,10 +90,11 @@ static const short yycheck[] = {        
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 0
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
 #if YYDEBUG
 static const char *yyname[] = {
 
-"end-of-file",
+"end-of-file","illegal-symbol",
 };
 static const char *yyrule[] = {
 "$accept : S",
@@ -117,12 +119,12 @@ YYSTYPE  yylval;
 #ifdef YYMAXDEPTH
 #define YYSTACKSIZE YYMAXDEPTH
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH  500
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH  10000
 #endif
 #endif
 
-#define YYINITSTACKSIZE 500
+#define YYINITSTACKSIZE 200
 
 typedef struct {
     unsigned stacksize;
@@ -160,7 +162,7 @@ yyerror(const char* s)
 {
     printf("%s\n", s);
 }
-#line 163 "/dev/stdout"
+#line 164 "/dev/stdout"
 
 #if YYDEBUG
 #include <stdio.h>		/* needed for printf */
@@ -184,7 +186,7 @@ static int yygrowstack(YYSTACKDATA *data
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;
 
-    i = data->s_mark - data->s_base;
+    i = (int) (data->s_mark - data->s_base);
     newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
         return -1;
@@ -258,9 +260,7 @@ yyloop:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, reading %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -342,9 +342,7 @@ yyinrecovery:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -387,9 +385,7 @@ yyreduce:
 #if YYDEBUG
             if (yydebug)
             {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
+                yys = yyname[YYTRANSLATE(yychar)];
                 printf("%sdebug: state %d, reading %d (%s)\n",
                         YYPREFIX, YYFINAL, yychar, yys);
             }

Modified: head/tools/regression/usr.bin/yacc/regress.06.out
==============================================================================
--- head/tools/regression/usr.bin/yacc/regress.06.out	Sun Mar  9 21:56:29 2014	(r262959)
+++ head/tools/regression/usr.bin/yacc/regress.06.out	Sun Mar  9 22:05:23 2014	(r262960)
@@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc
 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
+#define YYPATCH 20140101
 
 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
@@ -18,7 +19,7 @@ static const char yysccsid[] = "@(#)yacc
 #line 2 "error.y"
 int yylex(void);
 static void yyerror(const char *);
-#line 21 "/dev/stdout"
+#line 22 "/dev/stdout"
 
 #ifndef YYSTYPE
 typedef int YYSTYPE;
@@ -85,10 +86,11 @@ static const short yycheck[] = {        
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 0
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
 #if YYDEBUG
 static const char *yyname[] = {
 
-"end-of-file",
+"end-of-file","illegal-symbol",
 };
 static const char *yyrule[] = {
 "$accept : S",
@@ -113,12 +115,12 @@ YYSTYPE  yylval;
 #ifdef YYMAXDEPTH
 #define YYSTACKSIZE YYMAXDEPTH
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH  500
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH  10000
 #endif
 #endif
 
-#define YYINITSTACKSIZE 500
+#define YYINITSTACKSIZE 200
 
 typedef struct {
     unsigned stacksize;
@@ -152,7 +154,7 @@ yyerror(const char* s)
 {
     printf("%s\n", s);
 }
-#line 155 "/dev/stdout"
+#line 156 "/dev/stdout"
 
 #if YYDEBUG
 #include <stdio.h>		/* needed for printf */
@@ -176,7 +178,7 @@ static int yygrowstack(YYSTACKDATA *data
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;
 
-    i = data->s_mark - data->s_base;
+    i = (int) (data->s_mark - data->s_base);
     newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
         return -1;
@@ -250,9 +252,7 @@ yyloop:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, reading %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -334,9 +334,7 @@ yyinrecovery:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -379,9 +377,7 @@ yyreduce:
 #if YYDEBUG
             if (yydebug)
             {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
+                yys = yyname[YYTRANSLATE(yychar)];
                 printf("%sdebug: state %d, reading %d (%s)\n",
                         YYPREFIX, YYFINAL, yychar, yys);
             }

Modified: head/tools/regression/usr.bin/yacc/regress.07.out
==============================================================================
--- head/tools/regression/usr.bin/yacc/regress.07.out	Sun Mar  9 21:56:29 2014	(r262959)
+++ head/tools/regression/usr.bin/yacc/regress.07.out	Sun Mar  9 22:05:23 2014	(r262960)
@@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc
 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
+#define YYPATCH 20140101
 
 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
@@ -114,7 +115,7 @@ yyerror(const char *msg)
 {
 	perror(msg);
 }
-#line 117 "/dev/stdout"
+#line 118 "/dev/stdout"
 
 #ifndef YYSTYPE
 typedef int YYSTYPE;
@@ -357,6 +358,7 @@ static const short yycheck[] = {        
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 319
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
 #if YYDEBUG
 static const char *yyname[] = {
 
@@ -372,6 +374,7 @@ static const char *yyname[] = {
 "MAIL","MSND","MSOM","MSAM","MRSQ","MRCP","ALLO","REST","RNFR","RNTO","ABOR",
 "DELE","CWD","LIST","NLST","SITE","STAT","HELP","NOOP","MKD","RMD","PWD","CDUP",
 "STOU","SMNT","SYST","SIZE","MDTM","UMASK","IDLE","CHMOD","LEXERR",
+"illegal-symbol",
 };
 static const char *yyrule[] = {
 "$accept : cmd_list",
@@ -468,12 +471,12 @@ YYSTYPE  yylval;
 #ifdef YYMAXDEPTH
 #define YYSTACKSIZE YYMAXDEPTH
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH  500
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH  10000
 #endif
 #endif
 
-#define YYINITSTACKSIZE 500
+#define YYINITSTACKSIZE 200
 
 typedef struct {
     unsigned stacksize;
@@ -1008,7 +1011,7 @@ sizecmd(char *filename)
 		reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]);
 	}
 }
-#line 1011 "/dev/stdout"
+#line 1013 "/dev/stdout"
 
 #if YYDEBUG
 #include <stdio.h>		/* needed for printf */
@@ -1032,7 +1035,7 @@ static int yygrowstack(YYSTACKDATA *data
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;
 
-    i = data->s_mark - data->s_base;
+    i = (int) (data->s_mark - data->s_base);
     newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
         return -1;
@@ -1106,9 +1109,7 @@ yyloop:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, reading %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -1190,9 +1191,7 @@ yyinrecovery:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -1851,7 +1850,7 @@ case 73:
 		}
 	}
 break;
-#line 1854 "/dev/stdout"
+#line 1852 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -1873,9 +1872,7 @@ break;
 #if YYDEBUG
             if (yydebug)
             {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
+                yys = yyname[YYTRANSLATE(yychar)];
                 printf("%sdebug: state %d, reading %d (%s)\n",
                         YYPREFIX, YYFINAL, yychar, yys);
             }

Modified: head/tools/regression/usr.bin/yacc/regress.08.out
==============================================================================
--- head/tools/regression/usr.bin/yacc/regress.08.out	Sun Mar  9 21:56:29 2014	(r262959)
+++ head/tools/regression/usr.bin/yacc/regress.08.out	Sun Mar  9 22:05:23 2014	(r262960)
@@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc
 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
+#define YYPATCH 20140101
 
 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
@@ -302,7 +303,7 @@ haveAnsiParam (void)
     }
     return FALSE;
 }
-#line 305 "/dev/stdout"
+#line 306 "/dev/stdout"
 
 /* compatibility with bison */
 #ifdef YYPARSE_PARAM
@@ -660,6 +661,7 @@ static const short yycheck[] = {        
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 291
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
 #if YYDEBUG
 static const char *yyname[] = {
 
@@ -676,6 +678,7 @@ static const char *yyname[] = {
 "T_UNSIGNED","T_ENUM","T_STRUCT","T_UNION","T_Bool","T_Complex","T_Imaginary",
 "T_TYPE_QUALIFIER","T_BRACKETS","T_LBRACE","T_MATCHRBRACE","T_ELLIPSIS",
 "T_INITIALIZER","T_STRING_LITERAL","T_ASM","T_ASMARG","T_VA_DCL",
+"illegal-symbol",
 };
 static const char *yyrule[] = {
 "$accept : program",
@@ -813,12 +816,12 @@ YYSTYPE  yylval;
 #ifdef YYMAXDEPTH
 #define YYSTACKSIZE YYMAXDEPTH
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH  500
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH  10000
 #endif
 #endif
 
-#define YYINITSTACKSIZE 500
+#define YYINITSTACKSIZE 200
 
 typedef struct {
     unsigned stacksize;
@@ -1001,7 +1004,7 @@ free_parser(void)
 #endif
 }
 #endif
-#line 1004 "/dev/stdout"
+#line 1006 "/dev/stdout"
 
 #if YYDEBUG
 #include <stdio.h>		/* needed for printf */
@@ -1025,7 +1028,7 @@ static int yygrowstack(YYSTACKDATA *data
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;
 
-    i = data->s_mark - data->s_base;
+    i = (int) (data->s_mark - data->s_base);
     newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
         return -1;
@@ -1099,9 +1102,7 @@ yyloop:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, reading %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -1183,9 +1184,7 @@ yyinrecovery:
 #if YYDEBUG
         if (yydebug)
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
+            yys = yyname[YYTRANSLATE(yychar)];
             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                     YYPREFIX, yystate, yychar, yys);
         }
@@ -1881,7 +1880,7 @@ case 114:
 	    yyval.declarator->func_def = FUNC_ANSI;
 	}
 break;
-#line 1884 "/dev/stdout"
+#line 1882 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -1903,9 +1902,7 @@ break;
 #if YYDEBUG
             if (yydebug)
             {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
+                yys = yyname[YYTRANSLATE(yychar)];
                 printf("%sdebug: state %d, reading %d (%s)\n",
                         YYPREFIX, YYFINAL, yychar, yys);
             }

Modified: head/tools/regression/usr.bin/yacc/regress.09.out
==============================================================================
--- head/tools/regression/usr.bin/yacc/regress.09.out	Sun Mar  9 21:56:29 2014	(r262959)
+++ head/tools/regression/usr.bin/yacc/regress.09.out	Sun Mar  9 22:05:23 2014	(r262960)
@@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc
 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
+#define YYPATCH 20140101
 
 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
@@ -31,7 +32,7 @@ int YYLEX_DECL();
 static void YYERROR_DECL();
 #endif
 
-#line 34 "/dev/stdout"
+#line 35 "/dev/stdout"
 
 #ifndef YYSTYPE
 typedef int YYSTYPE;
@@ -158,6 +159,7 @@ static const short yycheck[] = {        
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 259
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
 #if YYDEBUG
 static const char *yyname[] = {
 
@@ -168,7 +170,7 @@ static const char *yyname[] = {
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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",
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol",
 };
 static const char *yyrule[] = {
 "$accept : list",
@@ -210,12 +212,12 @@ YYSTYPE  yylval;
 #ifdef YYMAXDEPTH
 #define YYSTACKSIZE YYMAXDEPTH
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH  500
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH  10000
 #endif
 #endif
 
-#define YYINITSTACKSIZE 500
+#define YYINITSTACKSIZE 200
 
 typedef struct {

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-head mailing list