]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Fix dates in copyright notice.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-07-09 Akim Demaille <akim@epita.fr>
2
3 * doc/bison.texinfo: Properly set the ``header'' part.
4 Use @dircategory ``GNU programming tools'' as per Texinfo's
5 documentation.
6 Use @copying.
7
82002-07-09 Akim Demaille <akim@epita.fr>
9
10 * lib/quotearg.h: Protect against multiple inclusions.
11 * src/location.h (location_t): Add a `file' member.
12 (LOCATION_RESET, LOCATION_PRINT): Adjust.
13 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14 `error_one_per_line' support.
15
162002-07-09 Akim Demaille <akim@epita.fr>
17
18 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
19 * src/reader.c (lineno): Remove.
20 Adjust all dependencies.
21 (get_merge_function): Take a location and use complain_at.
22 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
23 * tests/regression.at (Invalid inputs, Mixing %token styles):
24 Adjust.
25
262002-07-09 Akim Demaille <akim@epita.fr>
27
28 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
29 recovery rule, and forbid extensions when --yacc.
30 (gram_error): Use complain_at.
31 * src/reader.c (reader): Exit if there were parse errors.
32
332002-07-09 Akim Demaille <akim@epita.fr>
34
35 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
36 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
37 Reported by R Blake <blakers@mac.com>.
38
392002-07-09 Akim Demaille <akim@epita.fr>
40
41 * data/yacc.c: Output the copyright notive in the header.
42
432002-07-03 Akim Demaille <akim@epita.fr>
44
45 * src/output.c (froms, tos): Are state_number_t.
46 (save_column): sp, sp1, and sp2 are state_number_t.
47 (prepare): Rename `final' as `final_state_number', `nnts' as
48 `nterms_number', `nrules' as `rules_number', `nstates' as
49 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
50 unused.
51 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
52 * data/lalr1.cc (nsym_): Remove, unused.
53
542002-07-03 Akim Demaille <akim@epita.fr>
55
56 * src/lalr.h, src/lalr.c (goto_number_t): New.
57 * src/lalr.c (goto_list_t): New.
58 Propagate them.
59 * src/nullable.c (rule_list_t): New.
60 Propagate.
61 * src/types.h: Remove.
62
632002-07-03 Akim Demaille <akim@epita.fr>
64
65 * src/closure.c (print_fderives): Use rule_rhs_print.
66 * src/derives.c (print_derives): Use rule_rhs_print.
67 (rule_list_t): New, replaces `shorts'.
68 (set_derives): Add comments.
69 * tests/sets.at (Nullable, Firsts): Adjust.
70
712002-07-03 Akim Demaille <akim@epita.fr>
72
73 * src/output.c (prepare_actions): Free `tally' and `width'.
74 (prepare_actions): Allocate and free `order'.
75 * src/symtab.c (symbols_free): Free `symbols'.
76 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
77 * src/output.c (m4_invoke): Move to...
78 * src/scan-skel.l: here.
79 (<<EOF>>): Close yyout, and free its name.
80
812002-07-03 Akim Demaille <akim@epita.fr>
82
83 Fix some memory leaks, and fix a bug: state 0 was examined twice.
84
85 * src/LR0.c (new_state): Merge into...
86 (state_list_append): this.
87 (new_states): Merge into...
88 (generate_states): here.
89 (set_states): Don't ensure a proper `errs' state member here, do it...
90 * src/conflicts.c (conflicts_solve): here.
91 * src/state.h, src/state.c: Comment changes.
92 (state_t): Rename member `shifts' as `transitions'.
93 Adjust all dependencies.
94 (errs_new): For consistency, also take the values as argument.
95 (errs_dup): Remove.
96 (state_errs_set): New.
97 (state_reductions_set, state_transitions_set): Assert that no
98 previous value was assigned.
99 (state_free): New.
100 (states_free): Use it.
101 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
102 temporary storage: use `errs' and `nerrs' as elsewhere.
103 (set_conflicts): Allocate and free this `errs'.
104
1052002-07-02 Akim Demaille <akim@epita.fr>
106
107 * lib/libiberty.h: New.
108 * lib: Update the bitset implementation from upstream.
109 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
110 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
111 * src/main.c: Adjust bitset stats calls.
112
1132002-07-01 Paul Eggert <eggert@twinsun.com>
114
115 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
116 char, so that negative chars don't collide with $.
117
1182002-06-30 Akim Demaille <akim@epita.fr>
119
120 Have the GLR tests be `warning' checked, and fix the warnings.
121
122 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
123 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
124 (yyremoveDeletes): `yyi' and `yyj' are size_t.
125 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
126 (yyaddDeferredAction): static.
127 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
128 (yyreportParseError): yyprefix is const.
129 yytokenp is used only when verbose.
130 (yy__GNUC__): Replace with __GNUC__.
131 (yypdumpstack): yyi is size_t.
132 (yypreference): Un-yy local variables and arguments, to avoid
133 clashes with `yyr1'. Anyway, we are not in the user name space.
134 (yytname_size): be an int, as is compared with ints.
135 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
136 Use them.
137 * tests/cxx-gram.at: Use quotation to protect $1.
138 Use AT_COMPILE to enable warnings hunts.
139 Prototype yylex and yyerror.
140 `Use' argc.
141 Include `string.h', not `strings.h'.
142 Produce and prototype stmtMerge only when used.
143 yylex takes a location.
144
1452002-06-30 Akim Demaille <akim@epita.fr>
146
147 We spend a lot of time in quotearg, in particular when --verbose.
148
149 * src/symtab.c (symbol_get): Store a quoted version of the key.
150 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
151 Adjust all callers.
152
1532002-06-30 Akim Demaille <akim@epita.fr>
154
155 * src/state.h (reductions_t): Rename member `nreds' as num.
156 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
157 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
158
1592002-06-30 Akim Demaille <akim@epita.fr>
160
161 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
162 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
163 (shifts_to): Rename as...
164 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
165 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
166 (TRANSITION_IS_DISABLED, transitions_to): these.
167
1682002-06-30 Akim Demaille <akim@epita.fr>
169
170 * src/print.c (print_shifts, print_gotos): Merge into...
171 (print_transitions): this.
172 (print_transitions, print_errs, print_reductions): Align the
173 lookaheads columns.
174 (print_core, print_transitions, print_errs, print_state,
175 print_grammar): Output empty lines separator before, not after.
176 (state_default_rule_compute): Rename as...
177 (state_default_rule): this.
178 * tests/conflicts.at (Defaulted Conflicted Reduction),
179 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
180 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
181
1822002-06-30 Akim Demaille <akim@epita.fr>
183
184 Display items as we display rules.
185
186 * src/gram.h, src/gram.c (rule_lhs_print): New.
187 * src/gram.c (grammar_rules_partial_print): Use it.
188 * src/print.c (print_core): Likewise.
189 * tests/conflicts.at (Defaulted Conflicted Reduction),
190 (Unresolved SR Conflicts): Adjust.
191 (Unresolved SR Conflicts): Adjust and rename as...
192 (Resolved SR Conflicts): this, as was meant.
193 * tests/regression.at (Web2c Report): Adjust.
194
1952002-06-30 Akim Demaille <akim@epita.fr>
196
197 * src/print.c (state_default_rule_compute): New, extracted from...
198 (print_reductions): here.
199 Pessimize, but clarify the code.
200 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
201
2022002-06-30 Akim Demaille <akim@epita.fr>
203
204 * src/output.c (action_row): Let default_rule be always a rule
205 number.
206
2072002-06-30 Akim Demaille <akim@epita.fr>
208
209 * src/closure.c (print_firsts, print_fderives, closure):
210 Use BITSET_EXECUTE.
211 * src/lalr.c (lookaheads_print): Likewise.
212 * src/state.c (state_rule_lookaheads_print): Likewise.
213 * src/print_graph.c (print_core): Likewise.
214 * src/print.c (print_reductions): Likewise.
215 * src/output.c (action_row): Likewise.
216 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
217
2182002-06-30 Akim Demaille <akim@epita.fr>
219
220 * src/print_graph.c: Use report_flag.
221
2222002-06-30 Akim Demaille <akim@epita.fr>
223
224 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
225 to...
226 * src/relation.h, src/relation.c (traverse, relation_digraph)
227 (relation_print, relation_transpose): New.
228
2292002-06-30 Akim Demaille <akim@epita.fr>
230
231 * src/state.h, src/state.c (shifts_to): New.
232 * src/lalr.c (build_relations): Use it.
233
2342002-06-30 Akim Demaille <akim@epita.fr>
235
236 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
237 (item_number_of_rule_number, rule_number_of_item_number): New.
238 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
239 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
240 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
241 Propagate their use.
242 Much remains to be done, in particular wrt `shorts' from types.h.
243
2442002-06-30 Akim Demaille <akim@epita.fr>
245
246 * src/symtab.c (symbol_new): Initialize the `printer' member.
247
2482002-06-30 Akim Demaille <akim@epita.fr>
249
250 * src/LR0.c (save_reductions): Remove, replaced by...
251 * src/state.h, src/state.c (state_reductions_set): New.
252 (reductions, errs): Rename as...
253 (reductions_t, errs_t): these.
254 Adjust all dependencies.
255
2562002-06-30 Akim Demaille <akim@epita.fr>
257
258 * src/LR0.c (state_list_t, state_list_append): New.
259 (first_state, last_state): Now symbol_list_t.
260 (this_state): Remove.
261 (new_itemsets, append_states, save_reductions): Take a state_t as
262 argument.
263 (set_states, generate_states): Adjust.
264 (save_shifts): Remove, replaced by...
265 * src/state.h, src/state.c (state_shifts_set): New.
266 (shifts): Rename as...
267 (shifts_t): this.
268 Adjust all dependencies.
269 * src/state.h (state_t): Remove the `next' member.
270
2712002-06-30 Akim Demaille <akim@epita.fr>
272
273 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
274 escaped in slot 0.
275
2762002-06-30 Akim Demaille <akim@epita.fr>
277
278 Use hash.h for the state hash table.
279
280 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
281 (allocate_storage): Use state_hash_new.
282 (free_storage): Use state_hash_free.
283 (new_state, get_state): Adjust.
284 * src/lalr.h, src/lalr.c (states): Move to...
285 * src/states.h (state_t): Remove the `link' member, no longer
286 used.
287 * src/states.h, src/states.c: here.
288 (state_hash_new, state_hash_free, state_hash_lookup)
289 (state_hash_insert, states_free): New.
290 * src/states.c (state_table, state_compare, state_hash): New.
291 * src/output.c (output_actions): Do not free states now, since we
292 still need to know the final_state number in `prepare', called
293 afterwards. Do it...
294 * src/main.c (main): here: call states_free after `output'.
295
2962002-06-30 Akim Demaille <akim@epita.fr>
297
298 * src/state.h, src/state.c (state_new): New, extracted from...
299 * src/LR0.c (new_state): here.
300 * src/state.h (STATE_ALLOC): Move to...
301 * src/state.c: here.
302 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
303 * src/state.h, src/state.c: here.
304
3052002-06-30 Akim Demaille <akim@epita.fr>
306
307 * src/reader.c (gensym): Rename as...
308 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
309 (getsym): Rename as...
310 (symbol_get): this.
311
3122002-06-30 Akim Demaille <akim@epita.fr>
313
314 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
315 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
316 * src/output.c, src/print.c, src/print_graph.c: Propagate.
317 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
318
3192002-06-30 Akim Demaille <akim@epita.fr>
320
321 Make the test suite pass with warnings checked.
322
323 * tests/actions.at (Printers and Destructors): Improve.
324 Avoid unsigned vs. signed issues.
325 * tests/calc.at: Don't exercise the scanner here, do it...
326 * tests/input.at (Torturing the Scanner): here.
327
3282002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
329
330 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
331 reorganize first lines parallel to yacc.c.
332
3332002-06-28 Akim Demaille <akim@epita.fr>
334
335 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
336 (b4_token_enum, b4_token_defines): New, factored from...
337 * data/lalr1.cc, data/yacc.c, glr.c: here.
338
3392002-06-28 Akim Demaille <akim@epita.fr>
340
341 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
342 unused variables.
343 * src/output.c (merger_output): static.
344
3452002-06-28 Akim Demaille <akim@epita.fr>
346
347 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
348 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
349 pacify GCC.
350 * src/output.c (save_row): Initialize all the variables to pacify GCC.
351
3522002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
353
354 Accumulated changelog for new GLR parsing features.
355
356 * src/conflicts.c (count_total_conflicts): Change name to
357 conflicts_total_count.
358 * src/conflicts.h: Ditto.
359 * src/output.c (token_actions): Use the new name.
360 (output_conflicts): Change conflp => conflict_list_heads, and
361 confl => conflict_list for better readability.
362 * data/glr.c: Use the new names.
363 * NEWS: Add self to GLR announcement.
364
365 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
366
367 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
368 Akim Demaille.
369
370 * data/bison.glr: Change name to glr.c
371 * data/glr.c: Renamed from bison.glr.
372 * data/Makefile.am: Add glr.c
373
374 * src/getargs.c:
375
376 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
377 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
378
379 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
380
381 * data/bison.glr: Be sure to restore the
382 current #line when returning to the skeleton contents after having
383 exposed the input file's #line.
384
385 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
386
387 * data/bison.glr: Bring up to date with changes to bison.simple.
388
389 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
390
391 * data/bison.glr: Correct definitions that use b4_prefix.
392 Various reformatting.
393 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
394 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
395 yytokenp argument; now part of stack.
396 (yychar): Define to behave as documented.
397 (yyclearin): Ditto.
398
399 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
400
401 * src/reader.h: Add declaration for free_merger_functions.
402
403 * src/reader.c (merge_functions): New variable.
404 (get_merge_function): New function.
405 (free_merger_functions): New function.
406 (readgram): Check for %prec that is not followed by a symbol.
407 Handle %dprec and %merge declarations.
408 (packgram): Initialize dprec and merger fields in rules array.
409
410 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
411 conflict_list_cnt, conflict_list_free): New variables.
412 (table_grow): Also grow conflict_table.
413 (prepare_rules): Output dprec and merger tables.
414 (conflict_row): New function.
415 (action_row): Output conflict lists for GLR parser. Don't use
416 default reduction in conflicted states for GLR parser so that there
417 are spaces for the conflict lists.
418 (save_row): Also save conflict information.
419 (token_actions): Allocate conflict list.
420 (merger_output): New function.
421 (pack_vector): Pack conflict table, too.
422 (output_conflicts): New function to output yyconflp and yyconfl.
423 (output_check): Allocate conflict_tos.
424 (output_actions): Output conflict tables, also.
425 (output_skeleton): Output b4_mergers definition.
426 (prepare): Output b4_max_rhs_length definition.
427 Use 'bison.glr' as default skeleton for GLR parsers.
428
429 * src/gram.c (glr_parser): New flag.
430 (grammar_free): Call free_merger_functions.
431
432 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
433 all pairs of conflicting reductions, rather than just all tokens
434 causing conflicts. Needed to size conflict tables.
435 (conflicts_output): Modify call to count_rr_conflicts for new
436 interface.
437 (conflicts_print): Ditto.
438 (count_total_conflicts): New function.
439
440 * src/reader.h (merger_list): New type.
441 (merge_functions): New variable.
442
443 * src/lex.h (tok_dprec, tok_merge): New token types.
444
445 * src/gram.h (rule_s): Add dprec and merger fields.
446 (glr_parser): New flag.
447
448 * src/conflicts.h (count_total_conflicts): New function.
449
450 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
451
452 * doc/bison.texinfo (Generalized LR Parsing): New section.
453 (GLR Parsers): New section.
454 (Language and Grammar): Mention GLR parsing.
455 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
456 Correct typo ("tge" -> "the").
457
458 * data/bison.glr: New skeleton for GLR parsing.
459
460 * tests/cxx-gram.at: New tests for GLR parsing.
461
462 * tests/testsuite.at: Include cxx-gram.at.
463
464 * tests/Makefile.am: Add cxx-gram.at.
465
466 * src/parse-gram.y:
467
468 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
469
470 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
471
4722002-06-27 Akim Demaille <akim@epita.fr>
473
474 * src/options.h, src/options.c: Remove.
475 * src/getargs.c (short_options, long_options): New.
476
4772002-06-27 Akim Demaille <akim@epita.fr>
478
479 * data/bison.simple, data/bison.c++: Rename as...
480 * data/yacc.c, data/lalr1.cc: these.
481 * doc/bison.texinfo (Environment Variables): Remove.
482
4832002-06-25 Raja R Harinath <harinath@cs.umn.edu>
484
485 * src/getargs.c (report_argmatch): Initialize strtok().
486
4872002-06-20 Akim Demaille <akim@epita.fr>
488
489 * data/bison.simple (b4_symbol_actions): New, replaces...
490 (b4_symbol_destructor, b4_symbol_printer): these.
491 (yysymprint): Be sure to call YYPRINT only for tokens, and using
492 user token numbers.
493
4942002-06-20 Akim Demaille <akim@epita.fr>
495
496 * data/bison.simple (yydestructor): Rename as...
497 (yydestruct): this.
498
4992002-06-20 Akim Demaille <akim@epita.fr>
500
501 * src/symtab.h, src/symtab.c (symbol_type_set)
502 (symbol_destructor_set, symbol_precedence_set): The location is
503 the last argument.
504 Adjust all callers.
505
5062002-06-20 Akim Demaille <akim@epita.fr>
507
508 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
509 internals.
510 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
511 Takes a location.
512 * src/symtab.h, src/symtab.c (symbol_class_set)
513 (symbol_user_token_number_set): Likewise.
514 Adjust all callers.
515 Promote complain_at.
516 * tests/input.at (Type Clashes): Adjust.
517
5182002-06-20 Akim Demaille <akim@epita.fr>
519
520 * data/bison.simple (YYLEX): Fix the declaration when
521 %pure-parser.
522
5232002-06-20 Akim Demaille <akim@epita.fr>
524
525 * data/bison.simple (yysymprint): Don't print the token number,
526 just its name.
527 * tests/actions.at (Destructors): Rename as...
528 (Printers and Destructors): this.
529 Also exercise %printer.
530
5312002-06-20 Akim Demaille <akim@epita.fr>
532
533 * data/bison.simple (YYDSYMPRINT): New.
534 Use it to remove many of the #if YYDEBUG/if (yydebug).
535
5362002-06-20 Akim Demaille <akim@epita.fr>
537
538 * src/symtab.h, src/symtab.c (symbol_t): printer and
539 printer_location are new members.
540 (symbol_printer_set): New.
541 * src/parse-gram.y (PERCENT_PRINTER): New token.
542 Handle its associated rule.
543 * src/scan-gram.l: Adjust.
544 (handle_destructor_at, handle_destructor_dollar): Rename as...
545 (handle_symbol_code_at, handle_symbol_code_dollar): these.
546 * src/output.c (symbol_printers_output): New.
547 (output_skeleton): Call it.
548 * data/bison.simple (yysymprint): New. Cannot be named yyprint
549 since there are already many grammar files with a user `yyprint'.
550 Replace the calls to YYPRINT to calls to yysymprint.
551 * tests/calc.at: Adjust.
552 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
553 taking advantage of parser very internal details (stack size!).
554
5552002-06-20 Akim Demaille <akim@epita.fr>
556
557 * src/scan-gram.l: Complete the scanner with the missing patterns
558 to pacify Flex.
559 Use `quote' and `symbol_tag_get' where appropriate.
560
5612002-06-19 Akim Demaille <akim@epita.fr>
562
563 * tests/actions.at (Destructors): Augment to test locations.
564 * data/bison.simple (yydestructor): Pass it the current location
565 if locations are enabled.
566 Prototype only when __STDC__ or C++.
567 Change the argument names to move into the yy name space: there is
568 user code here.
569
5702002-06-19 Akim Demaille <akim@epita.fr>
571
572 * data/bison.simple (b4_pure_if): New.
573 Use it instead of #ifdef YYPURE.
574
5752002-06-19 Akim Demaille <akim@epita.fr>
576
577 * data/bison.simple (b4_location_if): New.
578 Use it instead of #ifdef YYLSP_NEEDED.
579
5802002-06-19 Akim Demaille <akim@epita.fr>
581
582 Prepare @$ in %destructor, but currently don't bind it in the
583 skeleton, as %location use is not cleaned up yet.
584
585 * src/scan-gram.l (handle_dollar, handle_destructor_at)
586 (handle_action_at): New.
587 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
588 a braced_code_t and a location as additional arguments.
589 (handle_destructor_dollar): Instead of requiring `b4_eval', just
590 unquote one when outputting `b4_dollar_dollar'.
591 Adjust callers.
592 * data/bison.simple (b4_eval): Remove.
593 (b4_symbol_destructor): Adjust.
594 * tests/input.at (Invalid @n): Adjust.
595
5962002-06-19 Zack Weinberg <zack@codesourcery.com>
597
598 * doc/bison.texinfo: Document ability to have multiple
599 prologue sections.
600
6012002-06-18 Akim Demaille <akim@epita.fr>
602
603 * src/files.c (compute_base_names): When computing the output file
604 names from the input file name, strip the directory part.
605
6062002-06-18 Akim Demaille <akim@epita.fr>
607
608 * data/bison.simple.new: Comment changes.
609 Reported by Andreas Schwab.
610
6112002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
612
613 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
614 there are no `label `yyoverflowlab' defined but not used' warnings
615 when yyoverflow is defined.
616
6172002-06-18 Akim Demaille <akim@epita.fr>
618
619 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
620 new member.
621 (symbol_destructor_set): Adjust.
622 * src/output.c (symbol_destructors_output): Output the destructor
623 locations.
624 Output the symbol name.
625 * data/bison.simple (b4_symbol_destructor): Adjust.
626
6272002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
628 and Akim Demaille <akim@epita.fr>
629
630 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
631 what's left on the stack when the error recovery hits EOF.
632 * tests/actions.at (Destructors): Complete to exercise this case.
633
6342002-06-17 Akim Demaille <akim@epita.fr>
635
636 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
637 arguments is really empty, not only equal to `[]'.
638 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
639 member.
640 (symbol_destructor_set): New.
641 * src/output.c (symbol_destructors_output): New.
642 * src/reader.h (brace_code_t, current_braced_code): New.
643 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
644 (handle_dollar): Rename as...
645 (handle_action_dollar): this.
646 (handle_destructor_dollar): New.
647 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
648 (grammar_declaration): Use it.
649 * data/bison.simple (yystos): Is always defined.
650 (yydestructor): New.
651 * tests/actions.at (Destructors): New.
652 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
653
6542002-06-17 Akim Demaille <akim@epita.fr>
655
656 * src/symlist.h, src/symlist.c (symbol_list_length): New.
657 * src/scan-gram.l (handle_dollar, handle_at): Compute the
658 rule_length only when needed.
659 * src/output.c (actions_output, token_definitions_output): Output
660 the full M4 block.
661 * src/symtab.c: Don't access directly to the symbol tag, use
662 symbol_tag_get.
663 * src/parse-gram.y: Use symbol_list_free.
664
6652002-06-17 Akim Demaille <akim@epita.fr>
666
667 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
668 (symbol_list_prepend, get_type_name): Move to...
669 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
670 (symbol_list_prepend, symbol_list_n_type_name_get): here.
671 Adjust all callers.
672 (symbol_list_free): New.
673 * src/scan-gram.l (handle_dollar): Takes a location.
674 * tests/input.at (Invalid $n): Adjust.
675
6762002-06-17 Akim Demaille <akim@epita.fr>
677
678 * src/reader.h, src/reader.c (symbol_list_new): Export it.
679 (symbol_list_prepend): New.
680 * src/parse-gram.y (%union): `list' is a new member.
681 (symbols.1): New, replaces...
682 (terms_to_prec.1, nterms_to_type.1): these.
683 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
684 Take a location as additional argument.
685 Adjust all callers.
686
6872002-06-15 Akim Demaille <akim@epita.fr>
688
689 * src/parse-gram.y: Move %token in the declaration section so that
690 we don't depend upon CVS Bison.
691
6922002-06-15 Akim Demaille <akim@epita.fr>
693
694 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
695 * src/print.c (print_core): Use it.
696
6972002-06-15 Akim Demaille <akim@epita.fr>
698
699 * src/conflicts.c (log_resolution): Accept the rule involved in
700 the sr conflicts instead of the lookahead number that points to
701 that rule.
702 (flush_reduce): Accept the current lookahead vector as argument,
703 instead of the index in LA.
704 (resolve_sr_conflict): Accept the current number of lookahead
705 bitset to consider for the STATE, instead of the index in LA.
706 (set_conflicts): Adjust.
707 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
708
7092002-06-15 Akim Demaille <akim@epita.fr>
710
711 * src/state.h (state_t): Replace the `lookaheadsp' member, a
712 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
713 Adjust all dependencies.
714 * src/lalr.c (initialize_lookaheads): Split into...
715 (states_lookaheads_count, states_lookaheads_initialize): these.
716 (lalr): Adjust.
717
7182002-06-15 Akim Demaille <akim@epita.fr>
719
720 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
721 out of...
722 (grammar_rules_print): here.
723 * src/reduce.c (reduce_output): Use it.
724 * tests/reduce.at (Useless Rules, Reduced Automaton)
725 (Underivable Rules): Adjust.
726
7272002-06-15 Akim Demaille <akim@epita.fr>
728
729 Copy BYacc's nice way to report the grammar.
730
731 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
732 New.
733 Don't print the rules' location, it is confusing and useless.
734 (rule_print): Use grammar_rhs_print.
735 * src/print.c (print_grammar): Use grammar_rules_print.
736
7372002-06-15 Akim Demaille <akim@epita.fr>
738
739 Complete and rationalize `useless thing' warnings.
740
741 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
742 (symbol_tag_print): New.
743 Use them everywhere in place of accessing directly the tag member.
744 * src/gram.h, src/gram.c (rule_print): New.
745 Use it where a rule used to be printed `by hand'.
746 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
747 (reduce_grammar_tables): Report the useless rules.
748 (reduce_print): Useless things are a warning, not an error.
749 Report it as such.
750 * tests/reduce.at (Useless Nonterminals, Useless Rules):
751 (Reduced Automaton, Underivable Rules): Adjust.
752 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
753 * tests/conflicts.at (Unresolved SR Conflicts)
754 (Solved SR Conflicts): Adjust.
755
7562002-06-15 Akim Demaille <akim@epita.fr>
757
758 Let symbols have a location.
759
760 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
761 (getsym): Adjust.
762 Adjust all callers.
763 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
764 Use location_t, not int.
765 * src/symtab.c (symbol_check_defined): Take advantage of the
766 location.
767 * tests/regression.at (Invalid inputs): Adjust.
768
7692002-06-15 Akim Demaille <akim@epita.fr>
770
771 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
772 (input): Don't try to initialize yylloc here, do it in the
773 scanner.
774 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
775 * src/gram.h (rule_t): Change line and action_line into location
776 and action_location, of location_t type.
777 Adjust all dependencies.
778 * src/location.h, src/location.c (empty_location): New.
779 * src/reader.h, src/reader.c (grammar_start_symbol_set)
780 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
781 (grammar_current_rule_symbol_append)
782 (grammar_current_rule_action_append): Expect a location as argument.
783 * src/reader.c (grammar_midrule_action): Adjust to attach an
784 action's location as dummy symbol location.
785 * src/symtab.h, src/symtab.c (startsymbol_location): New.
786 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
787 the line numbers.
788
7892002-06-14 Akim Demaille <akim@epita.fr>
790
791 Grammar declarations may be found in the grammar section.
792
793 * src/parse-gram.y (rules_or_grammar_declaration): New.
794 (declarations): Each declaration may end with a semicolon, not
795 just...
796 (grammar_declaration): `"%union"'.
797 (grammar): Branch to rules_or_grammar_declaration.
798
7992002-06-14 Akim Demaille <akim@epita.fr>
800
801 * src/main.c (main): Invoke scanner_free.
802
8032002-06-14 Akim Demaille <akim@epita.fr>
804
805 * src/output.c (m4_invoke): Extracted from...
806 (output_skeleton): here.
807 Free tempfile.
808
8092002-06-14 Akim Demaille <akim@epita.fr>
810
811 * src/parse-gram.y (directives, directive, gram)
812 (grammar_directives, precedence_directives, precedence_directive):
813 Rename as...
814 (declarations, declaration, grammar, grammar_declaration)
815 (precedence_declaration, precedence_declarator): these.
816 (symbol_declaration): New.
817
8182002-06-14 Akim Demaille <akim@epita.fr>
819
820 * src/files.c (action_obstack): Remove, unused.
821 (output_obstack): Remove it, and all its dependencies, as it is no
822 longer needed.
823 * src/reader.c (epilogue_set): Build the epilogue in the
824 muscle_obstack.
825 * src/output.h, src/output.c (muscle_obstack): Move to...
826 * src/muscle_tab.h, src/muscle_tab.h: here.
827 (muscle_init): Initialize muscle_obstack.
828 (muscle_free): New.
829 * src/main.c (main): Call it.
830
8312002-06-14 Akim Demaille <akim@epita.fr>
832
833 * src/location.h: New, extracted from...
834 * src/reader.h: here.
835 * src/Makefile.am (noinst_HEADERS): Merge into
836 (bison_SOURCES): this.
837 Add location.h.
838 * src/parse-gram.y: Use location_t instead of Bison's.
839 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
840 Use location_t instead of ints.
841
8422002-06-14 Akim Demaille <akim@epita.fr>
843
844 * data/bison.simple, data/bison.c++: Be sure to restore the
845 current #line when returning to the skeleton contents after having
846 exposed the input file's #line.
847
8482002-06-12 Akim Demaille <akim@epita.fr>
849
850 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
851 eager.
852 * tests/actions.at (Exotic Dollars): New.
853
8542002-06-12 Akim Demaille <akim@epita.fr>
855
856 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
857 ['"/] too eagerly.
858 * tests/input.at (Torturing the Scanner): New.
859
8602002-06-11 Akim Demaille <akim@epita.fr>
861
862 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
863 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
864 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
865 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
866 * src/reader.c (reader): Use it.
867
8682002-06-11 Akim Demaille <akim@epita.fr>
869
870 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
871 Adjust all callers.
872 (scanner_last_string_free): New.
873
8742002-06-11 Akim Demaille <akim@epita.fr>
875
876 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
877 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
878 (last_string, YY_OBS_FREE): New.
879 Use them when returning an ID.
880
8812002-06-11 Akim Demaille <akim@epita.fr>
882
883 Have Bison grammars parsed by a Bison grammar.
884
885 * src/reader.c, src/reader.h (prologue_augment): New.
886 * src/reader.c (copy_definition): Remove.
887
888 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
889 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
890 (grammar_current_rule_prec_set, grammar_current_rule_check)
891 (grammar_current_rule_symbol_append)
892 (grammar_current_rule_action_append): Export.
893 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
894 (symbol_list_action_append): Remove.
895 Hook the routines from reader.
896 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
897 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
898
899 * src/reader.c (read_declarations): Remove, unused.
900
901 * src/parse-gram.y: Handle the epilogue.
902 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
903 (grammar_start_symbol_set): this.
904 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
905 * src/reader.c (readgram): Remove, unused.
906 (reader): Adjust to insert eoftoken and axiom where appropriate.
907
908 * src/reader.c (copy_dollar): Replace with...
909 * src/scan-gram.h (handle_dollar): this.
910 * src/parse-gram.y: Remove `%thong'.
911
912 * src/reader.c (copy_at): Replace with...
913 * src/scan-gram.h (handle_at): this.
914
915 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
916 New.
917
918 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
919 time being.
920
921 * src/reader.h, src/reader.c (grammar_rule_end): New.
922
923 * src/parse.y (current_type, current_class): New.
924 Implement `%nterm', `%token' support.
925 Merge `%term' into `%token'.
926 (string_as_id): New.
927 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
928 type name.
929
930 * src/parse-gram.y: Be sure to handle properly the beginning of
931 rules.
932
933 * src/parse-gram.y: Handle %type.
934 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
935
936 * src/parse-gram.y: More directives support.
937 * src/options.c: No longer handle source directives.
938
939 * src/parse-gram.y: Fix %output.
940
941 * src/parse-gram.y: Handle %union.
942 Use the prologue locations.
943 * src/reader.c (parse_union_decl): Remove.
944
945 * src/reader.h, src/reader.c (epilogue_set): New.
946 * src/parse-gram.y: Use it.
947
948 * data/bison.simple, data/bison.c++: b4_stype is now either not
949 defined, then default to int, or to the contents of %union,
950 without `union' itself.
951 Adjust.
952 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
953
954 * src/output.c (actions_output): Don't output braces, as they are
955 already handled by the scanner.
956
957 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
958 characters to themselves.
959
960 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
961 that the epilogue has a proper #line.
962
963 * src/parse-gram.y: Handle precedence/associativity.
964
965 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
966 a terminal.
967 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
968 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
969 at all to define terminals that cannot be emitted.
970
971 * src/scan-gram.l: Escape M4 characters.
972
973 * src/scan-gram.l: Working properly with escapes in user
974 strings/characters.
975
976 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
977 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
978 grammar.
979 Use more modest sizes, as for the time being the parser does not
980 release memory, and therefore the process swallows a huge amount
981 of memory.
982
983 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
984 stricter %token grammar.
985
986 * src/symtab.h (associativity): Add `undef_assoc'.
987 (symbol_precedence_set): Do nothing when passed an undef_assoc.
988 * src/symtab.c (symbol_check_alias_consistence): Adjust.
989
990 * tests/regression.at (Invalid %directive): Remove, as it is now
991 meaningless.
992 (Invalid inputs): Adjust to the new error messages.
993 (Token definitions): The new grammar doesn't allow too many
994 eccentricities.
995
996 * src/lex.h, src/lex.c: Remove.
997 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
998 (copy_character, copy_string2, copy_string, copy_identifier)
999 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
1000 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
1001 (parse_action): Remove.
1002 * po/POTFILES.in: Adjust.
1003
10042002-06-11 Akim Demaille <akim@epita.fr>
1005
1006 * src/reader.c (parse_action): Don't store directly into the
1007 rule's action member: return the action as a string.
1008 Don't require `rule_length' as an argument: compute it.
1009 (grammar_current_rule_symbol_append)
1010 (grammar_current_rule_action_append): New, eved out from
1011 (readgram): here.
1012 Remove `action_flag', `rulelength', unused now.
1013
10142002-06-11 Akim Demaille <akim@epita.fr>
1015
1016 * src/reader.c (grammar_current_rule_prec_set).
1017 (grammar_current_rule_check): New, eved out from...
1018 (readgram): here.
1019 Remove `xaction', `first_rhs': useless.
1020 * tests/input.at (Type clashes): New.
1021 * tests/existing.at (GNU Cim Grammar): Adjust.
1022
10232002-06-11 Akim Demaille <akim@epita.fr>
1024
1025 * src/reader.c (grammar_midrule_action): New, Eved out from
1026 (readgram): here.
1027
10282002-06-11 Akim Demaille <akim@epita.fr>
1029
1030 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
1031 New.
1032 (readgram): Use them as replacement of inlined code, crule and
1033 crule1.
1034
10352002-06-11 Akim Demaille <akim@epita.fr>
1036
1037 * src/reader.c (grammar_end, grammar_symbol_append): New.
1038 (readgram): Use them.
1039 Make the use of `p' as local as possible.
1040
10412002-06-10 Akim Demaille <akim@epita.fr>
1042
1043 GCJ's parser requires the tokens to be defined before the prologue.
1044
1045 * data/bison.simple: Output the token definition before the user's
1046 prologue.
1047 * tests/regression.at (Braces parsing, Duplicate string)
1048 (Mixing %token styles): Check the output from bison.
1049 (Early token definitions): New.
1050
10512002-06-10 Akim Demaille <akim@epita.fr>
1052
1053 * src/symtab.c (symbol_user_token_number_set): Don't complain when
1054 assigning twice the same user number to a token, so that we can
1055 use it in...
1056 * src/lex.c (lex): here.
1057 Also use `symbol_class_set' instead of hand written code.
1058 * src/reader.c (parse_assoc_decl): Likewise.
1059
10602002-06-10 Akim Demaille <akim@epita.fr>
1061
1062 * src/symtab.c, src/symtab.c (symbol_class_set)
1063 (symbol_user_token_number_set): New.
1064 * src/reader.c (parse_token_decl): Use them.
1065 Use a switch instead of ifs.
1066 Use a single argument.
1067
10682002-06-10 Akim Demaille <akim@epita.fr>
1069
1070 Remove `%thong' support as it is undocumented, unused, duplicates
1071 `%token's job, and creates useless e-mail traffic with people who
1072 want to know what it is, why it is undocumented, unused, and
1073 duplicates `%token's job.
1074
1075 * src/reader.c (parse_thong_decl): Remove.
1076 * src/options.c (option_table): Remove "thong".
1077 * src/lex.h (tok_thong): Remove.
1078
10792002-06-10 Akim Demaille <akim@epita.fr>
1080
1081 * src/symtab.c, src/symtab.c (symbol_type_set)
1082 (symbol_precedence_set): New.
1083 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
1084 (value_components_used): Remove, unused.
1085
10862002-06-09 Akim Demaille <akim@epita.fr>
1087
1088 Move symbols handling code out of the reader.
1089
1090 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
1091 (axiom): Move to...
1092 * src/symtab.h, src/symtab.c: here.
1093
1094 * src/gram.c (start_symbol): Remove: use startsymbol->number.
1095 * src/reader.c (startval): Rename as...
1096 * src/symtab.h, src/symtab.c (startsymbol): this.
1097 * src/reader.c: Adjust.
1098
1099 * src/reader.c (symbol_check_defined, symbol_make_alias)
1100 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1101 (token_translations_init)
1102 Move to...
1103 * src/symtab.c: here.
1104 * src/reader.c (packsymbols): Move to...
1105 * src/symtab.h, src/symtab.c (symbols_pack): here.
1106 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
1107 argument.
1108
11092002-06-03 Akim Demaille <akim@epita.fr>
1110
1111 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
1112 then statements.
1113
11142002-06-03 Akim Demaille <akim@epita.fr>
1115
1116 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1117 structs with non literals.
1118 * src/scan-skel.l: never-interactive.
1119 * src/conflicts.c (enum conflict_resolution_e): No trailing
1120 comma.
1121 * src/getargs.c (usage): Split long literal strings.
1122 Reported by Hans Aberg.
1123
11242002-05-28 Akim Demaille <akim@epita.fr>
1125
1126 * data/bison.c++: Use C++ ostreams.
1127 (cdebug_): New member.
1128
11292002-05-28 Akim Demaille <akim@epita.fr>
1130
1131 * src/output.c (output_skeleton): Be sure to allocate enough room
1132 for `/' _and_ for `\0' in full_skeleton.
1133
11342002-05-28 Akim Demaille <akim@epita.fr>
1135
1136 * data/bison.c++: Catch up with bison.simple:
1137 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1138 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1139 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1140 and popping traces.
1141
11422002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1143
1144 * src/output.c (output_skeleton): Put an explicit path in front of
1145 the skeleton file name, rather than relying on the -I directory,
1146 to partially alleviate effects of having a skeleton file lying around
1147 in the current directory.
1148
11492002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1150
1151 * src/conflicts.c (log_resolution): Correct typo:
1152 obstack_printf should be obstack_fgrow1.
1153
11542002-05-26 Akim Demaille <akim@epita.fr>
1155
1156 * src/state.h (state_t): `solved_conflicts' is a new member.
1157 * src/LR0.c (new_state): Set it to 0.
1158 * src/conflicts.h, src/conflicts.c (print_conflicts)
1159 (free_conflicts, solve_conflicts): Rename as...
1160 (conflicts_print, conflicts_free, conflicts_solve): these.
1161 Adjust callers.
1162 * src/conflicts.c (enum conflict_resolution_e)
1163 (solved_conflicts_obstack): New, used by...
1164 (log_resolution): this.
1165 Adjust to attach the conflict resolution to each state.
1166 Complete the description with the precedence/associativity
1167 information.
1168 (resolve_sr_conflict): Adjust.
1169 * src/print.c (print_state): Output its solved_conflicts.
1170 * tests/conflicts.at (Unresolved SR Conflicts)
1171 (Solved SR Conflicts): Exercise --report=all.
1172
11732002-05-26 Akim Demaille <akim@epita.fr>
1174
1175 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1176 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1177 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1178 (token_number_t, item_number_as_token_number)
1179 (token_number_as_item_number, muscle_insert_token_number_table):
1180 Rename as...
1181 (symbol_number_t, item_number_as_symbol_number)
1182 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1183 these, since it is more appropriate.
1184
11852002-05-26 Akim Demaille <akim@epita.fr>
1186
1187 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1188 `Error:' lines.
1189 * data/bison.simple (yystos) [YYDEBUG]: New.
1190 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1191 error recovery.
1192 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1193
11942002-05-25 Akim Demaille <akim@epita.fr>
1195
1196 * doc/bison.texinfo (Debugging): Split into...
1197 (Tracing): this new section, its former contents, and...
1198 (Understanding): this new section.
1199 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1200 by...
1201 (report_flag): this.
1202 Adjust all dependencies.
1203 (report_args, report_types, report_argmatch): New.
1204 (usage, getargs): Report/support -r, --report.
1205 * src/options.h
1206 (struct option_table_struct): Rename as..,
1207 (struct option_table_s): this.
1208 Rename the `set_flag' member to `flag' to match with getopt_long's
1209 struct.
1210 * src/options.c (option_table): Split verbose into an entry for
1211 %verbose, and another for --verbose.
1212 Support --report/-r, so remove -r from the obsolete --raw.
1213 * src/print.c: Attach full item sets and lookaheads reports to
1214 report_flag instead of trace_flag.
1215 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1216
12172002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1218 and Paul Eggert <eggert@twinsun.com>
1219
1220 * data/bison.simple (yyparse): Correct error handling to conform to
1221 POSIX and yacc. Specifically, after syntax error is discovered,
1222 do not reduce further before shifting the error token.
1223 Clean up the code a bit by removing the labels yyerrdefault,
1224 yyerrhandle, yyerrpop.
1225 * NEWS: Document the above.
1226
12272002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1228
1229 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1230 type; it isn't always big enough, since it doesn't necessarily
1231 include non-terminals.
1232 (yytranslate): Expand definition of yy_token_number_type, so that
1233 the latter can be removed.
1234 (yy_token_number_type): Remove, only one use.
1235 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1236 don't use TokenNumberType as element type.
1237
1238 * tests/regression.at: Modify expected output to agree with change
1239 to yyr1 and yytranslate.
1240
12412002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1242
1243 * src/reader.c (parse_action): Use copy_character instead of
1244 obstack_1grow.
1245
12462002-05-13 Akim Demaille <akim@epita.fr>
1247
1248 * tests/regression.at (Token definitions): Prototype yylex and
1249 yyerror.
1250
12512002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1252
1253 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
1254 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1255 32-bit arithmetic.
1256 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1257
12582002-05-07 Akim Demaille <akim@epita.fr>
1259
1260 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1261 avoid GCC warnings.
1262
12632002-05-07 Akim Demaille <akim@epita.fr>
1264
1265 Kill GCC warnings.
1266
1267 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1268 over the RHS of each rule.
1269 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1270 * src/state.h (state_t): Member `nitems' is unsigned short.
1271 * src/LR0.c (get_state): Adjust.
1272 * src/reader.c (packgram): Likewise.
1273 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1274 `Type'.
1275 (muscle_insert_int_table): Remove, unused.
1276 (prepare_rules): Remove `max'.
1277
12782002-05-06 Akim Demaille <akim@epita.fr>
1279
1280 * src/closure.c (print_firsts): Display of the symbol tags.
1281 (bitmatrix_print): Move to...
1282 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1283 here.
1284 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1285
12862002-05-06 Akim Demaille <akim@epita.fr>
1287
1288 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1289 hash_do_for_each.
1290
12912002-05-06 Akim Demaille <akim@epita.fr>
1292
1293 * src/LR0.c (new_state, get_state): Instead of using the global
1294 `kernel_size' and `kernel_base', have two new arguments:
1295 `core_size' and `core'.
1296 Adjust callers.
1297
12982002-05-06 Akim Demaille <akim@epita.fr>
1299
1300 * src/reader.c (packgram): No longer end `ritem' with a 0
1301 sentinel: it is not used.
1302
13032002-05-05 Akim Demaille <akim@epita.fr>
1304
1305 New experimental feature: display the lookaheads in the report and
1306 graph.
1307
1308 * src/print (print_core): When --trace-flag, display the rules
1309 lookaheads.
1310 * src/print_graph.c (print_core): Likewise.
1311 Swap the arguments.
1312 Adjust caller.
1313
13142002-05-05 Akim Demaille <akim@epita.fr>
1315
1316 * tests/torture.at (Many lookaheads): New test.
1317
13182002-05-05 Akim Demaille <akim@epita.fr>
1319
1320 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1321 (GENERATE_MUSCLE_INSERT_TABLE): this.
1322 (output_int_table, output_unsigned_int_table, output_short_table)
1323 (output_token_number_table, output_item_number_table): Replace with...
1324 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1325 (muscle_insert_short_table, muscle_insert_token_number_table)
1326 (muscle_insert_item_number_table): these.
1327 Adjust all callers.
1328 (prepare_tokens): Don't free `translations', since...
1329 * src/reader.h, src/reader.c (grammar_free): do it.
1330 Move to...
1331 * src/gram.h, src/gram.c (grammar_free): here.
1332 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1333 b4_translate_max.
1334
13352002-05-05 Akim Demaille <akim@epita.fr>
1336
1337 * src/output.c (output_unsigned_int_table): New.
1338 (prepare_rules): `i' is unsigned.
1339 `prhs', `rline', `r2' are unsigned int.
1340 Rename muscle `rhs_number_max' as `rhs_max'.
1341 Output muscles `prhs_max', `rline_max', and `r2_max'.
1342 Free rline and r1.
1343 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1344 to compute types instead of constant types.
1345 * tests/regression.at (Web2c Actions): Adjust.
1346
13472002-05-04 Akim Demaille <akim@epita.fr>
1348
1349 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1350 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1351 Adjust dependencies.
1352 * src/output.c (token_definitions_output): Be sure not to output a
1353 `#define 'a'' when fed with `%token 'a' "a"'.
1354 * tests/regression.at (Token definitions): New.
1355
13562002-05-03 Paul Eggert <eggert@twinsun.com>
1357
1358 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1359 for K&R C.
1360
13612002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1362
1363 * Makefile.am (SUBDIRS): Remove intl.
1364 (EXTRA_DIST): Add config/config.rpath.
1365
13662002-05-03 Akim Demaille <akim@epita.fr>
1367
1368 * data/bison.simple (m4_if): Don't output empty enums.
1369 And actually, output valid enum definitions :(.
1370
13712002-05-03 Akim Demaille <akim@epita.fr>
1372
1373 * configure.bat: Remove, completely obsolete.
1374 * Makefile.am (EXTRA_DIST): Adjust.
1375 Don't distribute config.rpath...
1376 * config/Makefile.am (EXTRA_DIST): Do it.
1377
13782002-05-03 Akim Demaille <akim@epita.fr>
1379
1380 * configure.in (GETTEXT_VERSION): New.
1381 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1382
13832002-05-03 Akim Demaille <akim@epita.fr>
1384
1385 * data/bison.simple (b4_token_enum): New.
1386 (b4_token_defines): Use it to output tokens both as #define and
1387 enums.
1388 Suggested by Paul Eggert.
1389 * src/output.c (token_definitions_output): Don't output spurious
1390 white spaces.
1391
13922002-05-03 Akim Demaille <akim@epita.fr>
1393
1394 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1395
13962002-05-02 Robert Anisko <robert@lrde.epita.fr>
1397
1398 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1399 Update the stack class, give a try to deque as the default container.
1400
14012002-05-02 Akim Demaille <akim@epita.fr>
1402
1403 * data/bison.simple (yyparse): Do not implement @$ = @1.
1404 (YYLLOC_DEFAULT): Adjust to do it.
1405 * doc/bison.texinfo (Location Default Action): Fix.
1406
14072002-05-02 Akim Demaille <akim@epita.fr>
1408
1409 * src/reader.c (parse_braces): Merge into...
1410 (parse_action): this.
1411
14122002-05-02 Akim Demaille <akim@epita.fr>
1413
1414 * configure.in (ALL_LINGUAS): Remove.
1415 * po/LINGUAS, hr.po: New.
1416
14172002-05-02 Akim Demaille <akim@epita.fr>
1418
1419 Remove the so called hairy (semantic) parsers.
1420
1421 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1422 * src/gram.h, src/gram.c (semantic_parser): Remove.
1423 (rule_t): Remove the guard and guard_line members.
1424 * src/lex.h (token_t): remove tok_guard.
1425 * src/options.c (option_table): Remove %guard and %semantic_parser
1426 support.
1427 * src/output.c, src/output.h (guards_output): Remove.
1428 (prepare): Adjust.
1429 (token_definitions_output): Don't output the `T'
1430 tokens (???).
1431 (output_skeleton): Don't output the guards.
1432 * src/files.c, src/files.c (attrsfile): Remove.
1433 * src/reader.c (symbol_list): Remove the guard and guard_line
1434 members.
1435 Adjust dependencies.
1436 (parse_guard): Remove.
1437 * data/bison.hairy: Remove.
1438 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1439 BISON_HAIRY.
1440
14412002-05-02 Akim Demaille <akim@epita.fr>
1442
1443 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1444 (parse_guard): Rename the formal argument `stack_offset' as
1445 `rule_length', which is more readable.
1446 Adjust callers.
1447 (copy_at, copy_dollar): Instead of outputting the hard coded
1448 values of $$, $n and so forth, output invocation to b4_lhs_value,
1449 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
1450 Note: this patch partially drops `semantic-parser' support: it
1451 always does `rule_length - n', where semantic parsers ought to
1452 always use `-n'.
1453 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1454 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1455
14562002-05-02 Akim Demaille <akim@epita.fr>
1457
1458 * configure.in (AC_INIT): Bump to 1.49b.
1459 (AM_INIT_AUTOMAKE): Short invocation.
1460
14612002-05-02 Akim Demaille <akim@epita.fr>
1462
1463 Version 1.49a.
1464
14652002-05-01 Akim Demaille <akim@epita.fr>
1466
1467 * src/skeleton.h: Remove.
1468
14692002-05-01 Akim Demaille <akim@epita.fr>
1470
1471 * src/skeleton.h: Fix the #endif.
1472 Reported by Magnus Fromreide.
1473
14742002-04-26 Paul Eggert <eggert@twinsun.com>
1475
1476 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1477 Define if we define YYSTYPE and YYLTYPE, respectively.
1478 (YYCOPY): Fix [] quoting problem in the non-GCC case.
1479
14802002-04-25 Robert Anisko <robert@lrde.epita.fr>
1481
1482 * src/scan-skel.l: Postprocess quadrigraphs.
1483
1484 * src/reader.c (copy_character): New function, used to output
1485 single characters while replacing `[' and `]' with quadrigraphs, to
1486 avoid troubles with M4 quotes.
1487 (copy_comment): Output characters with copy_character.
1488 (read_additionnal_code): Likewise.
1489 (copy_string2): Likewise.
1490 (copy_definition): Likewise.
1491
1492 * tests/calc.at: Exercise M4 quoting.
1493
14942002-04-25 Akim Demaille <akim@epita.fr>
1495
1496 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1497 between `!' and the command.
1498 Reported by Paul Eggert.
1499
15002002-04-24 Robert Anisko <robert@lrde.epita.fr>
1501
1502 * tests/calc.at: Exercise prologue splitting.
1503
1504 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1505 `b4_post_prologue' instead of `b4_prologue'.
1506
1507 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1508 muscles.
1509 (output): Free pre_prologue_obstack and post_prologue_obstack.
1510 * src/files.h, src/files.c (attrs_obstack): Remove.
1511 (pre_prologue_obstack, post_prologue_obstack): New.
1512 * src/reader.c (copy_definition): Add a parameter to specify the
1513 obstack to fill, instead of using attrs_obstack unconditionally.
1514 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1515 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1516
15172002-04-23 Paul Eggert <eggert@twinsun.com>
1518
1519 * data/bison.simple: Remove unnecessary commentary and white
1520 space differences from 1_29-branch.
1521 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1522
1523 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1524 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1525 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1526 constructors or destructors.
1527
1528 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1529
15302002-04-23 Akim Demaille <akim@epita.fr>
1531
1532 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1533 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1534 location with columns.
1535 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1536 All reported by Paul Eggert.
1537
15382002-04-22 Akim Demaille <akim@epita.fr>
1539
1540 * src/reduce.c (dump_grammar): Move to...
1541 * src/gram.h, src/gram.c (grammar_dump): here.
1542 Be sure to separate long item numbers.
1543 Don't read the members of a rule's prec if its nil.
1544
15452002-04-22 Akim Demaille <akim@epita.fr>
1546
1547 * src/output.c (table_size, table_grow): New.
1548 (MAXTABLE): Remove, replace uses with table_size.
1549 (pack_vector): Instead of dying when the table is too big, grow it.
1550
15512002-04-22 Akim Demaille <akim@epita.fr>
1552
1553 * data/bison.simple (yyr1): Its type is that of a token number.
1554 * data/bison.c++ (r1_): Likewise.
1555 * tests/regression.at (Web2c Actions): Adjust.
1556
15572002-04-22 Akim Demaille <akim@epita.fr>
1558
1559 * src/reader.c (token_translations_init): 256 is now the default
1560 value for the error token, i.e., it will be assigned another
1561 number if the user assigned 256 to one of her tokens.
1562 (reader): Don't force 256 to error.
1563 * doc/bison.texinfo (Symbols): Adjust.
1564 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1565 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1566 etc. instead of 10, 20, 30 (which was used to `jump' over error
1567 (256) and undefined (2)).
1568
15692002-04-22 Akim Demaille <akim@epita.fr>
1570
1571 Propagate more token_number_t.
1572
1573 * src/gram.h (token_number_as_item_number)
1574 (item_number_as_token_number): New.
1575 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1576 Use it to create output_item_number_table and
1577 output_token_number_table.
1578 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1579 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1580 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1581 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1582
15832002-04-22 Akim Demaille <akim@epita.fr>
1584
1585 * src/output.h, src/output.c (get_lines_number): Remove.
1586
15872002-04-19 Akim Demaille <akim@epita.fr>
1588
1589 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1590 as Lex/Flex'.
1591 (Debugging): More details about enabling the debugging features.
1592 (Table of Symbols): Describe $$, $n, @$, and @n.
1593 Suggested by Tim Josling.
1594
15952002-04-19 Akim Demaille <akim@epita.fr>
1596
1597 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1598
15992002-04-10 Akim Demaille <akim@epita.fr>
1600
1601 * src/system.h: Rely on HAVE_LIMITS_H.
1602 Suggested by Paul Eggert.
1603
16042002-04-09 Akim Demaille <akim@epita.fr>
1605
1606 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1607 full stderr, and strip it according to the bison options, instead
1608 of composing the error message from different bits.
1609 This makes it easier to check for several error messages.
1610 Adjust all the invocations.
1611 Add an invocation exercising the error token.
1612 Add an invocation demonstrating a stupid error message.
1613 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1614 Adjust the tests.
1615 Error message are for stderr, not stdout.
1616
16172002-04-09 Akim Demaille <akim@epita.fr>
1618
1619 * src/gram.h, src/gram.c (error_token_number): Remove, use
1620 errtoken->number.
1621 * src/reader.c (reader): Don't specify the user token number (2)
1622 for $undefined, as it uselessly prevents using it.
1623 * src/gram.h (token_number_t): Move to...
1624 * src/symtab.h: here.
1625 (state_t.number): Is a token_number_t.
1626 * src/print.c, src/reader.c: Use undeftoken->number instead of
1627 hard coded 2.
1628 (Even though this 2 is not the same as above: the number of the
1629 undeftoken remains being 2, it is its user token number which
1630 might not be 2).
1631 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1632 `user_token_number_max'.
1633 Output `undef_token_number'.
1634 * data/bison.simple, data/bison.c++: Use them.
1635 Be sure to map invalid yylex return values to
1636 `undef_token_number'. This saves us from gratuitous SEGV.
1637
1638 * tests/conflicts.at (Solved SR Conflicts)
1639 (Unresolved SR Conflicts): Adjust.
1640 * tests/regression.at (Web2c Actions): Adjust.
1641
16422002-04-08 Akim Demaille <akim@epita.fr>
1643
1644 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1645 Adding #line.
1646 Remove the duplicate `typedefs'.
1647 (RhsNumberType): Fix the declaration and various other typos.
1648 Use __ofile__.
1649 * data/bison.simple: Use __ofile__.
1650 * src/scan-skel.l: Handle __ofile__.
1651
16522002-04-08 Akim Demaille <akim@epita.fr>
1653
1654 * src/gram.h (item_number_t): New, the type of item numbers in
1655 RITEM. Note that it must be able to code symbol numbers as
1656 positive number, and the negation of rule numbers as negative
1657 numbers.
1658 Adjust all dependencies (pretty many).
1659 * src/reduce.c (rule): Remove this `short *' pointer: use
1660 item_number_t.
1661 * src/system.h (MINSHORT, MAXSHORT): Remove.
1662 Include `limits.h'.
1663 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1664 (shortcpy): Remove.
1665 (MAXTABLE): Move to...
1666 * src/output.c (MAXTABLE): here.
1667 (prepare_rules): Use output_int_table to output rhs.
1668 * data/bison.simple, data/bison.c++: Adjust.
1669 * tests/torture.at (Big triangle): Move the limit from 254 to
1670 500.
1671 * tests/regression.at (Web2c Actions): Ajust.
1672
1673 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1674 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1675 passes, but produces negative #line number, once fixed, GCC is
1676 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1677 C), it passes.
1678 * src/state.h (state_h): Code input lines on ints, not shorts.
1679
16802002-04-08 Akim Demaille <akim@epita.fr>
1681
1682 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1683 and then the grammar.
1684
16852002-04-08 Akim Demaille <akim@epita.fr>
1686
1687 * src/system.h: No longer using strndup.
1688
16892002-04-07 Akim Demaille <akim@epita.fr>
1690
1691 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1692 * src/output.c (output_table_data): Return the longest number.
1693 (prepare_tokens): Output `token_number_max').
1694 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1695 New.
1696 Use them to define yy_token_number_type/TokenNumberType.
1697 Use this type for yytranslate.
1698 * tests/torture.at (Big triangle): Push the limit from 124 to
1699 253.
1700 * tests/regression.at (Web2c Actions): Adjust.
1701
17022002-04-07 Akim Demaille <akim@epita.fr>
1703
1704 * tests/torture.at (Big triangle): New.
1705 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1706 * tests/existing.at: here.
1707
17082002-04-07 Akim Demaille <akim@epita.fr>
1709
1710 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1711 nritems.
1712 Adjust dependencies.
1713
17142002-04-07 Akim Demaille <akim@epita.fr>
1715
1716 * src/reader.c: Normalize increments to prefix form.
1717
17182002-04-07 Akim Demaille <akim@epita.fr>
1719
1720 * src/reader.c, symtab.c: Remove debugging code.
1721
17222002-04-07 Akim Demaille <akim@epita.fr>
1723
1724 Rename all the `bucket's as `symbol_t'.
1725
1726 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1727 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1728 * src/symtab.c, src/symtab.h (bucket): Rename as...
1729 (symbol_t): this.
1730 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1731 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1732 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1733 (buckets_new, buckets_free, buckets_do): Rename as...
1734 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1735 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1736 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1737 (symbols_new, symbols_free, symbols_do): these.
1738
17392002-04-07 Akim Demaille <akim@epita.fr>
1740
1741 Use lib/hash for the symbol table.
1742
1743 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1744 EOF.
1745 * src/lex.c (lex): Set the `number' member of new terminals.
1746 * src/reader.c (bucket_check_defined, bucket_make_alias)
1747 (bucket_check_alias_consistence, bucket_translation): New.
1748 (reader, grammar_free, readgram, token_translations_init)
1749 (packsymbols): Adjust.
1750 (reader): Number the predefined tokens.
1751 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1752 for predefined tokens.
1753 * src/symtab.h (bucket): Remove all the hash table related
1754 members.
1755 * src/symtab.c (symtab): Replace by...
1756 (bucket_table): this.
1757 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1758 (buckets_new, buckets_do): New.
1759
17602002-04-07 Akim Demaille <akim@epita.fr>
1761
1762 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1763 (start_symbol, max_user_token_number, semantic_parser)
1764 (error_token_number): Initialize.
1765 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1766 Initialize.
1767 (reader): Don't.
1768 (errtoken, eoftoken, undeftoken, axiom): Extern.
1769
17702002-04-07 Akim Demaille <akim@epita.fr>
1771
1772 * src/gram.h (rule_s): prec and precsym are now pointers
1773 to the bucket giving the priority/associativity.
1774 Member `associativity' removed: useless.
1775 * src/reduce.c, src/conflicts.c: Adjust.
1776
17772002-04-07 Akim Demaille <akim@epita.fr>
1778
1779 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1780 Properly escape the symbols' TAG when outputting them.
1781
17822002-04-07 Akim Demaille <akim@epita.fr>
1783
1784 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1785
17862002-04-07 Akim Demaille <akim@epita.fr>
1787
1788 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1789 (LArule): this, which is an array to rule_t*.
1790 * src/print.c, src/conflicts.c: Adjust.
1791
17922002-04-07 Akim Demaille <akim@epita.fr>
1793
1794 * src/gram.h (rule_t): Rename `number' as `user_number'.
1795 `number' is a new member.
1796 Adjust dependencies.
1797 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1798
17992002-04-07 Akim Demaille <akim@epita.fr>
1800
1801 As a result of the previous patch, it is no longer needed
1802 to reorder ritem itself.
1803
1804 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1805
18062002-04-07 Akim Demaille <akim@epita.fr>
1807
1808 Be sure never to walk through RITEMS, but use only data related to
1809 the rules themselves. RITEMS should be banished.
1810
1811 * src/output.c (output_token_translations): Rename as...
1812 (prepare_tokens): this.
1813 In addition to `translate', prepare the muscles `tname' and
1814 `toknum', which were handled by...
1815 (output_rule_data): this.
1816 Remove, and move the remainder of its outputs into...
1817 (prepare_rules): this new routines, which also merges content from
1818 (output_gram): this.
1819 (prepare_rules): Be sure never to walk through RITEMS.
1820 (output_stos): Rename as...
1821 (prepare_stos): this.
1822 (output): Always invoke prepare_states, after all, just don't use it
1823 in the output if you don't need it.
1824
18252002-04-07 Akim Demaille <akim@epita.fr>
1826
1827 * src/LR0.c (new_state): Display `nstates' as the name of the
1828 newly created state.
1829 Adjust to initialize first_state and last_state if needed.
1830 Be sure to distinguish the initial from the final state.
1831 (new_states): Create the itemset of the initial state, and use
1832 new_state.
1833 * src/closure.c (closure): Now that the initial state has its
1834 items properly set, there is no need for a special case when
1835 creating `ruleset'.
1836
1837 As a result, now the rule 0, reducing to $axiom, is visible in the
1838 outputs. Adjust the test suite.
1839
1840 * tests/conflicts.at (Solved SR Conflicts)
1841 (Unresolved SR Conflicts): Adjust.
1842 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1843 * tests/conflicts.at (S/R in initial): New.
1844
18452002-04-07 Akim Demaille <akim@epita.fr>
1846
1847 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1848 the RHS of the rules.
1849 * src/output.c (output_gram): Likewise.
1850
18512002-04-07 Akim Demaille <akim@epita.fr>
1852
1853 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1854 bucket.
1855 Adjust all dependencies.
1856 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1857 `number' of the buckets too.
1858 * src/gram.h: Include `symtab.h'.
1859 (associativity): Move to...
1860 * src/symtab.h: here.
1861 No longer include `gram.h'.
1862
18632002-04-07 Akim Demaille <akim@epita.fr>
1864
1865 * src/gram.h, src/gram.c (rules_rhs_length): New.
1866 (ritem_longest_rhs): Use it.
1867 * src/gram.h (rule_t): `number' is a new member.
1868 * src/reader.c (packgram): Set it.
1869 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1870 the end of `rules', and count them out of `nrules'.
1871 (reduce_output, dump_grammar): Adjust.
1872 * src/print.c (print_grammar): It is no longer needed to check for
1873 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1874 * tests/reduce.at (Reduced Automaton): New test.
1875
18762002-04-07 Akim Demaille <akim@epita.fr>
1877
1878 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1879 lacking `+ 1' to nrules, Bison reported as useless a token if it
1880 was used solely to set the precedence of the last rule...
1881
18822002-04-07 Akim Demaille <akim@epita.fr>
1883
1884 * data/bison.c++, data/bison.simple: Don't output the current file
1885 name in #line, to avoid useless diffs between two identical
1886 outputs under different names.
1887
18882002-04-07 Akim Demaille <akim@epita.fr>
1889
1890 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1891 Normalize loops to using `< nrules + 1', not `<= nrules'.
1892
18932002-04-07 Akim Demaille <akim@epita.fr>
1894
1895 * TODO: Update.
1896
18972002-04-07 Akim Demaille <akim@epita.fr>
1898
1899 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1900 bucket.value as bucket.number.
1901
19022002-04-07 Akim Demaille <akim@epita.fr>
1903
1904 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1905 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1906 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1907 RHS, instead of being an index in RITEMS.
1908
19092002-04-04 Paul Eggert <eggert@twinsun.com>
1910
1911 * doc/bison.texinfo: Update copyright date.
1912 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1913 (Symbols): Warn about running Bison in one character set,
1914 but compiling and/or running in an incompatible one.
1915 Warn about character code 256, too.
1916
19172002-04-03 Paul Eggert <eggert@twinsun.com>
1918
1919 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1920 YYERROR_VERBOSE is nonzero, not whether it is defined.
1921
1922 Merge changes from bison-1_29-branch.
1923
19242002-03-20 Paul Eggert <eggert@twinsun.com>
1925
1926 Merge fixes from Debian bison_1.34-1.diff.
1927
1928 * configure.in (AC_PREREQ): 2.53.
1929
19302002-03-20 Akim Demaille <akim@epita.fr>
1931
1932 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1933
19342002-03-19 Paul Eggert <eggert@twinsun.com>
1935
1936 * src/bison.simple (YYCOPY): New macro.
1937 (YYSTACK_RELOCATE): Use it.
1938 Remove Type arg; no longer needed. All callers changed.
1939 (yymemcpy): Remove; no longer needed.
1940
1941 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1942 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1943
19442002-03-19 Akim Demaille <akim@epita.fr>
1945
1946 Test and fix the #line outputs.
1947
1948 * tests/atlocal.at (GCC): New.
1949 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1950 (Prologue synch line, ,%union synch line, Postprologue synch line)
1951 (Action synch line, Epilogue synch line): New tests.
1952 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1953 * data/bison.simple, data/bison.c++: Use it.
1954
19552002-03-19 Akim Demaille <akim@epita.fr>
1956
1957 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1958 (Solved SR Conflicts, %expect not enough, %expect right)
1959 (%expect too much): Move to...
1960 * tests/conflicts.at: this new file.
1961
19622002-03-19 Akim Demaille <akim@epita.fr>
1963
1964 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1965 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1966 that we can move to enums for instance.
1967 * src/output.c (token_definitions_output): Output a list of
1968 `token-name, token-number' instead of the #define.
1969 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1970
19712002-03-14 Akim Demaille <akim@epita.fr>
1972
1973 Use Gettext 0.11.1.
1974
19752002-03-09 Robert Anisko <robert@lrde.epita.fr>
1976
1977 * data/bison.c++: Make the user able to add members to the generated
1978 parser by subclassing.
1979
19802002-03-05 Robert Anisko <robert@lrde.epita.fr>
1981
1982 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1983 a character.
1984 Reported by Nicolas Tisserand and Nicolas Burrus.
1985
19862002-03-04 Robert Anisko <robert@lrde.epita.fr>
1987
1988 * src/reader.c: Warn about lacking semi-colons, do not complain.
1989
19902002-03-04 Robert Anisko <robert@lrde.epita.fr>
1991
1992 * data/bison.c++: Remove a debug line.
1993
19942002-03-04 Robert Anisko <robert@lrde.epita.fr>
1995
1996 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1997 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1998 provide a default implementation.
1999
20002002-03-04 Akim Demaille <akim@epita.fr>
2001
2002 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
2003 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
2004 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
2005 * tests/semantic.at (Parsing Guards): Similarly.
2006 * src/reader.at (readgram): Complain if the last rule is not ended
2007 with a semi-colon.
2008
20092002-03-04 Akim Demaille <akim@epita.fr>
2010
2011 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
2012 * src/closure.c: here.
2013 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
2014 RTC.
2015 * src/warshall.h, src/warshall.c: Remove.
2016 * tests/sets.at (Broken Closure): Adjust.
2017
20182002-03-04 Akim Demaille <akim@epita.fr>
2019
2020 * src/output.c (output_skeleton): tempdir is const.
2021 bytes_read is unused.
2022
20232002-03-04 Akim Demaille <akim@epita.fr>
2024
2025 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2026 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
2027 Update.
2028 From Michael Hayes.
2029
20302002-03-04 Akim Demaille <akim@epita.fr>
2031
2032 * src/closure.c (closure): `r' is unused.
2033
20342002-03-04 Akim Demaille <akim@epita.fr>
2035
2036 * tests/sets.at (Broken Closure): Add the ending `;'.
2037 * src/reader.at (readgram): Complain if a rule is not ended with a
2038 semi-colon.
2039
20402002-03-04 Akim Demaille <akim@epita.fr>
2041
2042 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
2043 (count_sr_conflicts): Use bitset_count.
2044 * src/reduce.c (inaccessable_symbols): Ditto.
2045 (bits_size): Remove.
2046 * src/warshall.h, src/warshall.c: Convert to bitsetv.
2047
20482002-03-04 Akim Demaille <akim@epita.fr>
2049
2050 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
2051 * src/reduce.c: Remove the `bitset_zero's following the
2052 `bitset_create's, as now it is performed by the latter.
2053
20542002-03-04 Akim Demaille <akim@epita.fr>
2055
2056 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
2057 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
2058 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
2059 latest sources from Michael.
2060
20612002-03-04 Akim Demaille <akim@epita.fr>
2062
2063 * src/output.c (output): Don't free the grammar.
2064 * src/reader.c (grammar_free): New.
2065 * src/main.c (main): Call it and don't free symtab here.
2066
20672002-03-04 Akim Demaille <akim@epita.fr>
2068
2069 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
2070 before returning.
2071 Reported by Benoit Perrot.
2072
20732002-03-04 Akim Demaille <akim@epita.fr>
2074
2075 Use bitset operations when possible, not loops over bits.
2076
2077 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
2078 bitset_or.
2079 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
2080 * src/reduce.c (useless_nonterminals): Formatting changes.
2081 * src/warshall.c (TC): Use bitset_or.
2082
20832002-03-04 Akim Demaille <akim@epita.fr>
2084
2085 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
2086 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
2087 Ditto.
2088
20892002-03-04 Akim Demaille <akim@epita.fr>
2090
2091 * src/lalr.c (F): Now a bitset*.
2092 Adjust all dependencies.
2093
20942002-03-04 Akim Demaille <akim@epita.fr>
2095
2096 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
2097 Adjust all dependencies.
2098
20992002-03-04 Akim Demaille <akim@epita.fr>
2100
2101 * src/L0.c, src/LR0.h (nstates): Be size_t.
2102 Adjust comparisons (signed vs unsigned).
2103 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
2104 bitset*.
2105 Adjust all dependencies.
2106
21072002-03-04 Akim Demaille <akim@epita.fr>
2108
2109 * src/closure.c (firsts): Now, also a bitset.
2110 Adjust all dependencies.
2111 (varsetsize): Remove, now unused.
2112 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2113
21142002-03-04 Akim Demaille <akim@epita.fr>
2115
2116 * src/print.c: Convert to use bitset.h, not hand coded iterations
2117 over ints.
2118
21192002-03-04 Akim Demaille <akim@epita.fr>
2120
2121 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2122
21232002-03-04 Akim Demaille <akim@epita.fr>
2124
2125 * src/closure.c (ruleset): Be a bitset.
2126 (rulesetsize): Remove.
2127
21282002-03-04 Akim Demaille <akim@epita.fr>
2129
2130 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2131 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2132 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2133 * src/closure.c (fderives): Be an array of bitsets.
2134
21352002-02-28 Robert Anisko <robert@lrde.epita.fr>
2136
2137 * data/bison.c++: Merge the two generated headers. Insert a copyright
2138 notice in each output file.
2139
21402002-02-28 Akim Demaille <akim@epita.fr>
2141
2142 * data/bison.c++: Copy the prologue of bison.simple to fetch
2143 useful M4 definitions, such as b4_header_guard.
2144
21452002-02-25 Akim Demaille <akim@epita.fr>
2146
2147 * src/getargs.c (version): Give the name of the authors, and use a
2148 translator friendly scheme for the bgr
2149 copyright notice.
2150
21512002-02-25 Akim Demaille <akim@epita.fr>
2152
2153 * src/output.c (header_output): Remove, now handled completely via
2154 M4.
2155
21562002-02-25 Akim Demaille <akim@epita.fr>
2157
2158 * m4/m4.m4: New, from CVS Autoconf.
2159 * configure.in: Invoke it.
2160 * src/output.c (output_skeleton): Use its result instead of the
2161 hard coded name.
2162
21632002-02-25 Akim Demaille <akim@epita.fr>
2164
2165 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2166 Fileutils 4.1.5.
2167 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2168 * src/output.c (output_skeleton): Use mkstemp to create a real
2169 temporary file.
2170 Move the filling of `skeleton' and its muscle to...
2171 (prepare): here.
2172 (output): Move the definition of the prologue muscle to...
2173 (prepare): here.
2174 * src/system.h (DEFAULT_TMPDIR): New.
2175
21762002-02-14 Paul Eggert <eggert@twinsun.com>
2177
2178 Remove the support for C++ namespace cleanliness; it was
2179 causing more problems than it was curing, since it didn't work
2180 properly on some nonstandard C++ compilers. This can wait
2181 for a proper C++ parser.
2182
2183 * NEWS: Document this.
2184 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2185 of C++, as it's treated like C now.
2186 * src/bison.simple (YYSTD): Remove.
2187 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2188 Treat C++ just like Standard C instead of trying to support
2189 namespace cleanliness.
2190
21912002-02-14 Akim Demaille <akim@epita.fr>
2192
2193 * tests/regression.at (else): Adjust to Andreas' change.
2194
21952002-02-14 Akim Demaille <akim@epita.fr>
2196
2197 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2198
21992002-02-13 Andreas Schwab <schwab@suse.de>
2200
2201 * src/output.c (output_rule_data): Don't output NULL, it might
2202 not be defined yet.
2203
22042002-02-11 Robert Anisko <robert@lrde.epita.fr>
2205
2206 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2207 (Copyright notice): Update.
2208
22092002-02-11 Akim Demaille <akim@epita.fr>
2210
2211 * tests/regression.at (%nonassoc and eof): Don't include
2212 nonportable headers.
2213
22142002-02-08 Robert Anisko <robert@lrde.epita.fr>
2215
2216 * data/bison.c++: Correct error recovery. Make the user able to
2217 initialize the starting location.
2218
22192002-02-07 Akim Demaille <akim@epita.fr>
2220
2221 * tests/input.at: New.
2222
22232002-02-07 Robert Anisko <robert@lrde.epita.fr>
2224
2225 * data/bison.c++: Replace some direct m4 expansions by constants. Be
2226 more consistent when naming methods and variables. Put preprocessor
2227 directives around tables only needed for debugging.
2228
22292002-02-07 Robert Anisko <robert@lrde.epita.fr>
2230
2231 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2232 C++ parsers.
2233 (yy::b4_name::parse): Use print_.
2234
22352002-02-07 Robert Anisko <robert@lrde.epita.fr>
2236
2237 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2238
22392002-02-07 Robert Anisko <robert@lrde.epita.fr>
2240
2241 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2242 C++ parsers.
2243 (yy::b4_name::parse): Build verbose error messages, and use error_.
2244
22452002-02-06 Robert Anisko <robert@lrde.epita.fr>
2246
2247 * data/bison.c++: Fix m4 quoting in comments.
2248
22492002-02-06 Robert Anisko <robert@lrde.epita.fr>
2250
2251 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2252 not expanded by m4.
2253
22542002-02-05 Akim Demaille <akim@epita.fr>
2255
2256 * data/bison.c++: Adjust to the M4 back end.
2257 More is certainly needed.
2258
22592002-02-05 Akim Demaille <akim@epita.fr>
2260
2261 Give a try to M4 as a back end.
2262
2263 * lib/readpipe.c: New, from wdiff.
2264 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2265 BISON_HAIRY.
2266 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2267 specific values. Now it is m4 that performs the lookup.
2268 * src/parse-skel.y: Remove.
2269 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2270 * src/output.c (actions_output, guards_output)
2271 (token_definitions_output): No longer keeps track of the output
2272 line number, hence remove the second argument.
2273 (guards_output): Check against the guard member of a rule, not the
2274 action member.
2275 Adjust callers.
2276 (output_skeleton): Don't look for the skeleton location, let m4 do
2277 that.
2278 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2279 file will be used.
2280 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2281 (prepare): Given that for the time being changesyntax is not
2282 usable in M4, rename the muscles using `-' to `_'.
2283 Define `defines_flag', `output_parser_name' and `output_header_name'.
2284 * src/output.h (actions_output, guards_output)
2285 (token_definitions_output): Adjust prototypes.
2286 * src/scan-skel.l: Instead of scanning the skeletons, it now
2287 processes the output of m4: `__oline__' and `#output'.
2288 * data/bison.simple: Adjust to be used by M4(sugar).
2289 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2290 to date.
2291 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2292 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2293 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2294 shamelessly stolen from CVS Autoconf.
2295
22962002-02-05 Akim Demaille <akim@epita.fr>
2297
2298 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2299 * configure.in: Check for the declarations of free and malloc.
2300 * src/muscle_tab.c: Adjust.
2301
23022002-02-05 Akim Demaille <akim@epita.fr>
2303
2304 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2305 which have no values.
2306
23072002-02-05 Akim Demaille <akim@epita.fr>
2308
2309 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2310 * data/: here.
2311
23122002-01-29 Paul Eggert <eggert@twinsun.com>
2313
2314 * src/bison.simple (YYSIZE_T): Do not define merely because
2315 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2316 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2317
23182002-01-27 Akim Demaille <akim@epita.fr>
2319
2320 Fix `%nonassoc and eof'.
2321
2322 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2323 which were not properly copied! Replace
2324 memcpy (res->errs, src->errs, src->nerrs);
2325 with
2326 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2327 !!!
2328 * tests/regression.at (%nonassoc and eof): Adjust to newest
2329 Autotest: `.' is not in the PATH.
2330
23312002-01-27 Akim Demaille <akim@epita.fr>
2332
2333 * tests/sets.at (AT_EXTRACT_SETS): New.
2334 (Nullable): Use it.
2335 (Firsts): New.
2336
23372002-01-26 Akim Demaille <akim@epita.fr>
2338
2339 * tests/actions.at, tests/calc.at, tests/headers.at,
2340 * tests/torture.at: Adjust to the newest Autotest which no longer
2341 forces `.' in the PATH.
2342
23432002-01-25 Akim Demaille <akim@epita.fr>
2344
2345 * tests/regression.at (%nonassoc and eof): New.
2346 Suggested by Robert Anisko.
2347
23482002-01-24 Akim Demaille <akim@epita.fr>
2349
2350 Bison dumps core when trying to complain about broken input files.
2351 Reported by Cris van Pelt.
2352
2353 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2354 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2355 into...
2356 (Invalid inputs): Strengthen: exercise parse_percent_token.
2357
23582002-01-24 Robert Anisko <robert.anisko@epita.fr>
2359
2360 * src/Makefile.am: Add bison.c++.
2361 * src/bison.c++: New skeleton.
2362
23632002-01-21 Paolo Bonzini <bonzini@gnu.org>
2364
2365 * po/it.po: New.
2366
23672002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2368
2369 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2370
23712002-01-20 Marc Autret <marc@gnu.org>
2372
2373 * src/files.c (compute_output_file_names): Fix
2374
23752002-01-20 Marc Autret <marc@gnu.org>
2376
2377 * tests/output.at: New test.
2378 * src/files.c (compute_base_names): Don't map extensions when
2379 the YACC flag is set, use defaults.
2380 Reported by Evgeny Stambulchik.
2381
23822002-01-20 Marc Autret <marc@gnu.org>
2383
2384 * src/system.h: Need to define __attribute__ away for non-GCC
2385 compilers as well (i.e. the vendor C compiler).
2386 Suggested by Albert Chin-A-Young.
2387
23882002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2389
2390 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2391 canonical definition.
2392 * src/system.h: Use the canonical definition for PARAMS (avoids
2393 a conflict with the macro from lib/hash.h).
2394
23952002-01-11 Akim Demaille <akim@epita.fr>
2396
2397 * configure.in: Use AC_FUNC_STRNLEN.
2398 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
2399
24002002-01-09 Akim Demaille <akim@epita.fr>
2401
2402 * src/files.c, src/files.h (output_infix): New.
2403 (tab_extension): Remove.
2404 (compute_base_names): Compute the former, drop the latter.
2405 * src/output.c (prepare): Insert the muscles `output-infix', and
2406 `output-suffix'.
2407 * src/parse-skel.y (string, string.1): New.
2408 (section.header): Use it.
2409 (section.yacc): Remove.
2410 (prefix): Remove too.
2411 * src/scan-skel.l: Adjust.
2412 * src/bison.simple, src/bison.hairy: Adjust.
2413
24142002-01-09 Akim Demaille <akim@epita.fr>
2415
2416 * configure.in (WERROR_CFLAGS): Compute it.
2417 * src/Makefile.am (CFLAGS): Pass it.
2418 * tests/atlocal.in (CFLAGS): Idem.
2419 * src/files.c: Fix a few warnings.
2420 (get_extension_index): Remove, unused.
2421
24222002-01-08 Akim Demaille <akim@epita.fr>
2423
2424 * src/getargs.c (AS_FILE_NAME): New.
2425 (getargs): Use it to convert DOSish file names.
2426 * src/files.c (base_name): Rename as full_base_name to avoid
2427 clashes with `base_name ()'.
2428 (filename_split): New.
2429 (compute_base_names): N-th rewrite, using filename_split.
2430
24312002-01-08 Akim Demaille <akim@epita.fr>
2432
2433 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2434 New, stolen from the Fileutils 4.1.
2435 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2436 * configure.in: Check for the presence of memrchr, and of its
2437 prototype.
2438
24392002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2440
2441 * lib/hash.h (__P): Added definition for this macro.
2442 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2443 BUILT_SOURCES, to ensure they are generated first.
2444 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2445 %error-verbose to allow bootstrapping with bison 1.30x.
2446
24472002-01-06 Akim Demaille <akim@epita.fr>
2448
2449 * src/reader.c (parse_braces): Don't fetch the next char, the
2450 convention is to fetch on entry.
2451 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2452 'switch' without a following semicolon.
2453 * tests/regression.at (braces parsing): New.
2454
24552002-01-06 Akim Demaille <akim@epita.fr>
2456
2457 Bison is dead wrong in its RR conflict reports.
2458
2459 * tests/torture.at (GNU Cim Grammar): New.
2460 * src/conflicts.c (count_rr_conflicts): Fix.
2461
24622002-01-06 Akim Demaille <akim@epita.fr>
2463
2464 Creating package.m4 from configure.ac causes too many problems.
2465
2466 * tests/Makefile.am (package.m4): Create it by hand,
2467 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2468
24692002-01-06 Akim Demaille <akim@epita.fr>
2470
2471 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2472 skeleton.h.
2473
24742002-01-04 Paul Eggert <eggert@twinsun.com>
2475
2476 * doc/bison.texinfo (Debugging):
2477 Remove YYSTDERR; it's no longer defined or used.
2478 Also, s/cstdio.h/cstdio/.
2479
24802002-01-03 Akim Demaille <akim@epita.fr>
2481
2482 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2483
24842002-01-03 Akim Demaille <akim@epita.fr>
2485
2486 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2487 tracing code to --trace, wait for a better --trace option, with
2488 args.
2489
24902002-01-03 Akim Demaille <akim@epita.fr>
2491
2492 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2493 The ISO C++ standard is extremely clear about it: stderr is
2494 considered a macro, not a regular symbol (see table 94 `Header
2495 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2496 Therefore std:: does not apply to it. It still does with fprintf.
2497 Also, s/cstdio.h/cstdio/.
2498
24992002-01-03 Akim Demaille <akim@epita.fr>
2500
2501 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2502 for non system headers.
2503
25042002-01-02 Akim Demaille <akim@epita.fr>
2505
2506 Equip the skeleton chain with location tracking, runtime trace,
2507 pure parser and scanner.
2508
2509 * src/parse-skel.y: Request a pure parser, locations, and prefix
2510 renaming.
2511 (%union): Having several members with the same type does not help
2512 type mismatches, simplify.
2513 (YYPRINT, yyprint): New.
2514 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2515 (skel_error): this.
2516 Handle locations.
2517 * src/scan-skel.l: Adjust to these changes.
2518 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2519 (LOCATION_PRINT, skel_control_t): New.
2520
25212001-12-30 Akim Demaille <akim@epita.fr>
2522
2523 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2524 replace `gb' with BLANKS.
2525 * src/scan-skel.l: Adjust.
2526
25272001-12-30 Akim Demaille <akim@epita.fr>
2528
2529 * src/system.h: We don't need nor want bcopy.
2530 Throw away MS-DOS crap: we don't need getpid.
2531 * configure.in: We don't need strndup. It was even causing
2532 problems: because Flex includes the headers *before* us,
2533 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2534 not visible.
2535 * lib/xstrndup.c: New.
2536 * src/scan-skel.l: Use it.
2537 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2538 * src/parse-skel.y: Use %directives instead of #defines.
2539
25402001-12-30 Akim Demaille <akim@epita.fr>
2541
2542 * src/skeleton.h: New.
2543 * src/output.c (output_parser, output_master_parser): Remove, dead
2544 code.
2545 * src/output.h (get_lines_number, actions_output, guards_output)
2546 (token_definitions_output): Prototype them.
2547 * src/parse-skel.y: Add the license notice.
2548 Include output.h and skeleton.h.
2549 (process_skeleton): Returns void, and takes a single parameter.
2550 * src/scan-skel.l: Add the license notice.
2551 Include skeleton.h.
2552 Don't use %option yylineno: it seems that then Flex imagines
2553 REJECT has been used, and therefore it won't reallocate its
2554 buffers (which makes no other sense to me than a bug). It results
2555 in warnings for `unused: yy_flex_realloc'.
2556
25572001-12-30 Robert Anisko <robert.anisko@epita.fr>
2558
2559 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2560 (MUSCLE_INSERT_PREFIX): ...to there.
2561 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2562 (MUSCLE_INSERT_PREFIX): Move from here...
2563
2564 * src/bison.hairy: Add a section directive. Put braces around muscle
2565 names. This parser skeleton is still broken, but Bison should not
2566 choke on a bad muscle 'syntax'.
2567 * src/bison.simple: Add a section directive. Put braces around muscle
2568 names.
2569
2570 * src/files.h (strsuffix, stringappend): Add declarations.
2571 (tab_extension): Add declaration.
2572 (short_base_name): Add declaration.
2573
2574 * src/files.c (strsuffix, stringappend): No longer static. These
2575 functions are used in the skeleton parser.
2576 (tab_extension): New.
2577 (compute_base_names): Use the computations done in this function
2578 to guess if the generated parsers should have '.tab' in their
2579 names.
2580 (short_base_name): No longer static.
2581
2582 * src/output.c (output_skeleton): New.
2583 (output): Disable call to output_master_parser, and give a try to
2584 a new skeleton handling system.
2585 (guards_output, actions_output): No longer static.
2586 (token_definitions_output, get_lines_number): No longer static.
2587
2588 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2589
2590 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
2591 parse-skel.y.
2592
2593 * src/parse-skel.y: New file.
2594 * src/scan-skel.l: New file.
2595
25962001-12-29 Akim Demaille <akim@epita.fr>
2597
2598 %name-prefix is broken.
2599
2600 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2601 Adjust all dependencies.
2602 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2603 %name-prefix.
2604
2605 Renaming yylval but not yylloc is not consistent. Now we do.
2606
2607 * src/bison.simple: Prefix yylloc if used.
2608 * doc/bison.texinfo (Decl Summary): Document that.
2609
26102001-12-29 Akim Demaille <akim@epita.fr>
2611
2612 * doc/bison.texinfo: Promote `%long-directive' over
2613 `%long_directive'.
2614 Remove all references to fixed-output-files, yacc is enough.
2615
26162001-12-29 Akim Demaille <akim@epita.fr>
2617
2618 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2619 user prologue. These are defaults.
2620 * tests/actions.at (Mid-rule actions): Make sure the user can
2621 define YYDEBUG and YYERROR_VERBOSE.
2622
26232001-12-29 Akim Demaille <akim@epita.fr>
2624
2625 * src/output.c (header_output): Don't forget to export YYLTYPE and
2626 yylloc.
2627 * tests/headers.at (export YYLTYPE): New, make sure it does.
2628 * tests/regression.at (%union and --defines, Invalid CPP headers):
2629 Move to...
2630 * tests/headers.at: here.
2631
26322001-12-29 Akim Demaille <akim@epita.fr>
2633
2634 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2635
26362001-12-29 Akim Demaille <akim@epita.fr>
2637
2638 * tests/actions.at (Mid-rule actions): Output on a single line
2639 instead of several.
2640
26412001-12-29 Akim Demaille <akim@epita.fr>
2642
2643 * doc/bison.texinfo: Formatting changes.
2644
26452001-12-29 Akim Demaille <akim@epita.fr>
2646
2647 Don't store the token defs in a muscle, just be ready to output it
2648 on command. Now possible via `symbols'. Fixes a memory leak.
2649
2650 * src/output.c (token_definitions_output): New.
2651 (output_parser, header_output): Use it.
2652 * src/reader.c (symbols_save): Remove.
2653
26542001-12-29 Akim Demaille <akim@epita.fr>
2655
2656 * src/bison.simple: Do not provide a default for YYSTYPE and
2657 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2658 default.
2659
26602001-12-29 Akim Demaille <akim@epita.fr>
2661
2662 Mid-rule actions are simply... ignored!
2663
2664 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2665 the empty-rule associated to the dummy symbol, not to the host
2666 rule.
2667 * tests/actions.at (Mid-rule actions): New.
2668
26692001-12-29 Akim Demaille <akim@epita.fr>
2670
2671 Memory leak.
2672
2673 * src/reader.c (reader): Free grammar.
2674
26752001-12-29 Akim Demaille <akim@epita.fr>
2676
2677 Memory leak.
2678
2679 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2680 since it allocates it for each state, although only one is needed.
2681 (allocate_storage): Do it here.
2682
26832001-12-29 Akim Demaille <akim@epita.fr>
2684
2685 * src/options.h, src/options.c (create_long_option_table): Rename
2686 as...
2687 (long_option_table_new): this, with a clearer prototype.
2688 (percent_table): Remove, unused,
2689 * src/getargs.c (getargs): Adjust.
2690
26912001-12-29 Akim Demaille <akim@epita.fr>
2692
2693 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2694 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2695 as states.
2696
26972001-12-29 Akim Demaille <akim@epita.fr>
2698
2699 * src/lalr.c (build_relations): Rename `states' as `states1'.
2700 Sorry, I don't understand exactly what it is, no better name...
2701
27022001-12-29 Akim Demaille <akim@epita.fr>
2703
2704 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2705 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2706 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2707 as rules.
2708
27092001-12-29 Akim Demaille <akim@epita.fr>
2710
2711 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2712 ago.
2713
27142001-12-29 Akim Demaille <akim@epita.fr>
2715
2716 * src/reader.c, src/reader.h (user_toknums): Remove.
2717 Adjust all users to use symbols[i]->user_token_number.
2718
27192001-12-29 Akim Demaille <akim@epita.fr>
2720
2721 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2722 Adjust all users to use symbols[i]->prec or ->assoc.
2723
27242001-12-29 Akim Demaille <akim@epita.fr>
2725
2726 * src/reader.c, src/reader.h (tags): Remove.
2727 Adjust all users to use symbols[i]->tag.
2728
27292001-12-29 Akim Demaille <akim@epita.fr>
2730
2731 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2732 and rule_table.
2733 * src/reader.c (packsymbols): Fill this table.
2734 Drop sprec.
2735 * src/conflicts.c (resolve_sr_conflict): Adjust.
2736 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2737 single table.
2738 Use symbols[i]->tag instead of tags[i].
2739
27402001-12-29 Akim Demaille <akim@epita.fr>
2741
2742 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2743 In addition, put a comment in there, to replace...
2744 * tests/regression.at (%union and C comments): Remove.
2745
27462001-12-29 Akim Demaille <akim@epita.fr>
2747
2748 * tests/regression.at (Web2c Actions): Blindly move the actual
2749 output as expected output. The contents *seem* right to me, but I
2750 can't pretend reading perfectly parser tables... Nonetheless, all
2751 the other tests pass correctly, the table look OK, even though the
2752 presence of `$axiom' is to be noted: AFAICS it is useless (but
2753 harmless).
2754
27552001-12-29 Akim Demaille <akim@epita.fr>
2756
2757 * src/reader.c (readgram): Don't add the rule 0 if there were no
2758 rules read. In other words, add it _after_ having performed
2759 grammar sanity checks.
2760 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2761
27622001-12-29 Akim Demaille <akim@epita.fr>
2763
2764 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2765 visible, and some states have now a different number.
2766
27672001-12-29 Akim Demaille <akim@epita.fr>
2768
2769 * src/reader.c (readgram): Bind the initial rule's lineno to that
2770 of the first rule.
2771 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2772 (Solved SR Conflicts): Adjust rule 0's line number.
2773
27742001-12-29 Akim Demaille <akim@epita.fr>
2775
2776 Fix the `GAWK Grammar' failure.
2777
2778 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2779 the reductions of the first state which was mistakenly confused
2780 with the final state because precisely final_state was initialized
2781 to 0.
2782 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2783 now noticed by Bison.
2784 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2785 have a reduction on $default.
2786
27872001-12-29 Akim Demaille <akim@epita.fr>
2788
2789 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2790 rule line numbers.
2791 * src/closure.c (print_closure): Likewise.
2792 * src/derives.c (print_derives): Likewise.
2793 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2794 now.
2795
27962001-12-29 Akim Demaille <akim@epita.fr>
2797
2798 * src/lalr.c (lookaheads_print): New.
2799 (lalr): Call it when --trace-flag.
2800 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2801 are dumped.
2802
28032001-12-29 Akim Demaille <akim@epita.fr>
2804
2805 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2806 when walking through ritem, even via rule->rhs.
2807 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2808 (useful_production, useless_nonterminals): Likewise.
2809 (reduce_grammar_tables): Likewise, plus update nritems.
2810 * src/nullable.c (set_nullable): Likewise.
2811 * src/lalr.c (build_relations): Likewise.
2812 * tests/sets.at (Nullable): Adjust.
2813 Fortunately, now, the $axiom is no longer nullable.
2814
28152001-12-29 Akim Demaille <akim@epita.fr>
2816
2817 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2818 the 0-sentinel.
2819 * src/gram.c (ritem_longest_rhs): Likewise.
2820 * src/reduce.c (nonterminals_reduce): Likewise.
2821 * src/print_graph.c (print_graph): Likewise.
2822 * src/output.c (output_rule_data): Likewise.
2823 * src/nullable.c (set_nullable): Likewise.
2824
28252001-12-29 Akim Demaille <akim@epita.fr>
2826
2827 * src/output.c: Comment changes.
2828
28292001-12-27 Paul Eggert <eggert@twinsun.com>
2830
2831 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2832 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2833 Sparc, as they were causing more porting problems than the
2834 (minor) performance improvement was worth.
2835
2836 Also, catch up with 1.31's YYSTD.
2837
28382001-12-27 Akim Demaille <akim@epita.fr>
2839
2840 * src/output.c (output_gram): Rely on nritems, not the
2841 0-sentinel. See below.
2842 Use -1 as separator, not 0.
2843 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2844 Rely on -1 as separator in yyrhs, instead of 0.
2845 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2846 twice `Now at end of input', therefore there are two lines less to
2847 expect.
2848
28492001-12-27 Akim Demaille <akim@epita.fr>
2850
2851 * tests/regression.at (Unresolved SR Conflicts):
2852 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2853 below.
2854
28552001-12-27 Akim Demaille <akim@epita.fr>
2856
2857 * src/LR0.c (new_state): Recognize the final state by the fact it
2858 is reached by eoftoken.
2859 (insert_start_shifting_state, insert_eof_shifting_state)
2860 (insert_accepting_state, augment_automaton): Remove, since now
2861 these states are automatically computed from the initial state.
2862 (generate_states): Adjust.
2863 * src/print.c: When reporting a rule number to the user, substract
2864 1, so that the axiom rule is rule 0, and the first user rule is 1.
2865 * src/reduce.c: Likewise.
2866 * src/print_graph.c (print_core): For the time being, just as for
2867 the report, depend upon --trace-flags to dump the full set of
2868 items.
2869 * src/reader.c (readgram): Once the grammar read, insert the rule
2870 0: `$axiom: START-SYMBOL $'.
2871 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2872 number of the states has changed (the final state is no longer
2873 necessarily the last), catch up.
2874
28752001-12-27 Akim Demaille <akim@epita.fr>
2876
2877 Try to make the use of the eoftoken valid. Given that its value
2878 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2879 is used instead of > 0 where appropriate, (ii), depend upon nritems
2880 instead of the 0-sentinel.
2881
2882 * src/gram.h, src/gram.c (nritems): New.
2883 Expected to be duplication of nitems, but for the time being...
2884 * src/reader.c (packgram): Assert nritems and nitems are equal.
2885 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2886 * src/closure.c (print_closure, print_fderives): Likewise.
2887 * src/gram.c (ritem_print): Likewise.
2888 * src/print.c (print_core, print_grammar): Likewise.
2889 * src/print_graph.c: Likewise.
2890
28912001-12-27 Akim Demaille <akim@epita.fr>
2892
2893 * src/main.c (main): If there are complains after grammar
2894 reductions, then output the report anyway if requested, then die.
2895 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2896 * src/reader.c (eoftoken): New.
2897 (parse_token_decl): If the token being defined has value `0', it
2898 is the eoftoken.
2899 (packsymbols): No longer hack `tags' to insert `$' by hand.
2900 Be sure to preserve the value of the eoftoken.
2901 (reader): Make sure eoftoken is defined.
2902 Initialize nsyms to 0: now eoftoken is created just like the others.
2903 * src/print.c (print_grammar): Don't special case the eof token.
2904 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2905 lie anyway, albeit pleasant.
2906 * tests/calc.at: Exercise error messages with eoftoken.
2907 Change the grammar so that empty input is invalid.
2908 Adjust expectations.
2909 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2910
29112001-12-27 Akim Demaille <akim@epita.fr>
2912
2913 * configure.in: Check the protos of strchr ans strspn.
2914 Replace strchr if needed.
2915 * src/system.h: Provide the protos of strchr, strspn and memchr if
2916 missing.
2917 * lib/strchr.c: New.
2918 * src/reader.c (symbols_save): Use strchr.
2919
29202001-12-27 Akim Demaille <akim@epita.fr>
2921
2922 * src/print.c, src/print_graph.c (escape): New.
2923 Use it to quote the TAGS outputs.
2924 * src/print_graph.c (print_state): Now errors are in red, and
2925 reductions in green.
2926 Prefer high to wide: output the state number on a line of its own.
2927
29282001-12-27 Akim Demaille <akim@epita.fr>
2929
2930 * src/state.h, src/state.c (reductions_new): New.
2931 * src/LR0.c (set_state_table): Let all the states have a
2932 `reductions', even if reduced to 0.
2933 (save_reductions): Adjust.
2934 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2935 * src/print.c (print_reductions, print_actions): Adjust.
2936 * src/output.c (action_row): Adjust.
2937
29382001-12-27 Akim Demaille <akim@epita.fr>
2939
2940 * src/state.h, src/state.c (errs_new, errs_dup): New.
2941 * src/LR0.c (set_state_table): Let all the states have an errs,
2942 even if reduced to 0.
2943 * src/print.c (print_errs, print_reductions): Adjust.
2944 * src/output.c (output_actions, action_row): Adjust.
2945 * src/conflicts.c (resolve_sr_conflict): Adjust.
2946
29472001-12-27 Akim Demaille <akim@epita.fr>
2948
2949 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2950
29512001-12-27 Akim Demaille <akim@epita.fr>
2952
2953 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2954 * src/print.c: here.
2955 (lookaheadset, shiftset): New, used as additional storage by
2956 print_reductions.
2957 (print_results): Adjust.
2958 (print_shifts, print_gotos, print_errs): New, extracted from...
2959 (print_actions): here.
2960 * src/print_graph.c (print_actions): Remove dead code.
2961
29622001-12-27 Akim Demaille <akim@epita.fr>
2963
2964 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2965 `$n' and `@n'.
2966
29672001-12-27 Akim Demaille <akim@epita.fr>
2968
2969 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2970 (build_relations): Adjust.
2971
29722001-12-27 Akim Demaille <akim@epita.fr>
2973
2974 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2975 duplication.
2976
29772001-12-27 Akim Demaille <akim@epita.fr>
2978
2979 * src/reader.c (packgram): Catch nitems overflows.
2980
29812001-12-27 Akim Demaille <akim@epita.fr>
2982
2983 * src/files.c, src/files.h (guard_obstack): Remove.
2984 * src/output.c (output): Adjust.
2985 * src/reader.c (parse_braces): New, factoring...
2986 (copy_action, copy_guard): these two which are renamed as...
2987 (parse_action, parse_guard): these.
2988 As a voluntary consequence, using braces around guards is now
2989 mandatory.
2990
29912001-12-27 Akim Demaille <akim@epita.fr>
2992
2993 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2994 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2995 members.
2996 (symbol_list_new): Adjust.
2997 (copy_action): action_line is the first line, not the last.
2998 (copy_guard): Just as for actions, store the `action' only, not
2999 the switch/case/break flesh.
3000 Don't parse the user action that might follow the guard, let...
3001 (readgram): do it, i.e., now, there can be an action after a
3002 guard.
3003 In other words the guard is just explicitly optional.
3004 (packgram): Adjust.
3005 * src/output.c (guards_output): New.
3006 (output_parser): Call it when needed.
3007 (output): Also free the guard and attrs obstacks.
3008 * src/files.c, src/files.h (obstack_save): Remove.
3009 (output_files): Remove.
3010 As a result, if one needs the former `.act' file, using an
3011 appropriate skeleton which requires actions and guards is now
3012 required.
3013 * src/main.c (main): Adjust.
3014 * tests/semantic.at: New.
3015 * tests/regression.at: Use `input.y' as input file name.
3016 Avoid 8+3 problems by requiring input.c when the test needs the
3017 parser.
3018
30192001-12-27 Akim Demaille <akim@epita.fr>
3020
3021 * src/reader.c (symbol_list_new): Be sure to initialize all the
3022 fields.
3023
30242001-12-27 Akim Demaille <akim@epita.fr>
3025
3026 All the hacks using a final pseudo state are now useless.
3027
3028 * src/LR0.c (set_state_table): state_table holds exactly nstates.
3029 * src/lalr.c (nLA): New.
3030 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
3031 instead of lookaheadsp from the pseudo state (nstate + 1).
3032
30332001-12-27 Akim Demaille <akim@epita.fr>
3034
3035 * src/output.c (action_row, token_actions): Use a state_t instead
3036 of a integer, and nlookaheads instead of the following state's
3037 lookaheadsp.
3038
30392001-12-27 Akim Demaille <akim@epita.fr>
3040
3041 * src/conflicts.c (log_resolution, flush_shift)
3042 (resolve_sr_conflict, set_conflicts, solve_conflicts)
3043 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
3044 (conflicts_print, print_reductions): Use a state_t instead of an
3045 integer when referring to a state.
3046 As much as possible, depend upon nlookaheads, instead of the
3047 `lookaheadsp' member of the following state (since lookaheads of
3048 successive states are successive, the difference between state n + 1
3049 and n served as the number of lookaheads for state n).
3050 * src/lalr.c (add_lookback_edge): Likewise.
3051 * src/print.c (print_core, print_actions, print_state)
3052 (print_results): Likewise.
3053 * src/print_graph.c (print_core, print_actions, print_state)
3054 (print_graph): Likewise.
3055 * src/conflicts.h: Adjust.
3056
30572001-12-27 Akim Demaille <akim@epita.fr>
3058
3059 * src/bison.hairy: Formatting/comment changes.
3060 ANSIfy.
3061 Remove `register' indications.
3062 Add plenty of `static'.
3063
30642001-12-27 Akim Demaille <akim@epita.fr>
3065
3066 * src/output.c (prepare): Drop the muscle `ntbase' which
3067 duplicates ntokens.
3068 * src/bison.simple: Formatting/comment changes.
3069 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
3070 is an undocumented synonym.
3071
30722001-12-22 Akim Demaille <akim@epita.fr>
3073
3074 * src/output.c (output_table_data): Change the prototype to use
3075 `int' for array ranges: some invocations do pass an int, not a
3076 short.
3077 Reported by Wayne Green.
3078
30792001-12-22 Akim Demaille <akim@epita.fr>
3080
3081 Some actions of web2c.y are improperly triggered.
3082 Reported by Mike Castle.
3083
3084 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
3085 * tests/regression.at (Web2c): Rename as...
3086 (Web2c Report): this.
3087 (Web2c Actions): New.
3088
30892001-12-22 Akim Demaille <akim@epita.fr>
3090
3091 Reductions in web2c.y are improperly reported.
3092 Reported by Mike Castle.
3093
3094 * src/conflicts.c (print_reductions): Fix.
3095 * tests/regression.at (Web2c): New.
3096
30972001-12-18 Akim Demaille <akim@epita.fr>
3098
3099 Some host fail on `assert (!"foo")', which expands to
3100 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
3101 Reported by Nelson Beebee.
3102
3103 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
3104 `#define it_succeeded 0' and `assert (it_succeeded)'.
3105
31062001-12-17 Marc Autret <autret_m@epita.fr>
3107
3108 * src/bison.simple: Don't hard code the skeleton line and filename.
3109 * src/output.c (output_parser): Rename 'line' as 'output_line'.
3110 New line counter 'skeleton_line' (skeleton-line muscle).
3111
31122001-12-17 Paul Eggert <eggert@twinsun.com>
3113
3114 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3115 YYDEBUG must be defined to a nonzero value.
3116
3117 * src/bison.simple (yytname): Do not assume that the user defines
3118 YYDEBUG to a properly parenthesized expression.
3119
31202001-12-17 Akim Demaille <akim@epita.fr>
3121
3122 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3123 nlookaheads is a new member.
3124 Adjust all users.
3125 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3126 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3127 state.
3128
31292001-12-17 Akim Demaille <akim@epita.fr>
3130
3131 * src/files.h, src/files.c (open_files, close_files): Remove.
3132 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3133 let...
3134 * src/reader.c (reader): Do it.
3135
31362001-12-17 Akim Demaille <akim@epita.fr>
3137
3138 * src/conflicts.c (print_reductions): Formatting changes.
3139
31402001-12-17 Akim Demaille <akim@epita.fr>
3141
3142 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3143 (flush_reduce): New.
3144 (resolve_sr_conflict): Adjust.
3145
31462001-12-17 Akim Demaille <akim@epita.fr>
3147
3148 * src/output.c (output_obstack): Be static and rename as...
3149 (format_obstack): this, to avoid any confusion with files.c's
3150 output_obstack.
3151 * src/reader.h (muscle_obstack): Move to...
3152 * src/output.h: here, since it's defined in output.c.
3153
31542001-12-17 Akim Demaille <akim@epita.fr>
3155
3156 * src/output.c (action_row, save_column, default_goto)
3157 (sort_actions, matching_state, pack_vector): Better variable
3158 locality.
3159
31602001-12-17 Akim Demaille <akim@epita.fr>
3161
3162 * src/output.c: Various formatting changes.
3163
31642001-12-17 Akim Demaille <akim@epita.fr>
3165
3166 * src/files.c (output_files): Free the output_obstack.
3167 * src/main.c (main): Call print and print_graph conditionally.
3168 * src/print.c (print): Work unconditionally.
3169 * src/print_graph.c (print_graph): Work unconditionally.
3170 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3171
31722001-12-16 Marc Autret <autret_m@epita.fr>
3173
3174 * src/output.c (actions_output): Fix. When we use %no-lines,
3175 there is one less line per action.
3176
31772001-12-16 Marc Autret <autret_m@epita.fr>
3178
3179 * src/bison.simple: Remove a useless #line directive.
3180 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3181 * src/output.c (get_lines_number): New.
3182 (output_parser): Adjust, now takes care about the lines of a
3183 output muscles.
3184 Fix line numbering.
3185 (actions_output): Computes the number of lines taken by actions.
3186 (output_master_parser): Insert new skeleton which is the name of
3187 the output parser file name.
3188
31892001-12-15 Marc Autret <autret_m@epita.fr>
3190
3191 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3192
31932001-12-15 Marc Autret <autret_m@epita.fr>
3194
3195 * src/output.c (output_gram): Keep track of the hairy one.
3196
31972001-12-15 Akim Demaille <akim@epita.fr>
3198
3199 Make `make distcheck' work.
3200
3201 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3202 system.h which uses libgettext.h.
3203
32042001-12-15 Akim Demaille <akim@epita.fr>
3205
3206 * src/nullable.c (set_nullable): Useless rules must be skipped,
3207 otherwise, since we range over their symbols, we might look at a
3208 nonterminal which no longer ``exists'', i.e., it is not counted in
3209 `nvars', hence we overflow our arrays.
3210
32112001-12-15 Akim Demaille <akim@epita.fr>
3212
3213 The header can also be produced directly, without any obstack!
3214 Yahoo!
3215
3216 * src/files.c, src/files.h (defines_obstack): Remove.
3217 (compute_header_macro): Global.
3218 (defines_obstack_save): Remove.
3219 * src/reader.c (parse_union_decl): No longer output to
3220 defines_obstack: its content can be found in the `stype' muscle
3221 anyway.
3222 (output_token_translations): Merge into...
3223 (symbols_output): this.
3224 Rename as...
3225 (symbols_save): this.
3226 (reader): Adjust.
3227 * src/output.c (header_output): New.
3228 (output): Call it.
3229
32302001-12-15 Akim Demaille <akim@epita.fr>
3231
3232 * src/reader.c (parse_union_decl): Instead of handling two obstack
3233 simultaneously, use one to define the `stype' muscle, and use the
3234 value of the latter to fill defines_obstack.
3235 (copy_comment): Remove.
3236 (copy_comment2): Work for a single obstack.
3237 Rename as...
3238 (copy_comment): this.
3239
32402001-12-15 Akim Demaille <akim@epita.fr>
3241
3242 * src/lex.c, src/lex.h (xgetc): No longer static.
3243 * src/reader.c (parse_union_decl): Revamp.
3244
32452001-12-15 Akim Demaille <akim@epita.fr>
3246
3247 Still making progress in separating Bison into (i) input, (ii)
3248 process, (iii) output: now we can directly output the parser file
3249 without using table_obstack at all.
3250
3251 * src/files.c, src/files.h (table_obstack): Bye bye.
3252 (parser_file_name): New.
3253 * src/files.c (compute_output_file_names): Compute it.
3254 * src/output.c (actions_output, output_parser)
3255 (output_master_parser): To a file instead of an obstack.
3256
32572001-12-15 Akim Demaille <akim@epita.fr>
3258
3259 Attach actions to rules, instead of pre-outputting them to
3260 actions_obstack.
3261
3262 * src/gram.h (rule_t): action and action_line are new members.
3263 * src/reader.c (symbol_list): Likewise.
3264 (copy_action): Save the actions within the rule.
3265 (packgram): Save them in rule_table.
3266 * src/output.c (actions_output): New.
3267 (output_parser): Use it on `%%actions'.
3268 (output_rule_data): Don't free rule_table.
3269 (output): Do it.
3270 (prepare): Don't save the `action' muscle.
3271 * src/bison.simple: s/%%action/%%actions/.
3272
32732001-12-15 Akim Demaille <akim@epita.fr>
3274
3275 * src/reader.c (copy_action): When --yacc, don't append a `;'
3276 to the user action: let it fail if lacking.
3277 Suggested by Arnold Robbins and Tom Tromey.
3278
32792001-12-14 Akim Demaille <akim@epita.fr>
3280
3281 * src/lex.c (literalchar): Simply return the char you decoded, non
3282 longer mess around with obstacks and int pointers.
3283 Adjust all callers.
3284
32852001-12-14 Akim Demaille <akim@epita.fr>
3286
3287 * src/lex.c (literalchar): Don't escape the special characters,
3288 just decode them, and keep them as char (before, eol was output as
3289 the 2 char string `\n' etc.).
3290 * src/output.c (output_rule_data): Use quotearg to output the
3291 token strings.
3292
32932001-12-13 Paul Eggert <eggert@twinsun.com>
3294
3295 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3296 Do not infringe on the global user namespace when using C++.
3297 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3298 All uses of `fprintf' and `stderr' changed.
3299
3300 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3301
33022001-12-13 Akim Demaille <akim@epita.fr>
3303
3304 The computation of nullable is broken: it doesn't handle empty
3305 RHS's properly.
3306
3307 * tests/torture.at (GNU AWK Grammar): New.
3308 * tests/sets.at (Nullable): New.
3309 * src/nullable.c (set_nullable): Instead of blindly looping over
3310 `ritems', loop over the rules, and then over their rhs's.
3311
3312 Work around Autotest bugs.
3313
3314 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3315 frame, because Autotest understand lines starting with a `+' as
3316 traces from the shell. Then, they are not processed properly.
3317 Admittedly an Autotest bug, but we don't have time to wait for
3318 Autotest to catch up.
3319 * tests/regression.at (Broken Closure): Adjust to the new table
3320 frames.
3321 Move to...
3322 * tests/sets.at: here.
3323
33242001-12-13 Akim Demaille <akim@epita.fr>
3325
3326 * src/closure.c (closure): Use nrules instead of playing tricks
3327 with BITS_PER_WORD.
3328
33292001-12-13 Akim Demaille <akim@epita.fr>
3330
3331 * src/print.c (print_actions): Output the handling of `$' as the
3332 traces do: shifting the token EOF. Before EOF was treated as a
3333 nonterminal.
3334 * tests/regression.at: Adjust some tests.
3335 * src/print_graph.c (print_core): Complete the set of items via
3336 closure. The next-to-final and final states are still unsatisfying,
3337 but that's to be addressed elsewhere.
3338 No longer output the rule numbers, but do output the state number.
3339 A single loop for the shifts + gotos is enough, but picked a
3340 distinct color for each.
3341 (print_graph): Initialize and finalize closure.
3342
33432001-12-13 Akim Demaille <akim@epita.fr>
3344
3345 * src/reader.c (readgram): Remove dead code, an strip useless
3346 braces.
3347 (get_type): Remove, unused.
3348
33492001-12-12 Akim Demaille <akim@epita.fr>
3350
3351 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3352 on that of lib/error.c.
3353
33542001-12-12 Akim Demaille <akim@epita.fr>
3355
3356 Some hosts don't like `/' in includes.
3357
3358 * src/system.h: Include libgettext.h without qualifying the path.
3359 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3360 $(top_srcdir).
3361
33622001-12-11 Marc Autret <autret_m@epita.fr>
3363
3364 * src/output.c (output_parser): Remove useless muscle.
3365
33662001-12-11 Marc Autret <autret_m@epita.fr>
3367
3368 * src/bison.simple: Remove #line just before %%epilogue. It
3369 is now handled in ...
3370 * src/reader.c (read_additionnal_code): Add the output of a
3371 #line for the epilogue.
3372
33732001-12-10 Marc Autret <autret_m@epita.fr>
3374
3375 * src/reader.c (copy_definition): Re-use CPP-outed code which
3376 replace precedent remove.
3377 * src/bison.simple: Remove #line before %%prologue because
3378 %%input-line is wrong at this time.
3379
33802001-12-10 Marc Autret <autret_m@epita.fr>
3381
3382 * src/reader.c (symbols_output): Clean up.
3383 * src/output.c (output_gram, output): Clean up.
3384
33852001-12-10 Akim Demaille <akim@epita.fr>
3386
3387 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3388 * src/LR0.c (set_state_table): here.
3389 * src/lalr.c (lalr): Call it.
3390
33912001-12-10 Akim Demaille <akim@epita.fr>
3392
3393 * src/state.h (shifts): Remove the `number' member: shifts are
3394 attached to state, hence no longer need to be labelled with a
3395 state number.
3396
33972001-12-10 Akim Demaille <akim@epita.fr>
3398
3399 Now that states have a complete set of members, the linked list of
3400 shifts is useless: just fill directly the state's shifts member.
3401
3402 * src/state.h (shifts): Remove the `next' member.
3403 * src/LR0.c (first_state, last_state): Remove.
3404 Adjust the callers.
3405 (augment_automaton): Don't look for the shifts that must be added
3406 a shift on EOF: it is those of the state we looked for! But now,
3407 since shifts are attached, it is no longer needed to looking
3408 merely by its id: its number.
3409
34102001-12-10 Akim Demaille <akim@epita.fr>
3411
3412 * src/LR0.c (augment_automaton): Better variable locality.
3413 Remove an impossible branch: if there is a state corresponding to
3414 the start symbol being shifted, then there is shift for the start
3415 symbol from the initial state.
3416
34172001-12-10 Akim Demaille <akim@epita.fr>
3418
3419 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3420 only when appropriate: when insert_start_shifting_state' is not
3421 invoked.
3422 * tests/regression.at (Rule Line Numbers): Adjust.
3423
34242001-12-10 Akim Demaille <akim@epita.fr>
3425
3426 * src/LR0.c (augment_automaton): Now that all states have shifts,
3427 merge the two cases addition shifts to the initial state.
3428
34292001-12-10 Akim Demaille <akim@epita.fr>
3430
3431 * src/lalr.c (set_state_table): Move to...
3432 * src/LR0.c: here.
3433 * src/lalr.c (lalr): Don't call it...
3434 * src/LR0.c (generate_states): do it.
3435 * src/LR0.h (first_state): Remove, only the table is used.
3436
34372001-12-10 Akim Demaille <akim@epita.fr>
3438
3439 * src/LR0.h (first_shift, first_reduction): Remove.
3440 * src/lalr.c: Don't use first_shift: find shifts through the
3441 states.
3442
34432001-12-10 Akim Demaille <akim@epita.fr>
3444
3445 * src/LR0.c: Attach shifts to states as soon as they are
3446 computed.
3447 * src/lalr.c (set_state_table): Instead of assigning shifts to
3448 state, just assert that the mapping was properly done.
3449
34502001-12-10 Akim Demaille <akim@epita.fr>
3451
3452 * src/LR0.c (insert_start_shift): Rename as...
3453 (insert_start_shifting_state): this.
3454 (insert_eof_shifting_state, insert_accepting_state): New.
3455 (augment_automaton): Adjust.
3456 Better locality of the variables.
3457 When looking if the start_symbol is shifted from the initial
3458 state, using `while (... symbol != start_symbol ...)' sounds
3459 better than `while (... symbol < start_symbol ...)': If fail
3460 to see how the order between symbols could be relevant!
3461
34622001-12-10 Akim Demaille <akim@epita.fr>
3463
3464 * src/getargs.h: Don't declare `spec_name_prefix' and
3465 `spec_file_prefix', declared by src/files.h.
3466 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3467 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3468 * src/output.c (prepare): Adjust.
3469 * src/reader.c (symbols_output): Likewise.
3470 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3471
34722001-12-10 Akim Demaille <akim@epita.fr>
3473
3474 * src/muscle_tab.c (muscle_init): NULL is a better default than
3475 `"0"'.
3476
34772001-12-10 Akim Demaille <akim@epita.fr>
3478
3479 * src/reader.c (reader): Calling symbols_output once is enough.
3480
34812001-12-10 Akim Demaille <akim@epita.fr>
3482
3483 Now that states have a complete set of members, the linked list of
3484 reductions is useless: just fill directly the state's reductions
3485 member.
3486
3487 * src/state.h (struct reductions): Remove member `number' and
3488 `next'.
3489 * src/LR0.c (first_reduction, last_reduction): Remove.
3490 (save_reductions): Don't link the new reductions, store them in
3491 this_state.
3492 * src/lalr.c (set_state_table): No need to attach reductions to
3493 states, it's already done.
3494 * src/output.c (output_actions): No longer free the shifts, then
3495 the reductions, then the states: free all the states and their
3496 members.
3497
34982001-12-10 Akim Demaille <akim@epita.fr>
3499
3500 * src/options.c (OPTN, DRTV, BOTH): New.
3501 (option_table): Use them.
3502
3503 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3504 the job of system.h.
3505 * src/options.c: Don't include stdio.h and xalloc.h for the same
3506 reasons.
3507
35082001-12-10 Akim Demaille <akim@epita.fr>
3509
3510 * src/output.c (output, prepare): Make sure the values of the
3511 muscles `action' and `prologue' are 0-terminated.
3512
35132001-12-10 Akim Demaille <akim@epita.fr>
3514
3515 Clean up GCC warnings.
3516
3517 * src/reader.c (copy_action): `buf' is not used.
3518 (parse_skel_decl): Be static.
3519 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3520 * src/options.h (create_long_option_table): Have a real prototype.
3521 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3522 (hash_delete_at): Return const void *.
3523 Adjust casts to preserve the const.
3524
35252001-12-10 Akim Demaille <akim@epita.fr>
3526
3527 * configure.in: Require 2.52g.
3528 M4 is not needed, but AUTOM4TE is.
3529 * m4/m4.m4: Remove.
3530 * tests/Makefile.am: Adjust.
3531
35322001-12-10 Akim Demaille <akim@epita.fr>
3533
3534 One structure for states is enough, even though theoretically
3535 there are LR(0) states and LALR(1) states.
3536
3537 * src/lalr.h (state_t): Remove.
3538 (state_table): Be state_t **, not state_t *.
3539 * src/state.h (core, CORE_ALLOC): Rename as...
3540 (state_t, STATE_ALLOC): this.
3541 Add the LALR(1) members: shifts, reductions, errs.
3542 * src/LR0.c (state_table): Rename as...
3543 (state_hash): this, to avoid name clashes with the global
3544 `state_table'.
3545 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3546 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3547
35482001-12-10 Akim Demaille <akim@epita.fr>
3549
3550 Bison dumps core on bash.y.
3551 Reported by Pascal Bart.
3552
3553 * src/warshall.c (bitmatrix_print): New.
3554 (TC): Use it.
3555 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3556 j must be the outer loop.
3557 * tests/regression.at (Broken Closure): New.
3558
35592001-12-05 Akim Demaille <akim@epita.fr>
3560
3561 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3562 its argument.
3563