]> git.saurik.com Git - bison.git/blobdiff - doc/bison.texinfo
Rename token.prefix as api.tokens.prefix.
[bison.git] / doc / bison.texinfo
index 176cc7ff645867ac1a6e1147cac5bb89c9dcfcb4..744641a0a62ec87669a4fab901a33698ae832967 100644 (file)
@@ -4902,6 +4902,43 @@ More user feedback will help to stabilize it.)
 @end itemize
 @c api.push-pull
 
+@item api.tokens.prefix
+@findex %define api.tokens.prefix
+
+@itemize
+@item Languages(s): all
+
+@item Purpose:
+Add a prefix to the token names when generating their definition in the
+target language.  For instance
+
+@example
+%token FILE for ERROR
+%define api.tokens.prefix "TOK_"
+%%
+start: FILE for ERROR;
+@end example
+
+@noindent
+generates the definition of the symbols @code{TOK_FILE}, @code{TOK_for},
+and @code{TOK_ERROR} in the generated source files.  In particular, the
+scanner must use these prefixed token names, while the grammar itself
+may still use the short names (as in the sample rule given above).  The
+generated informational files (@file{*.output}, @file{*.xml},
+@file{*.dot}) are not modified by this prefix.  See @ref{Calc++ Parser}
+and @ref{Calc++ Scanner}, for a complete example.
+
+@item Accepted Values:
+Any string.  Should be a valid identifier prefix in the target language,
+in other words, it should typically be an identifier itself (sequence of
+letters, underscores, and ---not at the beginning--- digits).
+
+@item Default Value:
+empty
+@end itemize
+@c api.tokens.prefix
+
+
 @item error-verbose
 @findex %define error-verbose
 @itemize
@@ -5192,42 +5229,6 @@ is not already defined, so that the debugging facilities are compiled.
 @end itemize
 @c parse.trace
 
-@item token.prefix
-@findex %define token.prefix
-
-@itemize
-@item Languages(s): all
-
-@item Purpose:
-Add a prefix to the token names when generating their definition in the
-target language.  For instance
-
-@example
-%token FILE for ERROR
-%define token.prefix "TOK_"
-%%
-start: FILE for ERROR;
-@end example
-
-@noindent
-generates the definition of the symbols @code{TOK_FILE}, @code{TOK_for},
-and @code{TOK_ERROR} in the generated source files.  In particular, the
-scanner must use these prefixed token names, while the grammar itself
-may still use the short names (as in the sample rule given above).  The
-generated informational files (@file{*.output}, @file{*.xml},
-@file{*.dot}) are not modified by this prefix.  See @ref{Calc++ Parser}
-and @ref{Calc++ Scanner}, for a complete example.
-
-@item Accepted Values:
-Any string.  Should be a valid identifier prefix in the target language,
-in other words, it should typically be an identifier itself (sequence of
-letters, underscores, and ---not at the beginning--- digits).
-
-@item Default Value:
-empty
-@end itemize
-@c token.prefix
-
 @end table
 @end deffn
 @c ----------------------------------------------------------   %define
@@ -8817,11 +8818,11 @@ 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''.  Similarly user friendly names are provided for each symbol.
 To avoid name clashes in the generated files (@pxref{Calc++ Scanner}),
-prefix tokens with @code{TOK_} (@pxref{Decl Summary,, token.prefix}).
+prefix tokens with @code{TOK_} (@pxref{Decl Summary,, api.tokens.prefix}).
 
 @comment file: calc++-parser.yy
 @example
-%define token.prefix "TOK_"
+%define api.tokens.prefix "TOK_"
 %token        END      0 "end of file"
 %token        ASSIGN     ":="
 %token <sval> IDENTIFIER "identifier"
@@ -8896,8 +8897,8 @@ parser's to get the set of defined tokens.
 @example
 %@{                                            /* -*- C++ -*- */
 # include <cstdlib>
-# include <errno.h>
-# include <limits.h>
+# include <cerrno>
+# include <climits>
 # include <string>
 # include "calc++-driver.hh"
 # include "calc++-parser.hh"