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