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