]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/state.h (reductions_t): Rename member `nreds' as num.
[bison.git] / ChangeLog
CommitLineData
d2576365
AD
12002-06-30 Akim Demaille <akim@epita.fr>
2
3 * src/state.h (reductions_t): Rename member `nreds' as num.
4 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
5 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
6
7
ccaf65bc
AD
82002-06-30 Akim Demaille <akim@epita.fr>
9
10 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
11 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12 (shifts_to): Rename as...
13 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
15 (TRANSITION_IS_DISABLED, transitions_to): these.
16
17
87675353
AD
182002-06-30 Akim Demaille <akim@epita.fr>
19
20 * src/print.c (print_shifts, print_gotos): Merge into...
21 (print_transitions): this.
22 (print_transitions, print_errs, print_reductions): Align the
23 lookaheads columns.
24 (print_core, print_transitions, print_errs, print_state,
25 print_grammar): Output empty lines separator before, not after.
26 (state_default_rule_compute): Rename as...
27 (state_default_rule): this.
28 * tests/conflicts.at (Defaulted Conflicted Reduction),
29 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
30 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
31
ce4ccb4b
AD
322002-06-30 Akim Demaille <akim@epita.fr>
33
34 Display items as we display rules.
35
36 * src/gram.h, src/gram.c (rule_lhs_print): New.
37 * src/gram.c (grammar_rules_partial_print): Use it.
38 * src/print.c (print_core): Likewise.
39 * tests/conflicts.at (Defaulted Conflicted Reduction),
40 (Unresolved SR Conflicts): Adjust.
41 (Unresolved SR Conflicts): Adjust and rename as...
42 (Resolved SR Conflicts): this, as was meant.
43 * tests/regression.at (Web2c Report): Adjust.
44
bc933ef1
AD
452002-06-30 Akim Demaille <akim@epita.fr>
46
47 * src/print.c (state_default_rule_compute): New, extracted from...
48 (print_reductions): here.
49 Pessimize, but clarify the code.
50 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
51
53d4308d
AD
522002-06-30 Akim Demaille <akim@epita.fr>
53
54 * src/output.c (action_row): Let default_rule be always a rule
55 number.
56
57
574fb2d5
AD
582002-06-30 Akim Demaille <akim@epita.fr>
59
60 * src/closure.c (print_firsts, print_fderives, closure):
61 Use BITSET_EXECUTE.
62 * src/lalr.c (lookaheads_print): Likewise.
63 * src/state.c (state_rule_lookaheads_print): Likewise.
64 * src/print_graph.c (print_core): Likewise.
65 * src/print.c (print_reductions): Likewise.
66 * src/output.c (action_row): Likewise.
67 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
68
69
05811fd7
AD
702002-06-30 Akim Demaille <akim@epita.fr>
71
72 * src/print_graph.c: Use report_flag.
73
74
0e4d5753
AD
752002-06-30 Akim Demaille <akim@epita.fr>
76
77 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
78 to...
79 * src/relation.h, src/relation.c (traverse, relation_digraph)
80 (relation_print, relation_transpose): New.
81
82
24c7d800
AD
832002-06-30 Akim Demaille <akim@epita.fr>
84
85 * src/state.h, src/state.c (shifts_to): New.
86 * src/lalr.c (build_relations): Use it.
87
88
9222837b
AD
892002-06-30 Akim Demaille <akim@epita.fr>
90
91 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
92 (item_number_of_rule_number, rule_number_of_item_number): New.
93 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
94 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
95 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
96 Propagate their use.
97 Much remains to be done, in particular wrt `shorts' from types.h.
98
99
260008e5
AD
1002002-06-30 Akim Demaille <akim@epita.fr>
101
102 * src/symtab.c (symbol_new): Initialize the `printer' member.
103
104
8a731ca8
AD
1052002-06-30 Akim Demaille <akim@epita.fr>
106
107 * src/LR0.c (save_reductions): Remove, replaced by...
108 * src/state.h, src/state.c (state_reductions_set): New.
109 (reductions, errs): Rename as...
110 (reductions_t, errs_t): these.
111 Adjust all dependencies.
112
113
32e1e0a4
AD
1142002-06-30 Akim Demaille <akim@epita.fr>
115
116 * src/LR0.c (state_list_t, state_list_append): New.
117 (first_state, last_state): Now symbol_list_t.
118 (this_state): Remove.
119 (new_itemsets, append_states, save_reductions): Take a state_t as
120 argument.
121 (set_states, generate_states): Adjust.
122 (save_shifts): Remove, replaced by...
123 * src/state.h, src/state.c (state_shifts_set): New.
124 (shifts): Rename as...
125 (shifts_t): this.
126 Adjust all dependencies.
127 * src/state.h (state_t): Remove the `next' member.
128
129
e5fb6710
AD
1302002-06-30 Akim Demaille <akim@epita.fr>
131
132 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
133 escaped in slot 0.
134
135
1362002-06-30 Akim Demaille <akim@epita.fr>
137
138 Use hash.h for the state hash table.
139
140 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
141 (allocate_storage): Use state_hash_new.
142 (free_storage): Use state_hash_free.
143 (new_state, get_state): Adjust.
144 * src/lalr.h, src/lalr.c (states): Move to...
145 * src/states.h (state_t): Remove the `link' member, no longer
146 used.
147 * src/states.h, src/states.c: here.
148 (state_hash_new, state_hash_free, state_hash_lookup)
149 (state_hash_insert, states_free): New.
150 * src/states.c (state_table, state_compare, state_hash): New.
151 * src/output.c (output_actions): Do not free states now, since we
152 still need to know the final_state number in `prepare', called
153 afterwards. Do it...
154 * src/main.c (main): here: call states_free after `output'.
155
156
c7ca99d4
AD
1572002-06-30 Akim Demaille <akim@epita.fr>
158
159 Use hash.h for the state hash table.
160
161 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
162 (allocate_storage): Use state_hash_new.
163 (free_storage): Use state_hash_free.
164 (new_state, get_state): Adjust.
165 * src/lalr.h, src/lalr.c (states): Move to...
166 * src/states.h (state_t): Remove the `link' member, no longer
167 used.
168 * src/states.h, src/states.c: here.
169 (state_hash_new, state_hash_free, state_hash_lookup)
170 (state_hash_insert, states_free): New.
171 * src/states.c (state_table, state_compare, state_hash): New.
172 * src/output.c (output_actions): Do not free states now, since we
173 still need to know the final_state number in `prepare', called
174 afterwards. Do it...
175 * src/main.c (main): here: call states_free after `output'.
176
177
df0e7316
AD
1782002-06-30 Akim Demaille <akim@epita.fr>
179
180 * src/state.h, src/state.c (state_new): New, extracted from...
181 * src/LR0.c (new_state): here.
182 * src/state.h (STATE_ALLOC): Move to...
183 * src/state.c: here.
184 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
185 * src/state.h, src/state.c: here.
186
187
39f41916
AD
1882002-06-30 Akim Demaille <akim@epita.fr>
189
190 * src/reader.c (gensym): Rename as...
191 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
192 (getsym): Rename as...
193 (symbol_get): this.
194
195
d57650a5
AD
1962002-06-30 Akim Demaille <akim@epita.fr>
197
198 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
199 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
200 * src/output.c, src/print.c, src/print_graph.c: Propagate.
201 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
202
5a08f1ce
AD
2032002-06-30 Akim Demaille <akim@epita.fr>
204
205 Make the test suite pass with warnings checked.
206
207 * tests/actions.at (Printers and Destructors): Improve.
208 Avoid unsigned vs. signed issues.
209 * tests/calc.at: Don't exercise the scanner here, do it...
210 * tests/input.at (Torturing the Scanner): here.
211
212
720623af
PH
2132002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
214
215 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
216 reorganize first lines parallel to yacc.c.
217
fb8135fa
AD
2182002-06-28 Akim Demaille <akim@epita.fr>
219
220 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
221 (b4_token_enum, b4_token_defines): New, factored from...
222 * data/lalr1.cc, data/yacc.c, glr.c: here.
223
41442480
AD
2242002-06-28 Akim Demaille <akim@epita.fr>
225
226 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
227 unused variables.
228 * src/output.c (merger_output): static.
229
e0e5bf84
AD
2302002-06-28 Akim Demaille <akim@epita.fr>
231
232 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
233 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
234 pacify GCC.
235 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 236
676385e2
PH
2372002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
238
239 Accumulated changelog for new GLR parsing features.
240
e0e5bf84 241 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
242 conflicts_total_count.
243 * src/conflicts.h: Ditto.
244 * src/output.c (token_actions): Use the new name.
245 (output_conflicts): Change conflp => conflict_list_heads, and
246 confl => conflict_list for better readability.
247 * data/glr.c: Use the new names.
248 * NEWS: Add self to GLR announcement.
e0e5bf84 249
676385e2
PH
250 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
251
252 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
253 Akim Demaille.
254
255 * data/bison.glr: Change name to glr.c
256 * data/glr.c: Renamed from bison.glr.
257 * data/Makefile.am: Add glr.c
e0e5bf84
AD
258
259 * src/getargs.c:
260
676385e2
PH
261 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
262 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 263
676385e2
PH
264 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
265
266 * data/bison.glr: Be sure to restore the
267 current #line when returning to the skeleton contents after having
268 exposed the input file's #line.
269
270 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
271
272 * data/bison.glr: Bring up to date with changes to bison.simple.
273
274 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
275
276 * data/bison.glr: Correct definitions that use b4_prefix.
277 Various reformatting.
278 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
279 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
280 yytokenp argument; now part of stack.
281 (yychar): Define to behave as documented.
282 (yyclearin): Ditto.
e0e5bf84 283
676385e2
PH
284 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
285
286 * src/reader.h: Add declaration for free_merger_functions.
287
288 * src/reader.c (merge_functions): New variable.
289 (get_merge_function): New function.
290 (free_merger_functions): New function.
291 (readgram): Check for %prec that is not followed by a symbol.
292 Handle %dprec and %merge declarations.
293 (packgram): Initialize dprec and merger fields in rules array.
294
295 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
296 conflict_list_cnt, conflict_list_free): New variables.
297 (table_grow): Also grow conflict_table.
e0e5bf84 298 (prepare_rules): Output dprec and merger tables.
676385e2 299 (conflict_row): New function.
e0e5bf84 300 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
301 default reduction in conflicted states for GLR parser so that there
302 are spaces for the conflict lists.
303 (save_row): Also save conflict information.
304 (token_actions): Allocate conflict list.
305 (merger_output): New function.
306 (pack_vector): Pack conflict table, too.
307 (output_conflicts): New function to output yyconflp and yyconfl.
308 (output_check): Allocate conflict_tos.
309 (output_actions): Output conflict tables, also.
310 (output_skeleton): Output b4_mergers definition.
311 (prepare): Output b4_max_rhs_length definition.
312 Use 'bison.glr' as default skeleton for GLR parsers.
313
314 * src/gram.c (glr_parser): New flag.
315 (grammar_free): Call free_merger_functions.
316
317 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
318 all pairs of conflicting reductions, rather than just all tokens
319 causing conflicts. Needed to size conflict tables.
e0e5bf84 320 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
321 interface.
322 (conflicts_print): Ditto.
323 (count_total_conflicts): New function.
324
325 * src/reader.h (merger_list): New type.
326 (merge_functions): New variable.
327
328 * src/lex.h (tok_dprec, tok_merge): New token types.
329
330 * src/gram.h (rule_s): Add dprec and merger fields.
331 (glr_parser): New flag.
332
333 * src/conflicts.h (count_total_conflicts): New function.
334
335 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
336
337 * doc/bison.texinfo (Generalized LR Parsing): New section.
338 (GLR Parsers): New section.
339 (Language and Grammar): Mention GLR parsing.
340 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
341 Correct typo ("tge" -> "the").
342
343 * data/bison.glr: New skeleton for GLR parsing.
344
345 * tests/cxx-gram.at: New tests for GLR parsing.
346
347 * tests/testsuite.at: Include cxx-gram.at.
348
349 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 350
676385e2
PH
351 * src/parse-gram.y:
352
353 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
354
355 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 356
b5480d74 3572002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
358
359 * src/options.h, src/options.c: Remove.
360 * src/getargs.c (short_options, long_options): New.
361
60491a94
AD
3622002-06-27 Akim Demaille <akim@epita.fr>
363
364 * data/bison.simple, data/bison.c++: Rename as...
365 * data/yacc.c, data/lalr1.cc: these.
366 * doc/bison.texinfo (Environment Variables): Remove.
367
9be0c25b
AD
3682002-06-25 Raja R Harinath <harinath@cs.umn.edu>
369
370 * src/getargs.c (report_argmatch): Initialize strtok().
371
1ae72863
AD
3722002-06-20 Akim Demaille <akim@epita.fr>
373
374 * data/bison.simple (b4_symbol_actions): New, replaces...
375 (b4_symbol_destructor, b4_symbol_printer): these.
376 (yysymprint): Be sure to call YYPRINT only for tokens, and using
377 user token numbers.
378
87542d29
AD
3792002-06-20 Akim Demaille <akim@epita.fr>
380
381 * data/bison.simple (yydestructor): Rename as...
382 (yydestruct): this.
383
1a31ed21
AD
3842002-06-20 Akim Demaille <akim@epita.fr>
385
386 * src/symtab.h, src/symtab.c (symbol_type_set)
387 (symbol_destructor_set, symbol_precedence_set): The location is
388 the last argument.
389 Adjust all callers.
390
e776192e
AD
3912002-06-20 Akim Demaille <akim@epita.fr>
392
393 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
394 internals.
395 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
396 Takes a location.
397 * src/symtab.h, src/symtab.c (symbol_class_set)
398 (symbol_user_token_number_set): Likewise.
399 Adjust all callers.
400 Promote complain_at.
401 * tests/input.at (Type Clashes): Adjust.
402
5c1180b3
AD
4032002-06-20 Akim Demaille <akim@epita.fr>
404
405 * data/bison.simple (YYLEX): Fix the declaration when
406 %pure-parser.
407
e3170060
AD
4082002-06-20 Akim Demaille <akim@epita.fr>
409
410 * data/bison.simple (yysymprint): Don't print the token number,
411 just its name.
412 * tests/actions.at (Destructors): Rename as...
413 (Printers and Destructors): this.
414 Also exercise %printer.
415
253862fd
AD
4162002-06-20 Akim Demaille <akim@epita.fr>
417
418 * data/bison.simple (YYDSYMPRINT): New.
419 Use it to remove many of the #if YYDEBUG/if (yydebug).
420
366eea36
AD
4212002-06-20 Akim Demaille <akim@epita.fr>
422
423 * src/symtab.h, src/symtab.c (symbol_t): printer and
424 printer_location are new members.
425 (symbol_printer_set): New.
426 * src/parse-gram.y (PERCENT_PRINTER): New token.
427 Handle its associated rule.
428 * src/scan-gram.l: Adjust.
429 (handle_destructor_at, handle_destructor_dollar): Rename as...
430 (handle_symbol_code_at, handle_symbol_code_dollar): these.
431 * src/output.c (symbol_printers_output): New.
432 (output_skeleton): Call it.
433 * data/bison.simple (yysymprint): New. Cannot be named yyprint
434 since there are already many grammar files with a user `yyprint'.
435 Replace the calls to YYPRINT to calls to yysymprint.
436 * tests/calc.at: Adjust.
437 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
438 taking advantage of parser very internal details (stack size!).
439
4f25ebb0
AD
4402002-06-20 Akim Demaille <akim@epita.fr>
441
442 * src/scan-gram.l: Complete the scanner with the missing patterns
443 to pacify Flex.
444 Use `quote' and `symbol_tag_get' where appropriate.
445
93b68a0e
AD
4462002-06-19 Akim Demaille <akim@epita.fr>
447
448 * tests/actions.at (Destructors): Augment to test locations.
449 * data/bison.simple (yydestructor): Pass it the current location
450 if locations are enabled.
451 Prototype only when __STDC__ or C++.
452 Change the argument names to move into the yy name space: there is
453 user code here.
454
58612f1d
AD
4552002-06-19 Akim Demaille <akim@epita.fr>
456
74310291
AD
457 * data/bison.simple (b4_pure_if): New.
458 Use it instead of #ifdef YYPURE.
459
4602002-06-19 Akim Demaille <akim@epita.fr>
461
462 * data/bison.simple (b4_location_if): New.
58612f1d
AD
463 Use it instead of #ifdef YYLSP_NEEDED.
464
f25bfb75
AD
4652002-06-19 Akim Demaille <akim@epita.fr>
466
467 Prepare @$ in %destructor, but currently don't bind it in the
468 skeleton, as %location use is not cleaned up yet.
469
470 * src/scan-gram.l (handle_dollar, handle_destructor_at)
471 (handle_action_at): New.
472 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
473 a braced_code_t and a location as additional arguments.
474 (handle_destructor_dollar): Instead of requiring `b4_eval', just
475 unquote one when outputting `b4_dollar_dollar'.
476 Adjust callers.
477 * data/bison.simple (b4_eval): Remove.
478 (b4_symbol_destructor): Adjust.
479 * tests/input.at (Invalid @n): Adjust.
480
c732d2c6
AD
4812002-06-19 Zack Weinberg <zack@codesourcery.com>
482
483 * doc/bison.texinfo: Document ability to have multiple
484 prologue sections.
485
8c165d89
AD
4862002-06-18 Akim Demaille <akim@epita.fr>
487
488 * src/files.c (compute_base_names): When computing the output file
489 names from the input file name, strip the directory part.
490
ca98bf57
AD
4912002-06-18 Akim Demaille <akim@epita.fr>
492
493 * data/bison.simple.new: Comment changes.
494 Reported by Andreas Schwab.
495
0bfb02ff
AD
4962002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
497
498 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
499 there are no `label `yyoverflowlab' defined but not used' warnings
500 when yyoverflow is defined.
501
24c0aad7
AD
5022002-06-18 Akim Demaille <akim@epita.fr>
503
504 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
505 new member.
506 (symbol_destructor_set): Adjust.
507 * src/output.c (symbol_destructors_output): Output the destructor
508 locations.
509 Output the symbol name.
510 * data/bison.simple (b4_symbol_destructor): Adjust.
511
5719c109
AD
5122002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
513 and Akim Demaille <akim@epita.fr>
514
515 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
516 what's left on the stack when the error recovery hits EOF.
517 * tests/actions.at (Destructors): Complete to exercise this case.
518
9280d3ef
AD
5192002-06-17 Akim Demaille <akim@epita.fr>
520
521 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
522 arguments is really empty, not only equal to `[]'.
523 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
524 member.
525 (symbol_destructor_set): New.
526 * src/output.c (symbol_destructors_output): New.
527 * src/reader.h (brace_code_t, current_braced_code): New.
528 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
529 (handle_dollar): Rename as...
530 (handle_action_dollar): this.
531 (handle_destructor_dollar): New.
532 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
533 (grammar_declaration): Use it.
534 * data/bison.simple (yystos): Is always defined.
535 (yydestructor): New.
536 * tests/actions.at (Destructors): New.
537 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
538
dafdc66f
AD
5392002-06-17 Akim Demaille <akim@epita.fr>
540
541 * src/symlist.h, src/symlist.c (symbol_list_length): New.
542 * src/scan-gram.l (handle_dollar, handle_at): Compute the
543 rule_length only when needed.
544 * src/output.c (actions_output, token_definitions_output): Output
545 the full M4 block.
546 * src/symtab.c: Don't access directly to the symbol tag, use
547 symbol_tag_get.
548 * src/parse-gram.y: Use symbol_list_free.
549
56c47203
AD
5502002-06-17 Akim Demaille <akim@epita.fr>
551
552 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
553 (symbol_list_prepend, get_type_name): Move to...
554 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
555 (symbol_list_prepend, symbol_list_n_type_name_get): here.
556 Adjust all callers.
557 (symbol_list_free): New.
558 * src/scan-gram.l (handle_dollar): Takes a location.
559 * tests/input.at (Invalid $n): Adjust.
560
1e0bab92
AD
5612002-06-17 Akim Demaille <akim@epita.fr>
562
563 * src/reader.h, src/reader.c (symbol_list_new): Export it.
564 (symbol_list_prepend): New.
565 * src/parse-gram.y (%union): `list' is a new member.
566 (symbols.1): New, replaces...
567 (terms_to_prec.1, nterms_to_type.1): these.
568 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
569 Take a location as additional argument.
570 Adjust all callers.
571
04e60654
AD
5722002-06-15 Akim Demaille <akim@epita.fr>
573
574 * src/parse-gram.y: Move %token in the declaration section so that
575 we don't depend upon CVS Bison.
576
10e5b8bd
AD
5772002-06-15 Akim Demaille <akim@epita.fr>
578
579 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
580 * src/print.c (print_core): Use it.
581
9801d40c
AD
5822002-06-15 Akim Demaille <akim@epita.fr>
583
584 * src/conflicts.c (log_resolution): Accept the rule involved in
585 the sr conflicts instead of the lookahead number that points to
586 that rule.
587 (flush_reduce): Accept the current lookahead vector as argument,
588 instead of the index in LA.
589 (resolve_sr_conflict): Accept the current number of lookahead
590 bitset to consider for the STATE, instead of the index in LA.
591 (set_conflicts): Adjust.
592 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
593
c0263492
AD
5942002-06-15 Akim Demaille <akim@epita.fr>
595
596 * src/state.h (state_t): Replace the `lookaheadsp' member, a
597 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
598 Adjust all dependencies.
599 * src/lalr.c (initialize_lookaheads): Split into...
600 (states_lookaheads_count, states_lookaheads_initialize): these.
601 (lalr): Adjust.
602
9757c359
AD
6032002-06-15 Akim Demaille <akim@epita.fr>
604
605 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
606 out of...
607 (grammar_rules_print): here.
608 * src/reduce.c (reduce_output): Use it.
609 * tests/reduce.at (Useless Rules, Reduced Automaton)
610 (Underivable Rules): Adjust.
611
6b98e4b5
AD
6122002-06-15 Akim Demaille <akim@epita.fr>
613
614 Copy BYacc's nice way to report the grammar.
615
616 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
617 New.
618 Don't print the rules' location, it is confusing and useless.
619 (rule_print): Use grammar_rhs_print.
620 * src/print.c (print_grammar): Use grammar_rules_print.
621
6b98e4b5
AD
6222002-06-15 Akim Demaille <akim@epita.fr>
623
624 Complete and rationalize `useless thing' warnings.
625
626 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
627 (symbol_tag_print): New.
628 Use them everywhere in place of accessing directly the tag member.
629 * src/gram.h, src/gram.c (rule_print): New.
630 Use it where a rule used to be printed `by hand'.
631 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
632 (reduce_grammar_tables): Report the useless rules.
633 (reduce_print): Useless things are a warning, not an error.
634 Report it as such.
635 * tests/reduce.at (Useless Nonterminals, Useless Rules):
636 (Reduced Automaton, Underivable Rules): Adjust.
637 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
638 * tests/conflicts.at (Unresolved SR Conflicts)
639 (Solved SR Conflicts): Adjust.
640
ee000ba4
AD
6412002-06-15 Akim Demaille <akim@epita.fr>
642
643 Let symbols have a location.
644
645 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
646 (getsym): Adjust.
647 Adjust all callers.
648 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
649 Use location_t, not int.
650 * src/symtab.c (symbol_check_defined): Take advantage of the
651 location.
652 * tests/regression.at (Invalid inputs): Adjust.
653
8efe435c
AD
6542002-06-15 Akim Demaille <akim@epita.fr>
655
656 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
657 (input): Don't try to initialize yylloc here, do it in the
658 scanner.
659 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
660 * src/gram.h (rule_t): Change line and action_line into location
661 and action_location, of location_t type.
662 Adjust all dependencies.
663 * src/location.h, src/location.c (empty_location): New.
664 * src/reader.h, src/reader.c (grammar_start_symbol_set)
665 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
666 (grammar_current_rule_symbol_append)
667 (grammar_current_rule_action_append): Expect a location as argument.
668 * src/reader.c (grammar_midrule_action): Adjust to attach an
669 action's location as dummy symbol location.
670 * src/symtab.h, src/symtab.c (startsymbol_location): New.
671 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
672 the line numbers.
673
1921f1d7
AD
6742002-06-14 Akim Demaille <akim@epita.fr>
675
676 Grammar declarations may be found in the grammar section.
677
678 * src/parse-gram.y (rules_or_grammar_declaration): New.
679 (declarations): Each declaration may end with a semicolon, not
680 just...
681 (grammar_declaration): `"%union"'.
682 (grammar): Branch to rules_or_grammar_declaration.
683
4515534c
AD
6842002-06-14 Akim Demaille <akim@epita.fr>
685
686 * src/main.c (main): Invoke scanner_free.
687
f958596b
AD
6882002-06-14 Akim Demaille <akim@epita.fr>
689
690 * src/output.c (m4_invoke): Extracted from...
691 (output_skeleton): here.
692 Free tempfile.
693
2c569025
AD
6942002-06-14 Akim Demaille <akim@epita.fr>
695
696 * src/parse-gram.y (directives, directive, gram)
697 (grammar_directives, precedence_directives, precedence_directive):
698 Rename as...
699 (declarations, declaration, grammar, grammar_declaration)
700 (precedence_declaration, precedence_declarator): these.
701 (symbol_declaration): New.
702
592e8d4d
AD
7032002-06-14 Akim Demaille <akim@epita.fr>
704
705 * src/files.c (action_obstack): Remove, unused.
706 (output_obstack): Remove it, and all its dependencies, as it is no
707 longer needed.
708 * src/reader.c (epilogue_set): Build the epilogue in the
709 muscle_obstack.
710 * src/output.h, src/output.c (muscle_obstack): Move to...
711 * src/muscle_tab.h, src/muscle_tab.h: here.
712 (muscle_init): Initialize muscle_obstack.
713 (muscle_free): New.
714 * src/main.c (main): Call it.
715
0c15323d
AD
7162002-06-14 Akim Demaille <akim@epita.fr>
717
718 * src/location.h: New, extracted from...
719 * src/reader.h: here.
720 * src/Makefile.am (noinst_HEADERS): Merge into
721 (bison_SOURCES): this.
722 Add location.h.
723 * src/parse-gram.y: Use location_t instead of Bison's.
724 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
725 Use location_t instead of ints.
726
e96c9728
AD
7272002-06-14 Akim Demaille <akim@epita.fr>
728
729 * data/bison.simple, data/bison.c++: Be sure to restore the
730 current #line when returning to the skeleton contents after having
731 exposed the input file's #line.
732
75d1fe16
AD
7332002-06-12 Akim Demaille <akim@epita.fr>
734
735 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
736 eager.
737 * tests/actions.at (Exotic Dollars): New.
738
6c35d22c
AD
7392002-06-12 Akim Demaille <akim@epita.fr>
740
741 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
742 ['"/] too eagerly.
743 * tests/input.at (Torturing the Scanner): New.
744
1d6412ad
AD
7452002-06-11 Akim Demaille <akim@epita.fr>
746
747 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
748 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
749 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
750 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
751 * src/reader.c (reader): Use it.
752
4cdb01db
AD
7532002-06-11 Akim Demaille <akim@epita.fr>
754
755 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
756 Adjust all callers.
757 (scanner_last_string_free): New.
758
44995b2e
AD
7592002-06-11 Akim Demaille <akim@epita.fr>
760
761 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
762 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
763 (last_string, YY_OBS_FREE): New.
764 Use them when returning an ID.
765
e9955c83
AD
7662002-06-11 Akim Demaille <akim@epita.fr>
767
768 Have Bison grammars parsed by a Bison grammar.
769
770 * src/reader.c, src/reader.h (prologue_augment): New.
771 * src/reader.c (copy_definition): Remove.
772
773 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
774 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
775 (grammar_current_rule_prec_set, grammar_current_rule_check)
776 (grammar_current_rule_symbol_append)
777 (grammar_current_rule_action_append): Export.
778 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
779 (symbol_list_action_append): Remove.
780 Hook the routines from reader.
781 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
782 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
783
784 * src/reader.c (read_declarations): Remove, unused.
785
786 * src/parse-gram.y: Handle the epilogue.
787 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
788 (grammar_start_symbol_set): this.
789 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
790 * src/reader.c (readgram): Remove, unused.
791 (reader): Adjust to insert eoftoken and axiom where appropriate.
792
793 * src/reader.c (copy_dollar): Replace with...
794 * src/scan-gram.h (handle_dollar): this.
795 * src/parse-gram.y: Remove `%thong'.
796
797 * src/reader.c (copy_at): Replace with...
798 * src/scan-gram.h (handle_at): this.
799
800 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
801 New.
802
803 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
804 time being.
805
806 * src/reader.h, src/reader.c (grammar_rule_end): New.
807
808 * src/parse.y (current_type, current_class): New.
809 Implement `%nterm', `%token' support.
810 Merge `%term' into `%token'.
811 (string_as_id): New.
812 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
813 type name.
814
815 * src/parse-gram.y: Be sure to handle properly the beginning of
816 rules.
817
818 * src/parse-gram.y: Handle %type.
819 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
820
821 * src/parse-gram.y: More directives support.
822 * src/options.c: No longer handle source directives.
823
824 * src/parse-gram.y: Fix %output.
825
826 * src/parse-gram.y: Handle %union.
827 Use the prologue locations.
828 * src/reader.c (parse_union_decl): Remove.
829
830 * src/reader.h, src/reader.c (epilogue_set): New.
831 * src/parse-gram.y: Use it.
832
833 * data/bison.simple, data/bison.c++: b4_stype is now either not
834 defined, then default to int, or to the contents of %union,
835 without `union' itself.
836 Adjust.
837 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
838
839 * src/output.c (actions_output): Don't output braces, as they are
840 already handled by the scanner.
841
842 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
843 characters to themselves.
844
845 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
846 that the epilogue has a proper #line.
847
848 * src/parse-gram.y: Handle precedence/associativity.
849
850 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
851 a terminal.
852 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
853 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
854 at all to define terminals that cannot be emitted.
855
856 * src/scan-gram.l: Escape M4 characters.
857
858 * src/scan-gram.l: Working properly with escapes in user
859 strings/characters.
860
861 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
862 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
863 grammar.
864 Use more modest sizes, as for the time being the parser does not
865 release memory, and therefore the process swallows a huge amount
866 of memory.
867
868 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
869 stricter %token grammar.
870
871 * src/symtab.h (associativity): Add `undef_assoc'.
872 (symbol_precedence_set): Do nothing when passed an undef_assoc.
873 * src/symtab.c (symbol_check_alias_consistence): Adjust.
874
875 * tests/regression.at (Invalid %directive): Remove, as it is now
876 meaningless.
877 (Invalid inputs): Adjust to the new error messages.
878 (Token definitions): The new grammar doesn't allow too many
879 eccentricities.
880
881 * src/lex.h, src/lex.c: Remove.
882 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
883 (copy_character, copy_string2, copy_string, copy_identifier)
884 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
885 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
886 (parse_action): Remove.
887 * po/POTFILES.in: Adjust.
888
2e047461
AD
8892002-06-11 Akim Demaille <akim@epita.fr>
890
891 * src/reader.c (parse_action): Don't store directly into the
892 rule's action member: return the action as a string.
893 Don't require `rule_length' as an argument: compute it.
894 (grammar_current_rule_symbol_append)
895 (grammar_current_rule_action_append): New, eved out from
896 (readgram): here.
897 Remove `action_flag', `rulelength', unused now.
898
9af3fbce
AD
8992002-06-11 Akim Demaille <akim@epita.fr>
900
901 * src/reader.c (grammar_current_rule_prec_set).
902 (grammar_current_rule_check): New, eved out from...
903 (readgram): here.
904 Remove `xaction', `first_rhs': useless.
905 * tests/input.at (Type clashes): New.
906 * tests/existing.at (GNU Cim Grammar): Adjust.
907
1485e106
AD
9082002-06-11 Akim Demaille <akim@epita.fr>
909
910 * src/reader.c (grammar_midrule_action): New, Eved out from
911 (readgram): here.
912
da4160c3
AD
9132002-06-11 Akim Demaille <akim@epita.fr>
914
915 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
916 New.
917 (readgram): Use them as replacement of inlined code, crule and
918 crule1.
919
f6d0f937
AD
9202002-06-11 Akim Demaille <akim@epita.fr>
921
922 * src/reader.c (grammar_end, grammar_symbol_append): New.
923 (readgram): Use them.
924 Make the use of `p' as local as possible.
925
69078d4b
AD
9262002-06-10 Akim Demaille <akim@epita.fr>
927
928 GCJ's parser requires the tokens to be defined before the prologue.
929
930 * data/bison.simple: Output the token definition before the user's
931 prologue.
932 * tests/regression.at (Braces parsing, Duplicate string)
933 (Mixing %token styles): Check the output from bison.
934 (Early token definitions): New.
935
5e424082
AD
9362002-06-10 Akim Demaille <akim@epita.fr>
937
938 * src/symtab.c (symbol_user_token_number_set): Don't complain when
939 assigning twice the same user number to a token, so that we can
940 use it in...
941 * src/lex.c (lex): here.
942 Also use `symbol_class_set' instead of hand written code.
943 * src/reader.c (parse_assoc_decl): Likewise.
944
44536b35
AD
9452002-06-10 Akim Demaille <akim@epita.fr>
946
947 * src/symtab.c, src/symtab.c (symbol_class_set)
948 (symbol_user_token_number_set): New.
949 * src/reader.c (parse_token_decl): Use them.
950 Use a switch instead of ifs.
951 Use a single argument.
952
8b9f2372
AD
9532002-06-10 Akim Demaille <akim@epita.fr>
954
955 Remove `%thong' support as it is undocumented, unused, duplicates
956 `%token's job, and creates useless e-mail traffic with people who
957 want to know what it is, why it is undocumented, unused, and
958 duplicates `%token's job.
959
960 * src/reader.c (parse_thong_decl): Remove.
961 * src/options.c (option_table): Remove "thong".
962 * src/lex.h (tok_thong): Remove.
963
3ae2b51f
AD
9642002-06-10 Akim Demaille <akim@epita.fr>
965
966 * src/symtab.c, src/symtab.c (symbol_type_set)
967 (symbol_precedence_set): New.
968 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
969 (value_components_used): Remove, unused.
970
2f1afb73
AD
9712002-06-09 Akim Demaille <akim@epita.fr>
972
973 Move symbols handling code out of the reader.
974
975 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
976 (axiom): Move to...
977 * src/symtab.h, src/symtab.c: here.
978
979 * src/gram.c (start_symbol): Remove: use startsymbol->number.
980 * src/reader.c (startval): Rename as...
981 * src/symtab.h, src/symtab.c (startsymbol): this.
982 * src/reader.c: Adjust.
983
984 * src/reader.c (symbol_check_defined, symbol_make_alias)
985 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
986 (token_translations_init)
987 Move to...
988 * src/symtab.c: here.
989 * src/reader.c (packsymbols): Move to...
990 * src/symtab.h, src/symtab.c (symbols_pack): here.
991 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
992 argument.
993
e9bca3ad
AD
9942002-06-03 Akim Demaille <akim@epita.fr>
995
996 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
997 then statements.
998
86eff183
AD
9992002-06-03 Akim Demaille <akim@epita.fr>
1000
1001 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1002 structs with non literals.
1003 * src/scan-skel.l: never-interactive.
1004 * src/conflicts.c (enum conflict_resolution_e): No trailing
1005 comma.
1006 * src/getargs.c (usage): Split long literal strings.
1007 Reported by Hans Aberg.
1008
717be197
AD
10092002-05-28 Akim Demaille <akim@epita.fr>
1010
1011 * data/bison.c++: Use C++ ostreams.
1012 (cdebug_): New member.
1013
670ddffd
AD
10142002-05-28 Akim Demaille <akim@epita.fr>
1015
1016 * src/output.c (output_skeleton): Be sure to allocate enough room
1017 for `/' _and_ for `\0' in full_skeleton.
1018
769b430f
AD
10192002-05-28 Akim Demaille <akim@epita.fr>
1020
1021 * data/bison.c++: Catch up with bison.simple:
1022 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1023 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1024 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1025 and popping traces.
1026
7067cb36
PH
10272002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1028
1029 * src/output.c (output_skeleton): Put an explicit path in front of
1030 the skeleton file name, rather than relying on the -I directory,
1031 to partially alleviate effects of having a skeleton file lying around
1032 in the current directory.
769b430f 1033
4a713ec2
PH
10342002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1035
769b430f 1036 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
1037 obstack_printf should be obstack_fgrow1.
1038
b408954b
AD
10392002-05-26 Akim Demaille <akim@epita.fr>
1040
1041 * src/state.h (state_t): `solved_conflicts' is a new member.
1042 * src/LR0.c (new_state): Set it to 0.
1043 * src/conflicts.h, src/conflicts.c (print_conflicts)
1044 (free_conflicts, solve_conflicts): Rename as...
1045 (conflicts_print, conflicts_free, conflicts_solve): these.
1046 Adjust callers.
1047 * src/conflicts.c (enum conflict_resolution_e)
1048 (solved_conflicts_obstack): New, used by...
1049 (log_resolution): this.
1050 Adjust to attach the conflict resolution to each state.
1051 Complete the description with the precedence/associativity
1052 information.
1053 (resolve_sr_conflict): Adjust.
1054 * src/print.c (print_state): Output its solved_conflicts.
1055 * tests/conflicts.at (Unresolved SR Conflicts)
1056 (Solved SR Conflicts): Exercise --report=all.
1057
a49aecd5
AD
10582002-05-26 Akim Demaille <akim@epita.fr>
1059
1060 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1061 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1062 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1063 (token_number_t, item_number_as_token_number)
1064 (token_number_as_item_number, muscle_insert_token_number_table):
1065 Rename as...
1066 (symbol_number_t, item_number_as_symbol_number)
1067 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1068 these, since it is more appropriate.
1069
5504898e
AD
10702002-05-26 Akim Demaille <akim@epita.fr>
1071
1072 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1073 `Error:' lines.
1074 * data/bison.simple (yystos) [YYDEBUG]: New.
1075 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1076 error recovery.
1077 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1078
ec3bc396
AD
10792002-05-25 Akim Demaille <akim@epita.fr>
1080
1081 * doc/bison.texinfo (Debugging): Split into...
1082 (Tracing): this new section, its former contents, and...
1083 (Understanding): this new section.
1084 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1085 by...
1086 (report_flag): this.
1087 Adjust all dependencies.
1088 (report_args, report_types, report_argmatch): New.
1089 (usage, getargs): Report/support -r, --report.
1090 * src/options.h
1091 (struct option_table_struct): Rename as..,
1092 (struct option_table_s): this.
1093 Rename the `set_flag' member to `flag' to match with getopt_long's
1094 struct.
1095 * src/options.c (option_table): Split verbose into an entry for
1096 %verbose, and another for --verbose.
1097 Support --report/-r, so remove -r from the obsolete --raw.
1098 * src/print.c: Attach full item sets and lookaheads reports to
1099 report_flag instead of trace_flag.
1100 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1101
78df8250
PE
11022002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1103 and Paul Eggert <eggert@twinsun.com>
769b430f 1104
78df8250
PE
1105 * data/bison.simple (yyparse): Correct error handling to conform to
1106 POSIX and yacc. Specifically, after syntax error is discovered,
1107 do not reduce further before shifting the error token.
1108 Clean up the code a bit by removing the labels yyerrdefault,
1109 yyerrhandle, yyerrpop.
1110 * NEWS: Document the above.
1111
c0c9ea05
PH
11122002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1113
1114 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1115 type; it isn't always big enough, since it doesn't necessarily
1116 include non-terminals.
769b430f 1117 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
1118 the latter can be removed.
1119 (yy_token_number_type): Remove, only one use.
1120 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1121 don't use TokenNumberType as element type.
769b430f 1122
c0c9ea05
PH
1123 * tests/regression.at: Modify expected output to agree with change
1124 to yyr1 and yytranslate.
769b430f 1125
6390a83f
FK
11262002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1127
1128 * src/reader.c (parse_action): Use copy_character instead of
1129 obstack_1grow.
1130
db7c8e9a
AD
11312002-05-13 Akim Demaille <akim@epita.fr>
1132
1133 * tests/regression.at (Token definitions): Prototype yylex and
1134 yyerror.
1135
fcc61800
PH
11362002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1137
158c687b 1138 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
1139 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1140 32-bit arithmetic.
1141 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1142
5683e9b2
AD
11432002-05-07 Akim Demaille <akim@epita.fr>
1144
1145 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1146 avoid GCC warnings.
1147
0c2d3f4c
AD
11482002-05-07 Akim Demaille <akim@epita.fr>
1149
1150 Kill GCC warnings.
1151
1152 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1153 over the RHS of each rule.
1154 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1155 * src/state.h (state_t): Member `nitems' is unsigned short.
1156 * src/LR0.c (get_state): Adjust.
1157 * src/reader.c (packgram): Likewise.
1158 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1159 `Type'.
1160 (muscle_insert_int_table): Remove, unused.
1161 (prepare_rules): Remove `max'.
1162
1565b720
AD
11632002-05-06 Akim Demaille <akim@epita.fr>
1164
1165 * src/closure.c (print_firsts): Display of the symbol tags.
1166 (bitmatrix_print): Move to...
1167 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1168 here.
1169 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1170
cfaee611
AD
11712002-05-06 Akim Demaille <akim@epita.fr>
1172
1173 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1174 hash_do_for_each.
1175
458be8e0
AD
11762002-05-06 Akim Demaille <akim@epita.fr>
1177
1178 * src/LR0.c (new_state, get_state): Instead of using the global
1179 `kernel_size' and `kernel_base', have two new arguments:
1180 `core_size' and `core'.
1181 Adjust callers.
1182
a900a624
AD
11832002-05-06 Akim Demaille <akim@epita.fr>
1184
1185 * src/reader.c (packgram): No longer end `ritem' with a 0
1186 sentinel: it is not used.
1187
d4e7d3a1
AD
11882002-05-05 Akim Demaille <akim@epita.fr>
1189
1190 New experimental feature: display the lookaheads in the report and
1191 graph.
1192
1193 * src/print (print_core): When --trace-flag, display the rules
1194 lookaheads.
1195 * src/print_graph.c (print_core): Likewise.
1196 Swap the arguments.
1197 Adjust caller.
1198
39ceb25b
AD
11992002-05-05 Akim Demaille <akim@epita.fr>
1200
1201 * tests/torture.at (Many lookaheads): New test.
1202
5372019f
AD
12032002-05-05 Akim Demaille <akim@epita.fr>
1204
1205 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1206 (GENERATE_MUSCLE_INSERT_TABLE): this.
1207 (output_int_table, output_unsigned_int_table, output_short_table)
1208 (output_token_number_table, output_item_number_table): Replace with...
1209 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1210 (muscle_insert_short_table, muscle_insert_token_number_table)
1211 (muscle_insert_item_number_table): these.
1212 Adjust all callers.
1213 (prepare_tokens): Don't free `translations', since...
1214 * src/reader.h, src/reader.c (grammar_free): do it.
1215 Move to...
1216 * src/gram.h, src/gram.c (grammar_free): here.
1217 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1218 b4_translate_max.
1219
5df5f6d5
AD
12202002-05-05 Akim Demaille <akim@epita.fr>
1221
1222 * src/output.c (output_unsigned_int_table): New.
1223 (prepare_rules): `i' is unsigned.
1224 `prhs', `rline', `r2' are unsigned int.
1225 Rename muscle `rhs_number_max' as `rhs_max'.
1226 Output muscles `prhs_max', `rline_max', and `r2_max'.
1227 Free rline and r1.
1228 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1229 to compute types instead of constant types.
1230 * tests/regression.at (Web2c Actions): Adjust.
1231
b87f8b21
AD
12322002-05-04 Akim Demaille <akim@epita.fr>
1233
1234 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1235 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1236 Adjust dependencies.
1237 * src/output.c (token_definitions_output): Be sure not to output a
1238 `#define 'a'' when fed with `%token 'a' "a"'.
1239 * tests/regression.at (Token definitions): New.
1240
8bb936e4
PE
12412002-05-03 Paul Eggert <eggert@twinsun.com>
1242
1243 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1244 for K&R C.
1245
12462002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1247
1248 * Makefile.am (SUBDIRS): Remove intl.
1249 (EXTRA_DIST): Add config/config.rpath.
1250
53c71a12
AD
12512002-05-03 Akim Demaille <akim@epita.fr>
1252
1253 * data/bison.simple (m4_if): Don't output empty enums.
1254 And actually, output valid enum definitions :(.
1255
289dd0cf
AD
12562002-05-03 Akim Demaille <akim@epita.fr>
1257
1258 * configure.bat: Remove, completely obsolete.
1259 * Makefile.am (EXTRA_DIST): Adjust.
1260 Don't distribute config.rpath...
1261 * config/Makefile.am (EXTRA_DIST): Do it.
1262
db85e524
AD
12632002-05-03 Akim Demaille <akim@epita.fr>
1264
1265 * configure.in (GETTEXT_VERSION): New.
1266 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1267
83ccf991
AD
12682002-05-03 Akim Demaille <akim@epita.fr>
1269
1270 * data/bison.simple (b4_token_enum): New.
1271 (b4_token_defines): Use it to output tokens both as #define and
1272 enums.
1273 Suggested by Paul Eggert.
1274 * src/output.c (token_definitions_output): Don't output spurious
1275 white spaces.
1276
1f418995
AD
12772002-05-03 Akim Demaille <akim@epita.fr>
1278
1279 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1280
45119f04
RA
12812002-05-02 Robert Anisko <robert@lrde.epita.fr>
1282
1283 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1284 Update the stack class, give a try to deque as the default container.
1285
b2d52318
AD
12862002-05-02 Akim Demaille <akim@epita.fr>
1287
1288 * data/bison.simple (yyparse): Do not implement @$ = @1.
1289 (YYLLOC_DEFAULT): Adjust to do it.
1290 * doc/bison.texinfo (Location Default Action): Fix.
1291
3a8b4109
AD
12922002-05-02 Akim Demaille <akim@epita.fr>
1293
1294 * src/reader.c (parse_braces): Merge into...
1295 (parse_action): this.
1296
84614e13
AD
12972002-05-02 Akim Demaille <akim@epita.fr>
1298
1299 * configure.in (ALL_LINGUAS): Remove.
1300 * po/LINGUAS, hr.po: New.
1301
fdbcd8e2
AD
13022002-05-02 Akim Demaille <akim@epita.fr>
1303
1304 Remove the so called hairy (semantic) parsers.
1305
1306 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1307 * src/gram.h, src/gram.c (semantic_parser): Remove.
1308 (rule_t): Remove the guard and guard_line members.
1309 * src/lex.h (token_t): remove tok_guard.
1310 * src/options.c (option_table): Remove %guard and %semantic_parser
1311 support.
1312 * src/output.c, src/output.h (guards_output): Remove.
1313 (prepare): Adjust.
1314 (token_definitions_output): Don't output the `T'
1315 tokens (???).
1316 (output_skeleton): Don't output the guards.
1317 * src/files.c, src/files.c (attrsfile): Remove.
1318 * src/reader.c (symbol_list): Remove the guard and guard_line
1319 members.
1320 Adjust dependencies.
1321 (parse_guard): Remove.
1322 * data/bison.hairy: Remove.
1323 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1324 BISON_HAIRY.
1325
82b6cb3f
AD
13262002-05-02 Akim Demaille <akim@epita.fr>
1327
1328 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1329 (parse_guard): Rename the formal argument `stack_offset' as
1330 `rule_length', which is more readable.
1331 Adjust callers.
1332 (copy_at, copy_dollar): Instead of outputting the hard coded
1333 values of $$, $n and so forth, output invocation to b4_lhs_value,
1334 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
1335 Note: this patch partially drops `semantic-parser' support: it
1336 always does `rule_length - n', where semantic parsers ought to
1337 always use `-n'.
82b6cb3f
AD
1338 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1339 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1340
6cbfbcc5
AD
13412002-05-02 Akim Demaille <akim@epita.fr>
1342
1343 * configure.in (AC_INIT): Bump to 1.49b.
1344 (AM_INIT_AUTOMAKE): Short invocation.
1345
b8548114
AD
13462002-05-02 Akim Demaille <akim@epita.fr>
1347
1348 Version 1.49a.
1349
c20cd1fa
AD
13502002-05-01 Akim Demaille <akim@epita.fr>
1351
1352 * src/skeleton.h: Remove.
1353
8a9566d4
AD
13542002-05-01 Akim Demaille <akim@epita.fr>
1355
1356 * src/skeleton.h: Fix the #endif.
1357 Reported by Magnus Fromreide.
1358
8c6d399a
PE
13592002-04-26 Paul Eggert <eggert@twinsun.com>
1360
1361 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1362 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 1363 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 1364
2b7ed18a
RA
13652002-04-25 Robert Anisko <robert@lrde.epita.fr>
1366
1367 * src/scan-skel.l: Postprocess quadrigraphs.
1368
1369 * src/reader.c (copy_character): New function, used to output
1370 single characters while replacing `[' and `]' with quadrigraphs, to
1371 avoid troubles with M4 quotes.
1372 (copy_comment): Output characters with copy_character.
1373 (read_additionnal_code): Likewise.
1374 (copy_string2): Likewise.
1375 (copy_definition): Likewise.
1376
1377 * tests/calc.at: Exercise M4 quoting.
1378
34a89c50
AD
13792002-04-25 Akim Demaille <akim@epita.fr>
1380
1381 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1382 between `!' and the command.
1383 Reported by Paul Eggert.
1384
0dd1580a
RA
13852002-04-24 Robert Anisko <robert@lrde.epita.fr>
1386
1387 * tests/calc.at: Exercise prologue splitting.
1388
1389 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1390 `b4_post_prologue' instead of `b4_prologue'.
1391
1392 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1393 muscles.
1394 (output): Free pre_prologue_obstack and post_prologue_obstack.
1395 * src/files.h, src/files.c (attrs_obstack): Remove.
1396 (pre_prologue_obstack, post_prologue_obstack): New.
1397 * src/reader.c (copy_definition): Add a parameter to specify the
1398 obstack to fill, instead of using attrs_obstack unconditionally.
1399 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1400 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1401
83c1796f
PE
14022002-04-23 Paul Eggert <eggert@twinsun.com>
1403
1404 * data/bison.simple: Remove unnecessary commentary and white
1405 space differences from 1_29-branch.
1406 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1407
1408 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1409 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1410 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1411 constructors or destructors.
1412
1413 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1414
1207eeac
AD
14152002-04-23 Akim Demaille <akim@epita.fr>
1416
1417 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1418 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1419 location with columns.
1420 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1421 All reported by Paul Eggert.
1422
78ab8f67
AD
14232002-04-22 Akim Demaille <akim@epita.fr>
1424
1425 * src/reduce.c (dump_grammar): Move to...
1426 * src/gram.h, src/gram.c (grammar_dump): here.
1427 Be sure to separate long item numbers.
1428 Don't read the members of a rule's prec if its nil.
1429
133c20e2
AD
14302002-04-22 Akim Demaille <akim@epita.fr>
1431
1432 * src/output.c (table_size, table_grow): New.
1433 (MAXTABLE): Remove, replace uses with table_size.
1434 (pack_vector): Instead of dying when the table is too big, grow it.
1435
9515e8a7
AD
14362002-04-22 Akim Demaille <akim@epita.fr>
1437
1438 * data/bison.simple (yyr1): Its type is that of a token number.
1439 * data/bison.c++ (r1_): Likewise.
1440 * tests/regression.at (Web2c Actions): Adjust.
1441
23c5a174
AD
14422002-04-22 Akim Demaille <akim@epita.fr>
1443
1444 * src/reader.c (token_translations_init): 256 is now the default
1445 value for the error token, i.e., it will be assigned another
1446 number if the user assigned 256 to one of her tokens.
1447 (reader): Don't force 256 to error.
1448 * doc/bison.texinfo (Symbols): Adjust.
1449 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1450 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1451 etc. instead of 10, 20, 30 (which was used to `jump' over error
1452 (256) and undefined (2)).
1453
5fbb0954
AD
14542002-04-22 Akim Demaille <akim@epita.fr>
1455
1456 Propagate more token_number_t.
1457
1458 * src/gram.h (token_number_as_item_number)
1459 (item_number_as_token_number): New.
1460 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1461 Use it to create output_item_number_table and
1462 output_token_number_table.
1463 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1464 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1465 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1466 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1467
4f940944
AD
14682002-04-22 Akim Demaille <akim@epita.fr>
1469
1470 * src/output.h, src/output.c (get_lines_number): Remove.
1471
3ded9a63
AD
14722002-04-19 Akim Demaille <akim@epita.fr>
1473
1474 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1475 as Lex/Flex'.
1476 (Debugging): More details about enabling the debugging features.
1477 (Table of Symbols): Describe $$, $n, @$, and @n.
1478 Suggested by Tim Josling.
1479
e0c471a9
AD
14802002-04-19 Akim Demaille <akim@epita.fr>
1481
1482 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1483
fecc10cd
AD
14842002-04-10 Akim Demaille <akim@epita.fr>
1485
1486 * src/system.h: Rely on HAVE_LIMITS_H.
1487 Suggested by Paul Eggert.
1488
51dec47b
AD
14892002-04-09 Akim Demaille <akim@epita.fr>
1490
1491 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1492 full stderr, and strip it according to the bison options, instead
1493 of composing the error message from different bits.
1494 This makes it easier to check for several error messages.
1495 Adjust all the invocations.
1496 Add an invocation exercising the error token.
1497 Add an invocation demonstrating a stupid error message.
1498 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1499 Adjust the tests.
1500 Error message are for stderr, not stdout.
1501
007a50a4
AD
15022002-04-09 Akim Demaille <akim@epita.fr>
1503
1504 * src/gram.h, src/gram.c (error_token_number): Remove, use
1505 errtoken->number.
1506 * src/reader.c (reader): Don't specify the user token number (2)
1507 for $undefined, as it uselessly prevents using it.
1508 * src/gram.h (token_number_t): Move to...
1509 * src/symtab.h: here.
1510 (state_t.number): Is a token_number_t.
1511 * src/print.c, src/reader.c: Use undeftoken->number instead of
1512 hard coded 2.
1513 (Even though this 2 is not the same as above: the number of the
1514 undeftoken remains being 2, it is its user token number which
1515 might not be 2).
1516 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1517 `user_token_number_max'.
1518 Output `undef_token_number'.
1519 * data/bison.simple, data/bison.c++: Use them.
1520 Be sure to map invalid yylex return values to
1521 `undef_token_number'. This saves us from gratuitous SEGV.
1522
1523 * tests/conflicts.at (Solved SR Conflicts)
1524 (Unresolved SR Conflicts): Adjust.
1525 * tests/regression.at (Web2c Actions): Adjust.
1526
06446ccf
AD
15272002-04-08 Akim Demaille <akim@epita.fr>
1528
1529 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1530 Adding #line.
1531 Remove the duplicate `typedefs'.
1532 (RhsNumberType): Fix the declaration and various other typos.
1533 Use __ofile__.
1534 * data/bison.simple: Use __ofile__.
1535 * src/scan-skel.l: Handle __ofile__.
1536
62a3e4f0
AD
15372002-04-08 Akim Demaille <akim@epita.fr>
1538
1539 * src/gram.h (item_number_t): New, the type of item numbers in
1540 RITEM. Note that it must be able to code symbol numbers as
1541 positive number, and the negation of rule numbers as negative
1542 numbers.
1543 Adjust all dependencies (pretty many).
1544 * src/reduce.c (rule): Remove this `short *' pointer: use
1545 item_number_t.
1546 * src/system.h (MINSHORT, MAXSHORT): Remove.
1547 Include `limits.h'.
1548 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1549 (shortcpy): Remove.
1550 (MAXTABLE): Move to...
1551 * src/output.c (MAXTABLE): here.
1552 (prepare_rules): Use output_int_table to output rhs.
1553 * data/bison.simple, data/bison.c++: Adjust.
1554 * tests/torture.at (Big triangle): Move the limit from 254 to
1555 500.
1556 * tests/regression.at (Web2c Actions): Ajust.
1557
1558 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1559 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1560 passes, but produces negative #line number, once fixed, GCC is
1561 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1562 C), it passes.
1563 * src/state.h (state_h): Code input lines on ints, not shorts.
1564
bb88b0fc
AD
15652002-04-08 Akim Demaille <akim@epita.fr>
1566
1567 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1568 and then the grammar.
1569
9a636f47
AD
15702002-04-08 Akim Demaille <akim@epita.fr>
1571
1572 * src/system.h: No longer using strndup.
1573
680e8701
AD
15742002-04-07 Akim Demaille <akim@epita.fr>
1575
1576 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1577 * src/output.c (output_table_data): Return the longest number.
1578 (prepare_tokens): Output `token_number_max').
1579 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1580 New.
1581 Use them to define yy_token_number_type/TokenNumberType.
1582 Use this type for yytranslate.
1583 * tests/torture.at (Big triangle): Push the limit from 124 to
1584 253.
1585 * tests/regression.at (Web2c Actions): Adjust.
1586
817e9f41
AD
15872002-04-07 Akim Demaille <akim@epita.fr>
1588
1589 * tests/torture.at (Big triangle): New.
1590 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1591 * tests/existing.at: here.
1592
5123689b
AD
15932002-04-07 Akim Demaille <akim@epita.fr>
1594
1595 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1596 nritems.
1597 Adjust dependencies.
1598
f3849179
AD
15992002-04-07 Akim Demaille <akim@epita.fr>
1600
1601 * src/reader.c: Normalize increments to prefix form.
1602
bd02036a
AD
16032002-04-07 Akim Demaille <akim@epita.fr>
1604
1605 * src/reader.c, symtab.c: Remove debugging code.
1606
db8837cb
AD
16072002-04-07 Akim Demaille <akim@epita.fr>
1608
1609 Rename all the `bucket's as `symbol_t'.
1610
1611 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1612 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1613 * src/symtab.c, src/symtab.h (bucket): Rename as...
1614 (symbol_t): this.
1615 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1616 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1617 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1618 (buckets_new, buckets_free, buckets_do): Rename as...
1619 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1620 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1621 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1622 (symbols_new, symbols_free, symbols_do): these.
1623
72a23c97
AD
16242002-04-07 Akim Demaille <akim@epita.fr>
1625
1626 Use lib/hash for the symbol table.
1627
1628 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1629 EOF.
1630 * src/lex.c (lex): Set the `number' member of new terminals.
1631 * src/reader.c (bucket_check_defined, bucket_make_alias)
1632 (bucket_check_alias_consistence, bucket_translation): New.
1633 (reader, grammar_free, readgram, token_translations_init)
1634 (packsymbols): Adjust.
1635 (reader): Number the predefined tokens.
1636 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1637 for predefined tokens.
1638 * src/symtab.h (bucket): Remove all the hash table related
1639 members.
1640 * src/symtab.c (symtab): Replace by...
1641 (bucket_table): this.
1642 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1643 (buckets_new, buckets_do): New.
1644
280a38c3
AD
16452002-04-07 Akim Demaille <akim@epita.fr>
1646
1647 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1648 (start_symbol, max_user_token_number, semantic_parser)
1649 (error_token_number): Initialize.
1650 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1651 Initialize.
1652 (reader): Don't.
1653 (errtoken, eoftoken, undeftoken, axiom): Extern.
1654
03b31c0c
AD
16552002-04-07 Akim Demaille <akim@epita.fr>
1656
1657 * src/gram.h (rule_s): prec and precsym are now pointers
1658 to the bucket giving the priority/associativity.
1659 Member `associativity' removed: useless.
1660 * src/reduce.c, src/conflicts.c: Adjust.
1661
8b3df748
AD
16622002-04-07 Akim Demaille <akim@epita.fr>
1663
1664 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1665 Properly escape the symbols' TAG when outputting them.
1666
e601aa1d
AD
16672002-04-07 Akim Demaille <akim@epita.fr>
1668
1669 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1670
b0299a2e
AD
16712002-04-07 Akim Demaille <akim@epita.fr>
1672
1673 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1674 (LArule): this, which is an array to rule_t*.
1675 * src/print.c, src/conflicts.c: Adjust.
1676
d7e1f00c
AD
16772002-04-07 Akim Demaille <akim@epita.fr>
1678
1679 * src/gram.h (rule_t): Rename `number' as `user_number'.
1680 `number' is a new member.
1681 Adjust dependencies.
1682 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1683
cc9305dd
AD
16842002-04-07 Akim Demaille <akim@epita.fr>
1685
1686 As a result of the previous patch, it is no longer needed
1687 to reorder ritem itself.
1688
1689 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1690
b0940840
AD
16912002-04-07 Akim Demaille <akim@epita.fr>
1692
1693 Be sure never to walk through RITEMS, but use only data related to
1694 the rules themselves. RITEMS should be banished.
1695
1696 * src/output.c (output_token_translations): Rename as...
1697 (prepare_tokens): this.
1698 In addition to `translate', prepare the muscles `tname' and
1699 `toknum', which were handled by...
1700 (output_rule_data): this.
1701 Remove, and move the remainder of its outputs into...
1702 (prepare_rules): this new routines, which also merges content from
1703 (output_gram): this.
1704 (prepare_rules): Be sure never to walk through RITEMS.
1705 (output_stos): Rename as...
1706 (prepare_stos): this.
1707 (output): Always invoke prepare_states, after all, just don't use it
1708 in the output if you don't need it.
1709
643a5994
AD
17102002-04-07 Akim Demaille <akim@epita.fr>
1711
1712 * src/LR0.c (new_state): Display `nstates' as the name of the
1713 newly created state.
1714 Adjust to initialize first_state and last_state if needed.
1715 Be sure to distinguish the initial from the final state.
1716 (new_states): Create the itemset of the initial state, and use
1717 new_state.
1718 * src/closure.c (closure): Now that the initial state has its
1719 items properly set, there is no need for a special case when
1720 creating `ruleset'.
1721
1722 As a result, now the rule 0, reducing to $axiom, is visible in the
1723 outputs. Adjust the test suite.
1724
1725 * tests/conflicts.at (Solved SR Conflicts)
1726 (Unresolved SR Conflicts): Adjust.
1727 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1728 * tests/conflicts.at (S/R in initial): New.
1729
b4c4ccc2
AD
17302002-04-07 Akim Demaille <akim@epita.fr>
1731
1732 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1733 the RHS of the rules.
1734 * src/output.c (output_gram): Likewise.
1735
bba97eb2
AD
17362002-04-07 Akim Demaille <akim@epita.fr>
1737
1738 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1739 bucket.
1740 Adjust all dependencies.
1741 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1742 `number' of the buckets too.
1743 * src/gram.h: Include `symtab.h'.
1744 (associativity): Move to...
1745 * src/symtab.h: here.
1746 No longer include `gram.h'.
1747
c3b407f4
AD
17482002-04-07 Akim Demaille <akim@epita.fr>
1749
1750 * src/gram.h, src/gram.c (rules_rhs_length): New.
1751 (ritem_longest_rhs): Use it.
1752 * src/gram.h (rule_t): `number' is a new member.
1753 * src/reader.c (packgram): Set it.
1754 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1755 the end of `rules', and count them out of `nrules'.
1756 (reduce_output, dump_grammar): Adjust.
1757 * src/print.c (print_grammar): It is no longer needed to check for
1758 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1759 * tests/reduce.at (Reduced Automaton): New test.
1760
11652ab3
AD
17612002-04-07 Akim Demaille <akim@epita.fr>
1762
1763 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1764 lacking `+ 1' to nrules, Bison reported as useless a token if it
1765 was used solely to set the precedence of the last rule...
1766
26b23c1a
AD
17672002-04-07 Akim Demaille <akim@epita.fr>
1768
1769 * data/bison.c++, data/bison.simple: Don't output the current file
1770 name in #line, to avoid useless diffs between two identical
1771 outputs under different names.
1772
18bcecb0
AD
17732002-04-07 Akim Demaille <akim@epita.fr>
1774
1775 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1776 Normalize loops to using `< nrules + 1', not `<= nrules'.
1777
fa770c86
AD
17782002-04-07 Akim Demaille <akim@epita.fr>
1779
1780 * TODO: Update.
1781
d9b739c3
AD
17822002-04-07 Akim Demaille <akim@epita.fr>
1783
1784 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1785 bucket.value as bucket.number.
1786
99013900
AD
17872002-04-07 Akim Demaille <akim@epita.fr>
1788
1789 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1790 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1791 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1792 RHS, instead of being an index in RITEMS.
1793
e966383b
PE
17942002-04-04 Paul Eggert <eggert@twinsun.com>
1795
1796 * doc/bison.texinfo: Update copyright date.
1797 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1798 (Symbols): Warn about running Bison in one character set,
1799 but compiling and/or running in an incompatible one.
1800 Warn about character code 256, too.
1801
18022002-04-03 Paul Eggert <eggert@twinsun.com>
1803
1804 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1805 YYERROR_VERBOSE is nonzero, not whether it is defined.
1806
1807 Merge changes from bison-1_29-branch.
c307773e 1808
8d6c48b9
PE
18092002-03-20 Paul Eggert <eggert@twinsun.com>
1810
1811 Merge fixes from Debian bison_1.34-1.diff.
1812
1813 * configure.in (AC_PREREQ): 2.53.
1814
e53c6322
AD
18152002-03-20 Akim Demaille <akim@epita.fr>
1816
1817 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1818
9ffbeca7
PE
18192002-03-19 Paul Eggert <eggert@twinsun.com>
1820
21db0b2a
PE
1821 * src/bison.simple (YYCOPY): New macro.
1822 (YYSTACK_RELOCATE): Use it.
1823 Remove Type arg; no longer needed. All callers changed.
1824 (yymemcpy): Remove; no longer needed.
1825
9ffbeca7
PE
1826 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1827 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1828
642cb8f8
AD
18292002-03-19 Akim Demaille <akim@epita.fr>
1830
1831 Test and fix the #line outputs.
1832
1833 * tests/atlocal.at (GCC): New.
1834 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1835 (Prologue synch line, ,%union synch line, Postprologue synch line)
1836 (Action synch line, Epilogue synch line): New tests.
1837 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1838 * data/bison.simple, data/bison.c++: Use it.
1839
3c31a486
AD
18402002-03-19 Akim Demaille <akim@epita.fr>
1841
1842 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1843 (Solved SR Conflicts, %expect not enough, %expect right)
1844 (%expect too much): Move to...
1845 * tests/conflicts.at: this new file.
1846
0d8bed56
AD
18472002-03-19 Akim Demaille <akim@epita.fr>
1848
1849 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1850 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1851 that we can move to enums for instance.
1852 * src/output.c (token_definitions_output): Output a list of
1853 `token-name, token-number' instead of the #define.
1854 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1855
9208d17f
AD
18562002-03-14 Akim Demaille <akim@epita.fr>
1857
1858 Use Gettext 0.11.1.
1859
af27eacb
RA
18602002-03-09 Robert Anisko <robert@lrde.epita.fr>
1861
1862 * data/bison.c++: Make the user able to add members to the generated
1863 parser by subclassing.
1864
9101a310
RA
18652002-03-05 Robert Anisko <robert@lrde.epita.fr>
1866
1867 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1868 a character.
1869 Reported by Nicolas Tisserand and Nicolas Burrus.
1870
fff9bf0b
RA
18712002-03-04 Robert Anisko <robert@lrde.epita.fr>
1872
1873 * src/reader.c: Warn about lacking semi-colons, do not complain.
1874
64dba31e
RA
18752002-03-04 Robert Anisko <robert@lrde.epita.fr>
1876
1877 * data/bison.c++: Remove a debug line.
1878
374f5a14
RA
18792002-03-04 Robert Anisko <robert@lrde.epita.fr>
1880
1881 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1882 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1883 provide a default implementation.
1884
bfcf1f3a
AD
18852002-03-04 Akim Demaille <akim@epita.fr>
1886
1887 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1888 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1889 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1890 * tests/semantic.at (Parsing Guards): Similarly.
1891 * src/reader.at (readgram): Complain if the last rule is not ended
1892 with a semi-colon.
1893
65ccf9fc
AD
18942002-03-04 Akim Demaille <akim@epita.fr>
1895
1896 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1897 * src/closure.c: here.
1898 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1899 RTC.
1900 * src/warshall.h, src/warshall.c: Remove.
1901 * tests/sets.at (Broken Closure): Adjust.
1902
d0039cbc
AD
19032002-03-04 Akim Demaille <akim@epita.fr>
1904
1905 * src/output.c (output_skeleton): tempdir is const.
1906 bytes_read is unused.
1907
345cea78
AD
19082002-03-04 Akim Demaille <akim@epita.fr>
1909
1910 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1911 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1912 Update.
1913 From Michael Hayes.
1914
564801f7
AD
19152002-03-04 Akim Demaille <akim@epita.fr>
1916
1917 * src/closure.c (closure): `r' is unused.
1918
e5352bc7
AD
19192002-03-04 Akim Demaille <akim@epita.fr>
1920
1921 * tests/sets.at (Broken Closure): Add the ending `;'.
1922 * src/reader.at (readgram): Complain if a rule is not ended with a
1923 semi-colon.
1924
914feea9
AD
19252002-03-04 Akim Demaille <akim@epita.fr>
1926
1927 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1928 (count_sr_conflicts): Use bitset_count.
1929 * src/reduce.c (inaccessable_symbols): Ditto.
1930 (bits_size): Remove.
1931 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1932
f0250de6
AD
19332002-03-04 Akim Demaille <akim@epita.fr>
1934
1935 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1936 * src/reduce.c: Remove the `bitset_zero's following the
1937 `bitset_create's, as now it is performed by the latter.
1938
ef017502
AD
19392002-03-04 Akim Demaille <akim@epita.fr>
1940
1941 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1942 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1943 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1944 latest sources from Michael.
1945
76514394
AD
19462002-03-04 Akim Demaille <akim@epita.fr>
1947
1948 * src/output.c (output): Don't free the grammar.
1949 * src/reader.c (grammar_free): New.
1950 * src/main.c (main): Call it and don't free symtab here.
1951
55024580
AD
19522002-03-04 Akim Demaille <akim@epita.fr>
1953
1954 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1955 before returning.
1956 Reported by Benoit Perrot.
1957
f9abaa2c
AD
19582002-03-04 Akim Demaille <akim@epita.fr>
1959
1960 Use bitset operations when possible, not loops over bits.
1961
1962 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1963 bitset_or.
1964 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1965 * src/reduce.c (useless_nonterminals): Formatting changes.
1966 * src/warshall.c (TC): Use bitset_or.
1967
0e721e75
AD
19682002-03-04 Akim Demaille <akim@epita.fr>
1969
1970 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1971 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1972 Ditto.
1973
0fb1ffb1
AD
19742002-03-04 Akim Demaille <akim@epita.fr>
1975
1976 * src/lalr.c (F): Now a bitset*.
1977 Adjust all dependencies.
1978
b86796bf
AD
19792002-03-04 Akim Demaille <akim@epita.fr>
1980
1981 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1982 Adjust all dependencies.
1983
602bbf31
AD
19842002-03-04 Akim Demaille <akim@epita.fr>
1985
1986 * src/L0.c, src/LR0.h (nstates): Be size_t.
1987 Adjust comparisons (signed vs unsigned).
1988 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1989 bitset*.
1990 Adjust all dependencies.
1991
d8a0245c
AD
19922002-03-04 Akim Demaille <akim@epita.fr>
1993
1994 * src/closure.c (firsts): Now, also a bitset.
1995 Adjust all dependencies.
1996 (varsetsize): Remove, now unused.
1997 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1998
34ba9743
AD
19992002-03-04 Akim Demaille <akim@epita.fr>
2000
2001 * src/print.c: Convert to use bitset.h, not hand coded iterations
2002 over ints.
2003
ed86e78c
AD
20042002-03-04 Akim Demaille <akim@epita.fr>
2005
2006 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2007
dfdb1797
AD
20082002-03-04 Akim Demaille <akim@epita.fr>
2009
2010 * src/closure.c (ruleset): Be a bitset.
2011 (rulesetsize): Remove.
2012
7086e707
AD
20132002-03-04 Akim Demaille <akim@epita.fr>
2014
2015 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2016 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2017 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2018 * src/closure.c (fderives): Be an array of bitsets.
2019
98254360
RA
20202002-02-28 Robert Anisko <robert@lrde.epita.fr>
2021
2022 * data/bison.c++: Merge the two generated headers. Insert a copyright
2023 notice in each output file.
2024
a75c057f
AD
20252002-02-28 Akim Demaille <akim@epita.fr>
2026
2027 * data/bison.c++: Copy the prologue of bison.simple to fetch
2028 useful M4 definitions, such as b4_header_guard.
2029
06b00abc
AD
20302002-02-25 Akim Demaille <akim@epita.fr>
2031
2032 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
2033 translator friendly scheme for the bgr
2034 copyright notice.
06b00abc 2035
70e7d534
AD
20362002-02-25 Akim Demaille <akim@epita.fr>
2037
2038 * src/output.c (header_output): Remove, now handled completely via
2039 M4.
2040
abe017f6
AD
20412002-02-25 Akim Demaille <akim@epita.fr>
2042
2043 * m4/m4.m4: New, from CVS Autoconf.
2044 * configure.in: Invoke it.
2045 * src/output.c (output_skeleton): Use its result instead of the
2046 hard coded name.
2047
381fb12e
AD
20482002-02-25 Akim Demaille <akim@epita.fr>
2049
2050 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2051 Fileutils 4.1.5.
2052 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2053 * src/output.c (output_skeleton): Use mkstemp to create a real
2054 temporary file.
2055 Move the filling of `skeleton' and its muscle to...
2056 (prepare): here.
2057 (output): Move the definition of the prologue muscle to...
2058 (prepare): here.
2059 * src/system.h (DEFAULT_TMPDIR): New.
2060
6f38107f
PE
20612002-02-14 Paul Eggert <eggert@twinsun.com>
2062
2063 Remove the support for C++ namespace cleanliness; it was
2064 causing more problems than it was curing, since it didn't work
2065 properly on some nonstandard C++ compilers. This can wait
2066 for a proper C++ parser.
2067
2068 * NEWS: Document this.
2069 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2070 of C++, as it's treated like C now.
2071 * src/bison.simple (YYSTD): Remove.
2072 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2073 Treat C++ just like Standard C instead of trying to support
2074 namespace cleanliness.
2075
80cce3da
AD
20762002-02-14 Akim Demaille <akim@epita.fr>
2077
2078 * tests/regression.at (else): Adjust to Andreas' change.
2079
842e8679
AD
20802002-02-14 Akim Demaille <akim@epita.fr>
2081
2082 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2083
4bda3f10
AD
20842002-02-13 Andreas Schwab <schwab@suse.de>
2085
2086 * src/output.c (output_rule_data): Don't output NULL, it might
2087 not be defined yet.
2088
4162fa07 20892002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 2090
4162fa07
RA
2091 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2092 (Copyright notice): Update.
b418ecd8 2093
bd16a5dc
AD
20942002-02-11 Akim Demaille <akim@epita.fr>
2095
2096 * tests/regression.at (%nonassoc and eof): Don't include
2097 nonportable headers.
2098
8d69a1a3
RA
20992002-02-08 Robert Anisko <robert@lrde.epita.fr>
2100
2101 * data/bison.c++: Correct error recovery. Make the user able to
2102 initialize the starting location.
2103
9b2d0677
AD
21042002-02-07 Akim Demaille <akim@epita.fr>
2105
2106 * tests/input.at: New.
2107
69e2658b
RA
21082002-02-07 Robert Anisko <robert@lrde.epita.fr>
2109
2110 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 2111 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
2112 directives around tables only needed for debugging.
2113
4aacc3a7
RA
21142002-02-07 Robert Anisko <robert@lrde.epita.fr>
2115
2116 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2117 C++ parsers.
2118 (yy::b4_name::parse): Use print_.
2119
762a801e
RA
21202002-02-07 Robert Anisko <robert@lrde.epita.fr>
2121
2122 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2123
4bb2bc3f
RA
21242002-02-07 Robert Anisko <robert@lrde.epita.fr>
2125
2126 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2127 C++ parsers.
2128 (yy::b4_name::parse): Build verbose error messages, and use error_.
2129
6b45a3ca
RA
21302002-02-06 Robert Anisko <robert@lrde.epita.fr>
2131
2132 * data/bison.c++: Fix m4 quoting in comments.
2133
50997c6e
RA
21342002-02-06 Robert Anisko <robert@lrde.epita.fr>
2135
2136 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2137 not expanded by m4.
2138
3f3eed27
AD
21392002-02-05 Akim Demaille <akim@epita.fr>
2140
2141 * data/bison.c++: Adjust to the M4 back end.
2142 More is certainly needed.
2143
be2a1a68
AD
21442002-02-05 Akim Demaille <akim@epita.fr>
2145
2146 Give a try to M4 as a back end.
2147
2148 * lib/readpipe.c: New, from wdiff.
2149 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2150 BISON_HAIRY.
2151 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2152 specific values. Now it is m4 that performs the lookup.
2153 * src/parse-skel.y: Remove.
2154 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2155 * src/output.c (actions_output, guards_output)
2156 (token_definitions_output): No longer keeps track of the output
2157 line number, hence remove the second argument.
2158 (guards_output): Check against the guard member of a rule, not the
2159 action member.
2160 Adjust callers.
2161 (output_skeleton): Don't look for the skeleton location, let m4 do
2162 that.
2163 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2164 file will be used.
2165 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2166 (prepare): Given that for the time being changesyntax is not
2167 usable in M4, rename the muscles using `-' to `_'.
2168 Define `defines_flag', `output_parser_name' and `output_header_name'.
2169 * src/output.h (actions_output, guards_output)
2170 (token_definitions_output): Adjust prototypes.
2171 * src/scan-skel.l: Instead of scanning the skeletons, it now
2172 processes the output of m4: `__oline__' and `#output'.
2173 * data/bison.simple: Adjust to be used by M4(sugar).
2174 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2175 to date.
2176 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2177 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2178 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2179 shamelessly stolen from CVS Autoconf.
2180
beda758b
AD
21812002-02-05 Akim Demaille <akim@epita.fr>
2182
2183 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2184 * configure.in: Check for the declarations of free and malloc.
2185 * src/muscle_tab.c: Adjust.
2186
5ece6d43
AD
21872002-02-05 Akim Demaille <akim@epita.fr>
2188
2189 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2190 which have no values.
2191
5bb18f9a
AD
21922002-02-05 Akim Demaille <akim@epita.fr>
2193
2194 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2195 * data/: here.
2196
894dd62e
PE
21972002-01-29 Paul Eggert <eggert@twinsun.com>
2198
2199 * src/bison.simple (YYSIZE_T): Do not define merely because
2200 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2201 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2202
82841af7
AD
22032002-01-27 Akim Demaille <akim@epita.fr>
2204
2205 Fix `%nonassoc and eof'.
2206
2207 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2208 which were not properly copied! Replace
2209 memcpy (res->errs, src->errs, src->nerrs);
2210 with
2211 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2212 !!!
2213 * tests/regression.at (%nonassoc and eof): Adjust to newest
2214 Autotest: `.' is not in the PATH.
2215
318b76e9
AD
22162002-01-27 Akim Demaille <akim@epita.fr>
2217
2218 * tests/sets.at (AT_EXTRACT_SETS): New.
2219 (Nullable): Use it.
2220 (Firsts): New.
2221
30d2f3d5
AD
22222002-01-26 Akim Demaille <akim@epita.fr>
2223
2224 * tests/actions.at, tests/calc.at, tests/headers.at,
2225 * tests/torture.at: Adjust to the newest Autotest which no longer
2226 forces `.' in the PATH.
2227
30f8c395
AD
22282002-01-25 Akim Demaille <akim@epita.fr>
2229
2230 * tests/regression.at (%nonassoc and eof): New.
2231 Suggested by Robert Anisko.
2232
29ae55f1
AD
22332002-01-24 Akim Demaille <akim@epita.fr>
2234
2235 Bison dumps core when trying to complain about broken input files.
2236 Reported by Cris van Pelt.
2237
2238 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2239 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2240 into...
2241 (Invalid inputs): Strengthen: exercise parse_percent_token.
2242
2b548aa6
RA
22432002-01-24 Robert Anisko <robert.anisko@epita.fr>
2244
2245 * src/Makefile.am: Add bison.c++.
2246 * src/bison.c++: New skeleton.
2247
bb0146c2
AD
22482002-01-21 Paolo Bonzini <bonzini@gnu.org>
2249
2250 * po/it.po: New.
2251
bec30531
AD
22522002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2253
2254 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2255
fc6edc45
MA
22562002-01-20 Marc Autret <marc@gnu.org>
2257
2258 * src/files.c (compute_output_file_names): Fix
2259
5e5d5415
MA
22602002-01-20 Marc Autret <marc@gnu.org>
2261
2262 * tests/output.at: New test.
2263 * src/files.c (compute_base_names): Don't map extensions when
2264 the YACC flag is set, use defaults.
2265 Reported by Evgeny Stambulchik.
2266
44ea3fbd
MA
22672002-01-20 Marc Autret <marc@gnu.org>
2268
bb0146c2 2269 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
2270 compilers as well (i.e. the vendor C compiler).
2271 Suggested by Albert Chin-A-Young.
2272
338963d1
TVH
22732002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2274
2275 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2276 canonical definition.
2277 * src/system.h: Use the canonical definition for PARAMS (avoids
2278 a conflict with the macro from lib/hash.h).
2279
c57b2479
AD
22802002-01-11 Akim Demaille <akim@epita.fr>
2281
2282 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 2283 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 2284
b85810ae
AD
22852002-01-09 Akim Demaille <akim@epita.fr>
2286
2287 * src/files.c, src/files.h (output_infix): New.
2288 (tab_extension): Remove.
2289 (compute_base_names): Compute the former, drop the latter.
2290 * src/output.c (prepare): Insert the muscles `output-infix', and
2291 `output-suffix'.
2292 * src/parse-skel.y (string, string.1): New.
2293 (section.header): Use it.
2294 (section.yacc): Remove.
2295 (prefix): Remove too.
2296 * src/scan-skel.l: Adjust.
2297 * src/bison.simple, src/bison.hairy: Adjust.
2298
cae60122
AD
22992002-01-09 Akim Demaille <akim@epita.fr>
2300
2301 * configure.in (WERROR_CFLAGS): Compute it.
2302 * src/Makefile.am (CFLAGS): Pass it.
2303 * tests/atlocal.in (CFLAGS): Idem.
2304 * src/files.c: Fix a few warnings.
2305 (get_extension_index): Remove, unused.
2306
ae404801
AD
23072002-01-08 Akim Demaille <akim@epita.fr>
2308
2309 * src/getargs.c (AS_FILE_NAME): New.
2310 (getargs): Use it to convert DOSish file names.
2311 * src/files.c (base_name): Rename as full_base_name to avoid
2312 clashes with `base_name ()'.
2313 (filename_split): New.
2314 (compute_base_names): N-th rewrite, using filename_split.
2315
22312b71
AD
23162002-01-08 Akim Demaille <akim@epita.fr>
2317
2318 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2319 New, stolen from the Fileutils 4.1.
2320 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2321 * configure.in: Check for the presence of memrchr, and of its
2322 prototype.
2323
a67cef01
TVH
23242002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2325
2326 * lib/hash.h (__P): Added definition for this macro.
2327 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2328 BUILT_SOURCES, to ensure they are generated first.
2329 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2330 %error-verbose to allow bootstrapping with bison 1.30x.
2331
2b25d624
AD
23322002-01-06 Akim Demaille <akim@epita.fr>
2333
2334 * src/reader.c (parse_braces): Don't fetch the next char, the
2335 convention is to fetch on entry.
2336 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2337 'switch' without a following semicolon.
2338 * tests/regression.at (braces parsing): New.
2339
3460813b
AD
23402002-01-06 Akim Demaille <akim@epita.fr>
2341
2342 Bison is dead wrong in its RR conflict reports.
2343
2344 * tests/torture.at (GNU Cim Grammar): New.
2345 * src/conflicts.c (count_rr_conflicts): Fix.
2346
73784c64
AD
23472002-01-06 Akim Demaille <akim@epita.fr>
2348
2349 Creating package.m4 from configure.ac causes too many problems.
2350
2351 * tests/Makefile.am (package.m4): Create it by hand,
2352 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2353
25d81090
AD
23542002-01-06 Akim Demaille <akim@epita.fr>
2355
2356 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2357 skeleton.h.
2358
a9b8959e
PE
23592002-01-04 Paul Eggert <eggert@twinsun.com>
2360
2361 * doc/bison.texinfo (Debugging):
2362 Remove YYSTDERR; it's no longer defined or used.
2363 Also, s/cstdio.h/cstdio/.
2364
25d81090
AD
23652002-01-03 Akim Demaille <akim@epita.fr>
2366
2367 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2368
1109455c
AD
23692002-01-03 Akim Demaille <akim@epita.fr>
2370
2371 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2372 tracing code to --trace, wait for a better --trace option, with
2373 args.
2374
7ea5e977
AD
23752002-01-03 Akim Demaille <akim@epita.fr>
2376
2377 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2378 The ISO C++ standard is extremely clear about it: stderr is
2379 considered a macro, not a regular symbol (see table 94 `Header
2380 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2381 Therefore std:: does not apply to it. It still does with fprintf.
2382 Also, s/cstdio.h/cstdio/.
2383
fab5b110
AD
23842002-01-03 Akim Demaille <akim@epita.fr>
2385
2386 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2387 for non system headers.
2388
aed7fd9b
AD
23892002-01-02 Akim Demaille <akim@epita.fr>
2390
2391 Equip the skeleton chain with location tracking, runtime trace,
2392 pure parser and scanner.
2393
2394 * src/parse-skel.y: Request a pure parser, locations, and prefix
2395 renaming.
2396 (%union): Having several members with the same type does not help
2397 type mismatches, simplify.
2398 (YYPRINT, yyprint): New.
2399 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2400 (skel_error): this.
2401 Handle locations.
2402 * src/scan-skel.l: Adjust to these changes.
2403 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2404 (LOCATION_PRINT, skel_control_t): New.
2405
24fad99e
AD
24062001-12-30 Akim Demaille <akim@epita.fr>
2407
2408 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2409 replace `gb' with BLANKS.
2410 * src/scan-skel.l: Adjust.
2411
a4b36db4
AD
24122001-12-30 Akim Demaille <akim@epita.fr>
2413
2414 * src/system.h: We don't need nor want bcopy.
2415 Throw away MS-DOS crap: we don't need getpid.
2416 * configure.in: We don't need strndup. It was even causing
2417 problems: because Flex includes the headers *before* us,
2418 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2419 not visible.
2420 * lib/xstrndup.c: New.
2421 * src/scan-skel.l: Use it.
2422 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2423 * src/parse-skel.y: Use %directives instead of #defines.
2424
1239777d
AD
24252001-12-30 Akim Demaille <akim@epita.fr>
2426
2427 * src/skeleton.h: New.
2428 * src/output.c (output_parser, output_master_parser): Remove, dead
2429 code.
2430 * src/output.h (get_lines_number, actions_output, guards_output)
2431 (token_definitions_output): Prototype them.
2432 * src/parse-skel.y: Add the license notice.
2433 Include output.h and skeleton.h.
2434 (process_skeleton): Returns void, and takes a single parameter.
2435 * src/scan-skel.l: Add the license notice.
2436 Include skeleton.h.
2437 Don't use %option yylineno: it seems that then Flex imagines
2438 REJECT has been used, and therefore it won't reallocate its
2439 buffers (which makes no other sense to me than a bug). It results
2440 in warnings for `unused: yy_flex_realloc'.
2441
9b3add5b
RA
24422001-12-30 Robert Anisko <robert.anisko@epita.fr>
2443
2444 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2445 (MUSCLE_INSERT_PREFIX): ...to there.
2446 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2447 (MUSCLE_INSERT_PREFIX): Move from here...
2448
2449 * src/bison.hairy: Add a section directive. Put braces around muscle
2450 names. This parser skeleton is still broken, but Bison should not
2451 choke on a bad muscle 'syntax'.
2452 * src/bison.simple: Add a section directive. Put braces around muscle
2453 names.
2454
2455 * src/files.h (strsuffix, stringappend): Add declarations.
2456 (tab_extension): Add declaration.
2457 (short_base_name): Add declaration.
2458
2459 * src/files.c (strsuffix, stringappend): No longer static. These
2460 functions are used in the skeleton parser.
2461 (tab_extension): New.
2462 (compute_base_names): Use the computations done in this function
fab5b110 2463 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
2464 names.
2465 (short_base_name): No longer static.
2466
2467 * src/output.c (output_skeleton): New.
2468 (output): Disable call to output_master_parser, and give a try to
2469 a new skeleton handling system.
2470 (guards_output, actions_output): No longer static.
2471 (token_definitions_output, get_lines_number): No longer static.
2472
2473 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2474
fab5b110 2475 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
2476 parse-skel.y.
2477
2478 * src/parse-skel.y: New file.
2479 * src/scan-skel.l: New file.
2480
b5b61c61
AD
24812001-12-29 Akim Demaille <akim@epita.fr>
2482
2483 %name-prefix is broken.
2484
2485 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2486 Adjust all dependencies.
2487 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2488 %name-prefix.
2489
2490 Renaming yylval but not yylloc is not consistent. Now we do.
2491
2492 * src/bison.simple: Prefix yylloc if used.
2493 * doc/bison.texinfo (Decl Summary): Document that.
2494
8c9a50be
AD
24952001-12-29 Akim Demaille <akim@epita.fr>
2496
2497 * doc/bison.texinfo: Promote `%long-directive' over
2498 `%long_directive'.
2499 Remove all references to fixed-output-files, yacc is enough.
2500
d99361e6
AD
25012001-12-29 Akim Demaille <akim@epita.fr>
2502
2503 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2504 user prologue. These are defaults.
2505 * tests/actions.at (Mid-rule actions): Make sure the user can
2506 define YYDEBUG and YYERROR_VERBOSE.
2507
b9cecb91
AD
25082001-12-29 Akim Demaille <akim@epita.fr>
2509
2510 * src/output.c (header_output): Don't forget to export YYLTYPE and
2511 yylloc.
2512 * tests/headers.at (export YYLTYPE): New, make sure it does.
2513 * tests/regression.at (%union and --defines, Invalid CPP headers):
2514 Move to...
2515 * tests/headers.at: here.
2516
aea13e97
AD
25172001-12-29 Akim Demaille <akim@epita.fr>
2518
2519 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2520
931394cb
AD
25212001-12-29 Akim Demaille <akim@epita.fr>
2522
2523 * tests/actions.at (Mid-rule actions): Output on a single line
2524 instead of several.
2525
704a47c4
AD
25262001-12-29 Akim Demaille <akim@epita.fr>
2527
2528 * doc/bison.texinfo: Formatting changes.
2529
091e20bb
AD
25302001-12-29 Akim Demaille <akim@epita.fr>
2531
2532 Don't store the token defs in a muscle, just be ready to output it
2533 on command. Now possible via `symbols'. Fixes a memory leak.
2534
2535 * src/output.c (token_definitions_output): New.
2536 (output_parser, header_output): Use it.
2537 * src/reader.c (symbols_save): Remove.
2538
cce71710
AD
25392001-12-29 Akim Demaille <akim@epita.fr>
2540
2541 * src/bison.simple: Do not provide a default for YYSTYPE and
2542 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2543 default.
2544
82c035a8
AD
25452001-12-29 Akim Demaille <akim@epita.fr>
2546
2547 Mid-rule actions are simply... ignored!
2548
2549 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2550 the empty-rule associated to the dummy symbol, not to the host
2551 rule.
2552 * tests/actions.at (Mid-rule actions): New.
2553
8419d367
AD
25542001-12-29 Akim Demaille <akim@epita.fr>
2555
2556 Memory leak.
2557
2558 * src/reader.c (reader): Free grammar.
2559
375d5806
AD
25602001-12-29 Akim Demaille <akim@epita.fr>
2561
2562 Memory leak.
2563
2564 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2565 since it allocates it for each state, although only one is needed.
2566 (allocate_storage): Do it here.
2567
f51cb8ff
AD
25682001-12-29 Akim Demaille <akim@epita.fr>
2569
2570 * src/options.h, src/options.c (create_long_option_table): Rename
2571 as...
2572 (long_option_table_new): this, with a clearer prototype.
2573 (percent_table): Remove, unused,
2574 * src/getargs.c (getargs): Adjust.
2575
29e88316
AD
25762001-12-29 Akim Demaille <akim@epita.fr>
2577
2578 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2579 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2580 as states.
2581
b9f71f19
AD
25822001-12-29 Akim Demaille <akim@epita.fr>
2583
2584 * src/lalr.c (build_relations): Rename `states' as `states1'.
2585 Sorry, I don't understand exactly what it is, no better name...
2586
1a2b5d37
AD
25872001-12-29 Akim Demaille <akim@epita.fr>
2588
2589 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2590 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2591 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2592 as rules.
2593
1cca533e
AD
25942001-12-29 Akim Demaille <akim@epita.fr>
2595
2596 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2597 ago.
2598
c03ae966
AD
25992001-12-29 Akim Demaille <akim@epita.fr>
2600
2601 * src/reader.c, src/reader.h (user_toknums): Remove.
2602 Adjust all users to use symbols[i]->user_token_number.
2603
5a670b1e
AD
26042001-12-29 Akim Demaille <akim@epita.fr>
2605
2606 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2607 Adjust all users to use symbols[i]->prec or ->assoc.
2608
ad949da9
AD
26092001-12-29 Akim Demaille <akim@epita.fr>
2610
2611 * src/reader.c, src/reader.h (tags): Remove.
2612 Adjust all users to use symbols[i]->tag.
2613
0e78e603
AD
26142001-12-29 Akim Demaille <akim@epita.fr>
2615
2616 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2617 and rule_table.
2618 * src/reader.c (packsymbols): Fill this table.
2619 Drop sprec.
2620 * src/conflicts.c (resolve_sr_conflict): Adjust.
2621 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2622 single table.
2623 Use symbols[i]->tag instead of tags[i].
2624
213e640e
AD
26252001-12-29 Akim Demaille <akim@epita.fr>
2626
2627 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2628 In addition, put a comment in there, to replace...
2629 * tests/regression.at (%union and C comments): Remove.
2630
e7b8bef1
AD
26312001-12-29 Akim Demaille <akim@epita.fr>
2632
2633 * tests/regression.at (Web2c Actions): Blindly move the actual
2634 output as expected output. The contents *seem* right to me, but I
2635 can't pretend reading perfectly parser tables... Nonetheless, all
2636 the other tests pass correctly, the table look OK, even though the
2637 presence of `$axiom' is to be noted: AFAICS it is useless (but
2638 harmless).
2639
b68e7744
AD
26402001-12-29 Akim Demaille <akim@epita.fr>
2641
2642 * src/reader.c (readgram): Don't add the rule 0 if there were no
2643 rules read. In other words, add it _after_ having performed
2644 grammar sanity checks.
2645 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2646
78d5bae9
AD
26472001-12-29 Akim Demaille <akim@epita.fr>
2648
2649 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2650 visible, and some states have now a different number.
2651
ff442794
AD
26522001-12-29 Akim Demaille <akim@epita.fr>
2653
2654 * src/reader.c (readgram): Bind the initial rule's lineno to that
2655 of the first rule.
2656 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2657 (Solved SR Conflicts): Adjust rule 0's line number.
2658
610ab194
AD
26592001-12-29 Akim Demaille <akim@epita.fr>
2660
2661 Fix the `GAWK Grammar' failure.
2662
2663 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2664 the reductions of the first state which was mistakenly confused
2665 with the final state because precisely final_state was initialized
2666 to 0.
2667 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2668 now noticed by Bison.
2669 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2670 have a reduction on $default.
2671
29d29c8f
AD
26722001-12-29 Akim Demaille <akim@epita.fr>
2673
2674 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2675 rule line numbers.
2676 * src/closure.c (print_closure): Likewise.
2677 * src/derives.c (print_derives): Likewise.
2678 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2679 now.
2680
7c6b64d0
AD
26812001-12-29 Akim Demaille <akim@epita.fr>
2682
2683 * src/lalr.c (lookaheads_print): New.
2684 (lalr): Call it when --trace-flag.
2685 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2686 are dumped.
2687
3d4daee3
AD
26882001-12-29 Akim Demaille <akim@epita.fr>
2689
2690 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2691 when walking through ritem, even via rule->rhs.
2692 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2693 (useful_production, useless_nonterminals): Likewise.
2694 (reduce_grammar_tables): Likewise, plus update nritems.
2695 * src/nullable.c (set_nullable): Likewise.
2696 * src/lalr.c (build_relations): Likewise.
2697 * tests/sets.at (Nullable): Adjust.
2698 Fortunately, now, the $axiom is no longer nullable.
2699
9e7f6bbd
AD
27002001-12-29 Akim Demaille <akim@epita.fr>
2701
2702 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2703 the 0-sentinel.
2704 * src/gram.c (ritem_longest_rhs): Likewise.
2705 * src/reduce.c (nonterminals_reduce): Likewise.
2706 * src/print_graph.c (print_graph): Likewise.
2707 * src/output.c (output_rule_data): Likewise.
2708 * src/nullable.c (set_nullable): Likewise.
2709
255ef638
AD
27102001-12-29 Akim Demaille <akim@epita.fr>
2711
2712 * src/output.c: Comment changes.
2713
0d8a7363
AD
27142001-12-27 Paul Eggert <eggert@twinsun.com>
2715
2716 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2717 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2718 Sparc, as they were causing more porting problems than the
2719 (minor) performance improvement was worth.
2720
2721 Also, catch up with 1.31's YYSTD.
2722
3db472b9
AD
27232001-12-27 Akim Demaille <akim@epita.fr>
2724
2725 * src/output.c (output_gram): Rely on nritems, not the
2726 0-sentinel. See below.
2727 Use -1 as separator, not 0.
2728 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2729 Rely on -1 as separator in yyrhs, instead of 0.
2730 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2731 twice `Now at end of input', therefore there are two lines less to
2732 expect.
2733
b365aa05
AD
27342001-12-27 Akim Demaille <akim@epita.fr>
2735
2736 * tests/regression.at (Unresolved SR Conflicts):
2737 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2738 below.
2739
30171f79
AD
27402001-12-27 Akim Demaille <akim@epita.fr>
2741
2742 * src/LR0.c (new_state): Recognize the final state by the fact it
2743 is reached by eoftoken.
2744 (insert_start_shifting_state, insert_eof_shifting_state)
2745 (insert_accepting_state, augment_automaton): Remove, since now
2746 these states are automatically computed from the initial state.
2747 (generate_states): Adjust.
2748 * src/print.c: When reporting a rule number to the user, substract
2749 1, so that the axiom rule is rule 0, and the first user rule is 1.
2750 * src/reduce.c: Likewise.
2751 * src/print_graph.c (print_core): For the time being, just as for
2752 the report, depend upon --trace-flags to dump the full set of
2753 items.
2754 * src/reader.c (readgram): Once the grammar read, insert the rule
2755 0: `$axiom: START-SYMBOL $'.
2756 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2757 number of the states has changed (the final state is no longer
2758 necessarily the last), catch up.
2759
75142d45
AD
27602001-12-27 Akim Demaille <akim@epita.fr>
2761
2762 Try to make the use of the eoftoken valid. Given that its value
2763 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2764 is used instead of > 0 where appropriate, (ii), depend upon nritems
2765 instead of the 0-sentinel.
2766
2767 * src/gram.h, src/gram.c (nritems): New.
2768 Expected to be duplication of nitems, but for the time being...
2769 * src/reader.c (packgram): Assert nritems and nitems are equal.
2770 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2771 * src/closure.c (print_closure, print_fderives): Likewise.
2772 * src/gram.c (ritem_print): Likewise.
2773 * src/print.c (print_core, print_grammar): Likewise.
2774 * src/print_graph.c: Likewise.
2775
b7c49edf
AD
27762001-12-27 Akim Demaille <akim@epita.fr>
2777
2778 * src/main.c (main): If there are complains after grammar
2779 reductions, then output the report anyway if requested, then die.
2780 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2781 * src/reader.c (eoftoken): New.
2782 (parse_token_decl): If the token being defined has value `0', it
2783 is the eoftoken.
2784 (packsymbols): No longer hack `tags' to insert `$' by hand.
2785 Be sure to preserve the value of the eoftoken.
2786 (reader): Make sure eoftoken is defined.
2787 Initialize nsyms to 0: now eoftoken is created just like the others.
2788 * src/print.c (print_grammar): Don't special case the eof token.
2789 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2790 lie anyway, albeit pleasant.
2791 * tests/calc.at: Exercise error messages with eoftoken.
2792 Change the grammar so that empty input is invalid.
2793 Adjust expectations.
2794 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2795
ec2da99f
AD
27962001-12-27 Akim Demaille <akim@epita.fr>
2797
2798 * configure.in: Check the protos of strchr ans strspn.
2799 Replace strchr if needed.
2800 * src/system.h: Provide the protos of strchr, strspn and memchr if
2801 missing.
2802 * lib/strchr.c: New.
2803 * src/reader.c (symbols_save): Use strchr.
2804
8adfa272
AD
28052001-12-27 Akim Demaille <akim@epita.fr>
2806
2807 * src/print.c, src/print_graph.c (escape): New.
2808 Use it to quote the TAGS outputs.
2809 * src/print_graph.c (print_state): Now errors are in red, and
2810 reductions in green.
2811 Prefer high to wide: output the state number on a line of its own.
2812
80dac38c
AD
28132001-12-27 Akim Demaille <akim@epita.fr>
2814
2815 * src/state.h, src/state.c (reductions_new): New.
2816 * src/LR0.c (set_state_table): Let all the states have a
2817 `reductions', even if reduced to 0.
2818 (save_reductions): Adjust.
2819 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2820 * src/print.c (print_reductions, print_actions): Adjust.
2821 * src/output.c (action_row): Adjust.
2822
2cec70b9
AD
28232001-12-27 Akim Demaille <akim@epita.fr>
2824
2825 * src/state.h, src/state.c (errs_new, errs_dup): New.
2826 * src/LR0.c (set_state_table): Let all the states have an errs,
2827 even if reduced to 0.
2828 * src/print.c (print_errs, print_reductions): Adjust.
2829 * src/output.c (output_actions, action_row): Adjust.
2830 * src/conflicts.c (resolve_sr_conflict): Adjust.
2831
13ca549a
AD
28322001-12-27 Akim Demaille <akim@epita.fr>
2833
2834 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2835
5092aba5
AD
28362001-12-27 Akim Demaille <akim@epita.fr>
2837
2838 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2839 * src/print.c: here.
2840 (lookaheadset, shiftset): New, used as additional storage by
2841 print_reductions.
2842 (print_results): Adjust.
2843 (print_shifts, print_gotos, print_errs): New, extracted from...
2844 (print_actions): here.
2845 * src/print_graph.c (print_actions): Remove dead code.
2846
11e2beca
AD
28472001-12-27 Akim Demaille <akim@epita.fr>
2848
2849 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2850 `$n' and `@n'.
2851
dac3c910
AD
28522001-12-27 Akim Demaille <akim@epita.fr>
2853
2854 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2855 (build_relations): Adjust.
2856
d0b0fefa
AD
28572001-12-27 Akim Demaille <akim@epita.fr>
2858
2859 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2860 duplication.
2861
adc8c848
AD
28622001-12-27 Akim Demaille <akim@epita.fr>
2863
2864 * src/reader.c (packgram): Catch nitems overflows.
2865
14d293ac
AD
28662001-12-27 Akim Demaille <akim@epita.fr>
2867
2868 * src/files.c, src/files.h (guard_obstack): Remove.
2869 * src/output.c (output): Adjust.
2870 * src/reader.c (parse_braces): New, factoring...
2871 (copy_action, copy_guard): these two which are renamed as...
2872 (parse_action, parse_guard): these.
2873 As a voluntary consequence, using braces around guards is now
2874 mandatory.
2875
f499b062
AD
28762001-12-27 Akim Demaille <akim@epita.fr>
2877
2878 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2879 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2880 members.
2881 (symbol_list_new): Adjust.
2882 (copy_action): action_line is the first line, not the last.
2883 (copy_guard): Just as for actions, store the `action' only, not
2884 the switch/case/break flesh.
2885 Don't parse the user action that might follow the guard, let...
2886 (readgram): do it, i.e., now, there can be an action after a
2887 guard.
2888 In other words the guard is just explicitly optional.
2889 (packgram): Adjust.
2890 * src/output.c (guards_output): New.
2891 (output_parser): Call it when needed.
2892 (output): Also free the guard and attrs obstacks.
2893 * src/files.c, src/files.h (obstack_save): Remove.
2894 (output_files): Remove.
2895 As a result, if one needs the former `.act' file, using an
2896 appropriate skeleton which requires actions and guards is now
2897 required.
2898 * src/main.c (main): Adjust.
2899 * tests/semantic.at: New.
2900 * tests/regression.at: Use `input.y' as input file name.
2901 Avoid 8+3 problems by requiring input.c when the test needs the
2902 parser.
2903
d945f5cd
AD
29042001-12-27 Akim Demaille <akim@epita.fr>
2905
2906 * src/reader.c (symbol_list_new): Be sure to initialize all the
2907 fields.
2908
d200e455
AD
29092001-12-27 Akim Demaille <akim@epita.fr>
2910
2911 All the hacks using a final pseudo state are now useless.
2912
2913 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2914 * src/lalr.c (nLA): New.
2915 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2916 instead of lookaheadsp from the pseudo state (nstate + 1).
2917
f9507c28
AD
29182001-12-27 Akim Demaille <akim@epita.fr>
2919
2920 * src/output.c (action_row, token_actions): Use a state_t instead
2921 of a integer, and nlookaheads instead of the following state's
2922 lookaheadsp.
2923
065fbd27
AD
29242001-12-27 Akim Demaille <akim@epita.fr>
2925
2926 * src/conflicts.c (log_resolution, flush_shift)
2927 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2928 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2929 (conflicts_print, print_reductions): Use a state_t instead of an
2930 integer when referring to a state.
2931 As much as possible, depend upon nlookaheads, instead of the
2932 `lookaheadsp' member of the following state (since lookaheads of
2933 successive states are successive, the difference between state n + 1
2934 and n served as the number of lookaheads for state n).
2935 * src/lalr.c (add_lookback_edge): Likewise.
2936 * src/print.c (print_core, print_actions, print_state)
2937 (print_results): Likewise.
2938 * src/print_graph.c (print_core, print_actions, print_state)
2939 (print_graph): Likewise.
2940 * src/conflicts.h: Adjust.
2941
1b177bd7
AD
29422001-12-27 Akim Demaille <akim@epita.fr>
2943
2944 * src/bison.hairy: Formatting/comment changes.
2945 ANSIfy.
2946 Remove `register' indications.
2947 Add plenty of `static'.
2948
7742ddeb
AD
29492001-12-27 Akim Demaille <akim@epita.fr>
2950
2951 * src/output.c (prepare): Drop the muscle `ntbase' which
2952 duplicates ntokens.
2953 * src/bison.simple: Formatting/comment changes.
2954 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2955 is an undocumented synonym.
2956
1fa14068
AD
29572001-12-22 Akim Demaille <akim@epita.fr>
2958
2959 * src/output.c (output_table_data): Change the prototype to use
2960 `int' for array ranges: some invocations do pass an int, not a
2961 short.
2962 Reported by Wayne Green.
2963
b9752825
AD
29642001-12-22 Akim Demaille <akim@epita.fr>
2965
2966 Some actions of web2c.y are improperly triggered.
2967 Reported by Mike Castle.
2968
2969 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2970 * tests/regression.at (Web2c): Rename as...
2971 (Web2c Report): this.
2972 (Web2c Actions): New.
2973
776209d6
AD
29742001-12-22 Akim Demaille <akim@epita.fr>
2975
2976 Reductions in web2c.y are improperly reported.
2977 Reported by Mike Castle.
2978
2979 * src/conflicts.c (print_reductions): Fix.
2980 * tests/regression.at (Web2c): New.
2981
275fc3ad
AD
29822001-12-18 Akim Demaille <akim@epita.fr>
2983
2984 Some host fail on `assert (!"foo")', which expands to
2985 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2986 Reported by Nelson Beebee.
2987
2988 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2989 `#define it_succeeded 0' and `assert (it_succeeded)'.
2990
897668ee
MA
29912001-12-17 Marc Autret <autret_m@epita.fr>
2992
2993 * src/bison.simple: Don't hard code the skeleton line and filename.
2994 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2995 New line counter 'skeleton_line' (skeleton-line muscle).
2996
ab3399e0
PE
29972001-12-17 Paul Eggert <eggert@twinsun.com>
2998
2999 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3000 YYDEBUG must be defined to a nonzero value.
3001
3002 * src/bison.simple (yytname): Do not assume that the user defines
3003 YYDEBUG to a properly parenthesized expression.
3004
3877f72b
AD
30052001-12-17 Akim Demaille <akim@epita.fr>
3006
3007 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3008 nlookaheads is a new member.
3009 Adjust all users.
3010 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3011 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3012 state.
776209d6 3013
331dbc1b
AD
30142001-12-17 Akim Demaille <akim@epita.fr>
3015
3016 * src/files.h, src/files.c (open_files, close_files): Remove.
3017 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3018 let...
3019 * src/reader.c (reader): Do it.
776209d6 3020
be750e4c
AD
30212001-12-17 Akim Demaille <akim@epita.fr>
3022
3023 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 3024
709ae8c6
AD
30252001-12-17 Akim Demaille <akim@epita.fr>
3026
3027 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3028 (flush_reduce): New.
3029 (resolve_sr_conflict): Adjust.
776209d6 3030
f87685c3
AD
30312001-12-17 Akim Demaille <akim@epita.fr>
3032
3033 * src/output.c (output_obstack): Be static and rename as...
3034 (format_obstack): this, to avoid any confusion with files.c's
3035 output_obstack.
3036 * src/reader.h (muscle_obstack): Move to...
3037 * src/output.h: here, since it's defined in output.c.
3038
837491d8
AD
30392001-12-17 Akim Demaille <akim@epita.fr>
3040
3041 * src/output.c (action_row, save_column, default_goto)
3042 (sort_actions, matching_state, pack_vector): Better variable
3043 locality.
3044
796d61fb
AD
30452001-12-17 Akim Demaille <akim@epita.fr>
3046
3047 * src/output.c: Various formatting changes.
776209d6 3048
64d15509
AD
30492001-12-17 Akim Demaille <akim@epita.fr>
3050
3051 * src/files.c (output_files): Free the output_obstack.
3052 * src/main.c (main): Call print and print_graph conditionally.
3053 * src/print.c (print): Work unconditionally.
3054 * src/print_graph.c (print_graph): Work unconditionally.
3055 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3056
fbc8ecb7
MA
30572001-12-16 Marc Autret <autret_m@epita.fr>
3058
3059 * src/output.c (actions_output): Fix. When we use %no-lines,
3060 there is one less line per action.
3061
f0440388
MA
30622001-12-16 Marc Autret <autret_m@epita.fr>
3063
3064 * src/bison.simple: Remove a useless #line directive.
3065 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3066 * src/output.c (get_lines_number): New.
776209d6 3067 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
3068 output muscles.
3069 Fix line numbering.
3070 (actions_output): Computes the number of lines taken by actions.
3071 (output_master_parser): Insert new skeleton which is the name of
3072 the output parser file name.
3073
a79986b8
MA
30742001-12-15 Marc Autret <autret_m@epita.fr>
3075
3076 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3077
4ec8e00f
MA
30782001-12-15 Marc Autret <autret_m@epita.fr>
3079
3080 * src/output.c (output_gram): Keep track of the hairy one.
3081
1a4648ff
AD
30822001-12-15 Akim Demaille <akim@epita.fr>
3083
3084 Make `make distcheck' work.
3085
3086 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3087 system.h which uses libgettext.h.
3088
9c2c67e6
AD
30892001-12-15 Akim Demaille <akim@epita.fr>
3090
3091 * src/nullable.c (set_nullable): Useless rules must be skipped,
3092 otherwise, since we range over their symbols, we might look at a
3093 nonterminal which no longer ``exists'', i.e., it is not counted in
3094 `nvars', hence we overflow our arrays.
3095
93ede233
AD
30962001-12-15 Akim Demaille <akim@epita.fr>
3097
3098 The header can also be produced directly, without any obstack!
3099 Yahoo!
3100
3101 * src/files.c, src/files.h (defines_obstack): Remove.
3102 (compute_header_macro): Global.
3103 (defines_obstack_save): Remove.
3104 * src/reader.c (parse_union_decl): No longer output to
3105 defines_obstack: its content can be found in the `stype' muscle
3106 anyway.
3107 (output_token_translations): Merge into...
3108 (symbols_output): this.
3109 Rename as...
3110 (symbols_save): this.
3111 (reader): Adjust.
3112 * src/output.c (header_output): New.
3113 (output): Call it.
3114
2666f928
AD
31152001-12-15 Akim Demaille <akim@epita.fr>
3116
3117 * src/reader.c (parse_union_decl): Instead of handling two obstack
3118 simultaneously, use one to define the `stype' muscle, and use the
3119 value of the latter to fill defines_obstack.
3120 (copy_comment): Remove.
3121 (copy_comment2): Work for a single obstack.
3122 Rename as...
3123 (copy_comment): this.
3124
428046f8
AD
31252001-12-15 Akim Demaille <akim@epita.fr>
3126
3127 * src/lex.c, src/lex.h (xgetc): No longer static.
3128 * src/reader.c (parse_union_decl): Revamp.
3129
ea52d706
AD
31302001-12-15 Akim Demaille <akim@epita.fr>
3131
3132 Still making progress in separating Bison into (i) input, (ii)
3133 process, (iii) output: now we can directly output the parser file
3134 without using table_obstack at all.
3135
3136 * src/files.c, src/files.h (table_obstack): Bye bye.
3137 (parser_file_name): New.
3138 * src/files.c (compute_output_file_names): Compute it.
3139 * src/output.c (actions_output, output_parser)
3140 (output_master_parser): To a file instead of an obstack.
3141
3f96f4dc
AD
31422001-12-15 Akim Demaille <akim@epita.fr>
3143
3144 Attach actions to rules, instead of pre-outputting them to
3145 actions_obstack.
3146
3147 * src/gram.h (rule_t): action and action_line are new members.
3148 * src/reader.c (symbol_list): Likewise.
3149 (copy_action): Save the actions within the rule.
3150 (packgram): Save them in rule_table.
3151 * src/output.c (actions_output): New.
3152 (output_parser): Use it on `%%actions'.
3153 (output_rule_data): Don't free rule_table.
3154 (output): Do it.
3155 (prepare): Don't save the `action' muscle.
3156 * src/bison.simple: s/%%action/%%actions/.
3157
51576fb3
AD
31582001-12-15 Akim Demaille <akim@epita.fr>
3159
3160 * src/reader.c (copy_action): When --yacc, don't append a `;'
3161 to the user action: let it fail if lacking.
dee049eb 3162 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 3163
2648a72d
AD
31642001-12-14 Akim Demaille <akim@epita.fr>
3165
3166 * src/lex.c (literalchar): Simply return the char you decoded, non
3167 longer mess around with obstacks and int pointers.
3168 Adjust all callers.
3169
92790e5b
AD
31702001-12-14 Akim Demaille <akim@epita.fr>
3171
3172 * src/lex.c (literalchar): Don't escape the special characters,
3173 just decode them, and keep them as char (before, eol was output as
3174 the 2 char string `\n' etc.).
3175 * src/output.c (output_rule_data): Use quotearg to output the
3176 token strings.
3177
927c1557
PE
31782001-12-13 Paul Eggert <eggert@twinsun.com>
3179
3180 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3181 Do not infringe on the global user namespace when using C++.
3182 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3183 All uses of `fprintf' and `stderr' changed.
3184
3185 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3186
ed8e1f68
AD
31872001-12-13 Akim Demaille <akim@epita.fr>
3188
3189 The computation of nullable is broken: it doesn't handle empty
3190 RHS's properly.
3191
3192 * tests/torture.at (GNU AWK Grammar): New.
3193 * tests/sets.at (Nullable): New.
3194 * src/nullable.c (set_nullable): Instead of blindly looping over
3195 `ritems', loop over the rules, and then over their rhs's.
3196
3197 Work around Autotest bugs.
3198
3199 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3200 frame, because Autotest understand lines starting with a `+' as
3201 traces from the shell. Then, they are not processed properly.
3202 Admittedly an Autotest bug, but we don't have time to wait for
3203 Autotest to catch up.
3204 * tests/regression.at (Broken Closure): Adjust to the new table
3205 frames.
3206 Move to...
3207 * tests/sets.at: here.
3208
cb581495
AD
32092001-12-13 Akim Demaille <akim@epita.fr>
3210
3211 * src/closure.c (closure): Use nrules instead of playing tricks
3212 with BITS_PER_WORD.
3213
2e729273
AD
32142001-12-13 Akim Demaille <akim@epita.fr>
3215
3216 * src/print.c (print_actions): Output the handling of `$' as the
3217 traces do: shifting the token EOF. Before EOF was treated as a
3218 nonterminal.
3219 * tests/regression.at: Adjust some tests.
3220 * src/print_graph.c (print_core): Complete the set of items via
3221 closure. The next-to-final and final states are still unsatisfying,
3222 but that's to be addressed elsewhere.
3223 No longer output the rule numbers, but do output the state number.
3224 A single loop for the shifts + gotos is enough, but picked a
3225 distinct color for each.
3226 (print_graph): Initialize and finalize closure.
3227
107f7dfb
AD
32282001-12-13 Akim Demaille <akim@epita.fr>
3229
3230 * src/reader.c (readgram): Remove dead code, an strip useless
3231 braces.
3232 (get_type): Remove, unused.
3233
9b53a24f
AD
32342001-12-12 Akim Demaille <akim@epita.fr>
3235
3236 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3237 on that of lib/error.c.
3238
dbfb6dcd
AD
32392001-12-12 Akim Demaille <akim@epita.fr>
3240
3241 Some hosts don't like `/' in includes.
3242
3243 * src/system.h: Include libgettext.h without qualifying the path.
3244 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3245 $(top_srcdir).
3246
c25fb648
MA
32472001-12-11 Marc Autret <autret_m@epita.fr>
3248
3249 * src/output.c (output_parser): Remove useless muscle.
3250
710ddc4f
MA
32512001-12-11 Marc Autret <autret_m@epita.fr>
3252
3253 * src/bison.simple: Remove #line just before %%epilogue. It
3254 is now handled in ...
3255 * src/reader.c (read_additionnal_code): Add the output of a
3256 #line for the epilogue.
3257
e83d80b8
MA
32582001-12-10 Marc Autret <autret_m@epita.fr>
3259
927c1557 3260 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
3261 replace precedent remove.
3262 * src/bison.simple: Remove #line before %%prologue because
3263 %%input-line is wrong at this time.
3264
971d5158
MA
32652001-12-10 Marc Autret <autret_m@epita.fr>
3266
3267 * src/reader.c (symbols_output): Clean up.
927c1557 3268 * src/output.c (output_gram, output): Clean up.
971d5158 3269
5edafffd
AD
32702001-12-10 Akim Demaille <akim@epita.fr>
3271
3272 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3273 * src/LR0.c (set_state_table): here.
3274 * src/lalr.c (lalr): Call it.
3275
0279f8e9
AD
32762001-12-10 Akim Demaille <akim@epita.fr>
3277
3278 * src/state.h (shifts): Remove the `number' member: shifts are
3279 attached to state, hence no longer need to be labelled with a
3280 state number.
3281
190c4f5f
AD
32822001-12-10 Akim Demaille <akim@epita.fr>
3283
3284 Now that states have a complete set of members, the linked list of
3285 shifts is useless: just fill directly the state's shifts member.
3286
3287 * src/state.h (shifts): Remove the `next' member.
3288 * src/LR0.c (first_state, last_state): Remove.
3289 Adjust the callers.
3290 (augment_automaton): Don't look for the shifts that must be added
3291 a shift on EOF: it is those of the state we looked for! But now,
3292 since shifts are attached, it is no longer needed to looking
3293 merely by its id: its number.
3294
2a73b93d
AD
32952001-12-10 Akim Demaille <akim@epita.fr>
3296
3297 * src/LR0.c (augment_automaton): Better variable locality.
3298 Remove an impossible branch: if there is a state corresponding to
3299 the start symbol being shifted, then there is shift for the start
3300 symbol from the initial state.
3301
74392f6a
AD
33022001-12-10 Akim Demaille <akim@epita.fr>
3303
3304 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3305 only when appropriate: when insert_start_shifting_state' is not
3306 invoked.
3307 * tests/regression.at (Rule Line Numbers): Adjust.
3308
37c82725
AD
33092001-12-10 Akim Demaille <akim@epita.fr>
3310
3311 * src/LR0.c (augment_automaton): Now that all states have shifts,
3312 merge the two cases addition shifts to the initial state.
3313
6a164e0c
AD
33142001-12-10 Akim Demaille <akim@epita.fr>
3315
3316 * src/lalr.c (set_state_table): Move to...
3317 * src/LR0.c: here.
3318 * src/lalr.c (lalr): Don't call it...
3319 * src/LR0.c (generate_states): do it.
3320 * src/LR0.h (first_state): Remove, only the table is used.
3321
7215de24
AD
33222001-12-10 Akim Demaille <akim@epita.fr>
3323
3324 * src/LR0.h (first_shift, first_reduction): Remove.
3325 * src/lalr.c: Don't use first_shift: find shifts through the
3326 states.
3327
80e25d4d
AD
33282001-12-10 Akim Demaille <akim@epita.fr>
3329
3330 * src/LR0.c: Attach shifts to states as soon as they are
3331 computed.
3332 * src/lalr.c (set_state_table): Instead of assigning shifts to
3333 state, just assert that the mapping was properly done.
3334
0ab3728b
AD
33352001-12-10 Akim Demaille <akim@epita.fr>
3336
3337 * src/LR0.c (insert_start_shift): Rename as...
3338 (insert_start_shifting_state): this.
3339 (insert_eof_shifting_state, insert_accepting_state): New.
3340 (augment_automaton): Adjust.
3341 Better locality of the variables.
3342 When looking if the start_symbol is shifted from the initial
3343 state, using `while (... symbol != start_symbol ...)' sounds
3344 better than `while (... symbol < start_symbol ...)': If fail
3345 to see how the order between symbols could be relevant!
3346
78af9bbc
AD
33472001-12-10 Akim Demaille <akim@epita.fr>
3348
3349 * src/getargs.h: Don't declare `spec_name_prefix' and
3350 `spec_file_prefix', declared by src/files.h.
3351 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3352 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3353 * src/output.c (prepare): Adjust.
3354 * src/reader.c (symbols_output): Likewise.
3355 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3356
bdef2a41
AD
33572001-12-10 Akim Demaille <akim@epita.fr>
3358
3359 * src/muscle_tab.c (muscle_init): NULL is a better default than
3360 `"0"'.
3361
3735969c
AD
33622001-12-10 Akim Demaille <akim@epita.fr>
3363
3364 * src/reader.c (reader): Calling symbols_output once is enough.
3365
49701457
AD
33662001-12-10 Akim Demaille <akim@epita.fr>
3367
3368 Now that states have a complete set of members, the linked list of
3369 reductions is useless: just fill directly the state's reductions
3370 member.
3371
3372 * src/state.h (struct reductions): Remove member `number' and
3373 `next'.
3374 * src/LR0.c (first_reduction, last_reduction): Remove.
3375 (save_reductions): Don't link the new reductions, store them in
3376 this_state.
3377 * src/lalr.c (set_state_table): No need to attach reductions to
3378 states, it's already done.
3379 * src/output.c (output_actions): No longer free the shifts, then
3380 the reductions, then the states: free all the states and their
3381 members.
3382
0edad749
AD
33832001-12-10 Akim Demaille <akim@epita.fr>
3384
3385 * src/options.c (OPTN, DRTV, BOTH): New.
3386 (option_table): Use them.
3387
0edad749
AD
3388 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3389 the job of system.h.
3390 * src/options.c: Don't include stdio.h and xalloc.h for the same
3391 reasons.
3392
5449dd0f
AD
33932001-12-10 Akim Demaille <akim@epita.fr>
3394
3395 * src/output.c (output, prepare): Make sure the values of the
3396 muscles `action' and `prologue' are 0-terminated.
3397
a870c567
AD
33982001-12-10 Akim Demaille <akim@epita.fr>
3399
3400 Clean up GCC warnings.
3401
3402 * src/reader.c (copy_action): `buf' is not used.
3403 (parse_skel_decl): Be static.
3404 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3405 * src/options.h (create_long_option_table): Have a real prototype.
3406 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3407 (hash_delete_at): Return const void *.
3408 Adjust casts to preserve the const.
3409
80df8768
AD
34102001-12-10 Akim Demaille <akim@epita.fr>
3411
3412 * configure.in: Require 2.52g.
3413 M4 is not needed, but AUTOM4TE is.
3414 * m4/m4.m4: Remove.
3415 * tests/Makefile.am: Adjust.
3416
f693ad14
AD
34172001-12-10 Akim Demaille <akim@epita.fr>
3418
3419 One structure for states is enough, even though theoretically
3420 there are LR(0) states and LALR(1) states.
3421
3422 * src/lalr.h (state_t): Remove.
3423 (state_table): Be state_t **, not state_t *.
3424 * src/state.h (core, CORE_ALLOC): Rename as...
3425 (state_t, STATE_ALLOC): this.
3426 Add the LALR(1) members: shifts, reductions, errs.
3427 * src/LR0.c (state_table): Rename as...
3428 (state_hash): this, to avoid name clashes with the global
3429 `state_table'.
3430 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3431 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3432
74ffbcb6
AD
34332001-12-10 Akim Demaille <akim@epita.fr>
3434
3435 Bison dumps core on bash.y.
3436 Reported by Pascal Bart.
3437
3438 * src/warshall.c (bitmatrix_print): New.
3439 (TC): Use it.
3440 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3441 j must be the outer loop.
3442 * tests/regression.at (Broken Closure): New.
3443
07708e19
AD
34442001-12-05 Akim Demaille <akim@epita.fr>
3445
3446 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3447 its argument.
3448