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