]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/symtab.h, src/symtab.c (symbol_type_set)
[bison.git] / ChangeLog
CommitLineData
1a31ed21
AD
12002-06-20 Akim Demaille <akim@epita.fr>
2
3 * src/symtab.h, src/symtab.c (symbol_type_set)
4 (symbol_destructor_set, symbol_precedence_set): The location is
5 the last argument.
6 Adjust all callers.
7
e776192e
AD
82002-06-20 Akim Demaille <akim@epita.fr>
9
10 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
11 internals.
12 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13 Takes a location.
14 * src/symtab.h, src/symtab.c (symbol_class_set)
15 (symbol_user_token_number_set): Likewise.
16 Adjust all callers.
17 Promote complain_at.
18 * tests/input.at (Type Clashes): Adjust.
19
5c1180b3
AD
202002-06-20 Akim Demaille <akim@epita.fr>
21
22 * data/bison.simple (YYLEX): Fix the declaration when
23 %pure-parser.
24
e3170060
AD
252002-06-20 Akim Demaille <akim@epita.fr>
26
27 * data/bison.simple (yysymprint): Don't print the token number,
28 just its name.
29 * tests/actions.at (Destructors): Rename as...
30 (Printers and Destructors): this.
31 Also exercise %printer.
32
253862fd
AD
332002-06-20 Akim Demaille <akim@epita.fr>
34
35 * data/bison.simple (YYDSYMPRINT): New.
36 Use it to remove many of the #if YYDEBUG/if (yydebug).
37
366eea36
AD
382002-06-20 Akim Demaille <akim@epita.fr>
39
40 * src/symtab.h, src/symtab.c (symbol_t): printer and
41 printer_location are new members.
42 (symbol_printer_set): New.
43 * src/parse-gram.y (PERCENT_PRINTER): New token.
44 Handle its associated rule.
45 * src/scan-gram.l: Adjust.
46 (handle_destructor_at, handle_destructor_dollar): Rename as...
47 (handle_symbol_code_at, handle_symbol_code_dollar): these.
48 * src/output.c (symbol_printers_output): New.
49 (output_skeleton): Call it.
50 * data/bison.simple (yysymprint): New. Cannot be named yyprint
51 since there are already many grammar files with a user `yyprint'.
52 Replace the calls to YYPRINT to calls to yysymprint.
53 * tests/calc.at: Adjust.
54 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
55 taking advantage of parser very internal details (stack size!).
56
4f25ebb0
AD
572002-06-20 Akim Demaille <akim@epita.fr>
58
59 * src/scan-gram.l: Complete the scanner with the missing patterns
60 to pacify Flex.
61 Use `quote' and `symbol_tag_get' where appropriate.
62
93b68a0e
AD
632002-06-19 Akim Demaille <akim@epita.fr>
64
65 * tests/actions.at (Destructors): Augment to test locations.
66 * data/bison.simple (yydestructor): Pass it the current location
67 if locations are enabled.
68 Prototype only when __STDC__ or C++.
69 Change the argument names to move into the yy name space: there is
70 user code here.
71
58612f1d
AD
722002-06-19 Akim Demaille <akim@epita.fr>
73
74310291
AD
74 * data/bison.simple (b4_pure_if): New.
75 Use it instead of #ifdef YYPURE.
76
772002-06-19 Akim Demaille <akim@epita.fr>
78
79 * data/bison.simple (b4_location_if): New.
58612f1d
AD
80 Use it instead of #ifdef YYLSP_NEEDED.
81
f25bfb75
AD
822002-06-19 Akim Demaille <akim@epita.fr>
83
84 Prepare @$ in %destructor, but currently don't bind it in the
85 skeleton, as %location use is not cleaned up yet.
86
87 * src/scan-gram.l (handle_dollar, handle_destructor_at)
88 (handle_action_at): New.
89 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
90 a braced_code_t and a location as additional arguments.
91 (handle_destructor_dollar): Instead of requiring `b4_eval', just
92 unquote one when outputting `b4_dollar_dollar'.
93 Adjust callers.
94 * data/bison.simple (b4_eval): Remove.
95 (b4_symbol_destructor): Adjust.
96 * tests/input.at (Invalid @n): Adjust.
97
c732d2c6
AD
982002-06-19 Zack Weinberg <zack@codesourcery.com>
99
100 * doc/bison.texinfo: Document ability to have multiple
101 prologue sections.
102
8c165d89
AD
1032002-06-18 Akim Demaille <akim@epita.fr>
104
105 * src/files.c (compute_base_names): When computing the output file
106 names from the input file name, strip the directory part.
107
ca98bf57
AD
1082002-06-18 Akim Demaille <akim@epita.fr>
109
110 * data/bison.simple.new: Comment changes.
111 Reported by Andreas Schwab.
112
0bfb02ff
AD
1132002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
114
115 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
116 there are no `label `yyoverflowlab' defined but not used' warnings
117 when yyoverflow is defined.
118
24c0aad7
AD
1192002-06-18 Akim Demaille <akim@epita.fr>
120
121 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
122 new member.
123 (symbol_destructor_set): Adjust.
124 * src/output.c (symbol_destructors_output): Output the destructor
125 locations.
126 Output the symbol name.
127 * data/bison.simple (b4_symbol_destructor): Adjust.
128
5719c109
AD
1292002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
130 and Akim Demaille <akim@epita.fr>
131
132 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
133 what's left on the stack when the error recovery hits EOF.
134 * tests/actions.at (Destructors): Complete to exercise this case.
135
9280d3ef
AD
1362002-06-17 Akim Demaille <akim@epita.fr>
137
138 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
139 arguments is really empty, not only equal to `[]'.
140 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
141 member.
142 (symbol_destructor_set): New.
143 * src/output.c (symbol_destructors_output): New.
144 * src/reader.h (brace_code_t, current_braced_code): New.
145 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
146 (handle_dollar): Rename as...
147 (handle_action_dollar): this.
148 (handle_destructor_dollar): New.
149 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
150 (grammar_declaration): Use it.
151 * data/bison.simple (yystos): Is always defined.
152 (yydestructor): New.
153 * tests/actions.at (Destructors): New.
154 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
155
dafdc66f
AD
1562002-06-17 Akim Demaille <akim@epita.fr>
157
158 * src/symlist.h, src/symlist.c (symbol_list_length): New.
159 * src/scan-gram.l (handle_dollar, handle_at): Compute the
160 rule_length only when needed.
161 * src/output.c (actions_output, token_definitions_output): Output
162 the full M4 block.
163 * src/symtab.c: Don't access directly to the symbol tag, use
164 symbol_tag_get.
165 * src/parse-gram.y: Use symbol_list_free.
166
56c47203
AD
1672002-06-17 Akim Demaille <akim@epita.fr>
168
169 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
170 (symbol_list_prepend, get_type_name): Move to...
171 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
172 (symbol_list_prepend, symbol_list_n_type_name_get): here.
173 Adjust all callers.
174 (symbol_list_free): New.
175 * src/scan-gram.l (handle_dollar): Takes a location.
176 * tests/input.at (Invalid $n): Adjust.
177
1e0bab92
AD
1782002-06-17 Akim Demaille <akim@epita.fr>
179
180 * src/reader.h, src/reader.c (symbol_list_new): Export it.
181 (symbol_list_prepend): New.
182 * src/parse-gram.y (%union): `list' is a new member.
183 (symbols.1): New, replaces...
184 (terms_to_prec.1, nterms_to_type.1): these.
185 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
186 Take a location as additional argument.
187 Adjust all callers.
188
04e60654
AD
1892002-06-15 Akim Demaille <akim@epita.fr>
190
191 * src/parse-gram.y: Move %token in the declaration section so that
192 we don't depend upon CVS Bison.
193
10e5b8bd
AD
1942002-06-15 Akim Demaille <akim@epita.fr>
195
196 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
197 * src/print.c (print_core): Use it.
198
9801d40c
AD
1992002-06-15 Akim Demaille <akim@epita.fr>
200
201 * src/conflicts.c (log_resolution): Accept the rule involved in
202 the sr conflicts instead of the lookahead number that points to
203 that rule.
204 (flush_reduce): Accept the current lookahead vector as argument,
205 instead of the index in LA.
206 (resolve_sr_conflict): Accept the current number of lookahead
207 bitset to consider for the STATE, instead of the index in LA.
208 (set_conflicts): Adjust.
209 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
210
c0263492
AD
2112002-06-15 Akim Demaille <akim@epita.fr>
212
213 * src/state.h (state_t): Replace the `lookaheadsp' member, a
214 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
215 Adjust all dependencies.
216 * src/lalr.c (initialize_lookaheads): Split into...
217 (states_lookaheads_count, states_lookaheads_initialize): these.
218 (lalr): Adjust.
219
9757c359
AD
2202002-06-15 Akim Demaille <akim@epita.fr>
221
222 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
223 out of...
224 (grammar_rules_print): here.
225 * src/reduce.c (reduce_output): Use it.
226 * tests/reduce.at (Useless Rules, Reduced Automaton)
227 (Underivable Rules): Adjust.
228
6b98e4b5
AD
2292002-06-15 Akim Demaille <akim@epita.fr>
230
231 Copy BYacc's nice way to report the grammar.
232
233 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
234 New.
235 Don't print the rules' location, it is confusing and useless.
236 (rule_print): Use grammar_rhs_print.
237 * src/print.c (print_grammar): Use grammar_rules_print.
238
6b98e4b5
AD
2392002-06-15 Akim Demaille <akim@epita.fr>
240
241 Complete and rationalize `useless thing' warnings.
242
243 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
244 (symbol_tag_print): New.
245 Use them everywhere in place of accessing directly the tag member.
246 * src/gram.h, src/gram.c (rule_print): New.
247 Use it where a rule used to be printed `by hand'.
248 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
249 (reduce_grammar_tables): Report the useless rules.
250 (reduce_print): Useless things are a warning, not an error.
251 Report it as such.
252 * tests/reduce.at (Useless Nonterminals, Useless Rules):
253 (Reduced Automaton, Underivable Rules): Adjust.
254 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
255 * tests/conflicts.at (Unresolved SR Conflicts)
256 (Solved SR Conflicts): Adjust.
257
ee000ba4
AD
2582002-06-15 Akim Demaille <akim@epita.fr>
259
260 Let symbols have a location.
261
262 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
263 (getsym): Adjust.
264 Adjust all callers.
265 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
266 Use location_t, not int.
267 * src/symtab.c (symbol_check_defined): Take advantage of the
268 location.
269 * tests/regression.at (Invalid inputs): Adjust.
270
8efe435c
AD
2712002-06-15 Akim Demaille <akim@epita.fr>
272
273 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
274 (input): Don't try to initialize yylloc here, do it in the
275 scanner.
276 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
277 * src/gram.h (rule_t): Change line and action_line into location
278 and action_location, of location_t type.
279 Adjust all dependencies.
280 * src/location.h, src/location.c (empty_location): New.
281 * src/reader.h, src/reader.c (grammar_start_symbol_set)
282 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
283 (grammar_current_rule_symbol_append)
284 (grammar_current_rule_action_append): Expect a location as argument.
285 * src/reader.c (grammar_midrule_action): Adjust to attach an
286 action's location as dummy symbol location.
287 * src/symtab.h, src/symtab.c (startsymbol_location): New.
288 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
289 the line numbers.
290
1921f1d7
AD
2912002-06-14 Akim Demaille <akim@epita.fr>
292
293 Grammar declarations may be found in the grammar section.
294
295 * src/parse-gram.y (rules_or_grammar_declaration): New.
296 (declarations): Each declaration may end with a semicolon, not
297 just...
298 (grammar_declaration): `"%union"'.
299 (grammar): Branch to rules_or_grammar_declaration.
300
4515534c
AD
3012002-06-14 Akim Demaille <akim@epita.fr>
302
303 * src/main.c (main): Invoke scanner_free.
304
f958596b
AD
3052002-06-14 Akim Demaille <akim@epita.fr>
306
307 * src/output.c (m4_invoke): Extracted from...
308 (output_skeleton): here.
309 Free tempfile.
310
2c569025
AD
3112002-06-14 Akim Demaille <akim@epita.fr>
312
313 * src/parse-gram.y (directives, directive, gram)
314 (grammar_directives, precedence_directives, precedence_directive):
315 Rename as...
316 (declarations, declaration, grammar, grammar_declaration)
317 (precedence_declaration, precedence_declarator): these.
318 (symbol_declaration): New.
319
592e8d4d
AD
3202002-06-14 Akim Demaille <akim@epita.fr>
321
322 * src/files.c (action_obstack): Remove, unused.
323 (output_obstack): Remove it, and all its dependencies, as it is no
324 longer needed.
325 * src/reader.c (epilogue_set): Build the epilogue in the
326 muscle_obstack.
327 * src/output.h, src/output.c (muscle_obstack): Move to...
328 * src/muscle_tab.h, src/muscle_tab.h: here.
329 (muscle_init): Initialize muscle_obstack.
330 (muscle_free): New.
331 * src/main.c (main): Call it.
332
0c15323d
AD
3332002-06-14 Akim Demaille <akim@epita.fr>
334
335 * src/location.h: New, extracted from...
336 * src/reader.h: here.
337 * src/Makefile.am (noinst_HEADERS): Merge into
338 (bison_SOURCES): this.
339 Add location.h.
340 * src/parse-gram.y: Use location_t instead of Bison's.
341 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
342 Use location_t instead of ints.
343
e96c9728
AD
3442002-06-14 Akim Demaille <akim@epita.fr>
345
346 * data/bison.simple, data/bison.c++: Be sure to restore the
347 current #line when returning to the skeleton contents after having
348 exposed the input file's #line.
349
75d1fe16
AD
3502002-06-12 Akim Demaille <akim@epita.fr>
351
352 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
353 eager.
354 * tests/actions.at (Exotic Dollars): New.
355
6c35d22c
AD
3562002-06-12 Akim Demaille <akim@epita.fr>
357
358 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
359 ['"/] too eagerly.
360 * tests/input.at (Torturing the Scanner): New.
361
1d6412ad
AD
3622002-06-11 Akim Demaille <akim@epita.fr>
363
364 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
365 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
366 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
367 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
368 * src/reader.c (reader): Use it.
369
4cdb01db
AD
3702002-06-11 Akim Demaille <akim@epita.fr>
371
372 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
373 Adjust all callers.
374 (scanner_last_string_free): New.
375
44995b2e
AD
3762002-06-11 Akim Demaille <akim@epita.fr>
377
378 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
379 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
380 (last_string, YY_OBS_FREE): New.
381 Use them when returning an ID.
382
e9955c83
AD
3832002-06-11 Akim Demaille <akim@epita.fr>
384
385 Have Bison grammars parsed by a Bison grammar.
386
387 * src/reader.c, src/reader.h (prologue_augment): New.
388 * src/reader.c (copy_definition): Remove.
389
390 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
391 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
392 (grammar_current_rule_prec_set, grammar_current_rule_check)
393 (grammar_current_rule_symbol_append)
394 (grammar_current_rule_action_append): Export.
395 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
396 (symbol_list_action_append): Remove.
397 Hook the routines from reader.
398 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
399 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
400
401 * src/reader.c (read_declarations): Remove, unused.
402
403 * src/parse-gram.y: Handle the epilogue.
404 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
405 (grammar_start_symbol_set): this.
406 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
407 * src/reader.c (readgram): Remove, unused.
408 (reader): Adjust to insert eoftoken and axiom where appropriate.
409
410 * src/reader.c (copy_dollar): Replace with...
411 * src/scan-gram.h (handle_dollar): this.
412 * src/parse-gram.y: Remove `%thong'.
413
414 * src/reader.c (copy_at): Replace with...
415 * src/scan-gram.h (handle_at): this.
416
417 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
418 New.
419
420 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
421 time being.
422
423 * src/reader.h, src/reader.c (grammar_rule_end): New.
424
425 * src/parse.y (current_type, current_class): New.
426 Implement `%nterm', `%token' support.
427 Merge `%term' into `%token'.
428 (string_as_id): New.
429 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
430 type name.
431
432 * src/parse-gram.y: Be sure to handle properly the beginning of
433 rules.
434
435 * src/parse-gram.y: Handle %type.
436 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
437
438 * src/parse-gram.y: More directives support.
439 * src/options.c: No longer handle source directives.
440
441 * src/parse-gram.y: Fix %output.
442
443 * src/parse-gram.y: Handle %union.
444 Use the prologue locations.
445 * src/reader.c (parse_union_decl): Remove.
446
447 * src/reader.h, src/reader.c (epilogue_set): New.
448 * src/parse-gram.y: Use it.
449
450 * data/bison.simple, data/bison.c++: b4_stype is now either not
451 defined, then default to int, or to the contents of %union,
452 without `union' itself.
453 Adjust.
454 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
455
456 * src/output.c (actions_output): Don't output braces, as they are
457 already handled by the scanner.
458
459 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
460 characters to themselves.
461
462 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
463 that the epilogue has a proper #line.
464
465 * src/parse-gram.y: Handle precedence/associativity.
466
467 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
468 a terminal.
469 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
470 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
471 at all to define terminals that cannot be emitted.
472
473 * src/scan-gram.l: Escape M4 characters.
474
475 * src/scan-gram.l: Working properly with escapes in user
476 strings/characters.
477
478 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
479 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
480 grammar.
481 Use more modest sizes, as for the time being the parser does not
482 release memory, and therefore the process swallows a huge amount
483 of memory.
484
485 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
486 stricter %token grammar.
487
488 * src/symtab.h (associativity): Add `undef_assoc'.
489 (symbol_precedence_set): Do nothing when passed an undef_assoc.
490 * src/symtab.c (symbol_check_alias_consistence): Adjust.
491
492 * tests/regression.at (Invalid %directive): Remove, as it is now
493 meaningless.
494 (Invalid inputs): Adjust to the new error messages.
495 (Token definitions): The new grammar doesn't allow too many
496 eccentricities.
497
498 * src/lex.h, src/lex.c: Remove.
499 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
500 (copy_character, copy_string2, copy_string, copy_identifier)
501 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
502 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
503 (parse_action): Remove.
504 * po/POTFILES.in: Adjust.
505
2e047461
AD
5062002-06-11 Akim Demaille <akim@epita.fr>
507
508 * src/reader.c (parse_action): Don't store directly into the
509 rule's action member: return the action as a string.
510 Don't require `rule_length' as an argument: compute it.
511 (grammar_current_rule_symbol_append)
512 (grammar_current_rule_action_append): New, eved out from
513 (readgram): here.
514 Remove `action_flag', `rulelength', unused now.
515
9af3fbce
AD
5162002-06-11 Akim Demaille <akim@epita.fr>
517
518 * src/reader.c (grammar_current_rule_prec_set).
519 (grammar_current_rule_check): New, eved out from...
520 (readgram): here.
521 Remove `xaction', `first_rhs': useless.
522 * tests/input.at (Type clashes): New.
523 * tests/existing.at (GNU Cim Grammar): Adjust.
524
1485e106
AD
5252002-06-11 Akim Demaille <akim@epita.fr>
526
527 * src/reader.c (grammar_midrule_action): New, Eved out from
528 (readgram): here.
529
da4160c3
AD
5302002-06-11 Akim Demaille <akim@epita.fr>
531
532 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
533 New.
534 (readgram): Use them as replacement of inlined code, crule and
535 crule1.
536
f6d0f937
AD
5372002-06-11 Akim Demaille <akim@epita.fr>
538
539 * src/reader.c (grammar_end, grammar_symbol_append): New.
540 (readgram): Use them.
541 Make the use of `p' as local as possible.
542
69078d4b
AD
5432002-06-10 Akim Demaille <akim@epita.fr>
544
545 GCJ's parser requires the tokens to be defined before the prologue.
546
547 * data/bison.simple: Output the token definition before the user's
548 prologue.
549 * tests/regression.at (Braces parsing, Duplicate string)
550 (Mixing %token styles): Check the output from bison.
551 (Early token definitions): New.
552
5e424082
AD
5532002-06-10 Akim Demaille <akim@epita.fr>
554
555 * src/symtab.c (symbol_user_token_number_set): Don't complain when
556 assigning twice the same user number to a token, so that we can
557 use it in...
558 * src/lex.c (lex): here.
559 Also use `symbol_class_set' instead of hand written code.
560 * src/reader.c (parse_assoc_decl): Likewise.
561
44536b35
AD
5622002-06-10 Akim Demaille <akim@epita.fr>
563
564 * src/symtab.c, src/symtab.c (symbol_class_set)
565 (symbol_user_token_number_set): New.
566 * src/reader.c (parse_token_decl): Use them.
567 Use a switch instead of ifs.
568 Use a single argument.
569
8b9f2372
AD
5702002-06-10 Akim Demaille <akim@epita.fr>
571
572 Remove `%thong' support as it is undocumented, unused, duplicates
573 `%token's job, and creates useless e-mail traffic with people who
574 want to know what it is, why it is undocumented, unused, and
575 duplicates `%token's job.
576
577 * src/reader.c (parse_thong_decl): Remove.
578 * src/options.c (option_table): Remove "thong".
579 * src/lex.h (tok_thong): Remove.
580
3ae2b51f
AD
5812002-06-10 Akim Demaille <akim@epita.fr>
582
583 * src/symtab.c, src/symtab.c (symbol_type_set)
584 (symbol_precedence_set): New.
585 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
586 (value_components_used): Remove, unused.
587
2f1afb73
AD
5882002-06-09 Akim Demaille <akim@epita.fr>
589
590 Move symbols handling code out of the reader.
591
592 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
593 (axiom): Move to...
594 * src/symtab.h, src/symtab.c: here.
595
596 * src/gram.c (start_symbol): Remove: use startsymbol->number.
597 * src/reader.c (startval): Rename as...
598 * src/symtab.h, src/symtab.c (startsymbol): this.
599 * src/reader.c: Adjust.
600
601 * src/reader.c (symbol_check_defined, symbol_make_alias)
602 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
603 (token_translations_init)
604 Move to...
605 * src/symtab.c: here.
606 * src/reader.c (packsymbols): Move to...
607 * src/symtab.h, src/symtab.c (symbols_pack): here.
608 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
609 argument.
610
e9bca3ad
AD
6112002-06-03 Akim Demaille <akim@epita.fr>
612
613 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
614 then statements.
615
86eff183
AD
6162002-06-03 Akim Demaille <akim@epita.fr>
617
618 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
619 structs with non literals.
620 * src/scan-skel.l: never-interactive.
621 * src/conflicts.c (enum conflict_resolution_e): No trailing
622 comma.
623 * src/getargs.c (usage): Split long literal strings.
624 Reported by Hans Aberg.
625
717be197
AD
6262002-05-28 Akim Demaille <akim@epita.fr>
627
628 * data/bison.c++: Use C++ ostreams.
629 (cdebug_): New member.
630
670ddffd
AD
6312002-05-28 Akim Demaille <akim@epita.fr>
632
633 * src/output.c (output_skeleton): Be sure to allocate enough room
634 for `/' _and_ for `\0' in full_skeleton.
635
769b430f
AD
6362002-05-28 Akim Demaille <akim@epita.fr>
637
638 * data/bison.c++: Catch up with bison.simple:
639 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
640 and Paul Eggert <eggert@twinsun.com>: `error' handing.
641 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
642 and popping traces.
643
7067cb36
PH
6442002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
645
646 * src/output.c (output_skeleton): Put an explicit path in front of
647 the skeleton file name, rather than relying on the -I directory,
648 to partially alleviate effects of having a skeleton file lying around
649 in the current directory.
769b430f 650
4a713ec2
PH
6512002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
652
769b430f 653 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
654 obstack_printf should be obstack_fgrow1.
655
b408954b
AD
6562002-05-26 Akim Demaille <akim@epita.fr>
657
658 * src/state.h (state_t): `solved_conflicts' is a new member.
659 * src/LR0.c (new_state): Set it to 0.
660 * src/conflicts.h, src/conflicts.c (print_conflicts)
661 (free_conflicts, solve_conflicts): Rename as...
662 (conflicts_print, conflicts_free, conflicts_solve): these.
663 Adjust callers.
664 * src/conflicts.c (enum conflict_resolution_e)
665 (solved_conflicts_obstack): New, used by...
666 (log_resolution): this.
667 Adjust to attach the conflict resolution to each state.
668 Complete the description with the precedence/associativity
669 information.
670 (resolve_sr_conflict): Adjust.
671 * src/print.c (print_state): Output its solved_conflicts.
672 * tests/conflicts.at (Unresolved SR Conflicts)
673 (Solved SR Conflicts): Exercise --report=all.
674
a49aecd5
AD
6752002-05-26 Akim Demaille <akim@epita.fr>
676
677 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
678 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
679 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
680 (token_number_t, item_number_as_token_number)
681 (token_number_as_item_number, muscle_insert_token_number_table):
682 Rename as...
683 (symbol_number_t, item_number_as_symbol_number)
684 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
685 these, since it is more appropriate.
686
5504898e
AD
6872002-05-26 Akim Demaille <akim@epita.fr>
688
689 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
690 `Error:' lines.
691 * data/bison.simple (yystos) [YYDEBUG]: New.
692 (yyparse) [YYDEBUG]: Display the symbols which are popped during
693 error recovery.
694 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
695
ec3bc396
AD
6962002-05-25 Akim Demaille <akim@epita.fr>
697
698 * doc/bison.texinfo (Debugging): Split into...
699 (Tracing): this new section, its former contents, and...
700 (Understanding): this new section.
701 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
702 by...
703 (report_flag): this.
704 Adjust all dependencies.
705 (report_args, report_types, report_argmatch): New.
706 (usage, getargs): Report/support -r, --report.
707 * src/options.h
708 (struct option_table_struct): Rename as..,
709 (struct option_table_s): this.
710 Rename the `set_flag' member to `flag' to match with getopt_long's
711 struct.
712 * src/options.c (option_table): Split verbose into an entry for
713 %verbose, and another for --verbose.
714 Support --report/-r, so remove -r from the obsolete --raw.
715 * src/print.c: Attach full item sets and lookaheads reports to
716 report_flag instead of trace_flag.
717 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
718
78df8250
PE
7192002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
720 and Paul Eggert <eggert@twinsun.com>
769b430f 721
78df8250
PE
722 * data/bison.simple (yyparse): Correct error handling to conform to
723 POSIX and yacc. Specifically, after syntax error is discovered,
724 do not reduce further before shifting the error token.
725 Clean up the code a bit by removing the labels yyerrdefault,
726 yyerrhandle, yyerrpop.
727 * NEWS: Document the above.
728
c0c9ea05
PH
7292002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
730
731 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
732 type; it isn't always big enough, since it doesn't necessarily
733 include non-terminals.
769b430f 734 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
735 the latter can be removed.
736 (yy_token_number_type): Remove, only one use.
737 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
738 don't use TokenNumberType as element type.
769b430f 739
c0c9ea05
PH
740 * tests/regression.at: Modify expected output to agree with change
741 to yyr1 and yytranslate.
769b430f 742
6390a83f
FK
7432002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
744
745 * src/reader.c (parse_action): Use copy_character instead of
746 obstack_1grow.
747
db7c8e9a
AD
7482002-05-13 Akim Demaille <akim@epita.fr>
749
750 * tests/regression.at (Token definitions): Prototype yylex and
751 yyerror.
752
fcc61800
PH
7532002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
754
158c687b 755 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
756 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
757 32-bit arithmetic.
758 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
759
5683e9b2
AD
7602002-05-07 Akim Demaille <akim@epita.fr>
761
762 * tests/synclines.at: Be sure to prototype yylex and yyerror to
763 avoid GCC warnings.
764
0c2d3f4c
AD
7652002-05-07 Akim Demaille <akim@epita.fr>
766
767 Kill GCC warnings.
768
769 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
770 over the RHS of each rule.
771 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
772 * src/state.h (state_t): Member `nitems' is unsigned short.
773 * src/LR0.c (get_state): Adjust.
774 * src/reader.c (packgram): Likewise.
775 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
776 `Type'.
777 (muscle_insert_int_table): Remove, unused.
778 (prepare_rules): Remove `max'.
779
1565b720
AD
7802002-05-06 Akim Demaille <akim@epita.fr>
781
782 * src/closure.c (print_firsts): Display of the symbol tags.
783 (bitmatrix_print): Move to...
784 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
785 here.
786 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
787
cfaee611
AD
7882002-05-06 Akim Demaille <akim@epita.fr>
789
790 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
791 hash_do_for_each.
792
458be8e0
AD
7932002-05-06 Akim Demaille <akim@epita.fr>
794
795 * src/LR0.c (new_state, get_state): Instead of using the global
796 `kernel_size' and `kernel_base', have two new arguments:
797 `core_size' and `core'.
798 Adjust callers.
799
a900a624
AD
8002002-05-06 Akim Demaille <akim@epita.fr>
801
802 * src/reader.c (packgram): No longer end `ritem' with a 0
803 sentinel: it is not used.
804
d4e7d3a1
AD
8052002-05-05 Akim Demaille <akim@epita.fr>
806
807 New experimental feature: display the lookaheads in the report and
808 graph.
809
810 * src/print (print_core): When --trace-flag, display the rules
811 lookaheads.
812 * src/print_graph.c (print_core): Likewise.
813 Swap the arguments.
814 Adjust caller.
815
39ceb25b
AD
8162002-05-05 Akim Demaille <akim@epita.fr>
817
818 * tests/torture.at (Many lookaheads): New test.
819
5372019f
AD
8202002-05-05 Akim Demaille <akim@epita.fr>
821
822 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
823 (GENERATE_MUSCLE_INSERT_TABLE): this.
824 (output_int_table, output_unsigned_int_table, output_short_table)
825 (output_token_number_table, output_item_number_table): Replace with...
826 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
827 (muscle_insert_short_table, muscle_insert_token_number_table)
828 (muscle_insert_item_number_table): these.
829 Adjust all callers.
830 (prepare_tokens): Don't free `translations', since...
831 * src/reader.h, src/reader.c (grammar_free): do it.
832 Move to...
833 * src/gram.h, src/gram.c (grammar_free): here.
834 * data/bison.simple, data/bison.c++: b4_token_number_max is now
835 b4_translate_max.
836
5df5f6d5
AD
8372002-05-05 Akim Demaille <akim@epita.fr>
838
839 * src/output.c (output_unsigned_int_table): New.
840 (prepare_rules): `i' is unsigned.
841 `prhs', `rline', `r2' are unsigned int.
842 Rename muscle `rhs_number_max' as `rhs_max'.
843 Output muscles `prhs_max', `rline_max', and `r2_max'.
844 Free rline and r1.
845 * data/bison.simple, data/bison.c++: Adjust to use these muscles
846 to compute types instead of constant types.
847 * tests/regression.at (Web2c Actions): Adjust.
848
b87f8b21
AD
8492002-05-04 Akim Demaille <akim@epita.fr>
850
851 * src/symtab.h (SALIAS, SUNDEF): Rename as...
852 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
853 Adjust dependencies.
854 * src/output.c (token_definitions_output): Be sure not to output a
855 `#define 'a'' when fed with `%token 'a' "a"'.
856 * tests/regression.at (Token definitions): New.
857
8bb936e4
PE
8582002-05-03 Paul Eggert <eggert@twinsun.com>
859
860 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
861 for K&R C.
862
8632002-05-03 gettextize <bug-gnu-gettext@gnu.org>
864
865 * Makefile.am (SUBDIRS): Remove intl.
866 (EXTRA_DIST): Add config/config.rpath.
867
53c71a12
AD
8682002-05-03 Akim Demaille <akim@epita.fr>
869
870 * data/bison.simple (m4_if): Don't output empty enums.
871 And actually, output valid enum definitions :(.
872
289dd0cf
AD
8732002-05-03 Akim Demaille <akim@epita.fr>
874
875 * configure.bat: Remove, completely obsolete.
876 * Makefile.am (EXTRA_DIST): Adjust.
877 Don't distribute config.rpath...
878 * config/Makefile.am (EXTRA_DIST): Do it.
879
db85e524
AD
8802002-05-03 Akim Demaille <akim@epita.fr>
881
882 * configure.in (GETTEXT_VERSION): New.
883 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
884
83ccf991
AD
8852002-05-03 Akim Demaille <akim@epita.fr>
886
887 * data/bison.simple (b4_token_enum): New.
888 (b4_token_defines): Use it to output tokens both as #define and
889 enums.
890 Suggested by Paul Eggert.
891 * src/output.c (token_definitions_output): Don't output spurious
892 white spaces.
893
1f418995
AD
8942002-05-03 Akim Demaille <akim@epita.fr>
895
896 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
897
45119f04
RA
8982002-05-02 Robert Anisko <robert@lrde.epita.fr>
899
900 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
901 Update the stack class, give a try to deque as the default container.
902
b2d52318
AD
9032002-05-02 Akim Demaille <akim@epita.fr>
904
905 * data/bison.simple (yyparse): Do not implement @$ = @1.
906 (YYLLOC_DEFAULT): Adjust to do it.
907 * doc/bison.texinfo (Location Default Action): Fix.
908
3a8b4109
AD
9092002-05-02 Akim Demaille <akim@epita.fr>
910
911 * src/reader.c (parse_braces): Merge into...
912 (parse_action): this.
913
84614e13
AD
9142002-05-02 Akim Demaille <akim@epita.fr>
915
916 * configure.in (ALL_LINGUAS): Remove.
917 * po/LINGUAS, hr.po: New.
918
fdbcd8e2
AD
9192002-05-02 Akim Demaille <akim@epita.fr>
920
921 Remove the so called hairy (semantic) parsers.
922
923 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
924 * src/gram.h, src/gram.c (semantic_parser): Remove.
925 (rule_t): Remove the guard and guard_line members.
926 * src/lex.h (token_t): remove tok_guard.
927 * src/options.c (option_table): Remove %guard and %semantic_parser
928 support.
929 * src/output.c, src/output.h (guards_output): Remove.
930 (prepare): Adjust.
931 (token_definitions_output): Don't output the `T'
932 tokens (???).
933 (output_skeleton): Don't output the guards.
934 * src/files.c, src/files.c (attrsfile): Remove.
935 * src/reader.c (symbol_list): Remove the guard and guard_line
936 members.
937 Adjust dependencies.
938 (parse_guard): Remove.
939 * data/bison.hairy: Remove.
940 * doc/bison.texinfo (Environment Variables): Remove occurrences of
941 BISON_HAIRY.
942
82b6cb3f
AD
9432002-05-02 Akim Demaille <akim@epita.fr>
944
945 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
946 (parse_guard): Rename the formal argument `stack_offset' as
947 `rule_length', which is more readable.
948 Adjust callers.
949 (copy_at, copy_dollar): Instead of outputting the hard coded
950 values of $$, $n and so forth, output invocation to b4_lhs_value,
951 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
952 Note: this patch partially drops `semantic-parser' support: it
953 always does `rule_length - n', where semantic parsers ought to
954 always use `-n'.
82b6cb3f
AD
955 * data/bison.simple, data/bison.c++ (b4_lhs_value)
956 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
957
6cbfbcc5
AD
9582002-05-02 Akim Demaille <akim@epita.fr>
959
960 * configure.in (AC_INIT): Bump to 1.49b.
961 (AM_INIT_AUTOMAKE): Short invocation.
962
b8548114
AD
9632002-05-02 Akim Demaille <akim@epita.fr>
964
965 Version 1.49a.
966
c20cd1fa
AD
9672002-05-01 Akim Demaille <akim@epita.fr>
968
969 * src/skeleton.h: Remove.
970
8a9566d4
AD
9712002-05-01 Akim Demaille <akim@epita.fr>
972
973 * src/skeleton.h: Fix the #endif.
974 Reported by Magnus Fromreide.
975
8c6d399a
PE
9762002-04-26 Paul Eggert <eggert@twinsun.com>
977
978 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
979 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 980 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 981
2b7ed18a
RA
9822002-04-25 Robert Anisko <robert@lrde.epita.fr>
983
984 * src/scan-skel.l: Postprocess quadrigraphs.
985
986 * src/reader.c (copy_character): New function, used to output
987 single characters while replacing `[' and `]' with quadrigraphs, to
988 avoid troubles with M4 quotes.
989 (copy_comment): Output characters with copy_character.
990 (read_additionnal_code): Likewise.
991 (copy_string2): Likewise.
992 (copy_definition): Likewise.
993
994 * tests/calc.at: Exercise M4 quoting.
995
34a89c50
AD
9962002-04-25 Akim Demaille <akim@epita.fr>
997
998 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
999 between `!' and the command.
1000 Reported by Paul Eggert.
1001
0dd1580a
RA
10022002-04-24 Robert Anisko <robert@lrde.epita.fr>
1003
1004 * tests/calc.at: Exercise prologue splitting.
1005
1006 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1007 `b4_post_prologue' instead of `b4_prologue'.
1008
1009 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1010 muscles.
1011 (output): Free pre_prologue_obstack and post_prologue_obstack.
1012 * src/files.h, src/files.c (attrs_obstack): Remove.
1013 (pre_prologue_obstack, post_prologue_obstack): New.
1014 * src/reader.c (copy_definition): Add a parameter to specify the
1015 obstack to fill, instead of using attrs_obstack unconditionally.
1016 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1017 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1018
83c1796f
PE
10192002-04-23 Paul Eggert <eggert@twinsun.com>
1020
1021 * data/bison.simple: Remove unnecessary commentary and white
1022 space differences from 1_29-branch.
1023 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1024
1025 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1026 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1027 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1028 constructors or destructors.
1029
1030 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1031
1207eeac
AD
10322002-04-23 Akim Demaille <akim@epita.fr>
1033
1034 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1035 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1036 location with columns.
1037 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1038 All reported by Paul Eggert.
1039
78ab8f67
AD
10402002-04-22 Akim Demaille <akim@epita.fr>
1041
1042 * src/reduce.c (dump_grammar): Move to...
1043 * src/gram.h, src/gram.c (grammar_dump): here.
1044 Be sure to separate long item numbers.
1045 Don't read the members of a rule's prec if its nil.
1046
133c20e2
AD
10472002-04-22 Akim Demaille <akim@epita.fr>
1048
1049 * src/output.c (table_size, table_grow): New.
1050 (MAXTABLE): Remove, replace uses with table_size.
1051 (pack_vector): Instead of dying when the table is too big, grow it.
1052
9515e8a7
AD
10532002-04-22 Akim Demaille <akim@epita.fr>
1054
1055 * data/bison.simple (yyr1): Its type is that of a token number.
1056 * data/bison.c++ (r1_): Likewise.
1057 * tests/regression.at (Web2c Actions): Adjust.
1058
23c5a174
AD
10592002-04-22 Akim Demaille <akim@epita.fr>
1060
1061 * src/reader.c (token_translations_init): 256 is now the default
1062 value for the error token, i.e., it will be assigned another
1063 number if the user assigned 256 to one of her tokens.
1064 (reader): Don't force 256 to error.
1065 * doc/bison.texinfo (Symbols): Adjust.
1066 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1067 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1068 etc. instead of 10, 20, 30 (which was used to `jump' over error
1069 (256) and undefined (2)).
1070
5fbb0954
AD
10712002-04-22 Akim Demaille <akim@epita.fr>
1072
1073 Propagate more token_number_t.
1074
1075 * src/gram.h (token_number_as_item_number)
1076 (item_number_as_token_number): New.
1077 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1078 Use it to create output_item_number_table and
1079 output_token_number_table.
1080 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1081 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1082 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1083 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1084
4f940944
AD
10852002-04-22 Akim Demaille <akim@epita.fr>
1086
1087 * src/output.h, src/output.c (get_lines_number): Remove.
1088
3ded9a63
AD
10892002-04-19 Akim Demaille <akim@epita.fr>
1090
1091 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1092 as Lex/Flex'.
1093 (Debugging): More details about enabling the debugging features.
1094 (Table of Symbols): Describe $$, $n, @$, and @n.
1095 Suggested by Tim Josling.
1096
e0c471a9
AD
10972002-04-19 Akim Demaille <akim@epita.fr>
1098
1099 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1100
fecc10cd
AD
11012002-04-10 Akim Demaille <akim@epita.fr>
1102
1103 * src/system.h: Rely on HAVE_LIMITS_H.
1104 Suggested by Paul Eggert.
1105
51dec47b
AD
11062002-04-09 Akim Demaille <akim@epita.fr>
1107
1108 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1109 full stderr, and strip it according to the bison options, instead
1110 of composing the error message from different bits.
1111 This makes it easier to check for several error messages.
1112 Adjust all the invocations.
1113 Add an invocation exercising the error token.
1114 Add an invocation demonstrating a stupid error message.
1115 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1116 Adjust the tests.
1117 Error message are for stderr, not stdout.
1118
007a50a4
AD
11192002-04-09 Akim Demaille <akim@epita.fr>
1120
1121 * src/gram.h, src/gram.c (error_token_number): Remove, use
1122 errtoken->number.
1123 * src/reader.c (reader): Don't specify the user token number (2)
1124 for $undefined, as it uselessly prevents using it.
1125 * src/gram.h (token_number_t): Move to...
1126 * src/symtab.h: here.
1127 (state_t.number): Is a token_number_t.
1128 * src/print.c, src/reader.c: Use undeftoken->number instead of
1129 hard coded 2.
1130 (Even though this 2 is not the same as above: the number of the
1131 undeftoken remains being 2, it is its user token number which
1132 might not be 2).
1133 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1134 `user_token_number_max'.
1135 Output `undef_token_number'.
1136 * data/bison.simple, data/bison.c++: Use them.
1137 Be sure to map invalid yylex return values to
1138 `undef_token_number'. This saves us from gratuitous SEGV.
1139
1140 * tests/conflicts.at (Solved SR Conflicts)
1141 (Unresolved SR Conflicts): Adjust.
1142 * tests/regression.at (Web2c Actions): Adjust.
1143
06446ccf
AD
11442002-04-08 Akim Demaille <akim@epita.fr>
1145
1146 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1147 Adding #line.
1148 Remove the duplicate `typedefs'.
1149 (RhsNumberType): Fix the declaration and various other typos.
1150 Use __ofile__.
1151 * data/bison.simple: Use __ofile__.
1152 * src/scan-skel.l: Handle __ofile__.
1153
62a3e4f0
AD
11542002-04-08 Akim Demaille <akim@epita.fr>
1155
1156 * src/gram.h (item_number_t): New, the type of item numbers in
1157 RITEM. Note that it must be able to code symbol numbers as
1158 positive number, and the negation of rule numbers as negative
1159 numbers.
1160 Adjust all dependencies (pretty many).
1161 * src/reduce.c (rule): Remove this `short *' pointer: use
1162 item_number_t.
1163 * src/system.h (MINSHORT, MAXSHORT): Remove.
1164 Include `limits.h'.
1165 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1166 (shortcpy): Remove.
1167 (MAXTABLE): Move to...
1168 * src/output.c (MAXTABLE): here.
1169 (prepare_rules): Use output_int_table to output rhs.
1170 * data/bison.simple, data/bison.c++: Adjust.
1171 * tests/torture.at (Big triangle): Move the limit from 254 to
1172 500.
1173 * tests/regression.at (Web2c Actions): Ajust.
1174
1175 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1176 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1177 passes, but produces negative #line number, once fixed, GCC is
1178 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1179 C), it passes.
1180 * src/state.h (state_h): Code input lines on ints, not shorts.
1181
bb88b0fc
AD
11822002-04-08 Akim Demaille <akim@epita.fr>
1183
1184 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1185 and then the grammar.
1186
9a636f47
AD
11872002-04-08 Akim Demaille <akim@epita.fr>
1188
1189 * src/system.h: No longer using strndup.
1190
680e8701
AD
11912002-04-07 Akim Demaille <akim@epita.fr>
1192
1193 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1194 * src/output.c (output_table_data): Return the longest number.
1195 (prepare_tokens): Output `token_number_max').
1196 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1197 New.
1198 Use them to define yy_token_number_type/TokenNumberType.
1199 Use this type for yytranslate.
1200 * tests/torture.at (Big triangle): Push the limit from 124 to
1201 253.
1202 * tests/regression.at (Web2c Actions): Adjust.
1203
817e9f41
AD
12042002-04-07 Akim Demaille <akim@epita.fr>
1205
1206 * tests/torture.at (Big triangle): New.
1207 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1208 * tests/existing.at: here.
1209
5123689b
AD
12102002-04-07 Akim Demaille <akim@epita.fr>
1211
1212 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1213 nritems.
1214 Adjust dependencies.
1215
f3849179
AD
12162002-04-07 Akim Demaille <akim@epita.fr>
1217
1218 * src/reader.c: Normalize increments to prefix form.
1219
bd02036a
AD
12202002-04-07 Akim Demaille <akim@epita.fr>
1221
1222 * src/reader.c, symtab.c: Remove debugging code.
1223
db8837cb
AD
12242002-04-07 Akim Demaille <akim@epita.fr>
1225
1226 Rename all the `bucket's as `symbol_t'.
1227
1228 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1229 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1230 * src/symtab.c, src/symtab.h (bucket): Rename as...
1231 (symbol_t): this.
1232 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1233 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1234 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1235 (buckets_new, buckets_free, buckets_do): Rename as...
1236 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1237 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1238 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1239 (symbols_new, symbols_free, symbols_do): these.
1240
72a23c97
AD
12412002-04-07 Akim Demaille <akim@epita.fr>
1242
1243 Use lib/hash for the symbol table.
1244
1245 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1246 EOF.
1247 * src/lex.c (lex): Set the `number' member of new terminals.
1248 * src/reader.c (bucket_check_defined, bucket_make_alias)
1249 (bucket_check_alias_consistence, bucket_translation): New.
1250 (reader, grammar_free, readgram, token_translations_init)
1251 (packsymbols): Adjust.
1252 (reader): Number the predefined tokens.
1253 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1254 for predefined tokens.
1255 * src/symtab.h (bucket): Remove all the hash table related
1256 members.
1257 * src/symtab.c (symtab): Replace by...
1258 (bucket_table): this.
1259 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1260 (buckets_new, buckets_do): New.
1261
280a38c3
AD
12622002-04-07 Akim Demaille <akim@epita.fr>
1263
1264 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1265 (start_symbol, max_user_token_number, semantic_parser)
1266 (error_token_number): Initialize.
1267 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1268 Initialize.
1269 (reader): Don't.
1270 (errtoken, eoftoken, undeftoken, axiom): Extern.
1271
03b31c0c
AD
12722002-04-07 Akim Demaille <akim@epita.fr>
1273
1274 * src/gram.h (rule_s): prec and precsym are now pointers
1275 to the bucket giving the priority/associativity.
1276 Member `associativity' removed: useless.
1277 * src/reduce.c, src/conflicts.c: Adjust.
1278
8b3df748
AD
12792002-04-07 Akim Demaille <akim@epita.fr>
1280
1281 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1282 Properly escape the symbols' TAG when outputting them.
1283
e601aa1d
AD
12842002-04-07 Akim Demaille <akim@epita.fr>
1285
1286 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1287
b0299a2e
AD
12882002-04-07 Akim Demaille <akim@epita.fr>
1289
1290 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1291 (LArule): this, which is an array to rule_t*.
1292 * src/print.c, src/conflicts.c: Adjust.
1293
d7e1f00c
AD
12942002-04-07 Akim Demaille <akim@epita.fr>
1295
1296 * src/gram.h (rule_t): Rename `number' as `user_number'.
1297 `number' is a new member.
1298 Adjust dependencies.
1299 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1300
cc9305dd
AD
13012002-04-07 Akim Demaille <akim@epita.fr>
1302
1303 As a result of the previous patch, it is no longer needed
1304 to reorder ritem itself.
1305
1306 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1307
b0940840
AD
13082002-04-07 Akim Demaille <akim@epita.fr>
1309
1310 Be sure never to walk through RITEMS, but use only data related to
1311 the rules themselves. RITEMS should be banished.
1312
1313 * src/output.c (output_token_translations): Rename as...
1314 (prepare_tokens): this.
1315 In addition to `translate', prepare the muscles `tname' and
1316 `toknum', which were handled by...
1317 (output_rule_data): this.
1318 Remove, and move the remainder of its outputs into...
1319 (prepare_rules): this new routines, which also merges content from
1320 (output_gram): this.
1321 (prepare_rules): Be sure never to walk through RITEMS.
1322 (output_stos): Rename as...
1323 (prepare_stos): this.
1324 (output): Always invoke prepare_states, after all, just don't use it
1325 in the output if you don't need it.
1326
643a5994
AD
13272002-04-07 Akim Demaille <akim@epita.fr>
1328
1329 * src/LR0.c (new_state): Display `nstates' as the name of the
1330 newly created state.
1331 Adjust to initialize first_state and last_state if needed.
1332 Be sure to distinguish the initial from the final state.
1333 (new_states): Create the itemset of the initial state, and use
1334 new_state.
1335 * src/closure.c (closure): Now that the initial state has its
1336 items properly set, there is no need for a special case when
1337 creating `ruleset'.
1338
1339 As a result, now the rule 0, reducing to $axiom, is visible in the
1340 outputs. Adjust the test suite.
1341
1342 * tests/conflicts.at (Solved SR Conflicts)
1343 (Unresolved SR Conflicts): Adjust.
1344 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1345 * tests/conflicts.at (S/R in initial): New.
1346
b4c4ccc2
AD
13472002-04-07 Akim Demaille <akim@epita.fr>
1348
1349 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1350 the RHS of the rules.
1351 * src/output.c (output_gram): Likewise.
1352
bba97eb2
AD
13532002-04-07 Akim Demaille <akim@epita.fr>
1354
1355 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1356 bucket.
1357 Adjust all dependencies.
1358 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1359 `number' of the buckets too.
1360 * src/gram.h: Include `symtab.h'.
1361 (associativity): Move to...
1362 * src/symtab.h: here.
1363 No longer include `gram.h'.
1364
c3b407f4
AD
13652002-04-07 Akim Demaille <akim@epita.fr>
1366
1367 * src/gram.h, src/gram.c (rules_rhs_length): New.
1368 (ritem_longest_rhs): Use it.
1369 * src/gram.h (rule_t): `number' is a new member.
1370 * src/reader.c (packgram): Set it.
1371 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1372 the end of `rules', and count them out of `nrules'.
1373 (reduce_output, dump_grammar): Adjust.
1374 * src/print.c (print_grammar): It is no longer needed to check for
1375 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1376 * tests/reduce.at (Reduced Automaton): New test.
1377
11652ab3
AD
13782002-04-07 Akim Demaille <akim@epita.fr>
1379
1380 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1381 lacking `+ 1' to nrules, Bison reported as useless a token if it
1382 was used solely to set the precedence of the last rule...
1383
26b23c1a
AD
13842002-04-07 Akim Demaille <akim@epita.fr>
1385
1386 * data/bison.c++, data/bison.simple: Don't output the current file
1387 name in #line, to avoid useless diffs between two identical
1388 outputs under different names.
1389
18bcecb0
AD
13902002-04-07 Akim Demaille <akim@epita.fr>
1391
1392 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1393 Normalize loops to using `< nrules + 1', not `<= nrules'.
1394
fa770c86
AD
13952002-04-07 Akim Demaille <akim@epita.fr>
1396
1397 * TODO: Update.
1398
d9b739c3
AD
13992002-04-07 Akim Demaille <akim@epita.fr>
1400
1401 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1402 bucket.value as bucket.number.
1403
99013900
AD
14042002-04-07 Akim Demaille <akim@epita.fr>
1405
1406 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1407 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1408 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1409 RHS, instead of being an index in RITEMS.
1410
e966383b
PE
14112002-04-04 Paul Eggert <eggert@twinsun.com>
1412
1413 * doc/bison.texinfo: Update copyright date.
1414 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1415 (Symbols): Warn about running Bison in one character set,
1416 but compiling and/or running in an incompatible one.
1417 Warn about character code 256, too.
1418
14192002-04-03 Paul Eggert <eggert@twinsun.com>
1420
1421 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1422 YYERROR_VERBOSE is nonzero, not whether it is defined.
1423
1424 Merge changes from bison-1_29-branch.
c307773e 1425
8d6c48b9
PE
14262002-03-20 Paul Eggert <eggert@twinsun.com>
1427
1428 Merge fixes from Debian bison_1.34-1.diff.
1429
1430 * configure.in (AC_PREREQ): 2.53.
1431
e53c6322
AD
14322002-03-20 Akim Demaille <akim@epita.fr>
1433
1434 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1435
9ffbeca7
PE
14362002-03-19 Paul Eggert <eggert@twinsun.com>
1437
21db0b2a
PE
1438 * src/bison.simple (YYCOPY): New macro.
1439 (YYSTACK_RELOCATE): Use it.
1440 Remove Type arg; no longer needed. All callers changed.
1441 (yymemcpy): Remove; no longer needed.
1442
9ffbeca7
PE
1443 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1444 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1445
642cb8f8
AD
14462002-03-19 Akim Demaille <akim@epita.fr>
1447
1448 Test and fix the #line outputs.
1449
1450 * tests/atlocal.at (GCC): New.
1451 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1452 (Prologue synch line, ,%union synch line, Postprologue synch line)
1453 (Action synch line, Epilogue synch line): New tests.
1454 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1455 * data/bison.simple, data/bison.c++: Use it.
1456
3c31a486
AD
14572002-03-19 Akim Demaille <akim@epita.fr>
1458
1459 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1460 (Solved SR Conflicts, %expect not enough, %expect right)
1461 (%expect too much): Move to...
1462 * tests/conflicts.at: this new file.
1463
0d8bed56
AD
14642002-03-19 Akim Demaille <akim@epita.fr>
1465
1466 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1467 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1468 that we can move to enums for instance.
1469 * src/output.c (token_definitions_output): Output a list of
1470 `token-name, token-number' instead of the #define.
1471 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1472
9208d17f
AD
14732002-03-14 Akim Demaille <akim@epita.fr>
1474
1475 Use Gettext 0.11.1.
1476
af27eacb
RA
14772002-03-09 Robert Anisko <robert@lrde.epita.fr>
1478
1479 * data/bison.c++: Make the user able to add members to the generated
1480 parser by subclassing.
1481
9101a310
RA
14822002-03-05 Robert Anisko <robert@lrde.epita.fr>
1483
1484 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1485 a character.
1486 Reported by Nicolas Tisserand and Nicolas Burrus.
1487
fff9bf0b
RA
14882002-03-04 Robert Anisko <robert@lrde.epita.fr>
1489
1490 * src/reader.c: Warn about lacking semi-colons, do not complain.
1491
64dba31e
RA
14922002-03-04 Robert Anisko <robert@lrde.epita.fr>
1493
1494 * data/bison.c++: Remove a debug line.
1495
374f5a14
RA
14962002-03-04 Robert Anisko <robert@lrde.epita.fr>
1497
1498 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1499 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1500 provide a default implementation.
1501
bfcf1f3a
AD
15022002-03-04 Akim Demaille <akim@epita.fr>
1503
1504 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1505 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1506 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1507 * tests/semantic.at (Parsing Guards): Similarly.
1508 * src/reader.at (readgram): Complain if the last rule is not ended
1509 with a semi-colon.
1510
65ccf9fc
AD
15112002-03-04 Akim Demaille <akim@epita.fr>
1512
1513 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1514 * src/closure.c: here.
1515 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1516 RTC.
1517 * src/warshall.h, src/warshall.c: Remove.
1518 * tests/sets.at (Broken Closure): Adjust.
1519
d0039cbc
AD
15202002-03-04 Akim Demaille <akim@epita.fr>
1521
1522 * src/output.c (output_skeleton): tempdir is const.
1523 bytes_read is unused.
1524
345cea78
AD
15252002-03-04 Akim Demaille <akim@epita.fr>
1526
1527 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1528 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1529 Update.
1530 From Michael Hayes.
1531
564801f7
AD
15322002-03-04 Akim Demaille <akim@epita.fr>
1533
1534 * src/closure.c (closure): `r' is unused.
1535
e5352bc7
AD
15362002-03-04 Akim Demaille <akim@epita.fr>
1537
1538 * tests/sets.at (Broken Closure): Add the ending `;'.
1539 * src/reader.at (readgram): Complain if a rule is not ended with a
1540 semi-colon.
1541
914feea9
AD
15422002-03-04 Akim Demaille <akim@epita.fr>
1543
1544 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1545 (count_sr_conflicts): Use bitset_count.
1546 * src/reduce.c (inaccessable_symbols): Ditto.
1547 (bits_size): Remove.
1548 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1549
f0250de6
AD
15502002-03-04 Akim Demaille <akim@epita.fr>
1551
1552 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1553 * src/reduce.c: Remove the `bitset_zero's following the
1554 `bitset_create's, as now it is performed by the latter.
1555
ef017502
AD
15562002-03-04 Akim Demaille <akim@epita.fr>
1557
1558 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1559 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1560 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1561 latest sources from Michael.
1562
76514394
AD
15632002-03-04 Akim Demaille <akim@epita.fr>
1564
1565 * src/output.c (output): Don't free the grammar.
1566 * src/reader.c (grammar_free): New.
1567 * src/main.c (main): Call it and don't free symtab here.
1568
55024580
AD
15692002-03-04 Akim Demaille <akim@epita.fr>
1570
1571 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1572 before returning.
1573 Reported by Benoit Perrot.
1574
f9abaa2c
AD
15752002-03-04 Akim Demaille <akim@epita.fr>
1576
1577 Use bitset operations when possible, not loops over bits.
1578
1579 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1580 bitset_or.
1581 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1582 * src/reduce.c (useless_nonterminals): Formatting changes.
1583 * src/warshall.c (TC): Use bitset_or.
1584
0e721e75
AD
15852002-03-04 Akim Demaille <akim@epita.fr>
1586
1587 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1588 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1589 Ditto.
1590
0fb1ffb1
AD
15912002-03-04 Akim Demaille <akim@epita.fr>
1592
1593 * src/lalr.c (F): Now a bitset*.
1594 Adjust all dependencies.
1595
b86796bf
AD
15962002-03-04 Akim Demaille <akim@epita.fr>
1597
1598 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1599 Adjust all dependencies.
1600
602bbf31
AD
16012002-03-04 Akim Demaille <akim@epita.fr>
1602
1603 * src/L0.c, src/LR0.h (nstates): Be size_t.
1604 Adjust comparisons (signed vs unsigned).
1605 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1606 bitset*.
1607 Adjust all dependencies.
1608
d8a0245c
AD
16092002-03-04 Akim Demaille <akim@epita.fr>
1610
1611 * src/closure.c (firsts): Now, also a bitset.
1612 Adjust all dependencies.
1613 (varsetsize): Remove, now unused.
1614 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1615
34ba9743
AD
16162002-03-04 Akim Demaille <akim@epita.fr>
1617
1618 * src/print.c: Convert to use bitset.h, not hand coded iterations
1619 over ints.
1620
ed86e78c
AD
16212002-03-04 Akim Demaille <akim@epita.fr>
1622
1623 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1624
dfdb1797
AD
16252002-03-04 Akim Demaille <akim@epita.fr>
1626
1627 * src/closure.c (ruleset): Be a bitset.
1628 (rulesetsize): Remove.
1629
7086e707
AD
16302002-03-04 Akim Demaille <akim@epita.fr>
1631
1632 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1633 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1634 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1635 * src/closure.c (fderives): Be an array of bitsets.
1636
98254360
RA
16372002-02-28 Robert Anisko <robert@lrde.epita.fr>
1638
1639 * data/bison.c++: Merge the two generated headers. Insert a copyright
1640 notice in each output file.
1641
a75c057f
AD
16422002-02-28 Akim Demaille <akim@epita.fr>
1643
1644 * data/bison.c++: Copy the prologue of bison.simple to fetch
1645 useful M4 definitions, such as b4_header_guard.
1646
06b00abc
AD
16472002-02-25 Akim Demaille <akim@epita.fr>
1648
1649 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
1650 translator friendly scheme for the bgr
1651 copyright notice.
06b00abc 1652
70e7d534
AD
16532002-02-25 Akim Demaille <akim@epita.fr>
1654
1655 * src/output.c (header_output): Remove, now handled completely via
1656 M4.
1657
abe017f6
AD
16582002-02-25 Akim Demaille <akim@epita.fr>
1659
1660 * m4/m4.m4: New, from CVS Autoconf.
1661 * configure.in: Invoke it.
1662 * src/output.c (output_skeleton): Use its result instead of the
1663 hard coded name.
1664
381fb12e
AD
16652002-02-25 Akim Demaille <akim@epita.fr>
1666
1667 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1668 Fileutils 4.1.5.
1669 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1670 * src/output.c (output_skeleton): Use mkstemp to create a real
1671 temporary file.
1672 Move the filling of `skeleton' and its muscle to...
1673 (prepare): here.
1674 (output): Move the definition of the prologue muscle to...
1675 (prepare): here.
1676 * src/system.h (DEFAULT_TMPDIR): New.
1677
6f38107f
PE
16782002-02-14 Paul Eggert <eggert@twinsun.com>
1679
1680 Remove the support for C++ namespace cleanliness; it was
1681 causing more problems than it was curing, since it didn't work
1682 properly on some nonstandard C++ compilers. This can wait
1683 for a proper C++ parser.
1684
1685 * NEWS: Document this.
1686 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1687 of C++, as it's treated like C now.
1688 * src/bison.simple (YYSTD): Remove.
1689 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1690 Treat C++ just like Standard C instead of trying to support
1691 namespace cleanliness.
1692
80cce3da
AD
16932002-02-14 Akim Demaille <akim@epita.fr>
1694
1695 * tests/regression.at (else): Adjust to Andreas' change.
1696
842e8679
AD
16972002-02-14 Akim Demaille <akim@epita.fr>
1698
1699 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1700
4bda3f10
AD
17012002-02-13 Andreas Schwab <schwab@suse.de>
1702
1703 * src/output.c (output_rule_data): Don't output NULL, it might
1704 not be defined yet.
1705
4162fa07 17062002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 1707
4162fa07
RA
1708 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
1709 (Copyright notice): Update.
b418ecd8 1710
bd16a5dc
AD
17112002-02-11 Akim Demaille <akim@epita.fr>
1712
1713 * tests/regression.at (%nonassoc and eof): Don't include
1714 nonportable headers.
1715
8d69a1a3
RA
17162002-02-08 Robert Anisko <robert@lrde.epita.fr>
1717
1718 * data/bison.c++: Correct error recovery. Make the user able to
1719 initialize the starting location.
1720
9b2d0677
AD
17212002-02-07 Akim Demaille <akim@epita.fr>
1722
1723 * tests/input.at: New.
1724
69e2658b
RA
17252002-02-07 Robert Anisko <robert@lrde.epita.fr>
1726
1727 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 1728 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
1729 directives around tables only needed for debugging.
1730
4aacc3a7
RA
17312002-02-07 Robert Anisko <robert@lrde.epita.fr>
1732
1733 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1734 C++ parsers.
1735 (yy::b4_name::parse): Use print_.
1736
762a801e
RA
17372002-02-07 Robert Anisko <robert@lrde.epita.fr>
1738
1739 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1740
4bb2bc3f
RA
17412002-02-07 Robert Anisko <robert@lrde.epita.fr>
1742
1743 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1744 C++ parsers.
1745 (yy::b4_name::parse): Build verbose error messages, and use error_.
1746
6b45a3ca
RA
17472002-02-06 Robert Anisko <robert@lrde.epita.fr>
1748
1749 * data/bison.c++: Fix m4 quoting in comments.
1750
50997c6e
RA
17512002-02-06 Robert Anisko <robert@lrde.epita.fr>
1752
1753 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1754 not expanded by m4.
1755
3f3eed27
AD
17562002-02-05 Akim Demaille <akim@epita.fr>
1757
1758 * data/bison.c++: Adjust to the M4 back end.
1759 More is certainly needed.
1760
be2a1a68
AD
17612002-02-05 Akim Demaille <akim@epita.fr>
1762
1763 Give a try to M4 as a back end.
1764
1765 * lib/readpipe.c: New, from wdiff.
1766 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1767 BISON_HAIRY.
1768 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1769 specific values. Now it is m4 that performs the lookup.
1770 * src/parse-skel.y: Remove.
1771 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1772 * src/output.c (actions_output, guards_output)
1773 (token_definitions_output): No longer keeps track of the output
1774 line number, hence remove the second argument.
1775 (guards_output): Check against the guard member of a rule, not the
1776 action member.
1777 Adjust callers.
1778 (output_skeleton): Don't look for the skeleton location, let m4 do
1779 that.
1780 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1781 file will be used.
1782 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1783 (prepare): Given that for the time being changesyntax is not
1784 usable in M4, rename the muscles using `-' to `_'.
1785 Define `defines_flag', `output_parser_name' and `output_header_name'.
1786 * src/output.h (actions_output, guards_output)
1787 (token_definitions_output): Adjust prototypes.
1788 * src/scan-skel.l: Instead of scanning the skeletons, it now
1789 processes the output of m4: `__oline__' and `#output'.
1790 * data/bison.simple: Adjust to be used by M4(sugar).
1791 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1792 to date.
1793 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1794 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1795 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1796 shamelessly stolen from CVS Autoconf.
1797
beda758b
AD
17982002-02-05 Akim Demaille <akim@epita.fr>
1799
1800 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1801 * configure.in: Check for the declarations of free and malloc.
1802 * src/muscle_tab.c: Adjust.
1803
5ece6d43
AD
18042002-02-05 Akim Demaille <akim@epita.fr>
1805
1806 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1807 which have no values.
1808
5bb18f9a
AD
18092002-02-05 Akim Demaille <akim@epita.fr>
1810
1811 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1812 * data/: here.
1813
894dd62e
PE
18142002-01-29 Paul Eggert <eggert@twinsun.com>
1815
1816 * src/bison.simple (YYSIZE_T): Do not define merely because
1817 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1818 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1819
82841af7
AD
18202002-01-27 Akim Demaille <akim@epita.fr>
1821
1822 Fix `%nonassoc and eof'.
1823
1824 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1825 which were not properly copied! Replace
1826 memcpy (res->errs, src->errs, src->nerrs);
1827 with
1828 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
1829 !!!
1830 * tests/regression.at (%nonassoc and eof): Adjust to newest
1831 Autotest: `.' is not in the PATH.
1832
318b76e9
AD
18332002-01-27 Akim Demaille <akim@epita.fr>
1834
1835 * tests/sets.at (AT_EXTRACT_SETS): New.
1836 (Nullable): Use it.
1837 (Firsts): New.
1838
30d2f3d5
AD
18392002-01-26 Akim Demaille <akim@epita.fr>
1840
1841 * tests/actions.at, tests/calc.at, tests/headers.at,
1842 * tests/torture.at: Adjust to the newest Autotest which no longer
1843 forces `.' in the PATH.
1844
30f8c395
AD
18452002-01-25 Akim Demaille <akim@epita.fr>
1846
1847 * tests/regression.at (%nonassoc and eof): New.
1848 Suggested by Robert Anisko.
1849
29ae55f1
AD
18502002-01-24 Akim Demaille <akim@epita.fr>
1851
1852 Bison dumps core when trying to complain about broken input files.
1853 Reported by Cris van Pelt.
1854
1855 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
1856 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
1857 into...
1858 (Invalid inputs): Strengthen: exercise parse_percent_token.
1859
2b548aa6
RA
18602002-01-24 Robert Anisko <robert.anisko@epita.fr>
1861
1862 * src/Makefile.am: Add bison.c++.
1863 * src/bison.c++: New skeleton.
1864
bb0146c2
AD
18652002-01-21 Paolo Bonzini <bonzini@gnu.org>
1866
1867 * po/it.po: New.
1868
bec30531
AD
18692002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
1870
1871 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
1872
fc6edc45
MA
18732002-01-20 Marc Autret <marc@gnu.org>
1874
1875 * src/files.c (compute_output_file_names): Fix
1876
5e5d5415
MA
18772002-01-20 Marc Autret <marc@gnu.org>
1878
1879 * tests/output.at: New test.
1880 * src/files.c (compute_base_names): Don't map extensions when
1881 the YACC flag is set, use defaults.
1882 Reported by Evgeny Stambulchik.
1883
44ea3fbd
MA
18842002-01-20 Marc Autret <marc@gnu.org>
1885
bb0146c2 1886 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
1887 compilers as well (i.e. the vendor C compiler).
1888 Suggested by Albert Chin-A-Young.
1889
338963d1
TVH
18902002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
1891
1892 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
1893 canonical definition.
1894 * src/system.h: Use the canonical definition for PARAMS (avoids
1895 a conflict with the macro from lib/hash.h).
1896
c57b2479
AD
18972002-01-11 Akim Demaille <akim@epita.fr>
1898
1899 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 1900 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 1901
b85810ae
AD
19022002-01-09 Akim Demaille <akim@epita.fr>
1903
1904 * src/files.c, src/files.h (output_infix): New.
1905 (tab_extension): Remove.
1906 (compute_base_names): Compute the former, drop the latter.
1907 * src/output.c (prepare): Insert the muscles `output-infix', and
1908 `output-suffix'.
1909 * src/parse-skel.y (string, string.1): New.
1910 (section.header): Use it.
1911 (section.yacc): Remove.
1912 (prefix): Remove too.
1913 * src/scan-skel.l: Adjust.
1914 * src/bison.simple, src/bison.hairy: Adjust.
1915
cae60122
AD
19162002-01-09 Akim Demaille <akim@epita.fr>
1917
1918 * configure.in (WERROR_CFLAGS): Compute it.
1919 * src/Makefile.am (CFLAGS): Pass it.
1920 * tests/atlocal.in (CFLAGS): Idem.
1921 * src/files.c: Fix a few warnings.
1922 (get_extension_index): Remove, unused.
1923
ae404801
AD
19242002-01-08 Akim Demaille <akim@epita.fr>
1925
1926 * src/getargs.c (AS_FILE_NAME): New.
1927 (getargs): Use it to convert DOSish file names.
1928 * src/files.c (base_name): Rename as full_base_name to avoid
1929 clashes with `base_name ()'.
1930 (filename_split): New.
1931 (compute_base_names): N-th rewrite, using filename_split.
1932
22312b71
AD
19332002-01-08 Akim Demaille <akim@epita.fr>
1934
1935 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
1936 New, stolen from the Fileutils 4.1.
1937 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
1938 * configure.in: Check for the presence of memrchr, and of its
1939 prototype.
1940
a67cef01
TVH
19412002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
1942
1943 * lib/hash.h (__P): Added definition for this macro.
1944 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1945 BUILT_SOURCES, to ensure they are generated first.
1946 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1947 %error-verbose to allow bootstrapping with bison 1.30x.
1948
2b25d624
AD
19492002-01-06 Akim Demaille <akim@epita.fr>
1950
1951 * src/reader.c (parse_braces): Don't fetch the next char, the
1952 convention is to fetch on entry.
1953 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1954 'switch' without a following semicolon.
1955 * tests/regression.at (braces parsing): New.
1956
3460813b
AD
19572002-01-06 Akim Demaille <akim@epita.fr>
1958
1959 Bison is dead wrong in its RR conflict reports.
1960
1961 * tests/torture.at (GNU Cim Grammar): New.
1962 * src/conflicts.c (count_rr_conflicts): Fix.
1963
73784c64
AD
19642002-01-06 Akim Demaille <akim@epita.fr>
1965
1966 Creating package.m4 from configure.ac causes too many problems.
1967
1968 * tests/Makefile.am (package.m4): Create it by hand,
1969 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1970
25d81090
AD
19712002-01-06 Akim Demaille <akim@epita.fr>
1972
1973 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1974 skeleton.h.
1975
a9b8959e
PE
19762002-01-04 Paul Eggert <eggert@twinsun.com>
1977
1978 * doc/bison.texinfo (Debugging):
1979 Remove YYSTDERR; it's no longer defined or used.
1980 Also, s/cstdio.h/cstdio/.
1981
25d81090
AD
19822002-01-03 Akim Demaille <akim@epita.fr>
1983
1984 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1985
1109455c
AD
19862002-01-03 Akim Demaille <akim@epita.fr>
1987
1988 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1989 tracing code to --trace, wait for a better --trace option, with
1990 args.
1991
7ea5e977
AD
19922002-01-03 Akim Demaille <akim@epita.fr>
1993
1994 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1995 The ISO C++ standard is extremely clear about it: stderr is
1996 considered a macro, not a regular symbol (see table 94 `Header
1997 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1998 Therefore std:: does not apply to it. It still does with fprintf.
1999 Also, s/cstdio.h/cstdio/.
2000
fab5b110
AD
20012002-01-03 Akim Demaille <akim@epita.fr>
2002
2003 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2004 for non system headers.
2005
aed7fd9b
AD
20062002-01-02 Akim Demaille <akim@epita.fr>
2007
2008 Equip the skeleton chain with location tracking, runtime trace,
2009 pure parser and scanner.
2010
2011 * src/parse-skel.y: Request a pure parser, locations, and prefix
2012 renaming.
2013 (%union): Having several members with the same type does not help
2014 type mismatches, simplify.
2015 (YYPRINT, yyprint): New.
2016 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2017 (skel_error): this.
2018 Handle locations.
2019 * src/scan-skel.l: Adjust to these changes.
2020 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2021 (LOCATION_PRINT, skel_control_t): New.
2022
24fad99e
AD
20232001-12-30 Akim Demaille <akim@epita.fr>
2024
2025 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2026 replace `gb' with BLANKS.
2027 * src/scan-skel.l: Adjust.
2028
a4b36db4
AD
20292001-12-30 Akim Demaille <akim@epita.fr>
2030
2031 * src/system.h: We don't need nor want bcopy.
2032 Throw away MS-DOS crap: we don't need getpid.
2033 * configure.in: We don't need strndup. It was even causing
2034 problems: because Flex includes the headers *before* us,
2035 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2036 not visible.
2037 * lib/xstrndup.c: New.
2038 * src/scan-skel.l: Use it.
2039 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2040 * src/parse-skel.y: Use %directives instead of #defines.
2041
1239777d
AD
20422001-12-30 Akim Demaille <akim@epita.fr>
2043
2044 * src/skeleton.h: New.
2045 * src/output.c (output_parser, output_master_parser): Remove, dead
2046 code.
2047 * src/output.h (get_lines_number, actions_output, guards_output)
2048 (token_definitions_output): Prototype them.
2049 * src/parse-skel.y: Add the license notice.
2050 Include output.h and skeleton.h.
2051 (process_skeleton): Returns void, and takes a single parameter.
2052 * src/scan-skel.l: Add the license notice.
2053 Include skeleton.h.
2054 Don't use %option yylineno: it seems that then Flex imagines
2055 REJECT has been used, and therefore it won't reallocate its
2056 buffers (which makes no other sense to me than a bug). It results
2057 in warnings for `unused: yy_flex_realloc'.
2058
9b3add5b
RA
20592001-12-30 Robert Anisko <robert.anisko@epita.fr>
2060
2061 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2062 (MUSCLE_INSERT_PREFIX): ...to there.
2063 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2064 (MUSCLE_INSERT_PREFIX): Move from here...
2065
2066 * src/bison.hairy: Add a section directive. Put braces around muscle
2067 names. This parser skeleton is still broken, but Bison should not
2068 choke on a bad muscle 'syntax'.
2069 * src/bison.simple: Add a section directive. Put braces around muscle
2070 names.
2071
2072 * src/files.h (strsuffix, stringappend): Add declarations.
2073 (tab_extension): Add declaration.
2074 (short_base_name): Add declaration.
2075
2076 * src/files.c (strsuffix, stringappend): No longer static. These
2077 functions are used in the skeleton parser.
2078 (tab_extension): New.
2079 (compute_base_names): Use the computations done in this function
fab5b110 2080 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
2081 names.
2082 (short_base_name): No longer static.
2083
2084 * src/output.c (output_skeleton): New.
2085 (output): Disable call to output_master_parser, and give a try to
2086 a new skeleton handling system.
2087 (guards_output, actions_output): No longer static.
2088 (token_definitions_output, get_lines_number): No longer static.
2089
2090 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2091
fab5b110 2092 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
2093 parse-skel.y.
2094
2095 * src/parse-skel.y: New file.
2096 * src/scan-skel.l: New file.
2097
b5b61c61
AD
20982001-12-29 Akim Demaille <akim@epita.fr>
2099
2100 %name-prefix is broken.
2101
2102 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2103 Adjust all dependencies.
2104 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2105 %name-prefix.
2106
2107 Renaming yylval but not yylloc is not consistent. Now we do.
2108
2109 * src/bison.simple: Prefix yylloc if used.
2110 * doc/bison.texinfo (Decl Summary): Document that.
2111
8c9a50be
AD
21122001-12-29 Akim Demaille <akim@epita.fr>
2113
2114 * doc/bison.texinfo: Promote `%long-directive' over
2115 `%long_directive'.
2116 Remove all references to fixed-output-files, yacc is enough.
2117
d99361e6
AD
21182001-12-29 Akim Demaille <akim@epita.fr>
2119
2120 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2121 user prologue. These are defaults.
2122 * tests/actions.at (Mid-rule actions): Make sure the user can
2123 define YYDEBUG and YYERROR_VERBOSE.
2124
b9cecb91
AD
21252001-12-29 Akim Demaille <akim@epita.fr>
2126
2127 * src/output.c (header_output): Don't forget to export YYLTYPE and
2128 yylloc.
2129 * tests/headers.at (export YYLTYPE): New, make sure it does.
2130 * tests/regression.at (%union and --defines, Invalid CPP headers):
2131 Move to...
2132 * tests/headers.at: here.
2133
aea13e97
AD
21342001-12-29 Akim Demaille <akim@epita.fr>
2135
2136 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2137
931394cb
AD
21382001-12-29 Akim Demaille <akim@epita.fr>
2139
2140 * tests/actions.at (Mid-rule actions): Output on a single line
2141 instead of several.
2142
704a47c4
AD
21432001-12-29 Akim Demaille <akim@epita.fr>
2144
2145 * doc/bison.texinfo: Formatting changes.
2146
091e20bb
AD
21472001-12-29 Akim Demaille <akim@epita.fr>
2148
2149 Don't store the token defs in a muscle, just be ready to output it
2150 on command. Now possible via `symbols'. Fixes a memory leak.
2151
2152 * src/output.c (token_definitions_output): New.
2153 (output_parser, header_output): Use it.
2154 * src/reader.c (symbols_save): Remove.
2155
cce71710
AD
21562001-12-29 Akim Demaille <akim@epita.fr>
2157
2158 * src/bison.simple: Do not provide a default for YYSTYPE and
2159 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2160 default.
2161
82c035a8
AD
21622001-12-29 Akim Demaille <akim@epita.fr>
2163
2164 Mid-rule actions are simply... ignored!
2165
2166 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2167 the empty-rule associated to the dummy symbol, not to the host
2168 rule.
2169 * tests/actions.at (Mid-rule actions): New.
2170
8419d367
AD
21712001-12-29 Akim Demaille <akim@epita.fr>
2172
2173 Memory leak.
2174
2175 * src/reader.c (reader): Free grammar.
2176
375d5806
AD
21772001-12-29 Akim Demaille <akim@epita.fr>
2178
2179 Memory leak.
2180
2181 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2182 since it allocates it for each state, although only one is needed.
2183 (allocate_storage): Do it here.
2184
f51cb8ff
AD
21852001-12-29 Akim Demaille <akim@epita.fr>
2186
2187 * src/options.h, src/options.c (create_long_option_table): Rename
2188 as...
2189 (long_option_table_new): this, with a clearer prototype.
2190 (percent_table): Remove, unused,
2191 * src/getargs.c (getargs): Adjust.
2192
29e88316
AD
21932001-12-29 Akim Demaille <akim@epita.fr>
2194
2195 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2196 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2197 as states.
2198
b9f71f19
AD
21992001-12-29 Akim Demaille <akim@epita.fr>
2200
2201 * src/lalr.c (build_relations): Rename `states' as `states1'.
2202 Sorry, I don't understand exactly what it is, no better name...
2203
1a2b5d37
AD
22042001-12-29 Akim Demaille <akim@epita.fr>
2205
2206 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2207 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2208 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2209 as rules.
2210
1cca533e
AD
22112001-12-29 Akim Demaille <akim@epita.fr>
2212
2213 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2214 ago.
2215
c03ae966
AD
22162001-12-29 Akim Demaille <akim@epita.fr>
2217
2218 * src/reader.c, src/reader.h (user_toknums): Remove.
2219 Adjust all users to use symbols[i]->user_token_number.
2220
5a670b1e
AD
22212001-12-29 Akim Demaille <akim@epita.fr>
2222
2223 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2224 Adjust all users to use symbols[i]->prec or ->assoc.
2225
ad949da9
AD
22262001-12-29 Akim Demaille <akim@epita.fr>
2227
2228 * src/reader.c, src/reader.h (tags): Remove.
2229 Adjust all users to use symbols[i]->tag.
2230
0e78e603
AD
22312001-12-29 Akim Demaille <akim@epita.fr>
2232
2233 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2234 and rule_table.
2235 * src/reader.c (packsymbols): Fill this table.
2236 Drop sprec.
2237 * src/conflicts.c (resolve_sr_conflict): Adjust.
2238 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2239 single table.
2240 Use symbols[i]->tag instead of tags[i].
2241
213e640e
AD
22422001-12-29 Akim Demaille <akim@epita.fr>
2243
2244 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2245 In addition, put a comment in there, to replace...
2246 * tests/regression.at (%union and C comments): Remove.
2247
e7b8bef1
AD
22482001-12-29 Akim Demaille <akim@epita.fr>
2249
2250 * tests/regression.at (Web2c Actions): Blindly move the actual
2251 output as expected output. The contents *seem* right to me, but I
2252 can't pretend reading perfectly parser tables... Nonetheless, all
2253 the other tests pass correctly, the table look OK, even though the
2254 presence of `$axiom' is to be noted: AFAICS it is useless (but
2255 harmless).
2256
b68e7744
AD
22572001-12-29 Akim Demaille <akim@epita.fr>
2258
2259 * src/reader.c (readgram): Don't add the rule 0 if there were no
2260 rules read. In other words, add it _after_ having performed
2261 grammar sanity checks.
2262 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2263
78d5bae9
AD
22642001-12-29 Akim Demaille <akim@epita.fr>
2265
2266 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2267 visible, and some states have now a different number.
2268
ff442794
AD
22692001-12-29 Akim Demaille <akim@epita.fr>
2270
2271 * src/reader.c (readgram): Bind the initial rule's lineno to that
2272 of the first rule.
2273 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2274 (Solved SR Conflicts): Adjust rule 0's line number.
2275
610ab194
AD
22762001-12-29 Akim Demaille <akim@epita.fr>
2277
2278 Fix the `GAWK Grammar' failure.
2279
2280 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2281 the reductions of the first state which was mistakenly confused
2282 with the final state because precisely final_state was initialized
2283 to 0.
2284 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2285 now noticed by Bison.
2286 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2287 have a reduction on $default.
2288
29d29c8f
AD
22892001-12-29 Akim Demaille <akim@epita.fr>
2290
2291 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2292 rule line numbers.
2293 * src/closure.c (print_closure): Likewise.
2294 * src/derives.c (print_derives): Likewise.
2295 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2296 now.
2297
7c6b64d0
AD
22982001-12-29 Akim Demaille <akim@epita.fr>
2299
2300 * src/lalr.c (lookaheads_print): New.
2301 (lalr): Call it when --trace-flag.
2302 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2303 are dumped.
2304
3d4daee3
AD
23052001-12-29 Akim Demaille <akim@epita.fr>
2306
2307 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2308 when walking through ritem, even via rule->rhs.
2309 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2310 (useful_production, useless_nonterminals): Likewise.
2311 (reduce_grammar_tables): Likewise, plus update nritems.
2312 * src/nullable.c (set_nullable): Likewise.
2313 * src/lalr.c (build_relations): Likewise.
2314 * tests/sets.at (Nullable): Adjust.
2315 Fortunately, now, the $axiom is no longer nullable.
2316
9e7f6bbd
AD
23172001-12-29 Akim Demaille <akim@epita.fr>
2318
2319 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2320 the 0-sentinel.
2321 * src/gram.c (ritem_longest_rhs): Likewise.
2322 * src/reduce.c (nonterminals_reduce): Likewise.
2323 * src/print_graph.c (print_graph): Likewise.
2324 * src/output.c (output_rule_data): Likewise.
2325 * src/nullable.c (set_nullable): Likewise.
2326
255ef638
AD
23272001-12-29 Akim Demaille <akim@epita.fr>
2328
2329 * src/output.c: Comment changes.
2330
0d8a7363
AD
23312001-12-27 Paul Eggert <eggert@twinsun.com>
2332
2333 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2334 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2335 Sparc, as they were causing more porting problems than the
2336 (minor) performance improvement was worth.
2337
2338 Also, catch up with 1.31's YYSTD.
2339
3db472b9
AD
23402001-12-27 Akim Demaille <akim@epita.fr>
2341
2342 * src/output.c (output_gram): Rely on nritems, not the
2343 0-sentinel. See below.
2344 Use -1 as separator, not 0.
2345 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2346 Rely on -1 as separator in yyrhs, instead of 0.
2347 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2348 twice `Now at end of input', therefore there are two lines less to
2349 expect.
2350
b365aa05
AD
23512001-12-27 Akim Demaille <akim@epita.fr>
2352
2353 * tests/regression.at (Unresolved SR Conflicts):
2354 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2355 below.
2356
30171f79
AD
23572001-12-27 Akim Demaille <akim@epita.fr>
2358
2359 * src/LR0.c (new_state): Recognize the final state by the fact it
2360 is reached by eoftoken.
2361 (insert_start_shifting_state, insert_eof_shifting_state)
2362 (insert_accepting_state, augment_automaton): Remove, since now
2363 these states are automatically computed from the initial state.
2364 (generate_states): Adjust.
2365 * src/print.c: When reporting a rule number to the user, substract
2366 1, so that the axiom rule is rule 0, and the first user rule is 1.
2367 * src/reduce.c: Likewise.
2368 * src/print_graph.c (print_core): For the time being, just as for
2369 the report, depend upon --trace-flags to dump the full set of
2370 items.
2371 * src/reader.c (readgram): Once the grammar read, insert the rule
2372 0: `$axiom: START-SYMBOL $'.
2373 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2374 number of the states has changed (the final state is no longer
2375 necessarily the last), catch up.
2376
75142d45
AD
23772001-12-27 Akim Demaille <akim@epita.fr>
2378
2379 Try to make the use of the eoftoken valid. Given that its value
2380 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2381 is used instead of > 0 where appropriate, (ii), depend upon nritems
2382 instead of the 0-sentinel.
2383
2384 * src/gram.h, src/gram.c (nritems): New.
2385 Expected to be duplication of nitems, but for the time being...
2386 * src/reader.c (packgram): Assert nritems and nitems are equal.
2387 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2388 * src/closure.c (print_closure, print_fderives): Likewise.
2389 * src/gram.c (ritem_print): Likewise.
2390 * src/print.c (print_core, print_grammar): Likewise.
2391 * src/print_graph.c: Likewise.
2392
b7c49edf
AD
23932001-12-27 Akim Demaille <akim@epita.fr>
2394
2395 * src/main.c (main): If there are complains after grammar
2396 reductions, then output the report anyway if requested, then die.
2397 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2398 * src/reader.c (eoftoken): New.
2399 (parse_token_decl): If the token being defined has value `0', it
2400 is the eoftoken.
2401 (packsymbols): No longer hack `tags' to insert `$' by hand.
2402 Be sure to preserve the value of the eoftoken.
2403 (reader): Make sure eoftoken is defined.
2404 Initialize nsyms to 0: now eoftoken is created just like the others.
2405 * src/print.c (print_grammar): Don't special case the eof token.
2406 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2407 lie anyway, albeit pleasant.
2408 * tests/calc.at: Exercise error messages with eoftoken.
2409 Change the grammar so that empty input is invalid.
2410 Adjust expectations.
2411 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2412
ec2da99f
AD
24132001-12-27 Akim Demaille <akim@epita.fr>
2414
2415 * configure.in: Check the protos of strchr ans strspn.
2416 Replace strchr if needed.
2417 * src/system.h: Provide the protos of strchr, strspn and memchr if
2418 missing.
2419 * lib/strchr.c: New.
2420 * src/reader.c (symbols_save): Use strchr.
2421
8adfa272
AD
24222001-12-27 Akim Demaille <akim@epita.fr>
2423
2424 * src/print.c, src/print_graph.c (escape): New.
2425 Use it to quote the TAGS outputs.
2426 * src/print_graph.c (print_state): Now errors are in red, and
2427 reductions in green.
2428 Prefer high to wide: output the state number on a line of its own.
2429
80dac38c
AD
24302001-12-27 Akim Demaille <akim@epita.fr>
2431
2432 * src/state.h, src/state.c (reductions_new): New.
2433 * src/LR0.c (set_state_table): Let all the states have a
2434 `reductions', even if reduced to 0.
2435 (save_reductions): Adjust.
2436 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2437 * src/print.c (print_reductions, print_actions): Adjust.
2438 * src/output.c (action_row): Adjust.
2439
2cec70b9
AD
24402001-12-27 Akim Demaille <akim@epita.fr>
2441
2442 * src/state.h, src/state.c (errs_new, errs_dup): New.
2443 * src/LR0.c (set_state_table): Let all the states have an errs,
2444 even if reduced to 0.
2445 * src/print.c (print_errs, print_reductions): Adjust.
2446 * src/output.c (output_actions, action_row): Adjust.
2447 * src/conflicts.c (resolve_sr_conflict): Adjust.
2448
13ca549a
AD
24492001-12-27 Akim Demaille <akim@epita.fr>
2450
2451 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2452
5092aba5
AD
24532001-12-27 Akim Demaille <akim@epita.fr>
2454
2455 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2456 * src/print.c: here.
2457 (lookaheadset, shiftset): New, used as additional storage by
2458 print_reductions.
2459 (print_results): Adjust.
2460 (print_shifts, print_gotos, print_errs): New, extracted from...
2461 (print_actions): here.
2462 * src/print_graph.c (print_actions): Remove dead code.
2463
11e2beca
AD
24642001-12-27 Akim Demaille <akim@epita.fr>
2465
2466 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2467 `$n' and `@n'.
2468
dac3c910
AD
24692001-12-27 Akim Demaille <akim@epita.fr>
2470
2471 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2472 (build_relations): Adjust.
2473
d0b0fefa
AD
24742001-12-27 Akim Demaille <akim@epita.fr>
2475
2476 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2477 duplication.
2478
adc8c848
AD
24792001-12-27 Akim Demaille <akim@epita.fr>
2480
2481 * src/reader.c (packgram): Catch nitems overflows.
2482
14d293ac
AD
24832001-12-27 Akim Demaille <akim@epita.fr>
2484
2485 * src/files.c, src/files.h (guard_obstack): Remove.
2486 * src/output.c (output): Adjust.
2487 * src/reader.c (parse_braces): New, factoring...
2488 (copy_action, copy_guard): these two which are renamed as...
2489 (parse_action, parse_guard): these.
2490 As a voluntary consequence, using braces around guards is now
2491 mandatory.
2492
f499b062
AD
24932001-12-27 Akim Demaille <akim@epita.fr>
2494
2495 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2496 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2497 members.
2498 (symbol_list_new): Adjust.
2499 (copy_action): action_line is the first line, not the last.
2500 (copy_guard): Just as for actions, store the `action' only, not
2501 the switch/case/break flesh.
2502 Don't parse the user action that might follow the guard, let...
2503 (readgram): do it, i.e., now, there can be an action after a
2504 guard.
2505 In other words the guard is just explicitly optional.
2506 (packgram): Adjust.
2507 * src/output.c (guards_output): New.
2508 (output_parser): Call it when needed.
2509 (output): Also free the guard and attrs obstacks.
2510 * src/files.c, src/files.h (obstack_save): Remove.
2511 (output_files): Remove.
2512 As a result, if one needs the former `.act' file, using an
2513 appropriate skeleton which requires actions and guards is now
2514 required.
2515 * src/main.c (main): Adjust.
2516 * tests/semantic.at: New.
2517 * tests/regression.at: Use `input.y' as input file name.
2518 Avoid 8+3 problems by requiring input.c when the test needs the
2519 parser.
2520
d945f5cd
AD
25212001-12-27 Akim Demaille <akim@epita.fr>
2522
2523 * src/reader.c (symbol_list_new): Be sure to initialize all the
2524 fields.
2525
d200e455
AD
25262001-12-27 Akim Demaille <akim@epita.fr>
2527
2528 All the hacks using a final pseudo state are now useless.
2529
2530 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2531 * src/lalr.c (nLA): New.
2532 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2533 instead of lookaheadsp from the pseudo state (nstate + 1).
2534
f9507c28
AD
25352001-12-27 Akim Demaille <akim@epita.fr>
2536
2537 * src/output.c (action_row, token_actions): Use a state_t instead
2538 of a integer, and nlookaheads instead of the following state's
2539 lookaheadsp.
2540
065fbd27
AD
25412001-12-27 Akim Demaille <akim@epita.fr>
2542
2543 * src/conflicts.c (log_resolution, flush_shift)
2544 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2545 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2546 (conflicts_print, print_reductions): Use a state_t instead of an
2547 integer when referring to a state.
2548 As much as possible, depend upon nlookaheads, instead of the
2549 `lookaheadsp' member of the following state (since lookaheads of
2550 successive states are successive, the difference between state n + 1
2551 and n served as the number of lookaheads for state n).
2552 * src/lalr.c (add_lookback_edge): Likewise.
2553 * src/print.c (print_core, print_actions, print_state)
2554 (print_results): Likewise.
2555 * src/print_graph.c (print_core, print_actions, print_state)
2556 (print_graph): Likewise.
2557 * src/conflicts.h: Adjust.
2558
1b177bd7
AD
25592001-12-27 Akim Demaille <akim@epita.fr>
2560
2561 * src/bison.hairy: Formatting/comment changes.
2562 ANSIfy.
2563 Remove `register' indications.
2564 Add plenty of `static'.
2565
7742ddeb
AD
25662001-12-27 Akim Demaille <akim@epita.fr>
2567
2568 * src/output.c (prepare): Drop the muscle `ntbase' which
2569 duplicates ntokens.
2570 * src/bison.simple: Formatting/comment changes.
2571 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2572 is an undocumented synonym.
2573
1fa14068
AD
25742001-12-22 Akim Demaille <akim@epita.fr>
2575
2576 * src/output.c (output_table_data): Change the prototype to use
2577 `int' for array ranges: some invocations do pass an int, not a
2578 short.
2579 Reported by Wayne Green.
2580
b9752825
AD
25812001-12-22 Akim Demaille <akim@epita.fr>
2582
2583 Some actions of web2c.y are improperly triggered.
2584 Reported by Mike Castle.
2585
2586 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2587 * tests/regression.at (Web2c): Rename as...
2588 (Web2c Report): this.
2589 (Web2c Actions): New.
2590
776209d6
AD
25912001-12-22 Akim Demaille <akim@epita.fr>
2592
2593 Reductions in web2c.y are improperly reported.
2594 Reported by Mike Castle.
2595
2596 * src/conflicts.c (print_reductions): Fix.
2597 * tests/regression.at (Web2c): New.
2598
275fc3ad
AD
25992001-12-18 Akim Demaille <akim@epita.fr>
2600
2601 Some host fail on `assert (!"foo")', which expands to
2602 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2603 Reported by Nelson Beebee.
2604
2605 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2606 `#define it_succeeded 0' and `assert (it_succeeded)'.
2607
897668ee
MA
26082001-12-17 Marc Autret <autret_m@epita.fr>
2609
2610 * src/bison.simple: Don't hard code the skeleton line and filename.
2611 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2612 New line counter 'skeleton_line' (skeleton-line muscle).
2613
ab3399e0
PE
26142001-12-17 Paul Eggert <eggert@twinsun.com>
2615
2616 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2617 YYDEBUG must be defined to a nonzero value.
2618
2619 * src/bison.simple (yytname): Do not assume that the user defines
2620 YYDEBUG to a properly parenthesized expression.
2621
3877f72b
AD
26222001-12-17 Akim Demaille <akim@epita.fr>
2623
2624 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2625 nlookaheads is a new member.
2626 Adjust all users.
2627 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2628 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2629 state.
776209d6 2630
331dbc1b
AD
26312001-12-17 Akim Demaille <akim@epita.fr>
2632
2633 * src/files.h, src/files.c (open_files, close_files): Remove.
2634 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2635 let...
2636 * src/reader.c (reader): Do it.
776209d6 2637
be750e4c
AD
26382001-12-17 Akim Demaille <akim@epita.fr>
2639
2640 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 2641
709ae8c6
AD
26422001-12-17 Akim Demaille <akim@epita.fr>
2643
2644 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2645 (flush_reduce): New.
2646 (resolve_sr_conflict): Adjust.
776209d6 2647
f87685c3
AD
26482001-12-17 Akim Demaille <akim@epita.fr>
2649
2650 * src/output.c (output_obstack): Be static and rename as...
2651 (format_obstack): this, to avoid any confusion with files.c's
2652 output_obstack.
2653 * src/reader.h (muscle_obstack): Move to...
2654 * src/output.h: here, since it's defined in output.c.
2655
837491d8
AD
26562001-12-17 Akim Demaille <akim@epita.fr>
2657
2658 * src/output.c (action_row, save_column, default_goto)
2659 (sort_actions, matching_state, pack_vector): Better variable
2660 locality.
2661
796d61fb
AD
26622001-12-17 Akim Demaille <akim@epita.fr>
2663
2664 * src/output.c: Various formatting changes.
776209d6 2665
64d15509
AD
26662001-12-17 Akim Demaille <akim@epita.fr>
2667
2668 * src/files.c (output_files): Free the output_obstack.
2669 * src/main.c (main): Call print and print_graph conditionally.
2670 * src/print.c (print): Work unconditionally.
2671 * src/print_graph.c (print_graph): Work unconditionally.
2672 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2673
fbc8ecb7
MA
26742001-12-16 Marc Autret <autret_m@epita.fr>
2675
2676 * src/output.c (actions_output): Fix. When we use %no-lines,
2677 there is one less line per action.
2678
f0440388
MA
26792001-12-16 Marc Autret <autret_m@epita.fr>
2680
2681 * src/bison.simple: Remove a useless #line directive.
2682 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2683 * src/output.c (get_lines_number): New.
776209d6 2684 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
2685 output muscles.
2686 Fix line numbering.
2687 (actions_output): Computes the number of lines taken by actions.
2688 (output_master_parser): Insert new skeleton which is the name of
2689 the output parser file name.
2690
a79986b8
MA
26912001-12-15 Marc Autret <autret_m@epita.fr>
2692
2693 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2694
4ec8e00f
MA
26952001-12-15 Marc Autret <autret_m@epita.fr>
2696
2697 * src/output.c (output_gram): Keep track of the hairy one.
2698
1a4648ff
AD
26992001-12-15 Akim Demaille <akim@epita.fr>
2700
2701 Make `make distcheck' work.
2702
2703 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2704 system.h which uses libgettext.h.
2705
9c2c67e6
AD
27062001-12-15 Akim Demaille <akim@epita.fr>
2707
2708 * src/nullable.c (set_nullable): Useless rules must be skipped,
2709 otherwise, since we range over their symbols, we might look at a
2710 nonterminal which no longer ``exists'', i.e., it is not counted in
2711 `nvars', hence we overflow our arrays.
2712
93ede233
AD
27132001-12-15 Akim Demaille <akim@epita.fr>
2714
2715 The header can also be produced directly, without any obstack!
2716 Yahoo!
2717
2718 * src/files.c, src/files.h (defines_obstack): Remove.
2719 (compute_header_macro): Global.
2720 (defines_obstack_save): Remove.
2721 * src/reader.c (parse_union_decl): No longer output to
2722 defines_obstack: its content can be found in the `stype' muscle
2723 anyway.
2724 (output_token_translations): Merge into...
2725 (symbols_output): this.
2726 Rename as...
2727 (symbols_save): this.
2728 (reader): Adjust.
2729 * src/output.c (header_output): New.
2730 (output): Call it.
2731
2666f928
AD
27322001-12-15 Akim Demaille <akim@epita.fr>
2733
2734 * src/reader.c (parse_union_decl): Instead of handling two obstack
2735 simultaneously, use one to define the `stype' muscle, and use the
2736 value of the latter to fill defines_obstack.
2737 (copy_comment): Remove.
2738 (copy_comment2): Work for a single obstack.
2739 Rename as...
2740 (copy_comment): this.
2741
428046f8
AD
27422001-12-15 Akim Demaille <akim@epita.fr>
2743
2744 * src/lex.c, src/lex.h (xgetc): No longer static.
2745 * src/reader.c (parse_union_decl): Revamp.
2746
ea52d706
AD
27472001-12-15 Akim Demaille <akim@epita.fr>
2748
2749 Still making progress in separating Bison into (i) input, (ii)
2750 process, (iii) output: now we can directly output the parser file
2751 without using table_obstack at all.
2752
2753 * src/files.c, src/files.h (table_obstack): Bye bye.
2754 (parser_file_name): New.
2755 * src/files.c (compute_output_file_names): Compute it.
2756 * src/output.c (actions_output, output_parser)
2757 (output_master_parser): To a file instead of an obstack.
2758
3f96f4dc
AD
27592001-12-15 Akim Demaille <akim@epita.fr>
2760
2761 Attach actions to rules, instead of pre-outputting them to
2762 actions_obstack.
2763
2764 * src/gram.h (rule_t): action and action_line are new members.
2765 * src/reader.c (symbol_list): Likewise.
2766 (copy_action): Save the actions within the rule.
2767 (packgram): Save them in rule_table.
2768 * src/output.c (actions_output): New.
2769 (output_parser): Use it on `%%actions'.
2770 (output_rule_data): Don't free rule_table.
2771 (output): Do it.
2772 (prepare): Don't save the `action' muscle.
2773 * src/bison.simple: s/%%action/%%actions/.
2774
51576fb3
AD
27752001-12-15 Akim Demaille <akim@epita.fr>
2776
2777 * src/reader.c (copy_action): When --yacc, don't append a `;'
2778 to the user action: let it fail if lacking.
dee049eb 2779 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 2780
2648a72d
AD
27812001-12-14 Akim Demaille <akim@epita.fr>
2782
2783 * src/lex.c (literalchar): Simply return the char you decoded, non
2784 longer mess around with obstacks and int pointers.
2785 Adjust all callers.
2786
92790e5b
AD
27872001-12-14 Akim Demaille <akim@epita.fr>
2788
2789 * src/lex.c (literalchar): Don't escape the special characters,
2790 just decode them, and keep them as char (before, eol was output as
2791 the 2 char string `\n' etc.).
2792 * src/output.c (output_rule_data): Use quotearg to output the
2793 token strings.
2794
927c1557
PE
27952001-12-13 Paul Eggert <eggert@twinsun.com>
2796
2797 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2798 Do not infringe on the global user namespace when using C++.
2799 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2800 All uses of `fprintf' and `stderr' changed.
2801
2802 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2803
ed8e1f68
AD
28042001-12-13 Akim Demaille <akim@epita.fr>
2805
2806 The computation of nullable is broken: it doesn't handle empty
2807 RHS's properly.
2808
2809 * tests/torture.at (GNU AWK Grammar): New.
2810 * tests/sets.at (Nullable): New.
2811 * src/nullable.c (set_nullable): Instead of blindly looping over
2812 `ritems', loop over the rules, and then over their rhs's.
2813
2814 Work around Autotest bugs.
2815
2816 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2817 frame, because Autotest understand lines starting with a `+' as
2818 traces from the shell. Then, they are not processed properly.
2819 Admittedly an Autotest bug, but we don't have time to wait for
2820 Autotest to catch up.
2821 * tests/regression.at (Broken Closure): Adjust to the new table
2822 frames.
2823 Move to...
2824 * tests/sets.at: here.
2825
cb581495
AD
28262001-12-13 Akim Demaille <akim@epita.fr>
2827
2828 * src/closure.c (closure): Use nrules instead of playing tricks
2829 with BITS_PER_WORD.
2830
2e729273
AD
28312001-12-13 Akim Demaille <akim@epita.fr>
2832
2833 * src/print.c (print_actions): Output the handling of `$' as the
2834 traces do: shifting the token EOF. Before EOF was treated as a
2835 nonterminal.
2836 * tests/regression.at: Adjust some tests.
2837 * src/print_graph.c (print_core): Complete the set of items via
2838 closure. The next-to-final and final states are still unsatisfying,
2839 but that's to be addressed elsewhere.
2840 No longer output the rule numbers, but do output the state number.
2841 A single loop for the shifts + gotos is enough, but picked a
2842 distinct color for each.
2843 (print_graph): Initialize and finalize closure.
2844
107f7dfb
AD
28452001-12-13 Akim Demaille <akim@epita.fr>
2846
2847 * src/reader.c (readgram): Remove dead code, an strip useless
2848 braces.
2849 (get_type): Remove, unused.
2850
9b53a24f
AD
28512001-12-12 Akim Demaille <akim@epita.fr>
2852
2853 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
2854 on that of lib/error.c.
2855
dbfb6dcd
AD
28562001-12-12 Akim Demaille <akim@epita.fr>
2857
2858 Some hosts don't like `/' in includes.
2859
2860 * src/system.h: Include libgettext.h without qualifying the path.
2861 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
2862 $(top_srcdir).
2863
c25fb648
MA
28642001-12-11 Marc Autret <autret_m@epita.fr>
2865
2866 * src/output.c (output_parser): Remove useless muscle.
2867
710ddc4f
MA
28682001-12-11 Marc Autret <autret_m@epita.fr>
2869
2870 * src/bison.simple: Remove #line just before %%epilogue. It
2871 is now handled in ...
2872 * src/reader.c (read_additionnal_code): Add the output of a
2873 #line for the epilogue.
2874
e83d80b8
MA
28752001-12-10 Marc Autret <autret_m@epita.fr>
2876
927c1557 2877 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
2878 replace precedent remove.
2879 * src/bison.simple: Remove #line before %%prologue because
2880 %%input-line is wrong at this time.
2881
971d5158
MA
28822001-12-10 Marc Autret <autret_m@epita.fr>
2883
2884 * src/reader.c (symbols_output): Clean up.
927c1557 2885 * src/output.c (output_gram, output): Clean up.
971d5158 2886
5edafffd
AD
28872001-12-10 Akim Demaille <akim@epita.fr>
2888
2889 * src/lalr.c (initialize_lookaheads): New. Extracted from...
2890 * src/LR0.c (set_state_table): here.
2891 * src/lalr.c (lalr): Call it.
2892
0279f8e9
AD
28932001-12-10 Akim Demaille <akim@epita.fr>
2894
2895 * src/state.h (shifts): Remove the `number' member: shifts are
2896 attached to state, hence no longer need to be labelled with a
2897 state number.
2898
190c4f5f
AD
28992001-12-10 Akim Demaille <akim@epita.fr>
2900
2901 Now that states have a complete set of members, the linked list of
2902 shifts is useless: just fill directly the state's shifts member.
2903
2904 * src/state.h (shifts): Remove the `next' member.
2905 * src/LR0.c (first_state, last_state): Remove.
2906 Adjust the callers.
2907 (augment_automaton): Don't look for the shifts that must be added
2908 a shift on EOF: it is those of the state we looked for! But now,
2909 since shifts are attached, it is no longer needed to looking
2910 merely by its id: its number.
2911
2a73b93d
AD
29122001-12-10 Akim Demaille <akim@epita.fr>
2913
2914 * src/LR0.c (augment_automaton): Better variable locality.
2915 Remove an impossible branch: if there is a state corresponding to
2916 the start symbol being shifted, then there is shift for the start
2917 symbol from the initial state.
2918
74392f6a
AD
29192001-12-10 Akim Demaille <akim@epita.fr>
2920
2921 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
2922 only when appropriate: when insert_start_shifting_state' is not
2923 invoked.
2924 * tests/regression.at (Rule Line Numbers): Adjust.
2925
37c82725
AD
29262001-12-10 Akim Demaille <akim@epita.fr>
2927
2928 * src/LR0.c (augment_automaton): Now that all states have shifts,
2929 merge the two cases addition shifts to the initial state.
2930
6a164e0c
AD
29312001-12-10 Akim Demaille <akim@epita.fr>
2932
2933 * src/lalr.c (set_state_table): Move to...
2934 * src/LR0.c: here.
2935 * src/lalr.c (lalr): Don't call it...
2936 * src/LR0.c (generate_states): do it.
2937 * src/LR0.h (first_state): Remove, only the table is used.
2938
7215de24
AD
29392001-12-10 Akim Demaille <akim@epita.fr>
2940
2941 * src/LR0.h (first_shift, first_reduction): Remove.
2942 * src/lalr.c: Don't use first_shift: find shifts through the
2943 states.
2944
80e25d4d
AD
29452001-12-10 Akim Demaille <akim@epita.fr>
2946
2947 * src/LR0.c: Attach shifts to states as soon as they are
2948 computed.
2949 * src/lalr.c (set_state_table): Instead of assigning shifts to
2950 state, just assert that the mapping was properly done.
2951
0ab3728b
AD
29522001-12-10 Akim Demaille <akim@epita.fr>
2953
2954 * src/LR0.c (insert_start_shift): Rename as...
2955 (insert_start_shifting_state): this.
2956 (insert_eof_shifting_state, insert_accepting_state): New.
2957 (augment_automaton): Adjust.
2958 Better locality of the variables.
2959 When looking if the start_symbol is shifted from the initial
2960 state, using `while (... symbol != start_symbol ...)' sounds
2961 better than `while (... symbol < start_symbol ...)': If fail
2962 to see how the order between symbols could be relevant!
2963
78af9bbc
AD
29642001-12-10 Akim Demaille <akim@epita.fr>
2965
2966 * src/getargs.h: Don't declare `spec_name_prefix' and
2967 `spec_file_prefix', declared by src/files.h.
2968 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2969 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2970 * src/output.c (prepare): Adjust.
2971 * src/reader.c (symbols_output): Likewise.
2972 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2973
bdef2a41
AD
29742001-12-10 Akim Demaille <akim@epita.fr>
2975
2976 * src/muscle_tab.c (muscle_init): NULL is a better default than
2977 `"0"'.
2978
3735969c
AD
29792001-12-10 Akim Demaille <akim@epita.fr>
2980
2981 * src/reader.c (reader): Calling symbols_output once is enough.
2982
49701457
AD
29832001-12-10 Akim Demaille <akim@epita.fr>
2984
2985 Now that states have a complete set of members, the linked list of
2986 reductions is useless: just fill directly the state's reductions
2987 member.
2988
2989 * src/state.h (struct reductions): Remove member `number' and
2990 `next'.
2991 * src/LR0.c (first_reduction, last_reduction): Remove.
2992 (save_reductions): Don't link the new reductions, store them in
2993 this_state.
2994 * src/lalr.c (set_state_table): No need to attach reductions to
2995 states, it's already done.
2996 * src/output.c (output_actions): No longer free the shifts, then
2997 the reductions, then the states: free all the states and their
2998 members.
2999
0edad749
AD
30002001-12-10 Akim Demaille <akim@epita.fr>
3001
3002 * src/options.c (OPTN, DRTV, BOTH): New.
3003 (option_table): Use them.
3004
0edad749
AD
3005 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3006 the job of system.h.
3007 * src/options.c: Don't include stdio.h and xalloc.h for the same
3008 reasons.
3009
5449dd0f
AD
30102001-12-10 Akim Demaille <akim@epita.fr>
3011
3012 * src/output.c (output, prepare): Make sure the values of the
3013 muscles `action' and `prologue' are 0-terminated.
3014
a870c567
AD
30152001-12-10 Akim Demaille <akim@epita.fr>
3016
3017 Clean up GCC warnings.
3018
3019 * src/reader.c (copy_action): `buf' is not used.
3020 (parse_skel_decl): Be static.
3021 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3022 * src/options.h (create_long_option_table): Have a real prototype.
3023 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3024 (hash_delete_at): Return const void *.
3025 Adjust casts to preserve the const.
3026
80df8768
AD
30272001-12-10 Akim Demaille <akim@epita.fr>
3028
3029 * configure.in: Require 2.52g.
3030 M4 is not needed, but AUTOM4TE is.
3031 * m4/m4.m4: Remove.
3032 * tests/Makefile.am: Adjust.
3033
f693ad14
AD
30342001-12-10 Akim Demaille <akim@epita.fr>
3035
3036 One structure for states is enough, even though theoretically
3037 there are LR(0) states and LALR(1) states.
3038
3039 * src/lalr.h (state_t): Remove.
3040 (state_table): Be state_t **, not state_t *.
3041 * src/state.h (core, CORE_ALLOC): Rename as...
3042 (state_t, STATE_ALLOC): this.
3043 Add the LALR(1) members: shifts, reductions, errs.
3044 * src/LR0.c (state_table): Rename as...
3045 (state_hash): this, to avoid name clashes with the global
3046 `state_table'.
3047 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3048 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3049
74ffbcb6
AD
30502001-12-10 Akim Demaille <akim@epita.fr>
3051
3052 Bison dumps core on bash.y.
3053 Reported by Pascal Bart.
3054
3055 * src/warshall.c (bitmatrix_print): New.
3056 (TC): Use it.
3057 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3058 j must be the outer loop.
3059 * tests/regression.at (Broken Closure): New.
3060
07708e19
AD
30612001-12-05 Akim Demaille <akim@epita.fr>
3062
3063 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3064 its argument.
3065