bug-bison
[Top][All Lists]
Advanced

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

Re: Bison Files and Token Order


From: Joel E. Denny
Subject: Re: Bison Files and Token Order
Date: Sat, 16 Feb 2008 21:48:39 -0500 (EST)

On Tue, 22 Jan 2008, Tim Josling wrote:

> In my lisp skeleton it is still a problem because some things are still
> not escaped going into m4.

> In my case I apply m4 functions to the actions.
> 
> This means, in my case, that if the actions have embedded commas or
> mismatched parentheses, then the m4 step fails in an ugly way. There may
> be some m4 magic way around this but I haven't been able to find it.
> (please tell me if there is a way around this!).

If you can post a minimal skeleton and grammar file that demonstrates the 
problem, I'll try to find some time to take a look.

> --no-parser option was dropped in 2.3a - this should be mentioned in the
> NEWS file.

> It is mentioned in the NEWS file that TK_EOF can be specified. It gives
> an example where it is 0 (so EOF is zero?). But it is not mentioned in
> the manual anywhere I can find that using a token value of zero has
> these specific implications. The manual just says the token number must
> be an integer, that is: ... -2, -1, 0, +1, +2, ... .

Thanks.  I committed this.

Index: ChangeLog
===================================================================
RCS file: /sources/bison/bison/ChangeLog,v
retrieving revision 1.1768
diff -p -u -r1.1768 ChangeLog
--- ChangeLog   17 Feb 2008 00:18:34 -0000      1.1768
+++ ChangeLog   17 Feb 2008 02:44:06 -0000
@@ -1,5 +1,15 @@
 2008-02-16  Joel E. Denny  <address@hidden>
 
+       Fix documentation problems reported by Tim Josling at
+       <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
+       * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
+       * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
+       integers.  Explain the effect of literal string aliases on error
+       messages.  Copy token 0 documentation from the C++ skeleton
+       documentation.
+
+2008-02-16  Joel E. Denny  <address@hidden>
+
        Accept a token number in a %left, %right, or %nonassoc for POSIX
        conformance.  Reported by Tim Josling at
        <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
Index: NEWS
===================================================================
RCS file: /sources/bison/bison/NEWS,v
retrieving revision 1.185
diff -p -u -r1.185 NEWS
--- NEWS        17 Feb 2008 00:18:35 -0000      1.185
+++ NEWS        17 Feb 2008 02:44:06 -0000
@@ -69,7 +69,7 @@ Changes in version 2.3a+ (????-??-??):
   for further discussion.
 
 * Lookahead Set Correction in the `.output' Report
-  
+
   When instructed to generate a `.output' file including lookahead sets
   (using `--report=lookahead', for example), Bison now prints each reduction's
   lookahead set only next to the associated state's one item that (1) is
@@ -158,6 +158,9 @@ Changes in version 2.3a+ (????-??-??):
   by POSIX.  However, see the end of section `Operator Precedence' in the Bison
   manual for a caveat concerning the treatment of literal strings.
 
+* The nonfunctional --no-parser, -n, and %no-parser options have been
+  completely removed from Bison.
+
 Changes in version 2.3a, 2006-09-13:
 
 * Instead of %union, you can define and use your own union type
Index: doc/bison.texinfo
===================================================================
RCS file: /sources/bison/bison/doc/bison.texinfo,v
retrieving revision 1.249
diff -p -u -r1.249 bison.texinfo
--- doc/bison.texinfo   17 Feb 2008 00:18:35 -0000      1.249
+++ doc/bison.texinfo   17 Feb 2008 02:44:10 -0000
@@ -4023,7 +4023,7 @@ associativity and precedence.  @xref{Pre
 Precedence}.
 
 You can explicitly specify the numeric code for a token type by appending
-a decimal or hexadecimal integer value in the field immediately
+a nonnegative decimal or hexadecimal integer value in the field immediately
 following the token name:
 
 @example
@@ -4076,6 +4076,16 @@ Once you equate the literal string and t
 interchangeably in further declarations or the grammar rules.  The
 @code{yylex} function can use the token name or the literal string to
 obtain the token type code number (@pxref{Calling Convention}).
+Syntax error messages passed to @code{yyerror} from the parser will reference
+the literal string instead of the token name.
+
+The token numbered as 0 corresponds to end of file; the following line
+allows for nicer error messages referring to ``end of file'' instead
+of ``$end'':
+
address@hidden
+%token END 0 "end of file"
address@hidden example
 
 @node Precedence Decl
 @subsection Operator Precedence




reply via email to

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