]> git.saurik.com Git - bison.git/commitdiff
java: stype is obsoleted by api.value.type
authorAkim Demaille <akim@lrde.epita.fr>
Mon, 31 Dec 2012 10:13:50 +0000 (11:13 +0100)
committerAkim Demaille <akim@lrde.epita.fr>
Mon, 31 Dec 2012 15:32:12 +0000 (16:32 +0100)
This is consistent with the other %define variable names.

* data/java.m4: Use api.value.type instead of stype.
* doc/bison.texi, NEWS: Document that change.
* src/muscle-tab.c (muscle_percent_variable_update): Provide backward
compatibility.
* tests/java.at: Adjust.

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

diff --git a/NEWS b/NEWS
index d4f8a750283be5563c5c20bca956793ff18ccfdc..a44e1beb15011cbf0c0a64f4c30f538d5f370de1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -198,6 +198,16 @@ GNU Bison NEWS
   used by the scanner, or rejecting invalid combinations from a
   factory invoked by the user actions).
 
   used by the scanner, or rejecting invalid combinations from a
   factory invoked by the user actions).
 
+** Renamed %define variables
+
+  The following variables have been renamed for consistency.  Backward
+  compatibility is ensured, but upgrading is recommended.
+
+    lr.default-reductions      -> lr.default-reduction
+    lr.keep-unreachable-states -> lr.keep-unreachable-state
+    namespace                  -> api.namespace
+    stype                      -> api.value.type
+
 ** Variable api.token.prefix
 
   The variable api.token.prefix changes the way tokens are identified in
 ** Variable api.token.prefix
 
   The variable api.token.prefix changes the way tokens are identified in
@@ -214,14 +224,7 @@ GNU Bison NEWS
   use these prefixed token names, although the grammar itself still
   uses the short names (as in the sample rule given above).
 
   use these prefixed token names, although the grammar itself still
   uses the short names (as in the sample rule given above).
 
-** Renamed %define variables
-
-  The following variables have been renamed for consistency.  Backward
-  compatibility is ensured, but upgrading is recommended.
 
 
-    lr.default-reductions      -> lr.default-reduction
-    lr.keep-unreachable-states -> lr.keep-unreachable-state
-    namespace                  -> api.namespace
 
 ** Variable parse.error
 
 
 ** Variable parse.error
 
index 2be2359b46ee9d6d8ed843e79956ef8b9cf52e09..97e9548fdb580c86ad4654e06c85feb91dbf99a1 100644 (file)
@@ -173,8 +173,8 @@ m4_define([b4_predicate_case], [  case $1:
 ## Default values.  ##
 ## ---------------- ##
 
 ## Default values.  ##
 ## ---------------- ##
 
-m4_define([b4_yystype], [b4_percent_define_get([[stype]])])
-b4_percent_define_default([[stype]], [[Object]])
+m4_define([b4_yystype], [b4_percent_define_get([[api.value.type]])])
+b4_percent_define_default([[api.value.type]], [[Object]])
 
 # %name-prefix
 m4_define_default([b4_prefix], [[YY]])
 
 # %name-prefix
 m4_define_default([b4_prefix], [[YY]])
index bc7b167c220c3b4386ed8f737445081ffda9791e..7a7511a40502e80bd40790e97359a62aa9923d45 100644 (file)
@@ -11233,11 +11233,11 @@ semantic values' types (class names) should be specified in the
 By default, the semantic stack is declared to have @code{Object} members,
 which means that the class types you specify can be of any class.
 To improve the type safety of the parser, you can declare the common
 By default, the semantic stack is declared to have @code{Object} members,
 which means that the class types you specify can be of any class.
 To improve the type safety of the parser, you can declare the common
-superclass of all the semantic values using the @samp{%define stype}
+superclass of all the semantic values using the @samp{%define api.value.type}
 directive.  For example, after the following declaration:
 
 @example
 directive.  For example, after the following declaration:
 
 @example
-%define stype "ASTNode"
+%define api.value.type "ASTNode"
 @end example
 
 @noindent
 @end example
 
 @noindent
@@ -11463,7 +11463,7 @@ The return type can be changed using @code{%define api.position.type
 @deftypemethod {Lexer} {Object} getLVal ()
 Return the semantic value of the last token that yylex returned.
 
 @deftypemethod {Lexer} {Object} getLVal ()
 Return the semantic value of the last token that yylex returned.
 
-The return type can be changed using @samp{%define stype
+The return type can be changed using @samp{%define api.value.type
 "@var{class-name}".}
 @end deftypemethod
 
 "@var{class-name}".}
 @end deftypemethod
 
@@ -11491,7 +11491,7 @@ Like @code{$@var{n}} but specifies a alternative type @var{typealt}.
 @defvar $$
 The semantic value for the grouping made by the current rule.  As a
 value, this is in the base type (@code{Object} or as specified by
 @defvar $$
 The semantic value for the grouping made by the current rule.  As a
 value, this is in the base type (@code{Object} or as specified by
-@samp{%define stype}) as in not cast to the declared subtype because
+@samp{%define api.value.type}) as in not cast to the declared subtype because
 casts are not allowed on the left-hand side of Java assignments.
 Use an explicit Java cast if the correct subtype is needed.
 @xref{Java Semantic Values}.
 casts are not allowed on the left-hand side of Java assignments.
 Use an explicit Java cast if the correct subtype is needed.
 @xref{Java Semantic Values}.
@@ -11573,7 +11573,7 @@ corresponds to these C macros.}.
 @item
 Java lacks unions, so @code{%union} has no effect.  Instead, semantic
 values have a common base type: @code{Object} or as specified by
 @item
 Java lacks unions, so @code{%union} has no effect.  Instead, semantic
 values have a common base type: @code{Object} or as specified by
-@samp{%define stype}.  Angle brackets on @code{%token}, @code{type},
+@samp{%define api.value.type}.  Angle brackets on @code{%token}, @code{type},
 @code{$@var{n}} and @code{$$} specify subtypes rather than fields of
 an union.  The type of @code{$$}, even with angle brackets, is the base
 type since Java casts are not allow on the left-hand side of assignments.
 @code{$@var{n}} and @code{$$} specify subtypes rather than fields of
 an union.  The type of @code{$$}, even with angle brackets, is the base
 type since Java casts are not allow on the left-hand side of assignments.
@@ -11749,7 +11749,7 @@ Whether the parser class is declared @code{public}.  Default is false.
 @xref{Java Bison Interface}.
 @end deffn
 
 @xref{Java Bison Interface}.
 @end deffn
 
-@deffn {Directive} {%define stype} "@var{class}"
+@deffn {Directive} {%define api.value.type} "@var{class}"
 The base type of semantic values.  Default is @code{Object}.
 @xref{Java Semantic Values}.
 @end deffn
 The base type of semantic values.  Default is @code{Object}.
 @xref{Java Semantic Values}.
 @end deffn
index e40da8d3be41a628a0bedb5adec8dcb8461194a2..1a1ada08db624bf409bdcd65b31cab273b798c06 100644 (file)
@@ -439,6 +439,7 @@ muscle_percent_variable_update (char const *variable, location variable_loc,
       { "lr.keep-unreachable-states", "lr.keep-unreachable-state", },
       { "lr.keep_unreachable_states", "lr.keep-unreachable-state", },
       { "namespace", "api.namespace", },
       { "lr.keep-unreachable-states", "lr.keep-unreachable-state", },
       { "lr.keep_unreachable_states", "lr.keep-unreachable-state", },
       { "namespace", "api.namespace", },
+      { "stype", "api.value.type", },
       { "variant=",     "api.value.type=variant", },
       { "variant=true", "api.value.type=variant", },
       { NULL, NULL, }
       { "variant=",     "api.value.type=variant", },
       { "variant=true", "api.value.type=variant", },
       { NULL, NULL, }
index 1c9bd50d3cf70485cd2a1d23fc92672fb4a036ac..2a1ba5141e36aec08a7168d526fc6ced33b286dd 100644 (file)
@@ -408,7 +408,7 @@ AT_JAVA_COMPILE([[YYParser.java]])
 
 
 # AT_CHECK_JAVA_MINIMAL_W_LEXER([1:DIRECTIVES], [2:LEX_THROWS],
 
 
 # AT_CHECK_JAVA_MINIMAL_W_LEXER([1:DIRECTIVES], [2:LEX_THROWS],
-#       [3:YYLEX_ACTION], [4:LEXER_BODY], [5:PARSER_ACTION], [6:STYPE],
+#       [3:YYLEX_ACTION], [4:LEXER_BODY], [5:PARSER_ACTION], [6:VALUE_TYPE],
 #       [7:POSITION_TYPE], [8:LOCATION_TYPE])
 # ---------------------------------------------------------------------
 # Check that a mininal parser with DIRECTIVES and a "%code lexer".
 #       [7:POSITION_TYPE], [8:LOCATION_TYPE])
 # ---------------------------------------------------------------------
 # Check that a mininal parser with DIRECTIVES and a "%code lexer".
@@ -742,14 +742,14 @@ AT_CHECK([[grep -q 'super("Test Thread"); if (true) throw new InterruptedExcepti
 AT_CLEANUP
 
 
 AT_CLEANUP
 
 
-# --------------------------------------------- #
-# Java stype, position_class and location_class #
-# --------------------------------------------- #
+# ------------------------------------------ #
+# Java value, position, and location types.  #
+# ------------------------------------------ #
 
 
-AT_SETUP([Java stype, position_class and location_class])
+AT_SETUP([Java value, position, and location types])
 
 AT_CHECK_JAVA_MINIMAL([[
 
 AT_CHECK_JAVA_MINIMAL([[
-%define stype "java.awt.Color"
+%define api.value.type "java.awt.Color"
 %type<java.awt.Color> start;
 %define api.location.type "MyLoc"
 %define api.position.type "MyPos"
 %type<java.awt.Color> start;
 %define api.location.type "MyLoc"
 %define api.position.type "MyPos"
@@ -759,7 +759,7 @@ AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Position']], [1], [ignore])
 AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Location']], [1], [ignore])
 
 AT_CHECK_JAVA_MINIMAL_W_LEXER([[
 AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Location']], [1], [ignore])
 
 AT_CHECK_JAVA_MINIMAL_W_LEXER([[
-%define stype "java.awt.Color"
+%define api.value.type "java.awt.Color"
 %type<java.awt.Color> start;
 %define api.location.type "MyLoc"
 %define api.position.type "MyPos"
 %type<java.awt.Color> start;
 %define api.location.type "MyLoc"
 %define api.position.type "MyPos"