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