Commit Graph

193 Commits

Author SHA1 Message Date
Paul Eggert
829fd4c70d Semicolons are now allowed before "|". 2003-05-14 23:37:32 +00:00
Akim Demaille
d5a3fe37a9 Bump 1.875b. 2003-02-05 09:58:41 +00:00
Paul Eggert
7aff61d4dc %expect-count violations will be errors again in the future. 2003-02-01 20:10:45 +00:00
Paul Eggert
9289898605 Version 1.875a, dated today. 2003-02-01 08:23:32 +00:00
Paul Eggert
69363a9e4d * NEWS: %expect-violations are now just warnings, reverting
to Bison 1.30 and 1.75 behavior.  This fixes the GCC 3.2
bootstrapping problem reported by Matthias Klose; see
<http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
* src/conflicts.c (conflicts_print): Likewise.
* tests/conflicts.at (%expect not enough, %expect too much,
%expect with reduce conflicts): Likewise.
* doc/bison.texinfo (Expect Decl): Document this.  Also mention
that the warning is enabled if the number of conflicts changes
(not necessarily increases).
2003-01-13 06:41:29 +00:00
Paul Eggert
d600ee67ee Add --disable-yacc. 2003-01-05 06:32:12 +00:00
Paul Eggert
dc546b0f6e Bison 1.875. 2003-01-01 09:04:56 +00:00
Paul Eggert
963fcc1705 Version 1.75f. 2002-12-29 03:17:12 +00:00
Paul Eggert
23f2d9dc0f Version 1.75e. 2002-12-24 08:35:23 +00:00
Paul Eggert
75eb3bc4e7 * If the user does not define YYSTYPE as a macro, Bison now declares it
using typedef instead of defining it as a macro.  POSIX requires this.
  For consistency, YYLTYPE is also declared instead of defined.

* %union directives can now have a tag before the `{', e.g., the
  directive `%union foo {...}' now generates the C code
  `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
  The default union tag is `YYSTYPE', for compatibility with Solaris 9 Yacc.
  For consistency, YYLTYPE's struct tag is now `YYLTYPE' instead of `yyltype'.

* `yystype' and `yyltype' are now obsolescent macros instead of being
  typedefs or tags; they are no longer documented and will be
  withdrawn in a future release.

Fix copyright notice.
2002-12-24 07:40:14 +00:00
Paul Eggert
20daca0631 Omit mentions of %lex-param and %parse-param from the documentation
for now.
2002-12-18 00:09:10 +00:00
Paul Eggert
d2caf5545c Add date to 1.75d notice. 2002-12-13 13:14:11 +00:00
Paul Eggert
d1de53722b Version 1.75d. 2002-12-13 12:21:57 +00:00
Paul Eggert
74724a70a5 Describe Yacc library, lex-param and parse-param changes. 2002-11-30 09:18:34 +00:00
Paul Eggert
3af4feb22f Version 1.75c. 2002-11-25 07:56:44 +00:00
Paul Eggert
6e649e659e * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
tests/action.at, tests/calc.at, tests/conflicts.at,
tests/cxx-type.at, tests/regression.at:
"parse error" -> "syntax error" for POSIX compatibility.
"parsing stack overflow..." -> "parser stack overflow" so
that code matches Bison documentation.
2002-11-15 20:32:21 +00:00
Akim Demaille
9501dc6e69 * tests/atlocal.in (CPPFLAGS): We have config.h.
* tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
New.
* tests/actions.at, tests/calc.at, tests/conflicts.at,
* tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
* tests/regression.at, tests/torture.at: Use them for all the
grammars that are to be compiled.
* tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
* tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
* doc/bison.texinfo (GLR Parsers): Document `inline'.
2002-11-14 09:58:01 +00:00
Akim Demaille
caf52fdfab Bump to 1.75c. 2002-11-13 15:17:35 +00:00
Paul Eggert
87f721cc87 Version 1.75b. 2002-11-13 08:32:08 +00:00
Akim Demaille
7bd6c77e5e * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
defines it.
* data/glr.c (yystos): New.
(b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
(YYDSYMPRINT): New.
(yyval): Don't define it, it is handled via M4.
(yyrecoverParseError): Free verbosely the discarded symbols.
* data/yacc.c (yysymprint): Remove, rather...
(b4_yysymprint_generate): invoke.
* data/c.m4 (b4_yysymprint_generate): New.
Accept pointers as arguments, as opposed to the version from
yacc.c.
(b4_yydestruct_generate): Likewise.
* tests/cations.at (Printers and Destructors): Use Bison directives
instead of CPP macros.
Don't rely on internal details.
2002-11-12 09:03:13 +00:00
Akim Demaille
72f889cca3 * doc/bison.texinfo (Destructor Decl): New. 2002-11-12 08:35:00 +00:00
Akim Demaille
959e5f515a Update. 2002-11-07 14:28:40 +00:00
Paul Eggert
fdac0091ce Minor spelling and punctuation fix. 2002-11-07 07:07:25 +00:00
Akim Demaille
6e40b4ebd4 #line should have quoted strings.
Ideally, this should be done by m4_quotearg.
* src/scan-skel.l: Include quotearg.h.
Quote __ofile__.
* src/output.c (symbol_printers_output)
(symbol_destructors_output): Quote the file name.
2002-11-06 16:22:04 +00:00
Akim Demaille
437c2d8000 Restore --no-lines.
Reported by Jim Kent.
* data/c.m4 (b4_syncline): New.
* data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
* src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
* src/output.c (user_actions_output): Likewise.
(prepare): Define 'b4_synclines_flag'.
2002-11-06 14:11:47 +00:00
Akim Demaille
900c5db537 * src/main.c (main): Free `infile'.
* src/scan-gram.l (handle_syncline): New.
Recognize `#line'.
* src/output.c (user_actions_output, symbol_destructors_output)
(symbol_printers_output): Use the location's file name, not
infile.
* src/reader.c (prologue_augment, epilogue_set): Likewise.
2002-11-06 08:08:46 +00:00
Paul Eggert
886a425c6f Bison now parses C99 lexical constructs like digraphs, UCNs, and
backslash-newline within C escape sequences, as POSIX now requires.
2002-11-06 06:56:35 +00:00
Akim Demaille
2a8d363aab * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
New.
* data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
(b4_parse_param): Remove.
Use b4_identification.
Propagate b4_pure_args where needed to pass them to yyerror.
* data/glr.m4 (b4_parse_param): Remove.
(b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
(b4_lpure_formals): New.
Use b4_identification.
(YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
b4_user_formals and b4_user_args.
(yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
(yyreportAmbiguity): When using a pure parser, also need
the location, and the parse-params.
Adjust callers.
(yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
When using a pure parser, also need the parse-params.
Adjust callers.
* tests/calc.at: Test pure (%pure-parser) and absolutely pure
(%pure-parser + %parse-param) LALR and GLR parsers.
(AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
(_AT_DATA_CALC_Y): Equip for purity of yyerror.
(_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
* tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
* doc/bison.texinfo: Untabify the whole file.
(Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
(Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
(Error Reporting): Adjust to these new directives.
Document %error-verbose, deprecate YYERROR_VERBOSE.
2002-11-03 16:41:57 +00:00
Paul Eggert
5c16c6b13a Version 1.75a. 2002-10-25 06:05:50 +00:00
Paul Eggert
71d1d25c7a Officially drop support for building Bison with K&R C,
since it didn't work anyway and it's not worth worrying about.
2002-10-17 01:24:46 +00:00
Akim Demaille
ae26e1f02a Version 1.75. 2002-10-14 16:29:41 +00:00
Akim Demaille
d90c934c05 Update. 2002-10-14 12:32:48 +00:00
Akim Demaille
f50adbbdb0 GLR parsers sometimes raise parse errors instead of performing the
default reduction.
Reported by Charles-Henry de Boysson.
* tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
check the length of the	traces when %glr.
(_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
GLR's traces.
(AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
Test GLR parsers.
* data/glr.c (YYLEFTMOST_STATE): Fix its value.
(yyltype): Remove the yy prefix from the member names.
(yytable): Complete its comment.
(yygetLRActions): Map error action number from YYTABLE from
YYTABLE_NINF to 0.
(yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
(which was a bug: it should have been YYTABEL_NINF, and yet it was
not satisfying as we could compare an YYACTION computed from
YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
only value for error actions.
(yyreportParseError): In verbose parse error messages, don't issue
`error' in the list of expected tokens.
* data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
next action to perform to match glr.c's decoding.
(yytable): Complete its comment.
2002-10-13 14:25:14 +00:00
Akim Demaille
b7195100fd * po/id.po: New. 2002-10-11 10:14:32 +00:00
Paul Eggert
7933f2b5dd Bison should now work on 64-bit hosts. 2002-10-07 06:08:30 +00:00
Paul Eggert
420f93c83b Version 1.50. 2002-10-05 06:25:50 +00:00
Akim Demaille
e88dbdbf44 Fixes from Jim Meyering. 2002-09-30 08:40:51 +00:00
Akim Demaille
805e703284 Bump to 1.49d. 2002-09-27 15:40:39 +00:00
Akim Demaille
f414d77d38 More about Java. 2002-09-11 08:50:55 +00:00
Paul Eggert
a861a3390f Mention that GNU M4 is now required. Clarify what is meant by "larger
grammars".  Mention the pt_BR translation.
2002-08-12 13:59:13 +00:00
Akim Demaille
217598dadc In verbose parse error message, don't report `error' as an
expected token.
* tests/actions.at (Printers and Destructors): Adjust.
* tests/calc.at (Calculator $1): Adjust.
* data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
error message, do not report the parser accepts the error token in
that state.
2002-07-30 11:56:44 +00:00
Akim Demaille
e8832397ea Report rules which are never reduced by the parser: those hidden
by conflicts.
* src/LR0.c (save_reductions): Don't make the final state too
different: save its reduction (accept) instead of having a state
without any action (no shift or goto, no reduce).
Note: the final state is now a ``regular'' state, i.e., the
parsers now contain `reduce 0' as default reduction.
Nevertheless, since they decide to `accept' when yystate =
final_state, they still will not reduce rule 0.
* src/print.c (print_actions, print_reduction): Adjust.
* src/output.c (action_row): Track reduced rules.
(token_actions): Report rules never reduced.
* tests/conflicts.at, tests/regression.at: Adjust.
2002-07-30 11:06:50 +00:00
Paul Hilfinger
676385e29c Initial check-in introducing experimental GLR parsing. See entry in
ChangeLog dated 2002-06-27 from Paul Hilfinger for details.
2002-06-28 02:26:44 +00:00
Akim Demaille
8c165d891d * src/files.c (compute_base_names): When computing the output file
names from the input file name, strip the directory part.
2002-06-18 12:39:54 +00:00
Akim Demaille
6b98e4b563 Copy BYacc's nice way to report the grammar.
* src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
New.
Don't print the rules' location, it is confusing and useless.
(rule_print): Use grammar_rhs_print.
* src/print.c (print_grammar): Use grammar_rules_print.
2002-06-15 18:23:12 +00:00
Akim Demaille
9af3fbce7c * src/reader.c (grammar_current_rule_prec_set).
(grammar_current_rule_check): New, eved out from...
(readgram): here.
Remove `xaction', `first_rhs': useless.
* tests/input.at (Type clashes): New.
* tests/existing.at (GNU Cim Grammar): Adjust.
2002-06-11 08:08:22 +00:00
Akim Demaille
b408954b40 * src/state.h (state_t): `solved_conflicts' is a new member.
* src/LR0.c (new_state): Set it to 0.
* src/conflicts.h, src/conflicts.c (print_conflicts)
(free_conflicts, solve_conflicts): Rename as...
(conflicts_print, conflicts_free, conflicts_solve): these.
Adjust callers.
* src/conflicts.c (enum conflict_resolution_e)
(solved_conflicts_obstack): New, used by...
(log_resolution): this.
Adjust to attach the conflict resolution to each state.
Complete the description with the precedence/associativity
information.
(resolve_sr_conflict): Adjust.
* src/print.c (print_state): Output its solved_conflicts.
* tests/conflicts.at (Unresolved SR Conflicts)
(Solved SR Conflicts): Exercise --report=all.
2002-05-26 20:25:52 +00:00
Akim Demaille
5504898e82 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
`Error:' lines.
* data/bison.simple (yystos) [YYDEBUG]: New.
(yyparse) [YYDEBUG]: Display the symbols which are popped during
error recovery.
* tests/regression.at (Web2c Actions): Adjust: yystos is output now.
2002-05-26 18:38:41 +00:00
Akim Demaille
ec3bc3961d * doc/bison.texinfo (Debugging): Split into...
(Tracing): this new section, its former contents, and...
(Understanding): this new section.
* src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
by...
(report_flag): this.
Adjust all dependencies.
(report_args, report_types, report_argmatch): New.
(usage, getargs): Report/support -r, --report.
* src/options.h
(struct option_table_struct): Rename as..,
(struct option_table_s): this.
Rename the `set_flag' member to `flag' to match with getopt_long's
struct.
* src/options.c (option_table): Split verbose into an entry for
%verbose, and another for --verbose.
Support --report/-r, so remove -r from the obsolete --raw.
* src/print.c: Attach full item sets and lookaheads reports to
report_flag instead of trace_flag.
* lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
2002-05-25 16:12:40 +00:00
Paul Eggert
68cd8af38b Document the recent error-recovery fix by Paul Hilfinger. 2002-05-24 12:38:52 +00:00