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