Commit Graph

1610 Commits

Author SHA1 Message Date
Paul Eggert 2ae64eed27 (version): Update copyright year to 2004. 2004-03-30 08:11:20 +00:00
Paul Hilfinger d63282419d * src/parse-gram.y: Define PERCENT_EXPECT_RR.
(declaration): Replace expected_conflicts with expected_sr_conflicts.
Add %expect-rr rule.

* src/scan-gram.l: Recognize %expect-rr.

* src/conflicts.h (expected_sr_conflicts): Rename from
expected_conflicts.
(expected_rr_conflicts): Declare.

* src/conflicts.c (expected_sr_conflicts): Rename from
expected_conflicts.
(expected_rr_conflicts): Define.
(conflicts_print): Check r/r conflicts against expected_rr_conflicts
for GLR parsers.
Use expected_sr_conflicts in place of expected_conflicts.
Warn if expected_rr_conflicts used in non-GLR parser.

* doc/bison.texinfo: Add documentation for %expect-rr.
2004-03-26 22:41:16 +00:00
Paul Eggert 1452af69b4 Add support for hex token numbers. 2004-03-08 20:49:34 +00:00
Paul Eggert dd0e0635ec Replace INCLUDES with AM_CPPFLAGS, fixing a bug in src/Makefile.am
reported by Paul Hilfinger.
2004-02-02 22:36:49 +00:00
Paul Eggert eecf08fe94 (output_skeleton): Rename local var. 2003-12-24 07:55:25 +00:00
Paul Eggert 92ac370570 Do not allow NUL bytes in string literals or character constants. 2003-10-07 07:32:57 +00:00
Paul Eggert 66ef8b9d65 Regenerate. 2003-10-01 22:00:13 +00:00
Paul Eggert 22fccf958f Use "%no-default-prec" instead of "%default-prec 0". 2003-10-01 21:33:24 +00:00
Akim Demaille fc8f296538 VCG no longer supports long_straight_phase.
* src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
* src/print_graph.c (print_graph): Adjust.
2003-10-01 07:46:41 +00:00
Akim Demaille 92f5e991da Update. 2003-10-01 07:46:02 +00:00
Paul Eggert 39a06c251a Add %default-prec. 2003-09-30 20:11:29 +00:00
Akim Demaille cd3684cfa8 When reducing initial empty rules, Bison parser read an initial
location that is not defined.  This results in garbage, and that
affects Bison's own parser.  Therefore we need (i) to extend Bison
to support a means to initialize this location, and (ii) to use
this CVS Bison to fix CVS Bison's parser.
* src/reader.h, reader.c (epilogue_augment): Remove, replace
with...
* src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
* src/parse-gram.y: Adjust.
(%initial-action): New.
(%error-verbose): Since we require CVS Bison, there is no reason
not to use it.
* src/scan-gram.l: Adjust.
* src/Makefile.am (YACC): New, to make sure we use our own parser.
* data/yacc.c (yyparse): Use b4_initial_action.
2003-08-25 15:16:25 +00:00
Paul Eggert 16caa4f431 (merge_output): Adjust to the change to ../data/glr.c. 2003-08-04 19:08:38 +00:00
Paul Eggert 465b4444e8 Regenerate. 2003-06-17 08:34:53 +00:00
Paul Hilfinger 25005f6ab0 * data/glr.c (YYERROR): Update definition.
(yyrecoverSyntaxError): Correct yyerrState logic. Correct comment.
Allow states with only a default reduction.

Fixes to avoid problem that $-N rules in GLR parsers can cause
buffer overruns, corrupting state.

* src/output.c (prepare_rules): Output max_left_semantic_context.
* src/reader.h (max_left_semantic_context): New
* src/scan-gram.l (max_left_semantic_context): Define.
(handle_action_dollar): Update max_left_semantic_context.
* data/glr.c (YYMAXLEFT): New.
(yydoAction): Increase yyrhsVals size.
(yyresolveAction): Ditto.

Fixes to problems with location handling in GLR parsers reported by
Frank Heckenbach (2003/06/05).

* data/glr.c (YYLTYPE): Make trivial if locations not used.
(YYRHSLOC): Add parentheses, make depend on whether locations used.
(YYLLOC_DEFAULT): Ditto.
(yyuserAction): Use YYLLOC_DEFAULT.
(yydoAction): Remove redundant code.

* tests/cxx-type.at: Exercise location information.
(yylex): Track locations.
(stmtMerge): Return value rather than printing.
2003-06-10 02:44:58 +00:00
Paul Eggert 83a457be99 Regenerate. 2003-05-24 19:26:35 +00:00
Paul Eggert d08290769c Switch from 'int' to 'bool' where that makes sense. 2003-05-24 19:16:02 +00:00
Paul Eggert eae34f44e6 Regenerate. 2003-05-14 19:28:04 +00:00
Paul Eggert 8d0a98bb50 (rules_or_grammar_declaration): Require a
semicolon after a grammar declaration, in the interest of possible
future changes to the Bison input language.
Do not allow a stray semicolon at the start of the grammar.
(rhses.1): Allow one or more semicolons after any rule, including
just before "|" as required by POSIX.
2003-05-14 19:26:16 +00:00
Akim Demaille 916708d59e * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
* src/getargs.c, src/getargs.h: here, as bool, not int.
(nondeterministic_parser): New.
* src/parse-gram.y, src/scan-gram.l: Support
%nondeterministic-parser.
* src/output.c (prepare): Use nondeterministic_parser instead
of glr_parser where appropriate.
* src/tables.c (conflict_row, action_row, save_row)
(token_actions, token_actions, pack_vector): Ditto.
2003-04-29 12:57:36 +00:00
Paul Eggert aa4180418f Add %option nounput, since we no longer use unput.
(unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
Do not insert the expected token via unput, as this runs afoul
of a POSIX-compatibility bug in flex 2.5.31.
All uses changed to BEGIN the parent state,
since we no longer insert the expected token via unput.
2003-04-18 07:26:19 +00:00
Paul Eggert 0de45ae542 (set_conflicts): Resolve all conflicts, not just
the first one.  This change is from Paul Hilfinger, and it fixes
regression reported by Werner Lemberg in
<http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.

(resolve_sr_conflict): Don't invoke state_errs_set
unless one or more tokens have been explicitly made errors.
Otherwise, the above change causes Bison to abort.
2003-04-18 05:07:08 +00:00
Akim Demaille d423d46080 * src/output.c (prepare_symbols): Avoid trailing spaces in the
output.
2003-03-31 09:17:40 +00:00
Paul Eggert 9986d7a732 Add 'yacc'. 2003-03-14 01:23:04 +00:00
Paul Eggert 379f0ac840 (YY_USER_INIT): Initialize code_start, too.
(<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
cursor, instead of leaving it undefined.  This fixes a bug
reported by Tim Van Holder in
<http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
2003-03-13 07:07:17 +00:00
Paul Eggert f61aad9399 Merge changes from gnulib. This was prompted because the CVS
snapshot of Bison didn't build on Solaris 7 due to strnlen problems.
2003-03-12 23:08:11 +00:00
Akim Demaille 650aa2cfbf Regen. 2003-03-03 09:00:12 +00:00
Paul Eggert a2bc9dbc7b (code_start): Initialize it to scanner_cursor,
not loc->end, since loc->end might contain garbage and this leads
to undefined behavior on some platforms.
(id_loc, token_start): Use (IF_LINTed) initial values that do not
depend on *loc, so that the reader doesn't give the the false
impression that *loc is initialized.
(<INITIAL>"%%"): Do not bother setting code_start, since its value
does not survive the return.
2003-03-02 06:55:15 +00:00
Akim Demaille 0433ba88f9 * src/scan-gram.l (code_start): Always initialize it when entering
into yylex, as SC_EPILOGUE is activated *before* the corresponding
yylex invocation.  An alternative would be making it static, but
then it starts with the second %%'s beginning, instead of its end.
2003-03-01 10:55:31 +00:00
Akim Demaille 6d5aa694aa Regen. 2003-03-01 08:31:06 +00:00
Akim Demaille 1d64f0bab6 Regen. 2003-02-05 09:57:02 +00:00
Paul Eggert a737b2163c Use more-consistent naming conventions for local vars. 2003-02-03 15:35:57 +00:00
Paul Eggert ba24760f05 (start_symbol): Remove unused decl.
Use more-consistent naming conventions for local vars.
2003-02-03 15:33:19 +00:00
Akim Demaille 68e93ad549 * src/scan-skel.l: Scan more than one inert character per yylex
invocation.
2003-02-02 10:55:20 +00:00
Paul Eggert 9a2b42a3ff Update copyright date to 2003. 2003-02-01 08:16:17 +00:00
Paul Eggert 34e1d16097 (symbol_printers_output): Fix typo that led
to core dump.  Problem reported by Antonio Rus in
<http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
2003-01-17 08:43:08 +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 8522c9ed2a (version): Update copyright year. 2003-01-11 08:11:32 +00:00
Akim Demaille f0057011f7 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@. 2003-01-09 12:45:08 +00:00
Paul Eggert a504e06dd7 (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
(EXTRA_SCRIPTS): New var, for yacc.
2003-01-05 06:26:52 +00:00
Paul Eggert 0fff129c7c ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
grow to a huge size with typical invocation.
2003-01-04 00:31:28 +00:00
Paul Eggert fd520abff8 (QPUTS): Omit redundant `;' from macro definition. 2003-01-03 21:56:01 +00:00
Paul Eggert b14ec5333b ("@oline@"): Output lineno+1, not lineno. 2003-01-03 14:28:35 +00:00
Paul Eggert 45aa0550a1 (_Bool, bool, false, true, __bool_true_false_are_defined):
Use the pattern recommended by Autoconf 2.57, except also protect
against double-definition.
2003-01-03 14:15:16 +00:00
Paul Eggert d891bc49ac Comment fixes. 2003-01-02 20:27:54 +00:00
Paul Eggert 8e4900ef40 Regenerate. 2003-01-01 10:09:55 +00:00
Paul Eggert 1deb9bdcad src/scan-gram.l (<SC_BRACED_CODE>"}"): Append ";" only in braced code,
not in unions etc.
2002-12-31 02:26:51 +00:00
Paul Eggert 83adb046bf (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
Moved here from...
(<INITIAL>","): Here.  This causes stray "," to be treated
more uniformly.
2002-12-30 23:38:20 +00:00
Paul Eggert 255227393f (<SC_BRACED_CODE>"}"): Append ";" before the last brace in braced code
when not in Yacc mode, for compatibility with Bison 1.35.  This
resurrects the 2001-12-15 patch to src/reader.c.
2002-12-30 22:40:52 +00:00
Paul Eggert 5b25cd7cd8 (YYDECL): Use YYSTYPE, not its deprecated alias yystype. This follows
up the 2002-12-24 YYSTYPE bug fix.
2002-12-30 22:35:56 +00:00