]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/system.h: No longer using strndup.
[bison.git] / ChangeLog
CommitLineData
9a636f47
AD
12002-04-08 Akim Demaille <akim@epita.fr>
2
3 * src/system.h: No longer using strndup.
4
5
680e8701
AD
62002-04-07 Akim Demaille <akim@epita.fr>
7
8 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
9 * src/output.c (output_table_data): Return the longest number.
10 (prepare_tokens): Output `token_number_max').
11 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
12 New.
13 Use them to define yy_token_number_type/TokenNumberType.
14 Use this type for yytranslate.
15 * tests/torture.at (Big triangle): Push the limit from 124 to
16 253.
17 * tests/regression.at (Web2c Actions): Adjust.
18
817e9f41
AD
192002-04-07 Akim Demaille <akim@epita.fr>
20
21 * tests/torture.at (Big triangle): New.
22 (GNU AWK Grammar, GNU Cim Grammar): Move to...
23 * tests/existing.at: here.
24
5123689b
AD
252002-04-07 Akim Demaille <akim@epita.fr>
26
27 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
28 nritems.
29 Adjust dependencies.
30
f3849179
AD
312002-04-07 Akim Demaille <akim@epita.fr>
32
33 * src/reader.c: Normalize increments to prefix form.
34
bd02036a
AD
352002-04-07 Akim Demaille <akim@epita.fr>
36
37 * src/reader.c, symtab.c: Remove debugging code.
38
db8837cb
AD
392002-04-07 Akim Demaille <akim@epita.fr>
40
41 Rename all the `bucket's as `symbol_t'.
42
43 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
44 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
45 * src/symtab.c, src/symtab.h (bucket): Rename as...
46 (symbol_t): this.
47 (symbol_list_new, bucket_check_defined, bucket_make_alias)
48 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
49 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
50 (buckets_new, buckets_free, buckets_do): Rename as...
51 (symbol_list_new, symbol_check_defined, symbol_make_alias)
52 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
53 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
54 (symbols_new, symbols_free, symbols_do): these.
55
72a23c97
AD
562002-04-07 Akim Demaille <akim@epita.fr>
57
58 Use lib/hash for the symbol table.
59
60 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
61 EOF.
62 * src/lex.c (lex): Set the `number' member of new terminals.
63 * src/reader.c (bucket_check_defined, bucket_make_alias)
64 (bucket_check_alias_consistence, bucket_translation): New.
65 (reader, grammar_free, readgram, token_translations_init)
66 (packsymbols): Adjust.
67 (reader): Number the predefined tokens.
68 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
69 for predefined tokens.
70 * src/symtab.h (bucket): Remove all the hash table related
71 members.
72 * src/symtab.c (symtab): Replace by...
73 (bucket_table): this.
74 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
75 (buckets_new, buckets_do): New.
76
280a38c3
AD
772002-04-07 Akim Demaille <akim@epita.fr>
78
79 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
80 (start_symbol, max_user_token_number, semantic_parser)
81 (error_token_number): Initialize.
82 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
83 Initialize.
84 (reader): Don't.
85 (errtoken, eoftoken, undeftoken, axiom): Extern.
86
03b31c0c
AD
872002-04-07 Akim Demaille <akim@epita.fr>
88
89 * src/gram.h (rule_s): prec and precsym are now pointers
90 to the bucket giving the priority/associativity.
91 Member `associativity' removed: useless.
92 * src/reduce.c, src/conflicts.c: Adjust.
93
8b3df748
AD
942002-04-07 Akim Demaille <akim@epita.fr>
95
96 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
97 Properly escape the symbols' TAG when outputting them.
98
e601aa1d
AD
992002-04-07 Akim Demaille <akim@epita.fr>
100
101 * src/lalr.h (LA): Is a bitsetv, not bitset*.
102
b0299a2e
AD
1032002-04-07 Akim Demaille <akim@epita.fr>
104
105 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
106 (LArule): this, which is an array to rule_t*.
107 * src/print.c, src/conflicts.c: Adjust.
108
d7e1f00c
AD
1092002-04-07 Akim Demaille <akim@epita.fr>
110
111 * src/gram.h (rule_t): Rename `number' as `user_number'.
112 `number' is a new member.
113 Adjust dependencies.
114 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
115
cc9305dd
AD
1162002-04-07 Akim Demaille <akim@epita.fr>
117
118 As a result of the previous patch, it is no longer needed
119 to reorder ritem itself.
120
121 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
122
b0940840
AD
1232002-04-07 Akim Demaille <akim@epita.fr>
124
125 Be sure never to walk through RITEMS, but use only data related to
126 the rules themselves. RITEMS should be banished.
127
128 * src/output.c (output_token_translations): Rename as...
129 (prepare_tokens): this.
130 In addition to `translate', prepare the muscles `tname' and
131 `toknum', which were handled by...
132 (output_rule_data): this.
133 Remove, and move the remainder of its outputs into...
134 (prepare_rules): this new routines, which also merges content from
135 (output_gram): this.
136 (prepare_rules): Be sure never to walk through RITEMS.
137 (output_stos): Rename as...
138 (prepare_stos): this.
139 (output): Always invoke prepare_states, after all, just don't use it
140 in the output if you don't need it.
141
643a5994
AD
1422002-04-07 Akim Demaille <akim@epita.fr>
143
144 * src/LR0.c (new_state): Display `nstates' as the name of the
145 newly created state.
146 Adjust to initialize first_state and last_state if needed.
147 Be sure to distinguish the initial from the final state.
148 (new_states): Create the itemset of the initial state, and use
149 new_state.
150 * src/closure.c (closure): Now that the initial state has its
151 items properly set, there is no need for a special case when
152 creating `ruleset'.
153
154 As a result, now the rule 0, reducing to $axiom, is visible in the
155 outputs. Adjust the test suite.
156
157 * tests/conflicts.at (Solved SR Conflicts)
158 (Unresolved SR Conflicts): Adjust.
159 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
160 * tests/conflicts.at (S/R in initial): New.
161
b4c4ccc2
AD
1622002-04-07 Akim Demaille <akim@epita.fr>
163
164 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
165 the RHS of the rules.
166 * src/output.c (output_gram): Likewise.
167
bba97eb2
AD
1682002-04-07 Akim Demaille <akim@epita.fr>
169
170 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
171 bucket.
172 Adjust all dependencies.
173 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
174 `number' of the buckets too.
175 * src/gram.h: Include `symtab.h'.
176 (associativity): Move to...
177 * src/symtab.h: here.
178 No longer include `gram.h'.
179
c3b407f4
AD
1802002-04-07 Akim Demaille <akim@epita.fr>
181
182 * src/gram.h, src/gram.c (rules_rhs_length): New.
183 (ritem_longest_rhs): Use it.
184 * src/gram.h (rule_t): `number' is a new member.
185 * src/reader.c (packgram): Set it.
186 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
187 the end of `rules', and count them out of `nrules'.
188 (reduce_output, dump_grammar): Adjust.
189 * src/print.c (print_grammar): It is no longer needed to check for
190 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
191 * tests/reduce.at (Reduced Automaton): New test.
192
11652ab3
AD
1932002-04-07 Akim Demaille <akim@epita.fr>
194
195 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
196 lacking `+ 1' to nrules, Bison reported as useless a token if it
197 was used solely to set the precedence of the last rule...
198
26b23c1a
AD
1992002-04-07 Akim Demaille <akim@epita.fr>
200
201 * data/bison.c++, data/bison.simple: Don't output the current file
202 name in #line, to avoid useless diffs between two identical
203 outputs under different names.
204
18bcecb0
AD
2052002-04-07 Akim Demaille <akim@epita.fr>
206
207 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
208 Normalize loops to using `< nrules + 1', not `<= nrules'.
209
fa770c86
AD
2102002-04-07 Akim Demaille <akim@epita.fr>
211
212 * TODO: Update.
213
d9b739c3
AD
2142002-04-07 Akim Demaille <akim@epita.fr>
215
216 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
217 bucket.value as bucket.number.
218
99013900
AD
2192002-04-07 Akim Demaille <akim@epita.fr>
220
221 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
222 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
223 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
224 RHS, instead of being an index in RITEMS.
225
e966383b
PE
2262002-04-04 Paul Eggert <eggert@twinsun.com>
227
228 * doc/bison.texinfo: Update copyright date.
229 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
230 (Symbols): Warn about running Bison in one character set,
231 but compiling and/or running in an incompatible one.
232 Warn about character code 256, too.
233
2342002-04-03 Paul Eggert <eggert@twinsun.com>
235
236 * src/bison.data (YYSTACK_ALLOC): Depend on whether
237 YYERROR_VERBOSE is nonzero, not whether it is defined.
238
239 Merge changes from bison-1_29-branch.
c307773e 240
8d6c48b9
PE
2412002-03-20 Paul Eggert <eggert@twinsun.com>
242
243 Merge fixes from Debian bison_1.34-1.diff.
244
245 * configure.in (AC_PREREQ): 2.53.
246
e53c6322
AD
2472002-03-20 Akim Demaille <akim@epita.fr>
248
249 * src/conflicts.c (log_resolution): Argument `resolution' is const.
250
9ffbeca7
PE
2512002-03-19 Paul Eggert <eggert@twinsun.com>
252
21db0b2a
PE
253 * src/bison.simple (YYCOPY): New macro.
254 (YYSTACK_RELOCATE): Use it.
255 Remove Type arg; no longer needed. All callers changed.
256 (yymemcpy): Remove; no longer needed.
257
9ffbeca7
PE
258 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
259 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
260
642cb8f8
AD
2612002-03-19 Akim Demaille <akim@epita.fr>
262
263 Test and fix the #line outputs.
264
265 * tests/atlocal.at (GCC): New.
266 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
267 (Prologue synch line, ,%union synch line, Postprologue synch line)
268 (Action synch line, Epilogue synch line): New tests.
269 * src/reader.c (parse_union_decl): Define the muscle stype_line.
270 * data/bison.simple, data/bison.c++: Use it.
271
3c31a486
AD
2722002-03-19 Akim Demaille <akim@epita.fr>
273
274 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
275 (Solved SR Conflicts, %expect not enough, %expect right)
276 (%expect too much): Move to...
277 * tests/conflicts.at: this new file.
278
0d8bed56
AD
2792002-03-19 Akim Demaille <akim@epita.fr>
280
281 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
282 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
283 that we can move to enums for instance.
284 * src/output.c (token_definitions_output): Output a list of
285 `token-name, token-number' instead of the #define.
286 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
287
9208d17f
AD
2882002-03-14 Akim Demaille <akim@epita.fr>
289
290 Use Gettext 0.11.1.
291
af27eacb
RA
2922002-03-09 Robert Anisko <robert@lrde.epita.fr>
293
294 * data/bison.c++: Make the user able to add members to the generated
295 parser by subclassing.
296
9101a310
RA
2972002-03-05 Robert Anisko <robert@lrde.epita.fr>
298
299 * src/reader.c (read_additionnal_code): `c' should be an integer, not
300 a character.
301 Reported by Nicolas Tisserand and Nicolas Burrus.
302
fff9bf0b
RA
3032002-03-04 Robert Anisko <robert@lrde.epita.fr>
304
305 * src/reader.c: Warn about lacking semi-colons, do not complain.
306
64dba31e
RA
3072002-03-04 Robert Anisko <robert@lrde.epita.fr>
308
309 * data/bison.c++: Remove a debug line.
310
374f5a14
RA
3112002-03-04 Robert Anisko <robert@lrde.epita.fr>
312
313 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
314 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
315 provide a default implementation.
316
bfcf1f3a
AD
3172002-03-04 Akim Demaille <akim@epita.fr>
318
319 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
320 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
321 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
322 * tests/semantic.at (Parsing Guards): Similarly.
323 * src/reader.at (readgram): Complain if the last rule is not ended
324 with a semi-colon.
325
65ccf9fc
AD
3262002-03-04 Akim Demaille <akim@epita.fr>
327
328 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
329 * src/closure.c: here.
330 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
331 RTC.
332 * src/warshall.h, src/warshall.c: Remove.
333 * tests/sets.at (Broken Closure): Adjust.
334
d0039cbc
AD
3352002-03-04 Akim Demaille <akim@epita.fr>
336
337 * src/output.c (output_skeleton): tempdir is const.
338 bytes_read is unused.
339
345cea78
AD
3402002-03-04 Akim Demaille <akim@epita.fr>
341
342 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
343 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
344 Update.
345 From Michael Hayes.
346
564801f7
AD
3472002-03-04 Akim Demaille <akim@epita.fr>
348
349 * src/closure.c (closure): `r' is unused.
350
e5352bc7
AD
3512002-03-04 Akim Demaille <akim@epita.fr>
352
353 * tests/sets.at (Broken Closure): Add the ending `;'.
354 * src/reader.at (readgram): Complain if a rule is not ended with a
355 semi-colon.
356
914feea9
AD
3572002-03-04 Akim Demaille <akim@epita.fr>
358
359 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
360 (count_sr_conflicts): Use bitset_count.
361 * src/reduce.c (inaccessable_symbols): Ditto.
362 (bits_size): Remove.
363 * src/warshall.h, src/warshall.c: Convert to bitsetv.
364
f0250de6
AD
3652002-03-04 Akim Demaille <akim@epita.fr>
366
367 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
368 * src/reduce.c: Remove the `bitset_zero's following the
369 `bitset_create's, as now it is performed by the latter.
370
ef017502
AD
3712002-03-04 Akim Demaille <akim@epita.fr>
372
373 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
374 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
375 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
376 latest sources from Michael.
377
76514394
AD
3782002-03-04 Akim Demaille <akim@epita.fr>
379
380 * src/output.c (output): Don't free the grammar.
381 * src/reader.c (grammar_free): New.
382 * src/main.c (main): Call it and don't free symtab here.
383
55024580
AD
3842002-03-04 Akim Demaille <akim@epita.fr>
385
386 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
387 before returning.
388 Reported by Benoit Perrot.
389
f9abaa2c
AD
3902002-03-04 Akim Demaille <akim@epita.fr>
391
392 Use bitset operations when possible, not loops over bits.
393
394 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
395 bitset_or.
396 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
397 * src/reduce.c (useless_nonterminals): Formatting changes.
398 * src/warshall.c (TC): Use bitset_or.
399
0e721e75
AD
4002002-03-04 Akim Demaille <akim@epita.fr>
401
402 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
403 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
404 Ditto.
405
0fb1ffb1
AD
4062002-03-04 Akim Demaille <akim@epita.fr>
407
408 * src/lalr.c (F): Now a bitset*.
409 Adjust all dependencies.
410
b86796bf
AD
4112002-03-04 Akim Demaille <akim@epita.fr>
412
413 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
414 Adjust all dependencies.
415
602bbf31
AD
4162002-03-04 Akim Demaille <akim@epita.fr>
417
418 * src/L0.c, src/LR0.h (nstates): Be size_t.
419 Adjust comparisons (signed vs unsigned).
420 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
421 bitset*.
422 Adjust all dependencies.
423
d8a0245c
AD
4242002-03-04 Akim Demaille <akim@epita.fr>
425
426 * src/closure.c (firsts): Now, also a bitset.
427 Adjust all dependencies.
428 (varsetsize): Remove, now unused.
429 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
430
34ba9743
AD
4312002-03-04 Akim Demaille <akim@epita.fr>
432
433 * src/print.c: Convert to use bitset.h, not hand coded iterations
434 over ints.
435
ed86e78c
AD
4362002-03-04 Akim Demaille <akim@epita.fr>
437
438 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
439
dfdb1797
AD
4402002-03-04 Akim Demaille <akim@epita.fr>
441
442 * src/closure.c (ruleset): Be a bitset.
443 (rulesetsize): Remove.
444
7086e707
AD
4452002-03-04 Akim Demaille <akim@epita.fr>
446
447 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
448 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
449 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
450 * src/closure.c (fderives): Be an array of bitsets.
451
98254360
RA
4522002-02-28 Robert Anisko <robert@lrde.epita.fr>
453
454 * data/bison.c++: Merge the two generated headers. Insert a copyright
455 notice in each output file.
456
a75c057f
AD
4572002-02-28 Akim Demaille <akim@epita.fr>
458
459 * data/bison.c++: Copy the prologue of bison.simple to fetch
460 useful M4 definitions, such as b4_header_guard.
461
06b00abc
AD
4622002-02-25 Akim Demaille <akim@epita.fr>
463
464 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
465 translator friendly scheme for the bgr
466 copyright notice.
06b00abc 467
70e7d534
AD
4682002-02-25 Akim Demaille <akim@epita.fr>
469
470 * src/output.c (header_output): Remove, now handled completely via
471 M4.
472
abe017f6
AD
4732002-02-25 Akim Demaille <akim@epita.fr>
474
475 * m4/m4.m4: New, from CVS Autoconf.
476 * configure.in: Invoke it.
477 * src/output.c (output_skeleton): Use its result instead of the
478 hard coded name.
479
381fb12e
AD
4802002-02-25 Akim Demaille <akim@epita.fr>
481
482 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
483 Fileutils 4.1.5.
484 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
485 * src/output.c (output_skeleton): Use mkstemp to create a real
486 temporary file.
487 Move the filling of `skeleton' and its muscle to...
488 (prepare): here.
489 (output): Move the definition of the prologue muscle to...
490 (prepare): here.
491 * src/system.h (DEFAULT_TMPDIR): New.
492
6f38107f
PE
4932002-02-14 Paul Eggert <eggert@twinsun.com>
494
495 Remove the support for C++ namespace cleanliness; it was
496 causing more problems than it was curing, since it didn't work
497 properly on some nonstandard C++ compilers. This can wait
498 for a proper C++ parser.
499
500 * NEWS: Document this.
501 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
502 of C++, as it's treated like C now.
503 * src/bison.simple (YYSTD): Remove.
504 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
505 Treat C++ just like Standard C instead of trying to support
506 namespace cleanliness.
507
80cce3da
AD
5082002-02-14 Akim Demaille <akim@epita.fr>
509
510 * tests/regression.at (else): Adjust to Andreas' change.
511
842e8679
AD
5122002-02-14 Akim Demaille <akim@epita.fr>
513
514 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
515
4bda3f10
AD
5162002-02-13 Andreas Schwab <schwab@suse.de>
517
518 * src/output.c (output_rule_data): Don't output NULL, it might
519 not be defined yet.
520
4162fa07 5212002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 522
4162fa07
RA
523 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
524 (Copyright notice): Update.
b418ecd8 525
bd16a5dc
AD
5262002-02-11 Akim Demaille <akim@epita.fr>
527
528 * tests/regression.at (%nonassoc and eof): Don't include
529 nonportable headers.
530
8d69a1a3
RA
5312002-02-08 Robert Anisko <robert@lrde.epita.fr>
532
533 * data/bison.c++: Correct error recovery. Make the user able to
534 initialize the starting location.
535
9b2d0677
AD
5362002-02-07 Akim Demaille <akim@epita.fr>
537
538 * tests/input.at: New.
539
69e2658b
RA
5402002-02-07 Robert Anisko <robert@lrde.epita.fr>
541
542 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 543 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
544 directives around tables only needed for debugging.
545
4aacc3a7
RA
5462002-02-07 Robert Anisko <robert@lrde.epita.fr>
547
548 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
549 C++ parsers.
550 (yy::b4_name::parse): Use print_.
551
762a801e
RA
5522002-02-07 Robert Anisko <robert@lrde.epita.fr>
553
554 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
555
4bb2bc3f
RA
5562002-02-07 Robert Anisko <robert@lrde.epita.fr>
557
558 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
559 C++ parsers.
560 (yy::b4_name::parse): Build verbose error messages, and use error_.
561
6b45a3ca
RA
5622002-02-06 Robert Anisko <robert@lrde.epita.fr>
563
564 * data/bison.c++: Fix m4 quoting in comments.
565
50997c6e
RA
5662002-02-06 Robert Anisko <robert@lrde.epita.fr>
567
568 * data/bison.c++: Adjust the parser code. Fix some muscles that were
569 not expanded by m4.
570
3f3eed27
AD
5712002-02-05 Akim Demaille <akim@epita.fr>
572
573 * data/bison.c++: Adjust to the M4 back end.
574 More is certainly needed.
575
be2a1a68
AD
5762002-02-05 Akim Demaille <akim@epita.fr>
577
578 Give a try to M4 as a back end.
579
580 * lib/readpipe.c: New, from wdiff.
581 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
582 BISON_HAIRY.
583 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
584 specific values. Now it is m4 that performs the lookup.
585 * src/parse-skel.y: Remove.
586 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
587 * src/output.c (actions_output, guards_output)
588 (token_definitions_output): No longer keeps track of the output
589 line number, hence remove the second argument.
590 (guards_output): Check against the guard member of a rule, not the
591 action member.
592 Adjust callers.
593 (output_skeleton): Don't look for the skeleton location, let m4 do
594 that.
595 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
596 file will be used.
597 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
598 (prepare): Given that for the time being changesyntax is not
599 usable in M4, rename the muscles using `-' to `_'.
600 Define `defines_flag', `output_parser_name' and `output_header_name'.
601 * src/output.h (actions_output, guards_output)
602 (token_definitions_output): Adjust prototypes.
603 * src/scan-skel.l: Instead of scanning the skeletons, it now
604 processes the output of m4: `__oline__' and `#output'.
605 * data/bison.simple: Adjust to be used by M4(sugar).
606 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
607 to date.
608 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
609 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
610 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
611 shamelessly stolen from CVS Autoconf.
612
beda758b
AD
6132002-02-05 Akim Demaille <akim@epita.fr>
614
615 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
616 * configure.in: Check for the declarations of free and malloc.
617 * src/muscle_tab.c: Adjust.
618
5ece6d43
AD
6192002-02-05 Akim Demaille <akim@epita.fr>
620
621 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
622 which have no values.
623
5bb18f9a
AD
6242002-02-05 Akim Demaille <akim@epita.fr>
625
626 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
627 * data/: here.
628
894dd62e
PE
6292002-01-29 Paul Eggert <eggert@twinsun.com>
630
631 * src/bison.simple (YYSIZE_T): Do not define merely because
632 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
633 On some platforms, <alloca.h> does not declare YYSTD (size_t).
634
82841af7
AD
6352002-01-27 Akim Demaille <akim@epita.fr>
636
637 Fix `%nonassoc and eof'.
638
639 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
640 which were not properly copied! Replace
641 memcpy (res->errs, src->errs, src->nerrs);
642 with
643 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
644 !!!
645 * tests/regression.at (%nonassoc and eof): Adjust to newest
646 Autotest: `.' is not in the PATH.
647
318b76e9
AD
6482002-01-27 Akim Demaille <akim@epita.fr>
649
650 * tests/sets.at (AT_EXTRACT_SETS): New.
651 (Nullable): Use it.
652 (Firsts): New.
653
30d2f3d5
AD
6542002-01-26 Akim Demaille <akim@epita.fr>
655
656 * tests/actions.at, tests/calc.at, tests/headers.at,
657 * tests/torture.at: Adjust to the newest Autotest which no longer
658 forces `.' in the PATH.
659
30f8c395
AD
6602002-01-25 Akim Demaille <akim@epita.fr>
661
662 * tests/regression.at (%nonassoc and eof): New.
663 Suggested by Robert Anisko.
664
29ae55f1
AD
6652002-01-24 Akim Demaille <akim@epita.fr>
666
667 Bison dumps core when trying to complain about broken input files.
668 Reported by Cris van Pelt.
669
670 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
671 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
672 into...
673 (Invalid inputs): Strengthen: exercise parse_percent_token.
674
2b548aa6
RA
6752002-01-24 Robert Anisko <robert.anisko@epita.fr>
676
677 * src/Makefile.am: Add bison.c++.
678 * src/bison.c++: New skeleton.
679
bb0146c2
AD
6802002-01-21 Paolo Bonzini <bonzini@gnu.org>
681
682 * po/it.po: New.
683
bec30531
AD
6842002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
685
686 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
687
fc6edc45
MA
6882002-01-20 Marc Autret <marc@gnu.org>
689
690 * src/files.c (compute_output_file_names): Fix
691
5e5d5415
MA
6922002-01-20 Marc Autret <marc@gnu.org>
693
694 * tests/output.at: New test.
695 * src/files.c (compute_base_names): Don't map extensions when
696 the YACC flag is set, use defaults.
697 Reported by Evgeny Stambulchik.
698
44ea3fbd
MA
6992002-01-20 Marc Autret <marc@gnu.org>
700
bb0146c2 701 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
702 compilers as well (i.e. the vendor C compiler).
703 Suggested by Albert Chin-A-Young.
704
338963d1
TVH
7052002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
706
707 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
708 canonical definition.
709 * src/system.h: Use the canonical definition for PARAMS (avoids
710 a conflict with the macro from lib/hash.h).
711
c57b2479
AD
7122002-01-11 Akim Demaille <akim@epita.fr>
713
714 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 715 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 716
b85810ae
AD
7172002-01-09 Akim Demaille <akim@epita.fr>
718
719 * src/files.c, src/files.h (output_infix): New.
720 (tab_extension): Remove.
721 (compute_base_names): Compute the former, drop the latter.
722 * src/output.c (prepare): Insert the muscles `output-infix', and
723 `output-suffix'.
724 * src/parse-skel.y (string, string.1): New.
725 (section.header): Use it.
726 (section.yacc): Remove.
727 (prefix): Remove too.
728 * src/scan-skel.l: Adjust.
729 * src/bison.simple, src/bison.hairy: Adjust.
730
cae60122
AD
7312002-01-09 Akim Demaille <akim@epita.fr>
732
733 * configure.in (WERROR_CFLAGS): Compute it.
734 * src/Makefile.am (CFLAGS): Pass it.
735 * tests/atlocal.in (CFLAGS): Idem.
736 * src/files.c: Fix a few warnings.
737 (get_extension_index): Remove, unused.
738
ae404801
AD
7392002-01-08 Akim Demaille <akim@epita.fr>
740
741 * src/getargs.c (AS_FILE_NAME): New.
742 (getargs): Use it to convert DOSish file names.
743 * src/files.c (base_name): Rename as full_base_name to avoid
744 clashes with `base_name ()'.
745 (filename_split): New.
746 (compute_base_names): N-th rewrite, using filename_split.
747
22312b71
AD
7482002-01-08 Akim Demaille <akim@epita.fr>
749
750 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
751 New, stolen from the Fileutils 4.1.
752 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
753 * configure.in: Check for the presence of memrchr, and of its
754 prototype.
755
a67cef01
TVH
7562002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
757
758 * lib/hash.h (__P): Added definition for this macro.
759 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
760 BUILT_SOURCES, to ensure they are generated first.
761 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
762 %error-verbose to allow bootstrapping with bison 1.30x.
763
2b25d624
AD
7642002-01-06 Akim Demaille <akim@epita.fr>
765
766 * src/reader.c (parse_braces): Don't fetch the next char, the
767 convention is to fetch on entry.
768 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
769 'switch' without a following semicolon.
770 * tests/regression.at (braces parsing): New.
771
3460813b
AD
7722002-01-06 Akim Demaille <akim@epita.fr>
773
774 Bison is dead wrong in its RR conflict reports.
775
776 * tests/torture.at (GNU Cim Grammar): New.
777 * src/conflicts.c (count_rr_conflicts): Fix.
778
73784c64
AD
7792002-01-06 Akim Demaille <akim@epita.fr>
780
781 Creating package.m4 from configure.ac causes too many problems.
782
783 * tests/Makefile.am (package.m4): Create it by hand,
784 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
785
25d81090
AD
7862002-01-06 Akim Demaille <akim@epita.fr>
787
788 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
789 skeleton.h.
790
a9b8959e
PE
7912002-01-04 Paul Eggert <eggert@twinsun.com>
792
793 * doc/bison.texinfo (Debugging):
794 Remove YYSTDERR; it's no longer defined or used.
795 Also, s/cstdio.h/cstdio/.
796
25d81090
AD
7972002-01-03 Akim Demaille <akim@epita.fr>
798
799 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
800
1109455c
AD
8012002-01-03 Akim Demaille <akim@epita.fr>
802
803 * src/parse-skel.y (process_skeleton): Don't bind the parser's
804 tracing code to --trace, wait for a better --trace option, with
805 args.
806
7ea5e977
AD
8072002-01-03 Akim Demaille <akim@epita.fr>
808
809 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
810 The ISO C++ standard is extremely clear about it: stderr is
811 considered a macro, not a regular symbol (see table 94 `Header
812 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
813 Therefore std:: does not apply to it. It still does with fprintf.
814 Also, s/cstdio.h/cstdio/.
815
fab5b110
AD
8162002-01-03 Akim Demaille <akim@epita.fr>
817
818 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
819 for non system headers.
820
aed7fd9b
AD
8212002-01-02 Akim Demaille <akim@epita.fr>
822
823 Equip the skeleton chain with location tracking, runtime trace,
824 pure parser and scanner.
825
826 * src/parse-skel.y: Request a pure parser, locations, and prefix
827 renaming.
828 (%union): Having several members with the same type does not help
829 type mismatches, simplify.
830 (YYPRINT, yyprint): New.
831 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
832 (skel_error): this.
833 Handle locations.
834 * src/scan-skel.l: Adjust to these changes.
835 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
836 (LOCATION_PRINT, skel_control_t): New.
837
24fad99e
AD
8382001-12-30 Akim Demaille <akim@epita.fr>
839
840 * src/parse-skel.y: Get rid of the shift/reduce conflict:
841 replace `gb' with BLANKS.
842 * src/scan-skel.l: Adjust.
843
a4b36db4
AD
8442001-12-30 Akim Demaille <akim@epita.fr>
845
846 * src/system.h: We don't need nor want bcopy.
847 Throw away MS-DOS crap: we don't need getpid.
848 * configure.in: We don't need strndup. It was even causing
849 problems: because Flex includes the headers *before* us,
850 _GNU_SOURCE is not defined by config.h, and therefore strndup was
851 not visible.
852 * lib/xstrndup.c: New.
853 * src/scan-skel.l: Use it.
854 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
855 * src/parse-skel.y: Use %directives instead of #defines.
856
1239777d
AD
8572001-12-30 Akim Demaille <akim@epita.fr>
858
859 * src/skeleton.h: New.
860 * src/output.c (output_parser, output_master_parser): Remove, dead
861 code.
862 * src/output.h (get_lines_number, actions_output, guards_output)
863 (token_definitions_output): Prototype them.
864 * src/parse-skel.y: Add the license notice.
865 Include output.h and skeleton.h.
866 (process_skeleton): Returns void, and takes a single parameter.
867 * src/scan-skel.l: Add the license notice.
868 Include skeleton.h.
869 Don't use %option yylineno: it seems that then Flex imagines
870 REJECT has been used, and therefore it won't reallocate its
871 buffers (which makes no other sense to me than a bug). It results
872 in warnings for `unused: yy_flex_realloc'.
873
9b3add5b
RA
8742001-12-30 Robert Anisko <robert.anisko@epita.fr>
875
876 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
877 (MUSCLE_INSERT_PREFIX): ...to there.
878 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
879 (MUSCLE_INSERT_PREFIX): Move from here...
880
881 * src/bison.hairy: Add a section directive. Put braces around muscle
882 names. This parser skeleton is still broken, but Bison should not
883 choke on a bad muscle 'syntax'.
884 * src/bison.simple: Add a section directive. Put braces around muscle
885 names.
886
887 * src/files.h (strsuffix, stringappend): Add declarations.
888 (tab_extension): Add declaration.
889 (short_base_name): Add declaration.
890
891 * src/files.c (strsuffix, stringappend): No longer static. These
892 functions are used in the skeleton parser.
893 (tab_extension): New.
894 (compute_base_names): Use the computations done in this function
fab5b110 895 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
896 names.
897 (short_base_name): No longer static.
898
899 * src/output.c (output_skeleton): New.
900 (output): Disable call to output_master_parser, and give a try to
901 a new skeleton handling system.
902 (guards_output, actions_output): No longer static.
903 (token_definitions_output, get_lines_number): No longer static.
904
905 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
906
fab5b110 907 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
908 parse-skel.y.
909
910 * src/parse-skel.y: New file.
911 * src/scan-skel.l: New file.
912
b5b61c61
AD
9132001-12-29 Akim Demaille <akim@epita.fr>
914
915 %name-prefix is broken.
916
917 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
918 Adjust all dependencies.
919 * tests/headers.at (export YYLTYPE): Strengthen this test: use
920 %name-prefix.
921
922 Renaming yylval but not yylloc is not consistent. Now we do.
923
924 * src/bison.simple: Prefix yylloc if used.
925 * doc/bison.texinfo (Decl Summary): Document that.
926
8c9a50be
AD
9272001-12-29 Akim Demaille <akim@epita.fr>
928
929 * doc/bison.texinfo: Promote `%long-directive' over
930 `%long_directive'.
931 Remove all references to fixed-output-files, yacc is enough.
932
d99361e6
AD
9332001-12-29 Akim Demaille <akim@epita.fr>
934
935 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
936 user prologue. These are defaults.
937 * tests/actions.at (Mid-rule actions): Make sure the user can
938 define YYDEBUG and YYERROR_VERBOSE.
939
b9cecb91
AD
9402001-12-29 Akim Demaille <akim@epita.fr>
941
942 * src/output.c (header_output): Don't forget to export YYLTYPE and
943 yylloc.
944 * tests/headers.at (export YYLTYPE): New, make sure it does.
945 * tests/regression.at (%union and --defines, Invalid CPP headers):
946 Move to...
947 * tests/headers.at: here.
948
aea13e97
AD
9492001-12-29 Akim Demaille <akim@epita.fr>
950
951 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
952
931394cb
AD
9532001-12-29 Akim Demaille <akim@epita.fr>
954
955 * tests/actions.at (Mid-rule actions): Output on a single line
956 instead of several.
957
704a47c4
AD
9582001-12-29 Akim Demaille <akim@epita.fr>
959
960 * doc/bison.texinfo: Formatting changes.
961
091e20bb
AD
9622001-12-29 Akim Demaille <akim@epita.fr>
963
964 Don't store the token defs in a muscle, just be ready to output it
965 on command. Now possible via `symbols'. Fixes a memory leak.
966
967 * src/output.c (token_definitions_output): New.
968 (output_parser, header_output): Use it.
969 * src/reader.c (symbols_save): Remove.
970
cce71710
AD
9712001-12-29 Akim Demaille <akim@epita.fr>
972
973 * src/bison.simple: Do not provide a default for YYSTYPE and
974 YYLTYPE before the user's prologue. Otherwise it's hardly... a
975 default.
976
82c035a8
AD
9772001-12-29 Akim Demaille <akim@epita.fr>
978
979 Mid-rule actions are simply... ignored!
980
981 * src/reader.c (readgram): Be sure to attach mid-rule actions to
982 the empty-rule associated to the dummy symbol, not to the host
983 rule.
984 * tests/actions.at (Mid-rule actions): New.
985
8419d367
AD
9862001-12-29 Akim Demaille <akim@epita.fr>
987
988 Memory leak.
989
990 * src/reader.c (reader): Free grammar.
991
375d5806
AD
9922001-12-29 Akim Demaille <akim@epita.fr>
993
994 Memory leak.
995
996 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
997 since it allocates it for each state, although only one is needed.
998 (allocate_storage): Do it here.
999
f51cb8ff
AD
10002001-12-29 Akim Demaille <akim@epita.fr>
1001
1002 * src/options.h, src/options.c (create_long_option_table): Rename
1003 as...
1004 (long_option_table_new): this, with a clearer prototype.
1005 (percent_table): Remove, unused,
1006 * src/getargs.c (getargs): Adjust.
1007
29e88316
AD
10082001-12-29 Akim Demaille <akim@epita.fr>
1009
1010 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1011 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1012 as states.
1013
b9f71f19
AD
10142001-12-29 Akim Demaille <akim@epita.fr>
1015
1016 * src/lalr.c (build_relations): Rename `states' as `states1'.
1017 Sorry, I don't understand exactly what it is, no better name...
1018
1a2b5d37
AD
10192001-12-29 Akim Demaille <akim@epita.fr>
1020
1021 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1022 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1023 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1024 as rules.
1025
1cca533e
AD
10262001-12-29 Akim Demaille <akim@epita.fr>
1027
1028 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1029 ago.
1030
c03ae966
AD
10312001-12-29 Akim Demaille <akim@epita.fr>
1032
1033 * src/reader.c, src/reader.h (user_toknums): Remove.
1034 Adjust all users to use symbols[i]->user_token_number.
1035
5a670b1e
AD
10362001-12-29 Akim Demaille <akim@epita.fr>
1037
1038 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1039 Adjust all users to use symbols[i]->prec or ->assoc.
1040
ad949da9
AD
10412001-12-29 Akim Demaille <akim@epita.fr>
1042
1043 * src/reader.c, src/reader.h (tags): Remove.
1044 Adjust all users to use symbols[i]->tag.
1045
0e78e603
AD
10462001-12-29 Akim Demaille <akim@epita.fr>
1047
1048 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1049 and rule_table.
1050 * src/reader.c (packsymbols): Fill this table.
1051 Drop sprec.
1052 * src/conflicts.c (resolve_sr_conflict): Adjust.
1053 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1054 single table.
1055 Use symbols[i]->tag instead of tags[i].
1056
213e640e
AD
10572001-12-29 Akim Demaille <akim@epita.fr>
1058
1059 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1060 In addition, put a comment in there, to replace...
1061 * tests/regression.at (%union and C comments): Remove.
1062
e7b8bef1
AD
10632001-12-29 Akim Demaille <akim@epita.fr>
1064
1065 * tests/regression.at (Web2c Actions): Blindly move the actual
1066 output as expected output. The contents *seem* right to me, but I
1067 can't pretend reading perfectly parser tables... Nonetheless, all
1068 the other tests pass correctly, the table look OK, even though the
1069 presence of `$axiom' is to be noted: AFAICS it is useless (but
1070 harmless).
1071
b68e7744
AD
10722001-12-29 Akim Demaille <akim@epita.fr>
1073
1074 * src/reader.c (readgram): Don't add the rule 0 if there were no
1075 rules read. In other words, add it _after_ having performed
1076 grammar sanity checks.
1077 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1078
78d5bae9
AD
10792001-12-29 Akim Demaille <akim@epita.fr>
1080
1081 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1082 visible, and some states have now a different number.
1083
ff442794
AD
10842001-12-29 Akim Demaille <akim@epita.fr>
1085
1086 * src/reader.c (readgram): Bind the initial rule's lineno to that
1087 of the first rule.
1088 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1089 (Solved SR Conflicts): Adjust rule 0's line number.
1090
610ab194
AD
10912001-12-29 Akim Demaille <akim@epita.fr>
1092
1093 Fix the `GAWK Grammar' failure.
1094
1095 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1096 the reductions of the first state which was mistakenly confused
1097 with the final state because precisely final_state was initialized
1098 to 0.
1099 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1100 now noticed by Bison.
1101 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1102 have a reduction on $default.
1103
29d29c8f
AD
11042001-12-29 Akim Demaille <akim@epita.fr>
1105
1106 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1107 rule line numbers.
1108 * src/closure.c (print_closure): Likewise.
1109 * src/derives.c (print_derives): Likewise.
1110 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1111 now.
1112
7c6b64d0
AD
11132001-12-29 Akim Demaille <akim@epita.fr>
1114
1115 * src/lalr.c (lookaheads_print): New.
1116 (lalr): Call it when --trace-flag.
1117 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1118 are dumped.
1119
3d4daee3
AD
11202001-12-29 Akim Demaille <akim@epita.fr>
1121
1122 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1123 when walking through ritem, even via rule->rhs.
1124 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1125 (useful_production, useless_nonterminals): Likewise.
1126 (reduce_grammar_tables): Likewise, plus update nritems.
1127 * src/nullable.c (set_nullable): Likewise.
1128 * src/lalr.c (build_relations): Likewise.
1129 * tests/sets.at (Nullable): Adjust.
1130 Fortunately, now, the $axiom is no longer nullable.
1131
9e7f6bbd
AD
11322001-12-29 Akim Demaille <akim@epita.fr>
1133
1134 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1135 the 0-sentinel.
1136 * src/gram.c (ritem_longest_rhs): Likewise.
1137 * src/reduce.c (nonterminals_reduce): Likewise.
1138 * src/print_graph.c (print_graph): Likewise.
1139 * src/output.c (output_rule_data): Likewise.
1140 * src/nullable.c (set_nullable): Likewise.
1141
255ef638
AD
11422001-12-29 Akim Demaille <akim@epita.fr>
1143
1144 * src/output.c: Comment changes.
1145
0d8a7363
AD
11462001-12-27 Paul Eggert <eggert@twinsun.com>
1147
1148 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1149 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1150 Sparc, as they were causing more porting problems than the
1151 (minor) performance improvement was worth.
1152
1153 Also, catch up with 1.31's YYSTD.
1154
3db472b9
AD
11552001-12-27 Akim Demaille <akim@epita.fr>
1156
1157 * src/output.c (output_gram): Rely on nritems, not the
1158 0-sentinel. See below.
1159 Use -1 as separator, not 0.
1160 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1161 Rely on -1 as separator in yyrhs, instead of 0.
1162 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1163 twice `Now at end of input', therefore there are two lines less to
1164 expect.
1165
b365aa05
AD
11662001-12-27 Akim Demaille <akim@epita.fr>
1167
1168 * tests/regression.at (Unresolved SR Conflicts):
1169 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1170 below.
1171
30171f79
AD
11722001-12-27 Akim Demaille <akim@epita.fr>
1173
1174 * src/LR0.c (new_state): Recognize the final state by the fact it
1175 is reached by eoftoken.
1176 (insert_start_shifting_state, insert_eof_shifting_state)
1177 (insert_accepting_state, augment_automaton): Remove, since now
1178 these states are automatically computed from the initial state.
1179 (generate_states): Adjust.
1180 * src/print.c: When reporting a rule number to the user, substract
1181 1, so that the axiom rule is rule 0, and the first user rule is 1.
1182 * src/reduce.c: Likewise.
1183 * src/print_graph.c (print_core): For the time being, just as for
1184 the report, depend upon --trace-flags to dump the full set of
1185 items.
1186 * src/reader.c (readgram): Once the grammar read, insert the rule
1187 0: `$axiom: START-SYMBOL $'.
1188 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1189 number of the states has changed (the final state is no longer
1190 necessarily the last), catch up.
1191
75142d45
AD
11922001-12-27 Akim Demaille <akim@epita.fr>
1193
1194 Try to make the use of the eoftoken valid. Given that its value
1195 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1196 is used instead of > 0 where appropriate, (ii), depend upon nritems
1197 instead of the 0-sentinel.
1198
1199 * src/gram.h, src/gram.c (nritems): New.
1200 Expected to be duplication of nitems, but for the time being...
1201 * src/reader.c (packgram): Assert nritems and nitems are equal.
1202 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1203 * src/closure.c (print_closure, print_fderives): Likewise.
1204 * src/gram.c (ritem_print): Likewise.
1205 * src/print.c (print_core, print_grammar): Likewise.
1206 * src/print_graph.c: Likewise.
1207
b7c49edf
AD
12082001-12-27 Akim Demaille <akim@epita.fr>
1209
1210 * src/main.c (main): If there are complains after grammar
1211 reductions, then output the report anyway if requested, then die.
1212 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1213 * src/reader.c (eoftoken): New.
1214 (parse_token_decl): If the token being defined has value `0', it
1215 is the eoftoken.
1216 (packsymbols): No longer hack `tags' to insert `$' by hand.
1217 Be sure to preserve the value of the eoftoken.
1218 (reader): Make sure eoftoken is defined.
1219 Initialize nsyms to 0: now eoftoken is created just like the others.
1220 * src/print.c (print_grammar): Don't special case the eof token.
1221 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1222 lie anyway, albeit pleasant.
1223 * tests/calc.at: Exercise error messages with eoftoken.
1224 Change the grammar so that empty input is invalid.
1225 Adjust expectations.
1226 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1227
ec2da99f
AD
12282001-12-27 Akim Demaille <akim@epita.fr>
1229
1230 * configure.in: Check the protos of strchr ans strspn.
1231 Replace strchr if needed.
1232 * src/system.h: Provide the protos of strchr, strspn and memchr if
1233 missing.
1234 * lib/strchr.c: New.
1235 * src/reader.c (symbols_save): Use strchr.
1236
8adfa272
AD
12372001-12-27 Akim Demaille <akim@epita.fr>
1238
1239 * src/print.c, src/print_graph.c (escape): New.
1240 Use it to quote the TAGS outputs.
1241 * src/print_graph.c (print_state): Now errors are in red, and
1242 reductions in green.
1243 Prefer high to wide: output the state number on a line of its own.
1244
80dac38c
AD
12452001-12-27 Akim Demaille <akim@epita.fr>
1246
1247 * src/state.h, src/state.c (reductions_new): New.
1248 * src/LR0.c (set_state_table): Let all the states have a
1249 `reductions', even if reduced to 0.
1250 (save_reductions): Adjust.
1251 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1252 * src/print.c (print_reductions, print_actions): Adjust.
1253 * src/output.c (action_row): Adjust.
1254
2cec70b9
AD
12552001-12-27 Akim Demaille <akim@epita.fr>
1256
1257 * src/state.h, src/state.c (errs_new, errs_dup): New.
1258 * src/LR0.c (set_state_table): Let all the states have an errs,
1259 even if reduced to 0.
1260 * src/print.c (print_errs, print_reductions): Adjust.
1261 * src/output.c (output_actions, action_row): Adjust.
1262 * src/conflicts.c (resolve_sr_conflict): Adjust.
1263
13ca549a
AD
12642001-12-27 Akim Demaille <akim@epita.fr>
1265
1266 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1267
5092aba5
AD
12682001-12-27 Akim Demaille <akim@epita.fr>
1269
1270 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1271 * src/print.c: here.
1272 (lookaheadset, shiftset): New, used as additional storage by
1273 print_reductions.
1274 (print_results): Adjust.
1275 (print_shifts, print_gotos, print_errs): New, extracted from...
1276 (print_actions): here.
1277 * src/print_graph.c (print_actions): Remove dead code.
1278
11e2beca
AD
12792001-12-27 Akim Demaille <akim@epita.fr>
1280
1281 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1282 `$n' and `@n'.
1283
dac3c910
AD
12842001-12-27 Akim Demaille <akim@epita.fr>
1285
1286 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1287 (build_relations): Adjust.
1288
d0b0fefa
AD
12892001-12-27 Akim Demaille <akim@epita.fr>
1290
1291 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1292 duplication.
1293
adc8c848
AD
12942001-12-27 Akim Demaille <akim@epita.fr>
1295
1296 * src/reader.c (packgram): Catch nitems overflows.
1297
14d293ac
AD
12982001-12-27 Akim Demaille <akim@epita.fr>
1299
1300 * src/files.c, src/files.h (guard_obstack): Remove.
1301 * src/output.c (output): Adjust.
1302 * src/reader.c (parse_braces): New, factoring...
1303 (copy_action, copy_guard): these two which are renamed as...
1304 (parse_action, parse_guard): these.
1305 As a voluntary consequence, using braces around guards is now
1306 mandatory.
1307
f499b062
AD
13082001-12-27 Akim Demaille <akim@epita.fr>
1309
1310 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1311 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1312 members.
1313 (symbol_list_new): Adjust.
1314 (copy_action): action_line is the first line, not the last.
1315 (copy_guard): Just as for actions, store the `action' only, not
1316 the switch/case/break flesh.
1317 Don't parse the user action that might follow the guard, let...
1318 (readgram): do it, i.e., now, there can be an action after a
1319 guard.
1320 In other words the guard is just explicitly optional.
1321 (packgram): Adjust.
1322 * src/output.c (guards_output): New.
1323 (output_parser): Call it when needed.
1324 (output): Also free the guard and attrs obstacks.
1325 * src/files.c, src/files.h (obstack_save): Remove.
1326 (output_files): Remove.
1327 As a result, if one needs the former `.act' file, using an
1328 appropriate skeleton which requires actions and guards is now
1329 required.
1330 * src/main.c (main): Adjust.
1331 * tests/semantic.at: New.
1332 * tests/regression.at: Use `input.y' as input file name.
1333 Avoid 8+3 problems by requiring input.c when the test needs the
1334 parser.
1335
d945f5cd
AD
13362001-12-27 Akim Demaille <akim@epita.fr>
1337
1338 * src/reader.c (symbol_list_new): Be sure to initialize all the
1339 fields.
1340
d200e455
AD
13412001-12-27 Akim Demaille <akim@epita.fr>
1342
1343 All the hacks using a final pseudo state are now useless.
1344
1345 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1346 * src/lalr.c (nLA): New.
1347 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1348 instead of lookaheadsp from the pseudo state (nstate + 1).
1349
f9507c28
AD
13502001-12-27 Akim Demaille <akim@epita.fr>
1351
1352 * src/output.c (action_row, token_actions): Use a state_t instead
1353 of a integer, and nlookaheads instead of the following state's
1354 lookaheadsp.
1355
065fbd27
AD
13562001-12-27 Akim Demaille <akim@epita.fr>
1357
1358 * src/conflicts.c (log_resolution, flush_shift)
1359 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1360 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1361 (conflicts_print, print_reductions): Use a state_t instead of an
1362 integer when referring to a state.
1363 As much as possible, depend upon nlookaheads, instead of the
1364 `lookaheadsp' member of the following state (since lookaheads of
1365 successive states are successive, the difference between state n + 1
1366 and n served as the number of lookaheads for state n).
1367 * src/lalr.c (add_lookback_edge): Likewise.
1368 * src/print.c (print_core, print_actions, print_state)
1369 (print_results): Likewise.
1370 * src/print_graph.c (print_core, print_actions, print_state)
1371 (print_graph): Likewise.
1372 * src/conflicts.h: Adjust.
1373
1b177bd7
AD
13742001-12-27 Akim Demaille <akim@epita.fr>
1375
1376 * src/bison.hairy: Formatting/comment changes.
1377 ANSIfy.
1378 Remove `register' indications.
1379 Add plenty of `static'.
1380
7742ddeb
AD
13812001-12-27 Akim Demaille <akim@epita.fr>
1382
1383 * src/output.c (prepare): Drop the muscle `ntbase' which
1384 duplicates ntokens.
1385 * src/bison.simple: Formatting/comment changes.
1386 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1387 is an undocumented synonym.
1388
1fa14068
AD
13892001-12-22 Akim Demaille <akim@epita.fr>
1390
1391 * src/output.c (output_table_data): Change the prototype to use
1392 `int' for array ranges: some invocations do pass an int, not a
1393 short.
1394 Reported by Wayne Green.
1395
b9752825
AD
13962001-12-22 Akim Demaille <akim@epita.fr>
1397
1398 Some actions of web2c.y are improperly triggered.
1399 Reported by Mike Castle.
1400
1401 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1402 * tests/regression.at (Web2c): Rename as...
1403 (Web2c Report): this.
1404 (Web2c Actions): New.
1405
776209d6
AD
14062001-12-22 Akim Demaille <akim@epita.fr>
1407
1408 Reductions in web2c.y are improperly reported.
1409 Reported by Mike Castle.
1410
1411 * src/conflicts.c (print_reductions): Fix.
1412 * tests/regression.at (Web2c): New.
1413
275fc3ad
AD
14142001-12-18 Akim Demaille <akim@epita.fr>
1415
1416 Some host fail on `assert (!"foo")', which expands to
1417 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1418 Reported by Nelson Beebee.
1419
1420 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1421 `#define it_succeeded 0' and `assert (it_succeeded)'.
1422
897668ee
MA
14232001-12-17 Marc Autret <autret_m@epita.fr>
1424
1425 * src/bison.simple: Don't hard code the skeleton line and filename.
1426 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1427 New line counter 'skeleton_line' (skeleton-line muscle).
1428
ab3399e0
PE
14292001-12-17 Paul Eggert <eggert@twinsun.com>
1430
1431 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1432 YYDEBUG must be defined to a nonzero value.
1433
1434 * src/bison.simple (yytname): Do not assume that the user defines
1435 YYDEBUG to a properly parenthesized expression.
1436
3877f72b
AD
14372001-12-17 Akim Demaille <akim@epita.fr>
1438
1439 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1440 nlookaheads is a new member.
1441 Adjust all users.
1442 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1443 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1444 state.
776209d6 1445
331dbc1b
AD
14462001-12-17 Akim Demaille <akim@epita.fr>
1447
1448 * src/files.h, src/files.c (open_files, close_files): Remove.
1449 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1450 let...
1451 * src/reader.c (reader): Do it.
776209d6 1452
be750e4c
AD
14532001-12-17 Akim Demaille <akim@epita.fr>
1454
1455 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 1456
709ae8c6
AD
14572001-12-17 Akim Demaille <akim@epita.fr>
1458
1459 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1460 (flush_reduce): New.
1461 (resolve_sr_conflict): Adjust.
776209d6 1462
f87685c3
AD
14632001-12-17 Akim Demaille <akim@epita.fr>
1464
1465 * src/output.c (output_obstack): Be static and rename as...
1466 (format_obstack): this, to avoid any confusion with files.c's
1467 output_obstack.
1468 * src/reader.h (muscle_obstack): Move to...
1469 * src/output.h: here, since it's defined in output.c.
1470
837491d8
AD
14712001-12-17 Akim Demaille <akim@epita.fr>
1472
1473 * src/output.c (action_row, save_column, default_goto)
1474 (sort_actions, matching_state, pack_vector): Better variable
1475 locality.
1476
796d61fb
AD
14772001-12-17 Akim Demaille <akim@epita.fr>
1478
1479 * src/output.c: Various formatting changes.
776209d6 1480
64d15509
AD
14812001-12-17 Akim Demaille <akim@epita.fr>
1482
1483 * src/files.c (output_files): Free the output_obstack.
1484 * src/main.c (main): Call print and print_graph conditionally.
1485 * src/print.c (print): Work unconditionally.
1486 * src/print_graph.c (print_graph): Work unconditionally.
1487 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1488
fbc8ecb7
MA
14892001-12-16 Marc Autret <autret_m@epita.fr>
1490
1491 * src/output.c (actions_output): Fix. When we use %no-lines,
1492 there is one less line per action.
1493
f0440388
MA
14942001-12-16 Marc Autret <autret_m@epita.fr>
1495
1496 * src/bison.simple: Remove a useless #line directive.
1497 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1498 * src/output.c (get_lines_number): New.
776209d6 1499 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
1500 output muscles.
1501 Fix line numbering.
1502 (actions_output): Computes the number of lines taken by actions.
1503 (output_master_parser): Insert new skeleton which is the name of
1504 the output parser file name.
1505
a79986b8
MA
15062001-12-15 Marc Autret <autret_m@epita.fr>
1507
1508 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1509
4ec8e00f
MA
15102001-12-15 Marc Autret <autret_m@epita.fr>
1511
1512 * src/output.c (output_gram): Keep track of the hairy one.
1513
1a4648ff
AD
15142001-12-15 Akim Demaille <akim@epita.fr>
1515
1516 Make `make distcheck' work.
1517
1518 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1519 system.h which uses libgettext.h.
1520
9c2c67e6
AD
15212001-12-15 Akim Demaille <akim@epita.fr>
1522
1523 * src/nullable.c (set_nullable): Useless rules must be skipped,
1524 otherwise, since we range over their symbols, we might look at a
1525 nonterminal which no longer ``exists'', i.e., it is not counted in
1526 `nvars', hence we overflow our arrays.
1527
93ede233
AD
15282001-12-15 Akim Demaille <akim@epita.fr>
1529
1530 The header can also be produced directly, without any obstack!
1531 Yahoo!
1532
1533 * src/files.c, src/files.h (defines_obstack): Remove.
1534 (compute_header_macro): Global.
1535 (defines_obstack_save): Remove.
1536 * src/reader.c (parse_union_decl): No longer output to
1537 defines_obstack: its content can be found in the `stype' muscle
1538 anyway.
1539 (output_token_translations): Merge into...
1540 (symbols_output): this.
1541 Rename as...
1542 (symbols_save): this.
1543 (reader): Adjust.
1544 * src/output.c (header_output): New.
1545 (output): Call it.
1546
2666f928
AD
15472001-12-15 Akim Demaille <akim@epita.fr>
1548
1549 * src/reader.c (parse_union_decl): Instead of handling two obstack
1550 simultaneously, use one to define the `stype' muscle, and use the
1551 value of the latter to fill defines_obstack.
1552 (copy_comment): Remove.
1553 (copy_comment2): Work for a single obstack.
1554 Rename as...
1555 (copy_comment): this.
1556
428046f8
AD
15572001-12-15 Akim Demaille <akim@epita.fr>
1558
1559 * src/lex.c, src/lex.h (xgetc): No longer static.
1560 * src/reader.c (parse_union_decl): Revamp.
1561
ea52d706
AD
15622001-12-15 Akim Demaille <akim@epita.fr>
1563
1564 Still making progress in separating Bison into (i) input, (ii)
1565 process, (iii) output: now we can directly output the parser file
1566 without using table_obstack at all.
1567
1568 * src/files.c, src/files.h (table_obstack): Bye bye.
1569 (parser_file_name): New.
1570 * src/files.c (compute_output_file_names): Compute it.
1571 * src/output.c (actions_output, output_parser)
1572 (output_master_parser): To a file instead of an obstack.
1573
3f96f4dc
AD
15742001-12-15 Akim Demaille <akim@epita.fr>
1575
1576 Attach actions to rules, instead of pre-outputting them to
1577 actions_obstack.
1578
1579 * src/gram.h (rule_t): action and action_line are new members.
1580 * src/reader.c (symbol_list): Likewise.
1581 (copy_action): Save the actions within the rule.
1582 (packgram): Save them in rule_table.
1583 * src/output.c (actions_output): New.
1584 (output_parser): Use it on `%%actions'.
1585 (output_rule_data): Don't free rule_table.
1586 (output): Do it.
1587 (prepare): Don't save the `action' muscle.
1588 * src/bison.simple: s/%%action/%%actions/.
1589
51576fb3
AD
15902001-12-15 Akim Demaille <akim@epita.fr>
1591
1592 * src/reader.c (copy_action): When --yacc, don't append a `;'
1593 to the user action: let it fail if lacking.
dee049eb 1594 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 1595
2648a72d
AD
15962001-12-14 Akim Demaille <akim@epita.fr>
1597
1598 * src/lex.c (literalchar): Simply return the char you decoded, non
1599 longer mess around with obstacks and int pointers.
1600 Adjust all callers.
1601
92790e5b
AD
16022001-12-14 Akim Demaille <akim@epita.fr>
1603
1604 * src/lex.c (literalchar): Don't escape the special characters,
1605 just decode them, and keep them as char (before, eol was output as
1606 the 2 char string `\n' etc.).
1607 * src/output.c (output_rule_data): Use quotearg to output the
1608 token strings.
1609
927c1557
PE
16102001-12-13 Paul Eggert <eggert@twinsun.com>
1611
1612 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1613 Do not infringe on the global user namespace when using C++.
1614 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1615 All uses of `fprintf' and `stderr' changed.
1616
1617 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1618
ed8e1f68
AD
16192001-12-13 Akim Demaille <akim@epita.fr>
1620
1621 The computation of nullable is broken: it doesn't handle empty
1622 RHS's properly.
1623
1624 * tests/torture.at (GNU AWK Grammar): New.
1625 * tests/sets.at (Nullable): New.
1626 * src/nullable.c (set_nullable): Instead of blindly looping over
1627 `ritems', loop over the rules, and then over their rhs's.
1628
1629 Work around Autotest bugs.
1630
1631 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1632 frame, because Autotest understand lines starting with a `+' as
1633 traces from the shell. Then, they are not processed properly.
1634 Admittedly an Autotest bug, but we don't have time to wait for
1635 Autotest to catch up.
1636 * tests/regression.at (Broken Closure): Adjust to the new table
1637 frames.
1638 Move to...
1639 * tests/sets.at: here.
1640
cb581495
AD
16412001-12-13 Akim Demaille <akim@epita.fr>
1642
1643 * src/closure.c (closure): Use nrules instead of playing tricks
1644 with BITS_PER_WORD.
1645
2e729273
AD
16462001-12-13 Akim Demaille <akim@epita.fr>
1647
1648 * src/print.c (print_actions): Output the handling of `$' as the
1649 traces do: shifting the token EOF. Before EOF was treated as a
1650 nonterminal.
1651 * tests/regression.at: Adjust some tests.
1652 * src/print_graph.c (print_core): Complete the set of items via
1653 closure. The next-to-final and final states are still unsatisfying,
1654 but that's to be addressed elsewhere.
1655 No longer output the rule numbers, but do output the state number.
1656 A single loop for the shifts + gotos is enough, but picked a
1657 distinct color for each.
1658 (print_graph): Initialize and finalize closure.
1659
107f7dfb
AD
16602001-12-13 Akim Demaille <akim@epita.fr>
1661
1662 * src/reader.c (readgram): Remove dead code, an strip useless
1663 braces.
1664 (get_type): Remove, unused.
1665
9b53a24f
AD
16662001-12-12 Akim Demaille <akim@epita.fr>
1667
1668 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1669 on that of lib/error.c.
1670
dbfb6dcd
AD
16712001-12-12 Akim Demaille <akim@epita.fr>
1672
1673 Some hosts don't like `/' in includes.
1674
1675 * src/system.h: Include libgettext.h without qualifying the path.
1676 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1677 $(top_srcdir).
1678
c25fb648
MA
16792001-12-11 Marc Autret <autret_m@epita.fr>
1680
1681 * src/output.c (output_parser): Remove useless muscle.
1682
710ddc4f
MA
16832001-12-11 Marc Autret <autret_m@epita.fr>
1684
1685 * src/bison.simple: Remove #line just before %%epilogue. It
1686 is now handled in ...
1687 * src/reader.c (read_additionnal_code): Add the output of a
1688 #line for the epilogue.
1689
e83d80b8
MA
16902001-12-10 Marc Autret <autret_m@epita.fr>
1691
927c1557 1692 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
1693 replace precedent remove.
1694 * src/bison.simple: Remove #line before %%prologue because
1695 %%input-line is wrong at this time.
1696
971d5158
MA
16972001-12-10 Marc Autret <autret_m@epita.fr>
1698
1699 * src/reader.c (symbols_output): Clean up.
927c1557 1700 * src/output.c (output_gram, output): Clean up.
971d5158 1701
5edafffd
AD
17022001-12-10 Akim Demaille <akim@epita.fr>
1703
1704 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1705 * src/LR0.c (set_state_table): here.
1706 * src/lalr.c (lalr): Call it.
1707
0279f8e9
AD
17082001-12-10 Akim Demaille <akim@epita.fr>
1709
1710 * src/state.h (shifts): Remove the `number' member: shifts are
1711 attached to state, hence no longer need to be labelled with a
1712 state number.
1713
190c4f5f
AD
17142001-12-10 Akim Demaille <akim@epita.fr>
1715
1716 Now that states have a complete set of members, the linked list of
1717 shifts is useless: just fill directly the state's shifts member.
1718
1719 * src/state.h (shifts): Remove the `next' member.
1720 * src/LR0.c (first_state, last_state): Remove.
1721 Adjust the callers.
1722 (augment_automaton): Don't look for the shifts that must be added
1723 a shift on EOF: it is those of the state we looked for! But now,
1724 since shifts are attached, it is no longer needed to looking
1725 merely by its id: its number.
1726
2a73b93d
AD
17272001-12-10 Akim Demaille <akim@epita.fr>
1728
1729 * src/LR0.c (augment_automaton): Better variable locality.
1730 Remove an impossible branch: if there is a state corresponding to
1731 the start symbol being shifted, then there is shift for the start
1732 symbol from the initial state.
1733
74392f6a
AD
17342001-12-10 Akim Demaille <akim@epita.fr>
1735
1736 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1737 only when appropriate: when insert_start_shifting_state' is not
1738 invoked.
1739 * tests/regression.at (Rule Line Numbers): Adjust.
1740
37c82725
AD
17412001-12-10 Akim Demaille <akim@epita.fr>
1742
1743 * src/LR0.c (augment_automaton): Now that all states have shifts,
1744 merge the two cases addition shifts to the initial state.
1745
6a164e0c
AD
17462001-12-10 Akim Demaille <akim@epita.fr>
1747
1748 * src/lalr.c (set_state_table): Move to...
1749 * src/LR0.c: here.
1750 * src/lalr.c (lalr): Don't call it...
1751 * src/LR0.c (generate_states): do it.
1752 * src/LR0.h (first_state): Remove, only the table is used.
1753
7215de24
AD
17542001-12-10 Akim Demaille <akim@epita.fr>
1755
1756 * src/LR0.h (first_shift, first_reduction): Remove.
1757 * src/lalr.c: Don't use first_shift: find shifts through the
1758 states.
1759
80e25d4d
AD
17602001-12-10 Akim Demaille <akim@epita.fr>
1761
1762 * src/LR0.c: Attach shifts to states as soon as they are
1763 computed.
1764 * src/lalr.c (set_state_table): Instead of assigning shifts to
1765 state, just assert that the mapping was properly done.
1766
0ab3728b
AD
17672001-12-10 Akim Demaille <akim@epita.fr>
1768
1769 * src/LR0.c (insert_start_shift): Rename as...
1770 (insert_start_shifting_state): this.
1771 (insert_eof_shifting_state, insert_accepting_state): New.
1772 (augment_automaton): Adjust.
1773 Better locality of the variables.
1774 When looking if the start_symbol is shifted from the initial
1775 state, using `while (... symbol != start_symbol ...)' sounds
1776 better than `while (... symbol < start_symbol ...)': If fail
1777 to see how the order between symbols could be relevant!
1778
78af9bbc
AD
17792001-12-10 Akim Demaille <akim@epita.fr>
1780
1781 * src/getargs.h: Don't declare `spec_name_prefix' and
1782 `spec_file_prefix', declared by src/files.h.
1783 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1784 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1785 * src/output.c (prepare): Adjust.
1786 * src/reader.c (symbols_output): Likewise.
1787 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1788
bdef2a41
AD
17892001-12-10 Akim Demaille <akim@epita.fr>
1790
1791 * src/muscle_tab.c (muscle_init): NULL is a better default than
1792 `"0"'.
1793
3735969c
AD
17942001-12-10 Akim Demaille <akim@epita.fr>
1795
1796 * src/reader.c (reader): Calling symbols_output once is enough.
1797
49701457
AD
17982001-12-10 Akim Demaille <akim@epita.fr>
1799
1800 Now that states have a complete set of members, the linked list of
1801 reductions is useless: just fill directly the state's reductions
1802 member.
1803
1804 * src/state.h (struct reductions): Remove member `number' and
1805 `next'.
1806 * src/LR0.c (first_reduction, last_reduction): Remove.
1807 (save_reductions): Don't link the new reductions, store them in
1808 this_state.
1809 * src/lalr.c (set_state_table): No need to attach reductions to
1810 states, it's already done.
1811 * src/output.c (output_actions): No longer free the shifts, then
1812 the reductions, then the states: free all the states and their
1813 members.
1814
0edad749
AD
18152001-12-10 Akim Demaille <akim@epita.fr>
1816
1817 * src/options.c (OPTN, DRTV, BOTH): New.
1818 (option_table): Use them.
1819
0edad749
AD
1820 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
1821 the job of system.h.
1822 * src/options.c: Don't include stdio.h and xalloc.h for the same
1823 reasons.
1824
5449dd0f
AD
18252001-12-10 Akim Demaille <akim@epita.fr>
1826
1827 * src/output.c (output, prepare): Make sure the values of the
1828 muscles `action' and `prologue' are 0-terminated.
1829
a870c567
AD
18302001-12-10 Akim Demaille <akim@epita.fr>
1831
1832 Clean up GCC warnings.
1833
1834 * src/reader.c (copy_action): `buf' is not used.
1835 (parse_skel_decl): Be static.
1836 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
1837 * src/options.h (create_long_option_table): Have a real prototype.
1838 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1839 (hash_delete_at): Return const void *.
1840 Adjust casts to preserve the const.
1841
80df8768
AD
18422001-12-10 Akim Demaille <akim@epita.fr>
1843
1844 * configure.in: Require 2.52g.
1845 M4 is not needed, but AUTOM4TE is.
1846 * m4/m4.m4: Remove.
1847 * tests/Makefile.am: Adjust.
1848
f693ad14
AD
18492001-12-10 Akim Demaille <akim@epita.fr>
1850
1851 One structure for states is enough, even though theoretically
1852 there are LR(0) states and LALR(1) states.
1853
1854 * src/lalr.h (state_t): Remove.
1855 (state_table): Be state_t **, not state_t *.
1856 * src/state.h (core, CORE_ALLOC): Rename as...
1857 (state_t, STATE_ALLOC): this.
1858 Add the LALR(1) members: shifts, reductions, errs.
1859 * src/LR0.c (state_table): Rename as...
1860 (state_hash): this, to avoid name clashes with the global
1861 `state_table'.
1862 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1863 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1864
74ffbcb6
AD
18652001-12-10 Akim Demaille <akim@epita.fr>
1866
1867 Bison dumps core on bash.y.
1868 Reported by Pascal Bart.
1869
1870 * src/warshall.c (bitmatrix_print): New.
1871 (TC): Use it.
1872 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1873 j must be the outer loop.
1874 * tests/regression.at (Broken Closure): New.
1875
07708e19
AD
18762001-12-05 Akim Demaille <akim@epita.fr>
1877
1878 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1879 its argument.
1880