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