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