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