GNU Bison NEWS
+* Noteworthy changes in release ?.? (????-??-??) [?]
+
+** Changes in the format of error messages
+
+ This used to be the format of many error reports:
+
+ foo.y:5.10-24: result type clash on merge function 'merge': <t3> != <t2>
+ foo.y:4.13-27: previous declaration
+
+ It is now:
+
+ foo.y:5.10-25: result type clash on merge function 'merge': <t3> != <t2>
+ foo.y:4.13-27: previous declaration
+
+** Exception safety (lalr1.cc)
+
+ The parse function now catches exceptions, uses the %destructors to
+ release memory (the lookahead symbol and the symbols pushed on the stack)
+ before re-throwing the exception.
+
+ This feature is somewhat experimental. User feedback would be
+ appreciated.
+
+** New %define variable: api.location.type (glr.cc, lalr1.cc, lalr1.java)
+
+ The %define variable api.location.type defines the name of the type to use
+ for locations. When defined, Bison no longer generates the position.hh
+ and location.hh files, nor does the parser will include them: the user is
+ then responsible to define her type.
+
+ This can be used in programs with several parsers to factor their location
+ and position files: let one of them generate them, and the others just use
+ them.
+
+ This feature was actually introduced, but not documented, in Bison 2.5,
+ under the name "location_type" (which is maintained for backward
+ compatibility).
+
+ For consistency, lalr1.java's %define variables location_type and
+ position_type are deprecated in favor of api.location.type and
+ api.position.type.
+
+** Graphviz improvements
+
+ The graphical presentation of the states is more readable: their shape is
+ now rectangular, the state number is clearly displayed, and the items are
+ numbered and left-justified.
+
+ The reductions are now explicitly represented as transitions to other
+ diamond shaped nodes.
+
+ * Noteworthy changes in release ?.? (????-??-??) [?]
+
+ We consider compiler warnings about Bison generated parsers to be bugs.
+ Rather than working around them in your own project, please consider
+ reporting them to us.
+
+ ** Bug fixes
+
+ Warnings about uninitialized yylval and/or yylloc for push parsers with a
+ pure interface have been fixed for GCC 4.0 up to 4.8, and Clang 2.9 to
+ 3.2.
+
+ Other issues in the test suite have been addressed.
+
+ Nul characters are correctly displayed in error messages.
+
+ When possible, yylloc is correctly initialized before calling yylex. It
+ is no longer necessary to initialize it in the %initial-action.
+
* Noteworthy changes in release 2.6.4 (2012-10-23) [stable]
Bison 2.6.3's --version was incorrect. This release fixes this issue.
]b4_parse_param_use[]dnl
[ yyparser.yy_symbol_print_ (yytype, yyvaluep]b4_locations_if([, yylocationp])[);
}
- ]])
+ ]])[
-]b4_locations_if([b4_percent_define_ifdef([[location_type]], [],
+ # Hijack the initial action to initialize the locations.
++]b4_locations_if([b4_percent_define_ifdef([[api.location.type]], [],
+ [m4_define([b4_initial_action],
+ [yylloc.initialize ();]m4_ifdef([b4_initial_action], [
+ m4_defn([b4_initial_action])]))])])[
# Hijack the post prologue to insert early definition of YYLLOC_DEFAULT
# and declaration of yyerror.
- Subproject commit 0e6a848c8cd1e9442e3794c7dcd2f535ea9797c6
-Subproject commit 0dbbe3f55352241d290403577dfebed802d6fd9a
++Subproject commit daf7f8c02242c535d596231e2f655109b97fa2bc
# Mostly test that we are robust to mistakes.
-[[input.y:1.1: invalid character: '\0'
-input.y:1.1: invalid character: '\001'
-input.y:1.1: invalid character: '\002'
-input.y:1.1: invalid character: '\377'
-input.y:1.2: invalid character: '?'
-input.y:3.1: invalid character: '?'
-input.y:4.14: invalid character: '}'
-input.y:5.1: invalid character: '%'
-input.y:5.2: invalid character: '&'
-input.y:6.1-17: invalid directive: '%a-does-not-exist'
-input.y:7.1: invalid character: '%'
-input.y:7.2: invalid character: '-'
-input.y:8.1-9.0: missing '%}' at end of file
-input.y:8.1-9.0: syntax error, unexpected %{...%}
+ ## ---------------- ##
+ ## Invalid inputs. ##
+ ## ---------------- ##
+
+ AT_SETUP([Invalid inputs])
+
+ AT_DATA([input.y],
+ [[\000\001\002\377?
+ %%
+ ?
+ default: 'a' }
+ %&
+ %a-does-not-exist
+ %-
+ %{
+ ]])
+ AT_CHECK([[$PERL -pi -e 's/\\(\d{3})/chr(oct($1))/ge' input.y || exit 77]])
+
+ AT_BISON_CHECK([input.y], [1], [],
-[[input.y:3.1-15: syntax error, unexpected %initial-action, expecting {...}
++[[input.y:1.1: error: invalid character: '\0'
++input.y:1.1: error: invalid character: '\001'
++input.y:1.1: error: invalid character: '\002'
++input.y:1.1: error: invalid character: '\377'
++input.y:1.2: error: invalid character: '?'
++input.y:3.1: error: invalid character: '?'
++input.y:4.14: error: invalid character: '}'
++input.y:5.1: error: invalid character: '%'
++input.y:5.2: error: invalid character: '&'
++input.y:6.1-17: error: invalid directive: '%a-does-not-exist'
++input.y:7.1: error: invalid character: '%'
++input.y:7.2: error: invalid character: '-'
++input.y:8.1-9.0: error: missing '%}' at end of file
++input.y:8.1-9.0: error: syntax error, unexpected %{...%}
+ ]])
+
+ AT_CLEANUP
+
+
+ AT_SETUP([Invalid inputs with {}])
+
+ # We used to SEGV here. See
+ # http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html
+
+ AT_DATA([input.y],
+ [[
+ %destructor
+ %initial-action
+ %lex-param
+ %parse-param
+ %printer
+ %union
+ ]])
+
+ AT_BISON_CHECK([input.y], [1], [],
++[[input.y:3.1-15: error: syntax error, unexpected %initial-action, expecting {...}
+ ]])
+
+ AT_CLEANUP
+
+
+
## ------------ ##
## Invalid $n. ##
## ------------ ##
m4_pushdef([AT_LOCATION_IF],
[m4_bmatch([$3], [%locations], [$1], [$2])])
m4_pushdef([AT_LOCATION_TYPE_IF],
-[m4_bmatch([$3], [%define location_type], [$1], [$2])])
+[m4_bmatch([$3], [%define \(api\.location\.type\|location_type\)], [$1], [$2])])
m4_pushdef([AT_PARAM_IF],
[m4_bmatch([$3], [%parse-param], [$1], [$2])])
+ # Comma-terminated list of formals parse-parameters.
+ # E.g., %parse-param { int x } {int y} -> "int x, int y, ".
+ m4_pushdef([AT_PARSE_PARAMS])
+ m4_bpatsubst([$3], [%parse-param { *\([^{}]*[^{} ]\) *}],
+ [m4_append([AT_PARSE_PARAMS], [\1, ])])
+
m4_pushdef([AT_PURE_IF],
[m4_bmatch([$3], [%define *api\.pure\|%pure-parser],
[m4_bmatch([$3], [%define *api\.pure *"?false"?], [$2], [$1])],
AT_DATA_GRAMMAR([test.y],
[[
%%
- start: foo[ /* aaa */ *&-.+ ] bar
+ start: foo[ /* aaa */ *&-.+\000\001\002\377 ] bar
{ s = $foo; }
]])
+ AT_CHECK([[$PERL -pi -e 's/\\(\d{3})/chr(oct($1))/ge' test.y || exit 77]])
AT_BISON_CHECK([-o test.c test.y], 1, [],
-[[test.y:11.23: invalid character in bracketed name: '*'
-test.y:11.24: invalid character in bracketed name: '&'
-test.y:11.25: invalid character in bracketed name: '-'
-test.y:11.27: invalid character in bracketed name: '+'
-test.y:11.28: invalid character in bracketed name: '\0'
-test.y:11.28: invalid character in bracketed name: '\001'
-test.y:11.28: invalid character in bracketed name: '\002'
-test.y:11.28: invalid character in bracketed name: '\377'
+[[test.y:11.23: error: invalid character in bracketed name: '*'
+test.y:11.24: error: invalid character in bracketed name: '&'
+test.y:11.25: error: invalid character in bracketed name: '-'
+test.y:11.27: error: invalid character in bracketed name: '+'
++test.y:11.28: error: invalid character in bracketed name: '\0'
++test.y:11.28: error: invalid character in bracketed name: '\001'
++test.y:11.28: error: invalid character in bracketed name: '\002'
++test.y:11.28: error: invalid character in bracketed name: '\377'
]])
AT_CLEANUP