]> git.saurik.com Git - bison.git/blame - ChangeLog
All the hacks using a final pseudo state are now useless.
[bison.git] / ChangeLog
CommitLineData
d200e455
AD
12001-12-27 Akim Demaille <akim@epita.fr>
2
3 All the hacks using a final pseudo state are now useless.
4
5 * src/LR0.c (set_state_table): state_table holds exactly nstates.
6 * src/lalr.c (nLA): New.
7 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
8 instead of lookaheadsp from the pseudo state (nstate + 1).
9
f9507c28
AD
102001-12-27 Akim Demaille <akim@epita.fr>
11
12 * src/output.c (action_row, token_actions): Use a state_t instead
13 of a integer, and nlookaheads instead of the following state's
14 lookaheadsp.
15
16
065fbd27
AD
172001-12-27 Akim Demaille <akim@epita.fr>
18
19 * src/conflicts.c (log_resolution, flush_shift)
20 (resolve_sr_conflict, set_conflicts, solve_conflicts)
21 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
22 (conflicts_print, print_reductions): Use a state_t instead of an
23 integer when referring to a state.
24 As much as possible, depend upon nlookaheads, instead of the
25 `lookaheadsp' member of the following state (since lookaheads of
26 successive states are successive, the difference between state n + 1
27 and n served as the number of lookaheads for state n).
28 * src/lalr.c (add_lookback_edge): Likewise.
29 * src/print.c (print_core, print_actions, print_state)
30 (print_results): Likewise.
31 * src/print_graph.c (print_core, print_actions, print_state)
32 (print_graph): Likewise.
33 * src/conflicts.h: Adjust.
34
1b177bd7
AD
352001-12-27 Akim Demaille <akim@epita.fr>
36
37 * src/bison.hairy: Formatting/comment changes.
38 ANSIfy.
39 Remove `register' indications.
40 Add plenty of `static'.
41
7742ddeb
AD
422001-12-27 Akim Demaille <akim@epita.fr>
43
44 * src/output.c (prepare): Drop the muscle `ntbase' which
45 duplicates ntokens.
46 * src/bison.simple: Formatting/comment changes.
47 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
48 is an undocumented synonym.
49
50
1fa14068
AD
512001-12-22 Akim Demaille <akim@epita.fr>
52
53 * src/output.c (output_table_data): Change the prototype to use
54 `int' for array ranges: some invocations do pass an int, not a
55 short.
56 Reported by Wayne Green.
57
b9752825
AD
582001-12-22 Akim Demaille <akim@epita.fr>
59
60 Some actions of web2c.y are improperly triggered.
61 Reported by Mike Castle.
62
63 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
64 * tests/regression.at (Web2c): Rename as...
65 (Web2c Report): this.
66 (Web2c Actions): New.
67
776209d6
AD
682001-12-22 Akim Demaille <akim@epita.fr>
69
70 Reductions in web2c.y are improperly reported.
71 Reported by Mike Castle.
72
73 * src/conflicts.c (print_reductions): Fix.
74 * tests/regression.at (Web2c): New.
75
275fc3ad
AD
762001-12-18 Akim Demaille <akim@epita.fr>
77
78 Some host fail on `assert (!"foo")', which expands to
79 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
80 Reported by Nelson Beebee.
81
82 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
83 `#define it_succeeded 0' and `assert (it_succeeded)'.
84
897668ee
MA
852001-12-17 Marc Autret <autret_m@epita.fr>
86
87 * src/bison.simple: Don't hard code the skeleton line and filename.
88 * src/output.c (output_parser): Rename 'line' as 'output_line'.
89 New line counter 'skeleton_line' (skeleton-line muscle).
90
ab3399e0
PE
912001-12-17 Paul Eggert <eggert@twinsun.com>
92
93 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
94 YYDEBUG must be defined to a nonzero value.
95
96 * src/bison.simple (yytname): Do not assume that the user defines
97 YYDEBUG to a properly parenthesized expression.
98
3877f72b
AD
992001-12-17 Akim Demaille <akim@epita.fr>
100
101 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
102 nlookaheads is a new member.
103 Adjust all users.
104 * src/lalr.h (nlookaheads): Remove this orphan declaration.
105 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
106 state.
776209d6 107
331dbc1b
AD
1082001-12-17 Akim Demaille <akim@epita.fr>
109
110 * src/files.h, src/files.c (open_files, close_files): Remove.
111 * src/main.c (main): Don't open/close files, nor invoke lex_free,
112 let...
113 * src/reader.c (reader): Do it.
776209d6 114
be750e4c
AD
1152001-12-17 Akim Demaille <akim@epita.fr>
116
117 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 118
709ae8c6
AD
1192001-12-17 Akim Demaille <akim@epita.fr>
120
121 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
122 (flush_reduce): New.
123 (resolve_sr_conflict): Adjust.
776209d6 124
f87685c3
AD
1252001-12-17 Akim Demaille <akim@epita.fr>
126
127 * src/output.c (output_obstack): Be static and rename as...
128 (format_obstack): this, to avoid any confusion with files.c's
129 output_obstack.
130 * src/reader.h (muscle_obstack): Move to...
131 * src/output.h: here, since it's defined in output.c.
132
837491d8
AD
1332001-12-17 Akim Demaille <akim@epita.fr>
134
135 * src/output.c (action_row, save_column, default_goto)
136 (sort_actions, matching_state, pack_vector): Better variable
137 locality.
138
796d61fb
AD
1392001-12-17 Akim Demaille <akim@epita.fr>
140
141 * src/output.c: Various formatting changes.
776209d6 142
64d15509
AD
1432001-12-17 Akim Demaille <akim@epita.fr>
144
145 * src/files.c (output_files): Free the output_obstack.
146 * src/main.c (main): Call print and print_graph conditionally.
147 * src/print.c (print): Work unconditionally.
148 * src/print_graph.c (print_graph): Work unconditionally.
149 * src/conflicts.c (log_resolution): Output only if verbose_flag.
150
fbc8ecb7
MA
1512001-12-16 Marc Autret <autret_m@epita.fr>
152
153 * src/output.c (actions_output): Fix. When we use %no-lines,
154 there is one less line per action.
155
f0440388
MA
1562001-12-16 Marc Autret <autret_m@epita.fr>
157
158 * src/bison.simple: Remove a useless #line directive.
159 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
160 * src/output.c (get_lines_number): New.
776209d6 161 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
162 output muscles.
163 Fix line numbering.
164 (actions_output): Computes the number of lines taken by actions.
165 (output_master_parser): Insert new skeleton which is the name of
166 the output parser file name.
167
a79986b8
MA
1682001-12-15 Marc Autret <autret_m@epita.fr>
169
170 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
171
4ec8e00f
MA
1722001-12-15 Marc Autret <autret_m@epita.fr>
173
174 * src/output.c (output_gram): Keep track of the hairy one.
175
1a4648ff
AD
1762001-12-15 Akim Demaille <akim@epita.fr>
177
178 Make `make distcheck' work.
179
180 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
181 system.h which uses libgettext.h.
182
9c2c67e6
AD
1832001-12-15 Akim Demaille <akim@epita.fr>
184
185 * src/nullable.c (set_nullable): Useless rules must be skipped,
186 otherwise, since we range over their symbols, we might look at a
187 nonterminal which no longer ``exists'', i.e., it is not counted in
188 `nvars', hence we overflow our arrays.
189
93ede233
AD
1902001-12-15 Akim Demaille <akim@epita.fr>
191
192 The header can also be produced directly, without any obstack!
193 Yahoo!
194
195 * src/files.c, src/files.h (defines_obstack): Remove.
196 (compute_header_macro): Global.
197 (defines_obstack_save): Remove.
198 * src/reader.c (parse_union_decl): No longer output to
199 defines_obstack: its content can be found in the `stype' muscle
200 anyway.
201 (output_token_translations): Merge into...
202 (symbols_output): this.
203 Rename as...
204 (symbols_save): this.
205 (reader): Adjust.
206 * src/output.c (header_output): New.
207 (output): Call it.
208
2666f928
AD
2092001-12-15 Akim Demaille <akim@epita.fr>
210
211 * src/reader.c (parse_union_decl): Instead of handling two obstack
212 simultaneously, use one to define the `stype' muscle, and use the
213 value of the latter to fill defines_obstack.
214 (copy_comment): Remove.
215 (copy_comment2): Work for a single obstack.
216 Rename as...
217 (copy_comment): this.
218
428046f8
AD
2192001-12-15 Akim Demaille <akim@epita.fr>
220
221 * src/lex.c, src/lex.h (xgetc): No longer static.
222 * src/reader.c (parse_union_decl): Revamp.
223
ea52d706
AD
2242001-12-15 Akim Demaille <akim@epita.fr>
225
226 Still making progress in separating Bison into (i) input, (ii)
227 process, (iii) output: now we can directly output the parser file
228 without using table_obstack at all.
229
230 * src/files.c, src/files.h (table_obstack): Bye bye.
231 (parser_file_name): New.
232 * src/files.c (compute_output_file_names): Compute it.
233 * src/output.c (actions_output, output_parser)
234 (output_master_parser): To a file instead of an obstack.
235
3f96f4dc
AD
2362001-12-15 Akim Demaille <akim@epita.fr>
237
238 Attach actions to rules, instead of pre-outputting them to
239 actions_obstack.
240
241 * src/gram.h (rule_t): action and action_line are new members.
242 * src/reader.c (symbol_list): Likewise.
243 (copy_action): Save the actions within the rule.
244 (packgram): Save them in rule_table.
245 * src/output.c (actions_output): New.
246 (output_parser): Use it on `%%actions'.
247 (output_rule_data): Don't free rule_table.
248 (output): Do it.
249 (prepare): Don't save the `action' muscle.
250 * src/bison.simple: s/%%action/%%actions/.
251
51576fb3
AD
2522001-12-15 Akim Demaille <akim@epita.fr>
253
254 * src/reader.c (copy_action): When --yacc, don't append a `;'
255 to the user action: let it fail if lacking.
dee049eb 256 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 257
2648a72d
AD
2582001-12-14 Akim Demaille <akim@epita.fr>
259
260 * src/lex.c (literalchar): Simply return the char you decoded, non
261 longer mess around with obstacks and int pointers.
262 Adjust all callers.
263
92790e5b
AD
2642001-12-14 Akim Demaille <akim@epita.fr>
265
266 * src/lex.c (literalchar): Don't escape the special characters,
267 just decode them, and keep them as char (before, eol was output as
268 the 2 char string `\n' etc.).
269 * src/output.c (output_rule_data): Use quotearg to output the
270 token strings.
271
927c1557
PE
2722001-12-13 Paul Eggert <eggert@twinsun.com>
273
274 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
275 Do not infringe on the global user namespace when using C++.
276 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
277 All uses of `fprintf' and `stderr' changed.
278
279 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
280
ed8e1f68
AD
2812001-12-13 Akim Demaille <akim@epita.fr>
282
283 The computation of nullable is broken: it doesn't handle empty
284 RHS's properly.
285
286 * tests/torture.at (GNU AWK Grammar): New.
287 * tests/sets.at (Nullable): New.
288 * src/nullable.c (set_nullable): Instead of blindly looping over
289 `ritems', loop over the rules, and then over their rhs's.
290
291 Work around Autotest bugs.
292
293 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
294 frame, because Autotest understand lines starting with a `+' as
295 traces from the shell. Then, they are not processed properly.
296 Admittedly an Autotest bug, but we don't have time to wait for
297 Autotest to catch up.
298 * tests/regression.at (Broken Closure): Adjust to the new table
299 frames.
300 Move to...
301 * tests/sets.at: here.
302
cb581495
AD
3032001-12-13 Akim Demaille <akim@epita.fr>
304
305 * src/closure.c (closure): Use nrules instead of playing tricks
306 with BITS_PER_WORD.
307
2e729273
AD
3082001-12-13 Akim Demaille <akim@epita.fr>
309
310 * src/print.c (print_actions): Output the handling of `$' as the
311 traces do: shifting the token EOF. Before EOF was treated as a
312 nonterminal.
313 * tests/regression.at: Adjust some tests.
314 * src/print_graph.c (print_core): Complete the set of items via
315 closure. The next-to-final and final states are still unsatisfying,
316 but that's to be addressed elsewhere.
317 No longer output the rule numbers, but do output the state number.
318 A single loop for the shifts + gotos is enough, but picked a
319 distinct color for each.
320 (print_graph): Initialize and finalize closure.
321
107f7dfb
AD
3222001-12-13 Akim Demaille <akim@epita.fr>
323
324 * src/reader.c (readgram): Remove dead code, an strip useless
325 braces.
326 (get_type): Remove, unused.
327
9b53a24f
AD
3282001-12-12 Akim Demaille <akim@epita.fr>
329
330 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
331 on that of lib/error.c.
332
dbfb6dcd
AD
3332001-12-12 Akim Demaille <akim@epita.fr>
334
335 Some hosts don't like `/' in includes.
336
337 * src/system.h: Include libgettext.h without qualifying the path.
338 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
339 $(top_srcdir).
340
c25fb648
MA
3412001-12-11 Marc Autret <autret_m@epita.fr>
342
343 * src/output.c (output_parser): Remove useless muscle.
344
710ddc4f
MA
3452001-12-11 Marc Autret <autret_m@epita.fr>
346
347 * src/bison.simple: Remove #line just before %%epilogue. It
348 is now handled in ...
349 * src/reader.c (read_additionnal_code): Add the output of a
350 #line for the epilogue.
351
e83d80b8
MA
3522001-12-10 Marc Autret <autret_m@epita.fr>
353
927c1557 354 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
355 replace precedent remove.
356 * src/bison.simple: Remove #line before %%prologue because
357 %%input-line is wrong at this time.
358
971d5158
MA
3592001-12-10 Marc Autret <autret_m@epita.fr>
360
361 * src/reader.c (symbols_output): Clean up.
927c1557 362 * src/output.c (output_gram, output): Clean up.
971d5158 363
5edafffd
AD
3642001-12-10 Akim Demaille <akim@epita.fr>
365
366 * src/lalr.c (initialize_lookaheads): New. Extracted from...
367 * src/LR0.c (set_state_table): here.
368 * src/lalr.c (lalr): Call it.
369
0279f8e9
AD
3702001-12-10 Akim Demaille <akim@epita.fr>
371
372 * src/state.h (shifts): Remove the `number' member: shifts are
373 attached to state, hence no longer need to be labelled with a
374 state number.
375
190c4f5f
AD
3762001-12-10 Akim Demaille <akim@epita.fr>
377
378 Now that states have a complete set of members, the linked list of
379 shifts is useless: just fill directly the state's shifts member.
380
381 * src/state.h (shifts): Remove the `next' member.
382 * src/LR0.c (first_state, last_state): Remove.
383 Adjust the callers.
384 (augment_automaton): Don't look for the shifts that must be added
385 a shift on EOF: it is those of the state we looked for! But now,
386 since shifts are attached, it is no longer needed to looking
387 merely by its id: its number.
388
2a73b93d
AD
3892001-12-10 Akim Demaille <akim@epita.fr>
390
391 * src/LR0.c (augment_automaton): Better variable locality.
392 Remove an impossible branch: if there is a state corresponding to
393 the start symbol being shifted, then there is shift for the start
394 symbol from the initial state.
395
74392f6a
AD
3962001-12-10 Akim Demaille <akim@epita.fr>
397
398 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
399 only when appropriate: when insert_start_shifting_state' is not
400 invoked.
401 * tests/regression.at (Rule Line Numbers): Adjust.
402
37c82725
AD
4032001-12-10 Akim Demaille <akim@epita.fr>
404
405 * src/LR0.c (augment_automaton): Now that all states have shifts,
406 merge the two cases addition shifts to the initial state.
407
6a164e0c
AD
4082001-12-10 Akim Demaille <akim@epita.fr>
409
410 * src/lalr.c (set_state_table): Move to...
411 * src/LR0.c: here.
412 * src/lalr.c (lalr): Don't call it...
413 * src/LR0.c (generate_states): do it.
414 * src/LR0.h (first_state): Remove, only the table is used.
415
7215de24
AD
4162001-12-10 Akim Demaille <akim@epita.fr>
417
418 * src/LR0.h (first_shift, first_reduction): Remove.
419 * src/lalr.c: Don't use first_shift: find shifts through the
420 states.
421
80e25d4d
AD
4222001-12-10 Akim Demaille <akim@epita.fr>
423
424 * src/LR0.c: Attach shifts to states as soon as they are
425 computed.
426 * src/lalr.c (set_state_table): Instead of assigning shifts to
427 state, just assert that the mapping was properly done.
428
0ab3728b
AD
4292001-12-10 Akim Demaille <akim@epita.fr>
430
431 * src/LR0.c (insert_start_shift): Rename as...
432 (insert_start_shifting_state): this.
433 (insert_eof_shifting_state, insert_accepting_state): New.
434 (augment_automaton): Adjust.
435 Better locality of the variables.
436 When looking if the start_symbol is shifted from the initial
437 state, using `while (... symbol != start_symbol ...)' sounds
438 better than `while (... symbol < start_symbol ...)': If fail
439 to see how the order between symbols could be relevant!
440
78af9bbc
AD
4412001-12-10 Akim Demaille <akim@epita.fr>
442
443 * src/getargs.h: Don't declare `spec_name_prefix' and
444 `spec_file_prefix', declared by src/files.h.
445 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
446 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
447 * src/output.c (prepare): Adjust.
448 * src/reader.c (symbols_output): Likewise.
449 * src/vmsgetargs.c: Vaguely adjust, but who cares?
450
bdef2a41
AD
4512001-12-10 Akim Demaille <akim@epita.fr>
452
453 * src/muscle_tab.c (muscle_init): NULL is a better default than
454 `"0"'.
455
3735969c
AD
4562001-12-10 Akim Demaille <akim@epita.fr>
457
458 * src/reader.c (reader): Calling symbols_output once is enough.
459
49701457
AD
4602001-12-10 Akim Demaille <akim@epita.fr>
461
462 Now that states have a complete set of members, the linked list of
463 reductions is useless: just fill directly the state's reductions
464 member.
465
466 * src/state.h (struct reductions): Remove member `number' and
467 `next'.
468 * src/LR0.c (first_reduction, last_reduction): Remove.
469 (save_reductions): Don't link the new reductions, store them in
470 this_state.
471 * src/lalr.c (set_state_table): No need to attach reductions to
472 states, it's already done.
473 * src/output.c (output_actions): No longer free the shifts, then
474 the reductions, then the states: free all the states and their
475 members.
476
0edad749
AD
4772001-12-10 Akim Demaille <akim@epita.fr>
478
479 * src/options.c (OPTN, DRTV, BOTH): New.
480 (option_table): Use them.
481
0edad749
AD
482 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
483 the job of system.h.
484 * src/options.c: Don't include stdio.h and xalloc.h for the same
485 reasons.
486
5449dd0f
AD
4872001-12-10 Akim Demaille <akim@epita.fr>
488
489 * src/output.c (output, prepare): Make sure the values of the
490 muscles `action' and `prologue' are 0-terminated.
491
a870c567
AD
4922001-12-10 Akim Demaille <akim@epita.fr>
493
494 Clean up GCC warnings.
495
496 * src/reader.c (copy_action): `buf' is not used.
497 (parse_skel_decl): Be static.
498 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
499 * src/options.h (create_long_option_table): Have a real prototype.
500 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
501 (hash_delete_at): Return const void *.
502 Adjust casts to preserve the const.
503
80df8768
AD
5042001-12-10 Akim Demaille <akim@epita.fr>
505
506 * configure.in: Require 2.52g.
507 M4 is not needed, but AUTOM4TE is.
508 * m4/m4.m4: Remove.
509 * tests/Makefile.am: Adjust.
510
f693ad14
AD
5112001-12-10 Akim Demaille <akim@epita.fr>
512
513 One structure for states is enough, even though theoretically
514 there are LR(0) states and LALR(1) states.
515
516 * src/lalr.h (state_t): Remove.
517 (state_table): Be state_t **, not state_t *.
518 * src/state.h (core, CORE_ALLOC): Rename as...
519 (state_t, STATE_ALLOC): this.
520 Add the LALR(1) members: shifts, reductions, errs.
521 * src/LR0.c (state_table): Rename as...
522 (state_hash): this, to avoid name clashes with the global
523 `state_table'.
524 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
525 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
526
74ffbcb6
AD
5272001-12-10 Akim Demaille <akim@epita.fr>
528
529 Bison dumps core on bash.y.
530 Reported by Pascal Bart.
531
532 * src/warshall.c (bitmatrix_print): New.
533 (TC): Use it.
534 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
535 j must be the outer loop.
536 * tests/regression.at (Broken Closure): New.
537
07708e19
AD
5382001-12-05 Akim Demaille <akim@epita.fr>
539
540 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
541 its argument.
542