Commit Graph

1099 Commits

Author SHA1 Message Date
Paul Eggert
da2a7671e1 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
changed to use xcalloc, xnmalloc, xnrealloc, respectively,
unless otherwise specified below.

* src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
to allocate kernel_base, kernel_items, kernel_size, since
they needn't be initialized to 0.
(allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
* src/closure.c (new_closure): Likewise, for itemset.
* src/derives.c (derives_compute): Likewise, for delts, derives, q.
* src/lalr.c (set_goto_map): Likewise, for temp_map.
(initialize_F): Likewise, for reads, edge, reads[i], includes[i].
(build_relations): Likewise for edge, states1, includes.
* src/nullable.c (nullable_compute): Likewise, for squeue, relts.
* src/reader.c (packgram): Likewise, for ritem, rules.
* src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
* src/relation.c (relation_digraph): Likewise for VERTICES.
(relation_transpose): Likewise for new_R, end_R.
* src/symtab.c (symbols_token_translations_init): Likewise for
token_translations.
* src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
(token_actions): Likewise for yydefact, actrow, conflrow,
conflict_list.
(save_column): Likewise for froms[symno], tos[symno].
(goto_actions): Likewise for state_count.
(pack_table): Likewise for base, pos, check.
(tables_generate): Likewise for width.

* src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
for initial core.  Just have a separate core, so we needn't worry
about whether kernel_size and kernel_base are initialized.

* src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
kernel_size, kernel_items): Remove unnecessary initialization.
* src/conflicts.c (conflicts): Likewise.
* src/derives.c (derives): Likewise.
* src/muscle_tablc (muscle_insert): Likewise.
* src/relation.c (relation_digraph): Likewise.
* src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
conflrow, conflict_table, conflict_list, table, check):
Likewise.

* src/closure.c (new_closure): Arg is of type unsigned int, not int.
This is because all callers pass unsigned int.
* src/closure.h (new_closure): Likewise.

* src/lalr.c (initialize_F): Initialize reads[i] in all cases.
(build_relations): Initialize includes[i] in all cases.
* src/reader.c (packgram): Always initialize rules[ruleno].prec
and rules[ruleno].precsym.  Initialize members in order.
* src/relation.c (relation_transpose): Always initialize new_R[i]
and end_R[i].
* src/table.c (conflict_row): Initialize 0 at end of conflict_list.

* src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
conflict_list[0] was always 0, but now it isn't initialized.

* src/table.c (table_grow): When conflict_table grew, the grown
area wasn't cleared.  Fix this.
2004-12-10 07:50:44 +00:00
Paul Eggert
86a54ab102 (allocate_itemsets): Use xnmalloc, not xcalloc,
to allocate kernel_base, kernel_items, kernel_size, since
they needn't be initialized to 0.
(set_states): Don't reuse kernel_size and kernel_base
for initial core.  Just have a separate core, so we needn't worry
about whether kernel_size and kernel_base are initialized.
(shift_symbol, redset, shiftset, kernel_base,
kernel_size, kernel_items): Remove unnecessary initialization.
2004-12-10 07:48:43 +00:00
Paul Eggert
8175837596 (CALLOC, MALLOC, REALLOC): Remove. 2004-12-10 07:47:58 +00:00
Paul Eggert
78143b92af (save_column, default_goto):
Use goto_number, not int, for goto numbers.
2004-12-08 05:54:51 +00:00
Paul Eggert
60e3ecc734 (set_goto_map): Don't allow ngotos to equal
GOTO_NUMBER_MAXIMUM, since we occasionally compute
ngotos + 1 without checking for overflow.
(build_relations): Use END_NODE, not -1, to denote end of edges.
(set_goto_map, map_goto, initialize_F, add_loopback_edge,
build_relations): Use goto_number, not int, for goto numbers.
2004-12-08 05:54:20 +00:00
Paul Eggert
b03595a5c2 (GOTO_NUMBER_MAXIMUM): New macro. 2004-12-08 05:53:55 +00:00
Paul Eggert
afbb696d19 XFREE -> free 2004-11-22 21:05:25 +00:00
Paul Eggert
7886c2d419 Use size_t rather than unsigned int in previous patch. 2004-10-22 23:14:00 +00:00
Paul Eggert
ed4cdb7afc (END_NODE): New macro.
(relation_node): Now unsigned int, not short int.
2004-10-22 23:10:39 +00:00
Paul Eggert
0859e438eb (relation_print, traverse, relation_transpose):
Check for END_NODE rather than looking at sign.
2004-10-22 23:10:07 +00:00
Paul Eggert
f55ec70868 (goto_number): Now unsigned int, not short int.
(GOTO_NUMBER_MAXIMUM): Remove.
2004-10-22 23:09:27 +00:00
Paul Eggert
4cf44c0045 (goto_map, ngotos, from_state, to_state): Omit
initial values, since they're never used.
(set_goto_map): ngotos is now unsigned, so test for overflow
2004-10-22 23:08:33 +00:00
Akim Demaille
df09ef2e8f * src/symtab.c (symbol_check_alias_consistency): Also check
type names, destructors, and printers.
Reported by Alexandre Duret-Lutz.
Recode the handling of associativity and precedence in terms
of symbol_precedence_set.
Accept no redeclaration at all, not even equal to the previous
value.
(redeclaration): New.
Use it to factor redeclaration complaints.
(symbol_make_alias): Don't set the type of the alias, let
symbol_check_alias_consistency do it as for other features.
* src/symtab.h (symbol): Add new member prec_location, and
type_location.
* src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
* tests/input.at (Incompatible Aliases): New.
2004-10-11 09:03:55 +00:00
Paul Eggert
2ed24dd8c7 Regenerate. 2004-10-09 18:08:21 +00:00
Akim Demaille
e503aa60d5 * src/parse-gram.y (add_param): Fix the truncation of trailing
spaces.
2004-10-06 15:52:24 +00:00
Akim Demaille
8a8dc872fa Regen. 2004-10-05 08:41:44 +00:00
Paul Eggert
ead9e56eb2 (add_param): Fix bug where NUL was mishandled.
Avoid the use of strchr to avoid future recurrences.
2004-09-27 22:03:42 +00:00
Akim Demaille
b233d5558f * src/parse-gram.y (add_param): Strip the leading and trailing
blanks from a formal argument declaration.
(YY_LOCATION_PRINT): New.
2004-09-27 07:42:04 +00:00
Akim Demaille
3fc16193d9 * data/yacc.c (YY_LOCATION_PRINT): New.
Define when we know YYLTYPE's structure, i.e., when the default
YYLLOC_DEFAULT is used.
* data/c.m4 (b4_yysymprint_generate): Use it.
* data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
value of the result.
(error_start_): Replace with...
(error_range_): this location array.
This allows to replace code relying on the implementation of
locations by portable code.
* data/yacc.c (yylerrsp): Replace with...
(yyerror_range): this.
Every time a token is popped, update yyerror_range[0], to have an
accurate location for the error token.
* data/glr.c (YY_LOCATION_PRINT): New.
(yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
deference a pointer.
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
report the location in %printers.
* src/scan-skel.l: Instead of abort, report error messages to ease
understanding skeleton scanning failures.
2004-09-20 09:32:55 +00:00
Paul Eggert
2ed973bf1d Regenerate. 2004-08-18 20:35:31 +00:00
Paul Eggert
87a8ad5cd3 Remove src/scan-action.l. 2004-08-11 04:19:14 +00:00
Paul Eggert
dca81a78f8 uniqstr wasn't being used for handle_syncline like it should. 2004-08-08 04:57:06 +00:00
Paul Eggert
ee42c6166b (symbol_destructors_output, symbol_printers_output):
Don't assume %union.
2004-07-22 14:39:58 +00:00
Paul Eggert
85f23fae45 Regenerate. 2004-06-21 20:51:32 +00:00
Paul Eggert
8dd162d3ff Use "look-ahead" instead of "lookahead", consistently. 2004-06-21 20:20:31 +00:00
Paul Eggert
329d23c5d6 Regenerate. 2004-05-27 07:40:12 +00:00
Paul Eggert
62cb8a9920 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug.
* configure.ac (AC_PREREQ): Bump to 2.58.
2004-05-27 07:38:17 +00:00
Paul Eggert
e476c87d93 Version 1.875d. 2004-05-21 21:03:41 +00:00
Paul Eggert
233a88ad11 Use size_t (not unsigned int) for hashes, since the gnulib hash module
now uses size_t.
2004-05-07 07:35:10 +00:00
Paul Eggert
a76ca26309 Regenerate. 2004-05-03 07:58:53 +00:00
Paul Eggert
12ffdd2835 * src/parse-gram.y: Put copyright notice inside %{ %} so it
gets copied to the output file.
2004-05-03 07:57:06 +00:00
Paul Eggert
4febdd9667 Reject unescaped newlines in strings. 2004-05-03 07:42:52 +00:00
Paul Eggert
e23d0dd71e Remove more 'intl'-related files while bootstrapping. 2004-05-03 07:36:12 +00:00
Paul Eggert
1f65350a16 Get files from the gnulib and po repositories, instead of relying
on them being in our CVS.  Upgrade to latest versions of gnulib and Automake.
2004-04-28 20:00:56 +00:00
Paul Eggert
6e26ca8c27 Remove more K&R C support. 2004-04-28 06:52:51 +00:00
Paul Eggert
1f916a78e6 Update copyright to 2004. 2004-04-13 17:43:15 +00:00
Paul Eggert
4f16766c00 * src/conflicts.c (conflicts_print): Correct format string typo:
use `%%' to produce literal `%'.  (trivial change)
2004-04-13 17:42:59 +00:00
Paul Eggert
584bbcd839 Regenerate. 2004-03-31 00:41:30 +00:00
Paul Eggert
779e7ceb93 Use 'short int' rather than 'short', and similarly for 'long', 'unsigned', etc. 2004-03-31 00:37:21 +00:00
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