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