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