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