]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
[bison.git] / ChangeLog
CommitLineData
3650b4b8
AD
12002-07-25 Akim Demaille <akim@epita.fr>
2
3 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
4 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
5 * tests/regression.at (Web2c Actions): Adjust.
6
4b3d3a8e
AD
72002-07-25 Akim Demaille <akim@epita.fr>
8
9 Stop storing rules from 1 to nrules + 1.
10
11 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12 * src/nullable.c, src/output.c, src/print.c, src/reader.c
13 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14 Iterate from 0 to nrules.
15 Use rule_number_as_item_number and item_number_as_rule_number.
16 Adjust to `derive' now containing possibly 0.
17 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
18 Handle the `- 1' part in rule numbers from/to item numbers.
19 * src/conflicts.c (log_resolution): Fix the message which reversed
20 shift and reduce.
21 * src/output.c (action_row): Initialize default_rule to -1.
22 (token_actions): Adjust.
23 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
24 expected output.
25 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
26
4a2a22f4
AD
272002-07-25 Akim Demaille <akim@epita.fr>
28
29 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
30 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
31 (b4_c_knr_arg_decl): New.
32 * data/yacc.c: Use it to define yysymprint, yydestruct, and
33 yyreport_parse_error.
34
b8df3223
AD
352002-07-25 Akim Demaille <akim@epita.fr>
36
37 * data/yacc.c (yyreport_parse_error): New, extracted from...
38 (yyparse): here.
39 (yydestruct, yysymprint): Move above yyparse.
40 Be K&R compliant.
41
a762e609
AD
422002-07-25 Akim Demaille <akim@epita.fr>
43
44 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
45 replace...
46 (b4_sint_type, b4_uint_type): these.
47 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
48 * tests/regression.at (Web2c Actions): Adjust.
49
12b0043a
AD
502002-07-25 Akim Demaille <akim@epita.fr>
51
52 * src/gram.h (TIEM_NUMBER_MAX): New.
53 (item_number_of_rule_number, rule_number_of_item_number): Rename
54 as...
55 (rule_number_as_item_number, item_number_as_rule_number): these.
56 Adjust dependencies.
57 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
58 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
59 (symbol_number_to_vector_number): New.
60 (order): Of vector_number_t* type.
61 (base_t, BASE_MAX, BASE_MIN): New.
62 (froms, tos, width, pos, check): Of base_t type.
63 (action_number_t, ACTION_MIN, ACTION_MAX): New.
64 (actrow): Of action_number_t type.
65 (conflrow): Of unsigned int type.
66 (table_ninf, base_ninf): New.
67 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
68 (muscle_insert_int_table, muscle_insert_base_table)
69 (muscle_insert_rule_number_table): New.
70 (prepare_tokens): Output `toknum' as int_table.
71 (action_row): Returns a rule_number_t.
72 Use ACTION_MIN, not SHRT_MIN.
73 (token_actions): yydefact is rule_number_t*.
74 (table_ninf_remap): New.
75 (pack_table): Use it for `base' and `table'.
76 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
77 replaced with...
78 (YYPACT_NINF, YYTABLE_NINF): these.
79 (yypact, yytable): Compute their types instead of hard-coded
80 `short'.
81 * tests/regression.at (Web2c Actions): Adjust.
82
5dde258a
AD
832002-07-19 Akim Demaille <akim@epita.fr>
84
85 * src/scan-gram.l (id): Can start with an underscore.
86
a945ec39
AD
872002-07-16 Akim Demaille <akim@epita.fr>
88
89 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
90 Adjust all former `associativity' dependencies.
91 * src/symtab.c (symbol_new): Default associativity is `undef', not
92 `right'.
93 (symbol_check_alias_consistence): Adjust.
94
fae437e8
AD
952002-07-09 Akim Demaille <akim@epita.fr>
96
97 * doc/bison.texinfo: Properly set the ``header'' part.
98 Use @dircategory ``GNU programming tools'' as per Texinfo's
99 documentation.
100 Use @copying.
101
1a715ef2
AD
1022002-07-09 Akim Demaille <akim@epita.fr>
103
104 * lib/quotearg.h: Protect against multiple inclusions.
105 * src/location.h (location_t): Add a `file' member.
106 (LOCATION_RESET, LOCATION_PRINT): Adjust.
107 * src/complain.c (warn_at, complain_at, fatal_at): Drop
108 `error_one_per_line' support.
109
a5d50994
AD
1102002-07-09 Akim Demaille <akim@epita.fr>
111
112 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
113 * src/reader.c (lineno): Remove.
114 Adjust all dependencies.
115 (get_merge_function): Take a location and use complain_at.
116 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
117 * tests/regression.at (Invalid inputs, Mixing %token styles):
118 Adjust.
119
b275314e
AD
1202002-07-09 Akim Demaille <akim@epita.fr>
121
122 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
123 recovery rule, and forbid extensions when --yacc.
124 (gram_error): Use complain_at.
125 * src/reader.c (reader): Exit if there were parse errors.
126
865b9df1
AD
1272002-07-09 Akim Demaille <akim@epita.fr>
128
129 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
130 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
131 Reported by R Blake <blakers@mac.com>.
132
c76e14da
AD
1332002-07-09 Akim Demaille <akim@epita.fr>
134
135 * data/yacc.c: Output the copyright notive in the header.
136
7db2ed2d
AD
1372002-07-03 Akim Demaille <akim@epita.fr>
138
139 * src/output.c (froms, tos): Are state_number_t.
140 (save_column): sp, sp1, and sp2 are state_number_t.
141 (prepare): Rename `final' as `final_state_number', `nnts' as
142 `nterms_number', `nrules' as `rules_number', `nstates' as
143 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
144 unused.
145 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
146 * data/lalr1.cc (nsym_): Remove, unused.
147
e68e0410
AD
1482002-07-03 Akim Demaille <akim@epita.fr>
149
150 * src/lalr.h, src/lalr.c (goto_number_t): New.
151 * src/lalr.c (goto_list_t): New.
152 Propagate them.
153 * src/nullable.c (rule_list_t): New.
154 Propagate.
155 * src/types.h: Remove.
156
e1a4f3a4
AD
1572002-07-03 Akim Demaille <akim@epita.fr>
158
159 * src/closure.c (print_fderives): Use rule_rhs_print.
160 * src/derives.c (print_derives): Use rule_rhs_print.
161 (rule_list_t): New, replaces `shorts'.
162 (set_derives): Add comments.
163 * tests/sets.at (Nullable, Firsts): Adjust.
164
536545f3
AD
1652002-07-03 Akim Demaille <akim@epita.fr>
166
167 * src/output.c (prepare_actions): Free `tally' and `width'.
168 (prepare_actions): Allocate and free `order'.
169 * src/symtab.c (symbols_free): Free `symbols'.
170 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
171 * src/output.c (m4_invoke): Move to...
172 * src/scan-skel.l: here.
173 (<<EOF>>): Close yyout, and free its name.
174
8b752b00
AD
1752002-07-03 Akim Demaille <akim@epita.fr>
176
177 Fix some memory leaks, and fix a bug: state 0 was examined twice.
178
179 * src/LR0.c (new_state): Merge into...
180 (state_list_append): this.
181 (new_states): Merge into...
182 (generate_states): here.
183 (set_states): Don't ensure a proper `errs' state member here, do it...
184 * src/conflicts.c (conflicts_solve): here.
185 * src/state.h, src/state.c: Comment changes.
186 (state_t): Rename member `shifts' as `transitions'.
187 Adjust all dependencies.
188 (errs_new): For consistency, also take the values as argument.
189 (errs_dup): Remove.
190 (state_errs_set): New.
191 (state_reductions_set, state_transitions_set): Assert that no
192 previous value was assigned.
193 (state_free): New.
194 (states_free): Use it.
195 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
196 temporary storage: use `errs' and `nerrs' as elsewhere.
197 (set_conflicts): Allocate and free this `errs'.
198
613f5e1a
AD
1992002-07-02 Akim Demaille <akim@epita.fr>
200
201 * lib/libiberty.h: New.
202 * lib: Update the bitset implementation from upstream.
203 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
204 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
205 * src/main.c: Adjust bitset stats calls.
206
26e0cadc
PE
2072002-07-01 Paul Eggert <eggert@twinsun.com>
208
209 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
210 char, so that negative chars don't collide with $.
211
1154cced
AD
2122002-06-30 Akim Demaille <akim@epita.fr>
213
214 Have the GLR tests be `warning' checked, and fix the warnings.
215
216 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
217 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
218 (yyremoveDeletes): `yyi' and `yyj' are size_t.
219 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
220 (yyaddDeferredAction): static.
221 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
222 (yyreportParseError): yyprefix is const.
223 yytokenp is used only when verbose.
224 (yy__GNUC__): Replace with __GNUC__.
225 (yypdumpstack): yyi is size_t.
226 (yypreference): Un-yy local variables and arguments, to avoid
227 clashes with `yyr1'. Anyway, we are not in the user name space.
228 (yytname_size): be an int, as is compared with ints.
229 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
230 Use them.
231 * tests/cxx-gram.at: Use quotation to protect $1.
232 Use AT_COMPILE to enable warnings hunts.
233 Prototype yylex and yyerror.
234 `Use' argc.
235 Include `string.h', not `strings.h'.
236 Produce and prototype stmtMerge only when used.
237 yylex takes a location.
238
97650f4e
AD
2392002-06-30 Akim Demaille <akim@epita.fr>
240
241 We spend a lot of time in quotearg, in particular when --verbose.
242
243 * src/symtab.c (symbol_get): Store a quoted version of the key.
244 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
245 Adjust all callers.
246
d2576365
AD
2472002-06-30 Akim Demaille <akim@epita.fr>
248
249 * src/state.h (reductions_t): Rename member `nreds' as num.
250 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
251 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
252
ccaf65bc
AD
2532002-06-30 Akim Demaille <akim@epita.fr>
254
255 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
256 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
257 (shifts_to): Rename as...
258 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
259 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
260 (TRANSITION_IS_DISABLED, transitions_to): these.
261
87675353
AD
2622002-06-30 Akim Demaille <akim@epita.fr>
263
264 * src/print.c (print_shifts, print_gotos): Merge into...
265 (print_transitions): this.
266 (print_transitions, print_errs, print_reductions): Align the
267 lookaheads columns.
268 (print_core, print_transitions, print_errs, print_state,
269 print_grammar): Output empty lines separator before, not after.
270 (state_default_rule_compute): Rename as...
271 (state_default_rule): this.
272 * tests/conflicts.at (Defaulted Conflicted Reduction),
273 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
274 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
275
ce4ccb4b
AD
2762002-06-30 Akim Demaille <akim@epita.fr>
277
278 Display items as we display rules.
279
280 * src/gram.h, src/gram.c (rule_lhs_print): New.
281 * src/gram.c (grammar_rules_partial_print): Use it.
282 * src/print.c (print_core): Likewise.
283 * tests/conflicts.at (Defaulted Conflicted Reduction),
284 (Unresolved SR Conflicts): Adjust.
285 (Unresolved SR Conflicts): Adjust and rename as...
286 (Resolved SR Conflicts): this, as was meant.
287 * tests/regression.at (Web2c Report): Adjust.
288
bc933ef1
AD
2892002-06-30 Akim Demaille <akim@epita.fr>
290
291 * src/print.c (state_default_rule_compute): New, extracted from...
292 (print_reductions): here.
293 Pessimize, but clarify the code.
294 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
295
53d4308d
AD
2962002-06-30 Akim Demaille <akim@epita.fr>
297
298 * src/output.c (action_row): Let default_rule be always a rule
299 number.
300
574fb2d5
AD
3012002-06-30 Akim Demaille <akim@epita.fr>
302
303 * src/closure.c (print_firsts, print_fderives, closure):
304 Use BITSET_EXECUTE.
305 * src/lalr.c (lookaheads_print): Likewise.
306 * src/state.c (state_rule_lookaheads_print): Likewise.
307 * src/print_graph.c (print_core): Likewise.
308 * src/print.c (print_reductions): Likewise.
309 * src/output.c (action_row): Likewise.
310 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
311
05811fd7
AD
3122002-06-30 Akim Demaille <akim@epita.fr>
313
314 * src/print_graph.c: Use report_flag.
315
0e4d5753
AD
3162002-06-30 Akim Demaille <akim@epita.fr>
317
318 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
319 to...
320 * src/relation.h, src/relation.c (traverse, relation_digraph)
321 (relation_print, relation_transpose): New.
322
24c7d800
AD
3232002-06-30 Akim Demaille <akim@epita.fr>
324
325 * src/state.h, src/state.c (shifts_to): New.
326 * src/lalr.c (build_relations): Use it.
327
9222837b
AD
3282002-06-30 Akim Demaille <akim@epita.fr>
329
330 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
331 (item_number_of_rule_number, rule_number_of_item_number): New.
332 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
333 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
334 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
335 Propagate their use.
336 Much remains to be done, in particular wrt `shorts' from types.h.
337
260008e5
AD
3382002-06-30 Akim Demaille <akim@epita.fr>
339
340 * src/symtab.c (symbol_new): Initialize the `printer' member.
341
8a731ca8
AD
3422002-06-30 Akim Demaille <akim@epita.fr>
343
344 * src/LR0.c (save_reductions): Remove, replaced by...
345 * src/state.h, src/state.c (state_reductions_set): New.
346 (reductions, errs): Rename as...
347 (reductions_t, errs_t): these.
348 Adjust all dependencies.
349
32e1e0a4
AD
3502002-06-30 Akim Demaille <akim@epita.fr>
351
352 * src/LR0.c (state_list_t, state_list_append): New.
353 (first_state, last_state): Now symbol_list_t.
354 (this_state): Remove.
355 (new_itemsets, append_states, save_reductions): Take a state_t as
356 argument.
357 (set_states, generate_states): Adjust.
358 (save_shifts): Remove, replaced by...
359 * src/state.h, src/state.c (state_shifts_set): New.
360 (shifts): Rename as...
361 (shifts_t): this.
362 Adjust all dependencies.
363 * src/state.h (state_t): Remove the `next' member.
364
e5fb6710
AD
3652002-06-30 Akim Demaille <akim@epita.fr>
366
367 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
368 escaped in slot 0.
369
c7ca99d4
AD
3702002-06-30 Akim Demaille <akim@epita.fr>
371
372 Use hash.h for the state hash table.
373
374 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
375 (allocate_storage): Use state_hash_new.
376 (free_storage): Use state_hash_free.
377 (new_state, get_state): Adjust.
378 * src/lalr.h, src/lalr.c (states): Move to...
379 * src/states.h (state_t): Remove the `link' member, no longer
380 used.
381 * src/states.h, src/states.c: here.
382 (state_hash_new, state_hash_free, state_hash_lookup)
383 (state_hash_insert, states_free): New.
384 * src/states.c (state_table, state_compare, state_hash): New.
385 * src/output.c (output_actions): Do not free states now, since we
386 still need to know the final_state number in `prepare', called
387 afterwards. Do it...
388 * src/main.c (main): here: call states_free after `output'.
389
df0e7316
AD
3902002-06-30 Akim Demaille <akim@epita.fr>
391
392 * src/state.h, src/state.c (state_new): New, extracted from...
393 * src/LR0.c (new_state): here.
394 * src/state.h (STATE_ALLOC): Move to...
395 * src/state.c: here.
396 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
397 * src/state.h, src/state.c: here.
398
39f41916
AD
3992002-06-30 Akim Demaille <akim@epita.fr>
400
401 * src/reader.c (gensym): Rename as...
402 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
403 (getsym): Rename as...
404 (symbol_get): this.
405
d57650a5
AD
4062002-06-30 Akim Demaille <akim@epita.fr>
407
408 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
409 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
410 * src/output.c, src/print.c, src/print_graph.c: Propagate.
411 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
412
5a08f1ce
AD
4132002-06-30 Akim Demaille <akim@epita.fr>
414
415 Make the test suite pass with warnings checked.
416
417 * tests/actions.at (Printers and Destructors): Improve.
418 Avoid unsigned vs. signed issues.
419 * tests/calc.at: Don't exercise the scanner here, do it...
420 * tests/input.at (Torturing the Scanner): here.
421
720623af
PH
4222002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
423
88e7e941 424 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
425 reorganize first lines parallel to yacc.c.
426
fb8135fa
AD
4272002-06-28 Akim Demaille <akim@epita.fr>
428
429 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
430 (b4_token_enum, b4_token_defines): New, factored from...
431 * data/lalr1.cc, data/yacc.c, glr.c: here.
432
41442480
AD
4332002-06-28 Akim Demaille <akim@epita.fr>
434
435 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
436 unused variables.
437 * src/output.c (merger_output): static.
438
e0e5bf84
AD
4392002-06-28 Akim Demaille <akim@epita.fr>
440
441 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
442 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
443 pacify GCC.
444 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 445
676385e2
PH
4462002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
447
448 Accumulated changelog for new GLR parsing features.
449
e0e5bf84 450 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
451 conflicts_total_count.
452 * src/conflicts.h: Ditto.
453 * src/output.c (token_actions): Use the new name.
454 (output_conflicts): Change conflp => conflict_list_heads, and
455 confl => conflict_list for better readability.
456 * data/glr.c: Use the new names.
457 * NEWS: Add self to GLR announcement.
e0e5bf84 458
676385e2
PH
459 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
460
461 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
462 Akim Demaille.
463
464 * data/bison.glr: Change name to glr.c
465 * data/glr.c: Renamed from bison.glr.
466 * data/Makefile.am: Add glr.c
e0e5bf84
AD
467
468 * src/getargs.c:
469
676385e2
PH
470 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
471 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 472
676385e2
PH
473 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
474
475 * data/bison.glr: Be sure to restore the
476 current #line when returning to the skeleton contents after having
477 exposed the input file's #line.
478
479 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
480
481 * data/bison.glr: Bring up to date with changes to bison.simple.
482
483 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
484
485 * data/bison.glr: Correct definitions that use b4_prefix.
486 Various reformatting.
487 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
488 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
489 yytokenp argument; now part of stack.
490 (yychar): Define to behave as documented.
491 (yyclearin): Ditto.
e0e5bf84 492
676385e2
PH
493 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
494
495 * src/reader.h: Add declaration for free_merger_functions.
496
497 * src/reader.c (merge_functions): New variable.
498 (get_merge_function): New function.
499 (free_merger_functions): New function.
500 (readgram): Check for %prec that is not followed by a symbol.
501 Handle %dprec and %merge declarations.
502 (packgram): Initialize dprec and merger fields in rules array.
503
504 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
505 conflict_list_cnt, conflict_list_free): New variables.
506 (table_grow): Also grow conflict_table.
e0e5bf84 507 (prepare_rules): Output dprec and merger tables.
676385e2 508 (conflict_row): New function.
e0e5bf84 509 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
510 default reduction in conflicted states for GLR parser so that there
511 are spaces for the conflict lists.
512 (save_row): Also save conflict information.
513 (token_actions): Allocate conflict list.
514 (merger_output): New function.
515 (pack_vector): Pack conflict table, too.
516 (output_conflicts): New function to output yyconflp and yyconfl.
517 (output_check): Allocate conflict_tos.
518 (output_actions): Output conflict tables, also.
519 (output_skeleton): Output b4_mergers definition.
520 (prepare): Output b4_max_rhs_length definition.
521 Use 'bison.glr' as default skeleton for GLR parsers.
522
523 * src/gram.c (glr_parser): New flag.
524 (grammar_free): Call free_merger_functions.
525
526 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
527 all pairs of conflicting reductions, rather than just all tokens
528 causing conflicts. Needed to size conflict tables.
e0e5bf84 529 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
530 interface.
531 (conflicts_print): Ditto.
532 (count_total_conflicts): New function.
533
534 * src/reader.h (merger_list): New type.
535 (merge_functions): New variable.
536
537 * src/lex.h (tok_dprec, tok_merge): New token types.
538
539 * src/gram.h (rule_s): Add dprec and merger fields.
540 (glr_parser): New flag.
541
542 * src/conflicts.h (count_total_conflicts): New function.
543
544 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
545
546 * doc/bison.texinfo (Generalized LR Parsing): New section.
547 (GLR Parsers): New section.
548 (Language and Grammar): Mention GLR parsing.
549 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
550 Correct typo ("tge" -> "the").
551
552 * data/bison.glr: New skeleton for GLR parsing.
553
554 * tests/cxx-gram.at: New tests for GLR parsing.
555
556 * tests/testsuite.at: Include cxx-gram.at.
557
558 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 559
676385e2
PH
560 * src/parse-gram.y:
561
562 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
563
564 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 565
b5480d74 5662002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
567
568 * src/options.h, src/options.c: Remove.
569 * src/getargs.c (short_options, long_options): New.
570
60491a94
AD
5712002-06-27 Akim Demaille <akim@epita.fr>
572
573 * data/bison.simple, data/bison.c++: Rename as...
574 * data/yacc.c, data/lalr1.cc: these.
575 * doc/bison.texinfo (Environment Variables): Remove.
576
9be0c25b
AD
5772002-06-25 Raja R Harinath <harinath@cs.umn.edu>
578
579 * src/getargs.c (report_argmatch): Initialize strtok().
580
1ae72863
AD
5812002-06-20 Akim Demaille <akim@epita.fr>
582
583 * data/bison.simple (b4_symbol_actions): New, replaces...
584 (b4_symbol_destructor, b4_symbol_printer): these.
585 (yysymprint): Be sure to call YYPRINT only for tokens, and using
586 user token numbers.
587
87542d29
AD
5882002-06-20 Akim Demaille <akim@epita.fr>
589
590 * data/bison.simple (yydestructor): Rename as...
591 (yydestruct): this.
592
1a31ed21
AD
5932002-06-20 Akim Demaille <akim@epita.fr>
594
595 * src/symtab.h, src/symtab.c (symbol_type_set)
596 (symbol_destructor_set, symbol_precedence_set): The location is
597 the last argument.
598 Adjust all callers.
599
e776192e
AD
6002002-06-20 Akim Demaille <akim@epita.fr>
601
602 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
603 internals.
604 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
605 Takes a location.
606 * src/symtab.h, src/symtab.c (symbol_class_set)
607 (symbol_user_token_number_set): Likewise.
608 Adjust all callers.
609 Promote complain_at.
610 * tests/input.at (Type Clashes): Adjust.
611
5c1180b3
AD
6122002-06-20 Akim Demaille <akim@epita.fr>
613
614 * data/bison.simple (YYLEX): Fix the declaration when
615 %pure-parser.
616
e3170060
AD
6172002-06-20 Akim Demaille <akim@epita.fr>
618
619 * data/bison.simple (yysymprint): Don't print the token number,
620 just its name.
621 * tests/actions.at (Destructors): Rename as...
622 (Printers and Destructors): this.
623 Also exercise %printer.
624
253862fd
AD
6252002-06-20 Akim Demaille <akim@epita.fr>
626
627 * data/bison.simple (YYDSYMPRINT): New.
628 Use it to remove many of the #if YYDEBUG/if (yydebug).
629
366eea36
AD
6302002-06-20 Akim Demaille <akim@epita.fr>
631
632 * src/symtab.h, src/symtab.c (symbol_t): printer and
633 printer_location are new members.
634 (symbol_printer_set): New.
635 * src/parse-gram.y (PERCENT_PRINTER): New token.
636 Handle its associated rule.
637 * src/scan-gram.l: Adjust.
638 (handle_destructor_at, handle_destructor_dollar): Rename as...
639 (handle_symbol_code_at, handle_symbol_code_dollar): these.
640 * src/output.c (symbol_printers_output): New.
641 (output_skeleton): Call it.
642 * data/bison.simple (yysymprint): New. Cannot be named yyprint
643 since there are already many grammar files with a user `yyprint'.
644 Replace the calls to YYPRINT to calls to yysymprint.
645 * tests/calc.at: Adjust.
646 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
647 taking advantage of parser very internal details (stack size!).
648
4f25ebb0
AD
6492002-06-20 Akim Demaille <akim@epita.fr>
650
651 * src/scan-gram.l: Complete the scanner with the missing patterns
652 to pacify Flex.
653 Use `quote' and `symbol_tag_get' where appropriate.
654
93b68a0e
AD
6552002-06-19 Akim Demaille <akim@epita.fr>
656
657 * tests/actions.at (Destructors): Augment to test locations.
658 * data/bison.simple (yydestructor): Pass it the current location
659 if locations are enabled.
660 Prototype only when __STDC__ or C++.
661 Change the argument names to move into the yy name space: there is
662 user code here.
663
58612f1d
AD
6642002-06-19 Akim Demaille <akim@epita.fr>
665
74310291
AD
666 * data/bison.simple (b4_pure_if): New.
667 Use it instead of #ifdef YYPURE.
668
6692002-06-19 Akim Demaille <akim@epita.fr>
670
671 * data/bison.simple (b4_location_if): New.
58612f1d
AD
672 Use it instead of #ifdef YYLSP_NEEDED.
673
f25bfb75
AD
6742002-06-19 Akim Demaille <akim@epita.fr>
675
676 Prepare @$ in %destructor, but currently don't bind it in the
677 skeleton, as %location use is not cleaned up yet.
678
679 * src/scan-gram.l (handle_dollar, handle_destructor_at)
680 (handle_action_at): New.
681 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
682 a braced_code_t and a location as additional arguments.
683 (handle_destructor_dollar): Instead of requiring `b4_eval', just
684 unquote one when outputting `b4_dollar_dollar'.
685 Adjust callers.
686 * data/bison.simple (b4_eval): Remove.
687 (b4_symbol_destructor): Adjust.
688 * tests/input.at (Invalid @n): Adjust.
689
c732d2c6
AD
6902002-06-19 Zack Weinberg <zack@codesourcery.com>
691
692 * doc/bison.texinfo: Document ability to have multiple
693 prologue sections.
694
8c165d89
AD
6952002-06-18 Akim Demaille <akim@epita.fr>
696
697 * src/files.c (compute_base_names): When computing the output file
698 names from the input file name, strip the directory part.
699
ca98bf57
AD
7002002-06-18 Akim Demaille <akim@epita.fr>
701
702 * data/bison.simple.new: Comment changes.
703 Reported by Andreas Schwab.
704
0bfb02ff
AD
7052002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
706
707 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
708 there are no `label `yyoverflowlab' defined but not used' warnings
709 when yyoverflow is defined.
710
24c0aad7
AD
7112002-06-18 Akim Demaille <akim@epita.fr>
712
713 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
714 new member.
715 (symbol_destructor_set): Adjust.
716 * src/output.c (symbol_destructors_output): Output the destructor
717 locations.
718 Output the symbol name.
719 * data/bison.simple (b4_symbol_destructor): Adjust.
720
5719c109
AD
7212002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
722 and Akim Demaille <akim@epita.fr>
723
724 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
725 what's left on the stack when the error recovery hits EOF.
726 * tests/actions.at (Destructors): Complete to exercise this case.
727
9280d3ef
AD
7282002-06-17 Akim Demaille <akim@epita.fr>
729
730 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
731 arguments is really empty, not only equal to `[]'.
732 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
733 member.
734 (symbol_destructor_set): New.
735 * src/output.c (symbol_destructors_output): New.
736 * src/reader.h (brace_code_t, current_braced_code): New.
737 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
738 (handle_dollar): Rename as...
739 (handle_action_dollar): this.
740 (handle_destructor_dollar): New.
741 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
742 (grammar_declaration): Use it.
743 * data/bison.simple (yystos): Is always defined.
744 (yydestructor): New.
745 * tests/actions.at (Destructors): New.
746 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
747
dafdc66f
AD
7482002-06-17 Akim Demaille <akim@epita.fr>
749
750 * src/symlist.h, src/symlist.c (symbol_list_length): New.
751 * src/scan-gram.l (handle_dollar, handle_at): Compute the
752 rule_length only when needed.
753 * src/output.c (actions_output, token_definitions_output): Output
754 the full M4 block.
755 * src/symtab.c: Don't access directly to the symbol tag, use
756 symbol_tag_get.
757 * src/parse-gram.y: Use symbol_list_free.
758
56c47203
AD
7592002-06-17 Akim Demaille <akim@epita.fr>
760
761 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
762 (symbol_list_prepend, get_type_name): Move to...
763 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
764 (symbol_list_prepend, symbol_list_n_type_name_get): here.
765 Adjust all callers.
766 (symbol_list_free): New.
767 * src/scan-gram.l (handle_dollar): Takes a location.
768 * tests/input.at (Invalid $n): Adjust.
769
1e0bab92
AD
7702002-06-17 Akim Demaille <akim@epita.fr>
771
772 * src/reader.h, src/reader.c (symbol_list_new): Export it.
773 (symbol_list_prepend): New.
774 * src/parse-gram.y (%union): `list' is a new member.
775 (symbols.1): New, replaces...
776 (terms_to_prec.1, nterms_to_type.1): these.
777 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
778 Take a location as additional argument.
779 Adjust all callers.
780
04e60654
AD
7812002-06-15 Akim Demaille <akim@epita.fr>
782
783 * src/parse-gram.y: Move %token in the declaration section so that
784 we don't depend upon CVS Bison.
785
10e5b8bd
AD
7862002-06-15 Akim Demaille <akim@epita.fr>
787
788 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
789 * src/print.c (print_core): Use it.
790
9801d40c
AD
7912002-06-15 Akim Demaille <akim@epita.fr>
792
793 * src/conflicts.c (log_resolution): Accept the rule involved in
794 the sr conflicts instead of the lookahead number that points to
795 that rule.
796 (flush_reduce): Accept the current lookahead vector as argument,
797 instead of the index in LA.
798 (resolve_sr_conflict): Accept the current number of lookahead
799 bitset to consider for the STATE, instead of the index in LA.
800 (set_conflicts): Adjust.
801 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
802
c0263492
AD
8032002-06-15 Akim Demaille <akim@epita.fr>
804
805 * src/state.h (state_t): Replace the `lookaheadsp' member, a
806 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
807 Adjust all dependencies.
808 * src/lalr.c (initialize_lookaheads): Split into...
809 (states_lookaheads_count, states_lookaheads_initialize): these.
810 (lalr): Adjust.
811
9757c359
AD
8122002-06-15 Akim Demaille <akim@epita.fr>
813
814 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
815 out of...
816 (grammar_rules_print): here.
817 * src/reduce.c (reduce_output): Use it.
818 * tests/reduce.at (Useless Rules, Reduced Automaton)
819 (Underivable Rules): Adjust.
820
6b98e4b5
AD
8212002-06-15 Akim Demaille <akim@epita.fr>
822
823 Copy BYacc's nice way to report the grammar.
824
825 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
826 New.
827 Don't print the rules' location, it is confusing and useless.
828 (rule_print): Use grammar_rhs_print.
829 * src/print.c (print_grammar): Use grammar_rules_print.
830
6b98e4b5
AD
8312002-06-15 Akim Demaille <akim@epita.fr>
832
833 Complete and rationalize `useless thing' warnings.
834
835 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
836 (symbol_tag_print): New.
837 Use them everywhere in place of accessing directly the tag member.
838 * src/gram.h, src/gram.c (rule_print): New.
839 Use it where a rule used to be printed `by hand'.
840 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
841 (reduce_grammar_tables): Report the useless rules.
842 (reduce_print): Useless things are a warning, not an error.
843 Report it as such.
844 * tests/reduce.at (Useless Nonterminals, Useless Rules):
845 (Reduced Automaton, Underivable Rules): Adjust.
846 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
847 * tests/conflicts.at (Unresolved SR Conflicts)
848 (Solved SR Conflicts): Adjust.
849
ee000ba4
AD
8502002-06-15 Akim Demaille <akim@epita.fr>
851
852 Let symbols have a location.
853
854 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
855 (getsym): Adjust.
856 Adjust all callers.
857 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
858 Use location_t, not int.
859 * src/symtab.c (symbol_check_defined): Take advantage of the
860 location.
861 * tests/regression.at (Invalid inputs): Adjust.
862
8efe435c
AD
8632002-06-15 Akim Demaille <akim@epita.fr>
864
865 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
866 (input): Don't try to initialize yylloc here, do it in the
867 scanner.
868 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
869 * src/gram.h (rule_t): Change line and action_line into location
870 and action_location, of location_t type.
871 Adjust all dependencies.
872 * src/location.h, src/location.c (empty_location): New.
873 * src/reader.h, src/reader.c (grammar_start_symbol_set)
874 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
875 (grammar_current_rule_symbol_append)
876 (grammar_current_rule_action_append): Expect a location as argument.
877 * src/reader.c (grammar_midrule_action): Adjust to attach an
878 action's location as dummy symbol location.
879 * src/symtab.h, src/symtab.c (startsymbol_location): New.
880 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
881 the line numbers.
882
1921f1d7
AD
8832002-06-14 Akim Demaille <akim@epita.fr>
884
885 Grammar declarations may be found in the grammar section.
886
887 * src/parse-gram.y (rules_or_grammar_declaration): New.
888 (declarations): Each declaration may end with a semicolon, not
889 just...
890 (grammar_declaration): `"%union"'.
891 (grammar): Branch to rules_or_grammar_declaration.
892
4515534c
AD
8932002-06-14 Akim Demaille <akim@epita.fr>
894
895 * src/main.c (main): Invoke scanner_free.
896
f958596b
AD
8972002-06-14 Akim Demaille <akim@epita.fr>
898
899 * src/output.c (m4_invoke): Extracted from...
900 (output_skeleton): here.
901 Free tempfile.
902
2c569025
AD
9032002-06-14 Akim Demaille <akim@epita.fr>
904
905 * src/parse-gram.y (directives, directive, gram)
906 (grammar_directives, precedence_directives, precedence_directive):
907 Rename as...
908 (declarations, declaration, grammar, grammar_declaration)
909 (precedence_declaration, precedence_declarator): these.
910 (symbol_declaration): New.
911
592e8d4d
AD
9122002-06-14 Akim Demaille <akim@epita.fr>
913
914 * src/files.c (action_obstack): Remove, unused.
915 (output_obstack): Remove it, and all its dependencies, as it is no
916 longer needed.
917 * src/reader.c (epilogue_set): Build the epilogue in the
918 muscle_obstack.
919 * src/output.h, src/output.c (muscle_obstack): Move to...
920 * src/muscle_tab.h, src/muscle_tab.h: here.
921 (muscle_init): Initialize muscle_obstack.
922 (muscle_free): New.
923 * src/main.c (main): Call it.
924
0c15323d
AD
9252002-06-14 Akim Demaille <akim@epita.fr>
926
927 * src/location.h: New, extracted from...
928 * src/reader.h: here.
929 * src/Makefile.am (noinst_HEADERS): Merge into
930 (bison_SOURCES): this.
931 Add location.h.
932 * src/parse-gram.y: Use location_t instead of Bison's.
933 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
934 Use location_t instead of ints.
935
e96c9728
AD
9362002-06-14 Akim Demaille <akim@epita.fr>
937
938 * data/bison.simple, data/bison.c++: Be sure to restore the
939 current #line when returning to the skeleton contents after having
940 exposed the input file's #line.
941
75d1fe16
AD
9422002-06-12 Akim Demaille <akim@epita.fr>
943
944 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
945 eager.
946 * tests/actions.at (Exotic Dollars): New.
947
6c35d22c
AD
9482002-06-12 Akim Demaille <akim@epita.fr>
949
950 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
951 ['"/] too eagerly.
952 * tests/input.at (Torturing the Scanner): New.
953
1d6412ad
AD
9542002-06-11 Akim Demaille <akim@epita.fr>
955
956 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
957 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
958 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
959 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
960 * src/reader.c (reader): Use it.
961
4cdb01db
AD
9622002-06-11 Akim Demaille <akim@epita.fr>
963
964 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
965 Adjust all callers.
966 (scanner_last_string_free): New.
967
44995b2e
AD
9682002-06-11 Akim Demaille <akim@epita.fr>
969
970 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
971 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
972 (last_string, YY_OBS_FREE): New.
973 Use them when returning an ID.
974
e9955c83
AD
9752002-06-11 Akim Demaille <akim@epita.fr>
976
977 Have Bison grammars parsed by a Bison grammar.
978
979 * src/reader.c, src/reader.h (prologue_augment): New.
980 * src/reader.c (copy_definition): Remove.
981
982 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
983 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
984 (grammar_current_rule_prec_set, grammar_current_rule_check)
985 (grammar_current_rule_symbol_append)
986 (grammar_current_rule_action_append): Export.
987 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
988 (symbol_list_action_append): Remove.
989 Hook the routines from reader.
990 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
991 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
992
993 * src/reader.c (read_declarations): Remove, unused.
994
995 * src/parse-gram.y: Handle the epilogue.
996 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
997 (grammar_start_symbol_set): this.
998 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
999 * src/reader.c (readgram): Remove, unused.
1000 (reader): Adjust to insert eoftoken and axiom where appropriate.
1001
1002 * src/reader.c (copy_dollar): Replace with...
1003 * src/scan-gram.h (handle_dollar): this.
1004 * src/parse-gram.y: Remove `%thong'.
1005
1006 * src/reader.c (copy_at): Replace with...
1007 * src/scan-gram.h (handle_at): this.
1008
1009 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
1010 New.
1011
1012 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
1013 time being.
1014
1015 * src/reader.h, src/reader.c (grammar_rule_end): New.
1016
1017 * src/parse.y (current_type, current_class): New.
1018 Implement `%nterm', `%token' support.
1019 Merge `%term' into `%token'.
1020 (string_as_id): New.
1021 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
1022 type name.
1023
1024 * src/parse-gram.y: Be sure to handle properly the beginning of
1025 rules.
1026
1027 * src/parse-gram.y: Handle %type.
1028 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
1029
1030 * src/parse-gram.y: More directives support.
1031 * src/options.c: No longer handle source directives.
1032
1033 * src/parse-gram.y: Fix %output.
1034
1035 * src/parse-gram.y: Handle %union.
1036 Use the prologue locations.
1037 * src/reader.c (parse_union_decl): Remove.
1038
1039 * src/reader.h, src/reader.c (epilogue_set): New.
1040 * src/parse-gram.y: Use it.
1041
1042 * data/bison.simple, data/bison.c++: b4_stype is now either not
1043 defined, then default to int, or to the contents of %union,
1044 without `union' itself.
1045 Adjust.
1046 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
1047
1048 * src/output.c (actions_output): Don't output braces, as they are
1049 already handled by the scanner.
1050
1051 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
1052 characters to themselves.
1053
1054 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
1055 that the epilogue has a proper #line.
1056
1057 * src/parse-gram.y: Handle precedence/associativity.
1058
1059 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
1060 a terminal.
1061 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
1062 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
1063 at all to define terminals that cannot be emitted.
1064
1065 * src/scan-gram.l: Escape M4 characters.
1066
1067 * src/scan-gram.l: Working properly with escapes in user
1068 strings/characters.
1069
1070 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
1071 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
1072 grammar.
1073 Use more modest sizes, as for the time being the parser does not
1074 release memory, and therefore the process swallows a huge amount
1075 of memory.
1076
1077 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
1078 stricter %token grammar.
1079
1080 * src/symtab.h (associativity): Add `undef_assoc'.
1081 (symbol_precedence_set): Do nothing when passed an undef_assoc.
1082 * src/symtab.c (symbol_check_alias_consistence): Adjust.
1083
1084 * tests/regression.at (Invalid %directive): Remove, as it is now
1085 meaningless.
1086 (Invalid inputs): Adjust to the new error messages.
1087 (Token definitions): The new grammar doesn't allow too many
1088 eccentricities.
1089
1090 * src/lex.h, src/lex.c: Remove.
1091 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
1092 (copy_character, copy_string2, copy_string, copy_identifier)
1093 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
1094 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
1095 (parse_action): Remove.
1096 * po/POTFILES.in: Adjust.
1097
2e047461
AD
10982002-06-11 Akim Demaille <akim@epita.fr>
1099
1100 * src/reader.c (parse_action): Don't store directly into the
1101 rule's action member: return the action as a string.
1102 Don't require `rule_length' as an argument: compute it.
1103 (grammar_current_rule_symbol_append)
1104 (grammar_current_rule_action_append): New, eved out from
1105 (readgram): here.
1106 Remove `action_flag', `rulelength', unused now.
1107
9af3fbce
AD
11082002-06-11 Akim Demaille <akim@epita.fr>
1109
1110 * src/reader.c (grammar_current_rule_prec_set).
1111 (grammar_current_rule_check): New, eved out from...
1112 (readgram): here.
1113 Remove `xaction', `first_rhs': useless.
1114 * tests/input.at (Type clashes): New.
1115 * tests/existing.at (GNU Cim Grammar): Adjust.
1116
1485e106
AD
11172002-06-11 Akim Demaille <akim@epita.fr>
1118
1119 * src/reader.c (grammar_midrule_action): New, Eved out from
1120 (readgram): here.
1121
da4160c3
AD
11222002-06-11 Akim Demaille <akim@epita.fr>
1123
1124 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
1125 New.
1126 (readgram): Use them as replacement of inlined code, crule and
1127 crule1.
1128
f6d0f937
AD
11292002-06-11 Akim Demaille <akim@epita.fr>
1130
1131 * src/reader.c (grammar_end, grammar_symbol_append): New.
1132 (readgram): Use them.
1133 Make the use of `p' as local as possible.
1134
69078d4b
AD
11352002-06-10 Akim Demaille <akim@epita.fr>
1136
1137 GCJ's parser requires the tokens to be defined before the prologue.
1138
1139 * data/bison.simple: Output the token definition before the user's
1140 prologue.
1141 * tests/regression.at (Braces parsing, Duplicate string)
1142 (Mixing %token styles): Check the output from bison.
1143 (Early token definitions): New.
1144
5e424082
AD
11452002-06-10 Akim Demaille <akim@epita.fr>
1146
1147 * src/symtab.c (symbol_user_token_number_set): Don't complain when
1148 assigning twice the same user number to a token, so that we can
1149 use it in...
1150 * src/lex.c (lex): here.
1151 Also use `symbol_class_set' instead of hand written code.
1152 * src/reader.c (parse_assoc_decl): Likewise.
1153
44536b35
AD
11542002-06-10 Akim Demaille <akim@epita.fr>
1155
1156 * src/symtab.c, src/symtab.c (symbol_class_set)
1157 (symbol_user_token_number_set): New.
1158 * src/reader.c (parse_token_decl): Use them.
1159 Use a switch instead of ifs.
1160 Use a single argument.
1161
8b9f2372
AD
11622002-06-10 Akim Demaille <akim@epita.fr>
1163
1164 Remove `%thong' support as it is undocumented, unused, duplicates
1165 `%token's job, and creates useless e-mail traffic with people who
1166 want to know what it is, why it is undocumented, unused, and
1167 duplicates `%token's job.
1168
1169 * src/reader.c (parse_thong_decl): Remove.
1170 * src/options.c (option_table): Remove "thong".
1171 * src/lex.h (tok_thong): Remove.
1172
3ae2b51f
AD
11732002-06-10 Akim Demaille <akim@epita.fr>
1174
1175 * src/symtab.c, src/symtab.c (symbol_type_set)
1176 (symbol_precedence_set): New.
1177 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
1178 (value_components_used): Remove, unused.
1179
2f1afb73
AD
11802002-06-09 Akim Demaille <akim@epita.fr>
1181
1182 Move symbols handling code out of the reader.
1183
1184 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
1185 (axiom): Move to...
1186 * src/symtab.h, src/symtab.c: here.
1187
1188 * src/gram.c (start_symbol): Remove: use startsymbol->number.
1189 * src/reader.c (startval): Rename as...
1190 * src/symtab.h, src/symtab.c (startsymbol): this.
1191 * src/reader.c: Adjust.
1192
1193 * src/reader.c (symbol_check_defined, symbol_make_alias)
1194 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1195 (token_translations_init)
1196 Move to...
1197 * src/symtab.c: here.
1198 * src/reader.c (packsymbols): Move to...
1199 * src/symtab.h, src/symtab.c (symbols_pack): here.
1200 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
1201 argument.
1202
e9bca3ad
AD
12032002-06-03 Akim Demaille <akim@epita.fr>
1204
1205 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
1206 then statements.
1207
86eff183
AD
12082002-06-03 Akim Demaille <akim@epita.fr>
1209
1210 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1211 structs with non literals.
1212 * src/scan-skel.l: never-interactive.
1213 * src/conflicts.c (enum conflict_resolution_e): No trailing
1214 comma.
1215 * src/getargs.c (usage): Split long literal strings.
1216 Reported by Hans Aberg.
1217
717be197
AD
12182002-05-28 Akim Demaille <akim@epita.fr>
1219
1220 * data/bison.c++: Use C++ ostreams.
1221 (cdebug_): New member.
1222
670ddffd
AD
12232002-05-28 Akim Demaille <akim@epita.fr>
1224
1225 * src/output.c (output_skeleton): Be sure to allocate enough room
1226 for `/' _and_ for `\0' in full_skeleton.
1227
769b430f
AD
12282002-05-28 Akim Demaille <akim@epita.fr>
1229
1230 * data/bison.c++: Catch up with bison.simple:
1231 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1232 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1233 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1234 and popping traces.
1235
7067cb36
PH
12362002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1237
1238 * src/output.c (output_skeleton): Put an explicit path in front of
1239 the skeleton file name, rather than relying on the -I directory,
1240 to partially alleviate effects of having a skeleton file lying around
1241 in the current directory.
769b430f 1242
4a713ec2
PH
12432002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1244
769b430f 1245 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
1246 obstack_printf should be obstack_fgrow1.
1247
b408954b
AD
12482002-05-26 Akim Demaille <akim@epita.fr>
1249
1250 * src/state.h (state_t): `solved_conflicts' is a new member.
1251 * src/LR0.c (new_state): Set it to 0.
1252 * src/conflicts.h, src/conflicts.c (print_conflicts)
1253 (free_conflicts, solve_conflicts): Rename as...
1254 (conflicts_print, conflicts_free, conflicts_solve): these.
1255 Adjust callers.
1256 * src/conflicts.c (enum conflict_resolution_e)
1257 (solved_conflicts_obstack): New, used by...
1258 (log_resolution): this.
1259 Adjust to attach the conflict resolution to each state.
1260 Complete the description with the precedence/associativity
1261 information.
1262 (resolve_sr_conflict): Adjust.
1263 * src/print.c (print_state): Output its solved_conflicts.
1264 * tests/conflicts.at (Unresolved SR Conflicts)
1265 (Solved SR Conflicts): Exercise --report=all.
1266
a49aecd5
AD
12672002-05-26 Akim Demaille <akim@epita.fr>
1268
1269 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1270 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1271 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1272 (token_number_t, item_number_as_token_number)
1273 (token_number_as_item_number, muscle_insert_token_number_table):
1274 Rename as...
1275 (symbol_number_t, item_number_as_symbol_number)
1276 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1277 these, since it is more appropriate.
1278
5504898e
AD
12792002-05-26 Akim Demaille <akim@epita.fr>
1280
1281 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1282 `Error:' lines.
1283 * data/bison.simple (yystos) [YYDEBUG]: New.
1284 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1285 error recovery.
1286 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1287
ec3bc396
AD
12882002-05-25 Akim Demaille <akim@epita.fr>
1289
1290 * doc/bison.texinfo (Debugging): Split into...
1291 (Tracing): this new section, its former contents, and...
1292 (Understanding): this new section.
1293 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1294 by...
1295 (report_flag): this.
1296 Adjust all dependencies.
1297 (report_args, report_types, report_argmatch): New.
1298 (usage, getargs): Report/support -r, --report.
1299 * src/options.h
1300 (struct option_table_struct): Rename as..,
1301 (struct option_table_s): this.
1302 Rename the `set_flag' member to `flag' to match with getopt_long's
1303 struct.
1304 * src/options.c (option_table): Split verbose into an entry for
1305 %verbose, and another for --verbose.
1306 Support --report/-r, so remove -r from the obsolete --raw.
1307 * src/print.c: Attach full item sets and lookaheads reports to
1308 report_flag instead of trace_flag.
1309 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1310
78df8250
PE
13112002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1312 and Paul Eggert <eggert@twinsun.com>
769b430f 1313
78df8250
PE
1314 * data/bison.simple (yyparse): Correct error handling to conform to
1315 POSIX and yacc. Specifically, after syntax error is discovered,
1316 do not reduce further before shifting the error token.
1317 Clean up the code a bit by removing the labels yyerrdefault,
1318 yyerrhandle, yyerrpop.
1319 * NEWS: Document the above.
1320
c0c9ea05
PH
13212002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1322
1323 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1324 type; it isn't always big enough, since it doesn't necessarily
1325 include non-terminals.
769b430f 1326 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
1327 the latter can be removed.
1328 (yy_token_number_type): Remove, only one use.
1329 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1330 don't use TokenNumberType as element type.
769b430f 1331
c0c9ea05
PH
1332 * tests/regression.at: Modify expected output to agree with change
1333 to yyr1 and yytranslate.
769b430f 1334
6390a83f
FK
13352002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1336
1337 * src/reader.c (parse_action): Use copy_character instead of
1338 obstack_1grow.
1339
db7c8e9a
AD
13402002-05-13 Akim Demaille <akim@epita.fr>
1341
1342 * tests/regression.at (Token definitions): Prototype yylex and
1343 yyerror.
1344
fcc61800
PH
13452002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1346
158c687b 1347 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
1348 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1349 32-bit arithmetic.
1350 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1351
5683e9b2
AD
13522002-05-07 Akim Demaille <akim@epita.fr>
1353
1354 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1355 avoid GCC warnings.
1356
0c2d3f4c
AD
13572002-05-07 Akim Demaille <akim@epita.fr>
1358
1359 Kill GCC warnings.
1360
1361 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1362 over the RHS of each rule.
1363 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1364 * src/state.h (state_t): Member `nitems' is unsigned short.
1365 * src/LR0.c (get_state): Adjust.
1366 * src/reader.c (packgram): Likewise.
1367 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1368 `Type'.
1369 (muscle_insert_int_table): Remove, unused.
1370 (prepare_rules): Remove `max'.
1371
1565b720
AD
13722002-05-06 Akim Demaille <akim@epita.fr>
1373
1374 * src/closure.c (print_firsts): Display of the symbol tags.
1375 (bitmatrix_print): Move to...
1376 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1377 here.
1378 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1379
cfaee611
AD
13802002-05-06 Akim Demaille <akim@epita.fr>
1381
1382 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1383 hash_do_for_each.
1384
458be8e0
AD
13852002-05-06 Akim Demaille <akim@epita.fr>
1386
1387 * src/LR0.c (new_state, get_state): Instead of using the global
1388 `kernel_size' and `kernel_base', have two new arguments:
1389 `core_size' and `core'.
1390 Adjust callers.
1391
a900a624
AD
13922002-05-06 Akim Demaille <akim@epita.fr>
1393
1394 * src/reader.c (packgram): No longer end `ritem' with a 0
1395 sentinel: it is not used.
1396
d4e7d3a1
AD
13972002-05-05 Akim Demaille <akim@epita.fr>
1398
1399 New experimental feature: display the lookaheads in the report and
1400 graph.
1401
1402 * src/print (print_core): When --trace-flag, display the rules
1403 lookaheads.
1404 * src/print_graph.c (print_core): Likewise.
1405 Swap the arguments.
1406 Adjust caller.
1407
39ceb25b
AD
14082002-05-05 Akim Demaille <akim@epita.fr>
1409
1410 * tests/torture.at (Many lookaheads): New test.
1411
5372019f
AD
14122002-05-05 Akim Demaille <akim@epita.fr>
1413
1414 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1415 (GENERATE_MUSCLE_INSERT_TABLE): this.
1416 (output_int_table, output_unsigned_int_table, output_short_table)
1417 (output_token_number_table, output_item_number_table): Replace with...
1418 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1419 (muscle_insert_short_table, muscle_insert_token_number_table)
1420 (muscle_insert_item_number_table): these.
1421 Adjust all callers.
1422 (prepare_tokens): Don't free `translations', since...
1423 * src/reader.h, src/reader.c (grammar_free): do it.
1424 Move to...
1425 * src/gram.h, src/gram.c (grammar_free): here.
1426 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1427 b4_translate_max.
1428
5df5f6d5
AD
14292002-05-05 Akim Demaille <akim@epita.fr>
1430
1431 * src/output.c (output_unsigned_int_table): New.
1432 (prepare_rules): `i' is unsigned.
1433 `prhs', `rline', `r2' are unsigned int.
1434 Rename muscle `rhs_number_max' as `rhs_max'.
1435 Output muscles `prhs_max', `rline_max', and `r2_max'.
1436 Free rline and r1.
1437 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1438 to compute types instead of constant types.
1439 * tests/regression.at (Web2c Actions): Adjust.
1440
b87f8b21
AD
14412002-05-04 Akim Demaille <akim@epita.fr>
1442
1443 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1444 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1445 Adjust dependencies.
1446 * src/output.c (token_definitions_output): Be sure not to output a
1447 `#define 'a'' when fed with `%token 'a' "a"'.
1448 * tests/regression.at (Token definitions): New.
1449
8bb936e4
PE
14502002-05-03 Paul Eggert <eggert@twinsun.com>
1451
1452 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1453 for K&R C.
1454
14552002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1456
1457 * Makefile.am (SUBDIRS): Remove intl.
1458 (EXTRA_DIST): Add config/config.rpath.
1459
53c71a12
AD
14602002-05-03 Akim Demaille <akim@epita.fr>
1461
1462 * data/bison.simple (m4_if): Don't output empty enums.
1463 And actually, output valid enum definitions :(.
1464
289dd0cf
AD
14652002-05-03 Akim Demaille <akim@epita.fr>
1466
1467 * configure.bat: Remove, completely obsolete.
1468 * Makefile.am (EXTRA_DIST): Adjust.
1469 Don't distribute config.rpath...
1470 * config/Makefile.am (EXTRA_DIST): Do it.
1471
db85e524
AD
14722002-05-03 Akim Demaille <akim@epita.fr>
1473
1474 * configure.in (GETTEXT_VERSION): New.
1475 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1476
83ccf991
AD
14772002-05-03 Akim Demaille <akim@epita.fr>
1478
1479 * data/bison.simple (b4_token_enum): New.
1480 (b4_token_defines): Use it to output tokens both as #define and
1481 enums.
1482 Suggested by Paul Eggert.
1483 * src/output.c (token_definitions_output): Don't output spurious
1484 white spaces.
1485
1f418995
AD
14862002-05-03 Akim Demaille <akim@epita.fr>
1487
1488 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1489
45119f04
RA
14902002-05-02 Robert Anisko <robert@lrde.epita.fr>
1491
1492 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1493 Update the stack class, give a try to deque as the default container.
1494
b2d52318
AD
14952002-05-02 Akim Demaille <akim@epita.fr>
1496
1497 * data/bison.simple (yyparse): Do not implement @$ = @1.
1498 (YYLLOC_DEFAULT): Adjust to do it.
1499 * doc/bison.texinfo (Location Default Action): Fix.
1500
3a8b4109
AD
15012002-05-02 Akim Demaille <akim@epita.fr>
1502
1503 * src/reader.c (parse_braces): Merge into...
1504 (parse_action): this.
1505
84614e13
AD
15062002-05-02 Akim Demaille <akim@epita.fr>
1507
1508 * configure.in (ALL_LINGUAS): Remove.
1509 * po/LINGUAS, hr.po: New.
1510
fdbcd8e2
AD
15112002-05-02 Akim Demaille <akim@epita.fr>
1512
1513 Remove the so called hairy (semantic) parsers.
1514
1515 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1516 * src/gram.h, src/gram.c (semantic_parser): Remove.
1517 (rule_t): Remove the guard and guard_line members.
1518 * src/lex.h (token_t): remove tok_guard.
1519 * src/options.c (option_table): Remove %guard and %semantic_parser
1520 support.
1521 * src/output.c, src/output.h (guards_output): Remove.
1522 (prepare): Adjust.
1523 (token_definitions_output): Don't output the `T'
1524 tokens (???).
1525 (output_skeleton): Don't output the guards.
1526 * src/files.c, src/files.c (attrsfile): Remove.
1527 * src/reader.c (symbol_list): Remove the guard and guard_line
1528 members.
1529 Adjust dependencies.
1530 (parse_guard): Remove.
1531 * data/bison.hairy: Remove.
1532 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1533 BISON_HAIRY.
1534
82b6cb3f
AD
15352002-05-02 Akim Demaille <akim@epita.fr>
1536
1537 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1538 (parse_guard): Rename the formal argument `stack_offset' as
1539 `rule_length', which is more readable.
1540 Adjust callers.
1541 (copy_at, copy_dollar): Instead of outputting the hard coded
1542 values of $$, $n and so forth, output invocation to b4_lhs_value,
1543 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
1544 Note: this patch partially drops `semantic-parser' support: it
1545 always does `rule_length - n', where semantic parsers ought to
1546 always use `-n'.
82b6cb3f
AD
1547 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1548 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1549
6cbfbcc5
AD
15502002-05-02 Akim Demaille <akim@epita.fr>
1551
1552 * configure.in (AC_INIT): Bump to 1.49b.
1553 (AM_INIT_AUTOMAKE): Short invocation.
1554
b8548114
AD
15552002-05-02 Akim Demaille <akim@epita.fr>
1556
1557 Version 1.49a.
1558
c20cd1fa
AD
15592002-05-01 Akim Demaille <akim@epita.fr>
1560
1561 * src/skeleton.h: Remove.
1562
8a9566d4
AD
15632002-05-01 Akim Demaille <akim@epita.fr>
1564
1565 * src/skeleton.h: Fix the #endif.
1566 Reported by Magnus Fromreide.
1567
8c6d399a
PE
15682002-04-26 Paul Eggert <eggert@twinsun.com>
1569
1570 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1571 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 1572 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 1573
2b7ed18a
RA
15742002-04-25 Robert Anisko <robert@lrde.epita.fr>
1575
1576 * src/scan-skel.l: Postprocess quadrigraphs.
1577
1578 * src/reader.c (copy_character): New function, used to output
1579 single characters while replacing `[' and `]' with quadrigraphs, to
1580 avoid troubles with M4 quotes.
1581 (copy_comment): Output characters with copy_character.
1582 (read_additionnal_code): Likewise.
1583 (copy_string2): Likewise.
1584 (copy_definition): Likewise.
1585
1586 * tests/calc.at: Exercise M4 quoting.
1587
34a89c50
AD
15882002-04-25 Akim Demaille <akim@epita.fr>
1589
1590 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1591 between `!' and the command.
1592 Reported by Paul Eggert.
1593
0dd1580a
RA
15942002-04-24 Robert Anisko <robert@lrde.epita.fr>
1595
1596 * tests/calc.at: Exercise prologue splitting.
1597
1598 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1599 `b4_post_prologue' instead of `b4_prologue'.
1600
1601 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1602 muscles.
1603 (output): Free pre_prologue_obstack and post_prologue_obstack.
1604 * src/files.h, src/files.c (attrs_obstack): Remove.
1605 (pre_prologue_obstack, post_prologue_obstack): New.
1606 * src/reader.c (copy_definition): Add a parameter to specify the
1607 obstack to fill, instead of using attrs_obstack unconditionally.
1608 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1609 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1610
83c1796f
PE
16112002-04-23 Paul Eggert <eggert@twinsun.com>
1612
1613 * data/bison.simple: Remove unnecessary commentary and white
1614 space differences from 1_29-branch.
1615 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1616
1617 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1618 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1619 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1620 constructors or destructors.
1621
1622 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1623
1207eeac
AD
16242002-04-23 Akim Demaille <akim@epita.fr>
1625
1626 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1627 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1628 location with columns.
1629 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1630 All reported by Paul Eggert.
1631
78ab8f67
AD
16322002-04-22 Akim Demaille <akim@epita.fr>
1633
1634 * src/reduce.c (dump_grammar): Move to...
1635 * src/gram.h, src/gram.c (grammar_dump): here.
1636 Be sure to separate long item numbers.
1637 Don't read the members of a rule's prec if its nil.
1638
133c20e2
AD
16392002-04-22 Akim Demaille <akim@epita.fr>
1640
1641 * src/output.c (table_size, table_grow): New.
1642 (MAXTABLE): Remove, replace uses with table_size.
1643 (pack_vector): Instead of dying when the table is too big, grow it.
1644
9515e8a7
AD
16452002-04-22 Akim Demaille <akim@epita.fr>
1646
1647 * data/bison.simple (yyr1): Its type is that of a token number.
1648 * data/bison.c++ (r1_): Likewise.
1649 * tests/regression.at (Web2c Actions): Adjust.
1650
23c5a174
AD
16512002-04-22 Akim Demaille <akim@epita.fr>
1652
1653 * src/reader.c (token_translations_init): 256 is now the default
1654 value for the error token, i.e., it will be assigned another
1655 number if the user assigned 256 to one of her tokens.
1656 (reader): Don't force 256 to error.
1657 * doc/bison.texinfo (Symbols): Adjust.
1658 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1659 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1660 etc. instead of 10, 20, 30 (which was used to `jump' over error
1661 (256) and undefined (2)).
1662
5fbb0954
AD
16632002-04-22 Akim Demaille <akim@epita.fr>
1664
1665 Propagate more token_number_t.
1666
1667 * src/gram.h (token_number_as_item_number)
1668 (item_number_as_token_number): New.
1669 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1670 Use it to create output_item_number_table and
1671 output_token_number_table.
1672 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1673 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1674 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1675 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1676
4f940944
AD
16772002-04-22 Akim Demaille <akim@epita.fr>
1678
1679 * src/output.h, src/output.c (get_lines_number): Remove.
1680
3ded9a63
AD
16812002-04-19 Akim Demaille <akim@epita.fr>
1682
1683 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1684 as Lex/Flex'.
1685 (Debugging): More details about enabling the debugging features.
1686 (Table of Symbols): Describe $$, $n, @$, and @n.
1687 Suggested by Tim Josling.
1688
e0c471a9
AD
16892002-04-19 Akim Demaille <akim@epita.fr>
1690
1691 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1692
fecc10cd
AD
16932002-04-10 Akim Demaille <akim@epita.fr>
1694
1695 * src/system.h: Rely on HAVE_LIMITS_H.
1696 Suggested by Paul Eggert.
1697
51dec47b
AD
16982002-04-09 Akim Demaille <akim@epita.fr>
1699
1700 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1701 full stderr, and strip it according to the bison options, instead
1702 of composing the error message from different bits.
1703 This makes it easier to check for several error messages.
1704 Adjust all the invocations.
1705 Add an invocation exercising the error token.
1706 Add an invocation demonstrating a stupid error message.
1707 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1708 Adjust the tests.
1709 Error message are for stderr, not stdout.
1710
007a50a4
AD
17112002-04-09 Akim Demaille <akim@epita.fr>
1712
1713 * src/gram.h, src/gram.c (error_token_number): Remove, use
1714 errtoken->number.
1715 * src/reader.c (reader): Don't specify the user token number (2)
1716 for $undefined, as it uselessly prevents using it.
1717 * src/gram.h (token_number_t): Move to...
1718 * src/symtab.h: here.
1719 (state_t.number): Is a token_number_t.
1720 * src/print.c, src/reader.c: Use undeftoken->number instead of
1721 hard coded 2.
1722 (Even though this 2 is not the same as above: the number of the
1723 undeftoken remains being 2, it is its user token number which
1724 might not be 2).
1725 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1726 `user_token_number_max'.
1727 Output `undef_token_number'.
1728 * data/bison.simple, data/bison.c++: Use them.
1729 Be sure to map invalid yylex return values to
1730 `undef_token_number'. This saves us from gratuitous SEGV.
1731
1732 * tests/conflicts.at (Solved SR Conflicts)
1733 (Unresolved SR Conflicts): Adjust.
1734 * tests/regression.at (Web2c Actions): Adjust.
1735
06446ccf
AD
17362002-04-08 Akim Demaille <akim@epita.fr>
1737
1738 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1739 Adding #line.
1740 Remove the duplicate `typedefs'.
1741 (RhsNumberType): Fix the declaration and various other typos.
1742 Use __ofile__.
1743 * data/bison.simple: Use __ofile__.
1744 * src/scan-skel.l: Handle __ofile__.
1745
62a3e4f0
AD
17462002-04-08 Akim Demaille <akim@epita.fr>
1747
1748 * src/gram.h (item_number_t): New, the type of item numbers in
1749 RITEM. Note that it must be able to code symbol numbers as
1750 positive number, and the negation of rule numbers as negative
1751 numbers.
1752 Adjust all dependencies (pretty many).
1753 * src/reduce.c (rule): Remove this `short *' pointer: use
1754 item_number_t.
1755 * src/system.h (MINSHORT, MAXSHORT): Remove.
1756 Include `limits.h'.
1757 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1758 (shortcpy): Remove.
1759 (MAXTABLE): Move to...
1760 * src/output.c (MAXTABLE): here.
1761 (prepare_rules): Use output_int_table to output rhs.
1762 * data/bison.simple, data/bison.c++: Adjust.
1763 * tests/torture.at (Big triangle): Move the limit from 254 to
1764 500.
1765 * tests/regression.at (Web2c Actions): Ajust.
1766
1767 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1768 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1769 passes, but produces negative #line number, once fixed, GCC is
1770 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1771 C), it passes.
1772 * src/state.h (state_h): Code input lines on ints, not shorts.
1773
bb88b0fc
AD
17742002-04-08 Akim Demaille <akim@epita.fr>
1775
1776 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1777 and then the grammar.
1778
9a636f47
AD
17792002-04-08 Akim Demaille <akim@epita.fr>
1780
1781 * src/system.h: No longer using strndup.
1782
680e8701
AD
17832002-04-07 Akim Demaille <akim@epita.fr>
1784
1785 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1786 * src/output.c (output_table_data): Return the longest number.
1787 (prepare_tokens): Output `token_number_max').
1788 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1789 New.
1790 Use them to define yy_token_number_type/TokenNumberType.
1791 Use this type for yytranslate.
1792 * tests/torture.at (Big triangle): Push the limit from 124 to
1793 253.
1794 * tests/regression.at (Web2c Actions): Adjust.
1795
817e9f41
AD
17962002-04-07 Akim Demaille <akim@epita.fr>
1797
1798 * tests/torture.at (Big triangle): New.
1799 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1800 * tests/existing.at: here.
1801
5123689b
AD
18022002-04-07 Akim Demaille <akim@epita.fr>
1803
1804 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1805 nritems.
1806 Adjust dependencies.
1807
f3849179
AD
18082002-04-07 Akim Demaille <akim@epita.fr>
1809
1810 * src/reader.c: Normalize increments to prefix form.
1811
bd02036a
AD
18122002-04-07 Akim Demaille <akim@epita.fr>
1813
1814 * src/reader.c, symtab.c: Remove debugging code.
1815
db8837cb
AD
18162002-04-07 Akim Demaille <akim@epita.fr>
1817
1818 Rename all the `bucket's as `symbol_t'.
1819
1820 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1821 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1822 * src/symtab.c, src/symtab.h (bucket): Rename as...
1823 (symbol_t): this.
1824 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1825 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1826 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1827 (buckets_new, buckets_free, buckets_do): Rename as...
1828 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1829 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1830 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1831 (symbols_new, symbols_free, symbols_do): these.
1832
72a23c97
AD
18332002-04-07 Akim Demaille <akim@epita.fr>
1834
1835 Use lib/hash for the symbol table.
1836
1837 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1838 EOF.
1839 * src/lex.c (lex): Set the `number' member of new terminals.
1840 * src/reader.c (bucket_check_defined, bucket_make_alias)
1841 (bucket_check_alias_consistence, bucket_translation): New.
1842 (reader, grammar_free, readgram, token_translations_init)
1843 (packsymbols): Adjust.
1844 (reader): Number the predefined tokens.
1845 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1846 for predefined tokens.
1847 * src/symtab.h (bucket): Remove all the hash table related
1848 members.
1849 * src/symtab.c (symtab): Replace by...
1850 (bucket_table): this.
1851 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1852 (buckets_new, buckets_do): New.
1853
280a38c3
AD
18542002-04-07 Akim Demaille <akim@epita.fr>
1855
1856 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1857 (start_symbol, max_user_token_number, semantic_parser)
1858 (error_token_number): Initialize.
1859 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1860 Initialize.
1861 (reader): Don't.
1862 (errtoken, eoftoken, undeftoken, axiom): Extern.
1863
03b31c0c
AD
18642002-04-07 Akim Demaille <akim@epita.fr>
1865
1866 * src/gram.h (rule_s): prec and precsym are now pointers
1867 to the bucket giving the priority/associativity.
1868 Member `associativity' removed: useless.
1869 * src/reduce.c, src/conflicts.c: Adjust.
1870
8b3df748
AD
18712002-04-07 Akim Demaille <akim@epita.fr>
1872
1873 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1874 Properly escape the symbols' TAG when outputting them.
1875
e601aa1d
AD
18762002-04-07 Akim Demaille <akim@epita.fr>
1877
1878 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1879
b0299a2e
AD
18802002-04-07 Akim Demaille <akim@epita.fr>
1881
1882 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1883 (LArule): this, which is an array to rule_t*.
1884 * src/print.c, src/conflicts.c: Adjust.
1885
d7e1f00c
AD
18862002-04-07 Akim Demaille <akim@epita.fr>
1887
1888 * src/gram.h (rule_t): Rename `number' as `user_number'.
1889 `number' is a new member.
1890 Adjust dependencies.
1891 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1892
cc9305dd
AD
18932002-04-07 Akim Demaille <akim@epita.fr>
1894
1895 As a result of the previous patch, it is no longer needed
1896 to reorder ritem itself.
1897
1898 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1899
b0940840
AD
19002002-04-07 Akim Demaille <akim@epita.fr>
1901
1902 Be sure never to walk through RITEMS, but use only data related to
1903 the rules themselves. RITEMS should be banished.
1904
1905 * src/output.c (output_token_translations): Rename as...
1906 (prepare_tokens): this.
1907 In addition to `translate', prepare the muscles `tname' and
1908 `toknum', which were handled by...
1909 (output_rule_data): this.
1910 Remove, and move the remainder of its outputs into...
1911 (prepare_rules): this new routines, which also merges content from
1912 (output_gram): this.
1913 (prepare_rules): Be sure never to walk through RITEMS.
1914 (output_stos): Rename as...
1915 (prepare_stos): this.
1916 (output): Always invoke prepare_states, after all, just don't use it
1917 in the output if you don't need it.
1918
643a5994
AD
19192002-04-07 Akim Demaille <akim@epita.fr>
1920
1921 * src/LR0.c (new_state): Display `nstates' as the name of the
1922 newly created state.
1923 Adjust to initialize first_state and last_state if needed.
1924 Be sure to distinguish the initial from the final state.
1925 (new_states): Create the itemset of the initial state, and use
1926 new_state.
1927 * src/closure.c (closure): Now that the initial state has its
1928 items properly set, there is no need for a special case when
1929 creating `ruleset'.
1930
1931 As a result, now the rule 0, reducing to $axiom, is visible in the
1932 outputs. Adjust the test suite.
1933
1934 * tests/conflicts.at (Solved SR Conflicts)
1935 (Unresolved SR Conflicts): Adjust.
1936 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1937 * tests/conflicts.at (S/R in initial): New.
1938
b4c4ccc2
AD
19392002-04-07 Akim Demaille <akim@epita.fr>
1940
1941 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1942 the RHS of the rules.
1943 * src/output.c (output_gram): Likewise.
1944
bba97eb2
AD
19452002-04-07 Akim Demaille <akim@epita.fr>
1946
1947 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1948 bucket.
1949 Adjust all dependencies.
1950 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1951 `number' of the buckets too.
1952 * src/gram.h: Include `symtab.h'.
1953 (associativity): Move to...
1954 * src/symtab.h: here.
1955 No longer include `gram.h'.
1956
c3b407f4
AD
19572002-04-07 Akim Demaille <akim@epita.fr>
1958
1959 * src/gram.h, src/gram.c (rules_rhs_length): New.
1960 (ritem_longest_rhs): Use it.
1961 * src/gram.h (rule_t): `number' is a new member.
1962 * src/reader.c (packgram): Set it.
1963 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1964 the end of `rules', and count them out of `nrules'.
1965 (reduce_output, dump_grammar): Adjust.
1966 * src/print.c (print_grammar): It is no longer needed to check for
1967 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1968 * tests/reduce.at (Reduced Automaton): New test.
1969
11652ab3
AD
19702002-04-07 Akim Demaille <akim@epita.fr>
1971
1972 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1973 lacking `+ 1' to nrules, Bison reported as useless a token if it
1974 was used solely to set the precedence of the last rule...
1975
26b23c1a
AD
19762002-04-07 Akim Demaille <akim@epita.fr>
1977
1978 * data/bison.c++, data/bison.simple: Don't output the current file
1979 name in #line, to avoid useless diffs between two identical
1980 outputs under different names.
1981
18bcecb0
AD
19822002-04-07 Akim Demaille <akim@epita.fr>
1983
1984 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1985 Normalize loops to using `< nrules + 1', not `<= nrules'.
1986
fa770c86
AD
19872002-04-07 Akim Demaille <akim@epita.fr>
1988
1989 * TODO: Update.
1990
d9b739c3
AD
19912002-04-07 Akim Demaille <akim@epita.fr>
1992
1993 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1994 bucket.value as bucket.number.
1995
99013900
AD
19962002-04-07 Akim Demaille <akim@epita.fr>
1997
1998 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1999 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
2000 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
2001 RHS, instead of being an index in RITEMS.
2002
e966383b
PE
20032002-04-04 Paul Eggert <eggert@twinsun.com>
2004
2005 * doc/bison.texinfo: Update copyright date.
2006 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
2007 (Symbols): Warn about running Bison in one character set,
2008 but compiling and/or running in an incompatible one.
2009 Warn about character code 256, too.
2010
20112002-04-03 Paul Eggert <eggert@twinsun.com>
2012
2013 * src/bison.data (YYSTACK_ALLOC): Depend on whether
2014 YYERROR_VERBOSE is nonzero, not whether it is defined.
2015
2016 Merge changes from bison-1_29-branch.
c307773e 2017
8d6c48b9
PE
20182002-03-20 Paul Eggert <eggert@twinsun.com>
2019
2020 Merge fixes from Debian bison_1.34-1.diff.
2021
2022 * configure.in (AC_PREREQ): 2.53.
2023
e53c6322
AD
20242002-03-20 Akim Demaille <akim@epita.fr>
2025
2026 * src/conflicts.c (log_resolution): Argument `resolution' is const.
2027
9ffbeca7
PE
20282002-03-19 Paul Eggert <eggert@twinsun.com>
2029
21db0b2a
PE
2030 * src/bison.simple (YYCOPY): New macro.
2031 (YYSTACK_RELOCATE): Use it.
2032 Remove Type arg; no longer needed. All callers changed.
2033 (yymemcpy): Remove; no longer needed.
2034
9ffbeca7
PE
2035 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
2036 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2037
642cb8f8
AD
20382002-03-19 Akim Demaille <akim@epita.fr>
2039
2040 Test and fix the #line outputs.
2041
2042 * tests/atlocal.at (GCC): New.
2043 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
2044 (Prologue synch line, ,%union synch line, Postprologue synch line)
2045 (Action synch line, Epilogue synch line): New tests.
2046 * src/reader.c (parse_union_decl): Define the muscle stype_line.
2047 * data/bison.simple, data/bison.c++: Use it.
2048
3c31a486
AD
20492002-03-19 Akim Demaille <akim@epita.fr>
2050
2051 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
2052 (Solved SR Conflicts, %expect not enough, %expect right)
2053 (%expect too much): Move to...
2054 * tests/conflicts.at: this new file.
2055
0d8bed56
AD
20562002-03-19 Akim Demaille <akim@epita.fr>
2057
2058 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2059 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
2060 that we can move to enums for instance.
2061 * src/output.c (token_definitions_output): Output a list of
2062 `token-name, token-number' instead of the #define.
2063 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
2064
9208d17f
AD
20652002-03-14 Akim Demaille <akim@epita.fr>
2066
2067 Use Gettext 0.11.1.
2068
af27eacb
RA
20692002-03-09 Robert Anisko <robert@lrde.epita.fr>
2070
2071 * data/bison.c++: Make the user able to add members to the generated
2072 parser by subclassing.
2073
9101a310
RA
20742002-03-05 Robert Anisko <robert@lrde.epita.fr>
2075
2076 * src/reader.c (read_additionnal_code): `c' should be an integer, not
2077 a character.
2078 Reported by Nicolas Tisserand and Nicolas Burrus.
2079
fff9bf0b
RA
20802002-03-04 Robert Anisko <robert@lrde.epita.fr>
2081
2082 * src/reader.c: Warn about lacking semi-colons, do not complain.
2083
64dba31e
RA
20842002-03-04 Robert Anisko <robert@lrde.epita.fr>
2085
2086 * data/bison.c++: Remove a debug line.
2087
374f5a14
RA
20882002-03-04 Robert Anisko <robert@lrde.epita.fr>
2089
2090 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
2091 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
2092 provide a default implementation.
2093
bfcf1f3a
AD
20942002-03-04 Akim Demaille <akim@epita.fr>
2095
2096 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
2097 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
2098 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
2099 * tests/semantic.at (Parsing Guards): Similarly.
2100 * src/reader.at (readgram): Complain if the last rule is not ended
2101 with a semi-colon.
2102
65ccf9fc
AD
21032002-03-04 Akim Demaille <akim@epita.fr>
2104
2105 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
2106 * src/closure.c: here.
2107 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
2108 RTC.
2109 * src/warshall.h, src/warshall.c: Remove.
2110 * tests/sets.at (Broken Closure): Adjust.
2111
d0039cbc
AD
21122002-03-04 Akim Demaille <akim@epita.fr>
2113
2114 * src/output.c (output_skeleton): tempdir is const.
2115 bytes_read is unused.
2116
345cea78
AD
21172002-03-04 Akim Demaille <akim@epita.fr>
2118
2119 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2120 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
2121 Update.
2122 From Michael Hayes.
2123
564801f7
AD
21242002-03-04 Akim Demaille <akim@epita.fr>
2125
2126 * src/closure.c (closure): `r' is unused.
2127
e5352bc7
AD
21282002-03-04 Akim Demaille <akim@epita.fr>
2129
2130 * tests/sets.at (Broken Closure): Add the ending `;'.
2131 * src/reader.at (readgram): Complain if a rule is not ended with a
2132 semi-colon.
2133
914feea9
AD
21342002-03-04 Akim Demaille <akim@epita.fr>
2135
2136 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
2137 (count_sr_conflicts): Use bitset_count.
2138 * src/reduce.c (inaccessable_symbols): Ditto.
2139 (bits_size): Remove.
2140 * src/warshall.h, src/warshall.c: Convert to bitsetv.
2141
f0250de6
AD
21422002-03-04 Akim Demaille <akim@epita.fr>
2143
2144 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
2145 * src/reduce.c: Remove the `bitset_zero's following the
2146 `bitset_create's, as now it is performed by the latter.
2147
ef017502
AD
21482002-03-04 Akim Demaille <akim@epita.fr>
2149
2150 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
2151 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
2152 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
2153 latest sources from Michael.
2154
76514394
AD
21552002-03-04 Akim Demaille <akim@epita.fr>
2156
2157 * src/output.c (output): Don't free the grammar.
2158 * src/reader.c (grammar_free): New.
2159 * src/main.c (main): Call it and don't free symtab here.
2160
55024580
AD
21612002-03-04 Akim Demaille <akim@epita.fr>
2162
2163 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
2164 before returning.
2165 Reported by Benoit Perrot.
2166
f9abaa2c
AD
21672002-03-04 Akim Demaille <akim@epita.fr>
2168
2169 Use bitset operations when possible, not loops over bits.
2170
2171 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
2172 bitset_or.
2173 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
2174 * src/reduce.c (useless_nonterminals): Formatting changes.
2175 * src/warshall.c (TC): Use bitset_or.
2176
0e721e75
AD
21772002-03-04 Akim Demaille <akim@epita.fr>
2178
2179 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
2180 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
2181 Ditto.
2182
0fb1ffb1
AD
21832002-03-04 Akim Demaille <akim@epita.fr>
2184
2185 * src/lalr.c (F): Now a bitset*.
2186 Adjust all dependencies.
2187
b86796bf
AD
21882002-03-04 Akim Demaille <akim@epita.fr>
2189
2190 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
2191 Adjust all dependencies.
2192
602bbf31
AD
21932002-03-04 Akim Demaille <akim@epita.fr>
2194
2195 * src/L0.c, src/LR0.h (nstates): Be size_t.
2196 Adjust comparisons (signed vs unsigned).
2197 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
2198 bitset*.
2199 Adjust all dependencies.
2200
d8a0245c
AD
22012002-03-04 Akim Demaille <akim@epita.fr>
2202
2203 * src/closure.c (firsts): Now, also a bitset.
2204 Adjust all dependencies.
2205 (varsetsize): Remove, now unused.
2206 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2207
34ba9743
AD
22082002-03-04 Akim Demaille <akim@epita.fr>
2209
2210 * src/print.c: Convert to use bitset.h, not hand coded iterations
2211 over ints.
2212
ed86e78c
AD
22132002-03-04 Akim Demaille <akim@epita.fr>
2214
2215 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2216
dfdb1797
AD
22172002-03-04 Akim Demaille <akim@epita.fr>
2218
2219 * src/closure.c (ruleset): Be a bitset.
2220 (rulesetsize): Remove.
2221
7086e707
AD
22222002-03-04 Akim Demaille <akim@epita.fr>
2223
2224 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2225 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2226 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2227 * src/closure.c (fderives): Be an array of bitsets.
2228
98254360
RA
22292002-02-28 Robert Anisko <robert@lrde.epita.fr>
2230
2231 * data/bison.c++: Merge the two generated headers. Insert a copyright
2232 notice in each output file.
2233
a75c057f
AD
22342002-02-28 Akim Demaille <akim@epita.fr>
2235
2236 * data/bison.c++: Copy the prologue of bison.simple to fetch
2237 useful M4 definitions, such as b4_header_guard.
2238
06b00abc
AD
22392002-02-25 Akim Demaille <akim@epita.fr>
2240
2241 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
2242 translator friendly scheme for the bgr
2243 copyright notice.
06b00abc 2244
70e7d534
AD
22452002-02-25 Akim Demaille <akim@epita.fr>
2246
2247 * src/output.c (header_output): Remove, now handled completely via
2248 M4.
2249
abe017f6
AD
22502002-02-25 Akim Demaille <akim@epita.fr>
2251
2252 * m4/m4.m4: New, from CVS Autoconf.
2253 * configure.in: Invoke it.
2254 * src/output.c (output_skeleton): Use its result instead of the
2255 hard coded name.
2256
381fb12e
AD
22572002-02-25 Akim Demaille <akim@epita.fr>
2258
2259 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2260 Fileutils 4.1.5.
2261 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2262 * src/output.c (output_skeleton): Use mkstemp to create a real
2263 temporary file.
2264 Move the filling of `skeleton' and its muscle to...
2265 (prepare): here.
2266 (output): Move the definition of the prologue muscle to...
2267 (prepare): here.
2268 * src/system.h (DEFAULT_TMPDIR): New.
2269
6f38107f
PE
22702002-02-14 Paul Eggert <eggert@twinsun.com>
2271
2272 Remove the support for C++ namespace cleanliness; it was
2273 causing more problems than it was curing, since it didn't work
2274 properly on some nonstandard C++ compilers. This can wait
2275 for a proper C++ parser.
2276
2277 * NEWS: Document this.
2278 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2279 of C++, as it's treated like C now.
2280 * src/bison.simple (YYSTD): Remove.
2281 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2282 Treat C++ just like Standard C instead of trying to support
2283 namespace cleanliness.
2284
80cce3da
AD
22852002-02-14 Akim Demaille <akim@epita.fr>
2286
2287 * tests/regression.at (else): Adjust to Andreas' change.
2288
842e8679
AD
22892002-02-14 Akim Demaille <akim@epita.fr>
2290
2291 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2292
4bda3f10
AD
22932002-02-13 Andreas Schwab <schwab@suse.de>
2294
2295 * src/output.c (output_rule_data): Don't output NULL, it might
2296 not be defined yet.
2297
4162fa07 22982002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 2299
4162fa07
RA
2300 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2301 (Copyright notice): Update.
b418ecd8 2302
bd16a5dc
AD
23032002-02-11 Akim Demaille <akim@epita.fr>
2304
2305 * tests/regression.at (%nonassoc and eof): Don't include
2306 nonportable headers.
2307
8d69a1a3
RA
23082002-02-08 Robert Anisko <robert@lrde.epita.fr>
2309
2310 * data/bison.c++: Correct error recovery. Make the user able to
2311 initialize the starting location.
2312
9b2d0677
AD
23132002-02-07 Akim Demaille <akim@epita.fr>
2314
2315 * tests/input.at: New.
2316
69e2658b
RA
23172002-02-07 Robert Anisko <robert@lrde.epita.fr>
2318
2319 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 2320 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
2321 directives around tables only needed for debugging.
2322
4aacc3a7
RA
23232002-02-07 Robert Anisko <robert@lrde.epita.fr>
2324
2325 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2326 C++ parsers.
2327 (yy::b4_name::parse): Use print_.
2328
762a801e
RA
23292002-02-07 Robert Anisko <robert@lrde.epita.fr>
2330
2331 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2332
4bb2bc3f
RA
23332002-02-07 Robert Anisko <robert@lrde.epita.fr>
2334
2335 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2336 C++ parsers.
2337 (yy::b4_name::parse): Build verbose error messages, and use error_.
2338
6b45a3ca
RA
23392002-02-06 Robert Anisko <robert@lrde.epita.fr>
2340
2341 * data/bison.c++: Fix m4 quoting in comments.
2342
50997c6e
RA
23432002-02-06 Robert Anisko <robert@lrde.epita.fr>
2344
2345 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2346 not expanded by m4.
2347
3f3eed27
AD
23482002-02-05 Akim Demaille <akim@epita.fr>
2349
2350 * data/bison.c++: Adjust to the M4 back end.
2351 More is certainly needed.
2352
be2a1a68
AD
23532002-02-05 Akim Demaille <akim@epita.fr>
2354
2355 Give a try to M4 as a back end.
2356
2357 * lib/readpipe.c: New, from wdiff.
2358 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2359 BISON_HAIRY.
2360 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2361 specific values. Now it is m4 that performs the lookup.
2362 * src/parse-skel.y: Remove.
2363 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2364 * src/output.c (actions_output, guards_output)
2365 (token_definitions_output): No longer keeps track of the output
2366 line number, hence remove the second argument.
2367 (guards_output): Check against the guard member of a rule, not the
2368 action member.
2369 Adjust callers.
2370 (output_skeleton): Don't look for the skeleton location, let m4 do
2371 that.
2372 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2373 file will be used.
2374 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2375 (prepare): Given that for the time being changesyntax is not
2376 usable in M4, rename the muscles using `-' to `_'.
2377 Define `defines_flag', `output_parser_name' and `output_header_name'.
2378 * src/output.h (actions_output, guards_output)
2379 (token_definitions_output): Adjust prototypes.
2380 * src/scan-skel.l: Instead of scanning the skeletons, it now
2381 processes the output of m4: `__oline__' and `#output'.
2382 * data/bison.simple: Adjust to be used by M4(sugar).
2383 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2384 to date.
2385 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2386 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2387 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2388 shamelessly stolen from CVS Autoconf.
2389
beda758b
AD
23902002-02-05 Akim Demaille <akim@epita.fr>
2391
2392 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2393 * configure.in: Check for the declarations of free and malloc.
2394 * src/muscle_tab.c: Adjust.
2395
5ece6d43
AD
23962002-02-05 Akim Demaille <akim@epita.fr>
2397
2398 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2399 which have no values.
2400
5bb18f9a
AD
24012002-02-05 Akim Demaille <akim@epita.fr>
2402
2403 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2404 * data/: here.
2405
894dd62e
PE
24062002-01-29 Paul Eggert <eggert@twinsun.com>
2407
2408 * src/bison.simple (YYSIZE_T): Do not define merely because
2409 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2410 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2411
82841af7
AD
24122002-01-27 Akim Demaille <akim@epita.fr>
2413
2414 Fix `%nonassoc and eof'.
2415
2416 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2417 which were not properly copied! Replace
2418 memcpy (res->errs, src->errs, src->nerrs);
2419 with
2420 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2421 !!!
2422 * tests/regression.at (%nonassoc and eof): Adjust to newest
2423 Autotest: `.' is not in the PATH.
2424
318b76e9
AD
24252002-01-27 Akim Demaille <akim@epita.fr>
2426
2427 * tests/sets.at (AT_EXTRACT_SETS): New.
2428 (Nullable): Use it.
2429 (Firsts): New.
2430
30d2f3d5
AD
24312002-01-26 Akim Demaille <akim@epita.fr>
2432
2433 * tests/actions.at, tests/calc.at, tests/headers.at,
2434 * tests/torture.at: Adjust to the newest Autotest which no longer
2435 forces `.' in the PATH.
2436
30f8c395
AD
24372002-01-25 Akim Demaille <akim@epita.fr>
2438
2439 * tests/regression.at (%nonassoc and eof): New.
2440 Suggested by Robert Anisko.
2441
29ae55f1
AD
24422002-01-24 Akim Demaille <akim@epita.fr>
2443
2444 Bison dumps core when trying to complain about broken input files.
2445 Reported by Cris van Pelt.
2446
2447 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2448 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2449 into...
2450 (Invalid inputs): Strengthen: exercise parse_percent_token.
2451
2b548aa6
RA
24522002-01-24 Robert Anisko <robert.anisko@epita.fr>
2453
2454 * src/Makefile.am: Add bison.c++.
2455 * src/bison.c++: New skeleton.
2456
bb0146c2
AD
24572002-01-21 Paolo Bonzini <bonzini@gnu.org>
2458
2459 * po/it.po: New.
2460
bec30531
AD
24612002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2462
2463 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2464
fc6edc45
MA
24652002-01-20 Marc Autret <marc@gnu.org>
2466
2467 * src/files.c (compute_output_file_names): Fix
2468
5e5d5415
MA
24692002-01-20 Marc Autret <marc@gnu.org>
2470
2471 * tests/output.at: New test.
2472 * src/files.c (compute_base_names): Don't map extensions when
2473 the YACC flag is set, use defaults.
2474 Reported by Evgeny Stambulchik.
2475
44ea3fbd
MA
24762002-01-20 Marc Autret <marc@gnu.org>
2477
bb0146c2 2478 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
2479 compilers as well (i.e. the vendor C compiler).
2480 Suggested by Albert Chin-A-Young.
2481
338963d1
TVH
24822002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2483
2484 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2485 canonical definition.
2486 * src/system.h: Use the canonical definition for PARAMS (avoids
2487 a conflict with the macro from lib/hash.h).
2488
c57b2479
AD
24892002-01-11 Akim Demaille <akim@epita.fr>
2490
2491 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 2492 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 2493
b85810ae
AD
24942002-01-09 Akim Demaille <akim@epita.fr>
2495
2496 * src/files.c, src/files.h (output_infix): New.
2497 (tab_extension): Remove.
2498 (compute_base_names): Compute the former, drop the latter.
2499 * src/output.c (prepare): Insert the muscles `output-infix', and
2500 `output-suffix'.
2501 * src/parse-skel.y (string, string.1): New.
2502 (section.header): Use it.
2503 (section.yacc): Remove.
2504 (prefix): Remove too.
2505 * src/scan-skel.l: Adjust.
2506 * src/bison.simple, src/bison.hairy: Adjust.
2507
cae60122
AD
25082002-01-09 Akim Demaille <akim@epita.fr>
2509
2510 * configure.in (WERROR_CFLAGS): Compute it.
2511 * src/Makefile.am (CFLAGS): Pass it.
2512 * tests/atlocal.in (CFLAGS): Idem.
2513 * src/files.c: Fix a few warnings.
2514 (get_extension_index): Remove, unused.
2515
ae404801
AD
25162002-01-08 Akim Demaille <akim@epita.fr>
2517
2518 * src/getargs.c (AS_FILE_NAME): New.
2519 (getargs): Use it to convert DOSish file names.
2520 * src/files.c (base_name): Rename as full_base_name to avoid
2521 clashes with `base_name ()'.
2522 (filename_split): New.
2523 (compute_base_names): N-th rewrite, using filename_split.
2524
22312b71
AD
25252002-01-08 Akim Demaille <akim@epita.fr>
2526
2527 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2528 New, stolen from the Fileutils 4.1.
2529 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2530 * configure.in: Check for the presence of memrchr, and of its
2531 prototype.
2532
a67cef01
TVH
25332002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2534
2535 * lib/hash.h (__P): Added definition for this macro.
2536 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2537 BUILT_SOURCES, to ensure they are generated first.
2538 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2539 %error-verbose to allow bootstrapping with bison 1.30x.
2540
2b25d624
AD
25412002-01-06 Akim Demaille <akim@epita.fr>
2542
2543 * src/reader.c (parse_braces): Don't fetch the next char, the
2544 convention is to fetch on entry.
2545 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2546 'switch' without a following semicolon.
2547 * tests/regression.at (braces parsing): New.
2548
3460813b
AD
25492002-01-06 Akim Demaille <akim@epita.fr>
2550
2551 Bison is dead wrong in its RR conflict reports.
2552
2553 * tests/torture.at (GNU Cim Grammar): New.
2554 * src/conflicts.c (count_rr_conflicts): Fix.
2555
73784c64
AD
25562002-01-06 Akim Demaille <akim@epita.fr>
2557
2558 Creating package.m4 from configure.ac causes too many problems.
2559
2560 * tests/Makefile.am (package.m4): Create it by hand,
2561 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2562
25d81090
AD
25632002-01-06 Akim Demaille <akim@epita.fr>
2564
2565 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2566 skeleton.h.
2567
a9b8959e
PE
25682002-01-04 Paul Eggert <eggert@twinsun.com>
2569
2570 * doc/bison.texinfo (Debugging):
2571 Remove YYSTDERR; it's no longer defined or used.
2572 Also, s/cstdio.h/cstdio/.
2573
25d81090
AD
25742002-01-03 Akim Demaille <akim@epita.fr>
2575
2576 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2577
1109455c
AD
25782002-01-03 Akim Demaille <akim@epita.fr>
2579
2580 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2581 tracing code to --trace, wait for a better --trace option, with
2582 args.
2583
7ea5e977
AD
25842002-01-03 Akim Demaille <akim@epita.fr>
2585
2586 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2587 The ISO C++ standard is extremely clear about it: stderr is
2588 considered a macro, not a regular symbol (see table 94 `Header
2589 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2590 Therefore std:: does not apply to it. It still does with fprintf.
2591 Also, s/cstdio.h/cstdio/.
2592
fab5b110
AD
25932002-01-03 Akim Demaille <akim@epita.fr>
2594
2595 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2596 for non system headers.
2597
aed7fd9b
AD
25982002-01-02 Akim Demaille <akim@epita.fr>
2599
2600 Equip the skeleton chain with location tracking, runtime trace,
2601 pure parser and scanner.
2602
2603 * src/parse-skel.y: Request a pure parser, locations, and prefix
2604 renaming.
2605 (%union): Having several members with the same type does not help
2606 type mismatches, simplify.
2607 (YYPRINT, yyprint): New.
2608 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2609 (skel_error): this.
2610 Handle locations.
2611 * src/scan-skel.l: Adjust to these changes.
2612 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2613 (LOCATION_PRINT, skel_control_t): New.
2614
24fad99e
AD
26152001-12-30 Akim Demaille <akim@epita.fr>
2616
2617 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2618 replace `gb' with BLANKS.
2619 * src/scan-skel.l: Adjust.
2620
a4b36db4
AD
26212001-12-30 Akim Demaille <akim@epita.fr>
2622
2623 * src/system.h: We don't need nor want bcopy.
2624 Throw away MS-DOS crap: we don't need getpid.
2625 * configure.in: We don't need strndup. It was even causing
2626 problems: because Flex includes the headers *before* us,
2627 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2628 not visible.
2629 * lib/xstrndup.c: New.
2630 * src/scan-skel.l: Use it.
2631 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2632 * src/parse-skel.y: Use %directives instead of #defines.
2633
1239777d
AD
26342001-12-30 Akim Demaille <akim@epita.fr>
2635
2636 * src/skeleton.h: New.
2637 * src/output.c (output_parser, output_master_parser): Remove, dead
2638 code.
2639 * src/output.h (get_lines_number, actions_output, guards_output)
2640 (token_definitions_output): Prototype them.
2641 * src/parse-skel.y: Add the license notice.
2642 Include output.h and skeleton.h.
2643 (process_skeleton): Returns void, and takes a single parameter.
2644 * src/scan-skel.l: Add the license notice.
2645 Include skeleton.h.
2646 Don't use %option yylineno: it seems that then Flex imagines
2647 REJECT has been used, and therefore it won't reallocate its
2648 buffers (which makes no other sense to me than a bug). It results
2649 in warnings for `unused: yy_flex_realloc'.
2650
9b3add5b
RA
26512001-12-30 Robert Anisko <robert.anisko@epita.fr>
2652
2653 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2654 (MUSCLE_INSERT_PREFIX): ...to there.
2655 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2656 (MUSCLE_INSERT_PREFIX): Move from here...
2657
2658 * src/bison.hairy: Add a section directive. Put braces around muscle
2659 names. This parser skeleton is still broken, but Bison should not
2660 choke on a bad muscle 'syntax'.
2661 * src/bison.simple: Add a section directive. Put braces around muscle
2662 names.
2663
2664 * src/files.h (strsuffix, stringappend): Add declarations.
2665 (tab_extension): Add declaration.
2666 (short_base_name): Add declaration.
2667
2668 * src/files.c (strsuffix, stringappend): No longer static. These
2669 functions are used in the skeleton parser.
2670 (tab_extension): New.
2671 (compute_base_names): Use the computations done in this function
fab5b110 2672 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
2673 names.
2674 (short_base_name): No longer static.
2675
2676 * src/output.c (output_skeleton): New.
2677 (output): Disable call to output_master_parser, and give a try to
2678 a new skeleton handling system.
2679 (guards_output, actions_output): No longer static.
2680 (token_definitions_output, get_lines_number): No longer static.
2681
2682 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2683
fab5b110 2684 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
2685 parse-skel.y.
2686
2687 * src/parse-skel.y: New file.
2688 * src/scan-skel.l: New file.
2689
b5b61c61
AD
26902001-12-29 Akim Demaille <akim@epita.fr>
2691
2692 %name-prefix is broken.
2693
2694 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2695 Adjust all dependencies.
2696 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2697 %name-prefix.
2698
2699 Renaming yylval but not yylloc is not consistent. Now we do.
2700
2701 * src/bison.simple: Prefix yylloc if used.
2702 * doc/bison.texinfo (Decl Summary): Document that.
2703
8c9a50be
AD
27042001-12-29 Akim Demaille <akim@epita.fr>
2705
2706 * doc/bison.texinfo: Promote `%long-directive' over
2707 `%long_directive'.
2708 Remove all references to fixed-output-files, yacc is enough.
2709
d99361e6
AD
27102001-12-29 Akim Demaille <akim@epita.fr>
2711
2712 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2713 user prologue. These are defaults.
2714 * tests/actions.at (Mid-rule actions): Make sure the user can
2715 define YYDEBUG and YYERROR_VERBOSE.
2716
b9cecb91
AD
27172001-12-29 Akim Demaille <akim@epita.fr>
2718
2719 * src/output.c (header_output): Don't forget to export YYLTYPE and
2720 yylloc.
2721 * tests/headers.at (export YYLTYPE): New, make sure it does.
2722 * tests/regression.at (%union and --defines, Invalid CPP headers):
2723 Move to...
2724 * tests/headers.at: here.
2725
aea13e97
AD
27262001-12-29 Akim Demaille <akim@epita.fr>
2727
2728 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2729
931394cb
AD
27302001-12-29 Akim Demaille <akim@epita.fr>
2731
2732 * tests/actions.at (Mid-rule actions): Output on a single line
2733 instead of several.
2734
704a47c4
AD
27352001-12-29 Akim Demaille <akim@epita.fr>
2736
2737 * doc/bison.texinfo: Formatting changes.
2738
091e20bb
AD
27392001-12-29 Akim Demaille <akim@epita.fr>
2740
2741 Don't store the token defs in a muscle, just be ready to output it
2742 on command. Now possible via `symbols'. Fixes a memory leak.
2743
2744 * src/output.c (token_definitions_output): New.
2745 (output_parser, header_output): Use it.
2746 * src/reader.c (symbols_save): Remove.
2747
cce71710
AD
27482001-12-29 Akim Demaille <akim@epita.fr>
2749
2750 * src/bison.simple: Do not provide a default for YYSTYPE and
2751 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2752 default.
2753
82c035a8
AD
27542001-12-29 Akim Demaille <akim@epita.fr>
2755
2756 Mid-rule actions are simply... ignored!
2757
2758 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2759 the empty-rule associated to the dummy symbol, not to the host
2760 rule.
2761 * tests/actions.at (Mid-rule actions): New.
2762
8419d367
AD
27632001-12-29 Akim Demaille <akim@epita.fr>
2764
2765 Memory leak.
2766
2767 * src/reader.c (reader): Free grammar.
2768
375d5806
AD
27692001-12-29 Akim Demaille <akim@epita.fr>
2770
2771 Memory leak.
2772
2773 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2774 since it allocates it for each state, although only one is needed.
2775 (allocate_storage): Do it here.
2776
f51cb8ff
AD
27772001-12-29 Akim Demaille <akim@epita.fr>
2778
2779 * src/options.h, src/options.c (create_long_option_table): Rename
2780 as...
2781 (long_option_table_new): this, with a clearer prototype.
2782 (percent_table): Remove, unused,
2783 * src/getargs.c (getargs): Adjust.
2784
29e88316
AD
27852001-12-29 Akim Demaille <akim@epita.fr>
2786
2787 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2788 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2789 as states.
2790
b9f71f19
AD
27912001-12-29 Akim Demaille <akim@epita.fr>
2792
2793 * src/lalr.c (build_relations): Rename `states' as `states1'.
2794 Sorry, I don't understand exactly what it is, no better name...
2795
1a2b5d37
AD
27962001-12-29 Akim Demaille <akim@epita.fr>
2797
2798 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2799 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2800 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2801 as rules.
2802
1cca533e
AD
28032001-12-29 Akim Demaille <akim@epita.fr>
2804
2805 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2806 ago.
2807
c03ae966
AD
28082001-12-29 Akim Demaille <akim@epita.fr>
2809
2810 * src/reader.c, src/reader.h (user_toknums): Remove.
2811 Adjust all users to use symbols[i]->user_token_number.
2812
5a670b1e
AD
28132001-12-29 Akim Demaille <akim@epita.fr>
2814
2815 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2816 Adjust all users to use symbols[i]->prec or ->assoc.
2817
ad949da9
AD
28182001-12-29 Akim Demaille <akim@epita.fr>
2819
2820 * src/reader.c, src/reader.h (tags): Remove.
2821 Adjust all users to use symbols[i]->tag.
2822
0e78e603
AD
28232001-12-29 Akim Demaille <akim@epita.fr>
2824
2825 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2826 and rule_table.
2827 * src/reader.c (packsymbols): Fill this table.
2828 Drop sprec.
2829 * src/conflicts.c (resolve_sr_conflict): Adjust.
2830 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2831 single table.
2832 Use symbols[i]->tag instead of tags[i].
2833
213e640e
AD
28342001-12-29 Akim Demaille <akim@epita.fr>
2835
2836 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2837 In addition, put a comment in there, to replace...
2838 * tests/regression.at (%union and C comments): Remove.
2839
e7b8bef1
AD
28402001-12-29 Akim Demaille <akim@epita.fr>
2841
2842 * tests/regression.at (Web2c Actions): Blindly move the actual
2843 output as expected output. The contents *seem* right to me, but I
2844 can't pretend reading perfectly parser tables... Nonetheless, all
2845 the other tests pass correctly, the table look OK, even though the
2846 presence of `$axiom' is to be noted: AFAICS it is useless (but
2847 harmless).
2848
b68e7744
AD
28492001-12-29 Akim Demaille <akim@epita.fr>
2850
2851 * src/reader.c (readgram): Don't add the rule 0 if there were no
2852 rules read. In other words, add it _after_ having performed
2853 grammar sanity checks.
2854 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2855
78d5bae9
AD
28562001-12-29 Akim Demaille <akim@epita.fr>
2857
2858 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2859 visible, and some states have now a different number.
2860
ff442794
AD
28612001-12-29 Akim Demaille <akim@epita.fr>
2862
2863 * src/reader.c (readgram): Bind the initial rule's lineno to that
2864 of the first rule.
2865 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2866 (Solved SR Conflicts): Adjust rule 0's line number.
2867
610ab194
AD
28682001-12-29 Akim Demaille <akim@epita.fr>
2869
2870 Fix the `GAWK Grammar' failure.
2871
2872 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2873 the reductions of the first state which was mistakenly confused
2874 with the final state because precisely final_state was initialized
2875 to 0.
2876 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2877 now noticed by Bison.
2878 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2879 have a reduction on $default.
2880
29d29c8f
AD
28812001-12-29 Akim Demaille <akim@epita.fr>
2882
2883 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2884 rule line numbers.
2885 * src/closure.c (print_closure): Likewise.
2886 * src/derives.c (print_derives): Likewise.
2887 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2888 now.
2889
7c6b64d0
AD
28902001-12-29 Akim Demaille <akim@epita.fr>
2891
2892 * src/lalr.c (lookaheads_print): New.
2893 (lalr): Call it when --trace-flag.
2894 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2895 are dumped.
2896
3d4daee3
AD
28972001-12-29 Akim Demaille <akim@epita.fr>
2898
2899 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2900 when walking through ritem, even via rule->rhs.
2901 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2902 (useful_production, useless_nonterminals): Likewise.
2903 (reduce_grammar_tables): Likewise, plus update nritems.
2904 * src/nullable.c (set_nullable): Likewise.
2905 * src/lalr.c (build_relations): Likewise.
2906 * tests/sets.at (Nullable): Adjust.
2907 Fortunately, now, the $axiom is no longer nullable.
2908
9e7f6bbd
AD
29092001-12-29 Akim Demaille <akim@epita.fr>
2910
2911 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2912 the 0-sentinel.
2913 * src/gram.c (ritem_longest_rhs): Likewise.
2914 * src/reduce.c (nonterminals_reduce): Likewise.
2915 * src/print_graph.c (print_graph): Likewise.
2916 * src/output.c (output_rule_data): Likewise.
2917 * src/nullable.c (set_nullable): Likewise.
2918
255ef638
AD
29192001-12-29 Akim Demaille <akim@epita.fr>
2920
2921 * src/output.c: Comment changes.
2922
0d8a7363
AD
29232001-12-27 Paul Eggert <eggert@twinsun.com>
2924
2925 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2926 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2927 Sparc, as they were causing more porting problems than the
2928 (minor) performance improvement was worth.
2929
2930 Also, catch up with 1.31's YYSTD.
2931
3db472b9
AD
29322001-12-27 Akim Demaille <akim@epita.fr>
2933
2934 * src/output.c (output_gram): Rely on nritems, not the
2935 0-sentinel. See below.
2936 Use -1 as separator, not 0.
2937 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2938 Rely on -1 as separator in yyrhs, instead of 0.
2939 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2940 twice `Now at end of input', therefore there are two lines less to
2941 expect.
2942
b365aa05
AD
29432001-12-27 Akim Demaille <akim@epita.fr>
2944
2945 * tests/regression.at (Unresolved SR Conflicts):
2946 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2947 below.
2948
30171f79
AD
29492001-12-27 Akim Demaille <akim@epita.fr>
2950
2951 * src/LR0.c (new_state): Recognize the final state by the fact it
2952 is reached by eoftoken.
2953 (insert_start_shifting_state, insert_eof_shifting_state)
2954 (insert_accepting_state, augment_automaton): Remove, since now
2955 these states are automatically computed from the initial state.
2956 (generate_states): Adjust.
2957 * src/print.c: When reporting a rule number to the user, substract
2958 1, so that the axiom rule is rule 0, and the first user rule is 1.
2959 * src/reduce.c: Likewise.
2960 * src/print_graph.c (print_core): For the time being, just as for
2961 the report, depend upon --trace-flags to dump the full set of
2962 items.
2963 * src/reader.c (readgram): Once the grammar read, insert the rule
2964 0: `$axiom: START-SYMBOL $'.
2965 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2966 number of the states has changed (the final state is no longer
2967 necessarily the last), catch up.
2968
75142d45
AD
29692001-12-27 Akim Demaille <akim@epita.fr>
2970
2971 Try to make the use of the eoftoken valid. Given that its value
2972 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2973 is used instead of > 0 where appropriate, (ii), depend upon nritems
2974 instead of the 0-sentinel.
2975
2976 * src/gram.h, src/gram.c (nritems): New.
2977 Expected to be duplication of nitems, but for the time being...
2978 * src/reader.c (packgram): Assert nritems and nitems are equal.
2979 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2980 * src/closure.c (print_closure, print_fderives): Likewise.
2981 * src/gram.c (ritem_print): Likewise.
2982 * src/print.c (print_core, print_grammar): Likewise.
2983 * src/print_graph.c: Likewise.
2984
b7c49edf
AD
29852001-12-27 Akim Demaille <akim@epita.fr>
2986
2987 * src/main.c (main): If there are complains after grammar
2988 reductions, then output the report anyway if requested, then die.
2989 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2990 * src/reader.c (eoftoken): New.
2991 (parse_token_decl): If the token being defined has value `0', it
2992 is the eoftoken.
2993 (packsymbols): No longer hack `tags' to insert `$' by hand.
2994 Be sure to preserve the value of the eoftoken.
2995 (reader): Make sure eoftoken is defined.
2996 Initialize nsyms to 0: now eoftoken is created just like the others.
2997 * src/print.c (print_grammar): Don't special case the eof token.
2998 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2999 lie anyway, albeit pleasant.
3000 * tests/calc.at: Exercise error messages with eoftoken.
3001 Change the grammar so that empty input is invalid.
3002 Adjust expectations.
3003 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
3004
ec2da99f
AD
30052001-12-27 Akim Demaille <akim@epita.fr>
3006
3007 * configure.in: Check the protos of strchr ans strspn.
3008 Replace strchr if needed.
3009 * src/system.h: Provide the protos of strchr, strspn and memchr if
3010 missing.
3011 * lib/strchr.c: New.
3012 * src/reader.c (symbols_save): Use strchr.
3013
8adfa272
AD
30142001-12-27 Akim Demaille <akim@epita.fr>
3015
3016 * src/print.c, src/print_graph.c (escape): New.
3017 Use it to quote the TAGS outputs.
3018 * src/print_graph.c (print_state): Now errors are in red, and
3019 reductions in green.
3020 Prefer high to wide: output the state number on a line of its own.
3021
80dac38c
AD
30222001-12-27 Akim Demaille <akim@epita.fr>
3023
3024 * src/state.h, src/state.c (reductions_new): New.
3025 * src/LR0.c (set_state_table): Let all the states have a
3026 `reductions', even if reduced to 0.
3027 (save_reductions): Adjust.
3028 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
3029 * src/print.c (print_reductions, print_actions): Adjust.
3030 * src/output.c (action_row): Adjust.
3031
2cec70b9
AD
30322001-12-27 Akim Demaille <akim@epita.fr>
3033
3034 * src/state.h, src/state.c (errs_new, errs_dup): New.
3035 * src/LR0.c (set_state_table): Let all the states have an errs,
3036 even if reduced to 0.
3037 * src/print.c (print_errs, print_reductions): Adjust.
3038 * src/output.c (output_actions, action_row): Adjust.
3039 * src/conflicts.c (resolve_sr_conflict): Adjust.
3040
13ca549a
AD
30412001-12-27 Akim Demaille <akim@epita.fr>
3042
3043 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
3044
5092aba5
AD
30452001-12-27 Akim Demaille <akim@epita.fr>
3046
3047 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
3048 * src/print.c: here.
3049 (lookaheadset, shiftset): New, used as additional storage by
3050 print_reductions.
3051 (print_results): Adjust.
3052 (print_shifts, print_gotos, print_errs): New, extracted from...
3053 (print_actions): here.
3054 * src/print_graph.c (print_actions): Remove dead code.
3055
11e2beca
AD
30562001-12-27 Akim Demaille <akim@epita.fr>
3057
3058 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
3059 `$n' and `@n'.
3060
dac3c910
AD
30612001-12-27 Akim Demaille <akim@epita.fr>
3062
3063 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
3064 (build_relations): Adjust.
3065
d0b0fefa
AD
30662001-12-27 Akim Demaille <akim@epita.fr>
3067
3068 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
3069 duplication.
3070
adc8c848
AD
30712001-12-27 Akim Demaille <akim@epita.fr>
3072
3073 * src/reader.c (packgram): Catch nitems overflows.
3074
14d293ac
AD
30752001-12-27 Akim Demaille <akim@epita.fr>
3076
3077 * src/files.c, src/files.h (guard_obstack): Remove.
3078 * src/output.c (output): Adjust.
3079 * src/reader.c (parse_braces): New, factoring...
3080 (copy_action, copy_guard): these two which are renamed as...
3081 (parse_action, parse_guard): these.
3082 As a voluntary consequence, using braces around guards is now
3083 mandatory.
3084
f499b062
AD
30852001-12-27 Akim Demaille <akim@epita.fr>
3086
3087 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
3088 * src/reader.c (symbol_list): `guard' and `guard_line' are new
3089 members.
3090 (symbol_list_new): Adjust.
3091 (copy_action): action_line is the first line, not the last.
3092 (copy_guard): Just as for actions, store the `action' only, not
3093 the switch/case/break flesh.
3094 Don't parse the user action that might follow the guard, let...
3095 (readgram): do it, i.e., now, there can be an action after a
3096 guard.
3097 In other words the guard is just explicitly optional.
3098 (packgram): Adjust.
3099 * src/output.c (guards_output): New.
3100 (output_parser): Call it when needed.
3101 (output): Also free the guard and attrs obstacks.
3102 * src/files.c, src/files.h (obstack_save): Remove.
3103 (output_files): Remove.
3104 As a result, if one needs the former `.act' file, using an
3105 appropriate skeleton which requires actions and guards is now
3106 required.
3107 * src/main.c (main): Adjust.
3108 * tests/semantic.at: New.
3109 * tests/regression.at: Use `input.y' as input file name.
3110 Avoid 8+3 problems by requiring input.c when the test needs the
3111 parser.
3112
d945f5cd
AD
31132001-12-27 Akim Demaille <akim@epita.fr>
3114
3115 * src/reader.c (symbol_list_new): Be sure to initialize all the
3116 fields.
3117
d200e455
AD
31182001-12-27 Akim Demaille <akim@epita.fr>
3119
3120 All the hacks using a final pseudo state are now useless.
3121
3122 * src/LR0.c (set_state_table): state_table holds exactly nstates.
3123 * src/lalr.c (nLA): New.
3124 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
3125 instead of lookaheadsp from the pseudo state (nstate + 1).
3126
f9507c28
AD
31272001-12-27 Akim Demaille <akim@epita.fr>
3128
3129 * src/output.c (action_row, token_actions): Use a state_t instead
3130 of a integer, and nlookaheads instead of the following state's
3131 lookaheadsp.
3132
065fbd27
AD
31332001-12-27 Akim Demaille <akim@epita.fr>
3134
3135 * src/conflicts.c (log_resolution, flush_shift)
3136 (resolve_sr_conflict, set_conflicts, solve_conflicts)
3137 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
3138 (conflicts_print, print_reductions): Use a state_t instead of an
3139 integer when referring to a state.
3140 As much as possible, depend upon nlookaheads, instead of the
3141 `lookaheadsp' member of the following state (since lookaheads of
3142 successive states are successive, the difference between state n + 1
3143 and n served as the number of lookaheads for state n).
3144 * src/lalr.c (add_lookback_edge): Likewise.
3145 * src/print.c (print_core, print_actions, print_state)
3146 (print_results): Likewise.
3147 * src/print_graph.c (print_core, print_actions, print_state)
3148 (print_graph): Likewise.
3149 * src/conflicts.h: Adjust.
3150
1b177bd7
AD
31512001-12-27 Akim Demaille <akim@epita.fr>
3152
3153 * src/bison.hairy: Formatting/comment changes.
3154 ANSIfy.
3155 Remove `register' indications.
3156 Add plenty of `static'.
3157
7742ddeb
AD
31582001-12-27 Akim Demaille <akim@epita.fr>
3159
3160 * src/output.c (prepare): Drop the muscle `ntbase' which
3161 duplicates ntokens.
3162 * src/bison.simple: Formatting/comment changes.
3163 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
3164 is an undocumented synonym.
3165
1fa14068
AD
31662001-12-22 Akim Demaille <akim@epita.fr>
3167
3168 * src/output.c (output_table_data): Change the prototype to use
3169 `int' for array ranges: some invocations do pass an int, not a
3170 short.
3171 Reported by Wayne Green.
3172
b9752825
AD
31732001-12-22 Akim Demaille <akim@epita.fr>
3174
3175 Some actions of web2c.y are improperly triggered.
3176 Reported by Mike Castle.
3177
3178 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
3179 * tests/regression.at (Web2c): Rename as...
3180 (Web2c Report): this.
3181 (Web2c Actions): New.
3182
776209d6
AD
31832001-12-22 Akim Demaille <akim@epita.fr>
3184
3185 Reductions in web2c.y are improperly reported.
3186 Reported by Mike Castle.
3187
3188 * src/conflicts.c (print_reductions): Fix.
3189 * tests/regression.at (Web2c): New.
3190
275fc3ad
AD
31912001-12-18 Akim Demaille <akim@epita.fr>
3192
3193 Some host fail on `assert (!"foo")', which expands to
3194 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
3195 Reported by Nelson Beebee.
3196
3197 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
3198 `#define it_succeeded 0' and `assert (it_succeeded)'.
3199
897668ee
MA
32002001-12-17 Marc Autret <autret_m@epita.fr>
3201
3202 * src/bison.simple: Don't hard code the skeleton line and filename.
3203 * src/output.c (output_parser): Rename 'line' as 'output_line'.
3204 New line counter 'skeleton_line' (skeleton-line muscle).
3205
ab3399e0
PE
32062001-12-17 Paul Eggert <eggert@twinsun.com>
3207
3208 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3209 YYDEBUG must be defined to a nonzero value.
3210
3211 * src/bison.simple (yytname): Do not assume that the user defines
3212 YYDEBUG to a properly parenthesized expression.
3213
3877f72b
AD
32142001-12-17 Akim Demaille <akim@epita.fr>
3215
3216 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3217 nlookaheads is a new member.
3218 Adjust all users.
3219 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3220 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3221 state.
776209d6 3222
331dbc1b
AD
32232001-12-17 Akim Demaille <akim@epita.fr>
3224
3225 * src/files.h, src/files.c (open_files, close_files): Remove.
3226 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3227 let...
3228 * src/reader.c (reader): Do it.
776209d6 3229
be750e4c
AD
32302001-12-17 Akim Demaille <akim@epita.fr>
3231
3232 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 3233
709ae8c6
AD
32342001-12-17 Akim Demaille <akim@epita.fr>
3235
3236 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3237 (flush_reduce): New.
3238 (resolve_sr_conflict): Adjust.
776209d6 3239
f87685c3
AD
32402001-12-17 Akim Demaille <akim@epita.fr>
3241
3242 * src/output.c (output_obstack): Be static and rename as...
3243 (format_obstack): this, to avoid any confusion with files.c's
3244 output_obstack.
3245 * src/reader.h (muscle_obstack): Move to...
3246 * src/output.h: here, since it's defined in output.c.
3247
837491d8
AD
32482001-12-17 Akim Demaille <akim@epita.fr>
3249
3250 * src/output.c (action_row, save_column, default_goto)
3251 (sort_actions, matching_state, pack_vector): Better variable
3252 locality.
3253
796d61fb
AD
32542001-12-17 Akim Demaille <akim@epita.fr>
3255
3256 * src/output.c: Various formatting changes.
776209d6 3257
64d15509
AD
32582001-12-17 Akim Demaille <akim@epita.fr>
3259
3260 * src/files.c (output_files): Free the output_obstack.
3261 * src/main.c (main): Call print and print_graph conditionally.
3262 * src/print.c (print): Work unconditionally.
3263 * src/print_graph.c (print_graph): Work unconditionally.
3264 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3265
fbc8ecb7
MA
32662001-12-16 Marc Autret <autret_m@epita.fr>
3267
3268 * src/output.c (actions_output): Fix. When we use %no-lines,
3269 there is one less line per action.
3270
f0440388
MA
32712001-12-16 Marc Autret <autret_m@epita.fr>
3272
3273 * src/bison.simple: Remove a useless #line directive.
3274 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3275 * src/output.c (get_lines_number): New.
776209d6 3276 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
3277 output muscles.
3278 Fix line numbering.
3279 (actions_output): Computes the number of lines taken by actions.
3280 (output_master_parser): Insert new skeleton which is the name of
3281 the output parser file name.
3282
a79986b8
MA
32832001-12-15 Marc Autret <autret_m@epita.fr>
3284
3285 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3286
4ec8e00f
MA
32872001-12-15 Marc Autret <autret_m@epita.fr>
3288
3289 * src/output.c (output_gram): Keep track of the hairy one.
3290
1a4648ff
AD
32912001-12-15 Akim Demaille <akim@epita.fr>
3292
3293 Make `make distcheck' work.
3294
3295 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3296 system.h which uses libgettext.h.
3297
9c2c67e6
AD
32982001-12-15 Akim Demaille <akim@epita.fr>
3299
3300 * src/nullable.c (set_nullable): Useless rules must be skipped,
3301 otherwise, since we range over their symbols, we might look at a
3302 nonterminal which no longer ``exists'', i.e., it is not counted in
3303 `nvars', hence we overflow our arrays.
3304
93ede233
AD
33052001-12-15 Akim Demaille <akim@epita.fr>
3306
3307 The header can also be produced directly, without any obstack!
3308 Yahoo!
3309
3310 * src/files.c, src/files.h (defines_obstack): Remove.
3311 (compute_header_macro): Global.
3312 (defines_obstack_save): Remove.
3313 * src/reader.c (parse_union_decl): No longer output to
3314 defines_obstack: its content can be found in the `stype' muscle
3315 anyway.
3316 (output_token_translations): Merge into...
3317 (symbols_output): this.
3318 Rename as...
3319 (symbols_save): this.
3320 (reader): Adjust.
3321 * src/output.c (header_output): New.
3322 (output): Call it.
3323
2666f928
AD
33242001-12-15 Akim Demaille <akim@epita.fr>
3325
3326 * src/reader.c (parse_union_decl): Instead of handling two obstack
3327 simultaneously, use one to define the `stype' muscle, and use the
3328 value of the latter to fill defines_obstack.
3329 (copy_comment): Remove.
3330 (copy_comment2): Work for a single obstack.
3331 Rename as...
3332 (copy_comment): this.
3333
428046f8
AD
33342001-12-15 Akim Demaille <akim@epita.fr>
3335
3336 * src/lex.c, src/lex.h (xgetc): No longer static.
3337 * src/reader.c (parse_union_decl): Revamp.
3338
ea52d706
AD
33392001-12-15 Akim Demaille <akim@epita.fr>
3340
3341 Still making progress in separating Bison into (i) input, (ii)
3342 process, (iii) output: now we can directly output the parser file
3343 without using table_obstack at all.
3344
3345 * src/files.c, src/files.h (table_obstack): Bye bye.
3346 (parser_file_name): New.
3347 * src/files.c (compute_output_file_names): Compute it.
3348 * src/output.c (actions_output, output_parser)
3349 (output_master_parser): To a file instead of an obstack.
3350
3f96f4dc
AD
33512001-12-15 Akim Demaille <akim@epita.fr>
3352
3353 Attach actions to rules, instead of pre-outputting them to
3354 actions_obstack.
3355
3356 * src/gram.h (rule_t): action and action_line are new members.
3357 * src/reader.c (symbol_list): Likewise.
3358 (copy_action): Save the actions within the rule.
3359 (packgram): Save them in rule_table.
3360 * src/output.c (actions_output): New.
3361 (output_parser): Use it on `%%actions'.
3362 (output_rule_data): Don't free rule_table.
3363 (output): Do it.
3364 (prepare): Don't save the `action' muscle.
3365 * src/bison.simple: s/%%action/%%actions/.
3366
51576fb3
AD
33672001-12-15 Akim Demaille <akim@epita.fr>
3368
3369 * src/reader.c (copy_action): When --yacc, don't append a `;'
3370 to the user action: let it fail if lacking.
dee049eb 3371 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 3372
2648a72d
AD
33732001-12-14 Akim Demaille <akim@epita.fr>
3374
3375 * src/lex.c (literalchar): Simply return the char you decoded, non
3376 longer mess around with obstacks and int pointers.
3377 Adjust all callers.
3378
92790e5b
AD
33792001-12-14 Akim Demaille <akim@epita.fr>
3380
3381 * src/lex.c (literalchar): Don't escape the special characters,
3382 just decode them, and keep them as char (before, eol was output as
3383 the 2 char string `\n' etc.).
3384 * src/output.c (output_rule_data): Use quotearg to output the
3385 token strings.
3386
927c1557
PE
33872001-12-13 Paul Eggert <eggert@twinsun.com>
3388
3389 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3390 Do not infringe on the global user namespace when using C++.
3391 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3392 All uses of `fprintf' and `stderr' changed.
3393
3394 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3395
ed8e1f68
AD
33962001-12-13 Akim Demaille <akim@epita.fr>
3397
3398 The computation of nullable is broken: it doesn't handle empty
3399 RHS's properly.
3400
3401 * tests/torture.at (GNU AWK Grammar): New.
3402 * tests/sets.at (Nullable): New.
3403 * src/nullable.c (set_nullable): Instead of blindly looping over
3404 `ritems', loop over the rules, and then over their rhs's.
3405
3406 Work around Autotest bugs.
3407
3408 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3409 frame, because Autotest understand lines starting with a `+' as
3410 traces from the shell. Then, they are not processed properly.
3411 Admittedly an Autotest bug, but we don't have time to wait for
3412 Autotest to catch up.
3413 * tests/regression.at (Broken Closure): Adjust to the new table
3414 frames.
3415 Move to...
3416 * tests/sets.at: here.
3417
cb581495
AD
34182001-12-13 Akim Demaille <akim@epita.fr>
3419
3420 * src/closure.c (closure): Use nrules instead of playing tricks
3421 with BITS_PER_WORD.
3422
2e729273
AD
34232001-12-13 Akim Demaille <akim@epita.fr>
3424
3425 * src/print.c (print_actions): Output the handling of `$' as the
3426 traces do: shifting the token EOF. Before EOF was treated as a
3427 nonterminal.
3428 * tests/regression.at: Adjust some tests.
3429 * src/print_graph.c (print_core): Complete the set of items via
3430 closure. The next-to-final and final states are still unsatisfying,
3431 but that's to be addressed elsewhere.
3432 No longer output the rule numbers, but do output the state number.
3433 A single loop for the shifts + gotos is enough, but picked a
3434 distinct color for each.
3435 (print_graph): Initialize and finalize closure.
3436
107f7dfb
AD
34372001-12-13 Akim Demaille <akim@epita.fr>
3438
3439 * src/reader.c (readgram): Remove dead code, an strip useless
3440 braces.
3441 (get_type): Remove, unused.
3442
9b53a24f
AD
34432001-12-12 Akim Demaille <akim@epita.fr>
3444
3445 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3446 on that of lib/error.c.
3447
dbfb6dcd
AD
34482001-12-12 Akim Demaille <akim@epita.fr>
3449
3450 Some hosts don't like `/' in includes.
3451
3452 * src/system.h: Include libgettext.h without qualifying the path.
3453 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3454 $(top_srcdir).
3455
c25fb648
MA
34562001-12-11 Marc Autret <autret_m@epita.fr>
3457
3458 * src/output.c (output_parser): Remove useless muscle.
3459
710ddc4f
MA
34602001-12-11 Marc Autret <autret_m@epita.fr>
3461
3462 * src/bison.simple: Remove #line just before %%epilogue. It
3463 is now handled in ...
3464 * src/reader.c (read_additionnal_code): Add the output of a
3465 #line for the epilogue.
3466
e83d80b8
MA
34672001-12-10 Marc Autret <autret_m@epita.fr>
3468
927c1557 3469 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
3470 replace precedent remove.
3471 * src/bison.simple: Remove #line before %%prologue because
3472 %%input-line is wrong at this time.
3473
971d5158
MA
34742001-12-10 Marc Autret <autret_m@epita.fr>
3475
3476 * src/reader.c (symbols_output): Clean up.
927c1557 3477 * src/output.c (output_gram, output): Clean up.
971d5158 3478
5edafffd
AD
34792001-12-10 Akim Demaille <akim@epita.fr>
3480
3481 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3482 * src/LR0.c (set_state_table): here.
3483 * src/lalr.c (lalr): Call it.
3484
0279f8e9
AD
34852001-12-10 Akim Demaille <akim@epita.fr>
3486
3487 * src/state.h (shifts): Remove the `number' member: shifts are
3488 attached to state, hence no longer need to be labelled with a
3489 state number.
3490
190c4f5f
AD
34912001-12-10 Akim Demaille <akim@epita.fr>
3492
3493 Now that states have a complete set of members, the linked list of
3494 shifts is useless: just fill directly the state's shifts member.
3495
3496 * src/state.h (shifts): Remove the `next' member.
3497 * src/LR0.c (first_state, last_state): Remove.
3498 Adjust the callers.
3499 (augment_automaton): Don't look for the shifts that must be added
3500 a shift on EOF: it is those of the state we looked for! But now,
3501 since shifts are attached, it is no longer needed to looking
3502 merely by its id: its number.
3503
2a73b93d
AD
35042001-12-10 Akim Demaille <akim@epita.fr>
3505
3506 * src/LR0.c (augment_automaton): Better variable locality.
3507 Remove an impossible branch: if there is a state corresponding to
3508 the start symbol being shifted, then there is shift for the start
3509 symbol from the initial state.
3510
74392f6a
AD
35112001-12-10 Akim Demaille <akim@epita.fr>
3512
3513 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3514 only when appropriate: when insert_start_shifting_state' is not
3515 invoked.
3516 * tests/regression.at (Rule Line Numbers): Adjust.
3517
37c82725
AD
35182001-12-10 Akim Demaille <akim@epita.fr>
3519
3520 * src/LR0.c (augment_automaton): Now that all states have shifts,
3521 merge the two cases addition shifts to the initial state.
3522
6a164e0c
AD
35232001-12-10 Akim Demaille <akim@epita.fr>
3524
3525 * src/lalr.c (set_state_table): Move to...
3526 * src/LR0.c: here.
3527 * src/lalr.c (lalr): Don't call it...
3528 * src/LR0.c (generate_states): do it.
3529 * src/LR0.h (first_state): Remove, only the table is used.
3530
7215de24
AD
35312001-12-10 Akim Demaille <akim@epita.fr>
3532
3533 * src/LR0.h (first_shift, first_reduction): Remove.
3534 * src/lalr.c: Don't use first_shift: find shifts through the
3535 states.
3536
80e25d4d
AD
35372001-12-10 Akim Demaille <akim@epita.fr>
3538
3539 * src/LR0.c: Attach shifts to states as soon as they are
3540 computed.
3541 * src/lalr.c (set_state_table): Instead of assigning shifts to
3542 state, just assert that the mapping was properly done.
3543
0ab3728b
AD
35442001-12-10 Akim Demaille <akim@epita.fr>
3545
3546 * src/LR0.c (insert_start_shift): Rename as...
3547 (insert_start_shifting_state): this.
3548 (insert_eof_shifting_state, insert_accepting_state): New.
3549 (augment_automaton): Adjust.
3550 Better locality of the variables.
3551 When looking if the start_symbol is shifted from the initial
3552 state, using `while (... symbol != start_symbol ...)' sounds
3553 better than `while (... symbol < start_symbol ...)': If fail
3554 to see how the order between symbols could be relevant!
3555
78af9bbc
AD
35562001-12-10 Akim Demaille <akim@epita.fr>
3557
3558 * src/getargs.h: Don't declare `spec_name_prefix' and
3559 `spec_file_prefix', declared by src/files.h.
3560 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3561 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3562 * src/output.c (prepare): Adjust.
3563 * src/reader.c (symbols_output): Likewise.
3564 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3565
bdef2a41
AD
35662001-12-10 Akim Demaille <akim@epita.fr>
3567
3568 * src/muscle_tab.c (muscle_init): NULL is a better default than
3569 `"0"'.
3570
3735969c
AD
35712001-12-10 Akim Demaille <akim@epita.fr>
3572
3573 * src/reader.c (reader): Calling symbols_output once is enough.
3574
49701457
AD
35752001-12-10 Akim Demaille <akim@epita.fr>
3576
3577 Now that states have a complete set of members, the linked list of
3578 reductions is useless: just fill directly the state's reductions
3579 member.
3580
3581 * src/state.h (struct reductions): Remove member `number' and
3582 `next'.
3583 * src/LR0.c (first_reduction, last_reduction): Remove.
3584 (save_reductions): Don't link the new reductions, store them in
3585 this_state.
3586 * src/lalr.c (set_state_table): No need to attach reductions to
3587 states, it's already done.
3588 * src/output.c (output_actions): No longer free the shifts, then
3589 the reductions, then the states: free all the states and their
3590 members.
3591
0edad749
AD
35922001-12-10 Akim Demaille <akim@epita.fr>
3593
3594 * src/options.c (OPTN, DRTV, BOTH): New.
3595 (option_table): Use them.
3596
0edad749
AD
3597 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3598 the job of system.h.
3599 * src/options.c: Don't include stdio.h and xalloc.h for the same
3600 reasons.
3601
5449dd0f
AD
36022001-12-10 Akim Demaille <akim@epita.fr>
3603
3604 * src/output.c (output, prepare): Make sure the values of the
3605 muscles `action' and `prologue' are 0-terminated.
3606
a870c567
AD
36072001-12-10 Akim Demaille <akim@epita.fr>
3608
3609 Clean up GCC warnings.
3610
3611 * src/reader.c (copy_action): `buf' is not used.
3612 (parse_skel_decl): Be static.
3613 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3614 * src/options.h (create_long_option_table): Have a real prototype.
3615 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3616 (hash_delete_at): Return const void *.
3617 Adjust casts to preserve the const.
3618
80df8768
AD
36192001-12-10 Akim Demaille <akim@epita.fr>
3620
3621 * configure.in: Require 2.52g.
3622 M4 is not needed, but AUTOM4TE is.
3623 * m4/m4.m4: Remove.
3624 * tests/Makefile.am: Adjust.
3625
f693ad14
AD
36262001-12-10 Akim Demaille <akim@epita.fr>
3627
3628 One structure for states is enough, even though theoretically
3629 there are LR(0) states and LALR(1) states.
3630
3631 * src/lalr.h (state_t): Remove.
3632 (state_table): Be state_t **, not state_t *.
3633 * src/state.h (core, CORE_ALLOC): Rename as...
3634 (state_t, STATE_ALLOC): this.
3635 Add the LALR(1) members: shifts, reductions, errs.
3636 * src/LR0.c (state_table): Rename as...
3637 (state_hash): this, to avoid name clashes with the global
3638 `state_table'.
3639 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3640 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3641
74ffbcb6
AD
36422001-12-10 Akim Demaille <akim@epita.fr>
3643
3644 Bison dumps core on bash.y.
3645 Reported by Pascal Bart.
3646
3647 * src/warshall.c (bitmatrix_print): New.
3648 (TC): Use it.
3649 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3650 j must be the outer loop.
3651 * tests/regression.at (Broken Closure): New.
3652
07708e19
AD
36532001-12-05 Akim Demaille <akim@epita.fr>
3654
3655 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3656 its argument.
3657