mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
doc: token.prefix
* doc/bison.simple (Decl Summary): Document token.prefix. (Calc++ Parser): Various fixes. Formatting changes. Use token.prefix. Introduce a macro TOKEN to shorten the code and make it more readable. (Calc++ Scanner): Adjust. * NEWS (Variable token.prefix): New.
This commit is contained in:
16
NEWS
16
NEWS
@@ -9,6 +9,22 @@ Bison News
|
||||
Also, it is possible to add code to the parser's constructors using
|
||||
"%code init" and "%define init_throws".
|
||||
|
||||
** Variable token.prefix
|
||||
|
||||
The variable token.prefix changes the way tokens are identified in
|
||||
the generated files. This is especially useful to avoid collisions
|
||||
with identifiers in the target language. For instance
|
||||
|
||||
%token FILE for ERROR
|
||||
%define token.prefix "TOK_"
|
||||
%%
|
||||
start: FILE for ERROR;
|
||||
|
||||
will generate the definition of the symbols TOK_FILE, TOK_for, and
|
||||
TOK_ERROR in the generated sources. In particular, the scanner must
|
||||
use these prefixed token names, although the grammar itself still
|
||||
uses the short names (as in the sample rule given above).
|
||||
|
||||
* Changes in version 2.5 (????-??-??):
|
||||
|
||||
** IELR(1) and Canonical LR(1) Support
|
||||
|
||||
Reference in New Issue
Block a user