]> git.saurik.com Git - bison.git/blame - ChangeLog
Stop storing rules from 1 to nrules + 1.
[bison.git] / ChangeLog
CommitLineData
4b3d3a8e
AD
12002-07-25 Akim Demaille <akim@epita.fr>
2
3 Stop storing rules from 1 to nrules + 1.
4
5 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
6 * src/nullable.c, src/output.c, src/print.c, src/reader.c
7 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
8 Iterate from 0 to nrules.
9 Use rule_number_as_item_number and item_number_as_rule_number.
10 Adjust to `derive' now containing possibly 0.
11 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12 Handle the `- 1' part in rule numbers from/to item numbers.
13 * src/conflicts.c (log_resolution): Fix the message which reversed
14 shift and reduce.
15 * src/output.c (action_row): Initialize default_rule to -1.
16 (token_actions): Adjust.
17 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
18 expected output.
19 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
20
4a2a22f4
AD
212002-07-25 Akim Demaille <akim@epita.fr>
22
23 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
24 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
25 (b4_c_knr_arg_decl): New.
26 * data/yacc.c: Use it to define yysymprint, yydestruct, and
27 yyreport_parse_error.
28
b8df3223
AD
292002-07-25 Akim Demaille <akim@epita.fr>
30
31 * data/yacc.c (yyreport_parse_error): New, extracted from...
32 (yyparse): here.
33 (yydestruct, yysymprint): Move above yyparse.
34 Be K&R compliant.
35
a762e609
AD
362002-07-25 Akim Demaille <akim@epita.fr>
37
38 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
39 replace...
40 (b4_sint_type, b4_uint_type): these.
41 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
42 * tests/regression.at (Web2c Actions): Adjust.
43
12b0043a
AD
442002-07-25 Akim Demaille <akim@epita.fr>
45
46 * src/gram.h (TIEM_NUMBER_MAX): New.
47 (item_number_of_rule_number, rule_number_of_item_number): Rename
48 as...
49 (rule_number_as_item_number, item_number_as_rule_number): these.
50 Adjust dependencies.
51 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
52 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
53 (symbol_number_to_vector_number): New.
54 (order): Of vector_number_t* type.
55 (base_t, BASE_MAX, BASE_MIN): New.
56 (froms, tos, width, pos, check): Of base_t type.
57 (action_number_t, ACTION_MIN, ACTION_MAX): New.
58 (actrow): Of action_number_t type.
59 (conflrow): Of unsigned int type.
60 (table_ninf, base_ninf): New.
61 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
62 (muscle_insert_int_table, muscle_insert_base_table)
63 (muscle_insert_rule_number_table): New.
64 (prepare_tokens): Output `toknum' as int_table.
65 (action_row): Returns a rule_number_t.
66 Use ACTION_MIN, not SHRT_MIN.
67 (token_actions): yydefact is rule_number_t*.
68 (table_ninf_remap): New.
69 (pack_table): Use it for `base' and `table'.
70 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
71 replaced with...
72 (YYPACT_NINF, YYTABLE_NINF): these.
73 (yypact, yytable): Compute their types instead of hard-coded
74 `short'.
75 * tests/regression.at (Web2c Actions): Adjust.
76
5dde258a
AD
772002-07-19 Akim Demaille <akim@epita.fr>
78
79 * src/scan-gram.l (id): Can start with an underscore.
80
a945ec39
AD
812002-07-16 Akim Demaille <akim@epita.fr>
82
83 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
84 Adjust all former `associativity' dependencies.
85 * src/symtab.c (symbol_new): Default associativity is `undef', not
86 `right'.
87 (symbol_check_alias_consistence): Adjust.
88
fae437e8
AD
892002-07-09 Akim Demaille <akim@epita.fr>
90
91 * doc/bison.texinfo: Properly set the ``header'' part.
92 Use @dircategory ``GNU programming tools'' as per Texinfo's
93 documentation.
94 Use @copying.
95
1a715ef2
AD
962002-07-09 Akim Demaille <akim@epita.fr>
97
98 * lib/quotearg.h: Protect against multiple inclusions.
99 * src/location.h (location_t): Add a `file' member.
100 (LOCATION_RESET, LOCATION_PRINT): Adjust.
101 * src/complain.c (warn_at, complain_at, fatal_at): Drop
102 `error_one_per_line' support.
103
a5d50994
AD
1042002-07-09 Akim Demaille <akim@epita.fr>
105
106 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
107 * src/reader.c (lineno): Remove.
108 Adjust all dependencies.
109 (get_merge_function): Take a location and use complain_at.
110 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
111 * tests/regression.at (Invalid inputs, Mixing %token styles):
112 Adjust.
113
b275314e
AD
1142002-07-09 Akim Demaille <akim@epita.fr>
115
116 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
117 recovery rule, and forbid extensions when --yacc.
118 (gram_error): Use complain_at.
119 * src/reader.c (reader): Exit if there were parse errors.
120
865b9df1
AD
1212002-07-09 Akim Demaille <akim@epita.fr>
122
123 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
124 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
125 Reported by R Blake <blakers@mac.com>.
126
c76e14da
AD
1272002-07-09 Akim Demaille <akim@epita.fr>
128
129 * data/yacc.c: Output the copyright notive in the header.
130
7db2ed2d
AD
1312002-07-03 Akim Demaille <akim@epita.fr>
132
133 * src/output.c (froms, tos): Are state_number_t.
134 (save_column): sp, sp1, and sp2 are state_number_t.
135 (prepare): Rename `final' as `final_state_number', `nnts' as
136 `nterms_number', `nrules' as `rules_number', `nstates' as
137 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
138 unused.
139 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
140 * data/lalr1.cc (nsym_): Remove, unused.
141
e68e0410
AD
1422002-07-03 Akim Demaille <akim@epita.fr>
143
144 * src/lalr.h, src/lalr.c (goto_number_t): New.
145 * src/lalr.c (goto_list_t): New.
146 Propagate them.
147 * src/nullable.c (rule_list_t): New.
148 Propagate.
149 * src/types.h: Remove.
150
e1a4f3a4
AD
1512002-07-03 Akim Demaille <akim@epita.fr>
152
153 * src/closure.c (print_fderives): Use rule_rhs_print.
154 * src/derives.c (print_derives): Use rule_rhs_print.
155 (rule_list_t): New, replaces `shorts'.
156 (set_derives): Add comments.
157 * tests/sets.at (Nullable, Firsts): Adjust.
158
536545f3
AD
1592002-07-03 Akim Demaille <akim@epita.fr>
160
161 * src/output.c (prepare_actions): Free `tally' and `width'.
162 (prepare_actions): Allocate and free `order'.
163 * src/symtab.c (symbols_free): Free `symbols'.
164 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
165 * src/output.c (m4_invoke): Move to...
166 * src/scan-skel.l: here.
167 (<<EOF>>): Close yyout, and free its name.
168
8b752b00
AD
1692002-07-03 Akim Demaille <akim@epita.fr>
170
171 Fix some memory leaks, and fix a bug: state 0 was examined twice.
172
173 * src/LR0.c (new_state): Merge into...
174 (state_list_append): this.
175 (new_states): Merge into...
176 (generate_states): here.
177 (set_states): Don't ensure a proper `errs' state member here, do it...
178 * src/conflicts.c (conflicts_solve): here.
179 * src/state.h, src/state.c: Comment changes.
180 (state_t): Rename member `shifts' as `transitions'.
181 Adjust all dependencies.
182 (errs_new): For consistency, also take the values as argument.
183 (errs_dup): Remove.
184 (state_errs_set): New.
185 (state_reductions_set, state_transitions_set): Assert that no
186 previous value was assigned.
187 (state_free): New.
188 (states_free): Use it.
189 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
190 temporary storage: use `errs' and `nerrs' as elsewhere.
191 (set_conflicts): Allocate and free this `errs'.
192
613f5e1a
AD
1932002-07-02 Akim Demaille <akim@epita.fr>
194
195 * lib/libiberty.h: New.
196 * lib: Update the bitset implementation from upstream.
197 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
198 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
199 * src/main.c: Adjust bitset stats calls.
200
26e0cadc
PE
2012002-07-01 Paul Eggert <eggert@twinsun.com>
202
203 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
204 char, so that negative chars don't collide with $.
205
1154cced
AD
2062002-06-30 Akim Demaille <akim@epita.fr>
207
208 Have the GLR tests be `warning' checked, and fix the warnings.
209
210 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
211 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
212 (yyremoveDeletes): `yyi' and `yyj' are size_t.
213 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
214 (yyaddDeferredAction): static.
215 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
216 (yyreportParseError): yyprefix is const.
217 yytokenp is used only when verbose.
218 (yy__GNUC__): Replace with __GNUC__.
219 (yypdumpstack): yyi is size_t.
220 (yypreference): Un-yy local variables and arguments, to avoid
221 clashes with `yyr1'. Anyway, we are not in the user name space.
222 (yytname_size): be an int, as is compared with ints.
223 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
224 Use them.
225 * tests/cxx-gram.at: Use quotation to protect $1.
226 Use AT_COMPILE to enable warnings hunts.
227 Prototype yylex and yyerror.
228 `Use' argc.
229 Include `string.h', not `strings.h'.
230 Produce and prototype stmtMerge only when used.
231 yylex takes a location.
232
97650f4e
AD
2332002-06-30 Akim Demaille <akim@epita.fr>
234
235 We spend a lot of time in quotearg, in particular when --verbose.
236
237 * src/symtab.c (symbol_get): Store a quoted version of the key.
238 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
239 Adjust all callers.
240
d2576365
AD
2412002-06-30 Akim Demaille <akim@epita.fr>
242
243 * src/state.h (reductions_t): Rename member `nreds' as num.
244 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
245 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
246
ccaf65bc
AD
2472002-06-30 Akim Demaille <akim@epita.fr>
248
249 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
250 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
251 (shifts_to): Rename as...
252 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
253 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
254 (TRANSITION_IS_DISABLED, transitions_to): these.
255
87675353
AD
2562002-06-30 Akim Demaille <akim@epita.fr>
257
258 * src/print.c (print_shifts, print_gotos): Merge into...
259 (print_transitions): this.
260 (print_transitions, print_errs, print_reductions): Align the
261 lookaheads columns.
262 (print_core, print_transitions, print_errs, print_state,
263 print_grammar): Output empty lines separator before, not after.
264 (state_default_rule_compute): Rename as...
265 (state_default_rule): this.
266 * tests/conflicts.at (Defaulted Conflicted Reduction),
267 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
268 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
269
ce4ccb4b
AD
2702002-06-30 Akim Demaille <akim@epita.fr>
271
272 Display items as we display rules.
273
274 * src/gram.h, src/gram.c (rule_lhs_print): New.
275 * src/gram.c (grammar_rules_partial_print): Use it.
276 * src/print.c (print_core): Likewise.
277 * tests/conflicts.at (Defaulted Conflicted Reduction),
278 (Unresolved SR Conflicts): Adjust.
279 (Unresolved SR Conflicts): Adjust and rename as...
280 (Resolved SR Conflicts): this, as was meant.
281 * tests/regression.at (Web2c Report): Adjust.
282
bc933ef1
AD
2832002-06-30 Akim Demaille <akim@epita.fr>
284
285 * src/print.c (state_default_rule_compute): New, extracted from...
286 (print_reductions): here.
287 Pessimize, but clarify the code.
288 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
289
53d4308d
AD
2902002-06-30 Akim Demaille <akim@epita.fr>
291
292 * src/output.c (action_row): Let default_rule be always a rule
293 number.
294
574fb2d5
AD
2952002-06-30 Akim Demaille <akim@epita.fr>
296
297 * src/closure.c (print_firsts, print_fderives, closure):
298 Use BITSET_EXECUTE.
299 * src/lalr.c (lookaheads_print): Likewise.
300 * src/state.c (state_rule_lookaheads_print): Likewise.
301 * src/print_graph.c (print_core): Likewise.
302 * src/print.c (print_reductions): Likewise.
303 * src/output.c (action_row): Likewise.
304 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
305
05811fd7
AD
3062002-06-30 Akim Demaille <akim@epita.fr>
307
308 * src/print_graph.c: Use report_flag.
309
0e4d5753
AD
3102002-06-30 Akim Demaille <akim@epita.fr>
311
312 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
313 to...
314 * src/relation.h, src/relation.c (traverse, relation_digraph)
315 (relation_print, relation_transpose): New.
316
24c7d800
AD
3172002-06-30 Akim Demaille <akim@epita.fr>
318
319 * src/state.h, src/state.c (shifts_to): New.
320 * src/lalr.c (build_relations): Use it.
321
9222837b
AD
3222002-06-30 Akim Demaille <akim@epita.fr>
323
324 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
325 (item_number_of_rule_number, rule_number_of_item_number): New.
326 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
327 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
328 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
329 Propagate their use.
330 Much remains to be done, in particular wrt `shorts' from types.h.
331
260008e5
AD
3322002-06-30 Akim Demaille <akim@epita.fr>
333
334 * src/symtab.c (symbol_new): Initialize the `printer' member.
335
8a731ca8
AD
3362002-06-30 Akim Demaille <akim@epita.fr>
337
338 * src/LR0.c (save_reductions): Remove, replaced by...
339 * src/state.h, src/state.c (state_reductions_set): New.
340 (reductions, errs): Rename as...
341 (reductions_t, errs_t): these.
342 Adjust all dependencies.
343
32e1e0a4
AD
3442002-06-30 Akim Demaille <akim@epita.fr>
345
346 * src/LR0.c (state_list_t, state_list_append): New.
347 (first_state, last_state): Now symbol_list_t.
348 (this_state): Remove.
349 (new_itemsets, append_states, save_reductions): Take a state_t as
350 argument.
351 (set_states, generate_states): Adjust.
352 (save_shifts): Remove, replaced by...
353 * src/state.h, src/state.c (state_shifts_set): New.
354 (shifts): Rename as...
355 (shifts_t): this.
356 Adjust all dependencies.
357 * src/state.h (state_t): Remove the `next' member.
358
e5fb6710
AD
3592002-06-30 Akim Demaille <akim@epita.fr>
360
361 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
362 escaped in slot 0.
363
c7ca99d4
AD
3642002-06-30 Akim Demaille <akim@epita.fr>
365
366 Use hash.h for the state hash table.
367
368 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
369 (allocate_storage): Use state_hash_new.
370 (free_storage): Use state_hash_free.
371 (new_state, get_state): Adjust.
372 * src/lalr.h, src/lalr.c (states): Move to...
373 * src/states.h (state_t): Remove the `link' member, no longer
374 used.
375 * src/states.h, src/states.c: here.
376 (state_hash_new, state_hash_free, state_hash_lookup)
377 (state_hash_insert, states_free): New.
378 * src/states.c (state_table, state_compare, state_hash): New.
379 * src/output.c (output_actions): Do not free states now, since we
380 still need to know the final_state number in `prepare', called
381 afterwards. Do it...
382 * src/main.c (main): here: call states_free after `output'.
383
df0e7316
AD
3842002-06-30 Akim Demaille <akim@epita.fr>
385
386 * src/state.h, src/state.c (state_new): New, extracted from...
387 * src/LR0.c (new_state): here.
388 * src/state.h (STATE_ALLOC): Move to...
389 * src/state.c: here.
390 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
391 * src/state.h, src/state.c: here.
392
39f41916
AD
3932002-06-30 Akim Demaille <akim@epita.fr>
394
395 * src/reader.c (gensym): Rename as...
396 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
397 (getsym): Rename as...
398 (symbol_get): this.
399
d57650a5
AD
4002002-06-30 Akim Demaille <akim@epita.fr>
401
402 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
403 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
404 * src/output.c, src/print.c, src/print_graph.c: Propagate.
405 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
406
5a08f1ce
AD
4072002-06-30 Akim Demaille <akim@epita.fr>
408
409 Make the test suite pass with warnings checked.
410
411 * tests/actions.at (Printers and Destructors): Improve.
412 Avoid unsigned vs. signed issues.
413 * tests/calc.at: Don't exercise the scanner here, do it...
414 * tests/input.at (Torturing the Scanner): here.
415
720623af
PH
4162002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
417
88e7e941 418 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
419 reorganize first lines parallel to yacc.c.
420
fb8135fa
AD
4212002-06-28 Akim Demaille <akim@epita.fr>
422
423 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
424 (b4_token_enum, b4_token_defines): New, factored from...
425 * data/lalr1.cc, data/yacc.c, glr.c: here.
426
41442480
AD
4272002-06-28 Akim Demaille <akim@epita.fr>
428
429 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
430 unused variables.
431 * src/output.c (merger_output): static.
432
e0e5bf84
AD
4332002-06-28 Akim Demaille <akim@epita.fr>
434
435 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
436 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
437 pacify GCC.
438 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 439
676385e2
PH
4402002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
441
442 Accumulated changelog for new GLR parsing features.
443
e0e5bf84 444 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
445 conflicts_total_count.
446 * src/conflicts.h: Ditto.
447 * src/output.c (token_actions): Use the new name.
448 (output_conflicts): Change conflp => conflict_list_heads, and
449 confl => conflict_list for better readability.
450 * data/glr.c: Use the new names.
451 * NEWS: Add self to GLR announcement.
e0e5bf84 452
676385e2
PH
453 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
454
455 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
456 Akim Demaille.
457
458 * data/bison.glr: Change name to glr.c
459 * data/glr.c: Renamed from bison.glr.
460 * data/Makefile.am: Add glr.c
e0e5bf84
AD
461
462 * src/getargs.c:
463
676385e2
PH
464 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
465 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 466
676385e2
PH
467 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
468
469 * data/bison.glr: Be sure to restore the
470 current #line when returning to the skeleton contents after having
471 exposed the input file's #line.
472
473 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
474
475 * data/bison.glr: Bring up to date with changes to bison.simple.
476
477 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
478
479 * data/bison.glr: Correct definitions that use b4_prefix.
480 Various reformatting.
481 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
482 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
483 yytokenp argument; now part of stack.
484 (yychar): Define to behave as documented.
485 (yyclearin): Ditto.
e0e5bf84 486
676385e2
PH
487 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
488
489 * src/reader.h: Add declaration for free_merger_functions.
490
491 * src/reader.c (merge_functions): New variable.
492 (get_merge_function): New function.
493 (free_merger_functions): New function.
494 (readgram): Check for %prec that is not followed by a symbol.
495 Handle %dprec and %merge declarations.
496 (packgram): Initialize dprec and merger fields in rules array.
497
498 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
499 conflict_list_cnt, conflict_list_free): New variables.
500 (table_grow): Also grow conflict_table.
e0e5bf84 501 (prepare_rules): Output dprec and merger tables.
676385e2 502 (conflict_row): New function.
e0e5bf84 503 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
504 default reduction in conflicted states for GLR parser so that there
505 are spaces for the conflict lists.
506 (save_row): Also save conflict information.
507 (token_actions): Allocate conflict list.
508 (merger_output): New function.
509 (pack_vector): Pack conflict table, too.
510 (output_conflicts): New function to output yyconflp and yyconfl.
511 (output_check): Allocate conflict_tos.
512 (output_actions): Output conflict tables, also.
513 (output_skeleton): Output b4_mergers definition.
514 (prepare): Output b4_max_rhs_length definition.
515 Use 'bison.glr' as default skeleton for GLR parsers.
516
517 * src/gram.c (glr_parser): New flag.
518 (grammar_free): Call free_merger_functions.
519
520 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
521 all pairs of conflicting reductions, rather than just all tokens
522 causing conflicts. Needed to size conflict tables.
e0e5bf84 523 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
524 interface.
525 (conflicts_print): Ditto.
526 (count_total_conflicts): New function.
527
528 * src/reader.h (merger_list): New type.
529 (merge_functions): New variable.
530
531 * src/lex.h (tok_dprec, tok_merge): New token types.
532
533 * src/gram.h (rule_s): Add dprec and merger fields.
534 (glr_parser): New flag.
535
536 * src/conflicts.h (count_total_conflicts): New function.
537
538 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
539
540 * doc/bison.texinfo (Generalized LR Parsing): New section.
541 (GLR Parsers): New section.
542 (Language and Grammar): Mention GLR parsing.
543 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
544 Correct typo ("tge" -> "the").
545
546 * data/bison.glr: New skeleton for GLR parsing.
547
548 * tests/cxx-gram.at: New tests for GLR parsing.
549
550 * tests/testsuite.at: Include cxx-gram.at.
551
552 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 553
676385e2
PH
554 * src/parse-gram.y:
555
556 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
557
558 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 559
b5480d74 5602002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
561
562 * src/options.h, src/options.c: Remove.
563 * src/getargs.c (short_options, long_options): New.
564
60491a94
AD
5652002-06-27 Akim Demaille <akim@epita.fr>
566
567 * data/bison.simple, data/bison.c++: Rename as...
568 * data/yacc.c, data/lalr1.cc: these.
569 * doc/bison.texinfo (Environment Variables): Remove.
570
9be0c25b
AD
5712002-06-25 Raja R Harinath <harinath@cs.umn.edu>
572
573 * src/getargs.c (report_argmatch): Initialize strtok().
574
1ae72863
AD
5752002-06-20 Akim Demaille <akim@epita.fr>
576
577 * data/bison.simple (b4_symbol_actions): New, replaces...
578 (b4_symbol_destructor, b4_symbol_printer): these.
579 (yysymprint): Be sure to call YYPRINT only for tokens, and using
580 user token numbers.
581
87542d29
AD
5822002-06-20 Akim Demaille <akim@epita.fr>
583
584 * data/bison.simple (yydestructor): Rename as...
585 (yydestruct): this.
586
1a31ed21
AD
5872002-06-20 Akim Demaille <akim@epita.fr>
588
589 * src/symtab.h, src/symtab.c (symbol_type_set)
590 (symbol_destructor_set, symbol_precedence_set): The location is
591 the last argument.
592 Adjust all callers.
593
e776192e
AD
5942002-06-20 Akim Demaille <akim@epita.fr>
595
596 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
597 internals.
598 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
599 Takes a location.
600 * src/symtab.h, src/symtab.c (symbol_class_set)
601 (symbol_user_token_number_set): Likewise.
602 Adjust all callers.
603 Promote complain_at.
604 * tests/input.at (Type Clashes): Adjust.
605
5c1180b3
AD
6062002-06-20 Akim Demaille <akim@epita.fr>
607
608 * data/bison.simple (YYLEX): Fix the declaration when
609 %pure-parser.
610
e3170060
AD
6112002-06-20 Akim Demaille <akim@epita.fr>
612
613 * data/bison.simple (yysymprint): Don't print the token number,
614 just its name.
615 * tests/actions.at (Destructors): Rename as...
616 (Printers and Destructors): this.
617 Also exercise %printer.
618
253862fd
AD
6192002-06-20 Akim Demaille <akim@epita.fr>
620
621 * data/bison.simple (YYDSYMPRINT): New.
622 Use it to remove many of the #if YYDEBUG/if (yydebug).
623
366eea36
AD
6242002-06-20 Akim Demaille <akim@epita.fr>
625
626 * src/symtab.h, src/symtab.c (symbol_t): printer and
627 printer_location are new members.
628 (symbol_printer_set): New.
629 * src/parse-gram.y (PERCENT_PRINTER): New token.
630 Handle its associated rule.
631 * src/scan-gram.l: Adjust.
632 (handle_destructor_at, handle_destructor_dollar): Rename as...
633 (handle_symbol_code_at, handle_symbol_code_dollar): these.
634 * src/output.c (symbol_printers_output): New.
635 (output_skeleton): Call it.
636 * data/bison.simple (yysymprint): New. Cannot be named yyprint
637 since there are already many grammar files with a user `yyprint'.
638 Replace the calls to YYPRINT to calls to yysymprint.
639 * tests/calc.at: Adjust.
640 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
641 taking advantage of parser very internal details (stack size!).
642
4f25ebb0
AD
6432002-06-20 Akim Demaille <akim@epita.fr>
644
645 * src/scan-gram.l: Complete the scanner with the missing patterns
646 to pacify Flex.
647 Use `quote' and `symbol_tag_get' where appropriate.
648
93b68a0e
AD
6492002-06-19 Akim Demaille <akim@epita.fr>
650
651 * tests/actions.at (Destructors): Augment to test locations.
652 * data/bison.simple (yydestructor): Pass it the current location
653 if locations are enabled.
654 Prototype only when __STDC__ or C++.
655 Change the argument names to move into the yy name space: there is
656 user code here.
657
58612f1d
AD
6582002-06-19 Akim Demaille <akim@epita.fr>
659
74310291
AD
660 * data/bison.simple (b4_pure_if): New.
661 Use it instead of #ifdef YYPURE.
662
6632002-06-19 Akim Demaille <akim@epita.fr>
664
665 * data/bison.simple (b4_location_if): New.
58612f1d
AD
666 Use it instead of #ifdef YYLSP_NEEDED.
667
f25bfb75
AD
6682002-06-19 Akim Demaille <akim@epita.fr>
669
670 Prepare @$ in %destructor, but currently don't bind it in the
671 skeleton, as %location use is not cleaned up yet.
672
673 * src/scan-gram.l (handle_dollar, handle_destructor_at)
674 (handle_action_at): New.
675 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
676 a braced_code_t and a location as additional arguments.
677 (handle_destructor_dollar): Instead of requiring `b4_eval', just
678 unquote one when outputting `b4_dollar_dollar'.
679 Adjust callers.
680 * data/bison.simple (b4_eval): Remove.
681 (b4_symbol_destructor): Adjust.
682 * tests/input.at (Invalid @n): Adjust.
683
c732d2c6
AD
6842002-06-19 Zack Weinberg <zack@codesourcery.com>
685
686 * doc/bison.texinfo: Document ability to have multiple
687 prologue sections.
688
8c165d89
AD
6892002-06-18 Akim Demaille <akim@epita.fr>
690
691 * src/files.c (compute_base_names): When computing the output file
692 names from the input file name, strip the directory part.
693
ca98bf57
AD
6942002-06-18 Akim Demaille <akim@epita.fr>
695
696 * data/bison.simple.new: Comment changes.
697 Reported by Andreas Schwab.
698
0bfb02ff
AD
6992002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
700
701 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
702 there are no `label `yyoverflowlab' defined but not used' warnings
703 when yyoverflow is defined.
704
24c0aad7
AD
7052002-06-18 Akim Demaille <akim@epita.fr>
706
707 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
708 new member.
709 (symbol_destructor_set): Adjust.
710 * src/output.c (symbol_destructors_output): Output the destructor
711 locations.
712 Output the symbol name.
713 * data/bison.simple (b4_symbol_destructor): Adjust.
714
5719c109
AD
7152002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
716 and Akim Demaille <akim@epita.fr>
717
718 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
719 what's left on the stack when the error recovery hits EOF.
720 * tests/actions.at (Destructors): Complete to exercise this case.
721
9280d3ef
AD
7222002-06-17 Akim Demaille <akim@epita.fr>
723
724 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
725 arguments is really empty, not only equal to `[]'.
726 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
727 member.
728 (symbol_destructor_set): New.
729 * src/output.c (symbol_destructors_output): New.
730 * src/reader.h (brace_code_t, current_braced_code): New.
731 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
732 (handle_dollar): Rename as...
733 (handle_action_dollar): this.
734 (handle_destructor_dollar): New.
735 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
736 (grammar_declaration): Use it.
737 * data/bison.simple (yystos): Is always defined.
738 (yydestructor): New.
739 * tests/actions.at (Destructors): New.
740 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
741
dafdc66f
AD
7422002-06-17 Akim Demaille <akim@epita.fr>
743
744 * src/symlist.h, src/symlist.c (symbol_list_length): New.
745 * src/scan-gram.l (handle_dollar, handle_at): Compute the
746 rule_length only when needed.
747 * src/output.c (actions_output, token_definitions_output): Output
748 the full M4 block.
749 * src/symtab.c: Don't access directly to the symbol tag, use
750 symbol_tag_get.
751 * src/parse-gram.y: Use symbol_list_free.
752
56c47203
AD
7532002-06-17 Akim Demaille <akim@epita.fr>
754
755 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
756 (symbol_list_prepend, get_type_name): Move to...
757 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
758 (symbol_list_prepend, symbol_list_n_type_name_get): here.
759 Adjust all callers.
760 (symbol_list_free): New.
761 * src/scan-gram.l (handle_dollar): Takes a location.
762 * tests/input.at (Invalid $n): Adjust.
763
1e0bab92
AD
7642002-06-17 Akim Demaille <akim@epita.fr>
765
766 * src/reader.h, src/reader.c (symbol_list_new): Export it.
767 (symbol_list_prepend): New.
768 * src/parse-gram.y (%union): `list' is a new member.
769 (symbols.1): New, replaces...
770 (terms_to_prec.1, nterms_to_type.1): these.
771 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
772 Take a location as additional argument.
773 Adjust all callers.
774
04e60654
AD
7752002-06-15 Akim Demaille <akim@epita.fr>
776
777 * src/parse-gram.y: Move %token in the declaration section so that
778 we don't depend upon CVS Bison.
779
10e5b8bd
AD
7802002-06-15 Akim Demaille <akim@epita.fr>
781
782 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
783 * src/print.c (print_core): Use it.
784
9801d40c
AD
7852002-06-15 Akim Demaille <akim@epita.fr>
786
787 * src/conflicts.c (log_resolution): Accept the rule involved in
788 the sr conflicts instead of the lookahead number that points to
789 that rule.
790 (flush_reduce): Accept the current lookahead vector as argument,
791 instead of the index in LA.
792 (resolve_sr_conflict): Accept the current number of lookahead
793 bitset to consider for the STATE, instead of the index in LA.
794 (set_conflicts): Adjust.
795 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
796
c0263492
AD
7972002-06-15 Akim Demaille <akim@epita.fr>
798
799 * src/state.h (state_t): Replace the `lookaheadsp' member, a
800 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
801 Adjust all dependencies.
802 * src/lalr.c (initialize_lookaheads): Split into...
803 (states_lookaheads_count, states_lookaheads_initialize): these.
804 (lalr): Adjust.
805
9757c359
AD
8062002-06-15 Akim Demaille <akim@epita.fr>
807
808 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
809 out of...
810 (grammar_rules_print): here.
811 * src/reduce.c (reduce_output): Use it.
812 * tests/reduce.at (Useless Rules, Reduced Automaton)
813 (Underivable Rules): Adjust.
814
6b98e4b5
AD
8152002-06-15 Akim Demaille <akim@epita.fr>
816
817 Copy BYacc's nice way to report the grammar.
818
819 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
820 New.
821 Don't print the rules' location, it is confusing and useless.
822 (rule_print): Use grammar_rhs_print.
823 * src/print.c (print_grammar): Use grammar_rules_print.
824
6b98e4b5
AD
8252002-06-15 Akim Demaille <akim@epita.fr>
826
827 Complete and rationalize `useless thing' warnings.
828
829 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
830 (symbol_tag_print): New.
831 Use them everywhere in place of accessing directly the tag member.
832 * src/gram.h, src/gram.c (rule_print): New.
833 Use it where a rule used to be printed `by hand'.
834 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
835 (reduce_grammar_tables): Report the useless rules.
836 (reduce_print): Useless things are a warning, not an error.
837 Report it as such.
838 * tests/reduce.at (Useless Nonterminals, Useless Rules):
839 (Reduced Automaton, Underivable Rules): Adjust.
840 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
841 * tests/conflicts.at (Unresolved SR Conflicts)
842 (Solved SR Conflicts): Adjust.
843
ee000ba4
AD
8442002-06-15 Akim Demaille <akim@epita.fr>
845
846 Let symbols have a location.
847
848 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
849 (getsym): Adjust.
850 Adjust all callers.
851 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
852 Use location_t, not int.
853 * src/symtab.c (symbol_check_defined): Take advantage of the
854 location.
855 * tests/regression.at (Invalid inputs): Adjust.
856
8efe435c
AD
8572002-06-15 Akim Demaille <akim@epita.fr>
858
859 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
860 (input): Don't try to initialize yylloc here, do it in the
861 scanner.
862 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
863 * src/gram.h (rule_t): Change line and action_line into location
864 and action_location, of location_t type.
865 Adjust all dependencies.
866 * src/location.h, src/location.c (empty_location): New.
867 * src/reader.h, src/reader.c (grammar_start_symbol_set)
868 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
869 (grammar_current_rule_symbol_append)
870 (grammar_current_rule_action_append): Expect a location as argument.
871 * src/reader.c (grammar_midrule_action): Adjust to attach an
872 action's location as dummy symbol location.
873 * src/symtab.h, src/symtab.c (startsymbol_location): New.
874 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
875 the line numbers.
876
1921f1d7
AD
8772002-06-14 Akim Demaille <akim@epita.fr>
878
879 Grammar declarations may be found in the grammar section.
880
881 * src/parse-gram.y (rules_or_grammar_declaration): New.
882 (declarations): Each declaration may end with a semicolon, not
883 just...
884 (grammar_declaration): `"%union"'.
885 (grammar): Branch to rules_or_grammar_declaration.
886
4515534c
AD
8872002-06-14 Akim Demaille <akim@epita.fr>
888
889 * src/main.c (main): Invoke scanner_free.
890
f958596b
AD
8912002-06-14 Akim Demaille <akim@epita.fr>
892
893 * src/output.c (m4_invoke): Extracted from...
894 (output_skeleton): here.
895 Free tempfile.
896
2c569025
AD
8972002-06-14 Akim Demaille <akim@epita.fr>
898
899 * src/parse-gram.y (directives, directive, gram)
900 (grammar_directives, precedence_directives, precedence_directive):
901 Rename as...
902 (declarations, declaration, grammar, grammar_declaration)
903 (precedence_declaration, precedence_declarator): these.
904 (symbol_declaration): New.
905
592e8d4d
AD
9062002-06-14 Akim Demaille <akim@epita.fr>
907
908 * src/files.c (action_obstack): Remove, unused.
909 (output_obstack): Remove it, and all its dependencies, as it is no
910 longer needed.
911 * src/reader.c (epilogue_set): Build the epilogue in the
912 muscle_obstack.
913 * src/output.h, src/output.c (muscle_obstack): Move to...
914 * src/muscle_tab.h, src/muscle_tab.h: here.
915 (muscle_init): Initialize muscle_obstack.
916 (muscle_free): New.
917 * src/main.c (main): Call it.
918
0c15323d
AD
9192002-06-14 Akim Demaille <akim@epita.fr>
920
921 * src/location.h: New, extracted from...
922 * src/reader.h: here.
923 * src/Makefile.am (noinst_HEADERS): Merge into
924 (bison_SOURCES): this.
925 Add location.h.
926 * src/parse-gram.y: Use location_t instead of Bison's.
927 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
928 Use location_t instead of ints.
929
e96c9728
AD
9302002-06-14 Akim Demaille <akim@epita.fr>
931
932 * data/bison.simple, data/bison.c++: Be sure to restore the
933 current #line when returning to the skeleton contents after having
934 exposed the input file's #line.
935
75d1fe16
AD
9362002-06-12 Akim Demaille <akim@epita.fr>
937
938 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
939 eager.
940 * tests/actions.at (Exotic Dollars): New.
941
6c35d22c
AD
9422002-06-12 Akim Demaille <akim@epita.fr>
943
944 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
945 ['"/] too eagerly.
946 * tests/input.at (Torturing the Scanner): New.
947
1d6412ad
AD
9482002-06-11 Akim Demaille <akim@epita.fr>
949
950 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
951 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
952 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
953 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
954 * src/reader.c (reader): Use it.
955
4cdb01db
AD
9562002-06-11 Akim Demaille <akim@epita.fr>
957
958 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
959 Adjust all callers.
960 (scanner_last_string_free): New.
961
44995b2e
AD
9622002-06-11 Akim Demaille <akim@epita.fr>
963
964 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
965 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
966 (last_string, YY_OBS_FREE): New.
967 Use them when returning an ID.
968
e9955c83
AD
9692002-06-11 Akim Demaille <akim@epita.fr>
970
971 Have Bison grammars parsed by a Bison grammar.
972
973 * src/reader.c, src/reader.h (prologue_augment): New.
974 * src/reader.c (copy_definition): Remove.
975
976 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
977 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
978 (grammar_current_rule_prec_set, grammar_current_rule_check)
979 (grammar_current_rule_symbol_append)
980 (grammar_current_rule_action_append): Export.
981 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
982 (symbol_list_action_append): Remove.
983 Hook the routines from reader.
984 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
985 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
986
987 * src/reader.c (read_declarations): Remove, unused.
988
989 * src/parse-gram.y: Handle the epilogue.
990 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
991 (grammar_start_symbol_set): this.
992 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
993 * src/reader.c (readgram): Remove, unused.
994 (reader): Adjust to insert eoftoken and axiom where appropriate.
995
996 * src/reader.c (copy_dollar): Replace with...
997 * src/scan-gram.h (handle_dollar): this.
998 * src/parse-gram.y: Remove `%thong'.
999
1000 * src/reader.c (copy_at): Replace with...
1001 * src/scan-gram.h (handle_at): this.
1002
1003 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
1004 New.
1005
1006 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
1007 time being.
1008
1009 * src/reader.h, src/reader.c (grammar_rule_end): New.
1010
1011 * src/parse.y (current_type, current_class): New.
1012 Implement `%nterm', `%token' support.
1013 Merge `%term' into `%token'.
1014 (string_as_id): New.
1015 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
1016 type name.
1017
1018 * src/parse-gram.y: Be sure to handle properly the beginning of
1019 rules.
1020
1021 * src/parse-gram.y: Handle %type.
1022 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
1023
1024 * src/parse-gram.y: More directives support.
1025 * src/options.c: No longer handle source directives.
1026
1027 * src/parse-gram.y: Fix %output.
1028
1029 * src/parse-gram.y: Handle %union.
1030 Use the prologue locations.
1031 * src/reader.c (parse_union_decl): Remove.
1032
1033 * src/reader.h, src/reader.c (epilogue_set): New.
1034 * src/parse-gram.y: Use it.
1035
1036 * data/bison.simple, data/bison.c++: b4_stype is now either not
1037 defined, then default to int, or to the contents of %union,
1038 without `union' itself.
1039 Adjust.
1040 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
1041
1042 * src/output.c (actions_output): Don't output braces, as they are
1043 already handled by the scanner.
1044
1045 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
1046 characters to themselves.
1047
1048 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
1049 that the epilogue has a proper #line.
1050
1051 * src/parse-gram.y: Handle precedence/associativity.
1052
1053 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
1054 a terminal.
1055 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
1056 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
1057 at all to define terminals that cannot be emitted.
1058
1059 * src/scan-gram.l: Escape M4 characters.
1060
1061 * src/scan-gram.l: Working properly with escapes in user
1062 strings/characters.
1063
1064 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
1065 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
1066 grammar.
1067 Use more modest sizes, as for the time being the parser does not
1068 release memory, and therefore the process swallows a huge amount
1069 of memory.
1070
1071 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
1072 stricter %token grammar.
1073
1074 * src/symtab.h (associativity): Add `undef_assoc'.
1075 (symbol_precedence_set): Do nothing when passed an undef_assoc.
1076 * src/symtab.c (symbol_check_alias_consistence): Adjust.
1077
1078 * tests/regression.at (Invalid %directive): Remove, as it is now
1079 meaningless.
1080 (Invalid inputs): Adjust to the new error messages.
1081 (Token definitions): The new grammar doesn't allow too many
1082 eccentricities.
1083
1084 * src/lex.h, src/lex.c: Remove.
1085 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
1086 (copy_character, copy_string2, copy_string, copy_identifier)
1087 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
1088 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
1089 (parse_action): Remove.
1090 * po/POTFILES.in: Adjust.
1091
2e047461
AD
10922002-06-11 Akim Demaille <akim@epita.fr>
1093
1094 * src/reader.c (parse_action): Don't store directly into the
1095 rule's action member: return the action as a string.
1096 Don't require `rule_length' as an argument: compute it.
1097 (grammar_current_rule_symbol_append)
1098 (grammar_current_rule_action_append): New, eved out from
1099 (readgram): here.
1100 Remove `action_flag', `rulelength', unused now.
1101
9af3fbce
AD
11022002-06-11 Akim Demaille <akim@epita.fr>
1103
1104 * src/reader.c (grammar_current_rule_prec_set).
1105 (grammar_current_rule_check): New, eved out from...
1106 (readgram): here.
1107 Remove `xaction', `first_rhs': useless.
1108 * tests/input.at (Type clashes): New.
1109 * tests/existing.at (GNU Cim Grammar): Adjust.
1110
1485e106
AD
11112002-06-11 Akim Demaille <akim@epita.fr>
1112
1113 * src/reader.c (grammar_midrule_action): New, Eved out from
1114 (readgram): here.
1115
da4160c3
AD
11162002-06-11 Akim Demaille <akim@epita.fr>
1117
1118 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
1119 New.
1120 (readgram): Use them as replacement of inlined code, crule and
1121 crule1.
1122
f6d0f937
AD
11232002-06-11 Akim Demaille <akim@epita.fr>
1124
1125 * src/reader.c (grammar_end, grammar_symbol_append): New.
1126 (readgram): Use them.
1127 Make the use of `p' as local as possible.
1128
69078d4b
AD
11292002-06-10 Akim Demaille <akim@epita.fr>
1130
1131 GCJ's parser requires the tokens to be defined before the prologue.
1132
1133 * data/bison.simple: Output the token definition before the user's
1134 prologue.
1135 * tests/regression.at (Braces parsing, Duplicate string)
1136 (Mixing %token styles): Check the output from bison.
1137 (Early token definitions): New.
1138
5e424082
AD
11392002-06-10 Akim Demaille <akim@epita.fr>
1140
1141 * src/symtab.c (symbol_user_token_number_set): Don't complain when
1142 assigning twice the same user number to a token, so that we can
1143 use it in...
1144 * src/lex.c (lex): here.
1145 Also use `symbol_class_set' instead of hand written code.
1146 * src/reader.c (parse_assoc_decl): Likewise.
1147
44536b35
AD
11482002-06-10 Akim Demaille <akim@epita.fr>
1149
1150 * src/symtab.c, src/symtab.c (symbol_class_set)
1151 (symbol_user_token_number_set): New.
1152 * src/reader.c (parse_token_decl): Use them.
1153 Use a switch instead of ifs.
1154 Use a single argument.
1155
8b9f2372
AD
11562002-06-10 Akim Demaille <akim@epita.fr>
1157
1158 Remove `%thong' support as it is undocumented, unused, duplicates
1159 `%token's job, and creates useless e-mail traffic with people who
1160 want to know what it is, why it is undocumented, unused, and
1161 duplicates `%token's job.
1162
1163 * src/reader.c (parse_thong_decl): Remove.
1164 * src/options.c (option_table): Remove "thong".
1165 * src/lex.h (tok_thong): Remove.
1166
3ae2b51f
AD
11672002-06-10 Akim Demaille <akim@epita.fr>
1168
1169 * src/symtab.c, src/symtab.c (symbol_type_set)
1170 (symbol_precedence_set): New.
1171 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
1172 (value_components_used): Remove, unused.
1173
2f1afb73
AD
11742002-06-09 Akim Demaille <akim@epita.fr>
1175
1176 Move symbols handling code out of the reader.
1177
1178 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
1179 (axiom): Move to...
1180 * src/symtab.h, src/symtab.c: here.
1181
1182 * src/gram.c (start_symbol): Remove: use startsymbol->number.
1183 * src/reader.c (startval): Rename as...
1184 * src/symtab.h, src/symtab.c (startsymbol): this.
1185 * src/reader.c: Adjust.
1186
1187 * src/reader.c (symbol_check_defined, symbol_make_alias)
1188 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1189 (token_translations_init)
1190 Move to...
1191 * src/symtab.c: here.
1192 * src/reader.c (packsymbols): Move to...
1193 * src/symtab.h, src/symtab.c (symbols_pack): here.
1194 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
1195 argument.
1196
e9bca3ad
AD
11972002-06-03 Akim Demaille <akim@epita.fr>
1198
1199 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
1200 then statements.
1201
86eff183
AD
12022002-06-03 Akim Demaille <akim@epita.fr>
1203
1204 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1205 structs with non literals.
1206 * src/scan-skel.l: never-interactive.
1207 * src/conflicts.c (enum conflict_resolution_e): No trailing
1208 comma.
1209 * src/getargs.c (usage): Split long literal strings.
1210 Reported by Hans Aberg.
1211
717be197
AD
12122002-05-28 Akim Demaille <akim@epita.fr>
1213
1214 * data/bison.c++: Use C++ ostreams.
1215 (cdebug_): New member.
1216
670ddffd
AD
12172002-05-28 Akim Demaille <akim@epita.fr>
1218
1219 * src/output.c (output_skeleton): Be sure to allocate enough room
1220 for `/' _and_ for `\0' in full_skeleton.
1221
769b430f
AD
12222002-05-28 Akim Demaille <akim@epita.fr>
1223
1224 * data/bison.c++: Catch up with bison.simple:
1225 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1226 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1227 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1228 and popping traces.
1229
7067cb36
PH
12302002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1231
1232 * src/output.c (output_skeleton): Put an explicit path in front of
1233 the skeleton file name, rather than relying on the -I directory,
1234 to partially alleviate effects of having a skeleton file lying around
1235 in the current directory.
769b430f 1236
4a713ec2
PH
12372002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1238
769b430f 1239 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
1240 obstack_printf should be obstack_fgrow1.
1241
b408954b
AD
12422002-05-26 Akim Demaille <akim@epita.fr>
1243
1244 * src/state.h (state_t): `solved_conflicts' is a new member.
1245 * src/LR0.c (new_state): Set it to 0.
1246 * src/conflicts.h, src/conflicts.c (print_conflicts)
1247 (free_conflicts, solve_conflicts): Rename as...
1248 (conflicts_print, conflicts_free, conflicts_solve): these.
1249 Adjust callers.
1250 * src/conflicts.c (enum conflict_resolution_e)
1251 (solved_conflicts_obstack): New, used by...
1252 (log_resolution): this.
1253 Adjust to attach the conflict resolution to each state.
1254 Complete the description with the precedence/associativity
1255 information.
1256 (resolve_sr_conflict): Adjust.
1257 * src/print.c (print_state): Output its solved_conflicts.
1258 * tests/conflicts.at (Unresolved SR Conflicts)
1259 (Solved SR Conflicts): Exercise --report=all.
1260
a49aecd5
AD
12612002-05-26 Akim Demaille <akim@epita.fr>
1262
1263 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1264 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1265 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1266 (token_number_t, item_number_as_token_number)
1267 (token_number_as_item_number, muscle_insert_token_number_table):
1268 Rename as...
1269 (symbol_number_t, item_number_as_symbol_number)
1270 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1271 these, since it is more appropriate.
1272
5504898e
AD
12732002-05-26 Akim Demaille <akim@epita.fr>
1274
1275 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1276 `Error:' lines.
1277 * data/bison.simple (yystos) [YYDEBUG]: New.
1278 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1279 error recovery.
1280 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1281
ec3bc396
AD
12822002-05-25 Akim Demaille <akim@epita.fr>
1283
1284 * doc/bison.texinfo (Debugging): Split into...
1285 (Tracing): this new section, its former contents, and...
1286 (Understanding): this new section.
1287 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1288 by...
1289 (report_flag): this.
1290 Adjust all dependencies.
1291 (report_args, report_types, report_argmatch): New.
1292 (usage, getargs): Report/support -r, --report.
1293 * src/options.h
1294 (struct option_table_struct): Rename as..,
1295 (struct option_table_s): this.
1296 Rename the `set_flag' member to `flag' to match with getopt_long's
1297 struct.
1298 * src/options.c (option_table): Split verbose into an entry for
1299 %verbose, and another for --verbose.
1300 Support --report/-r, so remove -r from the obsolete --raw.
1301 * src/print.c: Attach full item sets and lookaheads reports to
1302 report_flag instead of trace_flag.
1303 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1304
78df8250
PE
13052002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1306 and Paul Eggert <eggert@twinsun.com>
769b430f 1307
78df8250
PE
1308 * data/bison.simple (yyparse): Correct error handling to conform to
1309 POSIX and yacc. Specifically, after syntax error is discovered,
1310 do not reduce further before shifting the error token.
1311 Clean up the code a bit by removing the labels yyerrdefault,
1312 yyerrhandle, yyerrpop.
1313 * NEWS: Document the above.
1314
c0c9ea05
PH
13152002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1316
1317 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1318 type; it isn't always big enough, since it doesn't necessarily
1319 include non-terminals.
769b430f 1320 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
1321 the latter can be removed.
1322 (yy_token_number_type): Remove, only one use.
1323 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1324 don't use TokenNumberType as element type.
769b430f 1325
c0c9ea05
PH
1326 * tests/regression.at: Modify expected output to agree with change
1327 to yyr1 and yytranslate.
769b430f 1328
6390a83f
FK
13292002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1330
1331 * src/reader.c (parse_action): Use copy_character instead of
1332 obstack_1grow.
1333
db7c8e9a
AD
13342002-05-13 Akim Demaille <akim@epita.fr>
1335
1336 * tests/regression.at (Token definitions): Prototype yylex and
1337 yyerror.
1338
fcc61800
PH
13392002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1340
158c687b 1341 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
1342 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1343 32-bit arithmetic.
1344 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1345
5683e9b2
AD
13462002-05-07 Akim Demaille <akim@epita.fr>
1347
1348 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1349 avoid GCC warnings.
1350
0c2d3f4c
AD
13512002-05-07 Akim Demaille <akim@epita.fr>
1352
1353 Kill GCC warnings.
1354
1355 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1356 over the RHS of each rule.
1357 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1358 * src/state.h (state_t): Member `nitems' is unsigned short.
1359 * src/LR0.c (get_state): Adjust.
1360 * src/reader.c (packgram): Likewise.
1361 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1362 `Type'.
1363 (muscle_insert_int_table): Remove, unused.
1364 (prepare_rules): Remove `max'.
1365
1565b720
AD
13662002-05-06 Akim Demaille <akim@epita.fr>
1367
1368 * src/closure.c (print_firsts): Display of the symbol tags.
1369 (bitmatrix_print): Move to...
1370 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1371 here.
1372 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1373
cfaee611
AD
13742002-05-06 Akim Demaille <akim@epita.fr>
1375
1376 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1377 hash_do_for_each.
1378
458be8e0
AD
13792002-05-06 Akim Demaille <akim@epita.fr>
1380
1381 * src/LR0.c (new_state, get_state): Instead of using the global
1382 `kernel_size' and `kernel_base', have two new arguments:
1383 `core_size' and `core'.
1384 Adjust callers.
1385
a900a624
AD
13862002-05-06 Akim Demaille <akim@epita.fr>
1387
1388 * src/reader.c (packgram): No longer end `ritem' with a 0
1389 sentinel: it is not used.
1390
d4e7d3a1
AD
13912002-05-05 Akim Demaille <akim@epita.fr>
1392
1393 New experimental feature: display the lookaheads in the report and
1394 graph.
1395
1396 * src/print (print_core): When --trace-flag, display the rules
1397 lookaheads.
1398 * src/print_graph.c (print_core): Likewise.
1399 Swap the arguments.
1400 Adjust caller.
1401
39ceb25b
AD
14022002-05-05 Akim Demaille <akim@epita.fr>
1403
1404 * tests/torture.at (Many lookaheads): New test.
1405
5372019f
AD
14062002-05-05 Akim Demaille <akim@epita.fr>
1407
1408 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1409 (GENERATE_MUSCLE_INSERT_TABLE): this.
1410 (output_int_table, output_unsigned_int_table, output_short_table)
1411 (output_token_number_table, output_item_number_table): Replace with...
1412 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1413 (muscle_insert_short_table, muscle_insert_token_number_table)
1414 (muscle_insert_item_number_table): these.
1415 Adjust all callers.
1416 (prepare_tokens): Don't free `translations', since...
1417 * src/reader.h, src/reader.c (grammar_free): do it.
1418 Move to...
1419 * src/gram.h, src/gram.c (grammar_free): here.
1420 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1421 b4_translate_max.
1422
5df5f6d5
AD
14232002-05-05 Akim Demaille <akim@epita.fr>
1424
1425 * src/output.c (output_unsigned_int_table): New.
1426 (prepare_rules): `i' is unsigned.
1427 `prhs', `rline', `r2' are unsigned int.
1428 Rename muscle `rhs_number_max' as `rhs_max'.
1429 Output muscles `prhs_max', `rline_max', and `r2_max'.
1430 Free rline and r1.
1431 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1432 to compute types instead of constant types.
1433 * tests/regression.at (Web2c Actions): Adjust.
1434
b87f8b21
AD
14352002-05-04 Akim Demaille <akim@epita.fr>
1436
1437 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1438 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1439 Adjust dependencies.
1440 * src/output.c (token_definitions_output): Be sure not to output a
1441 `#define 'a'' when fed with `%token 'a' "a"'.
1442 * tests/regression.at (Token definitions): New.
1443
8bb936e4
PE
14442002-05-03 Paul Eggert <eggert@twinsun.com>
1445
1446 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1447 for K&R C.
1448
14492002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1450
1451 * Makefile.am (SUBDIRS): Remove intl.
1452 (EXTRA_DIST): Add config/config.rpath.
1453
53c71a12
AD
14542002-05-03 Akim Demaille <akim@epita.fr>
1455
1456 * data/bison.simple (m4_if): Don't output empty enums.
1457 And actually, output valid enum definitions :(.
1458
289dd0cf
AD
14592002-05-03 Akim Demaille <akim@epita.fr>
1460
1461 * configure.bat: Remove, completely obsolete.
1462 * Makefile.am (EXTRA_DIST): Adjust.
1463 Don't distribute config.rpath...
1464 * config/Makefile.am (EXTRA_DIST): Do it.
1465
db85e524
AD
14662002-05-03 Akim Demaille <akim@epita.fr>
1467
1468 * configure.in (GETTEXT_VERSION): New.
1469 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1470
83ccf991
AD
14712002-05-03 Akim Demaille <akim@epita.fr>
1472
1473 * data/bison.simple (b4_token_enum): New.
1474 (b4_token_defines): Use it to output tokens both as #define and
1475 enums.
1476 Suggested by Paul Eggert.
1477 * src/output.c (token_definitions_output): Don't output spurious
1478 white spaces.
1479
1f418995
AD
14802002-05-03 Akim Demaille <akim@epita.fr>
1481
1482 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1483
45119f04
RA
14842002-05-02 Robert Anisko <robert@lrde.epita.fr>
1485
1486 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1487 Update the stack class, give a try to deque as the default container.
1488
b2d52318
AD
14892002-05-02 Akim Demaille <akim@epita.fr>
1490
1491 * data/bison.simple (yyparse): Do not implement @$ = @1.
1492 (YYLLOC_DEFAULT): Adjust to do it.
1493 * doc/bison.texinfo (Location Default Action): Fix.
1494
3a8b4109
AD
14952002-05-02 Akim Demaille <akim@epita.fr>
1496
1497 * src/reader.c (parse_braces): Merge into...
1498 (parse_action): this.
1499
84614e13
AD
15002002-05-02 Akim Demaille <akim@epita.fr>
1501
1502 * configure.in (ALL_LINGUAS): Remove.
1503 * po/LINGUAS, hr.po: New.
1504
fdbcd8e2
AD
15052002-05-02 Akim Demaille <akim@epita.fr>
1506
1507 Remove the so called hairy (semantic) parsers.
1508
1509 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1510 * src/gram.h, src/gram.c (semantic_parser): Remove.
1511 (rule_t): Remove the guard and guard_line members.
1512 * src/lex.h (token_t): remove tok_guard.
1513 * src/options.c (option_table): Remove %guard and %semantic_parser
1514 support.
1515 * src/output.c, src/output.h (guards_output): Remove.
1516 (prepare): Adjust.
1517 (token_definitions_output): Don't output the `T'
1518 tokens (???).
1519 (output_skeleton): Don't output the guards.
1520 * src/files.c, src/files.c (attrsfile): Remove.
1521 * src/reader.c (symbol_list): Remove the guard and guard_line
1522 members.
1523 Adjust dependencies.
1524 (parse_guard): Remove.
1525 * data/bison.hairy: Remove.
1526 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1527 BISON_HAIRY.
1528
82b6cb3f
AD
15292002-05-02 Akim Demaille <akim@epita.fr>
1530
1531 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1532 (parse_guard): Rename the formal argument `stack_offset' as
1533 `rule_length', which is more readable.
1534 Adjust callers.
1535 (copy_at, copy_dollar): Instead of outputting the hard coded
1536 values of $$, $n and so forth, output invocation to b4_lhs_value,
1537 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
1538 Note: this patch partially drops `semantic-parser' support: it
1539 always does `rule_length - n', where semantic parsers ought to
1540 always use `-n'.
82b6cb3f
AD
1541 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1542 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1543
6cbfbcc5
AD
15442002-05-02 Akim Demaille <akim@epita.fr>
1545
1546 * configure.in (AC_INIT): Bump to 1.49b.
1547 (AM_INIT_AUTOMAKE): Short invocation.
1548
b8548114
AD
15492002-05-02 Akim Demaille <akim@epita.fr>
1550
1551 Version 1.49a.
1552
c20cd1fa
AD
15532002-05-01 Akim Demaille <akim@epita.fr>
1554
1555 * src/skeleton.h: Remove.
1556
8a9566d4
AD
15572002-05-01 Akim Demaille <akim@epita.fr>
1558
1559 * src/skeleton.h: Fix the #endif.
1560 Reported by Magnus Fromreide.
1561
8c6d399a
PE
15622002-04-26 Paul Eggert <eggert@twinsun.com>
1563
1564 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1565 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 1566 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 1567
2b7ed18a
RA
15682002-04-25 Robert Anisko <robert@lrde.epita.fr>
1569
1570 * src/scan-skel.l: Postprocess quadrigraphs.
1571
1572 * src/reader.c (copy_character): New function, used to output
1573 single characters while replacing `[' and `]' with quadrigraphs, to
1574 avoid troubles with M4 quotes.
1575 (copy_comment): Output characters with copy_character.
1576 (read_additionnal_code): Likewise.
1577 (copy_string2): Likewise.
1578 (copy_definition): Likewise.
1579
1580 * tests/calc.at: Exercise M4 quoting.
1581
34a89c50
AD
15822002-04-25 Akim Demaille <akim@epita.fr>
1583
1584 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1585 between `!' and the command.
1586 Reported by Paul Eggert.
1587
0dd1580a
RA
15882002-04-24 Robert Anisko <robert@lrde.epita.fr>
1589
1590 * tests/calc.at: Exercise prologue splitting.
1591
1592 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1593 `b4_post_prologue' instead of `b4_prologue'.
1594
1595 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1596 muscles.
1597 (output): Free pre_prologue_obstack and post_prologue_obstack.
1598 * src/files.h, src/files.c (attrs_obstack): Remove.
1599 (pre_prologue_obstack, post_prologue_obstack): New.
1600 * src/reader.c (copy_definition): Add a parameter to specify the
1601 obstack to fill, instead of using attrs_obstack unconditionally.
1602 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1603 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1604
83c1796f
PE
16052002-04-23 Paul Eggert <eggert@twinsun.com>
1606
1607 * data/bison.simple: Remove unnecessary commentary and white
1608 space differences from 1_29-branch.
1609 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1610
1611 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1612 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1613 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1614 constructors or destructors.
1615
1616 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1617
1207eeac
AD
16182002-04-23 Akim Demaille <akim@epita.fr>
1619
1620 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1621 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1622 location with columns.
1623 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1624 All reported by Paul Eggert.
1625
78ab8f67
AD
16262002-04-22 Akim Demaille <akim@epita.fr>
1627
1628 * src/reduce.c (dump_grammar): Move to...
1629 * src/gram.h, src/gram.c (grammar_dump): here.
1630 Be sure to separate long item numbers.
1631 Don't read the members of a rule's prec if its nil.
1632
133c20e2
AD
16332002-04-22 Akim Demaille <akim@epita.fr>
1634
1635 * src/output.c (table_size, table_grow): New.
1636 (MAXTABLE): Remove, replace uses with table_size.
1637 (pack_vector): Instead of dying when the table is too big, grow it.
1638
9515e8a7
AD
16392002-04-22 Akim Demaille <akim@epita.fr>
1640
1641 * data/bison.simple (yyr1): Its type is that of a token number.
1642 * data/bison.c++ (r1_): Likewise.
1643 * tests/regression.at (Web2c Actions): Adjust.
1644
23c5a174
AD
16452002-04-22 Akim Demaille <akim@epita.fr>
1646
1647 * src/reader.c (token_translations_init): 256 is now the default
1648 value for the error token, i.e., it will be assigned another
1649 number if the user assigned 256 to one of her tokens.
1650 (reader): Don't force 256 to error.
1651 * doc/bison.texinfo (Symbols): Adjust.
1652 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1653 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1654 etc. instead of 10, 20, 30 (which was used to `jump' over error
1655 (256) and undefined (2)).
1656
5fbb0954
AD
16572002-04-22 Akim Demaille <akim@epita.fr>
1658
1659 Propagate more token_number_t.
1660
1661 * src/gram.h (token_number_as_item_number)
1662 (item_number_as_token_number): New.
1663 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1664 Use it to create output_item_number_table and
1665 output_token_number_table.
1666 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1667 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1668 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1669 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1670
4f940944
AD
16712002-04-22 Akim Demaille <akim@epita.fr>
1672
1673 * src/output.h, src/output.c (get_lines_number): Remove.
1674
3ded9a63
AD
16752002-04-19 Akim Demaille <akim@epita.fr>
1676
1677 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1678 as Lex/Flex'.
1679 (Debugging): More details about enabling the debugging features.
1680 (Table of Symbols): Describe $$, $n, @$, and @n.
1681 Suggested by Tim Josling.
1682
e0c471a9
AD
16832002-04-19 Akim Demaille <akim@epita.fr>
1684
1685 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1686
fecc10cd
AD
16872002-04-10 Akim Demaille <akim@epita.fr>
1688
1689 * src/system.h: Rely on HAVE_LIMITS_H.
1690 Suggested by Paul Eggert.
1691
51dec47b
AD
16922002-04-09 Akim Demaille <akim@epita.fr>
1693
1694 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1695 full stderr, and strip it according to the bison options, instead
1696 of composing the error message from different bits.
1697 This makes it easier to check for several error messages.
1698 Adjust all the invocations.
1699 Add an invocation exercising the error token.
1700 Add an invocation demonstrating a stupid error message.
1701 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1702 Adjust the tests.
1703 Error message are for stderr, not stdout.
1704
007a50a4
AD
17052002-04-09 Akim Demaille <akim@epita.fr>
1706
1707 * src/gram.h, src/gram.c (error_token_number): Remove, use
1708 errtoken->number.
1709 * src/reader.c (reader): Don't specify the user token number (2)
1710 for $undefined, as it uselessly prevents using it.
1711 * src/gram.h (token_number_t): Move to...
1712 * src/symtab.h: here.
1713 (state_t.number): Is a token_number_t.
1714 * src/print.c, src/reader.c: Use undeftoken->number instead of
1715 hard coded 2.
1716 (Even though this 2 is not the same as above: the number of the
1717 undeftoken remains being 2, it is its user token number which
1718 might not be 2).
1719 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1720 `user_token_number_max'.
1721 Output `undef_token_number'.
1722 * data/bison.simple, data/bison.c++: Use them.
1723 Be sure to map invalid yylex return values to
1724 `undef_token_number'. This saves us from gratuitous SEGV.
1725
1726 * tests/conflicts.at (Solved SR Conflicts)
1727 (Unresolved SR Conflicts): Adjust.
1728 * tests/regression.at (Web2c Actions): Adjust.
1729
06446ccf
AD
17302002-04-08 Akim Demaille <akim@epita.fr>
1731
1732 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1733 Adding #line.
1734 Remove the duplicate `typedefs'.
1735 (RhsNumberType): Fix the declaration and various other typos.
1736 Use __ofile__.
1737 * data/bison.simple: Use __ofile__.
1738 * src/scan-skel.l: Handle __ofile__.
1739
62a3e4f0
AD
17402002-04-08 Akim Demaille <akim@epita.fr>
1741
1742 * src/gram.h (item_number_t): New, the type of item numbers in
1743 RITEM. Note that it must be able to code symbol numbers as
1744 positive number, and the negation of rule numbers as negative
1745 numbers.
1746 Adjust all dependencies (pretty many).
1747 * src/reduce.c (rule): Remove this `short *' pointer: use
1748 item_number_t.
1749 * src/system.h (MINSHORT, MAXSHORT): Remove.
1750 Include `limits.h'.
1751 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1752 (shortcpy): Remove.
1753 (MAXTABLE): Move to...
1754 * src/output.c (MAXTABLE): here.
1755 (prepare_rules): Use output_int_table to output rhs.
1756 * data/bison.simple, data/bison.c++: Adjust.
1757 * tests/torture.at (Big triangle): Move the limit from 254 to
1758 500.
1759 * tests/regression.at (Web2c Actions): Ajust.
1760
1761 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1762 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1763 passes, but produces negative #line number, once fixed, GCC is
1764 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1765 C), it passes.
1766 * src/state.h (state_h): Code input lines on ints, not shorts.
1767
bb88b0fc
AD
17682002-04-08 Akim Demaille <akim@epita.fr>
1769
1770 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1771 and then the grammar.
1772
9a636f47
AD
17732002-04-08 Akim Demaille <akim@epita.fr>
1774
1775 * src/system.h: No longer using strndup.
1776
680e8701
AD
17772002-04-07 Akim Demaille <akim@epita.fr>
1778
1779 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1780 * src/output.c (output_table_data): Return the longest number.
1781 (prepare_tokens): Output `token_number_max').
1782 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1783 New.
1784 Use them to define yy_token_number_type/TokenNumberType.
1785 Use this type for yytranslate.
1786 * tests/torture.at (Big triangle): Push the limit from 124 to
1787 253.
1788 * tests/regression.at (Web2c Actions): Adjust.
1789
817e9f41
AD
17902002-04-07 Akim Demaille <akim@epita.fr>
1791
1792 * tests/torture.at (Big triangle): New.
1793 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1794 * tests/existing.at: here.
1795
5123689b
AD
17962002-04-07 Akim Demaille <akim@epita.fr>
1797
1798 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1799 nritems.
1800 Adjust dependencies.
1801
f3849179
AD
18022002-04-07 Akim Demaille <akim@epita.fr>
1803
1804 * src/reader.c: Normalize increments to prefix form.
1805
bd02036a
AD
18062002-04-07 Akim Demaille <akim@epita.fr>
1807
1808 * src/reader.c, symtab.c: Remove debugging code.
1809
db8837cb
AD
18102002-04-07 Akim Demaille <akim@epita.fr>
1811
1812 Rename all the `bucket's as `symbol_t'.
1813
1814 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1815 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1816 * src/symtab.c, src/symtab.h (bucket): Rename as...
1817 (symbol_t): this.
1818 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1819 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1820 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1821 (buckets_new, buckets_free, buckets_do): Rename as...
1822 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1823 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1824 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1825 (symbols_new, symbols_free, symbols_do): these.
1826
72a23c97
AD
18272002-04-07 Akim Demaille <akim@epita.fr>
1828
1829 Use lib/hash for the symbol table.
1830
1831 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1832 EOF.
1833 * src/lex.c (lex): Set the `number' member of new terminals.
1834 * src/reader.c (bucket_check_defined, bucket_make_alias)
1835 (bucket_check_alias_consistence, bucket_translation): New.
1836 (reader, grammar_free, readgram, token_translations_init)
1837 (packsymbols): Adjust.
1838 (reader): Number the predefined tokens.
1839 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1840 for predefined tokens.
1841 * src/symtab.h (bucket): Remove all the hash table related
1842 members.
1843 * src/symtab.c (symtab): Replace by...
1844 (bucket_table): this.
1845 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1846 (buckets_new, buckets_do): New.
1847
280a38c3
AD
18482002-04-07 Akim Demaille <akim@epita.fr>
1849
1850 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1851 (start_symbol, max_user_token_number, semantic_parser)
1852 (error_token_number): Initialize.
1853 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1854 Initialize.
1855 (reader): Don't.
1856 (errtoken, eoftoken, undeftoken, axiom): Extern.
1857
03b31c0c
AD
18582002-04-07 Akim Demaille <akim@epita.fr>
1859
1860 * src/gram.h (rule_s): prec and precsym are now pointers
1861 to the bucket giving the priority/associativity.
1862 Member `associativity' removed: useless.
1863 * src/reduce.c, src/conflicts.c: Adjust.
1864
8b3df748
AD
18652002-04-07 Akim Demaille <akim@epita.fr>
1866
1867 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1868 Properly escape the symbols' TAG when outputting them.
1869
e601aa1d
AD
18702002-04-07 Akim Demaille <akim@epita.fr>
1871
1872 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1873
b0299a2e
AD
18742002-04-07 Akim Demaille <akim@epita.fr>
1875
1876 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1877 (LArule): this, which is an array to rule_t*.
1878 * src/print.c, src/conflicts.c: Adjust.
1879
d7e1f00c
AD
18802002-04-07 Akim Demaille <akim@epita.fr>
1881
1882 * src/gram.h (rule_t): Rename `number' as `user_number'.
1883 `number' is a new member.
1884 Adjust dependencies.
1885 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1886
cc9305dd
AD
18872002-04-07 Akim Demaille <akim@epita.fr>
1888
1889 As a result of the previous patch, it is no longer needed
1890 to reorder ritem itself.
1891
1892 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1893
b0940840
AD
18942002-04-07 Akim Demaille <akim@epita.fr>
1895
1896 Be sure never to walk through RITEMS, but use only data related to
1897 the rules themselves. RITEMS should be banished.
1898
1899 * src/output.c (output_token_translations): Rename as...
1900 (prepare_tokens): this.
1901 In addition to `translate', prepare the muscles `tname' and
1902 `toknum', which were handled by...
1903 (output_rule_data): this.
1904 Remove, and move the remainder of its outputs into...
1905 (prepare_rules): this new routines, which also merges content from
1906 (output_gram): this.
1907 (prepare_rules): Be sure never to walk through RITEMS.
1908 (output_stos): Rename as...
1909 (prepare_stos): this.
1910 (output): Always invoke prepare_states, after all, just don't use it
1911 in the output if you don't need it.
1912
643a5994
AD
19132002-04-07 Akim Demaille <akim@epita.fr>
1914
1915 * src/LR0.c (new_state): Display `nstates' as the name of the
1916 newly created state.
1917 Adjust to initialize first_state and last_state if needed.
1918 Be sure to distinguish the initial from the final state.
1919 (new_states): Create the itemset of the initial state, and use
1920 new_state.
1921 * src/closure.c (closure): Now that the initial state has its
1922 items properly set, there is no need for a special case when
1923 creating `ruleset'.
1924
1925 As a result, now the rule 0, reducing to $axiom, is visible in the
1926 outputs. Adjust the test suite.
1927
1928 * tests/conflicts.at (Solved SR Conflicts)
1929 (Unresolved SR Conflicts): Adjust.
1930 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1931 * tests/conflicts.at (S/R in initial): New.
1932
b4c4ccc2
AD
19332002-04-07 Akim Demaille <akim@epita.fr>
1934
1935 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1936 the RHS of the rules.
1937 * src/output.c (output_gram): Likewise.
1938
bba97eb2
AD
19392002-04-07 Akim Demaille <akim@epita.fr>
1940
1941 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1942 bucket.
1943 Adjust all dependencies.
1944 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1945 `number' of the buckets too.
1946 * src/gram.h: Include `symtab.h'.
1947 (associativity): Move to...
1948 * src/symtab.h: here.
1949 No longer include `gram.h'.
1950
c3b407f4
AD
19512002-04-07 Akim Demaille <akim@epita.fr>
1952
1953 * src/gram.h, src/gram.c (rules_rhs_length): New.
1954 (ritem_longest_rhs): Use it.
1955 * src/gram.h (rule_t): `number' is a new member.
1956 * src/reader.c (packgram): Set it.
1957 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1958 the end of `rules', and count them out of `nrules'.
1959 (reduce_output, dump_grammar): Adjust.
1960 * src/print.c (print_grammar): It is no longer needed to check for
1961 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1962 * tests/reduce.at (Reduced Automaton): New test.
1963
11652ab3
AD
19642002-04-07 Akim Demaille <akim@epita.fr>
1965
1966 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1967 lacking `+ 1' to nrules, Bison reported as useless a token if it
1968 was used solely to set the precedence of the last rule...
1969
26b23c1a
AD
19702002-04-07 Akim Demaille <akim@epita.fr>
1971
1972 * data/bison.c++, data/bison.simple: Don't output the current file
1973 name in #line, to avoid useless diffs between two identical
1974 outputs under different names.
1975
18bcecb0
AD
19762002-04-07 Akim Demaille <akim@epita.fr>
1977
1978 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1979 Normalize loops to using `< nrules + 1', not `<= nrules'.
1980
fa770c86
AD
19812002-04-07 Akim Demaille <akim@epita.fr>
1982
1983 * TODO: Update.
1984
d9b739c3
AD
19852002-04-07 Akim Demaille <akim@epita.fr>
1986
1987 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1988 bucket.value as bucket.number.
1989
99013900
AD
19902002-04-07 Akim Demaille <akim@epita.fr>
1991
1992 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1993 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1994 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1995 RHS, instead of being an index in RITEMS.
1996
e966383b
PE
19972002-04-04 Paul Eggert <eggert@twinsun.com>
1998
1999 * doc/bison.texinfo: Update copyright date.
2000 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
2001 (Symbols): Warn about running Bison in one character set,
2002 but compiling and/or running in an incompatible one.
2003 Warn about character code 256, too.
2004
20052002-04-03 Paul Eggert <eggert@twinsun.com>
2006
2007 * src/bison.data (YYSTACK_ALLOC): Depend on whether
2008 YYERROR_VERBOSE is nonzero, not whether it is defined.
2009
2010 Merge changes from bison-1_29-branch.
c307773e 2011
8d6c48b9
PE
20122002-03-20 Paul Eggert <eggert@twinsun.com>
2013
2014 Merge fixes from Debian bison_1.34-1.diff.
2015
2016 * configure.in (AC_PREREQ): 2.53.
2017
e53c6322
AD
20182002-03-20 Akim Demaille <akim@epita.fr>
2019
2020 * src/conflicts.c (log_resolution): Argument `resolution' is const.
2021
9ffbeca7
PE
20222002-03-19 Paul Eggert <eggert@twinsun.com>
2023
21db0b2a
PE
2024 * src/bison.simple (YYCOPY): New macro.
2025 (YYSTACK_RELOCATE): Use it.
2026 Remove Type arg; no longer needed. All callers changed.
2027 (yymemcpy): Remove; no longer needed.
2028
9ffbeca7
PE
2029 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
2030 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2031
642cb8f8
AD
20322002-03-19 Akim Demaille <akim@epita.fr>
2033
2034 Test and fix the #line outputs.
2035
2036 * tests/atlocal.at (GCC): New.
2037 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
2038 (Prologue synch line, ,%union synch line, Postprologue synch line)
2039 (Action synch line, Epilogue synch line): New tests.
2040 * src/reader.c (parse_union_decl): Define the muscle stype_line.
2041 * data/bison.simple, data/bison.c++: Use it.
2042
3c31a486
AD
20432002-03-19 Akim Demaille <akim@epita.fr>
2044
2045 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
2046 (Solved SR Conflicts, %expect not enough, %expect right)
2047 (%expect too much): Move to...
2048 * tests/conflicts.at: this new file.
2049
0d8bed56
AD
20502002-03-19 Akim Demaille <akim@epita.fr>
2051
2052 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2053 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
2054 that we can move to enums for instance.
2055 * src/output.c (token_definitions_output): Output a list of
2056 `token-name, token-number' instead of the #define.
2057 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
2058
9208d17f
AD
20592002-03-14 Akim Demaille <akim@epita.fr>
2060
2061 Use Gettext 0.11.1.
2062
af27eacb
RA
20632002-03-09 Robert Anisko <robert@lrde.epita.fr>
2064
2065 * data/bison.c++: Make the user able to add members to the generated
2066 parser by subclassing.
2067
9101a310
RA
20682002-03-05 Robert Anisko <robert@lrde.epita.fr>
2069
2070 * src/reader.c (read_additionnal_code): `c' should be an integer, not
2071 a character.
2072 Reported by Nicolas Tisserand and Nicolas Burrus.
2073
fff9bf0b
RA
20742002-03-04 Robert Anisko <robert@lrde.epita.fr>
2075
2076 * src/reader.c: Warn about lacking semi-colons, do not complain.
2077
64dba31e
RA
20782002-03-04 Robert Anisko <robert@lrde.epita.fr>
2079
2080 * data/bison.c++: Remove a debug line.
2081
374f5a14
RA
20822002-03-04 Robert Anisko <robert@lrde.epita.fr>
2083
2084 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
2085 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
2086 provide a default implementation.
2087
bfcf1f3a
AD
20882002-03-04 Akim Demaille <akim@epita.fr>
2089
2090 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
2091 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
2092 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
2093 * tests/semantic.at (Parsing Guards): Similarly.
2094 * src/reader.at (readgram): Complain if the last rule is not ended
2095 with a semi-colon.
2096
65ccf9fc
AD
20972002-03-04 Akim Demaille <akim@epita.fr>
2098
2099 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
2100 * src/closure.c: here.
2101 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
2102 RTC.
2103 * src/warshall.h, src/warshall.c: Remove.
2104 * tests/sets.at (Broken Closure): Adjust.
2105
d0039cbc
AD
21062002-03-04 Akim Demaille <akim@epita.fr>
2107
2108 * src/output.c (output_skeleton): tempdir is const.
2109 bytes_read is unused.
2110
345cea78
AD
21112002-03-04 Akim Demaille <akim@epita.fr>
2112
2113 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2114 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
2115 Update.
2116 From Michael Hayes.
2117
564801f7
AD
21182002-03-04 Akim Demaille <akim@epita.fr>
2119
2120 * src/closure.c (closure): `r' is unused.
2121
e5352bc7
AD
21222002-03-04 Akim Demaille <akim@epita.fr>
2123
2124 * tests/sets.at (Broken Closure): Add the ending `;'.
2125 * src/reader.at (readgram): Complain if a rule is not ended with a
2126 semi-colon.
2127
914feea9
AD
21282002-03-04 Akim Demaille <akim@epita.fr>
2129
2130 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
2131 (count_sr_conflicts): Use bitset_count.
2132 * src/reduce.c (inaccessable_symbols): Ditto.
2133 (bits_size): Remove.
2134 * src/warshall.h, src/warshall.c: Convert to bitsetv.
2135
f0250de6
AD
21362002-03-04 Akim Demaille <akim@epita.fr>
2137
2138 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
2139 * src/reduce.c: Remove the `bitset_zero's following the
2140 `bitset_create's, as now it is performed by the latter.
2141
ef017502
AD
21422002-03-04 Akim Demaille <akim@epita.fr>
2143
2144 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
2145 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
2146 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
2147 latest sources from Michael.
2148
76514394
AD
21492002-03-04 Akim Demaille <akim@epita.fr>
2150
2151 * src/output.c (output): Don't free the grammar.
2152 * src/reader.c (grammar_free): New.
2153 * src/main.c (main): Call it and don't free symtab here.
2154
55024580
AD
21552002-03-04 Akim Demaille <akim@epita.fr>
2156
2157 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
2158 before returning.
2159 Reported by Benoit Perrot.
2160
f9abaa2c
AD
21612002-03-04 Akim Demaille <akim@epita.fr>
2162
2163 Use bitset operations when possible, not loops over bits.
2164
2165 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
2166 bitset_or.
2167 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
2168 * src/reduce.c (useless_nonterminals): Formatting changes.
2169 * src/warshall.c (TC): Use bitset_or.
2170
0e721e75
AD
21712002-03-04 Akim Demaille <akim@epita.fr>
2172
2173 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
2174 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
2175 Ditto.
2176
0fb1ffb1
AD
21772002-03-04 Akim Demaille <akim@epita.fr>
2178
2179 * src/lalr.c (F): Now a bitset*.
2180 Adjust all dependencies.
2181
b86796bf
AD
21822002-03-04 Akim Demaille <akim@epita.fr>
2183
2184 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
2185 Adjust all dependencies.
2186
602bbf31
AD
21872002-03-04 Akim Demaille <akim@epita.fr>
2188
2189 * src/L0.c, src/LR0.h (nstates): Be size_t.
2190 Adjust comparisons (signed vs unsigned).
2191 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
2192 bitset*.
2193 Adjust all dependencies.
2194
d8a0245c
AD
21952002-03-04 Akim Demaille <akim@epita.fr>
2196
2197 * src/closure.c (firsts): Now, also a bitset.
2198 Adjust all dependencies.
2199 (varsetsize): Remove, now unused.
2200 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2201
34ba9743
AD
22022002-03-04 Akim Demaille <akim@epita.fr>
2203
2204 * src/print.c: Convert to use bitset.h, not hand coded iterations
2205 over ints.
2206
ed86e78c
AD
22072002-03-04 Akim Demaille <akim@epita.fr>
2208
2209 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2210
dfdb1797
AD
22112002-03-04 Akim Demaille <akim@epita.fr>
2212
2213 * src/closure.c (ruleset): Be a bitset.
2214 (rulesetsize): Remove.
2215
7086e707
AD
22162002-03-04 Akim Demaille <akim@epita.fr>
2217
2218 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2219 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2220 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2221 * src/closure.c (fderives): Be an array of bitsets.
2222
98254360
RA
22232002-02-28 Robert Anisko <robert@lrde.epita.fr>
2224
2225 * data/bison.c++: Merge the two generated headers. Insert a copyright
2226 notice in each output file.
2227
a75c057f
AD
22282002-02-28 Akim Demaille <akim@epita.fr>
2229
2230 * data/bison.c++: Copy the prologue of bison.simple to fetch
2231 useful M4 definitions, such as b4_header_guard.
2232
06b00abc
AD
22332002-02-25 Akim Demaille <akim@epita.fr>
2234
2235 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
2236 translator friendly scheme for the bgr
2237 copyright notice.
06b00abc 2238
70e7d534
AD
22392002-02-25 Akim Demaille <akim@epita.fr>
2240
2241 * src/output.c (header_output): Remove, now handled completely via
2242 M4.
2243
abe017f6
AD
22442002-02-25 Akim Demaille <akim@epita.fr>
2245
2246 * m4/m4.m4: New, from CVS Autoconf.
2247 * configure.in: Invoke it.
2248 * src/output.c (output_skeleton): Use its result instead of the
2249 hard coded name.
2250
381fb12e
AD
22512002-02-25 Akim Demaille <akim@epita.fr>
2252
2253 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2254 Fileutils 4.1.5.
2255 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2256 * src/output.c (output_skeleton): Use mkstemp to create a real
2257 temporary file.
2258 Move the filling of `skeleton' and its muscle to...
2259 (prepare): here.
2260 (output): Move the definition of the prologue muscle to...
2261 (prepare): here.
2262 * src/system.h (DEFAULT_TMPDIR): New.
2263
6f38107f
PE
22642002-02-14 Paul Eggert <eggert@twinsun.com>
2265
2266 Remove the support for C++ namespace cleanliness; it was
2267 causing more problems than it was curing, since it didn't work
2268 properly on some nonstandard C++ compilers. This can wait
2269 for a proper C++ parser.
2270
2271 * NEWS: Document this.
2272 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2273 of C++, as it's treated like C now.
2274 * src/bison.simple (YYSTD): Remove.
2275 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2276 Treat C++ just like Standard C instead of trying to support
2277 namespace cleanliness.
2278
80cce3da
AD
22792002-02-14 Akim Demaille <akim@epita.fr>
2280
2281 * tests/regression.at (else): Adjust to Andreas' change.
2282
842e8679
AD
22832002-02-14 Akim Demaille <akim@epita.fr>
2284
2285 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2286
4bda3f10
AD
22872002-02-13 Andreas Schwab <schwab@suse.de>
2288
2289 * src/output.c (output_rule_data): Don't output NULL, it might
2290 not be defined yet.
2291
4162fa07 22922002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 2293
4162fa07
RA
2294 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2295 (Copyright notice): Update.
b418ecd8 2296
bd16a5dc
AD
22972002-02-11 Akim Demaille <akim@epita.fr>
2298
2299 * tests/regression.at (%nonassoc and eof): Don't include
2300 nonportable headers.
2301
8d69a1a3
RA
23022002-02-08 Robert Anisko <robert@lrde.epita.fr>
2303
2304 * data/bison.c++: Correct error recovery. Make the user able to
2305 initialize the starting location.
2306
9b2d0677
AD
23072002-02-07 Akim Demaille <akim@epita.fr>
2308
2309 * tests/input.at: New.
2310
69e2658b
RA
23112002-02-07 Robert Anisko <robert@lrde.epita.fr>
2312
2313 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 2314 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
2315 directives around tables only needed for debugging.
2316
4aacc3a7
RA
23172002-02-07 Robert Anisko <robert@lrde.epita.fr>
2318
2319 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2320 C++ parsers.
2321 (yy::b4_name::parse): Use print_.
2322
762a801e
RA
23232002-02-07 Robert Anisko <robert@lrde.epita.fr>
2324
2325 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2326
4bb2bc3f
RA
23272002-02-07 Robert Anisko <robert@lrde.epita.fr>
2328
2329 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2330 C++ parsers.
2331 (yy::b4_name::parse): Build verbose error messages, and use error_.
2332
6b45a3ca
RA
23332002-02-06 Robert Anisko <robert@lrde.epita.fr>
2334
2335 * data/bison.c++: Fix m4 quoting in comments.
2336
50997c6e
RA
23372002-02-06 Robert Anisko <robert@lrde.epita.fr>
2338
2339 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2340 not expanded by m4.
2341
3f3eed27
AD
23422002-02-05 Akim Demaille <akim@epita.fr>
2343
2344 * data/bison.c++: Adjust to the M4 back end.
2345 More is certainly needed.
2346
be2a1a68
AD
23472002-02-05 Akim Demaille <akim@epita.fr>
2348
2349 Give a try to M4 as a back end.
2350
2351 * lib/readpipe.c: New, from wdiff.
2352 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2353 BISON_HAIRY.
2354 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2355 specific values. Now it is m4 that performs the lookup.
2356 * src/parse-skel.y: Remove.
2357 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2358 * src/output.c (actions_output, guards_output)
2359 (token_definitions_output): No longer keeps track of the output
2360 line number, hence remove the second argument.
2361 (guards_output): Check against the guard member of a rule, not the
2362 action member.
2363 Adjust callers.
2364 (output_skeleton): Don't look for the skeleton location, let m4 do
2365 that.
2366 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2367 file will be used.
2368 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2369 (prepare): Given that for the time being changesyntax is not
2370 usable in M4, rename the muscles using `-' to `_'.
2371 Define `defines_flag', `output_parser_name' and `output_header_name'.
2372 * src/output.h (actions_output, guards_output)
2373 (token_definitions_output): Adjust prototypes.
2374 * src/scan-skel.l: Instead of scanning the skeletons, it now
2375 processes the output of m4: `__oline__' and `#output'.
2376 * data/bison.simple: Adjust to be used by M4(sugar).
2377 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2378 to date.
2379 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2380 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2381 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2382 shamelessly stolen from CVS Autoconf.
2383
beda758b
AD
23842002-02-05 Akim Demaille <akim@epita.fr>
2385
2386 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2387 * configure.in: Check for the declarations of free and malloc.
2388 * src/muscle_tab.c: Adjust.
2389
5ece6d43
AD
23902002-02-05 Akim Demaille <akim@epita.fr>
2391
2392 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2393 which have no values.
2394
5bb18f9a
AD
23952002-02-05 Akim Demaille <akim@epita.fr>
2396
2397 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2398 * data/: here.
2399
894dd62e
PE
24002002-01-29 Paul Eggert <eggert@twinsun.com>
2401
2402 * src/bison.simple (YYSIZE_T): Do not define merely because
2403 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2404 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2405
82841af7
AD
24062002-01-27 Akim Demaille <akim@epita.fr>
2407
2408 Fix `%nonassoc and eof'.
2409
2410 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2411 which were not properly copied! Replace
2412 memcpy (res->errs, src->errs, src->nerrs);
2413 with
2414 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2415 !!!
2416 * tests/regression.at (%nonassoc and eof): Adjust to newest
2417 Autotest: `.' is not in the PATH.
2418
318b76e9
AD
24192002-01-27 Akim Demaille <akim@epita.fr>
2420
2421 * tests/sets.at (AT_EXTRACT_SETS): New.
2422 (Nullable): Use it.
2423 (Firsts): New.
2424
30d2f3d5
AD
24252002-01-26 Akim Demaille <akim@epita.fr>
2426
2427 * tests/actions.at, tests/calc.at, tests/headers.at,
2428 * tests/torture.at: Adjust to the newest Autotest which no longer
2429 forces `.' in the PATH.
2430
30f8c395
AD
24312002-01-25 Akim Demaille <akim@epita.fr>
2432
2433 * tests/regression.at (%nonassoc and eof): New.
2434 Suggested by Robert Anisko.
2435
29ae55f1
AD
24362002-01-24 Akim Demaille <akim@epita.fr>
2437
2438 Bison dumps core when trying to complain about broken input files.
2439 Reported by Cris van Pelt.
2440
2441 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2442 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2443 into...
2444 (Invalid inputs): Strengthen: exercise parse_percent_token.
2445
2b548aa6
RA
24462002-01-24 Robert Anisko <robert.anisko@epita.fr>
2447
2448 * src/Makefile.am: Add bison.c++.
2449 * src/bison.c++: New skeleton.
2450
bb0146c2
AD
24512002-01-21 Paolo Bonzini <bonzini@gnu.org>
2452
2453 * po/it.po: New.
2454
bec30531
AD
24552002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2456
2457 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2458
fc6edc45
MA
24592002-01-20 Marc Autret <marc@gnu.org>
2460
2461 * src/files.c (compute_output_file_names): Fix
2462
5e5d5415
MA
24632002-01-20 Marc Autret <marc@gnu.org>
2464
2465 * tests/output.at: New test.
2466 * src/files.c (compute_base_names): Don't map extensions when
2467 the YACC flag is set, use defaults.
2468 Reported by Evgeny Stambulchik.
2469
44ea3fbd
MA
24702002-01-20 Marc Autret <marc@gnu.org>
2471
bb0146c2 2472 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
2473 compilers as well (i.e. the vendor C compiler).
2474 Suggested by Albert Chin-A-Young.
2475
338963d1
TVH
24762002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2477
2478 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2479 canonical definition.
2480 * src/system.h: Use the canonical definition for PARAMS (avoids
2481 a conflict with the macro from lib/hash.h).
2482
c57b2479
AD
24832002-01-11 Akim Demaille <akim@epita.fr>
2484
2485 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 2486 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 2487
b85810ae
AD
24882002-01-09 Akim Demaille <akim@epita.fr>
2489
2490 * src/files.c, src/files.h (output_infix): New.
2491 (tab_extension): Remove.
2492 (compute_base_names): Compute the former, drop the latter.
2493 * src/output.c (prepare): Insert the muscles `output-infix', and
2494 `output-suffix'.
2495 * src/parse-skel.y (string, string.1): New.
2496 (section.header): Use it.
2497 (section.yacc): Remove.
2498 (prefix): Remove too.
2499 * src/scan-skel.l: Adjust.
2500 * src/bison.simple, src/bison.hairy: Adjust.
2501
cae60122
AD
25022002-01-09 Akim Demaille <akim@epita.fr>
2503
2504 * configure.in (WERROR_CFLAGS): Compute it.
2505 * src/Makefile.am (CFLAGS): Pass it.
2506 * tests/atlocal.in (CFLAGS): Idem.
2507 * src/files.c: Fix a few warnings.
2508 (get_extension_index): Remove, unused.
2509
ae404801
AD
25102002-01-08 Akim Demaille <akim@epita.fr>
2511
2512 * src/getargs.c (AS_FILE_NAME): New.
2513 (getargs): Use it to convert DOSish file names.
2514 * src/files.c (base_name): Rename as full_base_name to avoid
2515 clashes with `base_name ()'.
2516 (filename_split): New.
2517 (compute_base_names): N-th rewrite, using filename_split.
2518
22312b71
AD
25192002-01-08 Akim Demaille <akim@epita.fr>
2520
2521 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2522 New, stolen from the Fileutils 4.1.
2523 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2524 * configure.in: Check for the presence of memrchr, and of its
2525 prototype.
2526
a67cef01
TVH
25272002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2528
2529 * lib/hash.h (__P): Added definition for this macro.
2530 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2531 BUILT_SOURCES, to ensure they are generated first.
2532 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2533 %error-verbose to allow bootstrapping with bison 1.30x.
2534
2b25d624
AD
25352002-01-06 Akim Demaille <akim@epita.fr>
2536
2537 * src/reader.c (parse_braces): Don't fetch the next char, the
2538 convention is to fetch on entry.
2539 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2540 'switch' without a following semicolon.
2541 * tests/regression.at (braces parsing): New.
2542
3460813b
AD
25432002-01-06 Akim Demaille <akim@epita.fr>
2544
2545 Bison is dead wrong in its RR conflict reports.
2546
2547 * tests/torture.at (GNU Cim Grammar): New.
2548 * src/conflicts.c (count_rr_conflicts): Fix.
2549
73784c64
AD
25502002-01-06 Akim Demaille <akim@epita.fr>
2551
2552 Creating package.m4 from configure.ac causes too many problems.
2553
2554 * tests/Makefile.am (package.m4): Create it by hand,
2555 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2556
25d81090
AD
25572002-01-06 Akim Demaille <akim@epita.fr>
2558
2559 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2560 skeleton.h.
2561
a9b8959e
PE
25622002-01-04 Paul Eggert <eggert@twinsun.com>
2563
2564 * doc/bison.texinfo (Debugging):
2565 Remove YYSTDERR; it's no longer defined or used.
2566 Also, s/cstdio.h/cstdio/.
2567
25d81090
AD
25682002-01-03 Akim Demaille <akim@epita.fr>
2569
2570 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2571
1109455c
AD
25722002-01-03 Akim Demaille <akim@epita.fr>
2573
2574 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2575 tracing code to --trace, wait for a better --trace option, with
2576 args.
2577
7ea5e977
AD
25782002-01-03 Akim Demaille <akim@epita.fr>
2579
2580 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2581 The ISO C++ standard is extremely clear about it: stderr is
2582 considered a macro, not a regular symbol (see table 94 `Header
2583 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2584 Therefore std:: does not apply to it. It still does with fprintf.
2585 Also, s/cstdio.h/cstdio/.
2586
fab5b110
AD
25872002-01-03 Akim Demaille <akim@epita.fr>
2588
2589 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2590 for non system headers.
2591
aed7fd9b
AD
25922002-01-02 Akim Demaille <akim@epita.fr>
2593
2594 Equip the skeleton chain with location tracking, runtime trace,
2595 pure parser and scanner.
2596
2597 * src/parse-skel.y: Request a pure parser, locations, and prefix
2598 renaming.
2599 (%union): Having several members with the same type does not help
2600 type mismatches, simplify.
2601 (YYPRINT, yyprint): New.
2602 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2603 (skel_error): this.
2604 Handle locations.
2605 * src/scan-skel.l: Adjust to these changes.
2606 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2607 (LOCATION_PRINT, skel_control_t): New.
2608
24fad99e
AD
26092001-12-30 Akim Demaille <akim@epita.fr>
2610
2611 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2612 replace `gb' with BLANKS.
2613 * src/scan-skel.l: Adjust.
2614
a4b36db4
AD
26152001-12-30 Akim Demaille <akim@epita.fr>
2616
2617 * src/system.h: We don't need nor want bcopy.
2618 Throw away MS-DOS crap: we don't need getpid.
2619 * configure.in: We don't need strndup. It was even causing
2620 problems: because Flex includes the headers *before* us,
2621 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2622 not visible.
2623 * lib/xstrndup.c: New.
2624 * src/scan-skel.l: Use it.
2625 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2626 * src/parse-skel.y: Use %directives instead of #defines.
2627
1239777d
AD
26282001-12-30 Akim Demaille <akim@epita.fr>
2629
2630 * src/skeleton.h: New.
2631 * src/output.c (output_parser, output_master_parser): Remove, dead
2632 code.
2633 * src/output.h (get_lines_number, actions_output, guards_output)
2634 (token_definitions_output): Prototype them.
2635 * src/parse-skel.y: Add the license notice.
2636 Include output.h and skeleton.h.
2637 (process_skeleton): Returns void, and takes a single parameter.
2638 * src/scan-skel.l: Add the license notice.
2639 Include skeleton.h.
2640 Don't use %option yylineno: it seems that then Flex imagines
2641 REJECT has been used, and therefore it won't reallocate its
2642 buffers (which makes no other sense to me than a bug). It results
2643 in warnings for `unused: yy_flex_realloc'.
2644
9b3add5b
RA
26452001-12-30 Robert Anisko <robert.anisko@epita.fr>
2646
2647 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2648 (MUSCLE_INSERT_PREFIX): ...to there.
2649 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2650 (MUSCLE_INSERT_PREFIX): Move from here...
2651
2652 * src/bison.hairy: Add a section directive. Put braces around muscle
2653 names. This parser skeleton is still broken, but Bison should not
2654 choke on a bad muscle 'syntax'.
2655 * src/bison.simple: Add a section directive. Put braces around muscle
2656 names.
2657
2658 * src/files.h (strsuffix, stringappend): Add declarations.
2659 (tab_extension): Add declaration.
2660 (short_base_name): Add declaration.
2661
2662 * src/files.c (strsuffix, stringappend): No longer static. These
2663 functions are used in the skeleton parser.
2664 (tab_extension): New.
2665 (compute_base_names): Use the computations done in this function
fab5b110 2666 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
2667 names.
2668 (short_base_name): No longer static.
2669
2670 * src/output.c (output_skeleton): New.
2671 (output): Disable call to output_master_parser, and give a try to
2672 a new skeleton handling system.
2673 (guards_output, actions_output): No longer static.
2674 (token_definitions_output, get_lines_number): No longer static.
2675
2676 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2677
fab5b110 2678 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
2679 parse-skel.y.
2680
2681 * src/parse-skel.y: New file.
2682 * src/scan-skel.l: New file.
2683
b5b61c61
AD
26842001-12-29 Akim Demaille <akim@epita.fr>
2685
2686 %name-prefix is broken.
2687
2688 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2689 Adjust all dependencies.
2690 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2691 %name-prefix.
2692
2693 Renaming yylval but not yylloc is not consistent. Now we do.
2694
2695 * src/bison.simple: Prefix yylloc if used.
2696 * doc/bison.texinfo (Decl Summary): Document that.
2697
8c9a50be
AD
26982001-12-29 Akim Demaille <akim@epita.fr>
2699
2700 * doc/bison.texinfo: Promote `%long-directive' over
2701 `%long_directive'.
2702 Remove all references to fixed-output-files, yacc is enough.
2703
d99361e6
AD
27042001-12-29 Akim Demaille <akim@epita.fr>
2705
2706 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2707 user prologue. These are defaults.
2708 * tests/actions.at (Mid-rule actions): Make sure the user can
2709 define YYDEBUG and YYERROR_VERBOSE.
2710
b9cecb91
AD
27112001-12-29 Akim Demaille <akim@epita.fr>
2712
2713 * src/output.c (header_output): Don't forget to export YYLTYPE and
2714 yylloc.
2715 * tests/headers.at (export YYLTYPE): New, make sure it does.
2716 * tests/regression.at (%union and --defines, Invalid CPP headers):
2717 Move to...
2718 * tests/headers.at: here.
2719
aea13e97
AD
27202001-12-29 Akim Demaille <akim@epita.fr>
2721
2722 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2723
931394cb
AD
27242001-12-29 Akim Demaille <akim@epita.fr>
2725
2726 * tests/actions.at (Mid-rule actions): Output on a single line
2727 instead of several.
2728
704a47c4
AD
27292001-12-29 Akim Demaille <akim@epita.fr>
2730
2731 * doc/bison.texinfo: Formatting changes.
2732
091e20bb
AD
27332001-12-29 Akim Demaille <akim@epita.fr>
2734
2735 Don't store the token defs in a muscle, just be ready to output it
2736 on command. Now possible via `symbols'. Fixes a memory leak.
2737
2738 * src/output.c (token_definitions_output): New.
2739 (output_parser, header_output): Use it.
2740 * src/reader.c (symbols_save): Remove.
2741
cce71710
AD
27422001-12-29 Akim Demaille <akim@epita.fr>
2743
2744 * src/bison.simple: Do not provide a default for YYSTYPE and
2745 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2746 default.
2747
82c035a8
AD
27482001-12-29 Akim Demaille <akim@epita.fr>
2749
2750 Mid-rule actions are simply... ignored!
2751
2752 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2753 the empty-rule associated to the dummy symbol, not to the host
2754 rule.
2755 * tests/actions.at (Mid-rule actions): New.
2756
8419d367
AD
27572001-12-29 Akim Demaille <akim@epita.fr>
2758
2759 Memory leak.
2760
2761 * src/reader.c (reader): Free grammar.
2762
375d5806
AD
27632001-12-29 Akim Demaille <akim@epita.fr>
2764
2765 Memory leak.
2766
2767 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2768 since it allocates it for each state, although only one is needed.
2769 (allocate_storage): Do it here.
2770
f51cb8ff
AD
27712001-12-29 Akim Demaille <akim@epita.fr>
2772
2773 * src/options.h, src/options.c (create_long_option_table): Rename
2774 as...
2775 (long_option_table_new): this, with a clearer prototype.
2776 (percent_table): Remove, unused,
2777 * src/getargs.c (getargs): Adjust.
2778
29e88316
AD
27792001-12-29 Akim Demaille <akim@epita.fr>
2780
2781 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2782 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2783 as states.
2784
b9f71f19
AD
27852001-12-29 Akim Demaille <akim@epita.fr>
2786
2787 * src/lalr.c (build_relations): Rename `states' as `states1'.
2788 Sorry, I don't understand exactly what it is, no better name...
2789
1a2b5d37
AD
27902001-12-29 Akim Demaille <akim@epita.fr>
2791
2792 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2793 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2794 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2795 as rules.
2796
1cca533e
AD
27972001-12-29 Akim Demaille <akim@epita.fr>
2798
2799 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2800 ago.
2801
c03ae966
AD
28022001-12-29 Akim Demaille <akim@epita.fr>
2803
2804 * src/reader.c, src/reader.h (user_toknums): Remove.
2805 Adjust all users to use symbols[i]->user_token_number.
2806
5a670b1e
AD
28072001-12-29 Akim Demaille <akim@epita.fr>
2808
2809 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2810 Adjust all users to use symbols[i]->prec or ->assoc.
2811
ad949da9
AD
28122001-12-29 Akim Demaille <akim@epita.fr>
2813
2814 * src/reader.c, src/reader.h (tags): Remove.
2815 Adjust all users to use symbols[i]->tag.
2816
0e78e603
AD
28172001-12-29 Akim Demaille <akim@epita.fr>
2818
2819 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2820 and rule_table.
2821 * src/reader.c (packsymbols): Fill this table.
2822 Drop sprec.
2823 * src/conflicts.c (resolve_sr_conflict): Adjust.
2824 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2825 single table.
2826 Use symbols[i]->tag instead of tags[i].
2827
213e640e
AD
28282001-12-29 Akim Demaille <akim@epita.fr>
2829
2830 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2831 In addition, put a comment in there, to replace...
2832 * tests/regression.at (%union and C comments): Remove.
2833
e7b8bef1
AD
28342001-12-29 Akim Demaille <akim@epita.fr>
2835
2836 * tests/regression.at (Web2c Actions): Blindly move the actual
2837 output as expected output. The contents *seem* right to me, but I
2838 can't pretend reading perfectly parser tables... Nonetheless, all
2839 the other tests pass correctly, the table look OK, even though the
2840 presence of `$axiom' is to be noted: AFAICS it is useless (but
2841 harmless).
2842
b68e7744
AD
28432001-12-29 Akim Demaille <akim@epita.fr>
2844
2845 * src/reader.c (readgram): Don't add the rule 0 if there were no
2846 rules read. In other words, add it _after_ having performed
2847 grammar sanity checks.
2848 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2849
78d5bae9
AD
28502001-12-29 Akim Demaille <akim@epita.fr>
2851
2852 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2853 visible, and some states have now a different number.
2854
ff442794
AD
28552001-12-29 Akim Demaille <akim@epita.fr>
2856
2857 * src/reader.c (readgram): Bind the initial rule's lineno to that
2858 of the first rule.
2859 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2860 (Solved SR Conflicts): Adjust rule 0's line number.
2861
610ab194
AD
28622001-12-29 Akim Demaille <akim@epita.fr>
2863
2864 Fix the `GAWK Grammar' failure.
2865
2866 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2867 the reductions of the first state which was mistakenly confused
2868 with the final state because precisely final_state was initialized
2869 to 0.
2870 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2871 now noticed by Bison.
2872 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2873 have a reduction on $default.
2874
29d29c8f
AD
28752001-12-29 Akim Demaille <akim@epita.fr>
2876
2877 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2878 rule line numbers.
2879 * src/closure.c (print_closure): Likewise.
2880 * src/derives.c (print_derives): Likewise.
2881 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2882 now.
2883
7c6b64d0
AD
28842001-12-29 Akim Demaille <akim@epita.fr>
2885
2886 * src/lalr.c (lookaheads_print): New.
2887 (lalr): Call it when --trace-flag.
2888 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2889 are dumped.
2890
3d4daee3
AD
28912001-12-29 Akim Demaille <akim@epita.fr>
2892
2893 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2894 when walking through ritem, even via rule->rhs.
2895 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2896 (useful_production, useless_nonterminals): Likewise.
2897 (reduce_grammar_tables): Likewise, plus update nritems.
2898 * src/nullable.c (set_nullable): Likewise.
2899 * src/lalr.c (build_relations): Likewise.
2900 * tests/sets.at (Nullable): Adjust.
2901 Fortunately, now, the $axiom is no longer nullable.
2902
9e7f6bbd
AD
29032001-12-29 Akim Demaille <akim@epita.fr>
2904
2905 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2906 the 0-sentinel.
2907 * src/gram.c (ritem_longest_rhs): Likewise.
2908 * src/reduce.c (nonterminals_reduce): Likewise.
2909 * src/print_graph.c (print_graph): Likewise.
2910 * src/output.c (output_rule_data): Likewise.
2911 * src/nullable.c (set_nullable): Likewise.
2912
255ef638
AD
29132001-12-29 Akim Demaille <akim@epita.fr>
2914
2915 * src/output.c: Comment changes.
2916
0d8a7363
AD
29172001-12-27 Paul Eggert <eggert@twinsun.com>
2918
2919 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2920 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2921 Sparc, as they were causing more porting problems than the
2922 (minor) performance improvement was worth.
2923
2924 Also, catch up with 1.31's YYSTD.
2925
3db472b9
AD
29262001-12-27 Akim Demaille <akim@epita.fr>
2927
2928 * src/output.c (output_gram): Rely on nritems, not the
2929 0-sentinel. See below.
2930 Use -1 as separator, not 0.
2931 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2932 Rely on -1 as separator in yyrhs, instead of 0.
2933 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2934 twice `Now at end of input', therefore there are two lines less to
2935 expect.
2936
b365aa05
AD
29372001-12-27 Akim Demaille <akim@epita.fr>
2938
2939 * tests/regression.at (Unresolved SR Conflicts):
2940 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2941 below.
2942
30171f79
AD
29432001-12-27 Akim Demaille <akim@epita.fr>
2944
2945 * src/LR0.c (new_state): Recognize the final state by the fact it
2946 is reached by eoftoken.
2947 (insert_start_shifting_state, insert_eof_shifting_state)
2948 (insert_accepting_state, augment_automaton): Remove, since now
2949 these states are automatically computed from the initial state.
2950 (generate_states): Adjust.
2951 * src/print.c: When reporting a rule number to the user, substract
2952 1, so that the axiom rule is rule 0, and the first user rule is 1.
2953 * src/reduce.c: Likewise.
2954 * src/print_graph.c (print_core): For the time being, just as for
2955 the report, depend upon --trace-flags to dump the full set of
2956 items.
2957 * src/reader.c (readgram): Once the grammar read, insert the rule
2958 0: `$axiom: START-SYMBOL $'.
2959 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2960 number of the states has changed (the final state is no longer
2961 necessarily the last), catch up.
2962
75142d45
AD
29632001-12-27 Akim Demaille <akim@epita.fr>
2964
2965 Try to make the use of the eoftoken valid. Given that its value
2966 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2967 is used instead of > 0 where appropriate, (ii), depend upon nritems
2968 instead of the 0-sentinel.
2969
2970 * src/gram.h, src/gram.c (nritems): New.
2971 Expected to be duplication of nitems, but for the time being...
2972 * src/reader.c (packgram): Assert nritems and nitems are equal.
2973 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2974 * src/closure.c (print_closure, print_fderives): Likewise.
2975 * src/gram.c (ritem_print): Likewise.
2976 * src/print.c (print_core, print_grammar): Likewise.
2977 * src/print_graph.c: Likewise.
2978
b7c49edf
AD
29792001-12-27 Akim Demaille <akim@epita.fr>
2980
2981 * src/main.c (main): If there are complains after grammar
2982 reductions, then output the report anyway if requested, then die.
2983 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2984 * src/reader.c (eoftoken): New.
2985 (parse_token_decl): If the token being defined has value `0', it
2986 is the eoftoken.
2987 (packsymbols): No longer hack `tags' to insert `$' by hand.
2988 Be sure to preserve the value of the eoftoken.
2989 (reader): Make sure eoftoken is defined.
2990 Initialize nsyms to 0: now eoftoken is created just like the others.
2991 * src/print.c (print_grammar): Don't special case the eof token.
2992 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2993 lie anyway, albeit pleasant.
2994 * tests/calc.at: Exercise error messages with eoftoken.
2995 Change the grammar so that empty input is invalid.
2996 Adjust expectations.
2997 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2998
ec2da99f
AD
29992001-12-27 Akim Demaille <akim@epita.fr>
3000
3001 * configure.in: Check the protos of strchr ans strspn.
3002 Replace strchr if needed.
3003 * src/system.h: Provide the protos of strchr, strspn and memchr if
3004 missing.
3005 * lib/strchr.c: New.
3006 * src/reader.c (symbols_save): Use strchr.
3007
8adfa272
AD
30082001-12-27 Akim Demaille <akim@epita.fr>
3009
3010 * src/print.c, src/print_graph.c (escape): New.
3011 Use it to quote the TAGS outputs.
3012 * src/print_graph.c (print_state): Now errors are in red, and
3013 reductions in green.
3014 Prefer high to wide: output the state number on a line of its own.
3015
80dac38c
AD
30162001-12-27 Akim Demaille <akim@epita.fr>
3017
3018 * src/state.h, src/state.c (reductions_new): New.
3019 * src/LR0.c (set_state_table): Let all the states have a
3020 `reductions', even if reduced to 0.
3021 (save_reductions): Adjust.
3022 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
3023 * src/print.c (print_reductions, print_actions): Adjust.
3024 * src/output.c (action_row): Adjust.
3025
2cec70b9
AD
30262001-12-27 Akim Demaille <akim@epita.fr>
3027
3028 * src/state.h, src/state.c (errs_new, errs_dup): New.
3029 * src/LR0.c (set_state_table): Let all the states have an errs,
3030 even if reduced to 0.
3031 * src/print.c (print_errs, print_reductions): Adjust.
3032 * src/output.c (output_actions, action_row): Adjust.
3033 * src/conflicts.c (resolve_sr_conflict): Adjust.
3034
13ca549a
AD
30352001-12-27 Akim Demaille <akim@epita.fr>
3036
3037 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
3038
5092aba5
AD
30392001-12-27 Akim Demaille <akim@epita.fr>
3040
3041 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
3042 * src/print.c: here.
3043 (lookaheadset, shiftset): New, used as additional storage by
3044 print_reductions.
3045 (print_results): Adjust.
3046 (print_shifts, print_gotos, print_errs): New, extracted from...
3047 (print_actions): here.
3048 * src/print_graph.c (print_actions): Remove dead code.
3049
11e2beca
AD
30502001-12-27 Akim Demaille <akim@epita.fr>
3051
3052 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
3053 `$n' and `@n'.
3054
dac3c910
AD
30552001-12-27 Akim Demaille <akim@epita.fr>
3056
3057 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
3058 (build_relations): Adjust.
3059
d0b0fefa
AD
30602001-12-27 Akim Demaille <akim@epita.fr>
3061
3062 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
3063 duplication.
3064
adc8c848
AD
30652001-12-27 Akim Demaille <akim@epita.fr>
3066
3067 * src/reader.c (packgram): Catch nitems overflows.
3068
14d293ac
AD
30692001-12-27 Akim Demaille <akim@epita.fr>
3070
3071 * src/files.c, src/files.h (guard_obstack): Remove.
3072 * src/output.c (output): Adjust.
3073 * src/reader.c (parse_braces): New, factoring...
3074 (copy_action, copy_guard): these two which are renamed as...
3075 (parse_action, parse_guard): these.
3076 As a voluntary consequence, using braces around guards is now
3077 mandatory.
3078
f499b062
AD
30792001-12-27 Akim Demaille <akim@epita.fr>
3080
3081 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
3082 * src/reader.c (symbol_list): `guard' and `guard_line' are new
3083 members.
3084 (symbol_list_new): Adjust.
3085 (copy_action): action_line is the first line, not the last.
3086 (copy_guard): Just as for actions, store the `action' only, not
3087 the switch/case/break flesh.
3088 Don't parse the user action that might follow the guard, let...
3089 (readgram): do it, i.e., now, there can be an action after a
3090 guard.
3091 In other words the guard is just explicitly optional.
3092 (packgram): Adjust.
3093 * src/output.c (guards_output): New.
3094 (output_parser): Call it when needed.
3095 (output): Also free the guard and attrs obstacks.
3096 * src/files.c, src/files.h (obstack_save): Remove.
3097 (output_files): Remove.
3098 As a result, if one needs the former `.act' file, using an
3099 appropriate skeleton which requires actions and guards is now
3100 required.
3101 * src/main.c (main): Adjust.
3102 * tests/semantic.at: New.
3103 * tests/regression.at: Use `input.y' as input file name.
3104 Avoid 8+3 problems by requiring input.c when the test needs the
3105 parser.
3106
d945f5cd
AD
31072001-12-27 Akim Demaille <akim@epita.fr>
3108
3109 * src/reader.c (symbol_list_new): Be sure to initialize all the
3110 fields.
3111
d200e455
AD
31122001-12-27 Akim Demaille <akim@epita.fr>
3113
3114 All the hacks using a final pseudo state are now useless.
3115
3116 * src/LR0.c (set_state_table): state_table holds exactly nstates.
3117 * src/lalr.c (nLA): New.
3118 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
3119 instead of lookaheadsp from the pseudo state (nstate + 1).
3120
f9507c28
AD
31212001-12-27 Akim Demaille <akim@epita.fr>
3122
3123 * src/output.c (action_row, token_actions): Use a state_t instead
3124 of a integer, and nlookaheads instead of the following state's
3125 lookaheadsp.
3126
065fbd27
AD
31272001-12-27 Akim Demaille <akim@epita.fr>
3128
3129 * src/conflicts.c (log_resolution, flush_shift)
3130 (resolve_sr_conflict, set_conflicts, solve_conflicts)
3131 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
3132 (conflicts_print, print_reductions): Use a state_t instead of an
3133 integer when referring to a state.
3134 As much as possible, depend upon nlookaheads, instead of the
3135 `lookaheadsp' member of the following state (since lookaheads of
3136 successive states are successive, the difference between state n + 1
3137 and n served as the number of lookaheads for state n).
3138 * src/lalr.c (add_lookback_edge): Likewise.
3139 * src/print.c (print_core, print_actions, print_state)
3140 (print_results): Likewise.
3141 * src/print_graph.c (print_core, print_actions, print_state)
3142 (print_graph): Likewise.
3143 * src/conflicts.h: Adjust.
3144
1b177bd7
AD
31452001-12-27 Akim Demaille <akim@epita.fr>
3146
3147 * src/bison.hairy: Formatting/comment changes.
3148 ANSIfy.
3149 Remove `register' indications.
3150 Add plenty of `static'.
3151
7742ddeb
AD
31522001-12-27 Akim Demaille <akim@epita.fr>
3153
3154 * src/output.c (prepare): Drop the muscle `ntbase' which
3155 duplicates ntokens.
3156 * src/bison.simple: Formatting/comment changes.
3157 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
3158 is an undocumented synonym.
3159
1fa14068
AD
31602001-12-22 Akim Demaille <akim@epita.fr>
3161
3162 * src/output.c (output_table_data): Change the prototype to use
3163 `int' for array ranges: some invocations do pass an int, not a
3164 short.
3165 Reported by Wayne Green.
3166
b9752825
AD
31672001-12-22 Akim Demaille <akim@epita.fr>
3168
3169 Some actions of web2c.y are improperly triggered.
3170 Reported by Mike Castle.
3171
3172 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
3173 * tests/regression.at (Web2c): Rename as...
3174 (Web2c Report): this.
3175 (Web2c Actions): New.
3176
776209d6
AD
31772001-12-22 Akim Demaille <akim@epita.fr>
3178
3179 Reductions in web2c.y are improperly reported.
3180 Reported by Mike Castle.
3181
3182 * src/conflicts.c (print_reductions): Fix.
3183 * tests/regression.at (Web2c): New.
3184
275fc3ad
AD
31852001-12-18 Akim Demaille <akim@epita.fr>
3186
3187 Some host fail on `assert (!"foo")', which expands to
3188 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
3189 Reported by Nelson Beebee.
3190
3191 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
3192 `#define it_succeeded 0' and `assert (it_succeeded)'.
3193
897668ee
MA
31942001-12-17 Marc Autret <autret_m@epita.fr>
3195
3196 * src/bison.simple: Don't hard code the skeleton line and filename.
3197 * src/output.c (output_parser): Rename 'line' as 'output_line'.
3198 New line counter 'skeleton_line' (skeleton-line muscle).
3199
ab3399e0
PE
32002001-12-17 Paul Eggert <eggert@twinsun.com>
3201
3202 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3203 YYDEBUG must be defined to a nonzero value.
3204
3205 * src/bison.simple (yytname): Do not assume that the user defines
3206 YYDEBUG to a properly parenthesized expression.
3207
3877f72b
AD
32082001-12-17 Akim Demaille <akim@epita.fr>
3209
3210 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3211 nlookaheads is a new member.
3212 Adjust all users.
3213 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3214 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3215 state.
776209d6 3216
331dbc1b
AD
32172001-12-17 Akim Demaille <akim@epita.fr>
3218
3219 * src/files.h, src/files.c (open_files, close_files): Remove.
3220 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3221 let...
3222 * src/reader.c (reader): Do it.
776209d6 3223
be750e4c
AD
32242001-12-17 Akim Demaille <akim@epita.fr>
3225
3226 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 3227
709ae8c6
AD
32282001-12-17 Akim Demaille <akim@epita.fr>
3229
3230 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3231 (flush_reduce): New.
3232 (resolve_sr_conflict): Adjust.
776209d6 3233
f87685c3
AD
32342001-12-17 Akim Demaille <akim@epita.fr>
3235
3236 * src/output.c (output_obstack): Be static and rename as...
3237 (format_obstack): this, to avoid any confusion with files.c's
3238 output_obstack.
3239 * src/reader.h (muscle_obstack): Move to...
3240 * src/output.h: here, since it's defined in output.c.
3241
837491d8
AD
32422001-12-17 Akim Demaille <akim@epita.fr>
3243
3244 * src/output.c (action_row, save_column, default_goto)
3245 (sort_actions, matching_state, pack_vector): Better variable
3246 locality.
3247
796d61fb
AD
32482001-12-17 Akim Demaille <akim@epita.fr>
3249
3250 * src/output.c: Various formatting changes.
776209d6 3251
64d15509
AD
32522001-12-17 Akim Demaille <akim@epita.fr>
3253
3254 * src/files.c (output_files): Free the output_obstack.
3255 * src/main.c (main): Call print and print_graph conditionally.
3256 * src/print.c (print): Work unconditionally.
3257 * src/print_graph.c (print_graph): Work unconditionally.
3258 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3259
fbc8ecb7
MA
32602001-12-16 Marc Autret <autret_m@epita.fr>
3261
3262 * src/output.c (actions_output): Fix. When we use %no-lines,
3263 there is one less line per action.
3264
f0440388
MA
32652001-12-16 Marc Autret <autret_m@epita.fr>
3266
3267 * src/bison.simple: Remove a useless #line directive.
3268 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3269 * src/output.c (get_lines_number): New.
776209d6 3270 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
3271 output muscles.
3272 Fix line numbering.
3273 (actions_output): Computes the number of lines taken by actions.
3274 (output_master_parser): Insert new skeleton which is the name of
3275 the output parser file name.
3276
a79986b8
MA
32772001-12-15 Marc Autret <autret_m@epita.fr>
3278
3279 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3280
4ec8e00f
MA
32812001-12-15 Marc Autret <autret_m@epita.fr>
3282
3283 * src/output.c (output_gram): Keep track of the hairy one.
3284
1a4648ff
AD
32852001-12-15 Akim Demaille <akim@epita.fr>
3286
3287 Make `make distcheck' work.
3288
3289 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3290 system.h which uses libgettext.h.
3291
9c2c67e6
AD
32922001-12-15 Akim Demaille <akim@epita.fr>
3293
3294 * src/nullable.c (set_nullable): Useless rules must be skipped,
3295 otherwise, since we range over their symbols, we might look at a
3296 nonterminal which no longer ``exists'', i.e., it is not counted in
3297 `nvars', hence we overflow our arrays.
3298
93ede233
AD
32992001-12-15 Akim Demaille <akim@epita.fr>
3300
3301 The header can also be produced directly, without any obstack!
3302 Yahoo!
3303
3304 * src/files.c, src/files.h (defines_obstack): Remove.
3305 (compute_header_macro): Global.
3306 (defines_obstack_save): Remove.
3307 * src/reader.c (parse_union_decl): No longer output to
3308 defines_obstack: its content can be found in the `stype' muscle
3309 anyway.
3310 (output_token_translations): Merge into...
3311 (symbols_output): this.
3312 Rename as...
3313 (symbols_save): this.
3314 (reader): Adjust.
3315 * src/output.c (header_output): New.
3316 (output): Call it.
3317
2666f928
AD
33182001-12-15 Akim Demaille <akim@epita.fr>
3319
3320 * src/reader.c (parse_union_decl): Instead of handling two obstack
3321 simultaneously, use one to define the `stype' muscle, and use the
3322 value of the latter to fill defines_obstack.
3323 (copy_comment): Remove.
3324 (copy_comment2): Work for a single obstack.
3325 Rename as...
3326 (copy_comment): this.
3327
428046f8
AD
33282001-12-15 Akim Demaille <akim@epita.fr>
3329
3330 * src/lex.c, src/lex.h (xgetc): No longer static.
3331 * src/reader.c (parse_union_decl): Revamp.
3332
ea52d706
AD
33332001-12-15 Akim Demaille <akim@epita.fr>
3334
3335 Still making progress in separating Bison into (i) input, (ii)
3336 process, (iii) output: now we can directly output the parser file
3337 without using table_obstack at all.
3338
3339 * src/files.c, src/files.h (table_obstack): Bye bye.
3340 (parser_file_name): New.
3341 * src/files.c (compute_output_file_names): Compute it.
3342 * src/output.c (actions_output, output_parser)
3343 (output_master_parser): To a file instead of an obstack.
3344
3f96f4dc
AD
33452001-12-15 Akim Demaille <akim@epita.fr>
3346
3347 Attach actions to rules, instead of pre-outputting them to
3348 actions_obstack.
3349
3350 * src/gram.h (rule_t): action and action_line are new members.
3351 * src/reader.c (symbol_list): Likewise.
3352 (copy_action): Save the actions within the rule.
3353 (packgram): Save them in rule_table.
3354 * src/output.c (actions_output): New.
3355 (output_parser): Use it on `%%actions'.
3356 (output_rule_data): Don't free rule_table.
3357 (output): Do it.
3358 (prepare): Don't save the `action' muscle.
3359 * src/bison.simple: s/%%action/%%actions/.
3360
51576fb3
AD
33612001-12-15 Akim Demaille <akim@epita.fr>
3362
3363 * src/reader.c (copy_action): When --yacc, don't append a `;'
3364 to the user action: let it fail if lacking.
dee049eb 3365 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 3366
2648a72d
AD
33672001-12-14 Akim Demaille <akim@epita.fr>
3368
3369 * src/lex.c (literalchar): Simply return the char you decoded, non
3370 longer mess around with obstacks and int pointers.
3371 Adjust all callers.
3372
92790e5b
AD
33732001-12-14 Akim Demaille <akim@epita.fr>
3374
3375 * src/lex.c (literalchar): Don't escape the special characters,
3376 just decode them, and keep them as char (before, eol was output as
3377 the 2 char string `\n' etc.).
3378 * src/output.c (output_rule_data): Use quotearg to output the
3379 token strings.
3380
927c1557
PE
33812001-12-13 Paul Eggert <eggert@twinsun.com>
3382
3383 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3384 Do not infringe on the global user namespace when using C++.
3385 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3386 All uses of `fprintf' and `stderr' changed.
3387
3388 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3389
ed8e1f68
AD
33902001-12-13 Akim Demaille <akim@epita.fr>
3391
3392 The computation of nullable is broken: it doesn't handle empty
3393 RHS's properly.
3394
3395 * tests/torture.at (GNU AWK Grammar): New.
3396 * tests/sets.at (Nullable): New.
3397 * src/nullable.c (set_nullable): Instead of blindly looping over
3398 `ritems', loop over the rules, and then over their rhs's.
3399
3400 Work around Autotest bugs.
3401
3402 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3403 frame, because Autotest understand lines starting with a `+' as
3404 traces from the shell. Then, they are not processed properly.
3405 Admittedly an Autotest bug, but we don't have time to wait for
3406 Autotest to catch up.
3407 * tests/regression.at (Broken Closure): Adjust to the new table
3408 frames.
3409 Move to...
3410 * tests/sets.at: here.
3411
cb581495
AD
34122001-12-13 Akim Demaille <akim@epita.fr>
3413
3414 * src/closure.c (closure): Use nrules instead of playing tricks
3415 with BITS_PER_WORD.
3416
2e729273
AD
34172001-12-13 Akim Demaille <akim@epita.fr>
3418
3419 * src/print.c (print_actions): Output the handling of `$' as the
3420 traces do: shifting the token EOF. Before EOF was treated as a
3421 nonterminal.
3422 * tests/regression.at: Adjust some tests.
3423 * src/print_graph.c (print_core): Complete the set of items via
3424 closure. The next-to-final and final states are still unsatisfying,
3425 but that's to be addressed elsewhere.
3426 No longer output the rule numbers, but do output the state number.
3427 A single loop for the shifts + gotos is enough, but picked a
3428 distinct color for each.
3429 (print_graph): Initialize and finalize closure.
3430
107f7dfb
AD
34312001-12-13 Akim Demaille <akim@epita.fr>
3432
3433 * src/reader.c (readgram): Remove dead code, an strip useless
3434 braces.
3435 (get_type): Remove, unused.
3436
9b53a24f
AD
34372001-12-12 Akim Demaille <akim@epita.fr>
3438
3439 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3440 on that of lib/error.c.
3441
dbfb6dcd
AD
34422001-12-12 Akim Demaille <akim@epita.fr>
3443
3444 Some hosts don't like `/' in includes.
3445
3446 * src/system.h: Include libgettext.h without qualifying the path.
3447 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3448 $(top_srcdir).
3449
c25fb648
MA
34502001-12-11 Marc Autret <autret_m@epita.fr>
3451
3452 * src/output.c (output_parser): Remove useless muscle.
3453
710ddc4f
MA
34542001-12-11 Marc Autret <autret_m@epita.fr>
3455
3456 * src/bison.simple: Remove #line just before %%epilogue. It
3457 is now handled in ...
3458 * src/reader.c (read_additionnal_code): Add the output of a
3459 #line for the epilogue.
3460
e83d80b8
MA
34612001-12-10 Marc Autret <autret_m@epita.fr>
3462
927c1557 3463 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
3464 replace precedent remove.
3465 * src/bison.simple: Remove #line before %%prologue because
3466 %%input-line is wrong at this time.
3467
971d5158
MA
34682001-12-10 Marc Autret <autret_m@epita.fr>
3469
3470 * src/reader.c (symbols_output): Clean up.
927c1557 3471 * src/output.c (output_gram, output): Clean up.
971d5158 3472
5edafffd
AD
34732001-12-10 Akim Demaille <akim@epita.fr>
3474
3475 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3476 * src/LR0.c (set_state_table): here.
3477 * src/lalr.c (lalr): Call it.
3478
0279f8e9
AD
34792001-12-10 Akim Demaille <akim@epita.fr>
3480
3481 * src/state.h (shifts): Remove the `number' member: shifts are
3482 attached to state, hence no longer need to be labelled with a
3483 state number.
3484
190c4f5f
AD
34852001-12-10 Akim Demaille <akim@epita.fr>
3486
3487 Now that states have a complete set of members, the linked list of
3488 shifts is useless: just fill directly the state's shifts member.
3489
3490 * src/state.h (shifts): Remove the `next' member.
3491 * src/LR0.c (first_state, last_state): Remove.
3492 Adjust the callers.
3493 (augment_automaton): Don't look for the shifts that must be added
3494 a shift on EOF: it is those of the state we looked for! But now,
3495 since shifts are attached, it is no longer needed to looking
3496 merely by its id: its number.
3497
2a73b93d
AD
34982001-12-10 Akim Demaille <akim@epita.fr>
3499
3500 * src/LR0.c (augment_automaton): Better variable locality.
3501 Remove an impossible branch: if there is a state corresponding to
3502 the start symbol being shifted, then there is shift for the start
3503 symbol from the initial state.
3504
74392f6a
AD
35052001-12-10 Akim Demaille <akim@epita.fr>
3506
3507 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3508 only when appropriate: when insert_start_shifting_state' is not
3509 invoked.
3510 * tests/regression.at (Rule Line Numbers): Adjust.
3511
37c82725
AD
35122001-12-10 Akim Demaille <akim@epita.fr>
3513
3514 * src/LR0.c (augment_automaton): Now that all states have shifts,
3515 merge the two cases addition shifts to the initial state.
3516
6a164e0c
AD
35172001-12-10 Akim Demaille <akim@epita.fr>
3518
3519 * src/lalr.c (set_state_table): Move to...
3520 * src/LR0.c: here.
3521 * src/lalr.c (lalr): Don't call it...
3522 * src/LR0.c (generate_states): do it.
3523 * src/LR0.h (first_state): Remove, only the table is used.
3524
7215de24
AD
35252001-12-10 Akim Demaille <akim@epita.fr>
3526
3527 * src/LR0.h (first_shift, first_reduction): Remove.
3528 * src/lalr.c: Don't use first_shift: find shifts through the
3529 states.
3530
80e25d4d
AD
35312001-12-10 Akim Demaille <akim@epita.fr>
3532
3533 * src/LR0.c: Attach shifts to states as soon as they are
3534 computed.
3535 * src/lalr.c (set_state_table): Instead of assigning shifts to
3536 state, just assert that the mapping was properly done.
3537
0ab3728b
AD
35382001-12-10 Akim Demaille <akim@epita.fr>
3539
3540 * src/LR0.c (insert_start_shift): Rename as...
3541 (insert_start_shifting_state): this.
3542 (insert_eof_shifting_state, insert_accepting_state): New.
3543 (augment_automaton): Adjust.
3544 Better locality of the variables.
3545 When looking if the start_symbol is shifted from the initial
3546 state, using `while (... symbol != start_symbol ...)' sounds
3547 better than `while (... symbol < start_symbol ...)': If fail
3548 to see how the order between symbols could be relevant!
3549
78af9bbc
AD
35502001-12-10 Akim Demaille <akim@epita.fr>
3551
3552 * src/getargs.h: Don't declare `spec_name_prefix' and
3553 `spec_file_prefix', declared by src/files.h.
3554 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3555 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3556 * src/output.c (prepare): Adjust.
3557 * src/reader.c (symbols_output): Likewise.
3558 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3559
bdef2a41
AD
35602001-12-10 Akim Demaille <akim@epita.fr>
3561
3562 * src/muscle_tab.c (muscle_init): NULL is a better default than
3563 `"0"'.
3564
3735969c
AD
35652001-12-10 Akim Demaille <akim@epita.fr>
3566
3567 * src/reader.c (reader): Calling symbols_output once is enough.
3568
49701457
AD
35692001-12-10 Akim Demaille <akim@epita.fr>
3570
3571 Now that states have a complete set of members, the linked list of
3572 reductions is useless: just fill directly the state's reductions
3573 member.
3574
3575 * src/state.h (struct reductions): Remove member `number' and
3576 `next'.
3577 * src/LR0.c (first_reduction, last_reduction): Remove.
3578 (save_reductions): Don't link the new reductions, store them in
3579 this_state.
3580 * src/lalr.c (set_state_table): No need to attach reductions to
3581 states, it's already done.
3582 * src/output.c (output_actions): No longer free the shifts, then
3583 the reductions, then the states: free all the states and their
3584 members.
3585
0edad749
AD
35862001-12-10 Akim Demaille <akim@epita.fr>
3587
3588 * src/options.c (OPTN, DRTV, BOTH): New.
3589 (option_table): Use them.
3590
0edad749
AD
3591 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3592 the job of system.h.
3593 * src/options.c: Don't include stdio.h and xalloc.h for the same
3594 reasons.
3595
5449dd0f
AD
35962001-12-10 Akim Demaille <akim@epita.fr>
3597
3598 * src/output.c (output, prepare): Make sure the values of the
3599 muscles `action' and `prologue' are 0-terminated.
3600
a870c567
AD
36012001-12-10 Akim Demaille <akim@epita.fr>
3602
3603 Clean up GCC warnings.
3604
3605 * src/reader.c (copy_action): `buf' is not used.
3606 (parse_skel_decl): Be static.
3607 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3608 * src/options.h (create_long_option_table): Have a real prototype.
3609 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3610 (hash_delete_at): Return const void *.
3611 Adjust casts to preserve the const.
3612
80df8768
AD
36132001-12-10 Akim Demaille <akim@epita.fr>
3614
3615 * configure.in: Require 2.52g.
3616 M4 is not needed, but AUTOM4TE is.
3617 * m4/m4.m4: Remove.
3618 * tests/Makefile.am: Adjust.
3619
f693ad14
AD
36202001-12-10 Akim Demaille <akim@epita.fr>
3621
3622 One structure for states is enough, even though theoretically
3623 there are LR(0) states and LALR(1) states.
3624
3625 * src/lalr.h (state_t): Remove.
3626 (state_table): Be state_t **, not state_t *.
3627 * src/state.h (core, CORE_ALLOC): Rename as...
3628 (state_t, STATE_ALLOC): this.
3629 Add the LALR(1) members: shifts, reductions, errs.
3630 * src/LR0.c (state_table): Rename as...
3631 (state_hash): this, to avoid name clashes with the global
3632 `state_table'.
3633 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3634 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3635
74ffbcb6
AD
36362001-12-10 Akim Demaille <akim@epita.fr>
3637
3638 Bison dumps core on bash.y.
3639 Reported by Pascal Bart.
3640
3641 * src/warshall.c (bitmatrix_print): New.
3642 (TC): Use it.
3643 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3644 j must be the outer loop.
3645 * tests/regression.at (Broken Closure): New.
3646
07708e19
AD
36472001-12-05 Akim Demaille <akim@epita.fr>
3648
3649 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3650 its argument.
3651