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