]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/reader.h, src/reader.c (symbol_list, symbol_list_new)
[bison.git] / ChangeLog
CommitLineData
56c47203
AD
12002-06-17 Akim Demaille <akim@epita.fr>
2
3 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
4 (symbol_list_prepend, get_type_name): Move to...
5 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
6 (symbol_list_prepend, symbol_list_n_type_name_get): here.
7 Adjust all callers.
8 (symbol_list_free): New.
9 * src/scan-gram.l (handle_dollar): Takes a location.
10 * tests/input.at (Invalid $n): Adjust.
11
12
1e0bab92
AD
132002-06-17 Akim Demaille <akim@epita.fr>
14
15 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16 (symbol_list_prepend): New.
17 * src/parse-gram.y (%union): `list' is a new member.
18 (symbols.1): New, replaces...
19 (terms_to_prec.1, nterms_to_type.1): these.
20 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
21 Take a location as additional argument.
22 Adjust all callers.
23
04e60654
AD
242002-06-15 Akim Demaille <akim@epita.fr>
25
26 * src/parse-gram.y: Move %token in the declaration section so that
27 we don't depend upon CVS Bison.
28
10e5b8bd
AD
292002-06-15 Akim Demaille <akim@epita.fr>
30
31 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
32 * src/print.c (print_core): Use it.
33
9801d40c
AD
342002-06-15 Akim Demaille <akim@epita.fr>
35
36 * src/conflicts.c (log_resolution): Accept the rule involved in
37 the sr conflicts instead of the lookahead number that points to
38 that rule.
39 (flush_reduce): Accept the current lookahead vector as argument,
40 instead of the index in LA.
41 (resolve_sr_conflict): Accept the current number of lookahead
42 bitset to consider for the STATE, instead of the index in LA.
43 (set_conflicts): Adjust.
44 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
45
c0263492
AD
462002-06-15 Akim Demaille <akim@epita.fr>
47
48 * src/state.h (state_t): Replace the `lookaheadsp' member, a
49 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
50 Adjust all dependencies.
51 * src/lalr.c (initialize_lookaheads): Split into...
52 (states_lookaheads_count, states_lookaheads_initialize): these.
53 (lalr): Adjust.
54
9757c359
AD
552002-06-15 Akim Demaille <akim@epita.fr>
56
57 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
58 out of...
59 (grammar_rules_print): here.
60 * src/reduce.c (reduce_output): Use it.
61 * tests/reduce.at (Useless Rules, Reduced Automaton)
62 (Underivable Rules): Adjust.
63
6b98e4b5
AD
642002-06-15 Akim Demaille <akim@epita.fr>
65
66 Copy BYacc's nice way to report the grammar.
67
68 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
69 New.
70 Don't print the rules' location, it is confusing and useless.
71 (rule_print): Use grammar_rhs_print.
72 * src/print.c (print_grammar): Use grammar_rules_print.
73
6b98e4b5
AD
742002-06-15 Akim Demaille <akim@epita.fr>
75
76 Complete and rationalize `useless thing' warnings.
77
78 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
79 (symbol_tag_print): New.
80 Use them everywhere in place of accessing directly the tag member.
81 * src/gram.h, src/gram.c (rule_print): New.
82 Use it where a rule used to be printed `by hand'.
83 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
84 (reduce_grammar_tables): Report the useless rules.
85 (reduce_print): Useless things are a warning, not an error.
86 Report it as such.
87 * tests/reduce.at (Useless Nonterminals, Useless Rules):
88 (Reduced Automaton, Underivable Rules): Adjust.
89 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
90 * tests/conflicts.at (Unresolved SR Conflicts)
91 (Solved SR Conflicts): Adjust.
92
ee000ba4
AD
932002-06-15 Akim Demaille <akim@epita.fr>
94
95 Let symbols have a location.
96
97 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
98 (getsym): Adjust.
99 Adjust all callers.
100 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
101 Use location_t, not int.
102 * src/symtab.c (symbol_check_defined): Take advantage of the
103 location.
104 * tests/regression.at (Invalid inputs): Adjust.
105
8efe435c
AD
1062002-06-15 Akim Demaille <akim@epita.fr>
107
108 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
109 (input): Don't try to initialize yylloc here, do it in the
110 scanner.
111 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
112 * src/gram.h (rule_t): Change line and action_line into location
113 and action_location, of location_t type.
114 Adjust all dependencies.
115 * src/location.h, src/location.c (empty_location): New.
116 * src/reader.h, src/reader.c (grammar_start_symbol_set)
117 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
118 (grammar_current_rule_symbol_append)
119 (grammar_current_rule_action_append): Expect a location as argument.
120 * src/reader.c (grammar_midrule_action): Adjust to attach an
121 action's location as dummy symbol location.
122 * src/symtab.h, src/symtab.c (startsymbol_location): New.
123 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
124 the line numbers.
125
1921f1d7
AD
1262002-06-14 Akim Demaille <akim@epita.fr>
127
128 Grammar declarations may be found in the grammar section.
129
130 * src/parse-gram.y (rules_or_grammar_declaration): New.
131 (declarations): Each declaration may end with a semicolon, not
132 just...
133 (grammar_declaration): `"%union"'.
134 (grammar): Branch to rules_or_grammar_declaration.
135
4515534c
AD
1362002-06-14 Akim Demaille <akim@epita.fr>
137
138 * src/main.c (main): Invoke scanner_free.
139
f958596b
AD
1402002-06-14 Akim Demaille <akim@epita.fr>
141
142 * src/output.c (m4_invoke): Extracted from...
143 (output_skeleton): here.
144 Free tempfile.
145
2c569025
AD
1462002-06-14 Akim Demaille <akim@epita.fr>
147
148 * src/parse-gram.y (directives, directive, gram)
149 (grammar_directives, precedence_directives, precedence_directive):
150 Rename as...
151 (declarations, declaration, grammar, grammar_declaration)
152 (precedence_declaration, precedence_declarator): these.
153 (symbol_declaration): New.
154
592e8d4d
AD
1552002-06-14 Akim Demaille <akim@epita.fr>
156
157 * src/files.c (action_obstack): Remove, unused.
158 (output_obstack): Remove it, and all its dependencies, as it is no
159 longer needed.
160 * src/reader.c (epilogue_set): Build the epilogue in the
161 muscle_obstack.
162 * src/output.h, src/output.c (muscle_obstack): Move to...
163 * src/muscle_tab.h, src/muscle_tab.h: here.
164 (muscle_init): Initialize muscle_obstack.
165 (muscle_free): New.
166 * src/main.c (main): Call it.
167
0c15323d
AD
1682002-06-14 Akim Demaille <akim@epita.fr>
169
170 * src/location.h: New, extracted from...
171 * src/reader.h: here.
172 * src/Makefile.am (noinst_HEADERS): Merge into
173 (bison_SOURCES): this.
174 Add location.h.
175 * src/parse-gram.y: Use location_t instead of Bison's.
176 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
177 Use location_t instead of ints.
178
e96c9728
AD
1792002-06-14 Akim Demaille <akim@epita.fr>
180
181 * data/bison.simple, data/bison.c++: Be sure to restore the
182 current #line when returning to the skeleton contents after having
183 exposed the input file's #line.
184
75d1fe16
AD
1852002-06-12 Akim Demaille <akim@epita.fr>
186
187 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
188 eager.
189 * tests/actions.at (Exotic Dollars): New.
190
6c35d22c
AD
1912002-06-12 Akim Demaille <akim@epita.fr>
192
193 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
194 ['"/] too eagerly.
195 * tests/input.at (Torturing the Scanner): New.
196
1d6412ad
AD
1972002-06-11 Akim Demaille <akim@epita.fr>
198
199 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
200 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
201 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
202 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
203 * src/reader.c (reader): Use it.
204
4cdb01db
AD
2052002-06-11 Akim Demaille <akim@epita.fr>
206
207 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
208 Adjust all callers.
209 (scanner_last_string_free): New.
210
44995b2e
AD
2112002-06-11 Akim Demaille <akim@epita.fr>
212
213 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
214 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
215 (last_string, YY_OBS_FREE): New.
216 Use them when returning an ID.
217
e9955c83
AD
2182002-06-11 Akim Demaille <akim@epita.fr>
219
220 Have Bison grammars parsed by a Bison grammar.
221
222 * src/reader.c, src/reader.h (prologue_augment): New.
223 * src/reader.c (copy_definition): Remove.
224
225 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
226 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
227 (grammar_current_rule_prec_set, grammar_current_rule_check)
228 (grammar_current_rule_symbol_append)
229 (grammar_current_rule_action_append): Export.
230 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
231 (symbol_list_action_append): Remove.
232 Hook the routines from reader.
233 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
234 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
235
236 * src/reader.c (read_declarations): Remove, unused.
237
238 * src/parse-gram.y: Handle the epilogue.
239 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
240 (grammar_start_symbol_set): this.
241 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
242 * src/reader.c (readgram): Remove, unused.
243 (reader): Adjust to insert eoftoken and axiom where appropriate.
244
245 * src/reader.c (copy_dollar): Replace with...
246 * src/scan-gram.h (handle_dollar): this.
247 * src/parse-gram.y: Remove `%thong'.
248
249 * src/reader.c (copy_at): Replace with...
250 * src/scan-gram.h (handle_at): this.
251
252 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
253 New.
254
255 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
256 time being.
257
258 * src/reader.h, src/reader.c (grammar_rule_end): New.
259
260 * src/parse.y (current_type, current_class): New.
261 Implement `%nterm', `%token' support.
262 Merge `%term' into `%token'.
263 (string_as_id): New.
264 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
265 type name.
266
267 * src/parse-gram.y: Be sure to handle properly the beginning of
268 rules.
269
270 * src/parse-gram.y: Handle %type.
271 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
272
273 * src/parse-gram.y: More directives support.
274 * src/options.c: No longer handle source directives.
275
276 * src/parse-gram.y: Fix %output.
277
278 * src/parse-gram.y: Handle %union.
279 Use the prologue locations.
280 * src/reader.c (parse_union_decl): Remove.
281
282 * src/reader.h, src/reader.c (epilogue_set): New.
283 * src/parse-gram.y: Use it.
284
285 * data/bison.simple, data/bison.c++: b4_stype is now either not
286 defined, then default to int, or to the contents of %union,
287 without `union' itself.
288 Adjust.
289 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
290
291 * src/output.c (actions_output): Don't output braces, as they are
292 already handled by the scanner.
293
294 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
295 characters to themselves.
296
297 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
298 that the epilogue has a proper #line.
299
300 * src/parse-gram.y: Handle precedence/associativity.
301
302 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
303 a terminal.
304 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
305 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
306 at all to define terminals that cannot be emitted.
307
308 * src/scan-gram.l: Escape M4 characters.
309
310 * src/scan-gram.l: Working properly with escapes in user
311 strings/characters.
312
313 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
314 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
315 grammar.
316 Use more modest sizes, as for the time being the parser does not
317 release memory, and therefore the process swallows a huge amount
318 of memory.
319
320 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
321 stricter %token grammar.
322
323 * src/symtab.h (associativity): Add `undef_assoc'.
324 (symbol_precedence_set): Do nothing when passed an undef_assoc.
325 * src/symtab.c (symbol_check_alias_consistence): Adjust.
326
327 * tests/regression.at (Invalid %directive): Remove, as it is now
328 meaningless.
329 (Invalid inputs): Adjust to the new error messages.
330 (Token definitions): The new grammar doesn't allow too many
331 eccentricities.
332
333 * src/lex.h, src/lex.c: Remove.
334 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
335 (copy_character, copy_string2, copy_string, copy_identifier)
336 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
337 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
338 (parse_action): Remove.
339 * po/POTFILES.in: Adjust.
340
2e047461
AD
3412002-06-11 Akim Demaille <akim@epita.fr>
342
343 * src/reader.c (parse_action): Don't store directly into the
344 rule's action member: return the action as a string.
345 Don't require `rule_length' as an argument: compute it.
346 (grammar_current_rule_symbol_append)
347 (grammar_current_rule_action_append): New, eved out from
348 (readgram): here.
349 Remove `action_flag', `rulelength', unused now.
350
9af3fbce
AD
3512002-06-11 Akim Demaille <akim@epita.fr>
352
353 * src/reader.c (grammar_current_rule_prec_set).
354 (grammar_current_rule_check): New, eved out from...
355 (readgram): here.
356 Remove `xaction', `first_rhs': useless.
357 * tests/input.at (Type clashes): New.
358 * tests/existing.at (GNU Cim Grammar): Adjust.
359
1485e106
AD
3602002-06-11 Akim Demaille <akim@epita.fr>
361
362 * src/reader.c (grammar_midrule_action): New, Eved out from
363 (readgram): here.
364
da4160c3
AD
3652002-06-11 Akim Demaille <akim@epita.fr>
366
367 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
368 New.
369 (readgram): Use them as replacement of inlined code, crule and
370 crule1.
371
f6d0f937
AD
3722002-06-11 Akim Demaille <akim@epita.fr>
373
374 * src/reader.c (grammar_end, grammar_symbol_append): New.
375 (readgram): Use them.
376 Make the use of `p' as local as possible.
377
69078d4b
AD
3782002-06-10 Akim Demaille <akim@epita.fr>
379
380 GCJ's parser requires the tokens to be defined before the prologue.
381
382 * data/bison.simple: Output the token definition before the user's
383 prologue.
384 * tests/regression.at (Braces parsing, Duplicate string)
385 (Mixing %token styles): Check the output from bison.
386 (Early token definitions): New.
387
5e424082
AD
3882002-06-10 Akim Demaille <akim@epita.fr>
389
390 * src/symtab.c (symbol_user_token_number_set): Don't complain when
391 assigning twice the same user number to a token, so that we can
392 use it in...
393 * src/lex.c (lex): here.
394 Also use `symbol_class_set' instead of hand written code.
395 * src/reader.c (parse_assoc_decl): Likewise.
396
44536b35
AD
3972002-06-10 Akim Demaille <akim@epita.fr>
398
399 * src/symtab.c, src/symtab.c (symbol_class_set)
400 (symbol_user_token_number_set): New.
401 * src/reader.c (parse_token_decl): Use them.
402 Use a switch instead of ifs.
403 Use a single argument.
404
8b9f2372
AD
4052002-06-10 Akim Demaille <akim@epita.fr>
406
407 Remove `%thong' support as it is undocumented, unused, duplicates
408 `%token's job, and creates useless e-mail traffic with people who
409 want to know what it is, why it is undocumented, unused, and
410 duplicates `%token's job.
411
412 * src/reader.c (parse_thong_decl): Remove.
413 * src/options.c (option_table): Remove "thong".
414 * src/lex.h (tok_thong): Remove.
415
3ae2b51f
AD
4162002-06-10 Akim Demaille <akim@epita.fr>
417
418 * src/symtab.c, src/symtab.c (symbol_type_set)
419 (symbol_precedence_set): New.
420 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
421 (value_components_used): Remove, unused.
422
2f1afb73
AD
4232002-06-09 Akim Demaille <akim@epita.fr>
424
425 Move symbols handling code out of the reader.
426
427 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
428 (axiom): Move to...
429 * src/symtab.h, src/symtab.c: here.
430
431 * src/gram.c (start_symbol): Remove: use startsymbol->number.
432 * src/reader.c (startval): Rename as...
433 * src/symtab.h, src/symtab.c (startsymbol): this.
434 * src/reader.c: Adjust.
435
436 * src/reader.c (symbol_check_defined, symbol_make_alias)
437 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
438 (token_translations_init)
439 Move to...
440 * src/symtab.c: here.
441 * src/reader.c (packsymbols): Move to...
442 * src/symtab.h, src/symtab.c (symbols_pack): here.
443 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
444 argument.
445
e9bca3ad
AD
4462002-06-03 Akim Demaille <akim@epita.fr>
447
448 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
449 then statements.
450
86eff183
AD
4512002-06-03 Akim Demaille <akim@epita.fr>
452
453 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
454 structs with non literals.
455 * src/scan-skel.l: never-interactive.
456 * src/conflicts.c (enum conflict_resolution_e): No trailing
457 comma.
458 * src/getargs.c (usage): Split long literal strings.
459 Reported by Hans Aberg.
460
717be197
AD
4612002-05-28 Akim Demaille <akim@epita.fr>
462
463 * data/bison.c++: Use C++ ostreams.
464 (cdebug_): New member.
465
670ddffd
AD
4662002-05-28 Akim Demaille <akim@epita.fr>
467
468 * src/output.c (output_skeleton): Be sure to allocate enough room
469 for `/' _and_ for `\0' in full_skeleton.
470
769b430f
AD
4712002-05-28 Akim Demaille <akim@epita.fr>
472
473 * data/bison.c++: Catch up with bison.simple:
474 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
475 and Paul Eggert <eggert@twinsun.com>: `error' handing.
476 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
477 and popping traces.
478
7067cb36
PH
4792002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
480
481 * src/output.c (output_skeleton): Put an explicit path in front of
482 the skeleton file name, rather than relying on the -I directory,
483 to partially alleviate effects of having a skeleton file lying around
484 in the current directory.
769b430f 485
4a713ec2
PH
4862002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
487
769b430f 488 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
489 obstack_printf should be obstack_fgrow1.
490
b408954b
AD
4912002-05-26 Akim Demaille <akim@epita.fr>
492
493 * src/state.h (state_t): `solved_conflicts' is a new member.
494 * src/LR0.c (new_state): Set it to 0.
495 * src/conflicts.h, src/conflicts.c (print_conflicts)
496 (free_conflicts, solve_conflicts): Rename as...
497 (conflicts_print, conflicts_free, conflicts_solve): these.
498 Adjust callers.
499 * src/conflicts.c (enum conflict_resolution_e)
500 (solved_conflicts_obstack): New, used by...
501 (log_resolution): this.
502 Adjust to attach the conflict resolution to each state.
503 Complete the description with the precedence/associativity
504 information.
505 (resolve_sr_conflict): Adjust.
506 * src/print.c (print_state): Output its solved_conflicts.
507 * tests/conflicts.at (Unresolved SR Conflicts)
508 (Solved SR Conflicts): Exercise --report=all.
509
a49aecd5
AD
5102002-05-26 Akim Demaille <akim@epita.fr>
511
512 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
513 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
514 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
515 (token_number_t, item_number_as_token_number)
516 (token_number_as_item_number, muscle_insert_token_number_table):
517 Rename as...
518 (symbol_number_t, item_number_as_symbol_number)
519 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
520 these, since it is more appropriate.
521
5504898e
AD
5222002-05-26 Akim Demaille <akim@epita.fr>
523
524 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
525 `Error:' lines.
526 * data/bison.simple (yystos) [YYDEBUG]: New.
527 (yyparse) [YYDEBUG]: Display the symbols which are popped during
528 error recovery.
529 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
530
ec3bc396
AD
5312002-05-25 Akim Demaille <akim@epita.fr>
532
533 * doc/bison.texinfo (Debugging): Split into...
534 (Tracing): this new section, its former contents, and...
535 (Understanding): this new section.
536 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
537 by...
538 (report_flag): this.
539 Adjust all dependencies.
540 (report_args, report_types, report_argmatch): New.
541 (usage, getargs): Report/support -r, --report.
542 * src/options.h
543 (struct option_table_struct): Rename as..,
544 (struct option_table_s): this.
545 Rename the `set_flag' member to `flag' to match with getopt_long's
546 struct.
547 * src/options.c (option_table): Split verbose into an entry for
548 %verbose, and another for --verbose.
549 Support --report/-r, so remove -r from the obsolete --raw.
550 * src/print.c: Attach full item sets and lookaheads reports to
551 report_flag instead of trace_flag.
552 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
553
78df8250
PE
5542002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
555 and Paul Eggert <eggert@twinsun.com>
769b430f 556
78df8250
PE
557 * data/bison.simple (yyparse): Correct error handling to conform to
558 POSIX and yacc. Specifically, after syntax error is discovered,
559 do not reduce further before shifting the error token.
560 Clean up the code a bit by removing the labels yyerrdefault,
561 yyerrhandle, yyerrpop.
562 * NEWS: Document the above.
563
c0c9ea05
PH
5642002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
565
566 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
567 type; it isn't always big enough, since it doesn't necessarily
568 include non-terminals.
769b430f 569 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
570 the latter can be removed.
571 (yy_token_number_type): Remove, only one use.
572 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
573 don't use TokenNumberType as element type.
769b430f 574
c0c9ea05
PH
575 * tests/regression.at: Modify expected output to agree with change
576 to yyr1 and yytranslate.
769b430f 577
6390a83f
FK
5782002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
579
580 * src/reader.c (parse_action): Use copy_character instead of
581 obstack_1grow.
582
db7c8e9a
AD
5832002-05-13 Akim Demaille <akim@epita.fr>
584
585 * tests/regression.at (Token definitions): Prototype yylex and
586 yyerror.
587
fcc61800
PH
5882002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
589
158c687b 590 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
591 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
592 32-bit arithmetic.
593 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
594
5683e9b2
AD
5952002-05-07 Akim Demaille <akim@epita.fr>
596
597 * tests/synclines.at: Be sure to prototype yylex and yyerror to
598 avoid GCC warnings.
599
0c2d3f4c
AD
6002002-05-07 Akim Demaille <akim@epita.fr>
601
602 Kill GCC warnings.
603
604 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
605 over the RHS of each rule.
606 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
607 * src/state.h (state_t): Member `nitems' is unsigned short.
608 * src/LR0.c (get_state): Adjust.
609 * src/reader.c (packgram): Likewise.
610 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
611 `Type'.
612 (muscle_insert_int_table): Remove, unused.
613 (prepare_rules): Remove `max'.
614
1565b720
AD
6152002-05-06 Akim Demaille <akim@epita.fr>
616
617 * src/closure.c (print_firsts): Display of the symbol tags.
618 (bitmatrix_print): Move to...
619 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
620 here.
621 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
622
cfaee611
AD
6232002-05-06 Akim Demaille <akim@epita.fr>
624
625 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
626 hash_do_for_each.
627
458be8e0
AD
6282002-05-06 Akim Demaille <akim@epita.fr>
629
630 * src/LR0.c (new_state, get_state): Instead of using the global
631 `kernel_size' and `kernel_base', have two new arguments:
632 `core_size' and `core'.
633 Adjust callers.
634
a900a624
AD
6352002-05-06 Akim Demaille <akim@epita.fr>
636
637 * src/reader.c (packgram): No longer end `ritem' with a 0
638 sentinel: it is not used.
639
d4e7d3a1
AD
6402002-05-05 Akim Demaille <akim@epita.fr>
641
642 New experimental feature: display the lookaheads in the report and
643 graph.
644
645 * src/print (print_core): When --trace-flag, display the rules
646 lookaheads.
647 * src/print_graph.c (print_core): Likewise.
648 Swap the arguments.
649 Adjust caller.
650
39ceb25b
AD
6512002-05-05 Akim Demaille <akim@epita.fr>
652
653 * tests/torture.at (Many lookaheads): New test.
654
5372019f
AD
6552002-05-05 Akim Demaille <akim@epita.fr>
656
657 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
658 (GENERATE_MUSCLE_INSERT_TABLE): this.
659 (output_int_table, output_unsigned_int_table, output_short_table)
660 (output_token_number_table, output_item_number_table): Replace with...
661 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
662 (muscle_insert_short_table, muscle_insert_token_number_table)
663 (muscle_insert_item_number_table): these.
664 Adjust all callers.
665 (prepare_tokens): Don't free `translations', since...
666 * src/reader.h, src/reader.c (grammar_free): do it.
667 Move to...
668 * src/gram.h, src/gram.c (grammar_free): here.
669 * data/bison.simple, data/bison.c++: b4_token_number_max is now
670 b4_translate_max.
671
5df5f6d5
AD
6722002-05-05 Akim Demaille <akim@epita.fr>
673
674 * src/output.c (output_unsigned_int_table): New.
675 (prepare_rules): `i' is unsigned.
676 `prhs', `rline', `r2' are unsigned int.
677 Rename muscle `rhs_number_max' as `rhs_max'.
678 Output muscles `prhs_max', `rline_max', and `r2_max'.
679 Free rline and r1.
680 * data/bison.simple, data/bison.c++: Adjust to use these muscles
681 to compute types instead of constant types.
682 * tests/regression.at (Web2c Actions): Adjust.
683
b87f8b21
AD
6842002-05-04 Akim Demaille <akim@epita.fr>
685
686 * src/symtab.h (SALIAS, SUNDEF): Rename as...
687 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
688 Adjust dependencies.
689 * src/output.c (token_definitions_output): Be sure not to output a
690 `#define 'a'' when fed with `%token 'a' "a"'.
691 * tests/regression.at (Token definitions): New.
692
8bb936e4
PE
6932002-05-03 Paul Eggert <eggert@twinsun.com>
694
695 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
696 for K&R C.
697
6982002-05-03 gettextize <bug-gnu-gettext@gnu.org>
699
700 * Makefile.am (SUBDIRS): Remove intl.
701 (EXTRA_DIST): Add config/config.rpath.
702
53c71a12
AD
7032002-05-03 Akim Demaille <akim@epita.fr>
704
705 * data/bison.simple (m4_if): Don't output empty enums.
706 And actually, output valid enum definitions :(.
707
289dd0cf
AD
7082002-05-03 Akim Demaille <akim@epita.fr>
709
710 * configure.bat: Remove, completely obsolete.
711 * Makefile.am (EXTRA_DIST): Adjust.
712 Don't distribute config.rpath...
713 * config/Makefile.am (EXTRA_DIST): Do it.
714
db85e524
AD
7152002-05-03 Akim Demaille <akim@epita.fr>
716
717 * configure.in (GETTEXT_VERSION): New.
718 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
719
83ccf991
AD
7202002-05-03 Akim Demaille <akim@epita.fr>
721
722 * data/bison.simple (b4_token_enum): New.
723 (b4_token_defines): Use it to output tokens both as #define and
724 enums.
725 Suggested by Paul Eggert.
726 * src/output.c (token_definitions_output): Don't output spurious
727 white spaces.
728
1f418995
AD
7292002-05-03 Akim Demaille <akim@epita.fr>
730
731 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
732
45119f04
RA
7332002-05-02 Robert Anisko <robert@lrde.epita.fr>
734
735 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
736 Update the stack class, give a try to deque as the default container.
737
b2d52318
AD
7382002-05-02 Akim Demaille <akim@epita.fr>
739
740 * data/bison.simple (yyparse): Do not implement @$ = @1.
741 (YYLLOC_DEFAULT): Adjust to do it.
742 * doc/bison.texinfo (Location Default Action): Fix.
743
3a8b4109
AD
7442002-05-02 Akim Demaille <akim@epita.fr>
745
746 * src/reader.c (parse_braces): Merge into...
747 (parse_action): this.
748
84614e13
AD
7492002-05-02 Akim Demaille <akim@epita.fr>
750
751 * configure.in (ALL_LINGUAS): Remove.
752 * po/LINGUAS, hr.po: New.
753
fdbcd8e2
AD
7542002-05-02 Akim Demaille <akim@epita.fr>
755
756 Remove the so called hairy (semantic) parsers.
757
758 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
759 * src/gram.h, src/gram.c (semantic_parser): Remove.
760 (rule_t): Remove the guard and guard_line members.
761 * src/lex.h (token_t): remove tok_guard.
762 * src/options.c (option_table): Remove %guard and %semantic_parser
763 support.
764 * src/output.c, src/output.h (guards_output): Remove.
765 (prepare): Adjust.
766 (token_definitions_output): Don't output the `T'
767 tokens (???).
768 (output_skeleton): Don't output the guards.
769 * src/files.c, src/files.c (attrsfile): Remove.
770 * src/reader.c (symbol_list): Remove the guard and guard_line
771 members.
772 Adjust dependencies.
773 (parse_guard): Remove.
774 * data/bison.hairy: Remove.
775 * doc/bison.texinfo (Environment Variables): Remove occurrences of
776 BISON_HAIRY.
777
82b6cb3f
AD
7782002-05-02 Akim Demaille <akim@epita.fr>
779
780 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
781 (parse_guard): Rename the formal argument `stack_offset' as
782 `rule_length', which is more readable.
783 Adjust callers.
784 (copy_at, copy_dollar): Instead of outputting the hard coded
785 values of $$, $n and so forth, output invocation to b4_lhs_value,
786 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
787 Note: this patch partially drops `semantic-parser' support: it
788 always does `rule_length - n', where semantic parsers ought to
789 always use `-n'.
82b6cb3f
AD
790 * data/bison.simple, data/bison.c++ (b4_lhs_value)
791 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
792
6cbfbcc5
AD
7932002-05-02 Akim Demaille <akim@epita.fr>
794
795 * configure.in (AC_INIT): Bump to 1.49b.
796 (AM_INIT_AUTOMAKE): Short invocation.
797
b8548114
AD
7982002-05-02 Akim Demaille <akim@epita.fr>
799
800 Version 1.49a.
801
c20cd1fa
AD
8022002-05-01 Akim Demaille <akim@epita.fr>
803
804 * src/skeleton.h: Remove.
805
8a9566d4
AD
8062002-05-01 Akim Demaille <akim@epita.fr>
807
808 * src/skeleton.h: Fix the #endif.
809 Reported by Magnus Fromreide.
810
8c6d399a
PE
8112002-04-26 Paul Eggert <eggert@twinsun.com>
812
813 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
814 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 815 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 816
2b7ed18a
RA
8172002-04-25 Robert Anisko <robert@lrde.epita.fr>
818
819 * src/scan-skel.l: Postprocess quadrigraphs.
820
821 * src/reader.c (copy_character): New function, used to output
822 single characters while replacing `[' and `]' with quadrigraphs, to
823 avoid troubles with M4 quotes.
824 (copy_comment): Output characters with copy_character.
825 (read_additionnal_code): Likewise.
826 (copy_string2): Likewise.
827 (copy_definition): Likewise.
828
829 * tests/calc.at: Exercise M4 quoting.
830
34a89c50
AD
8312002-04-25 Akim Demaille <akim@epita.fr>
832
833 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
834 between `!' and the command.
835 Reported by Paul Eggert.
836
0dd1580a
RA
8372002-04-24 Robert Anisko <robert@lrde.epita.fr>
838
839 * tests/calc.at: Exercise prologue splitting.
840
841 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
842 `b4_post_prologue' instead of `b4_prologue'.
843
844 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
845 muscles.
846 (output): Free pre_prologue_obstack and post_prologue_obstack.
847 * src/files.h, src/files.c (attrs_obstack): Remove.
848 (pre_prologue_obstack, post_prologue_obstack): New.
849 * src/reader.c (copy_definition): Add a parameter to specify the
850 obstack to fill, instead of using attrs_obstack unconditionally.
851 (read_declarations): Pass pre_prologue_obstack to copy_definition if
852 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
853
83c1796f
PE
8542002-04-23 Paul Eggert <eggert@twinsun.com>
855
856 * data/bison.simple: Remove unnecessary commentary and white
857 space differences from 1_29-branch.
858 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
859
860 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
861 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
862 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
863 constructors or destructors.
864
865 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
866
1207eeac
AD
8672002-04-23 Akim Demaille <akim@epita.fr>
868
869 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
870 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
871 location with columns.
872 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
873 All reported by Paul Eggert.
874
78ab8f67
AD
8752002-04-22 Akim Demaille <akim@epita.fr>
876
877 * src/reduce.c (dump_grammar): Move to...
878 * src/gram.h, src/gram.c (grammar_dump): here.
879 Be sure to separate long item numbers.
880 Don't read the members of a rule's prec if its nil.
881
133c20e2
AD
8822002-04-22 Akim Demaille <akim@epita.fr>
883
884 * src/output.c (table_size, table_grow): New.
885 (MAXTABLE): Remove, replace uses with table_size.
886 (pack_vector): Instead of dying when the table is too big, grow it.
887
9515e8a7
AD
8882002-04-22 Akim Demaille <akim@epita.fr>
889
890 * data/bison.simple (yyr1): Its type is that of a token number.
891 * data/bison.c++ (r1_): Likewise.
892 * tests/regression.at (Web2c Actions): Adjust.
893
23c5a174
AD
8942002-04-22 Akim Demaille <akim@epita.fr>
895
896 * src/reader.c (token_translations_init): 256 is now the default
897 value for the error token, i.e., it will be assigned another
898 number if the user assigned 256 to one of her tokens.
899 (reader): Don't force 256 to error.
900 * doc/bison.texinfo (Symbols): Adjust.
901 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
902 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
903 etc. instead of 10, 20, 30 (which was used to `jump' over error
904 (256) and undefined (2)).
905
5fbb0954
AD
9062002-04-22 Akim Demaille <akim@epita.fr>
907
908 Propagate more token_number_t.
909
910 * src/gram.h (token_number_as_item_number)
911 (item_number_as_token_number): New.
912 * src/output.c (GENERATE_OUTPUT_TABLE): New.
913 Use it to create output_item_number_table and
914 output_token_number_table.
915 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
916 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
917 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
918 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
919
4f940944
AD
9202002-04-22 Akim Demaille <akim@epita.fr>
921
922 * src/output.h, src/output.c (get_lines_number): Remove.
923
3ded9a63
AD
9242002-04-19 Akim Demaille <akim@epita.fr>
925
926 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
927 as Lex/Flex'.
928 (Debugging): More details about enabling the debugging features.
929 (Table of Symbols): Describe $$, $n, @$, and @n.
930 Suggested by Tim Josling.
931
e0c471a9
AD
9322002-04-19 Akim Demaille <akim@epita.fr>
933
934 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
935
fecc10cd
AD
9362002-04-10 Akim Demaille <akim@epita.fr>
937
938 * src/system.h: Rely on HAVE_LIMITS_H.
939 Suggested by Paul Eggert.
940
51dec47b
AD
9412002-04-09 Akim Demaille <akim@epita.fr>
942
943 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
944 full stderr, and strip it according to the bison options, instead
945 of composing the error message from different bits.
946 This makes it easier to check for several error messages.
947 Adjust all the invocations.
948 Add an invocation exercising the error token.
949 Add an invocation demonstrating a stupid error message.
950 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
951 Adjust the tests.
952 Error message are for stderr, not stdout.
953
007a50a4
AD
9542002-04-09 Akim Demaille <akim@epita.fr>
955
956 * src/gram.h, src/gram.c (error_token_number): Remove, use
957 errtoken->number.
958 * src/reader.c (reader): Don't specify the user token number (2)
959 for $undefined, as it uselessly prevents using it.
960 * src/gram.h (token_number_t): Move to...
961 * src/symtab.h: here.
962 (state_t.number): Is a token_number_t.
963 * src/print.c, src/reader.c: Use undeftoken->number instead of
964 hard coded 2.
965 (Even though this 2 is not the same as above: the number of the
966 undeftoken remains being 2, it is its user token number which
967 might not be 2).
968 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
969 `user_token_number_max'.
970 Output `undef_token_number'.
971 * data/bison.simple, data/bison.c++: Use them.
972 Be sure to map invalid yylex return values to
973 `undef_token_number'. This saves us from gratuitous SEGV.
974
975 * tests/conflicts.at (Solved SR Conflicts)
976 (Unresolved SR Conflicts): Adjust.
977 * tests/regression.at (Web2c Actions): Adjust.
978
06446ccf
AD
9792002-04-08 Akim Demaille <akim@epita.fr>
980
981 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
982 Adding #line.
983 Remove the duplicate `typedefs'.
984 (RhsNumberType): Fix the declaration and various other typos.
985 Use __ofile__.
986 * data/bison.simple: Use __ofile__.
987 * src/scan-skel.l: Handle __ofile__.
988
62a3e4f0
AD
9892002-04-08 Akim Demaille <akim@epita.fr>
990
991 * src/gram.h (item_number_t): New, the type of item numbers in
992 RITEM. Note that it must be able to code symbol numbers as
993 positive number, and the negation of rule numbers as negative
994 numbers.
995 Adjust all dependencies (pretty many).
996 * src/reduce.c (rule): Remove this `short *' pointer: use
997 item_number_t.
998 * src/system.h (MINSHORT, MAXSHORT): Remove.
999 Include `limits.h'.
1000 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1001 (shortcpy): Remove.
1002 (MAXTABLE): Move to...
1003 * src/output.c (MAXTABLE): here.
1004 (prepare_rules): Use output_int_table to output rhs.
1005 * data/bison.simple, data/bison.c++: Adjust.
1006 * tests/torture.at (Big triangle): Move the limit from 254 to
1007 500.
1008 * tests/regression.at (Web2c Actions): Ajust.
1009
1010 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1011 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1012 passes, but produces negative #line number, once fixed, GCC is
1013 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1014 C), it passes.
1015 * src/state.h (state_h): Code input lines on ints, not shorts.
1016
bb88b0fc
AD
10172002-04-08 Akim Demaille <akim@epita.fr>
1018
1019 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1020 and then the grammar.
1021
9a636f47
AD
10222002-04-08 Akim Demaille <akim@epita.fr>
1023
1024 * src/system.h: No longer using strndup.
1025
680e8701
AD
10262002-04-07 Akim Demaille <akim@epita.fr>
1027
1028 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1029 * src/output.c (output_table_data): Return the longest number.
1030 (prepare_tokens): Output `token_number_max').
1031 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1032 New.
1033 Use them to define yy_token_number_type/TokenNumberType.
1034 Use this type for yytranslate.
1035 * tests/torture.at (Big triangle): Push the limit from 124 to
1036 253.
1037 * tests/regression.at (Web2c Actions): Adjust.
1038
817e9f41
AD
10392002-04-07 Akim Demaille <akim@epita.fr>
1040
1041 * tests/torture.at (Big triangle): New.
1042 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1043 * tests/existing.at: here.
1044
5123689b
AD
10452002-04-07 Akim Demaille <akim@epita.fr>
1046
1047 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1048 nritems.
1049 Adjust dependencies.
1050
f3849179
AD
10512002-04-07 Akim Demaille <akim@epita.fr>
1052
1053 * src/reader.c: Normalize increments to prefix form.
1054
bd02036a
AD
10552002-04-07 Akim Demaille <akim@epita.fr>
1056
1057 * src/reader.c, symtab.c: Remove debugging code.
1058
db8837cb
AD
10592002-04-07 Akim Demaille <akim@epita.fr>
1060
1061 Rename all the `bucket's as `symbol_t'.
1062
1063 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1064 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1065 * src/symtab.c, src/symtab.h (bucket): Rename as...
1066 (symbol_t): this.
1067 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1068 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1069 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1070 (buckets_new, buckets_free, buckets_do): Rename as...
1071 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1072 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1073 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1074 (symbols_new, symbols_free, symbols_do): these.
1075
72a23c97
AD
10762002-04-07 Akim Demaille <akim@epita.fr>
1077
1078 Use lib/hash for the symbol table.
1079
1080 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1081 EOF.
1082 * src/lex.c (lex): Set the `number' member of new terminals.
1083 * src/reader.c (bucket_check_defined, bucket_make_alias)
1084 (bucket_check_alias_consistence, bucket_translation): New.
1085 (reader, grammar_free, readgram, token_translations_init)
1086 (packsymbols): Adjust.
1087 (reader): Number the predefined tokens.
1088 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1089 for predefined tokens.
1090 * src/symtab.h (bucket): Remove all the hash table related
1091 members.
1092 * src/symtab.c (symtab): Replace by...
1093 (bucket_table): this.
1094 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1095 (buckets_new, buckets_do): New.
1096
280a38c3
AD
10972002-04-07 Akim Demaille <akim@epita.fr>
1098
1099 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1100 (start_symbol, max_user_token_number, semantic_parser)
1101 (error_token_number): Initialize.
1102 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1103 Initialize.
1104 (reader): Don't.
1105 (errtoken, eoftoken, undeftoken, axiom): Extern.
1106
03b31c0c
AD
11072002-04-07 Akim Demaille <akim@epita.fr>
1108
1109 * src/gram.h (rule_s): prec and precsym are now pointers
1110 to the bucket giving the priority/associativity.
1111 Member `associativity' removed: useless.
1112 * src/reduce.c, src/conflicts.c: Adjust.
1113
8b3df748
AD
11142002-04-07 Akim Demaille <akim@epita.fr>
1115
1116 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1117 Properly escape the symbols' TAG when outputting them.
1118
e601aa1d
AD
11192002-04-07 Akim Demaille <akim@epita.fr>
1120
1121 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1122
b0299a2e
AD
11232002-04-07 Akim Demaille <akim@epita.fr>
1124
1125 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1126 (LArule): this, which is an array to rule_t*.
1127 * src/print.c, src/conflicts.c: Adjust.
1128
d7e1f00c
AD
11292002-04-07 Akim Demaille <akim@epita.fr>
1130
1131 * src/gram.h (rule_t): Rename `number' as `user_number'.
1132 `number' is a new member.
1133 Adjust dependencies.
1134 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1135
cc9305dd
AD
11362002-04-07 Akim Demaille <akim@epita.fr>
1137
1138 As a result of the previous patch, it is no longer needed
1139 to reorder ritem itself.
1140
1141 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1142
b0940840
AD
11432002-04-07 Akim Demaille <akim@epita.fr>
1144
1145 Be sure never to walk through RITEMS, but use only data related to
1146 the rules themselves. RITEMS should be banished.
1147
1148 * src/output.c (output_token_translations): Rename as...
1149 (prepare_tokens): this.
1150 In addition to `translate', prepare the muscles `tname' and
1151 `toknum', which were handled by...
1152 (output_rule_data): this.
1153 Remove, and move the remainder of its outputs into...
1154 (prepare_rules): this new routines, which also merges content from
1155 (output_gram): this.
1156 (prepare_rules): Be sure never to walk through RITEMS.
1157 (output_stos): Rename as...
1158 (prepare_stos): this.
1159 (output): Always invoke prepare_states, after all, just don't use it
1160 in the output if you don't need it.
1161
643a5994
AD
11622002-04-07 Akim Demaille <akim@epita.fr>
1163
1164 * src/LR0.c (new_state): Display `nstates' as the name of the
1165 newly created state.
1166 Adjust to initialize first_state and last_state if needed.
1167 Be sure to distinguish the initial from the final state.
1168 (new_states): Create the itemset of the initial state, and use
1169 new_state.
1170 * src/closure.c (closure): Now that the initial state has its
1171 items properly set, there is no need for a special case when
1172 creating `ruleset'.
1173
1174 As a result, now the rule 0, reducing to $axiom, is visible in the
1175 outputs. Adjust the test suite.
1176
1177 * tests/conflicts.at (Solved SR Conflicts)
1178 (Unresolved SR Conflicts): Adjust.
1179 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1180 * tests/conflicts.at (S/R in initial): New.
1181
b4c4ccc2
AD
11822002-04-07 Akim Demaille <akim@epita.fr>
1183
1184 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1185 the RHS of the rules.
1186 * src/output.c (output_gram): Likewise.
1187
bba97eb2
AD
11882002-04-07 Akim Demaille <akim@epita.fr>
1189
1190 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1191 bucket.
1192 Adjust all dependencies.
1193 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1194 `number' of the buckets too.
1195 * src/gram.h: Include `symtab.h'.
1196 (associativity): Move to...
1197 * src/symtab.h: here.
1198 No longer include `gram.h'.
1199
c3b407f4
AD
12002002-04-07 Akim Demaille <akim@epita.fr>
1201
1202 * src/gram.h, src/gram.c (rules_rhs_length): New.
1203 (ritem_longest_rhs): Use it.
1204 * src/gram.h (rule_t): `number' is a new member.
1205 * src/reader.c (packgram): Set it.
1206 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1207 the end of `rules', and count them out of `nrules'.
1208 (reduce_output, dump_grammar): Adjust.
1209 * src/print.c (print_grammar): It is no longer needed to check for
1210 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1211 * tests/reduce.at (Reduced Automaton): New test.
1212
11652ab3
AD
12132002-04-07 Akim Demaille <akim@epita.fr>
1214
1215 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1216 lacking `+ 1' to nrules, Bison reported as useless a token if it
1217 was used solely to set the precedence of the last rule...
1218
26b23c1a
AD
12192002-04-07 Akim Demaille <akim@epita.fr>
1220
1221 * data/bison.c++, data/bison.simple: Don't output the current file
1222 name in #line, to avoid useless diffs between two identical
1223 outputs under different names.
1224
18bcecb0
AD
12252002-04-07 Akim Demaille <akim@epita.fr>
1226
1227 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1228 Normalize loops to using `< nrules + 1', not `<= nrules'.
1229
fa770c86
AD
12302002-04-07 Akim Demaille <akim@epita.fr>
1231
1232 * TODO: Update.
1233
d9b739c3
AD
12342002-04-07 Akim Demaille <akim@epita.fr>
1235
1236 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1237 bucket.value as bucket.number.
1238
99013900
AD
12392002-04-07 Akim Demaille <akim@epita.fr>
1240
1241 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1242 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1243 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1244 RHS, instead of being an index in RITEMS.
1245
e966383b
PE
12462002-04-04 Paul Eggert <eggert@twinsun.com>
1247
1248 * doc/bison.texinfo: Update copyright date.
1249 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1250 (Symbols): Warn about running Bison in one character set,
1251 but compiling and/or running in an incompatible one.
1252 Warn about character code 256, too.
1253
12542002-04-03 Paul Eggert <eggert@twinsun.com>
1255
1256 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1257 YYERROR_VERBOSE is nonzero, not whether it is defined.
1258
1259 Merge changes from bison-1_29-branch.
c307773e 1260
8d6c48b9
PE
12612002-03-20 Paul Eggert <eggert@twinsun.com>
1262
1263 Merge fixes from Debian bison_1.34-1.diff.
1264
1265 * configure.in (AC_PREREQ): 2.53.
1266
e53c6322
AD
12672002-03-20 Akim Demaille <akim@epita.fr>
1268
1269 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1270
9ffbeca7
PE
12712002-03-19 Paul Eggert <eggert@twinsun.com>
1272
21db0b2a
PE
1273 * src/bison.simple (YYCOPY): New macro.
1274 (YYSTACK_RELOCATE): Use it.
1275 Remove Type arg; no longer needed. All callers changed.
1276 (yymemcpy): Remove; no longer needed.
1277
9ffbeca7
PE
1278 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1279 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1280
642cb8f8
AD
12812002-03-19 Akim Demaille <akim@epita.fr>
1282
1283 Test and fix the #line outputs.
1284
1285 * tests/atlocal.at (GCC): New.
1286 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1287 (Prologue synch line, ,%union synch line, Postprologue synch line)
1288 (Action synch line, Epilogue synch line): New tests.
1289 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1290 * data/bison.simple, data/bison.c++: Use it.
1291
3c31a486
AD
12922002-03-19 Akim Demaille <akim@epita.fr>
1293
1294 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1295 (Solved SR Conflicts, %expect not enough, %expect right)
1296 (%expect too much): Move to...
1297 * tests/conflicts.at: this new file.
1298
0d8bed56
AD
12992002-03-19 Akim Demaille <akim@epita.fr>
1300
1301 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1302 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1303 that we can move to enums for instance.
1304 * src/output.c (token_definitions_output): Output a list of
1305 `token-name, token-number' instead of the #define.
1306 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1307
9208d17f
AD
13082002-03-14 Akim Demaille <akim@epita.fr>
1309
1310 Use Gettext 0.11.1.
1311
af27eacb
RA
13122002-03-09 Robert Anisko <robert@lrde.epita.fr>
1313
1314 * data/bison.c++: Make the user able to add members to the generated
1315 parser by subclassing.
1316
9101a310
RA
13172002-03-05 Robert Anisko <robert@lrde.epita.fr>
1318
1319 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1320 a character.
1321 Reported by Nicolas Tisserand and Nicolas Burrus.
1322
fff9bf0b
RA
13232002-03-04 Robert Anisko <robert@lrde.epita.fr>
1324
1325 * src/reader.c: Warn about lacking semi-colons, do not complain.
1326
64dba31e
RA
13272002-03-04 Robert Anisko <robert@lrde.epita.fr>
1328
1329 * data/bison.c++: Remove a debug line.
1330
374f5a14
RA
13312002-03-04 Robert Anisko <robert@lrde.epita.fr>
1332
1333 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1334 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1335 provide a default implementation.
1336
bfcf1f3a
AD
13372002-03-04 Akim Demaille <akim@epita.fr>
1338
1339 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1340 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1341 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1342 * tests/semantic.at (Parsing Guards): Similarly.
1343 * src/reader.at (readgram): Complain if the last rule is not ended
1344 with a semi-colon.
1345
65ccf9fc
AD
13462002-03-04 Akim Demaille <akim@epita.fr>
1347
1348 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1349 * src/closure.c: here.
1350 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1351 RTC.
1352 * src/warshall.h, src/warshall.c: Remove.
1353 * tests/sets.at (Broken Closure): Adjust.
1354
d0039cbc
AD
13552002-03-04 Akim Demaille <akim@epita.fr>
1356
1357 * src/output.c (output_skeleton): tempdir is const.
1358 bytes_read is unused.
1359
345cea78
AD
13602002-03-04 Akim Demaille <akim@epita.fr>
1361
1362 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1363 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1364 Update.
1365 From Michael Hayes.
1366
564801f7
AD
13672002-03-04 Akim Demaille <akim@epita.fr>
1368
1369 * src/closure.c (closure): `r' is unused.
1370
e5352bc7
AD
13712002-03-04 Akim Demaille <akim@epita.fr>
1372
1373 * tests/sets.at (Broken Closure): Add the ending `;'.
1374 * src/reader.at (readgram): Complain if a rule is not ended with a
1375 semi-colon.
1376
914feea9
AD
13772002-03-04 Akim Demaille <akim@epita.fr>
1378
1379 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1380 (count_sr_conflicts): Use bitset_count.
1381 * src/reduce.c (inaccessable_symbols): Ditto.
1382 (bits_size): Remove.
1383 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1384
f0250de6
AD
13852002-03-04 Akim Demaille <akim@epita.fr>
1386
1387 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1388 * src/reduce.c: Remove the `bitset_zero's following the
1389 `bitset_create's, as now it is performed by the latter.
1390
ef017502
AD
13912002-03-04 Akim Demaille <akim@epita.fr>
1392
1393 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1394 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1395 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1396 latest sources from Michael.
1397
76514394
AD
13982002-03-04 Akim Demaille <akim@epita.fr>
1399
1400 * src/output.c (output): Don't free the grammar.
1401 * src/reader.c (grammar_free): New.
1402 * src/main.c (main): Call it and don't free symtab here.
1403
55024580
AD
14042002-03-04 Akim Demaille <akim@epita.fr>
1405
1406 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1407 before returning.
1408 Reported by Benoit Perrot.
1409
f9abaa2c
AD
14102002-03-04 Akim Demaille <akim@epita.fr>
1411
1412 Use bitset operations when possible, not loops over bits.
1413
1414 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1415 bitset_or.
1416 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1417 * src/reduce.c (useless_nonterminals): Formatting changes.
1418 * src/warshall.c (TC): Use bitset_or.
1419
0e721e75
AD
14202002-03-04 Akim Demaille <akim@epita.fr>
1421
1422 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1423 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1424 Ditto.
1425
0fb1ffb1
AD
14262002-03-04 Akim Demaille <akim@epita.fr>
1427
1428 * src/lalr.c (F): Now a bitset*.
1429 Adjust all dependencies.
1430
b86796bf
AD
14312002-03-04 Akim Demaille <akim@epita.fr>
1432
1433 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1434 Adjust all dependencies.
1435
602bbf31
AD
14362002-03-04 Akim Demaille <akim@epita.fr>
1437
1438 * src/L0.c, src/LR0.h (nstates): Be size_t.
1439 Adjust comparisons (signed vs unsigned).
1440 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1441 bitset*.
1442 Adjust all dependencies.
1443
d8a0245c
AD
14442002-03-04 Akim Demaille <akim@epita.fr>
1445
1446 * src/closure.c (firsts): Now, also a bitset.
1447 Adjust all dependencies.
1448 (varsetsize): Remove, now unused.
1449 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1450
34ba9743
AD
14512002-03-04 Akim Demaille <akim@epita.fr>
1452
1453 * src/print.c: Convert to use bitset.h, not hand coded iterations
1454 over ints.
1455
ed86e78c
AD
14562002-03-04 Akim Demaille <akim@epita.fr>
1457
1458 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1459
dfdb1797
AD
14602002-03-04 Akim Demaille <akim@epita.fr>
1461
1462 * src/closure.c (ruleset): Be a bitset.
1463 (rulesetsize): Remove.
1464
7086e707
AD
14652002-03-04 Akim Demaille <akim@epita.fr>
1466
1467 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1468 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1469 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1470 * src/closure.c (fderives): Be an array of bitsets.
1471
98254360
RA
14722002-02-28 Robert Anisko <robert@lrde.epita.fr>
1473
1474 * data/bison.c++: Merge the two generated headers. Insert a copyright
1475 notice in each output file.
1476
a75c057f
AD
14772002-02-28 Akim Demaille <akim@epita.fr>
1478
1479 * data/bison.c++: Copy the prologue of bison.simple to fetch
1480 useful M4 definitions, such as b4_header_guard.
1481
06b00abc
AD
14822002-02-25 Akim Demaille <akim@epita.fr>
1483
1484 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
1485 translator friendly scheme for the bgr
1486 copyright notice.
06b00abc 1487
70e7d534
AD
14882002-02-25 Akim Demaille <akim@epita.fr>
1489
1490 * src/output.c (header_output): Remove, now handled completely via
1491 M4.
1492
abe017f6
AD
14932002-02-25 Akim Demaille <akim@epita.fr>
1494
1495 * m4/m4.m4: New, from CVS Autoconf.
1496 * configure.in: Invoke it.
1497 * src/output.c (output_skeleton): Use its result instead of the
1498 hard coded name.
1499
381fb12e
AD
15002002-02-25 Akim Demaille <akim@epita.fr>
1501
1502 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1503 Fileutils 4.1.5.
1504 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1505 * src/output.c (output_skeleton): Use mkstemp to create a real
1506 temporary file.
1507 Move the filling of `skeleton' and its muscle to...
1508 (prepare): here.
1509 (output): Move the definition of the prologue muscle to...
1510 (prepare): here.
1511 * src/system.h (DEFAULT_TMPDIR): New.
1512
6f38107f
PE
15132002-02-14 Paul Eggert <eggert@twinsun.com>
1514
1515 Remove the support for C++ namespace cleanliness; it was
1516 causing more problems than it was curing, since it didn't work
1517 properly on some nonstandard C++ compilers. This can wait
1518 for a proper C++ parser.
1519
1520 * NEWS: Document this.
1521 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1522 of C++, as it's treated like C now.
1523 * src/bison.simple (YYSTD): Remove.
1524 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1525 Treat C++ just like Standard C instead of trying to support
1526 namespace cleanliness.
1527
80cce3da
AD
15282002-02-14 Akim Demaille <akim@epita.fr>
1529
1530 * tests/regression.at (else): Adjust to Andreas' change.
1531
842e8679
AD
15322002-02-14 Akim Demaille <akim@epita.fr>
1533
1534 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1535
4bda3f10
AD
15362002-02-13 Andreas Schwab <schwab@suse.de>
1537
1538 * src/output.c (output_rule_data): Don't output NULL, it might
1539 not be defined yet.
1540
4162fa07 15412002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 1542
4162fa07
RA
1543 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
1544 (Copyright notice): Update.
b418ecd8 1545
bd16a5dc
AD
15462002-02-11 Akim Demaille <akim@epita.fr>
1547
1548 * tests/regression.at (%nonassoc and eof): Don't include
1549 nonportable headers.
1550
8d69a1a3
RA
15512002-02-08 Robert Anisko <robert@lrde.epita.fr>
1552
1553 * data/bison.c++: Correct error recovery. Make the user able to
1554 initialize the starting location.
1555
9b2d0677
AD
15562002-02-07 Akim Demaille <akim@epita.fr>
1557
1558 * tests/input.at: New.
1559
69e2658b
RA
15602002-02-07 Robert Anisko <robert@lrde.epita.fr>
1561
1562 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 1563 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
1564 directives around tables only needed for debugging.
1565
4aacc3a7
RA
15662002-02-07 Robert Anisko <robert@lrde.epita.fr>
1567
1568 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1569 C++ parsers.
1570 (yy::b4_name::parse): Use print_.
1571
762a801e
RA
15722002-02-07 Robert Anisko <robert@lrde.epita.fr>
1573
1574 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1575
4bb2bc3f
RA
15762002-02-07 Robert Anisko <robert@lrde.epita.fr>
1577
1578 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1579 C++ parsers.
1580 (yy::b4_name::parse): Build verbose error messages, and use error_.
1581
6b45a3ca
RA
15822002-02-06 Robert Anisko <robert@lrde.epita.fr>
1583
1584 * data/bison.c++: Fix m4 quoting in comments.
1585
50997c6e
RA
15862002-02-06 Robert Anisko <robert@lrde.epita.fr>
1587
1588 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1589 not expanded by m4.
1590
3f3eed27
AD
15912002-02-05 Akim Demaille <akim@epita.fr>
1592
1593 * data/bison.c++: Adjust to the M4 back end.
1594 More is certainly needed.
1595
be2a1a68
AD
15962002-02-05 Akim Demaille <akim@epita.fr>
1597
1598 Give a try to M4 as a back end.
1599
1600 * lib/readpipe.c: New, from wdiff.
1601 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1602 BISON_HAIRY.
1603 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1604 specific values. Now it is m4 that performs the lookup.
1605 * src/parse-skel.y: Remove.
1606 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1607 * src/output.c (actions_output, guards_output)
1608 (token_definitions_output): No longer keeps track of the output
1609 line number, hence remove the second argument.
1610 (guards_output): Check against the guard member of a rule, not the
1611 action member.
1612 Adjust callers.
1613 (output_skeleton): Don't look for the skeleton location, let m4 do
1614 that.
1615 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1616 file will be used.
1617 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1618 (prepare): Given that for the time being changesyntax is not
1619 usable in M4, rename the muscles using `-' to `_'.
1620 Define `defines_flag', `output_parser_name' and `output_header_name'.
1621 * src/output.h (actions_output, guards_output)
1622 (token_definitions_output): Adjust prototypes.
1623 * src/scan-skel.l: Instead of scanning the skeletons, it now
1624 processes the output of m4: `__oline__' and `#output'.
1625 * data/bison.simple: Adjust to be used by M4(sugar).
1626 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1627 to date.
1628 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1629 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1630 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1631 shamelessly stolen from CVS Autoconf.
1632
beda758b
AD
16332002-02-05 Akim Demaille <akim@epita.fr>
1634
1635 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1636 * configure.in: Check for the declarations of free and malloc.
1637 * src/muscle_tab.c: Adjust.
1638
5ece6d43
AD
16392002-02-05 Akim Demaille <akim@epita.fr>
1640
1641 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1642 which have no values.
1643
5bb18f9a
AD
16442002-02-05 Akim Demaille <akim@epita.fr>
1645
1646 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1647 * data/: here.
1648
894dd62e
PE
16492002-01-29 Paul Eggert <eggert@twinsun.com>
1650
1651 * src/bison.simple (YYSIZE_T): Do not define merely because
1652 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1653 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1654
82841af7
AD
16552002-01-27 Akim Demaille <akim@epita.fr>
1656
1657 Fix `%nonassoc and eof'.
1658
1659 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1660 which were not properly copied! Replace
1661 memcpy (res->errs, src->errs, src->nerrs);
1662 with
1663 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
1664 !!!
1665 * tests/regression.at (%nonassoc and eof): Adjust to newest
1666 Autotest: `.' is not in the PATH.
1667
318b76e9
AD
16682002-01-27 Akim Demaille <akim@epita.fr>
1669
1670 * tests/sets.at (AT_EXTRACT_SETS): New.
1671 (Nullable): Use it.
1672 (Firsts): New.
1673
30d2f3d5
AD
16742002-01-26 Akim Demaille <akim@epita.fr>
1675
1676 * tests/actions.at, tests/calc.at, tests/headers.at,
1677 * tests/torture.at: Adjust to the newest Autotest which no longer
1678 forces `.' in the PATH.
1679
30f8c395
AD
16802002-01-25 Akim Demaille <akim@epita.fr>
1681
1682 * tests/regression.at (%nonassoc and eof): New.
1683 Suggested by Robert Anisko.
1684
29ae55f1
AD
16852002-01-24 Akim Demaille <akim@epita.fr>
1686
1687 Bison dumps core when trying to complain about broken input files.
1688 Reported by Cris van Pelt.
1689
1690 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
1691 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
1692 into...
1693 (Invalid inputs): Strengthen: exercise parse_percent_token.
1694
2b548aa6
RA
16952002-01-24 Robert Anisko <robert.anisko@epita.fr>
1696
1697 * src/Makefile.am: Add bison.c++.
1698 * src/bison.c++: New skeleton.
1699
bb0146c2
AD
17002002-01-21 Paolo Bonzini <bonzini@gnu.org>
1701
1702 * po/it.po: New.
1703
bec30531
AD
17042002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
1705
1706 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
1707
fc6edc45
MA
17082002-01-20 Marc Autret <marc@gnu.org>
1709
1710 * src/files.c (compute_output_file_names): Fix
1711
5e5d5415
MA
17122002-01-20 Marc Autret <marc@gnu.org>
1713
1714 * tests/output.at: New test.
1715 * src/files.c (compute_base_names): Don't map extensions when
1716 the YACC flag is set, use defaults.
1717 Reported by Evgeny Stambulchik.
1718
44ea3fbd
MA
17192002-01-20 Marc Autret <marc@gnu.org>
1720
bb0146c2 1721 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
1722 compilers as well (i.e. the vendor C compiler).
1723 Suggested by Albert Chin-A-Young.
1724
338963d1
TVH
17252002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
1726
1727 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
1728 canonical definition.
1729 * src/system.h: Use the canonical definition for PARAMS (avoids
1730 a conflict with the macro from lib/hash.h).
1731
c57b2479
AD
17322002-01-11 Akim Demaille <akim@epita.fr>
1733
1734 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 1735 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 1736
b85810ae
AD
17372002-01-09 Akim Demaille <akim@epita.fr>
1738
1739 * src/files.c, src/files.h (output_infix): New.
1740 (tab_extension): Remove.
1741 (compute_base_names): Compute the former, drop the latter.
1742 * src/output.c (prepare): Insert the muscles `output-infix', and
1743 `output-suffix'.
1744 * src/parse-skel.y (string, string.1): New.
1745 (section.header): Use it.
1746 (section.yacc): Remove.
1747 (prefix): Remove too.
1748 * src/scan-skel.l: Adjust.
1749 * src/bison.simple, src/bison.hairy: Adjust.
1750
cae60122
AD
17512002-01-09 Akim Demaille <akim@epita.fr>
1752
1753 * configure.in (WERROR_CFLAGS): Compute it.
1754 * src/Makefile.am (CFLAGS): Pass it.
1755 * tests/atlocal.in (CFLAGS): Idem.
1756 * src/files.c: Fix a few warnings.
1757 (get_extension_index): Remove, unused.
1758
ae404801
AD
17592002-01-08 Akim Demaille <akim@epita.fr>
1760
1761 * src/getargs.c (AS_FILE_NAME): New.
1762 (getargs): Use it to convert DOSish file names.
1763 * src/files.c (base_name): Rename as full_base_name to avoid
1764 clashes with `base_name ()'.
1765 (filename_split): New.
1766 (compute_base_names): N-th rewrite, using filename_split.
1767
22312b71
AD
17682002-01-08 Akim Demaille <akim@epita.fr>
1769
1770 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
1771 New, stolen from the Fileutils 4.1.
1772 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
1773 * configure.in: Check for the presence of memrchr, and of its
1774 prototype.
1775
a67cef01
TVH
17762002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
1777
1778 * lib/hash.h (__P): Added definition for this macro.
1779 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1780 BUILT_SOURCES, to ensure they are generated first.
1781 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1782 %error-verbose to allow bootstrapping with bison 1.30x.
1783
2b25d624
AD
17842002-01-06 Akim Demaille <akim@epita.fr>
1785
1786 * src/reader.c (parse_braces): Don't fetch the next char, the
1787 convention is to fetch on entry.
1788 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1789 'switch' without a following semicolon.
1790 * tests/regression.at (braces parsing): New.
1791
3460813b
AD
17922002-01-06 Akim Demaille <akim@epita.fr>
1793
1794 Bison is dead wrong in its RR conflict reports.
1795
1796 * tests/torture.at (GNU Cim Grammar): New.
1797 * src/conflicts.c (count_rr_conflicts): Fix.
1798
73784c64
AD
17992002-01-06 Akim Demaille <akim@epita.fr>
1800
1801 Creating package.m4 from configure.ac causes too many problems.
1802
1803 * tests/Makefile.am (package.m4): Create it by hand,
1804 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1805
25d81090
AD
18062002-01-06 Akim Demaille <akim@epita.fr>
1807
1808 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1809 skeleton.h.
1810
a9b8959e
PE
18112002-01-04 Paul Eggert <eggert@twinsun.com>
1812
1813 * doc/bison.texinfo (Debugging):
1814 Remove YYSTDERR; it's no longer defined or used.
1815 Also, s/cstdio.h/cstdio/.
1816
25d81090
AD
18172002-01-03 Akim Demaille <akim@epita.fr>
1818
1819 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1820
1109455c
AD
18212002-01-03 Akim Demaille <akim@epita.fr>
1822
1823 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1824 tracing code to --trace, wait for a better --trace option, with
1825 args.
1826
7ea5e977
AD
18272002-01-03 Akim Demaille <akim@epita.fr>
1828
1829 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1830 The ISO C++ standard is extremely clear about it: stderr is
1831 considered a macro, not a regular symbol (see table 94 `Header
1832 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1833 Therefore std:: does not apply to it. It still does with fprintf.
1834 Also, s/cstdio.h/cstdio/.
1835
fab5b110
AD
18362002-01-03 Akim Demaille <akim@epita.fr>
1837
1838 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1839 for non system headers.
1840
aed7fd9b
AD
18412002-01-02 Akim Demaille <akim@epita.fr>
1842
1843 Equip the skeleton chain with location tracking, runtime trace,
1844 pure parser and scanner.
1845
1846 * src/parse-skel.y: Request a pure parser, locations, and prefix
1847 renaming.
1848 (%union): Having several members with the same type does not help
1849 type mismatches, simplify.
1850 (YYPRINT, yyprint): New.
1851 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1852 (skel_error): this.
1853 Handle locations.
1854 * src/scan-skel.l: Adjust to these changes.
1855 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1856 (LOCATION_PRINT, skel_control_t): New.
1857
24fad99e
AD
18582001-12-30 Akim Demaille <akim@epita.fr>
1859
1860 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1861 replace `gb' with BLANKS.
1862 * src/scan-skel.l: Adjust.
1863
a4b36db4
AD
18642001-12-30 Akim Demaille <akim@epita.fr>
1865
1866 * src/system.h: We don't need nor want bcopy.
1867 Throw away MS-DOS crap: we don't need getpid.
1868 * configure.in: We don't need strndup. It was even causing
1869 problems: because Flex includes the headers *before* us,
1870 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1871 not visible.
1872 * lib/xstrndup.c: New.
1873 * src/scan-skel.l: Use it.
1874 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1875 * src/parse-skel.y: Use %directives instead of #defines.
1876
1239777d
AD
18772001-12-30 Akim Demaille <akim@epita.fr>
1878
1879 * src/skeleton.h: New.
1880 * src/output.c (output_parser, output_master_parser): Remove, dead
1881 code.
1882 * src/output.h (get_lines_number, actions_output, guards_output)
1883 (token_definitions_output): Prototype them.
1884 * src/parse-skel.y: Add the license notice.
1885 Include output.h and skeleton.h.
1886 (process_skeleton): Returns void, and takes a single parameter.
1887 * src/scan-skel.l: Add the license notice.
1888 Include skeleton.h.
1889 Don't use %option yylineno: it seems that then Flex imagines
1890 REJECT has been used, and therefore it won't reallocate its
1891 buffers (which makes no other sense to me than a bug). It results
1892 in warnings for `unused: yy_flex_realloc'.
1893
9b3add5b
RA
18942001-12-30 Robert Anisko <robert.anisko@epita.fr>
1895
1896 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1897 (MUSCLE_INSERT_PREFIX): ...to there.
1898 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1899 (MUSCLE_INSERT_PREFIX): Move from here...
1900
1901 * src/bison.hairy: Add a section directive. Put braces around muscle
1902 names. This parser skeleton is still broken, but Bison should not
1903 choke on a bad muscle 'syntax'.
1904 * src/bison.simple: Add a section directive. Put braces around muscle
1905 names.
1906
1907 * src/files.h (strsuffix, stringappend): Add declarations.
1908 (tab_extension): Add declaration.
1909 (short_base_name): Add declaration.
1910
1911 * src/files.c (strsuffix, stringappend): No longer static. These
1912 functions are used in the skeleton parser.
1913 (tab_extension): New.
1914 (compute_base_names): Use the computations done in this function
fab5b110 1915 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
1916 names.
1917 (short_base_name): No longer static.
1918
1919 * src/output.c (output_skeleton): New.
1920 (output): Disable call to output_master_parser, and give a try to
1921 a new skeleton handling system.
1922 (guards_output, actions_output): No longer static.
1923 (token_definitions_output, get_lines_number): No longer static.
1924
1925 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1926
fab5b110 1927 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
1928 parse-skel.y.
1929
1930 * src/parse-skel.y: New file.
1931 * src/scan-skel.l: New file.
1932
b5b61c61
AD
19332001-12-29 Akim Demaille <akim@epita.fr>
1934
1935 %name-prefix is broken.
1936
1937 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1938 Adjust all dependencies.
1939 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1940 %name-prefix.
1941
1942 Renaming yylval but not yylloc is not consistent. Now we do.
1943
1944 * src/bison.simple: Prefix yylloc if used.
1945 * doc/bison.texinfo (Decl Summary): Document that.
1946
8c9a50be
AD
19472001-12-29 Akim Demaille <akim@epita.fr>
1948
1949 * doc/bison.texinfo: Promote `%long-directive' over
1950 `%long_directive'.
1951 Remove all references to fixed-output-files, yacc is enough.
1952
d99361e6
AD
19532001-12-29 Akim Demaille <akim@epita.fr>
1954
1955 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1956 user prologue. These are defaults.
1957 * tests/actions.at (Mid-rule actions): Make sure the user can
1958 define YYDEBUG and YYERROR_VERBOSE.
1959
b9cecb91
AD
19602001-12-29 Akim Demaille <akim@epita.fr>
1961
1962 * src/output.c (header_output): Don't forget to export YYLTYPE and
1963 yylloc.
1964 * tests/headers.at (export YYLTYPE): New, make sure it does.
1965 * tests/regression.at (%union and --defines, Invalid CPP headers):
1966 Move to...
1967 * tests/headers.at: here.
1968
aea13e97
AD
19692001-12-29 Akim Demaille <akim@epita.fr>
1970
1971 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1972
931394cb
AD
19732001-12-29 Akim Demaille <akim@epita.fr>
1974
1975 * tests/actions.at (Mid-rule actions): Output on a single line
1976 instead of several.
1977
704a47c4
AD
19782001-12-29 Akim Demaille <akim@epita.fr>
1979
1980 * doc/bison.texinfo: Formatting changes.
1981
091e20bb
AD
19822001-12-29 Akim Demaille <akim@epita.fr>
1983
1984 Don't store the token defs in a muscle, just be ready to output it
1985 on command. Now possible via `symbols'. Fixes a memory leak.
1986
1987 * src/output.c (token_definitions_output): New.
1988 (output_parser, header_output): Use it.
1989 * src/reader.c (symbols_save): Remove.
1990
cce71710
AD
19912001-12-29 Akim Demaille <akim@epita.fr>
1992
1993 * src/bison.simple: Do not provide a default for YYSTYPE and
1994 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1995 default.
1996
82c035a8
AD
19972001-12-29 Akim Demaille <akim@epita.fr>
1998
1999 Mid-rule actions are simply... ignored!
2000
2001 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2002 the empty-rule associated to the dummy symbol, not to the host
2003 rule.
2004 * tests/actions.at (Mid-rule actions): New.
2005
8419d367
AD
20062001-12-29 Akim Demaille <akim@epita.fr>
2007
2008 Memory leak.
2009
2010 * src/reader.c (reader): Free grammar.
2011
375d5806
AD
20122001-12-29 Akim Demaille <akim@epita.fr>
2013
2014 Memory leak.
2015
2016 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2017 since it allocates it for each state, although only one is needed.
2018 (allocate_storage): Do it here.
2019
f51cb8ff
AD
20202001-12-29 Akim Demaille <akim@epita.fr>
2021
2022 * src/options.h, src/options.c (create_long_option_table): Rename
2023 as...
2024 (long_option_table_new): this, with a clearer prototype.
2025 (percent_table): Remove, unused,
2026 * src/getargs.c (getargs): Adjust.
2027
29e88316
AD
20282001-12-29 Akim Demaille <akim@epita.fr>
2029
2030 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2031 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2032 as states.
2033
b9f71f19
AD
20342001-12-29 Akim Demaille <akim@epita.fr>
2035
2036 * src/lalr.c (build_relations): Rename `states' as `states1'.
2037 Sorry, I don't understand exactly what it is, no better name...
2038
1a2b5d37
AD
20392001-12-29 Akim Demaille <akim@epita.fr>
2040
2041 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2042 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2043 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2044 as rules.
2045
1cca533e
AD
20462001-12-29 Akim Demaille <akim@epita.fr>
2047
2048 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2049 ago.
2050
c03ae966
AD
20512001-12-29 Akim Demaille <akim@epita.fr>
2052
2053 * src/reader.c, src/reader.h (user_toknums): Remove.
2054 Adjust all users to use symbols[i]->user_token_number.
2055
5a670b1e
AD
20562001-12-29 Akim Demaille <akim@epita.fr>
2057
2058 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2059 Adjust all users to use symbols[i]->prec or ->assoc.
2060
ad949da9
AD
20612001-12-29 Akim Demaille <akim@epita.fr>
2062
2063 * src/reader.c, src/reader.h (tags): Remove.
2064 Adjust all users to use symbols[i]->tag.
2065
0e78e603
AD
20662001-12-29 Akim Demaille <akim@epita.fr>
2067
2068 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2069 and rule_table.
2070 * src/reader.c (packsymbols): Fill this table.
2071 Drop sprec.
2072 * src/conflicts.c (resolve_sr_conflict): Adjust.
2073 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2074 single table.
2075 Use symbols[i]->tag instead of tags[i].
2076
213e640e
AD
20772001-12-29 Akim Demaille <akim@epita.fr>
2078
2079 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2080 In addition, put a comment in there, to replace...
2081 * tests/regression.at (%union and C comments): Remove.
2082
e7b8bef1
AD
20832001-12-29 Akim Demaille <akim@epita.fr>
2084
2085 * tests/regression.at (Web2c Actions): Blindly move the actual
2086 output as expected output. The contents *seem* right to me, but I
2087 can't pretend reading perfectly parser tables... Nonetheless, all
2088 the other tests pass correctly, the table look OK, even though the
2089 presence of `$axiom' is to be noted: AFAICS it is useless (but
2090 harmless).
2091
b68e7744
AD
20922001-12-29 Akim Demaille <akim@epita.fr>
2093
2094 * src/reader.c (readgram): Don't add the rule 0 if there were no
2095 rules read. In other words, add it _after_ having performed
2096 grammar sanity checks.
2097 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2098
78d5bae9
AD
20992001-12-29 Akim Demaille <akim@epita.fr>
2100
2101 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2102 visible, and some states have now a different number.
2103
ff442794
AD
21042001-12-29 Akim Demaille <akim@epita.fr>
2105
2106 * src/reader.c (readgram): Bind the initial rule's lineno to that
2107 of the first rule.
2108 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2109 (Solved SR Conflicts): Adjust rule 0's line number.
2110
610ab194
AD
21112001-12-29 Akim Demaille <akim@epita.fr>
2112
2113 Fix the `GAWK Grammar' failure.
2114
2115 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2116 the reductions of the first state which was mistakenly confused
2117 with the final state because precisely final_state was initialized
2118 to 0.
2119 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2120 now noticed by Bison.
2121 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2122 have a reduction on $default.
2123
29d29c8f
AD
21242001-12-29 Akim Demaille <akim@epita.fr>
2125
2126 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2127 rule line numbers.
2128 * src/closure.c (print_closure): Likewise.
2129 * src/derives.c (print_derives): Likewise.
2130 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2131 now.
2132
7c6b64d0
AD
21332001-12-29 Akim Demaille <akim@epita.fr>
2134
2135 * src/lalr.c (lookaheads_print): New.
2136 (lalr): Call it when --trace-flag.
2137 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2138 are dumped.
2139
3d4daee3
AD
21402001-12-29 Akim Demaille <akim@epita.fr>
2141
2142 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2143 when walking through ritem, even via rule->rhs.
2144 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2145 (useful_production, useless_nonterminals): Likewise.
2146 (reduce_grammar_tables): Likewise, plus update nritems.
2147 * src/nullable.c (set_nullable): Likewise.
2148 * src/lalr.c (build_relations): Likewise.
2149 * tests/sets.at (Nullable): Adjust.
2150 Fortunately, now, the $axiom is no longer nullable.
2151
9e7f6bbd
AD
21522001-12-29 Akim Demaille <akim@epita.fr>
2153
2154 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2155 the 0-sentinel.
2156 * src/gram.c (ritem_longest_rhs): Likewise.
2157 * src/reduce.c (nonterminals_reduce): Likewise.
2158 * src/print_graph.c (print_graph): Likewise.
2159 * src/output.c (output_rule_data): Likewise.
2160 * src/nullable.c (set_nullable): Likewise.
2161
255ef638
AD
21622001-12-29 Akim Demaille <akim@epita.fr>
2163
2164 * src/output.c: Comment changes.
2165
0d8a7363
AD
21662001-12-27 Paul Eggert <eggert@twinsun.com>
2167
2168 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2169 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2170 Sparc, as they were causing more porting problems than the
2171 (minor) performance improvement was worth.
2172
2173 Also, catch up with 1.31's YYSTD.
2174
3db472b9
AD
21752001-12-27 Akim Demaille <akim@epita.fr>
2176
2177 * src/output.c (output_gram): Rely on nritems, not the
2178 0-sentinel. See below.
2179 Use -1 as separator, not 0.
2180 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2181 Rely on -1 as separator in yyrhs, instead of 0.
2182 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2183 twice `Now at end of input', therefore there are two lines less to
2184 expect.
2185
b365aa05
AD
21862001-12-27 Akim Demaille <akim@epita.fr>
2187
2188 * tests/regression.at (Unresolved SR Conflicts):
2189 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2190 below.
2191
30171f79
AD
21922001-12-27 Akim Demaille <akim@epita.fr>
2193
2194 * src/LR0.c (new_state): Recognize the final state by the fact it
2195 is reached by eoftoken.
2196 (insert_start_shifting_state, insert_eof_shifting_state)
2197 (insert_accepting_state, augment_automaton): Remove, since now
2198 these states are automatically computed from the initial state.
2199 (generate_states): Adjust.
2200 * src/print.c: When reporting a rule number to the user, substract
2201 1, so that the axiom rule is rule 0, and the first user rule is 1.
2202 * src/reduce.c: Likewise.
2203 * src/print_graph.c (print_core): For the time being, just as for
2204 the report, depend upon --trace-flags to dump the full set of
2205 items.
2206 * src/reader.c (readgram): Once the grammar read, insert the rule
2207 0: `$axiom: START-SYMBOL $'.
2208 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2209 number of the states has changed (the final state is no longer
2210 necessarily the last), catch up.
2211
75142d45
AD
22122001-12-27 Akim Demaille <akim@epita.fr>
2213
2214 Try to make the use of the eoftoken valid. Given that its value
2215 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2216 is used instead of > 0 where appropriate, (ii), depend upon nritems
2217 instead of the 0-sentinel.
2218
2219 * src/gram.h, src/gram.c (nritems): New.
2220 Expected to be duplication of nitems, but for the time being...
2221 * src/reader.c (packgram): Assert nritems and nitems are equal.
2222 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2223 * src/closure.c (print_closure, print_fderives): Likewise.
2224 * src/gram.c (ritem_print): Likewise.
2225 * src/print.c (print_core, print_grammar): Likewise.
2226 * src/print_graph.c: Likewise.
2227
b7c49edf
AD
22282001-12-27 Akim Demaille <akim@epita.fr>
2229
2230 * src/main.c (main): If there are complains after grammar
2231 reductions, then output the report anyway if requested, then die.
2232 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2233 * src/reader.c (eoftoken): New.
2234 (parse_token_decl): If the token being defined has value `0', it
2235 is the eoftoken.
2236 (packsymbols): No longer hack `tags' to insert `$' by hand.
2237 Be sure to preserve the value of the eoftoken.
2238 (reader): Make sure eoftoken is defined.
2239 Initialize nsyms to 0: now eoftoken is created just like the others.
2240 * src/print.c (print_grammar): Don't special case the eof token.
2241 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2242 lie anyway, albeit pleasant.
2243 * tests/calc.at: Exercise error messages with eoftoken.
2244 Change the grammar so that empty input is invalid.
2245 Adjust expectations.
2246 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2247
ec2da99f
AD
22482001-12-27 Akim Demaille <akim@epita.fr>
2249
2250 * configure.in: Check the protos of strchr ans strspn.
2251 Replace strchr if needed.
2252 * src/system.h: Provide the protos of strchr, strspn and memchr if
2253 missing.
2254 * lib/strchr.c: New.
2255 * src/reader.c (symbols_save): Use strchr.
2256
8adfa272
AD
22572001-12-27 Akim Demaille <akim@epita.fr>
2258
2259 * src/print.c, src/print_graph.c (escape): New.
2260 Use it to quote the TAGS outputs.
2261 * src/print_graph.c (print_state): Now errors are in red, and
2262 reductions in green.
2263 Prefer high to wide: output the state number on a line of its own.
2264
80dac38c
AD
22652001-12-27 Akim Demaille <akim@epita.fr>
2266
2267 * src/state.h, src/state.c (reductions_new): New.
2268 * src/LR0.c (set_state_table): Let all the states have a
2269 `reductions', even if reduced to 0.
2270 (save_reductions): Adjust.
2271 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2272 * src/print.c (print_reductions, print_actions): Adjust.
2273 * src/output.c (action_row): Adjust.
2274
2cec70b9
AD
22752001-12-27 Akim Demaille <akim@epita.fr>
2276
2277 * src/state.h, src/state.c (errs_new, errs_dup): New.
2278 * src/LR0.c (set_state_table): Let all the states have an errs,
2279 even if reduced to 0.
2280 * src/print.c (print_errs, print_reductions): Adjust.
2281 * src/output.c (output_actions, action_row): Adjust.
2282 * src/conflicts.c (resolve_sr_conflict): Adjust.
2283
13ca549a
AD
22842001-12-27 Akim Demaille <akim@epita.fr>
2285
2286 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2287
5092aba5
AD
22882001-12-27 Akim Demaille <akim@epita.fr>
2289
2290 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2291 * src/print.c: here.
2292 (lookaheadset, shiftset): New, used as additional storage by
2293 print_reductions.
2294 (print_results): Adjust.
2295 (print_shifts, print_gotos, print_errs): New, extracted from...
2296 (print_actions): here.
2297 * src/print_graph.c (print_actions): Remove dead code.
2298
11e2beca
AD
22992001-12-27 Akim Demaille <akim@epita.fr>
2300
2301 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2302 `$n' and `@n'.
2303
dac3c910
AD
23042001-12-27 Akim Demaille <akim@epita.fr>
2305
2306 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2307 (build_relations): Adjust.
2308
d0b0fefa
AD
23092001-12-27 Akim Demaille <akim@epita.fr>
2310
2311 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2312 duplication.
2313
adc8c848
AD
23142001-12-27 Akim Demaille <akim@epita.fr>
2315
2316 * src/reader.c (packgram): Catch nitems overflows.
2317
14d293ac
AD
23182001-12-27 Akim Demaille <akim@epita.fr>
2319
2320 * src/files.c, src/files.h (guard_obstack): Remove.
2321 * src/output.c (output): Adjust.
2322 * src/reader.c (parse_braces): New, factoring...
2323 (copy_action, copy_guard): these two which are renamed as...
2324 (parse_action, parse_guard): these.
2325 As a voluntary consequence, using braces around guards is now
2326 mandatory.
2327
f499b062
AD
23282001-12-27 Akim Demaille <akim@epita.fr>
2329
2330 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2331 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2332 members.
2333 (symbol_list_new): Adjust.
2334 (copy_action): action_line is the first line, not the last.
2335 (copy_guard): Just as for actions, store the `action' only, not
2336 the switch/case/break flesh.
2337 Don't parse the user action that might follow the guard, let...
2338 (readgram): do it, i.e., now, there can be an action after a
2339 guard.
2340 In other words the guard is just explicitly optional.
2341 (packgram): Adjust.
2342 * src/output.c (guards_output): New.
2343 (output_parser): Call it when needed.
2344 (output): Also free the guard and attrs obstacks.
2345 * src/files.c, src/files.h (obstack_save): Remove.
2346 (output_files): Remove.
2347 As a result, if one needs the former `.act' file, using an
2348 appropriate skeleton which requires actions and guards is now
2349 required.
2350 * src/main.c (main): Adjust.
2351 * tests/semantic.at: New.
2352 * tests/regression.at: Use `input.y' as input file name.
2353 Avoid 8+3 problems by requiring input.c when the test needs the
2354 parser.
2355
d945f5cd
AD
23562001-12-27 Akim Demaille <akim@epita.fr>
2357
2358 * src/reader.c (symbol_list_new): Be sure to initialize all the
2359 fields.
2360
d200e455
AD
23612001-12-27 Akim Demaille <akim@epita.fr>
2362
2363 All the hacks using a final pseudo state are now useless.
2364
2365 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2366 * src/lalr.c (nLA): New.
2367 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2368 instead of lookaheadsp from the pseudo state (nstate + 1).
2369
f9507c28
AD
23702001-12-27 Akim Demaille <akim@epita.fr>
2371
2372 * src/output.c (action_row, token_actions): Use a state_t instead
2373 of a integer, and nlookaheads instead of the following state's
2374 lookaheadsp.
2375
065fbd27
AD
23762001-12-27 Akim Demaille <akim@epita.fr>
2377
2378 * src/conflicts.c (log_resolution, flush_shift)
2379 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2380 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2381 (conflicts_print, print_reductions): Use a state_t instead of an
2382 integer when referring to a state.
2383 As much as possible, depend upon nlookaheads, instead of the
2384 `lookaheadsp' member of the following state (since lookaheads of
2385 successive states are successive, the difference between state n + 1
2386 and n served as the number of lookaheads for state n).
2387 * src/lalr.c (add_lookback_edge): Likewise.
2388 * src/print.c (print_core, print_actions, print_state)
2389 (print_results): Likewise.
2390 * src/print_graph.c (print_core, print_actions, print_state)
2391 (print_graph): Likewise.
2392 * src/conflicts.h: Adjust.
2393
1b177bd7
AD
23942001-12-27 Akim Demaille <akim@epita.fr>
2395
2396 * src/bison.hairy: Formatting/comment changes.
2397 ANSIfy.
2398 Remove `register' indications.
2399 Add plenty of `static'.
2400
7742ddeb
AD
24012001-12-27 Akim Demaille <akim@epita.fr>
2402
2403 * src/output.c (prepare): Drop the muscle `ntbase' which
2404 duplicates ntokens.
2405 * src/bison.simple: Formatting/comment changes.
2406 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2407 is an undocumented synonym.
2408
1fa14068
AD
24092001-12-22 Akim Demaille <akim@epita.fr>
2410
2411 * src/output.c (output_table_data): Change the prototype to use
2412 `int' for array ranges: some invocations do pass an int, not a
2413 short.
2414 Reported by Wayne Green.
2415
b9752825
AD
24162001-12-22 Akim Demaille <akim@epita.fr>
2417
2418 Some actions of web2c.y are improperly triggered.
2419 Reported by Mike Castle.
2420
2421 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2422 * tests/regression.at (Web2c): Rename as...
2423 (Web2c Report): this.
2424 (Web2c Actions): New.
2425
776209d6
AD
24262001-12-22 Akim Demaille <akim@epita.fr>
2427
2428 Reductions in web2c.y are improperly reported.
2429 Reported by Mike Castle.
2430
2431 * src/conflicts.c (print_reductions): Fix.
2432 * tests/regression.at (Web2c): New.
2433
275fc3ad
AD
24342001-12-18 Akim Demaille <akim@epita.fr>
2435
2436 Some host fail on `assert (!"foo")', which expands to
2437 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2438 Reported by Nelson Beebee.
2439
2440 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2441 `#define it_succeeded 0' and `assert (it_succeeded)'.
2442
897668ee
MA
24432001-12-17 Marc Autret <autret_m@epita.fr>
2444
2445 * src/bison.simple: Don't hard code the skeleton line and filename.
2446 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2447 New line counter 'skeleton_line' (skeleton-line muscle).
2448
ab3399e0
PE
24492001-12-17 Paul Eggert <eggert@twinsun.com>
2450
2451 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2452 YYDEBUG must be defined to a nonzero value.
2453
2454 * src/bison.simple (yytname): Do not assume that the user defines
2455 YYDEBUG to a properly parenthesized expression.
2456
3877f72b
AD
24572001-12-17 Akim Demaille <akim@epita.fr>
2458
2459 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2460 nlookaheads is a new member.
2461 Adjust all users.
2462 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2463 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2464 state.
776209d6 2465
331dbc1b
AD
24662001-12-17 Akim Demaille <akim@epita.fr>
2467
2468 * src/files.h, src/files.c (open_files, close_files): Remove.
2469 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2470 let...
2471 * src/reader.c (reader): Do it.
776209d6 2472
be750e4c
AD
24732001-12-17 Akim Demaille <akim@epita.fr>
2474
2475 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 2476
709ae8c6
AD
24772001-12-17 Akim Demaille <akim@epita.fr>
2478
2479 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2480 (flush_reduce): New.
2481 (resolve_sr_conflict): Adjust.
776209d6 2482
f87685c3
AD
24832001-12-17 Akim Demaille <akim@epita.fr>
2484
2485 * src/output.c (output_obstack): Be static and rename as...
2486 (format_obstack): this, to avoid any confusion with files.c's
2487 output_obstack.
2488 * src/reader.h (muscle_obstack): Move to...
2489 * src/output.h: here, since it's defined in output.c.
2490
837491d8
AD
24912001-12-17 Akim Demaille <akim@epita.fr>
2492
2493 * src/output.c (action_row, save_column, default_goto)
2494 (sort_actions, matching_state, pack_vector): Better variable
2495 locality.
2496
796d61fb
AD
24972001-12-17 Akim Demaille <akim@epita.fr>
2498
2499 * src/output.c: Various formatting changes.
776209d6 2500
64d15509
AD
25012001-12-17 Akim Demaille <akim@epita.fr>
2502
2503 * src/files.c (output_files): Free the output_obstack.
2504 * src/main.c (main): Call print and print_graph conditionally.
2505 * src/print.c (print): Work unconditionally.
2506 * src/print_graph.c (print_graph): Work unconditionally.
2507 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2508
fbc8ecb7
MA
25092001-12-16 Marc Autret <autret_m@epita.fr>
2510
2511 * src/output.c (actions_output): Fix. When we use %no-lines,
2512 there is one less line per action.
2513
f0440388
MA
25142001-12-16 Marc Autret <autret_m@epita.fr>
2515
2516 * src/bison.simple: Remove a useless #line directive.
2517 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2518 * src/output.c (get_lines_number): New.
776209d6 2519 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
2520 output muscles.
2521 Fix line numbering.
2522 (actions_output): Computes the number of lines taken by actions.
2523 (output_master_parser): Insert new skeleton which is the name of
2524 the output parser file name.
2525
a79986b8
MA
25262001-12-15 Marc Autret <autret_m@epita.fr>
2527
2528 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2529
4ec8e00f
MA
25302001-12-15 Marc Autret <autret_m@epita.fr>
2531
2532 * src/output.c (output_gram): Keep track of the hairy one.
2533
1a4648ff
AD
25342001-12-15 Akim Demaille <akim@epita.fr>
2535
2536 Make `make distcheck' work.
2537
2538 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2539 system.h which uses libgettext.h.
2540
9c2c67e6
AD
25412001-12-15 Akim Demaille <akim@epita.fr>
2542
2543 * src/nullable.c (set_nullable): Useless rules must be skipped,
2544 otherwise, since we range over their symbols, we might look at a
2545 nonterminal which no longer ``exists'', i.e., it is not counted in
2546 `nvars', hence we overflow our arrays.
2547
93ede233
AD
25482001-12-15 Akim Demaille <akim@epita.fr>
2549
2550 The header can also be produced directly, without any obstack!
2551 Yahoo!
2552
2553 * src/files.c, src/files.h (defines_obstack): Remove.
2554 (compute_header_macro): Global.
2555 (defines_obstack_save): Remove.
2556 * src/reader.c (parse_union_decl): No longer output to
2557 defines_obstack: its content can be found in the `stype' muscle
2558 anyway.
2559 (output_token_translations): Merge into...
2560 (symbols_output): this.
2561 Rename as...
2562 (symbols_save): this.
2563 (reader): Adjust.
2564 * src/output.c (header_output): New.
2565 (output): Call it.
2566
2666f928
AD
25672001-12-15 Akim Demaille <akim@epita.fr>
2568
2569 * src/reader.c (parse_union_decl): Instead of handling two obstack
2570 simultaneously, use one to define the `stype' muscle, and use the
2571 value of the latter to fill defines_obstack.
2572 (copy_comment): Remove.
2573 (copy_comment2): Work for a single obstack.
2574 Rename as...
2575 (copy_comment): this.
2576
428046f8
AD
25772001-12-15 Akim Demaille <akim@epita.fr>
2578
2579 * src/lex.c, src/lex.h (xgetc): No longer static.
2580 * src/reader.c (parse_union_decl): Revamp.
2581
ea52d706
AD
25822001-12-15 Akim Demaille <akim@epita.fr>
2583
2584 Still making progress in separating Bison into (i) input, (ii)
2585 process, (iii) output: now we can directly output the parser file
2586 without using table_obstack at all.
2587
2588 * src/files.c, src/files.h (table_obstack): Bye bye.
2589 (parser_file_name): New.
2590 * src/files.c (compute_output_file_names): Compute it.
2591 * src/output.c (actions_output, output_parser)
2592 (output_master_parser): To a file instead of an obstack.
2593
3f96f4dc
AD
25942001-12-15 Akim Demaille <akim@epita.fr>
2595
2596 Attach actions to rules, instead of pre-outputting them to
2597 actions_obstack.
2598
2599 * src/gram.h (rule_t): action and action_line are new members.
2600 * src/reader.c (symbol_list): Likewise.
2601 (copy_action): Save the actions within the rule.
2602 (packgram): Save them in rule_table.
2603 * src/output.c (actions_output): New.
2604 (output_parser): Use it on `%%actions'.
2605 (output_rule_data): Don't free rule_table.
2606 (output): Do it.
2607 (prepare): Don't save the `action' muscle.
2608 * src/bison.simple: s/%%action/%%actions/.
2609
51576fb3
AD
26102001-12-15 Akim Demaille <akim@epita.fr>
2611
2612 * src/reader.c (copy_action): When --yacc, don't append a `;'
2613 to the user action: let it fail if lacking.
dee049eb 2614 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 2615
2648a72d
AD
26162001-12-14 Akim Demaille <akim@epita.fr>
2617
2618 * src/lex.c (literalchar): Simply return the char you decoded, non
2619 longer mess around with obstacks and int pointers.
2620 Adjust all callers.
2621
92790e5b
AD
26222001-12-14 Akim Demaille <akim@epita.fr>
2623
2624 * src/lex.c (literalchar): Don't escape the special characters,
2625 just decode them, and keep them as char (before, eol was output as
2626 the 2 char string `\n' etc.).
2627 * src/output.c (output_rule_data): Use quotearg to output the
2628 token strings.
2629
927c1557
PE
26302001-12-13 Paul Eggert <eggert@twinsun.com>
2631
2632 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2633 Do not infringe on the global user namespace when using C++.
2634 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2635 All uses of `fprintf' and `stderr' changed.
2636
2637 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2638
ed8e1f68
AD
26392001-12-13 Akim Demaille <akim@epita.fr>
2640
2641 The computation of nullable is broken: it doesn't handle empty
2642 RHS's properly.
2643
2644 * tests/torture.at (GNU AWK Grammar): New.
2645 * tests/sets.at (Nullable): New.
2646 * src/nullable.c (set_nullable): Instead of blindly looping over
2647 `ritems', loop over the rules, and then over their rhs's.
2648
2649 Work around Autotest bugs.
2650
2651 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2652 frame, because Autotest understand lines starting with a `+' as
2653 traces from the shell. Then, they are not processed properly.
2654 Admittedly an Autotest bug, but we don't have time to wait for
2655 Autotest to catch up.
2656 * tests/regression.at (Broken Closure): Adjust to the new table
2657 frames.
2658 Move to...
2659 * tests/sets.at: here.
2660
cb581495
AD
26612001-12-13 Akim Demaille <akim@epita.fr>
2662
2663 * src/closure.c (closure): Use nrules instead of playing tricks
2664 with BITS_PER_WORD.
2665
2e729273
AD
26662001-12-13 Akim Demaille <akim@epita.fr>
2667
2668 * src/print.c (print_actions): Output the handling of `$' as the
2669 traces do: shifting the token EOF. Before EOF was treated as a
2670 nonterminal.
2671 * tests/regression.at: Adjust some tests.
2672 * src/print_graph.c (print_core): Complete the set of items via
2673 closure. The next-to-final and final states are still unsatisfying,
2674 but that's to be addressed elsewhere.
2675 No longer output the rule numbers, but do output the state number.
2676 A single loop for the shifts + gotos is enough, but picked a
2677 distinct color for each.
2678 (print_graph): Initialize and finalize closure.
2679
107f7dfb
AD
26802001-12-13 Akim Demaille <akim@epita.fr>
2681
2682 * src/reader.c (readgram): Remove dead code, an strip useless
2683 braces.
2684 (get_type): Remove, unused.
2685
9b53a24f
AD
26862001-12-12 Akim Demaille <akim@epita.fr>
2687
2688 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
2689 on that of lib/error.c.
2690
dbfb6dcd
AD
26912001-12-12 Akim Demaille <akim@epita.fr>
2692
2693 Some hosts don't like `/' in includes.
2694
2695 * src/system.h: Include libgettext.h without qualifying the path.
2696 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
2697 $(top_srcdir).
2698
c25fb648
MA
26992001-12-11 Marc Autret <autret_m@epita.fr>
2700
2701 * src/output.c (output_parser): Remove useless muscle.
2702
710ddc4f
MA
27032001-12-11 Marc Autret <autret_m@epita.fr>
2704
2705 * src/bison.simple: Remove #line just before %%epilogue. It
2706 is now handled in ...
2707 * src/reader.c (read_additionnal_code): Add the output of a
2708 #line for the epilogue.
2709
e83d80b8
MA
27102001-12-10 Marc Autret <autret_m@epita.fr>
2711
927c1557 2712 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
2713 replace precedent remove.
2714 * src/bison.simple: Remove #line before %%prologue because
2715 %%input-line is wrong at this time.
2716
971d5158
MA
27172001-12-10 Marc Autret <autret_m@epita.fr>
2718
2719 * src/reader.c (symbols_output): Clean up.
927c1557 2720 * src/output.c (output_gram, output): Clean up.
971d5158 2721
5edafffd
AD
27222001-12-10 Akim Demaille <akim@epita.fr>
2723
2724 * src/lalr.c (initialize_lookaheads): New. Extracted from...
2725 * src/LR0.c (set_state_table): here.
2726 * src/lalr.c (lalr): Call it.
2727
0279f8e9
AD
27282001-12-10 Akim Demaille <akim@epita.fr>
2729
2730 * src/state.h (shifts): Remove the `number' member: shifts are
2731 attached to state, hence no longer need to be labelled with a
2732 state number.
2733
190c4f5f
AD
27342001-12-10 Akim Demaille <akim@epita.fr>
2735
2736 Now that states have a complete set of members, the linked list of
2737 shifts is useless: just fill directly the state's shifts member.
2738
2739 * src/state.h (shifts): Remove the `next' member.
2740 * src/LR0.c (first_state, last_state): Remove.
2741 Adjust the callers.
2742 (augment_automaton): Don't look for the shifts that must be added
2743 a shift on EOF: it is those of the state we looked for! But now,
2744 since shifts are attached, it is no longer needed to looking
2745 merely by its id: its number.
2746
2a73b93d
AD
27472001-12-10 Akim Demaille <akim@epita.fr>
2748
2749 * src/LR0.c (augment_automaton): Better variable locality.
2750 Remove an impossible branch: if there is a state corresponding to
2751 the start symbol being shifted, then there is shift for the start
2752 symbol from the initial state.
2753
74392f6a
AD
27542001-12-10 Akim Demaille <akim@epita.fr>
2755
2756 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
2757 only when appropriate: when insert_start_shifting_state' is not
2758 invoked.
2759 * tests/regression.at (Rule Line Numbers): Adjust.
2760
37c82725
AD
27612001-12-10 Akim Demaille <akim@epita.fr>
2762
2763 * src/LR0.c (augment_automaton): Now that all states have shifts,
2764 merge the two cases addition shifts to the initial state.
2765
6a164e0c
AD
27662001-12-10 Akim Demaille <akim@epita.fr>
2767
2768 * src/lalr.c (set_state_table): Move to...
2769 * src/LR0.c: here.
2770 * src/lalr.c (lalr): Don't call it...
2771 * src/LR0.c (generate_states): do it.
2772 * src/LR0.h (first_state): Remove, only the table is used.
2773
7215de24
AD
27742001-12-10 Akim Demaille <akim@epita.fr>
2775
2776 * src/LR0.h (first_shift, first_reduction): Remove.
2777 * src/lalr.c: Don't use first_shift: find shifts through the
2778 states.
2779
80e25d4d
AD
27802001-12-10 Akim Demaille <akim@epita.fr>
2781
2782 * src/LR0.c: Attach shifts to states as soon as they are
2783 computed.
2784 * src/lalr.c (set_state_table): Instead of assigning shifts to
2785 state, just assert that the mapping was properly done.
2786
0ab3728b
AD
27872001-12-10 Akim Demaille <akim@epita.fr>
2788
2789 * src/LR0.c (insert_start_shift): Rename as...
2790 (insert_start_shifting_state): this.
2791 (insert_eof_shifting_state, insert_accepting_state): New.
2792 (augment_automaton): Adjust.
2793 Better locality of the variables.
2794 When looking if the start_symbol is shifted from the initial
2795 state, using `while (... symbol != start_symbol ...)' sounds
2796 better than `while (... symbol < start_symbol ...)': If fail
2797 to see how the order between symbols could be relevant!
2798
78af9bbc
AD
27992001-12-10 Akim Demaille <akim@epita.fr>
2800
2801 * src/getargs.h: Don't declare `spec_name_prefix' and
2802 `spec_file_prefix', declared by src/files.h.
2803 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2804 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2805 * src/output.c (prepare): Adjust.
2806 * src/reader.c (symbols_output): Likewise.
2807 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2808
bdef2a41
AD
28092001-12-10 Akim Demaille <akim@epita.fr>
2810
2811 * src/muscle_tab.c (muscle_init): NULL is a better default than
2812 `"0"'.
2813
3735969c
AD
28142001-12-10 Akim Demaille <akim@epita.fr>
2815
2816 * src/reader.c (reader): Calling symbols_output once is enough.
2817
49701457
AD
28182001-12-10 Akim Demaille <akim@epita.fr>
2819
2820 Now that states have a complete set of members, the linked list of
2821 reductions is useless: just fill directly the state's reductions
2822 member.
2823
2824 * src/state.h (struct reductions): Remove member `number' and
2825 `next'.
2826 * src/LR0.c (first_reduction, last_reduction): Remove.
2827 (save_reductions): Don't link the new reductions, store them in
2828 this_state.
2829 * src/lalr.c (set_state_table): No need to attach reductions to
2830 states, it's already done.
2831 * src/output.c (output_actions): No longer free the shifts, then
2832 the reductions, then the states: free all the states and their
2833 members.
2834
0edad749
AD
28352001-12-10 Akim Demaille <akim@epita.fr>
2836
2837 * src/options.c (OPTN, DRTV, BOTH): New.
2838 (option_table): Use them.
2839
0edad749
AD
2840 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2841 the job of system.h.
2842 * src/options.c: Don't include stdio.h and xalloc.h for the same
2843 reasons.
2844
5449dd0f
AD
28452001-12-10 Akim Demaille <akim@epita.fr>
2846
2847 * src/output.c (output, prepare): Make sure the values of the
2848 muscles `action' and `prologue' are 0-terminated.
2849
a870c567
AD
28502001-12-10 Akim Demaille <akim@epita.fr>
2851
2852 Clean up GCC warnings.
2853
2854 * src/reader.c (copy_action): `buf' is not used.
2855 (parse_skel_decl): Be static.
2856 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2857 * src/options.h (create_long_option_table): Have a real prototype.
2858 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2859 (hash_delete_at): Return const void *.
2860 Adjust casts to preserve the const.
2861
80df8768
AD
28622001-12-10 Akim Demaille <akim@epita.fr>
2863
2864 * configure.in: Require 2.52g.
2865 M4 is not needed, but AUTOM4TE is.
2866 * m4/m4.m4: Remove.
2867 * tests/Makefile.am: Adjust.
2868
f693ad14
AD
28692001-12-10 Akim Demaille <akim@epita.fr>
2870
2871 One structure for states is enough, even though theoretically
2872 there are LR(0) states and LALR(1) states.
2873
2874 * src/lalr.h (state_t): Remove.
2875 (state_table): Be state_t **, not state_t *.
2876 * src/state.h (core, CORE_ALLOC): Rename as...
2877 (state_t, STATE_ALLOC): this.
2878 Add the LALR(1) members: shifts, reductions, errs.
2879 * src/LR0.c (state_table): Rename as...
2880 (state_hash): this, to avoid name clashes with the global
2881 `state_table'.
2882 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2883 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2884
74ffbcb6
AD
28852001-12-10 Akim Demaille <akim@epita.fr>
2886
2887 Bison dumps core on bash.y.
2888 Reported by Pascal Bart.
2889
2890 * src/warshall.c (bitmatrix_print): New.
2891 (TC): Use it.
2892 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2893 j must be the outer loop.
2894 * tests/regression.at (Broken Closure): New.
2895
07708e19
AD
28962001-12-05 Akim Demaille <akim@epita.fr>
2897
2898 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2899 its argument.
2900