]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* data/yacc.c: Output the copyright notive in the header.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-07-09 Akim Demaille <akim@epita.fr>
2
3 * data/yacc.c: Output the copyright notive in the header.
4
52002-07-03 Akim Demaille <akim@epita.fr>
6
7 * src/output.c (froms, tos): Are state_number_t.
8 (save_column): sp, sp1, and sp2 are state_number_t.
9 (prepare): Rename `final' as `final_state_number', `nnts' as
10 `nterms_number', `nrules' as `rules_number', `nstates' as
11 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12 unused.
13 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14 * data/lalr1.cc (nsym_): Remove, unused.
15
162002-07-03 Akim Demaille <akim@epita.fr>
17
18 * src/lalr.h, src/lalr.c (goto_number_t): New.
19 * src/lalr.c (goto_list_t): New.
20 Propagate them.
21 * src/nullable.c (rule_list_t): New.
22 Propagate.
23 * src/types.h: Remove.
24
252002-07-03 Akim Demaille <akim@epita.fr>
26
27 * src/closure.c (print_fderives): Use rule_rhs_print.
28 * src/derives.c (print_derives): Use rule_rhs_print.
29 (rule_list_t): New, replaces `shorts'.
30 (set_derives): Add comments.
31 * tests/sets.at (Nullable, Firsts): Adjust.
32
332002-07-03 Akim Demaille <akim@epita.fr>
34
35 * src/output.c (prepare_actions): Free `tally' and `width'.
36 (prepare_actions): Allocate and free `order'.
37 * src/symtab.c (symbols_free): Free `symbols'.
38 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
39 * src/output.c (m4_invoke): Move to...
40 * src/scan-skel.l: here.
41 (<<EOF>>): Close yyout, and free its name.
42
432002-07-03 Akim Demaille <akim@epita.fr>
44
45 Fix some memory leaks, and fix a bug: state 0 was examined twice.
46
47 * src/LR0.c (new_state): Merge into...
48 (state_list_append): this.
49 (new_states): Merge into...
50 (generate_states): here.
51 (set_states): Don't ensure a proper `errs' state member here, do it...
52 * src/conflicts.c (conflicts_solve): here.
53 * src/state.h, src/state.c: Comment changes.
54 (state_t): Rename member `shifts' as `transitions'.
55 Adjust all dependencies.
56 (errs_new): For consistency, also take the values as argument.
57 (errs_dup): Remove.
58 (state_errs_set): New.
59 (state_reductions_set, state_transitions_set): Assert that no
60 previous value was assigned.
61 (state_free): New.
62 (states_free): Use it.
63 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
64 temporary storage: use `errs' and `nerrs' as elsewhere.
65 (set_conflicts): Allocate and free this `errs'.
66
672002-07-02 Akim Demaille <akim@epita.fr>
68
69 * lib/libiberty.h: New.
70 * lib: Update the bitset implementation from upstream.
71 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
72 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
73 * src/main.c: Adjust bitset stats calls.
74
752002-07-01 Paul Eggert <eggert@twinsun.com>
76
77 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
78 char, so that negative chars don't collide with $.
79
802002-06-30 Akim Demaille <akim@epita.fr>
81
82 Have the GLR tests be `warning' checked, and fix the warnings.
83
84 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
85 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
86 (yyremoveDeletes): `yyi' and `yyj' are size_t.
87 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
88 (yyaddDeferredAction): static.
89 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
90 (yyreportParseError): yyprefix is const.
91 yytokenp is used only when verbose.
92 (yy__GNUC__): Replace with __GNUC__.
93 (yypdumpstack): yyi is size_t.
94 (yypreference): Un-yy local variables and arguments, to avoid
95 clashes with `yyr1'. Anyway, we are not in the user name space.
96 (yytname_size): be an int, as is compared with ints.
97 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
98 Use them.
99 * tests/cxx-gram.at: Use quotation to protect $1.
100 Use AT_COMPILE to enable warnings hunts.
101 Prototype yylex and yyerror.
102 `Use' argc.
103 Include `string.h', not `strings.h'.
104 Produce and prototype stmtMerge only when used.
105 yylex takes a location.
106
1072002-06-30 Akim Demaille <akim@epita.fr>
108
109 We spend a lot of time in quotearg, in particular when --verbose.
110
111 * src/symtab.c (symbol_get): Store a quoted version of the key.
112 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
113 Adjust all callers.
114
1152002-06-30 Akim Demaille <akim@epita.fr>
116
117 * src/state.h (reductions_t): Rename member `nreds' as num.
118 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
119 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
120
1212002-06-30 Akim Demaille <akim@epita.fr>
122
123 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
124 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
125 (shifts_to): Rename as...
126 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
127 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
128 (TRANSITION_IS_DISABLED, transitions_to): these.
129
1302002-06-30 Akim Demaille <akim@epita.fr>
131
132 * src/print.c (print_shifts, print_gotos): Merge into...
133 (print_transitions): this.
134 (print_transitions, print_errs, print_reductions): Align the
135 lookaheads columns.
136 (print_core, print_transitions, print_errs, print_state,
137 print_grammar): Output empty lines separator before, not after.
138 (state_default_rule_compute): Rename as...
139 (state_default_rule): this.
140 * tests/conflicts.at (Defaulted Conflicted Reduction),
141 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
142 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
143
1442002-06-30 Akim Demaille <akim@epita.fr>
145
146 Display items as we display rules.
147
148 * src/gram.h, src/gram.c (rule_lhs_print): New.
149 * src/gram.c (grammar_rules_partial_print): Use it.
150 * src/print.c (print_core): Likewise.
151 * tests/conflicts.at (Defaulted Conflicted Reduction),
152 (Unresolved SR Conflicts): Adjust.
153 (Unresolved SR Conflicts): Adjust and rename as...
154 (Resolved SR Conflicts): this, as was meant.
155 * tests/regression.at (Web2c Report): Adjust.
156
1572002-06-30 Akim Demaille <akim@epita.fr>
158
159 * src/print.c (state_default_rule_compute): New, extracted from...
160 (print_reductions): here.
161 Pessimize, but clarify the code.
162 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
163
1642002-06-30 Akim Demaille <akim@epita.fr>
165
166 * src/output.c (action_row): Let default_rule be always a rule
167 number.
168
1692002-06-30 Akim Demaille <akim@epita.fr>
170
171 * src/closure.c (print_firsts, print_fderives, closure):
172 Use BITSET_EXECUTE.
173 * src/lalr.c (lookaheads_print): Likewise.
174 * src/state.c (state_rule_lookaheads_print): Likewise.
175 * src/print_graph.c (print_core): Likewise.
176 * src/print.c (print_reductions): Likewise.
177 * src/output.c (action_row): Likewise.
178 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
179
1802002-06-30 Akim Demaille <akim@epita.fr>
181
182 * src/print_graph.c: Use report_flag.
183
1842002-06-30 Akim Demaille <akim@epita.fr>
185
186 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
187 to...
188 * src/relation.h, src/relation.c (traverse, relation_digraph)
189 (relation_print, relation_transpose): New.
190
1912002-06-30 Akim Demaille <akim@epita.fr>
192
193 * src/state.h, src/state.c (shifts_to): New.
194 * src/lalr.c (build_relations): Use it.
195
1962002-06-30 Akim Demaille <akim@epita.fr>
197
198 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
199 (item_number_of_rule_number, rule_number_of_item_number): New.
200 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
201 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
202 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
203 Propagate their use.
204 Much remains to be done, in particular wrt `shorts' from types.h.
205
2062002-06-30 Akim Demaille <akim@epita.fr>
207
208 * src/symtab.c (symbol_new): Initialize the `printer' member.
209
2102002-06-30 Akim Demaille <akim@epita.fr>
211
212 * src/LR0.c (save_reductions): Remove, replaced by...
213 * src/state.h, src/state.c (state_reductions_set): New.
214 (reductions, errs): Rename as...
215 (reductions_t, errs_t): these.
216 Adjust all dependencies.
217
2182002-06-30 Akim Demaille <akim@epita.fr>
219
220 * src/LR0.c (state_list_t, state_list_append): New.
221 (first_state, last_state): Now symbol_list_t.
222 (this_state): Remove.
223 (new_itemsets, append_states, save_reductions): Take a state_t as
224 argument.
225 (set_states, generate_states): Adjust.
226 (save_shifts): Remove, replaced by...
227 * src/state.h, src/state.c (state_shifts_set): New.
228 (shifts): Rename as...
229 (shifts_t): this.
230 Adjust all dependencies.
231 * src/state.h (state_t): Remove the `next' member.
232
2332002-06-30 Akim Demaille <akim@epita.fr>
234
235 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
236 escaped in slot 0.
237
2382002-06-30 Akim Demaille <akim@epita.fr>
239
240 Use hash.h for the state hash table.
241
242 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
243 (allocate_storage): Use state_hash_new.
244 (free_storage): Use state_hash_free.
245 (new_state, get_state): Adjust.
246 * src/lalr.h, src/lalr.c (states): Move to...
247 * src/states.h (state_t): Remove the `link' member, no longer
248 used.
249 * src/states.h, src/states.c: here.
250 (state_hash_new, state_hash_free, state_hash_lookup)
251 (state_hash_insert, states_free): New.
252 * src/states.c (state_table, state_compare, state_hash): New.
253 * src/output.c (output_actions): Do not free states now, since we
254 still need to know the final_state number in `prepare', called
255 afterwards. Do it...
256 * src/main.c (main): here: call states_free after `output'.
257
2582002-06-30 Akim Demaille <akim@epita.fr>
259
260 * src/state.h, src/state.c (state_new): New, extracted from...
261 * src/LR0.c (new_state): here.
262 * src/state.h (STATE_ALLOC): Move to...
263 * src/state.c: here.
264 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
265 * src/state.h, src/state.c: here.
266
2672002-06-30 Akim Demaille <akim@epita.fr>
268
269 * src/reader.c (gensym): Rename as...
270 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
271 (getsym): Rename as...
272 (symbol_get): this.
273
2742002-06-30 Akim Demaille <akim@epita.fr>
275
276 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
277 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
278 * src/output.c, src/print.c, src/print_graph.c: Propagate.
279 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
280
2812002-06-30 Akim Demaille <akim@epita.fr>
282
283 Make the test suite pass with warnings checked.
284
285 * tests/actions.at (Printers and Destructors): Improve.
286 Avoid unsigned vs. signed issues.
287 * tests/calc.at: Don't exercise the scanner here, do it...
288 * tests/input.at (Torturing the Scanner): here.
289
2902002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
291
292 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
293 reorganize first lines parallel to yacc.c.
294
2952002-06-28 Akim Demaille <akim@epita.fr>
296
297 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
298 (b4_token_enum, b4_token_defines): New, factored from...
299 * data/lalr1.cc, data/yacc.c, glr.c: here.
300
3012002-06-28 Akim Demaille <akim@epita.fr>
302
303 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
304 unused variables.
305 * src/output.c (merger_output): static.
306
3072002-06-28 Akim Demaille <akim@epita.fr>
308
309 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
310 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
311 pacify GCC.
312 * src/output.c (save_row): Initialize all the variables to pacify GCC.
313
3142002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
315
316 Accumulated changelog for new GLR parsing features.
317
318 * src/conflicts.c (count_total_conflicts): Change name to
319 conflicts_total_count.
320 * src/conflicts.h: Ditto.
321 * src/output.c (token_actions): Use the new name.
322 (output_conflicts): Change conflp => conflict_list_heads, and
323 confl => conflict_list for better readability.
324 * data/glr.c: Use the new names.
325 * NEWS: Add self to GLR announcement.
326
327 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
328
329 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
330 Akim Demaille.
331
332 * data/bison.glr: Change name to glr.c
333 * data/glr.c: Renamed from bison.glr.
334 * data/Makefile.am: Add glr.c
335
336 * src/getargs.c:
337
338 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
339 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
340
341 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
342
343 * data/bison.glr: Be sure to restore the
344 current #line when returning to the skeleton contents after having
345 exposed the input file's #line.
346
347 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
348
349 * data/bison.glr: Bring up to date with changes to bison.simple.
350
351 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
352
353 * data/bison.glr: Correct definitions that use b4_prefix.
354 Various reformatting.
355 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
356 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
357 yytokenp argument; now part of stack.
358 (yychar): Define to behave as documented.
359 (yyclearin): Ditto.
360
361 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
362
363 * src/reader.h: Add declaration for free_merger_functions.
364
365 * src/reader.c (merge_functions): New variable.
366 (get_merge_function): New function.
367 (free_merger_functions): New function.
368 (readgram): Check for %prec that is not followed by a symbol.
369 Handle %dprec and %merge declarations.
370 (packgram): Initialize dprec and merger fields in rules array.
371
372 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
373 conflict_list_cnt, conflict_list_free): New variables.
374 (table_grow): Also grow conflict_table.
375 (prepare_rules): Output dprec and merger tables.
376 (conflict_row): New function.
377 (action_row): Output conflict lists for GLR parser. Don't use
378 default reduction in conflicted states for GLR parser so that there
379 are spaces for the conflict lists.
380 (save_row): Also save conflict information.
381 (token_actions): Allocate conflict list.
382 (merger_output): New function.
383 (pack_vector): Pack conflict table, too.
384 (output_conflicts): New function to output yyconflp and yyconfl.
385 (output_check): Allocate conflict_tos.
386 (output_actions): Output conflict tables, also.
387 (output_skeleton): Output b4_mergers definition.
388 (prepare): Output b4_max_rhs_length definition.
389 Use 'bison.glr' as default skeleton for GLR parsers.
390
391 * src/gram.c (glr_parser): New flag.
392 (grammar_free): Call free_merger_functions.
393
394 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
395 all pairs of conflicting reductions, rather than just all tokens
396 causing conflicts. Needed to size conflict tables.
397 (conflicts_output): Modify call to count_rr_conflicts for new
398 interface.
399 (conflicts_print): Ditto.
400 (count_total_conflicts): New function.
401
402 * src/reader.h (merger_list): New type.
403 (merge_functions): New variable.
404
405 * src/lex.h (tok_dprec, tok_merge): New token types.
406
407 * src/gram.h (rule_s): Add dprec and merger fields.
408 (glr_parser): New flag.
409
410 * src/conflicts.h (count_total_conflicts): New function.
411
412 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
413
414 * doc/bison.texinfo (Generalized LR Parsing): New section.
415 (GLR Parsers): New section.
416 (Language and Grammar): Mention GLR parsing.
417 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
418 Correct typo ("tge" -> "the").
419
420 * data/bison.glr: New skeleton for GLR parsing.
421
422 * tests/cxx-gram.at: New tests for GLR parsing.
423
424 * tests/testsuite.at: Include cxx-gram.at.
425
426 * tests/Makefile.am: Add cxx-gram.at.
427
428 * src/parse-gram.y:
429
430 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
431
432 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
433
4342002-06-27 Akim Demaille <akim@epita.fr>
435
436 * src/options.h, src/options.c: Remove.
437 * src/getargs.c (short_options, long_options): New.
438
4392002-06-27 Akim Demaille <akim@epita.fr>
440
441 * data/bison.simple, data/bison.c++: Rename as...
442 * data/yacc.c, data/lalr1.cc: these.
443 * doc/bison.texinfo (Environment Variables): Remove.
444
4452002-06-25 Raja R Harinath <harinath@cs.umn.edu>
446
447 * src/getargs.c (report_argmatch): Initialize strtok().
448
4492002-06-20 Akim Demaille <akim@epita.fr>
450
451 * data/bison.simple (b4_symbol_actions): New, replaces...
452 (b4_symbol_destructor, b4_symbol_printer): these.
453 (yysymprint): Be sure to call YYPRINT only for tokens, and using
454 user token numbers.
455
4562002-06-20 Akim Demaille <akim@epita.fr>
457
458 * data/bison.simple (yydestructor): Rename as...
459 (yydestruct): this.
460
4612002-06-20 Akim Demaille <akim@epita.fr>
462
463 * src/symtab.h, src/symtab.c (symbol_type_set)
464 (symbol_destructor_set, symbol_precedence_set): The location is
465 the last argument.
466 Adjust all callers.
467
4682002-06-20 Akim Demaille <akim@epita.fr>
469
470 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
471 internals.
472 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
473 Takes a location.
474 * src/symtab.h, src/symtab.c (symbol_class_set)
475 (symbol_user_token_number_set): Likewise.
476 Adjust all callers.
477 Promote complain_at.
478 * tests/input.at (Type Clashes): Adjust.
479
4802002-06-20 Akim Demaille <akim@epita.fr>
481
482 * data/bison.simple (YYLEX): Fix the declaration when
483 %pure-parser.
484
4852002-06-20 Akim Demaille <akim@epita.fr>
486
487 * data/bison.simple (yysymprint): Don't print the token number,
488 just its name.
489 * tests/actions.at (Destructors): Rename as...
490 (Printers and Destructors): this.
491 Also exercise %printer.
492
4932002-06-20 Akim Demaille <akim@epita.fr>
494
495 * data/bison.simple (YYDSYMPRINT): New.
496 Use it to remove many of the #if YYDEBUG/if (yydebug).
497
4982002-06-20 Akim Demaille <akim@epita.fr>
499
500 * src/symtab.h, src/symtab.c (symbol_t): printer and
501 printer_location are new members.
502 (symbol_printer_set): New.
503 * src/parse-gram.y (PERCENT_PRINTER): New token.
504 Handle its associated rule.
505 * src/scan-gram.l: Adjust.
506 (handle_destructor_at, handle_destructor_dollar): Rename as...
507 (handle_symbol_code_at, handle_symbol_code_dollar): these.
508 * src/output.c (symbol_printers_output): New.
509 (output_skeleton): Call it.
510 * data/bison.simple (yysymprint): New. Cannot be named yyprint
511 since there are already many grammar files with a user `yyprint'.
512 Replace the calls to YYPRINT to calls to yysymprint.
513 * tests/calc.at: Adjust.
514 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
515 taking advantage of parser very internal details (stack size!).
516
5172002-06-20 Akim Demaille <akim@epita.fr>
518
519 * src/scan-gram.l: Complete the scanner with the missing patterns
520 to pacify Flex.
521 Use `quote' and `symbol_tag_get' where appropriate.
522
5232002-06-19 Akim Demaille <akim@epita.fr>
524
525 * tests/actions.at (Destructors): Augment to test locations.
526 * data/bison.simple (yydestructor): Pass it the current location
527 if locations are enabled.
528 Prototype only when __STDC__ or C++.
529 Change the argument names to move into the yy name space: there is
530 user code here.
531
5322002-06-19 Akim Demaille <akim@epita.fr>
533
534 * data/bison.simple (b4_pure_if): New.
535 Use it instead of #ifdef YYPURE.
536
5372002-06-19 Akim Demaille <akim@epita.fr>
538
539 * data/bison.simple (b4_location_if): New.
540 Use it instead of #ifdef YYLSP_NEEDED.
541
5422002-06-19 Akim Demaille <akim@epita.fr>
543
544 Prepare @$ in %destructor, but currently don't bind it in the
545 skeleton, as %location use is not cleaned up yet.
546
547 * src/scan-gram.l (handle_dollar, handle_destructor_at)
548 (handle_action_at): New.
549 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
550 a braced_code_t and a location as additional arguments.
551 (handle_destructor_dollar): Instead of requiring `b4_eval', just
552 unquote one when outputting `b4_dollar_dollar'.
553 Adjust callers.
554 * data/bison.simple (b4_eval): Remove.
555 (b4_symbol_destructor): Adjust.
556 * tests/input.at (Invalid @n): Adjust.
557
5582002-06-19 Zack Weinberg <zack@codesourcery.com>
559
560 * doc/bison.texinfo: Document ability to have multiple
561 prologue sections.
562
5632002-06-18 Akim Demaille <akim@epita.fr>
564
565 * src/files.c (compute_base_names): When computing the output file
566 names from the input file name, strip the directory part.
567
5682002-06-18 Akim Demaille <akim@epita.fr>
569
570 * data/bison.simple.new: Comment changes.
571 Reported by Andreas Schwab.
572
5732002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
574
575 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
576 there are no `label `yyoverflowlab' defined but not used' warnings
577 when yyoverflow is defined.
578
5792002-06-18 Akim Demaille <akim@epita.fr>
580
581 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
582 new member.
583 (symbol_destructor_set): Adjust.
584 * src/output.c (symbol_destructors_output): Output the destructor
585 locations.
586 Output the symbol name.
587 * data/bison.simple (b4_symbol_destructor): Adjust.
588
5892002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
590 and Akim Demaille <akim@epita.fr>
591
592 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
593 what's left on the stack when the error recovery hits EOF.
594 * tests/actions.at (Destructors): Complete to exercise this case.
595
5962002-06-17 Akim Demaille <akim@epita.fr>
597
598 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
599 arguments is really empty, not only equal to `[]'.
600 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
601 member.
602 (symbol_destructor_set): New.
603 * src/output.c (symbol_destructors_output): New.
604 * src/reader.h (brace_code_t, current_braced_code): New.
605 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
606 (handle_dollar): Rename as...
607 (handle_action_dollar): this.
608 (handle_destructor_dollar): New.
609 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
610 (grammar_declaration): Use it.
611 * data/bison.simple (yystos): Is always defined.
612 (yydestructor): New.
613 * tests/actions.at (Destructors): New.
614 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
615
6162002-06-17 Akim Demaille <akim@epita.fr>
617
618 * src/symlist.h, src/symlist.c (symbol_list_length): New.
619 * src/scan-gram.l (handle_dollar, handle_at): Compute the
620 rule_length only when needed.
621 * src/output.c (actions_output, token_definitions_output): Output
622 the full M4 block.
623 * src/symtab.c: Don't access directly to the symbol tag, use
624 symbol_tag_get.
625 * src/parse-gram.y: Use symbol_list_free.
626
6272002-06-17 Akim Demaille <akim@epita.fr>
628
629 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
630 (symbol_list_prepend, get_type_name): Move to...
631 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
632 (symbol_list_prepend, symbol_list_n_type_name_get): here.
633 Adjust all callers.
634 (symbol_list_free): New.
635 * src/scan-gram.l (handle_dollar): Takes a location.
636 * tests/input.at (Invalid $n): Adjust.
637
6382002-06-17 Akim Demaille <akim@epita.fr>
639
640 * src/reader.h, src/reader.c (symbol_list_new): Export it.
641 (symbol_list_prepend): New.
642 * src/parse-gram.y (%union): `list' is a new member.
643 (symbols.1): New, replaces...
644 (terms_to_prec.1, nterms_to_type.1): these.
645 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
646 Take a location as additional argument.
647 Adjust all callers.
648
6492002-06-15 Akim Demaille <akim@epita.fr>
650
651 * src/parse-gram.y: Move %token in the declaration section so that
652 we don't depend upon CVS Bison.
653
6542002-06-15 Akim Demaille <akim@epita.fr>
655
656 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
657 * src/print.c (print_core): Use it.
658
6592002-06-15 Akim Demaille <akim@epita.fr>
660
661 * src/conflicts.c (log_resolution): Accept the rule involved in
662 the sr conflicts instead of the lookahead number that points to
663 that rule.
664 (flush_reduce): Accept the current lookahead vector as argument,
665 instead of the index in LA.
666 (resolve_sr_conflict): Accept the current number of lookahead
667 bitset to consider for the STATE, instead of the index in LA.
668 (set_conflicts): Adjust.
669 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
670
6712002-06-15 Akim Demaille <akim@epita.fr>
672
673 * src/state.h (state_t): Replace the `lookaheadsp' member, a
674 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
675 Adjust all dependencies.
676 * src/lalr.c (initialize_lookaheads): Split into...
677 (states_lookaheads_count, states_lookaheads_initialize): these.
678 (lalr): Adjust.
679
6802002-06-15 Akim Demaille <akim@epita.fr>
681
682 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
683 out of...
684 (grammar_rules_print): here.
685 * src/reduce.c (reduce_output): Use it.
686 * tests/reduce.at (Useless Rules, Reduced Automaton)
687 (Underivable Rules): Adjust.
688
6892002-06-15 Akim Demaille <akim@epita.fr>
690
691 Copy BYacc's nice way to report the grammar.
692
693 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
694 New.
695 Don't print the rules' location, it is confusing and useless.
696 (rule_print): Use grammar_rhs_print.
697 * src/print.c (print_grammar): Use grammar_rules_print.
698
6992002-06-15 Akim Demaille <akim@epita.fr>
700
701 Complete and rationalize `useless thing' warnings.
702
703 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
704 (symbol_tag_print): New.
705 Use them everywhere in place of accessing directly the tag member.
706 * src/gram.h, src/gram.c (rule_print): New.
707 Use it where a rule used to be printed `by hand'.
708 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
709 (reduce_grammar_tables): Report the useless rules.
710 (reduce_print): Useless things are a warning, not an error.
711 Report it as such.
712 * tests/reduce.at (Useless Nonterminals, Useless Rules):
713 (Reduced Automaton, Underivable Rules): Adjust.
714 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
715 * tests/conflicts.at (Unresolved SR Conflicts)
716 (Solved SR Conflicts): Adjust.
717
7182002-06-15 Akim Demaille <akim@epita.fr>
719
720 Let symbols have a location.
721
722 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
723 (getsym): Adjust.
724 Adjust all callers.
725 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
726 Use location_t, not int.
727 * src/symtab.c (symbol_check_defined): Take advantage of the
728 location.
729 * tests/regression.at (Invalid inputs): Adjust.
730
7312002-06-15 Akim Demaille <akim@epita.fr>
732
733 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
734 (input): Don't try to initialize yylloc here, do it in the
735 scanner.
736 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
737 * src/gram.h (rule_t): Change line and action_line into location
738 and action_location, of location_t type.
739 Adjust all dependencies.
740 * src/location.h, src/location.c (empty_location): New.
741 * src/reader.h, src/reader.c (grammar_start_symbol_set)
742 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
743 (grammar_current_rule_symbol_append)
744 (grammar_current_rule_action_append): Expect a location as argument.
745 * src/reader.c (grammar_midrule_action): Adjust to attach an
746 action's location as dummy symbol location.
747 * src/symtab.h, src/symtab.c (startsymbol_location): New.
748 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
749 the line numbers.
750
7512002-06-14 Akim Demaille <akim@epita.fr>
752
753 Grammar declarations may be found in the grammar section.
754
755 * src/parse-gram.y (rules_or_grammar_declaration): New.
756 (declarations): Each declaration may end with a semicolon, not
757 just...
758 (grammar_declaration): `"%union"'.
759 (grammar): Branch to rules_or_grammar_declaration.
760
7612002-06-14 Akim Demaille <akim@epita.fr>
762
763 * src/main.c (main): Invoke scanner_free.
764
7652002-06-14 Akim Demaille <akim@epita.fr>
766
767 * src/output.c (m4_invoke): Extracted from...
768 (output_skeleton): here.
769 Free tempfile.
770
7712002-06-14 Akim Demaille <akim@epita.fr>
772
773 * src/parse-gram.y (directives, directive, gram)
774 (grammar_directives, precedence_directives, precedence_directive):
775 Rename as...
776 (declarations, declaration, grammar, grammar_declaration)
777 (precedence_declaration, precedence_declarator): these.
778 (symbol_declaration): New.
779
7802002-06-14 Akim Demaille <akim@epita.fr>
781
782 * src/files.c (action_obstack): Remove, unused.
783 (output_obstack): Remove it, and all its dependencies, as it is no
784 longer needed.
785 * src/reader.c (epilogue_set): Build the epilogue in the
786 muscle_obstack.
787 * src/output.h, src/output.c (muscle_obstack): Move to...
788 * src/muscle_tab.h, src/muscle_tab.h: here.
789 (muscle_init): Initialize muscle_obstack.
790 (muscle_free): New.
791 * src/main.c (main): Call it.
792
7932002-06-14 Akim Demaille <akim@epita.fr>
794
795 * src/location.h: New, extracted from...
796 * src/reader.h: here.
797 * src/Makefile.am (noinst_HEADERS): Merge into
798 (bison_SOURCES): this.
799 Add location.h.
800 * src/parse-gram.y: Use location_t instead of Bison's.
801 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
802 Use location_t instead of ints.
803
8042002-06-14 Akim Demaille <akim@epita.fr>
805
806 * data/bison.simple, data/bison.c++: Be sure to restore the
807 current #line when returning to the skeleton contents after having
808 exposed the input file's #line.
809
8102002-06-12 Akim Demaille <akim@epita.fr>
811
812 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
813 eager.
814 * tests/actions.at (Exotic Dollars): New.
815
8162002-06-12 Akim Demaille <akim@epita.fr>
817
818 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
819 ['"/] too eagerly.
820 * tests/input.at (Torturing the Scanner): New.
821
8222002-06-11 Akim Demaille <akim@epita.fr>
823
824 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
825 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
826 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
827 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
828 * src/reader.c (reader): Use it.
829
8302002-06-11 Akim Demaille <akim@epita.fr>
831
832 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
833 Adjust all callers.
834 (scanner_last_string_free): New.
835
8362002-06-11 Akim Demaille <akim@epita.fr>
837
838 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
839 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
840 (last_string, YY_OBS_FREE): New.
841 Use them when returning an ID.
842
8432002-06-11 Akim Demaille <akim@epita.fr>
844
845 Have Bison grammars parsed by a Bison grammar.
846
847 * src/reader.c, src/reader.h (prologue_augment): New.
848 * src/reader.c (copy_definition): Remove.
849
850 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
851 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
852 (grammar_current_rule_prec_set, grammar_current_rule_check)
853 (grammar_current_rule_symbol_append)
854 (grammar_current_rule_action_append): Export.
855 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
856 (symbol_list_action_append): Remove.
857 Hook the routines from reader.
858 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
859 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
860
861 * src/reader.c (read_declarations): Remove, unused.
862
863 * src/parse-gram.y: Handle the epilogue.
864 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
865 (grammar_start_symbol_set): this.
866 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
867 * src/reader.c (readgram): Remove, unused.
868 (reader): Adjust to insert eoftoken and axiom where appropriate.
869
870 * src/reader.c (copy_dollar): Replace with...
871 * src/scan-gram.h (handle_dollar): this.
872 * src/parse-gram.y: Remove `%thong'.
873
874 * src/reader.c (copy_at): Replace with...
875 * src/scan-gram.h (handle_at): this.
876
877 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
878 New.
879
880 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
881 time being.
882
883 * src/reader.h, src/reader.c (grammar_rule_end): New.
884
885 * src/parse.y (current_type, current_class): New.
886 Implement `%nterm', `%token' support.
887 Merge `%term' into `%token'.
888 (string_as_id): New.
889 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
890 type name.
891
892 * src/parse-gram.y: Be sure to handle properly the beginning of
893 rules.
894
895 * src/parse-gram.y: Handle %type.
896 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
897
898 * src/parse-gram.y: More directives support.
899 * src/options.c: No longer handle source directives.
900
901 * src/parse-gram.y: Fix %output.
902
903 * src/parse-gram.y: Handle %union.
904 Use the prologue locations.
905 * src/reader.c (parse_union_decl): Remove.
906
907 * src/reader.h, src/reader.c (epilogue_set): New.
908 * src/parse-gram.y: Use it.
909
910 * data/bison.simple, data/bison.c++: b4_stype is now either not
911 defined, then default to int, or to the contents of %union,
912 without `union' itself.
913 Adjust.
914 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
915
916 * src/output.c (actions_output): Don't output braces, as they are
917 already handled by the scanner.
918
919 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
920 characters to themselves.
921
922 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
923 that the epilogue has a proper #line.
924
925 * src/parse-gram.y: Handle precedence/associativity.
926
927 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
928 a terminal.
929 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
930 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
931 at all to define terminals that cannot be emitted.
932
933 * src/scan-gram.l: Escape M4 characters.
934
935 * src/scan-gram.l: Working properly with escapes in user
936 strings/characters.
937
938 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
939 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
940 grammar.
941 Use more modest sizes, as for the time being the parser does not
942 release memory, and therefore the process swallows a huge amount
943 of memory.
944
945 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
946 stricter %token grammar.
947
948 * src/symtab.h (associativity): Add `undef_assoc'.
949 (symbol_precedence_set): Do nothing when passed an undef_assoc.
950 * src/symtab.c (symbol_check_alias_consistence): Adjust.
951
952 * tests/regression.at (Invalid %directive): Remove, as it is now
953 meaningless.
954 (Invalid inputs): Adjust to the new error messages.
955 (Token definitions): The new grammar doesn't allow too many
956 eccentricities.
957
958 * src/lex.h, src/lex.c: Remove.
959 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
960 (copy_character, copy_string2, copy_string, copy_identifier)
961 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
962 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
963 (parse_action): Remove.
964 * po/POTFILES.in: Adjust.
965
9662002-06-11 Akim Demaille <akim@epita.fr>
967
968 * src/reader.c (parse_action): Don't store directly into the
969 rule's action member: return the action as a string.
970 Don't require `rule_length' as an argument: compute it.
971 (grammar_current_rule_symbol_append)
972 (grammar_current_rule_action_append): New, eved out from
973 (readgram): here.
974 Remove `action_flag', `rulelength', unused now.
975
9762002-06-11 Akim Demaille <akim@epita.fr>
977
978 * src/reader.c (grammar_current_rule_prec_set).
979 (grammar_current_rule_check): New, eved out from...
980 (readgram): here.
981 Remove `xaction', `first_rhs': useless.
982 * tests/input.at (Type clashes): New.
983 * tests/existing.at (GNU Cim Grammar): Adjust.
984
9852002-06-11 Akim Demaille <akim@epita.fr>
986
987 * src/reader.c (grammar_midrule_action): New, Eved out from
988 (readgram): here.
989
9902002-06-11 Akim Demaille <akim@epita.fr>
991
992 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
993 New.
994 (readgram): Use them as replacement of inlined code, crule and
995 crule1.
996
9972002-06-11 Akim Demaille <akim@epita.fr>
998
999 * src/reader.c (grammar_end, grammar_symbol_append): New.
1000 (readgram): Use them.
1001 Make the use of `p' as local as possible.
1002
10032002-06-10 Akim Demaille <akim@epita.fr>
1004
1005 GCJ's parser requires the tokens to be defined before the prologue.
1006
1007 * data/bison.simple: Output the token definition before the user's
1008 prologue.
1009 * tests/regression.at (Braces parsing, Duplicate string)
1010 (Mixing %token styles): Check the output from bison.
1011 (Early token definitions): New.
1012
10132002-06-10 Akim Demaille <akim@epita.fr>
1014
1015 * src/symtab.c (symbol_user_token_number_set): Don't complain when
1016 assigning twice the same user number to a token, so that we can
1017 use it in...
1018 * src/lex.c (lex): here.
1019 Also use `symbol_class_set' instead of hand written code.
1020 * src/reader.c (parse_assoc_decl): Likewise.
1021
10222002-06-10 Akim Demaille <akim@epita.fr>
1023
1024 * src/symtab.c, src/symtab.c (symbol_class_set)
1025 (symbol_user_token_number_set): New.
1026 * src/reader.c (parse_token_decl): Use them.
1027 Use a switch instead of ifs.
1028 Use a single argument.
1029
10302002-06-10 Akim Demaille <akim@epita.fr>
1031
1032 Remove `%thong' support as it is undocumented, unused, duplicates
1033 `%token's job, and creates useless e-mail traffic with people who
1034 want to know what it is, why it is undocumented, unused, and
1035 duplicates `%token's job.
1036
1037 * src/reader.c (parse_thong_decl): Remove.
1038 * src/options.c (option_table): Remove "thong".
1039 * src/lex.h (tok_thong): Remove.
1040
10412002-06-10 Akim Demaille <akim@epita.fr>
1042
1043 * src/symtab.c, src/symtab.c (symbol_type_set)
1044 (symbol_precedence_set): New.
1045 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
1046 (value_components_used): Remove, unused.
1047
10482002-06-09 Akim Demaille <akim@epita.fr>
1049
1050 Move symbols handling code out of the reader.
1051
1052 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
1053 (axiom): Move to...
1054 * src/symtab.h, src/symtab.c: here.
1055
1056 * src/gram.c (start_symbol): Remove: use startsymbol->number.
1057 * src/reader.c (startval): Rename as...
1058 * src/symtab.h, src/symtab.c (startsymbol): this.
1059 * src/reader.c: Adjust.
1060
1061 * src/reader.c (symbol_check_defined, symbol_make_alias)
1062 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1063 (token_translations_init)
1064 Move to...
1065 * src/symtab.c: here.
1066 * src/reader.c (packsymbols): Move to...
1067 * src/symtab.h, src/symtab.c (symbols_pack): here.
1068 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
1069 argument.
1070
10712002-06-03 Akim Demaille <akim@epita.fr>
1072
1073 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
1074 then statements.
1075
10762002-06-03 Akim Demaille <akim@epita.fr>
1077
1078 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1079 structs with non literals.
1080 * src/scan-skel.l: never-interactive.
1081 * src/conflicts.c (enum conflict_resolution_e): No trailing
1082 comma.
1083 * src/getargs.c (usage): Split long literal strings.
1084 Reported by Hans Aberg.
1085
10862002-05-28 Akim Demaille <akim@epita.fr>
1087
1088 * data/bison.c++: Use C++ ostreams.
1089 (cdebug_): New member.
1090
10912002-05-28 Akim Demaille <akim@epita.fr>
1092
1093 * src/output.c (output_skeleton): Be sure to allocate enough room
1094 for `/' _and_ for `\0' in full_skeleton.
1095
10962002-05-28 Akim Demaille <akim@epita.fr>
1097
1098 * data/bison.c++: Catch up with bison.simple:
1099 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1100 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1101 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1102 and popping traces.
1103
11042002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1105
1106 * src/output.c (output_skeleton): Put an explicit path in front of
1107 the skeleton file name, rather than relying on the -I directory,
1108 to partially alleviate effects of having a skeleton file lying around
1109 in the current directory.
1110
11112002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1112
1113 * src/conflicts.c (log_resolution): Correct typo:
1114 obstack_printf should be obstack_fgrow1.
1115
11162002-05-26 Akim Demaille <akim@epita.fr>
1117
1118 * src/state.h (state_t): `solved_conflicts' is a new member.
1119 * src/LR0.c (new_state): Set it to 0.
1120 * src/conflicts.h, src/conflicts.c (print_conflicts)
1121 (free_conflicts, solve_conflicts): Rename as...
1122 (conflicts_print, conflicts_free, conflicts_solve): these.
1123 Adjust callers.
1124 * src/conflicts.c (enum conflict_resolution_e)
1125 (solved_conflicts_obstack): New, used by...
1126 (log_resolution): this.
1127 Adjust to attach the conflict resolution to each state.
1128 Complete the description with the precedence/associativity
1129 information.
1130 (resolve_sr_conflict): Adjust.
1131 * src/print.c (print_state): Output its solved_conflicts.
1132 * tests/conflicts.at (Unresolved SR Conflicts)
1133 (Solved SR Conflicts): Exercise --report=all.
1134
11352002-05-26 Akim Demaille <akim@epita.fr>
1136
1137 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1138 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1139 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1140 (token_number_t, item_number_as_token_number)
1141 (token_number_as_item_number, muscle_insert_token_number_table):
1142 Rename as...
1143 (symbol_number_t, item_number_as_symbol_number)
1144 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1145 these, since it is more appropriate.
1146
11472002-05-26 Akim Demaille <akim@epita.fr>
1148
1149 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1150 `Error:' lines.
1151 * data/bison.simple (yystos) [YYDEBUG]: New.
1152 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1153 error recovery.
1154 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1155
11562002-05-25 Akim Demaille <akim@epita.fr>
1157
1158 * doc/bison.texinfo (Debugging): Split into...
1159 (Tracing): this new section, its former contents, and...
1160 (Understanding): this new section.
1161 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1162 by...
1163 (report_flag): this.
1164 Adjust all dependencies.
1165 (report_args, report_types, report_argmatch): New.
1166 (usage, getargs): Report/support -r, --report.
1167 * src/options.h
1168 (struct option_table_struct): Rename as..,
1169 (struct option_table_s): this.
1170 Rename the `set_flag' member to `flag' to match with getopt_long's
1171 struct.
1172 * src/options.c (option_table): Split verbose into an entry for
1173 %verbose, and another for --verbose.
1174 Support --report/-r, so remove -r from the obsolete --raw.
1175 * src/print.c: Attach full item sets and lookaheads reports to
1176 report_flag instead of trace_flag.
1177 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1178
11792002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1180 and Paul Eggert <eggert@twinsun.com>
1181
1182 * data/bison.simple (yyparse): Correct error handling to conform to
1183 POSIX and yacc. Specifically, after syntax error is discovered,
1184 do not reduce further before shifting the error token.
1185 Clean up the code a bit by removing the labels yyerrdefault,
1186 yyerrhandle, yyerrpop.
1187 * NEWS: Document the above.
1188
11892002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1190
1191 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1192 type; it isn't always big enough, since it doesn't necessarily
1193 include non-terminals.
1194 (yytranslate): Expand definition of yy_token_number_type, so that
1195 the latter can be removed.
1196 (yy_token_number_type): Remove, only one use.
1197 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1198 don't use TokenNumberType as element type.
1199
1200 * tests/regression.at: Modify expected output to agree with change
1201 to yyr1 and yytranslate.
1202
12032002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1204
1205 * src/reader.c (parse_action): Use copy_character instead of
1206 obstack_1grow.
1207
12082002-05-13 Akim Demaille <akim@epita.fr>
1209
1210 * tests/regression.at (Token definitions): Prototype yylex and
1211 yyerror.
1212
12132002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1214
1215 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
1216 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1217 32-bit arithmetic.
1218 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1219
12202002-05-07 Akim Demaille <akim@epita.fr>
1221
1222 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1223 avoid GCC warnings.
1224
12252002-05-07 Akim Demaille <akim@epita.fr>
1226
1227 Kill GCC warnings.
1228
1229 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1230 over the RHS of each rule.
1231 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1232 * src/state.h (state_t): Member `nitems' is unsigned short.
1233 * src/LR0.c (get_state): Adjust.
1234 * src/reader.c (packgram): Likewise.
1235 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1236 `Type'.
1237 (muscle_insert_int_table): Remove, unused.
1238 (prepare_rules): Remove `max'.
1239
12402002-05-06 Akim Demaille <akim@epita.fr>
1241
1242 * src/closure.c (print_firsts): Display of the symbol tags.
1243 (bitmatrix_print): Move to...
1244 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1245 here.
1246 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1247
12482002-05-06 Akim Demaille <akim@epita.fr>
1249
1250 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1251 hash_do_for_each.
1252
12532002-05-06 Akim Demaille <akim@epita.fr>
1254
1255 * src/LR0.c (new_state, get_state): Instead of using the global
1256 `kernel_size' and `kernel_base', have two new arguments:
1257 `core_size' and `core'.
1258 Adjust callers.
1259
12602002-05-06 Akim Demaille <akim@epita.fr>
1261
1262 * src/reader.c (packgram): No longer end `ritem' with a 0
1263 sentinel: it is not used.
1264
12652002-05-05 Akim Demaille <akim@epita.fr>
1266
1267 New experimental feature: display the lookaheads in the report and
1268 graph.
1269
1270 * src/print (print_core): When --trace-flag, display the rules
1271 lookaheads.
1272 * src/print_graph.c (print_core): Likewise.
1273 Swap the arguments.
1274 Adjust caller.
1275
12762002-05-05 Akim Demaille <akim@epita.fr>
1277
1278 * tests/torture.at (Many lookaheads): New test.
1279
12802002-05-05 Akim Demaille <akim@epita.fr>
1281
1282 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1283 (GENERATE_MUSCLE_INSERT_TABLE): this.
1284 (output_int_table, output_unsigned_int_table, output_short_table)
1285 (output_token_number_table, output_item_number_table): Replace with...
1286 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1287 (muscle_insert_short_table, muscle_insert_token_number_table)
1288 (muscle_insert_item_number_table): these.
1289 Adjust all callers.
1290 (prepare_tokens): Don't free `translations', since...
1291 * src/reader.h, src/reader.c (grammar_free): do it.
1292 Move to...
1293 * src/gram.h, src/gram.c (grammar_free): here.
1294 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1295 b4_translate_max.
1296
12972002-05-05 Akim Demaille <akim@epita.fr>
1298
1299 * src/output.c (output_unsigned_int_table): New.
1300 (prepare_rules): `i' is unsigned.
1301 `prhs', `rline', `r2' are unsigned int.
1302 Rename muscle `rhs_number_max' as `rhs_max'.
1303 Output muscles `prhs_max', `rline_max', and `r2_max'.
1304 Free rline and r1.
1305 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1306 to compute types instead of constant types.
1307 * tests/regression.at (Web2c Actions): Adjust.
1308
13092002-05-04 Akim Demaille <akim@epita.fr>
1310
1311 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1312 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1313 Adjust dependencies.
1314 * src/output.c (token_definitions_output): Be sure not to output a
1315 `#define 'a'' when fed with `%token 'a' "a"'.
1316 * tests/regression.at (Token definitions): New.
1317
13182002-05-03 Paul Eggert <eggert@twinsun.com>
1319
1320 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1321 for K&R C.
1322
13232002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1324
1325 * Makefile.am (SUBDIRS): Remove intl.
1326 (EXTRA_DIST): Add config/config.rpath.
1327
13282002-05-03 Akim Demaille <akim@epita.fr>
1329
1330 * data/bison.simple (m4_if): Don't output empty enums.
1331 And actually, output valid enum definitions :(.
1332
13332002-05-03 Akim Demaille <akim@epita.fr>
1334
1335 * configure.bat: Remove, completely obsolete.
1336 * Makefile.am (EXTRA_DIST): Adjust.
1337 Don't distribute config.rpath...
1338 * config/Makefile.am (EXTRA_DIST): Do it.
1339
13402002-05-03 Akim Demaille <akim@epita.fr>
1341
1342 * configure.in (GETTEXT_VERSION): New.
1343 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1344
13452002-05-03 Akim Demaille <akim@epita.fr>
1346
1347 * data/bison.simple (b4_token_enum): New.
1348 (b4_token_defines): Use it to output tokens both as #define and
1349 enums.
1350 Suggested by Paul Eggert.
1351 * src/output.c (token_definitions_output): Don't output spurious
1352 white spaces.
1353
13542002-05-03 Akim Demaille <akim@epita.fr>
1355
1356 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1357
13582002-05-02 Robert Anisko <robert@lrde.epita.fr>
1359
1360 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1361 Update the stack class, give a try to deque as the default container.
1362
13632002-05-02 Akim Demaille <akim@epita.fr>
1364
1365 * data/bison.simple (yyparse): Do not implement @$ = @1.
1366 (YYLLOC_DEFAULT): Adjust to do it.
1367 * doc/bison.texinfo (Location Default Action): Fix.
1368
13692002-05-02 Akim Demaille <akim@epita.fr>
1370
1371 * src/reader.c (parse_braces): Merge into...
1372 (parse_action): this.
1373
13742002-05-02 Akim Demaille <akim@epita.fr>
1375
1376 * configure.in (ALL_LINGUAS): Remove.
1377 * po/LINGUAS, hr.po: New.
1378
13792002-05-02 Akim Demaille <akim@epita.fr>
1380
1381 Remove the so called hairy (semantic) parsers.
1382
1383 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1384 * src/gram.h, src/gram.c (semantic_parser): Remove.
1385 (rule_t): Remove the guard and guard_line members.
1386 * src/lex.h (token_t): remove tok_guard.
1387 * src/options.c (option_table): Remove %guard and %semantic_parser
1388 support.
1389 * src/output.c, src/output.h (guards_output): Remove.
1390 (prepare): Adjust.
1391 (token_definitions_output): Don't output the `T'
1392 tokens (???).
1393 (output_skeleton): Don't output the guards.
1394 * src/files.c, src/files.c (attrsfile): Remove.
1395 * src/reader.c (symbol_list): Remove the guard and guard_line
1396 members.
1397 Adjust dependencies.
1398 (parse_guard): Remove.
1399 * data/bison.hairy: Remove.
1400 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1401 BISON_HAIRY.
1402
14032002-05-02 Akim Demaille <akim@epita.fr>
1404
1405 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1406 (parse_guard): Rename the formal argument `stack_offset' as
1407 `rule_length', which is more readable.
1408 Adjust callers.
1409 (copy_at, copy_dollar): Instead of outputting the hard coded
1410 values of $$, $n and so forth, output invocation to b4_lhs_value,
1411 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
1412 Note: this patch partially drops `semantic-parser' support: it
1413 always does `rule_length - n', where semantic parsers ought to
1414 always use `-n'.
1415 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1416 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1417
14182002-05-02 Akim Demaille <akim@epita.fr>
1419
1420 * configure.in (AC_INIT): Bump to 1.49b.
1421 (AM_INIT_AUTOMAKE): Short invocation.
1422
14232002-05-02 Akim Demaille <akim@epita.fr>
1424
1425 Version 1.49a.
1426
14272002-05-01 Akim Demaille <akim@epita.fr>
1428
1429 * src/skeleton.h: Remove.
1430
14312002-05-01 Akim Demaille <akim@epita.fr>
1432
1433 * src/skeleton.h: Fix the #endif.
1434 Reported by Magnus Fromreide.
1435
14362002-04-26 Paul Eggert <eggert@twinsun.com>
1437
1438 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1439 Define if we define YYSTYPE and YYLTYPE, respectively.
1440 (YYCOPY): Fix [] quoting problem in the non-GCC case.
1441
14422002-04-25 Robert Anisko <robert@lrde.epita.fr>
1443
1444 * src/scan-skel.l: Postprocess quadrigraphs.
1445
1446 * src/reader.c (copy_character): New function, used to output
1447 single characters while replacing `[' and `]' with quadrigraphs, to
1448 avoid troubles with M4 quotes.
1449 (copy_comment): Output characters with copy_character.
1450 (read_additionnal_code): Likewise.
1451 (copy_string2): Likewise.
1452 (copy_definition): Likewise.
1453
1454 * tests/calc.at: Exercise M4 quoting.
1455
14562002-04-25 Akim Demaille <akim@epita.fr>
1457
1458 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1459 between `!' and the command.
1460 Reported by Paul Eggert.
1461
14622002-04-24 Robert Anisko <robert@lrde.epita.fr>
1463
1464 * tests/calc.at: Exercise prologue splitting.
1465
1466 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1467 `b4_post_prologue' instead of `b4_prologue'.
1468
1469 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1470 muscles.
1471 (output): Free pre_prologue_obstack and post_prologue_obstack.
1472 * src/files.h, src/files.c (attrs_obstack): Remove.
1473 (pre_prologue_obstack, post_prologue_obstack): New.
1474 * src/reader.c (copy_definition): Add a parameter to specify the
1475 obstack to fill, instead of using attrs_obstack unconditionally.
1476 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1477 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1478
14792002-04-23 Paul Eggert <eggert@twinsun.com>
1480
1481 * data/bison.simple: Remove unnecessary commentary and white
1482 space differences from 1_29-branch.
1483 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1484
1485 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1486 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1487 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1488 constructors or destructors.
1489
1490 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1491
14922002-04-23 Akim Demaille <akim@epita.fr>
1493
1494 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1495 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1496 location with columns.
1497 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1498 All reported by Paul Eggert.
1499
15002002-04-22 Akim Demaille <akim@epita.fr>
1501
1502 * src/reduce.c (dump_grammar): Move to...
1503 * src/gram.h, src/gram.c (grammar_dump): here.
1504 Be sure to separate long item numbers.
1505 Don't read the members of a rule's prec if its nil.
1506
15072002-04-22 Akim Demaille <akim@epita.fr>
1508
1509 * src/output.c (table_size, table_grow): New.
1510 (MAXTABLE): Remove, replace uses with table_size.
1511 (pack_vector): Instead of dying when the table is too big, grow it.
1512
15132002-04-22 Akim Demaille <akim@epita.fr>
1514
1515 * data/bison.simple (yyr1): Its type is that of a token number.
1516 * data/bison.c++ (r1_): Likewise.
1517 * tests/regression.at (Web2c Actions): Adjust.
1518
15192002-04-22 Akim Demaille <akim@epita.fr>
1520
1521 * src/reader.c (token_translations_init): 256 is now the default
1522 value for the error token, i.e., it will be assigned another
1523 number if the user assigned 256 to one of her tokens.
1524 (reader): Don't force 256 to error.
1525 * doc/bison.texinfo (Symbols): Adjust.
1526 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1527 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1528 etc. instead of 10, 20, 30 (which was used to `jump' over error
1529 (256) and undefined (2)).
1530
15312002-04-22 Akim Demaille <akim@epita.fr>
1532
1533 Propagate more token_number_t.
1534
1535 * src/gram.h (token_number_as_item_number)
1536 (item_number_as_token_number): New.
1537 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1538 Use it to create output_item_number_table and
1539 output_token_number_table.
1540 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1541 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1542 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1543 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1544
15452002-04-22 Akim Demaille <akim@epita.fr>
1546
1547 * src/output.h, src/output.c (get_lines_number): Remove.
1548
15492002-04-19 Akim Demaille <akim@epita.fr>
1550
1551 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1552 as Lex/Flex'.
1553 (Debugging): More details about enabling the debugging features.
1554 (Table of Symbols): Describe $$, $n, @$, and @n.
1555 Suggested by Tim Josling.
1556
15572002-04-19 Akim Demaille <akim@epita.fr>
1558
1559 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1560
15612002-04-10 Akim Demaille <akim@epita.fr>
1562
1563 * src/system.h: Rely on HAVE_LIMITS_H.
1564 Suggested by Paul Eggert.
1565
15662002-04-09 Akim Demaille <akim@epita.fr>
1567
1568 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1569 full stderr, and strip it according to the bison options, instead
1570 of composing the error message from different bits.
1571 This makes it easier to check for several error messages.
1572 Adjust all the invocations.
1573 Add an invocation exercising the error token.
1574 Add an invocation demonstrating a stupid error message.
1575 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1576 Adjust the tests.
1577 Error message are for stderr, not stdout.
1578
15792002-04-09 Akim Demaille <akim@epita.fr>
1580
1581 * src/gram.h, src/gram.c (error_token_number): Remove, use
1582 errtoken->number.
1583 * src/reader.c (reader): Don't specify the user token number (2)
1584 for $undefined, as it uselessly prevents using it.
1585 * src/gram.h (token_number_t): Move to...
1586 * src/symtab.h: here.
1587 (state_t.number): Is a token_number_t.
1588 * src/print.c, src/reader.c: Use undeftoken->number instead of
1589 hard coded 2.
1590 (Even though this 2 is not the same as above: the number of the
1591 undeftoken remains being 2, it is its user token number which
1592 might not be 2).
1593 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1594 `user_token_number_max'.
1595 Output `undef_token_number'.
1596 * data/bison.simple, data/bison.c++: Use them.
1597 Be sure to map invalid yylex return values to
1598 `undef_token_number'. This saves us from gratuitous SEGV.
1599
1600 * tests/conflicts.at (Solved SR Conflicts)
1601 (Unresolved SR Conflicts): Adjust.
1602 * tests/regression.at (Web2c Actions): Adjust.
1603
16042002-04-08 Akim Demaille <akim@epita.fr>
1605
1606 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1607 Adding #line.
1608 Remove the duplicate `typedefs'.
1609 (RhsNumberType): Fix the declaration and various other typos.
1610 Use __ofile__.
1611 * data/bison.simple: Use __ofile__.
1612 * src/scan-skel.l: Handle __ofile__.
1613
16142002-04-08 Akim Demaille <akim@epita.fr>
1615
1616 * src/gram.h (item_number_t): New, the type of item numbers in
1617 RITEM. Note that it must be able to code symbol numbers as
1618 positive number, and the negation of rule numbers as negative
1619 numbers.
1620 Adjust all dependencies (pretty many).
1621 * src/reduce.c (rule): Remove this `short *' pointer: use
1622 item_number_t.
1623 * src/system.h (MINSHORT, MAXSHORT): Remove.
1624 Include `limits.h'.
1625 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1626 (shortcpy): Remove.
1627 (MAXTABLE): Move to...
1628 * src/output.c (MAXTABLE): here.
1629 (prepare_rules): Use output_int_table to output rhs.
1630 * data/bison.simple, data/bison.c++: Adjust.
1631 * tests/torture.at (Big triangle): Move the limit from 254 to
1632 500.
1633 * tests/regression.at (Web2c Actions): Ajust.
1634
1635 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1636 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1637 passes, but produces negative #line number, once fixed, GCC is
1638 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1639 C), it passes.
1640 * src/state.h (state_h): Code input lines on ints, not shorts.
1641
16422002-04-08 Akim Demaille <akim@epita.fr>
1643
1644 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1645 and then the grammar.
1646
16472002-04-08 Akim Demaille <akim@epita.fr>
1648
1649 * src/system.h: No longer using strndup.
1650
16512002-04-07 Akim Demaille <akim@epita.fr>
1652
1653 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1654 * src/output.c (output_table_data): Return the longest number.
1655 (prepare_tokens): Output `token_number_max').
1656 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1657 New.
1658 Use them to define yy_token_number_type/TokenNumberType.
1659 Use this type for yytranslate.
1660 * tests/torture.at (Big triangle): Push the limit from 124 to
1661 253.
1662 * tests/regression.at (Web2c Actions): Adjust.
1663
16642002-04-07 Akim Demaille <akim@epita.fr>
1665
1666 * tests/torture.at (Big triangle): New.
1667 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1668 * tests/existing.at: here.
1669
16702002-04-07 Akim Demaille <akim@epita.fr>
1671
1672 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1673 nritems.
1674 Adjust dependencies.
1675
16762002-04-07 Akim Demaille <akim@epita.fr>
1677
1678 * src/reader.c: Normalize increments to prefix form.
1679
16802002-04-07 Akim Demaille <akim@epita.fr>
1681
1682 * src/reader.c, symtab.c: Remove debugging code.
1683
16842002-04-07 Akim Demaille <akim@epita.fr>
1685
1686 Rename all the `bucket's as `symbol_t'.
1687
1688 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1689 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1690 * src/symtab.c, src/symtab.h (bucket): Rename as...
1691 (symbol_t): this.
1692 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1693 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1694 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1695 (buckets_new, buckets_free, buckets_do): Rename as...
1696 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1697 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1698 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1699 (symbols_new, symbols_free, symbols_do): these.
1700
17012002-04-07 Akim Demaille <akim@epita.fr>
1702
1703 Use lib/hash for the symbol table.
1704
1705 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1706 EOF.
1707 * src/lex.c (lex): Set the `number' member of new terminals.
1708 * src/reader.c (bucket_check_defined, bucket_make_alias)
1709 (bucket_check_alias_consistence, bucket_translation): New.
1710 (reader, grammar_free, readgram, token_translations_init)
1711 (packsymbols): Adjust.
1712 (reader): Number the predefined tokens.
1713 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1714 for predefined tokens.
1715 * src/symtab.h (bucket): Remove all the hash table related
1716 members.
1717 * src/symtab.c (symtab): Replace by...
1718 (bucket_table): this.
1719 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1720 (buckets_new, buckets_do): New.
1721
17222002-04-07 Akim Demaille <akim@epita.fr>
1723
1724 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1725 (start_symbol, max_user_token_number, semantic_parser)
1726 (error_token_number): Initialize.
1727 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1728 Initialize.
1729 (reader): Don't.
1730 (errtoken, eoftoken, undeftoken, axiom): Extern.
1731
17322002-04-07 Akim Demaille <akim@epita.fr>
1733
1734 * src/gram.h (rule_s): prec and precsym are now pointers
1735 to the bucket giving the priority/associativity.
1736 Member `associativity' removed: useless.
1737 * src/reduce.c, src/conflicts.c: Adjust.
1738
17392002-04-07 Akim Demaille <akim@epita.fr>
1740
1741 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1742 Properly escape the symbols' TAG when outputting them.
1743
17442002-04-07 Akim Demaille <akim@epita.fr>
1745
1746 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1747
17482002-04-07 Akim Demaille <akim@epita.fr>
1749
1750 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1751 (LArule): this, which is an array to rule_t*.
1752 * src/print.c, src/conflicts.c: Adjust.
1753
17542002-04-07 Akim Demaille <akim@epita.fr>
1755
1756 * src/gram.h (rule_t): Rename `number' as `user_number'.
1757 `number' is a new member.
1758 Adjust dependencies.
1759 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1760
17612002-04-07 Akim Demaille <akim@epita.fr>
1762
1763 As a result of the previous patch, it is no longer needed
1764 to reorder ritem itself.
1765
1766 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1767
17682002-04-07 Akim Demaille <akim@epita.fr>
1769
1770 Be sure never to walk through RITEMS, but use only data related to
1771 the rules themselves. RITEMS should be banished.
1772
1773 * src/output.c (output_token_translations): Rename as...
1774 (prepare_tokens): this.
1775 In addition to `translate', prepare the muscles `tname' and
1776 `toknum', which were handled by...
1777 (output_rule_data): this.
1778 Remove, and move the remainder of its outputs into...
1779 (prepare_rules): this new routines, which also merges content from
1780 (output_gram): this.
1781 (prepare_rules): Be sure never to walk through RITEMS.
1782 (output_stos): Rename as...
1783 (prepare_stos): this.
1784 (output): Always invoke prepare_states, after all, just don't use it
1785 in the output if you don't need it.
1786
17872002-04-07 Akim Demaille <akim@epita.fr>
1788
1789 * src/LR0.c (new_state): Display `nstates' as the name of the
1790 newly created state.
1791 Adjust to initialize first_state and last_state if needed.
1792 Be sure to distinguish the initial from the final state.
1793 (new_states): Create the itemset of the initial state, and use
1794 new_state.
1795 * src/closure.c (closure): Now that the initial state has its
1796 items properly set, there is no need for a special case when
1797 creating `ruleset'.
1798
1799 As a result, now the rule 0, reducing to $axiom, is visible in the
1800 outputs. Adjust the test suite.
1801
1802 * tests/conflicts.at (Solved SR Conflicts)
1803 (Unresolved SR Conflicts): Adjust.
1804 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1805 * tests/conflicts.at (S/R in initial): New.
1806
18072002-04-07 Akim Demaille <akim@epita.fr>
1808
1809 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1810 the RHS of the rules.
1811 * src/output.c (output_gram): Likewise.
1812
18132002-04-07 Akim Demaille <akim@epita.fr>
1814
1815 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1816 bucket.
1817 Adjust all dependencies.
1818 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1819 `number' of the buckets too.
1820 * src/gram.h: Include `symtab.h'.
1821 (associativity): Move to...
1822 * src/symtab.h: here.
1823 No longer include `gram.h'.
1824
18252002-04-07 Akim Demaille <akim@epita.fr>
1826
1827 * src/gram.h, src/gram.c (rules_rhs_length): New.
1828 (ritem_longest_rhs): Use it.
1829 * src/gram.h (rule_t): `number' is a new member.
1830 * src/reader.c (packgram): Set it.
1831 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1832 the end of `rules', and count them out of `nrules'.
1833 (reduce_output, dump_grammar): Adjust.
1834 * src/print.c (print_grammar): It is no longer needed to check for
1835 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1836 * tests/reduce.at (Reduced Automaton): New test.
1837
18382002-04-07 Akim Demaille <akim@epita.fr>
1839
1840 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1841 lacking `+ 1' to nrules, Bison reported as useless a token if it
1842 was used solely to set the precedence of the last rule...
1843
18442002-04-07 Akim Demaille <akim@epita.fr>
1845
1846 * data/bison.c++, data/bison.simple: Don't output the current file
1847 name in #line, to avoid useless diffs between two identical
1848 outputs under different names.
1849
18502002-04-07 Akim Demaille <akim@epita.fr>
1851
1852 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1853 Normalize loops to using `< nrules + 1', not `<= nrules'.
1854
18552002-04-07 Akim Demaille <akim@epita.fr>
1856
1857 * TODO: Update.
1858
18592002-04-07 Akim Demaille <akim@epita.fr>
1860
1861 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1862 bucket.value as bucket.number.
1863
18642002-04-07 Akim Demaille <akim@epita.fr>
1865
1866 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1867 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1868 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1869 RHS, instead of being an index in RITEMS.
1870
18712002-04-04 Paul Eggert <eggert@twinsun.com>
1872
1873 * doc/bison.texinfo: Update copyright date.
1874 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1875 (Symbols): Warn about running Bison in one character set,
1876 but compiling and/or running in an incompatible one.
1877 Warn about character code 256, too.
1878
18792002-04-03 Paul Eggert <eggert@twinsun.com>
1880
1881 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1882 YYERROR_VERBOSE is nonzero, not whether it is defined.
1883
1884 Merge changes from bison-1_29-branch.
1885
18862002-03-20 Paul Eggert <eggert@twinsun.com>
1887
1888 Merge fixes from Debian bison_1.34-1.diff.
1889
1890 * configure.in (AC_PREREQ): 2.53.
1891
18922002-03-20 Akim Demaille <akim@epita.fr>
1893
1894 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1895
18962002-03-19 Paul Eggert <eggert@twinsun.com>
1897
1898 * src/bison.simple (YYCOPY): New macro.
1899 (YYSTACK_RELOCATE): Use it.
1900 Remove Type arg; no longer needed. All callers changed.
1901 (yymemcpy): Remove; no longer needed.
1902
1903 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1904 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1905
19062002-03-19 Akim Demaille <akim@epita.fr>
1907
1908 Test and fix the #line outputs.
1909
1910 * tests/atlocal.at (GCC): New.
1911 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1912 (Prologue synch line, ,%union synch line, Postprologue synch line)
1913 (Action synch line, Epilogue synch line): New tests.
1914 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1915 * data/bison.simple, data/bison.c++: Use it.
1916
19172002-03-19 Akim Demaille <akim@epita.fr>
1918
1919 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1920 (Solved SR Conflicts, %expect not enough, %expect right)
1921 (%expect too much): Move to...
1922 * tests/conflicts.at: this new file.
1923
19242002-03-19 Akim Demaille <akim@epita.fr>
1925
1926 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1927 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1928 that we can move to enums for instance.
1929 * src/output.c (token_definitions_output): Output a list of
1930 `token-name, token-number' instead of the #define.
1931 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1932
19332002-03-14 Akim Demaille <akim@epita.fr>
1934
1935 Use Gettext 0.11.1.
1936
19372002-03-09 Robert Anisko <robert@lrde.epita.fr>
1938
1939 * data/bison.c++: Make the user able to add members to the generated
1940 parser by subclassing.
1941
19422002-03-05 Robert Anisko <robert@lrde.epita.fr>
1943
1944 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1945 a character.
1946 Reported by Nicolas Tisserand and Nicolas Burrus.
1947
19482002-03-04 Robert Anisko <robert@lrde.epita.fr>
1949
1950 * src/reader.c: Warn about lacking semi-colons, do not complain.
1951
19522002-03-04 Robert Anisko <robert@lrde.epita.fr>
1953
1954 * data/bison.c++: Remove a debug line.
1955
19562002-03-04 Robert Anisko <robert@lrde.epita.fr>
1957
1958 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1959 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1960 provide a default implementation.
1961
19622002-03-04 Akim Demaille <akim@epita.fr>
1963
1964 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1965 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1966 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1967 * tests/semantic.at (Parsing Guards): Similarly.
1968 * src/reader.at (readgram): Complain if the last rule is not ended
1969 with a semi-colon.
1970
19712002-03-04 Akim Demaille <akim@epita.fr>
1972
1973 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1974 * src/closure.c: here.
1975 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1976 RTC.
1977 * src/warshall.h, src/warshall.c: Remove.
1978 * tests/sets.at (Broken Closure): Adjust.
1979
19802002-03-04 Akim Demaille <akim@epita.fr>
1981
1982 * src/output.c (output_skeleton): tempdir is const.
1983 bytes_read is unused.
1984
19852002-03-04 Akim Demaille <akim@epita.fr>
1986
1987 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1988 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1989 Update.
1990 From Michael Hayes.
1991
19922002-03-04 Akim Demaille <akim@epita.fr>
1993
1994 * src/closure.c (closure): `r' is unused.
1995
19962002-03-04 Akim Demaille <akim@epita.fr>
1997
1998 * tests/sets.at (Broken Closure): Add the ending `;'.
1999 * src/reader.at (readgram): Complain if a rule is not ended with a
2000 semi-colon.
2001
20022002-03-04 Akim Demaille <akim@epita.fr>
2003
2004 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
2005 (count_sr_conflicts): Use bitset_count.
2006 * src/reduce.c (inaccessable_symbols): Ditto.
2007 (bits_size): Remove.
2008 * src/warshall.h, src/warshall.c: Convert to bitsetv.
2009
20102002-03-04 Akim Demaille <akim@epita.fr>
2011
2012 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
2013 * src/reduce.c: Remove the `bitset_zero's following the
2014 `bitset_create's, as now it is performed by the latter.
2015
20162002-03-04 Akim Demaille <akim@epita.fr>
2017
2018 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
2019 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
2020 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
2021 latest sources from Michael.
2022
20232002-03-04 Akim Demaille <akim@epita.fr>
2024
2025 * src/output.c (output): Don't free the grammar.
2026 * src/reader.c (grammar_free): New.
2027 * src/main.c (main): Call it and don't free symtab here.
2028
20292002-03-04 Akim Demaille <akim@epita.fr>
2030
2031 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
2032 before returning.
2033 Reported by Benoit Perrot.
2034
20352002-03-04 Akim Demaille <akim@epita.fr>
2036
2037 Use bitset operations when possible, not loops over bits.
2038
2039 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
2040 bitset_or.
2041 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
2042 * src/reduce.c (useless_nonterminals): Formatting changes.
2043 * src/warshall.c (TC): Use bitset_or.
2044
20452002-03-04 Akim Demaille <akim@epita.fr>
2046
2047 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
2048 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
2049 Ditto.
2050
20512002-03-04 Akim Demaille <akim@epita.fr>
2052
2053 * src/lalr.c (F): Now a bitset*.
2054 Adjust all dependencies.
2055
20562002-03-04 Akim Demaille <akim@epita.fr>
2057
2058 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
2059 Adjust all dependencies.
2060
20612002-03-04 Akim Demaille <akim@epita.fr>
2062
2063 * src/L0.c, src/LR0.h (nstates): Be size_t.
2064 Adjust comparisons (signed vs unsigned).
2065 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
2066 bitset*.
2067 Adjust all dependencies.
2068
20692002-03-04 Akim Demaille <akim@epita.fr>
2070
2071 * src/closure.c (firsts): Now, also a bitset.
2072 Adjust all dependencies.
2073 (varsetsize): Remove, now unused.
2074 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2075
20762002-03-04 Akim Demaille <akim@epita.fr>
2077
2078 * src/print.c: Convert to use bitset.h, not hand coded iterations
2079 over ints.
2080
20812002-03-04 Akim Demaille <akim@epita.fr>
2082
2083 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2084
20852002-03-04 Akim Demaille <akim@epita.fr>
2086
2087 * src/closure.c (ruleset): Be a bitset.
2088 (rulesetsize): Remove.
2089
20902002-03-04 Akim Demaille <akim@epita.fr>
2091
2092 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2093 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2094 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2095 * src/closure.c (fderives): Be an array of bitsets.
2096
20972002-02-28 Robert Anisko <robert@lrde.epita.fr>
2098
2099 * data/bison.c++: Merge the two generated headers. Insert a copyright
2100 notice in each output file.
2101
21022002-02-28 Akim Demaille <akim@epita.fr>
2103
2104 * data/bison.c++: Copy the prologue of bison.simple to fetch
2105 useful M4 definitions, such as b4_header_guard.
2106
21072002-02-25 Akim Demaille <akim@epita.fr>
2108
2109 * src/getargs.c (version): Give the name of the authors, and use a
2110 translator friendly scheme for the bgr
2111 copyright notice.
2112
21132002-02-25 Akim Demaille <akim@epita.fr>
2114
2115 * src/output.c (header_output): Remove, now handled completely via
2116 M4.
2117
21182002-02-25 Akim Demaille <akim@epita.fr>
2119
2120 * m4/m4.m4: New, from CVS Autoconf.
2121 * configure.in: Invoke it.
2122 * src/output.c (output_skeleton): Use its result instead of the
2123 hard coded name.
2124
21252002-02-25 Akim Demaille <akim@epita.fr>
2126
2127 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2128 Fileutils 4.1.5.
2129 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2130 * src/output.c (output_skeleton): Use mkstemp to create a real
2131 temporary file.
2132 Move the filling of `skeleton' and its muscle to...
2133 (prepare): here.
2134 (output): Move the definition of the prologue muscle to...
2135 (prepare): here.
2136 * src/system.h (DEFAULT_TMPDIR): New.
2137
21382002-02-14 Paul Eggert <eggert@twinsun.com>
2139
2140 Remove the support for C++ namespace cleanliness; it was
2141 causing more problems than it was curing, since it didn't work
2142 properly on some nonstandard C++ compilers. This can wait
2143 for a proper C++ parser.
2144
2145 * NEWS: Document this.
2146 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2147 of C++, as it's treated like C now.
2148 * src/bison.simple (YYSTD): Remove.
2149 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2150 Treat C++ just like Standard C instead of trying to support
2151 namespace cleanliness.
2152
21532002-02-14 Akim Demaille <akim@epita.fr>
2154
2155 * tests/regression.at (else): Adjust to Andreas' change.
2156
21572002-02-14 Akim Demaille <akim@epita.fr>
2158
2159 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2160
21612002-02-13 Andreas Schwab <schwab@suse.de>
2162
2163 * src/output.c (output_rule_data): Don't output NULL, it might
2164 not be defined yet.
2165
21662002-02-11 Robert Anisko <robert@lrde.epita.fr>
2167
2168 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2169 (Copyright notice): Update.
2170
21712002-02-11 Akim Demaille <akim@epita.fr>
2172
2173 * tests/regression.at (%nonassoc and eof): Don't include
2174 nonportable headers.
2175
21762002-02-08 Robert Anisko <robert@lrde.epita.fr>
2177
2178 * data/bison.c++: Correct error recovery. Make the user able to
2179 initialize the starting location.
2180
21812002-02-07 Akim Demaille <akim@epita.fr>
2182
2183 * tests/input.at: New.
2184
21852002-02-07 Robert Anisko <robert@lrde.epita.fr>
2186
2187 * data/bison.c++: Replace some direct m4 expansions by constants. Be
2188 more consistent when naming methods and variables. Put preprocessor
2189 directives around tables only needed for debugging.
2190
21912002-02-07 Robert Anisko <robert@lrde.epita.fr>
2192
2193 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2194 C++ parsers.
2195 (yy::b4_name::parse): Use print_.
2196
21972002-02-07 Robert Anisko <robert@lrde.epita.fr>
2198
2199 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2200
22012002-02-07 Robert Anisko <robert@lrde.epita.fr>
2202
2203 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2204 C++ parsers.
2205 (yy::b4_name::parse): Build verbose error messages, and use error_.
2206
22072002-02-06 Robert Anisko <robert@lrde.epita.fr>
2208
2209 * data/bison.c++: Fix m4 quoting in comments.
2210
22112002-02-06 Robert Anisko <robert@lrde.epita.fr>
2212
2213 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2214 not expanded by m4.
2215
22162002-02-05 Akim Demaille <akim@epita.fr>
2217
2218 * data/bison.c++: Adjust to the M4 back end.
2219 More is certainly needed.
2220
22212002-02-05 Akim Demaille <akim@epita.fr>
2222
2223 Give a try to M4 as a back end.
2224
2225 * lib/readpipe.c: New, from wdiff.
2226 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2227 BISON_HAIRY.
2228 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2229 specific values. Now it is m4 that performs the lookup.
2230 * src/parse-skel.y: Remove.
2231 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2232 * src/output.c (actions_output, guards_output)
2233 (token_definitions_output): No longer keeps track of the output
2234 line number, hence remove the second argument.
2235 (guards_output): Check against the guard member of a rule, not the
2236 action member.
2237 Adjust callers.
2238 (output_skeleton): Don't look for the skeleton location, let m4 do
2239 that.
2240 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2241 file will be used.
2242 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2243 (prepare): Given that for the time being changesyntax is not
2244 usable in M4, rename the muscles using `-' to `_'.
2245 Define `defines_flag', `output_parser_name' and `output_header_name'.
2246 * src/output.h (actions_output, guards_output)
2247 (token_definitions_output): Adjust prototypes.
2248 * src/scan-skel.l: Instead of scanning the skeletons, it now
2249 processes the output of m4: `__oline__' and `#output'.
2250 * data/bison.simple: Adjust to be used by M4(sugar).
2251 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2252 to date.
2253 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2254 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2255 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2256 shamelessly stolen from CVS Autoconf.
2257
22582002-02-05 Akim Demaille <akim@epita.fr>
2259
2260 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2261 * configure.in: Check for the declarations of free and malloc.
2262 * src/muscle_tab.c: Adjust.
2263
22642002-02-05 Akim Demaille <akim@epita.fr>
2265
2266 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2267 which have no values.
2268
22692002-02-05 Akim Demaille <akim@epita.fr>
2270
2271 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2272 * data/: here.
2273
22742002-01-29 Paul Eggert <eggert@twinsun.com>
2275
2276 * src/bison.simple (YYSIZE_T): Do not define merely because
2277 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2278 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2279
22802002-01-27 Akim Demaille <akim@epita.fr>
2281
2282 Fix `%nonassoc and eof'.
2283
2284 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2285 which were not properly copied! Replace
2286 memcpy (res->errs, src->errs, src->nerrs);
2287 with
2288 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2289 !!!
2290 * tests/regression.at (%nonassoc and eof): Adjust to newest
2291 Autotest: `.' is not in the PATH.
2292
22932002-01-27 Akim Demaille <akim@epita.fr>
2294
2295 * tests/sets.at (AT_EXTRACT_SETS): New.
2296 (Nullable): Use it.
2297 (Firsts): New.
2298
22992002-01-26 Akim Demaille <akim@epita.fr>
2300
2301 * tests/actions.at, tests/calc.at, tests/headers.at,
2302 * tests/torture.at: Adjust to the newest Autotest which no longer
2303 forces `.' in the PATH.
2304
23052002-01-25 Akim Demaille <akim@epita.fr>
2306
2307 * tests/regression.at (%nonassoc and eof): New.
2308 Suggested by Robert Anisko.
2309
23102002-01-24 Akim Demaille <akim@epita.fr>
2311
2312 Bison dumps core when trying to complain about broken input files.
2313 Reported by Cris van Pelt.
2314
2315 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2316 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2317 into...
2318 (Invalid inputs): Strengthen: exercise parse_percent_token.
2319
23202002-01-24 Robert Anisko <robert.anisko@epita.fr>
2321
2322 * src/Makefile.am: Add bison.c++.
2323 * src/bison.c++: New skeleton.
2324
23252002-01-21 Paolo Bonzini <bonzini@gnu.org>
2326
2327 * po/it.po: New.
2328
23292002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2330
2331 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2332
23332002-01-20 Marc Autret <marc@gnu.org>
2334
2335 * src/files.c (compute_output_file_names): Fix
2336
23372002-01-20 Marc Autret <marc@gnu.org>
2338
2339 * tests/output.at: New test.
2340 * src/files.c (compute_base_names): Don't map extensions when
2341 the YACC flag is set, use defaults.
2342 Reported by Evgeny Stambulchik.
2343
23442002-01-20 Marc Autret <marc@gnu.org>
2345
2346 * src/system.h: Need to define __attribute__ away for non-GCC
2347 compilers as well (i.e. the vendor C compiler).
2348 Suggested by Albert Chin-A-Young.
2349
23502002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2351
2352 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2353 canonical definition.
2354 * src/system.h: Use the canonical definition for PARAMS (avoids
2355 a conflict with the macro from lib/hash.h).
2356
23572002-01-11 Akim Demaille <akim@epita.fr>
2358
2359 * configure.in: Use AC_FUNC_STRNLEN.
2360 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
2361
23622002-01-09 Akim Demaille <akim@epita.fr>
2363
2364 * src/files.c, src/files.h (output_infix): New.
2365 (tab_extension): Remove.
2366 (compute_base_names): Compute the former, drop the latter.
2367 * src/output.c (prepare): Insert the muscles `output-infix', and
2368 `output-suffix'.
2369 * src/parse-skel.y (string, string.1): New.
2370 (section.header): Use it.
2371 (section.yacc): Remove.
2372 (prefix): Remove too.
2373 * src/scan-skel.l: Adjust.
2374 * src/bison.simple, src/bison.hairy: Adjust.
2375
23762002-01-09 Akim Demaille <akim@epita.fr>
2377
2378 * configure.in (WERROR_CFLAGS): Compute it.
2379 * src/Makefile.am (CFLAGS): Pass it.
2380 * tests/atlocal.in (CFLAGS): Idem.
2381 * src/files.c: Fix a few warnings.
2382 (get_extension_index): Remove, unused.
2383
23842002-01-08 Akim Demaille <akim@epita.fr>
2385
2386 * src/getargs.c (AS_FILE_NAME): New.
2387 (getargs): Use it to convert DOSish file names.
2388 * src/files.c (base_name): Rename as full_base_name to avoid
2389 clashes with `base_name ()'.
2390 (filename_split): New.
2391 (compute_base_names): N-th rewrite, using filename_split.
2392
23932002-01-08 Akim Demaille <akim@epita.fr>
2394
2395 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2396 New, stolen from the Fileutils 4.1.
2397 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2398 * configure.in: Check for the presence of memrchr, and of its
2399 prototype.
2400
24012002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2402
2403 * lib/hash.h (__P): Added definition for this macro.
2404 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2405 BUILT_SOURCES, to ensure they are generated first.
2406 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2407 %error-verbose to allow bootstrapping with bison 1.30x.
2408
24092002-01-06 Akim Demaille <akim@epita.fr>
2410
2411 * src/reader.c (parse_braces): Don't fetch the next char, the
2412 convention is to fetch on entry.
2413 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2414 'switch' without a following semicolon.
2415 * tests/regression.at (braces parsing): New.
2416
24172002-01-06 Akim Demaille <akim@epita.fr>
2418
2419 Bison is dead wrong in its RR conflict reports.
2420
2421 * tests/torture.at (GNU Cim Grammar): New.
2422 * src/conflicts.c (count_rr_conflicts): Fix.
2423
24242002-01-06 Akim Demaille <akim@epita.fr>
2425
2426 Creating package.m4 from configure.ac causes too many problems.
2427
2428 * tests/Makefile.am (package.m4): Create it by hand,
2429 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2430
24312002-01-06 Akim Demaille <akim@epita.fr>
2432
2433 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2434 skeleton.h.
2435
24362002-01-04 Paul Eggert <eggert@twinsun.com>
2437
2438 * doc/bison.texinfo (Debugging):
2439 Remove YYSTDERR; it's no longer defined or used.
2440 Also, s/cstdio.h/cstdio/.
2441
24422002-01-03 Akim Demaille <akim@epita.fr>
2443
2444 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2445
24462002-01-03 Akim Demaille <akim@epita.fr>
2447
2448 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2449 tracing code to --trace, wait for a better --trace option, with
2450 args.
2451
24522002-01-03 Akim Demaille <akim@epita.fr>
2453
2454 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2455 The ISO C++ standard is extremely clear about it: stderr is
2456 considered a macro, not a regular symbol (see table 94 `Header
2457 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2458 Therefore std:: does not apply to it. It still does with fprintf.
2459 Also, s/cstdio.h/cstdio/.
2460
24612002-01-03 Akim Demaille <akim@epita.fr>
2462
2463 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2464 for non system headers.
2465
24662002-01-02 Akim Demaille <akim@epita.fr>
2467
2468 Equip the skeleton chain with location tracking, runtime trace,
2469 pure parser and scanner.
2470
2471 * src/parse-skel.y: Request a pure parser, locations, and prefix
2472 renaming.
2473 (%union): Having several members with the same type does not help
2474 type mismatches, simplify.
2475 (YYPRINT, yyprint): New.
2476 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2477 (skel_error): this.
2478 Handle locations.
2479 * src/scan-skel.l: Adjust to these changes.
2480 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2481 (LOCATION_PRINT, skel_control_t): New.
2482
24832001-12-30 Akim Demaille <akim@epita.fr>
2484
2485 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2486 replace `gb' with BLANKS.
2487 * src/scan-skel.l: Adjust.
2488
24892001-12-30 Akim Demaille <akim@epita.fr>
2490
2491 * src/system.h: We don't need nor want bcopy.
2492 Throw away MS-DOS crap: we don't need getpid.
2493 * configure.in: We don't need strndup. It was even causing
2494 problems: because Flex includes the headers *before* us,
2495 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2496 not visible.
2497 * lib/xstrndup.c: New.
2498 * src/scan-skel.l: Use it.
2499 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2500 * src/parse-skel.y: Use %directives instead of #defines.
2501
25022001-12-30 Akim Demaille <akim@epita.fr>
2503
2504 * src/skeleton.h: New.
2505 * src/output.c (output_parser, output_master_parser): Remove, dead
2506 code.
2507 * src/output.h (get_lines_number, actions_output, guards_output)
2508 (token_definitions_output): Prototype them.
2509 * src/parse-skel.y: Add the license notice.
2510 Include output.h and skeleton.h.
2511 (process_skeleton): Returns void, and takes a single parameter.
2512 * src/scan-skel.l: Add the license notice.
2513 Include skeleton.h.
2514 Don't use %option yylineno: it seems that then Flex imagines
2515 REJECT has been used, and therefore it won't reallocate its
2516 buffers (which makes no other sense to me than a bug). It results
2517 in warnings for `unused: yy_flex_realloc'.
2518
25192001-12-30 Robert Anisko <robert.anisko@epita.fr>
2520
2521 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2522 (MUSCLE_INSERT_PREFIX): ...to there.
2523 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2524 (MUSCLE_INSERT_PREFIX): Move from here...
2525
2526 * src/bison.hairy: Add a section directive. Put braces around muscle
2527 names. This parser skeleton is still broken, but Bison should not
2528 choke on a bad muscle 'syntax'.
2529 * src/bison.simple: Add a section directive. Put braces around muscle
2530 names.
2531
2532 * src/files.h (strsuffix, stringappend): Add declarations.
2533 (tab_extension): Add declaration.
2534 (short_base_name): Add declaration.
2535
2536 * src/files.c (strsuffix, stringappend): No longer static. These
2537 functions are used in the skeleton parser.
2538 (tab_extension): New.
2539 (compute_base_names): Use the computations done in this function
2540 to guess if the generated parsers should have '.tab' in their
2541 names.
2542 (short_base_name): No longer static.
2543
2544 * src/output.c (output_skeleton): New.
2545 (output): Disable call to output_master_parser, and give a try to
2546 a new skeleton handling system.
2547 (guards_output, actions_output): No longer static.
2548 (token_definitions_output, get_lines_number): No longer static.
2549
2550 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2551
2552 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
2553 parse-skel.y.
2554
2555 * src/parse-skel.y: New file.
2556 * src/scan-skel.l: New file.
2557
25582001-12-29 Akim Demaille <akim@epita.fr>
2559
2560 %name-prefix is broken.
2561
2562 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2563 Adjust all dependencies.
2564 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2565 %name-prefix.
2566
2567 Renaming yylval but not yylloc is not consistent. Now we do.
2568
2569 * src/bison.simple: Prefix yylloc if used.
2570 * doc/bison.texinfo (Decl Summary): Document that.
2571
25722001-12-29 Akim Demaille <akim@epita.fr>
2573
2574 * doc/bison.texinfo: Promote `%long-directive' over
2575 `%long_directive'.
2576 Remove all references to fixed-output-files, yacc is enough.
2577
25782001-12-29 Akim Demaille <akim@epita.fr>
2579
2580 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2581 user prologue. These are defaults.
2582 * tests/actions.at (Mid-rule actions): Make sure the user can
2583 define YYDEBUG and YYERROR_VERBOSE.
2584
25852001-12-29 Akim Demaille <akim@epita.fr>
2586
2587 * src/output.c (header_output): Don't forget to export YYLTYPE and
2588 yylloc.
2589 * tests/headers.at (export YYLTYPE): New, make sure it does.
2590 * tests/regression.at (%union and --defines, Invalid CPP headers):
2591 Move to...
2592 * tests/headers.at: here.
2593
25942001-12-29 Akim Demaille <akim@epita.fr>
2595
2596 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2597
25982001-12-29 Akim Demaille <akim@epita.fr>
2599
2600 * tests/actions.at (Mid-rule actions): Output on a single line
2601 instead of several.
2602
26032001-12-29 Akim Demaille <akim@epita.fr>
2604
2605 * doc/bison.texinfo: Formatting changes.
2606
26072001-12-29 Akim Demaille <akim@epita.fr>
2608
2609 Don't store the token defs in a muscle, just be ready to output it
2610 on command. Now possible via `symbols'. Fixes a memory leak.
2611
2612 * src/output.c (token_definitions_output): New.
2613 (output_parser, header_output): Use it.
2614 * src/reader.c (symbols_save): Remove.
2615
26162001-12-29 Akim Demaille <akim@epita.fr>
2617
2618 * src/bison.simple: Do not provide a default for YYSTYPE and
2619 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2620 default.
2621
26222001-12-29 Akim Demaille <akim@epita.fr>
2623
2624 Mid-rule actions are simply... ignored!
2625
2626 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2627 the empty-rule associated to the dummy symbol, not to the host
2628 rule.
2629 * tests/actions.at (Mid-rule actions): New.
2630
26312001-12-29 Akim Demaille <akim@epita.fr>
2632
2633 Memory leak.
2634
2635 * src/reader.c (reader): Free grammar.
2636
26372001-12-29 Akim Demaille <akim@epita.fr>
2638
2639 Memory leak.
2640
2641 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2642 since it allocates it for each state, although only one is needed.
2643 (allocate_storage): Do it here.
2644
26452001-12-29 Akim Demaille <akim@epita.fr>
2646
2647 * src/options.h, src/options.c (create_long_option_table): Rename
2648 as...
2649 (long_option_table_new): this, with a clearer prototype.
2650 (percent_table): Remove, unused,
2651 * src/getargs.c (getargs): Adjust.
2652
26532001-12-29 Akim Demaille <akim@epita.fr>
2654
2655 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2656 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2657 as states.
2658
26592001-12-29 Akim Demaille <akim@epita.fr>
2660
2661 * src/lalr.c (build_relations): Rename `states' as `states1'.
2662 Sorry, I don't understand exactly what it is, no better name...
2663
26642001-12-29 Akim Demaille <akim@epita.fr>
2665
2666 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2667 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2668 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2669 as rules.
2670
26712001-12-29 Akim Demaille <akim@epita.fr>
2672
2673 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2674 ago.
2675
26762001-12-29 Akim Demaille <akim@epita.fr>
2677
2678 * src/reader.c, src/reader.h (user_toknums): Remove.
2679 Adjust all users to use symbols[i]->user_token_number.
2680
26812001-12-29 Akim Demaille <akim@epita.fr>
2682
2683 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2684 Adjust all users to use symbols[i]->prec or ->assoc.
2685
26862001-12-29 Akim Demaille <akim@epita.fr>
2687
2688 * src/reader.c, src/reader.h (tags): Remove.
2689 Adjust all users to use symbols[i]->tag.
2690
26912001-12-29 Akim Demaille <akim@epita.fr>
2692
2693 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2694 and rule_table.
2695 * src/reader.c (packsymbols): Fill this table.
2696 Drop sprec.
2697 * src/conflicts.c (resolve_sr_conflict): Adjust.
2698 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2699 single table.
2700 Use symbols[i]->tag instead of tags[i].
2701
27022001-12-29 Akim Demaille <akim@epita.fr>
2703
2704 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2705 In addition, put a comment in there, to replace...
2706 * tests/regression.at (%union and C comments): Remove.
2707
27082001-12-29 Akim Demaille <akim@epita.fr>
2709
2710 * tests/regression.at (Web2c Actions): Blindly move the actual
2711 output as expected output. The contents *seem* right to me, but I
2712 can't pretend reading perfectly parser tables... Nonetheless, all
2713 the other tests pass correctly, the table look OK, even though the
2714 presence of `$axiom' is to be noted: AFAICS it is useless (but
2715 harmless).
2716
27172001-12-29 Akim Demaille <akim@epita.fr>
2718
2719 * src/reader.c (readgram): Don't add the rule 0 if there were no
2720 rules read. In other words, add it _after_ having performed
2721 grammar sanity checks.
2722 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2723
27242001-12-29 Akim Demaille <akim@epita.fr>
2725
2726 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2727 visible, and some states have now a different number.
2728
27292001-12-29 Akim Demaille <akim@epita.fr>
2730
2731 * src/reader.c (readgram): Bind the initial rule's lineno to that
2732 of the first rule.
2733 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2734 (Solved SR Conflicts): Adjust rule 0's line number.
2735
27362001-12-29 Akim Demaille <akim@epita.fr>
2737
2738 Fix the `GAWK Grammar' failure.
2739
2740 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2741 the reductions of the first state which was mistakenly confused
2742 with the final state because precisely final_state was initialized
2743 to 0.
2744 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2745 now noticed by Bison.
2746 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2747 have a reduction on $default.
2748
27492001-12-29 Akim Demaille <akim@epita.fr>
2750
2751 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2752 rule line numbers.
2753 * src/closure.c (print_closure): Likewise.
2754 * src/derives.c (print_derives): Likewise.
2755 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2756 now.
2757
27582001-12-29 Akim Demaille <akim@epita.fr>
2759
2760 * src/lalr.c (lookaheads_print): New.
2761 (lalr): Call it when --trace-flag.
2762 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2763 are dumped.
2764
27652001-12-29 Akim Demaille <akim@epita.fr>
2766
2767 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2768 when walking through ritem, even via rule->rhs.
2769 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2770 (useful_production, useless_nonterminals): Likewise.
2771 (reduce_grammar_tables): Likewise, plus update nritems.
2772 * src/nullable.c (set_nullable): Likewise.
2773 * src/lalr.c (build_relations): Likewise.
2774 * tests/sets.at (Nullable): Adjust.
2775 Fortunately, now, the $axiom is no longer nullable.
2776
27772001-12-29 Akim Demaille <akim@epita.fr>
2778
2779 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2780 the 0-sentinel.
2781 * src/gram.c (ritem_longest_rhs): Likewise.
2782 * src/reduce.c (nonterminals_reduce): Likewise.
2783 * src/print_graph.c (print_graph): Likewise.
2784 * src/output.c (output_rule_data): Likewise.
2785 * src/nullable.c (set_nullable): Likewise.
2786
27872001-12-29 Akim Demaille <akim@epita.fr>
2788
2789 * src/output.c: Comment changes.
2790
27912001-12-27 Paul Eggert <eggert@twinsun.com>
2792
2793 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2794 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2795 Sparc, as they were causing more porting problems than the
2796 (minor) performance improvement was worth.
2797
2798 Also, catch up with 1.31's YYSTD.
2799
28002001-12-27 Akim Demaille <akim@epita.fr>
2801
2802 * src/output.c (output_gram): Rely on nritems, not the
2803 0-sentinel. See below.
2804 Use -1 as separator, not 0.
2805 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2806 Rely on -1 as separator in yyrhs, instead of 0.
2807 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2808 twice `Now at end of input', therefore there are two lines less to
2809 expect.
2810
28112001-12-27 Akim Demaille <akim@epita.fr>
2812
2813 * tests/regression.at (Unresolved SR Conflicts):
2814 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2815 below.
2816
28172001-12-27 Akim Demaille <akim@epita.fr>
2818
2819 * src/LR0.c (new_state): Recognize the final state by the fact it
2820 is reached by eoftoken.
2821 (insert_start_shifting_state, insert_eof_shifting_state)
2822 (insert_accepting_state, augment_automaton): Remove, since now
2823 these states are automatically computed from the initial state.
2824 (generate_states): Adjust.
2825 * src/print.c: When reporting a rule number to the user, substract
2826 1, so that the axiom rule is rule 0, and the first user rule is 1.
2827 * src/reduce.c: Likewise.
2828 * src/print_graph.c (print_core): For the time being, just as for
2829 the report, depend upon --trace-flags to dump the full set of
2830 items.
2831 * src/reader.c (readgram): Once the grammar read, insert the rule
2832 0: `$axiom: START-SYMBOL $'.
2833 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2834 number of the states has changed (the final state is no longer
2835 necessarily the last), catch up.
2836
28372001-12-27 Akim Demaille <akim@epita.fr>
2838
2839 Try to make the use of the eoftoken valid. Given that its value
2840 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2841 is used instead of > 0 where appropriate, (ii), depend upon nritems
2842 instead of the 0-sentinel.
2843
2844 * src/gram.h, src/gram.c (nritems): New.
2845 Expected to be duplication of nitems, but for the time being...
2846 * src/reader.c (packgram): Assert nritems and nitems are equal.
2847 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2848 * src/closure.c (print_closure, print_fderives): Likewise.
2849 * src/gram.c (ritem_print): Likewise.
2850 * src/print.c (print_core, print_grammar): Likewise.
2851 * src/print_graph.c: Likewise.
2852
28532001-12-27 Akim Demaille <akim@epita.fr>
2854
2855 * src/main.c (main): If there are complains after grammar
2856 reductions, then output the report anyway if requested, then die.
2857 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2858 * src/reader.c (eoftoken): New.
2859 (parse_token_decl): If the token being defined has value `0', it
2860 is the eoftoken.
2861 (packsymbols): No longer hack `tags' to insert `$' by hand.
2862 Be sure to preserve the value of the eoftoken.
2863 (reader): Make sure eoftoken is defined.
2864 Initialize nsyms to 0: now eoftoken is created just like the others.
2865 * src/print.c (print_grammar): Don't special case the eof token.
2866 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2867 lie anyway, albeit pleasant.
2868 * tests/calc.at: Exercise error messages with eoftoken.
2869 Change the grammar so that empty input is invalid.
2870 Adjust expectations.
2871 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2872
28732001-12-27 Akim Demaille <akim@epita.fr>
2874
2875 * configure.in: Check the protos of strchr ans strspn.
2876 Replace strchr if needed.
2877 * src/system.h: Provide the protos of strchr, strspn and memchr if
2878 missing.
2879 * lib/strchr.c: New.
2880 * src/reader.c (symbols_save): Use strchr.
2881
28822001-12-27 Akim Demaille <akim@epita.fr>
2883
2884 * src/print.c, src/print_graph.c (escape): New.
2885 Use it to quote the TAGS outputs.
2886 * src/print_graph.c (print_state): Now errors are in red, and
2887 reductions in green.
2888 Prefer high to wide: output the state number on a line of its own.
2889
28902001-12-27 Akim Demaille <akim@epita.fr>
2891
2892 * src/state.h, src/state.c (reductions_new): New.
2893 * src/LR0.c (set_state_table): Let all the states have a
2894 `reductions', even if reduced to 0.
2895 (save_reductions): Adjust.
2896 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2897 * src/print.c (print_reductions, print_actions): Adjust.
2898 * src/output.c (action_row): Adjust.
2899
29002001-12-27 Akim Demaille <akim@epita.fr>
2901
2902 * src/state.h, src/state.c (errs_new, errs_dup): New.
2903 * src/LR0.c (set_state_table): Let all the states have an errs,
2904 even if reduced to 0.
2905 * src/print.c (print_errs, print_reductions): Adjust.
2906 * src/output.c (output_actions, action_row): Adjust.
2907 * src/conflicts.c (resolve_sr_conflict): Adjust.
2908
29092001-12-27 Akim Demaille <akim@epita.fr>
2910
2911 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2912
29132001-12-27 Akim Demaille <akim@epita.fr>
2914
2915 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2916 * src/print.c: here.
2917 (lookaheadset, shiftset): New, used as additional storage by
2918 print_reductions.
2919 (print_results): Adjust.
2920 (print_shifts, print_gotos, print_errs): New, extracted from...
2921 (print_actions): here.
2922 * src/print_graph.c (print_actions): Remove dead code.
2923
29242001-12-27 Akim Demaille <akim@epita.fr>
2925
2926 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2927 `$n' and `@n'.
2928
29292001-12-27 Akim Demaille <akim@epita.fr>
2930
2931 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2932 (build_relations): Adjust.
2933
29342001-12-27 Akim Demaille <akim@epita.fr>
2935
2936 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2937 duplication.
2938
29392001-12-27 Akim Demaille <akim@epita.fr>
2940
2941 * src/reader.c (packgram): Catch nitems overflows.
2942
29432001-12-27 Akim Demaille <akim@epita.fr>
2944
2945 * src/files.c, src/files.h (guard_obstack): Remove.
2946 * src/output.c (output): Adjust.
2947 * src/reader.c (parse_braces): New, factoring...
2948 (copy_action, copy_guard): these two which are renamed as...
2949 (parse_action, parse_guard): these.
2950 As a voluntary consequence, using braces around guards is now
2951 mandatory.
2952
29532001-12-27 Akim Demaille <akim@epita.fr>
2954
2955 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2956 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2957 members.
2958 (symbol_list_new): Adjust.
2959 (copy_action): action_line is the first line, not the last.
2960 (copy_guard): Just as for actions, store the `action' only, not
2961 the switch/case/break flesh.
2962 Don't parse the user action that might follow the guard, let...
2963 (readgram): do it, i.e., now, there can be an action after a
2964 guard.
2965 In other words the guard is just explicitly optional.
2966 (packgram): Adjust.
2967 * src/output.c (guards_output): New.
2968 (output_parser): Call it when needed.
2969 (output): Also free the guard and attrs obstacks.
2970 * src/files.c, src/files.h (obstack_save): Remove.
2971 (output_files): Remove.
2972 As a result, if one needs the former `.act' file, using an
2973 appropriate skeleton which requires actions and guards is now
2974 required.
2975 * src/main.c (main): Adjust.
2976 * tests/semantic.at: New.
2977 * tests/regression.at: Use `input.y' as input file name.
2978 Avoid 8+3 problems by requiring input.c when the test needs the
2979 parser.
2980
29812001-12-27 Akim Demaille <akim@epita.fr>
2982
2983 * src/reader.c (symbol_list_new): Be sure to initialize all the
2984 fields.
2985
29862001-12-27 Akim Demaille <akim@epita.fr>
2987
2988 All the hacks using a final pseudo state are now useless.
2989
2990 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2991 * src/lalr.c (nLA): New.
2992 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2993 instead of lookaheadsp from the pseudo state (nstate + 1).
2994
29952001-12-27 Akim Demaille <akim@epita.fr>
2996
2997 * src/output.c (action_row, token_actions): Use a state_t instead
2998 of a integer, and nlookaheads instead of the following state's
2999 lookaheadsp.
3000
30012001-12-27 Akim Demaille <akim@epita.fr>
3002
3003 * src/conflicts.c (log_resolution, flush_shift)
3004 (resolve_sr_conflict, set_conflicts, solve_conflicts)
3005 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
3006 (conflicts_print, print_reductions): Use a state_t instead of an
3007 integer when referring to a state.
3008 As much as possible, depend upon nlookaheads, instead of the
3009 `lookaheadsp' member of the following state (since lookaheads of
3010 successive states are successive, the difference between state n + 1
3011 and n served as the number of lookaheads for state n).
3012 * src/lalr.c (add_lookback_edge): Likewise.
3013 * src/print.c (print_core, print_actions, print_state)
3014 (print_results): Likewise.
3015 * src/print_graph.c (print_core, print_actions, print_state)
3016 (print_graph): Likewise.
3017 * src/conflicts.h: Adjust.
3018
30192001-12-27 Akim Demaille <akim@epita.fr>
3020
3021 * src/bison.hairy: Formatting/comment changes.
3022 ANSIfy.
3023 Remove `register' indications.
3024 Add plenty of `static'.
3025
30262001-12-27 Akim Demaille <akim@epita.fr>
3027
3028 * src/output.c (prepare): Drop the muscle `ntbase' which
3029 duplicates ntokens.
3030 * src/bison.simple: Formatting/comment changes.
3031 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
3032 is an undocumented synonym.
3033
30342001-12-22 Akim Demaille <akim@epita.fr>
3035
3036 * src/output.c (output_table_data): Change the prototype to use
3037 `int' for array ranges: some invocations do pass an int, not a
3038 short.
3039 Reported by Wayne Green.
3040
30412001-12-22 Akim Demaille <akim@epita.fr>
3042
3043 Some actions of web2c.y are improperly triggered.
3044 Reported by Mike Castle.
3045
3046 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
3047 * tests/regression.at (Web2c): Rename as...
3048 (Web2c Report): this.
3049 (Web2c Actions): New.
3050
30512001-12-22 Akim Demaille <akim@epita.fr>
3052
3053 Reductions in web2c.y are improperly reported.
3054 Reported by Mike Castle.
3055
3056 * src/conflicts.c (print_reductions): Fix.
3057 * tests/regression.at (Web2c): New.
3058
30592001-12-18 Akim Demaille <akim@epita.fr>
3060
3061 Some host fail on `assert (!"foo")', which expands to
3062 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
3063 Reported by Nelson Beebee.
3064
3065 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
3066 `#define it_succeeded 0' and `assert (it_succeeded)'.
3067
30682001-12-17 Marc Autret <autret_m@epita.fr>
3069
3070 * src/bison.simple: Don't hard code the skeleton line and filename.
3071 * src/output.c (output_parser): Rename 'line' as 'output_line'.
3072 New line counter 'skeleton_line' (skeleton-line muscle).
3073
30742001-12-17 Paul Eggert <eggert@twinsun.com>
3075
3076 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3077 YYDEBUG must be defined to a nonzero value.
3078
3079 * src/bison.simple (yytname): Do not assume that the user defines
3080 YYDEBUG to a properly parenthesized expression.
3081
30822001-12-17 Akim Demaille <akim@epita.fr>
3083
3084 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3085 nlookaheads is a new member.
3086 Adjust all users.
3087 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3088 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3089 state.
3090
30912001-12-17 Akim Demaille <akim@epita.fr>
3092
3093 * src/files.h, src/files.c (open_files, close_files): Remove.
3094 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3095 let...
3096 * src/reader.c (reader): Do it.
3097
30982001-12-17 Akim Demaille <akim@epita.fr>
3099
3100 * src/conflicts.c (print_reductions): Formatting changes.
3101
31022001-12-17 Akim Demaille <akim@epita.fr>
3103
3104 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3105 (flush_reduce): New.
3106 (resolve_sr_conflict): Adjust.
3107
31082001-12-17 Akim Demaille <akim@epita.fr>
3109
3110 * src/output.c (output_obstack): Be static and rename as...
3111 (format_obstack): this, to avoid any confusion with files.c's
3112 output_obstack.
3113 * src/reader.h (muscle_obstack): Move to...
3114 * src/output.h: here, since it's defined in output.c.
3115
31162001-12-17 Akim Demaille <akim@epita.fr>
3117
3118 * src/output.c (action_row, save_column, default_goto)
3119 (sort_actions, matching_state, pack_vector): Better variable
3120 locality.
3121
31222001-12-17 Akim Demaille <akim@epita.fr>
3123
3124 * src/output.c: Various formatting changes.
3125
31262001-12-17 Akim Demaille <akim@epita.fr>
3127
3128 * src/files.c (output_files): Free the output_obstack.
3129 * src/main.c (main): Call print and print_graph conditionally.
3130 * src/print.c (print): Work unconditionally.
3131 * src/print_graph.c (print_graph): Work unconditionally.
3132 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3133
31342001-12-16 Marc Autret <autret_m@epita.fr>
3135
3136 * src/output.c (actions_output): Fix. When we use %no-lines,
3137 there is one less line per action.
3138
31392001-12-16 Marc Autret <autret_m@epita.fr>
3140
3141 * src/bison.simple: Remove a useless #line directive.
3142 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3143 * src/output.c (get_lines_number): New.
3144 (output_parser): Adjust, now takes care about the lines of a
3145 output muscles.
3146 Fix line numbering.
3147 (actions_output): Computes the number of lines taken by actions.
3148 (output_master_parser): Insert new skeleton which is the name of
3149 the output parser file name.
3150
31512001-12-15 Marc Autret <autret_m@epita.fr>
3152
3153 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3154
31552001-12-15 Marc Autret <autret_m@epita.fr>
3156
3157 * src/output.c (output_gram): Keep track of the hairy one.
3158
31592001-12-15 Akim Demaille <akim@epita.fr>
3160
3161 Make `make distcheck' work.
3162
3163 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3164 system.h which uses libgettext.h.
3165
31662001-12-15 Akim Demaille <akim@epita.fr>
3167
3168 * src/nullable.c (set_nullable): Useless rules must be skipped,
3169 otherwise, since we range over their symbols, we might look at a
3170 nonterminal which no longer ``exists'', i.e., it is not counted in
3171 `nvars', hence we overflow our arrays.
3172
31732001-12-15 Akim Demaille <akim@epita.fr>
3174
3175 The header can also be produced directly, without any obstack!
3176 Yahoo!
3177
3178 * src/files.c, src/files.h (defines_obstack): Remove.
3179 (compute_header_macro): Global.
3180 (defines_obstack_save): Remove.
3181 * src/reader.c (parse_union_decl): No longer output to
3182 defines_obstack: its content can be found in the `stype' muscle
3183 anyway.
3184 (output_token_translations): Merge into...
3185 (symbols_output): this.
3186 Rename as...
3187 (symbols_save): this.
3188 (reader): Adjust.
3189 * src/output.c (header_output): New.
3190 (output): Call it.
3191
31922001-12-15 Akim Demaille <akim@epita.fr>
3193
3194 * src/reader.c (parse_union_decl): Instead of handling two obstack
3195 simultaneously, use one to define the `stype' muscle, and use the
3196 value of the latter to fill defines_obstack.
3197 (copy_comment): Remove.
3198 (copy_comment2): Work for a single obstack.
3199 Rename as...
3200 (copy_comment): this.
3201
32022001-12-15 Akim Demaille <akim@epita.fr>
3203
3204 * src/lex.c, src/lex.h (xgetc): No longer static.
3205 * src/reader.c (parse_union_decl): Revamp.
3206
32072001-12-15 Akim Demaille <akim@epita.fr>
3208
3209 Still making progress in separating Bison into (i) input, (ii)
3210 process, (iii) output: now we can directly output the parser file
3211 without using table_obstack at all.
3212
3213 * src/files.c, src/files.h (table_obstack): Bye bye.
3214 (parser_file_name): New.
3215 * src/files.c (compute_output_file_names): Compute it.
3216 * src/output.c (actions_output, output_parser)
3217 (output_master_parser): To a file instead of an obstack.
3218
32192001-12-15 Akim Demaille <akim@epita.fr>
3220
3221 Attach actions to rules, instead of pre-outputting them to
3222 actions_obstack.
3223
3224 * src/gram.h (rule_t): action and action_line are new members.
3225 * src/reader.c (symbol_list): Likewise.
3226 (copy_action): Save the actions within the rule.
3227 (packgram): Save them in rule_table.
3228 * src/output.c (actions_output): New.
3229 (output_parser): Use it on `%%actions'.
3230 (output_rule_data): Don't free rule_table.
3231 (output): Do it.
3232 (prepare): Don't save the `action' muscle.
3233 * src/bison.simple: s/%%action/%%actions/.
3234
32352001-12-15 Akim Demaille <akim@epita.fr>
3236
3237 * src/reader.c (copy_action): When --yacc, don't append a `;'
3238 to the user action: let it fail if lacking.
3239 Suggested by Arnold Robbins and Tom Tromey.
3240
32412001-12-14 Akim Demaille <akim@epita.fr>
3242
3243 * src/lex.c (literalchar): Simply return the char you decoded, non
3244 longer mess around with obstacks and int pointers.
3245 Adjust all callers.
3246
32472001-12-14 Akim Demaille <akim@epita.fr>
3248
3249 * src/lex.c (literalchar): Don't escape the special characters,
3250 just decode them, and keep them as char (before, eol was output as
3251 the 2 char string `\n' etc.).
3252 * src/output.c (output_rule_data): Use quotearg to output the
3253 token strings.
3254
32552001-12-13 Paul Eggert <eggert@twinsun.com>
3256
3257 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3258 Do not infringe on the global user namespace when using C++.
3259 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3260 All uses of `fprintf' and `stderr' changed.
3261
3262 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3263
32642001-12-13 Akim Demaille <akim@epita.fr>
3265
3266 The computation of nullable is broken: it doesn't handle empty
3267 RHS's properly.
3268
3269 * tests/torture.at (GNU AWK Grammar): New.
3270 * tests/sets.at (Nullable): New.
3271 * src/nullable.c (set_nullable): Instead of blindly looping over
3272 `ritems', loop over the rules, and then over their rhs's.
3273
3274 Work around Autotest bugs.
3275
3276 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3277 frame, because Autotest understand lines starting with a `+' as
3278 traces from the shell. Then, they are not processed properly.
3279 Admittedly an Autotest bug, but we don't have time to wait for
3280 Autotest to catch up.
3281 * tests/regression.at (Broken Closure): Adjust to the new table
3282 frames.
3283 Move to...
3284 * tests/sets.at: here.
3285
32862001-12-13 Akim Demaille <akim@epita.fr>
3287
3288 * src/closure.c (closure): Use nrules instead of playing tricks
3289 with BITS_PER_WORD.
3290
32912001-12-13 Akim Demaille <akim@epita.fr>
3292
3293 * src/print.c (print_actions): Output the handling of `$' as the
3294 traces do: shifting the token EOF. Before EOF was treated as a
3295 nonterminal.
3296 * tests/regression.at: Adjust some tests.
3297 * src/print_graph.c (print_core): Complete the set of items via
3298 closure. The next-to-final and final states are still unsatisfying,
3299 but that's to be addressed elsewhere.
3300 No longer output the rule numbers, but do output the state number.
3301 A single loop for the shifts + gotos is enough, but picked a
3302 distinct color for each.
3303 (print_graph): Initialize and finalize closure.
3304
33052001-12-13 Akim Demaille <akim@epita.fr>
3306
3307 * src/reader.c (readgram): Remove dead code, an strip useless
3308 braces.
3309 (get_type): Remove, unused.
3310
33112001-12-12 Akim Demaille <akim@epita.fr>
3312
3313 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3314 on that of lib/error.c.
3315
33162001-12-12 Akim Demaille <akim@epita.fr>
3317
3318 Some hosts don't like `/' in includes.
3319
3320 * src/system.h: Include libgettext.h without qualifying the path.
3321 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3322 $(top_srcdir).
3323
33242001-12-11 Marc Autret <autret_m@epita.fr>
3325
3326 * src/output.c (output_parser): Remove useless muscle.
3327
33282001-12-11 Marc Autret <autret_m@epita.fr>
3329
3330 * src/bison.simple: Remove #line just before %%epilogue. It
3331 is now handled in ...
3332 * src/reader.c (read_additionnal_code): Add the output of a
3333 #line for the epilogue.
3334
33352001-12-10 Marc Autret <autret_m@epita.fr>
3336
3337 * src/reader.c (copy_definition): Re-use CPP-outed code which
3338 replace precedent remove.
3339 * src/bison.simple: Remove #line before %%prologue because
3340 %%input-line is wrong at this time.
3341
33422001-12-10 Marc Autret <autret_m@epita.fr>
3343
3344 * src/reader.c (symbols_output): Clean up.
3345 * src/output.c (output_gram, output): Clean up.
3346
33472001-12-10 Akim Demaille <akim@epita.fr>
3348
3349 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3350 * src/LR0.c (set_state_table): here.
3351 * src/lalr.c (lalr): Call it.
3352
33532001-12-10 Akim Demaille <akim@epita.fr>
3354
3355 * src/state.h (shifts): Remove the `number' member: shifts are
3356 attached to state, hence no longer need to be labelled with a
3357 state number.
3358
33592001-12-10 Akim Demaille <akim@epita.fr>
3360
3361 Now that states have a complete set of members, the linked list of
3362 shifts is useless: just fill directly the state's shifts member.
3363
3364 * src/state.h (shifts): Remove the `next' member.
3365 * src/LR0.c (first_state, last_state): Remove.
3366 Adjust the callers.
3367 (augment_automaton): Don't look for the shifts that must be added
3368 a shift on EOF: it is those of the state we looked for! But now,
3369 since shifts are attached, it is no longer needed to looking
3370 merely by its id: its number.
3371
33722001-12-10 Akim Demaille <akim@epita.fr>
3373
3374 * src/LR0.c (augment_automaton): Better variable locality.
3375 Remove an impossible branch: if there is a state corresponding to
3376 the start symbol being shifted, then there is shift for the start
3377 symbol from the initial state.
3378
33792001-12-10 Akim Demaille <akim@epita.fr>
3380
3381 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3382 only when appropriate: when insert_start_shifting_state' is not
3383 invoked.
3384 * tests/regression.at (Rule Line Numbers): Adjust.
3385
33862001-12-10 Akim Demaille <akim@epita.fr>
3387
3388 * src/LR0.c (augment_automaton): Now that all states have shifts,
3389 merge the two cases addition shifts to the initial state.
3390
33912001-12-10 Akim Demaille <akim@epita.fr>
3392
3393 * src/lalr.c (set_state_table): Move to...
3394 * src/LR0.c: here.
3395 * src/lalr.c (lalr): Don't call it...
3396 * src/LR0.c (generate_states): do it.
3397 * src/LR0.h (first_state): Remove, only the table is used.
3398
33992001-12-10 Akim Demaille <akim@epita.fr>
3400
3401 * src/LR0.h (first_shift, first_reduction): Remove.
3402 * src/lalr.c: Don't use first_shift: find shifts through the
3403 states.
3404
34052001-12-10 Akim Demaille <akim@epita.fr>
3406
3407 * src/LR0.c: Attach shifts to states as soon as they are
3408 computed.
3409 * src/lalr.c (set_state_table): Instead of assigning shifts to
3410 state, just assert that the mapping was properly done.
3411
34122001-12-10 Akim Demaille <akim@epita.fr>
3413
3414 * src/LR0.c (insert_start_shift): Rename as...
3415 (insert_start_shifting_state): this.
3416 (insert_eof_shifting_state, insert_accepting_state): New.
3417 (augment_automaton): Adjust.
3418 Better locality of the variables.
3419 When looking if the start_symbol is shifted from the initial
3420 state, using `while (... symbol != start_symbol ...)' sounds
3421 better than `while (... symbol < start_symbol ...)': If fail
3422 to see how the order between symbols could be relevant!
3423
34242001-12-10 Akim Demaille <akim@epita.fr>
3425
3426 * src/getargs.h: Don't declare `spec_name_prefix' and
3427 `spec_file_prefix', declared by src/files.h.
3428 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3429 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3430 * src/output.c (prepare): Adjust.
3431 * src/reader.c (symbols_output): Likewise.
3432 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3433
34342001-12-10 Akim Demaille <akim@epita.fr>
3435
3436 * src/muscle_tab.c (muscle_init): NULL is a better default than
3437 `"0"'.
3438
34392001-12-10 Akim Demaille <akim@epita.fr>
3440
3441 * src/reader.c (reader): Calling symbols_output once is enough.
3442
34432001-12-10 Akim Demaille <akim@epita.fr>
3444
3445 Now that states have a complete set of members, the linked list of
3446 reductions is useless: just fill directly the state's reductions
3447 member.
3448
3449 * src/state.h (struct reductions): Remove member `number' and
3450 `next'.
3451 * src/LR0.c (first_reduction, last_reduction): Remove.
3452 (save_reductions): Don't link the new reductions, store them in
3453 this_state.
3454 * src/lalr.c (set_state_table): No need to attach reductions to
3455 states, it's already done.
3456 * src/output.c (output_actions): No longer free the shifts, then
3457 the reductions, then the states: free all the states and their
3458 members.
3459
34602001-12-10 Akim Demaille <akim@epita.fr>
3461
3462 * src/options.c (OPTN, DRTV, BOTH): New.
3463 (option_table): Use them.
3464
3465 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3466 the job of system.h.
3467 * src/options.c: Don't include stdio.h and xalloc.h for the same
3468 reasons.
3469
34702001-12-10 Akim Demaille <akim@epita.fr>
3471
3472 * src/output.c (output, prepare): Make sure the values of the
3473 muscles `action' and `prologue' are 0-terminated.
3474
34752001-12-10 Akim Demaille <akim@epita.fr>
3476
3477 Clean up GCC warnings.
3478
3479 * src/reader.c (copy_action): `buf' is not used.
3480 (parse_skel_decl): Be static.
3481 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3482 * src/options.h (create_long_option_table): Have a real prototype.
3483 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3484 (hash_delete_at): Return const void *.
3485 Adjust casts to preserve the const.
3486
34872001-12-10 Akim Demaille <akim@epita.fr>
3488
3489 * configure.in: Require 2.52g.
3490 M4 is not needed, but AUTOM4TE is.
3491 * m4/m4.m4: Remove.
3492 * tests/Makefile.am: Adjust.
3493
34942001-12-10 Akim Demaille <akim@epita.fr>
3495
3496 One structure for states is enough, even though theoretically
3497 there are LR(0) states and LALR(1) states.
3498
3499 * src/lalr.h (state_t): Remove.
3500 (state_table): Be state_t **, not state_t *.
3501 * src/state.h (core, CORE_ALLOC): Rename as...
3502 (state_t, STATE_ALLOC): this.
3503 Add the LALR(1) members: shifts, reductions, errs.
3504 * src/LR0.c (state_table): Rename as...
3505 (state_hash): this, to avoid name clashes with the global
3506 `state_table'.
3507 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3508 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3509
35102001-12-10 Akim Demaille <akim@epita.fr>
3511
3512 Bison dumps core on bash.y.
3513 Reported by Pascal Bart.
3514
3515 * src/warshall.c (bitmatrix_print): New.
3516 (TC): Use it.
3517 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3518 j must be the outer loop.
3519 * tests/regression.at (Broken Closure): New.
3520
35212001-12-05 Akim Demaille <akim@epita.fr>
3522
3523 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3524 its argument.
3525