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