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