summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS17
-rw-r--r--data/java.m44
-rw-r--r--doc/bison.texi12
-rw-r--r--src/muscle-tab.c1
-rw-r--r--tests/java.at14
5 files changed, 26 insertions, 22 deletions
diff --git a/NEWS b/NEWS
index d4f8a750..a44e1beb 100644
--- 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).
+** 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
@@ -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).
-** 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
diff --git a/data/java.m4 b/data/java.m4
index 2be2359b..97e9548f 100644
--- a/data/java.m4
+++ b/data/java.m4
@@ -173,8 +173,8 @@ m4_define([b4_predicate_case], [ case $1:
## 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]])
diff --git a/doc/bison.texi b/doc/bison.texi
index bc7b167c..7a7511a4 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -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
-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
-%define stype "ASTNode"
+%define api.value.type "ASTNode"
@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.
-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
@@ -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
-@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}.
@@ -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
-@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.
@@ -11749,7 +11749,7 @@ Whether the parser class is declared @code{public}. Default is false.
@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
diff --git a/src/muscle-tab.c b/src/muscle-tab.c
index e40da8d3..1a1ada08 100644
--- a/src/muscle-tab.c
+++ b/src/muscle-tab.c
@@ -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", },
+ { "stype", "api.value.type", },
{ "variant=", "api.value.type=variant", },
{ "variant=true", "api.value.type=variant", },
{ NULL, NULL, }
diff --git a/tests/java.at b/tests/java.at
index 1c9bd50d..2a1ba514 100644
--- a/tests/java.at
+++ b/tests/java.at
@@ -408,7 +408,7 @@ AT_JAVA_COMPILE([[YYParser.java]])
# 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".
@@ -742,14 +742,14 @@ AT_CHECK([[grep -q 'super("Test Thread"); if (true) throw new InterruptedExcepti
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([[
-%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"
@@ -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([[
-%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"