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