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