]> git.saurik.com Git - bison.git/blame - ChangeLog
* tests/calc.at: Exercise prologue splitting.
[bison.git] / ChangeLog
CommitLineData
0dd1580a
RA
12002-04-24 Robert Anisko <robert@lrde.epita.fr>
2
3 * tests/calc.at: Exercise prologue splitting.
4
5 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
6 `b4_post_prologue' instead of `b4_prologue'.
7
8 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
9 muscles.
10 (output): Free pre_prologue_obstack and post_prologue_obstack.
11 * src/files.h, src/files.c (attrs_obstack): Remove.
12 (pre_prologue_obstack, post_prologue_obstack): New.
13 * src/reader.c (copy_definition): Add a parameter to specify the
14 obstack to fill, instead of using attrs_obstack unconditionally.
15 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17
83c1796f
PE
182002-04-23 Paul Eggert <eggert@twinsun.com>
19
20 * data/bison.simple: Remove unnecessary commentary and white
21 space differences from 1_29-branch.
22 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
23
24 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
25 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
26 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
27 constructors or destructors.
28
29 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
30
1207eeac
AD
312002-04-23 Akim Demaille <akim@epita.fr>
32
33 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
34 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
35 location with columns.
36 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
37 All reported by Paul Eggert.
38
78ab8f67
AD
392002-04-22 Akim Demaille <akim@epita.fr>
40
41 * src/reduce.c (dump_grammar): Move to...
42 * src/gram.h, src/gram.c (grammar_dump): here.
43 Be sure to separate long item numbers.
44 Don't read the members of a rule's prec if its nil.
45
133c20e2
AD
462002-04-22 Akim Demaille <akim@epita.fr>
47
48 * src/output.c (table_size, table_grow): New.
49 (MAXTABLE): Remove, replace uses with table_size.
50 (pack_vector): Instead of dying when the table is too big, grow it.
51
9515e8a7
AD
522002-04-22 Akim Demaille <akim@epita.fr>
53
54 * data/bison.simple (yyr1): Its type is that of a token number.
55 * data/bison.c++ (r1_): Likewise.
56 * tests/regression.at (Web2c Actions): Adjust.
57
23c5a174
AD
582002-04-22 Akim Demaille <akim@epita.fr>
59
60 * src/reader.c (token_translations_init): 256 is now the default
61 value for the error token, i.e., it will be assigned another
62 number if the user assigned 256 to one of her tokens.
63 (reader): Don't force 256 to error.
64 * doc/bison.texinfo (Symbols): Adjust.
65 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
66 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
67 etc. instead of 10, 20, 30 (which was used to `jump' over error
68 (256) and undefined (2)).
69
5fbb0954
AD
702002-04-22 Akim Demaille <akim@epita.fr>
71
72 Propagate more token_number_t.
73
74 * src/gram.h (token_number_as_item_number)
75 (item_number_as_token_number): New.
76 * src/output.c (GENERATE_OUTPUT_TABLE): New.
77 Use it to create output_item_number_table and
78 output_token_number_table.
79 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
80 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
81 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
82 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
83
4f940944
AD
842002-04-22 Akim Demaille <akim@epita.fr>
85
86 * src/output.h, src/output.c (get_lines_number): Remove.
87
3ded9a63
AD
882002-04-19 Akim Demaille <akim@epita.fr>
89
90 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
91 as Lex/Flex'.
92 (Debugging): More details about enabling the debugging features.
93 (Table of Symbols): Describe $$, $n, @$, and @n.
94 Suggested by Tim Josling.
95
e0c471a9
AD
962002-04-19 Akim Demaille <akim@epita.fr>
97
98 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
99
fecc10cd
AD
1002002-04-10 Akim Demaille <akim@epita.fr>
101
102 * src/system.h: Rely on HAVE_LIMITS_H.
103 Suggested by Paul Eggert.
104
51dec47b
AD
1052002-04-09 Akim Demaille <akim@epita.fr>
106
107 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
108 full stderr, and strip it according to the bison options, instead
109 of composing the error message from different bits.
110 This makes it easier to check for several error messages.
111 Adjust all the invocations.
112 Add an invocation exercising the error token.
113 Add an invocation demonstrating a stupid error message.
114 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
115 Adjust the tests.
116 Error message are for stderr, not stdout.
117
007a50a4
AD
1182002-04-09 Akim Demaille <akim@epita.fr>
119
120 * src/gram.h, src/gram.c (error_token_number): Remove, use
121 errtoken->number.
122 * src/reader.c (reader): Don't specify the user token number (2)
123 for $undefined, as it uselessly prevents using it.
124 * src/gram.h (token_number_t): Move to...
125 * src/symtab.h: here.
126 (state_t.number): Is a token_number_t.
127 * src/print.c, src/reader.c: Use undeftoken->number instead of
128 hard coded 2.
129 (Even though this 2 is not the same as above: the number of the
130 undeftoken remains being 2, it is its user token number which
131 might not be 2).
132 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
133 `user_token_number_max'.
134 Output `undef_token_number'.
135 * data/bison.simple, data/bison.c++: Use them.
136 Be sure to map invalid yylex return values to
137 `undef_token_number'. This saves us from gratuitous SEGV.
138
139 * tests/conflicts.at (Solved SR Conflicts)
140 (Unresolved SR Conflicts): Adjust.
141 * tests/regression.at (Web2c Actions): Adjust.
142
06446ccf
AD
1432002-04-08 Akim Demaille <akim@epita.fr>
144
145 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
146 Adding #line.
147 Remove the duplicate `typedefs'.
148 (RhsNumberType): Fix the declaration and various other typos.
149 Use __ofile__.
150 * data/bison.simple: Use __ofile__.
151 * src/scan-skel.l: Handle __ofile__.
152
62a3e4f0
AD
1532002-04-08 Akim Demaille <akim@epita.fr>
154
155 * src/gram.h (item_number_t): New, the type of item numbers in
156 RITEM. Note that it must be able to code symbol numbers as
157 positive number, and the negation of rule numbers as negative
158 numbers.
159 Adjust all dependencies (pretty many).
160 * src/reduce.c (rule): Remove this `short *' pointer: use
161 item_number_t.
162 * src/system.h (MINSHORT, MAXSHORT): Remove.
163 Include `limits.h'.
164 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
165 (shortcpy): Remove.
166 (MAXTABLE): Move to...
167 * src/output.c (MAXTABLE): here.
168 (prepare_rules): Use output_int_table to output rhs.
169 * data/bison.simple, data/bison.c++: Adjust.
170 * tests/torture.at (Big triangle): Move the limit from 254 to
171 500.
172 * tests/regression.at (Web2c Actions): Ajust.
173
174 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
175 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
176 passes, but produces negative #line number, once fixed, GCC is
177 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
178 C), it passes.
179 * src/state.h (state_h): Code input lines on ints, not shorts.
180
bb88b0fc
AD
1812002-04-08 Akim Demaille <akim@epita.fr>
182
183 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
184 and then the grammar.
185
9a636f47
AD
1862002-04-08 Akim Demaille <akim@epita.fr>
187
188 * src/system.h: No longer using strndup.
189
680e8701
AD
1902002-04-07 Akim Demaille <akim@epita.fr>
191
192 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
193 * src/output.c (output_table_data): Return the longest number.
194 (prepare_tokens): Output `token_number_max').
195 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
196 New.
197 Use them to define yy_token_number_type/TokenNumberType.
198 Use this type for yytranslate.
199 * tests/torture.at (Big triangle): Push the limit from 124 to
200 253.
201 * tests/regression.at (Web2c Actions): Adjust.
202
817e9f41
AD
2032002-04-07 Akim Demaille <akim@epita.fr>
204
205 * tests/torture.at (Big triangle): New.
206 (GNU AWK Grammar, GNU Cim Grammar): Move to...
207 * tests/existing.at: here.
208
5123689b
AD
2092002-04-07 Akim Demaille <akim@epita.fr>
210
211 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
212 nritems.
213 Adjust dependencies.
214
f3849179
AD
2152002-04-07 Akim Demaille <akim@epita.fr>
216
217 * src/reader.c: Normalize increments to prefix form.
218
bd02036a
AD
2192002-04-07 Akim Demaille <akim@epita.fr>
220
221 * src/reader.c, symtab.c: Remove debugging code.
222
db8837cb
AD
2232002-04-07 Akim Demaille <akim@epita.fr>
224
225 Rename all the `bucket's as `symbol_t'.
226
227 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
228 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
229 * src/symtab.c, src/symtab.h (bucket): Rename as...
230 (symbol_t): this.
231 (symbol_list_new, bucket_check_defined, bucket_make_alias)
232 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
233 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
234 (buckets_new, buckets_free, buckets_do): Rename as...
235 (symbol_list_new, symbol_check_defined, symbol_make_alias)
236 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
237 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
238 (symbols_new, symbols_free, symbols_do): these.
239
72a23c97
AD
2402002-04-07 Akim Demaille <akim@epita.fr>
241
242 Use lib/hash for the symbol table.
243
244 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
245 EOF.
246 * src/lex.c (lex): Set the `number' member of new terminals.
247 * src/reader.c (bucket_check_defined, bucket_make_alias)
248 (bucket_check_alias_consistence, bucket_translation): New.
249 (reader, grammar_free, readgram, token_translations_init)
250 (packsymbols): Adjust.
251 (reader): Number the predefined tokens.
252 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
253 for predefined tokens.
254 * src/symtab.h (bucket): Remove all the hash table related
255 members.
256 * src/symtab.c (symtab): Replace by...
257 (bucket_table): this.
258 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
259 (buckets_new, buckets_do): New.
260
280a38c3
AD
2612002-04-07 Akim Demaille <akim@epita.fr>
262
263 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
264 (start_symbol, max_user_token_number, semantic_parser)
265 (error_token_number): Initialize.
266 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
267 Initialize.
268 (reader): Don't.
269 (errtoken, eoftoken, undeftoken, axiom): Extern.
270
03b31c0c
AD
2712002-04-07 Akim Demaille <akim@epita.fr>
272
273 * src/gram.h (rule_s): prec and precsym are now pointers
274 to the bucket giving the priority/associativity.
275 Member `associativity' removed: useless.
276 * src/reduce.c, src/conflicts.c: Adjust.
277
8b3df748
AD
2782002-04-07 Akim Demaille <akim@epita.fr>
279
280 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
281 Properly escape the symbols' TAG when outputting them.
282
e601aa1d
AD
2832002-04-07 Akim Demaille <akim@epita.fr>
284
285 * src/lalr.h (LA): Is a bitsetv, not bitset*.
286
b0299a2e
AD
2872002-04-07 Akim Demaille <akim@epita.fr>
288
289 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
290 (LArule): this, which is an array to rule_t*.
291 * src/print.c, src/conflicts.c: Adjust.
292
d7e1f00c
AD
2932002-04-07 Akim Demaille <akim@epita.fr>
294
295 * src/gram.h (rule_t): Rename `number' as `user_number'.
296 `number' is a new member.
297 Adjust dependencies.
298 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
299
cc9305dd
AD
3002002-04-07 Akim Demaille <akim@epita.fr>
301
302 As a result of the previous patch, it is no longer needed
303 to reorder ritem itself.
304
305 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
306
b0940840
AD
3072002-04-07 Akim Demaille <akim@epita.fr>
308
309 Be sure never to walk through RITEMS, but use only data related to
310 the rules themselves. RITEMS should be banished.
311
312 * src/output.c (output_token_translations): Rename as...
313 (prepare_tokens): this.
314 In addition to `translate', prepare the muscles `tname' and
315 `toknum', which were handled by...
316 (output_rule_data): this.
317 Remove, and move the remainder of its outputs into...
318 (prepare_rules): this new routines, which also merges content from
319 (output_gram): this.
320 (prepare_rules): Be sure never to walk through RITEMS.
321 (output_stos): Rename as...
322 (prepare_stos): this.
323 (output): Always invoke prepare_states, after all, just don't use it
324 in the output if you don't need it.
325
643a5994
AD
3262002-04-07 Akim Demaille <akim@epita.fr>
327
328 * src/LR0.c (new_state): Display `nstates' as the name of the
329 newly created state.
330 Adjust to initialize first_state and last_state if needed.
331 Be sure to distinguish the initial from the final state.
332 (new_states): Create the itemset of the initial state, and use
333 new_state.
334 * src/closure.c (closure): Now that the initial state has its
335 items properly set, there is no need for a special case when
336 creating `ruleset'.
337
338 As a result, now the rule 0, reducing to $axiom, is visible in the
339 outputs. Adjust the test suite.
340
341 * tests/conflicts.at (Solved SR Conflicts)
342 (Unresolved SR Conflicts): Adjust.
343 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
344 * tests/conflicts.at (S/R in initial): New.
345
b4c4ccc2
AD
3462002-04-07 Akim Demaille <akim@epita.fr>
347
348 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
349 the RHS of the rules.
350 * src/output.c (output_gram): Likewise.
351
bba97eb2
AD
3522002-04-07 Akim Demaille <akim@epita.fr>
353
354 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
355 bucket.
356 Adjust all dependencies.
357 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
358 `number' of the buckets too.
359 * src/gram.h: Include `symtab.h'.
360 (associativity): Move to...
361 * src/symtab.h: here.
362 No longer include `gram.h'.
363
c3b407f4
AD
3642002-04-07 Akim Demaille <akim@epita.fr>
365
366 * src/gram.h, src/gram.c (rules_rhs_length): New.
367 (ritem_longest_rhs): Use it.
368 * src/gram.h (rule_t): `number' is a new member.
369 * src/reader.c (packgram): Set it.
370 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
371 the end of `rules', and count them out of `nrules'.
372 (reduce_output, dump_grammar): Adjust.
373 * src/print.c (print_grammar): It is no longer needed to check for
374 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
375 * tests/reduce.at (Reduced Automaton): New test.
376
11652ab3
AD
3772002-04-07 Akim Demaille <akim@epita.fr>
378
379 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
380 lacking `+ 1' to nrules, Bison reported as useless a token if it
381 was used solely to set the precedence of the last rule...
382
26b23c1a
AD
3832002-04-07 Akim Demaille <akim@epita.fr>
384
385 * data/bison.c++, data/bison.simple: Don't output the current file
386 name in #line, to avoid useless diffs between two identical
387 outputs under different names.
388
18bcecb0
AD
3892002-04-07 Akim Demaille <akim@epita.fr>
390
391 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
392 Normalize loops to using `< nrules + 1', not `<= nrules'.
393
fa770c86
AD
3942002-04-07 Akim Demaille <akim@epita.fr>
395
396 * TODO: Update.
397
d9b739c3
AD
3982002-04-07 Akim Demaille <akim@epita.fr>
399
400 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
401 bucket.value as bucket.number.
402
99013900
AD
4032002-04-07 Akim Demaille <akim@epita.fr>
404
405 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
406 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
407 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
408 RHS, instead of being an index in RITEMS.
409
e966383b
PE
4102002-04-04 Paul Eggert <eggert@twinsun.com>
411
412 * doc/bison.texinfo: Update copyright date.
413 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
414 (Symbols): Warn about running Bison in one character set,
415 but compiling and/or running in an incompatible one.
416 Warn about character code 256, too.
417
4182002-04-03 Paul Eggert <eggert@twinsun.com>
419
420 * src/bison.data (YYSTACK_ALLOC): Depend on whether
421 YYERROR_VERBOSE is nonzero, not whether it is defined.
422
423 Merge changes from bison-1_29-branch.
c307773e 424
8d6c48b9
PE
4252002-03-20 Paul Eggert <eggert@twinsun.com>
426
427 Merge fixes from Debian bison_1.34-1.diff.
428
429 * configure.in (AC_PREREQ): 2.53.
430
e53c6322
AD
4312002-03-20 Akim Demaille <akim@epita.fr>
432
433 * src/conflicts.c (log_resolution): Argument `resolution' is const.
434
9ffbeca7
PE
4352002-03-19 Paul Eggert <eggert@twinsun.com>
436
21db0b2a
PE
437 * src/bison.simple (YYCOPY): New macro.
438 (YYSTACK_RELOCATE): Use it.
439 Remove Type arg; no longer needed. All callers changed.
440 (yymemcpy): Remove; no longer needed.
441
9ffbeca7
PE
442 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
443 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
444
642cb8f8
AD
4452002-03-19 Akim Demaille <akim@epita.fr>
446
447 Test and fix the #line outputs.
448
449 * tests/atlocal.at (GCC): New.
450 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
451 (Prologue synch line, ,%union synch line, Postprologue synch line)
452 (Action synch line, Epilogue synch line): New tests.
453 * src/reader.c (parse_union_decl): Define the muscle stype_line.
454 * data/bison.simple, data/bison.c++: Use it.
455
3c31a486
AD
4562002-03-19 Akim Demaille <akim@epita.fr>
457
458 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
459 (Solved SR Conflicts, %expect not enough, %expect right)
460 (%expect too much): Move to...
461 * tests/conflicts.at: this new file.
462
0d8bed56
AD
4632002-03-19 Akim Demaille <akim@epita.fr>
464
465 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
466 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
467 that we can move to enums for instance.
468 * src/output.c (token_definitions_output): Output a list of
469 `token-name, token-number' instead of the #define.
470 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
471
9208d17f
AD
4722002-03-14 Akim Demaille <akim@epita.fr>
473
474 Use Gettext 0.11.1.
475
af27eacb
RA
4762002-03-09 Robert Anisko <robert@lrde.epita.fr>
477
478 * data/bison.c++: Make the user able to add members to the generated
479 parser by subclassing.
480
9101a310
RA
4812002-03-05 Robert Anisko <robert@lrde.epita.fr>
482
483 * src/reader.c (read_additionnal_code): `c' should be an integer, not
484 a character.
485 Reported by Nicolas Tisserand and Nicolas Burrus.
486
fff9bf0b
RA
4872002-03-04 Robert Anisko <robert@lrde.epita.fr>
488
489 * src/reader.c: Warn about lacking semi-colons, do not complain.
490
64dba31e
RA
4912002-03-04 Robert Anisko <robert@lrde.epita.fr>
492
493 * data/bison.c++: Remove a debug line.
494
374f5a14
RA
4952002-03-04 Robert Anisko <robert@lrde.epita.fr>
496
497 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
498 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
499 provide a default implementation.
500
bfcf1f3a
AD
5012002-03-04 Akim Demaille <akim@epita.fr>
502
503 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
504 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
505 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
506 * tests/semantic.at (Parsing Guards): Similarly.
507 * src/reader.at (readgram): Complain if the last rule is not ended
508 with a semi-colon.
509
65ccf9fc
AD
5102002-03-04 Akim Demaille <akim@epita.fr>
511
512 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
513 * src/closure.c: here.
514 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
515 RTC.
516 * src/warshall.h, src/warshall.c: Remove.
517 * tests/sets.at (Broken Closure): Adjust.
518
d0039cbc
AD
5192002-03-04 Akim Demaille <akim@epita.fr>
520
521 * src/output.c (output_skeleton): tempdir is const.
522 bytes_read is unused.
523
345cea78
AD
5242002-03-04 Akim Demaille <akim@epita.fr>
525
526 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
527 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
528 Update.
529 From Michael Hayes.
530
564801f7
AD
5312002-03-04 Akim Demaille <akim@epita.fr>
532
533 * src/closure.c (closure): `r' is unused.
534
e5352bc7
AD
5352002-03-04 Akim Demaille <akim@epita.fr>
536
537 * tests/sets.at (Broken Closure): Add the ending `;'.
538 * src/reader.at (readgram): Complain if a rule is not ended with a
539 semi-colon.
540
914feea9
AD
5412002-03-04 Akim Demaille <akim@epita.fr>
542
543 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
544 (count_sr_conflicts): Use bitset_count.
545 * src/reduce.c (inaccessable_symbols): Ditto.
546 (bits_size): Remove.
547 * src/warshall.h, src/warshall.c: Convert to bitsetv.
548
f0250de6
AD
5492002-03-04 Akim Demaille <akim@epita.fr>
550
551 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
552 * src/reduce.c: Remove the `bitset_zero's following the
553 `bitset_create's, as now it is performed by the latter.
554
ef017502
AD
5552002-03-04 Akim Demaille <akim@epita.fr>
556
557 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
558 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
559 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
560 latest sources from Michael.
561
76514394
AD
5622002-03-04 Akim Demaille <akim@epita.fr>
563
564 * src/output.c (output): Don't free the grammar.
565 * src/reader.c (grammar_free): New.
566 * src/main.c (main): Call it and don't free symtab here.
567
55024580
AD
5682002-03-04 Akim Demaille <akim@epita.fr>
569
570 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
571 before returning.
572 Reported by Benoit Perrot.
573
f9abaa2c
AD
5742002-03-04 Akim Demaille <akim@epita.fr>
575
576 Use bitset operations when possible, not loops over bits.
577
578 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
579 bitset_or.
580 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
581 * src/reduce.c (useless_nonterminals): Formatting changes.
582 * src/warshall.c (TC): Use bitset_or.
583
0e721e75
AD
5842002-03-04 Akim Demaille <akim@epita.fr>
585
586 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
587 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
588 Ditto.
589
0fb1ffb1
AD
5902002-03-04 Akim Demaille <akim@epita.fr>
591
592 * src/lalr.c (F): Now a bitset*.
593 Adjust all dependencies.
594
b86796bf
AD
5952002-03-04 Akim Demaille <akim@epita.fr>
596
597 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
598 Adjust all dependencies.
599
602bbf31
AD
6002002-03-04 Akim Demaille <akim@epita.fr>
601
602 * src/L0.c, src/LR0.h (nstates): Be size_t.
603 Adjust comparisons (signed vs unsigned).
604 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
605 bitset*.
606 Adjust all dependencies.
607
d8a0245c
AD
6082002-03-04 Akim Demaille <akim@epita.fr>
609
610 * src/closure.c (firsts): Now, also a bitset.
611 Adjust all dependencies.
612 (varsetsize): Remove, now unused.
613 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
614
34ba9743
AD
6152002-03-04 Akim Demaille <akim@epita.fr>
616
617 * src/print.c: Convert to use bitset.h, not hand coded iterations
618 over ints.
619
ed86e78c
AD
6202002-03-04 Akim Demaille <akim@epita.fr>
621
622 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
623
dfdb1797
AD
6242002-03-04 Akim Demaille <akim@epita.fr>
625
626 * src/closure.c (ruleset): Be a bitset.
627 (rulesetsize): Remove.
628
7086e707
AD
6292002-03-04 Akim Demaille <akim@epita.fr>
630
631 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
632 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
633 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
634 * src/closure.c (fderives): Be an array of bitsets.
635
98254360
RA
6362002-02-28 Robert Anisko <robert@lrde.epita.fr>
637
638 * data/bison.c++: Merge the two generated headers. Insert a copyright
639 notice in each output file.
640
a75c057f
AD
6412002-02-28 Akim Demaille <akim@epita.fr>
642
643 * data/bison.c++: Copy the prologue of bison.simple to fetch
644 useful M4 definitions, such as b4_header_guard.
645
06b00abc
AD
6462002-02-25 Akim Demaille <akim@epita.fr>
647
648 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
649 translator friendly scheme for the bgr
650 copyright notice.
06b00abc 651
70e7d534
AD
6522002-02-25 Akim Demaille <akim@epita.fr>
653
654 * src/output.c (header_output): Remove, now handled completely via
655 M4.
656
abe017f6
AD
6572002-02-25 Akim Demaille <akim@epita.fr>
658
659 * m4/m4.m4: New, from CVS Autoconf.
660 * configure.in: Invoke it.
661 * src/output.c (output_skeleton): Use its result instead of the
662 hard coded name.
663
381fb12e
AD
6642002-02-25 Akim Demaille <akim@epita.fr>
665
666 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
667 Fileutils 4.1.5.
668 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
669 * src/output.c (output_skeleton): Use mkstemp to create a real
670 temporary file.
671 Move the filling of `skeleton' and its muscle to...
672 (prepare): here.
673 (output): Move the definition of the prologue muscle to...
674 (prepare): here.
675 * src/system.h (DEFAULT_TMPDIR): New.
676
6f38107f
PE
6772002-02-14 Paul Eggert <eggert@twinsun.com>
678
679 Remove the support for C++ namespace cleanliness; it was
680 causing more problems than it was curing, since it didn't work
681 properly on some nonstandard C++ compilers. This can wait
682 for a proper C++ parser.
683
684 * NEWS: Document this.
685 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
686 of C++, as it's treated like C now.
687 * src/bison.simple (YYSTD): Remove.
688 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
689 Treat C++ just like Standard C instead of trying to support
690 namespace cleanliness.
691
80cce3da
AD
6922002-02-14 Akim Demaille <akim@epita.fr>
693
694 * tests/regression.at (else): Adjust to Andreas' change.
695
842e8679
AD
6962002-02-14 Akim Demaille <akim@epita.fr>
697
698 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
699
4bda3f10
AD
7002002-02-13 Andreas Schwab <schwab@suse.de>
701
702 * src/output.c (output_rule_data): Don't output NULL, it might
703 not be defined yet.
704
4162fa07 7052002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 706
4162fa07
RA
707 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
708 (Copyright notice): Update.
b418ecd8 709
bd16a5dc
AD
7102002-02-11 Akim Demaille <akim@epita.fr>
711
712 * tests/regression.at (%nonassoc and eof): Don't include
713 nonportable headers.
714
8d69a1a3
RA
7152002-02-08 Robert Anisko <robert@lrde.epita.fr>
716
717 * data/bison.c++: Correct error recovery. Make the user able to
718 initialize the starting location.
719
9b2d0677
AD
7202002-02-07 Akim Demaille <akim@epita.fr>
721
722 * tests/input.at: New.
723
69e2658b
RA
7242002-02-07 Robert Anisko <robert@lrde.epita.fr>
725
726 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 727 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
728 directives around tables only needed for debugging.
729
4aacc3a7
RA
7302002-02-07 Robert Anisko <robert@lrde.epita.fr>
731
732 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
733 C++ parsers.
734 (yy::b4_name::parse): Use print_.
735
762a801e
RA
7362002-02-07 Robert Anisko <robert@lrde.epita.fr>
737
738 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
739
4bb2bc3f
RA
7402002-02-07 Robert Anisko <robert@lrde.epita.fr>
741
742 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
743 C++ parsers.
744 (yy::b4_name::parse): Build verbose error messages, and use error_.
745
6b45a3ca
RA
7462002-02-06 Robert Anisko <robert@lrde.epita.fr>
747
748 * data/bison.c++: Fix m4 quoting in comments.
749
50997c6e
RA
7502002-02-06 Robert Anisko <robert@lrde.epita.fr>
751
752 * data/bison.c++: Adjust the parser code. Fix some muscles that were
753 not expanded by m4.
754
3f3eed27
AD
7552002-02-05 Akim Demaille <akim@epita.fr>
756
757 * data/bison.c++: Adjust to the M4 back end.
758 More is certainly needed.
759
be2a1a68
AD
7602002-02-05 Akim Demaille <akim@epita.fr>
761
762 Give a try to M4 as a back end.
763
764 * lib/readpipe.c: New, from wdiff.
765 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
766 BISON_HAIRY.
767 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
768 specific values. Now it is m4 that performs the lookup.
769 * src/parse-skel.y: Remove.
770 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
771 * src/output.c (actions_output, guards_output)
772 (token_definitions_output): No longer keeps track of the output
773 line number, hence remove the second argument.
774 (guards_output): Check against the guard member of a rule, not the
775 action member.
776 Adjust callers.
777 (output_skeleton): Don't look for the skeleton location, let m4 do
778 that.
779 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
780 file will be used.
781 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
782 (prepare): Given that for the time being changesyntax is not
783 usable in M4, rename the muscles using `-' to `_'.
784 Define `defines_flag', `output_parser_name' and `output_header_name'.
785 * src/output.h (actions_output, guards_output)
786 (token_definitions_output): Adjust prototypes.
787 * src/scan-skel.l: Instead of scanning the skeletons, it now
788 processes the output of m4: `__oline__' and `#output'.
789 * data/bison.simple: Adjust to be used by M4(sugar).
790 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
791 to date.
792 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
793 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
794 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
795 shamelessly stolen from CVS Autoconf.
796
beda758b
AD
7972002-02-05 Akim Demaille <akim@epita.fr>
798
799 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
800 * configure.in: Check for the declarations of free and malloc.
801 * src/muscle_tab.c: Adjust.
802
5ece6d43
AD
8032002-02-05 Akim Demaille <akim@epita.fr>
804
805 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
806 which have no values.
807
5bb18f9a
AD
8082002-02-05 Akim Demaille <akim@epita.fr>
809
810 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
811 * data/: here.
812
894dd62e
PE
8132002-01-29 Paul Eggert <eggert@twinsun.com>
814
815 * src/bison.simple (YYSIZE_T): Do not define merely because
816 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
817 On some platforms, <alloca.h> does not declare YYSTD (size_t).
818
82841af7
AD
8192002-01-27 Akim Demaille <akim@epita.fr>
820
821 Fix `%nonassoc and eof'.
822
823 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
824 which were not properly copied! Replace
825 memcpy (res->errs, src->errs, src->nerrs);
826 with
827 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
828 !!!
829 * tests/regression.at (%nonassoc and eof): Adjust to newest
830 Autotest: `.' is not in the PATH.
831
318b76e9
AD
8322002-01-27 Akim Demaille <akim@epita.fr>
833
834 * tests/sets.at (AT_EXTRACT_SETS): New.
835 (Nullable): Use it.
836 (Firsts): New.
837
30d2f3d5
AD
8382002-01-26 Akim Demaille <akim@epita.fr>
839
840 * tests/actions.at, tests/calc.at, tests/headers.at,
841 * tests/torture.at: Adjust to the newest Autotest which no longer
842 forces `.' in the PATH.
843
30f8c395
AD
8442002-01-25 Akim Demaille <akim@epita.fr>
845
846 * tests/regression.at (%nonassoc and eof): New.
847 Suggested by Robert Anisko.
848
29ae55f1
AD
8492002-01-24 Akim Demaille <akim@epita.fr>
850
851 Bison dumps core when trying to complain about broken input files.
852 Reported by Cris van Pelt.
853
854 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
855 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
856 into...
857 (Invalid inputs): Strengthen: exercise parse_percent_token.
858
2b548aa6
RA
8592002-01-24 Robert Anisko <robert.anisko@epita.fr>
860
861 * src/Makefile.am: Add bison.c++.
862 * src/bison.c++: New skeleton.
863
bb0146c2
AD
8642002-01-21 Paolo Bonzini <bonzini@gnu.org>
865
866 * po/it.po: New.
867
bec30531
AD
8682002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
869
870 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
871
fc6edc45
MA
8722002-01-20 Marc Autret <marc@gnu.org>
873
874 * src/files.c (compute_output_file_names): Fix
875
5e5d5415
MA
8762002-01-20 Marc Autret <marc@gnu.org>
877
878 * tests/output.at: New test.
879 * src/files.c (compute_base_names): Don't map extensions when
880 the YACC flag is set, use defaults.
881 Reported by Evgeny Stambulchik.
882
44ea3fbd
MA
8832002-01-20 Marc Autret <marc@gnu.org>
884
bb0146c2 885 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
886 compilers as well (i.e. the vendor C compiler).
887 Suggested by Albert Chin-A-Young.
888
338963d1
TVH
8892002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
890
891 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
892 canonical definition.
893 * src/system.h: Use the canonical definition for PARAMS (avoids
894 a conflict with the macro from lib/hash.h).
895
c57b2479
AD
8962002-01-11 Akim Demaille <akim@epita.fr>
897
898 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 899 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 900
b85810ae
AD
9012002-01-09 Akim Demaille <akim@epita.fr>
902
903 * src/files.c, src/files.h (output_infix): New.
904 (tab_extension): Remove.
905 (compute_base_names): Compute the former, drop the latter.
906 * src/output.c (prepare): Insert the muscles `output-infix', and
907 `output-suffix'.
908 * src/parse-skel.y (string, string.1): New.
909 (section.header): Use it.
910 (section.yacc): Remove.
911 (prefix): Remove too.
912 * src/scan-skel.l: Adjust.
913 * src/bison.simple, src/bison.hairy: Adjust.
914
cae60122
AD
9152002-01-09 Akim Demaille <akim@epita.fr>
916
917 * configure.in (WERROR_CFLAGS): Compute it.
918 * src/Makefile.am (CFLAGS): Pass it.
919 * tests/atlocal.in (CFLAGS): Idem.
920 * src/files.c: Fix a few warnings.
921 (get_extension_index): Remove, unused.
922
ae404801
AD
9232002-01-08 Akim Demaille <akim@epita.fr>
924
925 * src/getargs.c (AS_FILE_NAME): New.
926 (getargs): Use it to convert DOSish file names.
927 * src/files.c (base_name): Rename as full_base_name to avoid
928 clashes with `base_name ()'.
929 (filename_split): New.
930 (compute_base_names): N-th rewrite, using filename_split.
931
22312b71
AD
9322002-01-08 Akim Demaille <akim@epita.fr>
933
934 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
935 New, stolen from the Fileutils 4.1.
936 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
937 * configure.in: Check for the presence of memrchr, and of its
938 prototype.
939
a67cef01
TVH
9402002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
941
942 * lib/hash.h (__P): Added definition for this macro.
943 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
944 BUILT_SOURCES, to ensure they are generated first.
945 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
946 %error-verbose to allow bootstrapping with bison 1.30x.
947
2b25d624
AD
9482002-01-06 Akim Demaille <akim@epita.fr>
949
950 * src/reader.c (parse_braces): Don't fetch the next char, the
951 convention is to fetch on entry.
952 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
953 'switch' without a following semicolon.
954 * tests/regression.at (braces parsing): New.
955
3460813b
AD
9562002-01-06 Akim Demaille <akim@epita.fr>
957
958 Bison is dead wrong in its RR conflict reports.
959
960 * tests/torture.at (GNU Cim Grammar): New.
961 * src/conflicts.c (count_rr_conflicts): Fix.
962
73784c64
AD
9632002-01-06 Akim Demaille <akim@epita.fr>
964
965 Creating package.m4 from configure.ac causes too many problems.
966
967 * tests/Makefile.am (package.m4): Create it by hand,
968 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
969
25d81090
AD
9702002-01-06 Akim Demaille <akim@epita.fr>
971
972 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
973 skeleton.h.
974
a9b8959e
PE
9752002-01-04 Paul Eggert <eggert@twinsun.com>
976
977 * doc/bison.texinfo (Debugging):
978 Remove YYSTDERR; it's no longer defined or used.
979 Also, s/cstdio.h/cstdio/.
980
25d81090
AD
9812002-01-03 Akim Demaille <akim@epita.fr>
982
983 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
984
1109455c
AD
9852002-01-03 Akim Demaille <akim@epita.fr>
986
987 * src/parse-skel.y (process_skeleton): Don't bind the parser's
988 tracing code to --trace, wait for a better --trace option, with
989 args.
990
7ea5e977
AD
9912002-01-03 Akim Demaille <akim@epita.fr>
992
993 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
994 The ISO C++ standard is extremely clear about it: stderr is
995 considered a macro, not a regular symbol (see table 94 `Header
996 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
997 Therefore std:: does not apply to it. It still does with fprintf.
998 Also, s/cstdio.h/cstdio/.
999
fab5b110
AD
10002002-01-03 Akim Demaille <akim@epita.fr>
1001
1002 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1003 for non system headers.
1004
aed7fd9b
AD
10052002-01-02 Akim Demaille <akim@epita.fr>
1006
1007 Equip the skeleton chain with location tracking, runtime trace,
1008 pure parser and scanner.
1009
1010 * src/parse-skel.y: Request a pure parser, locations, and prefix
1011 renaming.
1012 (%union): Having several members with the same type does not help
1013 type mismatches, simplify.
1014 (YYPRINT, yyprint): New.
1015 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1016 (skel_error): this.
1017 Handle locations.
1018 * src/scan-skel.l: Adjust to these changes.
1019 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1020 (LOCATION_PRINT, skel_control_t): New.
1021
24fad99e
AD
10222001-12-30 Akim Demaille <akim@epita.fr>
1023
1024 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1025 replace `gb' with BLANKS.
1026 * src/scan-skel.l: Adjust.
1027
a4b36db4
AD
10282001-12-30 Akim Demaille <akim@epita.fr>
1029
1030 * src/system.h: We don't need nor want bcopy.
1031 Throw away MS-DOS crap: we don't need getpid.
1032 * configure.in: We don't need strndup. It was even causing
1033 problems: because Flex includes the headers *before* us,
1034 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1035 not visible.
1036 * lib/xstrndup.c: New.
1037 * src/scan-skel.l: Use it.
1038 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1039 * src/parse-skel.y: Use %directives instead of #defines.
1040
1239777d
AD
10412001-12-30 Akim Demaille <akim@epita.fr>
1042
1043 * src/skeleton.h: New.
1044 * src/output.c (output_parser, output_master_parser): Remove, dead
1045 code.
1046 * src/output.h (get_lines_number, actions_output, guards_output)
1047 (token_definitions_output): Prototype them.
1048 * src/parse-skel.y: Add the license notice.
1049 Include output.h and skeleton.h.
1050 (process_skeleton): Returns void, and takes a single parameter.
1051 * src/scan-skel.l: Add the license notice.
1052 Include skeleton.h.
1053 Don't use %option yylineno: it seems that then Flex imagines
1054 REJECT has been used, and therefore it won't reallocate its
1055 buffers (which makes no other sense to me than a bug). It results
1056 in warnings for `unused: yy_flex_realloc'.
1057
9b3add5b
RA
10582001-12-30 Robert Anisko <robert.anisko@epita.fr>
1059
1060 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1061 (MUSCLE_INSERT_PREFIX): ...to there.
1062 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1063 (MUSCLE_INSERT_PREFIX): Move from here...
1064
1065 * src/bison.hairy: Add a section directive. Put braces around muscle
1066 names. This parser skeleton is still broken, but Bison should not
1067 choke on a bad muscle 'syntax'.
1068 * src/bison.simple: Add a section directive. Put braces around muscle
1069 names.
1070
1071 * src/files.h (strsuffix, stringappend): Add declarations.
1072 (tab_extension): Add declaration.
1073 (short_base_name): Add declaration.
1074
1075 * src/files.c (strsuffix, stringappend): No longer static. These
1076 functions are used in the skeleton parser.
1077 (tab_extension): New.
1078 (compute_base_names): Use the computations done in this function
fab5b110 1079 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
1080 names.
1081 (short_base_name): No longer static.
1082
1083 * src/output.c (output_skeleton): New.
1084 (output): Disable call to output_master_parser, and give a try to
1085 a new skeleton handling system.
1086 (guards_output, actions_output): No longer static.
1087 (token_definitions_output, get_lines_number): No longer static.
1088
1089 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1090
fab5b110 1091 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
1092 parse-skel.y.
1093
1094 * src/parse-skel.y: New file.
1095 * src/scan-skel.l: New file.
1096
b5b61c61
AD
10972001-12-29 Akim Demaille <akim@epita.fr>
1098
1099 %name-prefix is broken.
1100
1101 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1102 Adjust all dependencies.
1103 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1104 %name-prefix.
1105
1106 Renaming yylval but not yylloc is not consistent. Now we do.
1107
1108 * src/bison.simple: Prefix yylloc if used.
1109 * doc/bison.texinfo (Decl Summary): Document that.
1110
8c9a50be
AD
11112001-12-29 Akim Demaille <akim@epita.fr>
1112
1113 * doc/bison.texinfo: Promote `%long-directive' over
1114 `%long_directive'.
1115 Remove all references to fixed-output-files, yacc is enough.
1116
d99361e6
AD
11172001-12-29 Akim Demaille <akim@epita.fr>
1118
1119 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1120 user prologue. These are defaults.
1121 * tests/actions.at (Mid-rule actions): Make sure the user can
1122 define YYDEBUG and YYERROR_VERBOSE.
1123
b9cecb91
AD
11242001-12-29 Akim Demaille <akim@epita.fr>
1125
1126 * src/output.c (header_output): Don't forget to export YYLTYPE and
1127 yylloc.
1128 * tests/headers.at (export YYLTYPE): New, make sure it does.
1129 * tests/regression.at (%union and --defines, Invalid CPP headers):
1130 Move to...
1131 * tests/headers.at: here.
1132
aea13e97
AD
11332001-12-29 Akim Demaille <akim@epita.fr>
1134
1135 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1136
931394cb
AD
11372001-12-29 Akim Demaille <akim@epita.fr>
1138
1139 * tests/actions.at (Mid-rule actions): Output on a single line
1140 instead of several.
1141
704a47c4
AD
11422001-12-29 Akim Demaille <akim@epita.fr>
1143
1144 * doc/bison.texinfo: Formatting changes.
1145
091e20bb
AD
11462001-12-29 Akim Demaille <akim@epita.fr>
1147
1148 Don't store the token defs in a muscle, just be ready to output it
1149 on command. Now possible via `symbols'. Fixes a memory leak.
1150
1151 * src/output.c (token_definitions_output): New.
1152 (output_parser, header_output): Use it.
1153 * src/reader.c (symbols_save): Remove.
1154
cce71710
AD
11552001-12-29 Akim Demaille <akim@epita.fr>
1156
1157 * src/bison.simple: Do not provide a default for YYSTYPE and
1158 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1159 default.
1160
82c035a8
AD
11612001-12-29 Akim Demaille <akim@epita.fr>
1162
1163 Mid-rule actions are simply... ignored!
1164
1165 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1166 the empty-rule associated to the dummy symbol, not to the host
1167 rule.
1168 * tests/actions.at (Mid-rule actions): New.
1169
8419d367
AD
11702001-12-29 Akim Demaille <akim@epita.fr>
1171
1172 Memory leak.
1173
1174 * src/reader.c (reader): Free grammar.
1175
375d5806
AD
11762001-12-29 Akim Demaille <akim@epita.fr>
1177
1178 Memory leak.
1179
1180 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1181 since it allocates it for each state, although only one is needed.
1182 (allocate_storage): Do it here.
1183
f51cb8ff
AD
11842001-12-29 Akim Demaille <akim@epita.fr>
1185
1186 * src/options.h, src/options.c (create_long_option_table): Rename
1187 as...
1188 (long_option_table_new): this, with a clearer prototype.
1189 (percent_table): Remove, unused,
1190 * src/getargs.c (getargs): Adjust.
1191
29e88316
AD
11922001-12-29 Akim Demaille <akim@epita.fr>
1193
1194 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1195 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1196 as states.
1197
b9f71f19
AD
11982001-12-29 Akim Demaille <akim@epita.fr>
1199
1200 * src/lalr.c (build_relations): Rename `states' as `states1'.
1201 Sorry, I don't understand exactly what it is, no better name...
1202
1a2b5d37
AD
12032001-12-29 Akim Demaille <akim@epita.fr>
1204
1205 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1206 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1207 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1208 as rules.
1209
1cca533e
AD
12102001-12-29 Akim Demaille <akim@epita.fr>
1211
1212 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1213 ago.
1214
c03ae966
AD
12152001-12-29 Akim Demaille <akim@epita.fr>
1216
1217 * src/reader.c, src/reader.h (user_toknums): Remove.
1218 Adjust all users to use symbols[i]->user_token_number.
1219
5a670b1e
AD
12202001-12-29 Akim Demaille <akim@epita.fr>
1221
1222 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1223 Adjust all users to use symbols[i]->prec or ->assoc.
1224
ad949da9
AD
12252001-12-29 Akim Demaille <akim@epita.fr>
1226
1227 * src/reader.c, src/reader.h (tags): Remove.
1228 Adjust all users to use symbols[i]->tag.
1229
0e78e603
AD
12302001-12-29 Akim Demaille <akim@epita.fr>
1231
1232 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1233 and rule_table.
1234 * src/reader.c (packsymbols): Fill this table.
1235 Drop sprec.
1236 * src/conflicts.c (resolve_sr_conflict): Adjust.
1237 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1238 single table.
1239 Use symbols[i]->tag instead of tags[i].
1240
213e640e
AD
12412001-12-29 Akim Demaille <akim@epita.fr>
1242
1243 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1244 In addition, put a comment in there, to replace...
1245 * tests/regression.at (%union and C comments): Remove.
1246
e7b8bef1
AD
12472001-12-29 Akim Demaille <akim@epita.fr>
1248
1249 * tests/regression.at (Web2c Actions): Blindly move the actual
1250 output as expected output. The contents *seem* right to me, but I
1251 can't pretend reading perfectly parser tables... Nonetheless, all
1252 the other tests pass correctly, the table look OK, even though the
1253 presence of `$axiom' is to be noted: AFAICS it is useless (but
1254 harmless).
1255
b68e7744
AD
12562001-12-29 Akim Demaille <akim@epita.fr>
1257
1258 * src/reader.c (readgram): Don't add the rule 0 if there were no
1259 rules read. In other words, add it _after_ having performed
1260 grammar sanity checks.
1261 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1262
78d5bae9
AD
12632001-12-29 Akim Demaille <akim@epita.fr>
1264
1265 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1266 visible, and some states have now a different number.
1267
ff442794
AD
12682001-12-29 Akim Demaille <akim@epita.fr>
1269
1270 * src/reader.c (readgram): Bind the initial rule's lineno to that
1271 of the first rule.
1272 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1273 (Solved SR Conflicts): Adjust rule 0's line number.
1274
610ab194
AD
12752001-12-29 Akim Demaille <akim@epita.fr>
1276
1277 Fix the `GAWK Grammar' failure.
1278
1279 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1280 the reductions of the first state which was mistakenly confused
1281 with the final state because precisely final_state was initialized
1282 to 0.
1283 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1284 now noticed by Bison.
1285 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1286 have a reduction on $default.
1287
29d29c8f
AD
12882001-12-29 Akim Demaille <akim@epita.fr>
1289
1290 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1291 rule line numbers.
1292 * src/closure.c (print_closure): Likewise.
1293 * src/derives.c (print_derives): Likewise.
1294 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1295 now.
1296
7c6b64d0
AD
12972001-12-29 Akim Demaille <akim@epita.fr>
1298
1299 * src/lalr.c (lookaheads_print): New.
1300 (lalr): Call it when --trace-flag.
1301 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1302 are dumped.
1303
3d4daee3
AD
13042001-12-29 Akim Demaille <akim@epita.fr>
1305
1306 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1307 when walking through ritem, even via rule->rhs.
1308 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1309 (useful_production, useless_nonterminals): Likewise.
1310 (reduce_grammar_tables): Likewise, plus update nritems.
1311 * src/nullable.c (set_nullable): Likewise.
1312 * src/lalr.c (build_relations): Likewise.
1313 * tests/sets.at (Nullable): Adjust.
1314 Fortunately, now, the $axiom is no longer nullable.
1315
9e7f6bbd
AD
13162001-12-29 Akim Demaille <akim@epita.fr>
1317
1318 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1319 the 0-sentinel.
1320 * src/gram.c (ritem_longest_rhs): Likewise.
1321 * src/reduce.c (nonterminals_reduce): Likewise.
1322 * src/print_graph.c (print_graph): Likewise.
1323 * src/output.c (output_rule_data): Likewise.
1324 * src/nullable.c (set_nullable): Likewise.
1325
255ef638
AD
13262001-12-29 Akim Demaille <akim@epita.fr>
1327
1328 * src/output.c: Comment changes.
1329
0d8a7363
AD
13302001-12-27 Paul Eggert <eggert@twinsun.com>
1331
1332 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1333 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1334 Sparc, as they were causing more porting problems than the
1335 (minor) performance improvement was worth.
1336
1337 Also, catch up with 1.31's YYSTD.
1338
3db472b9
AD
13392001-12-27 Akim Demaille <akim@epita.fr>
1340
1341 * src/output.c (output_gram): Rely on nritems, not the
1342 0-sentinel. See below.
1343 Use -1 as separator, not 0.
1344 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1345 Rely on -1 as separator in yyrhs, instead of 0.
1346 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1347 twice `Now at end of input', therefore there are two lines less to
1348 expect.
1349
b365aa05
AD
13502001-12-27 Akim Demaille <akim@epita.fr>
1351
1352 * tests/regression.at (Unresolved SR Conflicts):
1353 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1354 below.
1355
30171f79
AD
13562001-12-27 Akim Demaille <akim@epita.fr>
1357
1358 * src/LR0.c (new_state): Recognize the final state by the fact it
1359 is reached by eoftoken.
1360 (insert_start_shifting_state, insert_eof_shifting_state)
1361 (insert_accepting_state, augment_automaton): Remove, since now
1362 these states are automatically computed from the initial state.
1363 (generate_states): Adjust.
1364 * src/print.c: When reporting a rule number to the user, substract
1365 1, so that the axiom rule is rule 0, and the first user rule is 1.
1366 * src/reduce.c: Likewise.
1367 * src/print_graph.c (print_core): For the time being, just as for
1368 the report, depend upon --trace-flags to dump the full set of
1369 items.
1370 * src/reader.c (readgram): Once the grammar read, insert the rule
1371 0: `$axiom: START-SYMBOL $'.
1372 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1373 number of the states has changed (the final state is no longer
1374 necessarily the last), catch up.
1375
75142d45
AD
13762001-12-27 Akim Demaille <akim@epita.fr>
1377
1378 Try to make the use of the eoftoken valid. Given that its value
1379 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1380 is used instead of > 0 where appropriate, (ii), depend upon nritems
1381 instead of the 0-sentinel.
1382
1383 * src/gram.h, src/gram.c (nritems): New.
1384 Expected to be duplication of nitems, but for the time being...
1385 * src/reader.c (packgram): Assert nritems and nitems are equal.
1386 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1387 * src/closure.c (print_closure, print_fderives): Likewise.
1388 * src/gram.c (ritem_print): Likewise.
1389 * src/print.c (print_core, print_grammar): Likewise.
1390 * src/print_graph.c: Likewise.
1391
b7c49edf
AD
13922001-12-27 Akim Demaille <akim@epita.fr>
1393
1394 * src/main.c (main): If there are complains after grammar
1395 reductions, then output the report anyway if requested, then die.
1396 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1397 * src/reader.c (eoftoken): New.
1398 (parse_token_decl): If the token being defined has value `0', it
1399 is the eoftoken.
1400 (packsymbols): No longer hack `tags' to insert `$' by hand.
1401 Be sure to preserve the value of the eoftoken.
1402 (reader): Make sure eoftoken is defined.
1403 Initialize nsyms to 0: now eoftoken is created just like the others.
1404 * src/print.c (print_grammar): Don't special case the eof token.
1405 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1406 lie anyway, albeit pleasant.
1407 * tests/calc.at: Exercise error messages with eoftoken.
1408 Change the grammar so that empty input is invalid.
1409 Adjust expectations.
1410 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1411
ec2da99f
AD
14122001-12-27 Akim Demaille <akim@epita.fr>
1413
1414 * configure.in: Check the protos of strchr ans strspn.
1415 Replace strchr if needed.
1416 * src/system.h: Provide the protos of strchr, strspn and memchr if
1417 missing.
1418 * lib/strchr.c: New.
1419 * src/reader.c (symbols_save): Use strchr.
1420
8adfa272
AD
14212001-12-27 Akim Demaille <akim@epita.fr>
1422
1423 * src/print.c, src/print_graph.c (escape): New.
1424 Use it to quote the TAGS outputs.
1425 * src/print_graph.c (print_state): Now errors are in red, and
1426 reductions in green.
1427 Prefer high to wide: output the state number on a line of its own.
1428
80dac38c
AD
14292001-12-27 Akim Demaille <akim@epita.fr>
1430
1431 * src/state.h, src/state.c (reductions_new): New.
1432 * src/LR0.c (set_state_table): Let all the states have a
1433 `reductions', even if reduced to 0.
1434 (save_reductions): Adjust.
1435 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1436 * src/print.c (print_reductions, print_actions): Adjust.
1437 * src/output.c (action_row): Adjust.
1438
2cec70b9
AD
14392001-12-27 Akim Demaille <akim@epita.fr>
1440
1441 * src/state.h, src/state.c (errs_new, errs_dup): New.
1442 * src/LR0.c (set_state_table): Let all the states have an errs,
1443 even if reduced to 0.
1444 * src/print.c (print_errs, print_reductions): Adjust.
1445 * src/output.c (output_actions, action_row): Adjust.
1446 * src/conflicts.c (resolve_sr_conflict): Adjust.
1447
13ca549a
AD
14482001-12-27 Akim Demaille <akim@epita.fr>
1449
1450 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1451
5092aba5
AD
14522001-12-27 Akim Demaille <akim@epita.fr>
1453
1454 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1455 * src/print.c: here.
1456 (lookaheadset, shiftset): New, used as additional storage by
1457 print_reductions.
1458 (print_results): Adjust.
1459 (print_shifts, print_gotos, print_errs): New, extracted from...
1460 (print_actions): here.
1461 * src/print_graph.c (print_actions): Remove dead code.
1462
11e2beca
AD
14632001-12-27 Akim Demaille <akim@epita.fr>
1464
1465 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1466 `$n' and `@n'.
1467
dac3c910
AD
14682001-12-27 Akim Demaille <akim@epita.fr>
1469
1470 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1471 (build_relations): Adjust.
1472
d0b0fefa
AD
14732001-12-27 Akim Demaille <akim@epita.fr>
1474
1475 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1476 duplication.
1477
adc8c848
AD
14782001-12-27 Akim Demaille <akim@epita.fr>
1479
1480 * src/reader.c (packgram): Catch nitems overflows.
1481
14d293ac
AD
14822001-12-27 Akim Demaille <akim@epita.fr>
1483
1484 * src/files.c, src/files.h (guard_obstack): Remove.
1485 * src/output.c (output): Adjust.
1486 * src/reader.c (parse_braces): New, factoring...
1487 (copy_action, copy_guard): these two which are renamed as...
1488 (parse_action, parse_guard): these.
1489 As a voluntary consequence, using braces around guards is now
1490 mandatory.
1491
f499b062
AD
14922001-12-27 Akim Demaille <akim@epita.fr>
1493
1494 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1495 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1496 members.
1497 (symbol_list_new): Adjust.
1498 (copy_action): action_line is the first line, not the last.
1499 (copy_guard): Just as for actions, store the `action' only, not
1500 the switch/case/break flesh.
1501 Don't parse the user action that might follow the guard, let...
1502 (readgram): do it, i.e., now, there can be an action after a
1503 guard.
1504 In other words the guard is just explicitly optional.
1505 (packgram): Adjust.
1506 * src/output.c (guards_output): New.
1507 (output_parser): Call it when needed.
1508 (output): Also free the guard and attrs obstacks.
1509 * src/files.c, src/files.h (obstack_save): Remove.
1510 (output_files): Remove.
1511 As a result, if one needs the former `.act' file, using an
1512 appropriate skeleton which requires actions and guards is now
1513 required.
1514 * src/main.c (main): Adjust.
1515 * tests/semantic.at: New.
1516 * tests/regression.at: Use `input.y' as input file name.
1517 Avoid 8+3 problems by requiring input.c when the test needs the
1518 parser.
1519
d945f5cd
AD
15202001-12-27 Akim Demaille <akim@epita.fr>
1521
1522 * src/reader.c (symbol_list_new): Be sure to initialize all the
1523 fields.
1524
d200e455
AD
15252001-12-27 Akim Demaille <akim@epita.fr>
1526
1527 All the hacks using a final pseudo state are now useless.
1528
1529 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1530 * src/lalr.c (nLA): New.
1531 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1532 instead of lookaheadsp from the pseudo state (nstate + 1).
1533
f9507c28
AD
15342001-12-27 Akim Demaille <akim@epita.fr>
1535
1536 * src/output.c (action_row, token_actions): Use a state_t instead
1537 of a integer, and nlookaheads instead of the following state's
1538 lookaheadsp.
1539
065fbd27
AD
15402001-12-27 Akim Demaille <akim@epita.fr>
1541
1542 * src/conflicts.c (log_resolution, flush_shift)
1543 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1544 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1545 (conflicts_print, print_reductions): Use a state_t instead of an
1546 integer when referring to a state.
1547 As much as possible, depend upon nlookaheads, instead of the
1548 `lookaheadsp' member of the following state (since lookaheads of
1549 successive states are successive, the difference between state n + 1
1550 and n served as the number of lookaheads for state n).
1551 * src/lalr.c (add_lookback_edge): Likewise.
1552 * src/print.c (print_core, print_actions, print_state)
1553 (print_results): Likewise.
1554 * src/print_graph.c (print_core, print_actions, print_state)
1555 (print_graph): Likewise.
1556 * src/conflicts.h: Adjust.
1557
1b177bd7
AD
15582001-12-27 Akim Demaille <akim@epita.fr>
1559
1560 * src/bison.hairy: Formatting/comment changes.
1561 ANSIfy.
1562 Remove `register' indications.
1563 Add plenty of `static'.
1564
7742ddeb
AD
15652001-12-27 Akim Demaille <akim@epita.fr>
1566
1567 * src/output.c (prepare): Drop the muscle `ntbase' which
1568 duplicates ntokens.
1569 * src/bison.simple: Formatting/comment changes.
1570 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1571 is an undocumented synonym.
1572
1fa14068
AD
15732001-12-22 Akim Demaille <akim@epita.fr>
1574
1575 * src/output.c (output_table_data): Change the prototype to use
1576 `int' for array ranges: some invocations do pass an int, not a
1577 short.
1578 Reported by Wayne Green.
1579
b9752825
AD
15802001-12-22 Akim Demaille <akim@epita.fr>
1581
1582 Some actions of web2c.y are improperly triggered.
1583 Reported by Mike Castle.
1584
1585 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1586 * tests/regression.at (Web2c): Rename as...
1587 (Web2c Report): this.
1588 (Web2c Actions): New.
1589
776209d6
AD
15902001-12-22 Akim Demaille <akim@epita.fr>
1591
1592 Reductions in web2c.y are improperly reported.
1593 Reported by Mike Castle.
1594
1595 * src/conflicts.c (print_reductions): Fix.
1596 * tests/regression.at (Web2c): New.
1597
275fc3ad
AD
15982001-12-18 Akim Demaille <akim@epita.fr>
1599
1600 Some host fail on `assert (!"foo")', which expands to
1601 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1602 Reported by Nelson Beebee.
1603
1604 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1605 `#define it_succeeded 0' and `assert (it_succeeded)'.
1606
897668ee
MA
16072001-12-17 Marc Autret <autret_m@epita.fr>
1608
1609 * src/bison.simple: Don't hard code the skeleton line and filename.
1610 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1611 New line counter 'skeleton_line' (skeleton-line muscle).
1612
ab3399e0
PE
16132001-12-17 Paul Eggert <eggert@twinsun.com>
1614
1615 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1616 YYDEBUG must be defined to a nonzero value.
1617
1618 * src/bison.simple (yytname): Do not assume that the user defines
1619 YYDEBUG to a properly parenthesized expression.
1620
3877f72b
AD
16212001-12-17 Akim Demaille <akim@epita.fr>
1622
1623 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1624 nlookaheads is a new member.
1625 Adjust all users.
1626 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1627 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1628 state.
776209d6 1629
331dbc1b
AD
16302001-12-17 Akim Demaille <akim@epita.fr>
1631
1632 * src/files.h, src/files.c (open_files, close_files): Remove.
1633 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1634 let...
1635 * src/reader.c (reader): Do it.
776209d6 1636
be750e4c
AD
16372001-12-17 Akim Demaille <akim@epita.fr>
1638
1639 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 1640
709ae8c6
AD
16412001-12-17 Akim Demaille <akim@epita.fr>
1642
1643 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1644 (flush_reduce): New.
1645 (resolve_sr_conflict): Adjust.
776209d6 1646
f87685c3
AD
16472001-12-17 Akim Demaille <akim@epita.fr>
1648
1649 * src/output.c (output_obstack): Be static and rename as...
1650 (format_obstack): this, to avoid any confusion with files.c's
1651 output_obstack.
1652 * src/reader.h (muscle_obstack): Move to...
1653 * src/output.h: here, since it's defined in output.c.
1654
837491d8
AD
16552001-12-17 Akim Demaille <akim@epita.fr>
1656
1657 * src/output.c (action_row, save_column, default_goto)
1658 (sort_actions, matching_state, pack_vector): Better variable
1659 locality.
1660
796d61fb
AD
16612001-12-17 Akim Demaille <akim@epita.fr>
1662
1663 * src/output.c: Various formatting changes.
776209d6 1664
64d15509
AD
16652001-12-17 Akim Demaille <akim@epita.fr>
1666
1667 * src/files.c (output_files): Free the output_obstack.
1668 * src/main.c (main): Call print and print_graph conditionally.
1669 * src/print.c (print): Work unconditionally.
1670 * src/print_graph.c (print_graph): Work unconditionally.
1671 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1672
fbc8ecb7
MA
16732001-12-16 Marc Autret <autret_m@epita.fr>
1674
1675 * src/output.c (actions_output): Fix. When we use %no-lines,
1676 there is one less line per action.
1677
f0440388
MA
16782001-12-16 Marc Autret <autret_m@epita.fr>
1679
1680 * src/bison.simple: Remove a useless #line directive.
1681 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1682 * src/output.c (get_lines_number): New.
776209d6 1683 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
1684 output muscles.
1685 Fix line numbering.
1686 (actions_output): Computes the number of lines taken by actions.
1687 (output_master_parser): Insert new skeleton which is the name of
1688 the output parser file name.
1689
a79986b8
MA
16902001-12-15 Marc Autret <autret_m@epita.fr>
1691
1692 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1693
4ec8e00f
MA
16942001-12-15 Marc Autret <autret_m@epita.fr>
1695
1696 * src/output.c (output_gram): Keep track of the hairy one.
1697
1a4648ff
AD
16982001-12-15 Akim Demaille <akim@epita.fr>
1699
1700 Make `make distcheck' work.
1701
1702 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1703 system.h which uses libgettext.h.
1704
9c2c67e6
AD
17052001-12-15 Akim Demaille <akim@epita.fr>
1706
1707 * src/nullable.c (set_nullable): Useless rules must be skipped,
1708 otherwise, since we range over their symbols, we might look at a
1709 nonterminal which no longer ``exists'', i.e., it is not counted in
1710 `nvars', hence we overflow our arrays.
1711
93ede233
AD
17122001-12-15 Akim Demaille <akim@epita.fr>
1713
1714 The header can also be produced directly, without any obstack!
1715 Yahoo!
1716
1717 * src/files.c, src/files.h (defines_obstack): Remove.
1718 (compute_header_macro): Global.
1719 (defines_obstack_save): Remove.
1720 * src/reader.c (parse_union_decl): No longer output to
1721 defines_obstack: its content can be found in the `stype' muscle
1722 anyway.
1723 (output_token_translations): Merge into...
1724 (symbols_output): this.
1725 Rename as...
1726 (symbols_save): this.
1727 (reader): Adjust.
1728 * src/output.c (header_output): New.
1729 (output): Call it.
1730
2666f928
AD
17312001-12-15 Akim Demaille <akim@epita.fr>
1732
1733 * src/reader.c (parse_union_decl): Instead of handling two obstack
1734 simultaneously, use one to define the `stype' muscle, and use the
1735 value of the latter to fill defines_obstack.
1736 (copy_comment): Remove.
1737 (copy_comment2): Work for a single obstack.
1738 Rename as...
1739 (copy_comment): this.
1740
428046f8
AD
17412001-12-15 Akim Demaille <akim@epita.fr>
1742
1743 * src/lex.c, src/lex.h (xgetc): No longer static.
1744 * src/reader.c (parse_union_decl): Revamp.
1745
ea52d706
AD
17462001-12-15 Akim Demaille <akim@epita.fr>
1747
1748 Still making progress in separating Bison into (i) input, (ii)
1749 process, (iii) output: now we can directly output the parser file
1750 without using table_obstack at all.
1751
1752 * src/files.c, src/files.h (table_obstack): Bye bye.
1753 (parser_file_name): New.
1754 * src/files.c (compute_output_file_names): Compute it.
1755 * src/output.c (actions_output, output_parser)
1756 (output_master_parser): To a file instead of an obstack.
1757
3f96f4dc
AD
17582001-12-15 Akim Demaille <akim@epita.fr>
1759
1760 Attach actions to rules, instead of pre-outputting them to
1761 actions_obstack.
1762
1763 * src/gram.h (rule_t): action and action_line are new members.
1764 * src/reader.c (symbol_list): Likewise.
1765 (copy_action): Save the actions within the rule.
1766 (packgram): Save them in rule_table.
1767 * src/output.c (actions_output): New.
1768 (output_parser): Use it on `%%actions'.
1769 (output_rule_data): Don't free rule_table.
1770 (output): Do it.
1771 (prepare): Don't save the `action' muscle.
1772 * src/bison.simple: s/%%action/%%actions/.
1773
51576fb3
AD
17742001-12-15 Akim Demaille <akim@epita.fr>
1775
1776 * src/reader.c (copy_action): When --yacc, don't append a `;'
1777 to the user action: let it fail if lacking.
dee049eb 1778 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 1779
2648a72d
AD
17802001-12-14 Akim Demaille <akim@epita.fr>
1781
1782 * src/lex.c (literalchar): Simply return the char you decoded, non
1783 longer mess around with obstacks and int pointers.
1784 Adjust all callers.
1785
92790e5b
AD
17862001-12-14 Akim Demaille <akim@epita.fr>
1787
1788 * src/lex.c (literalchar): Don't escape the special characters,
1789 just decode them, and keep them as char (before, eol was output as
1790 the 2 char string `\n' etc.).
1791 * src/output.c (output_rule_data): Use quotearg to output the
1792 token strings.
1793
927c1557
PE
17942001-12-13 Paul Eggert <eggert@twinsun.com>
1795
1796 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1797 Do not infringe on the global user namespace when using C++.
1798 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1799 All uses of `fprintf' and `stderr' changed.
1800
1801 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1802
ed8e1f68
AD
18032001-12-13 Akim Demaille <akim@epita.fr>
1804
1805 The computation of nullable is broken: it doesn't handle empty
1806 RHS's properly.
1807
1808 * tests/torture.at (GNU AWK Grammar): New.
1809 * tests/sets.at (Nullable): New.
1810 * src/nullable.c (set_nullable): Instead of blindly looping over
1811 `ritems', loop over the rules, and then over their rhs's.
1812
1813 Work around Autotest bugs.
1814
1815 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1816 frame, because Autotest understand lines starting with a `+' as
1817 traces from the shell. Then, they are not processed properly.
1818 Admittedly an Autotest bug, but we don't have time to wait for
1819 Autotest to catch up.
1820 * tests/regression.at (Broken Closure): Adjust to the new table
1821 frames.
1822 Move to...
1823 * tests/sets.at: here.
1824
cb581495
AD
18252001-12-13 Akim Demaille <akim@epita.fr>
1826
1827 * src/closure.c (closure): Use nrules instead of playing tricks
1828 with BITS_PER_WORD.
1829
2e729273
AD
18302001-12-13 Akim Demaille <akim@epita.fr>
1831
1832 * src/print.c (print_actions): Output the handling of `$' as the
1833 traces do: shifting the token EOF. Before EOF was treated as a
1834 nonterminal.
1835 * tests/regression.at: Adjust some tests.
1836 * src/print_graph.c (print_core): Complete the set of items via
1837 closure. The next-to-final and final states are still unsatisfying,
1838 but that's to be addressed elsewhere.
1839 No longer output the rule numbers, but do output the state number.
1840 A single loop for the shifts + gotos is enough, but picked a
1841 distinct color for each.
1842 (print_graph): Initialize and finalize closure.
1843
107f7dfb
AD
18442001-12-13 Akim Demaille <akim@epita.fr>
1845
1846 * src/reader.c (readgram): Remove dead code, an strip useless
1847 braces.
1848 (get_type): Remove, unused.
1849
9b53a24f
AD
18502001-12-12 Akim Demaille <akim@epita.fr>
1851
1852 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1853 on that of lib/error.c.
1854
dbfb6dcd
AD
18552001-12-12 Akim Demaille <akim@epita.fr>
1856
1857 Some hosts don't like `/' in includes.
1858
1859 * src/system.h: Include libgettext.h without qualifying the path.
1860 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1861 $(top_srcdir).
1862
c25fb648
MA
18632001-12-11 Marc Autret <autret_m@epita.fr>
1864
1865 * src/output.c (output_parser): Remove useless muscle.
1866
710ddc4f
MA
18672001-12-11 Marc Autret <autret_m@epita.fr>
1868
1869 * src/bison.simple: Remove #line just before %%epilogue. It
1870 is now handled in ...
1871 * src/reader.c (read_additionnal_code): Add the output of a
1872 #line for the epilogue.
1873
e83d80b8
MA
18742001-12-10 Marc Autret <autret_m@epita.fr>
1875
927c1557 1876 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
1877 replace precedent remove.
1878 * src/bison.simple: Remove #line before %%prologue because
1879 %%input-line is wrong at this time.
1880
971d5158
MA
18812001-12-10 Marc Autret <autret_m@epita.fr>
1882
1883 * src/reader.c (symbols_output): Clean up.
927c1557 1884 * src/output.c (output_gram, output): Clean up.
971d5158 1885
5edafffd
AD
18862001-12-10 Akim Demaille <akim@epita.fr>
1887
1888 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1889 * src/LR0.c (set_state_table): here.
1890 * src/lalr.c (lalr): Call it.
1891
0279f8e9
AD
18922001-12-10 Akim Demaille <akim@epita.fr>
1893
1894 * src/state.h (shifts): Remove the `number' member: shifts are
1895 attached to state, hence no longer need to be labelled with a
1896 state number.
1897
190c4f5f
AD
18982001-12-10 Akim Demaille <akim@epita.fr>
1899
1900 Now that states have a complete set of members, the linked list of
1901 shifts is useless: just fill directly the state's shifts member.
1902
1903 * src/state.h (shifts): Remove the `next' member.
1904 * src/LR0.c (first_state, last_state): Remove.
1905 Adjust the callers.
1906 (augment_automaton): Don't look for the shifts that must be added
1907 a shift on EOF: it is those of the state we looked for! But now,
1908 since shifts are attached, it is no longer needed to looking
1909 merely by its id: its number.
1910
2a73b93d
AD
19112001-12-10 Akim Demaille <akim@epita.fr>
1912
1913 * src/LR0.c (augment_automaton): Better variable locality.
1914 Remove an impossible branch: if there is a state corresponding to
1915 the start symbol being shifted, then there is shift for the start
1916 symbol from the initial state.
1917
74392f6a
AD
19182001-12-10 Akim Demaille <akim@epita.fr>
1919
1920 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1921 only when appropriate: when insert_start_shifting_state' is not
1922 invoked.
1923 * tests/regression.at (Rule Line Numbers): Adjust.
1924
37c82725
AD
19252001-12-10 Akim Demaille <akim@epita.fr>
1926
1927 * src/LR0.c (augment_automaton): Now that all states have shifts,
1928 merge the two cases addition shifts to the initial state.
1929
6a164e0c
AD
19302001-12-10 Akim Demaille <akim@epita.fr>
1931
1932 * src/lalr.c (set_state_table): Move to...
1933 * src/LR0.c: here.
1934 * src/lalr.c (lalr): Don't call it...
1935 * src/LR0.c (generate_states): do it.
1936 * src/LR0.h (first_state): Remove, only the table is used.
1937
7215de24
AD
19382001-12-10 Akim Demaille <akim@epita.fr>
1939
1940 * src/LR0.h (first_shift, first_reduction): Remove.
1941 * src/lalr.c: Don't use first_shift: find shifts through the
1942 states.
1943
80e25d4d
AD
19442001-12-10 Akim Demaille <akim@epita.fr>
1945
1946 * src/LR0.c: Attach shifts to states as soon as they are
1947 computed.
1948 * src/lalr.c (set_state_table): Instead of assigning shifts to
1949 state, just assert that the mapping was properly done.
1950
0ab3728b
AD
19512001-12-10 Akim Demaille <akim@epita.fr>
1952
1953 * src/LR0.c (insert_start_shift): Rename as...
1954 (insert_start_shifting_state): this.
1955 (insert_eof_shifting_state, insert_accepting_state): New.
1956 (augment_automaton): Adjust.
1957 Better locality of the variables.
1958 When looking if the start_symbol is shifted from the initial
1959 state, using `while (... symbol != start_symbol ...)' sounds
1960 better than `while (... symbol < start_symbol ...)': If fail
1961 to see how the order between symbols could be relevant!
1962
78af9bbc
AD
19632001-12-10 Akim Demaille <akim@epita.fr>
1964
1965 * src/getargs.h: Don't declare `spec_name_prefix' and
1966 `spec_file_prefix', declared by src/files.h.
1967 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1968 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1969 * src/output.c (prepare): Adjust.
1970 * src/reader.c (symbols_output): Likewise.
1971 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1972
bdef2a41
AD
19732001-12-10 Akim Demaille <akim@epita.fr>
1974
1975 * src/muscle_tab.c (muscle_init): NULL is a better default than
1976 `"0"'.
1977
3735969c
AD
19782001-12-10 Akim Demaille <akim@epita.fr>
1979
1980 * src/reader.c (reader): Calling symbols_output once is enough.
1981
49701457
AD
19822001-12-10 Akim Demaille <akim@epita.fr>
1983
1984 Now that states have a complete set of members, the linked list of
1985 reductions is useless: just fill directly the state's reductions
1986 member.
1987
1988 * src/state.h (struct reductions): Remove member `number' and
1989 `next'.
1990 * src/LR0.c (first_reduction, last_reduction): Remove.
1991 (save_reductions): Don't link the new reductions, store them in
1992 this_state.
1993 * src/lalr.c (set_state_table): No need to attach reductions to
1994 states, it's already done.
1995 * src/output.c (output_actions): No longer free the shifts, then
1996 the reductions, then the states: free all the states and their
1997 members.
1998
0edad749
AD
19992001-12-10 Akim Demaille <akim@epita.fr>
2000
2001 * src/options.c (OPTN, DRTV, BOTH): New.
2002 (option_table): Use them.
2003
0edad749
AD
2004 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2005 the job of system.h.
2006 * src/options.c: Don't include stdio.h and xalloc.h for the same
2007 reasons.
2008
5449dd0f
AD
20092001-12-10 Akim Demaille <akim@epita.fr>
2010
2011 * src/output.c (output, prepare): Make sure the values of the
2012 muscles `action' and `prologue' are 0-terminated.
2013
a870c567
AD
20142001-12-10 Akim Demaille <akim@epita.fr>
2015
2016 Clean up GCC warnings.
2017
2018 * src/reader.c (copy_action): `buf' is not used.
2019 (parse_skel_decl): Be static.
2020 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2021 * src/options.h (create_long_option_table): Have a real prototype.
2022 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2023 (hash_delete_at): Return const void *.
2024 Adjust casts to preserve the const.
2025
80df8768
AD
20262001-12-10 Akim Demaille <akim@epita.fr>
2027
2028 * configure.in: Require 2.52g.
2029 M4 is not needed, but AUTOM4TE is.
2030 * m4/m4.m4: Remove.
2031 * tests/Makefile.am: Adjust.
2032
f693ad14
AD
20332001-12-10 Akim Demaille <akim@epita.fr>
2034
2035 One structure for states is enough, even though theoretically
2036 there are LR(0) states and LALR(1) states.
2037
2038 * src/lalr.h (state_t): Remove.
2039 (state_table): Be state_t **, not state_t *.
2040 * src/state.h (core, CORE_ALLOC): Rename as...
2041 (state_t, STATE_ALLOC): this.
2042 Add the LALR(1) members: shifts, reductions, errs.
2043 * src/LR0.c (state_table): Rename as...
2044 (state_hash): this, to avoid name clashes with the global
2045 `state_table'.
2046 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2047 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2048
74ffbcb6
AD
20492001-12-10 Akim Demaille <akim@epita.fr>
2050
2051 Bison dumps core on bash.y.
2052 Reported by Pascal Bart.
2053
2054 * src/warshall.c (bitmatrix_print): New.
2055 (TC): Use it.
2056 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2057 j must be the outer loop.
2058 * tests/regression.at (Broken Closure): New.
2059
07708e19
AD
20602001-12-05 Akim Demaille <akim@epita.fr>
2061
2062 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2063 its argument.
2064