From b1cc23c4e3b94b55c2ef98d63052824273ebb92c Mon Sep 17 00:00:00 2001 From: "Joel E. Denny" Date: Sun, 17 Feb 2008 02:47:53 +0000 Subject: [PATCH] Fix documentation problems reported by Tim Josling at . * 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. --- ChangeLog | 10 ++++++++++ NEWS | 5 ++++- doc/bison.texinfo | 12 +++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb9daa62..2d823f76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-02-16 Joel E. Denny + + Fix documentation problems reported by Tim Josling at + . + * 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 Accept a token number in a %left, %right, or %nonassoc for POSIX diff --git a/NEWS b/NEWS index d0fc7abb..1458cb2d 100644 --- a/NEWS +++ b/NEWS @@ -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 diff --git a/doc/bison.texinfo b/doc/bison.texinfo index 72d027ac..bb6d5dcc 100644 --- a/doc/bison.texinfo +++ b/doc/bison.texinfo @@ -4023,7 +4023,7 @@ associativity and precedence. @xref{Precedence Decl, ,Operator 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 the token name, you can use them 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'': + +@example +%token END 0 "end of file" +@end example @node Precedence Decl @subsection Operator Precedence -- 2.45.2