mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 07:13:02 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user