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