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