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