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