]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Have the GLR tests be `warning' checked, and fix the warnings.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-06-30 Akim Demaille <akim@epita.fr>
2
3 Have the GLR tests be `warning' checked, and fix the warnings.
4
5 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
6 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
7 (yyremoveDeletes): `yyi' and `yyj' are size_t.
8 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
9 (yyaddDeferredAction): static.
10 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
11 (yyreportParseError): yyprefix is const.
12 yytokenp is used only when verbose.
13 (yy__GNUC__): Replace with __GNUC__.
14 (yypdumpstack): yyi is size_t.
15 (yypreference): Un-yy local variables and arguments, to avoid
16 clashes with `yyr1'. Anyway, we are not in the user name space.
17 (yytname_size): be an int, as is compared with ints.
18 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
19 Use them.
20 * tests/cxx-gram.at: Use quotation to protect $1.
21 Use AT_COMPILE to enable warnings hunts.
22 Prototype yylex and yyerror.
23 `Use' argc.
24 Include `string.h', not `strings.h'.
25 Produce and prototype stmtMerge only when used.
26 yylex takes a location.
27
28
292002-06-30 Akim Demaille <akim@epita.fr>
30
31 We spend a lot of time in quotearg, in particular when --verbose.
32
33 * src/symtab.c (symbol_get): Store a quoted version of the key.
34 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
35 Adjust all callers.
36
37
382002-06-30 Akim Demaille <akim@epita.fr>
39
40 * src/state.h (reductions_t): Rename member `nreds' as num.
41 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
42 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
43
44
452002-06-30 Akim Demaille <akim@epita.fr>
46
47 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
48 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
49 (shifts_to): Rename as...
50 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
51 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
52 (TRANSITION_IS_DISABLED, transitions_to): these.
53
54
552002-06-30 Akim Demaille <akim@epita.fr>
56
57 * src/print.c (print_shifts, print_gotos): Merge into...
58 (print_transitions): this.
59 (print_transitions, print_errs, print_reductions): Align the
60 lookaheads columns.
61 (print_core, print_transitions, print_errs, print_state,
62 print_grammar): Output empty lines separator before, not after.
63 (state_default_rule_compute): Rename as...
64 (state_default_rule): this.
65 * tests/conflicts.at (Defaulted Conflicted Reduction),
66 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
67 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
68
692002-06-30 Akim Demaille <akim@epita.fr>
70
71 Display items as we display rules.
72
73 * src/gram.h, src/gram.c (rule_lhs_print): New.
74 * src/gram.c (grammar_rules_partial_print): Use it.
75 * src/print.c (print_core): Likewise.
76 * tests/conflicts.at (Defaulted Conflicted Reduction),
77 (Unresolved SR Conflicts): Adjust.
78 (Unresolved SR Conflicts): Adjust and rename as...
79 (Resolved SR Conflicts): this, as was meant.
80 * tests/regression.at (Web2c Report): Adjust.
81
822002-06-30 Akim Demaille <akim@epita.fr>
83
84 * src/print.c (state_default_rule_compute): New, extracted from...
85 (print_reductions): here.
86 Pessimize, but clarify the code.
87 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
88
892002-06-30 Akim Demaille <akim@epita.fr>
90
91 * src/output.c (action_row): Let default_rule be always a rule
92 number.
93
94
952002-06-30 Akim Demaille <akim@epita.fr>
96
97 * src/closure.c (print_firsts, print_fderives, closure):
98 Use BITSET_EXECUTE.
99 * src/lalr.c (lookaheads_print): Likewise.
100 * src/state.c (state_rule_lookaheads_print): Likewise.
101 * src/print_graph.c (print_core): Likewise.
102 * src/print.c (print_reductions): Likewise.
103 * src/output.c (action_row): Likewise.
104 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
105
106
1072002-06-30 Akim Demaille <akim@epita.fr>
108
109 * src/print_graph.c: Use report_flag.
110
111
1122002-06-30 Akim Demaille <akim@epita.fr>
113
114 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
115 to...
116 * src/relation.h, src/relation.c (traverse, relation_digraph)
117 (relation_print, relation_transpose): New.
118
119
1202002-06-30 Akim Demaille <akim@epita.fr>
121
122 * src/state.h, src/state.c (shifts_to): New.
123 * src/lalr.c (build_relations): Use it.
124
125
1262002-06-30 Akim Demaille <akim@epita.fr>
127
128 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
129 (item_number_of_rule_number, rule_number_of_item_number): New.
130 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
131 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
132 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
133 Propagate their use.
134 Much remains to be done, in particular wrt `shorts' from types.h.
135
136
1372002-06-30 Akim Demaille <akim@epita.fr>
138
139 * src/symtab.c (symbol_new): Initialize the `printer' member.
140
141
1422002-06-30 Akim Demaille <akim@epita.fr>
143
144 * src/LR0.c (save_reductions): Remove, replaced by...
145 * src/state.h, src/state.c (state_reductions_set): New.
146 (reductions, errs): Rename as...
147 (reductions_t, errs_t): these.
148 Adjust all dependencies.
149
150
1512002-06-30 Akim Demaille <akim@epita.fr>
152
153 * src/LR0.c (state_list_t, state_list_append): New.
154 (first_state, last_state): Now symbol_list_t.
155 (this_state): Remove.
156 (new_itemsets, append_states, save_reductions): Take a state_t as
157 argument.
158 (set_states, generate_states): Adjust.
159 (save_shifts): Remove, replaced by...
160 * src/state.h, src/state.c (state_shifts_set): New.
161 (shifts): Rename as...
162 (shifts_t): this.
163 Adjust all dependencies.
164 * src/state.h (state_t): Remove the `next' member.
165
166
1672002-06-30 Akim Demaille <akim@epita.fr>
168
169 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
170 escaped in slot 0.
171
172
1732002-06-30 Akim Demaille <akim@epita.fr>
174
175 Use hash.h for the state hash table.
176
177 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
178 (allocate_storage): Use state_hash_new.
179 (free_storage): Use state_hash_free.
180 (new_state, get_state): Adjust.
181 * src/lalr.h, src/lalr.c (states): Move to...
182 * src/states.h (state_t): Remove the `link' member, no longer
183 used.
184 * src/states.h, src/states.c: here.
185 (state_hash_new, state_hash_free, state_hash_lookup)
186 (state_hash_insert, states_free): New.
187 * src/states.c (state_table, state_compare, state_hash): New.
188 * src/output.c (output_actions): Do not free states now, since we
189 still need to know the final_state number in `prepare', called
190 afterwards. Do it...
191 * src/main.c (main): here: call states_free after `output'.
192
193
1942002-06-30 Akim Demaille <akim@epita.fr>
195
196 Use hash.h for the state hash table.
197
198 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
199 (allocate_storage): Use state_hash_new.
200 (free_storage): Use state_hash_free.
201 (new_state, get_state): Adjust.
202 * src/lalr.h, src/lalr.c (states): Move to...
203 * src/states.h (state_t): Remove the `link' member, no longer
204 used.
205 * src/states.h, src/states.c: here.
206 (state_hash_new, state_hash_free, state_hash_lookup)
207 (state_hash_insert, states_free): New.
208 * src/states.c (state_table, state_compare, state_hash): New.
209 * src/output.c (output_actions): Do not free states now, since we
210 still need to know the final_state number in `prepare', called
211 afterwards. Do it...
212 * src/main.c (main): here: call states_free after `output'.
213
214
2152002-06-30 Akim Demaille <akim@epita.fr>
216
217 * src/state.h, src/state.c (state_new): New, extracted from...
218 * src/LR0.c (new_state): here.
219 * src/state.h (STATE_ALLOC): Move to...
220 * src/state.c: here.
221 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
222 * src/state.h, src/state.c: here.
223
224
2252002-06-30 Akim Demaille <akim@epita.fr>
226
227 * src/reader.c (gensym): Rename as...
228 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
229 (getsym): Rename as...
230 (symbol_get): this.
231
232
2332002-06-30 Akim Demaille <akim@epita.fr>
234
235 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
236 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
237 * src/output.c, src/print.c, src/print_graph.c: Propagate.
238 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
239
2402002-06-30 Akim Demaille <akim@epita.fr>
241
242 Make the test suite pass with warnings checked.
243
244 * tests/actions.at (Printers and Destructors): Improve.
245 Avoid unsigned vs. signed issues.
246 * tests/calc.at: Don't exercise the scanner here, do it...
247 * tests/input.at (Torturing the Scanner): here.
248
249
2502002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
251
252 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
253 reorganize first lines parallel to yacc.c.
254
2552002-06-28 Akim Demaille <akim@epita.fr>
256
257 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
258 (b4_token_enum, b4_token_defines): New, factored from...
259 * data/lalr1.cc, data/yacc.c, glr.c: here.
260
2612002-06-28 Akim Demaille <akim@epita.fr>
262
263 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
264 unused variables.
265 * src/output.c (merger_output): static.
266
2672002-06-28 Akim Demaille <akim@epita.fr>
268
269 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
270 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
271 pacify GCC.
272 * src/output.c (save_row): Initialize all the variables to pacify GCC.
273
2742002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
275
276 Accumulated changelog for new GLR parsing features.
277
278 * src/conflicts.c (count_total_conflicts): Change name to
279 conflicts_total_count.
280 * src/conflicts.h: Ditto.
281 * src/output.c (token_actions): Use the new name.
282 (output_conflicts): Change conflp => conflict_list_heads, and
283 confl => conflict_list for better readability.
284 * data/glr.c: Use the new names.
285 * NEWS: Add self to GLR announcement.
286
287 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
288
289 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
290 Akim Demaille.
291
292 * data/bison.glr: Change name to glr.c
293 * data/glr.c: Renamed from bison.glr.
294 * data/Makefile.am: Add glr.c
295
296 * src/getargs.c:
297
298 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
299 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
300
301 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
302
303 * data/bison.glr: Be sure to restore the
304 current #line when returning to the skeleton contents after having
305 exposed the input file's #line.
306
307 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
308
309 * data/bison.glr: Bring up to date with changes to bison.simple.
310
311 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
312
313 * data/bison.glr: Correct definitions that use b4_prefix.
314 Various reformatting.
315 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
316 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
317 yytokenp argument; now part of stack.
318 (yychar): Define to behave as documented.
319 (yyclearin): Ditto.
320
321 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
322
323 * src/reader.h: Add declaration for free_merger_functions.
324
325 * src/reader.c (merge_functions): New variable.
326 (get_merge_function): New function.
327 (free_merger_functions): New function.
328 (readgram): Check for %prec that is not followed by a symbol.
329 Handle %dprec and %merge declarations.
330 (packgram): Initialize dprec and merger fields in rules array.
331
332 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
333 conflict_list_cnt, conflict_list_free): New variables.
334 (table_grow): Also grow conflict_table.
335 (prepare_rules): Output dprec and merger tables.
336 (conflict_row): New function.
337 (action_row): Output conflict lists for GLR parser. Don't use
338 default reduction in conflicted states for GLR parser so that there
339 are spaces for the conflict lists.
340 (save_row): Also save conflict information.
341 (token_actions): Allocate conflict list.
342 (merger_output): New function.
343 (pack_vector): Pack conflict table, too.
344 (output_conflicts): New function to output yyconflp and yyconfl.
345 (output_check): Allocate conflict_tos.
346 (output_actions): Output conflict tables, also.
347 (output_skeleton): Output b4_mergers definition.
348 (prepare): Output b4_max_rhs_length definition.
349 Use 'bison.glr' as default skeleton for GLR parsers.
350
351 * src/gram.c (glr_parser): New flag.
352 (grammar_free): Call free_merger_functions.
353
354 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
355 all pairs of conflicting reductions, rather than just all tokens
356 causing conflicts. Needed to size conflict tables.
357 (conflicts_output): Modify call to count_rr_conflicts for new
358 interface.
359 (conflicts_print): Ditto.
360 (count_total_conflicts): New function.
361
362 * src/reader.h (merger_list): New type.
363 (merge_functions): New variable.
364
365 * src/lex.h (tok_dprec, tok_merge): New token types.
366
367 * src/gram.h (rule_s): Add dprec and merger fields.
368 (glr_parser): New flag.
369
370 * src/conflicts.h (count_total_conflicts): New function.
371
372 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
373
374 * doc/bison.texinfo (Generalized LR Parsing): New section.
375 (GLR Parsers): New section.
376 (Language and Grammar): Mention GLR parsing.
377 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
378 Correct typo ("tge" -> "the").
379
380 * data/bison.glr: New skeleton for GLR parsing.
381
382 * tests/cxx-gram.at: New tests for GLR parsing.
383
384 * tests/testsuite.at: Include cxx-gram.at.
385
386 * tests/Makefile.am: Add cxx-gram.at.
387
388 * src/parse-gram.y:
389
390 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
391
392 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
393
3942002-06-27 Akim Demaille <akim@epita.fr>
395
396 * src/options.h, src/options.c: Remove.
397 * src/getargs.c (short_options, long_options): New.
398
3992002-06-27 Akim Demaille <akim@epita.fr>
400
401 * data/bison.simple, data/bison.c++: Rename as...
402 * data/yacc.c, data/lalr1.cc: these.
403 * doc/bison.texinfo (Environment Variables): Remove.
404
4052002-06-25 Raja R Harinath <harinath@cs.umn.edu>
406
407 * src/getargs.c (report_argmatch): Initialize strtok().
408
4092002-06-20 Akim Demaille <akim@epita.fr>
410
411 * data/bison.simple (b4_symbol_actions): New, replaces...
412 (b4_symbol_destructor, b4_symbol_printer): these.
413 (yysymprint): Be sure to call YYPRINT only for tokens, and using
414 user token numbers.
415
4162002-06-20 Akim Demaille <akim@epita.fr>
417
418 * data/bison.simple (yydestructor): Rename as...
419 (yydestruct): this.
420
4212002-06-20 Akim Demaille <akim@epita.fr>
422
423 * src/symtab.h, src/symtab.c (symbol_type_set)
424 (symbol_destructor_set, symbol_precedence_set): The location is
425 the last argument.
426 Adjust all callers.
427
4282002-06-20 Akim Demaille <akim@epita.fr>
429
430 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
431 internals.
432 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
433 Takes a location.
434 * src/symtab.h, src/symtab.c (symbol_class_set)
435 (symbol_user_token_number_set): Likewise.
436 Adjust all callers.
437 Promote complain_at.
438 * tests/input.at (Type Clashes): Adjust.
439
4402002-06-20 Akim Demaille <akim@epita.fr>
441
442 * data/bison.simple (YYLEX): Fix the declaration when
443 %pure-parser.
444
4452002-06-20 Akim Demaille <akim@epita.fr>
446
447 * data/bison.simple (yysymprint): Don't print the token number,
448 just its name.
449 * tests/actions.at (Destructors): Rename as...
450 (Printers and Destructors): this.
451 Also exercise %printer.
452
4532002-06-20 Akim Demaille <akim@epita.fr>
454
455 * data/bison.simple (YYDSYMPRINT): New.
456 Use it to remove many of the #if YYDEBUG/if (yydebug).
457
4582002-06-20 Akim Demaille <akim@epita.fr>
459
460 * src/symtab.h, src/symtab.c (symbol_t): printer and
461 printer_location are new members.
462 (symbol_printer_set): New.
463 * src/parse-gram.y (PERCENT_PRINTER): New token.
464 Handle its associated rule.
465 * src/scan-gram.l: Adjust.
466 (handle_destructor_at, handle_destructor_dollar): Rename as...
467 (handle_symbol_code_at, handle_symbol_code_dollar): these.
468 * src/output.c (symbol_printers_output): New.
469 (output_skeleton): Call it.
470 * data/bison.simple (yysymprint): New. Cannot be named yyprint
471 since there are already many grammar files with a user `yyprint'.
472 Replace the calls to YYPRINT to calls to yysymprint.
473 * tests/calc.at: Adjust.
474 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
475 taking advantage of parser very internal details (stack size!).
476
4772002-06-20 Akim Demaille <akim@epita.fr>
478
479 * src/scan-gram.l: Complete the scanner with the missing patterns
480 to pacify Flex.
481 Use `quote' and `symbol_tag_get' where appropriate.
482
4832002-06-19 Akim Demaille <akim@epita.fr>
484
485 * tests/actions.at (Destructors): Augment to test locations.
486 * data/bison.simple (yydestructor): Pass it the current location
487 if locations are enabled.
488 Prototype only when __STDC__ or C++.
489 Change the argument names to move into the yy name space: there is
490 user code here.
491
4922002-06-19 Akim Demaille <akim@epita.fr>
493
494 * data/bison.simple (b4_pure_if): New.
495 Use it instead of #ifdef YYPURE.
496
4972002-06-19 Akim Demaille <akim@epita.fr>
498
499 * data/bison.simple (b4_location_if): New.
500 Use it instead of #ifdef YYLSP_NEEDED.
501
5022002-06-19 Akim Demaille <akim@epita.fr>
503
504 Prepare @$ in %destructor, but currently don't bind it in the
505 skeleton, as %location use is not cleaned up yet.
506
507 * src/scan-gram.l (handle_dollar, handle_destructor_at)
508 (handle_action_at): New.
509 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
510 a braced_code_t and a location as additional arguments.
511 (handle_destructor_dollar): Instead of requiring `b4_eval', just
512 unquote one when outputting `b4_dollar_dollar'.
513 Adjust callers.
514 * data/bison.simple (b4_eval): Remove.
515 (b4_symbol_destructor): Adjust.
516 * tests/input.at (Invalid @n): Adjust.
517
5182002-06-19 Zack Weinberg <zack@codesourcery.com>
519
520 * doc/bison.texinfo: Document ability to have multiple
521 prologue sections.
522
5232002-06-18 Akim Demaille <akim@epita.fr>
524
525 * src/files.c (compute_base_names): When computing the output file
526 names from the input file name, strip the directory part.
527
5282002-06-18 Akim Demaille <akim@epita.fr>
529
530 * data/bison.simple.new: Comment changes.
531 Reported by Andreas Schwab.
532
5332002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
534
535 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
536 there are no `label `yyoverflowlab' defined but not used' warnings
537 when yyoverflow is defined.
538
5392002-06-18 Akim Demaille <akim@epita.fr>
540
541 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
542 new member.
543 (symbol_destructor_set): Adjust.
544 * src/output.c (symbol_destructors_output): Output the destructor
545 locations.
546 Output the symbol name.
547 * data/bison.simple (b4_symbol_destructor): Adjust.
548
5492002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
550 and Akim Demaille <akim@epita.fr>
551
552 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
553 what's left on the stack when the error recovery hits EOF.
554 * tests/actions.at (Destructors): Complete to exercise this case.
555
5562002-06-17 Akim Demaille <akim@epita.fr>
557
558 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
559 arguments is really empty, not only equal to `[]'.
560 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
561 member.
562 (symbol_destructor_set): New.
563 * src/output.c (symbol_destructors_output): New.
564 * src/reader.h (brace_code_t, current_braced_code): New.
565 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
566 (handle_dollar): Rename as...
567 (handle_action_dollar): this.
568 (handle_destructor_dollar): New.
569 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
570 (grammar_declaration): Use it.
571 * data/bison.simple (yystos): Is always defined.
572 (yydestructor): New.
573 * tests/actions.at (Destructors): New.
574 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
575
5762002-06-17 Akim Demaille <akim@epita.fr>
577
578 * src/symlist.h, src/symlist.c (symbol_list_length): New.
579 * src/scan-gram.l (handle_dollar, handle_at): Compute the
580 rule_length only when needed.
581 * src/output.c (actions_output, token_definitions_output): Output
582 the full M4 block.
583 * src/symtab.c: Don't access directly to the symbol tag, use
584 symbol_tag_get.
585 * src/parse-gram.y: Use symbol_list_free.
586
5872002-06-17 Akim Demaille <akim@epita.fr>
588
589 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
590 (symbol_list_prepend, get_type_name): Move to...
591 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
592 (symbol_list_prepend, symbol_list_n_type_name_get): here.
593 Adjust all callers.
594 (symbol_list_free): New.
595 * src/scan-gram.l (handle_dollar): Takes a location.
596 * tests/input.at (Invalid $n): Adjust.
597
5982002-06-17 Akim Demaille <akim@epita.fr>
599
600 * src/reader.h, src/reader.c (symbol_list_new): Export it.
601 (symbol_list_prepend): New.
602 * src/parse-gram.y (%union): `list' is a new member.
603 (symbols.1): New, replaces...
604 (terms_to_prec.1, nterms_to_type.1): these.
605 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
606 Take a location as additional argument.
607 Adjust all callers.
608
6092002-06-15 Akim Demaille <akim@epita.fr>
610
611 * src/parse-gram.y: Move %token in the declaration section so that
612 we don't depend upon CVS Bison.
613
6142002-06-15 Akim Demaille <akim@epita.fr>
615
616 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
617 * src/print.c (print_core): Use it.
618
6192002-06-15 Akim Demaille <akim@epita.fr>
620
621 * src/conflicts.c (log_resolution): Accept the rule involved in
622 the sr conflicts instead of the lookahead number that points to
623 that rule.
624 (flush_reduce): Accept the current lookahead vector as argument,
625 instead of the index in LA.
626 (resolve_sr_conflict): Accept the current number of lookahead
627 bitset to consider for the STATE, instead of the index in LA.
628 (set_conflicts): Adjust.
629 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
630
6312002-06-15 Akim Demaille <akim@epita.fr>
632
633 * src/state.h (state_t): Replace the `lookaheadsp' member, a
634 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
635 Adjust all dependencies.
636 * src/lalr.c (initialize_lookaheads): Split into...
637 (states_lookaheads_count, states_lookaheads_initialize): these.
638 (lalr): Adjust.
639
6402002-06-15 Akim Demaille <akim@epita.fr>
641
642 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
643 out of...
644 (grammar_rules_print): here.
645 * src/reduce.c (reduce_output): Use it.
646 * tests/reduce.at (Useless Rules, Reduced Automaton)
647 (Underivable Rules): Adjust.
648
6492002-06-15 Akim Demaille <akim@epita.fr>
650
651 Copy BYacc's nice way to report the grammar.
652
653 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
654 New.
655 Don't print the rules' location, it is confusing and useless.
656 (rule_print): Use grammar_rhs_print.
657 * src/print.c (print_grammar): Use grammar_rules_print.
658
6592002-06-15 Akim Demaille <akim@epita.fr>
660
661 Complete and rationalize `useless thing' warnings.
662
663 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
664 (symbol_tag_print): New.
665 Use them everywhere in place of accessing directly the tag member.
666 * src/gram.h, src/gram.c (rule_print): New.
667 Use it where a rule used to be printed `by hand'.
668 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
669 (reduce_grammar_tables): Report the useless rules.
670 (reduce_print): Useless things are a warning, not an error.
671 Report it as such.
672 * tests/reduce.at (Useless Nonterminals, Useless Rules):
673 (Reduced Automaton, Underivable Rules): Adjust.
674 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
675 * tests/conflicts.at (Unresolved SR Conflicts)
676 (Solved SR Conflicts): Adjust.
677
6782002-06-15 Akim Demaille <akim@epita.fr>
679
680 Let symbols have a location.
681
682 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
683 (getsym): Adjust.
684 Adjust all callers.
685 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
686 Use location_t, not int.
687 * src/symtab.c (symbol_check_defined): Take advantage of the
688 location.
689 * tests/regression.at (Invalid inputs): Adjust.
690
6912002-06-15 Akim Demaille <akim@epita.fr>
692
693 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
694 (input): Don't try to initialize yylloc here, do it in the
695 scanner.
696 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
697 * src/gram.h (rule_t): Change line and action_line into location
698 and action_location, of location_t type.
699 Adjust all dependencies.
700 * src/location.h, src/location.c (empty_location): New.
701 * src/reader.h, src/reader.c (grammar_start_symbol_set)
702 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
703 (grammar_current_rule_symbol_append)
704 (grammar_current_rule_action_append): Expect a location as argument.
705 * src/reader.c (grammar_midrule_action): Adjust to attach an
706 action's location as dummy symbol location.
707 * src/symtab.h, src/symtab.c (startsymbol_location): New.
708 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
709 the line numbers.
710
7112002-06-14 Akim Demaille <akim@epita.fr>
712
713 Grammar declarations may be found in the grammar section.
714
715 * src/parse-gram.y (rules_or_grammar_declaration): New.
716 (declarations): Each declaration may end with a semicolon, not
717 just...
718 (grammar_declaration): `"%union"'.
719 (grammar): Branch to rules_or_grammar_declaration.
720
7212002-06-14 Akim Demaille <akim@epita.fr>
722
723 * src/main.c (main): Invoke scanner_free.
724
7252002-06-14 Akim Demaille <akim@epita.fr>
726
727 * src/output.c (m4_invoke): Extracted from...
728 (output_skeleton): here.
729 Free tempfile.
730
7312002-06-14 Akim Demaille <akim@epita.fr>
732
733 * src/parse-gram.y (directives, directive, gram)
734 (grammar_directives, precedence_directives, precedence_directive):
735 Rename as...
736 (declarations, declaration, grammar, grammar_declaration)
737 (precedence_declaration, precedence_declarator): these.
738 (symbol_declaration): New.
739
7402002-06-14 Akim Demaille <akim@epita.fr>
741
742 * src/files.c (action_obstack): Remove, unused.
743 (output_obstack): Remove it, and all its dependencies, as it is no
744 longer needed.
745 * src/reader.c (epilogue_set): Build the epilogue in the
746 muscle_obstack.
747 * src/output.h, src/output.c (muscle_obstack): Move to...
748 * src/muscle_tab.h, src/muscle_tab.h: here.
749 (muscle_init): Initialize muscle_obstack.
750 (muscle_free): New.
751 * src/main.c (main): Call it.
752
7532002-06-14 Akim Demaille <akim@epita.fr>
754
755 * src/location.h: New, extracted from...
756 * src/reader.h: here.
757 * src/Makefile.am (noinst_HEADERS): Merge into
758 (bison_SOURCES): this.
759 Add location.h.
760 * src/parse-gram.y: Use location_t instead of Bison's.
761 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
762 Use location_t instead of ints.
763
7642002-06-14 Akim Demaille <akim@epita.fr>
765
766 * data/bison.simple, data/bison.c++: Be sure to restore the
767 current #line when returning to the skeleton contents after having
768 exposed the input file's #line.
769
7702002-06-12 Akim Demaille <akim@epita.fr>
771
772 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
773 eager.
774 * tests/actions.at (Exotic Dollars): New.
775
7762002-06-12 Akim Demaille <akim@epita.fr>
777
778 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
779 ['"/] too eagerly.
780 * tests/input.at (Torturing the Scanner): New.
781
7822002-06-11 Akim Demaille <akim@epita.fr>
783
784 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
785 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
786 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
787 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
788 * src/reader.c (reader): Use it.
789
7902002-06-11 Akim Demaille <akim@epita.fr>
791
792 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
793 Adjust all callers.
794 (scanner_last_string_free): New.
795
7962002-06-11 Akim Demaille <akim@epita.fr>
797
798 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
799 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
800 (last_string, YY_OBS_FREE): New.
801 Use them when returning an ID.
802
8032002-06-11 Akim Demaille <akim@epita.fr>
804
805 Have Bison grammars parsed by a Bison grammar.
806
807 * src/reader.c, src/reader.h (prologue_augment): New.
808 * src/reader.c (copy_definition): Remove.
809
810 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
811 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
812 (grammar_current_rule_prec_set, grammar_current_rule_check)
813 (grammar_current_rule_symbol_append)
814 (grammar_current_rule_action_append): Export.
815 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
816 (symbol_list_action_append): Remove.
817 Hook the routines from reader.
818 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
819 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
820
821 * src/reader.c (read_declarations): Remove, unused.
822
823 * src/parse-gram.y: Handle the epilogue.
824 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
825 (grammar_start_symbol_set): this.
826 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
827 * src/reader.c (readgram): Remove, unused.
828 (reader): Adjust to insert eoftoken and axiom where appropriate.
829
830 * src/reader.c (copy_dollar): Replace with...
831 * src/scan-gram.h (handle_dollar): this.
832 * src/parse-gram.y: Remove `%thong'.
833
834 * src/reader.c (copy_at): Replace with...
835 * src/scan-gram.h (handle_at): this.
836
837 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
838 New.
839
840 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
841 time being.
842
843 * src/reader.h, src/reader.c (grammar_rule_end): New.
844
845 * src/parse.y (current_type, current_class): New.
846 Implement `%nterm', `%token' support.
847 Merge `%term' into `%token'.
848 (string_as_id): New.
849 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
850 type name.
851
852 * src/parse-gram.y: Be sure to handle properly the beginning of
853 rules.
854
855 * src/parse-gram.y: Handle %type.
856 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
857
858 * src/parse-gram.y: More directives support.
859 * src/options.c: No longer handle source directives.
860
861 * src/parse-gram.y: Fix %output.
862
863 * src/parse-gram.y: Handle %union.
864 Use the prologue locations.
865 * src/reader.c (parse_union_decl): Remove.
866
867 * src/reader.h, src/reader.c (epilogue_set): New.
868 * src/parse-gram.y: Use it.
869
870 * data/bison.simple, data/bison.c++: b4_stype is now either not
871 defined, then default to int, or to the contents of %union,
872 without `union' itself.
873 Adjust.
874 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
875
876 * src/output.c (actions_output): Don't output braces, as they are
877 already handled by the scanner.
878
879 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
880 characters to themselves.
881
882 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
883 that the epilogue has a proper #line.
884
885 * src/parse-gram.y: Handle precedence/associativity.
886
887 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
888 a terminal.
889 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
890 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
891 at all to define terminals that cannot be emitted.
892
893 * src/scan-gram.l: Escape M4 characters.
894
895 * src/scan-gram.l: Working properly with escapes in user
896 strings/characters.
897
898 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
899 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
900 grammar.
901 Use more modest sizes, as for the time being the parser does not
902 release memory, and therefore the process swallows a huge amount
903 of memory.
904
905 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
906 stricter %token grammar.
907
908 * src/symtab.h (associativity): Add `undef_assoc'.
909 (symbol_precedence_set): Do nothing when passed an undef_assoc.
910 * src/symtab.c (symbol_check_alias_consistence): Adjust.
911
912 * tests/regression.at (Invalid %directive): Remove, as it is now
913 meaningless.
914 (Invalid inputs): Adjust to the new error messages.
915 (Token definitions): The new grammar doesn't allow too many
916 eccentricities.
917
918 * src/lex.h, src/lex.c: Remove.
919 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
920 (copy_character, copy_string2, copy_string, copy_identifier)
921 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
922 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
923 (parse_action): Remove.
924 * po/POTFILES.in: Adjust.
925
9262002-06-11 Akim Demaille <akim@epita.fr>
927
928 * src/reader.c (parse_action): Don't store directly into the
929 rule's action member: return the action as a string.
930 Don't require `rule_length' as an argument: compute it.
931 (grammar_current_rule_symbol_append)
932 (grammar_current_rule_action_append): New, eved out from
933 (readgram): here.
934 Remove `action_flag', `rulelength', unused now.
935
9362002-06-11 Akim Demaille <akim@epita.fr>
937
938 * src/reader.c (grammar_current_rule_prec_set).
939 (grammar_current_rule_check): New, eved out from...
940 (readgram): here.
941 Remove `xaction', `first_rhs': useless.
942 * tests/input.at (Type clashes): New.
943 * tests/existing.at (GNU Cim Grammar): Adjust.
944
9452002-06-11 Akim Demaille <akim@epita.fr>
946
947 * src/reader.c (grammar_midrule_action): New, Eved out from
948 (readgram): here.
949
9502002-06-11 Akim Demaille <akim@epita.fr>
951
952 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
953 New.
954 (readgram): Use them as replacement of inlined code, crule and
955 crule1.
956
9572002-06-11 Akim Demaille <akim@epita.fr>
958
959 * src/reader.c (grammar_end, grammar_symbol_append): New.
960 (readgram): Use them.
961 Make the use of `p' as local as possible.
962
9632002-06-10 Akim Demaille <akim@epita.fr>
964
965 GCJ's parser requires the tokens to be defined before the prologue.
966
967 * data/bison.simple: Output the token definition before the user's
968 prologue.
969 * tests/regression.at (Braces parsing, Duplicate string)
970 (Mixing %token styles): Check the output from bison.
971 (Early token definitions): New.
972
9732002-06-10 Akim Demaille <akim@epita.fr>
974
975 * src/symtab.c (symbol_user_token_number_set): Don't complain when
976 assigning twice the same user number to a token, so that we can
977 use it in...
978 * src/lex.c (lex): here.
979 Also use `symbol_class_set' instead of hand written code.
980 * src/reader.c (parse_assoc_decl): Likewise.
981
9822002-06-10 Akim Demaille <akim@epita.fr>
983
984 * src/symtab.c, src/symtab.c (symbol_class_set)
985 (symbol_user_token_number_set): New.
986 * src/reader.c (parse_token_decl): Use them.
987 Use a switch instead of ifs.
988 Use a single argument.
989
9902002-06-10 Akim Demaille <akim@epita.fr>
991
992 Remove `%thong' support as it is undocumented, unused, duplicates
993 `%token's job, and creates useless e-mail traffic with people who
994 want to know what it is, why it is undocumented, unused, and
995 duplicates `%token's job.
996
997 * src/reader.c (parse_thong_decl): Remove.
998 * src/options.c (option_table): Remove "thong".
999 * src/lex.h (tok_thong): Remove.
1000
10012002-06-10 Akim Demaille <akim@epita.fr>
1002
1003 * src/symtab.c, src/symtab.c (symbol_type_set)
1004 (symbol_precedence_set): New.
1005 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
1006 (value_components_used): Remove, unused.
1007
10082002-06-09 Akim Demaille <akim@epita.fr>
1009
1010 Move symbols handling code out of the reader.
1011
1012 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
1013 (axiom): Move to...
1014 * src/symtab.h, src/symtab.c: here.
1015
1016 * src/gram.c (start_symbol): Remove: use startsymbol->number.
1017 * src/reader.c (startval): Rename as...
1018 * src/symtab.h, src/symtab.c (startsymbol): this.
1019 * src/reader.c: Adjust.
1020
1021 * src/reader.c (symbol_check_defined, symbol_make_alias)
1022 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1023 (token_translations_init)
1024 Move to...
1025 * src/symtab.c: here.
1026 * src/reader.c (packsymbols): Move to...
1027 * src/symtab.h, src/symtab.c (symbols_pack): here.
1028 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
1029 argument.
1030
10312002-06-03 Akim Demaille <akim@epita.fr>
1032
1033 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
1034 then statements.
1035
10362002-06-03 Akim Demaille <akim@epita.fr>
1037
1038 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1039 structs with non literals.
1040 * src/scan-skel.l: never-interactive.
1041 * src/conflicts.c (enum conflict_resolution_e): No trailing
1042 comma.
1043 * src/getargs.c (usage): Split long literal strings.
1044 Reported by Hans Aberg.
1045
10462002-05-28 Akim Demaille <akim@epita.fr>
1047
1048 * data/bison.c++: Use C++ ostreams.
1049 (cdebug_): New member.
1050
10512002-05-28 Akim Demaille <akim@epita.fr>
1052
1053 * src/output.c (output_skeleton): Be sure to allocate enough room
1054 for `/' _and_ for `\0' in full_skeleton.
1055
10562002-05-28 Akim Demaille <akim@epita.fr>
1057
1058 * data/bison.c++: Catch up with bison.simple:
1059 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1060 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1061 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1062 and popping traces.
1063
10642002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1065
1066 * src/output.c (output_skeleton): Put an explicit path in front of
1067 the skeleton file name, rather than relying on the -I directory,
1068 to partially alleviate effects of having a skeleton file lying around
1069 in the current directory.
1070
10712002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1072
1073 * src/conflicts.c (log_resolution): Correct typo:
1074 obstack_printf should be obstack_fgrow1.
1075
10762002-05-26 Akim Demaille <akim@epita.fr>
1077
1078 * src/state.h (state_t): `solved_conflicts' is a new member.
1079 * src/LR0.c (new_state): Set it to 0.
1080 * src/conflicts.h, src/conflicts.c (print_conflicts)
1081 (free_conflicts, solve_conflicts): Rename as...
1082 (conflicts_print, conflicts_free, conflicts_solve): these.
1083 Adjust callers.
1084 * src/conflicts.c (enum conflict_resolution_e)
1085 (solved_conflicts_obstack): New, used by...
1086 (log_resolution): this.
1087 Adjust to attach the conflict resolution to each state.
1088 Complete the description with the precedence/associativity
1089 information.
1090 (resolve_sr_conflict): Adjust.
1091 * src/print.c (print_state): Output its solved_conflicts.
1092 * tests/conflicts.at (Unresolved SR Conflicts)
1093 (Solved SR Conflicts): Exercise --report=all.
1094
10952002-05-26 Akim Demaille <akim@epita.fr>
1096
1097 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1098 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1099 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1100 (token_number_t, item_number_as_token_number)
1101 (token_number_as_item_number, muscle_insert_token_number_table):
1102 Rename as...
1103 (symbol_number_t, item_number_as_symbol_number)
1104 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1105 these, since it is more appropriate.
1106
11072002-05-26 Akim Demaille <akim@epita.fr>
1108
1109 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1110 `Error:' lines.
1111 * data/bison.simple (yystos) [YYDEBUG]: New.
1112 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1113 error recovery.
1114 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1115
11162002-05-25 Akim Demaille <akim@epita.fr>
1117
1118 * doc/bison.texinfo (Debugging): Split into...
1119 (Tracing): this new section, its former contents, and...
1120 (Understanding): this new section.
1121 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1122 by...
1123 (report_flag): this.
1124 Adjust all dependencies.
1125 (report_args, report_types, report_argmatch): New.
1126 (usage, getargs): Report/support -r, --report.
1127 * src/options.h
1128 (struct option_table_struct): Rename as..,
1129 (struct option_table_s): this.
1130 Rename the `set_flag' member to `flag' to match with getopt_long's
1131 struct.
1132 * src/options.c (option_table): Split verbose into an entry for
1133 %verbose, and another for --verbose.
1134 Support --report/-r, so remove -r from the obsolete --raw.
1135 * src/print.c: Attach full item sets and lookaheads reports to
1136 report_flag instead of trace_flag.
1137 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1138
11392002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1140 and Paul Eggert <eggert@twinsun.com>
1141
1142 * data/bison.simple (yyparse): Correct error handling to conform to
1143 POSIX and yacc. Specifically, after syntax error is discovered,
1144 do not reduce further before shifting the error token.
1145 Clean up the code a bit by removing the labels yyerrdefault,
1146 yyerrhandle, yyerrpop.
1147 * NEWS: Document the above.
1148
11492002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1150
1151 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1152 type; it isn't always big enough, since it doesn't necessarily
1153 include non-terminals.
1154 (yytranslate): Expand definition of yy_token_number_type, so that
1155 the latter can be removed.
1156 (yy_token_number_type): Remove, only one use.
1157 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1158 don't use TokenNumberType as element type.
1159
1160 * tests/regression.at: Modify expected output to agree with change
1161 to yyr1 and yytranslate.
1162
11632002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1164
1165 * src/reader.c (parse_action): Use copy_character instead of
1166 obstack_1grow.
1167
11682002-05-13 Akim Demaille <akim@epita.fr>
1169
1170 * tests/regression.at (Token definitions): Prototype yylex and
1171 yyerror.
1172
11732002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1174
1175 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
1176 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1177 32-bit arithmetic.
1178 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1179
11802002-05-07 Akim Demaille <akim@epita.fr>
1181
1182 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1183 avoid GCC warnings.
1184
11852002-05-07 Akim Demaille <akim@epita.fr>
1186
1187 Kill GCC warnings.
1188
1189 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1190 over the RHS of each rule.
1191 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1192 * src/state.h (state_t): Member `nitems' is unsigned short.
1193 * src/LR0.c (get_state): Adjust.
1194 * src/reader.c (packgram): Likewise.
1195 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1196 `Type'.
1197 (muscle_insert_int_table): Remove, unused.
1198 (prepare_rules): Remove `max'.
1199
12002002-05-06 Akim Demaille <akim@epita.fr>
1201
1202 * src/closure.c (print_firsts): Display of the symbol tags.
1203 (bitmatrix_print): Move to...
1204 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1205 here.
1206 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1207
12082002-05-06 Akim Demaille <akim@epita.fr>
1209
1210 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1211 hash_do_for_each.
1212
12132002-05-06 Akim Demaille <akim@epita.fr>
1214
1215 * src/LR0.c (new_state, get_state): Instead of using the global
1216 `kernel_size' and `kernel_base', have two new arguments:
1217 `core_size' and `core'.
1218 Adjust callers.
1219
12202002-05-06 Akim Demaille <akim@epita.fr>
1221
1222 * src/reader.c (packgram): No longer end `ritem' with a 0
1223 sentinel: it is not used.
1224
12252002-05-05 Akim Demaille <akim@epita.fr>
1226
1227 New experimental feature: display the lookaheads in the report and
1228 graph.
1229
1230 * src/print (print_core): When --trace-flag, display the rules
1231 lookaheads.
1232 * src/print_graph.c (print_core): Likewise.
1233 Swap the arguments.
1234 Adjust caller.
1235
12362002-05-05 Akim Demaille <akim@epita.fr>
1237
1238 * tests/torture.at (Many lookaheads): New test.
1239
12402002-05-05 Akim Demaille <akim@epita.fr>
1241
1242 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1243 (GENERATE_MUSCLE_INSERT_TABLE): this.
1244 (output_int_table, output_unsigned_int_table, output_short_table)
1245 (output_token_number_table, output_item_number_table): Replace with...
1246 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1247 (muscle_insert_short_table, muscle_insert_token_number_table)
1248 (muscle_insert_item_number_table): these.
1249 Adjust all callers.
1250 (prepare_tokens): Don't free `translations', since...
1251 * src/reader.h, src/reader.c (grammar_free): do it.
1252 Move to...
1253 * src/gram.h, src/gram.c (grammar_free): here.
1254 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1255 b4_translate_max.
1256
12572002-05-05 Akim Demaille <akim@epita.fr>
1258
1259 * src/output.c (output_unsigned_int_table): New.
1260 (prepare_rules): `i' is unsigned.
1261 `prhs', `rline', `r2' are unsigned int.
1262 Rename muscle `rhs_number_max' as `rhs_max'.
1263 Output muscles `prhs_max', `rline_max', and `r2_max'.
1264 Free rline and r1.
1265 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1266 to compute types instead of constant types.
1267 * tests/regression.at (Web2c Actions): Adjust.
1268
12692002-05-04 Akim Demaille <akim@epita.fr>
1270
1271 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1272 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1273 Adjust dependencies.
1274 * src/output.c (token_definitions_output): Be sure not to output a
1275 `#define 'a'' when fed with `%token 'a' "a"'.
1276 * tests/regression.at (Token definitions): New.
1277
12782002-05-03 Paul Eggert <eggert@twinsun.com>
1279
1280 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1281 for K&R C.
1282
12832002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1284
1285 * Makefile.am (SUBDIRS): Remove intl.
1286 (EXTRA_DIST): Add config/config.rpath.
1287
12882002-05-03 Akim Demaille <akim@epita.fr>
1289
1290 * data/bison.simple (m4_if): Don't output empty enums.
1291 And actually, output valid enum definitions :(.
1292
12932002-05-03 Akim Demaille <akim@epita.fr>
1294
1295 * configure.bat: Remove, completely obsolete.
1296 * Makefile.am (EXTRA_DIST): Adjust.
1297 Don't distribute config.rpath...
1298 * config/Makefile.am (EXTRA_DIST): Do it.
1299
13002002-05-03 Akim Demaille <akim@epita.fr>
1301
1302 * configure.in (GETTEXT_VERSION): New.
1303 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1304
13052002-05-03 Akim Demaille <akim@epita.fr>
1306
1307 * data/bison.simple (b4_token_enum): New.
1308 (b4_token_defines): Use it to output tokens both as #define and
1309 enums.
1310 Suggested by Paul Eggert.
1311 * src/output.c (token_definitions_output): Don't output spurious
1312 white spaces.
1313
13142002-05-03 Akim Demaille <akim@epita.fr>
1315
1316 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1317
13182002-05-02 Robert Anisko <robert@lrde.epita.fr>
1319
1320 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1321 Update the stack class, give a try to deque as the default container.
1322
13232002-05-02 Akim Demaille <akim@epita.fr>
1324
1325 * data/bison.simple (yyparse): Do not implement @$ = @1.
1326 (YYLLOC_DEFAULT): Adjust to do it.
1327 * doc/bison.texinfo (Location Default Action): Fix.
1328
13292002-05-02 Akim Demaille <akim@epita.fr>
1330
1331 * src/reader.c (parse_braces): Merge into...
1332 (parse_action): this.
1333
13342002-05-02 Akim Demaille <akim@epita.fr>
1335
1336 * configure.in (ALL_LINGUAS): Remove.
1337 * po/LINGUAS, hr.po: New.
1338
13392002-05-02 Akim Demaille <akim@epita.fr>
1340
1341 Remove the so called hairy (semantic) parsers.
1342
1343 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1344 * src/gram.h, src/gram.c (semantic_parser): Remove.
1345 (rule_t): Remove the guard and guard_line members.
1346 * src/lex.h (token_t): remove tok_guard.
1347 * src/options.c (option_table): Remove %guard and %semantic_parser
1348 support.
1349 * src/output.c, src/output.h (guards_output): Remove.
1350 (prepare): Adjust.
1351 (token_definitions_output): Don't output the `T'
1352 tokens (???).
1353 (output_skeleton): Don't output the guards.
1354 * src/files.c, src/files.c (attrsfile): Remove.
1355 * src/reader.c (symbol_list): Remove the guard and guard_line
1356 members.
1357 Adjust dependencies.
1358 (parse_guard): Remove.
1359 * data/bison.hairy: Remove.
1360 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1361 BISON_HAIRY.
1362
13632002-05-02 Akim Demaille <akim@epita.fr>
1364
1365 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1366 (parse_guard): Rename the formal argument `stack_offset' as
1367 `rule_length', which is more readable.
1368 Adjust callers.
1369 (copy_at, copy_dollar): Instead of outputting the hard coded
1370 values of $$, $n and so forth, output invocation to b4_lhs_value,
1371 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
1372 Note: this patch partially drops `semantic-parser' support: it
1373 always does `rule_length - n', where semantic parsers ought to
1374 always use `-n'.
1375 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1376 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1377
13782002-05-02 Akim Demaille <akim@epita.fr>
1379
1380 * configure.in (AC_INIT): Bump to 1.49b.
1381 (AM_INIT_AUTOMAKE): Short invocation.
1382
13832002-05-02 Akim Demaille <akim@epita.fr>
1384
1385 Version 1.49a.
1386
13872002-05-01 Akim Demaille <akim@epita.fr>
1388
1389 * src/skeleton.h: Remove.
1390
13912002-05-01 Akim Demaille <akim@epita.fr>
1392
1393 * src/skeleton.h: Fix the #endif.
1394 Reported by Magnus Fromreide.
1395
13962002-04-26 Paul Eggert <eggert@twinsun.com>
1397
1398 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1399 Define if we define YYSTYPE and YYLTYPE, respectively.
1400 (YYCOPY): Fix [] quoting problem in the non-GCC case.
1401
14022002-04-25 Robert Anisko <robert@lrde.epita.fr>
1403
1404 * src/scan-skel.l: Postprocess quadrigraphs.
1405
1406 * src/reader.c (copy_character): New function, used to output
1407 single characters while replacing `[' and `]' with quadrigraphs, to
1408 avoid troubles with M4 quotes.
1409 (copy_comment): Output characters with copy_character.
1410 (read_additionnal_code): Likewise.
1411 (copy_string2): Likewise.
1412 (copy_definition): Likewise.
1413
1414 * tests/calc.at: Exercise M4 quoting.
1415
14162002-04-25 Akim Demaille <akim@epita.fr>
1417
1418 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1419 between `!' and the command.
1420 Reported by Paul Eggert.
1421
14222002-04-24 Robert Anisko <robert@lrde.epita.fr>
1423
1424 * tests/calc.at: Exercise prologue splitting.
1425
1426 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1427 `b4_post_prologue' instead of `b4_prologue'.
1428
1429 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1430 muscles.
1431 (output): Free pre_prologue_obstack and post_prologue_obstack.
1432 * src/files.h, src/files.c (attrs_obstack): Remove.
1433 (pre_prologue_obstack, post_prologue_obstack): New.
1434 * src/reader.c (copy_definition): Add a parameter to specify the
1435 obstack to fill, instead of using attrs_obstack unconditionally.
1436 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1437 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1438
14392002-04-23 Paul Eggert <eggert@twinsun.com>
1440
1441 * data/bison.simple: Remove unnecessary commentary and white
1442 space differences from 1_29-branch.
1443 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1444
1445 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1446 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1447 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1448 constructors or destructors.
1449
1450 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1451
14522002-04-23 Akim Demaille <akim@epita.fr>
1453
1454 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1455 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1456 location with columns.
1457 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1458 All reported by Paul Eggert.
1459
14602002-04-22 Akim Demaille <akim@epita.fr>
1461
1462 * src/reduce.c (dump_grammar): Move to...
1463 * src/gram.h, src/gram.c (grammar_dump): here.
1464 Be sure to separate long item numbers.
1465 Don't read the members of a rule's prec if its nil.
1466
14672002-04-22 Akim Demaille <akim@epita.fr>
1468
1469 * src/output.c (table_size, table_grow): New.
1470 (MAXTABLE): Remove, replace uses with table_size.
1471 (pack_vector): Instead of dying when the table is too big, grow it.
1472
14732002-04-22 Akim Demaille <akim@epita.fr>
1474
1475 * data/bison.simple (yyr1): Its type is that of a token number.
1476 * data/bison.c++ (r1_): Likewise.
1477 * tests/regression.at (Web2c Actions): Adjust.
1478
14792002-04-22 Akim Demaille <akim@epita.fr>
1480
1481 * src/reader.c (token_translations_init): 256 is now the default
1482 value for the error token, i.e., it will be assigned another
1483 number if the user assigned 256 to one of her tokens.
1484 (reader): Don't force 256 to error.
1485 * doc/bison.texinfo (Symbols): Adjust.
1486 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1487 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1488 etc. instead of 10, 20, 30 (which was used to `jump' over error
1489 (256) and undefined (2)).
1490
14912002-04-22 Akim Demaille <akim@epita.fr>
1492
1493 Propagate more token_number_t.
1494
1495 * src/gram.h (token_number_as_item_number)
1496 (item_number_as_token_number): New.
1497 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1498 Use it to create output_item_number_table and
1499 output_token_number_table.
1500 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1501 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1502 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1503 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1504
15052002-04-22 Akim Demaille <akim@epita.fr>
1506
1507 * src/output.h, src/output.c (get_lines_number): Remove.
1508
15092002-04-19 Akim Demaille <akim@epita.fr>
1510
1511 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1512 as Lex/Flex'.
1513 (Debugging): More details about enabling the debugging features.
1514 (Table of Symbols): Describe $$, $n, @$, and @n.
1515 Suggested by Tim Josling.
1516
15172002-04-19 Akim Demaille <akim@epita.fr>
1518
1519 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1520
15212002-04-10 Akim Demaille <akim@epita.fr>
1522
1523 * src/system.h: Rely on HAVE_LIMITS_H.
1524 Suggested by Paul Eggert.
1525
15262002-04-09 Akim Demaille <akim@epita.fr>
1527
1528 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1529 full stderr, and strip it according to the bison options, instead
1530 of composing the error message from different bits.
1531 This makes it easier to check for several error messages.
1532 Adjust all the invocations.
1533 Add an invocation exercising the error token.
1534 Add an invocation demonstrating a stupid error message.
1535 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1536 Adjust the tests.
1537 Error message are for stderr, not stdout.
1538
15392002-04-09 Akim Demaille <akim@epita.fr>
1540
1541 * src/gram.h, src/gram.c (error_token_number): Remove, use
1542 errtoken->number.
1543 * src/reader.c (reader): Don't specify the user token number (2)
1544 for $undefined, as it uselessly prevents using it.
1545 * src/gram.h (token_number_t): Move to...
1546 * src/symtab.h: here.
1547 (state_t.number): Is a token_number_t.
1548 * src/print.c, src/reader.c: Use undeftoken->number instead of
1549 hard coded 2.
1550 (Even though this 2 is not the same as above: the number of the
1551 undeftoken remains being 2, it is its user token number which
1552 might not be 2).
1553 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1554 `user_token_number_max'.
1555 Output `undef_token_number'.
1556 * data/bison.simple, data/bison.c++: Use them.
1557 Be sure to map invalid yylex return values to
1558 `undef_token_number'. This saves us from gratuitous SEGV.
1559
1560 * tests/conflicts.at (Solved SR Conflicts)
1561 (Unresolved SR Conflicts): Adjust.
1562 * tests/regression.at (Web2c Actions): Adjust.
1563
15642002-04-08 Akim Demaille <akim@epita.fr>
1565
1566 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1567 Adding #line.
1568 Remove the duplicate `typedefs'.
1569 (RhsNumberType): Fix the declaration and various other typos.
1570 Use __ofile__.
1571 * data/bison.simple: Use __ofile__.
1572 * src/scan-skel.l: Handle __ofile__.
1573
15742002-04-08 Akim Demaille <akim@epita.fr>
1575
1576 * src/gram.h (item_number_t): New, the type of item numbers in
1577 RITEM. Note that it must be able to code symbol numbers as
1578 positive number, and the negation of rule numbers as negative
1579 numbers.
1580 Adjust all dependencies (pretty many).
1581 * src/reduce.c (rule): Remove this `short *' pointer: use
1582 item_number_t.
1583 * src/system.h (MINSHORT, MAXSHORT): Remove.
1584 Include `limits.h'.
1585 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1586 (shortcpy): Remove.
1587 (MAXTABLE): Move to...
1588 * src/output.c (MAXTABLE): here.
1589 (prepare_rules): Use output_int_table to output rhs.
1590 * data/bison.simple, data/bison.c++: Adjust.
1591 * tests/torture.at (Big triangle): Move the limit from 254 to
1592 500.
1593 * tests/regression.at (Web2c Actions): Ajust.
1594
1595 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1596 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1597 passes, but produces negative #line number, once fixed, GCC is
1598 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1599 C), it passes.
1600 * src/state.h (state_h): Code input lines on ints, not shorts.
1601
16022002-04-08 Akim Demaille <akim@epita.fr>
1603
1604 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1605 and then the grammar.
1606
16072002-04-08 Akim Demaille <akim@epita.fr>
1608
1609 * src/system.h: No longer using strndup.
1610
16112002-04-07 Akim Demaille <akim@epita.fr>
1612
1613 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1614 * src/output.c (output_table_data): Return the longest number.
1615 (prepare_tokens): Output `token_number_max').
1616 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1617 New.
1618 Use them to define yy_token_number_type/TokenNumberType.
1619 Use this type for yytranslate.
1620 * tests/torture.at (Big triangle): Push the limit from 124 to
1621 253.
1622 * tests/regression.at (Web2c Actions): Adjust.
1623
16242002-04-07 Akim Demaille <akim@epita.fr>
1625
1626 * tests/torture.at (Big triangle): New.
1627 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1628 * tests/existing.at: here.
1629
16302002-04-07 Akim Demaille <akim@epita.fr>
1631
1632 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1633 nritems.
1634 Adjust dependencies.
1635
16362002-04-07 Akim Demaille <akim@epita.fr>
1637
1638 * src/reader.c: Normalize increments to prefix form.
1639
16402002-04-07 Akim Demaille <akim@epita.fr>
1641
1642 * src/reader.c, symtab.c: Remove debugging code.
1643
16442002-04-07 Akim Demaille <akim@epita.fr>
1645
1646 Rename all the `bucket's as `symbol_t'.
1647
1648 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1649 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1650 * src/symtab.c, src/symtab.h (bucket): Rename as...
1651 (symbol_t): this.
1652 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1653 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1654 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1655 (buckets_new, buckets_free, buckets_do): Rename as...
1656 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1657 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1658 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1659 (symbols_new, symbols_free, symbols_do): these.
1660
16612002-04-07 Akim Demaille <akim@epita.fr>
1662
1663 Use lib/hash for the symbol table.
1664
1665 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1666 EOF.
1667 * src/lex.c (lex): Set the `number' member of new terminals.
1668 * src/reader.c (bucket_check_defined, bucket_make_alias)
1669 (bucket_check_alias_consistence, bucket_translation): New.
1670 (reader, grammar_free, readgram, token_translations_init)
1671 (packsymbols): Adjust.
1672 (reader): Number the predefined tokens.
1673 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1674 for predefined tokens.
1675 * src/symtab.h (bucket): Remove all the hash table related
1676 members.
1677 * src/symtab.c (symtab): Replace by...
1678 (bucket_table): this.
1679 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1680 (buckets_new, buckets_do): New.
1681
16822002-04-07 Akim Demaille <akim@epita.fr>
1683
1684 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1685 (start_symbol, max_user_token_number, semantic_parser)
1686 (error_token_number): Initialize.
1687 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1688 Initialize.
1689 (reader): Don't.
1690 (errtoken, eoftoken, undeftoken, axiom): Extern.
1691
16922002-04-07 Akim Demaille <akim@epita.fr>
1693
1694 * src/gram.h (rule_s): prec and precsym are now pointers
1695 to the bucket giving the priority/associativity.
1696 Member `associativity' removed: useless.
1697 * src/reduce.c, src/conflicts.c: Adjust.
1698
16992002-04-07 Akim Demaille <akim@epita.fr>
1700
1701 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1702 Properly escape the symbols' TAG when outputting them.
1703
17042002-04-07 Akim Demaille <akim@epita.fr>
1705
1706 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1707
17082002-04-07 Akim Demaille <akim@epita.fr>
1709
1710 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1711 (LArule): this, which is an array to rule_t*.
1712 * src/print.c, src/conflicts.c: Adjust.
1713
17142002-04-07 Akim Demaille <akim@epita.fr>
1715
1716 * src/gram.h (rule_t): Rename `number' as `user_number'.
1717 `number' is a new member.
1718 Adjust dependencies.
1719 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1720
17212002-04-07 Akim Demaille <akim@epita.fr>
1722
1723 As a result of the previous patch, it is no longer needed
1724 to reorder ritem itself.
1725
1726 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1727
17282002-04-07 Akim Demaille <akim@epita.fr>
1729
1730 Be sure never to walk through RITEMS, but use only data related to
1731 the rules themselves. RITEMS should be banished.
1732
1733 * src/output.c (output_token_translations): Rename as...
1734 (prepare_tokens): this.
1735 In addition to `translate', prepare the muscles `tname' and
1736 `toknum', which were handled by...
1737 (output_rule_data): this.
1738 Remove, and move the remainder of its outputs into...
1739 (prepare_rules): this new routines, which also merges content from
1740 (output_gram): this.
1741 (prepare_rules): Be sure never to walk through RITEMS.
1742 (output_stos): Rename as...
1743 (prepare_stos): this.
1744 (output): Always invoke prepare_states, after all, just don't use it
1745 in the output if you don't need it.
1746
17472002-04-07 Akim Demaille <akim@epita.fr>
1748
1749 * src/LR0.c (new_state): Display `nstates' as the name of the
1750 newly created state.
1751 Adjust to initialize first_state and last_state if needed.
1752 Be sure to distinguish the initial from the final state.
1753 (new_states): Create the itemset of the initial state, and use
1754 new_state.
1755 * src/closure.c (closure): Now that the initial state has its
1756 items properly set, there is no need for a special case when
1757 creating `ruleset'.
1758
1759 As a result, now the rule 0, reducing to $axiom, is visible in the
1760 outputs. Adjust the test suite.
1761
1762 * tests/conflicts.at (Solved SR Conflicts)
1763 (Unresolved SR Conflicts): Adjust.
1764 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1765 * tests/conflicts.at (S/R in initial): New.
1766
17672002-04-07 Akim Demaille <akim@epita.fr>
1768
1769 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1770 the RHS of the rules.
1771 * src/output.c (output_gram): Likewise.
1772
17732002-04-07 Akim Demaille <akim@epita.fr>
1774
1775 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1776 bucket.
1777 Adjust all dependencies.
1778 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1779 `number' of the buckets too.
1780 * src/gram.h: Include `symtab.h'.
1781 (associativity): Move to...
1782 * src/symtab.h: here.
1783 No longer include `gram.h'.
1784
17852002-04-07 Akim Demaille <akim@epita.fr>
1786
1787 * src/gram.h, src/gram.c (rules_rhs_length): New.
1788 (ritem_longest_rhs): Use it.
1789 * src/gram.h (rule_t): `number' is a new member.
1790 * src/reader.c (packgram): Set it.
1791 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1792 the end of `rules', and count them out of `nrules'.
1793 (reduce_output, dump_grammar): Adjust.
1794 * src/print.c (print_grammar): It is no longer needed to check for
1795 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1796 * tests/reduce.at (Reduced Automaton): New test.
1797
17982002-04-07 Akim Demaille <akim@epita.fr>
1799
1800 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1801 lacking `+ 1' to nrules, Bison reported as useless a token if it
1802 was used solely to set the precedence of the last rule...
1803
18042002-04-07 Akim Demaille <akim@epita.fr>
1805
1806 * data/bison.c++, data/bison.simple: Don't output the current file
1807 name in #line, to avoid useless diffs between two identical
1808 outputs under different names.
1809
18102002-04-07 Akim Demaille <akim@epita.fr>
1811
1812 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1813 Normalize loops to using `< nrules + 1', not `<= nrules'.
1814
18152002-04-07 Akim Demaille <akim@epita.fr>
1816
1817 * TODO: Update.
1818
18192002-04-07 Akim Demaille <akim@epita.fr>
1820
1821 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1822 bucket.value as bucket.number.
1823
18242002-04-07 Akim Demaille <akim@epita.fr>
1825
1826 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1827 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1828 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1829 RHS, instead of being an index in RITEMS.
1830
18312002-04-04 Paul Eggert <eggert@twinsun.com>
1832
1833 * doc/bison.texinfo: Update copyright date.
1834 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1835 (Symbols): Warn about running Bison in one character set,
1836 but compiling and/or running in an incompatible one.
1837 Warn about character code 256, too.
1838
18392002-04-03 Paul Eggert <eggert@twinsun.com>
1840
1841 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1842 YYERROR_VERBOSE is nonzero, not whether it is defined.
1843
1844 Merge changes from bison-1_29-branch.
1845
18462002-03-20 Paul Eggert <eggert@twinsun.com>
1847
1848 Merge fixes from Debian bison_1.34-1.diff.
1849
1850 * configure.in (AC_PREREQ): 2.53.
1851
18522002-03-20 Akim Demaille <akim@epita.fr>
1853
1854 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1855
18562002-03-19 Paul Eggert <eggert@twinsun.com>
1857
1858 * src/bison.simple (YYCOPY): New macro.
1859 (YYSTACK_RELOCATE): Use it.
1860 Remove Type arg; no longer needed. All callers changed.
1861 (yymemcpy): Remove; no longer needed.
1862
1863 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1864 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1865
18662002-03-19 Akim Demaille <akim@epita.fr>
1867
1868 Test and fix the #line outputs.
1869
1870 * tests/atlocal.at (GCC): New.
1871 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1872 (Prologue synch line, ,%union synch line, Postprologue synch line)
1873 (Action synch line, Epilogue synch line): New tests.
1874 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1875 * data/bison.simple, data/bison.c++: Use it.
1876
18772002-03-19 Akim Demaille <akim@epita.fr>
1878
1879 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1880 (Solved SR Conflicts, %expect not enough, %expect right)
1881 (%expect too much): Move to...
1882 * tests/conflicts.at: this new file.
1883
18842002-03-19 Akim Demaille <akim@epita.fr>
1885
1886 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1887 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1888 that we can move to enums for instance.
1889 * src/output.c (token_definitions_output): Output a list of
1890 `token-name, token-number' instead of the #define.
1891 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1892
18932002-03-14 Akim Demaille <akim@epita.fr>
1894
1895 Use Gettext 0.11.1.
1896
18972002-03-09 Robert Anisko <robert@lrde.epita.fr>
1898
1899 * data/bison.c++: Make the user able to add members to the generated
1900 parser by subclassing.
1901
19022002-03-05 Robert Anisko <robert@lrde.epita.fr>
1903
1904 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1905 a character.
1906 Reported by Nicolas Tisserand and Nicolas Burrus.
1907
19082002-03-04 Robert Anisko <robert@lrde.epita.fr>
1909
1910 * src/reader.c: Warn about lacking semi-colons, do not complain.
1911
19122002-03-04 Robert Anisko <robert@lrde.epita.fr>
1913
1914 * data/bison.c++: Remove a debug line.
1915
19162002-03-04 Robert Anisko <robert@lrde.epita.fr>
1917
1918 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1919 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1920 provide a default implementation.
1921
19222002-03-04 Akim Demaille <akim@epita.fr>
1923
1924 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1925 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1926 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1927 * tests/semantic.at (Parsing Guards): Similarly.
1928 * src/reader.at (readgram): Complain if the last rule is not ended
1929 with a semi-colon.
1930
19312002-03-04 Akim Demaille <akim@epita.fr>
1932
1933 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1934 * src/closure.c: here.
1935 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1936 RTC.
1937 * src/warshall.h, src/warshall.c: Remove.
1938 * tests/sets.at (Broken Closure): Adjust.
1939
19402002-03-04 Akim Demaille <akim@epita.fr>
1941
1942 * src/output.c (output_skeleton): tempdir is const.
1943 bytes_read is unused.
1944
19452002-03-04 Akim Demaille <akim@epita.fr>
1946
1947 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1948 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1949 Update.
1950 From Michael Hayes.
1951
19522002-03-04 Akim Demaille <akim@epita.fr>
1953
1954 * src/closure.c (closure): `r' is unused.
1955
19562002-03-04 Akim Demaille <akim@epita.fr>
1957
1958 * tests/sets.at (Broken Closure): Add the ending `;'.
1959 * src/reader.at (readgram): Complain if a rule is not ended with a
1960 semi-colon.
1961
19622002-03-04 Akim Demaille <akim@epita.fr>
1963
1964 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1965 (count_sr_conflicts): Use bitset_count.
1966 * src/reduce.c (inaccessable_symbols): Ditto.
1967 (bits_size): Remove.
1968 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1969
19702002-03-04 Akim Demaille <akim@epita.fr>
1971
1972 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1973 * src/reduce.c: Remove the `bitset_zero's following the
1974 `bitset_create's, as now it is performed by the latter.
1975
19762002-03-04 Akim Demaille <akim@epita.fr>
1977
1978 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1979 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1980 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1981 latest sources from Michael.
1982
19832002-03-04 Akim Demaille <akim@epita.fr>
1984
1985 * src/output.c (output): Don't free the grammar.
1986 * src/reader.c (grammar_free): New.
1987 * src/main.c (main): Call it and don't free symtab here.
1988
19892002-03-04 Akim Demaille <akim@epita.fr>
1990
1991 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1992 before returning.
1993 Reported by Benoit Perrot.
1994
19952002-03-04 Akim Demaille <akim@epita.fr>
1996
1997 Use bitset operations when possible, not loops over bits.
1998
1999 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
2000 bitset_or.
2001 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
2002 * src/reduce.c (useless_nonterminals): Formatting changes.
2003 * src/warshall.c (TC): Use bitset_or.
2004
20052002-03-04 Akim Demaille <akim@epita.fr>
2006
2007 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
2008 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
2009 Ditto.
2010
20112002-03-04 Akim Demaille <akim@epita.fr>
2012
2013 * src/lalr.c (F): Now a bitset*.
2014 Adjust all dependencies.
2015
20162002-03-04 Akim Demaille <akim@epita.fr>
2017
2018 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
2019 Adjust all dependencies.
2020
20212002-03-04 Akim Demaille <akim@epita.fr>
2022
2023 * src/L0.c, src/LR0.h (nstates): Be size_t.
2024 Adjust comparisons (signed vs unsigned).
2025 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
2026 bitset*.
2027 Adjust all dependencies.
2028
20292002-03-04 Akim Demaille <akim@epita.fr>
2030
2031 * src/closure.c (firsts): Now, also a bitset.
2032 Adjust all dependencies.
2033 (varsetsize): Remove, now unused.
2034 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2035
20362002-03-04 Akim Demaille <akim@epita.fr>
2037
2038 * src/print.c: Convert to use bitset.h, not hand coded iterations
2039 over ints.
2040
20412002-03-04 Akim Demaille <akim@epita.fr>
2042
2043 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2044
20452002-03-04 Akim Demaille <akim@epita.fr>
2046
2047 * src/closure.c (ruleset): Be a bitset.
2048 (rulesetsize): Remove.
2049
20502002-03-04 Akim Demaille <akim@epita.fr>
2051
2052 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2053 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2054 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2055 * src/closure.c (fderives): Be an array of bitsets.
2056
20572002-02-28 Robert Anisko <robert@lrde.epita.fr>
2058
2059 * data/bison.c++: Merge the two generated headers. Insert a copyright
2060 notice in each output file.
2061
20622002-02-28 Akim Demaille <akim@epita.fr>
2063
2064 * data/bison.c++: Copy the prologue of bison.simple to fetch
2065 useful M4 definitions, such as b4_header_guard.
2066
20672002-02-25 Akim Demaille <akim@epita.fr>
2068
2069 * src/getargs.c (version): Give the name of the authors, and use a
2070 translator friendly scheme for the bgr
2071 copyright notice.
2072
20732002-02-25 Akim Demaille <akim@epita.fr>
2074
2075 * src/output.c (header_output): Remove, now handled completely via
2076 M4.
2077
20782002-02-25 Akim Demaille <akim@epita.fr>
2079
2080 * m4/m4.m4: New, from CVS Autoconf.
2081 * configure.in: Invoke it.
2082 * src/output.c (output_skeleton): Use its result instead of the
2083 hard coded name.
2084
20852002-02-25 Akim Demaille <akim@epita.fr>
2086
2087 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2088 Fileutils 4.1.5.
2089 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2090 * src/output.c (output_skeleton): Use mkstemp to create a real
2091 temporary file.
2092 Move the filling of `skeleton' and its muscle to...
2093 (prepare): here.
2094 (output): Move the definition of the prologue muscle to...
2095 (prepare): here.
2096 * src/system.h (DEFAULT_TMPDIR): New.
2097
20982002-02-14 Paul Eggert <eggert@twinsun.com>
2099
2100 Remove the support for C++ namespace cleanliness; it was
2101 causing more problems than it was curing, since it didn't work
2102 properly on some nonstandard C++ compilers. This can wait
2103 for a proper C++ parser.
2104
2105 * NEWS: Document this.
2106 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2107 of C++, as it's treated like C now.
2108 * src/bison.simple (YYSTD): Remove.
2109 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2110 Treat C++ just like Standard C instead of trying to support
2111 namespace cleanliness.
2112
21132002-02-14 Akim Demaille <akim@epita.fr>
2114
2115 * tests/regression.at (else): Adjust to Andreas' change.
2116
21172002-02-14 Akim Demaille <akim@epita.fr>
2118
2119 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2120
21212002-02-13 Andreas Schwab <schwab@suse.de>
2122
2123 * src/output.c (output_rule_data): Don't output NULL, it might
2124 not be defined yet.
2125
21262002-02-11 Robert Anisko <robert@lrde.epita.fr>
2127
2128 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2129 (Copyright notice): Update.
2130
21312002-02-11 Akim Demaille <akim@epita.fr>
2132
2133 * tests/regression.at (%nonassoc and eof): Don't include
2134 nonportable headers.
2135
21362002-02-08 Robert Anisko <robert@lrde.epita.fr>
2137
2138 * data/bison.c++: Correct error recovery. Make the user able to
2139 initialize the starting location.
2140
21412002-02-07 Akim Demaille <akim@epita.fr>
2142
2143 * tests/input.at: New.
2144
21452002-02-07 Robert Anisko <robert@lrde.epita.fr>
2146
2147 * data/bison.c++: Replace some direct m4 expansions by constants. Be
2148 more consistent when naming methods and variables. Put preprocessor
2149 directives around tables only needed for debugging.
2150
21512002-02-07 Robert Anisko <robert@lrde.epita.fr>
2152
2153 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2154 C++ parsers.
2155 (yy::b4_name::parse): Use print_.
2156
21572002-02-07 Robert Anisko <robert@lrde.epita.fr>
2158
2159 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2160
21612002-02-07 Robert Anisko <robert@lrde.epita.fr>
2162
2163 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2164 C++ parsers.
2165 (yy::b4_name::parse): Build verbose error messages, and use error_.
2166
21672002-02-06 Robert Anisko <robert@lrde.epita.fr>
2168
2169 * data/bison.c++: Fix m4 quoting in comments.
2170
21712002-02-06 Robert Anisko <robert@lrde.epita.fr>
2172
2173 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2174 not expanded by m4.
2175
21762002-02-05 Akim Demaille <akim@epita.fr>
2177
2178 * data/bison.c++: Adjust to the M4 back end.
2179 More is certainly needed.
2180
21812002-02-05 Akim Demaille <akim@epita.fr>
2182
2183 Give a try to M4 as a back end.
2184
2185 * lib/readpipe.c: New, from wdiff.
2186 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2187 BISON_HAIRY.
2188 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2189 specific values. Now it is m4 that performs the lookup.
2190 * src/parse-skel.y: Remove.
2191 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2192 * src/output.c (actions_output, guards_output)
2193 (token_definitions_output): No longer keeps track of the output
2194 line number, hence remove the second argument.
2195 (guards_output): Check against the guard member of a rule, not the
2196 action member.
2197 Adjust callers.
2198 (output_skeleton): Don't look for the skeleton location, let m4 do
2199 that.
2200 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2201 file will be used.
2202 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2203 (prepare): Given that for the time being changesyntax is not
2204 usable in M4, rename the muscles using `-' to `_'.
2205 Define `defines_flag', `output_parser_name' and `output_header_name'.
2206 * src/output.h (actions_output, guards_output)
2207 (token_definitions_output): Adjust prototypes.
2208 * src/scan-skel.l: Instead of scanning the skeletons, it now
2209 processes the output of m4: `__oline__' and `#output'.
2210 * data/bison.simple: Adjust to be used by M4(sugar).
2211 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2212 to date.
2213 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2214 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2215 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2216 shamelessly stolen from CVS Autoconf.
2217
22182002-02-05 Akim Demaille <akim@epita.fr>
2219
2220 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2221 * configure.in: Check for the declarations of free and malloc.
2222 * src/muscle_tab.c: Adjust.
2223
22242002-02-05 Akim Demaille <akim@epita.fr>
2225
2226 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2227 which have no values.
2228
22292002-02-05 Akim Demaille <akim@epita.fr>
2230
2231 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2232 * data/: here.
2233
22342002-01-29 Paul Eggert <eggert@twinsun.com>
2235
2236 * src/bison.simple (YYSIZE_T): Do not define merely because
2237 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2238 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2239
22402002-01-27 Akim Demaille <akim@epita.fr>
2241
2242 Fix `%nonassoc and eof'.
2243
2244 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2245 which were not properly copied! Replace
2246 memcpy (res->errs, src->errs, src->nerrs);
2247 with
2248 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2249 !!!
2250 * tests/regression.at (%nonassoc and eof): Adjust to newest
2251 Autotest: `.' is not in the PATH.
2252
22532002-01-27 Akim Demaille <akim@epita.fr>
2254
2255 * tests/sets.at (AT_EXTRACT_SETS): New.
2256 (Nullable): Use it.
2257 (Firsts): New.
2258
22592002-01-26 Akim Demaille <akim@epita.fr>
2260
2261 * tests/actions.at, tests/calc.at, tests/headers.at,
2262 * tests/torture.at: Adjust to the newest Autotest which no longer
2263 forces `.' in the PATH.
2264
22652002-01-25 Akim Demaille <akim@epita.fr>
2266
2267 * tests/regression.at (%nonassoc and eof): New.
2268 Suggested by Robert Anisko.
2269
22702002-01-24 Akim Demaille <akim@epita.fr>
2271
2272 Bison dumps core when trying to complain about broken input files.
2273 Reported by Cris van Pelt.
2274
2275 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2276 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2277 into...
2278 (Invalid inputs): Strengthen: exercise parse_percent_token.
2279
22802002-01-24 Robert Anisko <robert.anisko@epita.fr>
2281
2282 * src/Makefile.am: Add bison.c++.
2283 * src/bison.c++: New skeleton.
2284
22852002-01-21 Paolo Bonzini <bonzini@gnu.org>
2286
2287 * po/it.po: New.
2288
22892002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2290
2291 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2292
22932002-01-20 Marc Autret <marc@gnu.org>
2294
2295 * src/files.c (compute_output_file_names): Fix
2296
22972002-01-20 Marc Autret <marc@gnu.org>
2298
2299 * tests/output.at: New test.
2300 * src/files.c (compute_base_names): Don't map extensions when
2301 the YACC flag is set, use defaults.
2302 Reported by Evgeny Stambulchik.
2303
23042002-01-20 Marc Autret <marc@gnu.org>
2305
2306 * src/system.h: Need to define __attribute__ away for non-GCC
2307 compilers as well (i.e. the vendor C compiler).
2308 Suggested by Albert Chin-A-Young.
2309
23102002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2311
2312 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2313 canonical definition.
2314 * src/system.h: Use the canonical definition for PARAMS (avoids
2315 a conflict with the macro from lib/hash.h).
2316
23172002-01-11 Akim Demaille <akim@epita.fr>
2318
2319 * configure.in: Use AC_FUNC_STRNLEN.
2320 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
2321
23222002-01-09 Akim Demaille <akim@epita.fr>
2323
2324 * src/files.c, src/files.h (output_infix): New.
2325 (tab_extension): Remove.
2326 (compute_base_names): Compute the former, drop the latter.
2327 * src/output.c (prepare): Insert the muscles `output-infix', and
2328 `output-suffix'.
2329 * src/parse-skel.y (string, string.1): New.
2330 (section.header): Use it.
2331 (section.yacc): Remove.
2332 (prefix): Remove too.
2333 * src/scan-skel.l: Adjust.
2334 * src/bison.simple, src/bison.hairy: Adjust.
2335
23362002-01-09 Akim Demaille <akim@epita.fr>
2337
2338 * configure.in (WERROR_CFLAGS): Compute it.
2339 * src/Makefile.am (CFLAGS): Pass it.
2340 * tests/atlocal.in (CFLAGS): Idem.
2341 * src/files.c: Fix a few warnings.
2342 (get_extension_index): Remove, unused.
2343
23442002-01-08 Akim Demaille <akim@epita.fr>
2345
2346 * src/getargs.c (AS_FILE_NAME): New.
2347 (getargs): Use it to convert DOSish file names.
2348 * src/files.c (base_name): Rename as full_base_name to avoid
2349 clashes with `base_name ()'.
2350 (filename_split): New.
2351 (compute_base_names): N-th rewrite, using filename_split.
2352
23532002-01-08 Akim Demaille <akim@epita.fr>
2354
2355 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2356 New, stolen from the Fileutils 4.1.
2357 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2358 * configure.in: Check for the presence of memrchr, and of its
2359 prototype.
2360
23612002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2362
2363 * lib/hash.h (__P): Added definition for this macro.
2364 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2365 BUILT_SOURCES, to ensure they are generated first.
2366 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2367 %error-verbose to allow bootstrapping with bison 1.30x.
2368
23692002-01-06 Akim Demaille <akim@epita.fr>
2370
2371 * src/reader.c (parse_braces): Don't fetch the next char, the
2372 convention is to fetch on entry.
2373 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2374 'switch' without a following semicolon.
2375 * tests/regression.at (braces parsing): New.
2376
23772002-01-06 Akim Demaille <akim@epita.fr>
2378
2379 Bison is dead wrong in its RR conflict reports.
2380
2381 * tests/torture.at (GNU Cim Grammar): New.
2382 * src/conflicts.c (count_rr_conflicts): Fix.
2383
23842002-01-06 Akim Demaille <akim@epita.fr>
2385
2386 Creating package.m4 from configure.ac causes too many problems.
2387
2388 * tests/Makefile.am (package.m4): Create it by hand,
2389 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2390
23912002-01-06 Akim Demaille <akim@epita.fr>
2392
2393 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2394 skeleton.h.
2395
23962002-01-04 Paul Eggert <eggert@twinsun.com>
2397
2398 * doc/bison.texinfo (Debugging):
2399 Remove YYSTDERR; it's no longer defined or used.
2400 Also, s/cstdio.h/cstdio/.
2401
24022002-01-03 Akim Demaille <akim@epita.fr>
2403
2404 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2405
24062002-01-03 Akim Demaille <akim@epita.fr>
2407
2408 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2409 tracing code to --trace, wait for a better --trace option, with
2410 args.
2411
24122002-01-03 Akim Demaille <akim@epita.fr>
2413
2414 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2415 The ISO C++ standard is extremely clear about it: stderr is
2416 considered a macro, not a regular symbol (see table 94 `Header
2417 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2418 Therefore std:: does not apply to it. It still does with fprintf.
2419 Also, s/cstdio.h/cstdio/.
2420
24212002-01-03 Akim Demaille <akim@epita.fr>
2422
2423 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2424 for non system headers.
2425
24262002-01-02 Akim Demaille <akim@epita.fr>
2427
2428 Equip the skeleton chain with location tracking, runtime trace,
2429 pure parser and scanner.
2430
2431 * src/parse-skel.y: Request a pure parser, locations, and prefix
2432 renaming.
2433 (%union): Having several members with the same type does not help
2434 type mismatches, simplify.
2435 (YYPRINT, yyprint): New.
2436 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2437 (skel_error): this.
2438 Handle locations.
2439 * src/scan-skel.l: Adjust to these changes.
2440 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2441 (LOCATION_PRINT, skel_control_t): New.
2442
24432001-12-30 Akim Demaille <akim@epita.fr>
2444
2445 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2446 replace `gb' with BLANKS.
2447 * src/scan-skel.l: Adjust.
2448
24492001-12-30 Akim Demaille <akim@epita.fr>
2450
2451 * src/system.h: We don't need nor want bcopy.
2452 Throw away MS-DOS crap: we don't need getpid.
2453 * configure.in: We don't need strndup. It was even causing
2454 problems: because Flex includes the headers *before* us,
2455 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2456 not visible.
2457 * lib/xstrndup.c: New.
2458 * src/scan-skel.l: Use it.
2459 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2460 * src/parse-skel.y: Use %directives instead of #defines.
2461
24622001-12-30 Akim Demaille <akim@epita.fr>
2463
2464 * src/skeleton.h: New.
2465 * src/output.c (output_parser, output_master_parser): Remove, dead
2466 code.
2467 * src/output.h (get_lines_number, actions_output, guards_output)
2468 (token_definitions_output): Prototype them.
2469 * src/parse-skel.y: Add the license notice.
2470 Include output.h and skeleton.h.
2471 (process_skeleton): Returns void, and takes a single parameter.
2472 * src/scan-skel.l: Add the license notice.
2473 Include skeleton.h.
2474 Don't use %option yylineno: it seems that then Flex imagines
2475 REJECT has been used, and therefore it won't reallocate its
2476 buffers (which makes no other sense to me than a bug). It results
2477 in warnings for `unused: yy_flex_realloc'.
2478
24792001-12-30 Robert Anisko <robert.anisko@epita.fr>
2480
2481 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2482 (MUSCLE_INSERT_PREFIX): ...to there.
2483 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2484 (MUSCLE_INSERT_PREFIX): Move from here...
2485
2486 * src/bison.hairy: Add a section directive. Put braces around muscle
2487 names. This parser skeleton is still broken, but Bison should not
2488 choke on a bad muscle 'syntax'.
2489 * src/bison.simple: Add a section directive. Put braces around muscle
2490 names.
2491
2492 * src/files.h (strsuffix, stringappend): Add declarations.
2493 (tab_extension): Add declaration.
2494 (short_base_name): Add declaration.
2495
2496 * src/files.c (strsuffix, stringappend): No longer static. These
2497 functions are used in the skeleton parser.
2498 (tab_extension): New.
2499 (compute_base_names): Use the computations done in this function
2500 to guess if the generated parsers should have '.tab' in their
2501 names.
2502 (short_base_name): No longer static.
2503
2504 * src/output.c (output_skeleton): New.
2505 (output): Disable call to output_master_parser, and give a try to
2506 a new skeleton handling system.
2507 (guards_output, actions_output): No longer static.
2508 (token_definitions_output, get_lines_number): No longer static.
2509
2510 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2511
2512 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
2513 parse-skel.y.
2514
2515 * src/parse-skel.y: New file.
2516 * src/scan-skel.l: New file.
2517
25182001-12-29 Akim Demaille <akim@epita.fr>
2519
2520 %name-prefix is broken.
2521
2522 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2523 Adjust all dependencies.
2524 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2525 %name-prefix.
2526
2527 Renaming yylval but not yylloc is not consistent. Now we do.
2528
2529 * src/bison.simple: Prefix yylloc if used.
2530 * doc/bison.texinfo (Decl Summary): Document that.
2531
25322001-12-29 Akim Demaille <akim@epita.fr>
2533
2534 * doc/bison.texinfo: Promote `%long-directive' over
2535 `%long_directive'.
2536 Remove all references to fixed-output-files, yacc is enough.
2537
25382001-12-29 Akim Demaille <akim@epita.fr>
2539
2540 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2541 user prologue. These are defaults.
2542 * tests/actions.at (Mid-rule actions): Make sure the user can
2543 define YYDEBUG and YYERROR_VERBOSE.
2544
25452001-12-29 Akim Demaille <akim@epita.fr>
2546
2547 * src/output.c (header_output): Don't forget to export YYLTYPE and
2548 yylloc.
2549 * tests/headers.at (export YYLTYPE): New, make sure it does.
2550 * tests/regression.at (%union and --defines, Invalid CPP headers):
2551 Move to...
2552 * tests/headers.at: here.
2553
25542001-12-29 Akim Demaille <akim@epita.fr>
2555
2556 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2557
25582001-12-29 Akim Demaille <akim@epita.fr>
2559
2560 * tests/actions.at (Mid-rule actions): Output on a single line
2561 instead of several.
2562
25632001-12-29 Akim Demaille <akim@epita.fr>
2564
2565 * doc/bison.texinfo: Formatting changes.
2566
25672001-12-29 Akim Demaille <akim@epita.fr>
2568
2569 Don't store the token defs in a muscle, just be ready to output it
2570 on command. Now possible via `symbols'. Fixes a memory leak.
2571
2572 * src/output.c (token_definitions_output): New.
2573 (output_parser, header_output): Use it.
2574 * src/reader.c (symbols_save): Remove.
2575
25762001-12-29 Akim Demaille <akim@epita.fr>
2577
2578 * src/bison.simple: Do not provide a default for YYSTYPE and
2579 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2580 default.
2581
25822001-12-29 Akim Demaille <akim@epita.fr>
2583
2584 Mid-rule actions are simply... ignored!
2585
2586 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2587 the empty-rule associated to the dummy symbol, not to the host
2588 rule.
2589 * tests/actions.at (Mid-rule actions): New.
2590
25912001-12-29 Akim Demaille <akim@epita.fr>
2592
2593 Memory leak.
2594
2595 * src/reader.c (reader): Free grammar.
2596
25972001-12-29 Akim Demaille <akim@epita.fr>
2598
2599 Memory leak.
2600
2601 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2602 since it allocates it for each state, although only one is needed.
2603 (allocate_storage): Do it here.
2604
26052001-12-29 Akim Demaille <akim@epita.fr>
2606
2607 * src/options.h, src/options.c (create_long_option_table): Rename
2608 as...
2609 (long_option_table_new): this, with a clearer prototype.
2610 (percent_table): Remove, unused,
2611 * src/getargs.c (getargs): Adjust.
2612
26132001-12-29 Akim Demaille <akim@epita.fr>
2614
2615 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2616 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2617 as states.
2618
26192001-12-29 Akim Demaille <akim@epita.fr>
2620
2621 * src/lalr.c (build_relations): Rename `states' as `states1'.
2622 Sorry, I don't understand exactly what it is, no better name...
2623
26242001-12-29 Akim Demaille <akim@epita.fr>
2625
2626 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2627 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2628 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2629 as rules.
2630
26312001-12-29 Akim Demaille <akim@epita.fr>
2632
2633 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2634 ago.
2635
26362001-12-29 Akim Demaille <akim@epita.fr>
2637
2638 * src/reader.c, src/reader.h (user_toknums): Remove.
2639 Adjust all users to use symbols[i]->user_token_number.
2640
26412001-12-29 Akim Demaille <akim@epita.fr>
2642
2643 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2644 Adjust all users to use symbols[i]->prec or ->assoc.
2645
26462001-12-29 Akim Demaille <akim@epita.fr>
2647
2648 * src/reader.c, src/reader.h (tags): Remove.
2649 Adjust all users to use symbols[i]->tag.
2650
26512001-12-29 Akim Demaille <akim@epita.fr>
2652
2653 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2654 and rule_table.
2655 * src/reader.c (packsymbols): Fill this table.
2656 Drop sprec.
2657 * src/conflicts.c (resolve_sr_conflict): Adjust.
2658 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2659 single table.
2660 Use symbols[i]->tag instead of tags[i].
2661
26622001-12-29 Akim Demaille <akim@epita.fr>
2663
2664 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2665 In addition, put a comment in there, to replace...
2666 * tests/regression.at (%union and C comments): Remove.
2667
26682001-12-29 Akim Demaille <akim@epita.fr>
2669
2670 * tests/regression.at (Web2c Actions): Blindly move the actual
2671 output as expected output. The contents *seem* right to me, but I
2672 can't pretend reading perfectly parser tables... Nonetheless, all
2673 the other tests pass correctly, the table look OK, even though the
2674 presence of `$axiom' is to be noted: AFAICS it is useless (but
2675 harmless).
2676
26772001-12-29 Akim Demaille <akim@epita.fr>
2678
2679 * src/reader.c (readgram): Don't add the rule 0 if there were no
2680 rules read. In other words, add it _after_ having performed
2681 grammar sanity checks.
2682 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2683
26842001-12-29 Akim Demaille <akim@epita.fr>
2685
2686 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2687 visible, and some states have now a different number.
2688
26892001-12-29 Akim Demaille <akim@epita.fr>
2690
2691 * src/reader.c (readgram): Bind the initial rule's lineno to that
2692 of the first rule.
2693 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2694 (Solved SR Conflicts): Adjust rule 0's line number.
2695
26962001-12-29 Akim Demaille <akim@epita.fr>
2697
2698 Fix the `GAWK Grammar' failure.
2699
2700 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2701 the reductions of the first state which was mistakenly confused
2702 with the final state because precisely final_state was initialized
2703 to 0.
2704 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2705 now noticed by Bison.
2706 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2707 have a reduction on $default.
2708
27092001-12-29 Akim Demaille <akim@epita.fr>
2710
2711 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2712 rule line numbers.
2713 * src/closure.c (print_closure): Likewise.
2714 * src/derives.c (print_derives): Likewise.
2715 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2716 now.
2717
27182001-12-29 Akim Demaille <akim@epita.fr>
2719
2720 * src/lalr.c (lookaheads_print): New.
2721 (lalr): Call it when --trace-flag.
2722 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2723 are dumped.
2724
27252001-12-29 Akim Demaille <akim@epita.fr>
2726
2727 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2728 when walking through ritem, even via rule->rhs.
2729 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2730 (useful_production, useless_nonterminals): Likewise.
2731 (reduce_grammar_tables): Likewise, plus update nritems.
2732 * src/nullable.c (set_nullable): Likewise.
2733 * src/lalr.c (build_relations): Likewise.
2734 * tests/sets.at (Nullable): Adjust.
2735 Fortunately, now, the $axiom is no longer nullable.
2736
27372001-12-29 Akim Demaille <akim@epita.fr>
2738
2739 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2740 the 0-sentinel.
2741 * src/gram.c (ritem_longest_rhs): Likewise.
2742 * src/reduce.c (nonterminals_reduce): Likewise.
2743 * src/print_graph.c (print_graph): Likewise.
2744 * src/output.c (output_rule_data): Likewise.
2745 * src/nullable.c (set_nullable): Likewise.
2746
27472001-12-29 Akim Demaille <akim@epita.fr>
2748
2749 * src/output.c: Comment changes.
2750
27512001-12-27 Paul Eggert <eggert@twinsun.com>
2752
2753 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2754 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2755 Sparc, as they were causing more porting problems than the
2756 (minor) performance improvement was worth.
2757
2758 Also, catch up with 1.31's YYSTD.
2759
27602001-12-27 Akim Demaille <akim@epita.fr>
2761
2762 * src/output.c (output_gram): Rely on nritems, not the
2763 0-sentinel. See below.
2764 Use -1 as separator, not 0.
2765 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2766 Rely on -1 as separator in yyrhs, instead of 0.
2767 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2768 twice `Now at end of input', therefore there are two lines less to
2769 expect.
2770
27712001-12-27 Akim Demaille <akim@epita.fr>
2772
2773 * tests/regression.at (Unresolved SR Conflicts):
2774 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2775 below.
2776
27772001-12-27 Akim Demaille <akim@epita.fr>
2778
2779 * src/LR0.c (new_state): Recognize the final state by the fact it
2780 is reached by eoftoken.
2781 (insert_start_shifting_state, insert_eof_shifting_state)
2782 (insert_accepting_state, augment_automaton): Remove, since now
2783 these states are automatically computed from the initial state.
2784 (generate_states): Adjust.
2785 * src/print.c: When reporting a rule number to the user, substract
2786 1, so that the axiom rule is rule 0, and the first user rule is 1.
2787 * src/reduce.c: Likewise.
2788 * src/print_graph.c (print_core): For the time being, just as for
2789 the report, depend upon --trace-flags to dump the full set of
2790 items.
2791 * src/reader.c (readgram): Once the grammar read, insert the rule
2792 0: `$axiom: START-SYMBOL $'.
2793 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2794 number of the states has changed (the final state is no longer
2795 necessarily the last), catch up.
2796
27972001-12-27 Akim Demaille <akim@epita.fr>
2798
2799 Try to make the use of the eoftoken valid. Given that its value
2800 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2801 is used instead of > 0 where appropriate, (ii), depend upon nritems
2802 instead of the 0-sentinel.
2803
2804 * src/gram.h, src/gram.c (nritems): New.
2805 Expected to be duplication of nitems, but for the time being...
2806 * src/reader.c (packgram): Assert nritems and nitems are equal.
2807 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2808 * src/closure.c (print_closure, print_fderives): Likewise.
2809 * src/gram.c (ritem_print): Likewise.
2810 * src/print.c (print_core, print_grammar): Likewise.
2811 * src/print_graph.c: Likewise.
2812
28132001-12-27 Akim Demaille <akim@epita.fr>
2814
2815 * src/main.c (main): If there are complains after grammar
2816 reductions, then output the report anyway if requested, then die.
2817 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2818 * src/reader.c (eoftoken): New.
2819 (parse_token_decl): If the token being defined has value `0', it
2820 is the eoftoken.
2821 (packsymbols): No longer hack `tags' to insert `$' by hand.
2822 Be sure to preserve the value of the eoftoken.
2823 (reader): Make sure eoftoken is defined.
2824 Initialize nsyms to 0: now eoftoken is created just like the others.
2825 * src/print.c (print_grammar): Don't special case the eof token.
2826 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2827 lie anyway, albeit pleasant.
2828 * tests/calc.at: Exercise error messages with eoftoken.
2829 Change the grammar so that empty input is invalid.
2830 Adjust expectations.
2831 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2832
28332001-12-27 Akim Demaille <akim@epita.fr>
2834
2835 * configure.in: Check the protos of strchr ans strspn.
2836 Replace strchr if needed.
2837 * src/system.h: Provide the protos of strchr, strspn and memchr if
2838 missing.
2839 * lib/strchr.c: New.
2840 * src/reader.c (symbols_save): Use strchr.
2841
28422001-12-27 Akim Demaille <akim@epita.fr>
2843
2844 * src/print.c, src/print_graph.c (escape): New.
2845 Use it to quote the TAGS outputs.
2846 * src/print_graph.c (print_state): Now errors are in red, and
2847 reductions in green.
2848 Prefer high to wide: output the state number on a line of its own.
2849
28502001-12-27 Akim Demaille <akim@epita.fr>
2851
2852 * src/state.h, src/state.c (reductions_new): New.
2853 * src/LR0.c (set_state_table): Let all the states have a
2854 `reductions', even if reduced to 0.
2855 (save_reductions): Adjust.
2856 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2857 * src/print.c (print_reductions, print_actions): Adjust.
2858 * src/output.c (action_row): Adjust.
2859
28602001-12-27 Akim Demaille <akim@epita.fr>
2861
2862 * src/state.h, src/state.c (errs_new, errs_dup): New.
2863 * src/LR0.c (set_state_table): Let all the states have an errs,
2864 even if reduced to 0.
2865 * src/print.c (print_errs, print_reductions): Adjust.
2866 * src/output.c (output_actions, action_row): Adjust.
2867 * src/conflicts.c (resolve_sr_conflict): Adjust.
2868
28692001-12-27 Akim Demaille <akim@epita.fr>
2870
2871 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2872
28732001-12-27 Akim Demaille <akim@epita.fr>
2874
2875 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2876 * src/print.c: here.
2877 (lookaheadset, shiftset): New, used as additional storage by
2878 print_reductions.
2879 (print_results): Adjust.
2880 (print_shifts, print_gotos, print_errs): New, extracted from...
2881 (print_actions): here.
2882 * src/print_graph.c (print_actions): Remove dead code.
2883
28842001-12-27 Akim Demaille <akim@epita.fr>
2885
2886 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2887 `$n' and `@n'.
2888
28892001-12-27 Akim Demaille <akim@epita.fr>
2890
2891 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2892 (build_relations): Adjust.
2893
28942001-12-27 Akim Demaille <akim@epita.fr>
2895
2896 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2897 duplication.
2898
28992001-12-27 Akim Demaille <akim@epita.fr>
2900
2901 * src/reader.c (packgram): Catch nitems overflows.
2902
29032001-12-27 Akim Demaille <akim@epita.fr>
2904
2905 * src/files.c, src/files.h (guard_obstack): Remove.
2906 * src/output.c (output): Adjust.
2907 * src/reader.c (parse_braces): New, factoring...
2908 (copy_action, copy_guard): these two which are renamed as...
2909 (parse_action, parse_guard): these.
2910 As a voluntary consequence, using braces around guards is now
2911 mandatory.
2912
29132001-12-27 Akim Demaille <akim@epita.fr>
2914
2915 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2916 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2917 members.
2918 (symbol_list_new): Adjust.
2919 (copy_action): action_line is the first line, not the last.
2920 (copy_guard): Just as for actions, store the `action' only, not
2921 the switch/case/break flesh.
2922 Don't parse the user action that might follow the guard, let...
2923 (readgram): do it, i.e., now, there can be an action after a
2924 guard.
2925 In other words the guard is just explicitly optional.
2926 (packgram): Adjust.
2927 * src/output.c (guards_output): New.
2928 (output_parser): Call it when needed.
2929 (output): Also free the guard and attrs obstacks.
2930 * src/files.c, src/files.h (obstack_save): Remove.
2931 (output_files): Remove.
2932 As a result, if one needs the former `.act' file, using an
2933 appropriate skeleton which requires actions and guards is now
2934 required.
2935 * src/main.c (main): Adjust.
2936 * tests/semantic.at: New.
2937 * tests/regression.at: Use `input.y' as input file name.
2938 Avoid 8+3 problems by requiring input.c when the test needs the
2939 parser.
2940
29412001-12-27 Akim Demaille <akim@epita.fr>
2942
2943 * src/reader.c (symbol_list_new): Be sure to initialize all the
2944 fields.
2945
29462001-12-27 Akim Demaille <akim@epita.fr>
2947
2948 All the hacks using a final pseudo state are now useless.
2949
2950 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2951 * src/lalr.c (nLA): New.
2952 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2953 instead of lookaheadsp from the pseudo state (nstate + 1).
2954
29552001-12-27 Akim Demaille <akim@epita.fr>
2956
2957 * src/output.c (action_row, token_actions): Use a state_t instead
2958 of a integer, and nlookaheads instead of the following state's
2959 lookaheadsp.
2960
29612001-12-27 Akim Demaille <akim@epita.fr>
2962
2963 * src/conflicts.c (log_resolution, flush_shift)
2964 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2965 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2966 (conflicts_print, print_reductions): Use a state_t instead of an
2967 integer when referring to a state.
2968 As much as possible, depend upon nlookaheads, instead of the
2969 `lookaheadsp' member of the following state (since lookaheads of
2970 successive states are successive, the difference between state n + 1
2971 and n served as the number of lookaheads for state n).
2972 * src/lalr.c (add_lookback_edge): Likewise.
2973 * src/print.c (print_core, print_actions, print_state)
2974 (print_results): Likewise.
2975 * src/print_graph.c (print_core, print_actions, print_state)
2976 (print_graph): Likewise.
2977 * src/conflicts.h: Adjust.
2978
29792001-12-27 Akim Demaille <akim@epita.fr>
2980
2981 * src/bison.hairy: Formatting/comment changes.
2982 ANSIfy.
2983 Remove `register' indications.
2984 Add plenty of `static'.
2985
29862001-12-27 Akim Demaille <akim@epita.fr>
2987
2988 * src/output.c (prepare): Drop the muscle `ntbase' which
2989 duplicates ntokens.
2990 * src/bison.simple: Formatting/comment changes.
2991 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2992 is an undocumented synonym.
2993
29942001-12-22 Akim Demaille <akim@epita.fr>
2995
2996 * src/output.c (output_table_data): Change the prototype to use
2997 `int' for array ranges: some invocations do pass an int, not a
2998 short.
2999 Reported by Wayne Green.
3000
30012001-12-22 Akim Demaille <akim@epita.fr>
3002
3003 Some actions of web2c.y are improperly triggered.
3004 Reported by Mike Castle.
3005
3006 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
3007 * tests/regression.at (Web2c): Rename as...
3008 (Web2c Report): this.
3009 (Web2c Actions): New.
3010
30112001-12-22 Akim Demaille <akim@epita.fr>
3012
3013 Reductions in web2c.y are improperly reported.
3014 Reported by Mike Castle.
3015
3016 * src/conflicts.c (print_reductions): Fix.
3017 * tests/regression.at (Web2c): New.
3018
30192001-12-18 Akim Demaille <akim@epita.fr>
3020
3021 Some host fail on `assert (!"foo")', which expands to
3022 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
3023 Reported by Nelson Beebee.
3024
3025 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
3026 `#define it_succeeded 0' and `assert (it_succeeded)'.
3027
30282001-12-17 Marc Autret <autret_m@epita.fr>
3029
3030 * src/bison.simple: Don't hard code the skeleton line and filename.
3031 * src/output.c (output_parser): Rename 'line' as 'output_line'.
3032 New line counter 'skeleton_line' (skeleton-line muscle).
3033
30342001-12-17 Paul Eggert <eggert@twinsun.com>
3035
3036 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3037 YYDEBUG must be defined to a nonzero value.
3038
3039 * src/bison.simple (yytname): Do not assume that the user defines
3040 YYDEBUG to a properly parenthesized expression.
3041
30422001-12-17 Akim Demaille <akim@epita.fr>
3043
3044 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3045 nlookaheads is a new member.
3046 Adjust all users.
3047 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3048 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3049 state.
3050
30512001-12-17 Akim Demaille <akim@epita.fr>
3052
3053 * src/files.h, src/files.c (open_files, close_files): Remove.
3054 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3055 let...
3056 * src/reader.c (reader): Do it.
3057
30582001-12-17 Akim Demaille <akim@epita.fr>
3059
3060 * src/conflicts.c (print_reductions): Formatting changes.
3061
30622001-12-17 Akim Demaille <akim@epita.fr>
3063
3064 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3065 (flush_reduce): New.
3066 (resolve_sr_conflict): Adjust.
3067
30682001-12-17 Akim Demaille <akim@epita.fr>
3069
3070 * src/output.c (output_obstack): Be static and rename as...
3071 (format_obstack): this, to avoid any confusion with files.c's
3072 output_obstack.
3073 * src/reader.h (muscle_obstack): Move to...
3074 * src/output.h: here, since it's defined in output.c.
3075
30762001-12-17 Akim Demaille <akim@epita.fr>
3077
3078 * src/output.c (action_row, save_column, default_goto)
3079 (sort_actions, matching_state, pack_vector): Better variable
3080 locality.
3081
30822001-12-17 Akim Demaille <akim@epita.fr>
3083
3084 * src/output.c: Various formatting changes.
3085
30862001-12-17 Akim Demaille <akim@epita.fr>
3087
3088 * src/files.c (output_files): Free the output_obstack.
3089 * src/main.c (main): Call print and print_graph conditionally.
3090 * src/print.c (print): Work unconditionally.
3091 * src/print_graph.c (print_graph): Work unconditionally.
3092 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3093
30942001-12-16 Marc Autret <autret_m@epita.fr>
3095
3096 * src/output.c (actions_output): Fix. When we use %no-lines,
3097 there is one less line per action.
3098
30992001-12-16 Marc Autret <autret_m@epita.fr>
3100
3101 * src/bison.simple: Remove a useless #line directive.
3102 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3103 * src/output.c (get_lines_number): New.
3104 (output_parser): Adjust, now takes care about the lines of a
3105 output muscles.
3106 Fix line numbering.
3107 (actions_output): Computes the number of lines taken by actions.
3108 (output_master_parser): Insert new skeleton which is the name of
3109 the output parser file name.
3110
31112001-12-15 Marc Autret <autret_m@epita.fr>
3112
3113 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3114
31152001-12-15 Marc Autret <autret_m@epita.fr>
3116
3117 * src/output.c (output_gram): Keep track of the hairy one.
3118
31192001-12-15 Akim Demaille <akim@epita.fr>
3120
3121 Make `make distcheck' work.
3122
3123 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3124 system.h which uses libgettext.h.
3125
31262001-12-15 Akim Demaille <akim@epita.fr>
3127
3128 * src/nullable.c (set_nullable): Useless rules must be skipped,
3129 otherwise, since we range over their symbols, we might look at a
3130 nonterminal which no longer ``exists'', i.e., it is not counted in
3131 `nvars', hence we overflow our arrays.
3132
31332001-12-15 Akim Demaille <akim@epita.fr>
3134
3135 The header can also be produced directly, without any obstack!
3136 Yahoo!
3137
3138 * src/files.c, src/files.h (defines_obstack): Remove.
3139 (compute_header_macro): Global.
3140 (defines_obstack_save): Remove.
3141 * src/reader.c (parse_union_decl): No longer output to
3142 defines_obstack: its content can be found in the `stype' muscle
3143 anyway.
3144 (output_token_translations): Merge into...
3145 (symbols_output): this.
3146 Rename as...
3147 (symbols_save): this.
3148 (reader): Adjust.
3149 * src/output.c (header_output): New.
3150 (output): Call it.
3151
31522001-12-15 Akim Demaille <akim@epita.fr>
3153
3154 * src/reader.c (parse_union_decl): Instead of handling two obstack
3155 simultaneously, use one to define the `stype' muscle, and use the
3156 value of the latter to fill defines_obstack.
3157 (copy_comment): Remove.
3158 (copy_comment2): Work for a single obstack.
3159 Rename as...
3160 (copy_comment): this.
3161
31622001-12-15 Akim Demaille <akim@epita.fr>
3163
3164 * src/lex.c, src/lex.h (xgetc): No longer static.
3165 * src/reader.c (parse_union_decl): Revamp.
3166
31672001-12-15 Akim Demaille <akim@epita.fr>
3168
3169 Still making progress in separating Bison into (i) input, (ii)
3170 process, (iii) output: now we can directly output the parser file
3171 without using table_obstack at all.
3172
3173 * src/files.c, src/files.h (table_obstack): Bye bye.
3174 (parser_file_name): New.
3175 * src/files.c (compute_output_file_names): Compute it.
3176 * src/output.c (actions_output, output_parser)
3177 (output_master_parser): To a file instead of an obstack.
3178
31792001-12-15 Akim Demaille <akim@epita.fr>
3180
3181 Attach actions to rules, instead of pre-outputting them to
3182 actions_obstack.
3183
3184 * src/gram.h (rule_t): action and action_line are new members.
3185 * src/reader.c (symbol_list): Likewise.
3186 (copy_action): Save the actions within the rule.
3187 (packgram): Save them in rule_table.
3188 * src/output.c (actions_output): New.
3189 (output_parser): Use it on `%%actions'.
3190 (output_rule_data): Don't free rule_table.
3191 (output): Do it.
3192 (prepare): Don't save the `action' muscle.
3193 * src/bison.simple: s/%%action/%%actions/.
3194
31952001-12-15 Akim Demaille <akim@epita.fr>
3196
3197 * src/reader.c (copy_action): When --yacc, don't append a `;'
3198 to the user action: let it fail if lacking.
3199 Suggested by Arnold Robbins and Tom Tromey.
3200
32012001-12-14 Akim Demaille <akim@epita.fr>
3202
3203 * src/lex.c (literalchar): Simply return the char you decoded, non
3204 longer mess around with obstacks and int pointers.
3205 Adjust all callers.
3206
32072001-12-14 Akim Demaille <akim@epita.fr>
3208
3209 * src/lex.c (literalchar): Don't escape the special characters,
3210 just decode them, and keep them as char (before, eol was output as
3211 the 2 char string `\n' etc.).
3212 * src/output.c (output_rule_data): Use quotearg to output the
3213 token strings.
3214
32152001-12-13 Paul Eggert <eggert@twinsun.com>
3216
3217 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3218 Do not infringe on the global user namespace when using C++.
3219 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3220 All uses of `fprintf' and `stderr' changed.
3221
3222 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3223
32242001-12-13 Akim Demaille <akim@epita.fr>
3225
3226 The computation of nullable is broken: it doesn't handle empty
3227 RHS's properly.
3228
3229 * tests/torture.at (GNU AWK Grammar): New.
3230 * tests/sets.at (Nullable): New.
3231 * src/nullable.c (set_nullable): Instead of blindly looping over
3232 `ritems', loop over the rules, and then over their rhs's.
3233
3234 Work around Autotest bugs.
3235
3236 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3237 frame, because Autotest understand lines starting with a `+' as
3238 traces from the shell. Then, they are not processed properly.
3239 Admittedly an Autotest bug, but we don't have time to wait for
3240 Autotest to catch up.
3241 * tests/regression.at (Broken Closure): Adjust to the new table
3242 frames.
3243 Move to...
3244 * tests/sets.at: here.
3245
32462001-12-13 Akim Demaille <akim@epita.fr>
3247
3248 * src/closure.c (closure): Use nrules instead of playing tricks
3249 with BITS_PER_WORD.
3250
32512001-12-13 Akim Demaille <akim@epita.fr>
3252
3253 * src/print.c (print_actions): Output the handling of `$' as the
3254 traces do: shifting the token EOF. Before EOF was treated as a
3255 nonterminal.
3256 * tests/regression.at: Adjust some tests.
3257 * src/print_graph.c (print_core): Complete the set of items via
3258 closure. The next-to-final and final states are still unsatisfying,
3259 but that's to be addressed elsewhere.
3260 No longer output the rule numbers, but do output the state number.
3261 A single loop for the shifts + gotos is enough, but picked a
3262 distinct color for each.
3263 (print_graph): Initialize and finalize closure.
3264
32652001-12-13 Akim Demaille <akim@epita.fr>
3266
3267 * src/reader.c (readgram): Remove dead code, an strip useless
3268 braces.
3269 (get_type): Remove, unused.
3270
32712001-12-12 Akim Demaille <akim@epita.fr>
3272
3273 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3274 on that of lib/error.c.
3275
32762001-12-12 Akim Demaille <akim@epita.fr>
3277
3278 Some hosts don't like `/' in includes.
3279
3280 * src/system.h: Include libgettext.h without qualifying the path.
3281 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3282 $(top_srcdir).
3283
32842001-12-11 Marc Autret <autret_m@epita.fr>
3285
3286 * src/output.c (output_parser): Remove useless muscle.
3287
32882001-12-11 Marc Autret <autret_m@epita.fr>
3289
3290 * src/bison.simple: Remove #line just before %%epilogue. It
3291 is now handled in ...
3292 * src/reader.c (read_additionnal_code): Add the output of a
3293 #line for the epilogue.
3294
32952001-12-10 Marc Autret <autret_m@epita.fr>
3296
3297 * src/reader.c (copy_definition): Re-use CPP-outed code which
3298 replace precedent remove.
3299 * src/bison.simple: Remove #line before %%prologue because
3300 %%input-line is wrong at this time.
3301
33022001-12-10 Marc Autret <autret_m@epita.fr>
3303
3304 * src/reader.c (symbols_output): Clean up.
3305 * src/output.c (output_gram, output): Clean up.
3306
33072001-12-10 Akim Demaille <akim@epita.fr>
3308
3309 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3310 * src/LR0.c (set_state_table): here.
3311 * src/lalr.c (lalr): Call it.
3312
33132001-12-10 Akim Demaille <akim@epita.fr>
3314
3315 * src/state.h (shifts): Remove the `number' member: shifts are
3316 attached to state, hence no longer need to be labelled with a
3317 state number.
3318
33192001-12-10 Akim Demaille <akim@epita.fr>
3320
3321 Now that states have a complete set of members, the linked list of
3322 shifts is useless: just fill directly the state's shifts member.
3323
3324 * src/state.h (shifts): Remove the `next' member.
3325 * src/LR0.c (first_state, last_state): Remove.
3326 Adjust the callers.
3327 (augment_automaton): Don't look for the shifts that must be added
3328 a shift on EOF: it is those of the state we looked for! But now,
3329 since shifts are attached, it is no longer needed to looking
3330 merely by its id: its number.
3331
33322001-12-10 Akim Demaille <akim@epita.fr>
3333
3334 * src/LR0.c (augment_automaton): Better variable locality.
3335 Remove an impossible branch: if there is a state corresponding to
3336 the start symbol being shifted, then there is shift for the start
3337 symbol from the initial state.
3338
33392001-12-10 Akim Demaille <akim@epita.fr>
3340
3341 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3342 only when appropriate: when insert_start_shifting_state' is not
3343 invoked.
3344 * tests/regression.at (Rule Line Numbers): Adjust.
3345
33462001-12-10 Akim Demaille <akim@epita.fr>
3347
3348 * src/LR0.c (augment_automaton): Now that all states have shifts,
3349 merge the two cases addition shifts to the initial state.
3350
33512001-12-10 Akim Demaille <akim@epita.fr>
3352
3353 * src/lalr.c (set_state_table): Move to...
3354 * src/LR0.c: here.
3355 * src/lalr.c (lalr): Don't call it...
3356 * src/LR0.c (generate_states): do it.
3357 * src/LR0.h (first_state): Remove, only the table is used.
3358
33592001-12-10 Akim Demaille <akim@epita.fr>
3360
3361 * src/LR0.h (first_shift, first_reduction): Remove.
3362 * src/lalr.c: Don't use first_shift: find shifts through the
3363 states.
3364
33652001-12-10 Akim Demaille <akim@epita.fr>
3366
3367 * src/LR0.c: Attach shifts to states as soon as they are
3368 computed.
3369 * src/lalr.c (set_state_table): Instead of assigning shifts to
3370 state, just assert that the mapping was properly done.
3371
33722001-12-10 Akim Demaille <akim@epita.fr>
3373
3374 * src/LR0.c (insert_start_shift): Rename as...
3375 (insert_start_shifting_state): this.
3376 (insert_eof_shifting_state, insert_accepting_state): New.
3377 (augment_automaton): Adjust.
3378 Better locality of the variables.
3379 When looking if the start_symbol is shifted from the initial
3380 state, using `while (... symbol != start_symbol ...)' sounds
3381 better than `while (... symbol < start_symbol ...)': If fail
3382 to see how the order between symbols could be relevant!
3383
33842001-12-10 Akim Demaille <akim@epita.fr>
3385
3386 * src/getargs.h: Don't declare `spec_name_prefix' and
3387 `spec_file_prefix', declared by src/files.h.
3388 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3389 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3390 * src/output.c (prepare): Adjust.
3391 * src/reader.c (symbols_output): Likewise.
3392 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3393
33942001-12-10 Akim Demaille <akim@epita.fr>
3395
3396 * src/muscle_tab.c (muscle_init): NULL is a better default than
3397 `"0"'.
3398
33992001-12-10 Akim Demaille <akim@epita.fr>
3400
3401 * src/reader.c (reader): Calling symbols_output once is enough.
3402
34032001-12-10 Akim Demaille <akim@epita.fr>
3404
3405 Now that states have a complete set of members, the linked list of
3406 reductions is useless: just fill directly the state's reductions
3407 member.
3408
3409 * src/state.h (struct reductions): Remove member `number' and
3410 `next'.
3411 * src/LR0.c (first_reduction, last_reduction): Remove.
3412 (save_reductions): Don't link the new reductions, store them in
3413 this_state.
3414 * src/lalr.c (set_state_table): No need to attach reductions to
3415 states, it's already done.
3416 * src/output.c (output_actions): No longer free the shifts, then
3417 the reductions, then the states: free all the states and their
3418 members.
3419
34202001-12-10 Akim Demaille <akim@epita.fr>
3421
3422 * src/options.c (OPTN, DRTV, BOTH): New.
3423 (option_table): Use them.
3424
3425 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3426 the job of system.h.
3427 * src/options.c: Don't include stdio.h and xalloc.h for the same
3428 reasons.
3429
34302001-12-10 Akim Demaille <akim@epita.fr>
3431
3432 * src/output.c (output, prepare): Make sure the values of the
3433 muscles `action' and `prologue' are 0-terminated.
3434
34352001-12-10 Akim Demaille <akim@epita.fr>
3436
3437 Clean up GCC warnings.
3438
3439 * src/reader.c (copy_action): `buf' is not used.
3440 (parse_skel_decl): Be static.
3441 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3442 * src/options.h (create_long_option_table): Have a real prototype.
3443 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3444 (hash_delete_at): Return const void *.
3445 Adjust casts to preserve the const.
3446
34472001-12-10 Akim Demaille <akim@epita.fr>
3448
3449 * configure.in: Require 2.52g.
3450 M4 is not needed, but AUTOM4TE is.
3451 * m4/m4.m4: Remove.
3452 * tests/Makefile.am: Adjust.
3453
34542001-12-10 Akim Demaille <akim@epita.fr>
3455
3456 One structure for states is enough, even though theoretically
3457 there are LR(0) states and LALR(1) states.
3458
3459 * src/lalr.h (state_t): Remove.
3460 (state_table): Be state_t **, not state_t *.
3461 * src/state.h (core, CORE_ALLOC): Rename as...
3462 (state_t, STATE_ALLOC): this.
3463 Add the LALR(1) members: shifts, reductions, errs.
3464 * src/LR0.c (state_table): Rename as...
3465 (state_hash): this, to avoid name clashes with the global
3466 `state_table'.
3467 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3468 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3469
34702001-12-10 Akim Demaille <akim@epita.fr>
3471
3472 Bison dumps core on bash.y.
3473 Reported by Pascal Bart.
3474
3475 * src/warshall.c (bitmatrix_print): New.
3476 (TC): Use it.
3477 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3478 j must be the outer loop.
3479 * tests/regression.at (Broken Closure): New.
3480
34812001-12-05 Akim Demaille <akim@epita.fr>
3482
3483 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3484 its argument.
3485