This page contains the following errors:

error on line 11245 at column 130: Premature end of data in tag tr line 11244

Below is a rendering of the page up to the first error.

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