]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-07-25 Akim Demaille <akim@epita.fr>
2
3 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
4 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
5 (b4_c_knr_arg_decl): New.
6 * data/yacc.c: Use it to define yysymprint, yydestruct, and
7 yyreport_parse_error.
8
92002-07-25 Akim Demaille <akim@epita.fr>
10
11 * data/yacc.c (yyreport_parse_error): New, extracted from...
12 (yyparse): here.
13 (yydestruct, yysymprint): Move above yyparse.
14 Be K&R compliant.
15
162002-07-25 Akim Demaille <akim@epita.fr>
17
18 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
19 replace...
20 (b4_sint_type, b4_uint_type): these.
21 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
22 * tests/regression.at (Web2c Actions): Adjust.
23
242002-07-25 Akim Demaille <akim@epita.fr>
25
26 * src/gram.h (TIEM_NUMBER_MAX): New.
27 (item_number_of_rule_number, rule_number_of_item_number): Rename
28 as...
29 (rule_number_as_item_number, item_number_as_rule_number): these.
30 Adjust dependencies.
31 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
32 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
33 (symbol_number_to_vector_number): New.
34 (order): Of vector_number_t* type.
35 (base_t, BASE_MAX, BASE_MIN): New.
36 (froms, tos, width, pos, check): Of base_t type.
37 (action_number_t, ACTION_MIN, ACTION_MAX): New.
38 (actrow): Of action_number_t type.
39 (conflrow): Of unsigned int type.
40 (table_ninf, base_ninf): New.
41 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
42 (muscle_insert_int_table, muscle_insert_base_table)
43 (muscle_insert_rule_number_table): New.
44 (prepare_tokens): Output `toknum' as int_table.
45 (action_row): Returns a rule_number_t.
46 Use ACTION_MIN, not SHRT_MIN.
47 (token_actions): yydefact is rule_number_t*.
48 (table_ninf_remap): New.
49 (pack_table): Use it for `base' and `table'.
50 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
51 replaced with...
52 (YYPACT_NINF, YYTABLE_NINF): these.
53 (yypact, yytable): Compute their types instead of hard-coded
54 `short'.
55 * tests/regression.at (Web2c Actions): Adjust.
56
572002-07-19 Akim Demaille <akim@epita.fr>
58
59 * src/scan-gram.l (id): Can start with an underscore.
60
612002-07-16 Akim Demaille <akim@epita.fr>
62
63 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
64 Adjust all former `associativity' dependencies.
65 * src/symtab.c (symbol_new): Default associativity is `undef', not
66 `right'.
67 (symbol_check_alias_consistence): Adjust.
68
692002-07-09 Akim Demaille <akim@epita.fr>
70
71 * doc/bison.texinfo: Properly set the ``header'' part.
72 Use @dircategory ``GNU programming tools'' as per Texinfo's
73 documentation.
74 Use @copying.
75
762002-07-09 Akim Demaille <akim@epita.fr>
77
78 * lib/quotearg.h: Protect against multiple inclusions.
79 * src/location.h (location_t): Add a `file' member.
80 (LOCATION_RESET, LOCATION_PRINT): Adjust.
81 * src/complain.c (warn_at, complain_at, fatal_at): Drop
82 `error_one_per_line' support.
83
842002-07-09 Akim Demaille <akim@epita.fr>
85
86 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
87 * src/reader.c (lineno): Remove.
88 Adjust all dependencies.
89 (get_merge_function): Take a location and use complain_at.
90 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
91 * tests/regression.at (Invalid inputs, Mixing %token styles):
92 Adjust.
93
942002-07-09 Akim Demaille <akim@epita.fr>
95
96 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
97 recovery rule, and forbid extensions when --yacc.
98 (gram_error): Use complain_at.
99 * src/reader.c (reader): Exit if there were parse errors.
100
1012002-07-09 Akim Demaille <akim@epita.fr>
102
103 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
104 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
105 Reported by R Blake <blakers@mac.com>.
106
1072002-07-09 Akim Demaille <akim@epita.fr>
108
109 * data/yacc.c: Output the copyright notive in the header.
110
1112002-07-03 Akim Demaille <akim@epita.fr>
112
113 * src/output.c (froms, tos): Are state_number_t.
114 (save_column): sp, sp1, and sp2 are state_number_t.
115 (prepare): Rename `final' as `final_state_number', `nnts' as
116 `nterms_number', `nrules' as `rules_number', `nstates' as
117 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
118 unused.
119 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
120 * data/lalr1.cc (nsym_): Remove, unused.
121
1222002-07-03 Akim Demaille <akim@epita.fr>
123
124 * src/lalr.h, src/lalr.c (goto_number_t): New.
125 * src/lalr.c (goto_list_t): New.
126 Propagate them.
127 * src/nullable.c (rule_list_t): New.
128 Propagate.
129 * src/types.h: Remove.
130
1312002-07-03 Akim Demaille <akim@epita.fr>
132
133 * src/closure.c (print_fderives): Use rule_rhs_print.
134 * src/derives.c (print_derives): Use rule_rhs_print.
135 (rule_list_t): New, replaces `shorts'.
136 (set_derives): Add comments.
137 * tests/sets.at (Nullable, Firsts): Adjust.
138
1392002-07-03 Akim Demaille <akim@epita.fr>
140
141 * src/output.c (prepare_actions): Free `tally' and `width'.
142 (prepare_actions): Allocate and free `order'.
143 * src/symtab.c (symbols_free): Free `symbols'.
144 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
145 * src/output.c (m4_invoke): Move to...
146 * src/scan-skel.l: here.
147 (<<EOF>>): Close yyout, and free its name.
148
1492002-07-03 Akim Demaille <akim@epita.fr>
150
151 Fix some memory leaks, and fix a bug: state 0 was examined twice.
152
153 * src/LR0.c (new_state): Merge into...
154 (state_list_append): this.
155 (new_states): Merge into...
156 (generate_states): here.
157 (set_states): Don't ensure a proper `errs' state member here, do it...
158 * src/conflicts.c (conflicts_solve): here.
159 * src/state.h, src/state.c: Comment changes.
160 (state_t): Rename member `shifts' as `transitions'.
161 Adjust all dependencies.
162 (errs_new): For consistency, also take the values as argument.
163 (errs_dup): Remove.
164 (state_errs_set): New.
165 (state_reductions_set, state_transitions_set): Assert that no
166 previous value was assigned.
167 (state_free): New.
168 (states_free): Use it.
169 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
170 temporary storage: use `errs' and `nerrs' as elsewhere.
171 (set_conflicts): Allocate and free this `errs'.
172
1732002-07-02 Akim Demaille <akim@epita.fr>
174
175 * lib/libiberty.h: New.
176 * lib: Update the bitset implementation from upstream.
177 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
178 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
179 * src/main.c: Adjust bitset stats calls.
180
1812002-07-01 Paul Eggert <eggert@twinsun.com>
182
183 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
184 char, so that negative chars don't collide with $.
185
1862002-06-30 Akim Demaille <akim@epita.fr>
187
188 Have the GLR tests be `warning' checked, and fix the warnings.
189
190 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
191 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
192 (yyremoveDeletes): `yyi' and `yyj' are size_t.
193 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
194 (yyaddDeferredAction): static.
195 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
196 (yyreportParseError): yyprefix is const.
197 yytokenp is used only when verbose.
198 (yy__GNUC__): Replace with __GNUC__.
199 (yypdumpstack): yyi is size_t.
200 (yypreference): Un-yy local variables and arguments, to avoid
201 clashes with `yyr1'. Anyway, we are not in the user name space.
202 (yytname_size): be an int, as is compared with ints.
203 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
204 Use them.
205 * tests/cxx-gram.at: Use quotation to protect $1.
206 Use AT_COMPILE to enable warnings hunts.
207 Prototype yylex and yyerror.
208 `Use' argc.
209 Include `string.h', not `strings.h'.
210 Produce and prototype stmtMerge only when used.
211 yylex takes a location.
212
2132002-06-30 Akim Demaille <akim@epita.fr>
214
215 We spend a lot of time in quotearg, in particular when --verbose.
216
217 * src/symtab.c (symbol_get): Store a quoted version of the key.
218 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
219 Adjust all callers.
220
2212002-06-30 Akim Demaille <akim@epita.fr>
222
223 * src/state.h (reductions_t): Rename member `nreds' as num.
224 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
225 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
226
2272002-06-30 Akim Demaille <akim@epita.fr>
228
229 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
230 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
231 (shifts_to): Rename as...
232 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
233 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
234 (TRANSITION_IS_DISABLED, transitions_to): these.
235
2362002-06-30 Akim Demaille <akim@epita.fr>
237
238 * src/print.c (print_shifts, print_gotos): Merge into...
239 (print_transitions): this.
240 (print_transitions, print_errs, print_reductions): Align the
241 lookaheads columns.
242 (print_core, print_transitions, print_errs, print_state,
243 print_grammar): Output empty lines separator before, not after.
244 (state_default_rule_compute): Rename as...
245 (state_default_rule): this.
246 * tests/conflicts.at (Defaulted Conflicted Reduction),
247 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
248 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
249
2502002-06-30 Akim Demaille <akim@epita.fr>
251
252 Display items as we display rules.
253
254 * src/gram.h, src/gram.c (rule_lhs_print): New.
255 * src/gram.c (grammar_rules_partial_print): Use it.
256 * src/print.c (print_core): Likewise.
257 * tests/conflicts.at (Defaulted Conflicted Reduction),
258 (Unresolved SR Conflicts): Adjust.
259 (Unresolved SR Conflicts): Adjust and rename as...
260 (Resolved SR Conflicts): this, as was meant.
261 * tests/regression.at (Web2c Report): Adjust.
262
2632002-06-30 Akim Demaille <akim@epita.fr>
264
265 * src/print.c (state_default_rule_compute): New, extracted from...
266 (print_reductions): here.
267 Pessimize, but clarify the code.
268 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
269
2702002-06-30 Akim Demaille <akim@epita.fr>
271
272 * src/output.c (action_row): Let default_rule be always a rule
273 number.
274
2752002-06-30 Akim Demaille <akim@epita.fr>
276
277 * src/closure.c (print_firsts, print_fderives, closure):
278 Use BITSET_EXECUTE.
279 * src/lalr.c (lookaheads_print): Likewise.
280 * src/state.c (state_rule_lookaheads_print): Likewise.
281 * src/print_graph.c (print_core): Likewise.
282 * src/print.c (print_reductions): Likewise.
283 * src/output.c (action_row): Likewise.
284 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
285
2862002-06-30 Akim Demaille <akim@epita.fr>
287
288 * src/print_graph.c: Use report_flag.
289
2902002-06-30 Akim Demaille <akim@epita.fr>
291
292 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
293 to...
294 * src/relation.h, src/relation.c (traverse, relation_digraph)
295 (relation_print, relation_transpose): New.
296
2972002-06-30 Akim Demaille <akim@epita.fr>
298
299 * src/state.h, src/state.c (shifts_to): New.
300 * src/lalr.c (build_relations): Use it.
301
3022002-06-30 Akim Demaille <akim@epita.fr>
303
304 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
305 (item_number_of_rule_number, rule_number_of_item_number): New.
306 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
307 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
308 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
309 Propagate their use.
310 Much remains to be done, in particular wrt `shorts' from types.h.
311
3122002-06-30 Akim Demaille <akim@epita.fr>
313
314 * src/symtab.c (symbol_new): Initialize the `printer' member.
315
3162002-06-30 Akim Demaille <akim@epita.fr>
317
318 * src/LR0.c (save_reductions): Remove, replaced by...
319 * src/state.h, src/state.c (state_reductions_set): New.
320 (reductions, errs): Rename as...
321 (reductions_t, errs_t): these.
322 Adjust all dependencies.
323
3242002-06-30 Akim Demaille <akim@epita.fr>
325
326 * src/LR0.c (state_list_t, state_list_append): New.
327 (first_state, last_state): Now symbol_list_t.
328 (this_state): Remove.
329 (new_itemsets, append_states, save_reductions): Take a state_t as
330 argument.
331 (set_states, generate_states): Adjust.
332 (save_shifts): Remove, replaced by...
333 * src/state.h, src/state.c (state_shifts_set): New.
334 (shifts): Rename as...
335 (shifts_t): this.
336 Adjust all dependencies.
337 * src/state.h (state_t): Remove the `next' member.
338
3392002-06-30 Akim Demaille <akim@epita.fr>
340
341 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
342 escaped in slot 0.
343
3442002-06-30 Akim Demaille <akim@epita.fr>
345
346 Use hash.h for the state hash table.
347
348 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
349 (allocate_storage): Use state_hash_new.
350 (free_storage): Use state_hash_free.
351 (new_state, get_state): Adjust.
352 * src/lalr.h, src/lalr.c (states): Move to...
353 * src/states.h (state_t): Remove the `link' member, no longer
354 used.
355 * src/states.h, src/states.c: here.
356 (state_hash_new, state_hash_free, state_hash_lookup)
357 (state_hash_insert, states_free): New.
358 * src/states.c (state_table, state_compare, state_hash): New.
359 * src/output.c (output_actions): Do not free states now, since we
360 still need to know the final_state number in `prepare', called
361 afterwards. Do it...
362 * src/main.c (main): here: call states_free after `output'.
363
3642002-06-30 Akim Demaille <akim@epita.fr>
365
366 * src/state.h, src/state.c (state_new): New, extracted from...
367 * src/LR0.c (new_state): here.
368 * src/state.h (STATE_ALLOC): Move to...
369 * src/state.c: here.
370 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
371 * src/state.h, src/state.c: here.
372
3732002-06-30 Akim Demaille <akim@epita.fr>
374
375 * src/reader.c (gensym): Rename as...
376 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
377 (getsym): Rename as...
378 (symbol_get): this.
379
3802002-06-30 Akim Demaille <akim@epita.fr>
381
382 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
383 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
384 * src/output.c, src/print.c, src/print_graph.c: Propagate.
385 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
386
3872002-06-30 Akim Demaille <akim@epita.fr>
388
389 Make the test suite pass with warnings checked.
390
391 * tests/actions.at (Printers and Destructors): Improve.
392 Avoid unsigned vs. signed issues.
393 * tests/calc.at: Don't exercise the scanner here, do it...
394 * tests/input.at (Torturing the Scanner): here.
395
3962002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
397
398 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
399 reorganize first lines parallel to yacc.c.
400
4012002-06-28 Akim Demaille <akim@epita.fr>
402
403 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
404 (b4_token_enum, b4_token_defines): New, factored from...
405 * data/lalr1.cc, data/yacc.c, glr.c: here.
406
4072002-06-28 Akim Demaille <akim@epita.fr>
408
409 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
410 unused variables.
411 * src/output.c (merger_output): static.
412
4132002-06-28 Akim Demaille <akim@epita.fr>
414
415 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
416 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
417 pacify GCC.
418 * src/output.c (save_row): Initialize all the variables to pacify GCC.
419
4202002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
421
422 Accumulated changelog for new GLR parsing features.
423
424 * src/conflicts.c (count_total_conflicts): Change name to
425 conflicts_total_count.
426 * src/conflicts.h: Ditto.
427 * src/output.c (token_actions): Use the new name.
428 (output_conflicts): Change conflp => conflict_list_heads, and
429 confl => conflict_list for better readability.
430 * data/glr.c: Use the new names.
431 * NEWS: Add self to GLR announcement.
432
433 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
434
435 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
436 Akim Demaille.
437
438 * data/bison.glr: Change name to glr.c
439 * data/glr.c: Renamed from bison.glr.
440 * data/Makefile.am: Add glr.c
441
442 * src/getargs.c:
443
444 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
445 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
446
447 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
448
449 * data/bison.glr: Be sure to restore the
450 current #line when returning to the skeleton contents after having
451 exposed the input file's #line.
452
453 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
454
455 * data/bison.glr: Bring up to date with changes to bison.simple.
456
457 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
458
459 * data/bison.glr: Correct definitions that use b4_prefix.
460 Various reformatting.
461 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
462 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
463 yytokenp argument; now part of stack.
464 (yychar): Define to behave as documented.
465 (yyclearin): Ditto.
466
467 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
468
469 * src/reader.h: Add declaration for free_merger_functions.
470
471 * src/reader.c (merge_functions): New variable.
472 (get_merge_function): New function.
473 (free_merger_functions): New function.
474 (readgram): Check for %prec that is not followed by a symbol.
475 Handle %dprec and %merge declarations.
476 (packgram): Initialize dprec and merger fields in rules array.
477
478 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
479 conflict_list_cnt, conflict_list_free): New variables.
480 (table_grow): Also grow conflict_table.
481 (prepare_rules): Output dprec and merger tables.
482 (conflict_row): New function.
483 (action_row): Output conflict lists for GLR parser. Don't use
484 default reduction in conflicted states for GLR parser so that there
485 are spaces for the conflict lists.
486 (save_row): Also save conflict information.
487 (token_actions): Allocate conflict list.
488 (merger_output): New function.
489 (pack_vector): Pack conflict table, too.
490 (output_conflicts): New function to output yyconflp and yyconfl.
491 (output_check): Allocate conflict_tos.
492 (output_actions): Output conflict tables, also.
493 (output_skeleton): Output b4_mergers definition.
494 (prepare): Output b4_max_rhs_length definition.
495 Use 'bison.glr' as default skeleton for GLR parsers.
496
497 * src/gram.c (glr_parser): New flag.
498 (grammar_free): Call free_merger_functions.
499
500 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
501 all pairs of conflicting reductions, rather than just all tokens
502 causing conflicts. Needed to size conflict tables.
503 (conflicts_output): Modify call to count_rr_conflicts for new
504 interface.
505 (conflicts_print): Ditto.
506 (count_total_conflicts): New function.
507
508 * src/reader.h (merger_list): New type.
509 (merge_functions): New variable.
510
511 * src/lex.h (tok_dprec, tok_merge): New token types.
512
513 * src/gram.h (rule_s): Add dprec and merger fields.
514 (glr_parser): New flag.
515
516 * src/conflicts.h (count_total_conflicts): New function.
517
518 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
519
520 * doc/bison.texinfo (Generalized LR Parsing): New section.
521 (GLR Parsers): New section.
522 (Language and Grammar): Mention GLR parsing.
523 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
524 Correct typo ("tge" -> "the").
525
526 * data/bison.glr: New skeleton for GLR parsing.
527
528 * tests/cxx-gram.at: New tests for GLR parsing.
529
530 * tests/testsuite.at: Include cxx-gram.at.
531
532 * tests/Makefile.am: Add cxx-gram.at.
533
534 * src/parse-gram.y:
535
536 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
537
538 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
539
5402002-06-27 Akim Demaille <akim@epita.fr>
541
542 * src/options.h, src/options.c: Remove.
543 * src/getargs.c (short_options, long_options): New.
544
5452002-06-27 Akim Demaille <akim@epita.fr>
546
547 * data/bison.simple, data/bison.c++: Rename as...
548 * data/yacc.c, data/lalr1.cc: these.
549 * doc/bison.texinfo (Environment Variables): Remove.
550
5512002-06-25 Raja R Harinath <harinath@cs.umn.edu>
552
553 * src/getargs.c (report_argmatch): Initialize strtok().
554
5552002-06-20 Akim Demaille <akim@epita.fr>
556
557 * data/bison.simple (b4_symbol_actions): New, replaces...
558 (b4_symbol_destructor, b4_symbol_printer): these.
559 (yysymprint): Be sure to call YYPRINT only for tokens, and using
560 user token numbers.
561
5622002-06-20 Akim Demaille <akim@epita.fr>
563
564 * data/bison.simple (yydestructor): Rename as...
565 (yydestruct): this.
566
5672002-06-20 Akim Demaille <akim@epita.fr>
568
569 * src/symtab.h, src/symtab.c (symbol_type_set)
570 (symbol_destructor_set, symbol_precedence_set): The location is
571 the last argument.
572 Adjust all callers.
573
5742002-06-20 Akim Demaille <akim@epita.fr>
575
576 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
577 internals.
578 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
579 Takes a location.
580 * src/symtab.h, src/symtab.c (symbol_class_set)
581 (symbol_user_token_number_set): Likewise.
582 Adjust all callers.
583 Promote complain_at.
584 * tests/input.at (Type Clashes): Adjust.
585
5862002-06-20 Akim Demaille <akim@epita.fr>
587
588 * data/bison.simple (YYLEX): Fix the declaration when
589 %pure-parser.
590
5912002-06-20 Akim Demaille <akim@epita.fr>
592
593 * data/bison.simple (yysymprint): Don't print the token number,
594 just its name.
595 * tests/actions.at (Destructors): Rename as...
596 (Printers and Destructors): this.
597 Also exercise %printer.
598
5992002-06-20 Akim Demaille <akim@epita.fr>
600
601 * data/bison.simple (YYDSYMPRINT): New.
602 Use it to remove many of the #if YYDEBUG/if (yydebug).
603
6042002-06-20 Akim Demaille <akim@epita.fr>
605
606 * src/symtab.h, src/symtab.c (symbol_t): printer and
607 printer_location are new members.
608 (symbol_printer_set): New.
609 * src/parse-gram.y (PERCENT_PRINTER): New token.
610 Handle its associated rule.
611 * src/scan-gram.l: Adjust.
612 (handle_destructor_at, handle_destructor_dollar): Rename as...
613 (handle_symbol_code_at, handle_symbol_code_dollar): these.
614 * src/output.c (symbol_printers_output): New.
615 (output_skeleton): Call it.
616 * data/bison.simple (yysymprint): New. Cannot be named yyprint
617 since there are already many grammar files with a user `yyprint'.
618 Replace the calls to YYPRINT to calls to yysymprint.
619 * tests/calc.at: Adjust.
620 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
621 taking advantage of parser very internal details (stack size!).
622
6232002-06-20 Akim Demaille <akim@epita.fr>
624
625 * src/scan-gram.l: Complete the scanner with the missing patterns
626 to pacify Flex.
627 Use `quote' and `symbol_tag_get' where appropriate.
628
6292002-06-19 Akim Demaille <akim@epita.fr>
630
631 * tests/actions.at (Destructors): Augment to test locations.
632 * data/bison.simple (yydestructor): Pass it the current location
633 if locations are enabled.
634 Prototype only when __STDC__ or C++.
635 Change the argument names to move into the yy name space: there is
636 user code here.
637
6382002-06-19 Akim Demaille <akim@epita.fr>
639
640 * data/bison.simple (b4_pure_if): New.
641 Use it instead of #ifdef YYPURE.
642
6432002-06-19 Akim Demaille <akim@epita.fr>
644
645 * data/bison.simple (b4_location_if): New.
646 Use it instead of #ifdef YYLSP_NEEDED.
647
6482002-06-19 Akim Demaille <akim@epita.fr>
649
650 Prepare @$ in %destructor, but currently don't bind it in the
651 skeleton, as %location use is not cleaned up yet.
652
653 * src/scan-gram.l (handle_dollar, handle_destructor_at)
654 (handle_action_at): New.
655 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
656 a braced_code_t and a location as additional arguments.
657 (handle_destructor_dollar): Instead of requiring `b4_eval', just
658 unquote one when outputting `b4_dollar_dollar'.
659 Adjust callers.
660 * data/bison.simple (b4_eval): Remove.
661 (b4_symbol_destructor): Adjust.
662 * tests/input.at (Invalid @n): Adjust.
663
6642002-06-19 Zack Weinberg <zack@codesourcery.com>
665
666 * doc/bison.texinfo: Document ability to have multiple
667 prologue sections.
668
6692002-06-18 Akim Demaille <akim@epita.fr>
670
671 * src/files.c (compute_base_names): When computing the output file
672 names from the input file name, strip the directory part.
673
6742002-06-18 Akim Demaille <akim@epita.fr>
675
676 * data/bison.simple.new: Comment changes.
677 Reported by Andreas Schwab.
678
6792002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
680
681 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
682 there are no `label `yyoverflowlab' defined but not used' warnings
683 when yyoverflow is defined.
684
6852002-06-18 Akim Demaille <akim@epita.fr>
686
687 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
688 new member.
689 (symbol_destructor_set): Adjust.
690 * src/output.c (symbol_destructors_output): Output the destructor
691 locations.
692 Output the symbol name.
693 * data/bison.simple (b4_symbol_destructor): Adjust.
694
6952002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
696 and Akim Demaille <akim@epita.fr>
697
698 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
699 what's left on the stack when the error recovery hits EOF.
700 * tests/actions.at (Destructors): Complete to exercise this case.
701
7022002-06-17 Akim Demaille <akim@epita.fr>
703
704 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
705 arguments is really empty, not only equal to `[]'.
706 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
707 member.
708 (symbol_destructor_set): New.
709 * src/output.c (symbol_destructors_output): New.
710 * src/reader.h (brace_code_t, current_braced_code): New.
711 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
712 (handle_dollar): Rename as...
713 (handle_action_dollar): this.
714 (handle_destructor_dollar): New.
715 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
716 (grammar_declaration): Use it.
717 * data/bison.simple (yystos): Is always defined.
718 (yydestructor): New.
719 * tests/actions.at (Destructors): New.
720 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
721
7222002-06-17 Akim Demaille <akim@epita.fr>
723
724 * src/symlist.h, src/symlist.c (symbol_list_length): New.
725 * src/scan-gram.l (handle_dollar, handle_at): Compute the
726 rule_length only when needed.
727 * src/output.c (actions_output, token_definitions_output): Output
728 the full M4 block.
729 * src/symtab.c: Don't access directly to the symbol tag, use
730 symbol_tag_get.
731 * src/parse-gram.y: Use symbol_list_free.
732
7332002-06-17 Akim Demaille <akim@epita.fr>
734
735 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
736 (symbol_list_prepend, get_type_name): Move to...
737 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
738 (symbol_list_prepend, symbol_list_n_type_name_get): here.
739 Adjust all callers.
740 (symbol_list_free): New.
741 * src/scan-gram.l (handle_dollar): Takes a location.
742 * tests/input.at (Invalid $n): Adjust.
743
7442002-06-17 Akim Demaille <akim@epita.fr>
745
746 * src/reader.h, src/reader.c (symbol_list_new): Export it.
747 (symbol_list_prepend): New.
748 * src/parse-gram.y (%union): `list' is a new member.
749 (symbols.1): New, replaces...
750 (terms_to_prec.1, nterms_to_type.1): these.
751 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
752 Take a location as additional argument.
753 Adjust all callers.
754
7552002-06-15 Akim Demaille <akim@epita.fr>
756
757 * src/parse-gram.y: Move %token in the declaration section so that
758 we don't depend upon CVS Bison.
759
7602002-06-15 Akim Demaille <akim@epita.fr>
761
762 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
763 * src/print.c (print_core): Use it.
764
7652002-06-15 Akim Demaille <akim@epita.fr>
766
767 * src/conflicts.c (log_resolution): Accept the rule involved in
768 the sr conflicts instead of the lookahead number that points to
769 that rule.
770 (flush_reduce): Accept the current lookahead vector as argument,
771 instead of the index in LA.
772 (resolve_sr_conflict): Accept the current number of lookahead
773 bitset to consider for the STATE, instead of the index in LA.
774 (set_conflicts): Adjust.
775 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
776
7772002-06-15 Akim Demaille <akim@epita.fr>
778
779 * src/state.h (state_t): Replace the `lookaheadsp' member, a
780 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
781 Adjust all dependencies.
782 * src/lalr.c (initialize_lookaheads): Split into...
783 (states_lookaheads_count, states_lookaheads_initialize): these.
784 (lalr): Adjust.
785
7862002-06-15 Akim Demaille <akim@epita.fr>
787
788 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
789 out of...
790 (grammar_rules_print): here.
791 * src/reduce.c (reduce_output): Use it.
792 * tests/reduce.at (Useless Rules, Reduced Automaton)
793 (Underivable Rules): Adjust.
794
7952002-06-15 Akim Demaille <akim@epita.fr>
796
797 Copy BYacc's nice way to report the grammar.
798
799 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
800 New.
801 Don't print the rules' location, it is confusing and useless.
802 (rule_print): Use grammar_rhs_print.
803 * src/print.c (print_grammar): Use grammar_rules_print.
804
8052002-06-15 Akim Demaille <akim@epita.fr>
806
807 Complete and rationalize `useless thing' warnings.
808
809 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
810 (symbol_tag_print): New.
811 Use them everywhere in place of accessing directly the tag member.
812 * src/gram.h, src/gram.c (rule_print): New.
813 Use it where a rule used to be printed `by hand'.
814 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
815 (reduce_grammar_tables): Report the useless rules.
816 (reduce_print): Useless things are a warning, not an error.
817 Report it as such.
818 * tests/reduce.at (Useless Nonterminals, Useless Rules):
819 (Reduced Automaton, Underivable Rules): Adjust.
820 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
821 * tests/conflicts.at (Unresolved SR Conflicts)
822 (Solved SR Conflicts): Adjust.
823
8242002-06-15 Akim Demaille <akim@epita.fr>
825
826 Let symbols have a location.
827
828 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
829 (getsym): Adjust.
830 Adjust all callers.
831 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
832 Use location_t, not int.
833 * src/symtab.c (symbol_check_defined): Take advantage of the
834 location.
835 * tests/regression.at (Invalid inputs): Adjust.
836
8372002-06-15 Akim Demaille <akim@epita.fr>
838
839 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
840 (input): Don't try to initialize yylloc here, do it in the
841 scanner.
842 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
843 * src/gram.h (rule_t): Change line and action_line into location
844 and action_location, of location_t type.
845 Adjust all dependencies.
846 * src/location.h, src/location.c (empty_location): New.
847 * src/reader.h, src/reader.c (grammar_start_symbol_set)
848 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
849 (grammar_current_rule_symbol_append)
850 (grammar_current_rule_action_append): Expect a location as argument.
851 * src/reader.c (grammar_midrule_action): Adjust to attach an
852 action's location as dummy symbol location.
853 * src/symtab.h, src/symtab.c (startsymbol_location): New.
854 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
855 the line numbers.
856
8572002-06-14 Akim Demaille <akim@epita.fr>
858
859 Grammar declarations may be found in the grammar section.
860
861 * src/parse-gram.y (rules_or_grammar_declaration): New.
862 (declarations): Each declaration may end with a semicolon, not
863 just...
864 (grammar_declaration): `"%union"'.
865 (grammar): Branch to rules_or_grammar_declaration.
866
8672002-06-14 Akim Demaille <akim@epita.fr>
868
869 * src/main.c (main): Invoke scanner_free.
870
8712002-06-14 Akim Demaille <akim@epita.fr>
872
873 * src/output.c (m4_invoke): Extracted from...
874 (output_skeleton): here.
875 Free tempfile.
876
8772002-06-14 Akim Demaille <akim@epita.fr>
878
879 * src/parse-gram.y (directives, directive, gram)
880 (grammar_directives, precedence_directives, precedence_directive):
881 Rename as...
882 (declarations, declaration, grammar, grammar_declaration)
883 (precedence_declaration, precedence_declarator): these.
884 (symbol_declaration): New.
885
8862002-06-14 Akim Demaille <akim@epita.fr>
887
888 * src/files.c (action_obstack): Remove, unused.
889 (output_obstack): Remove it, and all its dependencies, as it is no
890 longer needed.
891 * src/reader.c (epilogue_set): Build the epilogue in the
892 muscle_obstack.
893 * src/output.h, src/output.c (muscle_obstack): Move to...
894 * src/muscle_tab.h, src/muscle_tab.h: here.
895 (muscle_init): Initialize muscle_obstack.
896 (muscle_free): New.
897 * src/main.c (main): Call it.
898
8992002-06-14 Akim Demaille <akim@epita.fr>
900
901 * src/location.h: New, extracted from...
902 * src/reader.h: here.
903 * src/Makefile.am (noinst_HEADERS): Merge into
904 (bison_SOURCES): this.
905 Add location.h.
906 * src/parse-gram.y: Use location_t instead of Bison's.
907 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
908 Use location_t instead of ints.
909
9102002-06-14 Akim Demaille <akim@epita.fr>
911
912 * data/bison.simple, data/bison.c++: Be sure to restore the
913 current #line when returning to the skeleton contents after having
914 exposed the input file's #line.
915
9162002-06-12 Akim Demaille <akim@epita.fr>
917
918 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
919 eager.
920 * tests/actions.at (Exotic Dollars): New.
921
9222002-06-12 Akim Demaille <akim@epita.fr>
923
924 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
925 ['"/] too eagerly.
926 * tests/input.at (Torturing the Scanner): New.
927
9282002-06-11 Akim Demaille <akim@epita.fr>
929
930 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
931 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
932 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
933 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
934 * src/reader.c (reader): Use it.
935
9362002-06-11 Akim Demaille <akim@epita.fr>
937
938 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
939 Adjust all callers.
940 (scanner_last_string_free): New.
941
9422002-06-11 Akim Demaille <akim@epita.fr>
943
944 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
945 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
946 (last_string, YY_OBS_FREE): New.
947 Use them when returning an ID.
948
9492002-06-11 Akim Demaille <akim@epita.fr>
950
951 Have Bison grammars parsed by a Bison grammar.
952
953 * src/reader.c, src/reader.h (prologue_augment): New.
954 * src/reader.c (copy_definition): Remove.
955
956 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
957 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
958 (grammar_current_rule_prec_set, grammar_current_rule_check)
959 (grammar_current_rule_symbol_append)
960 (grammar_current_rule_action_append): Export.
961 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
962 (symbol_list_action_append): Remove.
963 Hook the routines from reader.
964 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
965 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
966
967 * src/reader.c (read_declarations): Remove, unused.
968
969 * src/parse-gram.y: Handle the epilogue.
970 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
971 (grammar_start_symbol_set): this.
972 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
973 * src/reader.c (readgram): Remove, unused.
974 (reader): Adjust to insert eoftoken and axiom where appropriate.
975
976 * src/reader.c (copy_dollar): Replace with...
977 * src/scan-gram.h (handle_dollar): this.
978 * src/parse-gram.y: Remove `%thong'.
979
980 * src/reader.c (copy_at): Replace with...
981 * src/scan-gram.h (handle_at): this.
982
983 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
984 New.
985
986 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
987 time being.
988
989 * src/reader.h, src/reader.c (grammar_rule_end): New.
990
991 * src/parse.y (current_type, current_class): New.
992 Implement `%nterm', `%token' support.
993 Merge `%term' into `%token'.
994 (string_as_id): New.
995 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
996 type name.
997
998 * src/parse-gram.y: Be sure to handle properly the beginning of
999 rules.
1000
1001 * src/parse-gram.y: Handle %type.
1002 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
1003
1004 * src/parse-gram.y: More directives support.
1005 * src/options.c: No longer handle source directives.
1006
1007 * src/parse-gram.y: Fix %output.
1008
1009 * src/parse-gram.y: Handle %union.
1010 Use the prologue locations.
1011 * src/reader.c (parse_union_decl): Remove.
1012
1013 * src/reader.h, src/reader.c (epilogue_set): New.
1014 * src/parse-gram.y: Use it.
1015
1016 * data/bison.simple, data/bison.c++: b4_stype is now either not
1017 defined, then default to int, or to the contents of %union,
1018 without `union' itself.
1019 Adjust.
1020 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
1021
1022 * src/output.c (actions_output): Don't output braces, as they are
1023 already handled by the scanner.
1024
1025 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
1026 characters to themselves.
1027
1028 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
1029 that the epilogue has a proper #line.
1030
1031 * src/parse-gram.y: Handle precedence/associativity.
1032
1033 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
1034 a terminal.
1035 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
1036 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
1037 at all to define terminals that cannot be emitted.
1038
1039 * src/scan-gram.l: Escape M4 characters.
1040
1041 * src/scan-gram.l: Working properly with escapes in user
1042 strings/characters.
1043
1044 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
1045 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
1046 grammar.
1047 Use more modest sizes, as for the time being the parser does not
1048 release memory, and therefore the process swallows a huge amount
1049 of memory.
1050
1051 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
1052 stricter %token grammar.
1053
1054 * src/symtab.h (associativity): Add `undef_assoc'.
1055 (symbol_precedence_set): Do nothing when passed an undef_assoc.
1056 * src/symtab.c (symbol_check_alias_consistence): Adjust.
1057
1058 * tests/regression.at (Invalid %directive): Remove, as it is now
1059 meaningless.
1060 (Invalid inputs): Adjust to the new error messages.
1061 (Token definitions): The new grammar doesn't allow too many
1062 eccentricities.
1063
1064 * src/lex.h, src/lex.c: Remove.
1065 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
1066 (copy_character, copy_string2, copy_string, copy_identifier)
1067 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
1068 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
1069 (parse_action): Remove.
1070 * po/POTFILES.in: Adjust.
1071
10722002-06-11 Akim Demaille <akim@epita.fr>
1073
1074 * src/reader.c (parse_action): Don't store directly into the
1075 rule's action member: return the action as a string.
1076 Don't require `rule_length' as an argument: compute it.
1077 (grammar_current_rule_symbol_append)
1078 (grammar_current_rule_action_append): New, eved out from
1079 (readgram): here.
1080 Remove `action_flag', `rulelength', unused now.
1081
10822002-06-11 Akim Demaille <akim@epita.fr>
1083
1084 * src/reader.c (grammar_current_rule_prec_set).
1085 (grammar_current_rule_check): New, eved out from...
1086 (readgram): here.
1087 Remove `xaction', `first_rhs': useless.
1088 * tests/input.at (Type clashes): New.
1089 * tests/existing.at (GNU Cim Grammar): Adjust.
1090
10912002-06-11 Akim Demaille <akim@epita.fr>
1092
1093 * src/reader.c (grammar_midrule_action): New, Eved out from
1094 (readgram): here.
1095
10962002-06-11 Akim Demaille <akim@epita.fr>
1097
1098 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
1099 New.
1100 (readgram): Use them as replacement of inlined code, crule and
1101 crule1.
1102
11032002-06-11 Akim Demaille <akim@epita.fr>
1104
1105 * src/reader.c (grammar_end, grammar_symbol_append): New.
1106 (readgram): Use them.
1107 Make the use of `p' as local as possible.
1108
11092002-06-10 Akim Demaille <akim@epita.fr>
1110
1111 GCJ's parser requires the tokens to be defined before the prologue.
1112
1113 * data/bison.simple: Output the token definition before the user's
1114 prologue.
1115 * tests/regression.at (Braces parsing, Duplicate string)
1116 (Mixing %token styles): Check the output from bison.
1117 (Early token definitions): New.
1118
11192002-06-10 Akim Demaille <akim@epita.fr>
1120
1121 * src/symtab.c (symbol_user_token_number_set): Don't complain when
1122 assigning twice the same user number to a token, so that we can
1123 use it in...
1124 * src/lex.c (lex): here.
1125 Also use `symbol_class_set' instead of hand written code.
1126 * src/reader.c (parse_assoc_decl): Likewise.
1127
11282002-06-10 Akim Demaille <akim@epita.fr>
1129
1130 * src/symtab.c, src/symtab.c (symbol_class_set)
1131 (symbol_user_token_number_set): New.
1132 * src/reader.c (parse_token_decl): Use them.
1133 Use a switch instead of ifs.
1134 Use a single argument.
1135
11362002-06-10 Akim Demaille <akim@epita.fr>
1137
1138 Remove `%thong' support as it is undocumented, unused, duplicates
1139 `%token's job, and creates useless e-mail traffic with people who
1140 want to know what it is, why it is undocumented, unused, and
1141 duplicates `%token's job.
1142
1143 * src/reader.c (parse_thong_decl): Remove.
1144 * src/options.c (option_table): Remove "thong".
1145 * src/lex.h (tok_thong): Remove.
1146
11472002-06-10 Akim Demaille <akim@epita.fr>
1148
1149 * src/symtab.c, src/symtab.c (symbol_type_set)
1150 (symbol_precedence_set): New.
1151 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
1152 (value_components_used): Remove, unused.
1153
11542002-06-09 Akim Demaille <akim@epita.fr>
1155
1156 Move symbols handling code out of the reader.
1157
1158 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
1159 (axiom): Move to...
1160 * src/symtab.h, src/symtab.c: here.
1161
1162 * src/gram.c (start_symbol): Remove: use startsymbol->number.
1163 * src/reader.c (startval): Rename as...
1164 * src/symtab.h, src/symtab.c (startsymbol): this.
1165 * src/reader.c: Adjust.
1166
1167 * src/reader.c (symbol_check_defined, symbol_make_alias)
1168 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1169 (token_translations_init)
1170 Move to...
1171 * src/symtab.c: here.
1172 * src/reader.c (packsymbols): Move to...
1173 * src/symtab.h, src/symtab.c (symbols_pack): here.
1174 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
1175 argument.
1176
11772002-06-03 Akim Demaille <akim@epita.fr>
1178
1179 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
1180 then statements.
1181
11822002-06-03 Akim Demaille <akim@epita.fr>
1183
1184 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1185 structs with non literals.
1186 * src/scan-skel.l: never-interactive.
1187 * src/conflicts.c (enum conflict_resolution_e): No trailing
1188 comma.
1189 * src/getargs.c (usage): Split long literal strings.
1190 Reported by Hans Aberg.
1191
11922002-05-28 Akim Demaille <akim@epita.fr>
1193
1194 * data/bison.c++: Use C++ ostreams.
1195 (cdebug_): New member.
1196
11972002-05-28 Akim Demaille <akim@epita.fr>
1198
1199 * src/output.c (output_skeleton): Be sure to allocate enough room
1200 for `/' _and_ for `\0' in full_skeleton.
1201
12022002-05-28 Akim Demaille <akim@epita.fr>
1203
1204 * data/bison.c++: Catch up with bison.simple:
1205 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1206 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1207 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1208 and popping traces.
1209
12102002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1211
1212 * src/output.c (output_skeleton): Put an explicit path in front of
1213 the skeleton file name, rather than relying on the -I directory,
1214 to partially alleviate effects of having a skeleton file lying around
1215 in the current directory.
1216
12172002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1218
1219 * src/conflicts.c (log_resolution): Correct typo:
1220 obstack_printf should be obstack_fgrow1.
1221
12222002-05-26 Akim Demaille <akim@epita.fr>
1223
1224 * src/state.h (state_t): `solved_conflicts' is a new member.
1225 * src/LR0.c (new_state): Set it to 0.
1226 * src/conflicts.h, src/conflicts.c (print_conflicts)
1227 (free_conflicts, solve_conflicts): Rename as...
1228 (conflicts_print, conflicts_free, conflicts_solve): these.
1229 Adjust callers.
1230 * src/conflicts.c (enum conflict_resolution_e)
1231 (solved_conflicts_obstack): New, used by...
1232 (log_resolution): this.
1233 Adjust to attach the conflict resolution to each state.
1234 Complete the description with the precedence/associativity
1235 information.
1236 (resolve_sr_conflict): Adjust.
1237 * src/print.c (print_state): Output its solved_conflicts.
1238 * tests/conflicts.at (Unresolved SR Conflicts)
1239 (Solved SR Conflicts): Exercise --report=all.
1240
12412002-05-26 Akim Demaille <akim@epita.fr>
1242
1243 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1244 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1245 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1246 (token_number_t, item_number_as_token_number)
1247 (token_number_as_item_number, muscle_insert_token_number_table):
1248 Rename as...
1249 (symbol_number_t, item_number_as_symbol_number)
1250 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1251 these, since it is more appropriate.
1252
12532002-05-26 Akim Demaille <akim@epita.fr>
1254
1255 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1256 `Error:' lines.
1257 * data/bison.simple (yystos) [YYDEBUG]: New.
1258 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1259 error recovery.
1260 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1261
12622002-05-25 Akim Demaille <akim@epita.fr>
1263
1264 * doc/bison.texinfo (Debugging): Split into...
1265 (Tracing): this new section, its former contents, and...
1266 (Understanding): this new section.
1267 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1268 by...
1269 (report_flag): this.
1270 Adjust all dependencies.
1271 (report_args, report_types, report_argmatch): New.
1272 (usage, getargs): Report/support -r, --report.
1273 * src/options.h
1274 (struct option_table_struct): Rename as..,
1275 (struct option_table_s): this.
1276 Rename the `set_flag' member to `flag' to match with getopt_long's
1277 struct.
1278 * src/options.c (option_table): Split verbose into an entry for
1279 %verbose, and another for --verbose.
1280 Support --report/-r, so remove -r from the obsolete --raw.
1281 * src/print.c: Attach full item sets and lookaheads reports to
1282 report_flag instead of trace_flag.
1283 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1284
12852002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1286 and Paul Eggert <eggert@twinsun.com>
1287
1288 * data/bison.simple (yyparse): Correct error handling to conform to
1289 POSIX and yacc. Specifically, after syntax error is discovered,
1290 do not reduce further before shifting the error token.
1291 Clean up the code a bit by removing the labels yyerrdefault,
1292 yyerrhandle, yyerrpop.
1293 * NEWS: Document the above.
1294
12952002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1296
1297 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1298 type; it isn't always big enough, since it doesn't necessarily
1299 include non-terminals.
1300 (yytranslate): Expand definition of yy_token_number_type, so that
1301 the latter can be removed.
1302 (yy_token_number_type): Remove, only one use.
1303 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1304 don't use TokenNumberType as element type.
1305
1306 * tests/regression.at: Modify expected output to agree with change
1307 to yyr1 and yytranslate.
1308
13092002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1310
1311 * src/reader.c (parse_action): Use copy_character instead of
1312 obstack_1grow.
1313
13142002-05-13 Akim Demaille <akim@epita.fr>
1315
1316 * tests/regression.at (Token definitions): Prototype yylex and
1317 yyerror.
1318
13192002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1320
1321 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
1322 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1323 32-bit arithmetic.
1324 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1325
13262002-05-07 Akim Demaille <akim@epita.fr>
1327
1328 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1329 avoid GCC warnings.
1330
13312002-05-07 Akim Demaille <akim@epita.fr>
1332
1333 Kill GCC warnings.
1334
1335 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1336 over the RHS of each rule.
1337 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1338 * src/state.h (state_t): Member `nitems' is unsigned short.
1339 * src/LR0.c (get_state): Adjust.
1340 * src/reader.c (packgram): Likewise.
1341 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1342 `Type'.
1343 (muscle_insert_int_table): Remove, unused.
1344 (prepare_rules): Remove `max'.
1345
13462002-05-06 Akim Demaille <akim@epita.fr>
1347
1348 * src/closure.c (print_firsts): Display of the symbol tags.
1349 (bitmatrix_print): Move to...
1350 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1351 here.
1352 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1353
13542002-05-06 Akim Demaille <akim@epita.fr>
1355
1356 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1357 hash_do_for_each.
1358
13592002-05-06 Akim Demaille <akim@epita.fr>
1360
1361 * src/LR0.c (new_state, get_state): Instead of using the global
1362 `kernel_size' and `kernel_base', have two new arguments:
1363 `core_size' and `core'.
1364 Adjust callers.
1365
13662002-05-06 Akim Demaille <akim@epita.fr>
1367
1368 * src/reader.c (packgram): No longer end `ritem' with a 0
1369 sentinel: it is not used.
1370
13712002-05-05 Akim Demaille <akim@epita.fr>
1372
1373 New experimental feature: display the lookaheads in the report and
1374 graph.
1375
1376 * src/print (print_core): When --trace-flag, display the rules
1377 lookaheads.
1378 * src/print_graph.c (print_core): Likewise.
1379 Swap the arguments.
1380 Adjust caller.
1381
13822002-05-05 Akim Demaille <akim@epita.fr>
1383
1384 * tests/torture.at (Many lookaheads): New test.
1385
13862002-05-05 Akim Demaille <akim@epita.fr>
1387
1388 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1389 (GENERATE_MUSCLE_INSERT_TABLE): this.
1390 (output_int_table, output_unsigned_int_table, output_short_table)
1391 (output_token_number_table, output_item_number_table): Replace with...
1392 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1393 (muscle_insert_short_table, muscle_insert_token_number_table)
1394 (muscle_insert_item_number_table): these.
1395 Adjust all callers.
1396 (prepare_tokens): Don't free `translations', since...
1397 * src/reader.h, src/reader.c (grammar_free): do it.
1398 Move to...
1399 * src/gram.h, src/gram.c (grammar_free): here.
1400 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1401 b4_translate_max.
1402
14032002-05-05 Akim Demaille <akim@epita.fr>
1404
1405 * src/output.c (output_unsigned_int_table): New.
1406 (prepare_rules): `i' is unsigned.
1407 `prhs', `rline', `r2' are unsigned int.
1408 Rename muscle `rhs_number_max' as `rhs_max'.
1409 Output muscles `prhs_max', `rline_max', and `r2_max'.
1410 Free rline and r1.
1411 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1412 to compute types instead of constant types.
1413 * tests/regression.at (Web2c Actions): Adjust.
1414
14152002-05-04 Akim Demaille <akim@epita.fr>
1416
1417 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1418 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1419 Adjust dependencies.
1420 * src/output.c (token_definitions_output): Be sure not to output a
1421 `#define 'a'' when fed with `%token 'a' "a"'.
1422 * tests/regression.at (Token definitions): New.
1423
14242002-05-03 Paul Eggert <eggert@twinsun.com>
1425
1426 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1427 for K&R C.
1428
14292002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1430
1431 * Makefile.am (SUBDIRS): Remove intl.
1432 (EXTRA_DIST): Add config/config.rpath.
1433
14342002-05-03 Akim Demaille <akim@epita.fr>
1435
1436 * data/bison.simple (m4_if): Don't output empty enums.
1437 And actually, output valid enum definitions :(.
1438
14392002-05-03 Akim Demaille <akim@epita.fr>
1440
1441 * configure.bat: Remove, completely obsolete.
1442 * Makefile.am (EXTRA_DIST): Adjust.
1443 Don't distribute config.rpath...
1444 * config/Makefile.am (EXTRA_DIST): Do it.
1445
14462002-05-03 Akim Demaille <akim@epita.fr>
1447
1448 * configure.in (GETTEXT_VERSION): New.
1449 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1450
14512002-05-03 Akim Demaille <akim@epita.fr>
1452
1453 * data/bison.simple (b4_token_enum): New.
1454 (b4_token_defines): Use it to output tokens both as #define and
1455 enums.
1456 Suggested by Paul Eggert.
1457 * src/output.c (token_definitions_output): Don't output spurious
1458 white spaces.
1459
14602002-05-03 Akim Demaille <akim@epita.fr>
1461
1462 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1463
14642002-05-02 Robert Anisko <robert@lrde.epita.fr>
1465
1466 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1467 Update the stack class, give a try to deque as the default container.
1468
14692002-05-02 Akim Demaille <akim@epita.fr>
1470
1471 * data/bison.simple (yyparse): Do not implement @$ = @1.
1472 (YYLLOC_DEFAULT): Adjust to do it.
1473 * doc/bison.texinfo (Location Default Action): Fix.
1474
14752002-05-02 Akim Demaille <akim@epita.fr>
1476
1477 * src/reader.c (parse_braces): Merge into...
1478 (parse_action): this.
1479
14802002-05-02 Akim Demaille <akim@epita.fr>
1481
1482 * configure.in (ALL_LINGUAS): Remove.
1483 * po/LINGUAS, hr.po: New.
1484
14852002-05-02 Akim Demaille <akim@epita.fr>
1486
1487 Remove the so called hairy (semantic) parsers.
1488
1489 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1490 * src/gram.h, src/gram.c (semantic_parser): Remove.
1491 (rule_t): Remove the guard and guard_line members.
1492 * src/lex.h (token_t): remove tok_guard.
1493 * src/options.c (option_table): Remove %guard and %semantic_parser
1494 support.
1495 * src/output.c, src/output.h (guards_output): Remove.
1496 (prepare): Adjust.
1497 (token_definitions_output): Don't output the `T'
1498 tokens (???).
1499 (output_skeleton): Don't output the guards.
1500 * src/files.c, src/files.c (attrsfile): Remove.
1501 * src/reader.c (symbol_list): Remove the guard and guard_line
1502 members.
1503 Adjust dependencies.
1504 (parse_guard): Remove.
1505 * data/bison.hairy: Remove.
1506 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1507 BISON_HAIRY.
1508
15092002-05-02 Akim Demaille <akim@epita.fr>
1510
1511 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1512 (parse_guard): Rename the formal argument `stack_offset' as
1513 `rule_length', which is more readable.
1514 Adjust callers.
1515 (copy_at, copy_dollar): Instead of outputting the hard coded
1516 values of $$, $n and so forth, output invocation to b4_lhs_value,
1517 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
1518 Note: this patch partially drops `semantic-parser' support: it
1519 always does `rule_length - n', where semantic parsers ought to
1520 always use `-n'.
1521 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1522 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1523
15242002-05-02 Akim Demaille <akim@epita.fr>
1525
1526 * configure.in (AC_INIT): Bump to 1.49b.
1527 (AM_INIT_AUTOMAKE): Short invocation.
1528
15292002-05-02 Akim Demaille <akim@epita.fr>
1530
1531 Version 1.49a.
1532
15332002-05-01 Akim Demaille <akim@epita.fr>
1534
1535 * src/skeleton.h: Remove.
1536
15372002-05-01 Akim Demaille <akim@epita.fr>
1538
1539 * src/skeleton.h: Fix the #endif.
1540 Reported by Magnus Fromreide.
1541
15422002-04-26 Paul Eggert <eggert@twinsun.com>
1543
1544 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1545 Define if we define YYSTYPE and YYLTYPE, respectively.
1546 (YYCOPY): Fix [] quoting problem in the non-GCC case.
1547
15482002-04-25 Robert Anisko <robert@lrde.epita.fr>
1549
1550 * src/scan-skel.l: Postprocess quadrigraphs.
1551
1552 * src/reader.c (copy_character): New function, used to output
1553 single characters while replacing `[' and `]' with quadrigraphs, to
1554 avoid troubles with M4 quotes.
1555 (copy_comment): Output characters with copy_character.
1556 (read_additionnal_code): Likewise.
1557 (copy_string2): Likewise.
1558 (copy_definition): Likewise.
1559
1560 * tests/calc.at: Exercise M4 quoting.
1561
15622002-04-25 Akim Demaille <akim@epita.fr>
1563
1564 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1565 between `!' and the command.
1566 Reported by Paul Eggert.
1567
15682002-04-24 Robert Anisko <robert@lrde.epita.fr>
1569
1570 * tests/calc.at: Exercise prologue splitting.
1571
1572 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1573 `b4_post_prologue' instead of `b4_prologue'.
1574
1575 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1576 muscles.
1577 (output): Free pre_prologue_obstack and post_prologue_obstack.
1578 * src/files.h, src/files.c (attrs_obstack): Remove.
1579 (pre_prologue_obstack, post_prologue_obstack): New.
1580 * src/reader.c (copy_definition): Add a parameter to specify the
1581 obstack to fill, instead of using attrs_obstack unconditionally.
1582 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1583 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1584
15852002-04-23 Paul Eggert <eggert@twinsun.com>
1586
1587 * data/bison.simple: Remove unnecessary commentary and white
1588 space differences from 1_29-branch.
1589 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1590
1591 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1592 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1593 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1594 constructors or destructors.
1595
1596 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1597
15982002-04-23 Akim Demaille <akim@epita.fr>
1599
1600 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1601 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1602 location with columns.
1603 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1604 All reported by Paul Eggert.
1605
16062002-04-22 Akim Demaille <akim@epita.fr>
1607
1608 * src/reduce.c (dump_grammar): Move to...
1609 * src/gram.h, src/gram.c (grammar_dump): here.
1610 Be sure to separate long item numbers.
1611 Don't read the members of a rule's prec if its nil.
1612
16132002-04-22 Akim Demaille <akim@epita.fr>
1614
1615 * src/output.c (table_size, table_grow): New.
1616 (MAXTABLE): Remove, replace uses with table_size.
1617 (pack_vector): Instead of dying when the table is too big, grow it.
1618
16192002-04-22 Akim Demaille <akim@epita.fr>
1620
1621 * data/bison.simple (yyr1): Its type is that of a token number.
1622 * data/bison.c++ (r1_): Likewise.
1623 * tests/regression.at (Web2c Actions): Adjust.
1624
16252002-04-22 Akim Demaille <akim@epita.fr>
1626
1627 * src/reader.c (token_translations_init): 256 is now the default
1628 value for the error token, i.e., it will be assigned another
1629 number if the user assigned 256 to one of her tokens.
1630 (reader): Don't force 256 to error.
1631 * doc/bison.texinfo (Symbols): Adjust.
1632 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1633 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1634 etc. instead of 10, 20, 30 (which was used to `jump' over error
1635 (256) and undefined (2)).
1636
16372002-04-22 Akim Demaille <akim@epita.fr>
1638
1639 Propagate more token_number_t.
1640
1641 * src/gram.h (token_number_as_item_number)
1642 (item_number_as_token_number): New.
1643 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1644 Use it to create output_item_number_table and
1645 output_token_number_table.
1646 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1647 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1648 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1649 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1650
16512002-04-22 Akim Demaille <akim@epita.fr>
1652
1653 * src/output.h, src/output.c (get_lines_number): Remove.
1654
16552002-04-19 Akim Demaille <akim@epita.fr>
1656
1657 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1658 as Lex/Flex'.
1659 (Debugging): More details about enabling the debugging features.
1660 (Table of Symbols): Describe $$, $n, @$, and @n.
1661 Suggested by Tim Josling.
1662
16632002-04-19 Akim Demaille <akim@epita.fr>
1664
1665 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1666
16672002-04-10 Akim Demaille <akim@epita.fr>
1668
1669 * src/system.h: Rely on HAVE_LIMITS_H.
1670 Suggested by Paul Eggert.
1671
16722002-04-09 Akim Demaille <akim@epita.fr>
1673
1674 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1675 full stderr, and strip it according to the bison options, instead
1676 of composing the error message from different bits.
1677 This makes it easier to check for several error messages.
1678 Adjust all the invocations.
1679 Add an invocation exercising the error token.
1680 Add an invocation demonstrating a stupid error message.
1681 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1682 Adjust the tests.
1683 Error message are for stderr, not stdout.
1684
16852002-04-09 Akim Demaille <akim@epita.fr>
1686
1687 * src/gram.h, src/gram.c (error_token_number): Remove, use
1688 errtoken->number.
1689 * src/reader.c (reader): Don't specify the user token number (2)
1690 for $undefined, as it uselessly prevents using it.
1691 * src/gram.h (token_number_t): Move to...
1692 * src/symtab.h: here.
1693 (state_t.number): Is a token_number_t.
1694 * src/print.c, src/reader.c: Use undeftoken->number instead of
1695 hard coded 2.
1696 (Even though this 2 is not the same as above: the number of the
1697 undeftoken remains being 2, it is its user token number which
1698 might not be 2).
1699 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1700 `user_token_number_max'.
1701 Output `undef_token_number'.
1702 * data/bison.simple, data/bison.c++: Use them.
1703 Be sure to map invalid yylex return values to
1704 `undef_token_number'. This saves us from gratuitous SEGV.
1705
1706 * tests/conflicts.at (Solved SR Conflicts)
1707 (Unresolved SR Conflicts): Adjust.
1708 * tests/regression.at (Web2c Actions): Adjust.
1709
17102002-04-08 Akim Demaille <akim@epita.fr>
1711
1712 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1713 Adding #line.
1714 Remove the duplicate `typedefs'.
1715 (RhsNumberType): Fix the declaration and various other typos.
1716 Use __ofile__.
1717 * data/bison.simple: Use __ofile__.
1718 * src/scan-skel.l: Handle __ofile__.
1719
17202002-04-08 Akim Demaille <akim@epita.fr>
1721
1722 * src/gram.h (item_number_t): New, the type of item numbers in
1723 RITEM. Note that it must be able to code symbol numbers as
1724 positive number, and the negation of rule numbers as negative
1725 numbers.
1726 Adjust all dependencies (pretty many).
1727 * src/reduce.c (rule): Remove this `short *' pointer: use
1728 item_number_t.
1729 * src/system.h (MINSHORT, MAXSHORT): Remove.
1730 Include `limits.h'.
1731 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1732 (shortcpy): Remove.
1733 (MAXTABLE): Move to...
1734 * src/output.c (MAXTABLE): here.
1735 (prepare_rules): Use output_int_table to output rhs.
1736 * data/bison.simple, data/bison.c++: Adjust.
1737 * tests/torture.at (Big triangle): Move the limit from 254 to
1738 500.
1739 * tests/regression.at (Web2c Actions): Ajust.
1740
1741 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1742 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1743 passes, but produces negative #line number, once fixed, GCC is
1744 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1745 C), it passes.
1746 * src/state.h (state_h): Code input lines on ints, not shorts.
1747
17482002-04-08 Akim Demaille <akim@epita.fr>
1749
1750 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1751 and then the grammar.
1752
17532002-04-08 Akim Demaille <akim@epita.fr>
1754
1755 * src/system.h: No longer using strndup.
1756
17572002-04-07 Akim Demaille <akim@epita.fr>
1758
1759 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1760 * src/output.c (output_table_data): Return the longest number.
1761 (prepare_tokens): Output `token_number_max').
1762 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1763 New.
1764 Use them to define yy_token_number_type/TokenNumberType.
1765 Use this type for yytranslate.
1766 * tests/torture.at (Big triangle): Push the limit from 124 to
1767 253.
1768 * tests/regression.at (Web2c Actions): Adjust.
1769
17702002-04-07 Akim Demaille <akim@epita.fr>
1771
1772 * tests/torture.at (Big triangle): New.
1773 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1774 * tests/existing.at: here.
1775
17762002-04-07 Akim Demaille <akim@epita.fr>
1777
1778 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1779 nritems.
1780 Adjust dependencies.
1781
17822002-04-07 Akim Demaille <akim@epita.fr>
1783
1784 * src/reader.c: Normalize increments to prefix form.
1785
17862002-04-07 Akim Demaille <akim@epita.fr>
1787
1788 * src/reader.c, symtab.c: Remove debugging code.
1789
17902002-04-07 Akim Demaille <akim@epita.fr>
1791
1792 Rename all the `bucket's as `symbol_t'.
1793
1794 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1795 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1796 * src/symtab.c, src/symtab.h (bucket): Rename as...
1797 (symbol_t): this.
1798 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1799 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1800 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1801 (buckets_new, buckets_free, buckets_do): Rename as...
1802 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1803 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1804 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1805 (symbols_new, symbols_free, symbols_do): these.
1806
18072002-04-07 Akim Demaille <akim@epita.fr>
1808
1809 Use lib/hash for the symbol table.
1810
1811 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1812 EOF.
1813 * src/lex.c (lex): Set the `number' member of new terminals.
1814 * src/reader.c (bucket_check_defined, bucket_make_alias)
1815 (bucket_check_alias_consistence, bucket_translation): New.
1816 (reader, grammar_free, readgram, token_translations_init)
1817 (packsymbols): Adjust.
1818 (reader): Number the predefined tokens.
1819 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1820 for predefined tokens.
1821 * src/symtab.h (bucket): Remove all the hash table related
1822 members.
1823 * src/symtab.c (symtab): Replace by...
1824 (bucket_table): this.
1825 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1826 (buckets_new, buckets_do): New.
1827
18282002-04-07 Akim Demaille <akim@epita.fr>
1829
1830 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1831 (start_symbol, max_user_token_number, semantic_parser)
1832 (error_token_number): Initialize.
1833 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1834 Initialize.
1835 (reader): Don't.
1836 (errtoken, eoftoken, undeftoken, axiom): Extern.
1837
18382002-04-07 Akim Demaille <akim@epita.fr>
1839
1840 * src/gram.h (rule_s): prec and precsym are now pointers
1841 to the bucket giving the priority/associativity.
1842 Member `associativity' removed: useless.
1843 * src/reduce.c, src/conflicts.c: Adjust.
1844
18452002-04-07 Akim Demaille <akim@epita.fr>
1846
1847 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1848 Properly escape the symbols' TAG when outputting them.
1849
18502002-04-07 Akim Demaille <akim@epita.fr>
1851
1852 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1853
18542002-04-07 Akim Demaille <akim@epita.fr>
1855
1856 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1857 (LArule): this, which is an array to rule_t*.
1858 * src/print.c, src/conflicts.c: Adjust.
1859
18602002-04-07 Akim Demaille <akim@epita.fr>
1861
1862 * src/gram.h (rule_t): Rename `number' as `user_number'.
1863 `number' is a new member.
1864 Adjust dependencies.
1865 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1866
18672002-04-07 Akim Demaille <akim@epita.fr>
1868
1869 As a result of the previous patch, it is no longer needed
1870 to reorder ritem itself.
1871
1872 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1873
18742002-04-07 Akim Demaille <akim@epita.fr>
1875
1876 Be sure never to walk through RITEMS, but use only data related to
1877 the rules themselves. RITEMS should be banished.
1878
1879 * src/output.c (output_token_translations): Rename as...
1880 (prepare_tokens): this.
1881 In addition to `translate', prepare the muscles `tname' and
1882 `toknum', which were handled by...
1883 (output_rule_data): this.
1884 Remove, and move the remainder of its outputs into...
1885 (prepare_rules): this new routines, which also merges content from
1886 (output_gram): this.
1887 (prepare_rules): Be sure never to walk through RITEMS.
1888 (output_stos): Rename as...
1889 (prepare_stos): this.
1890 (output): Always invoke prepare_states, after all, just don't use it
1891 in the output if you don't need it.
1892
18932002-04-07 Akim Demaille <akim@epita.fr>
1894
1895 * src/LR0.c (new_state): Display `nstates' as the name of the
1896 newly created state.
1897 Adjust to initialize first_state and last_state if needed.
1898 Be sure to distinguish the initial from the final state.
1899 (new_states): Create the itemset of the initial state, and use
1900 new_state.
1901 * src/closure.c (closure): Now that the initial state has its
1902 items properly set, there is no need for a special case when
1903 creating `ruleset'.
1904
1905 As a result, now the rule 0, reducing to $axiom, is visible in the
1906 outputs. Adjust the test suite.
1907
1908 * tests/conflicts.at (Solved SR Conflicts)
1909 (Unresolved SR Conflicts): Adjust.
1910 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1911 * tests/conflicts.at (S/R in initial): New.
1912
19132002-04-07 Akim Demaille <akim@epita.fr>
1914
1915 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1916 the RHS of the rules.
1917 * src/output.c (output_gram): Likewise.
1918
19192002-04-07 Akim Demaille <akim@epita.fr>
1920
1921 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1922 bucket.
1923 Adjust all dependencies.
1924 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1925 `number' of the buckets too.
1926 * src/gram.h: Include `symtab.h'.
1927 (associativity): Move to...
1928 * src/symtab.h: here.
1929 No longer include `gram.h'.
1930
19312002-04-07 Akim Demaille <akim@epita.fr>
1932
1933 * src/gram.h, src/gram.c (rules_rhs_length): New.
1934 (ritem_longest_rhs): Use it.
1935 * src/gram.h (rule_t): `number' is a new member.
1936 * src/reader.c (packgram): Set it.
1937 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1938 the end of `rules', and count them out of `nrules'.
1939 (reduce_output, dump_grammar): Adjust.
1940 * src/print.c (print_grammar): It is no longer needed to check for
1941 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1942 * tests/reduce.at (Reduced Automaton): New test.
1943
19442002-04-07 Akim Demaille <akim@epita.fr>
1945
1946 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1947 lacking `+ 1' to nrules, Bison reported as useless a token if it
1948 was used solely to set the precedence of the last rule...
1949
19502002-04-07 Akim Demaille <akim@epita.fr>
1951
1952 * data/bison.c++, data/bison.simple: Don't output the current file
1953 name in #line, to avoid useless diffs between two identical
1954 outputs under different names.
1955
19562002-04-07 Akim Demaille <akim@epita.fr>
1957
1958 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1959 Normalize loops to using `< nrules + 1', not `<= nrules'.
1960
19612002-04-07 Akim Demaille <akim@epita.fr>
1962
1963 * TODO: Update.
1964
19652002-04-07 Akim Demaille <akim@epita.fr>
1966
1967 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1968 bucket.value as bucket.number.
1969
19702002-04-07 Akim Demaille <akim@epita.fr>
1971
1972 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1973 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1974 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1975 RHS, instead of being an index in RITEMS.
1976
19772002-04-04 Paul Eggert <eggert@twinsun.com>
1978
1979 * doc/bison.texinfo: Update copyright date.
1980 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1981 (Symbols): Warn about running Bison in one character set,
1982 but compiling and/or running in an incompatible one.
1983 Warn about character code 256, too.
1984
19852002-04-03 Paul Eggert <eggert@twinsun.com>
1986
1987 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1988 YYERROR_VERBOSE is nonzero, not whether it is defined.
1989
1990 Merge changes from bison-1_29-branch.
1991
19922002-03-20 Paul Eggert <eggert@twinsun.com>
1993
1994 Merge fixes from Debian bison_1.34-1.diff.
1995
1996 * configure.in (AC_PREREQ): 2.53.
1997
19982002-03-20 Akim Demaille <akim@epita.fr>
1999
2000 * src/conflicts.c (log_resolution): Argument `resolution' is const.
2001
20022002-03-19 Paul Eggert <eggert@twinsun.com>
2003
2004 * src/bison.simple (YYCOPY): New macro.
2005 (YYSTACK_RELOCATE): Use it.
2006 Remove Type arg; no longer needed. All callers changed.
2007 (yymemcpy): Remove; no longer needed.
2008
2009 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
2010 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2011
20122002-03-19 Akim Demaille <akim@epita.fr>
2013
2014 Test and fix the #line outputs.
2015
2016 * tests/atlocal.at (GCC): New.
2017 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
2018 (Prologue synch line, ,%union synch line, Postprologue synch line)
2019 (Action synch line, Epilogue synch line): New tests.
2020 * src/reader.c (parse_union_decl): Define the muscle stype_line.
2021 * data/bison.simple, data/bison.c++: Use it.
2022
20232002-03-19 Akim Demaille <akim@epita.fr>
2024
2025 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
2026 (Solved SR Conflicts, %expect not enough, %expect right)
2027 (%expect too much): Move to...
2028 * tests/conflicts.at: this new file.
2029
20302002-03-19 Akim Demaille <akim@epita.fr>
2031
2032 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2033 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
2034 that we can move to enums for instance.
2035 * src/output.c (token_definitions_output): Output a list of
2036 `token-name, token-number' instead of the #define.
2037 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
2038
20392002-03-14 Akim Demaille <akim@epita.fr>
2040
2041 Use Gettext 0.11.1.
2042
20432002-03-09 Robert Anisko <robert@lrde.epita.fr>
2044
2045 * data/bison.c++: Make the user able to add members to the generated
2046 parser by subclassing.
2047
20482002-03-05 Robert Anisko <robert@lrde.epita.fr>
2049
2050 * src/reader.c (read_additionnal_code): `c' should be an integer, not
2051 a character.
2052 Reported by Nicolas Tisserand and Nicolas Burrus.
2053
20542002-03-04 Robert Anisko <robert@lrde.epita.fr>
2055
2056 * src/reader.c: Warn about lacking semi-colons, do not complain.
2057
20582002-03-04 Robert Anisko <robert@lrde.epita.fr>
2059
2060 * data/bison.c++: Remove a debug line.
2061
20622002-03-04 Robert Anisko <robert@lrde.epita.fr>
2063
2064 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
2065 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
2066 provide a default implementation.
2067
20682002-03-04 Akim Demaille <akim@epita.fr>
2069
2070 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
2071 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
2072 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
2073 * tests/semantic.at (Parsing Guards): Similarly.
2074 * src/reader.at (readgram): Complain if the last rule is not ended
2075 with a semi-colon.
2076
20772002-03-04 Akim Demaille <akim@epita.fr>
2078
2079 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
2080 * src/closure.c: here.
2081 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
2082 RTC.
2083 * src/warshall.h, src/warshall.c: Remove.
2084 * tests/sets.at (Broken Closure): Adjust.
2085
20862002-03-04 Akim Demaille <akim@epita.fr>
2087
2088 * src/output.c (output_skeleton): tempdir is const.
2089 bytes_read is unused.
2090
20912002-03-04 Akim Demaille <akim@epita.fr>
2092
2093 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2094 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
2095 Update.
2096 From Michael Hayes.
2097
20982002-03-04 Akim Demaille <akim@epita.fr>
2099
2100 * src/closure.c (closure): `r' is unused.
2101
21022002-03-04 Akim Demaille <akim@epita.fr>
2103
2104 * tests/sets.at (Broken Closure): Add the ending `;'.
2105 * src/reader.at (readgram): Complain if a rule is not ended with a
2106 semi-colon.
2107
21082002-03-04 Akim Demaille <akim@epita.fr>
2109
2110 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
2111 (count_sr_conflicts): Use bitset_count.
2112 * src/reduce.c (inaccessable_symbols): Ditto.
2113 (bits_size): Remove.
2114 * src/warshall.h, src/warshall.c: Convert to bitsetv.
2115
21162002-03-04 Akim Demaille <akim@epita.fr>
2117
2118 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
2119 * src/reduce.c: Remove the `bitset_zero's following the
2120 `bitset_create's, as now it is performed by the latter.
2121
21222002-03-04 Akim Demaille <akim@epita.fr>
2123
2124 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
2125 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
2126 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
2127 latest sources from Michael.
2128
21292002-03-04 Akim Demaille <akim@epita.fr>
2130
2131 * src/output.c (output): Don't free the grammar.
2132 * src/reader.c (grammar_free): New.
2133 * src/main.c (main): Call it and don't free symtab here.
2134
21352002-03-04 Akim Demaille <akim@epita.fr>
2136
2137 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
2138 before returning.
2139 Reported by Benoit Perrot.
2140
21412002-03-04 Akim Demaille <akim@epita.fr>
2142
2143 Use bitset operations when possible, not loops over bits.
2144
2145 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
2146 bitset_or.
2147 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
2148 * src/reduce.c (useless_nonterminals): Formatting changes.
2149 * src/warshall.c (TC): Use bitset_or.
2150
21512002-03-04 Akim Demaille <akim@epita.fr>
2152
2153 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
2154 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
2155 Ditto.
2156
21572002-03-04 Akim Demaille <akim@epita.fr>
2158
2159 * src/lalr.c (F): Now a bitset*.
2160 Adjust all dependencies.
2161
21622002-03-04 Akim Demaille <akim@epita.fr>
2163
2164 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
2165 Adjust all dependencies.
2166
21672002-03-04 Akim Demaille <akim@epita.fr>
2168
2169 * src/L0.c, src/LR0.h (nstates): Be size_t.
2170 Adjust comparisons (signed vs unsigned).
2171 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
2172 bitset*.
2173 Adjust all dependencies.
2174
21752002-03-04 Akim Demaille <akim@epita.fr>
2176
2177 * src/closure.c (firsts): Now, also a bitset.
2178 Adjust all dependencies.
2179 (varsetsize): Remove, now unused.
2180 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2181
21822002-03-04 Akim Demaille <akim@epita.fr>
2183
2184 * src/print.c: Convert to use bitset.h, not hand coded iterations
2185 over ints.
2186
21872002-03-04 Akim Demaille <akim@epita.fr>
2188
2189 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2190
21912002-03-04 Akim Demaille <akim@epita.fr>
2192
2193 * src/closure.c (ruleset): Be a bitset.
2194 (rulesetsize): Remove.
2195
21962002-03-04 Akim Demaille <akim@epita.fr>
2197
2198 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2199 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2200 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2201 * src/closure.c (fderives): Be an array of bitsets.
2202
22032002-02-28 Robert Anisko <robert@lrde.epita.fr>
2204
2205 * data/bison.c++: Merge the two generated headers. Insert a copyright
2206 notice in each output file.
2207
22082002-02-28 Akim Demaille <akim@epita.fr>
2209
2210 * data/bison.c++: Copy the prologue of bison.simple to fetch
2211 useful M4 definitions, such as b4_header_guard.
2212
22132002-02-25 Akim Demaille <akim@epita.fr>
2214
2215 * src/getargs.c (version): Give the name of the authors, and use a
2216 translator friendly scheme for the bgr
2217 copyright notice.
2218
22192002-02-25 Akim Demaille <akim@epita.fr>
2220
2221 * src/output.c (header_output): Remove, now handled completely via
2222 M4.
2223
22242002-02-25 Akim Demaille <akim@epita.fr>
2225
2226 * m4/m4.m4: New, from CVS Autoconf.
2227 * configure.in: Invoke it.
2228 * src/output.c (output_skeleton): Use its result instead of the
2229 hard coded name.
2230
22312002-02-25 Akim Demaille <akim@epita.fr>
2232
2233 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2234 Fileutils 4.1.5.
2235 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2236 * src/output.c (output_skeleton): Use mkstemp to create a real
2237 temporary file.
2238 Move the filling of `skeleton' and its muscle to...
2239 (prepare): here.
2240 (output): Move the definition of the prologue muscle to...
2241 (prepare): here.
2242 * src/system.h (DEFAULT_TMPDIR): New.
2243
22442002-02-14 Paul Eggert <eggert@twinsun.com>
2245
2246 Remove the support for C++ namespace cleanliness; it was
2247 causing more problems than it was curing, since it didn't work
2248 properly on some nonstandard C++ compilers. This can wait
2249 for a proper C++ parser.
2250
2251 * NEWS: Document this.
2252 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2253 of C++, as it's treated like C now.
2254 * src/bison.simple (YYSTD): Remove.
2255 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2256 Treat C++ just like Standard C instead of trying to support
2257 namespace cleanliness.
2258
22592002-02-14 Akim Demaille <akim@epita.fr>
2260
2261 * tests/regression.at (else): Adjust to Andreas' change.
2262
22632002-02-14 Akim Demaille <akim@epita.fr>
2264
2265 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2266
22672002-02-13 Andreas Schwab <schwab@suse.de>
2268
2269 * src/output.c (output_rule_data): Don't output NULL, it might
2270 not be defined yet.
2271
22722002-02-11 Robert Anisko <robert@lrde.epita.fr>
2273
2274 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2275 (Copyright notice): Update.
2276
22772002-02-11 Akim Demaille <akim@epita.fr>
2278
2279 * tests/regression.at (%nonassoc and eof): Don't include
2280 nonportable headers.
2281
22822002-02-08 Robert Anisko <robert@lrde.epita.fr>
2283
2284 * data/bison.c++: Correct error recovery. Make the user able to
2285 initialize the starting location.
2286
22872002-02-07 Akim Demaille <akim@epita.fr>
2288
2289 * tests/input.at: New.
2290
22912002-02-07 Robert Anisko <robert@lrde.epita.fr>
2292
2293 * data/bison.c++: Replace some direct m4 expansions by constants. Be
2294 more consistent when naming methods and variables. Put preprocessor
2295 directives around tables only needed for debugging.
2296
22972002-02-07 Robert Anisko <robert@lrde.epita.fr>
2298
2299 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2300 C++ parsers.
2301 (yy::b4_name::parse): Use print_.
2302
23032002-02-07 Robert Anisko <robert@lrde.epita.fr>
2304
2305 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2306
23072002-02-07 Robert Anisko <robert@lrde.epita.fr>
2308
2309 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2310 C++ parsers.
2311 (yy::b4_name::parse): Build verbose error messages, and use error_.
2312
23132002-02-06 Robert Anisko <robert@lrde.epita.fr>
2314
2315 * data/bison.c++: Fix m4 quoting in comments.
2316
23172002-02-06 Robert Anisko <robert@lrde.epita.fr>
2318
2319 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2320 not expanded by m4.
2321
23222002-02-05 Akim Demaille <akim@epita.fr>
2323
2324 * data/bison.c++: Adjust to the M4 back end.
2325 More is certainly needed.
2326
23272002-02-05 Akim Demaille <akim@epita.fr>
2328
2329 Give a try to M4 as a back end.
2330
2331 * lib/readpipe.c: New, from wdiff.
2332 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2333 BISON_HAIRY.
2334 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2335 specific values. Now it is m4 that performs the lookup.
2336 * src/parse-skel.y: Remove.
2337 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2338 * src/output.c (actions_output, guards_output)
2339 (token_definitions_output): No longer keeps track of the output
2340 line number, hence remove the second argument.
2341 (guards_output): Check against the guard member of a rule, not the
2342 action member.
2343 Adjust callers.
2344 (output_skeleton): Don't look for the skeleton location, let m4 do
2345 that.
2346 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2347 file will be used.
2348 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2349 (prepare): Given that for the time being changesyntax is not
2350 usable in M4, rename the muscles using `-' to `_'.
2351 Define `defines_flag', `output_parser_name' and `output_header_name'.
2352 * src/output.h (actions_output, guards_output)
2353 (token_definitions_output): Adjust prototypes.
2354 * src/scan-skel.l: Instead of scanning the skeletons, it now
2355 processes the output of m4: `__oline__' and `#output'.
2356 * data/bison.simple: Adjust to be used by M4(sugar).
2357 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2358 to date.
2359 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2360 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2361 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2362 shamelessly stolen from CVS Autoconf.
2363
23642002-02-05 Akim Demaille <akim@epita.fr>
2365
2366 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2367 * configure.in: Check for the declarations of free and malloc.
2368 * src/muscle_tab.c: Adjust.
2369
23702002-02-05 Akim Demaille <akim@epita.fr>
2371
2372 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2373 which have no values.
2374
23752002-02-05 Akim Demaille <akim@epita.fr>
2376
2377 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2378 * data/: here.
2379
23802002-01-29 Paul Eggert <eggert@twinsun.com>
2381
2382 * src/bison.simple (YYSIZE_T): Do not define merely because
2383 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2384 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2385
23862002-01-27 Akim Demaille <akim@epita.fr>
2387
2388 Fix `%nonassoc and eof'.
2389
2390 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2391 which were not properly copied! Replace
2392 memcpy (res->errs, src->errs, src->nerrs);
2393 with
2394 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2395 !!!
2396 * tests/regression.at (%nonassoc and eof): Adjust to newest
2397 Autotest: `.' is not in the PATH.
2398
23992002-01-27 Akim Demaille <akim@epita.fr>
2400
2401 * tests/sets.at (AT_EXTRACT_SETS): New.
2402 (Nullable): Use it.
2403 (Firsts): New.
2404
24052002-01-26 Akim Demaille <akim@epita.fr>
2406
2407 * tests/actions.at, tests/calc.at, tests/headers.at,
2408 * tests/torture.at: Adjust to the newest Autotest which no longer
2409 forces `.' in the PATH.
2410
24112002-01-25 Akim Demaille <akim@epita.fr>
2412
2413 * tests/regression.at (%nonassoc and eof): New.
2414 Suggested by Robert Anisko.
2415
24162002-01-24 Akim Demaille <akim@epita.fr>
2417
2418 Bison dumps core when trying to complain about broken input files.
2419 Reported by Cris van Pelt.
2420
2421 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2422 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2423 into...
2424 (Invalid inputs): Strengthen: exercise parse_percent_token.
2425
24262002-01-24 Robert Anisko <robert.anisko@epita.fr>
2427
2428 * src/Makefile.am: Add bison.c++.
2429 * src/bison.c++: New skeleton.
2430
24312002-01-21 Paolo Bonzini <bonzini@gnu.org>
2432
2433 * po/it.po: New.
2434
24352002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2436
2437 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2438
24392002-01-20 Marc Autret <marc@gnu.org>
2440
2441 * src/files.c (compute_output_file_names): Fix
2442
24432002-01-20 Marc Autret <marc@gnu.org>
2444
2445 * tests/output.at: New test.
2446 * src/files.c (compute_base_names): Don't map extensions when
2447 the YACC flag is set, use defaults.
2448 Reported by Evgeny Stambulchik.
2449
24502002-01-20 Marc Autret <marc@gnu.org>
2451
2452 * src/system.h: Need to define __attribute__ away for non-GCC
2453 compilers as well (i.e. the vendor C compiler).
2454 Suggested by Albert Chin-A-Young.
2455
24562002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2457
2458 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2459 canonical definition.
2460 * src/system.h: Use the canonical definition for PARAMS (avoids
2461 a conflict with the macro from lib/hash.h).
2462
24632002-01-11 Akim Demaille <akim@epita.fr>
2464
2465 * configure.in: Use AC_FUNC_STRNLEN.
2466 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
2467
24682002-01-09 Akim Demaille <akim@epita.fr>
2469
2470 * src/files.c, src/files.h (output_infix): New.
2471 (tab_extension): Remove.
2472 (compute_base_names): Compute the former, drop the latter.
2473 * src/output.c (prepare): Insert the muscles `output-infix', and
2474 `output-suffix'.
2475 * src/parse-skel.y (string, string.1): New.
2476 (section.header): Use it.
2477 (section.yacc): Remove.
2478 (prefix): Remove too.
2479 * src/scan-skel.l: Adjust.
2480 * src/bison.simple, src/bison.hairy: Adjust.
2481
24822002-01-09 Akim Demaille <akim@epita.fr>
2483
2484 * configure.in (WERROR_CFLAGS): Compute it.
2485 * src/Makefile.am (CFLAGS): Pass it.
2486 * tests/atlocal.in (CFLAGS): Idem.
2487 * src/files.c: Fix a few warnings.
2488 (get_extension_index): Remove, unused.
2489
24902002-01-08 Akim Demaille <akim@epita.fr>
2491
2492 * src/getargs.c (AS_FILE_NAME): New.
2493 (getargs): Use it to convert DOSish file names.
2494 * src/files.c (base_name): Rename as full_base_name to avoid
2495 clashes with `base_name ()'.
2496 (filename_split): New.
2497 (compute_base_names): N-th rewrite, using filename_split.
2498
24992002-01-08 Akim Demaille <akim@epita.fr>
2500
2501 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2502 New, stolen from the Fileutils 4.1.
2503 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2504 * configure.in: Check for the presence of memrchr, and of its
2505 prototype.
2506
25072002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2508
2509 * lib/hash.h (__P): Added definition for this macro.
2510 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2511 BUILT_SOURCES, to ensure they are generated first.
2512 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2513 %error-verbose to allow bootstrapping with bison 1.30x.
2514
25152002-01-06 Akim Demaille <akim@epita.fr>
2516
2517 * src/reader.c (parse_braces): Don't fetch the next char, the
2518 convention is to fetch on entry.
2519 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2520 'switch' without a following semicolon.
2521 * tests/regression.at (braces parsing): New.
2522
25232002-01-06 Akim Demaille <akim@epita.fr>
2524
2525 Bison is dead wrong in its RR conflict reports.
2526
2527 * tests/torture.at (GNU Cim Grammar): New.
2528 * src/conflicts.c (count_rr_conflicts): Fix.
2529
25302002-01-06 Akim Demaille <akim@epita.fr>
2531
2532 Creating package.m4 from configure.ac causes too many problems.
2533
2534 * tests/Makefile.am (package.m4): Create it by hand,
2535 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2536
25372002-01-06 Akim Demaille <akim@epita.fr>
2538
2539 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2540 skeleton.h.
2541
25422002-01-04 Paul Eggert <eggert@twinsun.com>
2543
2544 * doc/bison.texinfo (Debugging):
2545 Remove YYSTDERR; it's no longer defined or used.
2546 Also, s/cstdio.h/cstdio/.
2547
25482002-01-03 Akim Demaille <akim@epita.fr>
2549
2550 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2551
25522002-01-03 Akim Demaille <akim@epita.fr>
2553
2554 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2555 tracing code to --trace, wait for a better --trace option, with
2556 args.
2557
25582002-01-03 Akim Demaille <akim@epita.fr>
2559
2560 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2561 The ISO C++ standard is extremely clear about it: stderr is
2562 considered a macro, not a regular symbol (see table 94 `Header
2563 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2564 Therefore std:: does not apply to it. It still does with fprintf.
2565 Also, s/cstdio.h/cstdio/.
2566
25672002-01-03 Akim Demaille <akim@epita.fr>
2568
2569 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2570 for non system headers.
2571
25722002-01-02 Akim Demaille <akim@epita.fr>
2573
2574 Equip the skeleton chain with location tracking, runtime trace,
2575 pure parser and scanner.
2576
2577 * src/parse-skel.y: Request a pure parser, locations, and prefix
2578 renaming.
2579 (%union): Having several members with the same type does not help
2580 type mismatches, simplify.
2581 (YYPRINT, yyprint): New.
2582 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2583 (skel_error): this.
2584 Handle locations.
2585 * src/scan-skel.l: Adjust to these changes.
2586 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2587 (LOCATION_PRINT, skel_control_t): New.
2588
25892001-12-30 Akim Demaille <akim@epita.fr>
2590
2591 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2592 replace `gb' with BLANKS.
2593 * src/scan-skel.l: Adjust.
2594
25952001-12-30 Akim Demaille <akim@epita.fr>
2596
2597 * src/system.h: We don't need nor want bcopy.
2598 Throw away MS-DOS crap: we don't need getpid.
2599 * configure.in: We don't need strndup. It was even causing
2600 problems: because Flex includes the headers *before* us,
2601 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2602 not visible.
2603 * lib/xstrndup.c: New.
2604 * src/scan-skel.l: Use it.
2605 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2606 * src/parse-skel.y: Use %directives instead of #defines.
2607
26082001-12-30 Akim Demaille <akim@epita.fr>
2609
2610 * src/skeleton.h: New.
2611 * src/output.c (output_parser, output_master_parser): Remove, dead
2612 code.
2613 * src/output.h (get_lines_number, actions_output, guards_output)
2614 (token_definitions_output): Prototype them.
2615 * src/parse-skel.y: Add the license notice.
2616 Include output.h and skeleton.h.
2617 (process_skeleton): Returns void, and takes a single parameter.
2618 * src/scan-skel.l: Add the license notice.
2619 Include skeleton.h.
2620 Don't use %option yylineno: it seems that then Flex imagines
2621 REJECT has been used, and therefore it won't reallocate its
2622 buffers (which makes no other sense to me than a bug). It results
2623 in warnings for `unused: yy_flex_realloc'.
2624
26252001-12-30 Robert Anisko <robert.anisko@epita.fr>
2626
2627 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2628 (MUSCLE_INSERT_PREFIX): ...to there.
2629 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2630 (MUSCLE_INSERT_PREFIX): Move from here...
2631
2632 * src/bison.hairy: Add a section directive. Put braces around muscle
2633 names. This parser skeleton is still broken, but Bison should not
2634 choke on a bad muscle 'syntax'.
2635 * src/bison.simple: Add a section directive. Put braces around muscle
2636 names.
2637
2638 * src/files.h (strsuffix, stringappend): Add declarations.
2639 (tab_extension): Add declaration.
2640 (short_base_name): Add declaration.
2641
2642 * src/files.c (strsuffix, stringappend): No longer static. These
2643 functions are used in the skeleton parser.
2644 (tab_extension): New.
2645 (compute_base_names): Use the computations done in this function
2646 to guess if the generated parsers should have '.tab' in their
2647 names.
2648 (short_base_name): No longer static.
2649
2650 * src/output.c (output_skeleton): New.
2651 (output): Disable call to output_master_parser, and give a try to
2652 a new skeleton handling system.
2653 (guards_output, actions_output): No longer static.
2654 (token_definitions_output, get_lines_number): No longer static.
2655
2656 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2657
2658 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
2659 parse-skel.y.
2660
2661 * src/parse-skel.y: New file.
2662 * src/scan-skel.l: New file.
2663
26642001-12-29 Akim Demaille <akim@epita.fr>
2665
2666 %name-prefix is broken.
2667
2668 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2669 Adjust all dependencies.
2670 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2671 %name-prefix.
2672
2673 Renaming yylval but not yylloc is not consistent. Now we do.
2674
2675 * src/bison.simple: Prefix yylloc if used.
2676 * doc/bison.texinfo (Decl Summary): Document that.
2677
26782001-12-29 Akim Demaille <akim@epita.fr>
2679
2680 * doc/bison.texinfo: Promote `%long-directive' over
2681 `%long_directive'.
2682 Remove all references to fixed-output-files, yacc is enough.
2683
26842001-12-29 Akim Demaille <akim@epita.fr>
2685
2686 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2687 user prologue. These are defaults.
2688 * tests/actions.at (Mid-rule actions): Make sure the user can
2689 define YYDEBUG and YYERROR_VERBOSE.
2690
26912001-12-29 Akim Demaille <akim@epita.fr>
2692
2693 * src/output.c (header_output): Don't forget to export YYLTYPE and
2694 yylloc.
2695 * tests/headers.at (export YYLTYPE): New, make sure it does.
2696 * tests/regression.at (%union and --defines, Invalid CPP headers):
2697 Move to...
2698 * tests/headers.at: here.
2699
27002001-12-29 Akim Demaille <akim@epita.fr>
2701
2702 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2703
27042001-12-29 Akim Demaille <akim@epita.fr>
2705
2706 * tests/actions.at (Mid-rule actions): Output on a single line
2707 instead of several.
2708
27092001-12-29 Akim Demaille <akim@epita.fr>
2710
2711 * doc/bison.texinfo: Formatting changes.
2712
27132001-12-29 Akim Demaille <akim@epita.fr>
2714
2715 Don't store the token defs in a muscle, just be ready to output it
2716 on command. Now possible via `symbols'. Fixes a memory leak.
2717
2718 * src/output.c (token_definitions_output): New.
2719 (output_parser, header_output): Use it.
2720 * src/reader.c (symbols_save): Remove.
2721
27222001-12-29 Akim Demaille <akim@epita.fr>
2723
2724 * src/bison.simple: Do not provide a default for YYSTYPE and
2725 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2726 default.
2727
27282001-12-29 Akim Demaille <akim@epita.fr>
2729
2730 Mid-rule actions are simply... ignored!
2731
2732 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2733 the empty-rule associated to the dummy symbol, not to the host
2734 rule.
2735 * tests/actions.at (Mid-rule actions): New.
2736
27372001-12-29 Akim Demaille <akim@epita.fr>
2738
2739 Memory leak.
2740
2741 * src/reader.c (reader): Free grammar.
2742
27432001-12-29 Akim Demaille <akim@epita.fr>
2744
2745 Memory leak.
2746
2747 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2748 since it allocates it for each state, although only one is needed.
2749 (allocate_storage): Do it here.
2750
27512001-12-29 Akim Demaille <akim@epita.fr>
2752
2753 * src/options.h, src/options.c (create_long_option_table): Rename
2754 as...
2755 (long_option_table_new): this, with a clearer prototype.
2756 (percent_table): Remove, unused,
2757 * src/getargs.c (getargs): Adjust.
2758
27592001-12-29 Akim Demaille <akim@epita.fr>
2760
2761 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2762 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2763 as states.
2764
27652001-12-29 Akim Demaille <akim@epita.fr>
2766
2767 * src/lalr.c (build_relations): Rename `states' as `states1'.
2768 Sorry, I don't understand exactly what it is, no better name...
2769
27702001-12-29 Akim Demaille <akim@epita.fr>
2771
2772 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2773 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2774 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2775 as rules.
2776
27772001-12-29 Akim Demaille <akim@epita.fr>
2778
2779 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2780 ago.
2781
27822001-12-29 Akim Demaille <akim@epita.fr>
2783
2784 * src/reader.c, src/reader.h (user_toknums): Remove.
2785 Adjust all users to use symbols[i]->user_token_number.
2786
27872001-12-29 Akim Demaille <akim@epita.fr>
2788
2789 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2790 Adjust all users to use symbols[i]->prec or ->assoc.
2791
27922001-12-29 Akim Demaille <akim@epita.fr>
2793
2794 * src/reader.c, src/reader.h (tags): Remove.
2795 Adjust all users to use symbols[i]->tag.
2796
27972001-12-29 Akim Demaille <akim@epita.fr>
2798
2799 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2800 and rule_table.
2801 * src/reader.c (packsymbols): Fill this table.
2802 Drop sprec.
2803 * src/conflicts.c (resolve_sr_conflict): Adjust.
2804 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2805 single table.
2806 Use symbols[i]->tag instead of tags[i].
2807
28082001-12-29 Akim Demaille <akim@epita.fr>
2809
2810 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2811 In addition, put a comment in there, to replace...
2812 * tests/regression.at (%union and C comments): Remove.
2813
28142001-12-29 Akim Demaille <akim@epita.fr>
2815
2816 * tests/regression.at (Web2c Actions): Blindly move the actual
2817 output as expected output. The contents *seem* right to me, but I
2818 can't pretend reading perfectly parser tables... Nonetheless, all
2819 the other tests pass correctly, the table look OK, even though the
2820 presence of `$axiom' is to be noted: AFAICS it is useless (but
2821 harmless).
2822
28232001-12-29 Akim Demaille <akim@epita.fr>
2824
2825 * src/reader.c (readgram): Don't add the rule 0 if there were no
2826 rules read. In other words, add it _after_ having performed
2827 grammar sanity checks.
2828 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2829
28302001-12-29 Akim Demaille <akim@epita.fr>
2831
2832 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2833 visible, and some states have now a different number.
2834
28352001-12-29 Akim Demaille <akim@epita.fr>
2836
2837 * src/reader.c (readgram): Bind the initial rule's lineno to that
2838 of the first rule.
2839 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2840 (Solved SR Conflicts): Adjust rule 0's line number.
2841
28422001-12-29 Akim Demaille <akim@epita.fr>
2843
2844 Fix the `GAWK Grammar' failure.
2845
2846 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2847 the reductions of the first state which was mistakenly confused
2848 with the final state because precisely final_state was initialized
2849 to 0.
2850 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2851 now noticed by Bison.
2852 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2853 have a reduction on $default.
2854
28552001-12-29 Akim Demaille <akim@epita.fr>
2856
2857 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2858 rule line numbers.
2859 * src/closure.c (print_closure): Likewise.
2860 * src/derives.c (print_derives): Likewise.
2861 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2862 now.
2863
28642001-12-29 Akim Demaille <akim@epita.fr>
2865
2866 * src/lalr.c (lookaheads_print): New.
2867 (lalr): Call it when --trace-flag.
2868 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2869 are dumped.
2870
28712001-12-29 Akim Demaille <akim@epita.fr>
2872
2873 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2874 when walking through ritem, even via rule->rhs.
2875 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2876 (useful_production, useless_nonterminals): Likewise.
2877 (reduce_grammar_tables): Likewise, plus update nritems.
2878 * src/nullable.c (set_nullable): Likewise.
2879 * src/lalr.c (build_relations): Likewise.
2880 * tests/sets.at (Nullable): Adjust.
2881 Fortunately, now, the $axiom is no longer nullable.
2882
28832001-12-29 Akim Demaille <akim@epita.fr>
2884
2885 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2886 the 0-sentinel.
2887 * src/gram.c (ritem_longest_rhs): Likewise.
2888 * src/reduce.c (nonterminals_reduce): Likewise.
2889 * src/print_graph.c (print_graph): Likewise.
2890 * src/output.c (output_rule_data): Likewise.
2891 * src/nullable.c (set_nullable): Likewise.
2892
28932001-12-29 Akim Demaille <akim@epita.fr>
2894
2895 * src/output.c: Comment changes.
2896
28972001-12-27 Paul Eggert <eggert@twinsun.com>
2898
2899 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2900 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2901 Sparc, as they were causing more porting problems than the
2902 (minor) performance improvement was worth.
2903
2904 Also, catch up with 1.31's YYSTD.
2905
29062001-12-27 Akim Demaille <akim@epita.fr>
2907
2908 * src/output.c (output_gram): Rely on nritems, not the
2909 0-sentinel. See below.
2910 Use -1 as separator, not 0.
2911 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2912 Rely on -1 as separator in yyrhs, instead of 0.
2913 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2914 twice `Now at end of input', therefore there are two lines less to
2915 expect.
2916
29172001-12-27 Akim Demaille <akim@epita.fr>
2918
2919 * tests/regression.at (Unresolved SR Conflicts):
2920 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2921 below.
2922
29232001-12-27 Akim Demaille <akim@epita.fr>
2924
2925 * src/LR0.c (new_state): Recognize the final state by the fact it
2926 is reached by eoftoken.
2927 (insert_start_shifting_state, insert_eof_shifting_state)
2928 (insert_accepting_state, augment_automaton): Remove, since now
2929 these states are automatically computed from the initial state.
2930 (generate_states): Adjust.
2931 * src/print.c: When reporting a rule number to the user, substract
2932 1, so that the axiom rule is rule 0, and the first user rule is 1.
2933 * src/reduce.c: Likewise.
2934 * src/print_graph.c (print_core): For the time being, just as for
2935 the report, depend upon --trace-flags to dump the full set of
2936 items.
2937 * src/reader.c (readgram): Once the grammar read, insert the rule
2938 0: `$axiom: START-SYMBOL $'.
2939 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2940 number of the states has changed (the final state is no longer
2941 necessarily the last), catch up.
2942
29432001-12-27 Akim Demaille <akim@epita.fr>
2944
2945 Try to make the use of the eoftoken valid. Given that its value
2946 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2947 is used instead of > 0 where appropriate, (ii), depend upon nritems
2948 instead of the 0-sentinel.
2949
2950 * src/gram.h, src/gram.c (nritems): New.
2951 Expected to be duplication of nitems, but for the time being...
2952 * src/reader.c (packgram): Assert nritems and nitems are equal.
2953 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2954 * src/closure.c (print_closure, print_fderives): Likewise.
2955 * src/gram.c (ritem_print): Likewise.
2956 * src/print.c (print_core, print_grammar): Likewise.
2957 * src/print_graph.c: Likewise.
2958
29592001-12-27 Akim Demaille <akim@epita.fr>
2960
2961 * src/main.c (main): If there are complains after grammar
2962 reductions, then output the report anyway if requested, then die.
2963 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2964 * src/reader.c (eoftoken): New.
2965 (parse_token_decl): If the token being defined has value `0', it
2966 is the eoftoken.
2967 (packsymbols): No longer hack `tags' to insert `$' by hand.
2968 Be sure to preserve the value of the eoftoken.
2969 (reader): Make sure eoftoken is defined.
2970 Initialize nsyms to 0: now eoftoken is created just like the others.
2971 * src/print.c (print_grammar): Don't special case the eof token.
2972 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2973 lie anyway, albeit pleasant.
2974 * tests/calc.at: Exercise error messages with eoftoken.
2975 Change the grammar so that empty input is invalid.
2976 Adjust expectations.
2977 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2978
29792001-12-27 Akim Demaille <akim@epita.fr>
2980
2981 * configure.in: Check the protos of strchr ans strspn.
2982 Replace strchr if needed.
2983 * src/system.h: Provide the protos of strchr, strspn and memchr if
2984 missing.
2985 * lib/strchr.c: New.
2986 * src/reader.c (symbols_save): Use strchr.
2987
29882001-12-27 Akim Demaille <akim@epita.fr>
2989
2990 * src/print.c, src/print_graph.c (escape): New.
2991 Use it to quote the TAGS outputs.
2992 * src/print_graph.c (print_state): Now errors are in red, and
2993 reductions in green.
2994 Prefer high to wide: output the state number on a line of its own.
2995
29962001-12-27 Akim Demaille <akim@epita.fr>
2997
2998 * src/state.h, src/state.c (reductions_new): New.
2999 * src/LR0.c (set_state_table): Let all the states have a
3000 `reductions', even if reduced to 0.
3001 (save_reductions): Adjust.
3002 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
3003 * src/print.c (print_reductions, print_actions): Adjust.
3004 * src/output.c (action_row): Adjust.
3005
30062001-12-27 Akim Demaille <akim@epita.fr>
3007
3008 * src/state.h, src/state.c (errs_new, errs_dup): New.
3009 * src/LR0.c (set_state_table): Let all the states have an errs,
3010 even if reduced to 0.
3011 * src/print.c (print_errs, print_reductions): Adjust.
3012 * src/output.c (output_actions, action_row): Adjust.
3013 * src/conflicts.c (resolve_sr_conflict): Adjust.
3014
30152001-12-27 Akim Demaille <akim@epita.fr>
3016
3017 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
3018
30192001-12-27 Akim Demaille <akim@epita.fr>
3020
3021 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
3022 * src/print.c: here.
3023 (lookaheadset, shiftset): New, used as additional storage by
3024 print_reductions.
3025 (print_results): Adjust.
3026 (print_shifts, print_gotos, print_errs): New, extracted from...
3027 (print_actions): here.
3028 * src/print_graph.c (print_actions): Remove dead code.
3029
30302001-12-27 Akim Demaille <akim@epita.fr>
3031
3032 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
3033 `$n' and `@n'.
3034
30352001-12-27 Akim Demaille <akim@epita.fr>
3036
3037 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
3038 (build_relations): Adjust.
3039
30402001-12-27 Akim Demaille <akim@epita.fr>
3041
3042 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
3043 duplication.
3044
30452001-12-27 Akim Demaille <akim@epita.fr>
3046
3047 * src/reader.c (packgram): Catch nitems overflows.
3048
30492001-12-27 Akim Demaille <akim@epita.fr>
3050
3051 * src/files.c, src/files.h (guard_obstack): Remove.
3052 * src/output.c (output): Adjust.
3053 * src/reader.c (parse_braces): New, factoring...
3054 (copy_action, copy_guard): these two which are renamed as...
3055 (parse_action, parse_guard): these.
3056 As a voluntary consequence, using braces around guards is now
3057 mandatory.
3058
30592001-12-27 Akim Demaille <akim@epita.fr>
3060
3061 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
3062 * src/reader.c (symbol_list): `guard' and `guard_line' are new
3063 members.
3064 (symbol_list_new): Adjust.
3065 (copy_action): action_line is the first line, not the last.
3066 (copy_guard): Just as for actions, store the `action' only, not
3067 the switch/case/break flesh.
3068 Don't parse the user action that might follow the guard, let...
3069 (readgram): do it, i.e., now, there can be an action after a
3070 guard.
3071 In other words the guard is just explicitly optional.
3072 (packgram): Adjust.
3073 * src/output.c (guards_output): New.
3074 (output_parser): Call it when needed.
3075 (output): Also free the guard and attrs obstacks.
3076 * src/files.c, src/files.h (obstack_save): Remove.
3077 (output_files): Remove.
3078 As a result, if one needs the former `.act' file, using an
3079 appropriate skeleton which requires actions and guards is now
3080 required.
3081 * src/main.c (main): Adjust.
3082 * tests/semantic.at: New.
3083 * tests/regression.at: Use `input.y' as input file name.
3084 Avoid 8+3 problems by requiring input.c when the test needs the
3085 parser.
3086
30872001-12-27 Akim Demaille <akim@epita.fr>
3088
3089 * src/reader.c (symbol_list_new): Be sure to initialize all the
3090 fields.
3091
30922001-12-27 Akim Demaille <akim@epita.fr>
3093
3094 All the hacks using a final pseudo state are now useless.
3095
3096 * src/LR0.c (set_state_table): state_table holds exactly nstates.
3097 * src/lalr.c (nLA): New.
3098 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
3099 instead of lookaheadsp from the pseudo state (nstate + 1).
3100
31012001-12-27 Akim Demaille <akim@epita.fr>
3102
3103 * src/output.c (action_row, token_actions): Use a state_t instead
3104 of a integer, and nlookaheads instead of the following state's
3105 lookaheadsp.
3106
31072001-12-27 Akim Demaille <akim@epita.fr>
3108
3109 * src/conflicts.c (log_resolution, flush_shift)
3110 (resolve_sr_conflict, set_conflicts, solve_conflicts)
3111 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
3112 (conflicts_print, print_reductions): Use a state_t instead of an
3113 integer when referring to a state.
3114 As much as possible, depend upon nlookaheads, instead of the
3115 `lookaheadsp' member of the following state (since lookaheads of
3116 successive states are successive, the difference between state n + 1
3117 and n served as the number of lookaheads for state n).
3118 * src/lalr.c (add_lookback_edge): Likewise.
3119 * src/print.c (print_core, print_actions, print_state)
3120 (print_results): Likewise.
3121 * src/print_graph.c (print_core, print_actions, print_state)
3122 (print_graph): Likewise.
3123 * src/conflicts.h: Adjust.
3124
31252001-12-27 Akim Demaille <akim@epita.fr>
3126
3127 * src/bison.hairy: Formatting/comment changes.
3128 ANSIfy.
3129 Remove `register' indications.
3130 Add plenty of `static'.
3131
31322001-12-27 Akim Demaille <akim@epita.fr>
3133
3134 * src/output.c (prepare): Drop the muscle `ntbase' which
3135 duplicates ntokens.
3136 * src/bison.simple: Formatting/comment changes.
3137 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
3138 is an undocumented synonym.
3139
31402001-12-22 Akim Demaille <akim@epita.fr>
3141
3142 * src/output.c (output_table_data): Change the prototype to use
3143 `int' for array ranges: some invocations do pass an int, not a
3144 short.
3145 Reported by Wayne Green.
3146
31472001-12-22 Akim Demaille <akim@epita.fr>
3148
3149 Some actions of web2c.y are improperly triggered.
3150 Reported by Mike Castle.
3151
3152 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
3153 * tests/regression.at (Web2c): Rename as...
3154 (Web2c Report): this.
3155 (Web2c Actions): New.
3156
31572001-12-22 Akim Demaille <akim@epita.fr>
3158
3159 Reductions in web2c.y are improperly reported.
3160 Reported by Mike Castle.
3161
3162 * src/conflicts.c (print_reductions): Fix.
3163 * tests/regression.at (Web2c): New.
3164
31652001-12-18 Akim Demaille <akim@epita.fr>
3166
3167 Some host fail on `assert (!"foo")', which expands to
3168 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
3169 Reported by Nelson Beebee.
3170
3171 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
3172 `#define it_succeeded 0' and `assert (it_succeeded)'.
3173
31742001-12-17 Marc Autret <autret_m@epita.fr>
3175
3176 * src/bison.simple: Don't hard code the skeleton line and filename.
3177 * src/output.c (output_parser): Rename 'line' as 'output_line'.
3178 New line counter 'skeleton_line' (skeleton-line muscle).
3179
31802001-12-17 Paul Eggert <eggert@twinsun.com>
3181
3182 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3183 YYDEBUG must be defined to a nonzero value.
3184
3185 * src/bison.simple (yytname): Do not assume that the user defines
3186 YYDEBUG to a properly parenthesized expression.
3187
31882001-12-17 Akim Demaille <akim@epita.fr>
3189
3190 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3191 nlookaheads is a new member.
3192 Adjust all users.
3193 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3194 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3195 state.
3196
31972001-12-17 Akim Demaille <akim@epita.fr>
3198
3199 * src/files.h, src/files.c (open_files, close_files): Remove.
3200 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3201 let...
3202 * src/reader.c (reader): Do it.
3203
32042001-12-17 Akim Demaille <akim@epita.fr>
3205
3206 * src/conflicts.c (print_reductions): Formatting changes.
3207
32082001-12-17 Akim Demaille <akim@epita.fr>
3209
3210 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3211 (flush_reduce): New.
3212 (resolve_sr_conflict): Adjust.
3213
32142001-12-17 Akim Demaille <akim@epita.fr>
3215
3216 * src/output.c (output_obstack): Be static and rename as...
3217 (format_obstack): this, to avoid any confusion with files.c's
3218 output_obstack.
3219 * src/reader.h (muscle_obstack): Move to...
3220 * src/output.h: here, since it's defined in output.c.
3221
32222001-12-17 Akim Demaille <akim@epita.fr>
3223
3224 * src/output.c (action_row, save_column, default_goto)
3225 (sort_actions, matching_state, pack_vector): Better variable
3226 locality.
3227
32282001-12-17 Akim Demaille <akim@epita.fr>
3229
3230 * src/output.c: Various formatting changes.
3231
32322001-12-17 Akim Demaille <akim@epita.fr>
3233
3234 * src/files.c (output_files): Free the output_obstack.
3235 * src/main.c (main): Call print and print_graph conditionally.
3236 * src/print.c (print): Work unconditionally.
3237 * src/print_graph.c (print_graph): Work unconditionally.
3238 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3239
32402001-12-16 Marc Autret <autret_m@epita.fr>
3241
3242 * src/output.c (actions_output): Fix. When we use %no-lines,
3243 there is one less line per action.
3244
32452001-12-16 Marc Autret <autret_m@epita.fr>
3246
3247 * src/bison.simple: Remove a useless #line directive.
3248 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3249 * src/output.c (get_lines_number): New.
3250 (output_parser): Adjust, now takes care about the lines of a
3251 output muscles.
3252 Fix line numbering.
3253 (actions_output): Computes the number of lines taken by actions.
3254 (output_master_parser): Insert new skeleton which is the name of
3255 the output parser file name.
3256
32572001-12-15 Marc Autret <autret_m@epita.fr>
3258
3259 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3260
32612001-12-15 Marc Autret <autret_m@epita.fr>
3262
3263 * src/output.c (output_gram): Keep track of the hairy one.
3264
32652001-12-15 Akim Demaille <akim@epita.fr>
3266
3267 Make `make distcheck' work.
3268
3269 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3270 system.h which uses libgettext.h.
3271
32722001-12-15 Akim Demaille <akim@epita.fr>
3273
3274 * src/nullable.c (set_nullable): Useless rules must be skipped,
3275 otherwise, since we range over their symbols, we might look at a
3276 nonterminal which no longer ``exists'', i.e., it is not counted in
3277 `nvars', hence we overflow our arrays.
3278
32792001-12-15 Akim Demaille <akim@epita.fr>
3280
3281 The header can also be produced directly, without any obstack!
3282 Yahoo!
3283
3284 * src/files.c, src/files.h (defines_obstack): Remove.
3285 (compute_header_macro): Global.
3286 (defines_obstack_save): Remove.
3287 * src/reader.c (parse_union_decl): No longer output to
3288 defines_obstack: its content can be found in the `stype' muscle
3289 anyway.
3290 (output_token_translations): Merge into...
3291 (symbols_output): this.
3292 Rename as...
3293 (symbols_save): this.
3294 (reader): Adjust.
3295 * src/output.c (header_output): New.
3296 (output): Call it.
3297
32982001-12-15 Akim Demaille <akim@epita.fr>
3299
3300 * src/reader.c (parse_union_decl): Instead of handling two obstack
3301 simultaneously, use one to define the `stype' muscle, and use the
3302 value of the latter to fill defines_obstack.
3303 (copy_comment): Remove.
3304 (copy_comment2): Work for a single obstack.
3305 Rename as...
3306 (copy_comment): this.
3307
33082001-12-15 Akim Demaille <akim@epita.fr>
3309
3310 * src/lex.c, src/lex.h (xgetc): No longer static.
3311 * src/reader.c (parse_union_decl): Revamp.
3312
33132001-12-15 Akim Demaille <akim@epita.fr>
3314
3315 Still making progress in separating Bison into (i) input, (ii)
3316 process, (iii) output: now we can directly output the parser file
3317 without using table_obstack at all.
3318
3319 * src/files.c, src/files.h (table_obstack): Bye bye.
3320 (parser_file_name): New.
3321 * src/files.c (compute_output_file_names): Compute it.
3322 * src/output.c (actions_output, output_parser)
3323 (output_master_parser): To a file instead of an obstack.
3324
33252001-12-15 Akim Demaille <akim@epita.fr>
3326
3327 Attach actions to rules, instead of pre-outputting them to
3328 actions_obstack.
3329
3330 * src/gram.h (rule_t): action and action_line are new members.
3331 * src/reader.c (symbol_list): Likewise.
3332 (copy_action): Save the actions within the rule.
3333 (packgram): Save them in rule_table.
3334 * src/output.c (actions_output): New.
3335 (output_parser): Use it on `%%actions'.
3336 (output_rule_data): Don't free rule_table.
3337 (output): Do it.
3338 (prepare): Don't save the `action' muscle.
3339 * src/bison.simple: s/%%action/%%actions/.
3340
33412001-12-15 Akim Demaille <akim@epita.fr>
3342
3343 * src/reader.c (copy_action): When --yacc, don't append a `;'
3344 to the user action: let it fail if lacking.
3345 Suggested by Arnold Robbins and Tom Tromey.
3346
33472001-12-14 Akim Demaille <akim@epita.fr>
3348
3349 * src/lex.c (literalchar): Simply return the char you decoded, non
3350 longer mess around with obstacks and int pointers.
3351 Adjust all callers.
3352
33532001-12-14 Akim Demaille <akim@epita.fr>
3354
3355 * src/lex.c (literalchar): Don't escape the special characters,
3356 just decode them, and keep them as char (before, eol was output as
3357 the 2 char string `\n' etc.).
3358 * src/output.c (output_rule_data): Use quotearg to output the
3359 token strings.
3360
33612001-12-13 Paul Eggert <eggert@twinsun.com>
3362
3363 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3364 Do not infringe on the global user namespace when using C++.
3365 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3366 All uses of `fprintf' and `stderr' changed.
3367
3368 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3369
33702001-12-13 Akim Demaille <akim@epita.fr>
3371
3372 The computation of nullable is broken: it doesn't handle empty
3373 RHS's properly.
3374
3375 * tests/torture.at (GNU AWK Grammar): New.
3376 * tests/sets.at (Nullable): New.
3377 * src/nullable.c (set_nullable): Instead of blindly looping over
3378 `ritems', loop over the rules, and then over their rhs's.
3379
3380 Work around Autotest bugs.
3381
3382 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3383 frame, because Autotest understand lines starting with a `+' as
3384 traces from the shell. Then, they are not processed properly.
3385 Admittedly an Autotest bug, but we don't have time to wait for
3386 Autotest to catch up.
3387 * tests/regression.at (Broken Closure): Adjust to the new table
3388 frames.
3389 Move to...
3390 * tests/sets.at: here.
3391
33922001-12-13 Akim Demaille <akim@epita.fr>
3393
3394 * src/closure.c (closure): Use nrules instead of playing tricks
3395 with BITS_PER_WORD.
3396
33972001-12-13 Akim Demaille <akim@epita.fr>
3398
3399 * src/print.c (print_actions): Output the handling of `$' as the
3400 traces do: shifting the token EOF. Before EOF was treated as a
3401 nonterminal.
3402 * tests/regression.at: Adjust some tests.
3403 * src/print_graph.c (print_core): Complete the set of items via
3404 closure. The next-to-final and final states are still unsatisfying,
3405 but that's to be addressed elsewhere.
3406 No longer output the rule numbers, but do output the state number.
3407 A single loop for the shifts + gotos is enough, but picked a
3408 distinct color for each.
3409 (print_graph): Initialize and finalize closure.
3410
34112001-12-13 Akim Demaille <akim@epita.fr>
3412
3413 * src/reader.c (readgram): Remove dead code, an strip useless
3414 braces.
3415 (get_type): Remove, unused.
3416
34172001-12-12 Akim Demaille <akim@epita.fr>
3418
3419 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3420 on that of lib/error.c.
3421
34222001-12-12 Akim Demaille <akim@epita.fr>
3423
3424 Some hosts don't like `/' in includes.
3425
3426 * src/system.h: Include libgettext.h without qualifying the path.
3427 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3428 $(top_srcdir).
3429
34302001-12-11 Marc Autret <autret_m@epita.fr>
3431
3432 * src/output.c (output_parser): Remove useless muscle.
3433
34342001-12-11 Marc Autret <autret_m@epita.fr>
3435
3436 * src/bison.simple: Remove #line just before %%epilogue. It
3437 is now handled in ...
3438 * src/reader.c (read_additionnal_code): Add the output of a
3439 #line for the epilogue.
3440
34412001-12-10 Marc Autret <autret_m@epita.fr>
3442
3443 * src/reader.c (copy_definition): Re-use CPP-outed code which
3444 replace precedent remove.
3445 * src/bison.simple: Remove #line before %%prologue because
3446 %%input-line is wrong at this time.
3447
34482001-12-10 Marc Autret <autret_m@epita.fr>
3449
3450 * src/reader.c (symbols_output): Clean up.
3451 * src/output.c (output_gram, output): Clean up.
3452
34532001-12-10 Akim Demaille <akim@epita.fr>
3454
3455 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3456 * src/LR0.c (set_state_table): here.
3457 * src/lalr.c (lalr): Call it.
3458
34592001-12-10 Akim Demaille <akim@epita.fr>
3460
3461 * src/state.h (shifts): Remove the `number' member: shifts are
3462 attached to state, hence no longer need to be labelled with a
3463 state number.
3464
34652001-12-10 Akim Demaille <akim@epita.fr>
3466
3467 Now that states have a complete set of members, the linked list of
3468 shifts is useless: just fill directly the state's shifts member.
3469
3470 * src/state.h (shifts): Remove the `next' member.
3471 * src/LR0.c (first_state, last_state): Remove.
3472 Adjust the callers.
3473 (augment_automaton): Don't look for the shifts that must be added
3474 a shift on EOF: it is those of the state we looked for! But now,
3475 since shifts are attached, it is no longer needed to looking
3476 merely by its id: its number.
3477
34782001-12-10 Akim Demaille <akim@epita.fr>
3479
3480 * src/LR0.c (augment_automaton): Better variable locality.
3481 Remove an impossible branch: if there is a state corresponding to
3482 the start symbol being shifted, then there is shift for the start
3483 symbol from the initial state.
3484
34852001-12-10 Akim Demaille <akim@epita.fr>
3486
3487 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3488 only when appropriate: when insert_start_shifting_state' is not
3489 invoked.
3490 * tests/regression.at (Rule Line Numbers): Adjust.
3491
34922001-12-10 Akim Demaille <akim@epita.fr>
3493
3494 * src/LR0.c (augment_automaton): Now that all states have shifts,
3495 merge the two cases addition shifts to the initial state.
3496
34972001-12-10 Akim Demaille <akim@epita.fr>
3498
3499 * src/lalr.c (set_state_table): Move to...
3500 * src/LR0.c: here.
3501 * src/lalr.c (lalr): Don't call it...
3502 * src/LR0.c (generate_states): do it.
3503 * src/LR0.h (first_state): Remove, only the table is used.
3504
35052001-12-10 Akim Demaille <akim@epita.fr>
3506
3507 * src/LR0.h (first_shift, first_reduction): Remove.
3508 * src/lalr.c: Don't use first_shift: find shifts through the
3509 states.
3510
35112001-12-10 Akim Demaille <akim@epita.fr>
3512
3513 * src/LR0.c: Attach shifts to states as soon as they are
3514 computed.
3515 * src/lalr.c (set_state_table): Instead of assigning shifts to
3516 state, just assert that the mapping was properly done.
3517
35182001-12-10 Akim Demaille <akim@epita.fr>
3519
3520 * src/LR0.c (insert_start_shift): Rename as...
3521 (insert_start_shifting_state): this.
3522 (insert_eof_shifting_state, insert_accepting_state): New.
3523 (augment_automaton): Adjust.
3524 Better locality of the variables.
3525 When looking if the start_symbol is shifted from the initial
3526 state, using `while (... symbol != start_symbol ...)' sounds
3527 better than `while (... symbol < start_symbol ...)': If fail
3528 to see how the order between symbols could be relevant!
3529
35302001-12-10 Akim Demaille <akim@epita.fr>
3531
3532 * src/getargs.h: Don't declare `spec_name_prefix' and
3533 `spec_file_prefix', declared by src/files.h.
3534 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3535 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3536 * src/output.c (prepare): Adjust.
3537 * src/reader.c (symbols_output): Likewise.
3538 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3539
35402001-12-10 Akim Demaille <akim@epita.fr>
3541
3542 * src/muscle_tab.c (muscle_init): NULL is a better default than
3543 `"0"'.
3544
35452001-12-10 Akim Demaille <akim@epita.fr>
3546
3547 * src/reader.c (reader): Calling symbols_output once is enough.
3548
35492001-12-10 Akim Demaille <akim@epita.fr>
3550
3551 Now that states have a complete set of members, the linked list of
3552 reductions is useless: just fill directly the state's reductions
3553 member.
3554
3555 * src/state.h (struct reductions): Remove member `number' and
3556 `next'.
3557 * src/LR0.c (first_reduction, last_reduction): Remove.
3558 (save_reductions): Don't link the new reductions, store them in
3559 this_state.
3560 * src/lalr.c (set_state_table): No need to attach reductions to
3561 states, it's already done.
3562 * src/output.c (output_actions): No longer free the shifts, then
3563 the reductions, then the states: free all the states and their
3564 members.
3565
35662001-12-10 Akim Demaille <akim@epita.fr>
3567
3568 * src/options.c (OPTN, DRTV, BOTH): New.
3569 (option_table): Use them.
3570
3571 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3572 the job of system.h.
3573 * src/options.c: Don't include stdio.h and xalloc.h for the same
3574 reasons.
3575
35762001-12-10 Akim Demaille <akim@epita.fr>
3577
3578 * src/output.c (output, prepare): Make sure the values of the
3579 muscles `action' and `prologue' are 0-terminated.
3580
35812001-12-10 Akim Demaille <akim@epita.fr>
3582
3583 Clean up GCC warnings.
3584
3585 * src/reader.c (copy_action): `buf' is not used.
3586 (parse_skel_decl): Be static.
3587 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3588 * src/options.h (create_long_option_table): Have a real prototype.
3589 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3590 (hash_delete_at): Return const void *.
3591 Adjust casts to preserve the const.
3592
35932001-12-10 Akim Demaille <akim@epita.fr>
3594
3595 * configure.in: Require 2.52g.
3596 M4 is not needed, but AUTOM4TE is.
3597 * m4/m4.m4: Remove.
3598 * tests/Makefile.am: Adjust.
3599
36002001-12-10 Akim Demaille <akim@epita.fr>
3601
3602 One structure for states is enough, even though theoretically
3603 there are LR(0) states and LALR(1) states.
3604
3605 * src/lalr.h (state_t): Remove.
3606 (state_table): Be state_t **, not state_t *.
3607 * src/state.h (core, CORE_ALLOC): Rename as...
3608 (state_t, STATE_ALLOC): this.
3609 Add the LALR(1) members: shifts, reductions, errs.
3610 * src/LR0.c (state_table): Rename as...
3611 (state_hash): this, to avoid name clashes with the global
3612 `state_table'.
3613 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3614 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3615
36162001-12-10 Akim Demaille <akim@epita.fr>
3617
3618 Bison dumps core on bash.y.
3619 Reported by Pascal Bart.
3620
3621 * src/warshall.c (bitmatrix_print): New.
3622 (TC): Use it.
3623 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3624 j must be the outer loop.
3625 * tests/regression.at (Broken Closure): New.
3626
36272001-12-05 Akim Demaille <akim@epita.fr>
3628
3629 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3630 its argument.
3631