]> git.saurik.com Git - bison.git/blame - ChangeLog
Fix the `GAWK Grammar' failure.
[bison.git] / ChangeLog
CommitLineData
610ab194
AD
12001-12-29 Akim Demaille <akim@epita.fr>
2
3 Fix the `GAWK Grammar' failure.
4
5 * src/LR0.c (final_state): Initialize to -1 so that we do compute
6 the reductions of the first state which was mistakenly confused
7 with the final state because precisely final_state was initialized
8 to 0.
9 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
10 now noticed by Bison.
11 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
12 have a reduction on $default.
13
14
29d29c8f
AD
152001-12-29 Akim Demaille <akim@epita.fr>
16
17 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18 rule line numbers.
19 * src/closure.c (print_closure): Likewise.
20 * src/derives.c (print_derives): Likewise.
21 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
22 now.
23
7c6b64d0
AD
242001-12-29 Akim Demaille <akim@epita.fr>
25
26 * src/lalr.c (lookaheads_print): New.
27 (lalr): Call it when --trace-flag.
28 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
29 are dumped.
30
31
3d4daee3
AD
322001-12-29 Akim Demaille <akim@epita.fr>
33
34 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
35 when walking through ritem, even via rule->rhs.
36 * src/reduce.c (dump_grammar, useful_production, reduce_output)
37 (useful_production, useless_nonterminals): Likewise.
38 (reduce_grammar_tables): Likewise, plus update nritems.
39 * src/nullable.c (set_nullable): Likewise.
40 * src/lalr.c (build_relations): Likewise.
41 * tests/sets.at (Nullable): Adjust.
42 Fortunately, now, the $axiom is no longer nullable.
43
44
9e7f6bbd
AD
452001-12-29 Akim Demaille <akim@epita.fr>
46
47 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
48 the 0-sentinel.
49 * src/gram.c (ritem_longest_rhs): Likewise.
50 * src/reduce.c (nonterminals_reduce): Likewise.
51 * src/print_graph.c (print_graph): Likewise.
52 * src/output.c (output_rule_data): Likewise.
53 * src/nullable.c (set_nullable): Likewise.
54
255ef638
AD
552001-12-29 Akim Demaille <akim@epita.fr>
56
57 * src/output.c: Comment changes.
58
0d8a7363
AD
592001-12-27 Paul Eggert <eggert@twinsun.com>
60
61 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
62 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
63 Sparc, as they were causing more porting problems than the
64 (minor) performance improvement was worth.
65
66 Also, catch up with 1.31's YYSTD.
67
3db472b9
AD
682001-12-27 Akim Demaille <akim@epita.fr>
69
70 * src/output.c (output_gram): Rely on nritems, not the
71 0-sentinel. See below.
72 Use -1 as separator, not 0.
73 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
74 Rely on -1 as separator in yyrhs, instead of 0.
75 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
76 twice `Now at end of input', therefore there are two lines less to
77 expect.
78
b365aa05
AD
792001-12-27 Akim Demaille <akim@epita.fr>
80
81 * tests/regression.at (Unresolved SR Conflicts):
82 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
83 below.
84
30171f79
AD
852001-12-27 Akim Demaille <akim@epita.fr>
86
87 * src/LR0.c (new_state): Recognize the final state by the fact it
88 is reached by eoftoken.
89 (insert_start_shifting_state, insert_eof_shifting_state)
90 (insert_accepting_state, augment_automaton): Remove, since now
91 these states are automatically computed from the initial state.
92 (generate_states): Adjust.
93 * src/print.c: When reporting a rule number to the user, substract
94 1, so that the axiom rule is rule 0, and the first user rule is 1.
95 * src/reduce.c: Likewise.
96 * src/print_graph.c (print_core): For the time being, just as for
97 the report, depend upon --trace-flags to dump the full set of
98 items.
99 * src/reader.c (readgram): Once the grammar read, insert the rule
100 0: `$axiom: START-SYMBOL $'.
101 * tests/set.at: Adjust: rule 0 is now displayed, and since the
102 number of the states has changed (the final state is no longer
103 necessarily the last), catch up.
104
75142d45
AD
1052001-12-27 Akim Demaille <akim@epita.fr>
106
107 Try to make the use of the eoftoken valid. Given that its value
108 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
109 is used instead of > 0 where appropriate, (ii), depend upon nritems
110 instead of the 0-sentinel.
111
112 * src/gram.h, src/gram.c (nritems): New.
113 Expected to be duplication of nitems, but for the time being...
114 * src/reader.c (packgram): Assert nritems and nitems are equal.
115 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
116 * src/closure.c (print_closure, print_fderives): Likewise.
117 * src/gram.c (ritem_print): Likewise.
118 * src/print.c (print_core, print_grammar): Likewise.
119 * src/print_graph.c: Likewise.
120
b7c49edf
AD
1212001-12-27 Akim Demaille <akim@epita.fr>
122
123 * src/main.c (main): If there are complains after grammar
124 reductions, then output the report anyway if requested, then die.
125 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
126 * src/reader.c (eoftoken): New.
127 (parse_token_decl): If the token being defined has value `0', it
128 is the eoftoken.
129 (packsymbols): No longer hack `tags' to insert `$' by hand.
130 Be sure to preserve the value of the eoftoken.
131 (reader): Make sure eoftoken is defined.
132 Initialize nsyms to 0: now eoftoken is created just like the others.
133 * src/print.c (print_grammar): Don't special case the eof token.
134 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
135 lie anyway, albeit pleasant.
136 * tests/calc.at: Exercise error messages with eoftoken.
137 Change the grammar so that empty input is invalid.
138 Adjust expectations.
139 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
140
ec2da99f
AD
1412001-12-27 Akim Demaille <akim@epita.fr>
142
143 * configure.in: Check the protos of strchr ans strspn.
144 Replace strchr if needed.
145 * src/system.h: Provide the protos of strchr, strspn and memchr if
146 missing.
147 * lib/strchr.c: New.
148 * src/reader.c (symbols_save): Use strchr.
149
8adfa272
AD
1502001-12-27 Akim Demaille <akim@epita.fr>
151
152 * src/print.c, src/print_graph.c (escape): New.
153 Use it to quote the TAGS outputs.
154 * src/print_graph.c (print_state): Now errors are in red, and
155 reductions in green.
156 Prefer high to wide: output the state number on a line of its own.
157
80dac38c
AD
1582001-12-27 Akim Demaille <akim@epita.fr>
159
160 * src/state.h, src/state.c (reductions_new): New.
161 * src/LR0.c (set_state_table): Let all the states have a
162 `reductions', even if reduced to 0.
163 (save_reductions): Adjust.
164 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
165 * src/print.c (print_reductions, print_actions): Adjust.
166 * src/output.c (action_row): Adjust.
167
2cec70b9
AD
1682001-12-27 Akim Demaille <akim@epita.fr>
169
170 * src/state.h, src/state.c (errs_new, errs_dup): New.
171 * src/LR0.c (set_state_table): Let all the states have an errs,
172 even if reduced to 0.
173 * src/print.c (print_errs, print_reductions): Adjust.
174 * src/output.c (output_actions, action_row): Adjust.
175 * src/conflicts.c (resolve_sr_conflict): Adjust.
176
13ca549a
AD
1772001-12-27 Akim Demaille <akim@epita.fr>
178
179 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
180
5092aba5
AD
1812001-12-27 Akim Demaille <akim@epita.fr>
182
183 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
184 * src/print.c: here.
185 (lookaheadset, shiftset): New, used as additional storage by
186 print_reductions.
187 (print_results): Adjust.
188 (print_shifts, print_gotos, print_errs): New, extracted from...
189 (print_actions): here.
190 * src/print_graph.c (print_actions): Remove dead code.
191
11e2beca
AD
1922001-12-27 Akim Demaille <akim@epita.fr>
193
194 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
195 `$n' and `@n'.
196
dac3c910
AD
1972001-12-27 Akim Demaille <akim@epita.fr>
198
199 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
200 (build_relations): Adjust.
201
d0b0fefa
AD
2022001-12-27 Akim Demaille <akim@epita.fr>
203
204 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
205 duplication.
206
adc8c848
AD
2072001-12-27 Akim Demaille <akim@epita.fr>
208
209 * src/reader.c (packgram): Catch nitems overflows.
210
14d293ac
AD
2112001-12-27 Akim Demaille <akim@epita.fr>
212
213 * src/files.c, src/files.h (guard_obstack): Remove.
214 * src/output.c (output): Adjust.
215 * src/reader.c (parse_braces): New, factoring...
216 (copy_action, copy_guard): these two which are renamed as...
217 (parse_action, parse_guard): these.
218 As a voluntary consequence, using braces around guards is now
219 mandatory.
220
f499b062
AD
2212001-12-27 Akim Demaille <akim@epita.fr>
222
223 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
224 * src/reader.c (symbol_list): `guard' and `guard_line' are new
225 members.
226 (symbol_list_new): Adjust.
227 (copy_action): action_line is the first line, not the last.
228 (copy_guard): Just as for actions, store the `action' only, not
229 the switch/case/break flesh.
230 Don't parse the user action that might follow the guard, let...
231 (readgram): do it, i.e., now, there can be an action after a
232 guard.
233 In other words the guard is just explicitly optional.
234 (packgram): Adjust.
235 * src/output.c (guards_output): New.
236 (output_parser): Call it when needed.
237 (output): Also free the guard and attrs obstacks.
238 * src/files.c, src/files.h (obstack_save): Remove.
239 (output_files): Remove.
240 As a result, if one needs the former `.act' file, using an
241 appropriate skeleton which requires actions and guards is now
242 required.
243 * src/main.c (main): Adjust.
244 * tests/semantic.at: New.
245 * tests/regression.at: Use `input.y' as input file name.
246 Avoid 8+3 problems by requiring input.c when the test needs the
247 parser.
248
d945f5cd
AD
2492001-12-27 Akim Demaille <akim@epita.fr>
250
251 * src/reader.c (symbol_list_new): Be sure to initialize all the
252 fields.
253
d200e455
AD
2542001-12-27 Akim Demaille <akim@epita.fr>
255
256 All the hacks using a final pseudo state are now useless.
257
258 * src/LR0.c (set_state_table): state_table holds exactly nstates.
259 * src/lalr.c (nLA): New.
260 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
261 instead of lookaheadsp from the pseudo state (nstate + 1).
262
f9507c28
AD
2632001-12-27 Akim Demaille <akim@epita.fr>
264
265 * src/output.c (action_row, token_actions): Use a state_t instead
266 of a integer, and nlookaheads instead of the following state's
267 lookaheadsp.
268
065fbd27
AD
2692001-12-27 Akim Demaille <akim@epita.fr>
270
271 * src/conflicts.c (log_resolution, flush_shift)
272 (resolve_sr_conflict, set_conflicts, solve_conflicts)
273 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
274 (conflicts_print, print_reductions): Use a state_t instead of an
275 integer when referring to a state.
276 As much as possible, depend upon nlookaheads, instead of the
277 `lookaheadsp' member of the following state (since lookaheads of
278 successive states are successive, the difference between state n + 1
279 and n served as the number of lookaheads for state n).
280 * src/lalr.c (add_lookback_edge): Likewise.
281 * src/print.c (print_core, print_actions, print_state)
282 (print_results): Likewise.
283 * src/print_graph.c (print_core, print_actions, print_state)
284 (print_graph): Likewise.
285 * src/conflicts.h: Adjust.
286
1b177bd7
AD
2872001-12-27 Akim Demaille <akim@epita.fr>
288
289 * src/bison.hairy: Formatting/comment changes.
290 ANSIfy.
291 Remove `register' indications.
292 Add plenty of `static'.
293
7742ddeb
AD
2942001-12-27 Akim Demaille <akim@epita.fr>
295
296 * src/output.c (prepare): Drop the muscle `ntbase' which
297 duplicates ntokens.
298 * src/bison.simple: Formatting/comment changes.
299 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
300 is an undocumented synonym.
301
1fa14068
AD
3022001-12-22 Akim Demaille <akim@epita.fr>
303
304 * src/output.c (output_table_data): Change the prototype to use
305 `int' for array ranges: some invocations do pass an int, not a
306 short.
307 Reported by Wayne Green.
308
b9752825
AD
3092001-12-22 Akim Demaille <akim@epita.fr>
310
311 Some actions of web2c.y are improperly triggered.
312 Reported by Mike Castle.
313
314 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
315 * tests/regression.at (Web2c): Rename as...
316 (Web2c Report): this.
317 (Web2c Actions): New.
318
776209d6
AD
3192001-12-22 Akim Demaille <akim@epita.fr>
320
321 Reductions in web2c.y are improperly reported.
322 Reported by Mike Castle.
323
324 * src/conflicts.c (print_reductions): Fix.
325 * tests/regression.at (Web2c): New.
326
275fc3ad
AD
3272001-12-18 Akim Demaille <akim@epita.fr>
328
329 Some host fail on `assert (!"foo")', which expands to
330 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
331 Reported by Nelson Beebee.
332
333 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
334 `#define it_succeeded 0' and `assert (it_succeeded)'.
335
897668ee
MA
3362001-12-17 Marc Autret <autret_m@epita.fr>
337
338 * src/bison.simple: Don't hard code the skeleton line and filename.
339 * src/output.c (output_parser): Rename 'line' as 'output_line'.
340 New line counter 'skeleton_line' (skeleton-line muscle).
341
ab3399e0
PE
3422001-12-17 Paul Eggert <eggert@twinsun.com>
343
344 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
345 YYDEBUG must be defined to a nonzero value.
346
347 * src/bison.simple (yytname): Do not assume that the user defines
348 YYDEBUG to a properly parenthesized expression.
349
3877f72b
AD
3502001-12-17 Akim Demaille <akim@epita.fr>
351
352 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
353 nlookaheads is a new member.
354 Adjust all users.
355 * src/lalr.h (nlookaheads): Remove this orphan declaration.
356 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
357 state.
776209d6 358
331dbc1b
AD
3592001-12-17 Akim Demaille <akim@epita.fr>
360
361 * src/files.h, src/files.c (open_files, close_files): Remove.
362 * src/main.c (main): Don't open/close files, nor invoke lex_free,
363 let...
364 * src/reader.c (reader): Do it.
776209d6 365
be750e4c
AD
3662001-12-17 Akim Demaille <akim@epita.fr>
367
368 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 369
709ae8c6
AD
3702001-12-17 Akim Demaille <akim@epita.fr>
371
372 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
373 (flush_reduce): New.
374 (resolve_sr_conflict): Adjust.
776209d6 375
f87685c3
AD
3762001-12-17 Akim Demaille <akim@epita.fr>
377
378 * src/output.c (output_obstack): Be static and rename as...
379 (format_obstack): this, to avoid any confusion with files.c's
380 output_obstack.
381 * src/reader.h (muscle_obstack): Move to...
382 * src/output.h: here, since it's defined in output.c.
383
837491d8
AD
3842001-12-17 Akim Demaille <akim@epita.fr>
385
386 * src/output.c (action_row, save_column, default_goto)
387 (sort_actions, matching_state, pack_vector): Better variable
388 locality.
389
796d61fb
AD
3902001-12-17 Akim Demaille <akim@epita.fr>
391
392 * src/output.c: Various formatting changes.
776209d6 393
64d15509
AD
3942001-12-17 Akim Demaille <akim@epita.fr>
395
396 * src/files.c (output_files): Free the output_obstack.
397 * src/main.c (main): Call print and print_graph conditionally.
398 * src/print.c (print): Work unconditionally.
399 * src/print_graph.c (print_graph): Work unconditionally.
400 * src/conflicts.c (log_resolution): Output only if verbose_flag.
401
fbc8ecb7
MA
4022001-12-16 Marc Autret <autret_m@epita.fr>
403
404 * src/output.c (actions_output): Fix. When we use %no-lines,
405 there is one less line per action.
406
f0440388
MA
4072001-12-16 Marc Autret <autret_m@epita.fr>
408
409 * src/bison.simple: Remove a useless #line directive.
410 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
411 * src/output.c (get_lines_number): New.
776209d6 412 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
413 output muscles.
414 Fix line numbering.
415 (actions_output): Computes the number of lines taken by actions.
416 (output_master_parser): Insert new skeleton which is the name of
417 the output parser file name.
418
a79986b8
MA
4192001-12-15 Marc Autret <autret_m@epita.fr>
420
421 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
422
4ec8e00f
MA
4232001-12-15 Marc Autret <autret_m@epita.fr>
424
425 * src/output.c (output_gram): Keep track of the hairy one.
426
1a4648ff
AD
4272001-12-15 Akim Demaille <akim@epita.fr>
428
429 Make `make distcheck' work.
430
431 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
432 system.h which uses libgettext.h.
433
9c2c67e6
AD
4342001-12-15 Akim Demaille <akim@epita.fr>
435
436 * src/nullable.c (set_nullable): Useless rules must be skipped,
437 otherwise, since we range over their symbols, we might look at a
438 nonterminal which no longer ``exists'', i.e., it is not counted in
439 `nvars', hence we overflow our arrays.
440
93ede233
AD
4412001-12-15 Akim Demaille <akim@epita.fr>
442
443 The header can also be produced directly, without any obstack!
444 Yahoo!
445
446 * src/files.c, src/files.h (defines_obstack): Remove.
447 (compute_header_macro): Global.
448 (defines_obstack_save): Remove.
449 * src/reader.c (parse_union_decl): No longer output to
450 defines_obstack: its content can be found in the `stype' muscle
451 anyway.
452 (output_token_translations): Merge into...
453 (symbols_output): this.
454 Rename as...
455 (symbols_save): this.
456 (reader): Adjust.
457 * src/output.c (header_output): New.
458 (output): Call it.
459
2666f928
AD
4602001-12-15 Akim Demaille <akim@epita.fr>
461
462 * src/reader.c (parse_union_decl): Instead of handling two obstack
463 simultaneously, use one to define the `stype' muscle, and use the
464 value of the latter to fill defines_obstack.
465 (copy_comment): Remove.
466 (copy_comment2): Work for a single obstack.
467 Rename as...
468 (copy_comment): this.
469
428046f8
AD
4702001-12-15 Akim Demaille <akim@epita.fr>
471
472 * src/lex.c, src/lex.h (xgetc): No longer static.
473 * src/reader.c (parse_union_decl): Revamp.
474
ea52d706
AD
4752001-12-15 Akim Demaille <akim@epita.fr>
476
477 Still making progress in separating Bison into (i) input, (ii)
478 process, (iii) output: now we can directly output the parser file
479 without using table_obstack at all.
480
481 * src/files.c, src/files.h (table_obstack): Bye bye.
482 (parser_file_name): New.
483 * src/files.c (compute_output_file_names): Compute it.
484 * src/output.c (actions_output, output_parser)
485 (output_master_parser): To a file instead of an obstack.
486
3f96f4dc
AD
4872001-12-15 Akim Demaille <akim@epita.fr>
488
489 Attach actions to rules, instead of pre-outputting them to
490 actions_obstack.
491
492 * src/gram.h (rule_t): action and action_line are new members.
493 * src/reader.c (symbol_list): Likewise.
494 (copy_action): Save the actions within the rule.
495 (packgram): Save them in rule_table.
496 * src/output.c (actions_output): New.
497 (output_parser): Use it on `%%actions'.
498 (output_rule_data): Don't free rule_table.
499 (output): Do it.
500 (prepare): Don't save the `action' muscle.
501 * src/bison.simple: s/%%action/%%actions/.
502
51576fb3
AD
5032001-12-15 Akim Demaille <akim@epita.fr>
504
505 * src/reader.c (copy_action): When --yacc, don't append a `;'
506 to the user action: let it fail if lacking.
dee049eb 507 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 508
2648a72d
AD
5092001-12-14 Akim Demaille <akim@epita.fr>
510
511 * src/lex.c (literalchar): Simply return the char you decoded, non
512 longer mess around with obstacks and int pointers.
513 Adjust all callers.
514
92790e5b
AD
5152001-12-14 Akim Demaille <akim@epita.fr>
516
517 * src/lex.c (literalchar): Don't escape the special characters,
518 just decode them, and keep them as char (before, eol was output as
519 the 2 char string `\n' etc.).
520 * src/output.c (output_rule_data): Use quotearg to output the
521 token strings.
522
927c1557
PE
5232001-12-13 Paul Eggert <eggert@twinsun.com>
524
525 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
526 Do not infringe on the global user namespace when using C++.
527 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
528 All uses of `fprintf' and `stderr' changed.
529
530 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
531
ed8e1f68
AD
5322001-12-13 Akim Demaille <akim@epita.fr>
533
534 The computation of nullable is broken: it doesn't handle empty
535 RHS's properly.
536
537 * tests/torture.at (GNU AWK Grammar): New.
538 * tests/sets.at (Nullable): New.
539 * src/nullable.c (set_nullable): Instead of blindly looping over
540 `ritems', loop over the rules, and then over their rhs's.
541
542 Work around Autotest bugs.
543
544 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
545 frame, because Autotest understand lines starting with a `+' as
546 traces from the shell. Then, they are not processed properly.
547 Admittedly an Autotest bug, but we don't have time to wait for
548 Autotest to catch up.
549 * tests/regression.at (Broken Closure): Adjust to the new table
550 frames.
551 Move to...
552 * tests/sets.at: here.
553
cb581495
AD
5542001-12-13 Akim Demaille <akim@epita.fr>
555
556 * src/closure.c (closure): Use nrules instead of playing tricks
557 with BITS_PER_WORD.
558
2e729273
AD
5592001-12-13 Akim Demaille <akim@epita.fr>
560
561 * src/print.c (print_actions): Output the handling of `$' as the
562 traces do: shifting the token EOF. Before EOF was treated as a
563 nonterminal.
564 * tests/regression.at: Adjust some tests.
565 * src/print_graph.c (print_core): Complete the set of items via
566 closure. The next-to-final and final states are still unsatisfying,
567 but that's to be addressed elsewhere.
568 No longer output the rule numbers, but do output the state number.
569 A single loop for the shifts + gotos is enough, but picked a
570 distinct color for each.
571 (print_graph): Initialize and finalize closure.
572
107f7dfb
AD
5732001-12-13 Akim Demaille <akim@epita.fr>
574
575 * src/reader.c (readgram): Remove dead code, an strip useless
576 braces.
577 (get_type): Remove, unused.
578
9b53a24f
AD
5792001-12-12 Akim Demaille <akim@epita.fr>
580
581 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
582 on that of lib/error.c.
583
dbfb6dcd
AD
5842001-12-12 Akim Demaille <akim@epita.fr>
585
586 Some hosts don't like `/' in includes.
587
588 * src/system.h: Include libgettext.h without qualifying the path.
589 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
590 $(top_srcdir).
591
c25fb648
MA
5922001-12-11 Marc Autret <autret_m@epita.fr>
593
594 * src/output.c (output_parser): Remove useless muscle.
595
710ddc4f
MA
5962001-12-11 Marc Autret <autret_m@epita.fr>
597
598 * src/bison.simple: Remove #line just before %%epilogue. It
599 is now handled in ...
600 * src/reader.c (read_additionnal_code): Add the output of a
601 #line for the epilogue.
602
e83d80b8
MA
6032001-12-10 Marc Autret <autret_m@epita.fr>
604
927c1557 605 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
606 replace precedent remove.
607 * src/bison.simple: Remove #line before %%prologue because
608 %%input-line is wrong at this time.
609
971d5158
MA
6102001-12-10 Marc Autret <autret_m@epita.fr>
611
612 * src/reader.c (symbols_output): Clean up.
927c1557 613 * src/output.c (output_gram, output): Clean up.
971d5158 614
5edafffd
AD
6152001-12-10 Akim Demaille <akim@epita.fr>
616
617 * src/lalr.c (initialize_lookaheads): New. Extracted from...
618 * src/LR0.c (set_state_table): here.
619 * src/lalr.c (lalr): Call it.
620
0279f8e9
AD
6212001-12-10 Akim Demaille <akim@epita.fr>
622
623 * src/state.h (shifts): Remove the `number' member: shifts are
624 attached to state, hence no longer need to be labelled with a
625 state number.
626
190c4f5f
AD
6272001-12-10 Akim Demaille <akim@epita.fr>
628
629 Now that states have a complete set of members, the linked list of
630 shifts is useless: just fill directly the state's shifts member.
631
632 * src/state.h (shifts): Remove the `next' member.
633 * src/LR0.c (first_state, last_state): Remove.
634 Adjust the callers.
635 (augment_automaton): Don't look for the shifts that must be added
636 a shift on EOF: it is those of the state we looked for! But now,
637 since shifts are attached, it is no longer needed to looking
638 merely by its id: its number.
639
2a73b93d
AD
6402001-12-10 Akim Demaille <akim@epita.fr>
641
642 * src/LR0.c (augment_automaton): Better variable locality.
643 Remove an impossible branch: if there is a state corresponding to
644 the start symbol being shifted, then there is shift for the start
645 symbol from the initial state.
646
74392f6a
AD
6472001-12-10 Akim Demaille <akim@epita.fr>
648
649 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
650 only when appropriate: when insert_start_shifting_state' is not
651 invoked.
652 * tests/regression.at (Rule Line Numbers): Adjust.
653
37c82725
AD
6542001-12-10 Akim Demaille <akim@epita.fr>
655
656 * src/LR0.c (augment_automaton): Now that all states have shifts,
657 merge the two cases addition shifts to the initial state.
658
6a164e0c
AD
6592001-12-10 Akim Demaille <akim@epita.fr>
660
661 * src/lalr.c (set_state_table): Move to...
662 * src/LR0.c: here.
663 * src/lalr.c (lalr): Don't call it...
664 * src/LR0.c (generate_states): do it.
665 * src/LR0.h (first_state): Remove, only the table is used.
666
7215de24
AD
6672001-12-10 Akim Demaille <akim@epita.fr>
668
669 * src/LR0.h (first_shift, first_reduction): Remove.
670 * src/lalr.c: Don't use first_shift: find shifts through the
671 states.
672
80e25d4d
AD
6732001-12-10 Akim Demaille <akim@epita.fr>
674
675 * src/LR0.c: Attach shifts to states as soon as they are
676 computed.
677 * src/lalr.c (set_state_table): Instead of assigning shifts to
678 state, just assert that the mapping was properly done.
679
0ab3728b
AD
6802001-12-10 Akim Demaille <akim@epita.fr>
681
682 * src/LR0.c (insert_start_shift): Rename as...
683 (insert_start_shifting_state): this.
684 (insert_eof_shifting_state, insert_accepting_state): New.
685 (augment_automaton): Adjust.
686 Better locality of the variables.
687 When looking if the start_symbol is shifted from the initial
688 state, using `while (... symbol != start_symbol ...)' sounds
689 better than `while (... symbol < start_symbol ...)': If fail
690 to see how the order between symbols could be relevant!
691
78af9bbc
AD
6922001-12-10 Akim Demaille <akim@epita.fr>
693
694 * src/getargs.h: Don't declare `spec_name_prefix' and
695 `spec_file_prefix', declared by src/files.h.
696 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
697 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
698 * src/output.c (prepare): Adjust.
699 * src/reader.c (symbols_output): Likewise.
700 * src/vmsgetargs.c: Vaguely adjust, but who cares?
701
bdef2a41
AD
7022001-12-10 Akim Demaille <akim@epita.fr>
703
704 * src/muscle_tab.c (muscle_init): NULL is a better default than
705 `"0"'.
706
3735969c
AD
7072001-12-10 Akim Demaille <akim@epita.fr>
708
709 * src/reader.c (reader): Calling symbols_output once is enough.
710
49701457
AD
7112001-12-10 Akim Demaille <akim@epita.fr>
712
713 Now that states have a complete set of members, the linked list of
714 reductions is useless: just fill directly the state's reductions
715 member.
716
717 * src/state.h (struct reductions): Remove member `number' and
718 `next'.
719 * src/LR0.c (first_reduction, last_reduction): Remove.
720 (save_reductions): Don't link the new reductions, store them in
721 this_state.
722 * src/lalr.c (set_state_table): No need to attach reductions to
723 states, it's already done.
724 * src/output.c (output_actions): No longer free the shifts, then
725 the reductions, then the states: free all the states and their
726 members.
727
0edad749
AD
7282001-12-10 Akim Demaille <akim@epita.fr>
729
730 * src/options.c (OPTN, DRTV, BOTH): New.
731 (option_table): Use them.
732
0edad749
AD
733 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
734 the job of system.h.
735 * src/options.c: Don't include stdio.h and xalloc.h for the same
736 reasons.
737
5449dd0f
AD
7382001-12-10 Akim Demaille <akim@epita.fr>
739
740 * src/output.c (output, prepare): Make sure the values of the
741 muscles `action' and `prologue' are 0-terminated.
742
a870c567
AD
7432001-12-10 Akim Demaille <akim@epita.fr>
744
745 Clean up GCC warnings.
746
747 * src/reader.c (copy_action): `buf' is not used.
748 (parse_skel_decl): Be static.
749 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
750 * src/options.h (create_long_option_table): Have a real prototype.
751 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
752 (hash_delete_at): Return const void *.
753 Adjust casts to preserve the const.
754
80df8768
AD
7552001-12-10 Akim Demaille <akim@epita.fr>
756
757 * configure.in: Require 2.52g.
758 M4 is not needed, but AUTOM4TE is.
759 * m4/m4.m4: Remove.
760 * tests/Makefile.am: Adjust.
761
f693ad14
AD
7622001-12-10 Akim Demaille <akim@epita.fr>
763
764 One structure for states is enough, even though theoretically
765 there are LR(0) states and LALR(1) states.
766
767 * src/lalr.h (state_t): Remove.
768 (state_table): Be state_t **, not state_t *.
769 * src/state.h (core, CORE_ALLOC): Rename as...
770 (state_t, STATE_ALLOC): this.
771 Add the LALR(1) members: shifts, reductions, errs.
772 * src/LR0.c (state_table): Rename as...
773 (state_hash): this, to avoid name clashes with the global
774 `state_table'.
775 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
776 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
777
74ffbcb6
AD
7782001-12-10 Akim Demaille <akim@epita.fr>
779
780 Bison dumps core on bash.y.
781 Reported by Pascal Bart.
782
783 * src/warshall.c (bitmatrix_print): New.
784 (TC): Use it.
785 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
786 j must be the outer loop.
787 * tests/regression.at (Broken Closure): New.
788
07708e19
AD
7892001-12-05 Akim Demaille <akim@epita.fr>
790
791 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
792 its argument.
793