| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/location.h: (location_print): Add return value.
* src/location.c: (location_print): Return number of printed
characters.
* src/complain.h: Two new functions (complain_at_indent,
warn_at_indent).
* src/complain.cpp: Implement the alignment mechanism. Add new
static variable (indent_ptr). Use and update it (error_message,
complain_at_indent, warn_at_indent).
* src/scan-code.l: Fix strings for translations. Use new *_indent
functions (parse_ref, show_sub_messages).
* NEWS (2.5): Add an announcement about named references.
|
|
|
|
|
| |
* doc/bison.texinfo: here.
Reported by Alex Rozenman.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
"variant" %define variables.
(C++ Semantic Values): Split into...
(C++ Unions, C++ Variants): these.
The latter is new.
(C++ Parser Interface): Fix type names.
Document parser::syntax_error.
Document the fact that locations are not mandatory.
(C++ Scanner Interface): Split into...
(Split Symbols, Complete Symbols): these.
The later is new.
(Calc++ Parsing Driver): Use variants.
Add more comments.
Adjust style.
(Calc++ Parser): Declare all the tokens, no
longer accept raw characters.
Remove %union.
Adjust types and printers.
Remove destructors.
(Calc++ Scanner): Use make_<SYMBOL> functions.
Use strerror in error message.
|
|
|
|
| |
* doc/bison.texinfo: here.
|
|
|
|
| |
* doc/bison.texinfo: Comment changes.
|
|
|
|
|
|
|
|
|
| |
* data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
constructor to take a token_type instead of the (internal) symbol
number.
Call yytranslate_.
* data/variant.hh (b4_symbol_constructor_define_): Therefore,
don't call yytranslate_ here.
|
|
|
|
| |
* TODO (Figures): New.
|
|
|
|
|
| |
* tests/push.at: Remove "Push Parsing: " from test group titles
because these are already under the banner "Push Parsing Tests".
|
|
|
|
|
|
|
|
|
| |
Add "symbol not found in production" error message when
an "invalid reference" is detected in named references
resolution.
* src/scan-code.l: Update "invalid reference" case.
* tests/named-ref.at: Adjust test-cases.
|
|
|
|
|
|
|
| |
* data/yacc.c: Clean up M4 for readability, and make output
whitespace more consistent. For the main parse function
comment, instead of saying "yyparse or yypush_parse", say either
"yyparse" or "yypush_parse" depending on which it actually is.
|
|
|
|
| |
* src/parse-gram.y (%printer <param>): Handle param_none.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is common to use sort of factories in the user actions. These
factories may check some "syntactic" constraints that are not
enforced by the grammar itself. This is possible using YYERROR
within the action itself. Provide the user with a means to throw
a syntax_error exception.
* data/c++.m4 (b4_public_types_declare, b4_public_types_define):
Declare and define yy::parser::syntax_error.
* data/lalr1.cc: Include stdexcept.
(yy::parser::parse): Wrap the user action within a try/catch.
* data/glr.cc: Include stdexcept.
|
|
|
|
|
| |
* data/c++.m4 (b4_public_types_define): Add missing inline to
implementations provided in headers.
|
|
|
|
|
|
|
|
|
| |
* NEWS (2.6): Document %param, %lex-param, and %parse-param
changes.
* doc/bison.texinfo: Document that %lex-param and %parse-param
are n-ary.
Changes some examples to demonstrate it.
(Calc++ Parser): Use %param.
|
| |
|
|
|
|
| |
* src/parse-gram.y (add_param): Scope changes.
|
|
|
|
|
|
|
| |
* src/parse-gram.y (current_param): New.
(param_type): Add param_none.
(params): New nonterminal.
Use it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide a means to factor lex-param and parse-param common
declarations.
* src/parse-gram.y (param_type): New.
Define a %printer for it.
(add_param): Use it.
(%parse-param, %lex-param): Merge into...
(%parse): this new token.
Adjust the grammar to use it.
* src/scan-gram.l (RETURN_VALUE): New.
(RETURN_PERCENT_FLAG): Use it.
(RETURN_PERCENT_PARAM): New.
Use it to support %parse-param, %lex-param and %param.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS (2.5): Document.
* data/bison.m4 (b4_check_user_names): Complain instead of warn.
* doc/bison.texinfo (Decl Summary): Document complaint, and
improve %define documentation a little otherwise.
* tests/input.at (Reject unused %code qualifiers): Update.
(%define errors): Update.
(%define, --define, --force-define): Update.
(%define backward compatibility): Update.
(Unused %define api.pure): Update.
* tests/push.at (Push Parsing: Unsupported Skeletons): Update.
|
|
|
|
|
|
|
| |
* src/output.c: Don't include assert.h.
(output_skeleton): Use aver not assert.
* src/system.h (aver): In documentation of why, add links to
Paul Eggert's explanations in the mailing lists.
|
|
|
|
|
|
|
|
|
| |
in a symbolic reference resolution. Remove .expr and -expr from
the shown reference when the reference is unresolved.
* src/scan-code.l: Change the error message, adjust location columns,
rename variable "exact_mode" to "explicit_bracketing".
* tests/named-ref.at: Adjust existing tests and add a new one.
|
|
|
|
|
|
| |
* tests/bison.in: Do some magic (including working around issues
with ylwrap) when this wrapper is used to compile
src/parse-gram.y.
|
|
|
|
|
|
| |
* data/bison.m4 (b4_error_verbose_flag): Don't examine value of
%define variable parse.error unless b4_error_verbose_flag is
actually expanded in a skeleton.
|
|
|
|
| |
* NEWS (2.4.2): Add "Internationalization" item.
|
|
|
|
|
| |
* bootstrap (find_tool): Improve error messages.
Fix typo about find_tool_names.
|
|
|
|
|
|
|
|
|
| |
See
<http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
* src/scan-code.h (code_props_rule_action_init): Rename
named_ref arg to name so it doesn't shadow named_ref type. This
makes it consistent with the function definition in scan-code.l
anyway.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS (2.5): Group all %define changes together, and document
this one. Remove quotes in IELR and canonical LR entry.
* doc/bison.texinfo: Remove quotes in most examples throughout.
(Decl Summary): Update %define documentation.
(Table of Symbols): Likewise.
* src/ielr.c (LrType): Update documentation.
* src/parse-gram.y (content.opt): Add production for ID.
* tests/actions.at: Remove quotes in most tests.
* tests/calc.at: Likewise.
* tests/existing.at: Likewise.
* tests/input.at: Likewise.
* tests/local.at: Likewise.
* tests/push.at: Likewise.
* tests/reduce.at: Likewise.
* tests/torture.at: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
That is, "LALR" => "lalr", "IELR" => "ielr", and
"canonical LR" => "canonical-lr".
* NEWS (2.5): Update documentation.
* doc/bison.texinfo (Decl Summary): Likewise.
* src/ielr.c (ielr): Use new values.
* src/ielr.h (ielr): Update documentation.
* src/reader.c (prepare_percent_define_front_end_variables): Use
and validate new values.
* tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
grammars.
* tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
|
|
|
|
|
|
|
|
| |
* src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
Avoid compiler warning.
Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit bbbbe221d7c2ff2fff88f7a0c8dbfee73f2e8a58)
|
|
|
|
|
|
|
|
|
| |
And skip tests if perl is not available. This is better than
playing tricks with shell portability. Suggested by Akim
Demaille.
* tests/input.at (Bad character literals): Use it here for
omitting final newlines.
(Bad escapes in literals): Use it here for special characters.
|
|
|
|
|
| |
* tests/conflicts.at (%nonassoc and eof): Extend to test that it
prevents the omission of expected tokens for %error-verbose.
|
|
|
|
|
| |
* tests/input.at (Bad escapes in literals): Don't expect "echo
'\0'" to output \ then 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* data/bison.m4 (b4_integral_parser_tables_map): Don't mention
zero values in the YYTABLE comments.
* data/glr.c (yytable_value_is_error): Don't check for zero
value.
* data/lalr1.cc (yy_table_value_is_error_): Likewise.
* data/yacc.c (yytable_value_is_error): Likewise.
* data/lalr1.java (yy_table_value_is_error_): Likewise.
(yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
* src/tables.h: In header comments, explain why it's useless to
check for a zero value in yytable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
comments: zero indicates syntax error not default action.
* data/c.m4 (b4_table_value_equals): Comment that YYID must be
defined.
* data/glr.c (yyis_pact_ninf): Rename to...
(yypact_value_is_default): ... this.
(yyisDefaultedState): Update for rename.
(yyis_table_ninf): Rename to...
(yytable_value_is_error): ... this, and check for value zero
besides just YYTABLE_NINF.
(yygetLRActions): Check for default value from yypact. It
appears that this check is always performed before this function
is invoked, and so adding the check here is probably redundant.
However, the code may evolve after this subtlety is forgotten.
Also, update for rename to yytable_value_is_error. Because that
macro now checks for zero, a different but equivalent branch of
the if-then-else here is evaluated.
(yyreportSyntaxError): Update for rename to
yytable_value_is_error. The zero condition was mishandled
before.
(yyrecoverSyntaxError): Update for renames. No behavioral
changes.
* data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
New function.
(yy_table_value_is_error_): New function.
(parse): Use new functions where possible. No behavioral
changes.
(yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
The zero condition was mishandled before.
* data/yacc.c (yyis_pact_ninf): Rename to...
(yypact_value_is_default): ... this.
(yyis_table_ninf): Rename to...
(yytable_value_is_error): ... this, and check for value zero
besides just YYTABLE_NINF.
(yysyntax_error): Update for rename to yytable_value_is_error.
The zero condition was mishandled before.
(yyparse): Update for renames. No behavioral changes.
* src/tables.h: Improve comments about yypact, yytable, etc.
more. Most importantly, say yytable value of zero means syntax
error not default action.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS (2.5): Document.
* data/glr.c (yyreportSyntaxError): Fix this by checking
yyis_table_ninf.
* data/yacc.c (yysyntax_error): Likewise.
* data/lalr1.cc (yysyntax_error_): Fix this by checking
yytable_ninf_.
* data/lalr1.java (yysyntax_error): Likewise.
* tests/conflicts.at (%nonassoc and eof): Update expected output
and remove FIXME.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* data/c.m4 (b4_table_value_equals): New macro to capture
some repeated code.
* data/glr.c (yyis_pact_ninf): Use it here.
(yyis_table_ninf): Likewise.
(yyreportSyntaxError): Improve internal comments.
* data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
Use it everywhere possible.
(yyis_table_ninf): Likewise.
(yysyntax_error): Improve internal comments.
* data/lalr1.cc (yysyntax_error_): Likewise.
* data/lalr1.java (yysyntax_error): Likewise.
* src/tables.h: Improve comments about yypact, yytable, etc.
|
|
|
|
|
| |
* src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
quote rather than implementing quoting here.
|
|
|
|
|
|
|
|
|
|
| |
* src/output.c (ARRAY_CARDINALITY): New macro, copied from
argmatch.h.
(output_skeleton): Use it.
Suggested by Akim Demaille.
Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit 1266b636740f0c6719d8cc11a5d569084fa37009)
|
|
|
|
|
|
|
|
|
|
| |
* submodules/autoconf: Update to autoconf 2.64.
* configure.ac (M4_GNU_OPTION): New define.
* src/output.c (output_skeleton): Use it to resolve FIXME.
* NEWS: Mention this.
Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit b9ad39c1fb2482e1513cdf9800b31e71b7986b39)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Discussed starting at
<http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
* src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
For a \0 and similar escape sequences meaning the null
character, report an invalid escape sequence instead of an
invalid null character because the latter does not actually
appear in the user's input.
In all escape sequence complaints, don't escape the initial
backslash, and don't quote when the sequence appears at the end
of the complaint line unless there's whitespace that quotearg
won't escape.
Consistently say "invalid" not "unrecognized".
Consistently prefer "empty character literal" over "extra
characters in character literal" warning for invalid escape
sequences; that is, consistently discard those sequences.
* tests/input.at (Bad escapes in literals): New.
|
|
|
|
| |
* doc/bison.texinfo: Fix minor Texinfo errors.
|
|
|
|
|
| |
* tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
error messages from the output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch simplifies "variables: rename namespace as api.namespace",
commit 67501061076ba46355cfd9f9361c7eed861b389c.
Suggested by Joel E. Denny in
http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
* src/muscle-tab.c (muscle_percent_variable_update): New.
(muscle_percent_define_insert): Use it in replacement of the
previous tr invocation.
Remove variable_tr, no longer needed.
* data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
Remove.
* data/c++.m4: No longer handle namespace -> api.namespace.
* tests/input.at (%define backward compatibility): Check that
namespace is treated as api.namespace.
|
|
|
|
|
|
|
|
| |
doc: %initial-action to initialize yylloc.
Reported by Bill Allombert.
* doc/bison.texinfo: Set fill-column to 76.
(Location Type): Document the use of %initial-action to initialize
yylloc.
|
|
|
|
|
| |
* data/lalr1.cc (yysyntax_error_): Use state_type.
Move argument names into yy*.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
yystate and yystack_[0].state are equal, keep only the latter.
The former was also used as a temporary variable to compute the
post-reduction state. Move this computation into an auxiliary
function.
* data/glr.c (yyLRgotoState): Fuse variable definition and first
assignment.
* data/lalr1.cc (yy_lr_goto_state_): New.
(yyparse): Use it.
Replace remaining uses of yystate by yystate_[0].state.
Remove the former.
|
|
|
|
|
|
|
|
| |
* data/lalr1.cc (yyreduce): Compute the resulting state before
running the user action so that yylhs is a valid symbol.
(yyerrorlab): Since yylhs is complete (it knows its type), we can
simply call yy_destroy_ to destroy $$ on YYERROR invocations.
* tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
|
|
|
|
|
|
|
|
| |
* gnulib: Update.
* .x-update-copyright (COPYING): Add as it's no longer implied
when .x-update-copyright is present.
* cfg.mk (update-copyright-local): Remove, now ignored.
(update-copyright): Declare update-b4-copyright as a dependency.
|
|
|
|
|
|
|
|
| |
Suggested by Bruno Haible.
http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
* configure.ac: require gettext 0.17 to ensure compatibility with
gnulib.
|