bison-patches
[Top][All Lists]
Advanced

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

Re: bison atat


From: Paul Eggert
Subject: Re: bison atat
Date: Thu, 13 Oct 2005 12:41:32 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden writes:

> minor flaw in handling of @@ in bison current cvs version?
>
> something like  `@@$.start.file' does not generate
> warning message and non-compilable output is written.
>
> should this be seen as a bug?

I wouldn't call it a bug, since Bison isn't responsible for checking C
syntax.  However, Bison should warn if it sees '@' or '$' that is just
being copied through, since it's probably an error and it may run
afoul of future extensions we're thinking of.

I installed this patch.  Thanks for reporting the problem.

2005-10-13  Paul Eggert  <address@hidden>

        * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
        * src/scan-gram.l (<SC_BRACED_CODE>address@hidden): Implement this.

--- NEWS        5 Oct 2005 06:57:16 -0000       1.128
+++ NEWS        13 Oct 2005 19:35:51 -0000
@@ -3,7 +3,7 @@ Bison News
 
 Changes in version 2.1a:
 
-* DJGPP support added.
+* Bison now warns if it finds a stray `$' or `@' in an action.
 
 * %require "VERSION"
   To specify that the grammar file depends on features implemented in
@@ -22,6 +22,8 @@ Changes in version 2.1a:
 
   If you wish to update, then make sure older version of Bison will
   fail using `%require "2.1a"'.
+
+* DJGPP support added.
 
 Changes in version 2.1, 2005-09-16:
 
--- src/scan-gram.l     11 Oct 2005 05:06:16 -0000      1.77
+++ src/scan-gram.l     13 Oct 2005 19:35:52 -0000
@@ -618,6 +618,15 @@ splice      (\\[ \f\t\v]*\n)*
   "$"("<"{tag}">")?(-?[0-9]+|"$")  handle_dollar (token_type, yytext, *loc);
   "@"(-?[0-9]+|"$")               handle_at (token_type, yytext, *loc);
 
+  "$"  {
+    warn_at (*loc, _("stray `$'"));
+    obstack_sgrow (&obstack_for_string, "$][");
+  }
+  "@"  {
+    warn_at (*loc, _("stray `@'"));
+    obstack_sgrow (&obstack_for_string, "@@");
+  }
+
   <<EOF>>  unexpected_eof (code_start, "}"); BEGIN INITIAL;
 }
 




reply via email to

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