]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/state.h, src/state.c (shifts_to): New.
[bison.git] / ChangeLog
CommitLineData
24c7d800
AD
12002-06-30 Akim Demaille <akim@epita.fr>
2
3 * src/state.h, src/state.c (shifts_to): New.
4 * src/lalr.c (build_relations): Use it.
5
6
9222837b
AD
72002-06-30 Akim Demaille <akim@epita.fr>
8
9 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10 (item_number_of_rule_number, rule_number_of_item_number): New.
11 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
13 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14 Propagate their use.
15 Much remains to be done, in particular wrt `shorts' from types.h.
16
17
260008e5
AD
182002-06-30 Akim Demaille <akim@epita.fr>
19
20 * src/symtab.c (symbol_new): Initialize the `printer' member.
21
22
8a731ca8
AD
232002-06-30 Akim Demaille <akim@epita.fr>
24
25 * src/LR0.c (save_reductions): Remove, replaced by...
26 * src/state.h, src/state.c (state_reductions_set): New.
27 (reductions, errs): Rename as...
28 (reductions_t, errs_t): these.
29 Adjust all dependencies.
30
31
32e1e0a4
AD
322002-06-30 Akim Demaille <akim@epita.fr>
33
34 * src/LR0.c (state_list_t, state_list_append): New.
35 (first_state, last_state): Now symbol_list_t.
36 (this_state): Remove.
37 (new_itemsets, append_states, save_reductions): Take a state_t as
38 argument.
39 (set_states, generate_states): Adjust.
40 (save_shifts): Remove, replaced by...
41 * src/state.h, src/state.c (state_shifts_set): New.
42 (shifts): Rename as...
43 (shifts_t): this.
44 Adjust all dependencies.
45 * src/state.h (state_t): Remove the `next' member.
46
47
e5fb6710
AD
482002-06-30 Akim Demaille <akim@epita.fr>
49
50 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
51 escaped in slot 0.
52
53
542002-06-30 Akim Demaille <akim@epita.fr>
55
56 Use hash.h for the state hash table.
57
58 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
59 (allocate_storage): Use state_hash_new.
60 (free_storage): Use state_hash_free.
61 (new_state, get_state): Adjust.
62 * src/lalr.h, src/lalr.c (states): Move to...
63 * src/states.h (state_t): Remove the `link' member, no longer
64 used.
65 * src/states.h, src/states.c: here.
66 (state_hash_new, state_hash_free, state_hash_lookup)
67 (state_hash_insert, states_free): New.
68 * src/states.c (state_table, state_compare, state_hash): New.
69 * src/output.c (output_actions): Do not free states now, since we
70 still need to know the final_state number in `prepare', called
71 afterwards. Do it...
72 * src/main.c (main): here: call states_free after `output'.
73
74
c7ca99d4
AD
752002-06-30 Akim Demaille <akim@epita.fr>
76
77 Use hash.h for the state hash table.
78
79 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
80 (allocate_storage): Use state_hash_new.
81 (free_storage): Use state_hash_free.
82 (new_state, get_state): Adjust.
83 * src/lalr.h, src/lalr.c (states): Move to...
84 * src/states.h (state_t): Remove the `link' member, no longer
85 used.
86 * src/states.h, src/states.c: here.
87 (state_hash_new, state_hash_free, state_hash_lookup)
88 (state_hash_insert, states_free): New.
89 * src/states.c (state_table, state_compare, state_hash): New.
90 * src/output.c (output_actions): Do not free states now, since we
91 still need to know the final_state number in `prepare', called
92 afterwards. Do it...
93 * src/main.c (main): here: call states_free after `output'.
94
95
df0e7316
AD
962002-06-30 Akim Demaille <akim@epita.fr>
97
98 * src/state.h, src/state.c (state_new): New, extracted from...
99 * src/LR0.c (new_state): here.
100 * src/state.h (STATE_ALLOC): Move to...
101 * src/state.c: here.
102 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
103 * src/state.h, src/state.c: here.
104
105
39f41916
AD
1062002-06-30 Akim Demaille <akim@epita.fr>
107
108 * src/reader.c (gensym): Rename as...
109 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
110 (getsym): Rename as...
111 (symbol_get): this.
112
113
d57650a5
AD
1142002-06-30 Akim Demaille <akim@epita.fr>
115
116 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
117 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
118 * src/output.c, src/print.c, src/print_graph.c: Propagate.
119 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
120
5a08f1ce
AD
1212002-06-30 Akim Demaille <akim@epita.fr>
122
123 Make the test suite pass with warnings checked.
124
125 * tests/actions.at (Printers and Destructors): Improve.
126 Avoid unsigned vs. signed issues.
127 * tests/calc.at: Don't exercise the scanner here, do it...
128 * tests/input.at (Torturing the Scanner): here.
129
130
720623af
PH
1312002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
132
133 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
134 reorganize first lines parallel to yacc.c.
135
fb8135fa
AD
1362002-06-28 Akim Demaille <akim@epita.fr>
137
138 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
139 (b4_token_enum, b4_token_defines): New, factored from...
140 * data/lalr1.cc, data/yacc.c, glr.c: here.
141
41442480
AD
1422002-06-28 Akim Demaille <akim@epita.fr>
143
144 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
145 unused variables.
146 * src/output.c (merger_output): static.
147
e0e5bf84
AD
1482002-06-28 Akim Demaille <akim@epita.fr>
149
150 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
151 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
152 pacify GCC.
153 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 154
676385e2
PH
1552002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
156
157 Accumulated changelog for new GLR parsing features.
158
e0e5bf84 159 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
160 conflicts_total_count.
161 * src/conflicts.h: Ditto.
162 * src/output.c (token_actions): Use the new name.
163 (output_conflicts): Change conflp => conflict_list_heads, and
164 confl => conflict_list for better readability.
165 * data/glr.c: Use the new names.
166 * NEWS: Add self to GLR announcement.
e0e5bf84 167
676385e2
PH
168 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
169
170 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
171 Akim Demaille.
172
173 * data/bison.glr: Change name to glr.c
174 * data/glr.c: Renamed from bison.glr.
175 * data/Makefile.am: Add glr.c
e0e5bf84
AD
176
177 * src/getargs.c:
178
676385e2
PH
179 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
180 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 181
676385e2
PH
182 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
183
184 * data/bison.glr: Be sure to restore the
185 current #line when returning to the skeleton contents after having
186 exposed the input file's #line.
187
188 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
189
190 * data/bison.glr: Bring up to date with changes to bison.simple.
191
192 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
193
194 * data/bison.glr: Correct definitions that use b4_prefix.
195 Various reformatting.
196 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
197 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
198 yytokenp argument; now part of stack.
199 (yychar): Define to behave as documented.
200 (yyclearin): Ditto.
e0e5bf84 201
676385e2
PH
202 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
203
204 * src/reader.h: Add declaration for free_merger_functions.
205
206 * src/reader.c (merge_functions): New variable.
207 (get_merge_function): New function.
208 (free_merger_functions): New function.
209 (readgram): Check for %prec that is not followed by a symbol.
210 Handle %dprec and %merge declarations.
211 (packgram): Initialize dprec and merger fields in rules array.
212
213 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
214 conflict_list_cnt, conflict_list_free): New variables.
215 (table_grow): Also grow conflict_table.
e0e5bf84 216 (prepare_rules): Output dprec and merger tables.
676385e2 217 (conflict_row): New function.
e0e5bf84 218 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
219 default reduction in conflicted states for GLR parser so that there
220 are spaces for the conflict lists.
221 (save_row): Also save conflict information.
222 (token_actions): Allocate conflict list.
223 (merger_output): New function.
224 (pack_vector): Pack conflict table, too.
225 (output_conflicts): New function to output yyconflp and yyconfl.
226 (output_check): Allocate conflict_tos.
227 (output_actions): Output conflict tables, also.
228 (output_skeleton): Output b4_mergers definition.
229 (prepare): Output b4_max_rhs_length definition.
230 Use 'bison.glr' as default skeleton for GLR parsers.
231
232 * src/gram.c (glr_parser): New flag.
233 (grammar_free): Call free_merger_functions.
234
235 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
236 all pairs of conflicting reductions, rather than just all tokens
237 causing conflicts. Needed to size conflict tables.
e0e5bf84 238 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
239 interface.
240 (conflicts_print): Ditto.
241 (count_total_conflicts): New function.
242
243 * src/reader.h (merger_list): New type.
244 (merge_functions): New variable.
245
246 * src/lex.h (tok_dprec, tok_merge): New token types.
247
248 * src/gram.h (rule_s): Add dprec and merger fields.
249 (glr_parser): New flag.
250
251 * src/conflicts.h (count_total_conflicts): New function.
252
253 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
254
255 * doc/bison.texinfo (Generalized LR Parsing): New section.
256 (GLR Parsers): New section.
257 (Language and Grammar): Mention GLR parsing.
258 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
259 Correct typo ("tge" -> "the").
260
261 * data/bison.glr: New skeleton for GLR parsing.
262
263 * tests/cxx-gram.at: New tests for GLR parsing.
264
265 * tests/testsuite.at: Include cxx-gram.at.
266
267 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 268
676385e2
PH
269 * src/parse-gram.y:
270
271 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
272
273 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 274
b5480d74 2752002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
276
277 * src/options.h, src/options.c: Remove.
278 * src/getargs.c (short_options, long_options): New.
279
60491a94
AD
2802002-06-27 Akim Demaille <akim@epita.fr>
281
282 * data/bison.simple, data/bison.c++: Rename as...
283 * data/yacc.c, data/lalr1.cc: these.
284 * doc/bison.texinfo (Environment Variables): Remove.
285
9be0c25b
AD
2862002-06-25 Raja R Harinath <harinath@cs.umn.edu>
287
288 * src/getargs.c (report_argmatch): Initialize strtok().
289
1ae72863
AD
2902002-06-20 Akim Demaille <akim@epita.fr>
291
292 * data/bison.simple (b4_symbol_actions): New, replaces...
293 (b4_symbol_destructor, b4_symbol_printer): these.
294 (yysymprint): Be sure to call YYPRINT only for tokens, and using
295 user token numbers.
296
87542d29
AD
2972002-06-20 Akim Demaille <akim@epita.fr>
298
299 * data/bison.simple (yydestructor): Rename as...
300 (yydestruct): this.
301
1a31ed21
AD
3022002-06-20 Akim Demaille <akim@epita.fr>
303
304 * src/symtab.h, src/symtab.c (symbol_type_set)
305 (symbol_destructor_set, symbol_precedence_set): The location is
306 the last argument.
307 Adjust all callers.
308
e776192e
AD
3092002-06-20 Akim Demaille <akim@epita.fr>
310
311 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
312 internals.
313 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
314 Takes a location.
315 * src/symtab.h, src/symtab.c (symbol_class_set)
316 (symbol_user_token_number_set): Likewise.
317 Adjust all callers.
318 Promote complain_at.
319 * tests/input.at (Type Clashes): Adjust.
320
5c1180b3
AD
3212002-06-20 Akim Demaille <akim@epita.fr>
322
323 * data/bison.simple (YYLEX): Fix the declaration when
324 %pure-parser.
325
e3170060
AD
3262002-06-20 Akim Demaille <akim@epita.fr>
327
328 * data/bison.simple (yysymprint): Don't print the token number,
329 just its name.
330 * tests/actions.at (Destructors): Rename as...
331 (Printers and Destructors): this.
332 Also exercise %printer.
333
253862fd
AD
3342002-06-20 Akim Demaille <akim@epita.fr>
335
336 * data/bison.simple (YYDSYMPRINT): New.
337 Use it to remove many of the #if YYDEBUG/if (yydebug).
338
366eea36
AD
3392002-06-20 Akim Demaille <akim@epita.fr>
340
341 * src/symtab.h, src/symtab.c (symbol_t): printer and
342 printer_location are new members.
343 (symbol_printer_set): New.
344 * src/parse-gram.y (PERCENT_PRINTER): New token.
345 Handle its associated rule.
346 * src/scan-gram.l: Adjust.
347 (handle_destructor_at, handle_destructor_dollar): Rename as...
348 (handle_symbol_code_at, handle_symbol_code_dollar): these.
349 * src/output.c (symbol_printers_output): New.
350 (output_skeleton): Call it.
351 * data/bison.simple (yysymprint): New. Cannot be named yyprint
352 since there are already many grammar files with a user `yyprint'.
353 Replace the calls to YYPRINT to calls to yysymprint.
354 * tests/calc.at: Adjust.
355 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
356 taking advantage of parser very internal details (stack size!).
357
4f25ebb0
AD
3582002-06-20 Akim Demaille <akim@epita.fr>
359
360 * src/scan-gram.l: Complete the scanner with the missing patterns
361 to pacify Flex.
362 Use `quote' and `symbol_tag_get' where appropriate.
363
93b68a0e
AD
3642002-06-19 Akim Demaille <akim@epita.fr>
365
366 * tests/actions.at (Destructors): Augment to test locations.
367 * data/bison.simple (yydestructor): Pass it the current location
368 if locations are enabled.
369 Prototype only when __STDC__ or C++.
370 Change the argument names to move into the yy name space: there is
371 user code here.
372
58612f1d
AD
3732002-06-19 Akim Demaille <akim@epita.fr>
374
74310291
AD
375 * data/bison.simple (b4_pure_if): New.
376 Use it instead of #ifdef YYPURE.
377
3782002-06-19 Akim Demaille <akim@epita.fr>
379
380 * data/bison.simple (b4_location_if): New.
58612f1d
AD
381 Use it instead of #ifdef YYLSP_NEEDED.
382
f25bfb75
AD
3832002-06-19 Akim Demaille <akim@epita.fr>
384
385 Prepare @$ in %destructor, but currently don't bind it in the
386 skeleton, as %location use is not cleaned up yet.
387
388 * src/scan-gram.l (handle_dollar, handle_destructor_at)
389 (handle_action_at): New.
390 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
391 a braced_code_t and a location as additional arguments.
392 (handle_destructor_dollar): Instead of requiring `b4_eval', just
393 unquote one when outputting `b4_dollar_dollar'.
394 Adjust callers.
395 * data/bison.simple (b4_eval): Remove.
396 (b4_symbol_destructor): Adjust.
397 * tests/input.at (Invalid @n): Adjust.
398
c732d2c6
AD
3992002-06-19 Zack Weinberg <zack@codesourcery.com>
400
401 * doc/bison.texinfo: Document ability to have multiple
402 prologue sections.
403
8c165d89
AD
4042002-06-18 Akim Demaille <akim@epita.fr>
405
406 * src/files.c (compute_base_names): When computing the output file
407 names from the input file name, strip the directory part.
408
ca98bf57
AD
4092002-06-18 Akim Demaille <akim@epita.fr>
410
411 * data/bison.simple.new: Comment changes.
412 Reported by Andreas Schwab.
413
0bfb02ff
AD
4142002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
415
416 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
417 there are no `label `yyoverflowlab' defined but not used' warnings
418 when yyoverflow is defined.
419
24c0aad7
AD
4202002-06-18 Akim Demaille <akim@epita.fr>
421
422 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
423 new member.
424 (symbol_destructor_set): Adjust.
425 * src/output.c (symbol_destructors_output): Output the destructor
426 locations.
427 Output the symbol name.
428 * data/bison.simple (b4_symbol_destructor): Adjust.
429
5719c109
AD
4302002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
431 and Akim Demaille <akim@epita.fr>
432
433 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
434 what's left on the stack when the error recovery hits EOF.
435 * tests/actions.at (Destructors): Complete to exercise this case.
436
9280d3ef
AD
4372002-06-17 Akim Demaille <akim@epita.fr>
438
439 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
440 arguments is really empty, not only equal to `[]'.
441 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
442 member.
443 (symbol_destructor_set): New.
444 * src/output.c (symbol_destructors_output): New.
445 * src/reader.h (brace_code_t, current_braced_code): New.
446 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
447 (handle_dollar): Rename as...
448 (handle_action_dollar): this.
449 (handle_destructor_dollar): New.
450 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
451 (grammar_declaration): Use it.
452 * data/bison.simple (yystos): Is always defined.
453 (yydestructor): New.
454 * tests/actions.at (Destructors): New.
455 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
456
dafdc66f
AD
4572002-06-17 Akim Demaille <akim@epita.fr>
458
459 * src/symlist.h, src/symlist.c (symbol_list_length): New.
460 * src/scan-gram.l (handle_dollar, handle_at): Compute the
461 rule_length only when needed.
462 * src/output.c (actions_output, token_definitions_output): Output
463 the full M4 block.
464 * src/symtab.c: Don't access directly to the symbol tag, use
465 symbol_tag_get.
466 * src/parse-gram.y: Use symbol_list_free.
467
56c47203
AD
4682002-06-17 Akim Demaille <akim@epita.fr>
469
470 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
471 (symbol_list_prepend, get_type_name): Move to...
472 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
473 (symbol_list_prepend, symbol_list_n_type_name_get): here.
474 Adjust all callers.
475 (symbol_list_free): New.
476 * src/scan-gram.l (handle_dollar): Takes a location.
477 * tests/input.at (Invalid $n): Adjust.
478
1e0bab92
AD
4792002-06-17 Akim Demaille <akim@epita.fr>
480
481 * src/reader.h, src/reader.c (symbol_list_new): Export it.
482 (symbol_list_prepend): New.
483 * src/parse-gram.y (%union): `list' is a new member.
484 (symbols.1): New, replaces...
485 (terms_to_prec.1, nterms_to_type.1): these.
486 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
487 Take a location as additional argument.
488 Adjust all callers.
489
04e60654
AD
4902002-06-15 Akim Demaille <akim@epita.fr>
491
492 * src/parse-gram.y: Move %token in the declaration section so that
493 we don't depend upon CVS Bison.
494
10e5b8bd
AD
4952002-06-15 Akim Demaille <akim@epita.fr>
496
497 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
498 * src/print.c (print_core): Use it.
499
9801d40c
AD
5002002-06-15 Akim Demaille <akim@epita.fr>
501
502 * src/conflicts.c (log_resolution): Accept the rule involved in
503 the sr conflicts instead of the lookahead number that points to
504 that rule.
505 (flush_reduce): Accept the current lookahead vector as argument,
506 instead of the index in LA.
507 (resolve_sr_conflict): Accept the current number of lookahead
508 bitset to consider for the STATE, instead of the index in LA.
509 (set_conflicts): Adjust.
510 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
511
c0263492
AD
5122002-06-15 Akim Demaille <akim@epita.fr>
513
514 * src/state.h (state_t): Replace the `lookaheadsp' member, a
515 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
516 Adjust all dependencies.
517 * src/lalr.c (initialize_lookaheads): Split into...
518 (states_lookaheads_count, states_lookaheads_initialize): these.
519 (lalr): Adjust.
520
9757c359
AD
5212002-06-15 Akim Demaille <akim@epita.fr>
522
523 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
524 out of...
525 (grammar_rules_print): here.
526 * src/reduce.c (reduce_output): Use it.
527 * tests/reduce.at (Useless Rules, Reduced Automaton)
528 (Underivable Rules): Adjust.
529
6b98e4b5
AD
5302002-06-15 Akim Demaille <akim@epita.fr>
531
532 Copy BYacc's nice way to report the grammar.
533
534 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
535 New.
536 Don't print the rules' location, it is confusing and useless.
537 (rule_print): Use grammar_rhs_print.
538 * src/print.c (print_grammar): Use grammar_rules_print.
539
6b98e4b5
AD
5402002-06-15 Akim Demaille <akim@epita.fr>
541
542 Complete and rationalize `useless thing' warnings.
543
544 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
545 (symbol_tag_print): New.
546 Use them everywhere in place of accessing directly the tag member.
547 * src/gram.h, src/gram.c (rule_print): New.
548 Use it where a rule used to be printed `by hand'.
549 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
550 (reduce_grammar_tables): Report the useless rules.
551 (reduce_print): Useless things are a warning, not an error.
552 Report it as such.
553 * tests/reduce.at (Useless Nonterminals, Useless Rules):
554 (Reduced Automaton, Underivable Rules): Adjust.
555 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
556 * tests/conflicts.at (Unresolved SR Conflicts)
557 (Solved SR Conflicts): Adjust.
558
ee000ba4
AD
5592002-06-15 Akim Demaille <akim@epita.fr>
560
561 Let symbols have a location.
562
563 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
564 (getsym): Adjust.
565 Adjust all callers.
566 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
567 Use location_t, not int.
568 * src/symtab.c (symbol_check_defined): Take advantage of the
569 location.
570 * tests/regression.at (Invalid inputs): Adjust.
571
8efe435c
AD
5722002-06-15 Akim Demaille <akim@epita.fr>
573
574 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
575 (input): Don't try to initialize yylloc here, do it in the
576 scanner.
577 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
578 * src/gram.h (rule_t): Change line and action_line into location
579 and action_location, of location_t type.
580 Adjust all dependencies.
581 * src/location.h, src/location.c (empty_location): New.
582 * src/reader.h, src/reader.c (grammar_start_symbol_set)
583 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
584 (grammar_current_rule_symbol_append)
585 (grammar_current_rule_action_append): Expect a location as argument.
586 * src/reader.c (grammar_midrule_action): Adjust to attach an
587 action's location as dummy symbol location.
588 * src/symtab.h, src/symtab.c (startsymbol_location): New.
589 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
590 the line numbers.
591
1921f1d7
AD
5922002-06-14 Akim Demaille <akim@epita.fr>
593
594 Grammar declarations may be found in the grammar section.
595
596 * src/parse-gram.y (rules_or_grammar_declaration): New.
597 (declarations): Each declaration may end with a semicolon, not
598 just...
599 (grammar_declaration): `"%union"'.
600 (grammar): Branch to rules_or_grammar_declaration.
601
4515534c
AD
6022002-06-14 Akim Demaille <akim@epita.fr>
603
604 * src/main.c (main): Invoke scanner_free.
605
f958596b
AD
6062002-06-14 Akim Demaille <akim@epita.fr>
607
608 * src/output.c (m4_invoke): Extracted from...
609 (output_skeleton): here.
610 Free tempfile.
611
2c569025
AD
6122002-06-14 Akim Demaille <akim@epita.fr>
613
614 * src/parse-gram.y (directives, directive, gram)
615 (grammar_directives, precedence_directives, precedence_directive):
616 Rename as...
617 (declarations, declaration, grammar, grammar_declaration)
618 (precedence_declaration, precedence_declarator): these.
619 (symbol_declaration): New.
620
592e8d4d
AD
6212002-06-14 Akim Demaille <akim@epita.fr>
622
623 * src/files.c (action_obstack): Remove, unused.
624 (output_obstack): Remove it, and all its dependencies, as it is no
625 longer needed.
626 * src/reader.c (epilogue_set): Build the epilogue in the
627 muscle_obstack.
628 * src/output.h, src/output.c (muscle_obstack): Move to...
629 * src/muscle_tab.h, src/muscle_tab.h: here.
630 (muscle_init): Initialize muscle_obstack.
631 (muscle_free): New.
632 * src/main.c (main): Call it.
633
0c15323d
AD
6342002-06-14 Akim Demaille <akim@epita.fr>
635
636 * src/location.h: New, extracted from...
637 * src/reader.h: here.
638 * src/Makefile.am (noinst_HEADERS): Merge into
639 (bison_SOURCES): this.
640 Add location.h.
641 * src/parse-gram.y: Use location_t instead of Bison's.
642 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
643 Use location_t instead of ints.
644
e96c9728
AD
6452002-06-14 Akim Demaille <akim@epita.fr>
646
647 * data/bison.simple, data/bison.c++: Be sure to restore the
648 current #line when returning to the skeleton contents after having
649 exposed the input file's #line.
650
75d1fe16
AD
6512002-06-12 Akim Demaille <akim@epita.fr>
652
653 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
654 eager.
655 * tests/actions.at (Exotic Dollars): New.
656
6c35d22c
AD
6572002-06-12 Akim Demaille <akim@epita.fr>
658
659 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
660 ['"/] too eagerly.
661 * tests/input.at (Torturing the Scanner): New.
662
1d6412ad
AD
6632002-06-11 Akim Demaille <akim@epita.fr>
664
665 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
666 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
667 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
668 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
669 * src/reader.c (reader): Use it.
670
4cdb01db
AD
6712002-06-11 Akim Demaille <akim@epita.fr>
672
673 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
674 Adjust all callers.
675 (scanner_last_string_free): New.
676
44995b2e
AD
6772002-06-11 Akim Demaille <akim@epita.fr>
678
679 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
680 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
681 (last_string, YY_OBS_FREE): New.
682 Use them when returning an ID.
683
e9955c83
AD
6842002-06-11 Akim Demaille <akim@epita.fr>
685
686 Have Bison grammars parsed by a Bison grammar.
687
688 * src/reader.c, src/reader.h (prologue_augment): New.
689 * src/reader.c (copy_definition): Remove.
690
691 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
692 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
693 (grammar_current_rule_prec_set, grammar_current_rule_check)
694 (grammar_current_rule_symbol_append)
695 (grammar_current_rule_action_append): Export.
696 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
697 (symbol_list_action_append): Remove.
698 Hook the routines from reader.
699 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
700 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
701
702 * src/reader.c (read_declarations): Remove, unused.
703
704 * src/parse-gram.y: Handle the epilogue.
705 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
706 (grammar_start_symbol_set): this.
707 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
708 * src/reader.c (readgram): Remove, unused.
709 (reader): Adjust to insert eoftoken and axiom where appropriate.
710
711 * src/reader.c (copy_dollar): Replace with...
712 * src/scan-gram.h (handle_dollar): this.
713 * src/parse-gram.y: Remove `%thong'.
714
715 * src/reader.c (copy_at): Replace with...
716 * src/scan-gram.h (handle_at): this.
717
718 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
719 New.
720
721 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
722 time being.
723
724 * src/reader.h, src/reader.c (grammar_rule_end): New.
725
726 * src/parse.y (current_type, current_class): New.
727 Implement `%nterm', `%token' support.
728 Merge `%term' into `%token'.
729 (string_as_id): New.
730 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
731 type name.
732
733 * src/parse-gram.y: Be sure to handle properly the beginning of
734 rules.
735
736 * src/parse-gram.y: Handle %type.
737 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
738
739 * src/parse-gram.y: More directives support.
740 * src/options.c: No longer handle source directives.
741
742 * src/parse-gram.y: Fix %output.
743
744 * src/parse-gram.y: Handle %union.
745 Use the prologue locations.
746 * src/reader.c (parse_union_decl): Remove.
747
748 * src/reader.h, src/reader.c (epilogue_set): New.
749 * src/parse-gram.y: Use it.
750
751 * data/bison.simple, data/bison.c++: b4_stype is now either not
752 defined, then default to int, or to the contents of %union,
753 without `union' itself.
754 Adjust.
755 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
756
757 * src/output.c (actions_output): Don't output braces, as they are
758 already handled by the scanner.
759
760 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
761 characters to themselves.
762
763 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
764 that the epilogue has a proper #line.
765
766 * src/parse-gram.y: Handle precedence/associativity.
767
768 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
769 a terminal.
770 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
771 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
772 at all to define terminals that cannot be emitted.
773
774 * src/scan-gram.l: Escape M4 characters.
775
776 * src/scan-gram.l: Working properly with escapes in user
777 strings/characters.
778
779 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
780 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
781 grammar.
782 Use more modest sizes, as for the time being the parser does not
783 release memory, and therefore the process swallows a huge amount
784 of memory.
785
786 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
787 stricter %token grammar.
788
789 * src/symtab.h (associativity): Add `undef_assoc'.
790 (symbol_precedence_set): Do nothing when passed an undef_assoc.
791 * src/symtab.c (symbol_check_alias_consistence): Adjust.
792
793 * tests/regression.at (Invalid %directive): Remove, as it is now
794 meaningless.
795 (Invalid inputs): Adjust to the new error messages.
796 (Token definitions): The new grammar doesn't allow too many
797 eccentricities.
798
799 * src/lex.h, src/lex.c: Remove.
800 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
801 (copy_character, copy_string2, copy_string, copy_identifier)
802 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
803 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
804 (parse_action): Remove.
805 * po/POTFILES.in: Adjust.
806
2e047461
AD
8072002-06-11 Akim Demaille <akim@epita.fr>
808
809 * src/reader.c (parse_action): Don't store directly into the
810 rule's action member: return the action as a string.
811 Don't require `rule_length' as an argument: compute it.
812 (grammar_current_rule_symbol_append)
813 (grammar_current_rule_action_append): New, eved out from
814 (readgram): here.
815 Remove `action_flag', `rulelength', unused now.
816
9af3fbce
AD
8172002-06-11 Akim Demaille <akim@epita.fr>
818
819 * src/reader.c (grammar_current_rule_prec_set).
820 (grammar_current_rule_check): New, eved out from...
821 (readgram): here.
822 Remove `xaction', `first_rhs': useless.
823 * tests/input.at (Type clashes): New.
824 * tests/existing.at (GNU Cim Grammar): Adjust.
825
1485e106
AD
8262002-06-11 Akim Demaille <akim@epita.fr>
827
828 * src/reader.c (grammar_midrule_action): New, Eved out from
829 (readgram): here.
830
da4160c3
AD
8312002-06-11 Akim Demaille <akim@epita.fr>
832
833 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
834 New.
835 (readgram): Use them as replacement of inlined code, crule and
836 crule1.
837
f6d0f937
AD
8382002-06-11 Akim Demaille <akim@epita.fr>
839
840 * src/reader.c (grammar_end, grammar_symbol_append): New.
841 (readgram): Use them.
842 Make the use of `p' as local as possible.
843
69078d4b
AD
8442002-06-10 Akim Demaille <akim@epita.fr>
845
846 GCJ's parser requires the tokens to be defined before the prologue.
847
848 * data/bison.simple: Output the token definition before the user's
849 prologue.
850 * tests/regression.at (Braces parsing, Duplicate string)
851 (Mixing %token styles): Check the output from bison.
852 (Early token definitions): New.
853
5e424082
AD
8542002-06-10 Akim Demaille <akim@epita.fr>
855
856 * src/symtab.c (symbol_user_token_number_set): Don't complain when
857 assigning twice the same user number to a token, so that we can
858 use it in...
859 * src/lex.c (lex): here.
860 Also use `symbol_class_set' instead of hand written code.
861 * src/reader.c (parse_assoc_decl): Likewise.
862
44536b35
AD
8632002-06-10 Akim Demaille <akim@epita.fr>
864
865 * src/symtab.c, src/symtab.c (symbol_class_set)
866 (symbol_user_token_number_set): New.
867 * src/reader.c (parse_token_decl): Use them.
868 Use a switch instead of ifs.
869 Use a single argument.
870
8b9f2372
AD
8712002-06-10 Akim Demaille <akim@epita.fr>
872
873 Remove `%thong' support as it is undocumented, unused, duplicates
874 `%token's job, and creates useless e-mail traffic with people who
875 want to know what it is, why it is undocumented, unused, and
876 duplicates `%token's job.
877
878 * src/reader.c (parse_thong_decl): Remove.
879 * src/options.c (option_table): Remove "thong".
880 * src/lex.h (tok_thong): Remove.
881
3ae2b51f
AD
8822002-06-10 Akim Demaille <akim@epita.fr>
883
884 * src/symtab.c, src/symtab.c (symbol_type_set)
885 (symbol_precedence_set): New.
886 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
887 (value_components_used): Remove, unused.
888
2f1afb73
AD
8892002-06-09 Akim Demaille <akim@epita.fr>
890
891 Move symbols handling code out of the reader.
892
893 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
894 (axiom): Move to...
895 * src/symtab.h, src/symtab.c: here.
896
897 * src/gram.c (start_symbol): Remove: use startsymbol->number.
898 * src/reader.c (startval): Rename as...
899 * src/symtab.h, src/symtab.c (startsymbol): this.
900 * src/reader.c: Adjust.
901
902 * src/reader.c (symbol_check_defined, symbol_make_alias)
903 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
904 (token_translations_init)
905 Move to...
906 * src/symtab.c: here.
907 * src/reader.c (packsymbols): Move to...
908 * src/symtab.h, src/symtab.c (symbols_pack): here.
909 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
910 argument.
911
e9bca3ad
AD
9122002-06-03 Akim Demaille <akim@epita.fr>
913
914 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
915 then statements.
916
86eff183
AD
9172002-06-03 Akim Demaille <akim@epita.fr>
918
919 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
920 structs with non literals.
921 * src/scan-skel.l: never-interactive.
922 * src/conflicts.c (enum conflict_resolution_e): No trailing
923 comma.
924 * src/getargs.c (usage): Split long literal strings.
925 Reported by Hans Aberg.
926
717be197
AD
9272002-05-28 Akim Demaille <akim@epita.fr>
928
929 * data/bison.c++: Use C++ ostreams.
930 (cdebug_): New member.
931
670ddffd
AD
9322002-05-28 Akim Demaille <akim@epita.fr>
933
934 * src/output.c (output_skeleton): Be sure to allocate enough room
935 for `/' _and_ for `\0' in full_skeleton.
936
769b430f
AD
9372002-05-28 Akim Demaille <akim@epita.fr>
938
939 * data/bison.c++: Catch up with bison.simple:
940 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
941 and Paul Eggert <eggert@twinsun.com>: `error' handing.
942 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
943 and popping traces.
944
7067cb36
PH
9452002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
946
947 * src/output.c (output_skeleton): Put an explicit path in front of
948 the skeleton file name, rather than relying on the -I directory,
949 to partially alleviate effects of having a skeleton file lying around
950 in the current directory.
769b430f 951
4a713ec2
PH
9522002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
953
769b430f 954 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
955 obstack_printf should be obstack_fgrow1.
956
b408954b
AD
9572002-05-26 Akim Demaille <akim@epita.fr>
958
959 * src/state.h (state_t): `solved_conflicts' is a new member.
960 * src/LR0.c (new_state): Set it to 0.
961 * src/conflicts.h, src/conflicts.c (print_conflicts)
962 (free_conflicts, solve_conflicts): Rename as...
963 (conflicts_print, conflicts_free, conflicts_solve): these.
964 Adjust callers.
965 * src/conflicts.c (enum conflict_resolution_e)
966 (solved_conflicts_obstack): New, used by...
967 (log_resolution): this.
968 Adjust to attach the conflict resolution to each state.
969 Complete the description with the precedence/associativity
970 information.
971 (resolve_sr_conflict): Adjust.
972 * src/print.c (print_state): Output its solved_conflicts.
973 * tests/conflicts.at (Unresolved SR Conflicts)
974 (Solved SR Conflicts): Exercise --report=all.
975
a49aecd5
AD
9762002-05-26 Akim Demaille <akim@epita.fr>
977
978 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
979 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
980 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
981 (token_number_t, item_number_as_token_number)
982 (token_number_as_item_number, muscle_insert_token_number_table):
983 Rename as...
984 (symbol_number_t, item_number_as_symbol_number)
985 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
986 these, since it is more appropriate.
987
5504898e
AD
9882002-05-26 Akim Demaille <akim@epita.fr>
989
990 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
991 `Error:' lines.
992 * data/bison.simple (yystos) [YYDEBUG]: New.
993 (yyparse) [YYDEBUG]: Display the symbols which are popped during
994 error recovery.
995 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
996
ec3bc396
AD
9972002-05-25 Akim Demaille <akim@epita.fr>
998
999 * doc/bison.texinfo (Debugging): Split into...
1000 (Tracing): this new section, its former contents, and...
1001 (Understanding): this new section.
1002 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1003 by...
1004 (report_flag): this.
1005 Adjust all dependencies.
1006 (report_args, report_types, report_argmatch): New.
1007 (usage, getargs): Report/support -r, --report.
1008 * src/options.h
1009 (struct option_table_struct): Rename as..,
1010 (struct option_table_s): this.
1011 Rename the `set_flag' member to `flag' to match with getopt_long's
1012 struct.
1013 * src/options.c (option_table): Split verbose into an entry for
1014 %verbose, and another for --verbose.
1015 Support --report/-r, so remove -r from the obsolete --raw.
1016 * src/print.c: Attach full item sets and lookaheads reports to
1017 report_flag instead of trace_flag.
1018 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1019
78df8250
PE
10202002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1021 and Paul Eggert <eggert@twinsun.com>
769b430f 1022
78df8250
PE
1023 * data/bison.simple (yyparse): Correct error handling to conform to
1024 POSIX and yacc. Specifically, after syntax error is discovered,
1025 do not reduce further before shifting the error token.
1026 Clean up the code a bit by removing the labels yyerrdefault,
1027 yyerrhandle, yyerrpop.
1028 * NEWS: Document the above.
1029
c0c9ea05
PH
10302002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1031
1032 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1033 type; it isn't always big enough, since it doesn't necessarily
1034 include non-terminals.
769b430f 1035 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
1036 the latter can be removed.
1037 (yy_token_number_type): Remove, only one use.
1038 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1039 don't use TokenNumberType as element type.
769b430f 1040
c0c9ea05
PH
1041 * tests/regression.at: Modify expected output to agree with change
1042 to yyr1 and yytranslate.
769b430f 1043
6390a83f
FK
10442002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1045
1046 * src/reader.c (parse_action): Use copy_character instead of
1047 obstack_1grow.
1048
db7c8e9a
AD
10492002-05-13 Akim Demaille <akim@epita.fr>
1050
1051 * tests/regression.at (Token definitions): Prototype yylex and
1052 yyerror.
1053
fcc61800
PH
10542002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1055
158c687b 1056 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
1057 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1058 32-bit arithmetic.
1059 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1060
5683e9b2
AD
10612002-05-07 Akim Demaille <akim@epita.fr>
1062
1063 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1064 avoid GCC warnings.
1065
0c2d3f4c
AD
10662002-05-07 Akim Demaille <akim@epita.fr>
1067
1068 Kill GCC warnings.
1069
1070 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1071 over the RHS of each rule.
1072 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1073 * src/state.h (state_t): Member `nitems' is unsigned short.
1074 * src/LR0.c (get_state): Adjust.
1075 * src/reader.c (packgram): Likewise.
1076 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1077 `Type'.
1078 (muscle_insert_int_table): Remove, unused.
1079 (prepare_rules): Remove `max'.
1080
1565b720
AD
10812002-05-06 Akim Demaille <akim@epita.fr>
1082
1083 * src/closure.c (print_firsts): Display of the symbol tags.
1084 (bitmatrix_print): Move to...
1085 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1086 here.
1087 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1088
cfaee611
AD
10892002-05-06 Akim Demaille <akim@epita.fr>
1090
1091 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1092 hash_do_for_each.
1093
458be8e0
AD
10942002-05-06 Akim Demaille <akim@epita.fr>
1095
1096 * src/LR0.c (new_state, get_state): Instead of using the global
1097 `kernel_size' and `kernel_base', have two new arguments:
1098 `core_size' and `core'.
1099 Adjust callers.
1100
a900a624
AD
11012002-05-06 Akim Demaille <akim@epita.fr>
1102
1103 * src/reader.c (packgram): No longer end `ritem' with a 0
1104 sentinel: it is not used.
1105
d4e7d3a1
AD
11062002-05-05 Akim Demaille <akim@epita.fr>
1107
1108 New experimental feature: display the lookaheads in the report and
1109 graph.
1110
1111 * src/print (print_core): When --trace-flag, display the rules
1112 lookaheads.
1113 * src/print_graph.c (print_core): Likewise.
1114 Swap the arguments.
1115 Adjust caller.
1116
39ceb25b
AD
11172002-05-05 Akim Demaille <akim@epita.fr>
1118
1119 * tests/torture.at (Many lookaheads): New test.
1120
5372019f
AD
11212002-05-05 Akim Demaille <akim@epita.fr>
1122
1123 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1124 (GENERATE_MUSCLE_INSERT_TABLE): this.
1125 (output_int_table, output_unsigned_int_table, output_short_table)
1126 (output_token_number_table, output_item_number_table): Replace with...
1127 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1128 (muscle_insert_short_table, muscle_insert_token_number_table)
1129 (muscle_insert_item_number_table): these.
1130 Adjust all callers.
1131 (prepare_tokens): Don't free `translations', since...
1132 * src/reader.h, src/reader.c (grammar_free): do it.
1133 Move to...
1134 * src/gram.h, src/gram.c (grammar_free): here.
1135 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1136 b4_translate_max.
1137
5df5f6d5
AD
11382002-05-05 Akim Demaille <akim@epita.fr>
1139
1140 * src/output.c (output_unsigned_int_table): New.
1141 (prepare_rules): `i' is unsigned.
1142 `prhs', `rline', `r2' are unsigned int.
1143 Rename muscle `rhs_number_max' as `rhs_max'.
1144 Output muscles `prhs_max', `rline_max', and `r2_max'.
1145 Free rline and r1.
1146 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1147 to compute types instead of constant types.
1148 * tests/regression.at (Web2c Actions): Adjust.
1149
b87f8b21
AD
11502002-05-04 Akim Demaille <akim@epita.fr>
1151
1152 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1153 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1154 Adjust dependencies.
1155 * src/output.c (token_definitions_output): Be sure not to output a
1156 `#define 'a'' when fed with `%token 'a' "a"'.
1157 * tests/regression.at (Token definitions): New.
1158
8bb936e4
PE
11592002-05-03 Paul Eggert <eggert@twinsun.com>
1160
1161 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1162 for K&R C.
1163
11642002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1165
1166 * Makefile.am (SUBDIRS): Remove intl.
1167 (EXTRA_DIST): Add config/config.rpath.
1168
53c71a12
AD
11692002-05-03 Akim Demaille <akim@epita.fr>
1170
1171 * data/bison.simple (m4_if): Don't output empty enums.
1172 And actually, output valid enum definitions :(.
1173
289dd0cf
AD
11742002-05-03 Akim Demaille <akim@epita.fr>
1175
1176 * configure.bat: Remove, completely obsolete.
1177 * Makefile.am (EXTRA_DIST): Adjust.
1178 Don't distribute config.rpath...
1179 * config/Makefile.am (EXTRA_DIST): Do it.
1180
db85e524
AD
11812002-05-03 Akim Demaille <akim@epita.fr>
1182
1183 * configure.in (GETTEXT_VERSION): New.
1184 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1185
83ccf991
AD
11862002-05-03 Akim Demaille <akim@epita.fr>
1187
1188 * data/bison.simple (b4_token_enum): New.
1189 (b4_token_defines): Use it to output tokens both as #define and
1190 enums.
1191 Suggested by Paul Eggert.
1192 * src/output.c (token_definitions_output): Don't output spurious
1193 white spaces.
1194
1f418995
AD
11952002-05-03 Akim Demaille <akim@epita.fr>
1196
1197 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1198
45119f04
RA
11992002-05-02 Robert Anisko <robert@lrde.epita.fr>
1200
1201 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1202 Update the stack class, give a try to deque as the default container.
1203
b2d52318
AD
12042002-05-02 Akim Demaille <akim@epita.fr>
1205
1206 * data/bison.simple (yyparse): Do not implement @$ = @1.
1207 (YYLLOC_DEFAULT): Adjust to do it.
1208 * doc/bison.texinfo (Location Default Action): Fix.
1209
3a8b4109
AD
12102002-05-02 Akim Demaille <akim@epita.fr>
1211
1212 * src/reader.c (parse_braces): Merge into...
1213 (parse_action): this.
1214
84614e13
AD
12152002-05-02 Akim Demaille <akim@epita.fr>
1216
1217 * configure.in (ALL_LINGUAS): Remove.
1218 * po/LINGUAS, hr.po: New.
1219
fdbcd8e2
AD
12202002-05-02 Akim Demaille <akim@epita.fr>
1221
1222 Remove the so called hairy (semantic) parsers.
1223
1224 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1225 * src/gram.h, src/gram.c (semantic_parser): Remove.
1226 (rule_t): Remove the guard and guard_line members.
1227 * src/lex.h (token_t): remove tok_guard.
1228 * src/options.c (option_table): Remove %guard and %semantic_parser
1229 support.
1230 * src/output.c, src/output.h (guards_output): Remove.
1231 (prepare): Adjust.
1232 (token_definitions_output): Don't output the `T'
1233 tokens (???).
1234 (output_skeleton): Don't output the guards.
1235 * src/files.c, src/files.c (attrsfile): Remove.
1236 * src/reader.c (symbol_list): Remove the guard and guard_line
1237 members.
1238 Adjust dependencies.
1239 (parse_guard): Remove.
1240 * data/bison.hairy: Remove.
1241 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1242 BISON_HAIRY.
1243
82b6cb3f
AD
12442002-05-02 Akim Demaille <akim@epita.fr>
1245
1246 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1247 (parse_guard): Rename the formal argument `stack_offset' as
1248 `rule_length', which is more readable.
1249 Adjust callers.
1250 (copy_at, copy_dollar): Instead of outputting the hard coded
1251 values of $$, $n and so forth, output invocation to b4_lhs_value,
1252 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
1253 Note: this patch partially drops `semantic-parser' support: it
1254 always does `rule_length - n', where semantic parsers ought to
1255 always use `-n'.
82b6cb3f
AD
1256 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1257 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1258
6cbfbcc5
AD
12592002-05-02 Akim Demaille <akim@epita.fr>
1260
1261 * configure.in (AC_INIT): Bump to 1.49b.
1262 (AM_INIT_AUTOMAKE): Short invocation.
1263
b8548114
AD
12642002-05-02 Akim Demaille <akim@epita.fr>
1265
1266 Version 1.49a.
1267
c20cd1fa
AD
12682002-05-01 Akim Demaille <akim@epita.fr>
1269
1270 * src/skeleton.h: Remove.
1271
8a9566d4
AD
12722002-05-01 Akim Demaille <akim@epita.fr>
1273
1274 * src/skeleton.h: Fix the #endif.
1275 Reported by Magnus Fromreide.
1276
8c6d399a
PE
12772002-04-26 Paul Eggert <eggert@twinsun.com>
1278
1279 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1280 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 1281 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 1282
2b7ed18a
RA
12832002-04-25 Robert Anisko <robert@lrde.epita.fr>
1284
1285 * src/scan-skel.l: Postprocess quadrigraphs.
1286
1287 * src/reader.c (copy_character): New function, used to output
1288 single characters while replacing `[' and `]' with quadrigraphs, to
1289 avoid troubles with M4 quotes.
1290 (copy_comment): Output characters with copy_character.
1291 (read_additionnal_code): Likewise.
1292 (copy_string2): Likewise.
1293 (copy_definition): Likewise.
1294
1295 * tests/calc.at: Exercise M4 quoting.
1296
34a89c50
AD
12972002-04-25 Akim Demaille <akim@epita.fr>
1298
1299 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1300 between `!' and the command.
1301 Reported by Paul Eggert.
1302
0dd1580a
RA
13032002-04-24 Robert Anisko <robert@lrde.epita.fr>
1304
1305 * tests/calc.at: Exercise prologue splitting.
1306
1307 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1308 `b4_post_prologue' instead of `b4_prologue'.
1309
1310 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1311 muscles.
1312 (output): Free pre_prologue_obstack and post_prologue_obstack.
1313 * src/files.h, src/files.c (attrs_obstack): Remove.
1314 (pre_prologue_obstack, post_prologue_obstack): New.
1315 * src/reader.c (copy_definition): Add a parameter to specify the
1316 obstack to fill, instead of using attrs_obstack unconditionally.
1317 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1318 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1319
83c1796f
PE
13202002-04-23 Paul Eggert <eggert@twinsun.com>
1321
1322 * data/bison.simple: Remove unnecessary commentary and white
1323 space differences from 1_29-branch.
1324 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1325
1326 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1327 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1328 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1329 constructors or destructors.
1330
1331 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1332
1207eeac
AD
13332002-04-23 Akim Demaille <akim@epita.fr>
1334
1335 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1336 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1337 location with columns.
1338 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1339 All reported by Paul Eggert.
1340
78ab8f67
AD
13412002-04-22 Akim Demaille <akim@epita.fr>
1342
1343 * src/reduce.c (dump_grammar): Move to...
1344 * src/gram.h, src/gram.c (grammar_dump): here.
1345 Be sure to separate long item numbers.
1346 Don't read the members of a rule's prec if its nil.
1347
133c20e2
AD
13482002-04-22 Akim Demaille <akim@epita.fr>
1349
1350 * src/output.c (table_size, table_grow): New.
1351 (MAXTABLE): Remove, replace uses with table_size.
1352 (pack_vector): Instead of dying when the table is too big, grow it.
1353
9515e8a7
AD
13542002-04-22 Akim Demaille <akim@epita.fr>
1355
1356 * data/bison.simple (yyr1): Its type is that of a token number.
1357 * data/bison.c++ (r1_): Likewise.
1358 * tests/regression.at (Web2c Actions): Adjust.
1359
23c5a174
AD
13602002-04-22 Akim Demaille <akim@epita.fr>
1361
1362 * src/reader.c (token_translations_init): 256 is now the default
1363 value for the error token, i.e., it will be assigned another
1364 number if the user assigned 256 to one of her tokens.
1365 (reader): Don't force 256 to error.
1366 * doc/bison.texinfo (Symbols): Adjust.
1367 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1368 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1369 etc. instead of 10, 20, 30 (which was used to `jump' over error
1370 (256) and undefined (2)).
1371
5fbb0954
AD
13722002-04-22 Akim Demaille <akim@epita.fr>
1373
1374 Propagate more token_number_t.
1375
1376 * src/gram.h (token_number_as_item_number)
1377 (item_number_as_token_number): New.
1378 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1379 Use it to create output_item_number_table and
1380 output_token_number_table.
1381 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1382 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1383 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1384 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1385
4f940944
AD
13862002-04-22 Akim Demaille <akim@epita.fr>
1387
1388 * src/output.h, src/output.c (get_lines_number): Remove.
1389
3ded9a63
AD
13902002-04-19 Akim Demaille <akim@epita.fr>
1391
1392 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1393 as Lex/Flex'.
1394 (Debugging): More details about enabling the debugging features.
1395 (Table of Symbols): Describe $$, $n, @$, and @n.
1396 Suggested by Tim Josling.
1397
e0c471a9
AD
13982002-04-19 Akim Demaille <akim@epita.fr>
1399
1400 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1401
fecc10cd
AD
14022002-04-10 Akim Demaille <akim@epita.fr>
1403
1404 * src/system.h: Rely on HAVE_LIMITS_H.
1405 Suggested by Paul Eggert.
1406
51dec47b
AD
14072002-04-09 Akim Demaille <akim@epita.fr>
1408
1409 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1410 full stderr, and strip it according to the bison options, instead
1411 of composing the error message from different bits.
1412 This makes it easier to check for several error messages.
1413 Adjust all the invocations.
1414 Add an invocation exercising the error token.
1415 Add an invocation demonstrating a stupid error message.
1416 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1417 Adjust the tests.
1418 Error message are for stderr, not stdout.
1419
007a50a4
AD
14202002-04-09 Akim Demaille <akim@epita.fr>
1421
1422 * src/gram.h, src/gram.c (error_token_number): Remove, use
1423 errtoken->number.
1424 * src/reader.c (reader): Don't specify the user token number (2)
1425 for $undefined, as it uselessly prevents using it.
1426 * src/gram.h (token_number_t): Move to...
1427 * src/symtab.h: here.
1428 (state_t.number): Is a token_number_t.
1429 * src/print.c, src/reader.c: Use undeftoken->number instead of
1430 hard coded 2.
1431 (Even though this 2 is not the same as above: the number of the
1432 undeftoken remains being 2, it is its user token number which
1433 might not be 2).
1434 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1435 `user_token_number_max'.
1436 Output `undef_token_number'.
1437 * data/bison.simple, data/bison.c++: Use them.
1438 Be sure to map invalid yylex return values to
1439 `undef_token_number'. This saves us from gratuitous SEGV.
1440
1441 * tests/conflicts.at (Solved SR Conflicts)
1442 (Unresolved SR Conflicts): Adjust.
1443 * tests/regression.at (Web2c Actions): Adjust.
1444
06446ccf
AD
14452002-04-08 Akim Demaille <akim@epita.fr>
1446
1447 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1448 Adding #line.
1449 Remove the duplicate `typedefs'.
1450 (RhsNumberType): Fix the declaration and various other typos.
1451 Use __ofile__.
1452 * data/bison.simple: Use __ofile__.
1453 * src/scan-skel.l: Handle __ofile__.
1454
62a3e4f0
AD
14552002-04-08 Akim Demaille <akim@epita.fr>
1456
1457 * src/gram.h (item_number_t): New, the type of item numbers in
1458 RITEM. Note that it must be able to code symbol numbers as
1459 positive number, and the negation of rule numbers as negative
1460 numbers.
1461 Adjust all dependencies (pretty many).
1462 * src/reduce.c (rule): Remove this `short *' pointer: use
1463 item_number_t.
1464 * src/system.h (MINSHORT, MAXSHORT): Remove.
1465 Include `limits.h'.
1466 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1467 (shortcpy): Remove.
1468 (MAXTABLE): Move to...
1469 * src/output.c (MAXTABLE): here.
1470 (prepare_rules): Use output_int_table to output rhs.
1471 * data/bison.simple, data/bison.c++: Adjust.
1472 * tests/torture.at (Big triangle): Move the limit from 254 to
1473 500.
1474 * tests/regression.at (Web2c Actions): Ajust.
1475
1476 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1477 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1478 passes, but produces negative #line number, once fixed, GCC is
1479 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1480 C), it passes.
1481 * src/state.h (state_h): Code input lines on ints, not shorts.
1482
bb88b0fc
AD
14832002-04-08 Akim Demaille <akim@epita.fr>
1484
1485 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1486 and then the grammar.
1487
9a636f47
AD
14882002-04-08 Akim Demaille <akim@epita.fr>
1489
1490 * src/system.h: No longer using strndup.
1491
680e8701
AD
14922002-04-07 Akim Demaille <akim@epita.fr>
1493
1494 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1495 * src/output.c (output_table_data): Return the longest number.
1496 (prepare_tokens): Output `token_number_max').
1497 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1498 New.
1499 Use them to define yy_token_number_type/TokenNumberType.
1500 Use this type for yytranslate.
1501 * tests/torture.at (Big triangle): Push the limit from 124 to
1502 253.
1503 * tests/regression.at (Web2c Actions): Adjust.
1504
817e9f41
AD
15052002-04-07 Akim Demaille <akim@epita.fr>
1506
1507 * tests/torture.at (Big triangle): New.
1508 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1509 * tests/existing.at: here.
1510
5123689b
AD
15112002-04-07 Akim Demaille <akim@epita.fr>
1512
1513 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1514 nritems.
1515 Adjust dependencies.
1516
f3849179
AD
15172002-04-07 Akim Demaille <akim@epita.fr>
1518
1519 * src/reader.c: Normalize increments to prefix form.
1520
bd02036a
AD
15212002-04-07 Akim Demaille <akim@epita.fr>
1522
1523 * src/reader.c, symtab.c: Remove debugging code.
1524
db8837cb
AD
15252002-04-07 Akim Demaille <akim@epita.fr>
1526
1527 Rename all the `bucket's as `symbol_t'.
1528
1529 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1530 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1531 * src/symtab.c, src/symtab.h (bucket): Rename as...
1532 (symbol_t): this.
1533 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1534 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1535 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1536 (buckets_new, buckets_free, buckets_do): Rename as...
1537 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1538 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1539 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1540 (symbols_new, symbols_free, symbols_do): these.
1541
72a23c97
AD
15422002-04-07 Akim Demaille <akim@epita.fr>
1543
1544 Use lib/hash for the symbol table.
1545
1546 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1547 EOF.
1548 * src/lex.c (lex): Set the `number' member of new terminals.
1549 * src/reader.c (bucket_check_defined, bucket_make_alias)
1550 (bucket_check_alias_consistence, bucket_translation): New.
1551 (reader, grammar_free, readgram, token_translations_init)
1552 (packsymbols): Adjust.
1553 (reader): Number the predefined tokens.
1554 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1555 for predefined tokens.
1556 * src/symtab.h (bucket): Remove all the hash table related
1557 members.
1558 * src/symtab.c (symtab): Replace by...
1559 (bucket_table): this.
1560 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1561 (buckets_new, buckets_do): New.
1562
280a38c3
AD
15632002-04-07 Akim Demaille <akim@epita.fr>
1564
1565 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1566 (start_symbol, max_user_token_number, semantic_parser)
1567 (error_token_number): Initialize.
1568 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1569 Initialize.
1570 (reader): Don't.
1571 (errtoken, eoftoken, undeftoken, axiom): Extern.
1572
03b31c0c
AD
15732002-04-07 Akim Demaille <akim@epita.fr>
1574
1575 * src/gram.h (rule_s): prec and precsym are now pointers
1576 to the bucket giving the priority/associativity.
1577 Member `associativity' removed: useless.
1578 * src/reduce.c, src/conflicts.c: Adjust.
1579
8b3df748
AD
15802002-04-07 Akim Demaille <akim@epita.fr>
1581
1582 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1583 Properly escape the symbols' TAG when outputting them.
1584
e601aa1d
AD
15852002-04-07 Akim Demaille <akim@epita.fr>
1586
1587 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1588
b0299a2e
AD
15892002-04-07 Akim Demaille <akim@epita.fr>
1590
1591 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1592 (LArule): this, which is an array to rule_t*.
1593 * src/print.c, src/conflicts.c: Adjust.
1594
d7e1f00c
AD
15952002-04-07 Akim Demaille <akim@epita.fr>
1596
1597 * src/gram.h (rule_t): Rename `number' as `user_number'.
1598 `number' is a new member.
1599 Adjust dependencies.
1600 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1601
cc9305dd
AD
16022002-04-07 Akim Demaille <akim@epita.fr>
1603
1604 As a result of the previous patch, it is no longer needed
1605 to reorder ritem itself.
1606
1607 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1608
b0940840
AD
16092002-04-07 Akim Demaille <akim@epita.fr>
1610
1611 Be sure never to walk through RITEMS, but use only data related to
1612 the rules themselves. RITEMS should be banished.
1613
1614 * src/output.c (output_token_translations): Rename as...
1615 (prepare_tokens): this.
1616 In addition to `translate', prepare the muscles `tname' and
1617 `toknum', which were handled by...
1618 (output_rule_data): this.
1619 Remove, and move the remainder of its outputs into...
1620 (prepare_rules): this new routines, which also merges content from
1621 (output_gram): this.
1622 (prepare_rules): Be sure never to walk through RITEMS.
1623 (output_stos): Rename as...
1624 (prepare_stos): this.
1625 (output): Always invoke prepare_states, after all, just don't use it
1626 in the output if you don't need it.
1627
643a5994
AD
16282002-04-07 Akim Demaille <akim@epita.fr>
1629
1630 * src/LR0.c (new_state): Display `nstates' as the name of the
1631 newly created state.
1632 Adjust to initialize first_state and last_state if needed.
1633 Be sure to distinguish the initial from the final state.
1634 (new_states): Create the itemset of the initial state, and use
1635 new_state.
1636 * src/closure.c (closure): Now that the initial state has its
1637 items properly set, there is no need for a special case when
1638 creating `ruleset'.
1639
1640 As a result, now the rule 0, reducing to $axiom, is visible in the
1641 outputs. Adjust the test suite.
1642
1643 * tests/conflicts.at (Solved SR Conflicts)
1644 (Unresolved SR Conflicts): Adjust.
1645 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1646 * tests/conflicts.at (S/R in initial): New.
1647
b4c4ccc2
AD
16482002-04-07 Akim Demaille <akim@epita.fr>
1649
1650 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1651 the RHS of the rules.
1652 * src/output.c (output_gram): Likewise.
1653
bba97eb2
AD
16542002-04-07 Akim Demaille <akim@epita.fr>
1655
1656 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1657 bucket.
1658 Adjust all dependencies.
1659 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1660 `number' of the buckets too.
1661 * src/gram.h: Include `symtab.h'.
1662 (associativity): Move to...
1663 * src/symtab.h: here.
1664 No longer include `gram.h'.
1665
c3b407f4
AD
16662002-04-07 Akim Demaille <akim@epita.fr>
1667
1668 * src/gram.h, src/gram.c (rules_rhs_length): New.
1669 (ritem_longest_rhs): Use it.
1670 * src/gram.h (rule_t): `number' is a new member.
1671 * src/reader.c (packgram): Set it.
1672 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1673 the end of `rules', and count them out of `nrules'.
1674 (reduce_output, dump_grammar): Adjust.
1675 * src/print.c (print_grammar): It is no longer needed to check for
1676 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1677 * tests/reduce.at (Reduced Automaton): New test.
1678
11652ab3
AD
16792002-04-07 Akim Demaille <akim@epita.fr>
1680
1681 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1682 lacking `+ 1' to nrules, Bison reported as useless a token if it
1683 was used solely to set the precedence of the last rule...
1684
26b23c1a
AD
16852002-04-07 Akim Demaille <akim@epita.fr>
1686
1687 * data/bison.c++, data/bison.simple: Don't output the current file
1688 name in #line, to avoid useless diffs between two identical
1689 outputs under different names.
1690
18bcecb0
AD
16912002-04-07 Akim Demaille <akim@epita.fr>
1692
1693 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1694 Normalize loops to using `< nrules + 1', not `<= nrules'.
1695
fa770c86
AD
16962002-04-07 Akim Demaille <akim@epita.fr>
1697
1698 * TODO: Update.
1699
d9b739c3
AD
17002002-04-07 Akim Demaille <akim@epita.fr>
1701
1702 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1703 bucket.value as bucket.number.
1704
99013900
AD
17052002-04-07 Akim Demaille <akim@epita.fr>
1706
1707 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1708 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1709 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1710 RHS, instead of being an index in RITEMS.
1711
e966383b
PE
17122002-04-04 Paul Eggert <eggert@twinsun.com>
1713
1714 * doc/bison.texinfo: Update copyright date.
1715 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1716 (Symbols): Warn about running Bison in one character set,
1717 but compiling and/or running in an incompatible one.
1718 Warn about character code 256, too.
1719
17202002-04-03 Paul Eggert <eggert@twinsun.com>
1721
1722 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1723 YYERROR_VERBOSE is nonzero, not whether it is defined.
1724
1725 Merge changes from bison-1_29-branch.
c307773e 1726
8d6c48b9
PE
17272002-03-20 Paul Eggert <eggert@twinsun.com>
1728
1729 Merge fixes from Debian bison_1.34-1.diff.
1730
1731 * configure.in (AC_PREREQ): 2.53.
1732
e53c6322
AD
17332002-03-20 Akim Demaille <akim@epita.fr>
1734
1735 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1736
9ffbeca7
PE
17372002-03-19 Paul Eggert <eggert@twinsun.com>
1738
21db0b2a
PE
1739 * src/bison.simple (YYCOPY): New macro.
1740 (YYSTACK_RELOCATE): Use it.
1741 Remove Type arg; no longer needed. All callers changed.
1742 (yymemcpy): Remove; no longer needed.
1743
9ffbeca7
PE
1744 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1745 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1746
642cb8f8
AD
17472002-03-19 Akim Demaille <akim@epita.fr>
1748
1749 Test and fix the #line outputs.
1750
1751 * tests/atlocal.at (GCC): New.
1752 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1753 (Prologue synch line, ,%union synch line, Postprologue synch line)
1754 (Action synch line, Epilogue synch line): New tests.
1755 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1756 * data/bison.simple, data/bison.c++: Use it.
1757
3c31a486
AD
17582002-03-19 Akim Demaille <akim@epita.fr>
1759
1760 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1761 (Solved SR Conflicts, %expect not enough, %expect right)
1762 (%expect too much): Move to...
1763 * tests/conflicts.at: this new file.
1764
0d8bed56
AD
17652002-03-19 Akim Demaille <akim@epita.fr>
1766
1767 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1768 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1769 that we can move to enums for instance.
1770 * src/output.c (token_definitions_output): Output a list of
1771 `token-name, token-number' instead of the #define.
1772 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1773
9208d17f
AD
17742002-03-14 Akim Demaille <akim@epita.fr>
1775
1776 Use Gettext 0.11.1.
1777
af27eacb
RA
17782002-03-09 Robert Anisko <robert@lrde.epita.fr>
1779
1780 * data/bison.c++: Make the user able to add members to the generated
1781 parser by subclassing.
1782
9101a310
RA
17832002-03-05 Robert Anisko <robert@lrde.epita.fr>
1784
1785 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1786 a character.
1787 Reported by Nicolas Tisserand and Nicolas Burrus.
1788
fff9bf0b
RA
17892002-03-04 Robert Anisko <robert@lrde.epita.fr>
1790
1791 * src/reader.c: Warn about lacking semi-colons, do not complain.
1792
64dba31e
RA
17932002-03-04 Robert Anisko <robert@lrde.epita.fr>
1794
1795 * data/bison.c++: Remove a debug line.
1796
374f5a14
RA
17972002-03-04 Robert Anisko <robert@lrde.epita.fr>
1798
1799 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1800 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1801 provide a default implementation.
1802
bfcf1f3a
AD
18032002-03-04 Akim Demaille <akim@epita.fr>
1804
1805 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1806 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1807 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1808 * tests/semantic.at (Parsing Guards): Similarly.
1809 * src/reader.at (readgram): Complain if the last rule is not ended
1810 with a semi-colon.
1811
65ccf9fc
AD
18122002-03-04 Akim Demaille <akim@epita.fr>
1813
1814 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1815 * src/closure.c: here.
1816 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1817 RTC.
1818 * src/warshall.h, src/warshall.c: Remove.
1819 * tests/sets.at (Broken Closure): Adjust.
1820
d0039cbc
AD
18212002-03-04 Akim Demaille <akim@epita.fr>
1822
1823 * src/output.c (output_skeleton): tempdir is const.
1824 bytes_read is unused.
1825
345cea78
AD
18262002-03-04 Akim Demaille <akim@epita.fr>
1827
1828 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1829 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1830 Update.
1831 From Michael Hayes.
1832
564801f7
AD
18332002-03-04 Akim Demaille <akim@epita.fr>
1834
1835 * src/closure.c (closure): `r' is unused.
1836
e5352bc7
AD
18372002-03-04 Akim Demaille <akim@epita.fr>
1838
1839 * tests/sets.at (Broken Closure): Add the ending `;'.
1840 * src/reader.at (readgram): Complain if a rule is not ended with a
1841 semi-colon.
1842
914feea9
AD
18432002-03-04 Akim Demaille <akim@epita.fr>
1844
1845 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1846 (count_sr_conflicts): Use bitset_count.
1847 * src/reduce.c (inaccessable_symbols): Ditto.
1848 (bits_size): Remove.
1849 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1850
f0250de6
AD
18512002-03-04 Akim Demaille <akim@epita.fr>
1852
1853 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1854 * src/reduce.c: Remove the `bitset_zero's following the
1855 `bitset_create's, as now it is performed by the latter.
1856
ef017502
AD
18572002-03-04 Akim Demaille <akim@epita.fr>
1858
1859 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1860 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1861 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1862 latest sources from Michael.
1863
76514394
AD
18642002-03-04 Akim Demaille <akim@epita.fr>
1865
1866 * src/output.c (output): Don't free the grammar.
1867 * src/reader.c (grammar_free): New.
1868 * src/main.c (main): Call it and don't free symtab here.
1869
55024580
AD
18702002-03-04 Akim Demaille <akim@epita.fr>
1871
1872 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1873 before returning.
1874 Reported by Benoit Perrot.
1875
f9abaa2c
AD
18762002-03-04 Akim Demaille <akim@epita.fr>
1877
1878 Use bitset operations when possible, not loops over bits.
1879
1880 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1881 bitset_or.
1882 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1883 * src/reduce.c (useless_nonterminals): Formatting changes.
1884 * src/warshall.c (TC): Use bitset_or.
1885
0e721e75
AD
18862002-03-04 Akim Demaille <akim@epita.fr>
1887
1888 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1889 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1890 Ditto.
1891
0fb1ffb1
AD
18922002-03-04 Akim Demaille <akim@epita.fr>
1893
1894 * src/lalr.c (F): Now a bitset*.
1895 Adjust all dependencies.
1896
b86796bf
AD
18972002-03-04 Akim Demaille <akim@epita.fr>
1898
1899 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1900 Adjust all dependencies.
1901
602bbf31
AD
19022002-03-04 Akim Demaille <akim@epita.fr>
1903
1904 * src/L0.c, src/LR0.h (nstates): Be size_t.
1905 Adjust comparisons (signed vs unsigned).
1906 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1907 bitset*.
1908 Adjust all dependencies.
1909
d8a0245c
AD
19102002-03-04 Akim Demaille <akim@epita.fr>
1911
1912 * src/closure.c (firsts): Now, also a bitset.
1913 Adjust all dependencies.
1914 (varsetsize): Remove, now unused.
1915 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1916
34ba9743
AD
19172002-03-04 Akim Demaille <akim@epita.fr>
1918
1919 * src/print.c: Convert to use bitset.h, not hand coded iterations
1920 over ints.
1921
ed86e78c
AD
19222002-03-04 Akim Demaille <akim@epita.fr>
1923
1924 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1925
dfdb1797
AD
19262002-03-04 Akim Demaille <akim@epita.fr>
1927
1928 * src/closure.c (ruleset): Be a bitset.
1929 (rulesetsize): Remove.
1930
7086e707
AD
19312002-03-04 Akim Demaille <akim@epita.fr>
1932
1933 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1934 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1935 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1936 * src/closure.c (fderives): Be an array of bitsets.
1937
98254360
RA
19382002-02-28 Robert Anisko <robert@lrde.epita.fr>
1939
1940 * data/bison.c++: Merge the two generated headers. Insert a copyright
1941 notice in each output file.
1942
a75c057f
AD
19432002-02-28 Akim Demaille <akim@epita.fr>
1944
1945 * data/bison.c++: Copy the prologue of bison.simple to fetch
1946 useful M4 definitions, such as b4_header_guard.
1947
06b00abc
AD
19482002-02-25 Akim Demaille <akim@epita.fr>
1949
1950 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
1951 translator friendly scheme for the bgr
1952 copyright notice.
06b00abc 1953
70e7d534
AD
19542002-02-25 Akim Demaille <akim@epita.fr>
1955
1956 * src/output.c (header_output): Remove, now handled completely via
1957 M4.
1958
abe017f6
AD
19592002-02-25 Akim Demaille <akim@epita.fr>
1960
1961 * m4/m4.m4: New, from CVS Autoconf.
1962 * configure.in: Invoke it.
1963 * src/output.c (output_skeleton): Use its result instead of the
1964 hard coded name.
1965
381fb12e
AD
19662002-02-25 Akim Demaille <akim@epita.fr>
1967
1968 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1969 Fileutils 4.1.5.
1970 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1971 * src/output.c (output_skeleton): Use mkstemp to create a real
1972 temporary file.
1973 Move the filling of `skeleton' and its muscle to...
1974 (prepare): here.
1975 (output): Move the definition of the prologue muscle to...
1976 (prepare): here.
1977 * src/system.h (DEFAULT_TMPDIR): New.
1978
6f38107f
PE
19792002-02-14 Paul Eggert <eggert@twinsun.com>
1980
1981 Remove the support for C++ namespace cleanliness; it was
1982 causing more problems than it was curing, since it didn't work
1983 properly on some nonstandard C++ compilers. This can wait
1984 for a proper C++ parser.
1985
1986 * NEWS: Document this.
1987 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1988 of C++, as it's treated like C now.
1989 * src/bison.simple (YYSTD): Remove.
1990 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1991 Treat C++ just like Standard C instead of trying to support
1992 namespace cleanliness.
1993
80cce3da
AD
19942002-02-14 Akim Demaille <akim@epita.fr>
1995
1996 * tests/regression.at (else): Adjust to Andreas' change.
1997
842e8679
AD
19982002-02-14 Akim Demaille <akim@epita.fr>
1999
2000 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2001
4bda3f10
AD
20022002-02-13 Andreas Schwab <schwab@suse.de>
2003
2004 * src/output.c (output_rule_data): Don't output NULL, it might
2005 not be defined yet.
2006
4162fa07 20072002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 2008
4162fa07
RA
2009 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2010 (Copyright notice): Update.
b418ecd8 2011
bd16a5dc
AD
20122002-02-11 Akim Demaille <akim@epita.fr>
2013
2014 * tests/regression.at (%nonassoc and eof): Don't include
2015 nonportable headers.
2016
8d69a1a3
RA
20172002-02-08 Robert Anisko <robert@lrde.epita.fr>
2018
2019 * data/bison.c++: Correct error recovery. Make the user able to
2020 initialize the starting location.
2021
9b2d0677
AD
20222002-02-07 Akim Demaille <akim@epita.fr>
2023
2024 * tests/input.at: New.
2025
69e2658b
RA
20262002-02-07 Robert Anisko <robert@lrde.epita.fr>
2027
2028 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 2029 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
2030 directives around tables only needed for debugging.
2031
4aacc3a7
RA
20322002-02-07 Robert Anisko <robert@lrde.epita.fr>
2033
2034 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2035 C++ parsers.
2036 (yy::b4_name::parse): Use print_.
2037
762a801e
RA
20382002-02-07 Robert Anisko <robert@lrde.epita.fr>
2039
2040 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2041
4bb2bc3f
RA
20422002-02-07 Robert Anisko <robert@lrde.epita.fr>
2043
2044 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2045 C++ parsers.
2046 (yy::b4_name::parse): Build verbose error messages, and use error_.
2047
6b45a3ca
RA
20482002-02-06 Robert Anisko <robert@lrde.epita.fr>
2049
2050 * data/bison.c++: Fix m4 quoting in comments.
2051
50997c6e
RA
20522002-02-06 Robert Anisko <robert@lrde.epita.fr>
2053
2054 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2055 not expanded by m4.
2056
3f3eed27
AD
20572002-02-05 Akim Demaille <akim@epita.fr>
2058
2059 * data/bison.c++: Adjust to the M4 back end.
2060 More is certainly needed.
2061
be2a1a68
AD
20622002-02-05 Akim Demaille <akim@epita.fr>
2063
2064 Give a try to M4 as a back end.
2065
2066 * lib/readpipe.c: New, from wdiff.
2067 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2068 BISON_HAIRY.
2069 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2070 specific values. Now it is m4 that performs the lookup.
2071 * src/parse-skel.y: Remove.
2072 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2073 * src/output.c (actions_output, guards_output)
2074 (token_definitions_output): No longer keeps track of the output
2075 line number, hence remove the second argument.
2076 (guards_output): Check against the guard member of a rule, not the
2077 action member.
2078 Adjust callers.
2079 (output_skeleton): Don't look for the skeleton location, let m4 do
2080 that.
2081 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2082 file will be used.
2083 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2084 (prepare): Given that for the time being changesyntax is not
2085 usable in M4, rename the muscles using `-' to `_'.
2086 Define `defines_flag', `output_parser_name' and `output_header_name'.
2087 * src/output.h (actions_output, guards_output)
2088 (token_definitions_output): Adjust prototypes.
2089 * src/scan-skel.l: Instead of scanning the skeletons, it now
2090 processes the output of m4: `__oline__' and `#output'.
2091 * data/bison.simple: Adjust to be used by M4(sugar).
2092 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2093 to date.
2094 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2095 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2096 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2097 shamelessly stolen from CVS Autoconf.
2098
beda758b
AD
20992002-02-05 Akim Demaille <akim@epita.fr>
2100
2101 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2102 * configure.in: Check for the declarations of free and malloc.
2103 * src/muscle_tab.c: Adjust.
2104
5ece6d43
AD
21052002-02-05 Akim Demaille <akim@epita.fr>
2106
2107 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2108 which have no values.
2109
5bb18f9a
AD
21102002-02-05 Akim Demaille <akim@epita.fr>
2111
2112 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2113 * data/: here.
2114
894dd62e
PE
21152002-01-29 Paul Eggert <eggert@twinsun.com>
2116
2117 * src/bison.simple (YYSIZE_T): Do not define merely because
2118 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2119 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2120
82841af7
AD
21212002-01-27 Akim Demaille <akim@epita.fr>
2122
2123 Fix `%nonassoc and eof'.
2124
2125 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2126 which were not properly copied! Replace
2127 memcpy (res->errs, src->errs, src->nerrs);
2128 with
2129 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2130 !!!
2131 * tests/regression.at (%nonassoc and eof): Adjust to newest
2132 Autotest: `.' is not in the PATH.
2133
318b76e9
AD
21342002-01-27 Akim Demaille <akim@epita.fr>
2135
2136 * tests/sets.at (AT_EXTRACT_SETS): New.
2137 (Nullable): Use it.
2138 (Firsts): New.
2139
30d2f3d5
AD
21402002-01-26 Akim Demaille <akim@epita.fr>
2141
2142 * tests/actions.at, tests/calc.at, tests/headers.at,
2143 * tests/torture.at: Adjust to the newest Autotest which no longer
2144 forces `.' in the PATH.
2145
30f8c395
AD
21462002-01-25 Akim Demaille <akim@epita.fr>
2147
2148 * tests/regression.at (%nonassoc and eof): New.
2149 Suggested by Robert Anisko.
2150
29ae55f1
AD
21512002-01-24 Akim Demaille <akim@epita.fr>
2152
2153 Bison dumps core when trying to complain about broken input files.
2154 Reported by Cris van Pelt.
2155
2156 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2157 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2158 into...
2159 (Invalid inputs): Strengthen: exercise parse_percent_token.
2160
2b548aa6
RA
21612002-01-24 Robert Anisko <robert.anisko@epita.fr>
2162
2163 * src/Makefile.am: Add bison.c++.
2164 * src/bison.c++: New skeleton.
2165
bb0146c2
AD
21662002-01-21 Paolo Bonzini <bonzini@gnu.org>
2167
2168 * po/it.po: New.
2169
bec30531
AD
21702002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2171
2172 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2173
fc6edc45
MA
21742002-01-20 Marc Autret <marc@gnu.org>
2175
2176 * src/files.c (compute_output_file_names): Fix
2177
5e5d5415
MA
21782002-01-20 Marc Autret <marc@gnu.org>
2179
2180 * tests/output.at: New test.
2181 * src/files.c (compute_base_names): Don't map extensions when
2182 the YACC flag is set, use defaults.
2183 Reported by Evgeny Stambulchik.
2184
44ea3fbd
MA
21852002-01-20 Marc Autret <marc@gnu.org>
2186
bb0146c2 2187 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
2188 compilers as well (i.e. the vendor C compiler).
2189 Suggested by Albert Chin-A-Young.
2190
338963d1
TVH
21912002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2192
2193 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2194 canonical definition.
2195 * src/system.h: Use the canonical definition for PARAMS (avoids
2196 a conflict with the macro from lib/hash.h).
2197
c57b2479
AD
21982002-01-11 Akim Demaille <akim@epita.fr>
2199
2200 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 2201 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 2202
b85810ae
AD
22032002-01-09 Akim Demaille <akim@epita.fr>
2204
2205 * src/files.c, src/files.h (output_infix): New.
2206 (tab_extension): Remove.
2207 (compute_base_names): Compute the former, drop the latter.
2208 * src/output.c (prepare): Insert the muscles `output-infix', and
2209 `output-suffix'.
2210 * src/parse-skel.y (string, string.1): New.
2211 (section.header): Use it.
2212 (section.yacc): Remove.
2213 (prefix): Remove too.
2214 * src/scan-skel.l: Adjust.
2215 * src/bison.simple, src/bison.hairy: Adjust.
2216
cae60122
AD
22172002-01-09 Akim Demaille <akim@epita.fr>
2218
2219 * configure.in (WERROR_CFLAGS): Compute it.
2220 * src/Makefile.am (CFLAGS): Pass it.
2221 * tests/atlocal.in (CFLAGS): Idem.
2222 * src/files.c: Fix a few warnings.
2223 (get_extension_index): Remove, unused.
2224
ae404801
AD
22252002-01-08 Akim Demaille <akim@epita.fr>
2226
2227 * src/getargs.c (AS_FILE_NAME): New.
2228 (getargs): Use it to convert DOSish file names.
2229 * src/files.c (base_name): Rename as full_base_name to avoid
2230 clashes with `base_name ()'.
2231 (filename_split): New.
2232 (compute_base_names): N-th rewrite, using filename_split.
2233
22312b71
AD
22342002-01-08 Akim Demaille <akim@epita.fr>
2235
2236 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2237 New, stolen from the Fileutils 4.1.
2238 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2239 * configure.in: Check for the presence of memrchr, and of its
2240 prototype.
2241
a67cef01
TVH
22422002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2243
2244 * lib/hash.h (__P): Added definition for this macro.
2245 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2246 BUILT_SOURCES, to ensure they are generated first.
2247 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2248 %error-verbose to allow bootstrapping with bison 1.30x.
2249
2b25d624
AD
22502002-01-06 Akim Demaille <akim@epita.fr>
2251
2252 * src/reader.c (parse_braces): Don't fetch the next char, the
2253 convention is to fetch on entry.
2254 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2255 'switch' without a following semicolon.
2256 * tests/regression.at (braces parsing): New.
2257
3460813b
AD
22582002-01-06 Akim Demaille <akim@epita.fr>
2259
2260 Bison is dead wrong in its RR conflict reports.
2261
2262 * tests/torture.at (GNU Cim Grammar): New.
2263 * src/conflicts.c (count_rr_conflicts): Fix.
2264
73784c64
AD
22652002-01-06 Akim Demaille <akim@epita.fr>
2266
2267 Creating package.m4 from configure.ac causes too many problems.
2268
2269 * tests/Makefile.am (package.m4): Create it by hand,
2270 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2271
25d81090
AD
22722002-01-06 Akim Demaille <akim@epita.fr>
2273
2274 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2275 skeleton.h.
2276
a9b8959e
PE
22772002-01-04 Paul Eggert <eggert@twinsun.com>
2278
2279 * doc/bison.texinfo (Debugging):
2280 Remove YYSTDERR; it's no longer defined or used.
2281 Also, s/cstdio.h/cstdio/.
2282
25d81090
AD
22832002-01-03 Akim Demaille <akim@epita.fr>
2284
2285 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2286
1109455c
AD
22872002-01-03 Akim Demaille <akim@epita.fr>
2288
2289 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2290 tracing code to --trace, wait for a better --trace option, with
2291 args.
2292
7ea5e977
AD
22932002-01-03 Akim Demaille <akim@epita.fr>
2294
2295 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2296 The ISO C++ standard is extremely clear about it: stderr is
2297 considered a macro, not a regular symbol (see table 94 `Header
2298 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2299 Therefore std:: does not apply to it. It still does with fprintf.
2300 Also, s/cstdio.h/cstdio/.
2301
fab5b110
AD
23022002-01-03 Akim Demaille <akim@epita.fr>
2303
2304 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2305 for non system headers.
2306
aed7fd9b
AD
23072002-01-02 Akim Demaille <akim@epita.fr>
2308
2309 Equip the skeleton chain with location tracking, runtime trace,
2310 pure parser and scanner.
2311
2312 * src/parse-skel.y: Request a pure parser, locations, and prefix
2313 renaming.
2314 (%union): Having several members with the same type does not help
2315 type mismatches, simplify.
2316 (YYPRINT, yyprint): New.
2317 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2318 (skel_error): this.
2319 Handle locations.
2320 * src/scan-skel.l: Adjust to these changes.
2321 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2322 (LOCATION_PRINT, skel_control_t): New.
2323
24fad99e
AD
23242001-12-30 Akim Demaille <akim@epita.fr>
2325
2326 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2327 replace `gb' with BLANKS.
2328 * src/scan-skel.l: Adjust.
2329
a4b36db4
AD
23302001-12-30 Akim Demaille <akim@epita.fr>
2331
2332 * src/system.h: We don't need nor want bcopy.
2333 Throw away MS-DOS crap: we don't need getpid.
2334 * configure.in: We don't need strndup. It was even causing
2335 problems: because Flex includes the headers *before* us,
2336 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2337 not visible.
2338 * lib/xstrndup.c: New.
2339 * src/scan-skel.l: Use it.
2340 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2341 * src/parse-skel.y: Use %directives instead of #defines.
2342
1239777d
AD
23432001-12-30 Akim Demaille <akim@epita.fr>
2344
2345 * src/skeleton.h: New.
2346 * src/output.c (output_parser, output_master_parser): Remove, dead
2347 code.
2348 * src/output.h (get_lines_number, actions_output, guards_output)
2349 (token_definitions_output): Prototype them.
2350 * src/parse-skel.y: Add the license notice.
2351 Include output.h and skeleton.h.
2352 (process_skeleton): Returns void, and takes a single parameter.
2353 * src/scan-skel.l: Add the license notice.
2354 Include skeleton.h.
2355 Don't use %option yylineno: it seems that then Flex imagines
2356 REJECT has been used, and therefore it won't reallocate its
2357 buffers (which makes no other sense to me than a bug). It results
2358 in warnings for `unused: yy_flex_realloc'.
2359
9b3add5b
RA
23602001-12-30 Robert Anisko <robert.anisko@epita.fr>
2361
2362 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2363 (MUSCLE_INSERT_PREFIX): ...to there.
2364 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2365 (MUSCLE_INSERT_PREFIX): Move from here...
2366
2367 * src/bison.hairy: Add a section directive. Put braces around muscle
2368 names. This parser skeleton is still broken, but Bison should not
2369 choke on a bad muscle 'syntax'.
2370 * src/bison.simple: Add a section directive. Put braces around muscle
2371 names.
2372
2373 * src/files.h (strsuffix, stringappend): Add declarations.
2374 (tab_extension): Add declaration.
2375 (short_base_name): Add declaration.
2376
2377 * src/files.c (strsuffix, stringappend): No longer static. These
2378 functions are used in the skeleton parser.
2379 (tab_extension): New.
2380 (compute_base_names): Use the computations done in this function
fab5b110 2381 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
2382 names.
2383 (short_base_name): No longer static.
2384
2385 * src/output.c (output_skeleton): New.
2386 (output): Disable call to output_master_parser, and give a try to
2387 a new skeleton handling system.
2388 (guards_output, actions_output): No longer static.
2389 (token_definitions_output, get_lines_number): No longer static.
2390
2391 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2392
fab5b110 2393 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
2394 parse-skel.y.
2395
2396 * src/parse-skel.y: New file.
2397 * src/scan-skel.l: New file.
2398
b5b61c61
AD
23992001-12-29 Akim Demaille <akim@epita.fr>
2400
2401 %name-prefix is broken.
2402
2403 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2404 Adjust all dependencies.
2405 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2406 %name-prefix.
2407
2408 Renaming yylval but not yylloc is not consistent. Now we do.
2409
2410 * src/bison.simple: Prefix yylloc if used.
2411 * doc/bison.texinfo (Decl Summary): Document that.
2412
8c9a50be
AD
24132001-12-29 Akim Demaille <akim@epita.fr>
2414
2415 * doc/bison.texinfo: Promote `%long-directive' over
2416 `%long_directive'.
2417 Remove all references to fixed-output-files, yacc is enough.
2418
d99361e6
AD
24192001-12-29 Akim Demaille <akim@epita.fr>
2420
2421 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2422 user prologue. These are defaults.
2423 * tests/actions.at (Mid-rule actions): Make sure the user can
2424 define YYDEBUG and YYERROR_VERBOSE.
2425
b9cecb91
AD
24262001-12-29 Akim Demaille <akim@epita.fr>
2427
2428 * src/output.c (header_output): Don't forget to export YYLTYPE and
2429 yylloc.
2430 * tests/headers.at (export YYLTYPE): New, make sure it does.
2431 * tests/regression.at (%union and --defines, Invalid CPP headers):
2432 Move to...
2433 * tests/headers.at: here.
2434
aea13e97
AD
24352001-12-29 Akim Demaille <akim@epita.fr>
2436
2437 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2438
931394cb
AD
24392001-12-29 Akim Demaille <akim@epita.fr>
2440
2441 * tests/actions.at (Mid-rule actions): Output on a single line
2442 instead of several.
2443
704a47c4
AD
24442001-12-29 Akim Demaille <akim@epita.fr>
2445
2446 * doc/bison.texinfo: Formatting changes.
2447
091e20bb
AD
24482001-12-29 Akim Demaille <akim@epita.fr>
2449
2450 Don't store the token defs in a muscle, just be ready to output it
2451 on command. Now possible via `symbols'. Fixes a memory leak.
2452
2453 * src/output.c (token_definitions_output): New.
2454 (output_parser, header_output): Use it.
2455 * src/reader.c (symbols_save): Remove.
2456
cce71710
AD
24572001-12-29 Akim Demaille <akim@epita.fr>
2458
2459 * src/bison.simple: Do not provide a default for YYSTYPE and
2460 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2461 default.
2462
82c035a8
AD
24632001-12-29 Akim Demaille <akim@epita.fr>
2464
2465 Mid-rule actions are simply... ignored!
2466
2467 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2468 the empty-rule associated to the dummy symbol, not to the host
2469 rule.
2470 * tests/actions.at (Mid-rule actions): New.
2471
8419d367
AD
24722001-12-29 Akim Demaille <akim@epita.fr>
2473
2474 Memory leak.
2475
2476 * src/reader.c (reader): Free grammar.
2477
375d5806
AD
24782001-12-29 Akim Demaille <akim@epita.fr>
2479
2480 Memory leak.
2481
2482 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2483 since it allocates it for each state, although only one is needed.
2484 (allocate_storage): Do it here.
2485
f51cb8ff
AD
24862001-12-29 Akim Demaille <akim@epita.fr>
2487
2488 * src/options.h, src/options.c (create_long_option_table): Rename
2489 as...
2490 (long_option_table_new): this, with a clearer prototype.
2491 (percent_table): Remove, unused,
2492 * src/getargs.c (getargs): Adjust.
2493
29e88316
AD
24942001-12-29 Akim Demaille <akim@epita.fr>
2495
2496 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2497 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2498 as states.
2499
b9f71f19
AD
25002001-12-29 Akim Demaille <akim@epita.fr>
2501
2502 * src/lalr.c (build_relations): Rename `states' as `states1'.
2503 Sorry, I don't understand exactly what it is, no better name...
2504
1a2b5d37
AD
25052001-12-29 Akim Demaille <akim@epita.fr>
2506
2507 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2508 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2509 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2510 as rules.
2511
1cca533e
AD
25122001-12-29 Akim Demaille <akim@epita.fr>
2513
2514 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2515 ago.
2516
c03ae966
AD
25172001-12-29 Akim Demaille <akim@epita.fr>
2518
2519 * src/reader.c, src/reader.h (user_toknums): Remove.
2520 Adjust all users to use symbols[i]->user_token_number.
2521
5a670b1e
AD
25222001-12-29 Akim Demaille <akim@epita.fr>
2523
2524 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2525 Adjust all users to use symbols[i]->prec or ->assoc.
2526
ad949da9
AD
25272001-12-29 Akim Demaille <akim@epita.fr>
2528
2529 * src/reader.c, src/reader.h (tags): Remove.
2530 Adjust all users to use symbols[i]->tag.
2531
0e78e603
AD
25322001-12-29 Akim Demaille <akim@epita.fr>
2533
2534 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2535 and rule_table.
2536 * src/reader.c (packsymbols): Fill this table.
2537 Drop sprec.
2538 * src/conflicts.c (resolve_sr_conflict): Adjust.
2539 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2540 single table.
2541 Use symbols[i]->tag instead of tags[i].
2542
213e640e
AD
25432001-12-29 Akim Demaille <akim@epita.fr>
2544
2545 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2546 In addition, put a comment in there, to replace...
2547 * tests/regression.at (%union and C comments): Remove.
2548
e7b8bef1
AD
25492001-12-29 Akim Demaille <akim@epita.fr>
2550
2551 * tests/regression.at (Web2c Actions): Blindly move the actual
2552 output as expected output. The contents *seem* right to me, but I
2553 can't pretend reading perfectly parser tables... Nonetheless, all
2554 the other tests pass correctly, the table look OK, even though the
2555 presence of `$axiom' is to be noted: AFAICS it is useless (but
2556 harmless).
2557
b68e7744
AD
25582001-12-29 Akim Demaille <akim@epita.fr>
2559
2560 * src/reader.c (readgram): Don't add the rule 0 if there were no
2561 rules read. In other words, add it _after_ having performed
2562 grammar sanity checks.
2563 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2564
78d5bae9
AD
25652001-12-29 Akim Demaille <akim@epita.fr>
2566
2567 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2568 visible, and some states have now a different number.
2569
ff442794
AD
25702001-12-29 Akim Demaille <akim@epita.fr>
2571
2572 * src/reader.c (readgram): Bind the initial rule's lineno to that
2573 of the first rule.
2574 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2575 (Solved SR Conflicts): Adjust rule 0's line number.
2576
610ab194
AD
25772001-12-29 Akim Demaille <akim@epita.fr>
2578
2579 Fix the `GAWK Grammar' failure.
2580
2581 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2582 the reductions of the first state which was mistakenly confused
2583 with the final state because precisely final_state was initialized
2584 to 0.
2585 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2586 now noticed by Bison.
2587 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2588 have a reduction on $default.
2589
29d29c8f
AD
25902001-12-29 Akim Demaille <akim@epita.fr>
2591
2592 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2593 rule line numbers.
2594 * src/closure.c (print_closure): Likewise.
2595 * src/derives.c (print_derives): Likewise.
2596 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2597 now.
2598
7c6b64d0
AD
25992001-12-29 Akim Demaille <akim@epita.fr>
2600
2601 * src/lalr.c (lookaheads_print): New.
2602 (lalr): Call it when --trace-flag.
2603 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2604 are dumped.
2605
3d4daee3
AD
26062001-12-29 Akim Demaille <akim@epita.fr>
2607
2608 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2609 when walking through ritem, even via rule->rhs.
2610 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2611 (useful_production, useless_nonterminals): Likewise.
2612 (reduce_grammar_tables): Likewise, plus update nritems.
2613 * src/nullable.c (set_nullable): Likewise.
2614 * src/lalr.c (build_relations): Likewise.
2615 * tests/sets.at (Nullable): Adjust.
2616 Fortunately, now, the $axiom is no longer nullable.
2617
9e7f6bbd
AD
26182001-12-29 Akim Demaille <akim@epita.fr>
2619
2620 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2621 the 0-sentinel.
2622 * src/gram.c (ritem_longest_rhs): Likewise.
2623 * src/reduce.c (nonterminals_reduce): Likewise.
2624 * src/print_graph.c (print_graph): Likewise.
2625 * src/output.c (output_rule_data): Likewise.
2626 * src/nullable.c (set_nullable): Likewise.
2627
255ef638
AD
26282001-12-29 Akim Demaille <akim@epita.fr>
2629
2630 * src/output.c: Comment changes.
2631
0d8a7363
AD
26322001-12-27 Paul Eggert <eggert@twinsun.com>
2633
2634 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2635 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2636 Sparc, as they were causing more porting problems than the
2637 (minor) performance improvement was worth.
2638
2639 Also, catch up with 1.31's YYSTD.
2640
3db472b9
AD
26412001-12-27 Akim Demaille <akim@epita.fr>
2642
2643 * src/output.c (output_gram): Rely on nritems, not the
2644 0-sentinel. See below.
2645 Use -1 as separator, not 0.
2646 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2647 Rely on -1 as separator in yyrhs, instead of 0.
2648 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2649 twice `Now at end of input', therefore there are two lines less to
2650 expect.
2651
b365aa05
AD
26522001-12-27 Akim Demaille <akim@epita.fr>
2653
2654 * tests/regression.at (Unresolved SR Conflicts):
2655 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2656 below.
2657
30171f79
AD
26582001-12-27 Akim Demaille <akim@epita.fr>
2659
2660 * src/LR0.c (new_state): Recognize the final state by the fact it
2661 is reached by eoftoken.
2662 (insert_start_shifting_state, insert_eof_shifting_state)
2663 (insert_accepting_state, augment_automaton): Remove, since now
2664 these states are automatically computed from the initial state.
2665 (generate_states): Adjust.
2666 * src/print.c: When reporting a rule number to the user, substract
2667 1, so that the axiom rule is rule 0, and the first user rule is 1.
2668 * src/reduce.c: Likewise.
2669 * src/print_graph.c (print_core): For the time being, just as for
2670 the report, depend upon --trace-flags to dump the full set of
2671 items.
2672 * src/reader.c (readgram): Once the grammar read, insert the rule
2673 0: `$axiom: START-SYMBOL $'.
2674 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2675 number of the states has changed (the final state is no longer
2676 necessarily the last), catch up.
2677
75142d45
AD
26782001-12-27 Akim Demaille <akim@epita.fr>
2679
2680 Try to make the use of the eoftoken valid. Given that its value
2681 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2682 is used instead of > 0 where appropriate, (ii), depend upon nritems
2683 instead of the 0-sentinel.
2684
2685 * src/gram.h, src/gram.c (nritems): New.
2686 Expected to be duplication of nitems, but for the time being...
2687 * src/reader.c (packgram): Assert nritems and nitems are equal.
2688 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2689 * src/closure.c (print_closure, print_fderives): Likewise.
2690 * src/gram.c (ritem_print): Likewise.
2691 * src/print.c (print_core, print_grammar): Likewise.
2692 * src/print_graph.c: Likewise.
2693
b7c49edf
AD
26942001-12-27 Akim Demaille <akim@epita.fr>
2695
2696 * src/main.c (main): If there are complains after grammar
2697 reductions, then output the report anyway if requested, then die.
2698 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2699 * src/reader.c (eoftoken): New.
2700 (parse_token_decl): If the token being defined has value `0', it
2701 is the eoftoken.
2702 (packsymbols): No longer hack `tags' to insert `$' by hand.
2703 Be sure to preserve the value of the eoftoken.
2704 (reader): Make sure eoftoken is defined.
2705 Initialize nsyms to 0: now eoftoken is created just like the others.
2706 * src/print.c (print_grammar): Don't special case the eof token.
2707 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2708 lie anyway, albeit pleasant.
2709 * tests/calc.at: Exercise error messages with eoftoken.
2710 Change the grammar so that empty input is invalid.
2711 Adjust expectations.
2712 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2713
ec2da99f
AD
27142001-12-27 Akim Demaille <akim@epita.fr>
2715
2716 * configure.in: Check the protos of strchr ans strspn.
2717 Replace strchr if needed.
2718 * src/system.h: Provide the protos of strchr, strspn and memchr if
2719 missing.
2720 * lib/strchr.c: New.
2721 * src/reader.c (symbols_save): Use strchr.
2722
8adfa272
AD
27232001-12-27 Akim Demaille <akim@epita.fr>
2724
2725 * src/print.c, src/print_graph.c (escape): New.
2726 Use it to quote the TAGS outputs.
2727 * src/print_graph.c (print_state): Now errors are in red, and
2728 reductions in green.
2729 Prefer high to wide: output the state number on a line of its own.
2730
80dac38c
AD
27312001-12-27 Akim Demaille <akim@epita.fr>
2732
2733 * src/state.h, src/state.c (reductions_new): New.
2734 * src/LR0.c (set_state_table): Let all the states have a
2735 `reductions', even if reduced to 0.
2736 (save_reductions): Adjust.
2737 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2738 * src/print.c (print_reductions, print_actions): Adjust.
2739 * src/output.c (action_row): Adjust.
2740
2cec70b9
AD
27412001-12-27 Akim Demaille <akim@epita.fr>
2742
2743 * src/state.h, src/state.c (errs_new, errs_dup): New.
2744 * src/LR0.c (set_state_table): Let all the states have an errs,
2745 even if reduced to 0.
2746 * src/print.c (print_errs, print_reductions): Adjust.
2747 * src/output.c (output_actions, action_row): Adjust.
2748 * src/conflicts.c (resolve_sr_conflict): Adjust.
2749
13ca549a
AD
27502001-12-27 Akim Demaille <akim@epita.fr>
2751
2752 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2753
5092aba5
AD
27542001-12-27 Akim Demaille <akim@epita.fr>
2755
2756 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2757 * src/print.c: here.
2758 (lookaheadset, shiftset): New, used as additional storage by
2759 print_reductions.
2760 (print_results): Adjust.
2761 (print_shifts, print_gotos, print_errs): New, extracted from...
2762 (print_actions): here.
2763 * src/print_graph.c (print_actions): Remove dead code.
2764
11e2beca
AD
27652001-12-27 Akim Demaille <akim@epita.fr>
2766
2767 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2768 `$n' and `@n'.
2769
dac3c910
AD
27702001-12-27 Akim Demaille <akim@epita.fr>
2771
2772 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2773 (build_relations): Adjust.
2774
d0b0fefa
AD
27752001-12-27 Akim Demaille <akim@epita.fr>
2776
2777 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2778 duplication.
2779
adc8c848
AD
27802001-12-27 Akim Demaille <akim@epita.fr>
2781
2782 * src/reader.c (packgram): Catch nitems overflows.
2783
14d293ac
AD
27842001-12-27 Akim Demaille <akim@epita.fr>
2785
2786 * src/files.c, src/files.h (guard_obstack): Remove.
2787 * src/output.c (output): Adjust.
2788 * src/reader.c (parse_braces): New, factoring...
2789 (copy_action, copy_guard): these two which are renamed as...
2790 (parse_action, parse_guard): these.
2791 As a voluntary consequence, using braces around guards is now
2792 mandatory.
2793
f499b062
AD
27942001-12-27 Akim Demaille <akim@epita.fr>
2795
2796 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2797 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2798 members.
2799 (symbol_list_new): Adjust.
2800 (copy_action): action_line is the first line, not the last.
2801 (copy_guard): Just as for actions, store the `action' only, not
2802 the switch/case/break flesh.
2803 Don't parse the user action that might follow the guard, let...
2804 (readgram): do it, i.e., now, there can be an action after a
2805 guard.
2806 In other words the guard is just explicitly optional.
2807 (packgram): Adjust.
2808 * src/output.c (guards_output): New.
2809 (output_parser): Call it when needed.
2810 (output): Also free the guard and attrs obstacks.
2811 * src/files.c, src/files.h (obstack_save): Remove.
2812 (output_files): Remove.
2813 As a result, if one needs the former `.act' file, using an
2814 appropriate skeleton which requires actions and guards is now
2815 required.
2816 * src/main.c (main): Adjust.
2817 * tests/semantic.at: New.
2818 * tests/regression.at: Use `input.y' as input file name.
2819 Avoid 8+3 problems by requiring input.c when the test needs the
2820 parser.
2821
d945f5cd
AD
28222001-12-27 Akim Demaille <akim@epita.fr>
2823
2824 * src/reader.c (symbol_list_new): Be sure to initialize all the
2825 fields.
2826
d200e455
AD
28272001-12-27 Akim Demaille <akim@epita.fr>
2828
2829 All the hacks using a final pseudo state are now useless.
2830
2831 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2832 * src/lalr.c (nLA): New.
2833 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2834 instead of lookaheadsp from the pseudo state (nstate + 1).
2835
f9507c28
AD
28362001-12-27 Akim Demaille <akim@epita.fr>
2837
2838 * src/output.c (action_row, token_actions): Use a state_t instead
2839 of a integer, and nlookaheads instead of the following state's
2840 lookaheadsp.
2841
065fbd27
AD
28422001-12-27 Akim Demaille <akim@epita.fr>
2843
2844 * src/conflicts.c (log_resolution, flush_shift)
2845 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2846 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2847 (conflicts_print, print_reductions): Use a state_t instead of an
2848 integer when referring to a state.
2849 As much as possible, depend upon nlookaheads, instead of the
2850 `lookaheadsp' member of the following state (since lookaheads of
2851 successive states are successive, the difference between state n + 1
2852 and n served as the number of lookaheads for state n).
2853 * src/lalr.c (add_lookback_edge): Likewise.
2854 * src/print.c (print_core, print_actions, print_state)
2855 (print_results): Likewise.
2856 * src/print_graph.c (print_core, print_actions, print_state)
2857 (print_graph): Likewise.
2858 * src/conflicts.h: Adjust.
2859
1b177bd7
AD
28602001-12-27 Akim Demaille <akim@epita.fr>
2861
2862 * src/bison.hairy: Formatting/comment changes.
2863 ANSIfy.
2864 Remove `register' indications.
2865 Add plenty of `static'.
2866
7742ddeb
AD
28672001-12-27 Akim Demaille <akim@epita.fr>
2868
2869 * src/output.c (prepare): Drop the muscle `ntbase' which
2870 duplicates ntokens.
2871 * src/bison.simple: Formatting/comment changes.
2872 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2873 is an undocumented synonym.
2874
1fa14068
AD
28752001-12-22 Akim Demaille <akim@epita.fr>
2876
2877 * src/output.c (output_table_data): Change the prototype to use
2878 `int' for array ranges: some invocations do pass an int, not a
2879 short.
2880 Reported by Wayne Green.
2881
b9752825
AD
28822001-12-22 Akim Demaille <akim@epita.fr>
2883
2884 Some actions of web2c.y are improperly triggered.
2885 Reported by Mike Castle.
2886
2887 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2888 * tests/regression.at (Web2c): Rename as...
2889 (Web2c Report): this.
2890 (Web2c Actions): New.
2891
776209d6
AD
28922001-12-22 Akim Demaille <akim@epita.fr>
2893
2894 Reductions in web2c.y are improperly reported.
2895 Reported by Mike Castle.
2896
2897 * src/conflicts.c (print_reductions): Fix.
2898 * tests/regression.at (Web2c): New.
2899
275fc3ad
AD
29002001-12-18 Akim Demaille <akim@epita.fr>
2901
2902 Some host fail on `assert (!"foo")', which expands to
2903 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2904 Reported by Nelson Beebee.
2905
2906 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2907 `#define it_succeeded 0' and `assert (it_succeeded)'.
2908
897668ee
MA
29092001-12-17 Marc Autret <autret_m@epita.fr>
2910
2911 * src/bison.simple: Don't hard code the skeleton line and filename.
2912 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2913 New line counter 'skeleton_line' (skeleton-line muscle).
2914
ab3399e0
PE
29152001-12-17 Paul Eggert <eggert@twinsun.com>
2916
2917 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2918 YYDEBUG must be defined to a nonzero value.
2919
2920 * src/bison.simple (yytname): Do not assume that the user defines
2921 YYDEBUG to a properly parenthesized expression.
2922
3877f72b
AD
29232001-12-17 Akim Demaille <akim@epita.fr>
2924
2925 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2926 nlookaheads is a new member.
2927 Adjust all users.
2928 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2929 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2930 state.
776209d6 2931
331dbc1b
AD
29322001-12-17 Akim Demaille <akim@epita.fr>
2933
2934 * src/files.h, src/files.c (open_files, close_files): Remove.
2935 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2936 let...
2937 * src/reader.c (reader): Do it.
776209d6 2938
be750e4c
AD
29392001-12-17 Akim Demaille <akim@epita.fr>
2940
2941 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 2942
709ae8c6
AD
29432001-12-17 Akim Demaille <akim@epita.fr>
2944
2945 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2946 (flush_reduce): New.
2947 (resolve_sr_conflict): Adjust.
776209d6 2948
f87685c3
AD
29492001-12-17 Akim Demaille <akim@epita.fr>
2950
2951 * src/output.c (output_obstack): Be static and rename as...
2952 (format_obstack): this, to avoid any confusion with files.c's
2953 output_obstack.
2954 * src/reader.h (muscle_obstack): Move to...
2955 * src/output.h: here, since it's defined in output.c.
2956
837491d8
AD
29572001-12-17 Akim Demaille <akim@epita.fr>
2958
2959 * src/output.c (action_row, save_column, default_goto)
2960 (sort_actions, matching_state, pack_vector): Better variable
2961 locality.
2962
796d61fb
AD
29632001-12-17 Akim Demaille <akim@epita.fr>
2964
2965 * src/output.c: Various formatting changes.
776209d6 2966
64d15509
AD
29672001-12-17 Akim Demaille <akim@epita.fr>
2968
2969 * src/files.c (output_files): Free the output_obstack.
2970 * src/main.c (main): Call print and print_graph conditionally.
2971 * src/print.c (print): Work unconditionally.
2972 * src/print_graph.c (print_graph): Work unconditionally.
2973 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2974
fbc8ecb7
MA
29752001-12-16 Marc Autret <autret_m@epita.fr>
2976
2977 * src/output.c (actions_output): Fix. When we use %no-lines,
2978 there is one less line per action.
2979
f0440388
MA
29802001-12-16 Marc Autret <autret_m@epita.fr>
2981
2982 * src/bison.simple: Remove a useless #line directive.
2983 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2984 * src/output.c (get_lines_number): New.
776209d6 2985 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
2986 output muscles.
2987 Fix line numbering.
2988 (actions_output): Computes the number of lines taken by actions.
2989 (output_master_parser): Insert new skeleton which is the name of
2990 the output parser file name.
2991
a79986b8
MA
29922001-12-15 Marc Autret <autret_m@epita.fr>
2993
2994 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2995
4ec8e00f
MA
29962001-12-15 Marc Autret <autret_m@epita.fr>
2997
2998 * src/output.c (output_gram): Keep track of the hairy one.
2999
1a4648ff
AD
30002001-12-15 Akim Demaille <akim@epita.fr>
3001
3002 Make `make distcheck' work.
3003
3004 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3005 system.h which uses libgettext.h.
3006
9c2c67e6
AD
30072001-12-15 Akim Demaille <akim@epita.fr>
3008
3009 * src/nullable.c (set_nullable): Useless rules must be skipped,
3010 otherwise, since we range over their symbols, we might look at a
3011 nonterminal which no longer ``exists'', i.e., it is not counted in
3012 `nvars', hence we overflow our arrays.
3013
93ede233
AD
30142001-12-15 Akim Demaille <akim@epita.fr>
3015
3016 The header can also be produced directly, without any obstack!
3017 Yahoo!
3018
3019 * src/files.c, src/files.h (defines_obstack): Remove.
3020 (compute_header_macro): Global.
3021 (defines_obstack_save): Remove.
3022 * src/reader.c (parse_union_decl): No longer output to
3023 defines_obstack: its content can be found in the `stype' muscle
3024 anyway.
3025 (output_token_translations): Merge into...
3026 (symbols_output): this.
3027 Rename as...
3028 (symbols_save): this.
3029 (reader): Adjust.
3030 * src/output.c (header_output): New.
3031 (output): Call it.
3032
2666f928
AD
30332001-12-15 Akim Demaille <akim@epita.fr>
3034
3035 * src/reader.c (parse_union_decl): Instead of handling two obstack
3036 simultaneously, use one to define the `stype' muscle, and use the
3037 value of the latter to fill defines_obstack.
3038 (copy_comment): Remove.
3039 (copy_comment2): Work for a single obstack.
3040 Rename as...
3041 (copy_comment): this.
3042
428046f8
AD
30432001-12-15 Akim Demaille <akim@epita.fr>
3044
3045 * src/lex.c, src/lex.h (xgetc): No longer static.
3046 * src/reader.c (parse_union_decl): Revamp.
3047
ea52d706
AD
30482001-12-15 Akim Demaille <akim@epita.fr>
3049
3050 Still making progress in separating Bison into (i) input, (ii)
3051 process, (iii) output: now we can directly output the parser file
3052 without using table_obstack at all.
3053
3054 * src/files.c, src/files.h (table_obstack): Bye bye.
3055 (parser_file_name): New.
3056 * src/files.c (compute_output_file_names): Compute it.
3057 * src/output.c (actions_output, output_parser)
3058 (output_master_parser): To a file instead of an obstack.
3059
3f96f4dc
AD
30602001-12-15 Akim Demaille <akim@epita.fr>
3061
3062 Attach actions to rules, instead of pre-outputting them to
3063 actions_obstack.
3064
3065 * src/gram.h (rule_t): action and action_line are new members.
3066 * src/reader.c (symbol_list): Likewise.
3067 (copy_action): Save the actions within the rule.
3068 (packgram): Save them in rule_table.
3069 * src/output.c (actions_output): New.
3070 (output_parser): Use it on `%%actions'.
3071 (output_rule_data): Don't free rule_table.
3072 (output): Do it.
3073 (prepare): Don't save the `action' muscle.
3074 * src/bison.simple: s/%%action/%%actions/.
3075
51576fb3
AD
30762001-12-15 Akim Demaille <akim@epita.fr>
3077
3078 * src/reader.c (copy_action): When --yacc, don't append a `;'
3079 to the user action: let it fail if lacking.
dee049eb 3080 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 3081
2648a72d
AD
30822001-12-14 Akim Demaille <akim@epita.fr>
3083
3084 * src/lex.c (literalchar): Simply return the char you decoded, non
3085 longer mess around with obstacks and int pointers.
3086 Adjust all callers.
3087
92790e5b
AD
30882001-12-14 Akim Demaille <akim@epita.fr>
3089
3090 * src/lex.c (literalchar): Don't escape the special characters,
3091 just decode them, and keep them as char (before, eol was output as
3092 the 2 char string `\n' etc.).
3093 * src/output.c (output_rule_data): Use quotearg to output the
3094 token strings.
3095
927c1557
PE
30962001-12-13 Paul Eggert <eggert@twinsun.com>
3097
3098 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3099 Do not infringe on the global user namespace when using C++.
3100 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3101 All uses of `fprintf' and `stderr' changed.
3102
3103 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3104
ed8e1f68
AD
31052001-12-13 Akim Demaille <akim@epita.fr>
3106
3107 The computation of nullable is broken: it doesn't handle empty
3108 RHS's properly.
3109
3110 * tests/torture.at (GNU AWK Grammar): New.
3111 * tests/sets.at (Nullable): New.
3112 * src/nullable.c (set_nullable): Instead of blindly looping over
3113 `ritems', loop over the rules, and then over their rhs's.
3114
3115 Work around Autotest bugs.
3116
3117 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3118 frame, because Autotest understand lines starting with a `+' as
3119 traces from the shell. Then, they are not processed properly.
3120 Admittedly an Autotest bug, but we don't have time to wait for
3121 Autotest to catch up.
3122 * tests/regression.at (Broken Closure): Adjust to the new table
3123 frames.
3124 Move to...
3125 * tests/sets.at: here.
3126
cb581495
AD
31272001-12-13 Akim Demaille <akim@epita.fr>
3128
3129 * src/closure.c (closure): Use nrules instead of playing tricks
3130 with BITS_PER_WORD.
3131
2e729273
AD
31322001-12-13 Akim Demaille <akim@epita.fr>
3133
3134 * src/print.c (print_actions): Output the handling of `$' as the
3135 traces do: shifting the token EOF. Before EOF was treated as a
3136 nonterminal.
3137 * tests/regression.at: Adjust some tests.
3138 * src/print_graph.c (print_core): Complete the set of items via
3139 closure. The next-to-final and final states are still unsatisfying,
3140 but that's to be addressed elsewhere.
3141 No longer output the rule numbers, but do output the state number.
3142 A single loop for the shifts + gotos is enough, but picked a
3143 distinct color for each.
3144 (print_graph): Initialize and finalize closure.
3145
107f7dfb
AD
31462001-12-13 Akim Demaille <akim@epita.fr>
3147
3148 * src/reader.c (readgram): Remove dead code, an strip useless
3149 braces.
3150 (get_type): Remove, unused.
3151
9b53a24f
AD
31522001-12-12 Akim Demaille <akim@epita.fr>
3153
3154 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3155 on that of lib/error.c.
3156
dbfb6dcd
AD
31572001-12-12 Akim Demaille <akim@epita.fr>
3158
3159 Some hosts don't like `/' in includes.
3160
3161 * src/system.h: Include libgettext.h without qualifying the path.
3162 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3163 $(top_srcdir).
3164
c25fb648
MA
31652001-12-11 Marc Autret <autret_m@epita.fr>
3166
3167 * src/output.c (output_parser): Remove useless muscle.
3168
710ddc4f
MA
31692001-12-11 Marc Autret <autret_m@epita.fr>
3170
3171 * src/bison.simple: Remove #line just before %%epilogue. It
3172 is now handled in ...
3173 * src/reader.c (read_additionnal_code): Add the output of a
3174 #line for the epilogue.
3175
e83d80b8
MA
31762001-12-10 Marc Autret <autret_m@epita.fr>
3177
927c1557 3178 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
3179 replace precedent remove.
3180 * src/bison.simple: Remove #line before %%prologue because
3181 %%input-line is wrong at this time.
3182
971d5158
MA
31832001-12-10 Marc Autret <autret_m@epita.fr>
3184
3185 * src/reader.c (symbols_output): Clean up.
927c1557 3186 * src/output.c (output_gram, output): Clean up.
971d5158 3187
5edafffd
AD
31882001-12-10 Akim Demaille <akim@epita.fr>
3189
3190 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3191 * src/LR0.c (set_state_table): here.
3192 * src/lalr.c (lalr): Call it.
3193
0279f8e9
AD
31942001-12-10 Akim Demaille <akim@epita.fr>
3195
3196 * src/state.h (shifts): Remove the `number' member: shifts are
3197 attached to state, hence no longer need to be labelled with a
3198 state number.
3199
190c4f5f
AD
32002001-12-10 Akim Demaille <akim@epita.fr>
3201
3202 Now that states have a complete set of members, the linked list of
3203 shifts is useless: just fill directly the state's shifts member.
3204
3205 * src/state.h (shifts): Remove the `next' member.
3206 * src/LR0.c (first_state, last_state): Remove.
3207 Adjust the callers.
3208 (augment_automaton): Don't look for the shifts that must be added
3209 a shift on EOF: it is those of the state we looked for! But now,
3210 since shifts are attached, it is no longer needed to looking
3211 merely by its id: its number.
3212
2a73b93d
AD
32132001-12-10 Akim Demaille <akim@epita.fr>
3214
3215 * src/LR0.c (augment_automaton): Better variable locality.
3216 Remove an impossible branch: if there is a state corresponding to
3217 the start symbol being shifted, then there is shift for the start
3218 symbol from the initial state.
3219
74392f6a
AD
32202001-12-10 Akim Demaille <akim@epita.fr>
3221
3222 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3223 only when appropriate: when insert_start_shifting_state' is not
3224 invoked.
3225 * tests/regression.at (Rule Line Numbers): Adjust.
3226
37c82725
AD
32272001-12-10 Akim Demaille <akim@epita.fr>
3228
3229 * src/LR0.c (augment_automaton): Now that all states have shifts,
3230 merge the two cases addition shifts to the initial state.
3231
6a164e0c
AD
32322001-12-10 Akim Demaille <akim@epita.fr>
3233
3234 * src/lalr.c (set_state_table): Move to...
3235 * src/LR0.c: here.
3236 * src/lalr.c (lalr): Don't call it...
3237 * src/LR0.c (generate_states): do it.
3238 * src/LR0.h (first_state): Remove, only the table is used.
3239
7215de24
AD
32402001-12-10 Akim Demaille <akim@epita.fr>
3241
3242 * src/LR0.h (first_shift, first_reduction): Remove.
3243 * src/lalr.c: Don't use first_shift: find shifts through the
3244 states.
3245
80e25d4d
AD
32462001-12-10 Akim Demaille <akim@epita.fr>
3247
3248 * src/LR0.c: Attach shifts to states as soon as they are
3249 computed.
3250 * src/lalr.c (set_state_table): Instead of assigning shifts to
3251 state, just assert that the mapping was properly done.
3252
0ab3728b
AD
32532001-12-10 Akim Demaille <akim@epita.fr>
3254
3255 * src/LR0.c (insert_start_shift): Rename as...
3256 (insert_start_shifting_state): this.
3257 (insert_eof_shifting_state, insert_accepting_state): New.
3258 (augment_automaton): Adjust.
3259 Better locality of the variables.
3260 When looking if the start_symbol is shifted from the initial
3261 state, using `while (... symbol != start_symbol ...)' sounds
3262 better than `while (... symbol < start_symbol ...)': If fail
3263 to see how the order between symbols could be relevant!
3264
78af9bbc
AD
32652001-12-10 Akim Demaille <akim@epita.fr>
3266
3267 * src/getargs.h: Don't declare `spec_name_prefix' and
3268 `spec_file_prefix', declared by src/files.h.
3269 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3270 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3271 * src/output.c (prepare): Adjust.
3272 * src/reader.c (symbols_output): Likewise.
3273 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3274
bdef2a41
AD
32752001-12-10 Akim Demaille <akim@epita.fr>
3276
3277 * src/muscle_tab.c (muscle_init): NULL is a better default than
3278 `"0"'.
3279
3735969c
AD
32802001-12-10 Akim Demaille <akim@epita.fr>
3281
3282 * src/reader.c (reader): Calling symbols_output once is enough.
3283
49701457
AD
32842001-12-10 Akim Demaille <akim@epita.fr>
3285
3286 Now that states have a complete set of members, the linked list of
3287 reductions is useless: just fill directly the state's reductions
3288 member.
3289
3290 * src/state.h (struct reductions): Remove member `number' and
3291 `next'.
3292 * src/LR0.c (first_reduction, last_reduction): Remove.
3293 (save_reductions): Don't link the new reductions, store them in
3294 this_state.
3295 * src/lalr.c (set_state_table): No need to attach reductions to
3296 states, it's already done.
3297 * src/output.c (output_actions): No longer free the shifts, then
3298 the reductions, then the states: free all the states and their
3299 members.
3300
0edad749
AD
33012001-12-10 Akim Demaille <akim@epita.fr>
3302
3303 * src/options.c (OPTN, DRTV, BOTH): New.
3304 (option_table): Use them.
3305
0edad749
AD
3306 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3307 the job of system.h.
3308 * src/options.c: Don't include stdio.h and xalloc.h for the same
3309 reasons.
3310
5449dd0f
AD
33112001-12-10 Akim Demaille <akim@epita.fr>
3312
3313 * src/output.c (output, prepare): Make sure the values of the
3314 muscles `action' and `prologue' are 0-terminated.
3315
a870c567
AD
33162001-12-10 Akim Demaille <akim@epita.fr>
3317
3318 Clean up GCC warnings.
3319
3320 * src/reader.c (copy_action): `buf' is not used.
3321 (parse_skel_decl): Be static.
3322 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3323 * src/options.h (create_long_option_table): Have a real prototype.
3324 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3325 (hash_delete_at): Return const void *.
3326 Adjust casts to preserve the const.
3327
80df8768
AD
33282001-12-10 Akim Demaille <akim@epita.fr>
3329
3330 * configure.in: Require 2.52g.
3331 M4 is not needed, but AUTOM4TE is.
3332 * m4/m4.m4: Remove.
3333 * tests/Makefile.am: Adjust.
3334
f693ad14
AD
33352001-12-10 Akim Demaille <akim@epita.fr>
3336
3337 One structure for states is enough, even though theoretically
3338 there are LR(0) states and LALR(1) states.
3339
3340 * src/lalr.h (state_t): Remove.
3341 (state_table): Be state_t **, not state_t *.
3342 * src/state.h (core, CORE_ALLOC): Rename as...
3343 (state_t, STATE_ALLOC): this.
3344 Add the LALR(1) members: shifts, reductions, errs.
3345 * src/LR0.c (state_table): Rename as...
3346 (state_hash): this, to avoid name clashes with the global
3347 `state_table'.
3348 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3349 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3350
74ffbcb6
AD
33512001-12-10 Akim Demaille <akim@epita.fr>
3352
3353 Bison dumps core on bash.y.
3354 Reported by Pascal Bart.
3355
3356 * src/warshall.c (bitmatrix_print): New.
3357 (TC): Use it.
3358 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3359 j must be the outer loop.
3360 * tests/regression.at (Broken Closure): New.
3361
07708e19
AD
33622001-12-05 Akim Demaille <akim@epita.fr>
3363
3364 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3365 its argument.
3366