bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNU Bison 1.875b] testsuite: 117 failed


From: Bruce Lilly
Subject: Re: [GNU Bison 1.875b] testsuite: 117 failed
Date: Tue, 15 Jul 2003 07:29:14 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624

Paul Eggert wrote:
Bruce Lilly <address@hidden> writes:


117. glr-regression.at:117: testing Improper handling of embedded actions and 
hN in GLR parsers...
glr-regression.at:206: bison -o glr-regr2a.c glr-regr2a.y
glr-regression.at:207: $CC $CFLAGS $CPPFLAGS $LDFLAGS glr-regr2a.c $LIBS -o 
glr-regr2a
stderr:
glr-regression.at:211: echo s VARIABLE_1 t v x q | ./glr-regr2a
--- -   Mon Jul 14 00:00:23 2003
+++ /d/temp/bison/bison/tests/testsuite.dir/at-stdout   Mon Jul 14 00:00:23 2003
@@ -1,2 +1,2 @@
-Variable: 'VARIABLE_1'
+syntax error



OK, thanks.  To help isolate the problem, first let's check whether
Bison is generating the wrong parser, or if there's some problem in
compiling and running that the parser.  When I run the following
commands:

cd tests
./testsuite -v -d 117

I get the following file in tests/testsuite.dir/117/glr-regr2a.c.
Is that the same file that you get?

Not exactly.  Ignoring differences in whitespace, the contexts diffs
are attached.  Test output was:

## ---------------------------- ##
## GNU Bison 1.875b test suite. ##
## ---------------------------- ##
117. glr-regression.at:117: testing Improper handling of embedded actions and 
hN in GLR parsers...
glr-regression.at:206: bison -o glr-regr2a.c glr-regr2a.y
glr-regression.at:207: $CC $CFLAGS $CPPFLAGS $LDFLAGS glr-regr2a.c $LIBS -o 
glr-regr2a
stderr:
glr-regression.at:211: echo s VARIABLE_1 t v x q | ./glr-regr2a
--- -   Tue Jul 15 06:50:07 2003
+++ /d/temp/bison/bison-1.875b/tests/testsuite.dir/at-stdout    Tue Jul 15 
06:50:06 2003
@@ -1,2 +1,2 @@
-Variable: 'VARIABLE_1'
+syntax error

glr-regression.at:211: exit code was 1, expected 0
117. glr-regression.at:117: FAILED near `glr-regression.at:211'


The "syntax error" is the output of the generated executable.
*** glr-regr2a.c.eggert Tue Jul 15 06:48:14 2003
--- testsuite.dir/117/glr-regr2a.c      Tue Jul 15 06:50:02 2003
***************
*** 89,94 ****
--- 89,96 ----
  typedef struct YYLTYPE
  {
  
+   char yydummy;
+ 
  } YYLTYPE;
  # define YYLTYPE_IS_DECLARED 1
  # define YYLTYPE_IS_TRIVIAL 1
***************
*** 105,112 ****
  /* Copy the second part of user declarations.  */
  
  
! /* Line 217 of glr.c.  */
! #line 110 "glr-regr2a.c"
  
  #ifdef __cplusplus
     typedef bool yybool;
--- 107,114 ----
  /* Copy the second part of user declarations.  */
  
  
! /* Line 219 of glr.c.  */
! #line 112 "glr-regr2a.c"
  
  #ifdef __cplusplus
     typedef bool yybool;
***************
*** 333,339 ****
  
  
  #ifndef YYLLOC_DEFAULT
! # define YYLLOC_DEFAULT(yyCurrent, yyRhs, YYN) 
  #endif
  
  
--- 335,341 ----
  
  
  #ifndef YYLLOC_DEFAULT
! # define YYLLOC_DEFAULT(yyCurrent, yyRhs, YYN) ((void) 0)
  #endif
  
  
***************
*** 612,618 ****
  # undef YYABORT
  # define YYABORT return yyabort
  # undef YYERROR
! # define YYERROR do { yystack->yyerrState = 0; return yyerr; } while (0)
  # undef YYRECOVERING
  # define YYRECOVERING (yystack->yyerrState != 0)
  # undef yyclearin
--- 614,620 ----
  # undef YYABORT
  # define YYABORT return yyabort
  # undef YYERROR
! # define YYERROR return yyerrok, yyerr
  # undef YYRECOVERING
  # define YYRECOVERING (yystack->yyerrState != 0)
  # undef yyclearin
***************
*** 621,630 ****
  # define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal)
  # undef YYBACKUP
  # define YYBACKUP(Token, Value)                                               
     \
!   do {                                                                        
     \
!     yyerror ("syntax error: cannot back up");              \
!     YYERROR;                                                               \
!   } while (0)
  
    yylow = 1;
    if (yyrhslen == 0)
--- 623,630 ----
  # define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal)
  # undef YYBACKUP
  # define YYBACKUP(Token, Value)                                               
     \
!   return yyerror ("syntax error: cannot back up"),         \
!        yyerrok, yyerr
  
    yylow = 1;
    if (yyrhslen == 0)
***************
*** 997,1003 ****
          yystack->yytops.yystates[yyj] = yystack->yytops.yystates[yyi];
          if (yyj != yyi)
            {
!             YYDPRINTF ((stderr, "Rename stack %d -> %d.\n", yyi, yyj));
            }
          yyj += 1;
        }
--- 997,1004 ----
          yystack->yytops.yystates[yyj] = yystack->yytops.yystates[yyi];
          if (yyj != yyi)
            {
!             YYDPRINTF ((stderr, "Rename stack %lu -> %lu.\n",
!                         (unsigned long int) yyi, (unsigned long int) yyj));
            }
          yyj += 1;
        }
***************
*** 1111,1119 ****
  yy_reduce_print (size_t yyk, yyRuleNum yyrule)
  {
    int yyi;
!   unsigned int yylno = yyrline[yyrule];
!   YYFPRINTF (stderr, "Reducing stack %d by rule %d (line %u), ",
!            yyk, yyrule - 1, yylno);
    /* Print the symbols being reduced, and their result.  */
    for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
      YYFPRINTF (stderr, "%s ", yytokenName (yyrhs[yyi]));
--- 1112,1120 ----
  yy_reduce_print (size_t yyk, yyRuleNum yyrule)
  {
    int yyi;
!   YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu), ",
!            (unsigned long int) yyk, yyrule - 1,
!            (unsigned long int) yyrline[yyrule]);
    /* Print the symbols being reduced, and their result.  */
    for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
      YYFPRINTF (stderr, "%s ", yytokenName (yyrhs[yyi]));
***************
*** 1167,1175 ****
        yyupdateSplit (yystack, yys);
        yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));
        YYDPRINTF ((stderr,
!                 "Reduced stack %d by rule #%d; action deferred. "
                  "Now in state %d.\n",
!                 yyk, yyrule-1, yynewLRState));
        for (yyi = 0; yyi < yystack->yytops.yysize; yyi += 1)
        if (yyi != yyk && yystack->yytops.yystates[yyi] != NULL)
          {
--- 1168,1176 ----
        yyupdateSplit (yystack, yys);
        yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));
        YYDPRINTF ((stderr,
!                 "Reduced stack %lu by rule #%d; action deferred. "
                  "Now in state %d.\n",
!                 (unsigned long int) yyk, yyrule - 1, yynewLRState));
        for (yyi = 0; yyi < yystack->yytops.yysize; yyi += 1)
        if (yyi != yyk && yystack->yytops.yystates[yyi] != NULL)
          {
***************
*** 1181,1188 ****
                  {
                    yyaddDeferredAction (yystack, yyp, yys0, yyrule);
                    yymarkStackDeleted (yystack, yyk);
!                   YYDPRINTF ((stderr, "Merging stack %d into stack %d.\n",
!                               yyk, yyi));
                    return yyok;
                  }
                yyp = yyp->yypred;
--- 1182,1190 ----
                  {
                    yyaddDeferredAction (yystack, yyp, yys0, yyrule);
                    yymarkStackDeleted (yystack, yyk);
!                   YYDPRINTF ((stderr, "Merging stack %lu into stack %lu.\n",
!                               (unsigned long int) yyk,
!                               (unsigned long int) yyi));
                    return yyok;
                  }
                yyp = yyp->yypred;
***************
*** 1356,1364 ****
               yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
               yyx->yyrule);
    else
!     YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %d .. %d>\n",
               yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
!              yyx->yyrule, yys->yyposn+1, yyx->yystate->yyposn);
    for (yyi = 1; yyi <= yynrhs; yyi += 1)
      {
        if (yystates[yyi]->yyresolved)
--- 1358,1367 ----
               yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
               yyx->yyrule);
    else
!     YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %lu .. %lu>\n",
               yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
!              yyx->yyrule, (unsigned long int) (yys->yyposn + 1),
!              (unsigned long int) yyx->yystate->yyposn);
    for (yyi = 1; yyi <= yynrhs; yyi += 1)
      {
        if (yystates[yyi]->yyresolved)
***************
*** 1367,1375 ****
            YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
                       yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]));
          else
!           YYFPRINTF (stderr, "%*s%s <tokens %d .. %d>\n", yyindent+2, "",
                       yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]),
!                      yystates[yyi-1]->yyposn+1, yystates[yyi]->yyposn);
        }
        else
        yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2);
--- 1370,1379 ----
            YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
                       yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]));
          else
!           YYFPRINTF (stderr, "%*s%s <tokens %lu .. %lu>\n", yyindent+2, "",
                       yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]),
!                      (unsigned long int) (yystates[yyi - 1]->yyposn + 1),
!                      (unsigned long int) yystates[yyi]->yyposn);
        }
        else
        yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]