]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/parse-gram.y (rules_or_grammar_declaration): Add an error
[bison.git] / ChangeLog
CommitLineData
b275314e
AD
12002-07-09 Akim Demaille <akim@epita.fr>
2
3 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
4 recovery rule, and forbid extensions when --yacc.
5 (gram_error): Use complain_at.
6 * src/reader.c (reader): Exit if there were parse errors.
7
865b9df1
AD
82002-07-09 Akim Demaille <akim@epita.fr>
9
10 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
11 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12 Reported by R Blake <blakers@mac.com>.
13
c76e14da
AD
142002-07-09 Akim Demaille <akim@epita.fr>
15
16 * data/yacc.c: Output the copyright notive in the header.
17
7db2ed2d
AD
182002-07-03 Akim Demaille <akim@epita.fr>
19
20 * src/output.c (froms, tos): Are state_number_t.
21 (save_column): sp, sp1, and sp2 are state_number_t.
22 (prepare): Rename `final' as `final_state_number', `nnts' as
23 `nterms_number', `nrules' as `rules_number', `nstates' as
24 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
25 unused.
26 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
27 * data/lalr1.cc (nsym_): Remove, unused.
28
e68e0410
AD
292002-07-03 Akim Demaille <akim@epita.fr>
30
31 * src/lalr.h, src/lalr.c (goto_number_t): New.
32 * src/lalr.c (goto_list_t): New.
33 Propagate them.
34 * src/nullable.c (rule_list_t): New.
35 Propagate.
36 * src/types.h: Remove.
37
e1a4f3a4
AD
382002-07-03 Akim Demaille <akim@epita.fr>
39
40 * src/closure.c (print_fderives): Use rule_rhs_print.
41 * src/derives.c (print_derives): Use rule_rhs_print.
42 (rule_list_t): New, replaces `shorts'.
43 (set_derives): Add comments.
44 * tests/sets.at (Nullable, Firsts): Adjust.
45
536545f3
AD
462002-07-03 Akim Demaille <akim@epita.fr>
47
48 * src/output.c (prepare_actions): Free `tally' and `width'.
49 (prepare_actions): Allocate and free `order'.
50 * src/symtab.c (symbols_free): Free `symbols'.
51 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
52 * src/output.c (m4_invoke): Move to...
53 * src/scan-skel.l: here.
54 (<<EOF>>): Close yyout, and free its name.
55
8b752b00
AD
562002-07-03 Akim Demaille <akim@epita.fr>
57
58 Fix some memory leaks, and fix a bug: state 0 was examined twice.
59
60 * src/LR0.c (new_state): Merge into...
61 (state_list_append): this.
62 (new_states): Merge into...
63 (generate_states): here.
64 (set_states): Don't ensure a proper `errs' state member here, do it...
65 * src/conflicts.c (conflicts_solve): here.
66 * src/state.h, src/state.c: Comment changes.
67 (state_t): Rename member `shifts' as `transitions'.
68 Adjust all dependencies.
69 (errs_new): For consistency, also take the values as argument.
70 (errs_dup): Remove.
71 (state_errs_set): New.
72 (state_reductions_set, state_transitions_set): Assert that no
73 previous value was assigned.
74 (state_free): New.
75 (states_free): Use it.
76 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
77 temporary storage: use `errs' and `nerrs' as elsewhere.
78 (set_conflicts): Allocate and free this `errs'.
79
613f5e1a
AD
802002-07-02 Akim Demaille <akim@epita.fr>
81
82 * lib/libiberty.h: New.
83 * lib: Update the bitset implementation from upstream.
84 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
85 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
86 * src/main.c: Adjust bitset stats calls.
87
26e0cadc
PE
882002-07-01 Paul Eggert <eggert@twinsun.com>
89
90 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
91 char, so that negative chars don't collide with $.
92
1154cced
AD
932002-06-30 Akim Demaille <akim@epita.fr>
94
95 Have the GLR tests be `warning' checked, and fix the warnings.
96
97 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
98 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
99 (yyremoveDeletes): `yyi' and `yyj' are size_t.
100 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
101 (yyaddDeferredAction): static.
102 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
103 (yyreportParseError): yyprefix is const.
104 yytokenp is used only when verbose.
105 (yy__GNUC__): Replace with __GNUC__.
106 (yypdumpstack): yyi is size_t.
107 (yypreference): Un-yy local variables and arguments, to avoid
108 clashes with `yyr1'. Anyway, we are not in the user name space.
109 (yytname_size): be an int, as is compared with ints.
110 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
111 Use them.
112 * tests/cxx-gram.at: Use quotation to protect $1.
113 Use AT_COMPILE to enable warnings hunts.
114 Prototype yylex and yyerror.
115 `Use' argc.
116 Include `string.h', not `strings.h'.
117 Produce and prototype stmtMerge only when used.
118 yylex takes a location.
119
97650f4e
AD
1202002-06-30 Akim Demaille <akim@epita.fr>
121
122 We spend a lot of time in quotearg, in particular when --verbose.
123
124 * src/symtab.c (symbol_get): Store a quoted version of the key.
125 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
126 Adjust all callers.
127
d2576365
AD
1282002-06-30 Akim Demaille <akim@epita.fr>
129
130 * src/state.h (reductions_t): Rename member `nreds' as num.
131 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
132 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
133
ccaf65bc
AD
1342002-06-30 Akim Demaille <akim@epita.fr>
135
136 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
137 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
138 (shifts_to): Rename as...
139 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
140 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
141 (TRANSITION_IS_DISABLED, transitions_to): these.
142
87675353
AD
1432002-06-30 Akim Demaille <akim@epita.fr>
144
145 * src/print.c (print_shifts, print_gotos): Merge into...
146 (print_transitions): this.
147 (print_transitions, print_errs, print_reductions): Align the
148 lookaheads columns.
149 (print_core, print_transitions, print_errs, print_state,
150 print_grammar): Output empty lines separator before, not after.
151 (state_default_rule_compute): Rename as...
152 (state_default_rule): this.
153 * tests/conflicts.at (Defaulted Conflicted Reduction),
154 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
155 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
156
ce4ccb4b
AD
1572002-06-30 Akim Demaille <akim@epita.fr>
158
159 Display items as we display rules.
160
161 * src/gram.h, src/gram.c (rule_lhs_print): New.
162 * src/gram.c (grammar_rules_partial_print): Use it.
163 * src/print.c (print_core): Likewise.
164 * tests/conflicts.at (Defaulted Conflicted Reduction),
165 (Unresolved SR Conflicts): Adjust.
166 (Unresolved SR Conflicts): Adjust and rename as...
167 (Resolved SR Conflicts): this, as was meant.
168 * tests/regression.at (Web2c Report): Adjust.
169
bc933ef1
AD
1702002-06-30 Akim Demaille <akim@epita.fr>
171
172 * src/print.c (state_default_rule_compute): New, extracted from...
173 (print_reductions): here.
174 Pessimize, but clarify the code.
175 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
176
53d4308d
AD
1772002-06-30 Akim Demaille <akim@epita.fr>
178
179 * src/output.c (action_row): Let default_rule be always a rule
180 number.
181
574fb2d5
AD
1822002-06-30 Akim Demaille <akim@epita.fr>
183
184 * src/closure.c (print_firsts, print_fderives, closure):
185 Use BITSET_EXECUTE.
186 * src/lalr.c (lookaheads_print): Likewise.
187 * src/state.c (state_rule_lookaheads_print): Likewise.
188 * src/print_graph.c (print_core): Likewise.
189 * src/print.c (print_reductions): Likewise.
190 * src/output.c (action_row): Likewise.
191 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
192
05811fd7
AD
1932002-06-30 Akim Demaille <akim@epita.fr>
194
195 * src/print_graph.c: Use report_flag.
196
0e4d5753
AD
1972002-06-30 Akim Demaille <akim@epita.fr>
198
199 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
200 to...
201 * src/relation.h, src/relation.c (traverse, relation_digraph)
202 (relation_print, relation_transpose): New.
203
24c7d800
AD
2042002-06-30 Akim Demaille <akim@epita.fr>
205
206 * src/state.h, src/state.c (shifts_to): New.
207 * src/lalr.c (build_relations): Use it.
208
9222837b
AD
2092002-06-30 Akim Demaille <akim@epita.fr>
210
211 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
212 (item_number_of_rule_number, rule_number_of_item_number): New.
213 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
214 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
215 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
216 Propagate their use.
217 Much remains to be done, in particular wrt `shorts' from types.h.
218
260008e5
AD
2192002-06-30 Akim Demaille <akim@epita.fr>
220
221 * src/symtab.c (symbol_new): Initialize the `printer' member.
222
8a731ca8
AD
2232002-06-30 Akim Demaille <akim@epita.fr>
224
225 * src/LR0.c (save_reductions): Remove, replaced by...
226 * src/state.h, src/state.c (state_reductions_set): New.
227 (reductions, errs): Rename as...
228 (reductions_t, errs_t): these.
229 Adjust all dependencies.
230
32e1e0a4
AD
2312002-06-30 Akim Demaille <akim@epita.fr>
232
233 * src/LR0.c (state_list_t, state_list_append): New.
234 (first_state, last_state): Now symbol_list_t.
235 (this_state): Remove.
236 (new_itemsets, append_states, save_reductions): Take a state_t as
237 argument.
238 (set_states, generate_states): Adjust.
239 (save_shifts): Remove, replaced by...
240 * src/state.h, src/state.c (state_shifts_set): New.
241 (shifts): Rename as...
242 (shifts_t): this.
243 Adjust all dependencies.
244 * src/state.h (state_t): Remove the `next' member.
245
e5fb6710
AD
2462002-06-30 Akim Demaille <akim@epita.fr>
247
248 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
249 escaped in slot 0.
250
c7ca99d4
AD
2512002-06-30 Akim Demaille <akim@epita.fr>
252
253 Use hash.h for the state hash table.
254
255 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
256 (allocate_storage): Use state_hash_new.
257 (free_storage): Use state_hash_free.
258 (new_state, get_state): Adjust.
259 * src/lalr.h, src/lalr.c (states): Move to...
260 * src/states.h (state_t): Remove the `link' member, no longer
261 used.
262 * src/states.h, src/states.c: here.
263 (state_hash_new, state_hash_free, state_hash_lookup)
264 (state_hash_insert, states_free): New.
265 * src/states.c (state_table, state_compare, state_hash): New.
266 * src/output.c (output_actions): Do not free states now, since we
267 still need to know the final_state number in `prepare', called
268 afterwards. Do it...
269 * src/main.c (main): here: call states_free after `output'.
270
df0e7316
AD
2712002-06-30 Akim Demaille <akim@epita.fr>
272
273 * src/state.h, src/state.c (state_new): New, extracted from...
274 * src/LR0.c (new_state): here.
275 * src/state.h (STATE_ALLOC): Move to...
276 * src/state.c: here.
277 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
278 * src/state.h, src/state.c: here.
279
39f41916
AD
2802002-06-30 Akim Demaille <akim@epita.fr>
281
282 * src/reader.c (gensym): Rename as...
283 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
284 (getsym): Rename as...
285 (symbol_get): this.
286
d57650a5
AD
2872002-06-30 Akim Demaille <akim@epita.fr>
288
289 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
290 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
291 * src/output.c, src/print.c, src/print_graph.c: Propagate.
292 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
293
5a08f1ce
AD
2942002-06-30 Akim Demaille <akim@epita.fr>
295
296 Make the test suite pass with warnings checked.
297
298 * tests/actions.at (Printers and Destructors): Improve.
299 Avoid unsigned vs. signed issues.
300 * tests/calc.at: Don't exercise the scanner here, do it...
301 * tests/input.at (Torturing the Scanner): here.
302
720623af
PH
3032002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
304
88e7e941 305 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
306 reorganize first lines parallel to yacc.c.
307
fb8135fa
AD
3082002-06-28 Akim Demaille <akim@epita.fr>
309
310 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
311 (b4_token_enum, b4_token_defines): New, factored from...
312 * data/lalr1.cc, data/yacc.c, glr.c: here.
313
41442480
AD
3142002-06-28 Akim Demaille <akim@epita.fr>
315
316 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
317 unused variables.
318 * src/output.c (merger_output): static.
319
e0e5bf84
AD
3202002-06-28 Akim Demaille <akim@epita.fr>
321
322 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
323 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
324 pacify GCC.
325 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 326
676385e2
PH
3272002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
328
329 Accumulated changelog for new GLR parsing features.
330
e0e5bf84 331 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
332 conflicts_total_count.
333 * src/conflicts.h: Ditto.
334 * src/output.c (token_actions): Use the new name.
335 (output_conflicts): Change conflp => conflict_list_heads, and
336 confl => conflict_list for better readability.
337 * data/glr.c: Use the new names.
338 * NEWS: Add self to GLR announcement.
e0e5bf84 339
676385e2
PH
340 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
341
342 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
343 Akim Demaille.
344
345 * data/bison.glr: Change name to glr.c
346 * data/glr.c: Renamed from bison.glr.
347 * data/Makefile.am: Add glr.c
e0e5bf84
AD
348
349 * src/getargs.c:
350
676385e2
PH
351 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
352 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 353
676385e2
PH
354 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
355
356 * data/bison.glr: Be sure to restore the
357 current #line when returning to the skeleton contents after having
358 exposed the input file's #line.
359
360 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
361
362 * data/bison.glr: Bring up to date with changes to bison.simple.
363
364 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
365
366 * data/bison.glr: Correct definitions that use b4_prefix.
367 Various reformatting.
368 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
369 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
370 yytokenp argument; now part of stack.
371 (yychar): Define to behave as documented.
372 (yyclearin): Ditto.
e0e5bf84 373
676385e2
PH
374 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
375
376 * src/reader.h: Add declaration for free_merger_functions.
377
378 * src/reader.c (merge_functions): New variable.
379 (get_merge_function): New function.
380 (free_merger_functions): New function.
381 (readgram): Check for %prec that is not followed by a symbol.
382 Handle %dprec and %merge declarations.
383 (packgram): Initialize dprec and merger fields in rules array.
384
385 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
386 conflict_list_cnt, conflict_list_free): New variables.
387 (table_grow): Also grow conflict_table.
e0e5bf84 388 (prepare_rules): Output dprec and merger tables.
676385e2 389 (conflict_row): New function.
e0e5bf84 390 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
391 default reduction in conflicted states for GLR parser so that there
392 are spaces for the conflict lists.
393 (save_row): Also save conflict information.
394 (token_actions): Allocate conflict list.
395 (merger_output): New function.
396 (pack_vector): Pack conflict table, too.
397 (output_conflicts): New function to output yyconflp and yyconfl.
398 (output_check): Allocate conflict_tos.
399 (output_actions): Output conflict tables, also.
400 (output_skeleton): Output b4_mergers definition.
401 (prepare): Output b4_max_rhs_length definition.
402 Use 'bison.glr' as default skeleton for GLR parsers.
403
404 * src/gram.c (glr_parser): New flag.
405 (grammar_free): Call free_merger_functions.
406
407 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
408 all pairs of conflicting reductions, rather than just all tokens
409 causing conflicts. Needed to size conflict tables.
e0e5bf84 410 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
411 interface.
412 (conflicts_print): Ditto.
413 (count_total_conflicts): New function.
414
415 * src/reader.h (merger_list): New type.
416 (merge_functions): New variable.
417
418 * src/lex.h (tok_dprec, tok_merge): New token types.
419
420 * src/gram.h (rule_s): Add dprec and merger fields.
421 (glr_parser): New flag.
422
423 * src/conflicts.h (count_total_conflicts): New function.
424
425 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
426
427 * doc/bison.texinfo (Generalized LR Parsing): New section.
428 (GLR Parsers): New section.
429 (Language and Grammar): Mention GLR parsing.
430 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
431 Correct typo ("tge" -> "the").
432
433 * data/bison.glr: New skeleton for GLR parsing.
434
435 * tests/cxx-gram.at: New tests for GLR parsing.
436
437 * tests/testsuite.at: Include cxx-gram.at.
438
439 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 440
676385e2
PH
441 * src/parse-gram.y:
442
443 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
444
445 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 446
b5480d74 4472002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
448
449 * src/options.h, src/options.c: Remove.
450 * src/getargs.c (short_options, long_options): New.
451
60491a94
AD
4522002-06-27 Akim Demaille <akim@epita.fr>
453
454 * data/bison.simple, data/bison.c++: Rename as...
455 * data/yacc.c, data/lalr1.cc: these.
456 * doc/bison.texinfo (Environment Variables): Remove.
457
9be0c25b
AD
4582002-06-25 Raja R Harinath <harinath@cs.umn.edu>
459
460 * src/getargs.c (report_argmatch): Initialize strtok().
461
1ae72863
AD
4622002-06-20 Akim Demaille <akim@epita.fr>
463
464 * data/bison.simple (b4_symbol_actions): New, replaces...
465 (b4_symbol_destructor, b4_symbol_printer): these.
466 (yysymprint): Be sure to call YYPRINT only for tokens, and using
467 user token numbers.
468
87542d29
AD
4692002-06-20 Akim Demaille <akim@epita.fr>
470
471 * data/bison.simple (yydestructor): Rename as...
472 (yydestruct): this.
473
1a31ed21
AD
4742002-06-20 Akim Demaille <akim@epita.fr>
475
476 * src/symtab.h, src/symtab.c (symbol_type_set)
477 (symbol_destructor_set, symbol_precedence_set): The location is
478 the last argument.
479 Adjust all callers.
480
e776192e
AD
4812002-06-20 Akim Demaille <akim@epita.fr>
482
483 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
484 internals.
485 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
486 Takes a location.
487 * src/symtab.h, src/symtab.c (symbol_class_set)
488 (symbol_user_token_number_set): Likewise.
489 Adjust all callers.
490 Promote complain_at.
491 * tests/input.at (Type Clashes): Adjust.
492
5c1180b3
AD
4932002-06-20 Akim Demaille <akim@epita.fr>
494
495 * data/bison.simple (YYLEX): Fix the declaration when
496 %pure-parser.
497
e3170060
AD
4982002-06-20 Akim Demaille <akim@epita.fr>
499
500 * data/bison.simple (yysymprint): Don't print the token number,
501 just its name.
502 * tests/actions.at (Destructors): Rename as...
503 (Printers and Destructors): this.
504 Also exercise %printer.
505
253862fd
AD
5062002-06-20 Akim Demaille <akim@epita.fr>
507
508 * data/bison.simple (YYDSYMPRINT): New.
509 Use it to remove many of the #if YYDEBUG/if (yydebug).
510
366eea36
AD
5112002-06-20 Akim Demaille <akim@epita.fr>
512
513 * src/symtab.h, src/symtab.c (symbol_t): printer and
514 printer_location are new members.
515 (symbol_printer_set): New.
516 * src/parse-gram.y (PERCENT_PRINTER): New token.
517 Handle its associated rule.
518 * src/scan-gram.l: Adjust.
519 (handle_destructor_at, handle_destructor_dollar): Rename as...
520 (handle_symbol_code_at, handle_symbol_code_dollar): these.
521 * src/output.c (symbol_printers_output): New.
522 (output_skeleton): Call it.
523 * data/bison.simple (yysymprint): New. Cannot be named yyprint
524 since there are already many grammar files with a user `yyprint'.
525 Replace the calls to YYPRINT to calls to yysymprint.
526 * tests/calc.at: Adjust.
527 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
528 taking advantage of parser very internal details (stack size!).
529
4f25ebb0
AD
5302002-06-20 Akim Demaille <akim@epita.fr>
531
532 * src/scan-gram.l: Complete the scanner with the missing patterns
533 to pacify Flex.
534 Use `quote' and `symbol_tag_get' where appropriate.
535
93b68a0e
AD
5362002-06-19 Akim Demaille <akim@epita.fr>
537
538 * tests/actions.at (Destructors): Augment to test locations.
539 * data/bison.simple (yydestructor): Pass it the current location
540 if locations are enabled.
541 Prototype only when __STDC__ or C++.
542 Change the argument names to move into the yy name space: there is
543 user code here.
544
58612f1d
AD
5452002-06-19 Akim Demaille <akim@epita.fr>
546
74310291
AD
547 * data/bison.simple (b4_pure_if): New.
548 Use it instead of #ifdef YYPURE.
549
5502002-06-19 Akim Demaille <akim@epita.fr>
551
552 * data/bison.simple (b4_location_if): New.
58612f1d
AD
553 Use it instead of #ifdef YYLSP_NEEDED.
554
f25bfb75
AD
5552002-06-19 Akim Demaille <akim@epita.fr>
556
557 Prepare @$ in %destructor, but currently don't bind it in the
558 skeleton, as %location use is not cleaned up yet.
559
560 * src/scan-gram.l (handle_dollar, handle_destructor_at)
561 (handle_action_at): New.
562 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
563 a braced_code_t and a location as additional arguments.
564 (handle_destructor_dollar): Instead of requiring `b4_eval', just
565 unquote one when outputting `b4_dollar_dollar'.
566 Adjust callers.
567 * data/bison.simple (b4_eval): Remove.
568 (b4_symbol_destructor): Adjust.
569 * tests/input.at (Invalid @n): Adjust.
570
c732d2c6
AD
5712002-06-19 Zack Weinberg <zack@codesourcery.com>
572
573 * doc/bison.texinfo: Document ability to have multiple
574 prologue sections.
575
8c165d89
AD
5762002-06-18 Akim Demaille <akim@epita.fr>
577
578 * src/files.c (compute_base_names): When computing the output file
579 names from the input file name, strip the directory part.
580
ca98bf57
AD
5812002-06-18 Akim Demaille <akim@epita.fr>
582
583 * data/bison.simple.new: Comment changes.
584 Reported by Andreas Schwab.
585
0bfb02ff
AD
5862002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
587
588 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
589 there are no `label `yyoverflowlab' defined but not used' warnings
590 when yyoverflow is defined.
591
24c0aad7
AD
5922002-06-18 Akim Demaille <akim@epita.fr>
593
594 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
595 new member.
596 (symbol_destructor_set): Adjust.
597 * src/output.c (symbol_destructors_output): Output the destructor
598 locations.
599 Output the symbol name.
600 * data/bison.simple (b4_symbol_destructor): Adjust.
601
5719c109
AD
6022002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
603 and Akim Demaille <akim@epita.fr>
604
605 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
606 what's left on the stack when the error recovery hits EOF.
607 * tests/actions.at (Destructors): Complete to exercise this case.
608
9280d3ef
AD
6092002-06-17 Akim Demaille <akim@epita.fr>
610
611 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
612 arguments is really empty, not only equal to `[]'.
613 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
614 member.
615 (symbol_destructor_set): New.
616 * src/output.c (symbol_destructors_output): New.
617 * src/reader.h (brace_code_t, current_braced_code): New.
618 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
619 (handle_dollar): Rename as...
620 (handle_action_dollar): this.
621 (handle_destructor_dollar): New.
622 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
623 (grammar_declaration): Use it.
624 * data/bison.simple (yystos): Is always defined.
625 (yydestructor): New.
626 * tests/actions.at (Destructors): New.
627 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
628
dafdc66f
AD
6292002-06-17 Akim Demaille <akim@epita.fr>
630
631 * src/symlist.h, src/symlist.c (symbol_list_length): New.
632 * src/scan-gram.l (handle_dollar, handle_at): Compute the
633 rule_length only when needed.
634 * src/output.c (actions_output, token_definitions_output): Output
635 the full M4 block.
636 * src/symtab.c: Don't access directly to the symbol tag, use
637 symbol_tag_get.
638 * src/parse-gram.y: Use symbol_list_free.
639
56c47203
AD
6402002-06-17 Akim Demaille <akim@epita.fr>
641
642 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
643 (symbol_list_prepend, get_type_name): Move to...
644 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
645 (symbol_list_prepend, symbol_list_n_type_name_get): here.
646 Adjust all callers.
647 (symbol_list_free): New.
648 * src/scan-gram.l (handle_dollar): Takes a location.
649 * tests/input.at (Invalid $n): Adjust.
650
1e0bab92
AD
6512002-06-17 Akim Demaille <akim@epita.fr>
652
653 * src/reader.h, src/reader.c (symbol_list_new): Export it.
654 (symbol_list_prepend): New.
655 * src/parse-gram.y (%union): `list' is a new member.
656 (symbols.1): New, replaces...
657 (terms_to_prec.1, nterms_to_type.1): these.
658 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
659 Take a location as additional argument.
660 Adjust all callers.
661
04e60654
AD
6622002-06-15 Akim Demaille <akim@epita.fr>
663
664 * src/parse-gram.y: Move %token in the declaration section so that
665 we don't depend upon CVS Bison.
666
10e5b8bd
AD
6672002-06-15 Akim Demaille <akim@epita.fr>
668
669 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
670 * src/print.c (print_core): Use it.
671
9801d40c
AD
6722002-06-15 Akim Demaille <akim@epita.fr>
673
674 * src/conflicts.c (log_resolution): Accept the rule involved in
675 the sr conflicts instead of the lookahead number that points to
676 that rule.
677 (flush_reduce): Accept the current lookahead vector as argument,
678 instead of the index in LA.
679 (resolve_sr_conflict): Accept the current number of lookahead
680 bitset to consider for the STATE, instead of the index in LA.
681 (set_conflicts): Adjust.
682 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
683
c0263492
AD
6842002-06-15 Akim Demaille <akim@epita.fr>
685
686 * src/state.h (state_t): Replace the `lookaheadsp' member, a
687 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
688 Adjust all dependencies.
689 * src/lalr.c (initialize_lookaheads): Split into...
690 (states_lookaheads_count, states_lookaheads_initialize): these.
691 (lalr): Adjust.
692
9757c359
AD
6932002-06-15 Akim Demaille <akim@epita.fr>
694
695 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
696 out of...
697 (grammar_rules_print): here.
698 * src/reduce.c (reduce_output): Use it.
699 * tests/reduce.at (Useless Rules, Reduced Automaton)
700 (Underivable Rules): Adjust.
701
6b98e4b5
AD
7022002-06-15 Akim Demaille <akim@epita.fr>
703
704 Copy BYacc's nice way to report the grammar.
705
706 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
707 New.
708 Don't print the rules' location, it is confusing and useless.
709 (rule_print): Use grammar_rhs_print.
710 * src/print.c (print_grammar): Use grammar_rules_print.
711
6b98e4b5
AD
7122002-06-15 Akim Demaille <akim@epita.fr>
713
714 Complete and rationalize `useless thing' warnings.
715
716 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
717 (symbol_tag_print): New.
718 Use them everywhere in place of accessing directly the tag member.
719 * src/gram.h, src/gram.c (rule_print): New.
720 Use it where a rule used to be printed `by hand'.
721 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
722 (reduce_grammar_tables): Report the useless rules.
723 (reduce_print): Useless things are a warning, not an error.
724 Report it as such.
725 * tests/reduce.at (Useless Nonterminals, Useless Rules):
726 (Reduced Automaton, Underivable Rules): Adjust.
727 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
728 * tests/conflicts.at (Unresolved SR Conflicts)
729 (Solved SR Conflicts): Adjust.
730
ee000ba4
AD
7312002-06-15 Akim Demaille <akim@epita.fr>
732
733 Let symbols have a location.
734
735 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
736 (getsym): Adjust.
737 Adjust all callers.
738 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
739 Use location_t, not int.
740 * src/symtab.c (symbol_check_defined): Take advantage of the
741 location.
742 * tests/regression.at (Invalid inputs): Adjust.
743
8efe435c
AD
7442002-06-15 Akim Demaille <akim@epita.fr>
745
746 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
747 (input): Don't try to initialize yylloc here, do it in the
748 scanner.
749 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
750 * src/gram.h (rule_t): Change line and action_line into location
751 and action_location, of location_t type.
752 Adjust all dependencies.
753 * src/location.h, src/location.c (empty_location): New.
754 * src/reader.h, src/reader.c (grammar_start_symbol_set)
755 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
756 (grammar_current_rule_symbol_append)
757 (grammar_current_rule_action_append): Expect a location as argument.
758 * src/reader.c (grammar_midrule_action): Adjust to attach an
759 action's location as dummy symbol location.
760 * src/symtab.h, src/symtab.c (startsymbol_location): New.
761 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
762 the line numbers.
763
1921f1d7
AD
7642002-06-14 Akim Demaille <akim@epita.fr>
765
766 Grammar declarations may be found in the grammar section.
767
768 * src/parse-gram.y (rules_or_grammar_declaration): New.
769 (declarations): Each declaration may end with a semicolon, not
770 just...
771 (grammar_declaration): `"%union"'.
772 (grammar): Branch to rules_or_grammar_declaration.
773
4515534c
AD
7742002-06-14 Akim Demaille <akim@epita.fr>
775
776 * src/main.c (main): Invoke scanner_free.
777
f958596b
AD
7782002-06-14 Akim Demaille <akim@epita.fr>
779
780 * src/output.c (m4_invoke): Extracted from...
781 (output_skeleton): here.
782 Free tempfile.
783
2c569025
AD
7842002-06-14 Akim Demaille <akim@epita.fr>
785
786 * src/parse-gram.y (directives, directive, gram)
787 (grammar_directives, precedence_directives, precedence_directive):
788 Rename as...
789 (declarations, declaration, grammar, grammar_declaration)
790 (precedence_declaration, precedence_declarator): these.
791 (symbol_declaration): New.
792
592e8d4d
AD
7932002-06-14 Akim Demaille <akim@epita.fr>
794
795 * src/files.c (action_obstack): Remove, unused.
796 (output_obstack): Remove it, and all its dependencies, as it is no
797 longer needed.
798 * src/reader.c (epilogue_set): Build the epilogue in the
799 muscle_obstack.
800 * src/output.h, src/output.c (muscle_obstack): Move to...
801 * src/muscle_tab.h, src/muscle_tab.h: here.
802 (muscle_init): Initialize muscle_obstack.
803 (muscle_free): New.
804 * src/main.c (main): Call it.
805
0c15323d
AD
8062002-06-14 Akim Demaille <akim@epita.fr>
807
808 * src/location.h: New, extracted from...
809 * src/reader.h: here.
810 * src/Makefile.am (noinst_HEADERS): Merge into
811 (bison_SOURCES): this.
812 Add location.h.
813 * src/parse-gram.y: Use location_t instead of Bison's.
814 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
815 Use location_t instead of ints.
816
e96c9728
AD
8172002-06-14 Akim Demaille <akim@epita.fr>
818
819 * data/bison.simple, data/bison.c++: Be sure to restore the
820 current #line when returning to the skeleton contents after having
821 exposed the input file's #line.
822
75d1fe16
AD
8232002-06-12 Akim Demaille <akim@epita.fr>
824
825 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
826 eager.
827 * tests/actions.at (Exotic Dollars): New.
828
6c35d22c
AD
8292002-06-12 Akim Demaille <akim@epita.fr>
830
831 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
832 ['"/] too eagerly.
833 * tests/input.at (Torturing the Scanner): New.
834
1d6412ad
AD
8352002-06-11 Akim Demaille <akim@epita.fr>
836
837 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
838 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
839 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
840 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
841 * src/reader.c (reader): Use it.
842
4cdb01db
AD
8432002-06-11 Akim Demaille <akim@epita.fr>
844
845 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
846 Adjust all callers.
847 (scanner_last_string_free): New.
848
44995b2e
AD
8492002-06-11 Akim Demaille <akim@epita.fr>
850
851 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
852 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
853 (last_string, YY_OBS_FREE): New.
854 Use them when returning an ID.
855
e9955c83
AD
8562002-06-11 Akim Demaille <akim@epita.fr>
857
858 Have Bison grammars parsed by a Bison grammar.
859
860 * src/reader.c, src/reader.h (prologue_augment): New.
861 * src/reader.c (copy_definition): Remove.
862
863 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
864 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
865 (grammar_current_rule_prec_set, grammar_current_rule_check)
866 (grammar_current_rule_symbol_append)
867 (grammar_current_rule_action_append): Export.
868 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
869 (symbol_list_action_append): Remove.
870 Hook the routines from reader.
871 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
872 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
873
874 * src/reader.c (read_declarations): Remove, unused.
875
876 * src/parse-gram.y: Handle the epilogue.
877 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
878 (grammar_start_symbol_set): this.
879 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
880 * src/reader.c (readgram): Remove, unused.
881 (reader): Adjust to insert eoftoken and axiom where appropriate.
882
883 * src/reader.c (copy_dollar): Replace with...
884 * src/scan-gram.h (handle_dollar): this.
885 * src/parse-gram.y: Remove `%thong'.
886
887 * src/reader.c (copy_at): Replace with...
888 * src/scan-gram.h (handle_at): this.
889
890 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
891 New.
892
893 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
894 time being.
895
896 * src/reader.h, src/reader.c (grammar_rule_end): New.
897
898 * src/parse.y (current_type, current_class): New.
899 Implement `%nterm', `%token' support.
900 Merge `%term' into `%token'.
901 (string_as_id): New.
902 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
903 type name.
904
905 * src/parse-gram.y: Be sure to handle properly the beginning of
906 rules.
907
908 * src/parse-gram.y: Handle %type.
909 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
910
911 * src/parse-gram.y: More directives support.
912 * src/options.c: No longer handle source directives.
913
914 * src/parse-gram.y: Fix %output.
915
916 * src/parse-gram.y: Handle %union.
917 Use the prologue locations.
918 * src/reader.c (parse_union_decl): Remove.
919
920 * src/reader.h, src/reader.c (epilogue_set): New.
921 * src/parse-gram.y: Use it.
922
923 * data/bison.simple, data/bison.c++: b4_stype is now either not
924 defined, then default to int, or to the contents of %union,
925 without `union' itself.
926 Adjust.
927 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
928
929 * src/output.c (actions_output): Don't output braces, as they are
930 already handled by the scanner.
931
932 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
933 characters to themselves.
934
935 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
936 that the epilogue has a proper #line.
937
938 * src/parse-gram.y: Handle precedence/associativity.
939
940 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
941 a terminal.
942 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
943 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
944 at all to define terminals that cannot be emitted.
945
946 * src/scan-gram.l: Escape M4 characters.
947
948 * src/scan-gram.l: Working properly with escapes in user
949 strings/characters.
950
951 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
952 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
953 grammar.
954 Use more modest sizes, as for the time being the parser does not
955 release memory, and therefore the process swallows a huge amount
956 of memory.
957
958 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
959 stricter %token grammar.
960
961 * src/symtab.h (associativity): Add `undef_assoc'.
962 (symbol_precedence_set): Do nothing when passed an undef_assoc.
963 * src/symtab.c (symbol_check_alias_consistence): Adjust.
964
965 * tests/regression.at (Invalid %directive): Remove, as it is now
966 meaningless.
967 (Invalid inputs): Adjust to the new error messages.
968 (Token definitions): The new grammar doesn't allow too many
969 eccentricities.
970
971 * src/lex.h, src/lex.c: Remove.
972 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
973 (copy_character, copy_string2, copy_string, copy_identifier)
974 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
975 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
976 (parse_action): Remove.
977 * po/POTFILES.in: Adjust.
978
2e047461
AD
9792002-06-11 Akim Demaille <akim@epita.fr>
980
981 * src/reader.c (parse_action): Don't store directly into the
982 rule's action member: return the action as a string.
983 Don't require `rule_length' as an argument: compute it.
984 (grammar_current_rule_symbol_append)
985 (grammar_current_rule_action_append): New, eved out from
986 (readgram): here.
987 Remove `action_flag', `rulelength', unused now.
988
9af3fbce
AD
9892002-06-11 Akim Demaille <akim@epita.fr>
990
991 * src/reader.c (grammar_current_rule_prec_set).
992 (grammar_current_rule_check): New, eved out from...
993 (readgram): here.
994 Remove `xaction', `first_rhs': useless.
995 * tests/input.at (Type clashes): New.
996 * tests/existing.at (GNU Cim Grammar): Adjust.
997
1485e106
AD
9982002-06-11 Akim Demaille <akim@epita.fr>
999
1000 * src/reader.c (grammar_midrule_action): New, Eved out from
1001 (readgram): here.
1002
da4160c3
AD
10032002-06-11 Akim Demaille <akim@epita.fr>
1004
1005 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
1006 New.
1007 (readgram): Use them as replacement of inlined code, crule and
1008 crule1.
1009
f6d0f937
AD
10102002-06-11 Akim Demaille <akim@epita.fr>
1011
1012 * src/reader.c (grammar_end, grammar_symbol_append): New.
1013 (readgram): Use them.
1014 Make the use of `p' as local as possible.
1015
69078d4b
AD
10162002-06-10 Akim Demaille <akim@epita.fr>
1017
1018 GCJ's parser requires the tokens to be defined before the prologue.
1019
1020 * data/bison.simple: Output the token definition before the user's
1021 prologue.
1022 * tests/regression.at (Braces parsing, Duplicate string)
1023 (Mixing %token styles): Check the output from bison.
1024 (Early token definitions): New.
1025
5e424082
AD
10262002-06-10 Akim Demaille <akim@epita.fr>
1027
1028 * src/symtab.c (symbol_user_token_number_set): Don't complain when
1029 assigning twice the same user number to a token, so that we can
1030 use it in...
1031 * src/lex.c (lex): here.
1032 Also use `symbol_class_set' instead of hand written code.
1033 * src/reader.c (parse_assoc_decl): Likewise.
1034
44536b35
AD
10352002-06-10 Akim Demaille <akim@epita.fr>
1036
1037 * src/symtab.c, src/symtab.c (symbol_class_set)
1038 (symbol_user_token_number_set): New.
1039 * src/reader.c (parse_token_decl): Use them.
1040 Use a switch instead of ifs.
1041 Use a single argument.
1042
8b9f2372
AD
10432002-06-10 Akim Demaille <akim@epita.fr>
1044
1045 Remove `%thong' support as it is undocumented, unused, duplicates
1046 `%token's job, and creates useless e-mail traffic with people who
1047 want to know what it is, why it is undocumented, unused, and
1048 duplicates `%token's job.
1049
1050 * src/reader.c (parse_thong_decl): Remove.
1051 * src/options.c (option_table): Remove "thong".
1052 * src/lex.h (tok_thong): Remove.
1053
3ae2b51f
AD
10542002-06-10 Akim Demaille <akim@epita.fr>
1055
1056 * src/symtab.c, src/symtab.c (symbol_type_set)
1057 (symbol_precedence_set): New.
1058 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
1059 (value_components_used): Remove, unused.
1060
2f1afb73
AD
10612002-06-09 Akim Demaille <akim@epita.fr>
1062
1063 Move symbols handling code out of the reader.
1064
1065 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
1066 (axiom): Move to...
1067 * src/symtab.h, src/symtab.c: here.
1068
1069 * src/gram.c (start_symbol): Remove: use startsymbol->number.
1070 * src/reader.c (startval): Rename as...
1071 * src/symtab.h, src/symtab.c (startsymbol): this.
1072 * src/reader.c: Adjust.
1073
1074 * src/reader.c (symbol_check_defined, symbol_make_alias)
1075 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1076 (token_translations_init)
1077 Move to...
1078 * src/symtab.c: here.
1079 * src/reader.c (packsymbols): Move to...
1080 * src/symtab.h, src/symtab.c (symbols_pack): here.
1081 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
1082 argument.
1083
e9bca3ad
AD
10842002-06-03 Akim Demaille <akim@epita.fr>
1085
1086 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
1087 then statements.
1088
86eff183
AD
10892002-06-03 Akim Demaille <akim@epita.fr>
1090
1091 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1092 structs with non literals.
1093 * src/scan-skel.l: never-interactive.
1094 * src/conflicts.c (enum conflict_resolution_e): No trailing
1095 comma.
1096 * src/getargs.c (usage): Split long literal strings.
1097 Reported by Hans Aberg.
1098
717be197
AD
10992002-05-28 Akim Demaille <akim@epita.fr>
1100
1101 * data/bison.c++: Use C++ ostreams.
1102 (cdebug_): New member.
1103
670ddffd
AD
11042002-05-28 Akim Demaille <akim@epita.fr>
1105
1106 * src/output.c (output_skeleton): Be sure to allocate enough room
1107 for `/' _and_ for `\0' in full_skeleton.
1108
769b430f
AD
11092002-05-28 Akim Demaille <akim@epita.fr>
1110
1111 * data/bison.c++: Catch up with bison.simple:
1112 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1113 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1114 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1115 and popping traces.
1116
7067cb36
PH
11172002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1118
1119 * src/output.c (output_skeleton): Put an explicit path in front of
1120 the skeleton file name, rather than relying on the -I directory,
1121 to partially alleviate effects of having a skeleton file lying around
1122 in the current directory.
769b430f 1123
4a713ec2
PH
11242002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1125
769b430f 1126 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
1127 obstack_printf should be obstack_fgrow1.
1128
b408954b
AD
11292002-05-26 Akim Demaille <akim@epita.fr>
1130
1131 * src/state.h (state_t): `solved_conflicts' is a new member.
1132 * src/LR0.c (new_state): Set it to 0.
1133 * src/conflicts.h, src/conflicts.c (print_conflicts)
1134 (free_conflicts, solve_conflicts): Rename as...
1135 (conflicts_print, conflicts_free, conflicts_solve): these.
1136 Adjust callers.
1137 * src/conflicts.c (enum conflict_resolution_e)
1138 (solved_conflicts_obstack): New, used by...
1139 (log_resolution): this.
1140 Adjust to attach the conflict resolution to each state.
1141 Complete the description with the precedence/associativity
1142 information.
1143 (resolve_sr_conflict): Adjust.
1144 * src/print.c (print_state): Output its solved_conflicts.
1145 * tests/conflicts.at (Unresolved SR Conflicts)
1146 (Solved SR Conflicts): Exercise --report=all.
1147
a49aecd5
AD
11482002-05-26 Akim Demaille <akim@epita.fr>
1149
1150 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1151 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1152 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1153 (token_number_t, item_number_as_token_number)
1154 (token_number_as_item_number, muscle_insert_token_number_table):
1155 Rename as...
1156 (symbol_number_t, item_number_as_symbol_number)
1157 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1158 these, since it is more appropriate.
1159
5504898e
AD
11602002-05-26 Akim Demaille <akim@epita.fr>
1161
1162 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1163 `Error:' lines.
1164 * data/bison.simple (yystos) [YYDEBUG]: New.
1165 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1166 error recovery.
1167 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1168
ec3bc396
AD
11692002-05-25 Akim Demaille <akim@epita.fr>
1170
1171 * doc/bison.texinfo (Debugging): Split into...
1172 (Tracing): this new section, its former contents, and...
1173 (Understanding): this new section.
1174 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1175 by...
1176 (report_flag): this.
1177 Adjust all dependencies.
1178 (report_args, report_types, report_argmatch): New.
1179 (usage, getargs): Report/support -r, --report.
1180 * src/options.h
1181 (struct option_table_struct): Rename as..,
1182 (struct option_table_s): this.
1183 Rename the `set_flag' member to `flag' to match with getopt_long's
1184 struct.
1185 * src/options.c (option_table): Split verbose into an entry for
1186 %verbose, and another for --verbose.
1187 Support --report/-r, so remove -r from the obsolete --raw.
1188 * src/print.c: Attach full item sets and lookaheads reports to
1189 report_flag instead of trace_flag.
1190 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1191
78df8250
PE
11922002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1193 and Paul Eggert <eggert@twinsun.com>
769b430f 1194
78df8250
PE
1195 * data/bison.simple (yyparse): Correct error handling to conform to
1196 POSIX and yacc. Specifically, after syntax error is discovered,
1197 do not reduce further before shifting the error token.
1198 Clean up the code a bit by removing the labels yyerrdefault,
1199 yyerrhandle, yyerrpop.
1200 * NEWS: Document the above.
1201
c0c9ea05
PH
12022002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1203
1204 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1205 type; it isn't always big enough, since it doesn't necessarily
1206 include non-terminals.
769b430f 1207 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
1208 the latter can be removed.
1209 (yy_token_number_type): Remove, only one use.
1210 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1211 don't use TokenNumberType as element type.
769b430f 1212
c0c9ea05
PH
1213 * tests/regression.at: Modify expected output to agree with change
1214 to yyr1 and yytranslate.
769b430f 1215
6390a83f
FK
12162002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1217
1218 * src/reader.c (parse_action): Use copy_character instead of
1219 obstack_1grow.
1220
db7c8e9a
AD
12212002-05-13 Akim Demaille <akim@epita.fr>
1222
1223 * tests/regression.at (Token definitions): Prototype yylex and
1224 yyerror.
1225
fcc61800
PH
12262002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1227
158c687b 1228 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
1229 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1230 32-bit arithmetic.
1231 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1232
5683e9b2
AD
12332002-05-07 Akim Demaille <akim@epita.fr>
1234
1235 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1236 avoid GCC warnings.
1237
0c2d3f4c
AD
12382002-05-07 Akim Demaille <akim@epita.fr>
1239
1240 Kill GCC warnings.
1241
1242 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1243 over the RHS of each rule.
1244 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1245 * src/state.h (state_t): Member `nitems' is unsigned short.
1246 * src/LR0.c (get_state): Adjust.
1247 * src/reader.c (packgram): Likewise.
1248 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1249 `Type'.
1250 (muscle_insert_int_table): Remove, unused.
1251 (prepare_rules): Remove `max'.
1252
1565b720
AD
12532002-05-06 Akim Demaille <akim@epita.fr>
1254
1255 * src/closure.c (print_firsts): Display of the symbol tags.
1256 (bitmatrix_print): Move to...
1257 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1258 here.
1259 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1260
cfaee611
AD
12612002-05-06 Akim Demaille <akim@epita.fr>
1262
1263 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1264 hash_do_for_each.
1265
458be8e0
AD
12662002-05-06 Akim Demaille <akim@epita.fr>
1267
1268 * src/LR0.c (new_state, get_state): Instead of using the global
1269 `kernel_size' and `kernel_base', have two new arguments:
1270 `core_size' and `core'.
1271 Adjust callers.
1272
a900a624
AD
12732002-05-06 Akim Demaille <akim@epita.fr>
1274
1275 * src/reader.c (packgram): No longer end `ritem' with a 0
1276 sentinel: it is not used.
1277
d4e7d3a1
AD
12782002-05-05 Akim Demaille <akim@epita.fr>
1279
1280 New experimental feature: display the lookaheads in the report and
1281 graph.
1282
1283 * src/print (print_core): When --trace-flag, display the rules
1284 lookaheads.
1285 * src/print_graph.c (print_core): Likewise.
1286 Swap the arguments.
1287 Adjust caller.
1288
39ceb25b
AD
12892002-05-05 Akim Demaille <akim@epita.fr>
1290
1291 * tests/torture.at (Many lookaheads): New test.
1292
5372019f
AD
12932002-05-05 Akim Demaille <akim@epita.fr>
1294
1295 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1296 (GENERATE_MUSCLE_INSERT_TABLE): this.
1297 (output_int_table, output_unsigned_int_table, output_short_table)
1298 (output_token_number_table, output_item_number_table): Replace with...
1299 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1300 (muscle_insert_short_table, muscle_insert_token_number_table)
1301 (muscle_insert_item_number_table): these.
1302 Adjust all callers.
1303 (prepare_tokens): Don't free `translations', since...
1304 * src/reader.h, src/reader.c (grammar_free): do it.
1305 Move to...
1306 * src/gram.h, src/gram.c (grammar_free): here.
1307 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1308 b4_translate_max.
1309
5df5f6d5
AD
13102002-05-05 Akim Demaille <akim@epita.fr>
1311
1312 * src/output.c (output_unsigned_int_table): New.
1313 (prepare_rules): `i' is unsigned.
1314 `prhs', `rline', `r2' are unsigned int.
1315 Rename muscle `rhs_number_max' as `rhs_max'.
1316 Output muscles `prhs_max', `rline_max', and `r2_max'.
1317 Free rline and r1.
1318 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1319 to compute types instead of constant types.
1320 * tests/regression.at (Web2c Actions): Adjust.
1321
b87f8b21
AD
13222002-05-04 Akim Demaille <akim@epita.fr>
1323
1324 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1325 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1326 Adjust dependencies.
1327 * src/output.c (token_definitions_output): Be sure not to output a
1328 `#define 'a'' when fed with `%token 'a' "a"'.
1329 * tests/regression.at (Token definitions): New.
1330
8bb936e4
PE
13312002-05-03 Paul Eggert <eggert@twinsun.com>
1332
1333 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1334 for K&R C.
1335
13362002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1337
1338 * Makefile.am (SUBDIRS): Remove intl.
1339 (EXTRA_DIST): Add config/config.rpath.
1340
53c71a12
AD
13412002-05-03 Akim Demaille <akim@epita.fr>
1342
1343 * data/bison.simple (m4_if): Don't output empty enums.
1344 And actually, output valid enum definitions :(.
1345
289dd0cf
AD
13462002-05-03 Akim Demaille <akim@epita.fr>
1347
1348 * configure.bat: Remove, completely obsolete.
1349 * Makefile.am (EXTRA_DIST): Adjust.
1350 Don't distribute config.rpath...
1351 * config/Makefile.am (EXTRA_DIST): Do it.
1352
db85e524
AD
13532002-05-03 Akim Demaille <akim@epita.fr>
1354
1355 * configure.in (GETTEXT_VERSION): New.
1356 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1357
83ccf991
AD
13582002-05-03 Akim Demaille <akim@epita.fr>
1359
1360 * data/bison.simple (b4_token_enum): New.
1361 (b4_token_defines): Use it to output tokens both as #define and
1362 enums.
1363 Suggested by Paul Eggert.
1364 * src/output.c (token_definitions_output): Don't output spurious
1365 white spaces.
1366
1f418995
AD
13672002-05-03 Akim Demaille <akim@epita.fr>
1368
1369 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1370
45119f04
RA
13712002-05-02 Robert Anisko <robert@lrde.epita.fr>
1372
1373 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1374 Update the stack class, give a try to deque as the default container.
1375
b2d52318
AD
13762002-05-02 Akim Demaille <akim@epita.fr>
1377
1378 * data/bison.simple (yyparse): Do not implement @$ = @1.
1379 (YYLLOC_DEFAULT): Adjust to do it.
1380 * doc/bison.texinfo (Location Default Action): Fix.
1381
3a8b4109
AD
13822002-05-02 Akim Demaille <akim@epita.fr>
1383
1384 * src/reader.c (parse_braces): Merge into...
1385 (parse_action): this.
1386
84614e13
AD
13872002-05-02 Akim Demaille <akim@epita.fr>
1388
1389 * configure.in (ALL_LINGUAS): Remove.
1390 * po/LINGUAS, hr.po: New.
1391
fdbcd8e2
AD
13922002-05-02 Akim Demaille <akim@epita.fr>
1393
1394 Remove the so called hairy (semantic) parsers.
1395
1396 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1397 * src/gram.h, src/gram.c (semantic_parser): Remove.
1398 (rule_t): Remove the guard and guard_line members.
1399 * src/lex.h (token_t): remove tok_guard.
1400 * src/options.c (option_table): Remove %guard and %semantic_parser
1401 support.
1402 * src/output.c, src/output.h (guards_output): Remove.
1403 (prepare): Adjust.
1404 (token_definitions_output): Don't output the `T'
1405 tokens (???).
1406 (output_skeleton): Don't output the guards.
1407 * src/files.c, src/files.c (attrsfile): Remove.
1408 * src/reader.c (symbol_list): Remove the guard and guard_line
1409 members.
1410 Adjust dependencies.
1411 (parse_guard): Remove.
1412 * data/bison.hairy: Remove.
1413 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1414 BISON_HAIRY.
1415
82b6cb3f
AD
14162002-05-02 Akim Demaille <akim@epita.fr>
1417
1418 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1419 (parse_guard): Rename the formal argument `stack_offset' as
1420 `rule_length', which is more readable.
1421 Adjust callers.
1422 (copy_at, copy_dollar): Instead of outputting the hard coded
1423 values of $$, $n and so forth, output invocation to b4_lhs_value,
1424 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
1425 Note: this patch partially drops `semantic-parser' support: it
1426 always does `rule_length - n', where semantic parsers ought to
1427 always use `-n'.
82b6cb3f
AD
1428 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1429 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1430
6cbfbcc5
AD
14312002-05-02 Akim Demaille <akim@epita.fr>
1432
1433 * configure.in (AC_INIT): Bump to 1.49b.
1434 (AM_INIT_AUTOMAKE): Short invocation.
1435
b8548114
AD
14362002-05-02 Akim Demaille <akim@epita.fr>
1437
1438 Version 1.49a.
1439
c20cd1fa
AD
14402002-05-01 Akim Demaille <akim@epita.fr>
1441
1442 * src/skeleton.h: Remove.
1443
8a9566d4
AD
14442002-05-01 Akim Demaille <akim@epita.fr>
1445
1446 * src/skeleton.h: Fix the #endif.
1447 Reported by Magnus Fromreide.
1448
8c6d399a
PE
14492002-04-26 Paul Eggert <eggert@twinsun.com>
1450
1451 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1452 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 1453 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 1454
2b7ed18a
RA
14552002-04-25 Robert Anisko <robert@lrde.epita.fr>
1456
1457 * src/scan-skel.l: Postprocess quadrigraphs.
1458
1459 * src/reader.c (copy_character): New function, used to output
1460 single characters while replacing `[' and `]' with quadrigraphs, to
1461 avoid troubles with M4 quotes.
1462 (copy_comment): Output characters with copy_character.
1463 (read_additionnal_code): Likewise.
1464 (copy_string2): Likewise.
1465 (copy_definition): Likewise.
1466
1467 * tests/calc.at: Exercise M4 quoting.
1468
34a89c50
AD
14692002-04-25 Akim Demaille <akim@epita.fr>
1470
1471 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1472 between `!' and the command.
1473 Reported by Paul Eggert.
1474
0dd1580a
RA
14752002-04-24 Robert Anisko <robert@lrde.epita.fr>
1476
1477 * tests/calc.at: Exercise prologue splitting.
1478
1479 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1480 `b4_post_prologue' instead of `b4_prologue'.
1481
1482 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1483 muscles.
1484 (output): Free pre_prologue_obstack and post_prologue_obstack.
1485 * src/files.h, src/files.c (attrs_obstack): Remove.
1486 (pre_prologue_obstack, post_prologue_obstack): New.
1487 * src/reader.c (copy_definition): Add a parameter to specify the
1488 obstack to fill, instead of using attrs_obstack unconditionally.
1489 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1490 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1491
83c1796f
PE
14922002-04-23 Paul Eggert <eggert@twinsun.com>
1493
1494 * data/bison.simple: Remove unnecessary commentary and white
1495 space differences from 1_29-branch.
1496 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1497
1498 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1499 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1500 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1501 constructors or destructors.
1502
1503 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1504
1207eeac
AD
15052002-04-23 Akim Demaille <akim@epita.fr>
1506
1507 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1508 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1509 location with columns.
1510 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1511 All reported by Paul Eggert.
1512
78ab8f67
AD
15132002-04-22 Akim Demaille <akim@epita.fr>
1514
1515 * src/reduce.c (dump_grammar): Move to...
1516 * src/gram.h, src/gram.c (grammar_dump): here.
1517 Be sure to separate long item numbers.
1518 Don't read the members of a rule's prec if its nil.
1519
133c20e2
AD
15202002-04-22 Akim Demaille <akim@epita.fr>
1521
1522 * src/output.c (table_size, table_grow): New.
1523 (MAXTABLE): Remove, replace uses with table_size.
1524 (pack_vector): Instead of dying when the table is too big, grow it.
1525
9515e8a7
AD
15262002-04-22 Akim Demaille <akim@epita.fr>
1527
1528 * data/bison.simple (yyr1): Its type is that of a token number.
1529 * data/bison.c++ (r1_): Likewise.
1530 * tests/regression.at (Web2c Actions): Adjust.
1531
23c5a174
AD
15322002-04-22 Akim Demaille <akim@epita.fr>
1533
1534 * src/reader.c (token_translations_init): 256 is now the default
1535 value for the error token, i.e., it will be assigned another
1536 number if the user assigned 256 to one of her tokens.
1537 (reader): Don't force 256 to error.
1538 * doc/bison.texinfo (Symbols): Adjust.
1539 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1540 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1541 etc. instead of 10, 20, 30 (which was used to `jump' over error
1542 (256) and undefined (2)).
1543
5fbb0954
AD
15442002-04-22 Akim Demaille <akim@epita.fr>
1545
1546 Propagate more token_number_t.
1547
1548 * src/gram.h (token_number_as_item_number)
1549 (item_number_as_token_number): New.
1550 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1551 Use it to create output_item_number_table and
1552 output_token_number_table.
1553 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1554 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1555 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1556 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1557
4f940944
AD
15582002-04-22 Akim Demaille <akim@epita.fr>
1559
1560 * src/output.h, src/output.c (get_lines_number): Remove.
1561
3ded9a63
AD
15622002-04-19 Akim Demaille <akim@epita.fr>
1563
1564 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1565 as Lex/Flex'.
1566 (Debugging): More details about enabling the debugging features.
1567 (Table of Symbols): Describe $$, $n, @$, and @n.
1568 Suggested by Tim Josling.
1569
e0c471a9
AD
15702002-04-19 Akim Demaille <akim@epita.fr>
1571
1572 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1573
fecc10cd
AD
15742002-04-10 Akim Demaille <akim@epita.fr>
1575
1576 * src/system.h: Rely on HAVE_LIMITS_H.
1577 Suggested by Paul Eggert.
1578
51dec47b
AD
15792002-04-09 Akim Demaille <akim@epita.fr>
1580
1581 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1582 full stderr, and strip it according to the bison options, instead
1583 of composing the error message from different bits.
1584 This makes it easier to check for several error messages.
1585 Adjust all the invocations.
1586 Add an invocation exercising the error token.
1587 Add an invocation demonstrating a stupid error message.
1588 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1589 Adjust the tests.
1590 Error message are for stderr, not stdout.
1591
007a50a4
AD
15922002-04-09 Akim Demaille <akim@epita.fr>
1593
1594 * src/gram.h, src/gram.c (error_token_number): Remove, use
1595 errtoken->number.
1596 * src/reader.c (reader): Don't specify the user token number (2)
1597 for $undefined, as it uselessly prevents using it.
1598 * src/gram.h (token_number_t): Move to...
1599 * src/symtab.h: here.
1600 (state_t.number): Is a token_number_t.
1601 * src/print.c, src/reader.c: Use undeftoken->number instead of
1602 hard coded 2.
1603 (Even though this 2 is not the same as above: the number of the
1604 undeftoken remains being 2, it is its user token number which
1605 might not be 2).
1606 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1607 `user_token_number_max'.
1608 Output `undef_token_number'.
1609 * data/bison.simple, data/bison.c++: Use them.
1610 Be sure to map invalid yylex return values to
1611 `undef_token_number'. This saves us from gratuitous SEGV.
1612
1613 * tests/conflicts.at (Solved SR Conflicts)
1614 (Unresolved SR Conflicts): Adjust.
1615 * tests/regression.at (Web2c Actions): Adjust.
1616
06446ccf
AD
16172002-04-08 Akim Demaille <akim@epita.fr>
1618
1619 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1620 Adding #line.
1621 Remove the duplicate `typedefs'.
1622 (RhsNumberType): Fix the declaration and various other typos.
1623 Use __ofile__.
1624 * data/bison.simple: Use __ofile__.
1625 * src/scan-skel.l: Handle __ofile__.
1626
62a3e4f0
AD
16272002-04-08 Akim Demaille <akim@epita.fr>
1628
1629 * src/gram.h (item_number_t): New, the type of item numbers in
1630 RITEM. Note that it must be able to code symbol numbers as
1631 positive number, and the negation of rule numbers as negative
1632 numbers.
1633 Adjust all dependencies (pretty many).
1634 * src/reduce.c (rule): Remove this `short *' pointer: use
1635 item_number_t.
1636 * src/system.h (MINSHORT, MAXSHORT): Remove.
1637 Include `limits.h'.
1638 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1639 (shortcpy): Remove.
1640 (MAXTABLE): Move to...
1641 * src/output.c (MAXTABLE): here.
1642 (prepare_rules): Use output_int_table to output rhs.
1643 * data/bison.simple, data/bison.c++: Adjust.
1644 * tests/torture.at (Big triangle): Move the limit from 254 to
1645 500.
1646 * tests/regression.at (Web2c Actions): Ajust.
1647
1648 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1649 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1650 passes, but produces negative #line number, once fixed, GCC is
1651 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1652 C), it passes.
1653 * src/state.h (state_h): Code input lines on ints, not shorts.
1654
bb88b0fc
AD
16552002-04-08 Akim Demaille <akim@epita.fr>
1656
1657 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1658 and then the grammar.
1659
9a636f47
AD
16602002-04-08 Akim Demaille <akim@epita.fr>
1661
1662 * src/system.h: No longer using strndup.
1663
680e8701
AD
16642002-04-07 Akim Demaille <akim@epita.fr>
1665
1666 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1667 * src/output.c (output_table_data): Return the longest number.
1668 (prepare_tokens): Output `token_number_max').
1669 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1670 New.
1671 Use them to define yy_token_number_type/TokenNumberType.
1672 Use this type for yytranslate.
1673 * tests/torture.at (Big triangle): Push the limit from 124 to
1674 253.
1675 * tests/regression.at (Web2c Actions): Adjust.
1676
817e9f41
AD
16772002-04-07 Akim Demaille <akim@epita.fr>
1678
1679 * tests/torture.at (Big triangle): New.
1680 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1681 * tests/existing.at: here.
1682
5123689b
AD
16832002-04-07 Akim Demaille <akim@epita.fr>
1684
1685 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1686 nritems.
1687 Adjust dependencies.
1688
f3849179
AD
16892002-04-07 Akim Demaille <akim@epita.fr>
1690
1691 * src/reader.c: Normalize increments to prefix form.
1692
bd02036a
AD
16932002-04-07 Akim Demaille <akim@epita.fr>
1694
1695 * src/reader.c, symtab.c: Remove debugging code.
1696
db8837cb
AD
16972002-04-07 Akim Demaille <akim@epita.fr>
1698
1699 Rename all the `bucket's as `symbol_t'.
1700
1701 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1702 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1703 * src/symtab.c, src/symtab.h (bucket): Rename as...
1704 (symbol_t): this.
1705 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1706 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1707 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1708 (buckets_new, buckets_free, buckets_do): Rename as...
1709 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1710 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1711 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1712 (symbols_new, symbols_free, symbols_do): these.
1713
72a23c97
AD
17142002-04-07 Akim Demaille <akim@epita.fr>
1715
1716 Use lib/hash for the symbol table.
1717
1718 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1719 EOF.
1720 * src/lex.c (lex): Set the `number' member of new terminals.
1721 * src/reader.c (bucket_check_defined, bucket_make_alias)
1722 (bucket_check_alias_consistence, bucket_translation): New.
1723 (reader, grammar_free, readgram, token_translations_init)
1724 (packsymbols): Adjust.
1725 (reader): Number the predefined tokens.
1726 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1727 for predefined tokens.
1728 * src/symtab.h (bucket): Remove all the hash table related
1729 members.
1730 * src/symtab.c (symtab): Replace by...
1731 (bucket_table): this.
1732 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1733 (buckets_new, buckets_do): New.
1734
280a38c3
AD
17352002-04-07 Akim Demaille <akim@epita.fr>
1736
1737 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1738 (start_symbol, max_user_token_number, semantic_parser)
1739 (error_token_number): Initialize.
1740 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1741 Initialize.
1742 (reader): Don't.
1743 (errtoken, eoftoken, undeftoken, axiom): Extern.
1744
03b31c0c
AD
17452002-04-07 Akim Demaille <akim@epita.fr>
1746
1747 * src/gram.h (rule_s): prec and precsym are now pointers
1748 to the bucket giving the priority/associativity.
1749 Member `associativity' removed: useless.
1750 * src/reduce.c, src/conflicts.c: Adjust.
1751
8b3df748
AD
17522002-04-07 Akim Demaille <akim@epita.fr>
1753
1754 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1755 Properly escape the symbols' TAG when outputting them.
1756
e601aa1d
AD
17572002-04-07 Akim Demaille <akim@epita.fr>
1758
1759 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1760
b0299a2e
AD
17612002-04-07 Akim Demaille <akim@epita.fr>
1762
1763 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1764 (LArule): this, which is an array to rule_t*.
1765 * src/print.c, src/conflicts.c: Adjust.
1766
d7e1f00c
AD
17672002-04-07 Akim Demaille <akim@epita.fr>
1768
1769 * src/gram.h (rule_t): Rename `number' as `user_number'.
1770 `number' is a new member.
1771 Adjust dependencies.
1772 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1773
cc9305dd
AD
17742002-04-07 Akim Demaille <akim@epita.fr>
1775
1776 As a result of the previous patch, it is no longer needed
1777 to reorder ritem itself.
1778
1779 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1780
b0940840
AD
17812002-04-07 Akim Demaille <akim@epita.fr>
1782
1783 Be sure never to walk through RITEMS, but use only data related to
1784 the rules themselves. RITEMS should be banished.
1785
1786 * src/output.c (output_token_translations): Rename as...
1787 (prepare_tokens): this.
1788 In addition to `translate', prepare the muscles `tname' and
1789 `toknum', which were handled by...
1790 (output_rule_data): this.
1791 Remove, and move the remainder of its outputs into...
1792 (prepare_rules): this new routines, which also merges content from
1793 (output_gram): this.
1794 (prepare_rules): Be sure never to walk through RITEMS.
1795 (output_stos): Rename as...
1796 (prepare_stos): this.
1797 (output): Always invoke prepare_states, after all, just don't use it
1798 in the output if you don't need it.
1799
643a5994
AD
18002002-04-07 Akim Demaille <akim@epita.fr>
1801
1802 * src/LR0.c (new_state): Display `nstates' as the name of the
1803 newly created state.
1804 Adjust to initialize first_state and last_state if needed.
1805 Be sure to distinguish the initial from the final state.
1806 (new_states): Create the itemset of the initial state, and use
1807 new_state.
1808 * src/closure.c (closure): Now that the initial state has its
1809 items properly set, there is no need for a special case when
1810 creating `ruleset'.
1811
1812 As a result, now the rule 0, reducing to $axiom, is visible in the
1813 outputs. Adjust the test suite.
1814
1815 * tests/conflicts.at (Solved SR Conflicts)
1816 (Unresolved SR Conflicts): Adjust.
1817 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1818 * tests/conflicts.at (S/R in initial): New.
1819
b4c4ccc2
AD
18202002-04-07 Akim Demaille <akim@epita.fr>
1821
1822 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1823 the RHS of the rules.
1824 * src/output.c (output_gram): Likewise.
1825
bba97eb2
AD
18262002-04-07 Akim Demaille <akim@epita.fr>
1827
1828 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1829 bucket.
1830 Adjust all dependencies.
1831 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1832 `number' of the buckets too.
1833 * src/gram.h: Include `symtab.h'.
1834 (associativity): Move to...
1835 * src/symtab.h: here.
1836 No longer include `gram.h'.
1837
c3b407f4
AD
18382002-04-07 Akim Demaille <akim@epita.fr>
1839
1840 * src/gram.h, src/gram.c (rules_rhs_length): New.
1841 (ritem_longest_rhs): Use it.
1842 * src/gram.h (rule_t): `number' is a new member.
1843 * src/reader.c (packgram): Set it.
1844 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1845 the end of `rules', and count them out of `nrules'.
1846 (reduce_output, dump_grammar): Adjust.
1847 * src/print.c (print_grammar): It is no longer needed to check for
1848 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1849 * tests/reduce.at (Reduced Automaton): New test.
1850
11652ab3
AD
18512002-04-07 Akim Demaille <akim@epita.fr>
1852
1853 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1854 lacking `+ 1' to nrules, Bison reported as useless a token if it
1855 was used solely to set the precedence of the last rule...
1856
26b23c1a
AD
18572002-04-07 Akim Demaille <akim@epita.fr>
1858
1859 * data/bison.c++, data/bison.simple: Don't output the current file
1860 name in #line, to avoid useless diffs between two identical
1861 outputs under different names.
1862
18bcecb0
AD
18632002-04-07 Akim Demaille <akim@epita.fr>
1864
1865 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1866 Normalize loops to using `< nrules + 1', not `<= nrules'.
1867
fa770c86
AD
18682002-04-07 Akim Demaille <akim@epita.fr>
1869
1870 * TODO: Update.
1871
d9b739c3
AD
18722002-04-07 Akim Demaille <akim@epita.fr>
1873
1874 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1875 bucket.value as bucket.number.
1876
99013900
AD
18772002-04-07 Akim Demaille <akim@epita.fr>
1878
1879 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1880 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1881 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1882 RHS, instead of being an index in RITEMS.
1883
e966383b
PE
18842002-04-04 Paul Eggert <eggert@twinsun.com>
1885
1886 * doc/bison.texinfo: Update copyright date.
1887 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1888 (Symbols): Warn about running Bison in one character set,
1889 but compiling and/or running in an incompatible one.
1890 Warn about character code 256, too.
1891
18922002-04-03 Paul Eggert <eggert@twinsun.com>
1893
1894 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1895 YYERROR_VERBOSE is nonzero, not whether it is defined.
1896
1897 Merge changes from bison-1_29-branch.
c307773e 1898
8d6c48b9
PE
18992002-03-20 Paul Eggert <eggert@twinsun.com>
1900
1901 Merge fixes from Debian bison_1.34-1.diff.
1902
1903 * configure.in (AC_PREREQ): 2.53.
1904
e53c6322
AD
19052002-03-20 Akim Demaille <akim@epita.fr>
1906
1907 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1908
9ffbeca7
PE
19092002-03-19 Paul Eggert <eggert@twinsun.com>
1910
21db0b2a
PE
1911 * src/bison.simple (YYCOPY): New macro.
1912 (YYSTACK_RELOCATE): Use it.
1913 Remove Type arg; no longer needed. All callers changed.
1914 (yymemcpy): Remove; no longer needed.
1915
9ffbeca7
PE
1916 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1917 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1918
642cb8f8
AD
19192002-03-19 Akim Demaille <akim@epita.fr>
1920
1921 Test and fix the #line outputs.
1922
1923 * tests/atlocal.at (GCC): New.
1924 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1925 (Prologue synch line, ,%union synch line, Postprologue synch line)
1926 (Action synch line, Epilogue synch line): New tests.
1927 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1928 * data/bison.simple, data/bison.c++: Use it.
1929
3c31a486
AD
19302002-03-19 Akim Demaille <akim@epita.fr>
1931
1932 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1933 (Solved SR Conflicts, %expect not enough, %expect right)
1934 (%expect too much): Move to...
1935 * tests/conflicts.at: this new file.
1936
0d8bed56
AD
19372002-03-19 Akim Demaille <akim@epita.fr>
1938
1939 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1940 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1941 that we can move to enums for instance.
1942 * src/output.c (token_definitions_output): Output a list of
1943 `token-name, token-number' instead of the #define.
1944 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1945
9208d17f
AD
19462002-03-14 Akim Demaille <akim@epita.fr>
1947
1948 Use Gettext 0.11.1.
1949
af27eacb
RA
19502002-03-09 Robert Anisko <robert@lrde.epita.fr>
1951
1952 * data/bison.c++: Make the user able to add members to the generated
1953 parser by subclassing.
1954
9101a310
RA
19552002-03-05 Robert Anisko <robert@lrde.epita.fr>
1956
1957 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1958 a character.
1959 Reported by Nicolas Tisserand and Nicolas Burrus.
1960
fff9bf0b
RA
19612002-03-04 Robert Anisko <robert@lrde.epita.fr>
1962
1963 * src/reader.c: Warn about lacking semi-colons, do not complain.
1964
64dba31e
RA
19652002-03-04 Robert Anisko <robert@lrde.epita.fr>
1966
1967 * data/bison.c++: Remove a debug line.
1968
374f5a14
RA
19692002-03-04 Robert Anisko <robert@lrde.epita.fr>
1970
1971 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1972 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1973 provide a default implementation.
1974
bfcf1f3a
AD
19752002-03-04 Akim Demaille <akim@epita.fr>
1976
1977 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1978 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1979 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1980 * tests/semantic.at (Parsing Guards): Similarly.
1981 * src/reader.at (readgram): Complain if the last rule is not ended
1982 with a semi-colon.
1983
65ccf9fc
AD
19842002-03-04 Akim Demaille <akim@epita.fr>
1985
1986 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1987 * src/closure.c: here.
1988 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1989 RTC.
1990 * src/warshall.h, src/warshall.c: Remove.
1991 * tests/sets.at (Broken Closure): Adjust.
1992
d0039cbc
AD
19932002-03-04 Akim Demaille <akim@epita.fr>
1994
1995 * src/output.c (output_skeleton): tempdir is const.
1996 bytes_read is unused.
1997
345cea78
AD
19982002-03-04 Akim Demaille <akim@epita.fr>
1999
2000 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2001 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
2002 Update.
2003 From Michael Hayes.
2004
564801f7
AD
20052002-03-04 Akim Demaille <akim@epita.fr>
2006
2007 * src/closure.c (closure): `r' is unused.
2008
e5352bc7
AD
20092002-03-04 Akim Demaille <akim@epita.fr>
2010
2011 * tests/sets.at (Broken Closure): Add the ending `;'.
2012 * src/reader.at (readgram): Complain if a rule is not ended with a
2013 semi-colon.
2014
914feea9
AD
20152002-03-04 Akim Demaille <akim@epita.fr>
2016
2017 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
2018 (count_sr_conflicts): Use bitset_count.
2019 * src/reduce.c (inaccessable_symbols): Ditto.
2020 (bits_size): Remove.
2021 * src/warshall.h, src/warshall.c: Convert to bitsetv.
2022
f0250de6
AD
20232002-03-04 Akim Demaille <akim@epita.fr>
2024
2025 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
2026 * src/reduce.c: Remove the `bitset_zero's following the
2027 `bitset_create's, as now it is performed by the latter.
2028
ef017502
AD
20292002-03-04 Akim Demaille <akim@epita.fr>
2030
2031 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
2032 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
2033 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
2034 latest sources from Michael.
2035
76514394
AD
20362002-03-04 Akim Demaille <akim@epita.fr>
2037
2038 * src/output.c (output): Don't free the grammar.
2039 * src/reader.c (grammar_free): New.
2040 * src/main.c (main): Call it and don't free symtab here.
2041
55024580
AD
20422002-03-04 Akim Demaille <akim@epita.fr>
2043
2044 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
2045 before returning.
2046 Reported by Benoit Perrot.
2047
f9abaa2c
AD
20482002-03-04 Akim Demaille <akim@epita.fr>
2049
2050 Use bitset operations when possible, not loops over bits.
2051
2052 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
2053 bitset_or.
2054 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
2055 * src/reduce.c (useless_nonterminals): Formatting changes.
2056 * src/warshall.c (TC): Use bitset_or.
2057
0e721e75
AD
20582002-03-04 Akim Demaille <akim@epita.fr>
2059
2060 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
2061 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
2062 Ditto.
2063
0fb1ffb1
AD
20642002-03-04 Akim Demaille <akim@epita.fr>
2065
2066 * src/lalr.c (F): Now a bitset*.
2067 Adjust all dependencies.
2068
b86796bf
AD
20692002-03-04 Akim Demaille <akim@epita.fr>
2070
2071 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
2072 Adjust all dependencies.
2073
602bbf31
AD
20742002-03-04 Akim Demaille <akim@epita.fr>
2075
2076 * src/L0.c, src/LR0.h (nstates): Be size_t.
2077 Adjust comparisons (signed vs unsigned).
2078 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
2079 bitset*.
2080 Adjust all dependencies.
2081
d8a0245c
AD
20822002-03-04 Akim Demaille <akim@epita.fr>
2083
2084 * src/closure.c (firsts): Now, also a bitset.
2085 Adjust all dependencies.
2086 (varsetsize): Remove, now unused.
2087 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2088
34ba9743
AD
20892002-03-04 Akim Demaille <akim@epita.fr>
2090
2091 * src/print.c: Convert to use bitset.h, not hand coded iterations
2092 over ints.
2093
ed86e78c
AD
20942002-03-04 Akim Demaille <akim@epita.fr>
2095
2096 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2097
dfdb1797
AD
20982002-03-04 Akim Demaille <akim@epita.fr>
2099
2100 * src/closure.c (ruleset): Be a bitset.
2101 (rulesetsize): Remove.
2102
7086e707
AD
21032002-03-04 Akim Demaille <akim@epita.fr>
2104
2105 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2106 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2107 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2108 * src/closure.c (fderives): Be an array of bitsets.
2109
98254360
RA
21102002-02-28 Robert Anisko <robert@lrde.epita.fr>
2111
2112 * data/bison.c++: Merge the two generated headers. Insert a copyright
2113 notice in each output file.
2114
a75c057f
AD
21152002-02-28 Akim Demaille <akim@epita.fr>
2116
2117 * data/bison.c++: Copy the prologue of bison.simple to fetch
2118 useful M4 definitions, such as b4_header_guard.
2119
06b00abc
AD
21202002-02-25 Akim Demaille <akim@epita.fr>
2121
2122 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
2123 translator friendly scheme for the bgr
2124 copyright notice.
06b00abc 2125
70e7d534
AD
21262002-02-25 Akim Demaille <akim@epita.fr>
2127
2128 * src/output.c (header_output): Remove, now handled completely via
2129 M4.
2130
abe017f6
AD
21312002-02-25 Akim Demaille <akim@epita.fr>
2132
2133 * m4/m4.m4: New, from CVS Autoconf.
2134 * configure.in: Invoke it.
2135 * src/output.c (output_skeleton): Use its result instead of the
2136 hard coded name.
2137
381fb12e
AD
21382002-02-25 Akim Demaille <akim@epita.fr>
2139
2140 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2141 Fileutils 4.1.5.
2142 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2143 * src/output.c (output_skeleton): Use mkstemp to create a real
2144 temporary file.
2145 Move the filling of `skeleton' and its muscle to...
2146 (prepare): here.
2147 (output): Move the definition of the prologue muscle to...
2148 (prepare): here.
2149 * src/system.h (DEFAULT_TMPDIR): New.
2150
6f38107f
PE
21512002-02-14 Paul Eggert <eggert@twinsun.com>
2152
2153 Remove the support for C++ namespace cleanliness; it was
2154 causing more problems than it was curing, since it didn't work
2155 properly on some nonstandard C++ compilers. This can wait
2156 for a proper C++ parser.
2157
2158 * NEWS: Document this.
2159 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2160 of C++, as it's treated like C now.
2161 * src/bison.simple (YYSTD): Remove.
2162 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2163 Treat C++ just like Standard C instead of trying to support
2164 namespace cleanliness.
2165
80cce3da
AD
21662002-02-14 Akim Demaille <akim@epita.fr>
2167
2168 * tests/regression.at (else): Adjust to Andreas' change.
2169
842e8679
AD
21702002-02-14 Akim Demaille <akim@epita.fr>
2171
2172 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2173
4bda3f10
AD
21742002-02-13 Andreas Schwab <schwab@suse.de>
2175
2176 * src/output.c (output_rule_data): Don't output NULL, it might
2177 not be defined yet.
2178
4162fa07 21792002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 2180
4162fa07
RA
2181 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2182 (Copyright notice): Update.
b418ecd8 2183
bd16a5dc
AD
21842002-02-11 Akim Demaille <akim@epita.fr>
2185
2186 * tests/regression.at (%nonassoc and eof): Don't include
2187 nonportable headers.
2188
8d69a1a3
RA
21892002-02-08 Robert Anisko <robert@lrde.epita.fr>
2190
2191 * data/bison.c++: Correct error recovery. Make the user able to
2192 initialize the starting location.
2193
9b2d0677
AD
21942002-02-07 Akim Demaille <akim@epita.fr>
2195
2196 * tests/input.at: New.
2197
69e2658b
RA
21982002-02-07 Robert Anisko <robert@lrde.epita.fr>
2199
2200 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 2201 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
2202 directives around tables only needed for debugging.
2203
4aacc3a7
RA
22042002-02-07 Robert Anisko <robert@lrde.epita.fr>
2205
2206 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2207 C++ parsers.
2208 (yy::b4_name::parse): Use print_.
2209
762a801e
RA
22102002-02-07 Robert Anisko <robert@lrde.epita.fr>
2211
2212 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2213
4bb2bc3f
RA
22142002-02-07 Robert Anisko <robert@lrde.epita.fr>
2215
2216 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2217 C++ parsers.
2218 (yy::b4_name::parse): Build verbose error messages, and use error_.
2219
6b45a3ca
RA
22202002-02-06 Robert Anisko <robert@lrde.epita.fr>
2221
2222 * data/bison.c++: Fix m4 quoting in comments.
2223
50997c6e
RA
22242002-02-06 Robert Anisko <robert@lrde.epita.fr>
2225
2226 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2227 not expanded by m4.
2228
3f3eed27
AD
22292002-02-05 Akim Demaille <akim@epita.fr>
2230
2231 * data/bison.c++: Adjust to the M4 back end.
2232 More is certainly needed.
2233
be2a1a68
AD
22342002-02-05 Akim Demaille <akim@epita.fr>
2235
2236 Give a try to M4 as a back end.
2237
2238 * lib/readpipe.c: New, from wdiff.
2239 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2240 BISON_HAIRY.
2241 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2242 specific values. Now it is m4 that performs the lookup.
2243 * src/parse-skel.y: Remove.
2244 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2245 * src/output.c (actions_output, guards_output)
2246 (token_definitions_output): No longer keeps track of the output
2247 line number, hence remove the second argument.
2248 (guards_output): Check against the guard member of a rule, not the
2249 action member.
2250 Adjust callers.
2251 (output_skeleton): Don't look for the skeleton location, let m4 do
2252 that.
2253 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2254 file will be used.
2255 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2256 (prepare): Given that for the time being changesyntax is not
2257 usable in M4, rename the muscles using `-' to `_'.
2258 Define `defines_flag', `output_parser_name' and `output_header_name'.
2259 * src/output.h (actions_output, guards_output)
2260 (token_definitions_output): Adjust prototypes.
2261 * src/scan-skel.l: Instead of scanning the skeletons, it now
2262 processes the output of m4: `__oline__' and `#output'.
2263 * data/bison.simple: Adjust to be used by M4(sugar).
2264 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2265 to date.
2266 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2267 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2268 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2269 shamelessly stolen from CVS Autoconf.
2270
beda758b
AD
22712002-02-05 Akim Demaille <akim@epita.fr>
2272
2273 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2274 * configure.in: Check for the declarations of free and malloc.
2275 * src/muscle_tab.c: Adjust.
2276
5ece6d43
AD
22772002-02-05 Akim Demaille <akim@epita.fr>
2278
2279 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2280 which have no values.
2281
5bb18f9a
AD
22822002-02-05 Akim Demaille <akim@epita.fr>
2283
2284 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2285 * data/: here.
2286
894dd62e
PE
22872002-01-29 Paul Eggert <eggert@twinsun.com>
2288
2289 * src/bison.simple (YYSIZE_T): Do not define merely because
2290 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2291 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2292
82841af7
AD
22932002-01-27 Akim Demaille <akim@epita.fr>
2294
2295 Fix `%nonassoc and eof'.
2296
2297 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2298 which were not properly copied! Replace
2299 memcpy (res->errs, src->errs, src->nerrs);
2300 with
2301 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2302 !!!
2303 * tests/regression.at (%nonassoc and eof): Adjust to newest
2304 Autotest: `.' is not in the PATH.
2305
318b76e9
AD
23062002-01-27 Akim Demaille <akim@epita.fr>
2307
2308 * tests/sets.at (AT_EXTRACT_SETS): New.
2309 (Nullable): Use it.
2310 (Firsts): New.
2311
30d2f3d5
AD
23122002-01-26 Akim Demaille <akim@epita.fr>
2313
2314 * tests/actions.at, tests/calc.at, tests/headers.at,
2315 * tests/torture.at: Adjust to the newest Autotest which no longer
2316 forces `.' in the PATH.
2317
30f8c395
AD
23182002-01-25 Akim Demaille <akim@epita.fr>
2319
2320 * tests/regression.at (%nonassoc and eof): New.
2321 Suggested by Robert Anisko.
2322
29ae55f1
AD
23232002-01-24 Akim Demaille <akim@epita.fr>
2324
2325 Bison dumps core when trying to complain about broken input files.
2326 Reported by Cris van Pelt.
2327
2328 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2329 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2330 into...
2331 (Invalid inputs): Strengthen: exercise parse_percent_token.
2332
2b548aa6
RA
23332002-01-24 Robert Anisko <robert.anisko@epita.fr>
2334
2335 * src/Makefile.am: Add bison.c++.
2336 * src/bison.c++: New skeleton.
2337
bb0146c2
AD
23382002-01-21 Paolo Bonzini <bonzini@gnu.org>
2339
2340 * po/it.po: New.
2341
bec30531
AD
23422002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2343
2344 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2345
fc6edc45
MA
23462002-01-20 Marc Autret <marc@gnu.org>
2347
2348 * src/files.c (compute_output_file_names): Fix
2349
5e5d5415
MA
23502002-01-20 Marc Autret <marc@gnu.org>
2351
2352 * tests/output.at: New test.
2353 * src/files.c (compute_base_names): Don't map extensions when
2354 the YACC flag is set, use defaults.
2355 Reported by Evgeny Stambulchik.
2356
44ea3fbd
MA
23572002-01-20 Marc Autret <marc@gnu.org>
2358
bb0146c2 2359 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
2360 compilers as well (i.e. the vendor C compiler).
2361 Suggested by Albert Chin-A-Young.
2362
338963d1
TVH
23632002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2364
2365 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2366 canonical definition.
2367 * src/system.h: Use the canonical definition for PARAMS (avoids
2368 a conflict with the macro from lib/hash.h).
2369
c57b2479
AD
23702002-01-11 Akim Demaille <akim@epita.fr>
2371
2372 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 2373 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 2374
b85810ae
AD
23752002-01-09 Akim Demaille <akim@epita.fr>
2376
2377 * src/files.c, src/files.h (output_infix): New.
2378 (tab_extension): Remove.
2379 (compute_base_names): Compute the former, drop the latter.
2380 * src/output.c (prepare): Insert the muscles `output-infix', and
2381 `output-suffix'.
2382 * src/parse-skel.y (string, string.1): New.
2383 (section.header): Use it.
2384 (section.yacc): Remove.
2385 (prefix): Remove too.
2386 * src/scan-skel.l: Adjust.
2387 * src/bison.simple, src/bison.hairy: Adjust.
2388
cae60122
AD
23892002-01-09 Akim Demaille <akim@epita.fr>
2390
2391 * configure.in (WERROR_CFLAGS): Compute it.
2392 * src/Makefile.am (CFLAGS): Pass it.
2393 * tests/atlocal.in (CFLAGS): Idem.
2394 * src/files.c: Fix a few warnings.
2395 (get_extension_index): Remove, unused.
2396
ae404801
AD
23972002-01-08 Akim Demaille <akim@epita.fr>
2398
2399 * src/getargs.c (AS_FILE_NAME): New.
2400 (getargs): Use it to convert DOSish file names.
2401 * src/files.c (base_name): Rename as full_base_name to avoid
2402 clashes with `base_name ()'.
2403 (filename_split): New.
2404 (compute_base_names): N-th rewrite, using filename_split.
2405
22312b71
AD
24062002-01-08 Akim Demaille <akim@epita.fr>
2407
2408 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2409 New, stolen from the Fileutils 4.1.
2410 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2411 * configure.in: Check for the presence of memrchr, and of its
2412 prototype.
2413
a67cef01
TVH
24142002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2415
2416 * lib/hash.h (__P): Added definition for this macro.
2417 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2418 BUILT_SOURCES, to ensure they are generated first.
2419 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2420 %error-verbose to allow bootstrapping with bison 1.30x.
2421
2b25d624
AD
24222002-01-06 Akim Demaille <akim@epita.fr>
2423
2424 * src/reader.c (parse_braces): Don't fetch the next char, the
2425 convention is to fetch on entry.
2426 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2427 'switch' without a following semicolon.
2428 * tests/regression.at (braces parsing): New.
2429
3460813b
AD
24302002-01-06 Akim Demaille <akim@epita.fr>
2431
2432 Bison is dead wrong in its RR conflict reports.
2433
2434 * tests/torture.at (GNU Cim Grammar): New.
2435 * src/conflicts.c (count_rr_conflicts): Fix.
2436
73784c64
AD
24372002-01-06 Akim Demaille <akim@epita.fr>
2438
2439 Creating package.m4 from configure.ac causes too many problems.
2440
2441 * tests/Makefile.am (package.m4): Create it by hand,
2442 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2443
25d81090
AD
24442002-01-06 Akim Demaille <akim@epita.fr>
2445
2446 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2447 skeleton.h.
2448
a9b8959e
PE
24492002-01-04 Paul Eggert <eggert@twinsun.com>
2450
2451 * doc/bison.texinfo (Debugging):
2452 Remove YYSTDERR; it's no longer defined or used.
2453 Also, s/cstdio.h/cstdio/.
2454
25d81090
AD
24552002-01-03 Akim Demaille <akim@epita.fr>
2456
2457 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2458
1109455c
AD
24592002-01-03 Akim Demaille <akim@epita.fr>
2460
2461 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2462 tracing code to --trace, wait for a better --trace option, with
2463 args.
2464
7ea5e977
AD
24652002-01-03 Akim Demaille <akim@epita.fr>
2466
2467 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2468 The ISO C++ standard is extremely clear about it: stderr is
2469 considered a macro, not a regular symbol (see table 94 `Header
2470 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2471 Therefore std:: does not apply to it. It still does with fprintf.
2472 Also, s/cstdio.h/cstdio/.
2473
fab5b110
AD
24742002-01-03 Akim Demaille <akim@epita.fr>
2475
2476 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2477 for non system headers.
2478
aed7fd9b
AD
24792002-01-02 Akim Demaille <akim@epita.fr>
2480
2481 Equip the skeleton chain with location tracking, runtime trace,
2482 pure parser and scanner.
2483
2484 * src/parse-skel.y: Request a pure parser, locations, and prefix
2485 renaming.
2486 (%union): Having several members with the same type does not help
2487 type mismatches, simplify.
2488 (YYPRINT, yyprint): New.
2489 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2490 (skel_error): this.
2491 Handle locations.
2492 * src/scan-skel.l: Adjust to these changes.
2493 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2494 (LOCATION_PRINT, skel_control_t): New.
2495
24fad99e
AD
24962001-12-30 Akim Demaille <akim@epita.fr>
2497
2498 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2499 replace `gb' with BLANKS.
2500 * src/scan-skel.l: Adjust.
2501
a4b36db4
AD
25022001-12-30 Akim Demaille <akim@epita.fr>
2503
2504 * src/system.h: We don't need nor want bcopy.
2505 Throw away MS-DOS crap: we don't need getpid.
2506 * configure.in: We don't need strndup. It was even causing
2507 problems: because Flex includes the headers *before* us,
2508 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2509 not visible.
2510 * lib/xstrndup.c: New.
2511 * src/scan-skel.l: Use it.
2512 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2513 * src/parse-skel.y: Use %directives instead of #defines.
2514
1239777d
AD
25152001-12-30 Akim Demaille <akim@epita.fr>
2516
2517 * src/skeleton.h: New.
2518 * src/output.c (output_parser, output_master_parser): Remove, dead
2519 code.
2520 * src/output.h (get_lines_number, actions_output, guards_output)
2521 (token_definitions_output): Prototype them.
2522 * src/parse-skel.y: Add the license notice.
2523 Include output.h and skeleton.h.
2524 (process_skeleton): Returns void, and takes a single parameter.
2525 * src/scan-skel.l: Add the license notice.
2526 Include skeleton.h.
2527 Don't use %option yylineno: it seems that then Flex imagines
2528 REJECT has been used, and therefore it won't reallocate its
2529 buffers (which makes no other sense to me than a bug). It results
2530 in warnings for `unused: yy_flex_realloc'.
2531
9b3add5b
RA
25322001-12-30 Robert Anisko <robert.anisko@epita.fr>
2533
2534 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2535 (MUSCLE_INSERT_PREFIX): ...to there.
2536 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2537 (MUSCLE_INSERT_PREFIX): Move from here...
2538
2539 * src/bison.hairy: Add a section directive. Put braces around muscle
2540 names. This parser skeleton is still broken, but Bison should not
2541 choke on a bad muscle 'syntax'.
2542 * src/bison.simple: Add a section directive. Put braces around muscle
2543 names.
2544
2545 * src/files.h (strsuffix, stringappend): Add declarations.
2546 (tab_extension): Add declaration.
2547 (short_base_name): Add declaration.
2548
2549 * src/files.c (strsuffix, stringappend): No longer static. These
2550 functions are used in the skeleton parser.
2551 (tab_extension): New.
2552 (compute_base_names): Use the computations done in this function
fab5b110 2553 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
2554 names.
2555 (short_base_name): No longer static.
2556
2557 * src/output.c (output_skeleton): New.
2558 (output): Disable call to output_master_parser, and give a try to
2559 a new skeleton handling system.
2560 (guards_output, actions_output): No longer static.
2561 (token_definitions_output, get_lines_number): No longer static.
2562
2563 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2564
fab5b110 2565 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
2566 parse-skel.y.
2567
2568 * src/parse-skel.y: New file.
2569 * src/scan-skel.l: New file.
2570
b5b61c61
AD
25712001-12-29 Akim Demaille <akim@epita.fr>
2572
2573 %name-prefix is broken.
2574
2575 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2576 Adjust all dependencies.
2577 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2578 %name-prefix.
2579
2580 Renaming yylval but not yylloc is not consistent. Now we do.
2581
2582 * src/bison.simple: Prefix yylloc if used.
2583 * doc/bison.texinfo (Decl Summary): Document that.
2584
8c9a50be
AD
25852001-12-29 Akim Demaille <akim@epita.fr>
2586
2587 * doc/bison.texinfo: Promote `%long-directive' over
2588 `%long_directive'.
2589 Remove all references to fixed-output-files, yacc is enough.
2590
d99361e6
AD
25912001-12-29 Akim Demaille <akim@epita.fr>
2592
2593 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2594 user prologue. These are defaults.
2595 * tests/actions.at (Mid-rule actions): Make sure the user can
2596 define YYDEBUG and YYERROR_VERBOSE.
2597
b9cecb91
AD
25982001-12-29 Akim Demaille <akim@epita.fr>
2599
2600 * src/output.c (header_output): Don't forget to export YYLTYPE and
2601 yylloc.
2602 * tests/headers.at (export YYLTYPE): New, make sure it does.
2603 * tests/regression.at (%union and --defines, Invalid CPP headers):
2604 Move to...
2605 * tests/headers.at: here.
2606
aea13e97
AD
26072001-12-29 Akim Demaille <akim@epita.fr>
2608
2609 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2610
931394cb
AD
26112001-12-29 Akim Demaille <akim@epita.fr>
2612
2613 * tests/actions.at (Mid-rule actions): Output on a single line
2614 instead of several.
2615
704a47c4
AD
26162001-12-29 Akim Demaille <akim@epita.fr>
2617
2618 * doc/bison.texinfo: Formatting changes.
2619
091e20bb
AD
26202001-12-29 Akim Demaille <akim@epita.fr>
2621
2622 Don't store the token defs in a muscle, just be ready to output it
2623 on command. Now possible via `symbols'. Fixes a memory leak.
2624
2625 * src/output.c (token_definitions_output): New.
2626 (output_parser, header_output): Use it.
2627 * src/reader.c (symbols_save): Remove.
2628
cce71710
AD
26292001-12-29 Akim Demaille <akim@epita.fr>
2630
2631 * src/bison.simple: Do not provide a default for YYSTYPE and
2632 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2633 default.
2634
82c035a8
AD
26352001-12-29 Akim Demaille <akim@epita.fr>
2636
2637 Mid-rule actions are simply... ignored!
2638
2639 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2640 the empty-rule associated to the dummy symbol, not to the host
2641 rule.
2642 * tests/actions.at (Mid-rule actions): New.
2643
8419d367
AD
26442001-12-29 Akim Demaille <akim@epita.fr>
2645
2646 Memory leak.
2647
2648 * src/reader.c (reader): Free grammar.
2649
375d5806
AD
26502001-12-29 Akim Demaille <akim@epita.fr>
2651
2652 Memory leak.
2653
2654 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2655 since it allocates it for each state, although only one is needed.
2656 (allocate_storage): Do it here.
2657
f51cb8ff
AD
26582001-12-29 Akim Demaille <akim@epita.fr>
2659
2660 * src/options.h, src/options.c (create_long_option_table): Rename
2661 as...
2662 (long_option_table_new): this, with a clearer prototype.
2663 (percent_table): Remove, unused,
2664 * src/getargs.c (getargs): Adjust.
2665
29e88316
AD
26662001-12-29 Akim Demaille <akim@epita.fr>
2667
2668 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2669 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2670 as states.
2671
b9f71f19
AD
26722001-12-29 Akim Demaille <akim@epita.fr>
2673
2674 * src/lalr.c (build_relations): Rename `states' as `states1'.
2675 Sorry, I don't understand exactly what it is, no better name...
2676
1a2b5d37
AD
26772001-12-29 Akim Demaille <akim@epita.fr>
2678
2679 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2680 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2681 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2682 as rules.
2683
1cca533e
AD
26842001-12-29 Akim Demaille <akim@epita.fr>
2685
2686 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2687 ago.
2688
c03ae966
AD
26892001-12-29 Akim Demaille <akim@epita.fr>
2690
2691 * src/reader.c, src/reader.h (user_toknums): Remove.
2692 Adjust all users to use symbols[i]->user_token_number.
2693
5a670b1e
AD
26942001-12-29 Akim Demaille <akim@epita.fr>
2695
2696 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2697 Adjust all users to use symbols[i]->prec or ->assoc.
2698
ad949da9
AD
26992001-12-29 Akim Demaille <akim@epita.fr>
2700
2701 * src/reader.c, src/reader.h (tags): Remove.
2702 Adjust all users to use symbols[i]->tag.
2703
0e78e603
AD
27042001-12-29 Akim Demaille <akim@epita.fr>
2705
2706 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2707 and rule_table.
2708 * src/reader.c (packsymbols): Fill this table.
2709 Drop sprec.
2710 * src/conflicts.c (resolve_sr_conflict): Adjust.
2711 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2712 single table.
2713 Use symbols[i]->tag instead of tags[i].
2714
213e640e
AD
27152001-12-29 Akim Demaille <akim@epita.fr>
2716
2717 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2718 In addition, put a comment in there, to replace...
2719 * tests/regression.at (%union and C comments): Remove.
2720
e7b8bef1
AD
27212001-12-29 Akim Demaille <akim@epita.fr>
2722
2723 * tests/regression.at (Web2c Actions): Blindly move the actual
2724 output as expected output. The contents *seem* right to me, but I
2725 can't pretend reading perfectly parser tables... Nonetheless, all
2726 the other tests pass correctly, the table look OK, even though the
2727 presence of `$axiom' is to be noted: AFAICS it is useless (but
2728 harmless).
2729
b68e7744
AD
27302001-12-29 Akim Demaille <akim@epita.fr>
2731
2732 * src/reader.c (readgram): Don't add the rule 0 if there were no
2733 rules read. In other words, add it _after_ having performed
2734 grammar sanity checks.
2735 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2736
78d5bae9
AD
27372001-12-29 Akim Demaille <akim@epita.fr>
2738
2739 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2740 visible, and some states have now a different number.
2741
ff442794
AD
27422001-12-29 Akim Demaille <akim@epita.fr>
2743
2744 * src/reader.c (readgram): Bind the initial rule's lineno to that
2745 of the first rule.
2746 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2747 (Solved SR Conflicts): Adjust rule 0's line number.
2748
610ab194
AD
27492001-12-29 Akim Demaille <akim@epita.fr>
2750
2751 Fix the `GAWK Grammar' failure.
2752
2753 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2754 the reductions of the first state which was mistakenly confused
2755 with the final state because precisely final_state was initialized
2756 to 0.
2757 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2758 now noticed by Bison.
2759 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2760 have a reduction on $default.
2761
29d29c8f
AD
27622001-12-29 Akim Demaille <akim@epita.fr>
2763
2764 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2765 rule line numbers.
2766 * src/closure.c (print_closure): Likewise.
2767 * src/derives.c (print_derives): Likewise.
2768 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2769 now.
2770
7c6b64d0
AD
27712001-12-29 Akim Demaille <akim@epita.fr>
2772
2773 * src/lalr.c (lookaheads_print): New.
2774 (lalr): Call it when --trace-flag.
2775 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2776 are dumped.
2777
3d4daee3
AD
27782001-12-29 Akim Demaille <akim@epita.fr>
2779
2780 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2781 when walking through ritem, even via rule->rhs.
2782 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2783 (useful_production, useless_nonterminals): Likewise.
2784 (reduce_grammar_tables): Likewise, plus update nritems.
2785 * src/nullable.c (set_nullable): Likewise.
2786 * src/lalr.c (build_relations): Likewise.
2787 * tests/sets.at (Nullable): Adjust.
2788 Fortunately, now, the $axiom is no longer nullable.
2789
9e7f6bbd
AD
27902001-12-29 Akim Demaille <akim@epita.fr>
2791
2792 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2793 the 0-sentinel.
2794 * src/gram.c (ritem_longest_rhs): Likewise.
2795 * src/reduce.c (nonterminals_reduce): Likewise.
2796 * src/print_graph.c (print_graph): Likewise.
2797 * src/output.c (output_rule_data): Likewise.
2798 * src/nullable.c (set_nullable): Likewise.
2799
255ef638
AD
28002001-12-29 Akim Demaille <akim@epita.fr>
2801
2802 * src/output.c: Comment changes.
2803
0d8a7363
AD
28042001-12-27 Paul Eggert <eggert@twinsun.com>
2805
2806 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2807 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2808 Sparc, as they were causing more porting problems than the
2809 (minor) performance improvement was worth.
2810
2811 Also, catch up with 1.31's YYSTD.
2812
3db472b9
AD
28132001-12-27 Akim Demaille <akim@epita.fr>
2814
2815 * src/output.c (output_gram): Rely on nritems, not the
2816 0-sentinel. See below.
2817 Use -1 as separator, not 0.
2818 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2819 Rely on -1 as separator in yyrhs, instead of 0.
2820 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2821 twice `Now at end of input', therefore there are two lines less to
2822 expect.
2823
b365aa05
AD
28242001-12-27 Akim Demaille <akim@epita.fr>
2825
2826 * tests/regression.at (Unresolved SR Conflicts):
2827 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2828 below.
2829
30171f79
AD
28302001-12-27 Akim Demaille <akim@epita.fr>
2831
2832 * src/LR0.c (new_state): Recognize the final state by the fact it
2833 is reached by eoftoken.
2834 (insert_start_shifting_state, insert_eof_shifting_state)
2835 (insert_accepting_state, augment_automaton): Remove, since now
2836 these states are automatically computed from the initial state.
2837 (generate_states): Adjust.
2838 * src/print.c: When reporting a rule number to the user, substract
2839 1, so that the axiom rule is rule 0, and the first user rule is 1.
2840 * src/reduce.c: Likewise.
2841 * src/print_graph.c (print_core): For the time being, just as for
2842 the report, depend upon --trace-flags to dump the full set of
2843 items.
2844 * src/reader.c (readgram): Once the grammar read, insert the rule
2845 0: `$axiom: START-SYMBOL $'.
2846 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2847 number of the states has changed (the final state is no longer
2848 necessarily the last), catch up.
2849
75142d45
AD
28502001-12-27 Akim Demaille <akim@epita.fr>
2851
2852 Try to make the use of the eoftoken valid. Given that its value
2853 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2854 is used instead of > 0 where appropriate, (ii), depend upon nritems
2855 instead of the 0-sentinel.
2856
2857 * src/gram.h, src/gram.c (nritems): New.
2858 Expected to be duplication of nitems, but for the time being...
2859 * src/reader.c (packgram): Assert nritems and nitems are equal.
2860 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2861 * src/closure.c (print_closure, print_fderives): Likewise.
2862 * src/gram.c (ritem_print): Likewise.
2863 * src/print.c (print_core, print_grammar): Likewise.
2864 * src/print_graph.c: Likewise.
2865
b7c49edf
AD
28662001-12-27 Akim Demaille <akim@epita.fr>
2867
2868 * src/main.c (main): If there are complains after grammar
2869 reductions, then output the report anyway if requested, then die.
2870 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2871 * src/reader.c (eoftoken): New.
2872 (parse_token_decl): If the token being defined has value `0', it
2873 is the eoftoken.
2874 (packsymbols): No longer hack `tags' to insert `$' by hand.
2875 Be sure to preserve the value of the eoftoken.
2876 (reader): Make sure eoftoken is defined.
2877 Initialize nsyms to 0: now eoftoken is created just like the others.
2878 * src/print.c (print_grammar): Don't special case the eof token.
2879 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2880 lie anyway, albeit pleasant.
2881 * tests/calc.at: Exercise error messages with eoftoken.
2882 Change the grammar so that empty input is invalid.
2883 Adjust expectations.
2884 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2885
ec2da99f
AD
28862001-12-27 Akim Demaille <akim@epita.fr>
2887
2888 * configure.in: Check the protos of strchr ans strspn.
2889 Replace strchr if needed.
2890 * src/system.h: Provide the protos of strchr, strspn and memchr if
2891 missing.
2892 * lib/strchr.c: New.
2893 * src/reader.c (symbols_save): Use strchr.
2894
8adfa272
AD
28952001-12-27 Akim Demaille <akim@epita.fr>
2896
2897 * src/print.c, src/print_graph.c (escape): New.
2898 Use it to quote the TAGS outputs.
2899 * src/print_graph.c (print_state): Now errors are in red, and
2900 reductions in green.
2901 Prefer high to wide: output the state number on a line of its own.
2902
80dac38c
AD
29032001-12-27 Akim Demaille <akim@epita.fr>
2904
2905 * src/state.h, src/state.c (reductions_new): New.
2906 * src/LR0.c (set_state_table): Let all the states have a
2907 `reductions', even if reduced to 0.
2908 (save_reductions): Adjust.
2909 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2910 * src/print.c (print_reductions, print_actions): Adjust.
2911 * src/output.c (action_row): Adjust.
2912
2cec70b9
AD
29132001-12-27 Akim Demaille <akim@epita.fr>
2914
2915 * src/state.h, src/state.c (errs_new, errs_dup): New.
2916 * src/LR0.c (set_state_table): Let all the states have an errs,
2917 even if reduced to 0.
2918 * src/print.c (print_errs, print_reductions): Adjust.
2919 * src/output.c (output_actions, action_row): Adjust.
2920 * src/conflicts.c (resolve_sr_conflict): Adjust.
2921
13ca549a
AD
29222001-12-27 Akim Demaille <akim@epita.fr>
2923
2924 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2925
5092aba5
AD
29262001-12-27 Akim Demaille <akim@epita.fr>
2927
2928 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2929 * src/print.c: here.
2930 (lookaheadset, shiftset): New, used as additional storage by
2931 print_reductions.
2932 (print_results): Adjust.
2933 (print_shifts, print_gotos, print_errs): New, extracted from...
2934 (print_actions): here.
2935 * src/print_graph.c (print_actions): Remove dead code.
2936
11e2beca
AD
29372001-12-27 Akim Demaille <akim@epita.fr>
2938
2939 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2940 `$n' and `@n'.
2941
dac3c910
AD
29422001-12-27 Akim Demaille <akim@epita.fr>
2943
2944 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2945 (build_relations): Adjust.
2946
d0b0fefa
AD
29472001-12-27 Akim Demaille <akim@epita.fr>
2948
2949 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2950 duplication.
2951
adc8c848
AD
29522001-12-27 Akim Demaille <akim@epita.fr>
2953
2954 * src/reader.c (packgram): Catch nitems overflows.
2955
14d293ac
AD
29562001-12-27 Akim Demaille <akim@epita.fr>
2957
2958 * src/files.c, src/files.h (guard_obstack): Remove.
2959 * src/output.c (output): Adjust.
2960 * src/reader.c (parse_braces): New, factoring...
2961 (copy_action, copy_guard): these two which are renamed as...
2962 (parse_action, parse_guard): these.
2963 As a voluntary consequence, using braces around guards is now
2964 mandatory.
2965
f499b062
AD
29662001-12-27 Akim Demaille <akim@epita.fr>
2967
2968 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2969 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2970 members.
2971 (symbol_list_new): Adjust.
2972 (copy_action): action_line is the first line, not the last.
2973 (copy_guard): Just as for actions, store the `action' only, not
2974 the switch/case/break flesh.
2975 Don't parse the user action that might follow the guard, let...
2976 (readgram): do it, i.e., now, there can be an action after a
2977 guard.
2978 In other words the guard is just explicitly optional.
2979 (packgram): Adjust.
2980 * src/output.c (guards_output): New.
2981 (output_parser): Call it when needed.
2982 (output): Also free the guard and attrs obstacks.
2983 * src/files.c, src/files.h (obstack_save): Remove.
2984 (output_files): Remove.
2985 As a result, if one needs the former `.act' file, using an
2986 appropriate skeleton which requires actions and guards is now
2987 required.
2988 * src/main.c (main): Adjust.
2989 * tests/semantic.at: New.
2990 * tests/regression.at: Use `input.y' as input file name.
2991 Avoid 8+3 problems by requiring input.c when the test needs the
2992 parser.
2993
d945f5cd
AD
29942001-12-27 Akim Demaille <akim@epita.fr>
2995
2996 * src/reader.c (symbol_list_new): Be sure to initialize all the
2997 fields.
2998
d200e455
AD
29992001-12-27 Akim Demaille <akim@epita.fr>
3000
3001 All the hacks using a final pseudo state are now useless.
3002
3003 * src/LR0.c (set_state_table): state_table holds exactly nstates.
3004 * src/lalr.c (nLA): New.
3005 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
3006 instead of lookaheadsp from the pseudo state (nstate + 1).
3007
f9507c28
AD
30082001-12-27 Akim Demaille <akim@epita.fr>
3009
3010 * src/output.c (action_row, token_actions): Use a state_t instead
3011 of a integer, and nlookaheads instead of the following state's
3012 lookaheadsp.
3013
065fbd27
AD
30142001-12-27 Akim Demaille <akim@epita.fr>
3015
3016 * src/conflicts.c (log_resolution, flush_shift)
3017 (resolve_sr_conflict, set_conflicts, solve_conflicts)
3018 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
3019 (conflicts_print, print_reductions): Use a state_t instead of an
3020 integer when referring to a state.
3021 As much as possible, depend upon nlookaheads, instead of the
3022 `lookaheadsp' member of the following state (since lookaheads of
3023 successive states are successive, the difference between state n + 1
3024 and n served as the number of lookaheads for state n).
3025 * src/lalr.c (add_lookback_edge): Likewise.
3026 * src/print.c (print_core, print_actions, print_state)
3027 (print_results): Likewise.
3028 * src/print_graph.c (print_core, print_actions, print_state)
3029 (print_graph): Likewise.
3030 * src/conflicts.h: Adjust.
3031
1b177bd7
AD
30322001-12-27 Akim Demaille <akim@epita.fr>
3033
3034 * src/bison.hairy: Formatting/comment changes.
3035 ANSIfy.
3036 Remove `register' indications.
3037 Add plenty of `static'.
3038
7742ddeb
AD
30392001-12-27 Akim Demaille <akim@epita.fr>
3040
3041 * src/output.c (prepare): Drop the muscle `ntbase' which
3042 duplicates ntokens.
3043 * src/bison.simple: Formatting/comment changes.
3044 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
3045 is an undocumented synonym.
3046
1fa14068
AD
30472001-12-22 Akim Demaille <akim@epita.fr>
3048
3049 * src/output.c (output_table_data): Change the prototype to use
3050 `int' for array ranges: some invocations do pass an int, not a
3051 short.
3052 Reported by Wayne Green.
3053
b9752825
AD
30542001-12-22 Akim Demaille <akim@epita.fr>
3055
3056 Some actions of web2c.y are improperly triggered.
3057 Reported by Mike Castle.
3058
3059 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
3060 * tests/regression.at (Web2c): Rename as...
3061 (Web2c Report): this.
3062 (Web2c Actions): New.
3063
776209d6
AD
30642001-12-22 Akim Demaille <akim@epita.fr>
3065
3066 Reductions in web2c.y are improperly reported.
3067 Reported by Mike Castle.
3068
3069 * src/conflicts.c (print_reductions): Fix.
3070 * tests/regression.at (Web2c): New.
3071
275fc3ad
AD
30722001-12-18 Akim Demaille <akim@epita.fr>
3073
3074 Some host fail on `assert (!"foo")', which expands to
3075 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
3076 Reported by Nelson Beebee.
3077
3078 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
3079 `#define it_succeeded 0' and `assert (it_succeeded)'.
3080
897668ee
MA
30812001-12-17 Marc Autret <autret_m@epita.fr>
3082
3083 * src/bison.simple: Don't hard code the skeleton line and filename.
3084 * src/output.c (output_parser): Rename 'line' as 'output_line'.
3085 New line counter 'skeleton_line' (skeleton-line muscle).
3086
ab3399e0
PE
30872001-12-17 Paul Eggert <eggert@twinsun.com>
3088
3089 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3090 YYDEBUG must be defined to a nonzero value.
3091
3092 * src/bison.simple (yytname): Do not assume that the user defines
3093 YYDEBUG to a properly parenthesized expression.
3094
3877f72b
AD
30952001-12-17 Akim Demaille <akim@epita.fr>
3096
3097 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3098 nlookaheads is a new member.
3099 Adjust all users.
3100 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3101 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3102 state.
776209d6 3103
331dbc1b
AD
31042001-12-17 Akim Demaille <akim@epita.fr>
3105
3106 * src/files.h, src/files.c (open_files, close_files): Remove.
3107 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3108 let...
3109 * src/reader.c (reader): Do it.
776209d6 3110
be750e4c
AD
31112001-12-17 Akim Demaille <akim@epita.fr>
3112
3113 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 3114
709ae8c6
AD
31152001-12-17 Akim Demaille <akim@epita.fr>
3116
3117 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3118 (flush_reduce): New.
3119 (resolve_sr_conflict): Adjust.
776209d6 3120
f87685c3
AD
31212001-12-17 Akim Demaille <akim@epita.fr>
3122
3123 * src/output.c (output_obstack): Be static and rename as...
3124 (format_obstack): this, to avoid any confusion with files.c's
3125 output_obstack.
3126 * src/reader.h (muscle_obstack): Move to...
3127 * src/output.h: here, since it's defined in output.c.
3128
837491d8
AD
31292001-12-17 Akim Demaille <akim@epita.fr>
3130
3131 * src/output.c (action_row, save_column, default_goto)
3132 (sort_actions, matching_state, pack_vector): Better variable
3133 locality.
3134
796d61fb
AD
31352001-12-17 Akim Demaille <akim@epita.fr>
3136
3137 * src/output.c: Various formatting changes.
776209d6 3138
64d15509
AD
31392001-12-17 Akim Demaille <akim@epita.fr>
3140
3141 * src/files.c (output_files): Free the output_obstack.
3142 * src/main.c (main): Call print and print_graph conditionally.
3143 * src/print.c (print): Work unconditionally.
3144 * src/print_graph.c (print_graph): Work unconditionally.
3145 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3146
fbc8ecb7
MA
31472001-12-16 Marc Autret <autret_m@epita.fr>
3148
3149 * src/output.c (actions_output): Fix. When we use %no-lines,
3150 there is one less line per action.
3151
f0440388
MA
31522001-12-16 Marc Autret <autret_m@epita.fr>
3153
3154 * src/bison.simple: Remove a useless #line directive.
3155 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3156 * src/output.c (get_lines_number): New.
776209d6 3157 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
3158 output muscles.
3159 Fix line numbering.
3160 (actions_output): Computes the number of lines taken by actions.
3161 (output_master_parser): Insert new skeleton which is the name of
3162 the output parser file name.
3163
a79986b8
MA
31642001-12-15 Marc Autret <autret_m@epita.fr>
3165
3166 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3167
4ec8e00f
MA
31682001-12-15 Marc Autret <autret_m@epita.fr>
3169
3170 * src/output.c (output_gram): Keep track of the hairy one.
3171
1a4648ff
AD
31722001-12-15 Akim Demaille <akim@epita.fr>
3173
3174 Make `make distcheck' work.
3175
3176 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3177 system.h which uses libgettext.h.
3178
9c2c67e6
AD
31792001-12-15 Akim Demaille <akim@epita.fr>
3180
3181 * src/nullable.c (set_nullable): Useless rules must be skipped,
3182 otherwise, since we range over their symbols, we might look at a
3183 nonterminal which no longer ``exists'', i.e., it is not counted in
3184 `nvars', hence we overflow our arrays.
3185
93ede233
AD
31862001-12-15 Akim Demaille <akim@epita.fr>
3187
3188 The header can also be produced directly, without any obstack!
3189 Yahoo!
3190
3191 * src/files.c, src/files.h (defines_obstack): Remove.
3192 (compute_header_macro): Global.
3193 (defines_obstack_save): Remove.
3194 * src/reader.c (parse_union_decl): No longer output to
3195 defines_obstack: its content can be found in the `stype' muscle
3196 anyway.
3197 (output_token_translations): Merge into...
3198 (symbols_output): this.
3199 Rename as...
3200 (symbols_save): this.
3201 (reader): Adjust.
3202 * src/output.c (header_output): New.
3203 (output): Call it.
3204
2666f928
AD
32052001-12-15 Akim Demaille <akim@epita.fr>
3206
3207 * src/reader.c (parse_union_decl): Instead of handling two obstack
3208 simultaneously, use one to define the `stype' muscle, and use the
3209 value of the latter to fill defines_obstack.
3210 (copy_comment): Remove.
3211 (copy_comment2): Work for a single obstack.
3212 Rename as...
3213 (copy_comment): this.
3214
428046f8
AD
32152001-12-15 Akim Demaille <akim@epita.fr>
3216
3217 * src/lex.c, src/lex.h (xgetc): No longer static.
3218 * src/reader.c (parse_union_decl): Revamp.
3219
ea52d706
AD
32202001-12-15 Akim Demaille <akim@epita.fr>
3221
3222 Still making progress in separating Bison into (i) input, (ii)
3223 process, (iii) output: now we can directly output the parser file
3224 without using table_obstack at all.
3225
3226 * src/files.c, src/files.h (table_obstack): Bye bye.
3227 (parser_file_name): New.
3228 * src/files.c (compute_output_file_names): Compute it.
3229 * src/output.c (actions_output, output_parser)
3230 (output_master_parser): To a file instead of an obstack.
3231
3f96f4dc
AD
32322001-12-15 Akim Demaille <akim@epita.fr>
3233
3234 Attach actions to rules, instead of pre-outputting them to
3235 actions_obstack.
3236
3237 * src/gram.h (rule_t): action and action_line are new members.
3238 * src/reader.c (symbol_list): Likewise.
3239 (copy_action): Save the actions within the rule.
3240 (packgram): Save them in rule_table.
3241 * src/output.c (actions_output): New.
3242 (output_parser): Use it on `%%actions'.
3243 (output_rule_data): Don't free rule_table.
3244 (output): Do it.
3245 (prepare): Don't save the `action' muscle.
3246 * src/bison.simple: s/%%action/%%actions/.
3247
51576fb3
AD
32482001-12-15 Akim Demaille <akim@epita.fr>
3249
3250 * src/reader.c (copy_action): When --yacc, don't append a `;'
3251 to the user action: let it fail if lacking.
dee049eb 3252 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 3253
2648a72d
AD
32542001-12-14 Akim Demaille <akim@epita.fr>
3255
3256 * src/lex.c (literalchar): Simply return the char you decoded, non
3257 longer mess around with obstacks and int pointers.
3258 Adjust all callers.
3259
92790e5b
AD
32602001-12-14 Akim Demaille <akim@epita.fr>
3261
3262 * src/lex.c (literalchar): Don't escape the special characters,
3263 just decode them, and keep them as char (before, eol was output as
3264 the 2 char string `\n' etc.).
3265 * src/output.c (output_rule_data): Use quotearg to output the
3266 token strings.
3267
927c1557
PE
32682001-12-13 Paul Eggert <eggert@twinsun.com>
3269
3270 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3271 Do not infringe on the global user namespace when using C++.
3272 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3273 All uses of `fprintf' and `stderr' changed.
3274
3275 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3276
ed8e1f68
AD
32772001-12-13 Akim Demaille <akim@epita.fr>
3278
3279 The computation of nullable is broken: it doesn't handle empty
3280 RHS's properly.
3281
3282 * tests/torture.at (GNU AWK Grammar): New.
3283 * tests/sets.at (Nullable): New.
3284 * src/nullable.c (set_nullable): Instead of blindly looping over
3285 `ritems', loop over the rules, and then over their rhs's.
3286
3287 Work around Autotest bugs.
3288
3289 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3290 frame, because Autotest understand lines starting with a `+' as
3291 traces from the shell. Then, they are not processed properly.
3292 Admittedly an Autotest bug, but we don't have time to wait for
3293 Autotest to catch up.
3294 * tests/regression.at (Broken Closure): Adjust to the new table
3295 frames.
3296 Move to...
3297 * tests/sets.at: here.
3298
cb581495
AD
32992001-12-13 Akim Demaille <akim@epita.fr>
3300
3301 * src/closure.c (closure): Use nrules instead of playing tricks
3302 with BITS_PER_WORD.
3303
2e729273
AD
33042001-12-13 Akim Demaille <akim@epita.fr>
3305
3306 * src/print.c (print_actions): Output the handling of `$' as the
3307 traces do: shifting the token EOF. Before EOF was treated as a
3308 nonterminal.
3309 * tests/regression.at: Adjust some tests.
3310 * src/print_graph.c (print_core): Complete the set of items via
3311 closure. The next-to-final and final states are still unsatisfying,
3312 but that's to be addressed elsewhere.
3313 No longer output the rule numbers, but do output the state number.
3314 A single loop for the shifts + gotos is enough, but picked a
3315 distinct color for each.
3316 (print_graph): Initialize and finalize closure.
3317
107f7dfb
AD
33182001-12-13 Akim Demaille <akim@epita.fr>
3319
3320 * src/reader.c (readgram): Remove dead code, an strip useless
3321 braces.
3322 (get_type): Remove, unused.
3323
9b53a24f
AD
33242001-12-12 Akim Demaille <akim@epita.fr>
3325
3326 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3327 on that of lib/error.c.
3328
dbfb6dcd
AD
33292001-12-12 Akim Demaille <akim@epita.fr>
3330
3331 Some hosts don't like `/' in includes.
3332
3333 * src/system.h: Include libgettext.h without qualifying the path.
3334 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3335 $(top_srcdir).
3336
c25fb648
MA
33372001-12-11 Marc Autret <autret_m@epita.fr>
3338
3339 * src/output.c (output_parser): Remove useless muscle.
3340
710ddc4f
MA
33412001-12-11 Marc Autret <autret_m@epita.fr>
3342
3343 * src/bison.simple: Remove #line just before %%epilogue. It
3344 is now handled in ...
3345 * src/reader.c (read_additionnal_code): Add the output of a
3346 #line for the epilogue.
3347
e83d80b8
MA
33482001-12-10 Marc Autret <autret_m@epita.fr>
3349
927c1557 3350 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
3351 replace precedent remove.
3352 * src/bison.simple: Remove #line before %%prologue because
3353 %%input-line is wrong at this time.
3354
971d5158
MA
33552001-12-10 Marc Autret <autret_m@epita.fr>
3356
3357 * src/reader.c (symbols_output): Clean up.
927c1557 3358 * src/output.c (output_gram, output): Clean up.
971d5158 3359
5edafffd
AD
33602001-12-10 Akim Demaille <akim@epita.fr>
3361
3362 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3363 * src/LR0.c (set_state_table): here.
3364 * src/lalr.c (lalr): Call it.
3365
0279f8e9
AD
33662001-12-10 Akim Demaille <akim@epita.fr>
3367
3368 * src/state.h (shifts): Remove the `number' member: shifts are
3369 attached to state, hence no longer need to be labelled with a
3370 state number.
3371
190c4f5f
AD
33722001-12-10 Akim Demaille <akim@epita.fr>
3373
3374 Now that states have a complete set of members, the linked list of
3375 shifts is useless: just fill directly the state's shifts member.
3376
3377 * src/state.h (shifts): Remove the `next' member.
3378 * src/LR0.c (first_state, last_state): Remove.
3379 Adjust the callers.
3380 (augment_automaton): Don't look for the shifts that must be added
3381 a shift on EOF: it is those of the state we looked for! But now,
3382 since shifts are attached, it is no longer needed to looking
3383 merely by its id: its number.
3384
2a73b93d
AD
33852001-12-10 Akim Demaille <akim@epita.fr>
3386
3387 * src/LR0.c (augment_automaton): Better variable locality.
3388 Remove an impossible branch: if there is a state corresponding to
3389 the start symbol being shifted, then there is shift for the start
3390 symbol from the initial state.
3391
74392f6a
AD
33922001-12-10 Akim Demaille <akim@epita.fr>
3393
3394 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3395 only when appropriate: when insert_start_shifting_state' is not
3396 invoked.
3397 * tests/regression.at (Rule Line Numbers): Adjust.
3398
37c82725
AD
33992001-12-10 Akim Demaille <akim@epita.fr>
3400
3401 * src/LR0.c (augment_automaton): Now that all states have shifts,
3402 merge the two cases addition shifts to the initial state.
3403
6a164e0c
AD
34042001-12-10 Akim Demaille <akim@epita.fr>
3405
3406 * src/lalr.c (set_state_table): Move to...
3407 * src/LR0.c: here.
3408 * src/lalr.c (lalr): Don't call it...
3409 * src/LR0.c (generate_states): do it.
3410 * src/LR0.h (first_state): Remove, only the table is used.
3411
7215de24
AD
34122001-12-10 Akim Demaille <akim@epita.fr>
3413
3414 * src/LR0.h (first_shift, first_reduction): Remove.
3415 * src/lalr.c: Don't use first_shift: find shifts through the
3416 states.
3417
80e25d4d
AD
34182001-12-10 Akim Demaille <akim@epita.fr>
3419
3420 * src/LR0.c: Attach shifts to states as soon as they are
3421 computed.
3422 * src/lalr.c (set_state_table): Instead of assigning shifts to
3423 state, just assert that the mapping was properly done.
3424
0ab3728b
AD
34252001-12-10 Akim Demaille <akim@epita.fr>
3426
3427 * src/LR0.c (insert_start_shift): Rename as...
3428 (insert_start_shifting_state): this.
3429 (insert_eof_shifting_state, insert_accepting_state): New.
3430 (augment_automaton): Adjust.
3431 Better locality of the variables.
3432 When looking if the start_symbol is shifted from the initial
3433 state, using `while (... symbol != start_symbol ...)' sounds
3434 better than `while (... symbol < start_symbol ...)': If fail
3435 to see how the order between symbols could be relevant!
3436
78af9bbc
AD
34372001-12-10 Akim Demaille <akim@epita.fr>
3438
3439 * src/getargs.h: Don't declare `spec_name_prefix' and
3440 `spec_file_prefix', declared by src/files.h.
3441 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3442 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3443 * src/output.c (prepare): Adjust.
3444 * src/reader.c (symbols_output): Likewise.
3445 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3446
bdef2a41
AD
34472001-12-10 Akim Demaille <akim@epita.fr>
3448
3449 * src/muscle_tab.c (muscle_init): NULL is a better default than
3450 `"0"'.
3451
3735969c
AD
34522001-12-10 Akim Demaille <akim@epita.fr>
3453
3454 * src/reader.c (reader): Calling symbols_output once is enough.
3455
49701457
AD
34562001-12-10 Akim Demaille <akim@epita.fr>
3457
3458 Now that states have a complete set of members, the linked list of
3459 reductions is useless: just fill directly the state's reductions
3460 member.
3461
3462 * src/state.h (struct reductions): Remove member `number' and
3463 `next'.
3464 * src/LR0.c (first_reduction, last_reduction): Remove.
3465 (save_reductions): Don't link the new reductions, store them in
3466 this_state.
3467 * src/lalr.c (set_state_table): No need to attach reductions to
3468 states, it's already done.
3469 * src/output.c (output_actions): No longer free the shifts, then
3470 the reductions, then the states: free all the states and their
3471 members.
3472
0edad749
AD
34732001-12-10 Akim Demaille <akim@epita.fr>
3474
3475 * src/options.c (OPTN, DRTV, BOTH): New.
3476 (option_table): Use them.
3477
0edad749
AD
3478 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3479 the job of system.h.
3480 * src/options.c: Don't include stdio.h and xalloc.h for the same
3481 reasons.
3482
5449dd0f
AD
34832001-12-10 Akim Demaille <akim@epita.fr>
3484
3485 * src/output.c (output, prepare): Make sure the values of the
3486 muscles `action' and `prologue' are 0-terminated.
3487
a870c567
AD
34882001-12-10 Akim Demaille <akim@epita.fr>
3489
3490 Clean up GCC warnings.
3491
3492 * src/reader.c (copy_action): `buf' is not used.
3493 (parse_skel_decl): Be static.
3494 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3495 * src/options.h (create_long_option_table): Have a real prototype.
3496 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3497 (hash_delete_at): Return const void *.
3498 Adjust casts to preserve the const.
3499
80df8768
AD
35002001-12-10 Akim Demaille <akim@epita.fr>
3501
3502 * configure.in: Require 2.52g.
3503 M4 is not needed, but AUTOM4TE is.
3504 * m4/m4.m4: Remove.
3505 * tests/Makefile.am: Adjust.
3506
f693ad14
AD
35072001-12-10 Akim Demaille <akim@epita.fr>
3508
3509 One structure for states is enough, even though theoretically
3510 there are LR(0) states and LALR(1) states.
3511
3512 * src/lalr.h (state_t): Remove.
3513 (state_table): Be state_t **, not state_t *.
3514 * src/state.h (core, CORE_ALLOC): Rename as...
3515 (state_t, STATE_ALLOC): this.
3516 Add the LALR(1) members: shifts, reductions, errs.
3517 * src/LR0.c (state_table): Rename as...
3518 (state_hash): this, to avoid name clashes with the global
3519 `state_table'.
3520 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3521 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3522
74ffbcb6
AD
35232001-12-10 Akim Demaille <akim@epita.fr>
3524
3525 Bison dumps core on bash.y.
3526 Reported by Pascal Bart.
3527
3528 * src/warshall.c (bitmatrix_print): New.
3529 (TC): Use it.
3530 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3531 j must be the outer loop.
3532 * tests/regression.at (Broken Closure): New.
3533
07708e19
AD
35342001-12-05 Akim Demaille <akim@epita.fr>
3535
3536 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3537 its argument.
3538