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