]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* data/bison.simple (yydestructor): Rename as...
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-06-20 Akim Demaille <akim@epita.fr>
2
3 * data/bison.simple (yydestructor): Rename as...
4 (yydestruct): this.
5
62002-06-20 Akim Demaille <akim@epita.fr>
7
8 * src/symtab.h, src/symtab.c (symbol_type_set)
9 (symbol_destructor_set, symbol_precedence_set): The location is
10 the last argument.
11 Adjust all callers.
12
132002-06-20 Akim Demaille <akim@epita.fr>
14
15 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16 internals.
17 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
18 Takes a location.
19 * src/symtab.h, src/symtab.c (symbol_class_set)
20 (symbol_user_token_number_set): Likewise.
21 Adjust all callers.
22 Promote complain_at.
23 * tests/input.at (Type Clashes): Adjust.
24
252002-06-20 Akim Demaille <akim@epita.fr>
26
27 * data/bison.simple (YYLEX): Fix the declaration when
28 %pure-parser.
29
302002-06-20 Akim Demaille <akim@epita.fr>
31
32 * data/bison.simple (yysymprint): Don't print the token number,
33 just its name.
34 * tests/actions.at (Destructors): Rename as...
35 (Printers and Destructors): this.
36 Also exercise %printer.
37
382002-06-20 Akim Demaille <akim@epita.fr>
39
40 * data/bison.simple (YYDSYMPRINT): New.
41 Use it to remove many of the #if YYDEBUG/if (yydebug).
42
432002-06-20 Akim Demaille <akim@epita.fr>
44
45 * src/symtab.h, src/symtab.c (symbol_t): printer and
46 printer_location are new members.
47 (symbol_printer_set): New.
48 * src/parse-gram.y (PERCENT_PRINTER): New token.
49 Handle its associated rule.
50 * src/scan-gram.l: Adjust.
51 (handle_destructor_at, handle_destructor_dollar): Rename as...
52 (handle_symbol_code_at, handle_symbol_code_dollar): these.
53 * src/output.c (symbol_printers_output): New.
54 (output_skeleton): Call it.
55 * data/bison.simple (yysymprint): New. Cannot be named yyprint
56 since there are already many grammar files with a user `yyprint'.
57 Replace the calls to YYPRINT to calls to yysymprint.
58 * tests/calc.at: Adjust.
59 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
60 taking advantage of parser very internal details (stack size!).
61
622002-06-20 Akim Demaille <akim@epita.fr>
63
64 * src/scan-gram.l: Complete the scanner with the missing patterns
65 to pacify Flex.
66 Use `quote' and `symbol_tag_get' where appropriate.
67
682002-06-19 Akim Demaille <akim@epita.fr>
69
70 * tests/actions.at (Destructors): Augment to test locations.
71 * data/bison.simple (yydestructor): Pass it the current location
72 if locations are enabled.
73 Prototype only when __STDC__ or C++.
74 Change the argument names to move into the yy name space: there is
75 user code here.
76
772002-06-19 Akim Demaille <akim@epita.fr>
78
79 * data/bison.simple (b4_pure_if): New.
80 Use it instead of #ifdef YYPURE.
81
822002-06-19 Akim Demaille <akim@epita.fr>
83
84 * data/bison.simple (b4_location_if): New.
85 Use it instead of #ifdef YYLSP_NEEDED.
86
872002-06-19 Akim Demaille <akim@epita.fr>
88
89 Prepare @$ in %destructor, but currently don't bind it in the
90 skeleton, as %location use is not cleaned up yet.
91
92 * src/scan-gram.l (handle_dollar, handle_destructor_at)
93 (handle_action_at): New.
94 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
95 a braced_code_t and a location as additional arguments.
96 (handle_destructor_dollar): Instead of requiring `b4_eval', just
97 unquote one when outputting `b4_dollar_dollar'.
98 Adjust callers.
99 * data/bison.simple (b4_eval): Remove.
100 (b4_symbol_destructor): Adjust.
101 * tests/input.at (Invalid @n): Adjust.
102
1032002-06-19 Zack Weinberg <zack@codesourcery.com>
104
105 * doc/bison.texinfo: Document ability to have multiple
106 prologue sections.
107
1082002-06-18 Akim Demaille <akim@epita.fr>
109
110 * src/files.c (compute_base_names): When computing the output file
111 names from the input file name, strip the directory part.
112
1132002-06-18 Akim Demaille <akim@epita.fr>
114
115 * data/bison.simple.new: Comment changes.
116 Reported by Andreas Schwab.
117
1182002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
119
120 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
121 there are no `label `yyoverflowlab' defined but not used' warnings
122 when yyoverflow is defined.
123
1242002-06-18 Akim Demaille <akim@epita.fr>
125
126 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
127 new member.
128 (symbol_destructor_set): Adjust.
129 * src/output.c (symbol_destructors_output): Output the destructor
130 locations.
131 Output the symbol name.
132 * data/bison.simple (b4_symbol_destructor): Adjust.
133
1342002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
135 and Akim Demaille <akim@epita.fr>
136
137 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
138 what's left on the stack when the error recovery hits EOF.
139 * tests/actions.at (Destructors): Complete to exercise this case.
140
1412002-06-17 Akim Demaille <akim@epita.fr>
142
143 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
144 arguments is really empty, not only equal to `[]'.
145 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
146 member.
147 (symbol_destructor_set): New.
148 * src/output.c (symbol_destructors_output): New.
149 * src/reader.h (brace_code_t, current_braced_code): New.
150 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
151 (handle_dollar): Rename as...
152 (handle_action_dollar): this.
153 (handle_destructor_dollar): New.
154 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
155 (grammar_declaration): Use it.
156 * data/bison.simple (yystos): Is always defined.
157 (yydestructor): New.
158 * tests/actions.at (Destructors): New.
159 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
160
1612002-06-17 Akim Demaille <akim@epita.fr>
162
163 * src/symlist.h, src/symlist.c (symbol_list_length): New.
164 * src/scan-gram.l (handle_dollar, handle_at): Compute the
165 rule_length only when needed.
166 * src/output.c (actions_output, token_definitions_output): Output
167 the full M4 block.
168 * src/symtab.c: Don't access directly to the symbol tag, use
169 symbol_tag_get.
170 * src/parse-gram.y: Use symbol_list_free.
171
1722002-06-17 Akim Demaille <akim@epita.fr>
173
174 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
175 (symbol_list_prepend, get_type_name): Move to...
176 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
177 (symbol_list_prepend, symbol_list_n_type_name_get): here.
178 Adjust all callers.
179 (symbol_list_free): New.
180 * src/scan-gram.l (handle_dollar): Takes a location.
181 * tests/input.at (Invalid $n): Adjust.
182
1832002-06-17 Akim Demaille <akim@epita.fr>
184
185 * src/reader.h, src/reader.c (symbol_list_new): Export it.
186 (symbol_list_prepend): New.
187 * src/parse-gram.y (%union): `list' is a new member.
188 (symbols.1): New, replaces...
189 (terms_to_prec.1, nterms_to_type.1): these.
190 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
191 Take a location as additional argument.
192 Adjust all callers.
193
1942002-06-15 Akim Demaille <akim@epita.fr>
195
196 * src/parse-gram.y: Move %token in the declaration section so that
197 we don't depend upon CVS Bison.
198
1992002-06-15 Akim Demaille <akim@epita.fr>
200
201 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
202 * src/print.c (print_core): Use it.
203
2042002-06-15 Akim Demaille <akim@epita.fr>
205
206 * src/conflicts.c (log_resolution): Accept the rule involved in
207 the sr conflicts instead of the lookahead number that points to
208 that rule.
209 (flush_reduce): Accept the current lookahead vector as argument,
210 instead of the index in LA.
211 (resolve_sr_conflict): Accept the current number of lookahead
212 bitset to consider for the STATE, instead of the index in LA.
213 (set_conflicts): Adjust.
214 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
215
2162002-06-15 Akim Demaille <akim@epita.fr>
217
218 * src/state.h (state_t): Replace the `lookaheadsp' member, a
219 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
220 Adjust all dependencies.
221 * src/lalr.c (initialize_lookaheads): Split into...
222 (states_lookaheads_count, states_lookaheads_initialize): these.
223 (lalr): Adjust.
224
2252002-06-15 Akim Demaille <akim@epita.fr>
226
227 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
228 out of...
229 (grammar_rules_print): here.
230 * src/reduce.c (reduce_output): Use it.
231 * tests/reduce.at (Useless Rules, Reduced Automaton)
232 (Underivable Rules): Adjust.
233
2342002-06-15 Akim Demaille <akim@epita.fr>
235
236 Copy BYacc's nice way to report the grammar.
237
238 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
239 New.
240 Don't print the rules' location, it is confusing and useless.
241 (rule_print): Use grammar_rhs_print.
242 * src/print.c (print_grammar): Use grammar_rules_print.
243
2442002-06-15 Akim Demaille <akim@epita.fr>
245
246 Complete and rationalize `useless thing' warnings.
247
248 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
249 (symbol_tag_print): New.
250 Use them everywhere in place of accessing directly the tag member.
251 * src/gram.h, src/gram.c (rule_print): New.
252 Use it where a rule used to be printed `by hand'.
253 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
254 (reduce_grammar_tables): Report the useless rules.
255 (reduce_print): Useless things are a warning, not an error.
256 Report it as such.
257 * tests/reduce.at (Useless Nonterminals, Useless Rules):
258 (Reduced Automaton, Underivable Rules): Adjust.
259 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
260 * tests/conflicts.at (Unresolved SR Conflicts)
261 (Solved SR Conflicts): Adjust.
262
2632002-06-15 Akim Demaille <akim@epita.fr>
264
265 Let symbols have a location.
266
267 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
268 (getsym): Adjust.
269 Adjust all callers.
270 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
271 Use location_t, not int.
272 * src/symtab.c (symbol_check_defined): Take advantage of the
273 location.
274 * tests/regression.at (Invalid inputs): Adjust.
275
2762002-06-15 Akim Demaille <akim@epita.fr>
277
278 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
279 (input): Don't try to initialize yylloc here, do it in the
280 scanner.
281 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
282 * src/gram.h (rule_t): Change line and action_line into location
283 and action_location, of location_t type.
284 Adjust all dependencies.
285 * src/location.h, src/location.c (empty_location): New.
286 * src/reader.h, src/reader.c (grammar_start_symbol_set)
287 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
288 (grammar_current_rule_symbol_append)
289 (grammar_current_rule_action_append): Expect a location as argument.
290 * src/reader.c (grammar_midrule_action): Adjust to attach an
291 action's location as dummy symbol location.
292 * src/symtab.h, src/symtab.c (startsymbol_location): New.
293 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
294 the line numbers.
295
2962002-06-14 Akim Demaille <akim@epita.fr>
297
298 Grammar declarations may be found in the grammar section.
299
300 * src/parse-gram.y (rules_or_grammar_declaration): New.
301 (declarations): Each declaration may end with a semicolon, not
302 just...
303 (grammar_declaration): `"%union"'.
304 (grammar): Branch to rules_or_grammar_declaration.
305
3062002-06-14 Akim Demaille <akim@epita.fr>
307
308 * src/main.c (main): Invoke scanner_free.
309
3102002-06-14 Akim Demaille <akim@epita.fr>
311
312 * src/output.c (m4_invoke): Extracted from...
313 (output_skeleton): here.
314 Free tempfile.
315
3162002-06-14 Akim Demaille <akim@epita.fr>
317
318 * src/parse-gram.y (directives, directive, gram)
319 (grammar_directives, precedence_directives, precedence_directive):
320 Rename as...
321 (declarations, declaration, grammar, grammar_declaration)
322 (precedence_declaration, precedence_declarator): these.
323 (symbol_declaration): New.
324
3252002-06-14 Akim Demaille <akim@epita.fr>
326
327 * src/files.c (action_obstack): Remove, unused.
328 (output_obstack): Remove it, and all its dependencies, as it is no
329 longer needed.
330 * src/reader.c (epilogue_set): Build the epilogue in the
331 muscle_obstack.
332 * src/output.h, src/output.c (muscle_obstack): Move to...
333 * src/muscle_tab.h, src/muscle_tab.h: here.
334 (muscle_init): Initialize muscle_obstack.
335 (muscle_free): New.
336 * src/main.c (main): Call it.
337
3382002-06-14 Akim Demaille <akim@epita.fr>
339
340 * src/location.h: New, extracted from...
341 * src/reader.h: here.
342 * src/Makefile.am (noinst_HEADERS): Merge into
343 (bison_SOURCES): this.
344 Add location.h.
345 * src/parse-gram.y: Use location_t instead of Bison's.
346 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
347 Use location_t instead of ints.
348
3492002-06-14 Akim Demaille <akim@epita.fr>
350
351 * data/bison.simple, data/bison.c++: Be sure to restore the
352 current #line when returning to the skeleton contents after having
353 exposed the input file's #line.
354
3552002-06-12 Akim Demaille <akim@epita.fr>
356
357 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
358 eager.
359 * tests/actions.at (Exotic Dollars): New.
360
3612002-06-12 Akim Demaille <akim@epita.fr>
362
363 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
364 ['"/] too eagerly.
365 * tests/input.at (Torturing the Scanner): New.
366
3672002-06-11 Akim Demaille <akim@epita.fr>
368
369 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
370 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
371 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
372 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
373 * src/reader.c (reader): Use it.
374
3752002-06-11 Akim Demaille <akim@epita.fr>
376
377 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
378 Adjust all callers.
379 (scanner_last_string_free): New.
380
3812002-06-11 Akim Demaille <akim@epita.fr>
382
383 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
384 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
385 (last_string, YY_OBS_FREE): New.
386 Use them when returning an ID.
387
3882002-06-11 Akim Demaille <akim@epita.fr>
389
390 Have Bison grammars parsed by a Bison grammar.
391
392 * src/reader.c, src/reader.h (prologue_augment): New.
393 * src/reader.c (copy_definition): Remove.
394
395 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
396 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
397 (grammar_current_rule_prec_set, grammar_current_rule_check)
398 (grammar_current_rule_symbol_append)
399 (grammar_current_rule_action_append): Export.
400 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
401 (symbol_list_action_append): Remove.
402 Hook the routines from reader.
403 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
404 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
405
406 * src/reader.c (read_declarations): Remove, unused.
407
408 * src/parse-gram.y: Handle the epilogue.
409 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
410 (grammar_start_symbol_set): this.
411 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
412 * src/reader.c (readgram): Remove, unused.
413 (reader): Adjust to insert eoftoken and axiom where appropriate.
414
415 * src/reader.c (copy_dollar): Replace with...
416 * src/scan-gram.h (handle_dollar): this.
417 * src/parse-gram.y: Remove `%thong'.
418
419 * src/reader.c (copy_at): Replace with...
420 * src/scan-gram.h (handle_at): this.
421
422 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
423 New.
424
425 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
426 time being.
427
428 * src/reader.h, src/reader.c (grammar_rule_end): New.
429
430 * src/parse.y (current_type, current_class): New.
431 Implement `%nterm', `%token' support.
432 Merge `%term' into `%token'.
433 (string_as_id): New.
434 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
435 type name.
436
437 * src/parse-gram.y: Be sure to handle properly the beginning of
438 rules.
439
440 * src/parse-gram.y: Handle %type.
441 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
442
443 * src/parse-gram.y: More directives support.
444 * src/options.c: No longer handle source directives.
445
446 * src/parse-gram.y: Fix %output.
447
448 * src/parse-gram.y: Handle %union.
449 Use the prologue locations.
450 * src/reader.c (parse_union_decl): Remove.
451
452 * src/reader.h, src/reader.c (epilogue_set): New.
453 * src/parse-gram.y: Use it.
454
455 * data/bison.simple, data/bison.c++: b4_stype is now either not
456 defined, then default to int, or to the contents of %union,
457 without `union' itself.
458 Adjust.
459 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
460
461 * src/output.c (actions_output): Don't output braces, as they are
462 already handled by the scanner.
463
464 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
465 characters to themselves.
466
467 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
468 that the epilogue has a proper #line.
469
470 * src/parse-gram.y: Handle precedence/associativity.
471
472 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
473 a terminal.
474 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
475 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
476 at all to define terminals that cannot be emitted.
477
478 * src/scan-gram.l: Escape M4 characters.
479
480 * src/scan-gram.l: Working properly with escapes in user
481 strings/characters.
482
483 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
484 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
485 grammar.
486 Use more modest sizes, as for the time being the parser does not
487 release memory, and therefore the process swallows a huge amount
488 of memory.
489
490 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
491 stricter %token grammar.
492
493 * src/symtab.h (associativity): Add `undef_assoc'.
494 (symbol_precedence_set): Do nothing when passed an undef_assoc.
495 * src/symtab.c (symbol_check_alias_consistence): Adjust.
496
497 * tests/regression.at (Invalid %directive): Remove, as it is now
498 meaningless.
499 (Invalid inputs): Adjust to the new error messages.
500 (Token definitions): The new grammar doesn't allow too many
501 eccentricities.
502
503 * src/lex.h, src/lex.c: Remove.
504 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
505 (copy_character, copy_string2, copy_string, copy_identifier)
506 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
507 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
508 (parse_action): Remove.
509 * po/POTFILES.in: Adjust.
510
5112002-06-11 Akim Demaille <akim@epita.fr>
512
513 * src/reader.c (parse_action): Don't store directly into the
514 rule's action member: return the action as a string.
515 Don't require `rule_length' as an argument: compute it.
516 (grammar_current_rule_symbol_append)
517 (grammar_current_rule_action_append): New, eved out from
518 (readgram): here.
519 Remove `action_flag', `rulelength', unused now.
520
5212002-06-11 Akim Demaille <akim@epita.fr>
522
523 * src/reader.c (grammar_current_rule_prec_set).
524 (grammar_current_rule_check): New, eved out from...
525 (readgram): here.
526 Remove `xaction', `first_rhs': useless.
527 * tests/input.at (Type clashes): New.
528 * tests/existing.at (GNU Cim Grammar): Adjust.
529
5302002-06-11 Akim Demaille <akim@epita.fr>
531
532 * src/reader.c (grammar_midrule_action): New, Eved out from
533 (readgram): here.
534
5352002-06-11 Akim Demaille <akim@epita.fr>
536
537 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
538 New.
539 (readgram): Use them as replacement of inlined code, crule and
540 crule1.
541
5422002-06-11 Akim Demaille <akim@epita.fr>
543
544 * src/reader.c (grammar_end, grammar_symbol_append): New.
545 (readgram): Use them.
546 Make the use of `p' as local as possible.
547
5482002-06-10 Akim Demaille <akim@epita.fr>
549
550 GCJ's parser requires the tokens to be defined before the prologue.
551
552 * data/bison.simple: Output the token definition before the user's
553 prologue.
554 * tests/regression.at (Braces parsing, Duplicate string)
555 (Mixing %token styles): Check the output from bison.
556 (Early token definitions): New.
557
5582002-06-10 Akim Demaille <akim@epita.fr>
559
560 * src/symtab.c (symbol_user_token_number_set): Don't complain when
561 assigning twice the same user number to a token, so that we can
562 use it in...
563 * src/lex.c (lex): here.
564 Also use `symbol_class_set' instead of hand written code.
565 * src/reader.c (parse_assoc_decl): Likewise.
566
5672002-06-10 Akim Demaille <akim@epita.fr>
568
569 * src/symtab.c, src/symtab.c (symbol_class_set)
570 (symbol_user_token_number_set): New.
571 * src/reader.c (parse_token_decl): Use them.
572 Use a switch instead of ifs.
573 Use a single argument.
574
5752002-06-10 Akim Demaille <akim@epita.fr>
576
577 Remove `%thong' support as it is undocumented, unused, duplicates
578 `%token's job, and creates useless e-mail traffic with people who
579 want to know what it is, why it is undocumented, unused, and
580 duplicates `%token's job.
581
582 * src/reader.c (parse_thong_decl): Remove.
583 * src/options.c (option_table): Remove "thong".
584 * src/lex.h (tok_thong): Remove.
585
5862002-06-10 Akim Demaille <akim@epita.fr>
587
588 * src/symtab.c, src/symtab.c (symbol_type_set)
589 (symbol_precedence_set): New.
590 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
591 (value_components_used): Remove, unused.
592
5932002-06-09 Akim Demaille <akim@epita.fr>
594
595 Move symbols handling code out of the reader.
596
597 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
598 (axiom): Move to...
599 * src/symtab.h, src/symtab.c: here.
600
601 * src/gram.c (start_symbol): Remove: use startsymbol->number.
602 * src/reader.c (startval): Rename as...
603 * src/symtab.h, src/symtab.c (startsymbol): this.
604 * src/reader.c: Adjust.
605
606 * src/reader.c (symbol_check_defined, symbol_make_alias)
607 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
608 (token_translations_init)
609 Move to...
610 * src/symtab.c: here.
611 * src/reader.c (packsymbols): Move to...
612 * src/symtab.h, src/symtab.c (symbols_pack): here.
613 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
614 argument.
615
6162002-06-03 Akim Demaille <akim@epita.fr>
617
618 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
619 then statements.
620
6212002-06-03 Akim Demaille <akim@epita.fr>
622
623 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
624 structs with non literals.
625 * src/scan-skel.l: never-interactive.
626 * src/conflicts.c (enum conflict_resolution_e): No trailing
627 comma.
628 * src/getargs.c (usage): Split long literal strings.
629 Reported by Hans Aberg.
630
6312002-05-28 Akim Demaille <akim@epita.fr>
632
633 * data/bison.c++: Use C++ ostreams.
634 (cdebug_): New member.
635
6362002-05-28 Akim Demaille <akim@epita.fr>
637
638 * src/output.c (output_skeleton): Be sure to allocate enough room
639 for `/' _and_ for `\0' in full_skeleton.
640
6412002-05-28 Akim Demaille <akim@epita.fr>
642
643 * data/bison.c++: Catch up with bison.simple:
644 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
645 and Paul Eggert <eggert@twinsun.com>: `error' handing.
646 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
647 and popping traces.
648
6492002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
650
651 * src/output.c (output_skeleton): Put an explicit path in front of
652 the skeleton file name, rather than relying on the -I directory,
653 to partially alleviate effects of having a skeleton file lying around
654 in the current directory.
655
6562002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
657
658 * src/conflicts.c (log_resolution): Correct typo:
659 obstack_printf should be obstack_fgrow1.
660
6612002-05-26 Akim Demaille <akim@epita.fr>
662
663 * src/state.h (state_t): `solved_conflicts' is a new member.
664 * src/LR0.c (new_state): Set it to 0.
665 * src/conflicts.h, src/conflicts.c (print_conflicts)
666 (free_conflicts, solve_conflicts): Rename as...
667 (conflicts_print, conflicts_free, conflicts_solve): these.
668 Adjust callers.
669 * src/conflicts.c (enum conflict_resolution_e)
670 (solved_conflicts_obstack): New, used by...
671 (log_resolution): this.
672 Adjust to attach the conflict resolution to each state.
673 Complete the description with the precedence/associativity
674 information.
675 (resolve_sr_conflict): Adjust.
676 * src/print.c (print_state): Output its solved_conflicts.
677 * tests/conflicts.at (Unresolved SR Conflicts)
678 (Solved SR Conflicts): Exercise --report=all.
679
6802002-05-26 Akim Demaille <akim@epita.fr>
681
682 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
683 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
684 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
685 (token_number_t, item_number_as_token_number)
686 (token_number_as_item_number, muscle_insert_token_number_table):
687 Rename as...
688 (symbol_number_t, item_number_as_symbol_number)
689 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
690 these, since it is more appropriate.
691
6922002-05-26 Akim Demaille <akim@epita.fr>
693
694 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
695 `Error:' lines.
696 * data/bison.simple (yystos) [YYDEBUG]: New.
697 (yyparse) [YYDEBUG]: Display the symbols which are popped during
698 error recovery.
699 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
700
7012002-05-25 Akim Demaille <akim@epita.fr>
702
703 * doc/bison.texinfo (Debugging): Split into...
704 (Tracing): this new section, its former contents, and...
705 (Understanding): this new section.
706 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
707 by...
708 (report_flag): this.
709 Adjust all dependencies.
710 (report_args, report_types, report_argmatch): New.
711 (usage, getargs): Report/support -r, --report.
712 * src/options.h
713 (struct option_table_struct): Rename as..,
714 (struct option_table_s): this.
715 Rename the `set_flag' member to `flag' to match with getopt_long's
716 struct.
717 * src/options.c (option_table): Split verbose into an entry for
718 %verbose, and another for --verbose.
719 Support --report/-r, so remove -r from the obsolete --raw.
720 * src/print.c: Attach full item sets and lookaheads reports to
721 report_flag instead of trace_flag.
722 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
723
7242002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
725 and Paul Eggert <eggert@twinsun.com>
726
727 * data/bison.simple (yyparse): Correct error handling to conform to
728 POSIX and yacc. Specifically, after syntax error is discovered,
729 do not reduce further before shifting the error token.
730 Clean up the code a bit by removing the labels yyerrdefault,
731 yyerrhandle, yyerrpop.
732 * NEWS: Document the above.
733
7342002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
735
736 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
737 type; it isn't always big enough, since it doesn't necessarily
738 include non-terminals.
739 (yytranslate): Expand definition of yy_token_number_type, so that
740 the latter can be removed.
741 (yy_token_number_type): Remove, only one use.
742 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
743 don't use TokenNumberType as element type.
744
745 * tests/regression.at: Modify expected output to agree with change
746 to yyr1 and yytranslate.
747
7482002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
749
750 * src/reader.c (parse_action): Use copy_character instead of
751 obstack_1grow.
752
7532002-05-13 Akim Demaille <akim@epita.fr>
754
755 * tests/regression.at (Token definitions): Prototype yylex and
756 yyerror.
757
7582002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
759
760 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
761 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
762 32-bit arithmetic.
763 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
764
7652002-05-07 Akim Demaille <akim@epita.fr>
766
767 * tests/synclines.at: Be sure to prototype yylex and yyerror to
768 avoid GCC warnings.
769
7702002-05-07 Akim Demaille <akim@epita.fr>
771
772 Kill GCC warnings.
773
774 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
775 over the RHS of each rule.
776 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
777 * src/state.h (state_t): Member `nitems' is unsigned short.
778 * src/LR0.c (get_state): Adjust.
779 * src/reader.c (packgram): Likewise.
780 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
781 `Type'.
782 (muscle_insert_int_table): Remove, unused.
783 (prepare_rules): Remove `max'.
784
7852002-05-06 Akim Demaille <akim@epita.fr>
786
787 * src/closure.c (print_firsts): Display of the symbol tags.
788 (bitmatrix_print): Move to...
789 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
790 here.
791 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
792
7932002-05-06 Akim Demaille <akim@epita.fr>
794
795 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
796 hash_do_for_each.
797
7982002-05-06 Akim Demaille <akim@epita.fr>
799
800 * src/LR0.c (new_state, get_state): Instead of using the global
801 `kernel_size' and `kernel_base', have two new arguments:
802 `core_size' and `core'.
803 Adjust callers.
804
8052002-05-06 Akim Demaille <akim@epita.fr>
806
807 * src/reader.c (packgram): No longer end `ritem' with a 0
808 sentinel: it is not used.
809
8102002-05-05 Akim Demaille <akim@epita.fr>
811
812 New experimental feature: display the lookaheads in the report and
813 graph.
814
815 * src/print (print_core): When --trace-flag, display the rules
816 lookaheads.
817 * src/print_graph.c (print_core): Likewise.
818 Swap the arguments.
819 Adjust caller.
820
8212002-05-05 Akim Demaille <akim@epita.fr>
822
823 * tests/torture.at (Many lookaheads): New test.
824
8252002-05-05 Akim Demaille <akim@epita.fr>
826
827 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
828 (GENERATE_MUSCLE_INSERT_TABLE): this.
829 (output_int_table, output_unsigned_int_table, output_short_table)
830 (output_token_number_table, output_item_number_table): Replace with...
831 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
832 (muscle_insert_short_table, muscle_insert_token_number_table)
833 (muscle_insert_item_number_table): these.
834 Adjust all callers.
835 (prepare_tokens): Don't free `translations', since...
836 * src/reader.h, src/reader.c (grammar_free): do it.
837 Move to...
838 * src/gram.h, src/gram.c (grammar_free): here.
839 * data/bison.simple, data/bison.c++: b4_token_number_max is now
840 b4_translate_max.
841
8422002-05-05 Akim Demaille <akim@epita.fr>
843
844 * src/output.c (output_unsigned_int_table): New.
845 (prepare_rules): `i' is unsigned.
846 `prhs', `rline', `r2' are unsigned int.
847 Rename muscle `rhs_number_max' as `rhs_max'.
848 Output muscles `prhs_max', `rline_max', and `r2_max'.
849 Free rline and r1.
850 * data/bison.simple, data/bison.c++: Adjust to use these muscles
851 to compute types instead of constant types.
852 * tests/regression.at (Web2c Actions): Adjust.
853
8542002-05-04 Akim Demaille <akim@epita.fr>
855
856 * src/symtab.h (SALIAS, SUNDEF): Rename as...
857 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
858 Adjust dependencies.
859 * src/output.c (token_definitions_output): Be sure not to output a
860 `#define 'a'' when fed with `%token 'a' "a"'.
861 * tests/regression.at (Token definitions): New.
862
8632002-05-03 Paul Eggert <eggert@twinsun.com>
864
865 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
866 for K&R C.
867
8682002-05-03 gettextize <bug-gnu-gettext@gnu.org>
869
870 * Makefile.am (SUBDIRS): Remove intl.
871 (EXTRA_DIST): Add config/config.rpath.
872
8732002-05-03 Akim Demaille <akim@epita.fr>
874
875 * data/bison.simple (m4_if): Don't output empty enums.
876 And actually, output valid enum definitions :(.
877
8782002-05-03 Akim Demaille <akim@epita.fr>
879
880 * configure.bat: Remove, completely obsolete.
881 * Makefile.am (EXTRA_DIST): Adjust.
882 Don't distribute config.rpath...
883 * config/Makefile.am (EXTRA_DIST): Do it.
884
8852002-05-03 Akim Demaille <akim@epita.fr>
886
887 * configure.in (GETTEXT_VERSION): New.
888 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
889
8902002-05-03 Akim Demaille <akim@epita.fr>
891
892 * data/bison.simple (b4_token_enum): New.
893 (b4_token_defines): Use it to output tokens both as #define and
894 enums.
895 Suggested by Paul Eggert.
896 * src/output.c (token_definitions_output): Don't output spurious
897 white spaces.
898
8992002-05-03 Akim Demaille <akim@epita.fr>
900
901 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
902
9032002-05-02 Robert Anisko <robert@lrde.epita.fr>
904
905 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
906 Update the stack class, give a try to deque as the default container.
907
9082002-05-02 Akim Demaille <akim@epita.fr>
909
910 * data/bison.simple (yyparse): Do not implement @$ = @1.
911 (YYLLOC_DEFAULT): Adjust to do it.
912 * doc/bison.texinfo (Location Default Action): Fix.
913
9142002-05-02 Akim Demaille <akim@epita.fr>
915
916 * src/reader.c (parse_braces): Merge into...
917 (parse_action): this.
918
9192002-05-02 Akim Demaille <akim@epita.fr>
920
921 * configure.in (ALL_LINGUAS): Remove.
922 * po/LINGUAS, hr.po: New.
923
9242002-05-02 Akim Demaille <akim@epita.fr>
925
926 Remove the so called hairy (semantic) parsers.
927
928 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
929 * src/gram.h, src/gram.c (semantic_parser): Remove.
930 (rule_t): Remove the guard and guard_line members.
931 * src/lex.h (token_t): remove tok_guard.
932 * src/options.c (option_table): Remove %guard and %semantic_parser
933 support.
934 * src/output.c, src/output.h (guards_output): Remove.
935 (prepare): Adjust.
936 (token_definitions_output): Don't output the `T'
937 tokens (???).
938 (output_skeleton): Don't output the guards.
939 * src/files.c, src/files.c (attrsfile): Remove.
940 * src/reader.c (symbol_list): Remove the guard and guard_line
941 members.
942 Adjust dependencies.
943 (parse_guard): Remove.
944 * data/bison.hairy: Remove.
945 * doc/bison.texinfo (Environment Variables): Remove occurrences of
946 BISON_HAIRY.
947
9482002-05-02 Akim Demaille <akim@epita.fr>
949
950 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
951 (parse_guard): Rename the formal argument `stack_offset' as
952 `rule_length', which is more readable.
953 Adjust callers.
954 (copy_at, copy_dollar): Instead of outputting the hard coded
955 values of $$, $n and so forth, output invocation to b4_lhs_value,
956 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
957 Note: this patch partially drops `semantic-parser' support: it
958 always does `rule_length - n', where semantic parsers ought to
959 always use `-n'.
960 * data/bison.simple, data/bison.c++ (b4_lhs_value)
961 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
962
9632002-05-02 Akim Demaille <akim@epita.fr>
964
965 * configure.in (AC_INIT): Bump to 1.49b.
966 (AM_INIT_AUTOMAKE): Short invocation.
967
9682002-05-02 Akim Demaille <akim@epita.fr>
969
970 Version 1.49a.
971
9722002-05-01 Akim Demaille <akim@epita.fr>
973
974 * src/skeleton.h: Remove.
975
9762002-05-01 Akim Demaille <akim@epita.fr>
977
978 * src/skeleton.h: Fix the #endif.
979 Reported by Magnus Fromreide.
980
9812002-04-26 Paul Eggert <eggert@twinsun.com>
982
983 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
984 Define if we define YYSTYPE and YYLTYPE, respectively.
985 (YYCOPY): Fix [] quoting problem in the non-GCC case.
986
9872002-04-25 Robert Anisko <robert@lrde.epita.fr>
988
989 * src/scan-skel.l: Postprocess quadrigraphs.
990
991 * src/reader.c (copy_character): New function, used to output
992 single characters while replacing `[' and `]' with quadrigraphs, to
993 avoid troubles with M4 quotes.
994 (copy_comment): Output characters with copy_character.
995 (read_additionnal_code): Likewise.
996 (copy_string2): Likewise.
997 (copy_definition): Likewise.
998
999 * tests/calc.at: Exercise M4 quoting.
1000
10012002-04-25 Akim Demaille <akim@epita.fr>
1002
1003 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1004 between `!' and the command.
1005 Reported by Paul Eggert.
1006
10072002-04-24 Robert Anisko <robert@lrde.epita.fr>
1008
1009 * tests/calc.at: Exercise prologue splitting.
1010
1011 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1012 `b4_post_prologue' instead of `b4_prologue'.
1013
1014 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1015 muscles.
1016 (output): Free pre_prologue_obstack and post_prologue_obstack.
1017 * src/files.h, src/files.c (attrs_obstack): Remove.
1018 (pre_prologue_obstack, post_prologue_obstack): New.
1019 * src/reader.c (copy_definition): Add a parameter to specify the
1020 obstack to fill, instead of using attrs_obstack unconditionally.
1021 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1022 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1023
10242002-04-23 Paul Eggert <eggert@twinsun.com>
1025
1026 * data/bison.simple: Remove unnecessary commentary and white
1027 space differences from 1_29-branch.
1028 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1029
1030 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1031 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1032 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1033 constructors or destructors.
1034
1035 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1036
10372002-04-23 Akim Demaille <akim@epita.fr>
1038
1039 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1040 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1041 location with columns.
1042 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1043 All reported by Paul Eggert.
1044
10452002-04-22 Akim Demaille <akim@epita.fr>
1046
1047 * src/reduce.c (dump_grammar): Move to...
1048 * src/gram.h, src/gram.c (grammar_dump): here.
1049 Be sure to separate long item numbers.
1050 Don't read the members of a rule's prec if its nil.
1051
10522002-04-22 Akim Demaille <akim@epita.fr>
1053
1054 * src/output.c (table_size, table_grow): New.
1055 (MAXTABLE): Remove, replace uses with table_size.
1056 (pack_vector): Instead of dying when the table is too big, grow it.
1057
10582002-04-22 Akim Demaille <akim@epita.fr>
1059
1060 * data/bison.simple (yyr1): Its type is that of a token number.
1061 * data/bison.c++ (r1_): Likewise.
1062 * tests/regression.at (Web2c Actions): Adjust.
1063
10642002-04-22 Akim Demaille <akim@epita.fr>
1065
1066 * src/reader.c (token_translations_init): 256 is now the default
1067 value for the error token, i.e., it will be assigned another
1068 number if the user assigned 256 to one of her tokens.
1069 (reader): Don't force 256 to error.
1070 * doc/bison.texinfo (Symbols): Adjust.
1071 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1072 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1073 etc. instead of 10, 20, 30 (which was used to `jump' over error
1074 (256) and undefined (2)).
1075
10762002-04-22 Akim Demaille <akim@epita.fr>
1077
1078 Propagate more token_number_t.
1079
1080 * src/gram.h (token_number_as_item_number)
1081 (item_number_as_token_number): New.
1082 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1083 Use it to create output_item_number_table and
1084 output_token_number_table.
1085 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1086 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1087 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1088 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1089
10902002-04-22 Akim Demaille <akim@epita.fr>
1091
1092 * src/output.h, src/output.c (get_lines_number): Remove.
1093
10942002-04-19 Akim Demaille <akim@epita.fr>
1095
1096 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1097 as Lex/Flex'.
1098 (Debugging): More details about enabling the debugging features.
1099 (Table of Symbols): Describe $$, $n, @$, and @n.
1100 Suggested by Tim Josling.
1101
11022002-04-19 Akim Demaille <akim@epita.fr>
1103
1104 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1105
11062002-04-10 Akim Demaille <akim@epita.fr>
1107
1108 * src/system.h: Rely on HAVE_LIMITS_H.
1109 Suggested by Paul Eggert.
1110
11112002-04-09 Akim Demaille <akim@epita.fr>
1112
1113 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1114 full stderr, and strip it according to the bison options, instead
1115 of composing the error message from different bits.
1116 This makes it easier to check for several error messages.
1117 Adjust all the invocations.
1118 Add an invocation exercising the error token.
1119 Add an invocation demonstrating a stupid error message.
1120 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1121 Adjust the tests.
1122 Error message are for stderr, not stdout.
1123
11242002-04-09 Akim Demaille <akim@epita.fr>
1125
1126 * src/gram.h, src/gram.c (error_token_number): Remove, use
1127 errtoken->number.
1128 * src/reader.c (reader): Don't specify the user token number (2)
1129 for $undefined, as it uselessly prevents using it.
1130 * src/gram.h (token_number_t): Move to...
1131 * src/symtab.h: here.
1132 (state_t.number): Is a token_number_t.
1133 * src/print.c, src/reader.c: Use undeftoken->number instead of
1134 hard coded 2.
1135 (Even though this 2 is not the same as above: the number of the
1136 undeftoken remains being 2, it is its user token number which
1137 might not be 2).
1138 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1139 `user_token_number_max'.
1140 Output `undef_token_number'.
1141 * data/bison.simple, data/bison.c++: Use them.
1142 Be sure to map invalid yylex return values to
1143 `undef_token_number'. This saves us from gratuitous SEGV.
1144
1145 * tests/conflicts.at (Solved SR Conflicts)
1146 (Unresolved SR Conflicts): Adjust.
1147 * tests/regression.at (Web2c Actions): Adjust.
1148
11492002-04-08 Akim Demaille <akim@epita.fr>
1150
1151 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1152 Adding #line.
1153 Remove the duplicate `typedefs'.
1154 (RhsNumberType): Fix the declaration and various other typos.
1155 Use __ofile__.
1156 * data/bison.simple: Use __ofile__.
1157 * src/scan-skel.l: Handle __ofile__.
1158
11592002-04-08 Akim Demaille <akim@epita.fr>
1160
1161 * src/gram.h (item_number_t): New, the type of item numbers in
1162 RITEM. Note that it must be able to code symbol numbers as
1163 positive number, and the negation of rule numbers as negative
1164 numbers.
1165 Adjust all dependencies (pretty many).
1166 * src/reduce.c (rule): Remove this `short *' pointer: use
1167 item_number_t.
1168 * src/system.h (MINSHORT, MAXSHORT): Remove.
1169 Include `limits.h'.
1170 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1171 (shortcpy): Remove.
1172 (MAXTABLE): Move to...
1173 * src/output.c (MAXTABLE): here.
1174 (prepare_rules): Use output_int_table to output rhs.
1175 * data/bison.simple, data/bison.c++: Adjust.
1176 * tests/torture.at (Big triangle): Move the limit from 254 to
1177 500.
1178 * tests/regression.at (Web2c Actions): Ajust.
1179
1180 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1181 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1182 passes, but produces negative #line number, once fixed, GCC is
1183 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1184 C), it passes.
1185 * src/state.h (state_h): Code input lines on ints, not shorts.
1186
11872002-04-08 Akim Demaille <akim@epita.fr>
1188
1189 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1190 and then the grammar.
1191
11922002-04-08 Akim Demaille <akim@epita.fr>
1193
1194 * src/system.h: No longer using strndup.
1195
11962002-04-07 Akim Demaille <akim@epita.fr>
1197
1198 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1199 * src/output.c (output_table_data): Return the longest number.
1200 (prepare_tokens): Output `token_number_max').
1201 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1202 New.
1203 Use them to define yy_token_number_type/TokenNumberType.
1204 Use this type for yytranslate.
1205 * tests/torture.at (Big triangle): Push the limit from 124 to
1206 253.
1207 * tests/regression.at (Web2c Actions): Adjust.
1208
12092002-04-07 Akim Demaille <akim@epita.fr>
1210
1211 * tests/torture.at (Big triangle): New.
1212 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1213 * tests/existing.at: here.
1214
12152002-04-07 Akim Demaille <akim@epita.fr>
1216
1217 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1218 nritems.
1219 Adjust dependencies.
1220
12212002-04-07 Akim Demaille <akim@epita.fr>
1222
1223 * src/reader.c: Normalize increments to prefix form.
1224
12252002-04-07 Akim Demaille <akim@epita.fr>
1226
1227 * src/reader.c, symtab.c: Remove debugging code.
1228
12292002-04-07 Akim Demaille <akim@epita.fr>
1230
1231 Rename all the `bucket's as `symbol_t'.
1232
1233 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1234 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1235 * src/symtab.c, src/symtab.h (bucket): Rename as...
1236 (symbol_t): this.
1237 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1238 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1239 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1240 (buckets_new, buckets_free, buckets_do): Rename as...
1241 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1242 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1243 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1244 (symbols_new, symbols_free, symbols_do): these.
1245
12462002-04-07 Akim Demaille <akim@epita.fr>
1247
1248 Use lib/hash for the symbol table.
1249
1250 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1251 EOF.
1252 * src/lex.c (lex): Set the `number' member of new terminals.
1253 * src/reader.c (bucket_check_defined, bucket_make_alias)
1254 (bucket_check_alias_consistence, bucket_translation): New.
1255 (reader, grammar_free, readgram, token_translations_init)
1256 (packsymbols): Adjust.
1257 (reader): Number the predefined tokens.
1258 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1259 for predefined tokens.
1260 * src/symtab.h (bucket): Remove all the hash table related
1261 members.
1262 * src/symtab.c (symtab): Replace by...
1263 (bucket_table): this.
1264 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1265 (buckets_new, buckets_do): New.
1266
12672002-04-07 Akim Demaille <akim@epita.fr>
1268
1269 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1270 (start_symbol, max_user_token_number, semantic_parser)
1271 (error_token_number): Initialize.
1272 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1273 Initialize.
1274 (reader): Don't.
1275 (errtoken, eoftoken, undeftoken, axiom): Extern.
1276
12772002-04-07 Akim Demaille <akim@epita.fr>
1278
1279 * src/gram.h (rule_s): prec and precsym are now pointers
1280 to the bucket giving the priority/associativity.
1281 Member `associativity' removed: useless.
1282 * src/reduce.c, src/conflicts.c: Adjust.
1283
12842002-04-07 Akim Demaille <akim@epita.fr>
1285
1286 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1287 Properly escape the symbols' TAG when outputting them.
1288
12892002-04-07 Akim Demaille <akim@epita.fr>
1290
1291 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1292
12932002-04-07 Akim Demaille <akim@epita.fr>
1294
1295 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1296 (LArule): this, which is an array to rule_t*.
1297 * src/print.c, src/conflicts.c: Adjust.
1298
12992002-04-07 Akim Demaille <akim@epita.fr>
1300
1301 * src/gram.h (rule_t): Rename `number' as `user_number'.
1302 `number' is a new member.
1303 Adjust dependencies.
1304 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1305
13062002-04-07 Akim Demaille <akim@epita.fr>
1307
1308 As a result of the previous patch, it is no longer needed
1309 to reorder ritem itself.
1310
1311 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1312
13132002-04-07 Akim Demaille <akim@epita.fr>
1314
1315 Be sure never to walk through RITEMS, but use only data related to
1316 the rules themselves. RITEMS should be banished.
1317
1318 * src/output.c (output_token_translations): Rename as...
1319 (prepare_tokens): this.
1320 In addition to `translate', prepare the muscles `tname' and
1321 `toknum', which were handled by...
1322 (output_rule_data): this.
1323 Remove, and move the remainder of its outputs into...
1324 (prepare_rules): this new routines, which also merges content from
1325 (output_gram): this.
1326 (prepare_rules): Be sure never to walk through RITEMS.
1327 (output_stos): Rename as...
1328 (prepare_stos): this.
1329 (output): Always invoke prepare_states, after all, just don't use it
1330 in the output if you don't need it.
1331
13322002-04-07 Akim Demaille <akim@epita.fr>
1333
1334 * src/LR0.c (new_state): Display `nstates' as the name of the
1335 newly created state.
1336 Adjust to initialize first_state and last_state if needed.
1337 Be sure to distinguish the initial from the final state.
1338 (new_states): Create the itemset of the initial state, and use
1339 new_state.
1340 * src/closure.c (closure): Now that the initial state has its
1341 items properly set, there is no need for a special case when
1342 creating `ruleset'.
1343
1344 As a result, now the rule 0, reducing to $axiom, is visible in the
1345 outputs. Adjust the test suite.
1346
1347 * tests/conflicts.at (Solved SR Conflicts)
1348 (Unresolved SR Conflicts): Adjust.
1349 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1350 * tests/conflicts.at (S/R in initial): New.
1351
13522002-04-07 Akim Demaille <akim@epita.fr>
1353
1354 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1355 the RHS of the rules.
1356 * src/output.c (output_gram): Likewise.
1357
13582002-04-07 Akim Demaille <akim@epita.fr>
1359
1360 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1361 bucket.
1362 Adjust all dependencies.
1363 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1364 `number' of the buckets too.
1365 * src/gram.h: Include `symtab.h'.
1366 (associativity): Move to...
1367 * src/symtab.h: here.
1368 No longer include `gram.h'.
1369
13702002-04-07 Akim Demaille <akim@epita.fr>
1371
1372 * src/gram.h, src/gram.c (rules_rhs_length): New.
1373 (ritem_longest_rhs): Use it.
1374 * src/gram.h (rule_t): `number' is a new member.
1375 * src/reader.c (packgram): Set it.
1376 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1377 the end of `rules', and count them out of `nrules'.
1378 (reduce_output, dump_grammar): Adjust.
1379 * src/print.c (print_grammar): It is no longer needed to check for
1380 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1381 * tests/reduce.at (Reduced Automaton): New test.
1382
13832002-04-07 Akim Demaille <akim@epita.fr>
1384
1385 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1386 lacking `+ 1' to nrules, Bison reported as useless a token if it
1387 was used solely to set the precedence of the last rule...
1388
13892002-04-07 Akim Demaille <akim@epita.fr>
1390
1391 * data/bison.c++, data/bison.simple: Don't output the current file
1392 name in #line, to avoid useless diffs between two identical
1393 outputs under different names.
1394
13952002-04-07 Akim Demaille <akim@epita.fr>
1396
1397 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1398 Normalize loops to using `< nrules + 1', not `<= nrules'.
1399
14002002-04-07 Akim Demaille <akim@epita.fr>
1401
1402 * TODO: Update.
1403
14042002-04-07 Akim Demaille <akim@epita.fr>
1405
1406 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1407 bucket.value as bucket.number.
1408
14092002-04-07 Akim Demaille <akim@epita.fr>
1410
1411 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1412 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1413 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1414 RHS, instead of being an index in RITEMS.
1415
14162002-04-04 Paul Eggert <eggert@twinsun.com>
1417
1418 * doc/bison.texinfo: Update copyright date.
1419 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1420 (Symbols): Warn about running Bison in one character set,
1421 but compiling and/or running in an incompatible one.
1422 Warn about character code 256, too.
1423
14242002-04-03 Paul Eggert <eggert@twinsun.com>
1425
1426 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1427 YYERROR_VERBOSE is nonzero, not whether it is defined.
1428
1429 Merge changes from bison-1_29-branch.
1430
14312002-03-20 Paul Eggert <eggert@twinsun.com>
1432
1433 Merge fixes from Debian bison_1.34-1.diff.
1434
1435 * configure.in (AC_PREREQ): 2.53.
1436
14372002-03-20 Akim Demaille <akim@epita.fr>
1438
1439 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1440
14412002-03-19 Paul Eggert <eggert@twinsun.com>
1442
1443 * src/bison.simple (YYCOPY): New macro.
1444 (YYSTACK_RELOCATE): Use it.
1445 Remove Type arg; no longer needed. All callers changed.
1446 (yymemcpy): Remove; no longer needed.
1447
1448 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1449 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1450
14512002-03-19 Akim Demaille <akim@epita.fr>
1452
1453 Test and fix the #line outputs.
1454
1455 * tests/atlocal.at (GCC): New.
1456 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1457 (Prologue synch line, ,%union synch line, Postprologue synch line)
1458 (Action synch line, Epilogue synch line): New tests.
1459 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1460 * data/bison.simple, data/bison.c++: Use it.
1461
14622002-03-19 Akim Demaille <akim@epita.fr>
1463
1464 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1465 (Solved SR Conflicts, %expect not enough, %expect right)
1466 (%expect too much): Move to...
1467 * tests/conflicts.at: this new file.
1468
14692002-03-19 Akim Demaille <akim@epita.fr>
1470
1471 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1472 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1473 that we can move to enums for instance.
1474 * src/output.c (token_definitions_output): Output a list of
1475 `token-name, token-number' instead of the #define.
1476 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1477
14782002-03-14 Akim Demaille <akim@epita.fr>
1479
1480 Use Gettext 0.11.1.
1481
14822002-03-09 Robert Anisko <robert@lrde.epita.fr>
1483
1484 * data/bison.c++: Make the user able to add members to the generated
1485 parser by subclassing.
1486
14872002-03-05 Robert Anisko <robert@lrde.epita.fr>
1488
1489 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1490 a character.
1491 Reported by Nicolas Tisserand and Nicolas Burrus.
1492
14932002-03-04 Robert Anisko <robert@lrde.epita.fr>
1494
1495 * src/reader.c: Warn about lacking semi-colons, do not complain.
1496
14972002-03-04 Robert Anisko <robert@lrde.epita.fr>
1498
1499 * data/bison.c++: Remove a debug line.
1500
15012002-03-04 Robert Anisko <robert@lrde.epita.fr>
1502
1503 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1504 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1505 provide a default implementation.
1506
15072002-03-04 Akim Demaille <akim@epita.fr>
1508
1509 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1510 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1511 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1512 * tests/semantic.at (Parsing Guards): Similarly.
1513 * src/reader.at (readgram): Complain if the last rule is not ended
1514 with a semi-colon.
1515
15162002-03-04 Akim Demaille <akim@epita.fr>
1517
1518 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1519 * src/closure.c: here.
1520 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1521 RTC.
1522 * src/warshall.h, src/warshall.c: Remove.
1523 * tests/sets.at (Broken Closure): Adjust.
1524
15252002-03-04 Akim Demaille <akim@epita.fr>
1526
1527 * src/output.c (output_skeleton): tempdir is const.
1528 bytes_read is unused.
1529
15302002-03-04 Akim Demaille <akim@epita.fr>
1531
1532 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1533 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1534 Update.
1535 From Michael Hayes.
1536
15372002-03-04 Akim Demaille <akim@epita.fr>
1538
1539 * src/closure.c (closure): `r' is unused.
1540
15412002-03-04 Akim Demaille <akim@epita.fr>
1542
1543 * tests/sets.at (Broken Closure): Add the ending `;'.
1544 * src/reader.at (readgram): Complain if a rule is not ended with a
1545 semi-colon.
1546
15472002-03-04 Akim Demaille <akim@epita.fr>
1548
1549 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1550 (count_sr_conflicts): Use bitset_count.
1551 * src/reduce.c (inaccessable_symbols): Ditto.
1552 (bits_size): Remove.
1553 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1554
15552002-03-04 Akim Demaille <akim@epita.fr>
1556
1557 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1558 * src/reduce.c: Remove the `bitset_zero's following the
1559 `bitset_create's, as now it is performed by the latter.
1560
15612002-03-04 Akim Demaille <akim@epita.fr>
1562
1563 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1564 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1565 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1566 latest sources from Michael.
1567
15682002-03-04 Akim Demaille <akim@epita.fr>
1569
1570 * src/output.c (output): Don't free the grammar.
1571 * src/reader.c (grammar_free): New.
1572 * src/main.c (main): Call it and don't free symtab here.
1573
15742002-03-04 Akim Demaille <akim@epita.fr>
1575
1576 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1577 before returning.
1578 Reported by Benoit Perrot.
1579
15802002-03-04 Akim Demaille <akim@epita.fr>
1581
1582 Use bitset operations when possible, not loops over bits.
1583
1584 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1585 bitset_or.
1586 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1587 * src/reduce.c (useless_nonterminals): Formatting changes.
1588 * src/warshall.c (TC): Use bitset_or.
1589
15902002-03-04 Akim Demaille <akim@epita.fr>
1591
1592 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1593 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1594 Ditto.
1595
15962002-03-04 Akim Demaille <akim@epita.fr>
1597
1598 * src/lalr.c (F): Now a bitset*.
1599 Adjust all dependencies.
1600
16012002-03-04 Akim Demaille <akim@epita.fr>
1602
1603 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1604 Adjust all dependencies.
1605
16062002-03-04 Akim Demaille <akim@epita.fr>
1607
1608 * src/L0.c, src/LR0.h (nstates): Be size_t.
1609 Adjust comparisons (signed vs unsigned).
1610 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1611 bitset*.
1612 Adjust all dependencies.
1613
16142002-03-04 Akim Demaille <akim@epita.fr>
1615
1616 * src/closure.c (firsts): Now, also a bitset.
1617 Adjust all dependencies.
1618 (varsetsize): Remove, now unused.
1619 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1620
16212002-03-04 Akim Demaille <akim@epita.fr>
1622
1623 * src/print.c: Convert to use bitset.h, not hand coded iterations
1624 over ints.
1625
16262002-03-04 Akim Demaille <akim@epita.fr>
1627
1628 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1629
16302002-03-04 Akim Demaille <akim@epita.fr>
1631
1632 * src/closure.c (ruleset): Be a bitset.
1633 (rulesetsize): Remove.
1634
16352002-03-04 Akim Demaille <akim@epita.fr>
1636
1637 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1638 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1639 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1640 * src/closure.c (fderives): Be an array of bitsets.
1641
16422002-02-28 Robert Anisko <robert@lrde.epita.fr>
1643
1644 * data/bison.c++: Merge the two generated headers. Insert a copyright
1645 notice in each output file.
1646
16472002-02-28 Akim Demaille <akim@epita.fr>
1648
1649 * data/bison.c++: Copy the prologue of bison.simple to fetch
1650 useful M4 definitions, such as b4_header_guard.
1651
16522002-02-25 Akim Demaille <akim@epita.fr>
1653
1654 * src/getargs.c (version): Give the name of the authors, and use a
1655 translator friendly scheme for the bgr
1656 copyright notice.
1657
16582002-02-25 Akim Demaille <akim@epita.fr>
1659
1660 * src/output.c (header_output): Remove, now handled completely via
1661 M4.
1662
16632002-02-25 Akim Demaille <akim@epita.fr>
1664
1665 * m4/m4.m4: New, from CVS Autoconf.
1666 * configure.in: Invoke it.
1667 * src/output.c (output_skeleton): Use its result instead of the
1668 hard coded name.
1669
16702002-02-25 Akim Demaille <akim@epita.fr>
1671
1672 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1673 Fileutils 4.1.5.
1674 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1675 * src/output.c (output_skeleton): Use mkstemp to create a real
1676 temporary file.
1677 Move the filling of `skeleton' and its muscle to...
1678 (prepare): here.
1679 (output): Move the definition of the prologue muscle to...
1680 (prepare): here.
1681 * src/system.h (DEFAULT_TMPDIR): New.
1682
16832002-02-14 Paul Eggert <eggert@twinsun.com>
1684
1685 Remove the support for C++ namespace cleanliness; it was
1686 causing more problems than it was curing, since it didn't work
1687 properly on some nonstandard C++ compilers. This can wait
1688 for a proper C++ parser.
1689
1690 * NEWS: Document this.
1691 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1692 of C++, as it's treated like C now.
1693 * src/bison.simple (YYSTD): Remove.
1694 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1695 Treat C++ just like Standard C instead of trying to support
1696 namespace cleanliness.
1697
16982002-02-14 Akim Demaille <akim@epita.fr>
1699
1700 * tests/regression.at (else): Adjust to Andreas' change.
1701
17022002-02-14 Akim Demaille <akim@epita.fr>
1703
1704 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1705
17062002-02-13 Andreas Schwab <schwab@suse.de>
1707
1708 * src/output.c (output_rule_data): Don't output NULL, it might
1709 not be defined yet.
1710
17112002-02-11 Robert Anisko <robert@lrde.epita.fr>
1712
1713 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
1714 (Copyright notice): Update.
1715
17162002-02-11 Akim Demaille <akim@epita.fr>
1717
1718 * tests/regression.at (%nonassoc and eof): Don't include
1719 nonportable headers.
1720
17212002-02-08 Robert Anisko <robert@lrde.epita.fr>
1722
1723 * data/bison.c++: Correct error recovery. Make the user able to
1724 initialize the starting location.
1725
17262002-02-07 Akim Demaille <akim@epita.fr>
1727
1728 * tests/input.at: New.
1729
17302002-02-07 Robert Anisko <robert@lrde.epita.fr>
1731
1732 * data/bison.c++: Replace some direct m4 expansions by constants. Be
1733 more consistent when naming methods and variables. Put preprocessor
1734 directives around tables only needed for debugging.
1735
17362002-02-07 Robert Anisko <robert@lrde.epita.fr>
1737
1738 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1739 C++ parsers.
1740 (yy::b4_name::parse): Use print_.
1741
17422002-02-07 Robert Anisko <robert@lrde.epita.fr>
1743
1744 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1745
17462002-02-07 Robert Anisko <robert@lrde.epita.fr>
1747
1748 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1749 C++ parsers.
1750 (yy::b4_name::parse): Build verbose error messages, and use error_.
1751
17522002-02-06 Robert Anisko <robert@lrde.epita.fr>
1753
1754 * data/bison.c++: Fix m4 quoting in comments.
1755
17562002-02-06 Robert Anisko <robert@lrde.epita.fr>
1757
1758 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1759 not expanded by m4.
1760
17612002-02-05 Akim Demaille <akim@epita.fr>
1762
1763 * data/bison.c++: Adjust to the M4 back end.
1764 More is certainly needed.
1765
17662002-02-05 Akim Demaille <akim@epita.fr>
1767
1768 Give a try to M4 as a back end.
1769
1770 * lib/readpipe.c: New, from wdiff.
1771 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1772 BISON_HAIRY.
1773 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1774 specific values. Now it is m4 that performs the lookup.
1775 * src/parse-skel.y: Remove.
1776 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1777 * src/output.c (actions_output, guards_output)
1778 (token_definitions_output): No longer keeps track of the output
1779 line number, hence remove the second argument.
1780 (guards_output): Check against the guard member of a rule, not the
1781 action member.
1782 Adjust callers.
1783 (output_skeleton): Don't look for the skeleton location, let m4 do
1784 that.
1785 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1786 file will be used.
1787 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1788 (prepare): Given that for the time being changesyntax is not
1789 usable in M4, rename the muscles using `-' to `_'.
1790 Define `defines_flag', `output_parser_name' and `output_header_name'.
1791 * src/output.h (actions_output, guards_output)
1792 (token_definitions_output): Adjust prototypes.
1793 * src/scan-skel.l: Instead of scanning the skeletons, it now
1794 processes the output of m4: `__oline__' and `#output'.
1795 * data/bison.simple: Adjust to be used by M4(sugar).
1796 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1797 to date.
1798 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1799 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1800 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1801 shamelessly stolen from CVS Autoconf.
1802
18032002-02-05 Akim Demaille <akim@epita.fr>
1804
1805 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1806 * configure.in: Check for the declarations of free and malloc.
1807 * src/muscle_tab.c: Adjust.
1808
18092002-02-05 Akim Demaille <akim@epita.fr>
1810
1811 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1812 which have no values.
1813
18142002-02-05 Akim Demaille <akim@epita.fr>
1815
1816 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1817 * data/: here.
1818
18192002-01-29 Paul Eggert <eggert@twinsun.com>
1820
1821 * src/bison.simple (YYSIZE_T): Do not define merely because
1822 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1823 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1824
18252002-01-27 Akim Demaille <akim@epita.fr>
1826
1827 Fix `%nonassoc and eof'.
1828
1829 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1830 which were not properly copied! Replace
1831 memcpy (res->errs, src->errs, src->nerrs);
1832 with
1833 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
1834 !!!
1835 * tests/regression.at (%nonassoc and eof): Adjust to newest
1836 Autotest: `.' is not in the PATH.
1837
18382002-01-27 Akim Demaille <akim@epita.fr>
1839
1840 * tests/sets.at (AT_EXTRACT_SETS): New.
1841 (Nullable): Use it.
1842 (Firsts): New.
1843
18442002-01-26 Akim Demaille <akim@epita.fr>
1845
1846 * tests/actions.at, tests/calc.at, tests/headers.at,
1847 * tests/torture.at: Adjust to the newest Autotest which no longer
1848 forces `.' in the PATH.
1849
18502002-01-25 Akim Demaille <akim@epita.fr>
1851
1852 * tests/regression.at (%nonassoc and eof): New.
1853 Suggested by Robert Anisko.
1854
18552002-01-24 Akim Demaille <akim@epita.fr>
1856
1857 Bison dumps core when trying to complain about broken input files.
1858 Reported by Cris van Pelt.
1859
1860 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
1861 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
1862 into...
1863 (Invalid inputs): Strengthen: exercise parse_percent_token.
1864
18652002-01-24 Robert Anisko <robert.anisko@epita.fr>
1866
1867 * src/Makefile.am: Add bison.c++.
1868 * src/bison.c++: New skeleton.
1869
18702002-01-21 Paolo Bonzini <bonzini@gnu.org>
1871
1872 * po/it.po: New.
1873
18742002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
1875
1876 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
1877
18782002-01-20 Marc Autret <marc@gnu.org>
1879
1880 * src/files.c (compute_output_file_names): Fix
1881
18822002-01-20 Marc Autret <marc@gnu.org>
1883
1884 * tests/output.at: New test.
1885 * src/files.c (compute_base_names): Don't map extensions when
1886 the YACC flag is set, use defaults.
1887 Reported by Evgeny Stambulchik.
1888
18892002-01-20 Marc Autret <marc@gnu.org>
1890
1891 * src/system.h: Need to define __attribute__ away for non-GCC
1892 compilers as well (i.e. the vendor C compiler).
1893 Suggested by Albert Chin-A-Young.
1894
18952002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
1896
1897 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
1898 canonical definition.
1899 * src/system.h: Use the canonical definition for PARAMS (avoids
1900 a conflict with the macro from lib/hash.h).
1901
19022002-01-11 Akim Demaille <akim@epita.fr>
1903
1904 * configure.in: Use AC_FUNC_STRNLEN.
1905 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
1906
19072002-01-09 Akim Demaille <akim@epita.fr>
1908
1909 * src/files.c, src/files.h (output_infix): New.
1910 (tab_extension): Remove.
1911 (compute_base_names): Compute the former, drop the latter.
1912 * src/output.c (prepare): Insert the muscles `output-infix', and
1913 `output-suffix'.
1914 * src/parse-skel.y (string, string.1): New.
1915 (section.header): Use it.
1916 (section.yacc): Remove.
1917 (prefix): Remove too.
1918 * src/scan-skel.l: Adjust.
1919 * src/bison.simple, src/bison.hairy: Adjust.
1920
19212002-01-09 Akim Demaille <akim@epita.fr>
1922
1923 * configure.in (WERROR_CFLAGS): Compute it.
1924 * src/Makefile.am (CFLAGS): Pass it.
1925 * tests/atlocal.in (CFLAGS): Idem.
1926 * src/files.c: Fix a few warnings.
1927 (get_extension_index): Remove, unused.
1928
19292002-01-08 Akim Demaille <akim@epita.fr>
1930
1931 * src/getargs.c (AS_FILE_NAME): New.
1932 (getargs): Use it to convert DOSish file names.
1933 * src/files.c (base_name): Rename as full_base_name to avoid
1934 clashes with `base_name ()'.
1935 (filename_split): New.
1936 (compute_base_names): N-th rewrite, using filename_split.
1937
19382002-01-08 Akim Demaille <akim@epita.fr>
1939
1940 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
1941 New, stolen from the Fileutils 4.1.
1942 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
1943 * configure.in: Check for the presence of memrchr, and of its
1944 prototype.
1945
19462002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
1947
1948 * lib/hash.h (__P): Added definition for this macro.
1949 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1950 BUILT_SOURCES, to ensure they are generated first.
1951 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1952 %error-verbose to allow bootstrapping with bison 1.30x.
1953
19542002-01-06 Akim Demaille <akim@epita.fr>
1955
1956 * src/reader.c (parse_braces): Don't fetch the next char, the
1957 convention is to fetch on entry.
1958 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1959 'switch' without a following semicolon.
1960 * tests/regression.at (braces parsing): New.
1961
19622002-01-06 Akim Demaille <akim@epita.fr>
1963
1964 Bison is dead wrong in its RR conflict reports.
1965
1966 * tests/torture.at (GNU Cim Grammar): New.
1967 * src/conflicts.c (count_rr_conflicts): Fix.
1968
19692002-01-06 Akim Demaille <akim@epita.fr>
1970
1971 Creating package.m4 from configure.ac causes too many problems.
1972
1973 * tests/Makefile.am (package.m4): Create it by hand,
1974 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1975
19762002-01-06 Akim Demaille <akim@epita.fr>
1977
1978 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1979 skeleton.h.
1980
19812002-01-04 Paul Eggert <eggert@twinsun.com>
1982
1983 * doc/bison.texinfo (Debugging):
1984 Remove YYSTDERR; it's no longer defined or used.
1985 Also, s/cstdio.h/cstdio/.
1986
19872002-01-03 Akim Demaille <akim@epita.fr>
1988
1989 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1990
19912002-01-03 Akim Demaille <akim@epita.fr>
1992
1993 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1994 tracing code to --trace, wait for a better --trace option, with
1995 args.
1996
19972002-01-03 Akim Demaille <akim@epita.fr>
1998
1999 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2000 The ISO C++ standard is extremely clear about it: stderr is
2001 considered a macro, not a regular symbol (see table 94 `Header
2002 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2003 Therefore std:: does not apply to it. It still does with fprintf.
2004 Also, s/cstdio.h/cstdio/.
2005
20062002-01-03 Akim Demaille <akim@epita.fr>
2007
2008 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2009 for non system headers.
2010
20112002-01-02 Akim Demaille <akim@epita.fr>
2012
2013 Equip the skeleton chain with location tracking, runtime trace,
2014 pure parser and scanner.
2015
2016 * src/parse-skel.y: Request a pure parser, locations, and prefix
2017 renaming.
2018 (%union): Having several members with the same type does not help
2019 type mismatches, simplify.
2020 (YYPRINT, yyprint): New.
2021 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2022 (skel_error): this.
2023 Handle locations.
2024 * src/scan-skel.l: Adjust to these changes.
2025 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2026 (LOCATION_PRINT, skel_control_t): New.
2027
20282001-12-30 Akim Demaille <akim@epita.fr>
2029
2030 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2031 replace `gb' with BLANKS.
2032 * src/scan-skel.l: Adjust.
2033
20342001-12-30 Akim Demaille <akim@epita.fr>
2035
2036 * src/system.h: We don't need nor want bcopy.
2037 Throw away MS-DOS crap: we don't need getpid.
2038 * configure.in: We don't need strndup. It was even causing
2039 problems: because Flex includes the headers *before* us,
2040 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2041 not visible.
2042 * lib/xstrndup.c: New.
2043 * src/scan-skel.l: Use it.
2044 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2045 * src/parse-skel.y: Use %directives instead of #defines.
2046
20472001-12-30 Akim Demaille <akim@epita.fr>
2048
2049 * src/skeleton.h: New.
2050 * src/output.c (output_parser, output_master_parser): Remove, dead
2051 code.
2052 * src/output.h (get_lines_number, actions_output, guards_output)
2053 (token_definitions_output): Prototype them.
2054 * src/parse-skel.y: Add the license notice.
2055 Include output.h and skeleton.h.
2056 (process_skeleton): Returns void, and takes a single parameter.
2057 * src/scan-skel.l: Add the license notice.
2058 Include skeleton.h.
2059 Don't use %option yylineno: it seems that then Flex imagines
2060 REJECT has been used, and therefore it won't reallocate its
2061 buffers (which makes no other sense to me than a bug). It results
2062 in warnings for `unused: yy_flex_realloc'.
2063
20642001-12-30 Robert Anisko <robert.anisko@epita.fr>
2065
2066 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2067 (MUSCLE_INSERT_PREFIX): ...to there.
2068 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2069 (MUSCLE_INSERT_PREFIX): Move from here...
2070
2071 * src/bison.hairy: Add a section directive. Put braces around muscle
2072 names. This parser skeleton is still broken, but Bison should not
2073 choke on a bad muscle 'syntax'.
2074 * src/bison.simple: Add a section directive. Put braces around muscle
2075 names.
2076
2077 * src/files.h (strsuffix, stringappend): Add declarations.
2078 (tab_extension): Add declaration.
2079 (short_base_name): Add declaration.
2080
2081 * src/files.c (strsuffix, stringappend): No longer static. These
2082 functions are used in the skeleton parser.
2083 (tab_extension): New.
2084 (compute_base_names): Use the computations done in this function
2085 to guess if the generated parsers should have '.tab' in their
2086 names.
2087 (short_base_name): No longer static.
2088
2089 * src/output.c (output_skeleton): New.
2090 (output): Disable call to output_master_parser, and give a try to
2091 a new skeleton handling system.
2092 (guards_output, actions_output): No longer static.
2093 (token_definitions_output, get_lines_number): No longer static.
2094
2095 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2096
2097 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
2098 parse-skel.y.
2099
2100 * src/parse-skel.y: New file.
2101 * src/scan-skel.l: New file.
2102
21032001-12-29 Akim Demaille <akim@epita.fr>
2104
2105 %name-prefix is broken.
2106
2107 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2108 Adjust all dependencies.
2109 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2110 %name-prefix.
2111
2112 Renaming yylval but not yylloc is not consistent. Now we do.
2113
2114 * src/bison.simple: Prefix yylloc if used.
2115 * doc/bison.texinfo (Decl Summary): Document that.
2116
21172001-12-29 Akim Demaille <akim@epita.fr>
2118
2119 * doc/bison.texinfo: Promote `%long-directive' over
2120 `%long_directive'.
2121 Remove all references to fixed-output-files, yacc is enough.
2122
21232001-12-29 Akim Demaille <akim@epita.fr>
2124
2125 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2126 user prologue. These are defaults.
2127 * tests/actions.at (Mid-rule actions): Make sure the user can
2128 define YYDEBUG and YYERROR_VERBOSE.
2129
21302001-12-29 Akim Demaille <akim@epita.fr>
2131
2132 * src/output.c (header_output): Don't forget to export YYLTYPE and
2133 yylloc.
2134 * tests/headers.at (export YYLTYPE): New, make sure it does.
2135 * tests/regression.at (%union and --defines, Invalid CPP headers):
2136 Move to...
2137 * tests/headers.at: here.
2138
21392001-12-29 Akim Demaille <akim@epita.fr>
2140
2141 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2142
21432001-12-29 Akim Demaille <akim@epita.fr>
2144
2145 * tests/actions.at (Mid-rule actions): Output on a single line
2146 instead of several.
2147
21482001-12-29 Akim Demaille <akim@epita.fr>
2149
2150 * doc/bison.texinfo: Formatting changes.
2151
21522001-12-29 Akim Demaille <akim@epita.fr>
2153
2154 Don't store the token defs in a muscle, just be ready to output it
2155 on command. Now possible via `symbols'. Fixes a memory leak.
2156
2157 * src/output.c (token_definitions_output): New.
2158 (output_parser, header_output): Use it.
2159 * src/reader.c (symbols_save): Remove.
2160
21612001-12-29 Akim Demaille <akim@epita.fr>
2162
2163 * src/bison.simple: Do not provide a default for YYSTYPE and
2164 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2165 default.
2166
21672001-12-29 Akim Demaille <akim@epita.fr>
2168
2169 Mid-rule actions are simply... ignored!
2170
2171 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2172 the empty-rule associated to the dummy symbol, not to the host
2173 rule.
2174 * tests/actions.at (Mid-rule actions): New.
2175
21762001-12-29 Akim Demaille <akim@epita.fr>
2177
2178 Memory leak.
2179
2180 * src/reader.c (reader): Free grammar.
2181
21822001-12-29 Akim Demaille <akim@epita.fr>
2183
2184 Memory leak.
2185
2186 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2187 since it allocates it for each state, although only one is needed.
2188 (allocate_storage): Do it here.
2189
21902001-12-29 Akim Demaille <akim@epita.fr>
2191
2192 * src/options.h, src/options.c (create_long_option_table): Rename
2193 as...
2194 (long_option_table_new): this, with a clearer prototype.
2195 (percent_table): Remove, unused,
2196 * src/getargs.c (getargs): Adjust.
2197
21982001-12-29 Akim Demaille <akim@epita.fr>
2199
2200 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2201 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2202 as states.
2203
22042001-12-29 Akim Demaille <akim@epita.fr>
2205
2206 * src/lalr.c (build_relations): Rename `states' as `states1'.
2207 Sorry, I don't understand exactly what it is, no better name...
2208
22092001-12-29 Akim Demaille <akim@epita.fr>
2210
2211 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2212 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2213 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2214 as rules.
2215
22162001-12-29 Akim Demaille <akim@epita.fr>
2217
2218 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2219 ago.
2220
22212001-12-29 Akim Demaille <akim@epita.fr>
2222
2223 * src/reader.c, src/reader.h (user_toknums): Remove.
2224 Adjust all users to use symbols[i]->user_token_number.
2225
22262001-12-29 Akim Demaille <akim@epita.fr>
2227
2228 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2229 Adjust all users to use symbols[i]->prec or ->assoc.
2230
22312001-12-29 Akim Demaille <akim@epita.fr>
2232
2233 * src/reader.c, src/reader.h (tags): Remove.
2234 Adjust all users to use symbols[i]->tag.
2235
22362001-12-29 Akim Demaille <akim@epita.fr>
2237
2238 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2239 and rule_table.
2240 * src/reader.c (packsymbols): Fill this table.
2241 Drop sprec.
2242 * src/conflicts.c (resolve_sr_conflict): Adjust.
2243 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2244 single table.
2245 Use symbols[i]->tag instead of tags[i].
2246
22472001-12-29 Akim Demaille <akim@epita.fr>
2248
2249 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2250 In addition, put a comment in there, to replace...
2251 * tests/regression.at (%union and C comments): Remove.
2252
22532001-12-29 Akim Demaille <akim@epita.fr>
2254
2255 * tests/regression.at (Web2c Actions): Blindly move the actual
2256 output as expected output. The contents *seem* right to me, but I
2257 can't pretend reading perfectly parser tables... Nonetheless, all
2258 the other tests pass correctly, the table look OK, even though the
2259 presence of `$axiom' is to be noted: AFAICS it is useless (but
2260 harmless).
2261
22622001-12-29 Akim Demaille <akim@epita.fr>
2263
2264 * src/reader.c (readgram): Don't add the rule 0 if there were no
2265 rules read. In other words, add it _after_ having performed
2266 grammar sanity checks.
2267 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2268
22692001-12-29 Akim Demaille <akim@epita.fr>
2270
2271 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2272 visible, and some states have now a different number.
2273
22742001-12-29 Akim Demaille <akim@epita.fr>
2275
2276 * src/reader.c (readgram): Bind the initial rule's lineno to that
2277 of the first rule.
2278 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2279 (Solved SR Conflicts): Adjust rule 0's line number.
2280
22812001-12-29 Akim Demaille <akim@epita.fr>
2282
2283 Fix the `GAWK Grammar' failure.
2284
2285 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2286 the reductions of the first state which was mistakenly confused
2287 with the final state because precisely final_state was initialized
2288 to 0.
2289 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2290 now noticed by Bison.
2291 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2292 have a reduction on $default.
2293
22942001-12-29 Akim Demaille <akim@epita.fr>
2295
2296 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2297 rule line numbers.
2298 * src/closure.c (print_closure): Likewise.
2299 * src/derives.c (print_derives): Likewise.
2300 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2301 now.
2302
23032001-12-29 Akim Demaille <akim@epita.fr>
2304
2305 * src/lalr.c (lookaheads_print): New.
2306 (lalr): Call it when --trace-flag.
2307 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2308 are dumped.
2309
23102001-12-29 Akim Demaille <akim@epita.fr>
2311
2312 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2313 when walking through ritem, even via rule->rhs.
2314 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2315 (useful_production, useless_nonterminals): Likewise.
2316 (reduce_grammar_tables): Likewise, plus update nritems.
2317 * src/nullable.c (set_nullable): Likewise.
2318 * src/lalr.c (build_relations): Likewise.
2319 * tests/sets.at (Nullable): Adjust.
2320 Fortunately, now, the $axiom is no longer nullable.
2321
23222001-12-29 Akim Demaille <akim@epita.fr>
2323
2324 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2325 the 0-sentinel.
2326 * src/gram.c (ritem_longest_rhs): Likewise.
2327 * src/reduce.c (nonterminals_reduce): Likewise.
2328 * src/print_graph.c (print_graph): Likewise.
2329 * src/output.c (output_rule_data): Likewise.
2330 * src/nullable.c (set_nullable): Likewise.
2331
23322001-12-29 Akim Demaille <akim@epita.fr>
2333
2334 * src/output.c: Comment changes.
2335
23362001-12-27 Paul Eggert <eggert@twinsun.com>
2337
2338 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2339 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2340 Sparc, as they were causing more porting problems than the
2341 (minor) performance improvement was worth.
2342
2343 Also, catch up with 1.31's YYSTD.
2344
23452001-12-27 Akim Demaille <akim@epita.fr>
2346
2347 * src/output.c (output_gram): Rely on nritems, not the
2348 0-sentinel. See below.
2349 Use -1 as separator, not 0.
2350 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2351 Rely on -1 as separator in yyrhs, instead of 0.
2352 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2353 twice `Now at end of input', therefore there are two lines less to
2354 expect.
2355
23562001-12-27 Akim Demaille <akim@epita.fr>
2357
2358 * tests/regression.at (Unresolved SR Conflicts):
2359 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2360 below.
2361
23622001-12-27 Akim Demaille <akim@epita.fr>
2363
2364 * src/LR0.c (new_state): Recognize the final state by the fact it
2365 is reached by eoftoken.
2366 (insert_start_shifting_state, insert_eof_shifting_state)
2367 (insert_accepting_state, augment_automaton): Remove, since now
2368 these states are automatically computed from the initial state.
2369 (generate_states): Adjust.
2370 * src/print.c: When reporting a rule number to the user, substract
2371 1, so that the axiom rule is rule 0, and the first user rule is 1.
2372 * src/reduce.c: Likewise.
2373 * src/print_graph.c (print_core): For the time being, just as for
2374 the report, depend upon --trace-flags to dump the full set of
2375 items.
2376 * src/reader.c (readgram): Once the grammar read, insert the rule
2377 0: `$axiom: START-SYMBOL $'.
2378 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2379 number of the states has changed (the final state is no longer
2380 necessarily the last), catch up.
2381
23822001-12-27 Akim Demaille <akim@epita.fr>
2383
2384 Try to make the use of the eoftoken valid. Given that its value
2385 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2386 is used instead of > 0 where appropriate, (ii), depend upon nritems
2387 instead of the 0-sentinel.
2388
2389 * src/gram.h, src/gram.c (nritems): New.
2390 Expected to be duplication of nitems, but for the time being...
2391 * src/reader.c (packgram): Assert nritems and nitems are equal.
2392 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2393 * src/closure.c (print_closure, print_fderives): Likewise.
2394 * src/gram.c (ritem_print): Likewise.
2395 * src/print.c (print_core, print_grammar): Likewise.
2396 * src/print_graph.c: Likewise.
2397
23982001-12-27 Akim Demaille <akim@epita.fr>
2399
2400 * src/main.c (main): If there are complains after grammar
2401 reductions, then output the report anyway if requested, then die.
2402 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2403 * src/reader.c (eoftoken): New.
2404 (parse_token_decl): If the token being defined has value `0', it
2405 is the eoftoken.
2406 (packsymbols): No longer hack `tags' to insert `$' by hand.
2407 Be sure to preserve the value of the eoftoken.
2408 (reader): Make sure eoftoken is defined.
2409 Initialize nsyms to 0: now eoftoken is created just like the others.
2410 * src/print.c (print_grammar): Don't special case the eof token.
2411 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2412 lie anyway, albeit pleasant.
2413 * tests/calc.at: Exercise error messages with eoftoken.
2414 Change the grammar so that empty input is invalid.
2415 Adjust expectations.
2416 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2417
24182001-12-27 Akim Demaille <akim@epita.fr>
2419
2420 * configure.in: Check the protos of strchr ans strspn.
2421 Replace strchr if needed.
2422 * src/system.h: Provide the protos of strchr, strspn and memchr if
2423 missing.
2424 * lib/strchr.c: New.
2425 * src/reader.c (symbols_save): Use strchr.
2426
24272001-12-27 Akim Demaille <akim@epita.fr>
2428
2429 * src/print.c, src/print_graph.c (escape): New.
2430 Use it to quote the TAGS outputs.
2431 * src/print_graph.c (print_state): Now errors are in red, and
2432 reductions in green.
2433 Prefer high to wide: output the state number on a line of its own.
2434
24352001-12-27 Akim Demaille <akim@epita.fr>
2436
2437 * src/state.h, src/state.c (reductions_new): New.
2438 * src/LR0.c (set_state_table): Let all the states have a
2439 `reductions', even if reduced to 0.
2440 (save_reductions): Adjust.
2441 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2442 * src/print.c (print_reductions, print_actions): Adjust.
2443 * src/output.c (action_row): Adjust.
2444
24452001-12-27 Akim Demaille <akim@epita.fr>
2446
2447 * src/state.h, src/state.c (errs_new, errs_dup): New.
2448 * src/LR0.c (set_state_table): Let all the states have an errs,
2449 even if reduced to 0.
2450 * src/print.c (print_errs, print_reductions): Adjust.
2451 * src/output.c (output_actions, action_row): Adjust.
2452 * src/conflicts.c (resolve_sr_conflict): Adjust.
2453
24542001-12-27 Akim Demaille <akim@epita.fr>
2455
2456 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2457
24582001-12-27 Akim Demaille <akim@epita.fr>
2459
2460 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2461 * src/print.c: here.
2462 (lookaheadset, shiftset): New, used as additional storage by
2463 print_reductions.
2464 (print_results): Adjust.
2465 (print_shifts, print_gotos, print_errs): New, extracted from...
2466 (print_actions): here.
2467 * src/print_graph.c (print_actions): Remove dead code.
2468
24692001-12-27 Akim Demaille <akim@epita.fr>
2470
2471 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2472 `$n' and `@n'.
2473
24742001-12-27 Akim Demaille <akim@epita.fr>
2475
2476 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2477 (build_relations): Adjust.
2478
24792001-12-27 Akim Demaille <akim@epita.fr>
2480
2481 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2482 duplication.
2483
24842001-12-27 Akim Demaille <akim@epita.fr>
2485
2486 * src/reader.c (packgram): Catch nitems overflows.
2487
24882001-12-27 Akim Demaille <akim@epita.fr>
2489
2490 * src/files.c, src/files.h (guard_obstack): Remove.
2491 * src/output.c (output): Adjust.
2492 * src/reader.c (parse_braces): New, factoring...
2493 (copy_action, copy_guard): these two which are renamed as...
2494 (parse_action, parse_guard): these.
2495 As a voluntary consequence, using braces around guards is now
2496 mandatory.
2497
24982001-12-27 Akim Demaille <akim@epita.fr>
2499
2500 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2501 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2502 members.
2503 (symbol_list_new): Adjust.
2504 (copy_action): action_line is the first line, not the last.
2505 (copy_guard): Just as for actions, store the `action' only, not
2506 the switch/case/break flesh.
2507 Don't parse the user action that might follow the guard, let...
2508 (readgram): do it, i.e., now, there can be an action after a
2509 guard.
2510 In other words the guard is just explicitly optional.
2511 (packgram): Adjust.
2512 * src/output.c (guards_output): New.
2513 (output_parser): Call it when needed.
2514 (output): Also free the guard and attrs obstacks.
2515 * src/files.c, src/files.h (obstack_save): Remove.
2516 (output_files): Remove.
2517 As a result, if one needs the former `.act' file, using an
2518 appropriate skeleton which requires actions and guards is now
2519 required.
2520 * src/main.c (main): Adjust.
2521 * tests/semantic.at: New.
2522 * tests/regression.at: Use `input.y' as input file name.
2523 Avoid 8+3 problems by requiring input.c when the test needs the
2524 parser.
2525
25262001-12-27 Akim Demaille <akim@epita.fr>
2527
2528 * src/reader.c (symbol_list_new): Be sure to initialize all the
2529 fields.
2530
25312001-12-27 Akim Demaille <akim@epita.fr>
2532
2533 All the hacks using a final pseudo state are now useless.
2534
2535 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2536 * src/lalr.c (nLA): New.
2537 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2538 instead of lookaheadsp from the pseudo state (nstate + 1).
2539
25402001-12-27 Akim Demaille <akim@epita.fr>
2541
2542 * src/output.c (action_row, token_actions): Use a state_t instead
2543 of a integer, and nlookaheads instead of the following state's
2544 lookaheadsp.
2545
25462001-12-27 Akim Demaille <akim@epita.fr>
2547
2548 * src/conflicts.c (log_resolution, flush_shift)
2549 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2550 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2551 (conflicts_print, print_reductions): Use a state_t instead of an
2552 integer when referring to a state.
2553 As much as possible, depend upon nlookaheads, instead of the
2554 `lookaheadsp' member of the following state (since lookaheads of
2555 successive states are successive, the difference between state n + 1
2556 and n served as the number of lookaheads for state n).
2557 * src/lalr.c (add_lookback_edge): Likewise.
2558 * src/print.c (print_core, print_actions, print_state)
2559 (print_results): Likewise.
2560 * src/print_graph.c (print_core, print_actions, print_state)
2561 (print_graph): Likewise.
2562 * src/conflicts.h: Adjust.
2563
25642001-12-27 Akim Demaille <akim@epita.fr>
2565
2566 * src/bison.hairy: Formatting/comment changes.
2567 ANSIfy.
2568 Remove `register' indications.
2569 Add plenty of `static'.
2570
25712001-12-27 Akim Demaille <akim@epita.fr>
2572
2573 * src/output.c (prepare): Drop the muscle `ntbase' which
2574 duplicates ntokens.
2575 * src/bison.simple: Formatting/comment changes.
2576 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2577 is an undocumented synonym.
2578
25792001-12-22 Akim Demaille <akim@epita.fr>
2580
2581 * src/output.c (output_table_data): Change the prototype to use
2582 `int' for array ranges: some invocations do pass an int, not a
2583 short.
2584 Reported by Wayne Green.
2585
25862001-12-22 Akim Demaille <akim@epita.fr>
2587
2588 Some actions of web2c.y are improperly triggered.
2589 Reported by Mike Castle.
2590
2591 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2592 * tests/regression.at (Web2c): Rename as...
2593 (Web2c Report): this.
2594 (Web2c Actions): New.
2595
25962001-12-22 Akim Demaille <akim@epita.fr>
2597
2598 Reductions in web2c.y are improperly reported.
2599 Reported by Mike Castle.
2600
2601 * src/conflicts.c (print_reductions): Fix.
2602 * tests/regression.at (Web2c): New.
2603
26042001-12-18 Akim Demaille <akim@epita.fr>
2605
2606 Some host fail on `assert (!"foo")', which expands to
2607 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2608 Reported by Nelson Beebee.
2609
2610 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2611 `#define it_succeeded 0' and `assert (it_succeeded)'.
2612
26132001-12-17 Marc Autret <autret_m@epita.fr>
2614
2615 * src/bison.simple: Don't hard code the skeleton line and filename.
2616 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2617 New line counter 'skeleton_line' (skeleton-line muscle).
2618
26192001-12-17 Paul Eggert <eggert@twinsun.com>
2620
2621 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2622 YYDEBUG must be defined to a nonzero value.
2623
2624 * src/bison.simple (yytname): Do not assume that the user defines
2625 YYDEBUG to a properly parenthesized expression.
2626
26272001-12-17 Akim Demaille <akim@epita.fr>
2628
2629 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2630 nlookaheads is a new member.
2631 Adjust all users.
2632 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2633 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2634 state.
2635
26362001-12-17 Akim Demaille <akim@epita.fr>
2637
2638 * src/files.h, src/files.c (open_files, close_files): Remove.
2639 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2640 let...
2641 * src/reader.c (reader): Do it.
2642
26432001-12-17 Akim Demaille <akim@epita.fr>
2644
2645 * src/conflicts.c (print_reductions): Formatting changes.
2646
26472001-12-17 Akim Demaille <akim@epita.fr>
2648
2649 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2650 (flush_reduce): New.
2651 (resolve_sr_conflict): Adjust.
2652
26532001-12-17 Akim Demaille <akim@epita.fr>
2654
2655 * src/output.c (output_obstack): Be static and rename as...
2656 (format_obstack): this, to avoid any confusion with files.c's
2657 output_obstack.
2658 * src/reader.h (muscle_obstack): Move to...
2659 * src/output.h: here, since it's defined in output.c.
2660
26612001-12-17 Akim Demaille <akim@epita.fr>
2662
2663 * src/output.c (action_row, save_column, default_goto)
2664 (sort_actions, matching_state, pack_vector): Better variable
2665 locality.
2666
26672001-12-17 Akim Demaille <akim@epita.fr>
2668
2669 * src/output.c: Various formatting changes.
2670
26712001-12-17 Akim Demaille <akim@epita.fr>
2672
2673 * src/files.c (output_files): Free the output_obstack.
2674 * src/main.c (main): Call print and print_graph conditionally.
2675 * src/print.c (print): Work unconditionally.
2676 * src/print_graph.c (print_graph): Work unconditionally.
2677 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2678
26792001-12-16 Marc Autret <autret_m@epita.fr>
2680
2681 * src/output.c (actions_output): Fix. When we use %no-lines,
2682 there is one less line per action.
2683
26842001-12-16 Marc Autret <autret_m@epita.fr>
2685
2686 * src/bison.simple: Remove a useless #line directive.
2687 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2688 * src/output.c (get_lines_number): New.
2689 (output_parser): Adjust, now takes care about the lines of a
2690 output muscles.
2691 Fix line numbering.
2692 (actions_output): Computes the number of lines taken by actions.
2693 (output_master_parser): Insert new skeleton which is the name of
2694 the output parser file name.
2695
26962001-12-15 Marc Autret <autret_m@epita.fr>
2697
2698 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2699
27002001-12-15 Marc Autret <autret_m@epita.fr>
2701
2702 * src/output.c (output_gram): Keep track of the hairy one.
2703
27042001-12-15 Akim Demaille <akim@epita.fr>
2705
2706 Make `make distcheck' work.
2707
2708 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2709 system.h which uses libgettext.h.
2710
27112001-12-15 Akim Demaille <akim@epita.fr>
2712
2713 * src/nullable.c (set_nullable): Useless rules must be skipped,
2714 otherwise, since we range over their symbols, we might look at a
2715 nonterminal which no longer ``exists'', i.e., it is not counted in
2716 `nvars', hence we overflow our arrays.
2717
27182001-12-15 Akim Demaille <akim@epita.fr>
2719
2720 The header can also be produced directly, without any obstack!
2721 Yahoo!
2722
2723 * src/files.c, src/files.h (defines_obstack): Remove.
2724 (compute_header_macro): Global.
2725 (defines_obstack_save): Remove.
2726 * src/reader.c (parse_union_decl): No longer output to
2727 defines_obstack: its content can be found in the `stype' muscle
2728 anyway.
2729 (output_token_translations): Merge into...
2730 (symbols_output): this.
2731 Rename as...
2732 (symbols_save): this.
2733 (reader): Adjust.
2734 * src/output.c (header_output): New.
2735 (output): Call it.
2736
27372001-12-15 Akim Demaille <akim@epita.fr>
2738
2739 * src/reader.c (parse_union_decl): Instead of handling two obstack
2740 simultaneously, use one to define the `stype' muscle, and use the
2741 value of the latter to fill defines_obstack.
2742 (copy_comment): Remove.
2743 (copy_comment2): Work for a single obstack.
2744 Rename as...
2745 (copy_comment): this.
2746
27472001-12-15 Akim Demaille <akim@epita.fr>
2748
2749 * src/lex.c, src/lex.h (xgetc): No longer static.
2750 * src/reader.c (parse_union_decl): Revamp.
2751
27522001-12-15 Akim Demaille <akim@epita.fr>
2753
2754 Still making progress in separating Bison into (i) input, (ii)
2755 process, (iii) output: now we can directly output the parser file
2756 without using table_obstack at all.
2757
2758 * src/files.c, src/files.h (table_obstack): Bye bye.
2759 (parser_file_name): New.
2760 * src/files.c (compute_output_file_names): Compute it.
2761 * src/output.c (actions_output, output_parser)
2762 (output_master_parser): To a file instead of an obstack.
2763
27642001-12-15 Akim Demaille <akim@epita.fr>
2765
2766 Attach actions to rules, instead of pre-outputting them to
2767 actions_obstack.
2768
2769 * src/gram.h (rule_t): action and action_line are new members.
2770 * src/reader.c (symbol_list): Likewise.
2771 (copy_action): Save the actions within the rule.
2772 (packgram): Save them in rule_table.
2773 * src/output.c (actions_output): New.
2774 (output_parser): Use it on `%%actions'.
2775 (output_rule_data): Don't free rule_table.
2776 (output): Do it.
2777 (prepare): Don't save the `action' muscle.
2778 * src/bison.simple: s/%%action/%%actions/.
2779
27802001-12-15 Akim Demaille <akim@epita.fr>
2781
2782 * src/reader.c (copy_action): When --yacc, don't append a `;'
2783 to the user action: let it fail if lacking.
2784 Suggested by Arnold Robbins and Tom Tromey.
2785
27862001-12-14 Akim Demaille <akim@epita.fr>
2787
2788 * src/lex.c (literalchar): Simply return the char you decoded, non
2789 longer mess around with obstacks and int pointers.
2790 Adjust all callers.
2791
27922001-12-14 Akim Demaille <akim@epita.fr>
2793
2794 * src/lex.c (literalchar): Don't escape the special characters,
2795 just decode them, and keep them as char (before, eol was output as
2796 the 2 char string `\n' etc.).
2797 * src/output.c (output_rule_data): Use quotearg to output the
2798 token strings.
2799
28002001-12-13 Paul Eggert <eggert@twinsun.com>
2801
2802 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2803 Do not infringe on the global user namespace when using C++.
2804 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2805 All uses of `fprintf' and `stderr' changed.
2806
2807 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2808
28092001-12-13 Akim Demaille <akim@epita.fr>
2810
2811 The computation of nullable is broken: it doesn't handle empty
2812 RHS's properly.
2813
2814 * tests/torture.at (GNU AWK Grammar): New.
2815 * tests/sets.at (Nullable): New.
2816 * src/nullable.c (set_nullable): Instead of blindly looping over
2817 `ritems', loop over the rules, and then over their rhs's.
2818
2819 Work around Autotest bugs.
2820
2821 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2822 frame, because Autotest understand lines starting with a `+' as
2823 traces from the shell. Then, they are not processed properly.
2824 Admittedly an Autotest bug, but we don't have time to wait for
2825 Autotest to catch up.
2826 * tests/regression.at (Broken Closure): Adjust to the new table
2827 frames.
2828 Move to...
2829 * tests/sets.at: here.
2830
28312001-12-13 Akim Demaille <akim@epita.fr>
2832
2833 * src/closure.c (closure): Use nrules instead of playing tricks
2834 with BITS_PER_WORD.
2835
28362001-12-13 Akim Demaille <akim@epita.fr>
2837
2838 * src/print.c (print_actions): Output the handling of `$' as the
2839 traces do: shifting the token EOF. Before EOF was treated as a
2840 nonterminal.
2841 * tests/regression.at: Adjust some tests.
2842 * src/print_graph.c (print_core): Complete the set of items via
2843 closure. The next-to-final and final states are still unsatisfying,
2844 but that's to be addressed elsewhere.
2845 No longer output the rule numbers, but do output the state number.
2846 A single loop for the shifts + gotos is enough, but picked a
2847 distinct color for each.
2848 (print_graph): Initialize and finalize closure.
2849
28502001-12-13 Akim Demaille <akim@epita.fr>
2851
2852 * src/reader.c (readgram): Remove dead code, an strip useless
2853 braces.
2854 (get_type): Remove, unused.
2855
28562001-12-12 Akim Demaille <akim@epita.fr>
2857
2858 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
2859 on that of lib/error.c.
2860
28612001-12-12 Akim Demaille <akim@epita.fr>
2862
2863 Some hosts don't like `/' in includes.
2864
2865 * src/system.h: Include libgettext.h without qualifying the path.
2866 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
2867 $(top_srcdir).
2868
28692001-12-11 Marc Autret <autret_m@epita.fr>
2870
2871 * src/output.c (output_parser): Remove useless muscle.
2872
28732001-12-11 Marc Autret <autret_m@epita.fr>
2874
2875 * src/bison.simple: Remove #line just before %%epilogue. It
2876 is now handled in ...
2877 * src/reader.c (read_additionnal_code): Add the output of a
2878 #line for the epilogue.
2879
28802001-12-10 Marc Autret <autret_m@epita.fr>
2881
2882 * src/reader.c (copy_definition): Re-use CPP-outed code which
2883 replace precedent remove.
2884 * src/bison.simple: Remove #line before %%prologue because
2885 %%input-line is wrong at this time.
2886
28872001-12-10 Marc Autret <autret_m@epita.fr>
2888
2889 * src/reader.c (symbols_output): Clean up.
2890 * src/output.c (output_gram, output): Clean up.
2891
28922001-12-10 Akim Demaille <akim@epita.fr>
2893
2894 * src/lalr.c (initialize_lookaheads): New. Extracted from...
2895 * src/LR0.c (set_state_table): here.
2896 * src/lalr.c (lalr): Call it.
2897
28982001-12-10 Akim Demaille <akim@epita.fr>
2899
2900 * src/state.h (shifts): Remove the `number' member: shifts are
2901 attached to state, hence no longer need to be labelled with a
2902 state number.
2903
29042001-12-10 Akim Demaille <akim@epita.fr>
2905
2906 Now that states have a complete set of members, the linked list of
2907 shifts is useless: just fill directly the state's shifts member.
2908
2909 * src/state.h (shifts): Remove the `next' member.
2910 * src/LR0.c (first_state, last_state): Remove.
2911 Adjust the callers.
2912 (augment_automaton): Don't look for the shifts that must be added
2913 a shift on EOF: it is those of the state we looked for! But now,
2914 since shifts are attached, it is no longer needed to looking
2915 merely by its id: its number.
2916
29172001-12-10 Akim Demaille <akim@epita.fr>
2918
2919 * src/LR0.c (augment_automaton): Better variable locality.
2920 Remove an impossible branch: if there is a state corresponding to
2921 the start symbol being shifted, then there is shift for the start
2922 symbol from the initial state.
2923
29242001-12-10 Akim Demaille <akim@epita.fr>
2925
2926 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
2927 only when appropriate: when insert_start_shifting_state' is not
2928 invoked.
2929 * tests/regression.at (Rule Line Numbers): Adjust.
2930
29312001-12-10 Akim Demaille <akim@epita.fr>
2932
2933 * src/LR0.c (augment_automaton): Now that all states have shifts,
2934 merge the two cases addition shifts to the initial state.
2935
29362001-12-10 Akim Demaille <akim@epita.fr>
2937
2938 * src/lalr.c (set_state_table): Move to...
2939 * src/LR0.c: here.
2940 * src/lalr.c (lalr): Don't call it...
2941 * src/LR0.c (generate_states): do it.
2942 * src/LR0.h (first_state): Remove, only the table is used.
2943
29442001-12-10 Akim Demaille <akim@epita.fr>
2945
2946 * src/LR0.h (first_shift, first_reduction): Remove.
2947 * src/lalr.c: Don't use first_shift: find shifts through the
2948 states.
2949
29502001-12-10 Akim Demaille <akim@epita.fr>
2951
2952 * src/LR0.c: Attach shifts to states as soon as they are
2953 computed.
2954 * src/lalr.c (set_state_table): Instead of assigning shifts to
2955 state, just assert that the mapping was properly done.
2956
29572001-12-10 Akim Demaille <akim@epita.fr>
2958
2959 * src/LR0.c (insert_start_shift): Rename as...
2960 (insert_start_shifting_state): this.
2961 (insert_eof_shifting_state, insert_accepting_state): New.
2962 (augment_automaton): Adjust.
2963 Better locality of the variables.
2964 When looking if the start_symbol is shifted from the initial
2965 state, using `while (... symbol != start_symbol ...)' sounds
2966 better than `while (... symbol < start_symbol ...)': If fail
2967 to see how the order between symbols could be relevant!
2968
29692001-12-10 Akim Demaille <akim@epita.fr>
2970
2971 * src/getargs.h: Don't declare `spec_name_prefix' and
2972 `spec_file_prefix', declared by src/files.h.
2973 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2974 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2975 * src/output.c (prepare): Adjust.
2976 * src/reader.c (symbols_output): Likewise.
2977 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2978
29792001-12-10 Akim Demaille <akim@epita.fr>
2980
2981 * src/muscle_tab.c (muscle_init): NULL is a better default than
2982 `"0"'.
2983
29842001-12-10 Akim Demaille <akim@epita.fr>
2985
2986 * src/reader.c (reader): Calling symbols_output once is enough.
2987
29882001-12-10 Akim Demaille <akim@epita.fr>
2989
2990 Now that states have a complete set of members, the linked list of
2991 reductions is useless: just fill directly the state's reductions
2992 member.
2993
2994 * src/state.h (struct reductions): Remove member `number' and
2995 `next'.
2996 * src/LR0.c (first_reduction, last_reduction): Remove.
2997 (save_reductions): Don't link the new reductions, store them in
2998 this_state.
2999 * src/lalr.c (set_state_table): No need to attach reductions to
3000 states, it's already done.
3001 * src/output.c (output_actions): No longer free the shifts, then
3002 the reductions, then the states: free all the states and their
3003 members.
3004
30052001-12-10 Akim Demaille <akim@epita.fr>
3006
3007 * src/options.c (OPTN, DRTV, BOTH): New.
3008 (option_table): Use them.
3009
3010 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3011 the job of system.h.
3012 * src/options.c: Don't include stdio.h and xalloc.h for the same
3013 reasons.
3014
30152001-12-10 Akim Demaille <akim@epita.fr>
3016
3017 * src/output.c (output, prepare): Make sure the values of the
3018 muscles `action' and `prologue' are 0-terminated.
3019
30202001-12-10 Akim Demaille <akim@epita.fr>
3021
3022 Clean up GCC warnings.
3023
3024 * src/reader.c (copy_action): `buf' is not used.
3025 (parse_skel_decl): Be static.
3026 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3027 * src/options.h (create_long_option_table): Have a real prototype.
3028 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3029 (hash_delete_at): Return const void *.
3030 Adjust casts to preserve the const.
3031
30322001-12-10 Akim Demaille <akim@epita.fr>
3033
3034 * configure.in: Require 2.52g.
3035 M4 is not needed, but AUTOM4TE is.
3036 * m4/m4.m4: Remove.
3037 * tests/Makefile.am: Adjust.
3038
30392001-12-10 Akim Demaille <akim@epita.fr>
3040
3041 One structure for states is enough, even though theoretically
3042 there are LR(0) states and LALR(1) states.
3043
3044 * src/lalr.h (state_t): Remove.
3045 (state_table): Be state_t **, not state_t *.
3046 * src/state.h (core, CORE_ALLOC): Rename as...
3047 (state_t, STATE_ALLOC): this.
3048 Add the LALR(1) members: shifts, reductions, errs.
3049 * src/LR0.c (state_table): Rename as...
3050 (state_hash): this, to avoid name clashes with the global
3051 `state_table'.
3052 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3053 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3054
30552001-12-10 Akim Demaille <akim@epita.fr>
3056
3057 Bison dumps core on bash.y.
3058 Reported by Pascal Bart.
3059
3060 * src/warshall.c (bitmatrix_print): New.
3061 (TC): Use it.
3062 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3063 j must be the outer loop.
3064 * tests/regression.at (Broken Closure): New.
3065
30662001-12-05 Akim Demaille <akim@epita.fr>
3067
3068 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3069 its argument.
3070