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