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