]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* data/bison.simple (b4_pure_if): New.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-06-19 Akim Demaille <akim@epita.fr>
2
3 * data/bison.simple (b4_pure_if): New.
4 Use it instead of #ifdef YYPURE.
5
62002-06-19 Akim Demaille <akim@epita.fr>
7
8 * data/bison.simple (b4_location_if): New.
9 Use it instead of #ifdef YYLSP_NEEDED.
10
112002-06-19 Akim Demaille <akim@epita.fr>
12
13 Prepare @$ in %destructor, but currently don't bind it in the
14 skeleton, as %location use is not cleaned up yet.
15
16 * src/scan-gram.l (handle_dollar, handle_destructor_at)
17 (handle_action_at): New.
18 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
19 a braced_code_t and a location as additional arguments.
20 (handle_destructor_dollar): Instead of requiring `b4_eval', just
21 unquote one when outputting `b4_dollar_dollar'.
22 Adjust callers.
23 * data/bison.simple (b4_eval): Remove.
24 (b4_symbol_destructor): Adjust.
25 * tests/input.at (Invalid @n): Adjust.
26
272002-06-19 Zack Weinberg <zack@codesourcery.com>
28
29 * doc/bison.texinfo: Document ability to have multiple
30 prologue sections.
31
322002-06-18 Akim Demaille <akim@epita.fr>
33
34 * src/files.c (compute_base_names): When computing the output file
35 names from the input file name, strip the directory part.
36
372002-06-18 Akim Demaille <akim@epita.fr>
38
39 * data/bison.simple.new: Comment changes.
40 Reported by Andreas Schwab.
41
422002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
43
44 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
45 there are no `label `yyoverflowlab' defined but not used' warnings
46 when yyoverflow is defined.
47
482002-06-18 Akim Demaille <akim@epita.fr>
49
50 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
51 new member.
52 (symbol_destructor_set): Adjust.
53 * src/output.c (symbol_destructors_output): Output the destructor
54 locations.
55 Output the symbol name.
56 * data/bison.simple (b4_symbol_destructor): Adjust.
57
582002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
59 and Akim Demaille <akim@epita.fr>
60
61 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
62 what's left on the stack when the error recovery hits EOF.
63 * tests/actions.at (Destructors): Complete to exercise this case.
64
652002-06-17 Akim Demaille <akim@epita.fr>
66
67 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
68 arguments is really empty, not only equal to `[]'.
69 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
70 member.
71 (symbol_destructor_set): New.
72 * src/output.c (symbol_destructors_output): New.
73 * src/reader.h (brace_code_t, current_braced_code): New.
74 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
75 (handle_dollar): Rename as...
76 (handle_action_dollar): this.
77 (handle_destructor_dollar): New.
78 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
79 (grammar_declaration): Use it.
80 * data/bison.simple (yystos): Is always defined.
81 (yydestructor): New.
82 * tests/actions.at (Destructors): New.
83 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
84
852002-06-17 Akim Demaille <akim@epita.fr>
86
87 * src/symlist.h, src/symlist.c (symbol_list_length): New.
88 * src/scan-gram.l (handle_dollar, handle_at): Compute the
89 rule_length only when needed.
90 * src/output.c (actions_output, token_definitions_output): Output
91 the full M4 block.
92 * src/symtab.c: Don't access directly to the symbol tag, use
93 symbol_tag_get.
94 * src/parse-gram.y: Use symbol_list_free.
95
962002-06-17 Akim Demaille <akim@epita.fr>
97
98 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
99 (symbol_list_prepend, get_type_name): Move to...
100 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
101 (symbol_list_prepend, symbol_list_n_type_name_get): here.
102 Adjust all callers.
103 (symbol_list_free): New.
104 * src/scan-gram.l (handle_dollar): Takes a location.
105 * tests/input.at (Invalid $n): Adjust.
106
1072002-06-17 Akim Demaille <akim@epita.fr>
108
109 * src/reader.h, src/reader.c (symbol_list_new): Export it.
110 (symbol_list_prepend): New.
111 * src/parse-gram.y (%union): `list' is a new member.
112 (symbols.1): New, replaces...
113 (terms_to_prec.1, nterms_to_type.1): these.
114 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
115 Take a location as additional argument.
116 Adjust all callers.
117
1182002-06-15 Akim Demaille <akim@epita.fr>
119
120 * src/parse-gram.y: Move %token in the declaration section so that
121 we don't depend upon CVS Bison.
122
1232002-06-15 Akim Demaille <akim@epita.fr>
124
125 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
126 * src/print.c (print_core): Use it.
127
1282002-06-15 Akim Demaille <akim@epita.fr>
129
130 * src/conflicts.c (log_resolution): Accept the rule involved in
131 the sr conflicts instead of the lookahead number that points to
132 that rule.
133 (flush_reduce): Accept the current lookahead vector as argument,
134 instead of the index in LA.
135 (resolve_sr_conflict): Accept the current number of lookahead
136 bitset to consider for the STATE, instead of the index in LA.
137 (set_conflicts): Adjust.
138 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
139
1402002-06-15 Akim Demaille <akim@epita.fr>
141
142 * src/state.h (state_t): Replace the `lookaheadsp' member, a
143 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
144 Adjust all dependencies.
145 * src/lalr.c (initialize_lookaheads): Split into...
146 (states_lookaheads_count, states_lookaheads_initialize): these.
147 (lalr): Adjust.
148
1492002-06-15 Akim Demaille <akim@epita.fr>
150
151 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
152 out of...
153 (grammar_rules_print): here.
154 * src/reduce.c (reduce_output): Use it.
155 * tests/reduce.at (Useless Rules, Reduced Automaton)
156 (Underivable Rules): Adjust.
157
1582002-06-15 Akim Demaille <akim@epita.fr>
159
160 Copy BYacc's nice way to report the grammar.
161
162 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
163 New.
164 Don't print the rules' location, it is confusing and useless.
165 (rule_print): Use grammar_rhs_print.
166 * src/print.c (print_grammar): Use grammar_rules_print.
167
1682002-06-15 Akim Demaille <akim@epita.fr>
169
170 Complete and rationalize `useless thing' warnings.
171
172 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
173 (symbol_tag_print): New.
174 Use them everywhere in place of accessing directly the tag member.
175 * src/gram.h, src/gram.c (rule_print): New.
176 Use it where a rule used to be printed `by hand'.
177 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
178 (reduce_grammar_tables): Report the useless rules.
179 (reduce_print): Useless things are a warning, not an error.
180 Report it as such.
181 * tests/reduce.at (Useless Nonterminals, Useless Rules):
182 (Reduced Automaton, Underivable Rules): Adjust.
183 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
184 * tests/conflicts.at (Unresolved SR Conflicts)
185 (Solved SR Conflicts): Adjust.
186
1872002-06-15 Akim Demaille <akim@epita.fr>
188
189 Let symbols have a location.
190
191 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
192 (getsym): Adjust.
193 Adjust all callers.
194 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
195 Use location_t, not int.
196 * src/symtab.c (symbol_check_defined): Take advantage of the
197 location.
198 * tests/regression.at (Invalid inputs): Adjust.
199
2002002-06-15 Akim Demaille <akim@epita.fr>
201
202 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
203 (input): Don't try to initialize yylloc here, do it in the
204 scanner.
205 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
206 * src/gram.h (rule_t): Change line and action_line into location
207 and action_location, of location_t type.
208 Adjust all dependencies.
209 * src/location.h, src/location.c (empty_location): New.
210 * src/reader.h, src/reader.c (grammar_start_symbol_set)
211 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
212 (grammar_current_rule_symbol_append)
213 (grammar_current_rule_action_append): Expect a location as argument.
214 * src/reader.c (grammar_midrule_action): Adjust to attach an
215 action's location as dummy symbol location.
216 * src/symtab.h, src/symtab.c (startsymbol_location): New.
217 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
218 the line numbers.
219
2202002-06-14 Akim Demaille <akim@epita.fr>
221
222 Grammar declarations may be found in the grammar section.
223
224 * src/parse-gram.y (rules_or_grammar_declaration): New.
225 (declarations): Each declaration may end with a semicolon, not
226 just...
227 (grammar_declaration): `"%union"'.
228 (grammar): Branch to rules_or_grammar_declaration.
229
2302002-06-14 Akim Demaille <akim@epita.fr>
231
232 * src/main.c (main): Invoke scanner_free.
233
2342002-06-14 Akim Demaille <akim@epita.fr>
235
236 * src/output.c (m4_invoke): Extracted from...
237 (output_skeleton): here.
238 Free tempfile.
239
2402002-06-14 Akim Demaille <akim@epita.fr>
241
242 * src/parse-gram.y (directives, directive, gram)
243 (grammar_directives, precedence_directives, precedence_directive):
244 Rename as...
245 (declarations, declaration, grammar, grammar_declaration)
246 (precedence_declaration, precedence_declarator): these.
247 (symbol_declaration): New.
248
2492002-06-14 Akim Demaille <akim@epita.fr>
250
251 * src/files.c (action_obstack): Remove, unused.
252 (output_obstack): Remove it, and all its dependencies, as it is no
253 longer needed.
254 * src/reader.c (epilogue_set): Build the epilogue in the
255 muscle_obstack.
256 * src/output.h, src/output.c (muscle_obstack): Move to...
257 * src/muscle_tab.h, src/muscle_tab.h: here.
258 (muscle_init): Initialize muscle_obstack.
259 (muscle_free): New.
260 * src/main.c (main): Call it.
261
2622002-06-14 Akim Demaille <akim@epita.fr>
263
264 * src/location.h: New, extracted from...
265 * src/reader.h: here.
266 * src/Makefile.am (noinst_HEADERS): Merge into
267 (bison_SOURCES): this.
268 Add location.h.
269 * src/parse-gram.y: Use location_t instead of Bison's.
270 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
271 Use location_t instead of ints.
272
2732002-06-14 Akim Demaille <akim@epita.fr>
274
275 * data/bison.simple, data/bison.c++: Be sure to restore the
276 current #line when returning to the skeleton contents after having
277 exposed the input file's #line.
278
2792002-06-12 Akim Demaille <akim@epita.fr>
280
281 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
282 eager.
283 * tests/actions.at (Exotic Dollars): New.
284
2852002-06-12 Akim Demaille <akim@epita.fr>
286
287 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
288 ['"/] too eagerly.
289 * tests/input.at (Torturing the Scanner): New.
290
2912002-06-11 Akim Demaille <akim@epita.fr>
292
293 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
294 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
295 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
296 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
297 * src/reader.c (reader): Use it.
298
2992002-06-11 Akim Demaille <akim@epita.fr>
300
301 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
302 Adjust all callers.
303 (scanner_last_string_free): New.
304
3052002-06-11 Akim Demaille <akim@epita.fr>
306
307 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
308 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
309 (last_string, YY_OBS_FREE): New.
310 Use them when returning an ID.
311
3122002-06-11 Akim Demaille <akim@epita.fr>
313
314 Have Bison grammars parsed by a Bison grammar.
315
316 * src/reader.c, src/reader.h (prologue_augment): New.
317 * src/reader.c (copy_definition): Remove.
318
319 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
320 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
321 (grammar_current_rule_prec_set, grammar_current_rule_check)
322 (grammar_current_rule_symbol_append)
323 (grammar_current_rule_action_append): Export.
324 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
325 (symbol_list_action_append): Remove.
326 Hook the routines from reader.
327 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
328 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
329
330 * src/reader.c (read_declarations): Remove, unused.
331
332 * src/parse-gram.y: Handle the epilogue.
333 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
334 (grammar_start_symbol_set): this.
335 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
336 * src/reader.c (readgram): Remove, unused.
337 (reader): Adjust to insert eoftoken and axiom where appropriate.
338
339 * src/reader.c (copy_dollar): Replace with...
340 * src/scan-gram.h (handle_dollar): this.
341 * src/parse-gram.y: Remove `%thong'.
342
343 * src/reader.c (copy_at): Replace with...
344 * src/scan-gram.h (handle_at): this.
345
346 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
347 New.
348
349 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
350 time being.
351
352 * src/reader.h, src/reader.c (grammar_rule_end): New.
353
354 * src/parse.y (current_type, current_class): New.
355 Implement `%nterm', `%token' support.
356 Merge `%term' into `%token'.
357 (string_as_id): New.
358 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
359 type name.
360
361 * src/parse-gram.y: Be sure to handle properly the beginning of
362 rules.
363
364 * src/parse-gram.y: Handle %type.
365 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
366
367 * src/parse-gram.y: More directives support.
368 * src/options.c: No longer handle source directives.
369
370 * src/parse-gram.y: Fix %output.
371
372 * src/parse-gram.y: Handle %union.
373 Use the prologue locations.
374 * src/reader.c (parse_union_decl): Remove.
375
376 * src/reader.h, src/reader.c (epilogue_set): New.
377 * src/parse-gram.y: Use it.
378
379 * data/bison.simple, data/bison.c++: b4_stype is now either not
380 defined, then default to int, or to the contents of %union,
381 without `union' itself.
382 Adjust.
383 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
384
385 * src/output.c (actions_output): Don't output braces, as they are
386 already handled by the scanner.
387
388 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
389 characters to themselves.
390
391 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
392 that the epilogue has a proper #line.
393
394 * src/parse-gram.y: Handle precedence/associativity.
395
396 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
397 a terminal.
398 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
399 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
400 at all to define terminals that cannot be emitted.
401
402 * src/scan-gram.l: Escape M4 characters.
403
404 * src/scan-gram.l: Working properly with escapes in user
405 strings/characters.
406
407 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
408 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
409 grammar.
410 Use more modest sizes, as for the time being the parser does not
411 release memory, and therefore the process swallows a huge amount
412 of memory.
413
414 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
415 stricter %token grammar.
416
417 * src/symtab.h (associativity): Add `undef_assoc'.
418 (symbol_precedence_set): Do nothing when passed an undef_assoc.
419 * src/symtab.c (symbol_check_alias_consistence): Adjust.
420
421 * tests/regression.at (Invalid %directive): Remove, as it is now
422 meaningless.
423 (Invalid inputs): Adjust to the new error messages.
424 (Token definitions): The new grammar doesn't allow too many
425 eccentricities.
426
427 * src/lex.h, src/lex.c: Remove.
428 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
429 (copy_character, copy_string2, copy_string, copy_identifier)
430 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
431 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
432 (parse_action): Remove.
433 * po/POTFILES.in: Adjust.
434
4352002-06-11 Akim Demaille <akim@epita.fr>
436
437 * src/reader.c (parse_action): Don't store directly into the
438 rule's action member: return the action as a string.
439 Don't require `rule_length' as an argument: compute it.
440 (grammar_current_rule_symbol_append)
441 (grammar_current_rule_action_append): New, eved out from
442 (readgram): here.
443 Remove `action_flag', `rulelength', unused now.
444
4452002-06-11 Akim Demaille <akim@epita.fr>
446
447 * src/reader.c (grammar_current_rule_prec_set).
448 (grammar_current_rule_check): New, eved out from...
449 (readgram): here.
450 Remove `xaction', `first_rhs': useless.
451 * tests/input.at (Type clashes): New.
452 * tests/existing.at (GNU Cim Grammar): Adjust.
453
4542002-06-11 Akim Demaille <akim@epita.fr>
455
456 * src/reader.c (grammar_midrule_action): New, Eved out from
457 (readgram): here.
458
4592002-06-11 Akim Demaille <akim@epita.fr>
460
461 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
462 New.
463 (readgram): Use them as replacement of inlined code, crule and
464 crule1.
465
4662002-06-11 Akim Demaille <akim@epita.fr>
467
468 * src/reader.c (grammar_end, grammar_symbol_append): New.
469 (readgram): Use them.
470 Make the use of `p' as local as possible.
471
4722002-06-10 Akim Demaille <akim@epita.fr>
473
474 GCJ's parser requires the tokens to be defined before the prologue.
475
476 * data/bison.simple: Output the token definition before the user's
477 prologue.
478 * tests/regression.at (Braces parsing, Duplicate string)
479 (Mixing %token styles): Check the output from bison.
480 (Early token definitions): New.
481
4822002-06-10 Akim Demaille <akim@epita.fr>
483
484 * src/symtab.c (symbol_user_token_number_set): Don't complain when
485 assigning twice the same user number to a token, so that we can
486 use it in...
487 * src/lex.c (lex): here.
488 Also use `symbol_class_set' instead of hand written code.
489 * src/reader.c (parse_assoc_decl): Likewise.
490
4912002-06-10 Akim Demaille <akim@epita.fr>
492
493 * src/symtab.c, src/symtab.c (symbol_class_set)
494 (symbol_user_token_number_set): New.
495 * src/reader.c (parse_token_decl): Use them.
496 Use a switch instead of ifs.
497 Use a single argument.
498
4992002-06-10 Akim Demaille <akim@epita.fr>
500
501 Remove `%thong' support as it is undocumented, unused, duplicates
502 `%token's job, and creates useless e-mail traffic with people who
503 want to know what it is, why it is undocumented, unused, and
504 duplicates `%token's job.
505
506 * src/reader.c (parse_thong_decl): Remove.
507 * src/options.c (option_table): Remove "thong".
508 * src/lex.h (tok_thong): Remove.
509
5102002-06-10 Akim Demaille <akim@epita.fr>
511
512 * src/symtab.c, src/symtab.c (symbol_type_set)
513 (symbol_precedence_set): New.
514 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
515 (value_components_used): Remove, unused.
516
5172002-06-09 Akim Demaille <akim@epita.fr>
518
519 Move symbols handling code out of the reader.
520
521 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
522 (axiom): Move to...
523 * src/symtab.h, src/symtab.c: here.
524
525 * src/gram.c (start_symbol): Remove: use startsymbol->number.
526 * src/reader.c (startval): Rename as...
527 * src/symtab.h, src/symtab.c (startsymbol): this.
528 * src/reader.c: Adjust.
529
530 * src/reader.c (symbol_check_defined, symbol_make_alias)
531 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
532 (token_translations_init)
533 Move to...
534 * src/symtab.c: here.
535 * src/reader.c (packsymbols): Move to...
536 * src/symtab.h, src/symtab.c (symbols_pack): here.
537 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
538 argument.
539
5402002-06-03 Akim Demaille <akim@epita.fr>
541
542 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
543 then statements.
544
5452002-06-03 Akim Demaille <akim@epita.fr>
546
547 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
548 structs with non literals.
549 * src/scan-skel.l: never-interactive.
550 * src/conflicts.c (enum conflict_resolution_e): No trailing
551 comma.
552 * src/getargs.c (usage): Split long literal strings.
553 Reported by Hans Aberg.
554
5552002-05-28 Akim Demaille <akim@epita.fr>
556
557 * data/bison.c++: Use C++ ostreams.
558 (cdebug_): New member.
559
5602002-05-28 Akim Demaille <akim@epita.fr>
561
562 * src/output.c (output_skeleton): Be sure to allocate enough room
563 for `/' _and_ for `\0' in full_skeleton.
564
5652002-05-28 Akim Demaille <akim@epita.fr>
566
567 * data/bison.c++: Catch up with bison.simple:
568 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
569 and Paul Eggert <eggert@twinsun.com>: `error' handing.
570 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
571 and popping traces.
572
5732002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
574
575 * src/output.c (output_skeleton): Put an explicit path in front of
576 the skeleton file name, rather than relying on the -I directory,
577 to partially alleviate effects of having a skeleton file lying around
578 in the current directory.
579
5802002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
581
582 * src/conflicts.c (log_resolution): Correct typo:
583 obstack_printf should be obstack_fgrow1.
584
5852002-05-26 Akim Demaille <akim@epita.fr>
586
587 * src/state.h (state_t): `solved_conflicts' is a new member.
588 * src/LR0.c (new_state): Set it to 0.
589 * src/conflicts.h, src/conflicts.c (print_conflicts)
590 (free_conflicts, solve_conflicts): Rename as...
591 (conflicts_print, conflicts_free, conflicts_solve): these.
592 Adjust callers.
593 * src/conflicts.c (enum conflict_resolution_e)
594 (solved_conflicts_obstack): New, used by...
595 (log_resolution): this.
596 Adjust to attach the conflict resolution to each state.
597 Complete the description with the precedence/associativity
598 information.
599 (resolve_sr_conflict): Adjust.
600 * src/print.c (print_state): Output its solved_conflicts.
601 * tests/conflicts.at (Unresolved SR Conflicts)
602 (Solved SR Conflicts): Exercise --report=all.
603
6042002-05-26 Akim Demaille <akim@epita.fr>
605
606 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
607 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
608 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
609 (token_number_t, item_number_as_token_number)
610 (token_number_as_item_number, muscle_insert_token_number_table):
611 Rename as...
612 (symbol_number_t, item_number_as_symbol_number)
613 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
614 these, since it is more appropriate.
615
6162002-05-26 Akim Demaille <akim@epita.fr>
617
618 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
619 `Error:' lines.
620 * data/bison.simple (yystos) [YYDEBUG]: New.
621 (yyparse) [YYDEBUG]: Display the symbols which are popped during
622 error recovery.
623 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
624
6252002-05-25 Akim Demaille <akim@epita.fr>
626
627 * doc/bison.texinfo (Debugging): Split into...
628 (Tracing): this new section, its former contents, and...
629 (Understanding): this new section.
630 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
631 by...
632 (report_flag): this.
633 Adjust all dependencies.
634 (report_args, report_types, report_argmatch): New.
635 (usage, getargs): Report/support -r, --report.
636 * src/options.h
637 (struct option_table_struct): Rename as..,
638 (struct option_table_s): this.
639 Rename the `set_flag' member to `flag' to match with getopt_long's
640 struct.
641 * src/options.c (option_table): Split verbose into an entry for
642 %verbose, and another for --verbose.
643 Support --report/-r, so remove -r from the obsolete --raw.
644 * src/print.c: Attach full item sets and lookaheads reports to
645 report_flag instead of trace_flag.
646 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
647
6482002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
649 and Paul Eggert <eggert@twinsun.com>
650
651 * data/bison.simple (yyparse): Correct error handling to conform to
652 POSIX and yacc. Specifically, after syntax error is discovered,
653 do not reduce further before shifting the error token.
654 Clean up the code a bit by removing the labels yyerrdefault,
655 yyerrhandle, yyerrpop.
656 * NEWS: Document the above.
657
6582002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
659
660 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
661 type; it isn't always big enough, since it doesn't necessarily
662 include non-terminals.
663 (yytranslate): Expand definition of yy_token_number_type, so that
664 the latter can be removed.
665 (yy_token_number_type): Remove, only one use.
666 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
667 don't use TokenNumberType as element type.
668
669 * tests/regression.at: Modify expected output to agree with change
670 to yyr1 and yytranslate.
671
6722002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
673
674 * src/reader.c (parse_action): Use copy_character instead of
675 obstack_1grow.
676
6772002-05-13 Akim Demaille <akim@epita.fr>
678
679 * tests/regression.at (Token definitions): Prototype yylex and
680 yyerror.
681
6822002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
683
684 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
685 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
686 32-bit arithmetic.
687 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
688
6892002-05-07 Akim Demaille <akim@epita.fr>
690
691 * tests/synclines.at: Be sure to prototype yylex and yyerror to
692 avoid GCC warnings.
693
6942002-05-07 Akim Demaille <akim@epita.fr>
695
696 Kill GCC warnings.
697
698 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
699 over the RHS of each rule.
700 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
701 * src/state.h (state_t): Member `nitems' is unsigned short.
702 * src/LR0.c (get_state): Adjust.
703 * src/reader.c (packgram): Likewise.
704 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
705 `Type'.
706 (muscle_insert_int_table): Remove, unused.
707 (prepare_rules): Remove `max'.
708
7092002-05-06 Akim Demaille <akim@epita.fr>
710
711 * src/closure.c (print_firsts): Display of the symbol tags.
712 (bitmatrix_print): Move to...
713 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
714 here.
715 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
716
7172002-05-06 Akim Demaille <akim@epita.fr>
718
719 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
720 hash_do_for_each.
721
7222002-05-06 Akim Demaille <akim@epita.fr>
723
724 * src/LR0.c (new_state, get_state): Instead of using the global
725 `kernel_size' and `kernel_base', have two new arguments:
726 `core_size' and `core'.
727 Adjust callers.
728
7292002-05-06 Akim Demaille <akim@epita.fr>
730
731 * src/reader.c (packgram): No longer end `ritem' with a 0
732 sentinel: it is not used.
733
7342002-05-05 Akim Demaille <akim@epita.fr>
735
736 New experimental feature: display the lookaheads in the report and
737 graph.
738
739 * src/print (print_core): When --trace-flag, display the rules
740 lookaheads.
741 * src/print_graph.c (print_core): Likewise.
742 Swap the arguments.
743 Adjust caller.
744
7452002-05-05 Akim Demaille <akim@epita.fr>
746
747 * tests/torture.at (Many lookaheads): New test.
748
7492002-05-05 Akim Demaille <akim@epita.fr>
750
751 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
752 (GENERATE_MUSCLE_INSERT_TABLE): this.
753 (output_int_table, output_unsigned_int_table, output_short_table)
754 (output_token_number_table, output_item_number_table): Replace with...
755 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
756 (muscle_insert_short_table, muscle_insert_token_number_table)
757 (muscle_insert_item_number_table): these.
758 Adjust all callers.
759 (prepare_tokens): Don't free `translations', since...
760 * src/reader.h, src/reader.c (grammar_free): do it.
761 Move to...
762 * src/gram.h, src/gram.c (grammar_free): here.
763 * data/bison.simple, data/bison.c++: b4_token_number_max is now
764 b4_translate_max.
765
7662002-05-05 Akim Demaille <akim@epita.fr>
767
768 * src/output.c (output_unsigned_int_table): New.
769 (prepare_rules): `i' is unsigned.
770 `prhs', `rline', `r2' are unsigned int.
771 Rename muscle `rhs_number_max' as `rhs_max'.
772 Output muscles `prhs_max', `rline_max', and `r2_max'.
773 Free rline and r1.
774 * data/bison.simple, data/bison.c++: Adjust to use these muscles
775 to compute types instead of constant types.
776 * tests/regression.at (Web2c Actions): Adjust.
777
7782002-05-04 Akim Demaille <akim@epita.fr>
779
780 * src/symtab.h (SALIAS, SUNDEF): Rename as...
781 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
782 Adjust dependencies.
783 * src/output.c (token_definitions_output): Be sure not to output a
784 `#define 'a'' when fed with `%token 'a' "a"'.
785 * tests/regression.at (Token definitions): New.
786
7872002-05-03 Paul Eggert <eggert@twinsun.com>
788
789 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
790 for K&R C.
791
7922002-05-03 gettextize <bug-gnu-gettext@gnu.org>
793
794 * Makefile.am (SUBDIRS): Remove intl.
795 (EXTRA_DIST): Add config/config.rpath.
796
7972002-05-03 Akim Demaille <akim@epita.fr>
798
799 * data/bison.simple (m4_if): Don't output empty enums.
800 And actually, output valid enum definitions :(.
801
8022002-05-03 Akim Demaille <akim@epita.fr>
803
804 * configure.bat: Remove, completely obsolete.
805 * Makefile.am (EXTRA_DIST): Adjust.
806 Don't distribute config.rpath...
807 * config/Makefile.am (EXTRA_DIST): Do it.
808
8092002-05-03 Akim Demaille <akim@epita.fr>
810
811 * configure.in (GETTEXT_VERSION): New.
812 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
813
8142002-05-03 Akim Demaille <akim@epita.fr>
815
816 * data/bison.simple (b4_token_enum): New.
817 (b4_token_defines): Use it to output tokens both as #define and
818 enums.
819 Suggested by Paul Eggert.
820 * src/output.c (token_definitions_output): Don't output spurious
821 white spaces.
822
8232002-05-03 Akim Demaille <akim@epita.fr>
824
825 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
826
8272002-05-02 Robert Anisko <robert@lrde.epita.fr>
828
829 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
830 Update the stack class, give a try to deque as the default container.
831
8322002-05-02 Akim Demaille <akim@epita.fr>
833
834 * data/bison.simple (yyparse): Do not implement @$ = @1.
835 (YYLLOC_DEFAULT): Adjust to do it.
836 * doc/bison.texinfo (Location Default Action): Fix.
837
8382002-05-02 Akim Demaille <akim@epita.fr>
839
840 * src/reader.c (parse_braces): Merge into...
841 (parse_action): this.
842
8432002-05-02 Akim Demaille <akim@epita.fr>
844
845 * configure.in (ALL_LINGUAS): Remove.
846 * po/LINGUAS, hr.po: New.
847
8482002-05-02 Akim Demaille <akim@epita.fr>
849
850 Remove the so called hairy (semantic) parsers.
851
852 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
853 * src/gram.h, src/gram.c (semantic_parser): Remove.
854 (rule_t): Remove the guard and guard_line members.
855 * src/lex.h (token_t): remove tok_guard.
856 * src/options.c (option_table): Remove %guard and %semantic_parser
857 support.
858 * src/output.c, src/output.h (guards_output): Remove.
859 (prepare): Adjust.
860 (token_definitions_output): Don't output the `T'
861 tokens (???).
862 (output_skeleton): Don't output the guards.
863 * src/files.c, src/files.c (attrsfile): Remove.
864 * src/reader.c (symbol_list): Remove the guard and guard_line
865 members.
866 Adjust dependencies.
867 (parse_guard): Remove.
868 * data/bison.hairy: Remove.
869 * doc/bison.texinfo (Environment Variables): Remove occurrences of
870 BISON_HAIRY.
871
8722002-05-02 Akim Demaille <akim@epita.fr>
873
874 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
875 (parse_guard): Rename the formal argument `stack_offset' as
876 `rule_length', which is more readable.
877 Adjust callers.
878 (copy_at, copy_dollar): Instead of outputting the hard coded
879 values of $$, $n and so forth, output invocation to b4_lhs_value,
880 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
881 Note: this patch partially drops `semantic-parser' support: it
882 always does `rule_length - n', where semantic parsers ought to
883 always use `-n'.
884 * data/bison.simple, data/bison.c++ (b4_lhs_value)
885 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
886
8872002-05-02 Akim Demaille <akim@epita.fr>
888
889 * configure.in (AC_INIT): Bump to 1.49b.
890 (AM_INIT_AUTOMAKE): Short invocation.
891
8922002-05-02 Akim Demaille <akim@epita.fr>
893
894 Version 1.49a.
895
8962002-05-01 Akim Demaille <akim@epita.fr>
897
898 * src/skeleton.h: Remove.
899
9002002-05-01 Akim Demaille <akim@epita.fr>
901
902 * src/skeleton.h: Fix the #endif.
903 Reported by Magnus Fromreide.
904
9052002-04-26 Paul Eggert <eggert@twinsun.com>
906
907 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
908 Define if we define YYSTYPE and YYLTYPE, respectively.
909 (YYCOPY): Fix [] quoting problem in the non-GCC case.
910
9112002-04-25 Robert Anisko <robert@lrde.epita.fr>
912
913 * src/scan-skel.l: Postprocess quadrigraphs.
914
915 * src/reader.c (copy_character): New function, used to output
916 single characters while replacing `[' and `]' with quadrigraphs, to
917 avoid troubles with M4 quotes.
918 (copy_comment): Output characters with copy_character.
919 (read_additionnal_code): Likewise.
920 (copy_string2): Likewise.
921 (copy_definition): Likewise.
922
923 * tests/calc.at: Exercise M4 quoting.
924
9252002-04-25 Akim Demaille <akim@epita.fr>
926
927 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
928 between `!' and the command.
929 Reported by Paul Eggert.
930
9312002-04-24 Robert Anisko <robert@lrde.epita.fr>
932
933 * tests/calc.at: Exercise prologue splitting.
934
935 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
936 `b4_post_prologue' instead of `b4_prologue'.
937
938 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
939 muscles.
940 (output): Free pre_prologue_obstack and post_prologue_obstack.
941 * src/files.h, src/files.c (attrs_obstack): Remove.
942 (pre_prologue_obstack, post_prologue_obstack): New.
943 * src/reader.c (copy_definition): Add a parameter to specify the
944 obstack to fill, instead of using attrs_obstack unconditionally.
945 (read_declarations): Pass pre_prologue_obstack to copy_definition if
946 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
947
9482002-04-23 Paul Eggert <eggert@twinsun.com>
949
950 * data/bison.simple: Remove unnecessary commentary and white
951 space differences from 1_29-branch.
952 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
953
954 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
955 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
956 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
957 constructors or destructors.
958
959 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
960
9612002-04-23 Akim Demaille <akim@epita.fr>
962
963 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
964 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
965 location with columns.
966 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
967 All reported by Paul Eggert.
968
9692002-04-22 Akim Demaille <akim@epita.fr>
970
971 * src/reduce.c (dump_grammar): Move to...
972 * src/gram.h, src/gram.c (grammar_dump): here.
973 Be sure to separate long item numbers.
974 Don't read the members of a rule's prec if its nil.
975
9762002-04-22 Akim Demaille <akim@epita.fr>
977
978 * src/output.c (table_size, table_grow): New.
979 (MAXTABLE): Remove, replace uses with table_size.
980 (pack_vector): Instead of dying when the table is too big, grow it.
981
9822002-04-22 Akim Demaille <akim@epita.fr>
983
984 * data/bison.simple (yyr1): Its type is that of a token number.
985 * data/bison.c++ (r1_): Likewise.
986 * tests/regression.at (Web2c Actions): Adjust.
987
9882002-04-22 Akim Demaille <akim@epita.fr>
989
990 * src/reader.c (token_translations_init): 256 is now the default
991 value for the error token, i.e., it will be assigned another
992 number if the user assigned 256 to one of her tokens.
993 (reader): Don't force 256 to error.
994 * doc/bison.texinfo (Symbols): Adjust.
995 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
996 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
997 etc. instead of 10, 20, 30 (which was used to `jump' over error
998 (256) and undefined (2)).
999
10002002-04-22 Akim Demaille <akim@epita.fr>
1001
1002 Propagate more token_number_t.
1003
1004 * src/gram.h (token_number_as_item_number)
1005 (item_number_as_token_number): New.
1006 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1007 Use it to create output_item_number_table and
1008 output_token_number_table.
1009 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1010 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1011 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1012 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1013
10142002-04-22 Akim Demaille <akim@epita.fr>
1015
1016 * src/output.h, src/output.c (get_lines_number): Remove.
1017
10182002-04-19 Akim Demaille <akim@epita.fr>
1019
1020 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1021 as Lex/Flex'.
1022 (Debugging): More details about enabling the debugging features.
1023 (Table of Symbols): Describe $$, $n, @$, and @n.
1024 Suggested by Tim Josling.
1025
10262002-04-19 Akim Demaille <akim@epita.fr>
1027
1028 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1029
10302002-04-10 Akim Demaille <akim@epita.fr>
1031
1032 * src/system.h: Rely on HAVE_LIMITS_H.
1033 Suggested by Paul Eggert.
1034
10352002-04-09 Akim Demaille <akim@epita.fr>
1036
1037 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1038 full stderr, and strip it according to the bison options, instead
1039 of composing the error message from different bits.
1040 This makes it easier to check for several error messages.
1041 Adjust all the invocations.
1042 Add an invocation exercising the error token.
1043 Add an invocation demonstrating a stupid error message.
1044 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1045 Adjust the tests.
1046 Error message are for stderr, not stdout.
1047
10482002-04-09 Akim Demaille <akim@epita.fr>
1049
1050 * src/gram.h, src/gram.c (error_token_number): Remove, use
1051 errtoken->number.
1052 * src/reader.c (reader): Don't specify the user token number (2)
1053 for $undefined, as it uselessly prevents using it.
1054 * src/gram.h (token_number_t): Move to...
1055 * src/symtab.h: here.
1056 (state_t.number): Is a token_number_t.
1057 * src/print.c, src/reader.c: Use undeftoken->number instead of
1058 hard coded 2.
1059 (Even though this 2 is not the same as above: the number of the
1060 undeftoken remains being 2, it is its user token number which
1061 might not be 2).
1062 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1063 `user_token_number_max'.
1064 Output `undef_token_number'.
1065 * data/bison.simple, data/bison.c++: Use them.
1066 Be sure to map invalid yylex return values to
1067 `undef_token_number'. This saves us from gratuitous SEGV.
1068
1069 * tests/conflicts.at (Solved SR Conflicts)
1070 (Unresolved SR Conflicts): Adjust.
1071 * tests/regression.at (Web2c Actions): Adjust.
1072
10732002-04-08 Akim Demaille <akim@epita.fr>
1074
1075 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1076 Adding #line.
1077 Remove the duplicate `typedefs'.
1078 (RhsNumberType): Fix the declaration and various other typos.
1079 Use __ofile__.
1080 * data/bison.simple: Use __ofile__.
1081 * src/scan-skel.l: Handle __ofile__.
1082
10832002-04-08 Akim Demaille <akim@epita.fr>
1084
1085 * src/gram.h (item_number_t): New, the type of item numbers in
1086 RITEM. Note that it must be able to code symbol numbers as
1087 positive number, and the negation of rule numbers as negative
1088 numbers.
1089 Adjust all dependencies (pretty many).
1090 * src/reduce.c (rule): Remove this `short *' pointer: use
1091 item_number_t.
1092 * src/system.h (MINSHORT, MAXSHORT): Remove.
1093 Include `limits.h'.
1094 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1095 (shortcpy): Remove.
1096 (MAXTABLE): Move to...
1097 * src/output.c (MAXTABLE): here.
1098 (prepare_rules): Use output_int_table to output rhs.
1099 * data/bison.simple, data/bison.c++: Adjust.
1100 * tests/torture.at (Big triangle): Move the limit from 254 to
1101 500.
1102 * tests/regression.at (Web2c Actions): Ajust.
1103
1104 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1105 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1106 passes, but produces negative #line number, once fixed, GCC is
1107 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1108 C), it passes.
1109 * src/state.h (state_h): Code input lines on ints, not shorts.
1110
11112002-04-08 Akim Demaille <akim@epita.fr>
1112
1113 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1114 and then the grammar.
1115
11162002-04-08 Akim Demaille <akim@epita.fr>
1117
1118 * src/system.h: No longer using strndup.
1119
11202002-04-07 Akim Demaille <akim@epita.fr>
1121
1122 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1123 * src/output.c (output_table_data): Return the longest number.
1124 (prepare_tokens): Output `token_number_max').
1125 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1126 New.
1127 Use them to define yy_token_number_type/TokenNumberType.
1128 Use this type for yytranslate.
1129 * tests/torture.at (Big triangle): Push the limit from 124 to
1130 253.
1131 * tests/regression.at (Web2c Actions): Adjust.
1132
11332002-04-07 Akim Demaille <akim@epita.fr>
1134
1135 * tests/torture.at (Big triangle): New.
1136 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1137 * tests/existing.at: here.
1138
11392002-04-07 Akim Demaille <akim@epita.fr>
1140
1141 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1142 nritems.
1143 Adjust dependencies.
1144
11452002-04-07 Akim Demaille <akim@epita.fr>
1146
1147 * src/reader.c: Normalize increments to prefix form.
1148
11492002-04-07 Akim Demaille <akim@epita.fr>
1150
1151 * src/reader.c, symtab.c: Remove debugging code.
1152
11532002-04-07 Akim Demaille <akim@epita.fr>
1154
1155 Rename all the `bucket's as `symbol_t'.
1156
1157 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1158 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1159 * src/symtab.c, src/symtab.h (bucket): Rename as...
1160 (symbol_t): this.
1161 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1162 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1163 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1164 (buckets_new, buckets_free, buckets_do): Rename as...
1165 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1166 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1167 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1168 (symbols_new, symbols_free, symbols_do): these.
1169
11702002-04-07 Akim Demaille <akim@epita.fr>
1171
1172 Use lib/hash for the symbol table.
1173
1174 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1175 EOF.
1176 * src/lex.c (lex): Set the `number' member of new terminals.
1177 * src/reader.c (bucket_check_defined, bucket_make_alias)
1178 (bucket_check_alias_consistence, bucket_translation): New.
1179 (reader, grammar_free, readgram, token_translations_init)
1180 (packsymbols): Adjust.
1181 (reader): Number the predefined tokens.
1182 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1183 for predefined tokens.
1184 * src/symtab.h (bucket): Remove all the hash table related
1185 members.
1186 * src/symtab.c (symtab): Replace by...
1187 (bucket_table): this.
1188 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1189 (buckets_new, buckets_do): New.
1190
11912002-04-07 Akim Demaille <akim@epita.fr>
1192
1193 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1194 (start_symbol, max_user_token_number, semantic_parser)
1195 (error_token_number): Initialize.
1196 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1197 Initialize.
1198 (reader): Don't.
1199 (errtoken, eoftoken, undeftoken, axiom): Extern.
1200
12012002-04-07 Akim Demaille <akim@epita.fr>
1202
1203 * src/gram.h (rule_s): prec and precsym are now pointers
1204 to the bucket giving the priority/associativity.
1205 Member `associativity' removed: useless.
1206 * src/reduce.c, src/conflicts.c: Adjust.
1207
12082002-04-07 Akim Demaille <akim@epita.fr>
1209
1210 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1211 Properly escape the symbols' TAG when outputting them.
1212
12132002-04-07 Akim Demaille <akim@epita.fr>
1214
1215 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1216
12172002-04-07 Akim Demaille <akim@epita.fr>
1218
1219 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1220 (LArule): this, which is an array to rule_t*.
1221 * src/print.c, src/conflicts.c: Adjust.
1222
12232002-04-07 Akim Demaille <akim@epita.fr>
1224
1225 * src/gram.h (rule_t): Rename `number' as `user_number'.
1226 `number' is a new member.
1227 Adjust dependencies.
1228 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1229
12302002-04-07 Akim Demaille <akim@epita.fr>
1231
1232 As a result of the previous patch, it is no longer needed
1233 to reorder ritem itself.
1234
1235 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1236
12372002-04-07 Akim Demaille <akim@epita.fr>
1238
1239 Be sure never to walk through RITEMS, but use only data related to
1240 the rules themselves. RITEMS should be banished.
1241
1242 * src/output.c (output_token_translations): Rename as...
1243 (prepare_tokens): this.
1244 In addition to `translate', prepare the muscles `tname' and
1245 `toknum', which were handled by...
1246 (output_rule_data): this.
1247 Remove, and move the remainder of its outputs into...
1248 (prepare_rules): this new routines, which also merges content from
1249 (output_gram): this.
1250 (prepare_rules): Be sure never to walk through RITEMS.
1251 (output_stos): Rename as...
1252 (prepare_stos): this.
1253 (output): Always invoke prepare_states, after all, just don't use it
1254 in the output if you don't need it.
1255
12562002-04-07 Akim Demaille <akim@epita.fr>
1257
1258 * src/LR0.c (new_state): Display `nstates' as the name of the
1259 newly created state.
1260 Adjust to initialize first_state and last_state if needed.
1261 Be sure to distinguish the initial from the final state.
1262 (new_states): Create the itemset of the initial state, and use
1263 new_state.
1264 * src/closure.c (closure): Now that the initial state has its
1265 items properly set, there is no need for a special case when
1266 creating `ruleset'.
1267
1268 As a result, now the rule 0, reducing to $axiom, is visible in the
1269 outputs. Adjust the test suite.
1270
1271 * tests/conflicts.at (Solved SR Conflicts)
1272 (Unresolved SR Conflicts): Adjust.
1273 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1274 * tests/conflicts.at (S/R in initial): New.
1275
12762002-04-07 Akim Demaille <akim@epita.fr>
1277
1278 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1279 the RHS of the rules.
1280 * src/output.c (output_gram): Likewise.
1281
12822002-04-07 Akim Demaille <akim@epita.fr>
1283
1284 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1285 bucket.
1286 Adjust all dependencies.
1287 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1288 `number' of the buckets too.
1289 * src/gram.h: Include `symtab.h'.
1290 (associativity): Move to...
1291 * src/symtab.h: here.
1292 No longer include `gram.h'.
1293
12942002-04-07 Akim Demaille <akim@epita.fr>
1295
1296 * src/gram.h, src/gram.c (rules_rhs_length): New.
1297 (ritem_longest_rhs): Use it.
1298 * src/gram.h (rule_t): `number' is a new member.
1299 * src/reader.c (packgram): Set it.
1300 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1301 the end of `rules', and count them out of `nrules'.
1302 (reduce_output, dump_grammar): Adjust.
1303 * src/print.c (print_grammar): It is no longer needed to check for
1304 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1305 * tests/reduce.at (Reduced Automaton): New test.
1306
13072002-04-07 Akim Demaille <akim@epita.fr>
1308
1309 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1310 lacking `+ 1' to nrules, Bison reported as useless a token if it
1311 was used solely to set the precedence of the last rule...
1312
13132002-04-07 Akim Demaille <akim@epita.fr>
1314
1315 * data/bison.c++, data/bison.simple: Don't output the current file
1316 name in #line, to avoid useless diffs between two identical
1317 outputs under different names.
1318
13192002-04-07 Akim Demaille <akim@epita.fr>
1320
1321 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1322 Normalize loops to using `< nrules + 1', not `<= nrules'.
1323
13242002-04-07 Akim Demaille <akim@epita.fr>
1325
1326 * TODO: Update.
1327
13282002-04-07 Akim Demaille <akim@epita.fr>
1329
1330 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1331 bucket.value as bucket.number.
1332
13332002-04-07 Akim Demaille <akim@epita.fr>
1334
1335 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1336 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1337 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1338 RHS, instead of being an index in RITEMS.
1339
13402002-04-04 Paul Eggert <eggert@twinsun.com>
1341
1342 * doc/bison.texinfo: Update copyright date.
1343 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1344 (Symbols): Warn about running Bison in one character set,
1345 but compiling and/or running in an incompatible one.
1346 Warn about character code 256, too.
1347
13482002-04-03 Paul Eggert <eggert@twinsun.com>
1349
1350 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1351 YYERROR_VERBOSE is nonzero, not whether it is defined.
1352
1353 Merge changes from bison-1_29-branch.
1354
13552002-03-20 Paul Eggert <eggert@twinsun.com>
1356
1357 Merge fixes from Debian bison_1.34-1.diff.
1358
1359 * configure.in (AC_PREREQ): 2.53.
1360
13612002-03-20 Akim Demaille <akim@epita.fr>
1362
1363 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1364
13652002-03-19 Paul Eggert <eggert@twinsun.com>
1366
1367 * src/bison.simple (YYCOPY): New macro.
1368 (YYSTACK_RELOCATE): Use it.
1369 Remove Type arg; no longer needed. All callers changed.
1370 (yymemcpy): Remove; no longer needed.
1371
1372 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1373 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1374
13752002-03-19 Akim Demaille <akim@epita.fr>
1376
1377 Test and fix the #line outputs.
1378
1379 * tests/atlocal.at (GCC): New.
1380 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1381 (Prologue synch line, ,%union synch line, Postprologue synch line)
1382 (Action synch line, Epilogue synch line): New tests.
1383 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1384 * data/bison.simple, data/bison.c++: Use it.
1385
13862002-03-19 Akim Demaille <akim@epita.fr>
1387
1388 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1389 (Solved SR Conflicts, %expect not enough, %expect right)
1390 (%expect too much): Move to...
1391 * tests/conflicts.at: this new file.
1392
13932002-03-19 Akim Demaille <akim@epita.fr>
1394
1395 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1396 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1397 that we can move to enums for instance.
1398 * src/output.c (token_definitions_output): Output a list of
1399 `token-name, token-number' instead of the #define.
1400 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1401
14022002-03-14 Akim Demaille <akim@epita.fr>
1403
1404 Use Gettext 0.11.1.
1405
14062002-03-09 Robert Anisko <robert@lrde.epita.fr>
1407
1408 * data/bison.c++: Make the user able to add members to the generated
1409 parser by subclassing.
1410
14112002-03-05 Robert Anisko <robert@lrde.epita.fr>
1412
1413 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1414 a character.
1415 Reported by Nicolas Tisserand and Nicolas Burrus.
1416
14172002-03-04 Robert Anisko <robert@lrde.epita.fr>
1418
1419 * src/reader.c: Warn about lacking semi-colons, do not complain.
1420
14212002-03-04 Robert Anisko <robert@lrde.epita.fr>
1422
1423 * data/bison.c++: Remove a debug line.
1424
14252002-03-04 Robert Anisko <robert@lrde.epita.fr>
1426
1427 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1428 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1429 provide a default implementation.
1430
14312002-03-04 Akim Demaille <akim@epita.fr>
1432
1433 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1434 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1435 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1436 * tests/semantic.at (Parsing Guards): Similarly.
1437 * src/reader.at (readgram): Complain if the last rule is not ended
1438 with a semi-colon.
1439
14402002-03-04 Akim Demaille <akim@epita.fr>
1441
1442 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1443 * src/closure.c: here.
1444 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1445 RTC.
1446 * src/warshall.h, src/warshall.c: Remove.
1447 * tests/sets.at (Broken Closure): Adjust.
1448
14492002-03-04 Akim Demaille <akim@epita.fr>
1450
1451 * src/output.c (output_skeleton): tempdir is const.
1452 bytes_read is unused.
1453
14542002-03-04 Akim Demaille <akim@epita.fr>
1455
1456 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1457 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1458 Update.
1459 From Michael Hayes.
1460
14612002-03-04 Akim Demaille <akim@epita.fr>
1462
1463 * src/closure.c (closure): `r' is unused.
1464
14652002-03-04 Akim Demaille <akim@epita.fr>
1466
1467 * tests/sets.at (Broken Closure): Add the ending `;'.
1468 * src/reader.at (readgram): Complain if a rule is not ended with a
1469 semi-colon.
1470
14712002-03-04 Akim Demaille <akim@epita.fr>
1472
1473 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1474 (count_sr_conflicts): Use bitset_count.
1475 * src/reduce.c (inaccessable_symbols): Ditto.
1476 (bits_size): Remove.
1477 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1478
14792002-03-04 Akim Demaille <akim@epita.fr>
1480
1481 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1482 * src/reduce.c: Remove the `bitset_zero's following the
1483 `bitset_create's, as now it is performed by the latter.
1484
14852002-03-04 Akim Demaille <akim@epita.fr>
1486
1487 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1488 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1489 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1490 latest sources from Michael.
1491
14922002-03-04 Akim Demaille <akim@epita.fr>
1493
1494 * src/output.c (output): Don't free the grammar.
1495 * src/reader.c (grammar_free): New.
1496 * src/main.c (main): Call it and don't free symtab here.
1497
14982002-03-04 Akim Demaille <akim@epita.fr>
1499
1500 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1501 before returning.
1502 Reported by Benoit Perrot.
1503
15042002-03-04 Akim Demaille <akim@epita.fr>
1505
1506 Use bitset operations when possible, not loops over bits.
1507
1508 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1509 bitset_or.
1510 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1511 * src/reduce.c (useless_nonterminals): Formatting changes.
1512 * src/warshall.c (TC): Use bitset_or.
1513
15142002-03-04 Akim Demaille <akim@epita.fr>
1515
1516 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1517 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1518 Ditto.
1519
15202002-03-04 Akim Demaille <akim@epita.fr>
1521
1522 * src/lalr.c (F): Now a bitset*.
1523 Adjust all dependencies.
1524
15252002-03-04 Akim Demaille <akim@epita.fr>
1526
1527 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1528 Adjust all dependencies.
1529
15302002-03-04 Akim Demaille <akim@epita.fr>
1531
1532 * src/L0.c, src/LR0.h (nstates): Be size_t.
1533 Adjust comparisons (signed vs unsigned).
1534 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1535 bitset*.
1536 Adjust all dependencies.
1537
15382002-03-04 Akim Demaille <akim@epita.fr>
1539
1540 * src/closure.c (firsts): Now, also a bitset.
1541 Adjust all dependencies.
1542 (varsetsize): Remove, now unused.
1543 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1544
15452002-03-04 Akim Demaille <akim@epita.fr>
1546
1547 * src/print.c: Convert to use bitset.h, not hand coded iterations
1548 over ints.
1549
15502002-03-04 Akim Demaille <akim@epita.fr>
1551
1552 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1553
15542002-03-04 Akim Demaille <akim@epita.fr>
1555
1556 * src/closure.c (ruleset): Be a bitset.
1557 (rulesetsize): Remove.
1558
15592002-03-04 Akim Demaille <akim@epita.fr>
1560
1561 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1562 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1563 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1564 * src/closure.c (fderives): Be an array of bitsets.
1565
15662002-02-28 Robert Anisko <robert@lrde.epita.fr>
1567
1568 * data/bison.c++: Merge the two generated headers. Insert a copyright
1569 notice in each output file.
1570
15712002-02-28 Akim Demaille <akim@epita.fr>
1572
1573 * data/bison.c++: Copy the prologue of bison.simple to fetch
1574 useful M4 definitions, such as b4_header_guard.
1575
15762002-02-25 Akim Demaille <akim@epita.fr>
1577
1578 * src/getargs.c (version): Give the name of the authors, and use a
1579 translator friendly scheme for the bgr
1580 copyright notice.
1581
15822002-02-25 Akim Demaille <akim@epita.fr>
1583
1584 * src/output.c (header_output): Remove, now handled completely via
1585 M4.
1586
15872002-02-25 Akim Demaille <akim@epita.fr>
1588
1589 * m4/m4.m4: New, from CVS Autoconf.
1590 * configure.in: Invoke it.
1591 * src/output.c (output_skeleton): Use its result instead of the
1592 hard coded name.
1593
15942002-02-25 Akim Demaille <akim@epita.fr>
1595
1596 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1597 Fileutils 4.1.5.
1598 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1599 * src/output.c (output_skeleton): Use mkstemp to create a real
1600 temporary file.
1601 Move the filling of `skeleton' and its muscle to...
1602 (prepare): here.
1603 (output): Move the definition of the prologue muscle to...
1604 (prepare): here.
1605 * src/system.h (DEFAULT_TMPDIR): New.
1606
16072002-02-14 Paul Eggert <eggert@twinsun.com>
1608
1609 Remove the support for C++ namespace cleanliness; it was
1610 causing more problems than it was curing, since it didn't work
1611 properly on some nonstandard C++ compilers. This can wait
1612 for a proper C++ parser.
1613
1614 * NEWS: Document this.
1615 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1616 of C++, as it's treated like C now.
1617 * src/bison.simple (YYSTD): Remove.
1618 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1619 Treat C++ just like Standard C instead of trying to support
1620 namespace cleanliness.
1621
16222002-02-14 Akim Demaille <akim@epita.fr>
1623
1624 * tests/regression.at (else): Adjust to Andreas' change.
1625
16262002-02-14 Akim Demaille <akim@epita.fr>
1627
1628 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1629
16302002-02-13 Andreas Schwab <schwab@suse.de>
1631
1632 * src/output.c (output_rule_data): Don't output NULL, it might
1633 not be defined yet.
1634
16352002-02-11 Robert Anisko <robert@lrde.epita.fr>
1636
1637 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
1638 (Copyright notice): Update.
1639
16402002-02-11 Akim Demaille <akim@epita.fr>
1641
1642 * tests/regression.at (%nonassoc and eof): Don't include
1643 nonportable headers.
1644
16452002-02-08 Robert Anisko <robert@lrde.epita.fr>
1646
1647 * data/bison.c++: Correct error recovery. Make the user able to
1648 initialize the starting location.
1649
16502002-02-07 Akim Demaille <akim@epita.fr>
1651
1652 * tests/input.at: New.
1653
16542002-02-07 Robert Anisko <robert@lrde.epita.fr>
1655
1656 * data/bison.c++: Replace some direct m4 expansions by constants. Be
1657 more consistent when naming methods and variables. Put preprocessor
1658 directives around tables only needed for debugging.
1659
16602002-02-07 Robert Anisko <robert@lrde.epita.fr>
1661
1662 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1663 C++ parsers.
1664 (yy::b4_name::parse): Use print_.
1665
16662002-02-07 Robert Anisko <robert@lrde.epita.fr>
1667
1668 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1669
16702002-02-07 Robert Anisko <robert@lrde.epita.fr>
1671
1672 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1673 C++ parsers.
1674 (yy::b4_name::parse): Build verbose error messages, and use error_.
1675
16762002-02-06 Robert Anisko <robert@lrde.epita.fr>
1677
1678 * data/bison.c++: Fix m4 quoting in comments.
1679
16802002-02-06 Robert Anisko <robert@lrde.epita.fr>
1681
1682 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1683 not expanded by m4.
1684
16852002-02-05 Akim Demaille <akim@epita.fr>
1686
1687 * data/bison.c++: Adjust to the M4 back end.
1688 More is certainly needed.
1689
16902002-02-05 Akim Demaille <akim@epita.fr>
1691
1692 Give a try to M4 as a back end.
1693
1694 * lib/readpipe.c: New, from wdiff.
1695 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1696 BISON_HAIRY.
1697 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1698 specific values. Now it is m4 that performs the lookup.
1699 * src/parse-skel.y: Remove.
1700 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1701 * src/output.c (actions_output, guards_output)
1702 (token_definitions_output): No longer keeps track of the output
1703 line number, hence remove the second argument.
1704 (guards_output): Check against the guard member of a rule, not the
1705 action member.
1706 Adjust callers.
1707 (output_skeleton): Don't look for the skeleton location, let m4 do
1708 that.
1709 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1710 file will be used.
1711 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1712 (prepare): Given that for the time being changesyntax is not
1713 usable in M4, rename the muscles using `-' to `_'.
1714 Define `defines_flag', `output_parser_name' and `output_header_name'.
1715 * src/output.h (actions_output, guards_output)
1716 (token_definitions_output): Adjust prototypes.
1717 * src/scan-skel.l: Instead of scanning the skeletons, it now
1718 processes the output of m4: `__oline__' and `#output'.
1719 * data/bison.simple: Adjust to be used by M4(sugar).
1720 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1721 to date.
1722 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1723 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1724 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1725 shamelessly stolen from CVS Autoconf.
1726
17272002-02-05 Akim Demaille <akim@epita.fr>
1728
1729 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1730 * configure.in: Check for the declarations of free and malloc.
1731 * src/muscle_tab.c: Adjust.
1732
17332002-02-05 Akim Demaille <akim@epita.fr>
1734
1735 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1736 which have no values.
1737
17382002-02-05 Akim Demaille <akim@epita.fr>
1739
1740 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1741 * data/: here.
1742
17432002-01-29 Paul Eggert <eggert@twinsun.com>
1744
1745 * src/bison.simple (YYSIZE_T): Do not define merely because
1746 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1747 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1748
17492002-01-27 Akim Demaille <akim@epita.fr>
1750
1751 Fix `%nonassoc and eof'.
1752
1753 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1754 which were not properly copied! Replace
1755 memcpy (res->errs, src->errs, src->nerrs);
1756 with
1757 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
1758 !!!
1759 * tests/regression.at (%nonassoc and eof): Adjust to newest
1760 Autotest: `.' is not in the PATH.
1761
17622002-01-27 Akim Demaille <akim@epita.fr>
1763
1764 * tests/sets.at (AT_EXTRACT_SETS): New.
1765 (Nullable): Use it.
1766 (Firsts): New.
1767
17682002-01-26 Akim Demaille <akim@epita.fr>
1769
1770 * tests/actions.at, tests/calc.at, tests/headers.at,
1771 * tests/torture.at: Adjust to the newest Autotest which no longer
1772 forces `.' in the PATH.
1773
17742002-01-25 Akim Demaille <akim@epita.fr>
1775
1776 * tests/regression.at (%nonassoc and eof): New.
1777 Suggested by Robert Anisko.
1778
17792002-01-24 Akim Demaille <akim@epita.fr>
1780
1781 Bison dumps core when trying to complain about broken input files.
1782 Reported by Cris van Pelt.
1783
1784 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
1785 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
1786 into...
1787 (Invalid inputs): Strengthen: exercise parse_percent_token.
1788
17892002-01-24 Robert Anisko <robert.anisko@epita.fr>
1790
1791 * src/Makefile.am: Add bison.c++.
1792 * src/bison.c++: New skeleton.
1793
17942002-01-21 Paolo Bonzini <bonzini@gnu.org>
1795
1796 * po/it.po: New.
1797
17982002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
1799
1800 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
1801
18022002-01-20 Marc Autret <marc@gnu.org>
1803
1804 * src/files.c (compute_output_file_names): Fix
1805
18062002-01-20 Marc Autret <marc@gnu.org>
1807
1808 * tests/output.at: New test.
1809 * src/files.c (compute_base_names): Don't map extensions when
1810 the YACC flag is set, use defaults.
1811 Reported by Evgeny Stambulchik.
1812
18132002-01-20 Marc Autret <marc@gnu.org>
1814
1815 * src/system.h: Need to define __attribute__ away for non-GCC
1816 compilers as well (i.e. the vendor C compiler).
1817 Suggested by Albert Chin-A-Young.
1818
18192002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
1820
1821 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
1822 canonical definition.
1823 * src/system.h: Use the canonical definition for PARAMS (avoids
1824 a conflict with the macro from lib/hash.h).
1825
18262002-01-11 Akim Demaille <akim@epita.fr>
1827
1828 * configure.in: Use AC_FUNC_STRNLEN.
1829 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
1830
18312002-01-09 Akim Demaille <akim@epita.fr>
1832
1833 * src/files.c, src/files.h (output_infix): New.
1834 (tab_extension): Remove.
1835 (compute_base_names): Compute the former, drop the latter.
1836 * src/output.c (prepare): Insert the muscles `output-infix', and
1837 `output-suffix'.
1838 * src/parse-skel.y (string, string.1): New.
1839 (section.header): Use it.
1840 (section.yacc): Remove.
1841 (prefix): Remove too.
1842 * src/scan-skel.l: Adjust.
1843 * src/bison.simple, src/bison.hairy: Adjust.
1844
18452002-01-09 Akim Demaille <akim@epita.fr>
1846
1847 * configure.in (WERROR_CFLAGS): Compute it.
1848 * src/Makefile.am (CFLAGS): Pass it.
1849 * tests/atlocal.in (CFLAGS): Idem.
1850 * src/files.c: Fix a few warnings.
1851 (get_extension_index): Remove, unused.
1852
18532002-01-08 Akim Demaille <akim@epita.fr>
1854
1855 * src/getargs.c (AS_FILE_NAME): New.
1856 (getargs): Use it to convert DOSish file names.
1857 * src/files.c (base_name): Rename as full_base_name to avoid
1858 clashes with `base_name ()'.
1859 (filename_split): New.
1860 (compute_base_names): N-th rewrite, using filename_split.
1861
18622002-01-08 Akim Demaille <akim@epita.fr>
1863
1864 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
1865 New, stolen from the Fileutils 4.1.
1866 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
1867 * configure.in: Check for the presence of memrchr, and of its
1868 prototype.
1869
18702002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
1871
1872 * lib/hash.h (__P): Added definition for this macro.
1873 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1874 BUILT_SOURCES, to ensure they are generated first.
1875 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1876 %error-verbose to allow bootstrapping with bison 1.30x.
1877
18782002-01-06 Akim Demaille <akim@epita.fr>
1879
1880 * src/reader.c (parse_braces): Don't fetch the next char, the
1881 convention is to fetch on entry.
1882 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1883 'switch' without a following semicolon.
1884 * tests/regression.at (braces parsing): New.
1885
18862002-01-06 Akim Demaille <akim@epita.fr>
1887
1888 Bison is dead wrong in its RR conflict reports.
1889
1890 * tests/torture.at (GNU Cim Grammar): New.
1891 * src/conflicts.c (count_rr_conflicts): Fix.
1892
18932002-01-06 Akim Demaille <akim@epita.fr>
1894
1895 Creating package.m4 from configure.ac causes too many problems.
1896
1897 * tests/Makefile.am (package.m4): Create it by hand,
1898 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1899
19002002-01-06 Akim Demaille <akim@epita.fr>
1901
1902 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1903 skeleton.h.
1904
19052002-01-04 Paul Eggert <eggert@twinsun.com>
1906
1907 * doc/bison.texinfo (Debugging):
1908 Remove YYSTDERR; it's no longer defined or used.
1909 Also, s/cstdio.h/cstdio/.
1910
19112002-01-03 Akim Demaille <akim@epita.fr>
1912
1913 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1914
19152002-01-03 Akim Demaille <akim@epita.fr>
1916
1917 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1918 tracing code to --trace, wait for a better --trace option, with
1919 args.
1920
19212002-01-03 Akim Demaille <akim@epita.fr>
1922
1923 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1924 The ISO C++ standard is extremely clear about it: stderr is
1925 considered a macro, not a regular symbol (see table 94 `Header
1926 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1927 Therefore std:: does not apply to it. It still does with fprintf.
1928 Also, s/cstdio.h/cstdio/.
1929
19302002-01-03 Akim Demaille <akim@epita.fr>
1931
1932 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1933 for non system headers.
1934
19352002-01-02 Akim Demaille <akim@epita.fr>
1936
1937 Equip the skeleton chain with location tracking, runtime trace,
1938 pure parser and scanner.
1939
1940 * src/parse-skel.y: Request a pure parser, locations, and prefix
1941 renaming.
1942 (%union): Having several members with the same type does not help
1943 type mismatches, simplify.
1944 (YYPRINT, yyprint): New.
1945 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1946 (skel_error): this.
1947 Handle locations.
1948 * src/scan-skel.l: Adjust to these changes.
1949 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1950 (LOCATION_PRINT, skel_control_t): New.
1951
19522001-12-30 Akim Demaille <akim@epita.fr>
1953
1954 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1955 replace `gb' with BLANKS.
1956 * src/scan-skel.l: Adjust.
1957
19582001-12-30 Akim Demaille <akim@epita.fr>
1959
1960 * src/system.h: We don't need nor want bcopy.
1961 Throw away MS-DOS crap: we don't need getpid.
1962 * configure.in: We don't need strndup. It was even causing
1963 problems: because Flex includes the headers *before* us,
1964 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1965 not visible.
1966 * lib/xstrndup.c: New.
1967 * src/scan-skel.l: Use it.
1968 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1969 * src/parse-skel.y: Use %directives instead of #defines.
1970
19712001-12-30 Akim Demaille <akim@epita.fr>
1972
1973 * src/skeleton.h: New.
1974 * src/output.c (output_parser, output_master_parser): Remove, dead
1975 code.
1976 * src/output.h (get_lines_number, actions_output, guards_output)
1977 (token_definitions_output): Prototype them.
1978 * src/parse-skel.y: Add the license notice.
1979 Include output.h and skeleton.h.
1980 (process_skeleton): Returns void, and takes a single parameter.
1981 * src/scan-skel.l: Add the license notice.
1982 Include skeleton.h.
1983 Don't use %option yylineno: it seems that then Flex imagines
1984 REJECT has been used, and therefore it won't reallocate its
1985 buffers (which makes no other sense to me than a bug). It results
1986 in warnings for `unused: yy_flex_realloc'.
1987
19882001-12-30 Robert Anisko <robert.anisko@epita.fr>
1989
1990 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1991 (MUSCLE_INSERT_PREFIX): ...to there.
1992 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1993 (MUSCLE_INSERT_PREFIX): Move from here...
1994
1995 * src/bison.hairy: Add a section directive. Put braces around muscle
1996 names. This parser skeleton is still broken, but Bison should not
1997 choke on a bad muscle 'syntax'.
1998 * src/bison.simple: Add a section directive. Put braces around muscle
1999 names.
2000
2001 * src/files.h (strsuffix, stringappend): Add declarations.
2002 (tab_extension): Add declaration.
2003 (short_base_name): Add declaration.
2004
2005 * src/files.c (strsuffix, stringappend): No longer static. These
2006 functions are used in the skeleton parser.
2007 (tab_extension): New.
2008 (compute_base_names): Use the computations done in this function
2009 to guess if the generated parsers should have '.tab' in their
2010 names.
2011 (short_base_name): No longer static.
2012
2013 * src/output.c (output_skeleton): New.
2014 (output): Disable call to output_master_parser, and give a try to
2015 a new skeleton handling system.
2016 (guards_output, actions_output): No longer static.
2017 (token_definitions_output, get_lines_number): No longer static.
2018
2019 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2020
2021 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
2022 parse-skel.y.
2023
2024 * src/parse-skel.y: New file.
2025 * src/scan-skel.l: New file.
2026
20272001-12-29 Akim Demaille <akim@epita.fr>
2028
2029 %name-prefix is broken.
2030
2031 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2032 Adjust all dependencies.
2033 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2034 %name-prefix.
2035
2036 Renaming yylval but not yylloc is not consistent. Now we do.
2037
2038 * src/bison.simple: Prefix yylloc if used.
2039 * doc/bison.texinfo (Decl Summary): Document that.
2040
20412001-12-29 Akim Demaille <akim@epita.fr>
2042
2043 * doc/bison.texinfo: Promote `%long-directive' over
2044 `%long_directive'.
2045 Remove all references to fixed-output-files, yacc is enough.
2046
20472001-12-29 Akim Demaille <akim@epita.fr>
2048
2049 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2050 user prologue. These are defaults.
2051 * tests/actions.at (Mid-rule actions): Make sure the user can
2052 define YYDEBUG and YYERROR_VERBOSE.
2053
20542001-12-29 Akim Demaille <akim@epita.fr>
2055
2056 * src/output.c (header_output): Don't forget to export YYLTYPE and
2057 yylloc.
2058 * tests/headers.at (export YYLTYPE): New, make sure it does.
2059 * tests/regression.at (%union and --defines, Invalid CPP headers):
2060 Move to...
2061 * tests/headers.at: here.
2062
20632001-12-29 Akim Demaille <akim@epita.fr>
2064
2065 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2066
20672001-12-29 Akim Demaille <akim@epita.fr>
2068
2069 * tests/actions.at (Mid-rule actions): Output on a single line
2070 instead of several.
2071
20722001-12-29 Akim Demaille <akim@epita.fr>
2073
2074 * doc/bison.texinfo: Formatting changes.
2075
20762001-12-29 Akim Demaille <akim@epita.fr>
2077
2078 Don't store the token defs in a muscle, just be ready to output it
2079 on command. Now possible via `symbols'. Fixes a memory leak.
2080
2081 * src/output.c (token_definitions_output): New.
2082 (output_parser, header_output): Use it.
2083 * src/reader.c (symbols_save): Remove.
2084
20852001-12-29 Akim Demaille <akim@epita.fr>
2086
2087 * src/bison.simple: Do not provide a default for YYSTYPE and
2088 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2089 default.
2090
20912001-12-29 Akim Demaille <akim@epita.fr>
2092
2093 Mid-rule actions are simply... ignored!
2094
2095 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2096 the empty-rule associated to the dummy symbol, not to the host
2097 rule.
2098 * tests/actions.at (Mid-rule actions): New.
2099
21002001-12-29 Akim Demaille <akim@epita.fr>
2101
2102 Memory leak.
2103
2104 * src/reader.c (reader): Free grammar.
2105
21062001-12-29 Akim Demaille <akim@epita.fr>
2107
2108 Memory leak.
2109
2110 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2111 since it allocates it for each state, although only one is needed.
2112 (allocate_storage): Do it here.
2113
21142001-12-29 Akim Demaille <akim@epita.fr>
2115
2116 * src/options.h, src/options.c (create_long_option_table): Rename
2117 as...
2118 (long_option_table_new): this, with a clearer prototype.
2119 (percent_table): Remove, unused,
2120 * src/getargs.c (getargs): Adjust.
2121
21222001-12-29 Akim Demaille <akim@epita.fr>
2123
2124 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2125 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2126 as states.
2127
21282001-12-29 Akim Demaille <akim@epita.fr>
2129
2130 * src/lalr.c (build_relations): Rename `states' as `states1'.
2131 Sorry, I don't understand exactly what it is, no better name...
2132
21332001-12-29 Akim Demaille <akim@epita.fr>
2134
2135 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2136 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2137 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2138 as rules.
2139
21402001-12-29 Akim Demaille <akim@epita.fr>
2141
2142 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2143 ago.
2144
21452001-12-29 Akim Demaille <akim@epita.fr>
2146
2147 * src/reader.c, src/reader.h (user_toknums): Remove.
2148 Adjust all users to use symbols[i]->user_token_number.
2149
21502001-12-29 Akim Demaille <akim@epita.fr>
2151
2152 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2153 Adjust all users to use symbols[i]->prec or ->assoc.
2154
21552001-12-29 Akim Demaille <akim@epita.fr>
2156
2157 * src/reader.c, src/reader.h (tags): Remove.
2158 Adjust all users to use symbols[i]->tag.
2159
21602001-12-29 Akim Demaille <akim@epita.fr>
2161
2162 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2163 and rule_table.
2164 * src/reader.c (packsymbols): Fill this table.
2165 Drop sprec.
2166 * src/conflicts.c (resolve_sr_conflict): Adjust.
2167 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2168 single table.
2169 Use symbols[i]->tag instead of tags[i].
2170
21712001-12-29 Akim Demaille <akim@epita.fr>
2172
2173 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2174 In addition, put a comment in there, to replace...
2175 * tests/regression.at (%union and C comments): Remove.
2176
21772001-12-29 Akim Demaille <akim@epita.fr>
2178
2179 * tests/regression.at (Web2c Actions): Blindly move the actual
2180 output as expected output. The contents *seem* right to me, but I
2181 can't pretend reading perfectly parser tables... Nonetheless, all
2182 the other tests pass correctly, the table look OK, even though the
2183 presence of `$axiom' is to be noted: AFAICS it is useless (but
2184 harmless).
2185
21862001-12-29 Akim Demaille <akim@epita.fr>
2187
2188 * src/reader.c (readgram): Don't add the rule 0 if there were no
2189 rules read. In other words, add it _after_ having performed
2190 grammar sanity checks.
2191 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2192
21932001-12-29 Akim Demaille <akim@epita.fr>
2194
2195 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2196 visible, and some states have now a different number.
2197
21982001-12-29 Akim Demaille <akim@epita.fr>
2199
2200 * src/reader.c (readgram): Bind the initial rule's lineno to that
2201 of the first rule.
2202 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2203 (Solved SR Conflicts): Adjust rule 0's line number.
2204
22052001-12-29 Akim Demaille <akim@epita.fr>
2206
2207 Fix the `GAWK Grammar' failure.
2208
2209 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2210 the reductions of the first state which was mistakenly confused
2211 with the final state because precisely final_state was initialized
2212 to 0.
2213 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2214 now noticed by Bison.
2215 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2216 have a reduction on $default.
2217
22182001-12-29 Akim Demaille <akim@epita.fr>
2219
2220 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2221 rule line numbers.
2222 * src/closure.c (print_closure): Likewise.
2223 * src/derives.c (print_derives): Likewise.
2224 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2225 now.
2226
22272001-12-29 Akim Demaille <akim@epita.fr>
2228
2229 * src/lalr.c (lookaheads_print): New.
2230 (lalr): Call it when --trace-flag.
2231 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2232 are dumped.
2233
22342001-12-29 Akim Demaille <akim@epita.fr>
2235
2236 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2237 when walking through ritem, even via rule->rhs.
2238 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2239 (useful_production, useless_nonterminals): Likewise.
2240 (reduce_grammar_tables): Likewise, plus update nritems.
2241 * src/nullable.c (set_nullable): Likewise.
2242 * src/lalr.c (build_relations): Likewise.
2243 * tests/sets.at (Nullable): Adjust.
2244 Fortunately, now, the $axiom is no longer nullable.
2245
22462001-12-29 Akim Demaille <akim@epita.fr>
2247
2248 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2249 the 0-sentinel.
2250 * src/gram.c (ritem_longest_rhs): Likewise.
2251 * src/reduce.c (nonterminals_reduce): Likewise.
2252 * src/print_graph.c (print_graph): Likewise.
2253 * src/output.c (output_rule_data): Likewise.
2254 * src/nullable.c (set_nullable): Likewise.
2255
22562001-12-29 Akim Demaille <akim@epita.fr>
2257
2258 * src/output.c: Comment changes.
2259
22602001-12-27 Paul Eggert <eggert@twinsun.com>
2261
2262 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2263 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2264 Sparc, as they were causing more porting problems than the
2265 (minor) performance improvement was worth.
2266
2267 Also, catch up with 1.31's YYSTD.
2268
22692001-12-27 Akim Demaille <akim@epita.fr>
2270
2271 * src/output.c (output_gram): Rely on nritems, not the
2272 0-sentinel. See below.
2273 Use -1 as separator, not 0.
2274 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2275 Rely on -1 as separator in yyrhs, instead of 0.
2276 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2277 twice `Now at end of input', therefore there are two lines less to
2278 expect.
2279
22802001-12-27 Akim Demaille <akim@epita.fr>
2281
2282 * tests/regression.at (Unresolved SR Conflicts):
2283 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2284 below.
2285
22862001-12-27 Akim Demaille <akim@epita.fr>
2287
2288 * src/LR0.c (new_state): Recognize the final state by the fact it
2289 is reached by eoftoken.
2290 (insert_start_shifting_state, insert_eof_shifting_state)
2291 (insert_accepting_state, augment_automaton): Remove, since now
2292 these states are automatically computed from the initial state.
2293 (generate_states): Adjust.
2294 * src/print.c: When reporting a rule number to the user, substract
2295 1, so that the axiom rule is rule 0, and the first user rule is 1.
2296 * src/reduce.c: Likewise.
2297 * src/print_graph.c (print_core): For the time being, just as for
2298 the report, depend upon --trace-flags to dump the full set of
2299 items.
2300 * src/reader.c (readgram): Once the grammar read, insert the rule
2301 0: `$axiom: START-SYMBOL $'.
2302 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2303 number of the states has changed (the final state is no longer
2304 necessarily the last), catch up.
2305
23062001-12-27 Akim Demaille <akim@epita.fr>
2307
2308 Try to make the use of the eoftoken valid. Given that its value
2309 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2310 is used instead of > 0 where appropriate, (ii), depend upon nritems
2311 instead of the 0-sentinel.
2312
2313 * src/gram.h, src/gram.c (nritems): New.
2314 Expected to be duplication of nitems, but for the time being...
2315 * src/reader.c (packgram): Assert nritems and nitems are equal.
2316 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2317 * src/closure.c (print_closure, print_fderives): Likewise.
2318 * src/gram.c (ritem_print): Likewise.
2319 * src/print.c (print_core, print_grammar): Likewise.
2320 * src/print_graph.c: Likewise.
2321
23222001-12-27 Akim Demaille <akim@epita.fr>
2323
2324 * src/main.c (main): If there are complains after grammar
2325 reductions, then output the report anyway if requested, then die.
2326 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2327 * src/reader.c (eoftoken): New.
2328 (parse_token_decl): If the token being defined has value `0', it
2329 is the eoftoken.
2330 (packsymbols): No longer hack `tags' to insert `$' by hand.
2331 Be sure to preserve the value of the eoftoken.
2332 (reader): Make sure eoftoken is defined.
2333 Initialize nsyms to 0: now eoftoken is created just like the others.
2334 * src/print.c (print_grammar): Don't special case the eof token.
2335 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2336 lie anyway, albeit pleasant.
2337 * tests/calc.at: Exercise error messages with eoftoken.
2338 Change the grammar so that empty input is invalid.
2339 Adjust expectations.
2340 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2341
23422001-12-27 Akim Demaille <akim@epita.fr>
2343
2344 * configure.in: Check the protos of strchr ans strspn.
2345 Replace strchr if needed.
2346 * src/system.h: Provide the protos of strchr, strspn and memchr if
2347 missing.
2348 * lib/strchr.c: New.
2349 * src/reader.c (symbols_save): Use strchr.
2350
23512001-12-27 Akim Demaille <akim@epita.fr>
2352
2353 * src/print.c, src/print_graph.c (escape): New.
2354 Use it to quote the TAGS outputs.
2355 * src/print_graph.c (print_state): Now errors are in red, and
2356 reductions in green.
2357 Prefer high to wide: output the state number on a line of its own.
2358
23592001-12-27 Akim Demaille <akim@epita.fr>
2360
2361 * src/state.h, src/state.c (reductions_new): New.
2362 * src/LR0.c (set_state_table): Let all the states have a
2363 `reductions', even if reduced to 0.
2364 (save_reductions): Adjust.
2365 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2366 * src/print.c (print_reductions, print_actions): Adjust.
2367 * src/output.c (action_row): Adjust.
2368
23692001-12-27 Akim Demaille <akim@epita.fr>
2370
2371 * src/state.h, src/state.c (errs_new, errs_dup): New.
2372 * src/LR0.c (set_state_table): Let all the states have an errs,
2373 even if reduced to 0.
2374 * src/print.c (print_errs, print_reductions): Adjust.
2375 * src/output.c (output_actions, action_row): Adjust.
2376 * src/conflicts.c (resolve_sr_conflict): Adjust.
2377
23782001-12-27 Akim Demaille <akim@epita.fr>
2379
2380 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2381
23822001-12-27 Akim Demaille <akim@epita.fr>
2383
2384 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2385 * src/print.c: here.
2386 (lookaheadset, shiftset): New, used as additional storage by
2387 print_reductions.
2388 (print_results): Adjust.
2389 (print_shifts, print_gotos, print_errs): New, extracted from...
2390 (print_actions): here.
2391 * src/print_graph.c (print_actions): Remove dead code.
2392
23932001-12-27 Akim Demaille <akim@epita.fr>
2394
2395 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2396 `$n' and `@n'.
2397
23982001-12-27 Akim Demaille <akim@epita.fr>
2399
2400 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2401 (build_relations): Adjust.
2402
24032001-12-27 Akim Demaille <akim@epita.fr>
2404
2405 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2406 duplication.
2407
24082001-12-27 Akim Demaille <akim@epita.fr>
2409
2410 * src/reader.c (packgram): Catch nitems overflows.
2411
24122001-12-27 Akim Demaille <akim@epita.fr>
2413
2414 * src/files.c, src/files.h (guard_obstack): Remove.
2415 * src/output.c (output): Adjust.
2416 * src/reader.c (parse_braces): New, factoring...
2417 (copy_action, copy_guard): these two which are renamed as...
2418 (parse_action, parse_guard): these.
2419 As a voluntary consequence, using braces around guards is now
2420 mandatory.
2421
24222001-12-27 Akim Demaille <akim@epita.fr>
2423
2424 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2425 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2426 members.
2427 (symbol_list_new): Adjust.
2428 (copy_action): action_line is the first line, not the last.
2429 (copy_guard): Just as for actions, store the `action' only, not
2430 the switch/case/break flesh.
2431 Don't parse the user action that might follow the guard, let...
2432 (readgram): do it, i.e., now, there can be an action after a
2433 guard.
2434 In other words the guard is just explicitly optional.
2435 (packgram): Adjust.
2436 * src/output.c (guards_output): New.
2437 (output_parser): Call it when needed.
2438 (output): Also free the guard and attrs obstacks.
2439 * src/files.c, src/files.h (obstack_save): Remove.
2440 (output_files): Remove.
2441 As a result, if one needs the former `.act' file, using an
2442 appropriate skeleton which requires actions and guards is now
2443 required.
2444 * src/main.c (main): Adjust.
2445 * tests/semantic.at: New.
2446 * tests/regression.at: Use `input.y' as input file name.
2447 Avoid 8+3 problems by requiring input.c when the test needs the
2448 parser.
2449
24502001-12-27 Akim Demaille <akim@epita.fr>
2451
2452 * src/reader.c (symbol_list_new): Be sure to initialize all the
2453 fields.
2454
24552001-12-27 Akim Demaille <akim@epita.fr>
2456
2457 All the hacks using a final pseudo state are now useless.
2458
2459 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2460 * src/lalr.c (nLA): New.
2461 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2462 instead of lookaheadsp from the pseudo state (nstate + 1).
2463
24642001-12-27 Akim Demaille <akim@epita.fr>
2465
2466 * src/output.c (action_row, token_actions): Use a state_t instead
2467 of a integer, and nlookaheads instead of the following state's
2468 lookaheadsp.
2469
24702001-12-27 Akim Demaille <akim@epita.fr>
2471
2472 * src/conflicts.c (log_resolution, flush_shift)
2473 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2474 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2475 (conflicts_print, print_reductions): Use a state_t instead of an
2476 integer when referring to a state.
2477 As much as possible, depend upon nlookaheads, instead of the
2478 `lookaheadsp' member of the following state (since lookaheads of
2479 successive states are successive, the difference between state n + 1
2480 and n served as the number of lookaheads for state n).
2481 * src/lalr.c (add_lookback_edge): Likewise.
2482 * src/print.c (print_core, print_actions, print_state)
2483 (print_results): Likewise.
2484 * src/print_graph.c (print_core, print_actions, print_state)
2485 (print_graph): Likewise.
2486 * src/conflicts.h: Adjust.
2487
24882001-12-27 Akim Demaille <akim@epita.fr>
2489
2490 * src/bison.hairy: Formatting/comment changes.
2491 ANSIfy.
2492 Remove `register' indications.
2493 Add plenty of `static'.
2494
24952001-12-27 Akim Demaille <akim@epita.fr>
2496
2497 * src/output.c (prepare): Drop the muscle `ntbase' which
2498 duplicates ntokens.
2499 * src/bison.simple: Formatting/comment changes.
2500 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2501 is an undocumented synonym.
2502
25032001-12-22 Akim Demaille <akim@epita.fr>
2504
2505 * src/output.c (output_table_data): Change the prototype to use
2506 `int' for array ranges: some invocations do pass an int, not a
2507 short.
2508 Reported by Wayne Green.
2509
25102001-12-22 Akim Demaille <akim@epita.fr>
2511
2512 Some actions of web2c.y are improperly triggered.
2513 Reported by Mike Castle.
2514
2515 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2516 * tests/regression.at (Web2c): Rename as...
2517 (Web2c Report): this.
2518 (Web2c Actions): New.
2519
25202001-12-22 Akim Demaille <akim@epita.fr>
2521
2522 Reductions in web2c.y are improperly reported.
2523 Reported by Mike Castle.
2524
2525 * src/conflicts.c (print_reductions): Fix.
2526 * tests/regression.at (Web2c): New.
2527
25282001-12-18 Akim Demaille <akim@epita.fr>
2529
2530 Some host fail on `assert (!"foo")', which expands to
2531 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2532 Reported by Nelson Beebee.
2533
2534 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2535 `#define it_succeeded 0' and `assert (it_succeeded)'.
2536
25372001-12-17 Marc Autret <autret_m@epita.fr>
2538
2539 * src/bison.simple: Don't hard code the skeleton line and filename.
2540 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2541 New line counter 'skeleton_line' (skeleton-line muscle).
2542
25432001-12-17 Paul Eggert <eggert@twinsun.com>
2544
2545 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2546 YYDEBUG must be defined to a nonzero value.
2547
2548 * src/bison.simple (yytname): Do not assume that the user defines
2549 YYDEBUG to a properly parenthesized expression.
2550
25512001-12-17 Akim Demaille <akim@epita.fr>
2552
2553 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2554 nlookaheads is a new member.
2555 Adjust all users.
2556 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2557 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2558 state.
2559
25602001-12-17 Akim Demaille <akim@epita.fr>
2561
2562 * src/files.h, src/files.c (open_files, close_files): Remove.
2563 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2564 let...
2565 * src/reader.c (reader): Do it.
2566
25672001-12-17 Akim Demaille <akim@epita.fr>
2568
2569 * src/conflicts.c (print_reductions): Formatting changes.
2570
25712001-12-17 Akim Demaille <akim@epita.fr>
2572
2573 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2574 (flush_reduce): New.
2575 (resolve_sr_conflict): Adjust.
2576
25772001-12-17 Akim Demaille <akim@epita.fr>
2578
2579 * src/output.c (output_obstack): Be static and rename as...
2580 (format_obstack): this, to avoid any confusion with files.c's
2581 output_obstack.
2582 * src/reader.h (muscle_obstack): Move to...
2583 * src/output.h: here, since it's defined in output.c.
2584
25852001-12-17 Akim Demaille <akim@epita.fr>
2586
2587 * src/output.c (action_row, save_column, default_goto)
2588 (sort_actions, matching_state, pack_vector): Better variable
2589 locality.
2590
25912001-12-17 Akim Demaille <akim@epita.fr>
2592
2593 * src/output.c: Various formatting changes.
2594
25952001-12-17 Akim Demaille <akim@epita.fr>
2596
2597 * src/files.c (output_files): Free the output_obstack.
2598 * src/main.c (main): Call print and print_graph conditionally.
2599 * src/print.c (print): Work unconditionally.
2600 * src/print_graph.c (print_graph): Work unconditionally.
2601 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2602
26032001-12-16 Marc Autret <autret_m@epita.fr>
2604
2605 * src/output.c (actions_output): Fix. When we use %no-lines,
2606 there is one less line per action.
2607
26082001-12-16 Marc Autret <autret_m@epita.fr>
2609
2610 * src/bison.simple: Remove a useless #line directive.
2611 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2612 * src/output.c (get_lines_number): New.
2613 (output_parser): Adjust, now takes care about the lines of a
2614 output muscles.
2615 Fix line numbering.
2616 (actions_output): Computes the number of lines taken by actions.
2617 (output_master_parser): Insert new skeleton which is the name of
2618 the output parser file name.
2619
26202001-12-15 Marc Autret <autret_m@epita.fr>
2621
2622 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2623
26242001-12-15 Marc Autret <autret_m@epita.fr>
2625
2626 * src/output.c (output_gram): Keep track of the hairy one.
2627
26282001-12-15 Akim Demaille <akim@epita.fr>
2629
2630 Make `make distcheck' work.
2631
2632 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2633 system.h which uses libgettext.h.
2634
26352001-12-15 Akim Demaille <akim@epita.fr>
2636
2637 * src/nullable.c (set_nullable): Useless rules must be skipped,
2638 otherwise, since we range over their symbols, we might look at a
2639 nonterminal which no longer ``exists'', i.e., it is not counted in
2640 `nvars', hence we overflow our arrays.
2641
26422001-12-15 Akim Demaille <akim@epita.fr>
2643
2644 The header can also be produced directly, without any obstack!
2645 Yahoo!
2646
2647 * src/files.c, src/files.h (defines_obstack): Remove.
2648 (compute_header_macro): Global.
2649 (defines_obstack_save): Remove.
2650 * src/reader.c (parse_union_decl): No longer output to
2651 defines_obstack: its content can be found in the `stype' muscle
2652 anyway.
2653 (output_token_translations): Merge into...
2654 (symbols_output): this.
2655 Rename as...
2656 (symbols_save): this.
2657 (reader): Adjust.
2658 * src/output.c (header_output): New.
2659 (output): Call it.
2660
26612001-12-15 Akim Demaille <akim@epita.fr>
2662
2663 * src/reader.c (parse_union_decl): Instead of handling two obstack
2664 simultaneously, use one to define the `stype' muscle, and use the
2665 value of the latter to fill defines_obstack.
2666 (copy_comment): Remove.
2667 (copy_comment2): Work for a single obstack.
2668 Rename as...
2669 (copy_comment): this.
2670
26712001-12-15 Akim Demaille <akim@epita.fr>
2672
2673 * src/lex.c, src/lex.h (xgetc): No longer static.
2674 * src/reader.c (parse_union_decl): Revamp.
2675
26762001-12-15 Akim Demaille <akim@epita.fr>
2677
2678 Still making progress in separating Bison into (i) input, (ii)
2679 process, (iii) output: now we can directly output the parser file
2680 without using table_obstack at all.
2681
2682 * src/files.c, src/files.h (table_obstack): Bye bye.
2683 (parser_file_name): New.
2684 * src/files.c (compute_output_file_names): Compute it.
2685 * src/output.c (actions_output, output_parser)
2686 (output_master_parser): To a file instead of an obstack.
2687
26882001-12-15 Akim Demaille <akim@epita.fr>
2689
2690 Attach actions to rules, instead of pre-outputting them to
2691 actions_obstack.
2692
2693 * src/gram.h (rule_t): action and action_line are new members.
2694 * src/reader.c (symbol_list): Likewise.
2695 (copy_action): Save the actions within the rule.
2696 (packgram): Save them in rule_table.
2697 * src/output.c (actions_output): New.
2698 (output_parser): Use it on `%%actions'.
2699 (output_rule_data): Don't free rule_table.
2700 (output): Do it.
2701 (prepare): Don't save the `action' muscle.
2702 * src/bison.simple: s/%%action/%%actions/.
2703
27042001-12-15 Akim Demaille <akim@epita.fr>
2705
2706 * src/reader.c (copy_action): When --yacc, don't append a `;'
2707 to the user action: let it fail if lacking.
2708 Suggested by Arnold Robbins and Tom Tromey.
2709
27102001-12-14 Akim Demaille <akim@epita.fr>
2711
2712 * src/lex.c (literalchar): Simply return the char you decoded, non
2713 longer mess around with obstacks and int pointers.
2714 Adjust all callers.
2715
27162001-12-14 Akim Demaille <akim@epita.fr>
2717
2718 * src/lex.c (literalchar): Don't escape the special characters,
2719 just decode them, and keep them as char (before, eol was output as
2720 the 2 char string `\n' etc.).
2721 * src/output.c (output_rule_data): Use quotearg to output the
2722 token strings.
2723
27242001-12-13 Paul Eggert <eggert@twinsun.com>
2725
2726 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2727 Do not infringe on the global user namespace when using C++.
2728 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2729 All uses of `fprintf' and `stderr' changed.
2730
2731 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2732
27332001-12-13 Akim Demaille <akim@epita.fr>
2734
2735 The computation of nullable is broken: it doesn't handle empty
2736 RHS's properly.
2737
2738 * tests/torture.at (GNU AWK Grammar): New.
2739 * tests/sets.at (Nullable): New.
2740 * src/nullable.c (set_nullable): Instead of blindly looping over
2741 `ritems', loop over the rules, and then over their rhs's.
2742
2743 Work around Autotest bugs.
2744
2745 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2746 frame, because Autotest understand lines starting with a `+' as
2747 traces from the shell. Then, they are not processed properly.
2748 Admittedly an Autotest bug, but we don't have time to wait for
2749 Autotest to catch up.
2750 * tests/regression.at (Broken Closure): Adjust to the new table
2751 frames.
2752 Move to...
2753 * tests/sets.at: here.
2754
27552001-12-13 Akim Demaille <akim@epita.fr>
2756
2757 * src/closure.c (closure): Use nrules instead of playing tricks
2758 with BITS_PER_WORD.
2759
27602001-12-13 Akim Demaille <akim@epita.fr>
2761
2762 * src/print.c (print_actions): Output the handling of `$' as the
2763 traces do: shifting the token EOF. Before EOF was treated as a
2764 nonterminal.
2765 * tests/regression.at: Adjust some tests.
2766 * src/print_graph.c (print_core): Complete the set of items via
2767 closure. The next-to-final and final states are still unsatisfying,
2768 but that's to be addressed elsewhere.
2769 No longer output the rule numbers, but do output the state number.
2770 A single loop for the shifts + gotos is enough, but picked a
2771 distinct color for each.
2772 (print_graph): Initialize and finalize closure.
2773
27742001-12-13 Akim Demaille <akim@epita.fr>
2775
2776 * src/reader.c (readgram): Remove dead code, an strip useless
2777 braces.
2778 (get_type): Remove, unused.
2779
27802001-12-12 Akim Demaille <akim@epita.fr>
2781
2782 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
2783 on that of lib/error.c.
2784
27852001-12-12 Akim Demaille <akim@epita.fr>
2786
2787 Some hosts don't like `/' in includes.
2788
2789 * src/system.h: Include libgettext.h without qualifying the path.
2790 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
2791 $(top_srcdir).
2792
27932001-12-11 Marc Autret <autret_m@epita.fr>
2794
2795 * src/output.c (output_parser): Remove useless muscle.
2796
27972001-12-11 Marc Autret <autret_m@epita.fr>
2798
2799 * src/bison.simple: Remove #line just before %%epilogue. It
2800 is now handled in ...
2801 * src/reader.c (read_additionnal_code): Add the output of a
2802 #line for the epilogue.
2803
28042001-12-10 Marc Autret <autret_m@epita.fr>
2805
2806 * src/reader.c (copy_definition): Re-use CPP-outed code which
2807 replace precedent remove.
2808 * src/bison.simple: Remove #line before %%prologue because
2809 %%input-line is wrong at this time.
2810
28112001-12-10 Marc Autret <autret_m@epita.fr>
2812
2813 * src/reader.c (symbols_output): Clean up.
2814 * src/output.c (output_gram, output): Clean up.
2815
28162001-12-10 Akim Demaille <akim@epita.fr>
2817
2818 * src/lalr.c (initialize_lookaheads): New. Extracted from...
2819 * src/LR0.c (set_state_table): here.
2820 * src/lalr.c (lalr): Call it.
2821
28222001-12-10 Akim Demaille <akim@epita.fr>
2823
2824 * src/state.h (shifts): Remove the `number' member: shifts are
2825 attached to state, hence no longer need to be labelled with a
2826 state number.
2827
28282001-12-10 Akim Demaille <akim@epita.fr>
2829
2830 Now that states have a complete set of members, the linked list of
2831 shifts is useless: just fill directly the state's shifts member.
2832
2833 * src/state.h (shifts): Remove the `next' member.
2834 * src/LR0.c (first_state, last_state): Remove.
2835 Adjust the callers.
2836 (augment_automaton): Don't look for the shifts that must be added
2837 a shift on EOF: it is those of the state we looked for! But now,
2838 since shifts are attached, it is no longer needed to looking
2839 merely by its id: its number.
2840
28412001-12-10 Akim Demaille <akim@epita.fr>
2842
2843 * src/LR0.c (augment_automaton): Better variable locality.
2844 Remove an impossible branch: if there is a state corresponding to
2845 the start symbol being shifted, then there is shift for the start
2846 symbol from the initial state.
2847
28482001-12-10 Akim Demaille <akim@epita.fr>
2849
2850 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
2851 only when appropriate: when insert_start_shifting_state' is not
2852 invoked.
2853 * tests/regression.at (Rule Line Numbers): Adjust.
2854
28552001-12-10 Akim Demaille <akim@epita.fr>
2856
2857 * src/LR0.c (augment_automaton): Now that all states have shifts,
2858 merge the two cases addition shifts to the initial state.
2859
28602001-12-10 Akim Demaille <akim@epita.fr>
2861
2862 * src/lalr.c (set_state_table): Move to...
2863 * src/LR0.c: here.
2864 * src/lalr.c (lalr): Don't call it...
2865 * src/LR0.c (generate_states): do it.
2866 * src/LR0.h (first_state): Remove, only the table is used.
2867
28682001-12-10 Akim Demaille <akim@epita.fr>
2869
2870 * src/LR0.h (first_shift, first_reduction): Remove.
2871 * src/lalr.c: Don't use first_shift: find shifts through the
2872 states.
2873
28742001-12-10 Akim Demaille <akim@epita.fr>
2875
2876 * src/LR0.c: Attach shifts to states as soon as they are
2877 computed.
2878 * src/lalr.c (set_state_table): Instead of assigning shifts to
2879 state, just assert that the mapping was properly done.
2880
28812001-12-10 Akim Demaille <akim@epita.fr>
2882
2883 * src/LR0.c (insert_start_shift): Rename as...
2884 (insert_start_shifting_state): this.
2885 (insert_eof_shifting_state, insert_accepting_state): New.
2886 (augment_automaton): Adjust.
2887 Better locality of the variables.
2888 When looking if the start_symbol is shifted from the initial
2889 state, using `while (... symbol != start_symbol ...)' sounds
2890 better than `while (... symbol < start_symbol ...)': If fail
2891 to see how the order between symbols could be relevant!
2892
28932001-12-10 Akim Demaille <akim@epita.fr>
2894
2895 * src/getargs.h: Don't declare `spec_name_prefix' and
2896 `spec_file_prefix', declared by src/files.h.
2897 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2898 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2899 * src/output.c (prepare): Adjust.
2900 * src/reader.c (symbols_output): Likewise.
2901 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2902
29032001-12-10 Akim Demaille <akim@epita.fr>
2904
2905 * src/muscle_tab.c (muscle_init): NULL is a better default than
2906 `"0"'.
2907
29082001-12-10 Akim Demaille <akim@epita.fr>
2909
2910 * src/reader.c (reader): Calling symbols_output once is enough.
2911
29122001-12-10 Akim Demaille <akim@epita.fr>
2913
2914 Now that states have a complete set of members, the linked list of
2915 reductions is useless: just fill directly the state's reductions
2916 member.
2917
2918 * src/state.h (struct reductions): Remove member `number' and
2919 `next'.
2920 * src/LR0.c (first_reduction, last_reduction): Remove.
2921 (save_reductions): Don't link the new reductions, store them in
2922 this_state.
2923 * src/lalr.c (set_state_table): No need to attach reductions to
2924 states, it's already done.
2925 * src/output.c (output_actions): No longer free the shifts, then
2926 the reductions, then the states: free all the states and their
2927 members.
2928
29292001-12-10 Akim Demaille <akim@epita.fr>
2930
2931 * src/options.c (OPTN, DRTV, BOTH): New.
2932 (option_table): Use them.
2933
2934 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2935 the job of system.h.
2936 * src/options.c: Don't include stdio.h and xalloc.h for the same
2937 reasons.
2938
29392001-12-10 Akim Demaille <akim@epita.fr>
2940
2941 * src/output.c (output, prepare): Make sure the values of the
2942 muscles `action' and `prologue' are 0-terminated.
2943
29442001-12-10 Akim Demaille <akim@epita.fr>
2945
2946 Clean up GCC warnings.
2947
2948 * src/reader.c (copy_action): `buf' is not used.
2949 (parse_skel_decl): Be static.
2950 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2951 * src/options.h (create_long_option_table): Have a real prototype.
2952 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2953 (hash_delete_at): Return const void *.
2954 Adjust casts to preserve the const.
2955
29562001-12-10 Akim Demaille <akim@epita.fr>
2957
2958 * configure.in: Require 2.52g.
2959 M4 is not needed, but AUTOM4TE is.
2960 * m4/m4.m4: Remove.
2961 * tests/Makefile.am: Adjust.
2962
29632001-12-10 Akim Demaille <akim@epita.fr>
2964
2965 One structure for states is enough, even though theoretically
2966 there are LR(0) states and LALR(1) states.
2967
2968 * src/lalr.h (state_t): Remove.
2969 (state_table): Be state_t **, not state_t *.
2970 * src/state.h (core, CORE_ALLOC): Rename as...
2971 (state_t, STATE_ALLOC): this.
2972 Add the LALR(1) members: shifts, reductions, errs.
2973 * src/LR0.c (state_table): Rename as...
2974 (state_hash): this, to avoid name clashes with the global
2975 `state_table'.
2976 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2977 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2978
29792001-12-10 Akim Demaille <akim@epita.fr>
2980
2981 Bison dumps core on bash.y.
2982 Reported by Pascal Bart.
2983
2984 * src/warshall.c (bitmatrix_print): New.
2985 (TC): Use it.
2986 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2987 j must be the outer loop.
2988 * tests/regression.at (Broken Closure): New.
2989
29902001-12-05 Akim Demaille <akim@epita.fr>
2991
2992 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2993 its argument.
2994