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