]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/lalr.c (build_relations): Rename `states' as `states1'.
[bison.git] / ChangeLog
CommitLineData
b9f71f19
AD
12001-12-29 Akim Demaille <akim@epita.fr>
2
3 * src/lalr.c (build_relations): Rename `states' as `states1'.
4 Sorry, I don't understand exactly what it is, no better name...
5
6
1a2b5d37
AD
72001-12-29 Akim Demaille <akim@epita.fr>
8
9 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
10 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
11 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
12 as rules.
13
14
1cca533e
AD
152001-12-29 Akim Demaille <akim@epita.fr>
16
17 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18 ago.
19
20
c03ae966
AD
212001-12-29 Akim Demaille <akim@epita.fr>
22
23 * src/reader.c, src/reader.h (user_toknums): Remove.
24 Adjust all users to use symbols[i]->user_token_number.
25
26
5a670b1e
AD
272001-12-29 Akim Demaille <akim@epita.fr>
28
29 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
30 Adjust all users to use symbols[i]->prec or ->assoc.
31
32
ad949da9
AD
332001-12-29 Akim Demaille <akim@epita.fr>
34
35 * src/reader.c, src/reader.h (tags): Remove.
36 Adjust all users to use symbols[i]->tag.
37
38
0e78e603
AD
392001-12-29 Akim Demaille <akim@epita.fr>
40
41 * src/gram.h, src/gram.c (symbols): New, similar to state_table
42 and rule_table.
43 * src/reader.c (packsymbols): Fill this table.
44 Drop sprec.
45 * src/conflicts.c (resolve_sr_conflict): Adjust.
46 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
47 single table.
48 Use symbols[i]->tag instead of tags[i].
49
50
213e640e
AD
512001-12-29 Akim Demaille <akim@epita.fr>
52
53 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
54 In addition, put a comment in there, to replace...
55 * tests/regression.at (%union and C comments): Remove.
56
57
e7b8bef1
AD
582001-12-29 Akim Demaille <akim@epita.fr>
59
60 * tests/regression.at (Web2c Actions): Blindly move the actual
61 output as expected output. The contents *seem* right to me, but I
62 can't pretend reading perfectly parser tables... Nonetheless, all
63 the other tests pass correctly, the table look OK, even though the
64 presence of `$axiom' is to be noted: AFAICS it is useless (but
65 harmless).
66
67
b68e7744
AD
682001-12-29 Akim Demaille <akim@epita.fr>
69
70 * src/reader.c (readgram): Don't add the rule 0 if there were no
71 rules read. In other words, add it _after_ having performed
72 grammar sanity checks.
73 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
74
75
78d5bae9
AD
762001-12-29 Akim Demaille <akim@epita.fr>
77
78 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
79 visible, and some states have now a different number.
80
81
ff442794
AD
822001-12-29 Akim Demaille <akim@epita.fr>
83
84 * src/reader.c (readgram): Bind the initial rule's lineno to that
85 of the first rule.
86 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
87 (Solved SR Conflicts): Adjust rule 0's line number.
88
89
610ab194
AD
902001-12-29 Akim Demaille <akim@epita.fr>
91
92 Fix the `GAWK Grammar' failure.
93
94 * src/LR0.c (final_state): Initialize to -1 so that we do compute
95 the reductions of the first state which was mistakenly confused
96 with the final state because precisely final_state was initialized
97 to 0.
98 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
99 now noticed by Bison.
100 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
101 have a reduction on $default.
102
103
29d29c8f
AD
1042001-12-29 Akim Demaille <akim@epita.fr>
105
106 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
107 rule line numbers.
108 * src/closure.c (print_closure): Likewise.
109 * src/derives.c (print_derives): Likewise.
110 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
111 now.
112
7c6b64d0
AD
1132001-12-29 Akim Demaille <akim@epita.fr>
114
115 * src/lalr.c (lookaheads_print): New.
116 (lalr): Call it when --trace-flag.
117 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
118 are dumped.
119
120
3d4daee3
AD
1212001-12-29 Akim Demaille <akim@epita.fr>
122
123 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
124 when walking through ritem, even via rule->rhs.
125 * src/reduce.c (dump_grammar, useful_production, reduce_output)
126 (useful_production, useless_nonterminals): Likewise.
127 (reduce_grammar_tables): Likewise, plus update nritems.
128 * src/nullable.c (set_nullable): Likewise.
129 * src/lalr.c (build_relations): Likewise.
130 * tests/sets.at (Nullable): Adjust.
131 Fortunately, now, the $axiom is no longer nullable.
132
133
9e7f6bbd
AD
1342001-12-29 Akim Demaille <akim@epita.fr>
135
136 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
137 the 0-sentinel.
138 * src/gram.c (ritem_longest_rhs): Likewise.
139 * src/reduce.c (nonterminals_reduce): Likewise.
140 * src/print_graph.c (print_graph): Likewise.
141 * src/output.c (output_rule_data): Likewise.
142 * src/nullable.c (set_nullable): Likewise.
143
255ef638
AD
1442001-12-29 Akim Demaille <akim@epita.fr>
145
146 * src/output.c: Comment changes.
147
0d8a7363
AD
1482001-12-27 Paul Eggert <eggert@twinsun.com>
149
150 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
151 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
152 Sparc, as they were causing more porting problems than the
153 (minor) performance improvement was worth.
154
155 Also, catch up with 1.31's YYSTD.
156
3db472b9
AD
1572001-12-27 Akim Demaille <akim@epita.fr>
158
159 * src/output.c (output_gram): Rely on nritems, not the
160 0-sentinel. See below.
161 Use -1 as separator, not 0.
162 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
163 Rely on -1 as separator in yyrhs, instead of 0.
164 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
165 twice `Now at end of input', therefore there are two lines less to
166 expect.
167
b365aa05
AD
1682001-12-27 Akim Demaille <akim@epita.fr>
169
170 * tests/regression.at (Unresolved SR Conflicts):
171 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
172 below.
173
30171f79
AD
1742001-12-27 Akim Demaille <akim@epita.fr>
175
176 * src/LR0.c (new_state): Recognize the final state by the fact it
177 is reached by eoftoken.
178 (insert_start_shifting_state, insert_eof_shifting_state)
179 (insert_accepting_state, augment_automaton): Remove, since now
180 these states are automatically computed from the initial state.
181 (generate_states): Adjust.
182 * src/print.c: When reporting a rule number to the user, substract
183 1, so that the axiom rule is rule 0, and the first user rule is 1.
184 * src/reduce.c: Likewise.
185 * src/print_graph.c (print_core): For the time being, just as for
186 the report, depend upon --trace-flags to dump the full set of
187 items.
188 * src/reader.c (readgram): Once the grammar read, insert the rule
189 0: `$axiom: START-SYMBOL $'.
190 * tests/set.at: Adjust: rule 0 is now displayed, and since the
191 number of the states has changed (the final state is no longer
192 necessarily the last), catch up.
193
75142d45
AD
1942001-12-27 Akim Demaille <akim@epita.fr>
195
196 Try to make the use of the eoftoken valid. Given that its value
197 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
198 is used instead of > 0 where appropriate, (ii), depend upon nritems
199 instead of the 0-sentinel.
200
201 * src/gram.h, src/gram.c (nritems): New.
202 Expected to be duplication of nitems, but for the time being...
203 * src/reader.c (packgram): Assert nritems and nitems are equal.
204 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
205 * src/closure.c (print_closure, print_fderives): Likewise.
206 * src/gram.c (ritem_print): Likewise.
207 * src/print.c (print_core, print_grammar): Likewise.
208 * src/print_graph.c: Likewise.
209
b7c49edf
AD
2102001-12-27 Akim Demaille <akim@epita.fr>
211
212 * src/main.c (main): If there are complains after grammar
213 reductions, then output the report anyway if requested, then die.
214 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
215 * src/reader.c (eoftoken): New.
216 (parse_token_decl): If the token being defined has value `0', it
217 is the eoftoken.
218 (packsymbols): No longer hack `tags' to insert `$' by hand.
219 Be sure to preserve the value of the eoftoken.
220 (reader): Make sure eoftoken is defined.
221 Initialize nsyms to 0: now eoftoken is created just like the others.
222 * src/print.c (print_grammar): Don't special case the eof token.
223 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
224 lie anyway, albeit pleasant.
225 * tests/calc.at: Exercise error messages with eoftoken.
226 Change the grammar so that empty input is invalid.
227 Adjust expectations.
228 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
229
ec2da99f
AD
2302001-12-27 Akim Demaille <akim@epita.fr>
231
232 * configure.in: Check the protos of strchr ans strspn.
233 Replace strchr if needed.
234 * src/system.h: Provide the protos of strchr, strspn and memchr if
235 missing.
236 * lib/strchr.c: New.
237 * src/reader.c (symbols_save): Use strchr.
238
8adfa272
AD
2392001-12-27 Akim Demaille <akim@epita.fr>
240
241 * src/print.c, src/print_graph.c (escape): New.
242 Use it to quote the TAGS outputs.
243 * src/print_graph.c (print_state): Now errors are in red, and
244 reductions in green.
245 Prefer high to wide: output the state number on a line of its own.
246
80dac38c
AD
2472001-12-27 Akim Demaille <akim@epita.fr>
248
249 * src/state.h, src/state.c (reductions_new): New.
250 * src/LR0.c (set_state_table): Let all the states have a
251 `reductions', even if reduced to 0.
252 (save_reductions): Adjust.
253 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
254 * src/print.c (print_reductions, print_actions): Adjust.
255 * src/output.c (action_row): Adjust.
256
2cec70b9
AD
2572001-12-27 Akim Demaille <akim@epita.fr>
258
259 * src/state.h, src/state.c (errs_new, errs_dup): New.
260 * src/LR0.c (set_state_table): Let all the states have an errs,
261 even if reduced to 0.
262 * src/print.c (print_errs, print_reductions): Adjust.
263 * src/output.c (output_actions, action_row): Adjust.
264 * src/conflicts.c (resolve_sr_conflict): Adjust.
265
13ca549a
AD
2662001-12-27 Akim Demaille <akim@epita.fr>
267
268 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
269
5092aba5
AD
2702001-12-27 Akim Demaille <akim@epita.fr>
271
272 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
273 * src/print.c: here.
274 (lookaheadset, shiftset): New, used as additional storage by
275 print_reductions.
276 (print_results): Adjust.
277 (print_shifts, print_gotos, print_errs): New, extracted from...
278 (print_actions): here.
279 * src/print_graph.c (print_actions): Remove dead code.
280
11e2beca
AD
2812001-12-27 Akim Demaille <akim@epita.fr>
282
283 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
284 `$n' and `@n'.
285
dac3c910
AD
2862001-12-27 Akim Demaille <akim@epita.fr>
287
288 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
289 (build_relations): Adjust.
290
d0b0fefa
AD
2912001-12-27 Akim Demaille <akim@epita.fr>
292
293 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
294 duplication.
295
adc8c848
AD
2962001-12-27 Akim Demaille <akim@epita.fr>
297
298 * src/reader.c (packgram): Catch nitems overflows.
299
14d293ac
AD
3002001-12-27 Akim Demaille <akim@epita.fr>
301
302 * src/files.c, src/files.h (guard_obstack): Remove.
303 * src/output.c (output): Adjust.
304 * src/reader.c (parse_braces): New, factoring...
305 (copy_action, copy_guard): these two which are renamed as...
306 (parse_action, parse_guard): these.
307 As a voluntary consequence, using braces around guards is now
308 mandatory.
309
f499b062
AD
3102001-12-27 Akim Demaille <akim@epita.fr>
311
312 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
313 * src/reader.c (symbol_list): `guard' and `guard_line' are new
314 members.
315 (symbol_list_new): Adjust.
316 (copy_action): action_line is the first line, not the last.
317 (copy_guard): Just as for actions, store the `action' only, not
318 the switch/case/break flesh.
319 Don't parse the user action that might follow the guard, let...
320 (readgram): do it, i.e., now, there can be an action after a
321 guard.
322 In other words the guard is just explicitly optional.
323 (packgram): Adjust.
324 * src/output.c (guards_output): New.
325 (output_parser): Call it when needed.
326 (output): Also free the guard and attrs obstacks.
327 * src/files.c, src/files.h (obstack_save): Remove.
328 (output_files): Remove.
329 As a result, if one needs the former `.act' file, using an
330 appropriate skeleton which requires actions and guards is now
331 required.
332 * src/main.c (main): Adjust.
333 * tests/semantic.at: New.
334 * tests/regression.at: Use `input.y' as input file name.
335 Avoid 8+3 problems by requiring input.c when the test needs the
336 parser.
337
d945f5cd
AD
3382001-12-27 Akim Demaille <akim@epita.fr>
339
340 * src/reader.c (symbol_list_new): Be sure to initialize all the
341 fields.
342
d200e455
AD
3432001-12-27 Akim Demaille <akim@epita.fr>
344
345 All the hacks using a final pseudo state are now useless.
346
347 * src/LR0.c (set_state_table): state_table holds exactly nstates.
348 * src/lalr.c (nLA): New.
349 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
350 instead of lookaheadsp from the pseudo state (nstate + 1).
351
f9507c28
AD
3522001-12-27 Akim Demaille <akim@epita.fr>
353
354 * src/output.c (action_row, token_actions): Use a state_t instead
355 of a integer, and nlookaheads instead of the following state's
356 lookaheadsp.
357
065fbd27
AD
3582001-12-27 Akim Demaille <akim@epita.fr>
359
360 * src/conflicts.c (log_resolution, flush_shift)
361 (resolve_sr_conflict, set_conflicts, solve_conflicts)
362 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
363 (conflicts_print, print_reductions): Use a state_t instead of an
364 integer when referring to a state.
365 As much as possible, depend upon nlookaheads, instead of the
366 `lookaheadsp' member of the following state (since lookaheads of
367 successive states are successive, the difference between state n + 1
368 and n served as the number of lookaheads for state n).
369 * src/lalr.c (add_lookback_edge): Likewise.
370 * src/print.c (print_core, print_actions, print_state)
371 (print_results): Likewise.
372 * src/print_graph.c (print_core, print_actions, print_state)
373 (print_graph): Likewise.
374 * src/conflicts.h: Adjust.
375
1b177bd7
AD
3762001-12-27 Akim Demaille <akim@epita.fr>
377
378 * src/bison.hairy: Formatting/comment changes.
379 ANSIfy.
380 Remove `register' indications.
381 Add plenty of `static'.
382
7742ddeb
AD
3832001-12-27 Akim Demaille <akim@epita.fr>
384
385 * src/output.c (prepare): Drop the muscle `ntbase' which
386 duplicates ntokens.
387 * src/bison.simple: Formatting/comment changes.
388 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
389 is an undocumented synonym.
390
1fa14068
AD
3912001-12-22 Akim Demaille <akim@epita.fr>
392
393 * src/output.c (output_table_data): Change the prototype to use
394 `int' for array ranges: some invocations do pass an int, not a
395 short.
396 Reported by Wayne Green.
397
b9752825
AD
3982001-12-22 Akim Demaille <akim@epita.fr>
399
400 Some actions of web2c.y are improperly triggered.
401 Reported by Mike Castle.
402
403 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
404 * tests/regression.at (Web2c): Rename as...
405 (Web2c Report): this.
406 (Web2c Actions): New.
407
776209d6
AD
4082001-12-22 Akim Demaille <akim@epita.fr>
409
410 Reductions in web2c.y are improperly reported.
411 Reported by Mike Castle.
412
413 * src/conflicts.c (print_reductions): Fix.
414 * tests/regression.at (Web2c): New.
415
275fc3ad
AD
4162001-12-18 Akim Demaille <akim@epita.fr>
417
418 Some host fail on `assert (!"foo")', which expands to
419 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
420 Reported by Nelson Beebee.
421
422 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
423 `#define it_succeeded 0' and `assert (it_succeeded)'.
424
897668ee
MA
4252001-12-17 Marc Autret <autret_m@epita.fr>
426
427 * src/bison.simple: Don't hard code the skeleton line and filename.
428 * src/output.c (output_parser): Rename 'line' as 'output_line'.
429 New line counter 'skeleton_line' (skeleton-line muscle).
430
ab3399e0
PE
4312001-12-17 Paul Eggert <eggert@twinsun.com>
432
433 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
434 YYDEBUG must be defined to a nonzero value.
435
436 * src/bison.simple (yytname): Do not assume that the user defines
437 YYDEBUG to a properly parenthesized expression.
438
3877f72b
AD
4392001-12-17 Akim Demaille <akim@epita.fr>
440
441 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
442 nlookaheads is a new member.
443 Adjust all users.
444 * src/lalr.h (nlookaheads): Remove this orphan declaration.
445 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
446 state.
776209d6 447
331dbc1b
AD
4482001-12-17 Akim Demaille <akim@epita.fr>
449
450 * src/files.h, src/files.c (open_files, close_files): Remove.
451 * src/main.c (main): Don't open/close files, nor invoke lex_free,
452 let...
453 * src/reader.c (reader): Do it.
776209d6 454
be750e4c
AD
4552001-12-17 Akim Demaille <akim@epita.fr>
456
457 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 458
709ae8c6
AD
4592001-12-17 Akim Demaille <akim@epita.fr>
460
461 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
462 (flush_reduce): New.
463 (resolve_sr_conflict): Adjust.
776209d6 464
f87685c3
AD
4652001-12-17 Akim Demaille <akim@epita.fr>
466
467 * src/output.c (output_obstack): Be static and rename as...
468 (format_obstack): this, to avoid any confusion with files.c's
469 output_obstack.
470 * src/reader.h (muscle_obstack): Move to...
471 * src/output.h: here, since it's defined in output.c.
472
837491d8
AD
4732001-12-17 Akim Demaille <akim@epita.fr>
474
475 * src/output.c (action_row, save_column, default_goto)
476 (sort_actions, matching_state, pack_vector): Better variable
477 locality.
478
796d61fb
AD
4792001-12-17 Akim Demaille <akim@epita.fr>
480
481 * src/output.c: Various formatting changes.
776209d6 482
64d15509
AD
4832001-12-17 Akim Demaille <akim@epita.fr>
484
485 * src/files.c (output_files): Free the output_obstack.
486 * src/main.c (main): Call print and print_graph conditionally.
487 * src/print.c (print): Work unconditionally.
488 * src/print_graph.c (print_graph): Work unconditionally.
489 * src/conflicts.c (log_resolution): Output only if verbose_flag.
490
fbc8ecb7
MA
4912001-12-16 Marc Autret <autret_m@epita.fr>
492
493 * src/output.c (actions_output): Fix. When we use %no-lines,
494 there is one less line per action.
495
f0440388
MA
4962001-12-16 Marc Autret <autret_m@epita.fr>
497
498 * src/bison.simple: Remove a useless #line directive.
499 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
500 * src/output.c (get_lines_number): New.
776209d6 501 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
502 output muscles.
503 Fix line numbering.
504 (actions_output): Computes the number of lines taken by actions.
505 (output_master_parser): Insert new skeleton which is the name of
506 the output parser file name.
507
a79986b8
MA
5082001-12-15 Marc Autret <autret_m@epita.fr>
509
510 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
511
4ec8e00f
MA
5122001-12-15 Marc Autret <autret_m@epita.fr>
513
514 * src/output.c (output_gram): Keep track of the hairy one.
515
1a4648ff
AD
5162001-12-15 Akim Demaille <akim@epita.fr>
517
518 Make `make distcheck' work.
519
520 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
521 system.h which uses libgettext.h.
522
9c2c67e6
AD
5232001-12-15 Akim Demaille <akim@epita.fr>
524
525 * src/nullable.c (set_nullable): Useless rules must be skipped,
526 otherwise, since we range over their symbols, we might look at a
527 nonterminal which no longer ``exists'', i.e., it is not counted in
528 `nvars', hence we overflow our arrays.
529
93ede233
AD
5302001-12-15 Akim Demaille <akim@epita.fr>
531
532 The header can also be produced directly, without any obstack!
533 Yahoo!
534
535 * src/files.c, src/files.h (defines_obstack): Remove.
536 (compute_header_macro): Global.
537 (defines_obstack_save): Remove.
538 * src/reader.c (parse_union_decl): No longer output to
539 defines_obstack: its content can be found in the `stype' muscle
540 anyway.
541 (output_token_translations): Merge into...
542 (symbols_output): this.
543 Rename as...
544 (symbols_save): this.
545 (reader): Adjust.
546 * src/output.c (header_output): New.
547 (output): Call it.
548
2666f928
AD
5492001-12-15 Akim Demaille <akim@epita.fr>
550
551 * src/reader.c (parse_union_decl): Instead of handling two obstack
552 simultaneously, use one to define the `stype' muscle, and use the
553 value of the latter to fill defines_obstack.
554 (copy_comment): Remove.
555 (copy_comment2): Work for a single obstack.
556 Rename as...
557 (copy_comment): this.
558
428046f8
AD
5592001-12-15 Akim Demaille <akim@epita.fr>
560
561 * src/lex.c, src/lex.h (xgetc): No longer static.
562 * src/reader.c (parse_union_decl): Revamp.
563
ea52d706
AD
5642001-12-15 Akim Demaille <akim@epita.fr>
565
566 Still making progress in separating Bison into (i) input, (ii)
567 process, (iii) output: now we can directly output the parser file
568 without using table_obstack at all.
569
570 * src/files.c, src/files.h (table_obstack): Bye bye.
571 (parser_file_name): New.
572 * src/files.c (compute_output_file_names): Compute it.
573 * src/output.c (actions_output, output_parser)
574 (output_master_parser): To a file instead of an obstack.
575
3f96f4dc
AD
5762001-12-15 Akim Demaille <akim@epita.fr>
577
578 Attach actions to rules, instead of pre-outputting them to
579 actions_obstack.
580
581 * src/gram.h (rule_t): action and action_line are new members.
582 * src/reader.c (symbol_list): Likewise.
583 (copy_action): Save the actions within the rule.
584 (packgram): Save them in rule_table.
585 * src/output.c (actions_output): New.
586 (output_parser): Use it on `%%actions'.
587 (output_rule_data): Don't free rule_table.
588 (output): Do it.
589 (prepare): Don't save the `action' muscle.
590 * src/bison.simple: s/%%action/%%actions/.
591
51576fb3
AD
5922001-12-15 Akim Demaille <akim@epita.fr>
593
594 * src/reader.c (copy_action): When --yacc, don't append a `;'
595 to the user action: let it fail if lacking.
dee049eb 596 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 597
2648a72d
AD
5982001-12-14 Akim Demaille <akim@epita.fr>
599
600 * src/lex.c (literalchar): Simply return the char you decoded, non
601 longer mess around with obstacks and int pointers.
602 Adjust all callers.
603
92790e5b
AD
6042001-12-14 Akim Demaille <akim@epita.fr>
605
606 * src/lex.c (literalchar): Don't escape the special characters,
607 just decode them, and keep them as char (before, eol was output as
608 the 2 char string `\n' etc.).
609 * src/output.c (output_rule_data): Use quotearg to output the
610 token strings.
611
927c1557
PE
6122001-12-13 Paul Eggert <eggert@twinsun.com>
613
614 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
615 Do not infringe on the global user namespace when using C++.
616 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
617 All uses of `fprintf' and `stderr' changed.
618
619 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
620
ed8e1f68
AD
6212001-12-13 Akim Demaille <akim@epita.fr>
622
623 The computation of nullable is broken: it doesn't handle empty
624 RHS's properly.
625
626 * tests/torture.at (GNU AWK Grammar): New.
627 * tests/sets.at (Nullable): New.
628 * src/nullable.c (set_nullable): Instead of blindly looping over
629 `ritems', loop over the rules, and then over their rhs's.
630
631 Work around Autotest bugs.
632
633 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
634 frame, because Autotest understand lines starting with a `+' as
635 traces from the shell. Then, they are not processed properly.
636 Admittedly an Autotest bug, but we don't have time to wait for
637 Autotest to catch up.
638 * tests/regression.at (Broken Closure): Adjust to the new table
639 frames.
640 Move to...
641 * tests/sets.at: here.
642
cb581495
AD
6432001-12-13 Akim Demaille <akim@epita.fr>
644
645 * src/closure.c (closure): Use nrules instead of playing tricks
646 with BITS_PER_WORD.
647
2e729273
AD
6482001-12-13 Akim Demaille <akim@epita.fr>
649
650 * src/print.c (print_actions): Output the handling of `$' as the
651 traces do: shifting the token EOF. Before EOF was treated as a
652 nonterminal.
653 * tests/regression.at: Adjust some tests.
654 * src/print_graph.c (print_core): Complete the set of items via
655 closure. The next-to-final and final states are still unsatisfying,
656 but that's to be addressed elsewhere.
657 No longer output the rule numbers, but do output the state number.
658 A single loop for the shifts + gotos is enough, but picked a
659 distinct color for each.
660 (print_graph): Initialize and finalize closure.
661
107f7dfb
AD
6622001-12-13 Akim Demaille <akim@epita.fr>
663
664 * src/reader.c (readgram): Remove dead code, an strip useless
665 braces.
666 (get_type): Remove, unused.
667
9b53a24f
AD
6682001-12-12 Akim Demaille <akim@epita.fr>
669
670 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
671 on that of lib/error.c.
672
dbfb6dcd
AD
6732001-12-12 Akim Demaille <akim@epita.fr>
674
675 Some hosts don't like `/' in includes.
676
677 * src/system.h: Include libgettext.h without qualifying the path.
678 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
679 $(top_srcdir).
680
c25fb648
MA
6812001-12-11 Marc Autret <autret_m@epita.fr>
682
683 * src/output.c (output_parser): Remove useless muscle.
684
710ddc4f
MA
6852001-12-11 Marc Autret <autret_m@epita.fr>
686
687 * src/bison.simple: Remove #line just before %%epilogue. It
688 is now handled in ...
689 * src/reader.c (read_additionnal_code): Add the output of a
690 #line for the epilogue.
691
e83d80b8
MA
6922001-12-10 Marc Autret <autret_m@epita.fr>
693
927c1557 694 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
695 replace precedent remove.
696 * src/bison.simple: Remove #line before %%prologue because
697 %%input-line is wrong at this time.
698
971d5158
MA
6992001-12-10 Marc Autret <autret_m@epita.fr>
700
701 * src/reader.c (symbols_output): Clean up.
927c1557 702 * src/output.c (output_gram, output): Clean up.
971d5158 703
5edafffd
AD
7042001-12-10 Akim Demaille <akim@epita.fr>
705
706 * src/lalr.c (initialize_lookaheads): New. Extracted from...
707 * src/LR0.c (set_state_table): here.
708 * src/lalr.c (lalr): Call it.
709
0279f8e9
AD
7102001-12-10 Akim Demaille <akim@epita.fr>
711
712 * src/state.h (shifts): Remove the `number' member: shifts are
713 attached to state, hence no longer need to be labelled with a
714 state number.
715
190c4f5f
AD
7162001-12-10 Akim Demaille <akim@epita.fr>
717
718 Now that states have a complete set of members, the linked list of
719 shifts is useless: just fill directly the state's shifts member.
720
721 * src/state.h (shifts): Remove the `next' member.
722 * src/LR0.c (first_state, last_state): Remove.
723 Adjust the callers.
724 (augment_automaton): Don't look for the shifts that must be added
725 a shift on EOF: it is those of the state we looked for! But now,
726 since shifts are attached, it is no longer needed to looking
727 merely by its id: its number.
728
2a73b93d
AD
7292001-12-10 Akim Demaille <akim@epita.fr>
730
731 * src/LR0.c (augment_automaton): Better variable locality.
732 Remove an impossible branch: if there is a state corresponding to
733 the start symbol being shifted, then there is shift for the start
734 symbol from the initial state.
735
74392f6a
AD
7362001-12-10 Akim Demaille <akim@epita.fr>
737
738 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
739 only when appropriate: when insert_start_shifting_state' is not
740 invoked.
741 * tests/regression.at (Rule Line Numbers): Adjust.
742
37c82725
AD
7432001-12-10 Akim Demaille <akim@epita.fr>
744
745 * src/LR0.c (augment_automaton): Now that all states have shifts,
746 merge the two cases addition shifts to the initial state.
747
6a164e0c
AD
7482001-12-10 Akim Demaille <akim@epita.fr>
749
750 * src/lalr.c (set_state_table): Move to...
751 * src/LR0.c: here.
752 * src/lalr.c (lalr): Don't call it...
753 * src/LR0.c (generate_states): do it.
754 * src/LR0.h (first_state): Remove, only the table is used.
755
7215de24
AD
7562001-12-10 Akim Demaille <akim@epita.fr>
757
758 * src/LR0.h (first_shift, first_reduction): Remove.
759 * src/lalr.c: Don't use first_shift: find shifts through the
760 states.
761
80e25d4d
AD
7622001-12-10 Akim Demaille <akim@epita.fr>
763
764 * src/LR0.c: Attach shifts to states as soon as they are
765 computed.
766 * src/lalr.c (set_state_table): Instead of assigning shifts to
767 state, just assert that the mapping was properly done.
768
0ab3728b
AD
7692001-12-10 Akim Demaille <akim@epita.fr>
770
771 * src/LR0.c (insert_start_shift): Rename as...
772 (insert_start_shifting_state): this.
773 (insert_eof_shifting_state, insert_accepting_state): New.
774 (augment_automaton): Adjust.
775 Better locality of the variables.
776 When looking if the start_symbol is shifted from the initial
777 state, using `while (... symbol != start_symbol ...)' sounds
778 better than `while (... symbol < start_symbol ...)': If fail
779 to see how the order between symbols could be relevant!
780
78af9bbc
AD
7812001-12-10 Akim Demaille <akim@epita.fr>
782
783 * src/getargs.h: Don't declare `spec_name_prefix' and
784 `spec_file_prefix', declared by src/files.h.
785 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
786 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
787 * src/output.c (prepare): Adjust.
788 * src/reader.c (symbols_output): Likewise.
789 * src/vmsgetargs.c: Vaguely adjust, but who cares?
790
bdef2a41
AD
7912001-12-10 Akim Demaille <akim@epita.fr>
792
793 * src/muscle_tab.c (muscle_init): NULL is a better default than
794 `"0"'.
795
3735969c
AD
7962001-12-10 Akim Demaille <akim@epita.fr>
797
798 * src/reader.c (reader): Calling symbols_output once is enough.
799
49701457
AD
8002001-12-10 Akim Demaille <akim@epita.fr>
801
802 Now that states have a complete set of members, the linked list of
803 reductions is useless: just fill directly the state's reductions
804 member.
805
806 * src/state.h (struct reductions): Remove member `number' and
807 `next'.
808 * src/LR0.c (first_reduction, last_reduction): Remove.
809 (save_reductions): Don't link the new reductions, store them in
810 this_state.
811 * src/lalr.c (set_state_table): No need to attach reductions to
812 states, it's already done.
813 * src/output.c (output_actions): No longer free the shifts, then
814 the reductions, then the states: free all the states and their
815 members.
816
0edad749
AD
8172001-12-10 Akim Demaille <akim@epita.fr>
818
819 * src/options.c (OPTN, DRTV, BOTH): New.
820 (option_table): Use them.
821
0edad749
AD
822 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
823 the job of system.h.
824 * src/options.c: Don't include stdio.h and xalloc.h for the same
825 reasons.
826
5449dd0f
AD
8272001-12-10 Akim Demaille <akim@epita.fr>
828
829 * src/output.c (output, prepare): Make sure the values of the
830 muscles `action' and `prologue' are 0-terminated.
831
a870c567
AD
8322001-12-10 Akim Demaille <akim@epita.fr>
833
834 Clean up GCC warnings.
835
836 * src/reader.c (copy_action): `buf' is not used.
837 (parse_skel_decl): Be static.
838 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
839 * src/options.h (create_long_option_table): Have a real prototype.
840 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
841 (hash_delete_at): Return const void *.
842 Adjust casts to preserve the const.
843
80df8768
AD
8442001-12-10 Akim Demaille <akim@epita.fr>
845
846 * configure.in: Require 2.52g.
847 M4 is not needed, but AUTOM4TE is.
848 * m4/m4.m4: Remove.
849 * tests/Makefile.am: Adjust.
850
f693ad14
AD
8512001-12-10 Akim Demaille <akim@epita.fr>
852
853 One structure for states is enough, even though theoretically
854 there are LR(0) states and LALR(1) states.
855
856 * src/lalr.h (state_t): Remove.
857 (state_table): Be state_t **, not state_t *.
858 * src/state.h (core, CORE_ALLOC): Rename as...
859 (state_t, STATE_ALLOC): this.
860 Add the LALR(1) members: shifts, reductions, errs.
861 * src/LR0.c (state_table): Rename as...
862 (state_hash): this, to avoid name clashes with the global
863 `state_table'.
864 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
865 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
866
74ffbcb6
AD
8672001-12-10 Akim Demaille <akim@epita.fr>
868
869 Bison dumps core on bash.y.
870 Reported by Pascal Bart.
871
872 * src/warshall.c (bitmatrix_print): New.
873 (TC): Use it.
874 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
875 j must be the outer loop.
876 * tests/regression.at (Broken Closure): New.
877
07708e19
AD
8782001-12-05 Akim Demaille <akim@epita.fr>
879
880 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
881 its argument.
882