]> git.saurik.com Git - bison.git/blame - ChangeLog
* data/lalr1.cc (struct yyltype): Don't define it, since we use
[bison.git] / ChangeLog
CommitLineData
21846f69
AD
12002-09-06 Akim Demaille <akim@epita.fr>
2
3 * data/lalr1.cc (struct yyltype): Don't define it, since we use
4 LocationType.
5 (b4_ltype): Default to yy::Location from location.hh.
6
c0ad8bf3
AD
72002-09-04 Jim Meyering <jim@meyering.net>
8
9 * data/yacc.c: Guard the declaration of yytoknum also with
10 `#ifdef YYPRINT', so it is declared only when used.
11
3a93251e
AD
122002-09-04 Akim Demaille <akim@epita.fr>
13
14 * configure.in: Rename as...
15 * configure.ac: this.
16 Bump to 1.49c.
17
427c0dda
AD
182002-09-04 Akim Demaille <akim@epita.fr>
19
20 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
21 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
22 translate maintainer only messages.
23
6a254321
PE
242002-08-12 Paul Eggert <eggert@twinsun.com>
25
645e30d1
PE
26 Version 1.49b.
27
6a254321
PE
28 * Makefile.am (SUBDIRS): Remove intl.
29 (DISTCLEANFILES): Remove.
30 * NEWS: Mention that GNU M4 is now required. Clarify what is
31 meant by "larger grammars". Mention the pt_BR translation.
32 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
33 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
34 Bump version from 0.11.2 to 0.11.5.
35 (BISON_PREREQ_STAGE): Remove.
36 (AM_GNU_GETTEXT): Use external gettext.
37 (AC_OUTPUT): Remove intl/Makefile.
38
39 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
40
41 * data/glr.c: Include string.h, for strlen.
42 (yyreportParseError): Use size_t for yysize.
43 (yy_yypstack): No longer nested inside yypstates, as nested
44 functions are not portable. Do not assume size_t is the
45 same width as int.
46 (yypstates): Do not assume that ptrdiff_t is the same width
47 as int, and similarly for yyposn and YYINDEX.
48
49 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
50
51 * lib/Makefile.am (INCLUDES): Do not include from the intl
52 directory, which has been removed.
53 * src/Makefile.am (INCLUDES): Likewise.
54
55 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
56 (bitsets_sources, additional_bitsets_sources, timevars_sources):
57 New vars.
58
59 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
60 * tests/Makefile.am (EXTRA_DIST): Likewise.
61
62 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
63 Do not assume that bitset_windex is the same width as unsigned.
64
65 * lib/abitset.c (abitset_unused_clear): Do not assume that
66 bitset_word is the same width as int.
67 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
68 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
69 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
70 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
71 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
72
73 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
74 portability to one's complement hosts!).
75 * lib/ebitset.c (ebitset_op1): Likewise.
76 * lib/lbitset.c (lbitset_op1): Likewise.
77
78 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
79 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
80 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
81 Sync with fileutils.
82 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
83 lib/gettext.h: Sync with diffutils.
84
85 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
86 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
87
88 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
89 PROTOTYPES to check for prototypes, and "defined __STDC__" to
90 check for void *.
91
92 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
93 size_t; the old version tried to do this but casted improperly.
94 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
95 (bitset_test): Now returns int, not unsigned long.
96
97 * lib/bitset_stats.c: Include "gettext.h".
98 (_): New macro.
99 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
100 name locals "index", as it generates unnecessary warnings on some
101 hosts that have an "index" function.
102
103 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
104 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
105 they need translation.
106 * src/LR0.c (state_list_append, new_itemsets, get_state,
107 append_states, generate_states): Likewise.
108 * src/assoc.c (assoc_to_string): Likewise.
109 * src/closure.c (print_closure, set_firsts, closure): Likewise.
110 * src/gram.c (grammar_dump): Likewise.
111 * src/injections.c (injections_compute): Likewise.
112 * src/lalr.c (lookaheads_print): Likewise.
113 * src/relation.c (relation_transpose): Likewise.
114 * src/scan-gram.l: Likewise.
115 * src/tables.c (table_grow, pack_vector): Likewise.
116
117 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
118 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
119 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
120 * m4/mbstate_t.m4: Sync with fileutils.
121 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
122
123 * po/LINGUAS: Add pt_BR.
124 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
125 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
126 lib/timevar.c.
127 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
128 manual recommends.
129 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
130
131 * src/complain.c (strerror_r): Remove decl; not needed.
132 (strerror): Use same pattern as ../lib/error.c.
133
134 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
135
136 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
137
138 * src/main.c (main): Cast result of bindtextdomain and textdomain
139 to void, to avoid a GCC warning when --disable-nls is in effect.
140
141 * src/scan-gram.l: Use strings rather than escapes when possible,
142 to minimize the number of warnings from xgettext.
143 (handle_action_dollar, handle_action_at): Don't use isdigit,
144 as it mishandles negative chars and it may not work as expected
145 outside the C locale.
146
147 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
148 this is a GCC extension and is not portable to other compilers.
149
150 * src/system.h (alloca): Use same pattern as ../lib/error.c.
151 Do not include <ctype.h>; no longer needed.
152 Do not include <malloc.h>; no longer needed (and generates
153 warnings on OpenBSD 3.0).
154
155 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
156 it's not portable.
157
158 * tests/regression.at: Do not use 'cc -c input.c -o input';
159 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
160
161 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
162 exit status as failure, not just exit status 1. Sun C exits
163 with status 2 sometimes.
164
165 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
166 Use it for the two large tests.
167
c8f002c7
AD
1682002-08-02 Akim Demaille <akim@epita.fr>
169
170 * src/conflicts.c (conflicts_output): Don't output rules never
171 reduced here, since anyway that computation doesn't work.
172 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
173 (rule_useless_p, rule_never_reduced_p): New.
174 (grammar_rules_partial_print): Use a filter instead of a range.
175 Display the title only if needed.
176 (grammar_rules_print): Adjust.
177 (grammar_rules_never_reduced_report): New.
178 * src/tables.c (action_row): Move the computation of rules never
179 reduced to...
180 (token_actions): here.
181 * src/main.c (main): Make the parser before making the report, so
182 that rules never reduced are computed.
183 Call grammar_rules_never_reduced_report.
184 * src/print.c (print_results): Report rules never reduced.
185 * tests/conflicts.at, tests/reduce.at: Adjust.
186
cd08e51e
AD
1872002-08-01 Akim Demaille <akim@epita.fr>
188
189 Instead of attaching lookaheads and duplicating the rules being
190 reduced by a state, attach the lookaheads to the reductions.
191
192 * src/state.h (state_t): Remove the `lookaheads',
193 `lookaheads_rule' member.
194 (reductions_t): Add a `lookaheads' member.
195 Use a regular array for the `rules'.
196 * src/state.c (reductions_new): Initialize the lookaheads member
197 to 0.
198 (state_rule_lookaheads_print): Adjust.
199 * src/state.h, src/state.c (state_reductions_find): New.
200 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
201 (count_rr_conflicts): Adjust.
202 * src/lalr.c (LArule): Remove.
203 (add_lookback_edge): Adjust.
204 (state_lookaheads_count): New.
205 (states_lookaheads_initialize): Merge into...
206 (initialize_LA): this.
207 (lalr_free): Adjust.
208 * src/main.c (main): Don't free nullable and derives too early: it
209 is used by --verbose.
210 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
211
bb0027a9
AD
2122002-08-01 Akim Demaille <akim@epita.fr>
213
214 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
215 `rule_number_t**'.
216 (set_derives, free_derives): Rename as...
217 (derives_compute, derives_free): this.
218 Adjust all dependencies.
219 * src/nullable.c (set_nullable, free_nullable): Rename as...
220 (nullable_compute, nullable_free): these.
221 (rule_list_t): Store rule_t *, not rule_number_t.
222 * src/state.c (state_rule_lookaheads_print): Directly compare rule
223 pointers, instead of their numbers.
224 * src/main.c (main): Call nullable_free, and derives_free earlier,
225 as they were lo longer used.
226
3325ddc4
AD
2272002-08-01 Akim Demaille <akim@epita.fr>
228
229 * lib/timevar.c (get_time): Include children time.
230 * src/lalr.h (LA, LArule): Don't export them: used with the
231 state_t.
232 * src/lalr.c (LA, LArule): Static.
233 * src/lalr.h, src/lalr.c (lalr_free): New.
234 * src/main.c (main): Call it.
235 * src/tables.c (pack_vector): Check whether loc is >= to the
236 table_size, not >.
237 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
238 (tables_generate): do it, since that's also it which allocates
239 them.
240 Don't free LA and LArule, main does.
241
c6f1a33c
AD
2422002-07-31 Akim Demaille <akim@epita.fr>
243
244 Separate parser tables computation and output.
245
246 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
247 (conflict_list, conflict_list_cnt, table, check, table_ninf)
248 (yydefgoto, yydefact, high): Move to...
249 * src/tables.h, src/tables.c: here.
250 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
251 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
252 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
253 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
254 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
255 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
256 (action_row, save_row, token_actions, save_column, default_goto)
257 (goto_actions, sort_actions, matching_state, pack_vector)
258 (table_ninf_remap, pack_table, prepare_actions): Move to...
259 * src/tables.c: here.
260 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
261 * src/output.c (token_actions, output_base, output_conflicts)
262 (output_check): Merge into...
263 (prepare_actions): this.
264 (actions_output): Rename as...
265 (user_actions_output): this.
266 * src/main.c (main): Call tables_generate and tables_free.
267
1509d42f
AD
2682002-07-31 Akim Demaille <akim@epita.fr>
269
270 Steal GCC's --time-report support.
271
272 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
273 stolen/adjusted from GCC.
274 * m4/stage.m4: Remove time related checks.
275 * m4/timevar.m4: New.
276 * configure.in: Adjust.
277 * src/system.h: Adjust to using timevar.h.
278 * src/getargs.h, src/getargs.c: Support trace_time for
279 --trace=time.
280 * src/main.c (stage): Remove.
281 (main): Replace `stage' invocations with timevar calls.
282 * src/output.c: Insert pertinent timevar calls.
283
273a74fa
AD
2842002-07-31 Akim Demaille <akim@epita.fr>
285
286 Let --trace have arguments.
287
288 * src/getargs.h (enum trace_e): New.
289 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
290 (long_options, short_options): --trace/-T takes an optional
291 argument.
292 Change all the uses of trace_flag to reflect the new flags.
293 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
294
295 Strengthen `stage' portability.
296
297 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
298 * configure.in: Use it.
299 Don't check for malloc.h and sys/times.h.
300 * src/system.h: Include them when appropriate.
301 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
302 times and struct tms are available.
303
217598da
AD
3042002-07-30 Akim Demaille <akim@epita.fr>
305
306 In verbose parse error message, don't report `error' as an
307 expected token.
308 * tests/actions.at (Printers and Destructors): Adjust.
309 * tests/calc.at (Calculator $1): Adjust.
310 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
311 error message, do not report the parser accepts the error token in
312 that state.
313
52489d44
AD
3142002-07-30 Akim Demaille <akim@epita.fr>
315
316 Normalize conflict related messages.
317
318 * src/complain.h, src/complain.c (warn, complain): New.
319 * src/conflicts.c (conflicts_print): Use them.
320 (conflict_report_yacc): New, extracted from...
321 (conflicts_print): here.
322 * tests/conflicts.at, tests/existing.at: Adjust.
323
e8832397
AD
3242002-07-30 Akim Demaille <akim@epita.fr>
325
326 Report rules which are never reduced by the parser: those hidden
327 by conflicts.
328
329 * src/LR0.c (save_reductions): Don't make the final state too
330 different: save its reduction (accept) instead of having a state
331 without any action (no shift or goto, no reduce).
332 Note: the final state is now a ``regular'' state, i.e., the
333 parsers now contain `reduce 0' as default reduction.
334 Nevertheless, since they decide to `accept' when yystate =
335 final_state, they still will not reduce rule 0.
336 * src/print.c (print_actions, print_reduction): Adjust.
337 * src/output.c (action_row): Track reduced rules.
338 (token_actions): Report rules never reduced.
339 * tests/conflicts.at, tests/regression.at: Adjust.
340
caf23d24
AD
3412002-07-30 Akim Demaille <akim@epita.fr>
342
343 `stage' was accidently included in a previous patch.
344 Initiate its autoconfiscation.
345
346 * configure.in: Look for malloc.h and sys/times.h.
347 * src/main.c (stage): Adjust.
348 Report only when trace_flag.
349
640748ee
AD
3502002-07-29 Akim Demaille <akim@epita.fr>
351
352 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
353 state_number_t.
354 (errs_t): symbol_t*, not symbol_number_t.
355 (reductions_t): rule_t*, not rule_number_t.
356 (FOR_EACH_SHIFT): New.
357 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
358 * src/print.c, src/print_graph.c: Adjust.
359
88bce5a2
AD
3602002-07-29 Akim Demaille <akim@epita.fr>
361
362 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
363
364 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
365 (endtoken, accept): these.
366 * src/reader.c (reader): Set endtoken's default tag to "$end".
367 Set undeftoken's tag to "$undefined" instead of "$undefined.".
368 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
369 Adjust.
370
1bfb97db
AD
3712002-07-29 Akim Demaille <akim@epita.fr>
372
373 * src/reduce.c (reduce_grammar): When the language is empty,
374 complain about the start symbol, not the axiom.
375 Use its location.
376 * tests/reduce.at (Empty Language): New.
377
fc5734fe
AD
3782002-07-26 Akim Demaille <akim@epita.fr>
379
380 * src/reader.h, src/reader.c (gram_error): ... can't get
381 yycontrol without making too strong assumptions on the parser
382 itself.
383 * src/output.c (prepare_tokens): Use the real 0th value of
384 token_translations instead of `0'.
385 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
386 visible here.
387 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
388 for the time being: %locations ought to provide it to yyerror.
389
3650b4b8
AD
3902002-07-25 Akim Demaille <akim@epita.fr>
391
392 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
393 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
394 * tests/regression.at (Web2c Actions): Adjust.
395
4b3d3a8e
AD
3962002-07-25 Akim Demaille <akim@epita.fr>
397
398 Stop storing rules from 1 to nrules + 1.
399
400 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
401 * src/nullable.c, src/output.c, src/print.c, src/reader.c
402 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
403 Iterate from 0 to nrules.
404 Use rule_number_as_item_number and item_number_as_rule_number.
405 Adjust to `derive' now containing possibly 0.
406 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
407 Handle the `- 1' part in rule numbers from/to item numbers.
408 * src/conflicts.c (log_resolution): Fix the message which reversed
409 shift and reduce.
410 * src/output.c (action_row): Initialize default_rule to -1.
411 (token_actions): Adjust.
412 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
413 expected output.
414 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
415
4a2a22f4
AD
4162002-07-25 Akim Demaille <akim@epita.fr>
417
418 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
419 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
420 (b4_c_knr_arg_decl): New.
421 * data/yacc.c: Use it to define yysymprint, yydestruct, and
422 yyreport_parse_error.
423
b8df3223
AD
4242002-07-25 Akim Demaille <akim@epita.fr>
425
426 * data/yacc.c (yyreport_parse_error): New, extracted from...
427 (yyparse): here.
428 (yydestruct, yysymprint): Move above yyparse.
429 Be K&R compliant.
430
a762e609
AD
4312002-07-25 Akim Demaille <akim@epita.fr>
432
433 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
434 replace...
435 (b4_sint_type, b4_uint_type): these.
436 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
437 * tests/regression.at (Web2c Actions): Adjust.
438
12b0043a
AD
4392002-07-25 Akim Demaille <akim@epita.fr>
440
441 * src/gram.h (TIEM_NUMBER_MAX): New.
442 (item_number_of_rule_number, rule_number_of_item_number): Rename
443 as...
444 (rule_number_as_item_number, item_number_as_rule_number): these.
445 Adjust dependencies.
446 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
447 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
448 (symbol_number_to_vector_number): New.
449 (order): Of vector_number_t* type.
450 (base_t, BASE_MAX, BASE_MIN): New.
451 (froms, tos, width, pos, check): Of base_t type.
452 (action_number_t, ACTION_MIN, ACTION_MAX): New.
453 (actrow): Of action_number_t type.
454 (conflrow): Of unsigned int type.
455 (table_ninf, base_ninf): New.
456 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
457 (muscle_insert_int_table, muscle_insert_base_table)
458 (muscle_insert_rule_number_table): New.
459 (prepare_tokens): Output `toknum' as int_table.
460 (action_row): Returns a rule_number_t.
461 Use ACTION_MIN, not SHRT_MIN.
462 (token_actions): yydefact is rule_number_t*.
463 (table_ninf_remap): New.
464 (pack_table): Use it for `base' and `table'.
465 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
466 replaced with...
467 (YYPACT_NINF, YYTABLE_NINF): these.
468 (yypact, yytable): Compute their types instead of hard-coded
469 `short'.
470 * tests/regression.at (Web2c Actions): Adjust.
471
5dde258a
AD
4722002-07-19 Akim Demaille <akim@epita.fr>
473
474 * src/scan-gram.l (id): Can start with an underscore.
475
a945ec39
AD
4762002-07-16 Akim Demaille <akim@epita.fr>
477
478 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
479 Adjust all former `associativity' dependencies.
480 * src/symtab.c (symbol_new): Default associativity is `undef', not
481 `right'.
482 (symbol_check_alias_consistence): Adjust.
483
fae437e8
AD
4842002-07-09 Akim Demaille <akim@epita.fr>
485
486 * doc/bison.texinfo: Properly set the ``header'' part.
487 Use @dircategory ``GNU programming tools'' as per Texinfo's
488 documentation.
489 Use @copying.
490
1a715ef2
AD
4912002-07-09 Akim Demaille <akim@epita.fr>
492
493 * lib/quotearg.h: Protect against multiple inclusions.
494 * src/location.h (location_t): Add a `file' member.
495 (LOCATION_RESET, LOCATION_PRINT): Adjust.
496 * src/complain.c (warn_at, complain_at, fatal_at): Drop
497 `error_one_per_line' support.
498
a5d50994
AD
4992002-07-09 Akim Demaille <akim@epita.fr>
500
501 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
502 * src/reader.c (lineno): Remove.
503 Adjust all dependencies.
504 (get_merge_function): Take a location and use complain_at.
505 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
506 * tests/regression.at (Invalid inputs, Mixing %token styles):
507 Adjust.
508
b275314e
AD
5092002-07-09 Akim Demaille <akim@epita.fr>
510
511 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
512 recovery rule, and forbid extensions when --yacc.
513 (gram_error): Use complain_at.
514 * src/reader.c (reader): Exit if there were parse errors.
515
865b9df1
AD
5162002-07-09 Akim Demaille <akim@epita.fr>
517
518 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
519 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
520 Reported by R Blake <blakers@mac.com>.
521
c76e14da
AD
5222002-07-09 Akim Demaille <akim@epita.fr>
523
524 * data/yacc.c: Output the copyright notive in the header.
525
7db2ed2d
AD
5262002-07-03 Akim Demaille <akim@epita.fr>
527
528 * src/output.c (froms, tos): Are state_number_t.
529 (save_column): sp, sp1, and sp2 are state_number_t.
530 (prepare): Rename `final' as `final_state_number', `nnts' as
531 `nterms_number', `nrules' as `rules_number', `nstates' as
532 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
533 unused.
534 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
535 * data/lalr1.cc (nsym_): Remove, unused.
536
e68e0410
AD
5372002-07-03 Akim Demaille <akim@epita.fr>
538
539 * src/lalr.h, src/lalr.c (goto_number_t): New.
540 * src/lalr.c (goto_list_t): New.
541 Propagate them.
542 * src/nullable.c (rule_list_t): New.
543 Propagate.
544 * src/types.h: Remove.
545
e1a4f3a4
AD
5462002-07-03 Akim Demaille <akim@epita.fr>
547
548 * src/closure.c (print_fderives): Use rule_rhs_print.
549 * src/derives.c (print_derives): Use rule_rhs_print.
550 (rule_list_t): New, replaces `shorts'.
551 (set_derives): Add comments.
552 * tests/sets.at (Nullable, Firsts): Adjust.
553
536545f3
AD
5542002-07-03 Akim Demaille <akim@epita.fr>
555
556 * src/output.c (prepare_actions): Free `tally' and `width'.
557 (prepare_actions): Allocate and free `order'.
558 * src/symtab.c (symbols_free): Free `symbols'.
559 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
560 * src/output.c (m4_invoke): Move to...
561 * src/scan-skel.l: here.
562 (<<EOF>>): Close yyout, and free its name.
563
8b752b00
AD
5642002-07-03 Akim Demaille <akim@epita.fr>
565
566 Fix some memory leaks, and fix a bug: state 0 was examined twice.
567
568 * src/LR0.c (new_state): Merge into...
569 (state_list_append): this.
570 (new_states): Merge into...
571 (generate_states): here.
572 (set_states): Don't ensure a proper `errs' state member here, do it...
573 * src/conflicts.c (conflicts_solve): here.
574 * src/state.h, src/state.c: Comment changes.
575 (state_t): Rename member `shifts' as `transitions'.
576 Adjust all dependencies.
577 (errs_new): For consistency, also take the values as argument.
578 (errs_dup): Remove.
579 (state_errs_set): New.
580 (state_reductions_set, state_transitions_set): Assert that no
581 previous value was assigned.
582 (state_free): New.
583 (states_free): Use it.
584 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
585 temporary storage: use `errs' and `nerrs' as elsewhere.
586 (set_conflicts): Allocate and free this `errs'.
587
613f5e1a
AD
5882002-07-02 Akim Demaille <akim@epita.fr>
589
590 * lib/libiberty.h: New.
591 * lib: Update the bitset implementation from upstream.
592 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
593 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
594 * src/main.c: Adjust bitset stats calls.
595
26e0cadc
PE
5962002-07-01 Paul Eggert <eggert@twinsun.com>
597
598 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
599 char, so that negative chars don't collide with $.
600
1154cced
AD
6012002-06-30 Akim Demaille <akim@epita.fr>
602
603 Have the GLR tests be `warning' checked, and fix the warnings.
604
605 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
606 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
607 (yyremoveDeletes): `yyi' and `yyj' are size_t.
608 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
609 (yyaddDeferredAction): static.
610 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
611 (yyreportParseError): yyprefix is const.
612 yytokenp is used only when verbose.
613 (yy__GNUC__): Replace with __GNUC__.
614 (yypdumpstack): yyi is size_t.
615 (yypreference): Un-yy local variables and arguments, to avoid
616 clashes with `yyr1'. Anyway, we are not in the user name space.
617 (yytname_size): be an int, as is compared with ints.
618 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
619 Use them.
620 * tests/cxx-gram.at: Use quotation to protect $1.
621 Use AT_COMPILE to enable warnings hunts.
622 Prototype yylex and yyerror.
623 `Use' argc.
624 Include `string.h', not `strings.h'.
625 Produce and prototype stmtMerge only when used.
626 yylex takes a location.
627
97650f4e
AD
6282002-06-30 Akim Demaille <akim@epita.fr>
629
630 We spend a lot of time in quotearg, in particular when --verbose.
631
632 * src/symtab.c (symbol_get): Store a quoted version of the key.
633 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
634 Adjust all callers.
635
d2576365
AD
6362002-06-30 Akim Demaille <akim@epita.fr>
637
638 * src/state.h (reductions_t): Rename member `nreds' as num.
639 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
640 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
641
ccaf65bc
AD
6422002-06-30 Akim Demaille <akim@epita.fr>
643
644 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
645 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
646 (shifts_to): Rename as...
647 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
648 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
649 (TRANSITION_IS_DISABLED, transitions_to): these.
650
87675353
AD
6512002-06-30 Akim Demaille <akim@epita.fr>
652
653 * src/print.c (print_shifts, print_gotos): Merge into...
654 (print_transitions): this.
655 (print_transitions, print_errs, print_reductions): Align the
656 lookaheads columns.
657 (print_core, print_transitions, print_errs, print_state,
658 print_grammar): Output empty lines separator before, not after.
659 (state_default_rule_compute): Rename as...
660 (state_default_rule): this.
661 * tests/conflicts.at (Defaulted Conflicted Reduction),
662 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
663 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
664
ce4ccb4b
AD
6652002-06-30 Akim Demaille <akim@epita.fr>
666
667 Display items as we display rules.
668
669 * src/gram.h, src/gram.c (rule_lhs_print): New.
670 * src/gram.c (grammar_rules_partial_print): Use it.
671 * src/print.c (print_core): Likewise.
672 * tests/conflicts.at (Defaulted Conflicted Reduction),
673 (Unresolved SR Conflicts): Adjust.
674 (Unresolved SR Conflicts): Adjust and rename as...
675 (Resolved SR Conflicts): this, as was meant.
676 * tests/regression.at (Web2c Report): Adjust.
677
bc933ef1
AD
6782002-06-30 Akim Demaille <akim@epita.fr>
679
680 * src/print.c (state_default_rule_compute): New, extracted from...
681 (print_reductions): here.
682 Pessimize, but clarify the code.
683 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
684
53d4308d
AD
6852002-06-30 Akim Demaille <akim@epita.fr>
686
687 * src/output.c (action_row): Let default_rule be always a rule
688 number.
689
574fb2d5
AD
6902002-06-30 Akim Demaille <akim@epita.fr>
691
692 * src/closure.c (print_firsts, print_fderives, closure):
693 Use BITSET_EXECUTE.
694 * src/lalr.c (lookaheads_print): Likewise.
695 * src/state.c (state_rule_lookaheads_print): Likewise.
696 * src/print_graph.c (print_core): Likewise.
697 * src/print.c (print_reductions): Likewise.
698 * src/output.c (action_row): Likewise.
699 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
700
05811fd7
AD
7012002-06-30 Akim Demaille <akim@epita.fr>
702
703 * src/print_graph.c: Use report_flag.
704
0e4d5753
AD
7052002-06-30 Akim Demaille <akim@epita.fr>
706
707 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
708 to...
709 * src/relation.h, src/relation.c (traverse, relation_digraph)
710 (relation_print, relation_transpose): New.
711
24c7d800
AD
7122002-06-30 Akim Demaille <akim@epita.fr>
713
714 * src/state.h, src/state.c (shifts_to): New.
715 * src/lalr.c (build_relations): Use it.
716
9222837b
AD
7172002-06-30 Akim Demaille <akim@epita.fr>
718
719 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
720 (item_number_of_rule_number, rule_number_of_item_number): New.
721 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
722 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
723 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
724 Propagate their use.
725 Much remains to be done, in particular wrt `shorts' from types.h.
726
260008e5
AD
7272002-06-30 Akim Demaille <akim@epita.fr>
728
729 * src/symtab.c (symbol_new): Initialize the `printer' member.
730
8a731ca8
AD
7312002-06-30 Akim Demaille <akim@epita.fr>
732
733 * src/LR0.c (save_reductions): Remove, replaced by...
734 * src/state.h, src/state.c (state_reductions_set): New.
735 (reductions, errs): Rename as...
736 (reductions_t, errs_t): these.
737 Adjust all dependencies.
738
32e1e0a4
AD
7392002-06-30 Akim Demaille <akim@epita.fr>
740
741 * src/LR0.c (state_list_t, state_list_append): New.
742 (first_state, last_state): Now symbol_list_t.
743 (this_state): Remove.
744 (new_itemsets, append_states, save_reductions): Take a state_t as
745 argument.
746 (set_states, generate_states): Adjust.
747 (save_shifts): Remove, replaced by...
748 * src/state.h, src/state.c (state_shifts_set): New.
749 (shifts): Rename as...
750 (shifts_t): this.
751 Adjust all dependencies.
752 * src/state.h (state_t): Remove the `next' member.
753
e5fb6710
AD
7542002-06-30 Akim Demaille <akim@epita.fr>
755
756 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
757 escaped in slot 0.
758
c7ca99d4
AD
7592002-06-30 Akim Demaille <akim@epita.fr>
760
761 Use hash.h for the state hash table.
762
763 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
764 (allocate_storage): Use state_hash_new.
765 (free_storage): Use state_hash_free.
766 (new_state, get_state): Adjust.
767 * src/lalr.h, src/lalr.c (states): Move to...
768 * src/states.h (state_t): Remove the `link' member, no longer
769 used.
770 * src/states.h, src/states.c: here.
771 (state_hash_new, state_hash_free, state_hash_lookup)
772 (state_hash_insert, states_free): New.
773 * src/states.c (state_table, state_compare, state_hash): New.
774 * src/output.c (output_actions): Do not free states now, since we
775 still need to know the final_state number in `prepare', called
776 afterwards. Do it...
777 * src/main.c (main): here: call states_free after `output'.
778
df0e7316
AD
7792002-06-30 Akim Demaille <akim@epita.fr>
780
781 * src/state.h, src/state.c (state_new): New, extracted from...
782 * src/LR0.c (new_state): here.
783 * src/state.h (STATE_ALLOC): Move to...
784 * src/state.c: here.
785 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
786 * src/state.h, src/state.c: here.
787
39f41916
AD
7882002-06-30 Akim Demaille <akim@epita.fr>
789
790 * src/reader.c (gensym): Rename as...
791 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
792 (getsym): Rename as...
793 (symbol_get): this.
794
d57650a5
AD
7952002-06-30 Akim Demaille <akim@epita.fr>
796
797 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
798 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
799 * src/output.c, src/print.c, src/print_graph.c: Propagate.
800 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
801
5a08f1ce
AD
8022002-06-30 Akim Demaille <akim@epita.fr>
803
804 Make the test suite pass with warnings checked.
805
806 * tests/actions.at (Printers and Destructors): Improve.
807 Avoid unsigned vs. signed issues.
808 * tests/calc.at: Don't exercise the scanner here, do it...
809 * tests/input.at (Torturing the Scanner): here.
810
720623af
PH
8112002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
812
88e7e941 813 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
814 reorganize first lines parallel to yacc.c.
815
fb8135fa
AD
8162002-06-28 Akim Demaille <akim@epita.fr>
817
818 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
819 (b4_token_enum, b4_token_defines): New, factored from...
820 * data/lalr1.cc, data/yacc.c, glr.c: here.
821
41442480
AD
8222002-06-28 Akim Demaille <akim@epita.fr>
823
824 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
825 unused variables.
826 * src/output.c (merger_output): static.
827
e0e5bf84
AD
8282002-06-28 Akim Demaille <akim@epita.fr>
829
830 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
831 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
832 pacify GCC.
833 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 834
676385e2
PH
8352002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
836
837 Accumulated changelog for new GLR parsing features.
838
6a254321 839 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
840 conflicts_total_count.
841 * src/conflicts.h: Ditto.
842 * src/output.c (token_actions): Use the new name.
843 (output_conflicts): Change conflp => conflict_list_heads, and
844 confl => conflict_list for better readability.
845 * data/glr.c: Use the new names.
846 * NEWS: Add self to GLR announcement.
e0e5bf84 847
676385e2
PH
848 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
849
850 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
851 Akim Demaille.
852
853 * data/bison.glr: Change name to glr.c
854 * data/glr.c: Renamed from bison.glr.
855 * data/Makefile.am: Add glr.c
e0e5bf84
AD
856
857 * src/getargs.c:
858
676385e2
PH
859 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
860 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 861
676385e2
PH
862 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
863
864 * data/bison.glr: Be sure to restore the
865 current #line when returning to the skeleton contents after having
866 exposed the input file's #line.
867
868 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
869
870 * data/bison.glr: Bring up to date with changes to bison.simple.
871
872 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
873
874 * data/bison.glr: Correct definitions that use b4_prefix.
875 Various reformatting.
876 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
877 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
878 yytokenp argument; now part of stack.
879 (yychar): Define to behave as documented.
880 (yyclearin): Ditto.
e0e5bf84 881
676385e2
PH
882 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
883
884 * src/reader.h: Add declaration for free_merger_functions.
885
886 * src/reader.c (merge_functions): New variable.
887 (get_merge_function): New function.
888 (free_merger_functions): New function.
889 (readgram): Check for %prec that is not followed by a symbol.
890 Handle %dprec and %merge declarations.
891 (packgram): Initialize dprec and merger fields in rules array.
892
893 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
894 conflict_list_cnt, conflict_list_free): New variables.
895 (table_grow): Also grow conflict_table.
e0e5bf84 896 (prepare_rules): Output dprec and merger tables.
676385e2 897 (conflict_row): New function.
e0e5bf84 898 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
899 default reduction in conflicted states for GLR parser so that there
900 are spaces for the conflict lists.
901 (save_row): Also save conflict information.
902 (token_actions): Allocate conflict list.
903 (merger_output): New function.
904 (pack_vector): Pack conflict table, too.
905 (output_conflicts): New function to output yyconflp and yyconfl.
906 (output_check): Allocate conflict_tos.
907 (output_actions): Output conflict tables, also.
908 (output_skeleton): Output b4_mergers definition.
909 (prepare): Output b4_max_rhs_length definition.
910 Use 'bison.glr' as default skeleton for GLR parsers.
911
912 * src/gram.c (glr_parser): New flag.
913 (grammar_free): Call free_merger_functions.
914
915 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
916 all pairs of conflicting reductions, rather than just all tokens
917 causing conflicts. Needed to size conflict tables.
e0e5bf84 918 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
919 interface.
920 (conflicts_print): Ditto.
921 (count_total_conflicts): New function.
922
923 * src/reader.h (merger_list): New type.
924 (merge_functions): New variable.
925
926 * src/lex.h (tok_dprec, tok_merge): New token types.
927
928 * src/gram.h (rule_s): Add dprec and merger fields.
929 (glr_parser): New flag.
930
931 * src/conflicts.h (count_total_conflicts): New function.
932
933 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
934
935 * doc/bison.texinfo (Generalized LR Parsing): New section.
936 (GLR Parsers): New section.
937 (Language and Grammar): Mention GLR parsing.
938 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
939 Correct typo ("tge" -> "the").
940
941 * data/bison.glr: New skeleton for GLR parsing.
942
943 * tests/cxx-gram.at: New tests for GLR parsing.
944
945 * tests/testsuite.at: Include cxx-gram.at.
946
947 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 948
676385e2
PH
949 * src/parse-gram.y:
950
951 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
952
953 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 954
b5480d74 9552002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
956
957 * src/options.h, src/options.c: Remove.
958 * src/getargs.c (short_options, long_options): New.
959
60491a94
AD
9602002-06-27 Akim Demaille <akim@epita.fr>
961
962 * data/bison.simple, data/bison.c++: Rename as...
963 * data/yacc.c, data/lalr1.cc: these.
964 * doc/bison.texinfo (Environment Variables): Remove.
965
9be0c25b
AD
9662002-06-25 Raja R Harinath <harinath@cs.umn.edu>
967
968 * src/getargs.c (report_argmatch): Initialize strtok().
969
1ae72863
AD
9702002-06-20 Akim Demaille <akim@epita.fr>
971
972 * data/bison.simple (b4_symbol_actions): New, replaces...
973 (b4_symbol_destructor, b4_symbol_printer): these.
974 (yysymprint): Be sure to call YYPRINT only for tokens, and using
975 user token numbers.
976
87542d29
AD
9772002-06-20 Akim Demaille <akim@epita.fr>
978
979 * data/bison.simple (yydestructor): Rename as...
980 (yydestruct): this.
981
1a31ed21
AD
9822002-06-20 Akim Demaille <akim@epita.fr>
983
984 * src/symtab.h, src/symtab.c (symbol_type_set)
985 (symbol_destructor_set, symbol_precedence_set): The location is
986 the last argument.
987 Adjust all callers.
988
e776192e
AD
9892002-06-20 Akim Demaille <akim@epita.fr>
990
991 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
992 internals.
993 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
994 Takes a location.
995 * src/symtab.h, src/symtab.c (symbol_class_set)
996 (symbol_user_token_number_set): Likewise.
997 Adjust all callers.
998 Promote complain_at.
999 * tests/input.at (Type Clashes): Adjust.
1000
5c1180b3
AD
10012002-06-20 Akim Demaille <akim@epita.fr>
1002
1003 * data/bison.simple (YYLEX): Fix the declaration when
1004 %pure-parser.
1005
e3170060
AD
10062002-06-20 Akim Demaille <akim@epita.fr>
1007
1008 * data/bison.simple (yysymprint): Don't print the token number,
1009 just its name.
1010 * tests/actions.at (Destructors): Rename as...
1011 (Printers and Destructors): this.
1012 Also exercise %printer.
1013
253862fd
AD
10142002-06-20 Akim Demaille <akim@epita.fr>
1015
1016 * data/bison.simple (YYDSYMPRINT): New.
1017 Use it to remove many of the #if YYDEBUG/if (yydebug).
1018
366eea36
AD
10192002-06-20 Akim Demaille <akim@epita.fr>
1020
1021 * src/symtab.h, src/symtab.c (symbol_t): printer and
1022 printer_location are new members.
1023 (symbol_printer_set): New.
1024 * src/parse-gram.y (PERCENT_PRINTER): New token.
1025 Handle its associated rule.
1026 * src/scan-gram.l: Adjust.
1027 (handle_destructor_at, handle_destructor_dollar): Rename as...
1028 (handle_symbol_code_at, handle_symbol_code_dollar): these.
1029 * src/output.c (symbol_printers_output): New.
1030 (output_skeleton): Call it.
1031 * data/bison.simple (yysymprint): New. Cannot be named yyprint
1032 since there are already many grammar files with a user `yyprint'.
1033 Replace the calls to YYPRINT to calls to yysymprint.
1034 * tests/calc.at: Adjust.
1035 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
1036 taking advantage of parser very internal details (stack size!).
1037
4f25ebb0
AD
10382002-06-20 Akim Demaille <akim@epita.fr>
1039
1040 * src/scan-gram.l: Complete the scanner with the missing patterns
1041 to pacify Flex.
1042 Use `quote' and `symbol_tag_get' where appropriate.
1043
93b68a0e
AD
10442002-06-19 Akim Demaille <akim@epita.fr>
1045
1046 * tests/actions.at (Destructors): Augment to test locations.
1047 * data/bison.simple (yydestructor): Pass it the current location
1048 if locations are enabled.
1049 Prototype only when __STDC__ or C++.
1050 Change the argument names to move into the yy name space: there is
1051 user code here.
1052
58612f1d
AD
10532002-06-19 Akim Demaille <akim@epita.fr>
1054
74310291
AD
1055 * data/bison.simple (b4_pure_if): New.
1056 Use it instead of #ifdef YYPURE.
1057
10582002-06-19 Akim Demaille <akim@epita.fr>
1059
1060 * data/bison.simple (b4_location_if): New.
58612f1d
AD
1061 Use it instead of #ifdef YYLSP_NEEDED.
1062
f25bfb75
AD
10632002-06-19 Akim Demaille <akim@epita.fr>
1064
1065 Prepare @$ in %destructor, but currently don't bind it in the
1066 skeleton, as %location use is not cleaned up yet.
1067
1068 * src/scan-gram.l (handle_dollar, handle_destructor_at)
1069 (handle_action_at): New.
1070 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
1071 a braced_code_t and a location as additional arguments.
1072 (handle_destructor_dollar): Instead of requiring `b4_eval', just
1073 unquote one when outputting `b4_dollar_dollar'.
1074 Adjust callers.
1075 * data/bison.simple (b4_eval): Remove.
1076 (b4_symbol_destructor): Adjust.
1077 * tests/input.at (Invalid @n): Adjust.
1078
c732d2c6
AD
10792002-06-19 Zack Weinberg <zack@codesourcery.com>
1080
1081 * doc/bison.texinfo: Document ability to have multiple
1082 prologue sections.
1083
8c165d89
AD
10842002-06-18 Akim Demaille <akim@epita.fr>
1085
1086 * src/files.c (compute_base_names): When computing the output file
1087 names from the input file name, strip the directory part.
1088
ca98bf57
AD
10892002-06-18 Akim Demaille <akim@epita.fr>
1090
1091 * data/bison.simple.new: Comment changes.
1092 Reported by Andreas Schwab.
1093
0bfb02ff
AD
10942002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
1095
1096 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
1097 there are no `label `yyoverflowlab' defined but not used' warnings
1098 when yyoverflow is defined.
1099
24c0aad7
AD
11002002-06-18 Akim Demaille <akim@epita.fr>
1101
1102 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
1103 new member.
1104 (symbol_destructor_set): Adjust.
1105 * src/output.c (symbol_destructors_output): Output the destructor
1106 locations.
1107 Output the symbol name.
1108 * data/bison.simple (b4_symbol_destructor): Adjust.
1109
5719c109
AD
11102002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
1111 and Akim Demaille <akim@epita.fr>
1112
1113 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
1114 what's left on the stack when the error recovery hits EOF.
1115 * tests/actions.at (Destructors): Complete to exercise this case.
1116
9280d3ef
AD
11172002-06-17 Akim Demaille <akim@epita.fr>
1118
1119 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
1120 arguments is really empty, not only equal to `[]'.
1121 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
1122 member.
1123 (symbol_destructor_set): New.
1124 * src/output.c (symbol_destructors_output): New.
1125 * src/reader.h (brace_code_t, current_braced_code): New.
1126 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
1127 (handle_dollar): Rename as...
1128 (handle_action_dollar): this.
1129 (handle_destructor_dollar): New.
1130 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
1131 (grammar_declaration): Use it.
1132 * data/bison.simple (yystos): Is always defined.
1133 (yydestructor): New.
1134 * tests/actions.at (Destructors): New.
1135 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
1136
dafdc66f
AD
11372002-06-17 Akim Demaille <akim@epita.fr>
1138
1139 * src/symlist.h, src/symlist.c (symbol_list_length): New.
1140 * src/scan-gram.l (handle_dollar, handle_at): Compute the
1141 rule_length only when needed.
1142 * src/output.c (actions_output, token_definitions_output): Output
1143 the full M4 block.
1144 * src/symtab.c: Don't access directly to the symbol tag, use
1145 symbol_tag_get.
1146 * src/parse-gram.y: Use symbol_list_free.
1147
56c47203
AD
11482002-06-17 Akim Demaille <akim@epita.fr>
1149
1150 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
1151 (symbol_list_prepend, get_type_name): Move to...
1152 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
1153 (symbol_list_prepend, symbol_list_n_type_name_get): here.
1154 Adjust all callers.
1155 (symbol_list_free): New.
1156 * src/scan-gram.l (handle_dollar): Takes a location.
1157 * tests/input.at (Invalid $n): Adjust.
1158
1e0bab92
AD
11592002-06-17 Akim Demaille <akim@epita.fr>
1160
1161 * src/reader.h, src/reader.c (symbol_list_new): Export it.
1162 (symbol_list_prepend): New.
1163 * src/parse-gram.y (%union): `list' is a new member.
1164 (symbols.1): New, replaces...
1165 (terms_to_prec.1, nterms_to_type.1): these.
1166 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
1167 Take a location as additional argument.
1168 Adjust all callers.
1169
04e60654
AD
11702002-06-15 Akim Demaille <akim@epita.fr>
1171
1172 * src/parse-gram.y: Move %token in the declaration section so that
1173 we don't depend upon CVS Bison.
1174
10e5b8bd
AD
11752002-06-15 Akim Demaille <akim@epita.fr>
1176
1177 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
1178 * src/print.c (print_core): Use it.
1179
9801d40c
AD
11802002-06-15 Akim Demaille <akim@epita.fr>
1181
1182 * src/conflicts.c (log_resolution): Accept the rule involved in
1183 the sr conflicts instead of the lookahead number that points to
1184 that rule.
1185 (flush_reduce): Accept the current lookahead vector as argument,
1186 instead of the index in LA.
1187 (resolve_sr_conflict): Accept the current number of lookahead
1188 bitset to consider for the STATE, instead of the index in LA.
1189 (set_conflicts): Adjust.
1190 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
1191
c0263492
AD
11922002-06-15 Akim Demaille <akim@epita.fr>
1193
1194 * src/state.h (state_t): Replace the `lookaheadsp' member, a
1195 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
1196 Adjust all dependencies.
1197 * src/lalr.c (initialize_lookaheads): Split into...
1198 (states_lookaheads_count, states_lookaheads_initialize): these.
1199 (lalr): Adjust.
1200
9757c359
AD
12012002-06-15 Akim Demaille <akim@epita.fr>
1202
1203 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
1204 out of...
1205 (grammar_rules_print): here.
1206 * src/reduce.c (reduce_output): Use it.
1207 * tests/reduce.at (Useless Rules, Reduced Automaton)
1208 (Underivable Rules): Adjust.
1209
6b98e4b5
AD
12102002-06-15 Akim Demaille <akim@epita.fr>
1211
1212 Copy BYacc's nice way to report the grammar.
1213
1214 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
1215 New.
1216 Don't print the rules' location, it is confusing and useless.
1217 (rule_print): Use grammar_rhs_print.
1218 * src/print.c (print_grammar): Use grammar_rules_print.
1219
6b98e4b5
AD
12202002-06-15 Akim Demaille <akim@epita.fr>
1221
1222 Complete and rationalize `useless thing' warnings.
1223
1224 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
1225 (symbol_tag_print): New.
1226 Use them everywhere in place of accessing directly the tag member.
1227 * src/gram.h, src/gram.c (rule_print): New.
1228 Use it where a rule used to be printed `by hand'.
1229 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
1230 (reduce_grammar_tables): Report the useless rules.
1231 (reduce_print): Useless things are a warning, not an error.
1232 Report it as such.
1233 * tests/reduce.at (Useless Nonterminals, Useless Rules):
1234 (Reduced Automaton, Underivable Rules): Adjust.
1235 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
1236 * tests/conflicts.at (Unresolved SR Conflicts)
1237 (Solved SR Conflicts): Adjust.
1238
ee000ba4
AD
12392002-06-15 Akim Demaille <akim@epita.fr>
1240
1241 Let symbols have a location.
1242
1243 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
1244 (getsym): Adjust.
1245 Adjust all callers.
1246 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
1247 Use location_t, not int.
1248 * src/symtab.c (symbol_check_defined): Take advantage of the
1249 location.
1250 * tests/regression.at (Invalid inputs): Adjust.
1251
8efe435c
AD
12522002-06-15 Akim Demaille <akim@epita.fr>
1253
1254 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
1255 (input): Don't try to initialize yylloc here, do it in the
1256 scanner.
1257 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
1258 * src/gram.h (rule_t): Change line and action_line into location
1259 and action_location, of location_t type.
1260 Adjust all dependencies.
1261 * src/location.h, src/location.c (empty_location): New.
1262 * src/reader.h, src/reader.c (grammar_start_symbol_set)
1263 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
1264 (grammar_current_rule_symbol_append)
1265 (grammar_current_rule_action_append): Expect a location as argument.
1266 * src/reader.c (grammar_midrule_action): Adjust to attach an
1267 action's location as dummy symbol location.
1268 * src/symtab.h, src/symtab.c (startsymbol_location): New.
1269 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
1270 the line numbers.
1271
1921f1d7
AD
12722002-06-14 Akim Demaille <akim@epita.fr>
1273
1274 Grammar declarations may be found in the grammar section.
1275
1276 * src/parse-gram.y (rules_or_grammar_declaration): New.
1277 (declarations): Each declaration may end with a semicolon, not
1278 just...
1279 (grammar_declaration): `"%union"'.
1280 (grammar): Branch to rules_or_grammar_declaration.
1281
4515534c
AD
12822002-06-14 Akim Demaille <akim@epita.fr>
1283
1284 * src/main.c (main): Invoke scanner_free.
1285
f958596b
AD
12862002-06-14 Akim Demaille <akim@epita.fr>
1287
1288 * src/output.c (m4_invoke): Extracted from...
1289 (output_skeleton): here.
1290 Free tempfile.
1291
2c569025
AD
12922002-06-14 Akim Demaille <akim@epita.fr>
1293
1294 * src/parse-gram.y (directives, directive, gram)
1295 (grammar_directives, precedence_directives, precedence_directive):
1296 Rename as...
1297 (declarations, declaration, grammar, grammar_declaration)
1298 (precedence_declaration, precedence_declarator): these.
1299 (symbol_declaration): New.
1300
592e8d4d
AD
13012002-06-14 Akim Demaille <akim@epita.fr>
1302
1303 * src/files.c (action_obstack): Remove, unused.
1304 (output_obstack): Remove it, and all its dependencies, as it is no
1305 longer needed.
1306 * src/reader.c (epilogue_set): Build the epilogue in the
1307 muscle_obstack.
1308 * src/output.h, src/output.c (muscle_obstack): Move to...
1309 * src/muscle_tab.h, src/muscle_tab.h: here.
1310 (muscle_init): Initialize muscle_obstack.
1311 (muscle_free): New.
1312 * src/main.c (main): Call it.
1313
0c15323d
AD
13142002-06-14 Akim Demaille <akim@epita.fr>
1315
1316 * src/location.h: New, extracted from...
1317 * src/reader.h: here.
1318 * src/Makefile.am (noinst_HEADERS): Merge into
1319 (bison_SOURCES): this.
1320 Add location.h.
1321 * src/parse-gram.y: Use location_t instead of Bison's.
1322 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
1323 Use location_t instead of ints.
1324
e96c9728
AD
13252002-06-14 Akim Demaille <akim@epita.fr>
1326
1327 * data/bison.simple, data/bison.c++: Be sure to restore the
1328 current #line when returning to the skeleton contents after having
1329 exposed the input file's #line.
1330
75d1fe16
AD
13312002-06-12 Akim Demaille <akim@epita.fr>
1332
1333 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
1334 eager.
1335 * tests/actions.at (Exotic Dollars): New.
1336
6c35d22c
AD
13372002-06-12 Akim Demaille <akim@epita.fr>
1338
1339 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
1340 ['"/] too eagerly.
1341 * tests/input.at (Torturing the Scanner): New.
1342
1d6412ad
AD
13432002-06-11 Akim Demaille <akim@epita.fr>
1344
1345 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
1346 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
1347 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
1348 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
1349 * src/reader.c (reader): Use it.
1350
4cdb01db
AD
13512002-06-11 Akim Demaille <akim@epita.fr>
1352
1353 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
1354 Adjust all callers.
1355 (scanner_last_string_free): New.
1356
44995b2e
AD
13572002-06-11 Akim Demaille <akim@epita.fr>
1358
1359 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
1360 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
1361 (last_string, YY_OBS_FREE): New.
1362 Use them when returning an ID.
1363
e9955c83
AD
13642002-06-11 Akim Demaille <akim@epita.fr>
1365
1366 Have Bison grammars parsed by a Bison grammar.
1367
1368 * src/reader.c, src/reader.h (prologue_augment): New.
1369 * src/reader.c (copy_definition): Remove.
1370
1371 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
1372 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
1373 (grammar_current_rule_prec_set, grammar_current_rule_check)
1374 (grammar_current_rule_symbol_append)
1375 (grammar_current_rule_action_append): Export.
1376 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
1377 (symbol_list_action_append): Remove.
1378 Hook the routines from reader.
1379 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
1380 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
1381
1382 * src/reader.c (read_declarations): Remove, unused.
1383
1384 * src/parse-gram.y: Handle the epilogue.
1385 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
1386 (grammar_start_symbol_set): this.
1387 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
1388 * src/reader.c (readgram): Remove, unused.
1389 (reader): Adjust to insert eoftoken and axiom where appropriate.
1390
1391 * src/reader.c (copy_dollar): Replace with...
1392 * src/scan-gram.h (handle_dollar): this.
1393 * src/parse-gram.y: Remove `%thong'.
1394
1395 * src/reader.c (copy_at): Replace with...
1396 * src/scan-gram.h (handle_at): this.
1397
1398 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
1399 New.
1400
1401 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
1402 time being.
1403
1404 * src/reader.h, src/reader.c (grammar_rule_end): New.
1405
1406 * src/parse.y (current_type, current_class): New.
1407 Implement `%nterm', `%token' support.
1408 Merge `%term' into `%token'.
1409 (string_as_id): New.
1410 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
1411 type name.
1412
1413 * src/parse-gram.y: Be sure to handle properly the beginning of
1414 rules.
1415
1416 * src/parse-gram.y: Handle %type.
1417 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
1418
1419 * src/parse-gram.y: More directives support.
1420 * src/options.c: No longer handle source directives.
1421
1422 * src/parse-gram.y: Fix %output.
1423
1424 * src/parse-gram.y: Handle %union.
1425 Use the prologue locations.
1426 * src/reader.c (parse_union_decl): Remove.
1427
1428 * src/reader.h, src/reader.c (epilogue_set): New.
1429 * src/parse-gram.y: Use it.
1430
1431 * data/bison.simple, data/bison.c++: b4_stype is now either not
1432 defined, then default to int, or to the contents of %union,
1433 without `union' itself.
1434 Adjust.
1435 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
1436
1437 * src/output.c (actions_output): Don't output braces, as they are
1438 already handled by the scanner.
1439
1440 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
1441 characters to themselves.
1442
1443 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
1444 that the epilogue has a proper #line.
1445
1446 * src/parse-gram.y: Handle precedence/associativity.
1447
1448 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
1449 a terminal.
1450 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
1451 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
1452 at all to define terminals that cannot be emitted.
1453
1454 * src/scan-gram.l: Escape M4 characters.
1455
1456 * src/scan-gram.l: Working properly with escapes in user
1457 strings/characters.
1458
1459 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
1460 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
1461 grammar.
1462 Use more modest sizes, as for the time being the parser does not
1463 release memory, and therefore the process swallows a huge amount
1464 of memory.
1465
1466 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
1467 stricter %token grammar.
1468
1469 * src/symtab.h (associativity): Add `undef_assoc'.
1470 (symbol_precedence_set): Do nothing when passed an undef_assoc.
1471 * src/symtab.c (symbol_check_alias_consistence): Adjust.
1472
1473 * tests/regression.at (Invalid %directive): Remove, as it is now
1474 meaningless.
1475 (Invalid inputs): Adjust to the new error messages.
1476 (Token definitions): The new grammar doesn't allow too many
1477 eccentricities.
1478
1479 * src/lex.h, src/lex.c: Remove.
1480 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
1481 (copy_character, copy_string2, copy_string, copy_identifier)
1482 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
1483 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
1484 (parse_action): Remove.
1485 * po/POTFILES.in: Adjust.
1486
2e047461
AD
14872002-06-11 Akim Demaille <akim@epita.fr>
1488
1489 * src/reader.c (parse_action): Don't store directly into the
1490 rule's action member: return the action as a string.
1491 Don't require `rule_length' as an argument: compute it.
1492 (grammar_current_rule_symbol_append)
1493 (grammar_current_rule_action_append): New, eved out from
1494 (readgram): here.
1495 Remove `action_flag', `rulelength', unused now.
1496
9af3fbce
AD
14972002-06-11 Akim Demaille <akim@epita.fr>
1498
1499 * src/reader.c (grammar_current_rule_prec_set).
1500 (grammar_current_rule_check): New, eved out from...
1501 (readgram): here.
1502 Remove `xaction', `first_rhs': useless.
1503 * tests/input.at (Type clashes): New.
1504 * tests/existing.at (GNU Cim Grammar): Adjust.
1505
1485e106
AD
15062002-06-11 Akim Demaille <akim@epita.fr>
1507
1508 * src/reader.c (grammar_midrule_action): New, Eved out from
1509 (readgram): here.
1510
da4160c3
AD
15112002-06-11 Akim Demaille <akim@epita.fr>
1512
1513 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
1514 New.
1515 (readgram): Use them as replacement of inlined code, crule and
1516 crule1.
1517
f6d0f937
AD
15182002-06-11 Akim Demaille <akim@epita.fr>
1519
1520 * src/reader.c (grammar_end, grammar_symbol_append): New.
1521 (readgram): Use them.
1522 Make the use of `p' as local as possible.
1523
69078d4b
AD
15242002-06-10 Akim Demaille <akim@epita.fr>
1525
1526 GCJ's parser requires the tokens to be defined before the prologue.
1527
1528 * data/bison.simple: Output the token definition before the user's
1529 prologue.
1530 * tests/regression.at (Braces parsing, Duplicate string)
1531 (Mixing %token styles): Check the output from bison.
1532 (Early token definitions): New.
1533
5e424082
AD
15342002-06-10 Akim Demaille <akim@epita.fr>
1535
1536 * src/symtab.c (symbol_user_token_number_set): Don't complain when
1537 assigning twice the same user number to a token, so that we can
1538 use it in...
1539 * src/lex.c (lex): here.
1540 Also use `symbol_class_set' instead of hand written code.
1541 * src/reader.c (parse_assoc_decl): Likewise.
1542
44536b35
AD
15432002-06-10 Akim Demaille <akim@epita.fr>
1544
1545 * src/symtab.c, src/symtab.c (symbol_class_set)
1546 (symbol_user_token_number_set): New.
1547 * src/reader.c (parse_token_decl): Use them.
1548 Use a switch instead of ifs.
1549 Use a single argument.
1550
8b9f2372
AD
15512002-06-10 Akim Demaille <akim@epita.fr>
1552
1553 Remove `%thong' support as it is undocumented, unused, duplicates
1554 `%token's job, and creates useless e-mail traffic with people who
1555 want to know what it is, why it is undocumented, unused, and
1556 duplicates `%token's job.
1557
1558 * src/reader.c (parse_thong_decl): Remove.
1559 * src/options.c (option_table): Remove "thong".
1560 * src/lex.h (tok_thong): Remove.
1561
3ae2b51f
AD
15622002-06-10 Akim Demaille <akim@epita.fr>
1563
1564 * src/symtab.c, src/symtab.c (symbol_type_set)
1565 (symbol_precedence_set): New.
1566 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
1567 (value_components_used): Remove, unused.
1568
2f1afb73
AD
15692002-06-09 Akim Demaille <akim@epita.fr>
1570
1571 Move symbols handling code out of the reader.
1572
1573 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
1574 (axiom): Move to...
1575 * src/symtab.h, src/symtab.c: here.
1576
1577 * src/gram.c (start_symbol): Remove: use startsymbol->number.
1578 * src/reader.c (startval): Rename as...
1579 * src/symtab.h, src/symtab.c (startsymbol): this.
1580 * src/reader.c: Adjust.
1581
1582 * src/reader.c (symbol_check_defined, symbol_make_alias)
1583 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1584 (token_translations_init)
1585 Move to...
1586 * src/symtab.c: here.
1587 * src/reader.c (packsymbols): Move to...
1588 * src/symtab.h, src/symtab.c (symbols_pack): here.
1589 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
1590 argument.
1591
e9bca3ad
AD
15922002-06-03 Akim Demaille <akim@epita.fr>
1593
1594 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
1595 then statements.
1596
86eff183
AD
15972002-06-03 Akim Demaille <akim@epita.fr>
1598
1599 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1600 structs with non literals.
1601 * src/scan-skel.l: never-interactive.
1602 * src/conflicts.c (enum conflict_resolution_e): No trailing
1603 comma.
1604 * src/getargs.c (usage): Split long literal strings.
1605 Reported by Hans Aberg.
1606
717be197
AD
16072002-05-28 Akim Demaille <akim@epita.fr>
1608
1609 * data/bison.c++: Use C++ ostreams.
1610 (cdebug_): New member.
1611
670ddffd
AD
16122002-05-28 Akim Demaille <akim@epita.fr>
1613
1614 * src/output.c (output_skeleton): Be sure to allocate enough room
1615 for `/' _and_ for `\0' in full_skeleton.
1616
769b430f
AD
16172002-05-28 Akim Demaille <akim@epita.fr>
1618
1619 * data/bison.c++: Catch up with bison.simple:
1620 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1621 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1622 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1623 and popping traces.
1624
7067cb36
PH
16252002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1626
1627 * src/output.c (output_skeleton): Put an explicit path in front of
1628 the skeleton file name, rather than relying on the -I directory,
1629 to partially alleviate effects of having a skeleton file lying around
1630 in the current directory.
769b430f 1631
4a713ec2
PH
16322002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1633
769b430f 1634 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
1635 obstack_printf should be obstack_fgrow1.
1636
b408954b
AD
16372002-05-26 Akim Demaille <akim@epita.fr>
1638
1639 * src/state.h (state_t): `solved_conflicts' is a new member.
1640 * src/LR0.c (new_state): Set it to 0.
1641 * src/conflicts.h, src/conflicts.c (print_conflicts)
1642 (free_conflicts, solve_conflicts): Rename as...
1643 (conflicts_print, conflicts_free, conflicts_solve): these.
1644 Adjust callers.
1645 * src/conflicts.c (enum conflict_resolution_e)
1646 (solved_conflicts_obstack): New, used by...
1647 (log_resolution): this.
1648 Adjust to attach the conflict resolution to each state.
1649 Complete the description with the precedence/associativity
1650 information.
1651 (resolve_sr_conflict): Adjust.
1652 * src/print.c (print_state): Output its solved_conflicts.
1653 * tests/conflicts.at (Unresolved SR Conflicts)
1654 (Solved SR Conflicts): Exercise --report=all.
1655
a49aecd5
AD
16562002-05-26 Akim Demaille <akim@epita.fr>
1657
1658 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1659 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1660 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1661 (token_number_t, item_number_as_token_number)
1662 (token_number_as_item_number, muscle_insert_token_number_table):
1663 Rename as...
1664 (symbol_number_t, item_number_as_symbol_number)
1665 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1666 these, since it is more appropriate.
1667
5504898e
AD
16682002-05-26 Akim Demaille <akim@epita.fr>
1669
1670 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1671 `Error:' lines.
1672 * data/bison.simple (yystos) [YYDEBUG]: New.
1673 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1674 error recovery.
1675 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1676
ec3bc396
AD
16772002-05-25 Akim Demaille <akim@epita.fr>
1678
1679 * doc/bison.texinfo (Debugging): Split into...
1680 (Tracing): this new section, its former contents, and...
1681 (Understanding): this new section.
1682 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1683 by...
1684 (report_flag): this.
1685 Adjust all dependencies.
1686 (report_args, report_types, report_argmatch): New.
1687 (usage, getargs): Report/support -r, --report.
1688 * src/options.h
1689 (struct option_table_struct): Rename as..,
1690 (struct option_table_s): this.
1691 Rename the `set_flag' member to `flag' to match with getopt_long's
1692 struct.
1693 * src/options.c (option_table): Split verbose into an entry for
1694 %verbose, and another for --verbose.
1695 Support --report/-r, so remove -r from the obsolete --raw.
1696 * src/print.c: Attach full item sets and lookaheads reports to
1697 report_flag instead of trace_flag.
1698 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1699
78df8250
PE
17002002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1701 and Paul Eggert <eggert@twinsun.com>
769b430f 1702
78df8250
PE
1703 * data/bison.simple (yyparse): Correct error handling to conform to
1704 POSIX and yacc. Specifically, after syntax error is discovered,
1705 do not reduce further before shifting the error token.
1706 Clean up the code a bit by removing the labels yyerrdefault,
1707 yyerrhandle, yyerrpop.
1708 * NEWS: Document the above.
1709
c0c9ea05
PH
17102002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1711
1712 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1713 type; it isn't always big enough, since it doesn't necessarily
1714 include non-terminals.
769b430f 1715 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
1716 the latter can be removed.
1717 (yy_token_number_type): Remove, only one use.
1718 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1719 don't use TokenNumberType as element type.
769b430f 1720
c0c9ea05
PH
1721 * tests/regression.at: Modify expected output to agree with change
1722 to yyr1 and yytranslate.
769b430f 1723
6390a83f
FK
17242002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1725
1726 * src/reader.c (parse_action): Use copy_character instead of
1727 obstack_1grow.
1728
db7c8e9a
AD
17292002-05-13 Akim Demaille <akim@epita.fr>
1730
1731 * tests/regression.at (Token definitions): Prototype yylex and
1732 yyerror.
1733
fcc61800
PH
17342002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1735
158c687b 1736 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
1737 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1738 32-bit arithmetic.
1739 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1740
5683e9b2
AD
17412002-05-07 Akim Demaille <akim@epita.fr>
1742
1743 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1744 avoid GCC warnings.
1745
0c2d3f4c
AD
17462002-05-07 Akim Demaille <akim@epita.fr>
1747
1748 Kill GCC warnings.
1749
1750 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1751 over the RHS of each rule.
1752 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1753 * src/state.h (state_t): Member `nitems' is unsigned short.
1754 * src/LR0.c (get_state): Adjust.
1755 * src/reader.c (packgram): Likewise.
1756 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1757 `Type'.
1758 (muscle_insert_int_table): Remove, unused.
1759 (prepare_rules): Remove `max'.
1760
1565b720
AD
17612002-05-06 Akim Demaille <akim@epita.fr>
1762
1763 * src/closure.c (print_firsts): Display of the symbol tags.
1764 (bitmatrix_print): Move to...
1765 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1766 here.
1767 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1768
cfaee611
AD
17692002-05-06 Akim Demaille <akim@epita.fr>
1770
1771 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1772 hash_do_for_each.
1773
458be8e0
AD
17742002-05-06 Akim Demaille <akim@epita.fr>
1775
1776 * src/LR0.c (new_state, get_state): Instead of using the global
1777 `kernel_size' and `kernel_base', have two new arguments:
1778 `core_size' and `core'.
1779 Adjust callers.
1780
a900a624
AD
17812002-05-06 Akim Demaille <akim@epita.fr>
1782
1783 * src/reader.c (packgram): No longer end `ritem' with a 0
1784 sentinel: it is not used.
1785
d4e7d3a1
AD
17862002-05-05 Akim Demaille <akim@epita.fr>
1787
1788 New experimental feature: display the lookaheads in the report and
1789 graph.
1790
1791 * src/print (print_core): When --trace-flag, display the rules
1792 lookaheads.
1793 * src/print_graph.c (print_core): Likewise.
1794 Swap the arguments.
1795 Adjust caller.
1796
39ceb25b
AD
17972002-05-05 Akim Demaille <akim@epita.fr>
1798
1799 * tests/torture.at (Many lookaheads): New test.
1800
5372019f
AD
18012002-05-05 Akim Demaille <akim@epita.fr>
1802
1803 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1804 (GENERATE_MUSCLE_INSERT_TABLE): this.
1805 (output_int_table, output_unsigned_int_table, output_short_table)
1806 (output_token_number_table, output_item_number_table): Replace with...
1807 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1808 (muscle_insert_short_table, muscle_insert_token_number_table)
1809 (muscle_insert_item_number_table): these.
1810 Adjust all callers.
1811 (prepare_tokens): Don't free `translations', since...
1812 * src/reader.h, src/reader.c (grammar_free): do it.
1813 Move to...
1814 * src/gram.h, src/gram.c (grammar_free): here.
1815 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1816 b4_translate_max.
1817
5df5f6d5
AD
18182002-05-05 Akim Demaille <akim@epita.fr>
1819
1820 * src/output.c (output_unsigned_int_table): New.
1821 (prepare_rules): `i' is unsigned.
1822 `prhs', `rline', `r2' are unsigned int.
1823 Rename muscle `rhs_number_max' as `rhs_max'.
1824 Output muscles `prhs_max', `rline_max', and `r2_max'.
1825 Free rline and r1.
1826 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1827 to compute types instead of constant types.
1828 * tests/regression.at (Web2c Actions): Adjust.
1829
b87f8b21
AD
18302002-05-04 Akim Demaille <akim@epita.fr>
1831
1832 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1833 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1834 Adjust dependencies.
1835 * src/output.c (token_definitions_output): Be sure not to output a
1836 `#define 'a'' when fed with `%token 'a' "a"'.
1837 * tests/regression.at (Token definitions): New.
1838
8bb936e4
PE
18392002-05-03 Paul Eggert <eggert@twinsun.com>
1840
1841 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1842 for K&R C.
1843
18442002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1845
1846 * Makefile.am (SUBDIRS): Remove intl.
1847 (EXTRA_DIST): Add config/config.rpath.
1848
53c71a12
AD
18492002-05-03 Akim Demaille <akim@epita.fr>
1850
1851 * data/bison.simple (m4_if): Don't output empty enums.
1852 And actually, output valid enum definitions :(.
1853
289dd0cf
AD
18542002-05-03 Akim Demaille <akim@epita.fr>
1855
1856 * configure.bat: Remove, completely obsolete.
1857 * Makefile.am (EXTRA_DIST): Adjust.
1858 Don't distribute config.rpath...
1859 * config/Makefile.am (EXTRA_DIST): Do it.
1860
db85e524
AD
18612002-05-03 Akim Demaille <akim@epita.fr>
1862
1863 * configure.in (GETTEXT_VERSION): New.
1864 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1865
83ccf991
AD
18662002-05-03 Akim Demaille <akim@epita.fr>
1867
1868 * data/bison.simple (b4_token_enum): New.
1869 (b4_token_defines): Use it to output tokens both as #define and
1870 enums.
1871 Suggested by Paul Eggert.
1872 * src/output.c (token_definitions_output): Don't output spurious
1873 white spaces.
1874
1f418995
AD
18752002-05-03 Akim Demaille <akim@epita.fr>
1876
1877 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1878
45119f04
RA
18792002-05-02 Robert Anisko <robert@lrde.epita.fr>
1880
1881 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1882 Update the stack class, give a try to deque as the default container.
1883
b2d52318
AD
18842002-05-02 Akim Demaille <akim@epita.fr>
1885
1886 * data/bison.simple (yyparse): Do not implement @$ = @1.
1887 (YYLLOC_DEFAULT): Adjust to do it.
1888 * doc/bison.texinfo (Location Default Action): Fix.
1889
3a8b4109
AD
18902002-05-02 Akim Demaille <akim@epita.fr>
1891
1892 * src/reader.c (parse_braces): Merge into...
1893 (parse_action): this.
1894
84614e13
AD
18952002-05-02 Akim Demaille <akim@epita.fr>
1896
1897 * configure.in (ALL_LINGUAS): Remove.
1898 * po/LINGUAS, hr.po: New.
1899
fdbcd8e2
AD
19002002-05-02 Akim Demaille <akim@epita.fr>
1901
1902 Remove the so called hairy (semantic) parsers.
1903
1904 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1905 * src/gram.h, src/gram.c (semantic_parser): Remove.
1906 (rule_t): Remove the guard and guard_line members.
1907 * src/lex.h (token_t): remove tok_guard.
1908 * src/options.c (option_table): Remove %guard and %semantic_parser
1909 support.
1910 * src/output.c, src/output.h (guards_output): Remove.
1911 (prepare): Adjust.
1912 (token_definitions_output): Don't output the `T'
1913 tokens (???).
1914 (output_skeleton): Don't output the guards.
1915 * src/files.c, src/files.c (attrsfile): Remove.
1916 * src/reader.c (symbol_list): Remove the guard and guard_line
1917 members.
1918 Adjust dependencies.
1919 (parse_guard): Remove.
1920 * data/bison.hairy: Remove.
1921 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1922 BISON_HAIRY.
1923
82b6cb3f
AD
19242002-05-02 Akim Demaille <akim@epita.fr>
1925
1926 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1927 (parse_guard): Rename the formal argument `stack_offset' as
1928 `rule_length', which is more readable.
1929 Adjust callers.
1930 (copy_at, copy_dollar): Instead of outputting the hard coded
1931 values of $$, $n and so forth, output invocation to b4_lhs_value,
1932 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
1933 Note: this patch partially drops `semantic-parser' support: it
1934 always does `rule_length - n', where semantic parsers ought to
1935 always use `-n'.
82b6cb3f
AD
1936 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1937 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1938
6cbfbcc5
AD
19392002-05-02 Akim Demaille <akim@epita.fr>
1940
1941 * configure.in (AC_INIT): Bump to 1.49b.
1942 (AM_INIT_AUTOMAKE): Short invocation.
1943
b8548114
AD
19442002-05-02 Akim Demaille <akim@epita.fr>
1945
1946 Version 1.49a.
1947
c20cd1fa
AD
19482002-05-01 Akim Demaille <akim@epita.fr>
1949
1950 * src/skeleton.h: Remove.
1951
8a9566d4
AD
19522002-05-01 Akim Demaille <akim@epita.fr>
1953
1954 * src/skeleton.h: Fix the #endif.
1955 Reported by Magnus Fromreide.
1956
8c6d399a
PE
19572002-04-26 Paul Eggert <eggert@twinsun.com>
1958
1959 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1960 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 1961 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 1962
2b7ed18a
RA
19632002-04-25 Robert Anisko <robert@lrde.epita.fr>
1964
1965 * src/scan-skel.l: Postprocess quadrigraphs.
1966
1967 * src/reader.c (copy_character): New function, used to output
1968 single characters while replacing `[' and `]' with quadrigraphs, to
1969 avoid troubles with M4 quotes.
1970 (copy_comment): Output characters with copy_character.
1971 (read_additionnal_code): Likewise.
1972 (copy_string2): Likewise.
1973 (copy_definition): Likewise.
1974
1975 * tests/calc.at: Exercise M4 quoting.
1976
34a89c50
AD
19772002-04-25 Akim Demaille <akim@epita.fr>
1978
1979 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1980 between `!' and the command.
1981 Reported by Paul Eggert.
1982
0dd1580a
RA
19832002-04-24 Robert Anisko <robert@lrde.epita.fr>
1984
1985 * tests/calc.at: Exercise prologue splitting.
1986
1987 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1988 `b4_post_prologue' instead of `b4_prologue'.
1989
1990 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1991 muscles.
1992 (output): Free pre_prologue_obstack and post_prologue_obstack.
1993 * src/files.h, src/files.c (attrs_obstack): Remove.
1994 (pre_prologue_obstack, post_prologue_obstack): New.
1995 * src/reader.c (copy_definition): Add a parameter to specify the
1996 obstack to fill, instead of using attrs_obstack unconditionally.
1997 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1998 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1999
83c1796f
PE
20002002-04-23 Paul Eggert <eggert@twinsun.com>
2001
2002 * data/bison.simple: Remove unnecessary commentary and white
2003 space differences from 1_29-branch.
2004 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
2005
2006 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
2007 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
2008 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
2009 constructors or destructors.
2010
2011 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
2012
1207eeac
AD
20132002-04-23 Akim Demaille <akim@epita.fr>
2014
2015 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
2016 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
2017 location with columns.
2018 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
2019 All reported by Paul Eggert.
2020
78ab8f67
AD
20212002-04-22 Akim Demaille <akim@epita.fr>
2022
2023 * src/reduce.c (dump_grammar): Move to...
2024 * src/gram.h, src/gram.c (grammar_dump): here.
2025 Be sure to separate long item numbers.
2026 Don't read the members of a rule's prec if its nil.
2027
133c20e2
AD
20282002-04-22 Akim Demaille <akim@epita.fr>
2029
2030 * src/output.c (table_size, table_grow): New.
2031 (MAXTABLE): Remove, replace uses with table_size.
2032 (pack_vector): Instead of dying when the table is too big, grow it.
2033
9515e8a7
AD
20342002-04-22 Akim Demaille <akim@epita.fr>
2035
2036 * data/bison.simple (yyr1): Its type is that of a token number.
2037 * data/bison.c++ (r1_): Likewise.
2038 * tests/regression.at (Web2c Actions): Adjust.
2039
23c5a174
AD
20402002-04-22 Akim Demaille <akim@epita.fr>
2041
2042 * src/reader.c (token_translations_init): 256 is now the default
2043 value for the error token, i.e., it will be assigned another
2044 number if the user assigned 256 to one of her tokens.
2045 (reader): Don't force 256 to error.
2046 * doc/bison.texinfo (Symbols): Adjust.
2047 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
2048 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
2049 etc. instead of 10, 20, 30 (which was used to `jump' over error
2050 (256) and undefined (2)).
2051
5fbb0954
AD
20522002-04-22 Akim Demaille <akim@epita.fr>
2053
2054 Propagate more token_number_t.
2055
2056 * src/gram.h (token_number_as_item_number)
2057 (item_number_as_token_number): New.
2058 * src/output.c (GENERATE_OUTPUT_TABLE): New.
2059 Use it to create output_item_number_table and
2060 output_token_number_table.
2061 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2062 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
2063 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
2064 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
2065
4f940944
AD
20662002-04-22 Akim Demaille <akim@epita.fr>
2067
2068 * src/output.h, src/output.c (get_lines_number): Remove.
2069
3ded9a63
AD
20702002-04-19 Akim Demaille <akim@epita.fr>
2071
2072 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
2073 as Lex/Flex'.
2074 (Debugging): More details about enabling the debugging features.
2075 (Table of Symbols): Describe $$, $n, @$, and @n.
2076 Suggested by Tim Josling.
2077
e0c471a9
AD
20782002-04-19 Akim Demaille <akim@epita.fr>
2079
2080 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
2081
fecc10cd
AD
20822002-04-10 Akim Demaille <akim@epita.fr>
2083
2084 * src/system.h: Rely on HAVE_LIMITS_H.
2085 Suggested by Paul Eggert.
2086
51dec47b
AD
20872002-04-09 Akim Demaille <akim@epita.fr>
2088
2089 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
2090 full stderr, and strip it according to the bison options, instead
2091 of composing the error message from different bits.
2092 This makes it easier to check for several error messages.
2093 Adjust all the invocations.
2094 Add an invocation exercising the error token.
2095 Add an invocation demonstrating a stupid error message.
2096 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
2097 Adjust the tests.
2098 Error message are for stderr, not stdout.
2099
007a50a4
AD
21002002-04-09 Akim Demaille <akim@epita.fr>
2101
2102 * src/gram.h, src/gram.c (error_token_number): Remove, use
2103 errtoken->number.
2104 * src/reader.c (reader): Don't specify the user token number (2)
2105 for $undefined, as it uselessly prevents using it.
2106 * src/gram.h (token_number_t): Move to...
2107 * src/symtab.h: here.
2108 (state_t.number): Is a token_number_t.
2109 * src/print.c, src/reader.c: Use undeftoken->number instead of
2110 hard coded 2.
2111 (Even though this 2 is not the same as above: the number of the
2112 undeftoken remains being 2, it is its user token number which
2113 might not be 2).
2114 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
2115 `user_token_number_max'.
2116 Output `undef_token_number'.
2117 * data/bison.simple, data/bison.c++: Use them.
2118 Be sure to map invalid yylex return values to
2119 `undef_token_number'. This saves us from gratuitous SEGV.
2120
2121 * tests/conflicts.at (Solved SR Conflicts)
2122 (Unresolved SR Conflicts): Adjust.
2123 * tests/regression.at (Web2c Actions): Adjust.
2124
06446ccf
AD
21252002-04-08 Akim Demaille <akim@epita.fr>
2126
2127 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
2128 Adding #line.
2129 Remove the duplicate `typedefs'.
2130 (RhsNumberType): Fix the declaration and various other typos.
2131 Use __ofile__.
2132 * data/bison.simple: Use __ofile__.
2133 * src/scan-skel.l: Handle __ofile__.
2134
62a3e4f0
AD
21352002-04-08 Akim Demaille <akim@epita.fr>
2136
2137 * src/gram.h (item_number_t): New, the type of item numbers in
2138 RITEM. Note that it must be able to code symbol numbers as
2139 positive number, and the negation of rule numbers as negative
2140 numbers.
2141 Adjust all dependencies (pretty many).
2142 * src/reduce.c (rule): Remove this `short *' pointer: use
2143 item_number_t.
2144 * src/system.h (MINSHORT, MAXSHORT): Remove.
2145 Include `limits.h'.
2146 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
2147 (shortcpy): Remove.
2148 (MAXTABLE): Move to...
2149 * src/output.c (MAXTABLE): here.
2150 (prepare_rules): Use output_int_table to output rhs.
2151 * data/bison.simple, data/bison.c++: Adjust.
2152 * tests/torture.at (Big triangle): Move the limit from 254 to
2153 500.
2154 * tests/regression.at (Web2c Actions): Ajust.
2155
2156 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
2157 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
2158 passes, but produces negative #line number, once fixed, GCC is
2159 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
2160 C), it passes.
2161 * src/state.h (state_h): Code input lines on ints, not shorts.
2162
bb88b0fc
AD
21632002-04-08 Akim Demaille <akim@epita.fr>
2164
2165 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
2166 and then the grammar.
2167
9a636f47
AD
21682002-04-08 Akim Demaille <akim@epita.fr>
2169
2170 * src/system.h: No longer using strndup.
2171
680e8701
AD
21722002-04-07 Akim Demaille <akim@epita.fr>
2173
2174 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
2175 * src/output.c (output_table_data): Return the longest number.
2176 (prepare_tokens): Output `token_number_max').
2177 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
2178 New.
2179 Use them to define yy_token_number_type/TokenNumberType.
2180 Use this type for yytranslate.
2181 * tests/torture.at (Big triangle): Push the limit from 124 to
2182 253.
2183 * tests/regression.at (Web2c Actions): Adjust.
2184
817e9f41
AD
21852002-04-07 Akim Demaille <akim@epita.fr>
2186
2187 * tests/torture.at (Big triangle): New.
2188 (GNU AWK Grammar, GNU Cim Grammar): Move to...
2189 * tests/existing.at: here.
2190
5123689b
AD
21912002-04-07 Akim Demaille <akim@epita.fr>
2192
2193 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
2194 nritems.
2195 Adjust dependencies.
2196
f3849179
AD
21972002-04-07 Akim Demaille <akim@epita.fr>
2198
2199 * src/reader.c: Normalize increments to prefix form.
2200
bd02036a
AD
22012002-04-07 Akim Demaille <akim@epita.fr>
2202
2203 * src/reader.c, symtab.c: Remove debugging code.
2204
db8837cb
AD
22052002-04-07 Akim Demaille <akim@epita.fr>
2206
2207 Rename all the `bucket's as `symbol_t'.
2208
2209 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
2210 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
2211 * src/symtab.c, src/symtab.h (bucket): Rename as...
2212 (symbol_t): this.
2213 (symbol_list_new, bucket_check_defined, bucket_make_alias)
2214 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
2215 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
2216 (buckets_new, buckets_free, buckets_do): Rename as...
2217 (symbol_list_new, symbol_check_defined, symbol_make_alias)
2218 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
2219 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
2220 (symbols_new, symbols_free, symbols_do): these.
2221
72a23c97
AD
22222002-04-07 Akim Demaille <akim@epita.fr>
2223
2224 Use lib/hash for the symbol table.
2225
2226 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
2227 EOF.
2228 * src/lex.c (lex): Set the `number' member of new terminals.
2229 * src/reader.c (bucket_check_defined, bucket_make_alias)
2230 (bucket_check_alias_consistence, bucket_translation): New.
2231 (reader, grammar_free, readgram, token_translations_init)
2232 (packsymbols): Adjust.
2233 (reader): Number the predefined tokens.
2234 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
2235 for predefined tokens.
2236 * src/symtab.h (bucket): Remove all the hash table related
2237 members.
2238 * src/symtab.c (symtab): Replace by...
2239 (bucket_table): this.
2240 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
2241 (buckets_new, buckets_do): New.
2242
280a38c3
AD
22432002-04-07 Akim Demaille <akim@epita.fr>
2244
2245 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
2246 (start_symbol, max_user_token_number, semantic_parser)
2247 (error_token_number): Initialize.
2248 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
2249 Initialize.
2250 (reader): Don't.
2251 (errtoken, eoftoken, undeftoken, axiom): Extern.
2252
03b31c0c
AD
22532002-04-07 Akim Demaille <akim@epita.fr>
2254
2255 * src/gram.h (rule_s): prec and precsym are now pointers
2256 to the bucket giving the priority/associativity.
2257 Member `associativity' removed: useless.
2258 * src/reduce.c, src/conflicts.c: Adjust.
2259
8b3df748
AD
22602002-04-07 Akim Demaille <akim@epita.fr>
2261
2262 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
2263 Properly escape the symbols' TAG when outputting them.
2264
e601aa1d
AD
22652002-04-07 Akim Demaille <akim@epita.fr>
2266
2267 * src/lalr.h (LA): Is a bitsetv, not bitset*.
2268
b0299a2e
AD
22692002-04-07 Akim Demaille <akim@epita.fr>
2270
2271 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
2272 (LArule): this, which is an array to rule_t*.
2273 * src/print.c, src/conflicts.c: Adjust.
2274
d7e1f00c
AD
22752002-04-07 Akim Demaille <akim@epita.fr>
2276
2277 * src/gram.h (rule_t): Rename `number' as `user_number'.
2278 `number' is a new member.
2279 Adjust dependencies.
2280 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
2281
cc9305dd
AD
22822002-04-07 Akim Demaille <akim@epita.fr>
2283
2284 As a result of the previous patch, it is no longer needed
2285 to reorder ritem itself.
2286
2287 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
2288
b0940840
AD
22892002-04-07 Akim Demaille <akim@epita.fr>
2290
2291 Be sure never to walk through RITEMS, but use only data related to
2292 the rules themselves. RITEMS should be banished.
2293
2294 * src/output.c (output_token_translations): Rename as...
2295 (prepare_tokens): this.
2296 In addition to `translate', prepare the muscles `tname' and
2297 `toknum', which were handled by...
2298 (output_rule_data): this.
2299 Remove, and move the remainder of its outputs into...
2300 (prepare_rules): this new routines, which also merges content from
2301 (output_gram): this.
2302 (prepare_rules): Be sure never to walk through RITEMS.
2303 (output_stos): Rename as...
2304 (prepare_stos): this.
2305 (output): Always invoke prepare_states, after all, just don't use it
2306 in the output if you don't need it.
2307
643a5994
AD
23082002-04-07 Akim Demaille <akim@epita.fr>
2309
2310 * src/LR0.c (new_state): Display `nstates' as the name of the
2311 newly created state.
2312 Adjust to initialize first_state and last_state if needed.
2313 Be sure to distinguish the initial from the final state.
2314 (new_states): Create the itemset of the initial state, and use
2315 new_state.
2316 * src/closure.c (closure): Now that the initial state has its
2317 items properly set, there is no need for a special case when
2318 creating `ruleset'.
2319
2320 As a result, now the rule 0, reducing to $axiom, is visible in the
2321 outputs. Adjust the test suite.
2322
2323 * tests/conflicts.at (Solved SR Conflicts)
2324 (Unresolved SR Conflicts): Adjust.
2325 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
2326 * tests/conflicts.at (S/R in initial): New.
2327
b4c4ccc2
AD
23282002-04-07 Akim Demaille <akim@epita.fr>
2329
2330 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
2331 the RHS of the rules.
2332 * src/output.c (output_gram): Likewise.
2333
bba97eb2
AD
23342002-04-07 Akim Demaille <akim@epita.fr>
2335
2336 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
2337 bucket.
2338 Adjust all dependencies.
2339 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
2340 `number' of the buckets too.
2341 * src/gram.h: Include `symtab.h'.
2342 (associativity): Move to...
2343 * src/symtab.h: here.
2344 No longer include `gram.h'.
2345
c3b407f4
AD
23462002-04-07 Akim Demaille <akim@epita.fr>
2347
2348 * src/gram.h, src/gram.c (rules_rhs_length): New.
2349 (ritem_longest_rhs): Use it.
2350 * src/gram.h (rule_t): `number' is a new member.
2351 * src/reader.c (packgram): Set it.
2352 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
2353 the end of `rules', and count them out of `nrules'.
2354 (reduce_output, dump_grammar): Adjust.
2355 * src/print.c (print_grammar): It is no longer needed to check for
2356 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
2357 * tests/reduce.at (Reduced Automaton): New test.
2358
11652ab3
AD
23592002-04-07 Akim Demaille <akim@epita.fr>
2360
2361 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
2362 lacking `+ 1' to nrules, Bison reported as useless a token if it
2363 was used solely to set the precedence of the last rule...
2364
26b23c1a
AD
23652002-04-07 Akim Demaille <akim@epita.fr>
2366
2367 * data/bison.c++, data/bison.simple: Don't output the current file
2368 name in #line, to avoid useless diffs between two identical
2369 outputs under different names.
2370
18bcecb0
AD
23712002-04-07 Akim Demaille <akim@epita.fr>
2372
2373 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
2374 Normalize loops to using `< nrules + 1', not `<= nrules'.
2375
fa770c86
AD
23762002-04-07 Akim Demaille <akim@epita.fr>
2377
2378 * TODO: Update.
2379
d9b739c3
AD
23802002-04-07 Akim Demaille <akim@epita.fr>
2381
2382 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
2383 bucket.value as bucket.number.
2384
99013900
AD
23852002-04-07 Akim Demaille <akim@epita.fr>
2386
2387 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
2388 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
2389 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
2390 RHS, instead of being an index in RITEMS.
2391
e966383b
PE
23922002-04-04 Paul Eggert <eggert@twinsun.com>
2393
2394 * doc/bison.texinfo: Update copyright date.
2395 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
2396 (Symbols): Warn about running Bison in one character set,
2397 but compiling and/or running in an incompatible one.
2398 Warn about character code 256, too.
2399
24002002-04-03 Paul Eggert <eggert@twinsun.com>
2401
2402 * src/bison.data (YYSTACK_ALLOC): Depend on whether
2403 YYERROR_VERBOSE is nonzero, not whether it is defined.
2404
2405 Merge changes from bison-1_29-branch.
c307773e 2406
8d6c48b9
PE
24072002-03-20 Paul Eggert <eggert@twinsun.com>
2408
2409 Merge fixes from Debian bison_1.34-1.diff.
2410
2411 * configure.in (AC_PREREQ): 2.53.
2412
e53c6322
AD
24132002-03-20 Akim Demaille <akim@epita.fr>
2414
2415 * src/conflicts.c (log_resolution): Argument `resolution' is const.
2416
9ffbeca7
PE
24172002-03-19 Paul Eggert <eggert@twinsun.com>
2418
21db0b2a
PE
2419 * src/bison.simple (YYCOPY): New macro.
2420 (YYSTACK_RELOCATE): Use it.
2421 Remove Type arg; no longer needed. All callers changed.
2422 (yymemcpy): Remove; no longer needed.
2423
9ffbeca7
PE
2424 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
2425 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2426
642cb8f8
AD
24272002-03-19 Akim Demaille <akim@epita.fr>
2428
2429 Test and fix the #line outputs.
2430
2431 * tests/atlocal.at (GCC): New.
2432 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
2433 (Prologue synch line, ,%union synch line, Postprologue synch line)
2434 (Action synch line, Epilogue synch line): New tests.
2435 * src/reader.c (parse_union_decl): Define the muscle stype_line.
2436 * data/bison.simple, data/bison.c++: Use it.
2437
3c31a486
AD
24382002-03-19 Akim Demaille <akim@epita.fr>
2439
2440 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
2441 (Solved SR Conflicts, %expect not enough, %expect right)
2442 (%expect too much): Move to...
2443 * tests/conflicts.at: this new file.
2444
0d8bed56
AD
24452002-03-19 Akim Demaille <akim@epita.fr>
2446
2447 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2448 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
2449 that we can move to enums for instance.
2450 * src/output.c (token_definitions_output): Output a list of
2451 `token-name, token-number' instead of the #define.
2452 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
2453
9208d17f
AD
24542002-03-14 Akim Demaille <akim@epita.fr>
2455
2456 Use Gettext 0.11.1.
2457
af27eacb
RA
24582002-03-09 Robert Anisko <robert@lrde.epita.fr>
2459
2460 * data/bison.c++: Make the user able to add members to the generated
2461 parser by subclassing.
2462
9101a310
RA
24632002-03-05 Robert Anisko <robert@lrde.epita.fr>
2464
2465 * src/reader.c (read_additionnal_code): `c' should be an integer, not
2466 a character.
2467 Reported by Nicolas Tisserand and Nicolas Burrus.
2468
fff9bf0b
RA
24692002-03-04 Robert Anisko <robert@lrde.epita.fr>
2470
2471 * src/reader.c: Warn about lacking semi-colons, do not complain.
2472
64dba31e
RA
24732002-03-04 Robert Anisko <robert@lrde.epita.fr>
2474
2475 * data/bison.c++: Remove a debug line.
2476
374f5a14
RA
24772002-03-04 Robert Anisko <robert@lrde.epita.fr>
2478
2479 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
2480 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
2481 provide a default implementation.
2482
bfcf1f3a
AD
24832002-03-04 Akim Demaille <akim@epita.fr>
2484
2485 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
2486 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
2487 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
2488 * tests/semantic.at (Parsing Guards): Similarly.
2489 * src/reader.at (readgram): Complain if the last rule is not ended
2490 with a semi-colon.
2491
65ccf9fc
AD
24922002-03-04 Akim Demaille <akim@epita.fr>
2493
2494 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
2495 * src/closure.c: here.
2496 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
2497 RTC.
2498 * src/warshall.h, src/warshall.c: Remove.
2499 * tests/sets.at (Broken Closure): Adjust.
2500
d0039cbc
AD
25012002-03-04 Akim Demaille <akim@epita.fr>
2502
2503 * src/output.c (output_skeleton): tempdir is const.
2504 bytes_read is unused.
2505
345cea78
AD
25062002-03-04 Akim Demaille <akim@epita.fr>
2507
2508 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2509 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
2510 Update.
2511 From Michael Hayes.
2512
564801f7
AD
25132002-03-04 Akim Demaille <akim@epita.fr>
2514
2515 * src/closure.c (closure): `r' is unused.
2516
e5352bc7
AD
25172002-03-04 Akim Demaille <akim@epita.fr>
2518
2519 * tests/sets.at (Broken Closure): Add the ending `;'.
2520 * src/reader.at (readgram): Complain if a rule is not ended with a
2521 semi-colon.
2522
914feea9
AD
25232002-03-04 Akim Demaille <akim@epita.fr>
2524
2525 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
2526 (count_sr_conflicts): Use bitset_count.
2527 * src/reduce.c (inaccessable_symbols): Ditto.
2528 (bits_size): Remove.
2529 * src/warshall.h, src/warshall.c: Convert to bitsetv.
2530
f0250de6
AD
25312002-03-04 Akim Demaille <akim@epita.fr>
2532
2533 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
2534 * src/reduce.c: Remove the `bitset_zero's following the
2535 `bitset_create's, as now it is performed by the latter.
2536
ef017502
AD
25372002-03-04 Akim Demaille <akim@epita.fr>
2538
2539 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
2540 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
2541 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
2542 latest sources from Michael.
2543
76514394
AD
25442002-03-04 Akim Demaille <akim@epita.fr>
2545
2546 * src/output.c (output): Don't free the grammar.
2547 * src/reader.c (grammar_free): New.
2548 * src/main.c (main): Call it and don't free symtab here.
2549
55024580
AD
25502002-03-04 Akim Demaille <akim@epita.fr>
2551
2552 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
2553 before returning.
2554 Reported by Benoit Perrot.
2555
f9abaa2c
AD
25562002-03-04 Akim Demaille <akim@epita.fr>
2557
2558 Use bitset operations when possible, not loops over bits.
2559
2560 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
2561 bitset_or.
2562 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
2563 * src/reduce.c (useless_nonterminals): Formatting changes.
2564 * src/warshall.c (TC): Use bitset_or.
2565
0e721e75
AD
25662002-03-04 Akim Demaille <akim@epita.fr>
2567
2568 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
2569 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
2570 Ditto.
2571
0fb1ffb1
AD
25722002-03-04 Akim Demaille <akim@epita.fr>
2573
2574 * src/lalr.c (F): Now a bitset*.
2575 Adjust all dependencies.
2576
b86796bf
AD
25772002-03-04 Akim Demaille <akim@epita.fr>
2578
2579 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
2580 Adjust all dependencies.
2581
602bbf31
AD
25822002-03-04 Akim Demaille <akim@epita.fr>
2583
2584 * src/L0.c, src/LR0.h (nstates): Be size_t.
2585 Adjust comparisons (signed vs unsigned).
2586 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
2587 bitset*.
2588 Adjust all dependencies.
2589
d8a0245c
AD
25902002-03-04 Akim Demaille <akim@epita.fr>
2591
2592 * src/closure.c (firsts): Now, also a bitset.
2593 Adjust all dependencies.
2594 (varsetsize): Remove, now unused.
2595 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2596
34ba9743
AD
25972002-03-04 Akim Demaille <akim@epita.fr>
2598
2599 * src/print.c: Convert to use bitset.h, not hand coded iterations
2600 over ints.
2601
ed86e78c
AD
26022002-03-04 Akim Demaille <akim@epita.fr>
2603
2604 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2605
dfdb1797
AD
26062002-03-04 Akim Demaille <akim@epita.fr>
2607
2608 * src/closure.c (ruleset): Be a bitset.
2609 (rulesetsize): Remove.
2610
7086e707
AD
26112002-03-04 Akim Demaille <akim@epita.fr>
2612
2613 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2614 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2615 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2616 * src/closure.c (fderives): Be an array of bitsets.
2617
98254360
RA
26182002-02-28 Robert Anisko <robert@lrde.epita.fr>
2619
2620 * data/bison.c++: Merge the two generated headers. Insert a copyright
2621 notice in each output file.
2622
a75c057f
AD
26232002-02-28 Akim Demaille <akim@epita.fr>
2624
2625 * data/bison.c++: Copy the prologue of bison.simple to fetch
2626 useful M4 definitions, such as b4_header_guard.
2627
06b00abc
AD
26282002-02-25 Akim Demaille <akim@epita.fr>
2629
2630 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
2631 translator friendly scheme for the bgr
2632 copyright notice.
06b00abc 2633
70e7d534
AD
26342002-02-25 Akim Demaille <akim@epita.fr>
2635
2636 * src/output.c (header_output): Remove, now handled completely via
2637 M4.
2638
abe017f6
AD
26392002-02-25 Akim Demaille <akim@epita.fr>
2640
2641 * m4/m4.m4: New, from CVS Autoconf.
2642 * configure.in: Invoke it.
2643 * src/output.c (output_skeleton): Use its result instead of the
2644 hard coded name.
2645
381fb12e
AD
26462002-02-25 Akim Demaille <akim@epita.fr>
2647
2648 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2649 Fileutils 4.1.5.
2650 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2651 * src/output.c (output_skeleton): Use mkstemp to create a real
2652 temporary file.
2653 Move the filling of `skeleton' and its muscle to...
2654 (prepare): here.
2655 (output): Move the definition of the prologue muscle to...
2656 (prepare): here.
2657 * src/system.h (DEFAULT_TMPDIR): New.
2658
6f38107f
PE
26592002-02-14 Paul Eggert <eggert@twinsun.com>
2660
2661 Remove the support for C++ namespace cleanliness; it was
2662 causing more problems than it was curing, since it didn't work
2663 properly on some nonstandard C++ compilers. This can wait
2664 for a proper C++ parser.
2665
2666 * NEWS: Document this.
2667 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2668 of C++, as it's treated like C now.
2669 * src/bison.simple (YYSTD): Remove.
2670 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2671 Treat C++ just like Standard C instead of trying to support
2672 namespace cleanliness.
2673
80cce3da
AD
26742002-02-14 Akim Demaille <akim@epita.fr>
2675
2676 * tests/regression.at (else): Adjust to Andreas' change.
2677
842e8679
AD
26782002-02-14 Akim Demaille <akim@epita.fr>
2679
2680 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2681
4bda3f10
AD
26822002-02-13 Andreas Schwab <schwab@suse.de>
2683
2684 * src/output.c (output_rule_data): Don't output NULL, it might
2685 not be defined yet.
2686
4162fa07 26872002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 2688
4162fa07
RA
2689 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2690 (Copyright notice): Update.
b418ecd8 2691
bd16a5dc
AD
26922002-02-11 Akim Demaille <akim@epita.fr>
2693
2694 * tests/regression.at (%nonassoc and eof): Don't include
2695 nonportable headers.
2696
8d69a1a3
RA
26972002-02-08 Robert Anisko <robert@lrde.epita.fr>
2698
2699 * data/bison.c++: Correct error recovery. Make the user able to
2700 initialize the starting location.
2701
9b2d0677
AD
27022002-02-07 Akim Demaille <akim@epita.fr>
2703
2704 * tests/input.at: New.
2705
69e2658b
RA
27062002-02-07 Robert Anisko <robert@lrde.epita.fr>
2707
2708 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 2709 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
2710 directives around tables only needed for debugging.
2711
4aacc3a7
RA
27122002-02-07 Robert Anisko <robert@lrde.epita.fr>
2713
2714 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2715 C++ parsers.
2716 (yy::b4_name::parse): Use print_.
2717
762a801e
RA
27182002-02-07 Robert Anisko <robert@lrde.epita.fr>
2719
2720 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2721
4bb2bc3f
RA
27222002-02-07 Robert Anisko <robert@lrde.epita.fr>
2723
2724 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2725 C++ parsers.
2726 (yy::b4_name::parse): Build verbose error messages, and use error_.
2727
6b45a3ca
RA
27282002-02-06 Robert Anisko <robert@lrde.epita.fr>
2729
2730 * data/bison.c++: Fix m4 quoting in comments.
2731
50997c6e
RA
27322002-02-06 Robert Anisko <robert@lrde.epita.fr>
2733
2734 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2735 not expanded by m4.
2736
3f3eed27
AD
27372002-02-05 Akim Demaille <akim@epita.fr>
2738
2739 * data/bison.c++: Adjust to the M4 back end.
2740 More is certainly needed.
2741
be2a1a68
AD
27422002-02-05 Akim Demaille <akim@epita.fr>
2743
2744 Give a try to M4 as a back end.
2745
2746 * lib/readpipe.c: New, from wdiff.
2747 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2748 BISON_HAIRY.
2749 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2750 specific values. Now it is m4 that performs the lookup.
2751 * src/parse-skel.y: Remove.
2752 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2753 * src/output.c (actions_output, guards_output)
2754 (token_definitions_output): No longer keeps track of the output
2755 line number, hence remove the second argument.
2756 (guards_output): Check against the guard member of a rule, not the
2757 action member.
2758 Adjust callers.
2759 (output_skeleton): Don't look for the skeleton location, let m4 do
2760 that.
2761 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2762 file will be used.
2763 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2764 (prepare): Given that for the time being changesyntax is not
2765 usable in M4, rename the muscles using `-' to `_'.
2766 Define `defines_flag', `output_parser_name' and `output_header_name'.
2767 * src/output.h (actions_output, guards_output)
2768 (token_definitions_output): Adjust prototypes.
2769 * src/scan-skel.l: Instead of scanning the skeletons, it now
2770 processes the output of m4: `__oline__' and `#output'.
2771 * data/bison.simple: Adjust to be used by M4(sugar).
2772 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2773 to date.
2774 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2775 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2776 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2777 shamelessly stolen from CVS Autoconf.
2778
beda758b
AD
27792002-02-05 Akim Demaille <akim@epita.fr>
2780
2781 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2782 * configure.in: Check for the declarations of free and malloc.
2783 * src/muscle_tab.c: Adjust.
2784
5ece6d43
AD
27852002-02-05 Akim Demaille <akim@epita.fr>
2786
2787 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2788 which have no values.
2789
5bb18f9a
AD
27902002-02-05 Akim Demaille <akim@epita.fr>
2791
2792 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2793 * data/: here.
2794
894dd62e
PE
27952002-01-29 Paul Eggert <eggert@twinsun.com>
2796
2797 * src/bison.simple (YYSIZE_T): Do not define merely because
2798 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2799 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2800
82841af7
AD
28012002-01-27 Akim Demaille <akim@epita.fr>
2802
2803 Fix `%nonassoc and eof'.
2804
2805 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2806 which were not properly copied! Replace
2807 memcpy (res->errs, src->errs, src->nerrs);
2808 with
2809 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2810 !!!
2811 * tests/regression.at (%nonassoc and eof): Adjust to newest
2812 Autotest: `.' is not in the PATH.
2813
318b76e9
AD
28142002-01-27 Akim Demaille <akim@epita.fr>
2815
2816 * tests/sets.at (AT_EXTRACT_SETS): New.
2817 (Nullable): Use it.
2818 (Firsts): New.
2819
30d2f3d5
AD
28202002-01-26 Akim Demaille <akim@epita.fr>
2821
2822 * tests/actions.at, tests/calc.at, tests/headers.at,
2823 * tests/torture.at: Adjust to the newest Autotest which no longer
2824 forces `.' in the PATH.
2825
30f8c395
AD
28262002-01-25 Akim Demaille <akim@epita.fr>
2827
2828 * tests/regression.at (%nonassoc and eof): New.
2829 Suggested by Robert Anisko.
2830
29ae55f1
AD
28312002-01-24 Akim Demaille <akim@epita.fr>
2832
2833 Bison dumps core when trying to complain about broken input files.
2834 Reported by Cris van Pelt.
2835
2836 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2837 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2838 into...
2839 (Invalid inputs): Strengthen: exercise parse_percent_token.
2840
2b548aa6
RA
28412002-01-24 Robert Anisko <robert.anisko@epita.fr>
2842
2843 * src/Makefile.am: Add bison.c++.
2844 * src/bison.c++: New skeleton.
2845
bb0146c2
AD
28462002-01-21 Paolo Bonzini <bonzini@gnu.org>
2847
2848 * po/it.po: New.
2849
bec30531
AD
28502002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2851
2852 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2853
fc6edc45
MA
28542002-01-20 Marc Autret <marc@gnu.org>
2855
2856 * src/files.c (compute_output_file_names): Fix
2857
5e5d5415
MA
28582002-01-20 Marc Autret <marc@gnu.org>
2859
2860 * tests/output.at: New test.
2861 * src/files.c (compute_base_names): Don't map extensions when
2862 the YACC flag is set, use defaults.
2863 Reported by Evgeny Stambulchik.
2864
44ea3fbd
MA
28652002-01-20 Marc Autret <marc@gnu.org>
2866
bb0146c2 2867 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
2868 compilers as well (i.e. the vendor C compiler).
2869 Suggested by Albert Chin-A-Young.
2870
338963d1
TVH
28712002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2872
2873 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2874 canonical definition.
2875 * src/system.h: Use the canonical definition for PARAMS (avoids
2876 a conflict with the macro from lib/hash.h).
2877
c57b2479
AD
28782002-01-11 Akim Demaille <akim@epita.fr>
2879
2880 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 2881 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 2882
b85810ae
AD
28832002-01-09 Akim Demaille <akim@epita.fr>
2884
2885 * src/files.c, src/files.h (output_infix): New.
2886 (tab_extension): Remove.
2887 (compute_base_names): Compute the former, drop the latter.
2888 * src/output.c (prepare): Insert the muscles `output-infix', and
2889 `output-suffix'.
2890 * src/parse-skel.y (string, string.1): New.
2891 (section.header): Use it.
2892 (section.yacc): Remove.
2893 (prefix): Remove too.
2894 * src/scan-skel.l: Adjust.
2895 * src/bison.simple, src/bison.hairy: Adjust.
2896
cae60122
AD
28972002-01-09 Akim Demaille <akim@epita.fr>
2898
2899 * configure.in (WERROR_CFLAGS): Compute it.
2900 * src/Makefile.am (CFLAGS): Pass it.
2901 * tests/atlocal.in (CFLAGS): Idem.
2902 * src/files.c: Fix a few warnings.
2903 (get_extension_index): Remove, unused.
2904
ae404801
AD
29052002-01-08 Akim Demaille <akim@epita.fr>
2906
2907 * src/getargs.c (AS_FILE_NAME): New.
2908 (getargs): Use it to convert DOSish file names.
2909 * src/files.c (base_name): Rename as full_base_name to avoid
2910 clashes with `base_name ()'.
2911 (filename_split): New.
2912 (compute_base_names): N-th rewrite, using filename_split.
2913
22312b71
AD
29142002-01-08 Akim Demaille <akim@epita.fr>
2915
2916 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2917 New, stolen from the Fileutils 4.1.
2918 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2919 * configure.in: Check for the presence of memrchr, and of its
2920 prototype.
2921
a67cef01
TVH
29222002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2923
2924 * lib/hash.h (__P): Added definition for this macro.
2925 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2926 BUILT_SOURCES, to ensure they are generated first.
2927 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2928 %error-verbose to allow bootstrapping with bison 1.30x.
2929
2b25d624
AD
29302002-01-06 Akim Demaille <akim@epita.fr>
2931
2932 * src/reader.c (parse_braces): Don't fetch the next char, the
2933 convention is to fetch on entry.
2934 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2935 'switch' without a following semicolon.
2936 * tests/regression.at (braces parsing): New.
2937
3460813b
AD
29382002-01-06 Akim Demaille <akim@epita.fr>
2939
2940 Bison is dead wrong in its RR conflict reports.
2941
2942 * tests/torture.at (GNU Cim Grammar): New.
2943 * src/conflicts.c (count_rr_conflicts): Fix.
2944
73784c64
AD
29452002-01-06 Akim Demaille <akim@epita.fr>
2946
2947 Creating package.m4 from configure.ac causes too many problems.
2948
2949 * tests/Makefile.am (package.m4): Create it by hand,
2950 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2951
25d81090
AD
29522002-01-06 Akim Demaille <akim@epita.fr>
2953
2954 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2955 skeleton.h.
2956
a9b8959e
PE
29572002-01-04 Paul Eggert <eggert@twinsun.com>
2958
2959 * doc/bison.texinfo (Debugging):
2960 Remove YYSTDERR; it's no longer defined or used.
2961 Also, s/cstdio.h/cstdio/.
2962
25d81090
AD
29632002-01-03 Akim Demaille <akim@epita.fr>
2964
2965 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2966
1109455c
AD
29672002-01-03 Akim Demaille <akim@epita.fr>
2968
2969 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2970 tracing code to --trace, wait for a better --trace option, with
2971 args.
2972
7ea5e977
AD
29732002-01-03 Akim Demaille <akim@epita.fr>
2974
2975 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2976 The ISO C++ standard is extremely clear about it: stderr is
2977 considered a macro, not a regular symbol (see table 94 `Header
2978 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2979 Therefore std:: does not apply to it. It still does with fprintf.
2980 Also, s/cstdio.h/cstdio/.
2981
fab5b110
AD
29822002-01-03 Akim Demaille <akim@epita.fr>
2983
2984 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2985 for non system headers.
2986
aed7fd9b
AD
29872002-01-02 Akim Demaille <akim@epita.fr>
2988
2989 Equip the skeleton chain with location tracking, runtime trace,
2990 pure parser and scanner.
2991
2992 * src/parse-skel.y: Request a pure parser, locations, and prefix
2993 renaming.
2994 (%union): Having several members with the same type does not help
2995 type mismatches, simplify.
2996 (YYPRINT, yyprint): New.
2997 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2998 (skel_error): this.
2999 Handle locations.
3000 * src/scan-skel.l: Adjust to these changes.
3001 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
3002 (LOCATION_PRINT, skel_control_t): New.
3003
24fad99e
AD
30042001-12-30 Akim Demaille <akim@epita.fr>
3005
3006 * src/parse-skel.y: Get rid of the shift/reduce conflict:
3007 replace `gb' with BLANKS.
3008 * src/scan-skel.l: Adjust.
3009
a4b36db4
AD
30102001-12-30 Akim Demaille <akim@epita.fr>
3011
3012 * src/system.h: We don't need nor want bcopy.
3013 Throw away MS-DOS crap: we don't need getpid.
3014 * configure.in: We don't need strndup. It was even causing
3015 problems: because Flex includes the headers *before* us,
3016 _GNU_SOURCE is not defined by config.h, and therefore strndup was
3017 not visible.
3018 * lib/xstrndup.c: New.
3019 * src/scan-skel.l: Use it.
3020 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
3021 * src/parse-skel.y: Use %directives instead of #defines.
3022
1239777d
AD
30232001-12-30 Akim Demaille <akim@epita.fr>
3024
3025 * src/skeleton.h: New.
3026 * src/output.c (output_parser, output_master_parser): Remove, dead
3027 code.
3028 * src/output.h (get_lines_number, actions_output, guards_output)
3029 (token_definitions_output): Prototype them.
3030 * src/parse-skel.y: Add the license notice.
3031 Include output.h and skeleton.h.
3032 (process_skeleton): Returns void, and takes a single parameter.
3033 * src/scan-skel.l: Add the license notice.
3034 Include skeleton.h.
3035 Don't use %option yylineno: it seems that then Flex imagines
3036 REJECT has been used, and therefore it won't reallocate its
3037 buffers (which makes no other sense to me than a bug). It results
3038 in warnings for `unused: yy_flex_realloc'.
3039
9b3add5b
RA
30402001-12-30 Robert Anisko <robert.anisko@epita.fr>
3041
3042 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3043 (MUSCLE_INSERT_PREFIX): ...to there.
3044 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3045 (MUSCLE_INSERT_PREFIX): Move from here...
3046
3047 * src/bison.hairy: Add a section directive. Put braces around muscle
3048 names. This parser skeleton is still broken, but Bison should not
3049 choke on a bad muscle 'syntax'.
3050 * src/bison.simple: Add a section directive. Put braces around muscle
3051 names.
3052
3053 * src/files.h (strsuffix, stringappend): Add declarations.
3054 (tab_extension): Add declaration.
3055 (short_base_name): Add declaration.
3056
3057 * src/files.c (strsuffix, stringappend): No longer static. These
3058 functions are used in the skeleton parser.
3059 (tab_extension): New.
3060 (compute_base_names): Use the computations done in this function
fab5b110 3061 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
3062 names.
3063 (short_base_name): No longer static.
3064
3065 * src/output.c (output_skeleton): New.
3066 (output): Disable call to output_master_parser, and give a try to
3067 a new skeleton handling system.
3068 (guards_output, actions_output): No longer static.
3069 (token_definitions_output, get_lines_number): No longer static.
3070
3071 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
3072
fab5b110 3073 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
3074 parse-skel.y.
3075
3076 * src/parse-skel.y: New file.
3077 * src/scan-skel.l: New file.
3078
b5b61c61
AD
30792001-12-29 Akim Demaille <akim@epita.fr>
3080
3081 %name-prefix is broken.
3082
3083 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
3084 Adjust all dependencies.
3085 * tests/headers.at (export YYLTYPE): Strengthen this test: use
3086 %name-prefix.
3087
3088 Renaming yylval but not yylloc is not consistent. Now we do.
3089
3090 * src/bison.simple: Prefix yylloc if used.
3091 * doc/bison.texinfo (Decl Summary): Document that.
3092
8c9a50be
AD
30932001-12-29 Akim Demaille <akim@epita.fr>
3094
3095 * doc/bison.texinfo: Promote `%long-directive' over
3096 `%long_directive'.
3097 Remove all references to fixed-output-files, yacc is enough.
3098
d99361e6
AD
30992001-12-29 Akim Demaille <akim@epita.fr>
3100
3101 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
3102 user prologue. These are defaults.
3103 * tests/actions.at (Mid-rule actions): Make sure the user can
3104 define YYDEBUG and YYERROR_VERBOSE.
3105
b9cecb91
AD
31062001-12-29 Akim Demaille <akim@epita.fr>
3107
3108 * src/output.c (header_output): Don't forget to export YYLTYPE and
3109 yylloc.
3110 * tests/headers.at (export YYLTYPE): New, make sure it does.
3111 * tests/regression.at (%union and --defines, Invalid CPP headers):
3112 Move to...
3113 * tests/headers.at: here.
3114
aea13e97
AD
31152001-12-29 Akim Demaille <akim@epita.fr>
3116
3117 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
3118
931394cb
AD
31192001-12-29 Akim Demaille <akim@epita.fr>
3120
3121 * tests/actions.at (Mid-rule actions): Output on a single line
3122 instead of several.
3123
704a47c4
AD
31242001-12-29 Akim Demaille <akim@epita.fr>
3125
3126 * doc/bison.texinfo: Formatting changes.
3127
091e20bb
AD
31282001-12-29 Akim Demaille <akim@epita.fr>
3129
3130 Don't store the token defs in a muscle, just be ready to output it
3131 on command. Now possible via `symbols'. Fixes a memory leak.
3132
3133 * src/output.c (token_definitions_output): New.
3134 (output_parser, header_output): Use it.
3135 * src/reader.c (symbols_save): Remove.
3136
cce71710
AD
31372001-12-29 Akim Demaille <akim@epita.fr>
3138
3139 * src/bison.simple: Do not provide a default for YYSTYPE and
3140 YYLTYPE before the user's prologue. Otherwise it's hardly... a
3141 default.
3142
82c035a8
AD
31432001-12-29 Akim Demaille <akim@epita.fr>
3144
3145 Mid-rule actions are simply... ignored!
3146
3147 * src/reader.c (readgram): Be sure to attach mid-rule actions to
3148 the empty-rule associated to the dummy symbol, not to the host
3149 rule.
3150 * tests/actions.at (Mid-rule actions): New.
3151
8419d367
AD
31522001-12-29 Akim Demaille <akim@epita.fr>
3153
3154 Memory leak.
3155
3156 * src/reader.c (reader): Free grammar.
3157
375d5806
AD
31582001-12-29 Akim Demaille <akim@epita.fr>
3159
3160 Memory leak.
3161
3162 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
3163 since it allocates it for each state, although only one is needed.
3164 (allocate_storage): Do it here.
3165
f51cb8ff
AD
31662001-12-29 Akim Demaille <akim@epita.fr>
3167
3168 * src/options.h, src/options.c (create_long_option_table): Rename
3169 as...
3170 (long_option_table_new): this, with a clearer prototype.
3171 (percent_table): Remove, unused,
3172 * src/getargs.c (getargs): Adjust.
3173
29e88316
AD
31742001-12-29 Akim Demaille <akim@epita.fr>
3175
3176 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
3177 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
3178 as states.
3179
b9f71f19
AD
31802001-12-29 Akim Demaille <akim@epita.fr>
3181
3182 * src/lalr.c (build_relations): Rename `states' as `states1'.
3183 Sorry, I don't understand exactly what it is, no better name...
3184
1a2b5d37
AD
31852001-12-29 Akim Demaille <akim@epita.fr>
3186
3187 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
3188 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
3189 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
3190 as rules.
3191
1cca533e
AD
31922001-12-29 Akim Demaille <akim@epita.fr>
3193
3194 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
3195 ago.
3196
c03ae966
AD
31972001-12-29 Akim Demaille <akim@epita.fr>
3198
3199 * src/reader.c, src/reader.h (user_toknums): Remove.
3200 Adjust all users to use symbols[i]->user_token_number.
3201
5a670b1e
AD
32022001-12-29 Akim Demaille <akim@epita.fr>
3203
3204 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
3205 Adjust all users to use symbols[i]->prec or ->assoc.
3206
ad949da9
AD
32072001-12-29 Akim Demaille <akim@epita.fr>
3208
3209 * src/reader.c, src/reader.h (tags): Remove.
3210 Adjust all users to use symbols[i]->tag.
3211
0e78e603
AD
32122001-12-29 Akim Demaille <akim@epita.fr>
3213
3214 * src/gram.h, src/gram.c (symbols): New, similar to state_table
3215 and rule_table.
3216 * src/reader.c (packsymbols): Fill this table.
3217 Drop sprec.
3218 * src/conflicts.c (resolve_sr_conflict): Adjust.
3219 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
3220 single table.
3221 Use symbols[i]->tag instead of tags[i].
3222
213e640e
AD
32232001-12-29 Akim Demaille <akim@epita.fr>
3224
3225 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
3226 In addition, put a comment in there, to replace...
3227 * tests/regression.at (%union and C comments): Remove.
3228
e7b8bef1
AD
32292001-12-29 Akim Demaille <akim@epita.fr>
3230
3231 * tests/regression.at (Web2c Actions): Blindly move the actual
3232 output as expected output. The contents *seem* right to me, but I
3233 can't pretend reading perfectly parser tables... Nonetheless, all
3234 the other tests pass correctly, the table look OK, even though the
3235 presence of `$axiom' is to be noted: AFAICS it is useless (but
3236 harmless).
3237
b68e7744
AD
32382001-12-29 Akim Demaille <akim@epita.fr>
3239
3240 * src/reader.c (readgram): Don't add the rule 0 if there were no
3241 rules read. In other words, add it _after_ having performed
3242 grammar sanity checks.
3243 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
3244
78d5bae9
AD
32452001-12-29 Akim Demaille <akim@epita.fr>
3246
3247 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
3248 visible, and some states have now a different number.
3249
ff442794
AD
32502001-12-29 Akim Demaille <akim@epita.fr>
3251
3252 * src/reader.c (readgram): Bind the initial rule's lineno to that
3253 of the first rule.
3254 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
3255 (Solved SR Conflicts): Adjust rule 0's line number.
3256
610ab194
AD
32572001-12-29 Akim Demaille <akim@epita.fr>
3258
3259 Fix the `GAWK Grammar' failure.
3260
3261 * src/LR0.c (final_state): Initialize to -1 so that we do compute
3262 the reductions of the first state which was mistakenly confused
3263 with the final state because precisely final_state was initialized
3264 to 0.
3265 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
3266 now noticed by Bison.
3267 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
3268 have a reduction on $default.
3269
29d29c8f
AD
32702001-12-29 Akim Demaille <akim@epita.fr>
3271
3272 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
3273 rule line numbers.
3274 * src/closure.c (print_closure): Likewise.
3275 * src/derives.c (print_derives): Likewise.
3276 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
3277 now.
3278
7c6b64d0
AD
32792001-12-29 Akim Demaille <akim@epita.fr>
3280
3281 * src/lalr.c (lookaheads_print): New.
3282 (lalr): Call it when --trace-flag.
3283 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
3284 are dumped.
3285
3d4daee3
AD
32862001-12-29 Akim Demaille <akim@epita.fr>
3287
3288 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
3289 when walking through ritem, even via rule->rhs.
3290 * src/reduce.c (dump_grammar, useful_production, reduce_output)
3291 (useful_production, useless_nonterminals): Likewise.
3292 (reduce_grammar_tables): Likewise, plus update nritems.
3293 * src/nullable.c (set_nullable): Likewise.
3294 * src/lalr.c (build_relations): Likewise.
3295 * tests/sets.at (Nullable): Adjust.
3296 Fortunately, now, the $axiom is no longer nullable.
3297
9e7f6bbd
AD
32982001-12-29 Akim Demaille <akim@epita.fr>
3299
3300 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
3301 the 0-sentinel.
3302 * src/gram.c (ritem_longest_rhs): Likewise.
3303 * src/reduce.c (nonterminals_reduce): Likewise.
3304 * src/print_graph.c (print_graph): Likewise.
3305 * src/output.c (output_rule_data): Likewise.
3306 * src/nullable.c (set_nullable): Likewise.
3307
255ef638
AD
33082001-12-29 Akim Demaille <akim@epita.fr>
3309
3310 * src/output.c: Comment changes.
3311
0d8a7363
AD
33122001-12-27 Paul Eggert <eggert@twinsun.com>
3313
3314 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
3315 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
3316 Sparc, as they were causing more porting problems than the
3317 (minor) performance improvement was worth.
3318
3319 Also, catch up with 1.31's YYSTD.
3320
3db472b9
AD
33212001-12-27 Akim Demaille <akim@epita.fr>
3322
3323 * src/output.c (output_gram): Rely on nritems, not the
3324 0-sentinel. See below.
3325 Use -1 as separator, not 0.
3326 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
3327 Rely on -1 as separator in yyrhs, instead of 0.
3328 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
3329 twice `Now at end of input', therefore there are two lines less to
3330 expect.
3331
b365aa05
AD
33322001-12-27 Akim Demaille <akim@epita.fr>
3333
3334 * tests/regression.at (Unresolved SR Conflicts):
3335 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
3336 below.
3337
30171f79
AD
33382001-12-27 Akim Demaille <akim@epita.fr>
3339
3340 * src/LR0.c (new_state): Recognize the final state by the fact it
3341 is reached by eoftoken.
3342 (insert_start_shifting_state, insert_eof_shifting_state)
3343 (insert_accepting_state, augment_automaton): Remove, since now
3344 these states are automatically computed from the initial state.
3345 (generate_states): Adjust.
3346 * src/print.c: When reporting a rule number to the user, substract
3347 1, so that the axiom rule is rule 0, and the first user rule is 1.
3348 * src/reduce.c: Likewise.
3349 * src/print_graph.c (print_core): For the time being, just as for
3350 the report, depend upon --trace-flags to dump the full set of
3351 items.
3352 * src/reader.c (readgram): Once the grammar read, insert the rule
3353 0: `$axiom: START-SYMBOL $'.
3354 * tests/set.at: Adjust: rule 0 is now displayed, and since the
3355 number of the states has changed (the final state is no longer
3356 necessarily the last), catch up.
3357
75142d45
AD
33582001-12-27 Akim Demaille <akim@epita.fr>
3359
3360 Try to make the use of the eoftoken valid. Given that its value
3361 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
3362 is used instead of > 0 where appropriate, (ii), depend upon nritems
3363 instead of the 0-sentinel.
3364
3365 * src/gram.h, src/gram.c (nritems): New.
3366 Expected to be duplication of nitems, but for the time being...
3367 * src/reader.c (packgram): Assert nritems and nitems are equal.
3368 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
3369 * src/closure.c (print_closure, print_fderives): Likewise.
3370 * src/gram.c (ritem_print): Likewise.
3371 * src/print.c (print_core, print_grammar): Likewise.
3372 * src/print_graph.c: Likewise.
3373
b7c49edf
AD
33742001-12-27 Akim Demaille <akim@epita.fr>
3375
3376 * src/main.c (main): If there are complains after grammar
3377 reductions, then output the report anyway if requested, then die.
3378 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
3379 * src/reader.c (eoftoken): New.
3380 (parse_token_decl): If the token being defined has value `0', it
3381 is the eoftoken.
3382 (packsymbols): No longer hack `tags' to insert `$' by hand.
3383 Be sure to preserve the value of the eoftoken.
3384 (reader): Make sure eoftoken is defined.
3385 Initialize nsyms to 0: now eoftoken is created just like the others.
3386 * src/print.c (print_grammar): Don't special case the eof token.
3387 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
3388 lie anyway, albeit pleasant.
3389 * tests/calc.at: Exercise error messages with eoftoken.
3390 Change the grammar so that empty input is invalid.
3391 Adjust expectations.
3392 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
3393
ec2da99f
AD
33942001-12-27 Akim Demaille <akim@epita.fr>
3395
3396 * configure.in: Check the protos of strchr ans strspn.
3397 Replace strchr if needed.
3398 * src/system.h: Provide the protos of strchr, strspn and memchr if
3399 missing.
3400 * lib/strchr.c: New.
3401 * src/reader.c (symbols_save): Use strchr.
3402
8adfa272
AD
34032001-12-27 Akim Demaille <akim@epita.fr>
3404
3405 * src/print.c, src/print_graph.c (escape): New.
3406 Use it to quote the TAGS outputs.
3407 * src/print_graph.c (print_state): Now errors are in red, and
3408 reductions in green.
3409 Prefer high to wide: output the state number on a line of its own.
3410
80dac38c
AD
34112001-12-27 Akim Demaille <akim@epita.fr>
3412
3413 * src/state.h, src/state.c (reductions_new): New.
3414 * src/LR0.c (set_state_table): Let all the states have a
3415 `reductions', even if reduced to 0.
3416 (save_reductions): Adjust.
3417 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
3418 * src/print.c (print_reductions, print_actions): Adjust.
3419 * src/output.c (action_row): Adjust.
3420
2cec70b9
AD
34212001-12-27 Akim Demaille <akim@epita.fr>
3422
3423 * src/state.h, src/state.c (errs_new, errs_dup): New.
3424 * src/LR0.c (set_state_table): Let all the states have an errs,
3425 even if reduced to 0.
3426 * src/print.c (print_errs, print_reductions): Adjust.
3427 * src/output.c (output_actions, action_row): Adjust.
3428 * src/conflicts.c (resolve_sr_conflict): Adjust.
3429
13ca549a
AD
34302001-12-27 Akim Demaille <akim@epita.fr>
3431
3432 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
3433
5092aba5
AD
34342001-12-27 Akim Demaille <akim@epita.fr>
3435
3436 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
3437 * src/print.c: here.
3438 (lookaheadset, shiftset): New, used as additional storage by
3439 print_reductions.
3440 (print_results): Adjust.
3441 (print_shifts, print_gotos, print_errs): New, extracted from...
3442 (print_actions): here.
3443 * src/print_graph.c (print_actions): Remove dead code.
3444
11e2beca
AD
34452001-12-27 Akim Demaille <akim@epita.fr>
3446
3447 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
3448 `$n' and `@n'.
3449
dac3c910
AD
34502001-12-27 Akim Demaille <akim@epita.fr>
3451
3452 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
3453 (build_relations): Adjust.
3454
d0b0fefa
AD
34552001-12-27 Akim Demaille <akim@epita.fr>
3456
3457 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
3458 duplication.
3459
adc8c848
AD
34602001-12-27 Akim Demaille <akim@epita.fr>
3461
3462 * src/reader.c (packgram): Catch nitems overflows.
3463
14d293ac
AD
34642001-12-27 Akim Demaille <akim@epita.fr>
3465
3466 * src/files.c, src/files.h (guard_obstack): Remove.
3467 * src/output.c (output): Adjust.
3468 * src/reader.c (parse_braces): New, factoring...
3469 (copy_action, copy_guard): these two which are renamed as...
3470 (parse_action, parse_guard): these.
3471 As a voluntary consequence, using braces around guards is now
3472 mandatory.
3473
f499b062
AD
34742001-12-27 Akim Demaille <akim@epita.fr>
3475
3476 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
3477 * src/reader.c (symbol_list): `guard' and `guard_line' are new
3478 members.
3479 (symbol_list_new): Adjust.
3480 (copy_action): action_line is the first line, not the last.
3481 (copy_guard): Just as for actions, store the `action' only, not
3482 the switch/case/break flesh.
3483 Don't parse the user action that might follow the guard, let...
3484 (readgram): do it, i.e., now, there can be an action after a
3485 guard.
3486 In other words the guard is just explicitly optional.
3487 (packgram): Adjust.
3488 * src/output.c (guards_output): New.
3489 (output_parser): Call it when needed.
3490 (output): Also free the guard and attrs obstacks.
3491 * src/files.c, src/files.h (obstack_save): Remove.
3492 (output_files): Remove.
3493 As a result, if one needs the former `.act' file, using an
3494 appropriate skeleton which requires actions and guards is now
3495 required.
3496 * src/main.c (main): Adjust.
3497 * tests/semantic.at: New.
3498 * tests/regression.at: Use `input.y' as input file name.
3499 Avoid 8+3 problems by requiring input.c when the test needs the
3500 parser.
3501
d945f5cd
AD
35022001-12-27 Akim Demaille <akim@epita.fr>
3503
3504 * src/reader.c (symbol_list_new): Be sure to initialize all the
3505 fields.
3506
d200e455
AD
35072001-12-27 Akim Demaille <akim@epita.fr>
3508
3509 All the hacks using a final pseudo state are now useless.
3510
3511 * src/LR0.c (set_state_table): state_table holds exactly nstates.
3512 * src/lalr.c (nLA): New.
3513 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
3514 instead of lookaheadsp from the pseudo state (nstate + 1).
3515
f9507c28
AD
35162001-12-27 Akim Demaille <akim@epita.fr>
3517
3518 * src/output.c (action_row, token_actions): Use a state_t instead
3519 of a integer, and nlookaheads instead of the following state's
3520 lookaheadsp.
3521
065fbd27
AD
35222001-12-27 Akim Demaille <akim@epita.fr>
3523
3524 * src/conflicts.c (log_resolution, flush_shift)
3525 (resolve_sr_conflict, set_conflicts, solve_conflicts)
3526 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
3527 (conflicts_print, print_reductions): Use a state_t instead of an
3528 integer when referring to a state.
3529 As much as possible, depend upon nlookaheads, instead of the
3530 `lookaheadsp' member of the following state (since lookaheads of
3531 successive states are successive, the difference between state n + 1
3532 and n served as the number of lookaheads for state n).
3533 * src/lalr.c (add_lookback_edge): Likewise.
3534 * src/print.c (print_core, print_actions, print_state)
3535 (print_results): Likewise.
3536 * src/print_graph.c (print_core, print_actions, print_state)
3537 (print_graph): Likewise.
3538 * src/conflicts.h: Adjust.
3539
1b177bd7
AD
35402001-12-27 Akim Demaille <akim@epita.fr>
3541
3542 * src/bison.hairy: Formatting/comment changes.
3543 ANSIfy.
3544 Remove `register' indications.
3545 Add plenty of `static'.
3546
7742ddeb
AD
35472001-12-27 Akim Demaille <akim@epita.fr>
3548
3549 * src/output.c (prepare): Drop the muscle `ntbase' which
3550 duplicates ntokens.
3551 * src/bison.simple: Formatting/comment changes.
3552 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
3553 is an undocumented synonym.
3554
1fa14068
AD
35552001-12-22 Akim Demaille <akim@epita.fr>
3556
3557 * src/output.c (output_table_data): Change the prototype to use
3558 `int' for array ranges: some invocations do pass an int, not a
3559 short.
3560 Reported by Wayne Green.
3561
b9752825
AD
35622001-12-22 Akim Demaille <akim@epita.fr>
3563
3564 Some actions of web2c.y are improperly triggered.
3565 Reported by Mike Castle.
3566
3567 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
3568 * tests/regression.at (Web2c): Rename as...
3569 (Web2c Report): this.
3570 (Web2c Actions): New.
3571
776209d6
AD
35722001-12-22 Akim Demaille <akim@epita.fr>
3573
3574 Reductions in web2c.y are improperly reported.
3575 Reported by Mike Castle.
3576
3577 * src/conflicts.c (print_reductions): Fix.
3578 * tests/regression.at (Web2c): New.
3579
275fc3ad
AD
35802001-12-18 Akim Demaille <akim@epita.fr>
3581
3582 Some host fail on `assert (!"foo")', which expands to
3583 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
3584 Reported by Nelson Beebee.
3585
3586 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
3587 `#define it_succeeded 0' and `assert (it_succeeded)'.
3588
897668ee
MA
35892001-12-17 Marc Autret <autret_m@epita.fr>
3590
3591 * src/bison.simple: Don't hard code the skeleton line and filename.
3592 * src/output.c (output_parser): Rename 'line' as 'output_line'.
3593 New line counter 'skeleton_line' (skeleton-line muscle).
3594
ab3399e0
PE
35952001-12-17 Paul Eggert <eggert@twinsun.com>
3596
3597 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3598 YYDEBUG must be defined to a nonzero value.
3599
3600 * src/bison.simple (yytname): Do not assume that the user defines
3601 YYDEBUG to a properly parenthesized expression.
3602
3877f72b
AD
36032001-12-17 Akim Demaille <akim@epita.fr>
3604
3605 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3606 nlookaheads is a new member.
3607 Adjust all users.
3608 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3609 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3610 state.
776209d6 3611
331dbc1b
AD
36122001-12-17 Akim Demaille <akim@epita.fr>
3613
3614 * src/files.h, src/files.c (open_files, close_files): Remove.
3615 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3616 let...
3617 * src/reader.c (reader): Do it.
776209d6 3618
be750e4c
AD
36192001-12-17 Akim Demaille <akim@epita.fr>
3620
3621 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 3622
709ae8c6
AD
36232001-12-17 Akim Demaille <akim@epita.fr>
3624
3625 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3626 (flush_reduce): New.
3627 (resolve_sr_conflict): Adjust.
776209d6 3628
f87685c3
AD
36292001-12-17 Akim Demaille <akim@epita.fr>
3630
3631 * src/output.c (output_obstack): Be static and rename as...
3632 (format_obstack): this, to avoid any confusion with files.c's
3633 output_obstack.
3634 * src/reader.h (muscle_obstack): Move to...
3635 * src/output.h: here, since it's defined in output.c.
3636
837491d8
AD
36372001-12-17 Akim Demaille <akim@epita.fr>
3638
3639 * src/output.c (action_row, save_column, default_goto)
3640 (sort_actions, matching_state, pack_vector): Better variable
3641 locality.
3642
796d61fb
AD
36432001-12-17 Akim Demaille <akim@epita.fr>
3644
3645 * src/output.c: Various formatting changes.
776209d6 3646
64d15509
AD
36472001-12-17 Akim Demaille <akim@epita.fr>
3648
3649 * src/files.c (output_files): Free the output_obstack.
3650 * src/main.c (main): Call print and print_graph conditionally.
3651 * src/print.c (print): Work unconditionally.
3652 * src/print_graph.c (print_graph): Work unconditionally.
3653 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3654
fbc8ecb7
MA
36552001-12-16 Marc Autret <autret_m@epita.fr>
3656
3657 * src/output.c (actions_output): Fix. When we use %no-lines,
3658 there is one less line per action.
3659
f0440388
MA
36602001-12-16 Marc Autret <autret_m@epita.fr>
3661
3662 * src/bison.simple: Remove a useless #line directive.
3663 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3664 * src/output.c (get_lines_number): New.
776209d6 3665 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
3666 output muscles.
3667 Fix line numbering.
3668 (actions_output): Computes the number of lines taken by actions.
3669 (output_master_parser): Insert new skeleton which is the name of
3670 the output parser file name.
3671
a79986b8
MA
36722001-12-15 Marc Autret <autret_m@epita.fr>
3673
3674 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3675
4ec8e00f
MA
36762001-12-15 Marc Autret <autret_m@epita.fr>
3677
3678 * src/output.c (output_gram): Keep track of the hairy one.
3679
1a4648ff
AD
36802001-12-15 Akim Demaille <akim@epita.fr>
3681
3682 Make `make distcheck' work.
3683
3684 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3685 system.h which uses libgettext.h.
3686
9c2c67e6
AD
36872001-12-15 Akim Demaille <akim@epita.fr>
3688
3689 * src/nullable.c (set_nullable): Useless rules must be skipped,
3690 otherwise, since we range over their symbols, we might look at a
3691 nonterminal which no longer ``exists'', i.e., it is not counted in
3692 `nvars', hence we overflow our arrays.
3693
93ede233
AD
36942001-12-15 Akim Demaille <akim@epita.fr>
3695
3696 The header can also be produced directly, without any obstack!
3697 Yahoo!
3698
3699 * src/files.c, src/files.h (defines_obstack): Remove.
3700 (compute_header_macro): Global.
3701 (defines_obstack_save): Remove.
3702 * src/reader.c (parse_union_decl): No longer output to
3703 defines_obstack: its content can be found in the `stype' muscle
3704 anyway.
3705 (output_token_translations): Merge into...
3706 (symbols_output): this.
3707 Rename as...
3708 (symbols_save): this.
3709 (reader): Adjust.
3710 * src/output.c (header_output): New.
3711 (output): Call it.
3712
2666f928
AD
37132001-12-15 Akim Demaille <akim@epita.fr>
3714
3715 * src/reader.c (parse_union_decl): Instead of handling two obstack
3716 simultaneously, use one to define the `stype' muscle, and use the
3717 value of the latter to fill defines_obstack.
3718 (copy_comment): Remove.
3719 (copy_comment2): Work for a single obstack.
3720 Rename as...
3721 (copy_comment): this.
3722
428046f8
AD
37232001-12-15 Akim Demaille <akim@epita.fr>
3724
3725 * src/lex.c, src/lex.h (xgetc): No longer static.
3726 * src/reader.c (parse_union_decl): Revamp.
3727
ea52d706
AD
37282001-12-15 Akim Demaille <akim@epita.fr>
3729
3730 Still making progress in separating Bison into (i) input, (ii)
3731 process, (iii) output: now we can directly output the parser file
3732 without using table_obstack at all.
3733
3734 * src/files.c, src/files.h (table_obstack): Bye bye.
3735 (parser_file_name): New.
3736 * src/files.c (compute_output_file_names): Compute it.
3737 * src/output.c (actions_output, output_parser)
3738 (output_master_parser): To a file instead of an obstack.
3739
3f96f4dc
AD
37402001-12-15 Akim Demaille <akim@epita.fr>
3741
3742 Attach actions to rules, instead of pre-outputting them to
3743 actions_obstack.
3744
3745 * src/gram.h (rule_t): action and action_line are new members.
3746 * src/reader.c (symbol_list): Likewise.
3747 (copy_action): Save the actions within the rule.
3748 (packgram): Save them in rule_table.
3749 * src/output.c (actions_output): New.
3750 (output_parser): Use it on `%%actions'.
3751 (output_rule_data): Don't free rule_table.
3752 (output): Do it.
3753 (prepare): Don't save the `action' muscle.
3754 * src/bison.simple: s/%%action/%%actions/.
3755
51576fb3
AD
37562001-12-15 Akim Demaille <akim@epita.fr>
3757
3758 * src/reader.c (copy_action): When --yacc, don't append a `;'
3759 to the user action: let it fail if lacking.
dee049eb 3760 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 3761
2648a72d
AD
37622001-12-14 Akim Demaille <akim@epita.fr>
3763
3764 * src/lex.c (literalchar): Simply return the char you decoded, non
3765 longer mess around with obstacks and int pointers.
3766 Adjust all callers.
3767
92790e5b
AD
37682001-12-14 Akim Demaille <akim@epita.fr>
3769
3770 * src/lex.c (literalchar): Don't escape the special characters,
3771 just decode them, and keep them as char (before, eol was output as
3772 the 2 char string `\n' etc.).
3773 * src/output.c (output_rule_data): Use quotearg to output the
3774 token strings.
3775
927c1557
PE
37762001-12-13 Paul Eggert <eggert@twinsun.com>
3777
3778 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3779 Do not infringe on the global user namespace when using C++.
3780 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3781 All uses of `fprintf' and `stderr' changed.
3782
3783 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3784
ed8e1f68
AD
37852001-12-13 Akim Demaille <akim@epita.fr>
3786
3787 The computation of nullable is broken: it doesn't handle empty
3788 RHS's properly.
3789
3790 * tests/torture.at (GNU AWK Grammar): New.
3791 * tests/sets.at (Nullable): New.
3792 * src/nullable.c (set_nullable): Instead of blindly looping over
3793 `ritems', loop over the rules, and then over their rhs's.
3794
3795 Work around Autotest bugs.
3796
3797 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3798 frame, because Autotest understand lines starting with a `+' as
3799 traces from the shell. Then, they are not processed properly.
3800 Admittedly an Autotest bug, but we don't have time to wait for
3801 Autotest to catch up.
3802 * tests/regression.at (Broken Closure): Adjust to the new table
3803 frames.
3804 Move to...
3805 * tests/sets.at: here.
3806
cb581495
AD
38072001-12-13 Akim Demaille <akim@epita.fr>
3808
3809 * src/closure.c (closure): Use nrules instead of playing tricks
3810 with BITS_PER_WORD.
3811
2e729273
AD
38122001-12-13 Akim Demaille <akim@epita.fr>
3813
3814 * src/print.c (print_actions): Output the handling of `$' as the
3815 traces do: shifting the token EOF. Before EOF was treated as a
3816 nonterminal.
3817 * tests/regression.at: Adjust some tests.
3818 * src/print_graph.c (print_core): Complete the set of items via
3819 closure. The next-to-final and final states are still unsatisfying,
3820 but that's to be addressed elsewhere.
3821 No longer output the rule numbers, but do output the state number.
3822 A single loop for the shifts + gotos is enough, but picked a
3823 distinct color for each.
3824 (print_graph): Initialize and finalize closure.
3825
107f7dfb
AD
38262001-12-13 Akim Demaille <akim@epita.fr>
3827
3828 * src/reader.c (readgram): Remove dead code, an strip useless
3829 braces.
3830 (get_type): Remove, unused.
3831
9b53a24f
AD
38322001-12-12 Akim Demaille <akim@epita.fr>
3833
3834 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3835 on that of lib/error.c.
3836
dbfb6dcd
AD
38372001-12-12 Akim Demaille <akim@epita.fr>
3838
3839 Some hosts don't like `/' in includes.
3840
3841 * src/system.h: Include libgettext.h without qualifying the path.
3842 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3843 $(top_srcdir).
3844
c25fb648
MA
38452001-12-11 Marc Autret <autret_m@epita.fr>
3846
3847 * src/output.c (output_parser): Remove useless muscle.
3848
710ddc4f
MA
38492001-12-11 Marc Autret <autret_m@epita.fr>
3850
3851 * src/bison.simple: Remove #line just before %%epilogue. It
3852 is now handled in ...
3853 * src/reader.c (read_additionnal_code): Add the output of a
3854 #line for the epilogue.
3855
e83d80b8
MA
38562001-12-10 Marc Autret <autret_m@epita.fr>
3857
927c1557 3858 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
3859 replace precedent remove.
3860 * src/bison.simple: Remove #line before %%prologue because
3861 %%input-line is wrong at this time.
3862
971d5158
MA
38632001-12-10 Marc Autret <autret_m@epita.fr>
3864
3865 * src/reader.c (symbols_output): Clean up.
927c1557 3866 * src/output.c (output_gram, output): Clean up.
971d5158 3867
5edafffd
AD
38682001-12-10 Akim Demaille <akim@epita.fr>
3869
3870 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3871 * src/LR0.c (set_state_table): here.
3872 * src/lalr.c (lalr): Call it.
3873
0279f8e9
AD
38742001-12-10 Akim Demaille <akim@epita.fr>
3875
3876 * src/state.h (shifts): Remove the `number' member: shifts are
3877 attached to state, hence no longer need to be labelled with a
3878 state number.
3879
190c4f5f
AD
38802001-12-10 Akim Demaille <akim@epita.fr>
3881
3882 Now that states have a complete set of members, the linked list of
3883 shifts is useless: just fill directly the state's shifts member.
3884
3885 * src/state.h (shifts): Remove the `next' member.
3886 * src/LR0.c (first_state, last_state): Remove.
3887 Adjust the callers.
3888 (augment_automaton): Don't look for the shifts that must be added
3889 a shift on EOF: it is those of the state we looked for! But now,
3890 since shifts are attached, it is no longer needed to looking
3891 merely by its id: its number.
3892
2a73b93d
AD
38932001-12-10 Akim Demaille <akim@epita.fr>
3894
3895 * src/LR0.c (augment_automaton): Better variable locality.
3896 Remove an impossible branch: if there is a state corresponding to
3897 the start symbol being shifted, then there is shift for the start
3898 symbol from the initial state.
3899
74392f6a
AD
39002001-12-10 Akim Demaille <akim@epita.fr>
3901
3902 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3903 only when appropriate: when insert_start_shifting_state' is not
3904 invoked.
3905 * tests/regression.at (Rule Line Numbers): Adjust.
3906
37c82725
AD
39072001-12-10 Akim Demaille <akim@epita.fr>
3908
3909 * src/LR0.c (augment_automaton): Now that all states have shifts,
3910 merge the two cases addition shifts to the initial state.
3911
6a164e0c
AD
39122001-12-10 Akim Demaille <akim@epita.fr>
3913
3914 * src/lalr.c (set_state_table): Move to...
3915 * src/LR0.c: here.
3916 * src/lalr.c (lalr): Don't call it...
3917 * src/LR0.c (generate_states): do it.
3918 * src/LR0.h (first_state): Remove, only the table is used.
3919
7215de24
AD
39202001-12-10 Akim Demaille <akim@epita.fr>
3921
3922 * src/LR0.h (first_shift, first_reduction): Remove.
3923 * src/lalr.c: Don't use first_shift: find shifts through the
3924 states.
3925
80e25d4d
AD
39262001-12-10 Akim Demaille <akim@epita.fr>
3927
3928 * src/LR0.c: Attach shifts to states as soon as they are
3929 computed.
3930 * src/lalr.c (set_state_table): Instead of assigning shifts to
3931 state, just assert that the mapping was properly done.
3932
0ab3728b
AD
39332001-12-10 Akim Demaille <akim@epita.fr>
3934
3935 * src/LR0.c (insert_start_shift): Rename as...
3936 (insert_start_shifting_state): this.
3937 (insert_eof_shifting_state, insert_accepting_state): New.
3938 (augment_automaton): Adjust.
3939 Better locality of the variables.
3940 When looking if the start_symbol is shifted from the initial
3941 state, using `while (... symbol != start_symbol ...)' sounds
3942 better than `while (... symbol < start_symbol ...)': If fail
3943 to see how the order between symbols could be relevant!
3944
78af9bbc
AD
39452001-12-10 Akim Demaille <akim@epita.fr>
3946
3947 * src/getargs.h: Don't declare `spec_name_prefix' and
3948 `spec_file_prefix', declared by src/files.h.
3949 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3950 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3951 * src/output.c (prepare): Adjust.
3952 * src/reader.c (symbols_output): Likewise.
3953 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3954
bdef2a41
AD
39552001-12-10 Akim Demaille <akim@epita.fr>
3956
3957 * src/muscle_tab.c (muscle_init): NULL is a better default than
3958 `"0"'.
3959
3735969c
AD
39602001-12-10 Akim Demaille <akim@epita.fr>
3961
3962 * src/reader.c (reader): Calling symbols_output once is enough.
3963
49701457
AD
39642001-12-10 Akim Demaille <akim@epita.fr>
3965
3966 Now that states have a complete set of members, the linked list of
3967 reductions is useless: just fill directly the state's reductions
3968 member.
3969
3970 * src/state.h (struct reductions): Remove member `number' and
3971 `next'.
3972 * src/LR0.c (first_reduction, last_reduction): Remove.
3973 (save_reductions): Don't link the new reductions, store them in
3974 this_state.
3975 * src/lalr.c (set_state_table): No need to attach reductions to
3976 states, it's already done.
3977 * src/output.c (output_actions): No longer free the shifts, then
3978 the reductions, then the states: free all the states and their
3979 members.
3980
0edad749
AD
39812001-12-10 Akim Demaille <akim@epita.fr>
3982
3983 * src/options.c (OPTN, DRTV, BOTH): New.
3984 (option_table): Use them.
3985
0edad749
AD
3986 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3987 the job of system.h.
3988 * src/options.c: Don't include stdio.h and xalloc.h for the same
3989 reasons.
3990
5449dd0f
AD
39912001-12-10 Akim Demaille <akim@epita.fr>
3992
3993 * src/output.c (output, prepare): Make sure the values of the
3994 muscles `action' and `prologue' are 0-terminated.
3995
a870c567
AD
39962001-12-10 Akim Demaille <akim@epita.fr>
3997
3998 Clean up GCC warnings.
3999
4000 * src/reader.c (copy_action): `buf' is not used.
4001 (parse_skel_decl): Be static.
4002 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
4003 * src/options.h (create_long_option_table): Have a real prototype.
4004 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
4005 (hash_delete_at): Return const void *.
4006 Adjust casts to preserve the const.
4007
80df8768
AD
40082001-12-10 Akim Demaille <akim@epita.fr>
4009
4010 * configure.in: Require 2.52g.
4011 M4 is not needed, but AUTOM4TE is.
4012 * m4/m4.m4: Remove.
4013 * tests/Makefile.am: Adjust.
4014
f693ad14
AD
40152001-12-10 Akim Demaille <akim@epita.fr>
4016
4017 One structure for states is enough, even though theoretically
4018 there are LR(0) states and LALR(1) states.
4019
4020 * src/lalr.h (state_t): Remove.
4021 (state_table): Be state_t **, not state_t *.
4022 * src/state.h (core, CORE_ALLOC): Rename as...
4023 (state_t, STATE_ALLOC): this.
4024 Add the LALR(1) members: shifts, reductions, errs.
4025 * src/LR0.c (state_table): Rename as...
4026 (state_hash): this, to avoid name clashes with the global
4027 `state_table'.
4028 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
4029 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
4030
74ffbcb6
AD
40312001-12-10 Akim Demaille <akim@epita.fr>
4032
4033 Bison dumps core on bash.y.
4034 Reported by Pascal Bart.
4035
4036 * src/warshall.c (bitmatrix_print): New.
4037 (TC): Use it.
4038 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
4039 j must be the outer loop.
4040 * tests/regression.at (Broken Closure): New.
4041
07708e19
AD
40422001-12-05 Akim Demaille <akim@epita.fr>
4043
4044 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
4045 its argument.
4046