[Top][All Lists]

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

Bug in compatibility mode

From: Julien LEMOINE
Subject: Bug in compatibility mode
Date: Tue, 19 Feb 2002 17:03:47 +0100

        there is a bug in yacc emulation mode, the original bug report is 
on debian bug tracking system : 

I made a patch for this bug, but I am not sure that it does not create 
another problem.

here is the patch :
diff -bBdNrw -U5 bison-1.33-orig/src/reader.c bison-1.33/src/reader.c
--- bison-1.33-orig/src/reader.c        Thu Feb  7 18:12:44 2002
+++ bison-1.33/src/reader.c     Tue Feb 19 15:38:37 2002
@@ -1142,13 +1142,13 @@

   /* As a Bison extension, add the ending semicolon.  Since some Yacc
      don't do that, help people using bison as a Yacc finding their
      missing semicolons.  */
-  if (yacc_flag)
+  /*if (yacc_flag)
     obstack_sgrow (&action_obstack, "}\n    break;");
-  else
+    else*/
     obstack_sgrow (&action_obstack, ";\n    break;}");

 | After `%guard' is seen in the input file, copy the actual guard    |

here is the problem description :
$ cat test.yy
#include "stdio.h"

%token PARAMS


ocr: PARAMS {printf("params\n")}  '{' /*...*/ '}'


extern char *yytext;
int yyerror(char *err)
  fprintf(stderr, "%s at %s\n", err, yytext);
$bison -y test.yy
$gcc -c y.tab.c
test.yy: In function `yyparse':
test.yy:10: parse error before `}'
please Cc me replies, thanks.
Julien LEMOINE / SpeedBlue

reply via email to

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