]> git.saurik.com Git - bison.git/commitdiff
api.tokens.prefix -> api.token.prefix
authorAkim Demaille <akim@lrde.epita.fr>
Tue, 16 Oct 2012 08:51:38 +0000 (10:51 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Tue, 16 Oct 2012 08:51:38 +0000 (10:51 +0200)
See
http://lists.gnu.org/archive/html/bison-patches/2012-02/msg00045.html
Note that api.tokens.prefix has not been released, yet.

* NEWS, data/bison.m4, doc/bison.texi, tests/c++.at,
* tests/calc.at, tests/java.at, tests/local.at: Do it.
* src/muscle-tab.c (muscle_percent_variable_update): Ensure
backward compatibility.

NEWS
data/bison.m4
doc/bison.texi
src/muscle-tab.c
tests/c++.at
tests/calc.at
tests/java.at
tests/local.at

diff --git a/NEWS b/NEWS
index d3a860b532202390d07501a7e5f388f33ed81652..29b6b3230ebac5ae128a77d43a9c16496ce6988b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -195,14 +195,14 @@ GNU Bison NEWS
   used by the scanner, or rejecting invalid combinations from a
   factory invoked by the user actions).
 
-** Variable api.tokens.prefix
+** Variable api.token.prefix
 
-  The variable api.tokens.prefix changes the way tokens are identified in
+  The variable api.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 api.tokens.prefix "TOK_"
+    %define api.token.prefix "TOK_"
     %%
     start: FILE for ERROR;
 
index 1907e42e8774ebb5a791915bed9da9387c016d95..0d2a39eb79b91b84bf2b0bdaa966855d609e7713 100644 (file)
@@ -333,7 +333,7 @@ m4_define([b4_symbol_],
 # undefined.  If FIELD = id, prepend the prefix.
 m4_define([b4_symbol],
 [m4_case([$2],
-         [id],    [m4_do([b4_percent_define_get([api.tokens.prefix])],
+         [id],    [m4_do([b4_percent_define_get([api.token.prefix])],
                          [b4_symbol_([$1], [id])])],
          [b4_symbol_($@)])])
 
@@ -790,8 +790,8 @@ m4_define([b4_percent_code_ifdef],
 
 # Default values for %define.
 # ---------------------------
-# If the api.tokens.prefix, it is empty.
-m4_percent_define_default([[api.tokens.prefix]], [[]])
+# If the api.token.prefix, it is empty.
+m4_percent_define_default([[api.token.prefix]], [[]])
 
 # b4_parse_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT])
 # b4_parse_trace_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT])
index d18167fac2cf4eca5670f6d245cc96ca41ba9ab9..0428c78c47b403f0d3e3bbb3ae1de628087abf30 100644 (file)
@@ -5546,9 +5546,9 @@ More user feedback will help to stabilize it.)
 
 
 
-@c ================================================== api.tokens.prefix
-@item api.tokens.prefix
-@findex %define api.tokens.prefix
+@c ================================================== api.token.prefix
+@item api.token.prefix
+@findex %define api.token.prefix
 
 @itemize
 @item Languages(s): all
@@ -5559,7 +5559,7 @@ target language.  For instance
 
 @example
 %token FILE for ERROR
-%define api.tokens.prefix "TOK_"
+%define api.token.prefix "TOK_"
 %%
 start: FILE for ERROR;
 @end example
@@ -5580,8 +5580,10 @@ letters, underscores, and ---not at the beginning--- digits).
 
 @item Default Value:
 empty
+@item History:
+introduced in Bison 2.8
 @end itemize
-@c api.tokens.prefix
+@c api.token.prefix
 
 
 @c ================================================== lex_symbol
@@ -10098,7 +10100,7 @@ So for each token type, Bison generates named constructors as follows.
 @deftypemethod {symbol_type} {} make_@var{token} (const @var{value_type}& @var{value}, const location_type& @var{location})
 @deftypemethodx {symbol_type} {} make_@var{token} (const location_type& @var{location})
 Build a complete terminal symbol for the token type @var{token} (not
-including the @code{api.tokens.prefix}) whose possible semantic value is
+including the @code{api.token.prefix}) whose possible semantic value is
 @var{value} of adequate @var{value_type}.  If location tracking is enabled,
 also pass the @var{location}.
 @end deftypemethod
@@ -10106,7 +10108,7 @@ also pass the @var{location}.
 For instance, given the following declarations:
 
 @example
-%define api.tokens.prefix "TOK_"
+%define api.token.prefix "TOK_"
 %token <std::string> IDENTIFIER;
 %token <int> INTEGER;
 %token COLON;
@@ -10428,11 +10430,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{%define Summary,,api.tokens.prefix}).
+tokens with @code{TOK_} (@pxref{%define Summary,,api.token.prefix}).
 
 @comment file: calc++-parser.yy
 @example
-%define api.tokens.prefix "TOK_"
+%define api.token.prefix "TOK_"
 %token
   END  0  "end of file"
   ASSIGN  ":="
index 1789280f912ebc7b7720b86c603e8cf84e3dccd7..9fe32ea1c453cdbdad88c8f6028e1c92646d81b7 100644 (file)
@@ -398,6 +398,7 @@ muscle_percent_variable_update (char const *variable, location variable_loc)
   const conversion_type conversion[] =
     {
       { "api.push_pull", "api.push-pull", },
+      { "api.tokens.prefix", "api.token.prefix", },
       { "location_type", "api.location.type", },
       { "lr.keep_unreachable_states", "lr.keep-unreachable-states", },
       { "namespace", "api.namespace", },
index 0d49170921b0c66c041a14872802b9949f6e6cff..d5e75962aad5e76e87d64164974bd18d0a618749 100644 (file)
@@ -202,7 +202,7 @@ AT_CHECK_VARIANTS([])
 AT_CHECK_VARIANTS([%define parse.assert])
 AT_CHECK_VARIANTS([[%define parse.assert %code {\n#define ONE_STAGE_BUILD\n}]])
 AT_CHECK_VARIANTS([[%define parse.assert %define lex_symbol %code {\n#define USE_LEX_SYMBOL\n}]])
-AT_CHECK_VARIANTS([[%define parse.assert %define lex_symbol %code {\n#define USE_LEX_SYMBOL\n} %define api.tokens.prefix "TOK_"]])
+AT_CHECK_VARIANTS([[%define parse.assert %define lex_symbol %code {\n#define USE_LEX_SYMBOL\n} %define api.token.prefix "TOK_"]])
 
 
 ## ----------------------- ##
index b959bfaf8f493caabd79e21fc7e7458ee59fb64a..a6c6742cdfff95c2d005917bc3d719a7b93d3909 100644 (file)
@@ -647,7 +647,7 @@ AT_CHECK_CALC_LALR([%define api.push-pull both %define api.pure %locations])
 AT_CHECK_CALC_LALR([%define parse.error verbose %locations])
 
 AT_CHECK_CALC_LALR([%define parse.error verbose %locations %defines %define api.prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_LALR([%define parse.error verbose %locations %defines %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc])
+AT_CHECK_CALC_LALR([%define parse.error verbose %locations %defines %name-prefix "calc" %define api.token.prefix "TOK_" %verbose %yacc])
 
 AT_CHECK_CALC_LALR([%debug])
 AT_CHECK_CALC_LALR([%define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
@@ -690,7 +690,7 @@ AT_CHECK_CALC_GLR([%define parse.error verbose %locations %defines %name-prefix
 
 AT_CHECK_CALC_GLR([%debug])
 AT_CHECK_CALC_GLR([%define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_GLR([%define parse.error verbose %debug %locations %defines %define api.prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc])
+AT_CHECK_CALC_GLR([%define parse.error verbose %debug %locations %defines %define api.prefix "calc" %define api.token.prefix "TOK_" %verbose %yacc])
 
 AT_CHECK_CALC_GLR([%define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
 
@@ -723,7 +723,7 @@ AT_CHECK_CALC_LALR1_CC([%locations %define parse.error verbose %define api.prefi
 AT_CHECK_CALC_LALR1_CC([%locations %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc])
 
 AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error verbose %debug %define api.prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error verbose %debug %define api.prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc])
+AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error verbose %debug %define api.prefix "calc" %define api.token.prefix "TOK_" %verbose %yacc])
 
 AT_CHECK_CALC_LALR1_CC([%defines %locations %pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} {int *count}])
 
@@ -758,7 +758,7 @@ AT_CHECK_CALC_GLR_CC([%debug])
 AT_CHECK_CALC_GLR_CC([%define parse.error verbose %debug %name-prefix "calc" %verbose %yacc])
 
 AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error verbose %debug %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc])
+AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error verbose %debug %name-prefix "calc" %define api.token.prefix "TOK_" %verbose %yacc])
 
 AT_CHECK_CALC_GLR_CC([%locations %defines %pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} {int *count}])
 AT_CHECK_CALC_GLR_CC([%locations %defines %pure-parser %define parse.error verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} {int *count}])
index 9b48453f62406a1217401b4e6fb561a4cb4ab165..5b0c1528097f90377a7251a0e1d90f5b7a79d315 100644 (file)
@@ -461,7 +461,7 @@ AT_CHECK_JAVA_GREP([[class YYParser]])
 AT_CHECK_JAVA_MINIMAL([[%name-prefix "Prefix"]])
 AT_CHECK_JAVA_GREP([[class PrefixParser]])
 
-AT_CHECK_JAVA_MINIMAL([[%define api.tokens.prefix "TOK_"]])
+AT_CHECK_JAVA_MINIMAL([[%define api.token.prefix "TOK_"]])
 AT_CHECK_JAVA_GREP([[.*TOK_END.*]])
 
 AT_CHECK_JAVA_MINIMAL([[%define parser_class_name "ParserClassName"]])
index 7458412a2b34e12b74c623d620b429af48f67516..ac266daacdb31c7e19455ce72723a7ed51cdc1e0 100644 (file)
@@ -153,8 +153,8 @@ m4_pushdef([AT_NAME_PREFIX],
            [m4_bregexp([$3], [\(%define api\.prefix\|%name-prefix\) "\([^""]*\)"], [\2])],
            [yy])])
 m4_pushdef([AT_TOKEN_PREFIX],
-[m4_bmatch([$3], [%define api.tokens.prefix ".*"],
-           [m4_bregexp([$3], [%define api.tokens.prefix "\(.*\)"], [\1])])])
+[m4_bmatch([$3], [%define api.token.prefix ".*"],
+           [m4_bregexp([$3], [%define api.token.prefix "\(.*\)"], [\1])])])
 m4_pushdef([AT_API_prefix],
 [m4_bmatch([$3], [%define api\.prefix ".*"],
            [m4_bregexp([$3], [%define api\.prefix "\([^""]*\)"], [\1])],