This page contains the following errors:

error on line 10823 at column 130: Premature end of data in tag tr line 10822

Below is a rendering of the page up to the first error.

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