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