]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
[bison.git] / ChangeLog
CommitLineData
82b6cb3f
AD
12002-05-02 Akim Demaille <akim@epita.fr>
2
3 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
4 (parse_guard): Rename the formal argument `stack_offset' as
5 `rule_length', which is more readable.
6 Adjust callers.
7 (copy_at, copy_dollar): Instead of outputting the hard coded
8 values of $$, $n and so forth, output invocation to b4_lhs_value,
9 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
10 * data/bison.simple, data/bison.c++ (b4_lhs_value)
11 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12
6cbfbcc5
AD
132002-05-02 Akim Demaille <akim@epita.fr>
14
15 * configure.in (AC_INIT): Bump to 1.49b.
16 (AM_INIT_AUTOMAKE): Short invocation.
17
b8548114
AD
182002-05-02 Akim Demaille <akim@epita.fr>
19
20 Version 1.49a.
21
c20cd1fa
AD
222002-05-01 Akim Demaille <akim@epita.fr>
23
24 * src/skeleton.h: Remove.
25
8a9566d4
AD
262002-05-01 Akim Demaille <akim@epita.fr>
27
28 * src/skeleton.h: Fix the #endif.
29 Reported by Magnus Fromreide.
30
8c6d399a
PE
312002-04-26 Paul Eggert <eggert@twinsun.com>
32
33 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
34 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 35 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 36
2b7ed18a
RA
372002-04-25 Robert Anisko <robert@lrde.epita.fr>
38
39 * src/scan-skel.l: Postprocess quadrigraphs.
40
41 * src/reader.c (copy_character): New function, used to output
42 single characters while replacing `[' and `]' with quadrigraphs, to
43 avoid troubles with M4 quotes.
44 (copy_comment): Output characters with copy_character.
45 (read_additionnal_code): Likewise.
46 (copy_string2): Likewise.
47 (copy_definition): Likewise.
48
49 * tests/calc.at: Exercise M4 quoting.
50
34a89c50
AD
512002-04-25 Akim Demaille <akim@epita.fr>
52
53 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
54 between `!' and the command.
55 Reported by Paul Eggert.
56
0dd1580a
RA
572002-04-24 Robert Anisko <robert@lrde.epita.fr>
58
59 * tests/calc.at: Exercise prologue splitting.
60
61 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
62 `b4_post_prologue' instead of `b4_prologue'.
63
64 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
65 muscles.
66 (output): Free pre_prologue_obstack and post_prologue_obstack.
67 * src/files.h, src/files.c (attrs_obstack): Remove.
68 (pre_prologue_obstack, post_prologue_obstack): New.
69 * src/reader.c (copy_definition): Add a parameter to specify the
70 obstack to fill, instead of using attrs_obstack unconditionally.
71 (read_declarations): Pass pre_prologue_obstack to copy_definition if
72 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
73
83c1796f
PE
742002-04-23 Paul Eggert <eggert@twinsun.com>
75
76 * data/bison.simple: Remove unnecessary commentary and white
77 space differences from 1_29-branch.
78 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
79
80 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
81 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
82 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
83 constructors or destructors.
84
85 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
86
1207eeac
AD
872002-04-23 Akim Demaille <akim@epita.fr>
88
89 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
90 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
91 location with columns.
92 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
93 All reported by Paul Eggert.
94
78ab8f67
AD
952002-04-22 Akim Demaille <akim@epita.fr>
96
97 * src/reduce.c (dump_grammar): Move to...
98 * src/gram.h, src/gram.c (grammar_dump): here.
99 Be sure to separate long item numbers.
100 Don't read the members of a rule's prec if its nil.
101
133c20e2
AD
1022002-04-22 Akim Demaille <akim@epita.fr>
103
104 * src/output.c (table_size, table_grow): New.
105 (MAXTABLE): Remove, replace uses with table_size.
106 (pack_vector): Instead of dying when the table is too big, grow it.
107
9515e8a7
AD
1082002-04-22 Akim Demaille <akim@epita.fr>
109
110 * data/bison.simple (yyr1): Its type is that of a token number.
111 * data/bison.c++ (r1_): Likewise.
112 * tests/regression.at (Web2c Actions): Adjust.
113
23c5a174
AD
1142002-04-22 Akim Demaille <akim@epita.fr>
115
116 * src/reader.c (token_translations_init): 256 is now the default
117 value for the error token, i.e., it will be assigned another
118 number if the user assigned 256 to one of her tokens.
119 (reader): Don't force 256 to error.
120 * doc/bison.texinfo (Symbols): Adjust.
121 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
122 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
123 etc. instead of 10, 20, 30 (which was used to `jump' over error
124 (256) and undefined (2)).
125
5fbb0954
AD
1262002-04-22 Akim Demaille <akim@epita.fr>
127
128 Propagate more token_number_t.
129
130 * src/gram.h (token_number_as_item_number)
131 (item_number_as_token_number): New.
132 * src/output.c (GENERATE_OUTPUT_TABLE): New.
133 Use it to create output_item_number_table and
134 output_token_number_table.
135 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
136 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
137 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
138 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
139
4f940944
AD
1402002-04-22 Akim Demaille <akim@epita.fr>
141
142 * src/output.h, src/output.c (get_lines_number): Remove.
143
3ded9a63
AD
1442002-04-19 Akim Demaille <akim@epita.fr>
145
146 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
147 as Lex/Flex'.
148 (Debugging): More details about enabling the debugging features.
149 (Table of Symbols): Describe $$, $n, @$, and @n.
150 Suggested by Tim Josling.
151
e0c471a9
AD
1522002-04-19 Akim Demaille <akim@epita.fr>
153
154 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
155
fecc10cd
AD
1562002-04-10 Akim Demaille <akim@epita.fr>
157
158 * src/system.h: Rely on HAVE_LIMITS_H.
159 Suggested by Paul Eggert.
160
51dec47b
AD
1612002-04-09 Akim Demaille <akim@epita.fr>
162
163 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
164 full stderr, and strip it according to the bison options, instead
165 of composing the error message from different bits.
166 This makes it easier to check for several error messages.
167 Adjust all the invocations.
168 Add an invocation exercising the error token.
169 Add an invocation demonstrating a stupid error message.
170 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
171 Adjust the tests.
172 Error message are for stderr, not stdout.
173
007a50a4
AD
1742002-04-09 Akim Demaille <akim@epita.fr>
175
176 * src/gram.h, src/gram.c (error_token_number): Remove, use
177 errtoken->number.
178 * src/reader.c (reader): Don't specify the user token number (2)
179 for $undefined, as it uselessly prevents using it.
180 * src/gram.h (token_number_t): Move to...
181 * src/symtab.h: here.
182 (state_t.number): Is a token_number_t.
183 * src/print.c, src/reader.c: Use undeftoken->number instead of
184 hard coded 2.
185 (Even though this 2 is not the same as above: the number of the
186 undeftoken remains being 2, it is its user token number which
187 might not be 2).
188 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
189 `user_token_number_max'.
190 Output `undef_token_number'.
191 * data/bison.simple, data/bison.c++: Use them.
192 Be sure to map invalid yylex return values to
193 `undef_token_number'. This saves us from gratuitous SEGV.
194
195 * tests/conflicts.at (Solved SR Conflicts)
196 (Unresolved SR Conflicts): Adjust.
197 * tests/regression.at (Web2c Actions): Adjust.
198
06446ccf
AD
1992002-04-08 Akim Demaille <akim@epita.fr>
200
201 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
202 Adding #line.
203 Remove the duplicate `typedefs'.
204 (RhsNumberType): Fix the declaration and various other typos.
205 Use __ofile__.
206 * data/bison.simple: Use __ofile__.
207 * src/scan-skel.l: Handle __ofile__.
208
62a3e4f0
AD
2092002-04-08 Akim Demaille <akim@epita.fr>
210
211 * src/gram.h (item_number_t): New, the type of item numbers in
212 RITEM. Note that it must be able to code symbol numbers as
213 positive number, and the negation of rule numbers as negative
214 numbers.
215 Adjust all dependencies (pretty many).
216 * src/reduce.c (rule): Remove this `short *' pointer: use
217 item_number_t.
218 * src/system.h (MINSHORT, MAXSHORT): Remove.
219 Include `limits.h'.
220 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
221 (shortcpy): Remove.
222 (MAXTABLE): Move to...
223 * src/output.c (MAXTABLE): here.
224 (prepare_rules): Use output_int_table to output rhs.
225 * data/bison.simple, data/bison.c++: Adjust.
226 * tests/torture.at (Big triangle): Move the limit from 254 to
227 500.
228 * tests/regression.at (Web2c Actions): Ajust.
229
230 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
231 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
232 passes, but produces negative #line number, once fixed, GCC is
233 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
234 C), it passes.
235 * src/state.h (state_h): Code input lines on ints, not shorts.
236
bb88b0fc
AD
2372002-04-08 Akim Demaille <akim@epita.fr>
238
239 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
240 and then the grammar.
241
9a636f47
AD
2422002-04-08 Akim Demaille <akim@epita.fr>
243
244 * src/system.h: No longer using strndup.
245
680e8701
AD
2462002-04-07 Akim Demaille <akim@epita.fr>
247
248 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
249 * src/output.c (output_table_data): Return the longest number.
250 (prepare_tokens): Output `token_number_max').
251 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
252 New.
253 Use them to define yy_token_number_type/TokenNumberType.
254 Use this type for yytranslate.
255 * tests/torture.at (Big triangle): Push the limit from 124 to
256 253.
257 * tests/regression.at (Web2c Actions): Adjust.
258
817e9f41
AD
2592002-04-07 Akim Demaille <akim@epita.fr>
260
261 * tests/torture.at (Big triangle): New.
262 (GNU AWK Grammar, GNU Cim Grammar): Move to...
263 * tests/existing.at: here.
264
5123689b
AD
2652002-04-07 Akim Demaille <akim@epita.fr>
266
267 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
268 nritems.
269 Adjust dependencies.
270
f3849179
AD
2712002-04-07 Akim Demaille <akim@epita.fr>
272
273 * src/reader.c: Normalize increments to prefix form.
274
bd02036a
AD
2752002-04-07 Akim Demaille <akim@epita.fr>
276
277 * src/reader.c, symtab.c: Remove debugging code.
278
db8837cb
AD
2792002-04-07 Akim Demaille <akim@epita.fr>
280
281 Rename all the `bucket's as `symbol_t'.
282
283 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
284 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
285 * src/symtab.c, src/symtab.h (bucket): Rename as...
286 (symbol_t): this.
287 (symbol_list_new, bucket_check_defined, bucket_make_alias)
288 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
289 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
290 (buckets_new, buckets_free, buckets_do): Rename as...
291 (symbol_list_new, symbol_check_defined, symbol_make_alias)
292 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
293 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
294 (symbols_new, symbols_free, symbols_do): these.
295
72a23c97
AD
2962002-04-07 Akim Demaille <akim@epita.fr>
297
298 Use lib/hash for the symbol table.
299
300 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
301 EOF.
302 * src/lex.c (lex): Set the `number' member of new terminals.
303 * src/reader.c (bucket_check_defined, bucket_make_alias)
304 (bucket_check_alias_consistence, bucket_translation): New.
305 (reader, grammar_free, readgram, token_translations_init)
306 (packsymbols): Adjust.
307 (reader): Number the predefined tokens.
308 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
309 for predefined tokens.
310 * src/symtab.h (bucket): Remove all the hash table related
311 members.
312 * src/symtab.c (symtab): Replace by...
313 (bucket_table): this.
314 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
315 (buckets_new, buckets_do): New.
316
280a38c3
AD
3172002-04-07 Akim Demaille <akim@epita.fr>
318
319 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
320 (start_symbol, max_user_token_number, semantic_parser)
321 (error_token_number): Initialize.
322 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
323 Initialize.
324 (reader): Don't.
325 (errtoken, eoftoken, undeftoken, axiom): Extern.
326
03b31c0c
AD
3272002-04-07 Akim Demaille <akim@epita.fr>
328
329 * src/gram.h (rule_s): prec and precsym are now pointers
330 to the bucket giving the priority/associativity.
331 Member `associativity' removed: useless.
332 * src/reduce.c, src/conflicts.c: Adjust.
333
8b3df748
AD
3342002-04-07 Akim Demaille <akim@epita.fr>
335
336 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
337 Properly escape the symbols' TAG when outputting them.
338
e601aa1d
AD
3392002-04-07 Akim Demaille <akim@epita.fr>
340
341 * src/lalr.h (LA): Is a bitsetv, not bitset*.
342
b0299a2e
AD
3432002-04-07 Akim Demaille <akim@epita.fr>
344
345 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
346 (LArule): this, which is an array to rule_t*.
347 * src/print.c, src/conflicts.c: Adjust.
348
d7e1f00c
AD
3492002-04-07 Akim Demaille <akim@epita.fr>
350
351 * src/gram.h (rule_t): Rename `number' as `user_number'.
352 `number' is a new member.
353 Adjust dependencies.
354 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
355
cc9305dd
AD
3562002-04-07 Akim Demaille <akim@epita.fr>
357
358 As a result of the previous patch, it is no longer needed
359 to reorder ritem itself.
360
361 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
362
b0940840
AD
3632002-04-07 Akim Demaille <akim@epita.fr>
364
365 Be sure never to walk through RITEMS, but use only data related to
366 the rules themselves. RITEMS should be banished.
367
368 * src/output.c (output_token_translations): Rename as...
369 (prepare_tokens): this.
370 In addition to `translate', prepare the muscles `tname' and
371 `toknum', which were handled by...
372 (output_rule_data): this.
373 Remove, and move the remainder of its outputs into...
374 (prepare_rules): this new routines, which also merges content from
375 (output_gram): this.
376 (prepare_rules): Be sure never to walk through RITEMS.
377 (output_stos): Rename as...
378 (prepare_stos): this.
379 (output): Always invoke prepare_states, after all, just don't use it
380 in the output if you don't need it.
381
643a5994
AD
3822002-04-07 Akim Demaille <akim@epita.fr>
383
384 * src/LR0.c (new_state): Display `nstates' as the name of the
385 newly created state.
386 Adjust to initialize first_state and last_state if needed.
387 Be sure to distinguish the initial from the final state.
388 (new_states): Create the itemset of the initial state, and use
389 new_state.
390 * src/closure.c (closure): Now that the initial state has its
391 items properly set, there is no need for a special case when
392 creating `ruleset'.
393
394 As a result, now the rule 0, reducing to $axiom, is visible in the
395 outputs. Adjust the test suite.
396
397 * tests/conflicts.at (Solved SR Conflicts)
398 (Unresolved SR Conflicts): Adjust.
399 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
400 * tests/conflicts.at (S/R in initial): New.
401
b4c4ccc2
AD
4022002-04-07 Akim Demaille <akim@epita.fr>
403
404 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
405 the RHS of the rules.
406 * src/output.c (output_gram): Likewise.
407
bba97eb2
AD
4082002-04-07 Akim Demaille <akim@epita.fr>
409
410 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
411 bucket.
412 Adjust all dependencies.
413 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
414 `number' of the buckets too.
415 * src/gram.h: Include `symtab.h'.
416 (associativity): Move to...
417 * src/symtab.h: here.
418 No longer include `gram.h'.
419
c3b407f4
AD
4202002-04-07 Akim Demaille <akim@epita.fr>
421
422 * src/gram.h, src/gram.c (rules_rhs_length): New.
423 (ritem_longest_rhs): Use it.
424 * src/gram.h (rule_t): `number' is a new member.
425 * src/reader.c (packgram): Set it.
426 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
427 the end of `rules', and count them out of `nrules'.
428 (reduce_output, dump_grammar): Adjust.
429 * src/print.c (print_grammar): It is no longer needed to check for
430 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
431 * tests/reduce.at (Reduced Automaton): New test.
432
11652ab3
AD
4332002-04-07 Akim Demaille <akim@epita.fr>
434
435 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
436 lacking `+ 1' to nrules, Bison reported as useless a token if it
437 was used solely to set the precedence of the last rule...
438
26b23c1a
AD
4392002-04-07 Akim Demaille <akim@epita.fr>
440
441 * data/bison.c++, data/bison.simple: Don't output the current file
442 name in #line, to avoid useless diffs between two identical
443 outputs under different names.
444
18bcecb0
AD
4452002-04-07 Akim Demaille <akim@epita.fr>
446
447 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
448 Normalize loops to using `< nrules + 1', not `<= nrules'.
449
fa770c86
AD
4502002-04-07 Akim Demaille <akim@epita.fr>
451
452 * TODO: Update.
453
d9b739c3
AD
4542002-04-07 Akim Demaille <akim@epita.fr>
455
456 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
457 bucket.value as bucket.number.
458
99013900
AD
4592002-04-07 Akim Demaille <akim@epita.fr>
460
461 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
462 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
463 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
464 RHS, instead of being an index in RITEMS.
465
e966383b
PE
4662002-04-04 Paul Eggert <eggert@twinsun.com>
467
468 * doc/bison.texinfo: Update copyright date.
469 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
470 (Symbols): Warn about running Bison in one character set,
471 but compiling and/or running in an incompatible one.
472 Warn about character code 256, too.
473
4742002-04-03 Paul Eggert <eggert@twinsun.com>
475
476 * src/bison.data (YYSTACK_ALLOC): Depend on whether
477 YYERROR_VERBOSE is nonzero, not whether it is defined.
478
479 Merge changes from bison-1_29-branch.
c307773e 480
8d6c48b9
PE
4812002-03-20 Paul Eggert <eggert@twinsun.com>
482
483 Merge fixes from Debian bison_1.34-1.diff.
484
485 * configure.in (AC_PREREQ): 2.53.
486
e53c6322
AD
4872002-03-20 Akim Demaille <akim@epita.fr>
488
489 * src/conflicts.c (log_resolution): Argument `resolution' is const.
490
9ffbeca7
PE
4912002-03-19 Paul Eggert <eggert@twinsun.com>
492
21db0b2a
PE
493 * src/bison.simple (YYCOPY): New macro.
494 (YYSTACK_RELOCATE): Use it.
495 Remove Type arg; no longer needed. All callers changed.
496 (yymemcpy): Remove; no longer needed.
497
9ffbeca7
PE
498 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
499 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
500
642cb8f8
AD
5012002-03-19 Akim Demaille <akim@epita.fr>
502
503 Test and fix the #line outputs.
504
505 * tests/atlocal.at (GCC): New.
506 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
507 (Prologue synch line, ,%union synch line, Postprologue synch line)
508 (Action synch line, Epilogue synch line): New tests.
509 * src/reader.c (parse_union_decl): Define the muscle stype_line.
510 * data/bison.simple, data/bison.c++: Use it.
511
3c31a486
AD
5122002-03-19 Akim Demaille <akim@epita.fr>
513
514 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
515 (Solved SR Conflicts, %expect not enough, %expect right)
516 (%expect too much): Move to...
517 * tests/conflicts.at: this new file.
518
0d8bed56
AD
5192002-03-19 Akim Demaille <akim@epita.fr>
520
521 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
522 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
523 that we can move to enums for instance.
524 * src/output.c (token_definitions_output): Output a list of
525 `token-name, token-number' instead of the #define.
526 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
527
9208d17f
AD
5282002-03-14 Akim Demaille <akim@epita.fr>
529
530 Use Gettext 0.11.1.
531
af27eacb
RA
5322002-03-09 Robert Anisko <robert@lrde.epita.fr>
533
534 * data/bison.c++: Make the user able to add members to the generated
535 parser by subclassing.
536
9101a310
RA
5372002-03-05 Robert Anisko <robert@lrde.epita.fr>
538
539 * src/reader.c (read_additionnal_code): `c' should be an integer, not
540 a character.
541 Reported by Nicolas Tisserand and Nicolas Burrus.
542
fff9bf0b
RA
5432002-03-04 Robert Anisko <robert@lrde.epita.fr>
544
545 * src/reader.c: Warn about lacking semi-colons, do not complain.
546
64dba31e
RA
5472002-03-04 Robert Anisko <robert@lrde.epita.fr>
548
549 * data/bison.c++: Remove a debug line.
550
374f5a14
RA
5512002-03-04 Robert Anisko <robert@lrde.epita.fr>
552
553 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
554 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
555 provide a default implementation.
556
bfcf1f3a
AD
5572002-03-04 Akim Demaille <akim@epita.fr>
558
559 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
560 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
561 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
562 * tests/semantic.at (Parsing Guards): Similarly.
563 * src/reader.at (readgram): Complain if the last rule is not ended
564 with a semi-colon.
565
65ccf9fc
AD
5662002-03-04 Akim Demaille <akim@epita.fr>
567
568 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
569 * src/closure.c: here.
570 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
571 RTC.
572 * src/warshall.h, src/warshall.c: Remove.
573 * tests/sets.at (Broken Closure): Adjust.
574
d0039cbc
AD
5752002-03-04 Akim Demaille <akim@epita.fr>
576
577 * src/output.c (output_skeleton): tempdir is const.
578 bytes_read is unused.
579
345cea78
AD
5802002-03-04 Akim Demaille <akim@epita.fr>
581
582 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
583 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
584 Update.
585 From Michael Hayes.
586
564801f7
AD
5872002-03-04 Akim Demaille <akim@epita.fr>
588
589 * src/closure.c (closure): `r' is unused.
590
e5352bc7
AD
5912002-03-04 Akim Demaille <akim@epita.fr>
592
593 * tests/sets.at (Broken Closure): Add the ending `;'.
594 * src/reader.at (readgram): Complain if a rule is not ended with a
595 semi-colon.
596
914feea9
AD
5972002-03-04 Akim Demaille <akim@epita.fr>
598
599 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
600 (count_sr_conflicts): Use bitset_count.
601 * src/reduce.c (inaccessable_symbols): Ditto.
602 (bits_size): Remove.
603 * src/warshall.h, src/warshall.c: Convert to bitsetv.
604
f0250de6
AD
6052002-03-04 Akim Demaille <akim@epita.fr>
606
607 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
608 * src/reduce.c: Remove the `bitset_zero's following the
609 `bitset_create's, as now it is performed by the latter.
610
ef017502
AD
6112002-03-04 Akim Demaille <akim@epita.fr>
612
613 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
614 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
615 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
616 latest sources from Michael.
617
76514394
AD
6182002-03-04 Akim Demaille <akim@epita.fr>
619
620 * src/output.c (output): Don't free the grammar.
621 * src/reader.c (grammar_free): New.
622 * src/main.c (main): Call it and don't free symtab here.
623
55024580
AD
6242002-03-04 Akim Demaille <akim@epita.fr>
625
626 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
627 before returning.
628 Reported by Benoit Perrot.
629
f9abaa2c
AD
6302002-03-04 Akim Demaille <akim@epita.fr>
631
632 Use bitset operations when possible, not loops over bits.
633
634 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
635 bitset_or.
636 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
637 * src/reduce.c (useless_nonterminals): Formatting changes.
638 * src/warshall.c (TC): Use bitset_or.
639
0e721e75
AD
6402002-03-04 Akim Demaille <akim@epita.fr>
641
642 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
643 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
644 Ditto.
645
0fb1ffb1
AD
6462002-03-04 Akim Demaille <akim@epita.fr>
647
648 * src/lalr.c (F): Now a bitset*.
649 Adjust all dependencies.
650
b86796bf
AD
6512002-03-04 Akim Demaille <akim@epita.fr>
652
653 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
654 Adjust all dependencies.
655
602bbf31
AD
6562002-03-04 Akim Demaille <akim@epita.fr>
657
658 * src/L0.c, src/LR0.h (nstates): Be size_t.
659 Adjust comparisons (signed vs unsigned).
660 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
661 bitset*.
662 Adjust all dependencies.
663
d8a0245c
AD
6642002-03-04 Akim Demaille <akim@epita.fr>
665
666 * src/closure.c (firsts): Now, also a bitset.
667 Adjust all dependencies.
668 (varsetsize): Remove, now unused.
669 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
670
34ba9743
AD
6712002-03-04 Akim Demaille <akim@epita.fr>
672
673 * src/print.c: Convert to use bitset.h, not hand coded iterations
674 over ints.
675
ed86e78c
AD
6762002-03-04 Akim Demaille <akim@epita.fr>
677
678 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
679
dfdb1797
AD
6802002-03-04 Akim Demaille <akim@epita.fr>
681
682 * src/closure.c (ruleset): Be a bitset.
683 (rulesetsize): Remove.
684
7086e707
AD
6852002-03-04 Akim Demaille <akim@epita.fr>
686
687 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
688 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
689 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
690 * src/closure.c (fderives): Be an array of bitsets.
691
98254360
RA
6922002-02-28 Robert Anisko <robert@lrde.epita.fr>
693
694 * data/bison.c++: Merge the two generated headers. Insert a copyright
695 notice in each output file.
696
a75c057f
AD
6972002-02-28 Akim Demaille <akim@epita.fr>
698
699 * data/bison.c++: Copy the prologue of bison.simple to fetch
700 useful M4 definitions, such as b4_header_guard.
701
06b00abc
AD
7022002-02-25 Akim Demaille <akim@epita.fr>
703
704 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
705 translator friendly scheme for the bgr
706 copyright notice.
06b00abc 707
70e7d534
AD
7082002-02-25 Akim Demaille <akim@epita.fr>
709
710 * src/output.c (header_output): Remove, now handled completely via
711 M4.
712
abe017f6
AD
7132002-02-25 Akim Demaille <akim@epita.fr>
714
715 * m4/m4.m4: New, from CVS Autoconf.
716 * configure.in: Invoke it.
717 * src/output.c (output_skeleton): Use its result instead of the
718 hard coded name.
719
381fb12e
AD
7202002-02-25 Akim Demaille <akim@epita.fr>
721
722 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
723 Fileutils 4.1.5.
724 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
725 * src/output.c (output_skeleton): Use mkstemp to create a real
726 temporary file.
727 Move the filling of `skeleton' and its muscle to...
728 (prepare): here.
729 (output): Move the definition of the prologue muscle to...
730 (prepare): here.
731 * src/system.h (DEFAULT_TMPDIR): New.
732
6f38107f
PE
7332002-02-14 Paul Eggert <eggert@twinsun.com>
734
735 Remove the support for C++ namespace cleanliness; it was
736 causing more problems than it was curing, since it didn't work
737 properly on some nonstandard C++ compilers. This can wait
738 for a proper C++ parser.
739
740 * NEWS: Document this.
741 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
742 of C++, as it's treated like C now.
743 * src/bison.simple (YYSTD): Remove.
744 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
745 Treat C++ just like Standard C instead of trying to support
746 namespace cleanliness.
747
80cce3da
AD
7482002-02-14 Akim Demaille <akim@epita.fr>
749
750 * tests/regression.at (else): Adjust to Andreas' change.
751
842e8679
AD
7522002-02-14 Akim Demaille <akim@epita.fr>
753
754 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
755
4bda3f10
AD
7562002-02-13 Andreas Schwab <schwab@suse.de>
757
758 * src/output.c (output_rule_data): Don't output NULL, it might
759 not be defined yet.
760
4162fa07 7612002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 762
4162fa07
RA
763 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
764 (Copyright notice): Update.
b418ecd8 765
bd16a5dc
AD
7662002-02-11 Akim Demaille <akim@epita.fr>
767
768 * tests/regression.at (%nonassoc and eof): Don't include
769 nonportable headers.
770
8d69a1a3
RA
7712002-02-08 Robert Anisko <robert@lrde.epita.fr>
772
773 * data/bison.c++: Correct error recovery. Make the user able to
774 initialize the starting location.
775
9b2d0677
AD
7762002-02-07 Akim Demaille <akim@epita.fr>
777
778 * tests/input.at: New.
779
69e2658b
RA
7802002-02-07 Robert Anisko <robert@lrde.epita.fr>
781
782 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 783 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
784 directives around tables only needed for debugging.
785
4aacc3a7
RA
7862002-02-07 Robert Anisko <robert@lrde.epita.fr>
787
788 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
789 C++ parsers.
790 (yy::b4_name::parse): Use print_.
791
762a801e
RA
7922002-02-07 Robert Anisko <robert@lrde.epita.fr>
793
794 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
795
4bb2bc3f
RA
7962002-02-07 Robert Anisko <robert@lrde.epita.fr>
797
798 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
799 C++ parsers.
800 (yy::b4_name::parse): Build verbose error messages, and use error_.
801
6b45a3ca
RA
8022002-02-06 Robert Anisko <robert@lrde.epita.fr>
803
804 * data/bison.c++: Fix m4 quoting in comments.
805
50997c6e
RA
8062002-02-06 Robert Anisko <robert@lrde.epita.fr>
807
808 * data/bison.c++: Adjust the parser code. Fix some muscles that were
809 not expanded by m4.
810
3f3eed27
AD
8112002-02-05 Akim Demaille <akim@epita.fr>
812
813 * data/bison.c++: Adjust to the M4 back end.
814 More is certainly needed.
815
be2a1a68
AD
8162002-02-05 Akim Demaille <akim@epita.fr>
817
818 Give a try to M4 as a back end.
819
820 * lib/readpipe.c: New, from wdiff.
821 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
822 BISON_HAIRY.
823 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
824 specific values. Now it is m4 that performs the lookup.
825 * src/parse-skel.y: Remove.
826 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
827 * src/output.c (actions_output, guards_output)
828 (token_definitions_output): No longer keeps track of the output
829 line number, hence remove the second argument.
830 (guards_output): Check against the guard member of a rule, not the
831 action member.
832 Adjust callers.
833 (output_skeleton): Don't look for the skeleton location, let m4 do
834 that.
835 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
836 file will be used.
837 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
838 (prepare): Given that for the time being changesyntax is not
839 usable in M4, rename the muscles using `-' to `_'.
840 Define `defines_flag', `output_parser_name' and `output_header_name'.
841 * src/output.h (actions_output, guards_output)
842 (token_definitions_output): Adjust prototypes.
843 * src/scan-skel.l: Instead of scanning the skeletons, it now
844 processes the output of m4: `__oline__' and `#output'.
845 * data/bison.simple: Adjust to be used by M4(sugar).
846 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
847 to date.
848 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
849 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
850 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
851 shamelessly stolen from CVS Autoconf.
852
beda758b
AD
8532002-02-05 Akim Demaille <akim@epita.fr>
854
855 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
856 * configure.in: Check for the declarations of free and malloc.
857 * src/muscle_tab.c: Adjust.
858
5ece6d43
AD
8592002-02-05 Akim Demaille <akim@epita.fr>
860
861 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
862 which have no values.
863
5bb18f9a
AD
8642002-02-05 Akim Demaille <akim@epita.fr>
865
866 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
867 * data/: here.
868
894dd62e
PE
8692002-01-29 Paul Eggert <eggert@twinsun.com>
870
871 * src/bison.simple (YYSIZE_T): Do not define merely because
872 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
873 On some platforms, <alloca.h> does not declare YYSTD (size_t).
874
82841af7
AD
8752002-01-27 Akim Demaille <akim@epita.fr>
876
877 Fix `%nonassoc and eof'.
878
879 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
880 which were not properly copied! Replace
881 memcpy (res->errs, src->errs, src->nerrs);
882 with
883 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
884 !!!
885 * tests/regression.at (%nonassoc and eof): Adjust to newest
886 Autotest: `.' is not in the PATH.
887
318b76e9
AD
8882002-01-27 Akim Demaille <akim@epita.fr>
889
890 * tests/sets.at (AT_EXTRACT_SETS): New.
891 (Nullable): Use it.
892 (Firsts): New.
893
30d2f3d5
AD
8942002-01-26 Akim Demaille <akim@epita.fr>
895
896 * tests/actions.at, tests/calc.at, tests/headers.at,
897 * tests/torture.at: Adjust to the newest Autotest which no longer
898 forces `.' in the PATH.
899
30f8c395
AD
9002002-01-25 Akim Demaille <akim@epita.fr>
901
902 * tests/regression.at (%nonassoc and eof): New.
903 Suggested by Robert Anisko.
904
29ae55f1
AD
9052002-01-24 Akim Demaille <akim@epita.fr>
906
907 Bison dumps core when trying to complain about broken input files.
908 Reported by Cris van Pelt.
909
910 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
911 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
912 into...
913 (Invalid inputs): Strengthen: exercise parse_percent_token.
914
2b548aa6
RA
9152002-01-24 Robert Anisko <robert.anisko@epita.fr>
916
917 * src/Makefile.am: Add bison.c++.
918 * src/bison.c++: New skeleton.
919
bb0146c2
AD
9202002-01-21 Paolo Bonzini <bonzini@gnu.org>
921
922 * po/it.po: New.
923
bec30531
AD
9242002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
925
926 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
927
fc6edc45
MA
9282002-01-20 Marc Autret <marc@gnu.org>
929
930 * src/files.c (compute_output_file_names): Fix
931
5e5d5415
MA
9322002-01-20 Marc Autret <marc@gnu.org>
933
934 * tests/output.at: New test.
935 * src/files.c (compute_base_names): Don't map extensions when
936 the YACC flag is set, use defaults.
937 Reported by Evgeny Stambulchik.
938
44ea3fbd
MA
9392002-01-20 Marc Autret <marc@gnu.org>
940
bb0146c2 941 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
942 compilers as well (i.e. the vendor C compiler).
943 Suggested by Albert Chin-A-Young.
944
338963d1
TVH
9452002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
946
947 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
948 canonical definition.
949 * src/system.h: Use the canonical definition for PARAMS (avoids
950 a conflict with the macro from lib/hash.h).
951
c57b2479
AD
9522002-01-11 Akim Demaille <akim@epita.fr>
953
954 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 955 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 956
b85810ae
AD
9572002-01-09 Akim Demaille <akim@epita.fr>
958
959 * src/files.c, src/files.h (output_infix): New.
960 (tab_extension): Remove.
961 (compute_base_names): Compute the former, drop the latter.
962 * src/output.c (prepare): Insert the muscles `output-infix', and
963 `output-suffix'.
964 * src/parse-skel.y (string, string.1): New.
965 (section.header): Use it.
966 (section.yacc): Remove.
967 (prefix): Remove too.
968 * src/scan-skel.l: Adjust.
969 * src/bison.simple, src/bison.hairy: Adjust.
970
cae60122
AD
9712002-01-09 Akim Demaille <akim@epita.fr>
972
973 * configure.in (WERROR_CFLAGS): Compute it.
974 * src/Makefile.am (CFLAGS): Pass it.
975 * tests/atlocal.in (CFLAGS): Idem.
976 * src/files.c: Fix a few warnings.
977 (get_extension_index): Remove, unused.
978
ae404801
AD
9792002-01-08 Akim Demaille <akim@epita.fr>
980
981 * src/getargs.c (AS_FILE_NAME): New.
982 (getargs): Use it to convert DOSish file names.
983 * src/files.c (base_name): Rename as full_base_name to avoid
984 clashes with `base_name ()'.
985 (filename_split): New.
986 (compute_base_names): N-th rewrite, using filename_split.
987
22312b71
AD
9882002-01-08 Akim Demaille <akim@epita.fr>
989
990 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
991 New, stolen from the Fileutils 4.1.
992 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
993 * configure.in: Check for the presence of memrchr, and of its
994 prototype.
995
a67cef01
TVH
9962002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
997
998 * lib/hash.h (__P): Added definition for this macro.
999 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1000 BUILT_SOURCES, to ensure they are generated first.
1001 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1002 %error-verbose to allow bootstrapping with bison 1.30x.
1003
2b25d624
AD
10042002-01-06 Akim Demaille <akim@epita.fr>
1005
1006 * src/reader.c (parse_braces): Don't fetch the next char, the
1007 convention is to fetch on entry.
1008 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1009 'switch' without a following semicolon.
1010 * tests/regression.at (braces parsing): New.
1011
3460813b
AD
10122002-01-06 Akim Demaille <akim@epita.fr>
1013
1014 Bison is dead wrong in its RR conflict reports.
1015
1016 * tests/torture.at (GNU Cim Grammar): New.
1017 * src/conflicts.c (count_rr_conflicts): Fix.
1018
73784c64
AD
10192002-01-06 Akim Demaille <akim@epita.fr>
1020
1021 Creating package.m4 from configure.ac causes too many problems.
1022
1023 * tests/Makefile.am (package.m4): Create it by hand,
1024 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1025
25d81090
AD
10262002-01-06 Akim Demaille <akim@epita.fr>
1027
1028 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1029 skeleton.h.
1030
a9b8959e
PE
10312002-01-04 Paul Eggert <eggert@twinsun.com>
1032
1033 * doc/bison.texinfo (Debugging):
1034 Remove YYSTDERR; it's no longer defined or used.
1035 Also, s/cstdio.h/cstdio/.
1036
25d81090
AD
10372002-01-03 Akim Demaille <akim@epita.fr>
1038
1039 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1040
1109455c
AD
10412002-01-03 Akim Demaille <akim@epita.fr>
1042
1043 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1044 tracing code to --trace, wait for a better --trace option, with
1045 args.
1046
7ea5e977
AD
10472002-01-03 Akim Demaille <akim@epita.fr>
1048
1049 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1050 The ISO C++ standard is extremely clear about it: stderr is
1051 considered a macro, not a regular symbol (see table 94 `Header
1052 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1053 Therefore std:: does not apply to it. It still does with fprintf.
1054 Also, s/cstdio.h/cstdio/.
1055
fab5b110
AD
10562002-01-03 Akim Demaille <akim@epita.fr>
1057
1058 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1059 for non system headers.
1060
aed7fd9b
AD
10612002-01-02 Akim Demaille <akim@epita.fr>
1062
1063 Equip the skeleton chain with location tracking, runtime trace,
1064 pure parser and scanner.
1065
1066 * src/parse-skel.y: Request a pure parser, locations, and prefix
1067 renaming.
1068 (%union): Having several members with the same type does not help
1069 type mismatches, simplify.
1070 (YYPRINT, yyprint): New.
1071 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1072 (skel_error): this.
1073 Handle locations.
1074 * src/scan-skel.l: Adjust to these changes.
1075 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1076 (LOCATION_PRINT, skel_control_t): New.
1077
24fad99e
AD
10782001-12-30 Akim Demaille <akim@epita.fr>
1079
1080 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1081 replace `gb' with BLANKS.
1082 * src/scan-skel.l: Adjust.
1083
a4b36db4
AD
10842001-12-30 Akim Demaille <akim@epita.fr>
1085
1086 * src/system.h: We don't need nor want bcopy.
1087 Throw away MS-DOS crap: we don't need getpid.
1088 * configure.in: We don't need strndup. It was even causing
1089 problems: because Flex includes the headers *before* us,
1090 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1091 not visible.
1092 * lib/xstrndup.c: New.
1093 * src/scan-skel.l: Use it.
1094 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1095 * src/parse-skel.y: Use %directives instead of #defines.
1096
1239777d
AD
10972001-12-30 Akim Demaille <akim@epita.fr>
1098
1099 * src/skeleton.h: New.
1100 * src/output.c (output_parser, output_master_parser): Remove, dead
1101 code.
1102 * src/output.h (get_lines_number, actions_output, guards_output)
1103 (token_definitions_output): Prototype them.
1104 * src/parse-skel.y: Add the license notice.
1105 Include output.h and skeleton.h.
1106 (process_skeleton): Returns void, and takes a single parameter.
1107 * src/scan-skel.l: Add the license notice.
1108 Include skeleton.h.
1109 Don't use %option yylineno: it seems that then Flex imagines
1110 REJECT has been used, and therefore it won't reallocate its
1111 buffers (which makes no other sense to me than a bug). It results
1112 in warnings for `unused: yy_flex_realloc'.
1113
9b3add5b
RA
11142001-12-30 Robert Anisko <robert.anisko@epita.fr>
1115
1116 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1117 (MUSCLE_INSERT_PREFIX): ...to there.
1118 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1119 (MUSCLE_INSERT_PREFIX): Move from here...
1120
1121 * src/bison.hairy: Add a section directive. Put braces around muscle
1122 names. This parser skeleton is still broken, but Bison should not
1123 choke on a bad muscle 'syntax'.
1124 * src/bison.simple: Add a section directive. Put braces around muscle
1125 names.
1126
1127 * src/files.h (strsuffix, stringappend): Add declarations.
1128 (tab_extension): Add declaration.
1129 (short_base_name): Add declaration.
1130
1131 * src/files.c (strsuffix, stringappend): No longer static. These
1132 functions are used in the skeleton parser.
1133 (tab_extension): New.
1134 (compute_base_names): Use the computations done in this function
fab5b110 1135 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
1136 names.
1137 (short_base_name): No longer static.
1138
1139 * src/output.c (output_skeleton): New.
1140 (output): Disable call to output_master_parser, and give a try to
1141 a new skeleton handling system.
1142 (guards_output, actions_output): No longer static.
1143 (token_definitions_output, get_lines_number): No longer static.
1144
1145 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1146
fab5b110 1147 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
1148 parse-skel.y.
1149
1150 * src/parse-skel.y: New file.
1151 * src/scan-skel.l: New file.
1152
b5b61c61
AD
11532001-12-29 Akim Demaille <akim@epita.fr>
1154
1155 %name-prefix is broken.
1156
1157 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1158 Adjust all dependencies.
1159 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1160 %name-prefix.
1161
1162 Renaming yylval but not yylloc is not consistent. Now we do.
1163
1164 * src/bison.simple: Prefix yylloc if used.
1165 * doc/bison.texinfo (Decl Summary): Document that.
1166
8c9a50be
AD
11672001-12-29 Akim Demaille <akim@epita.fr>
1168
1169 * doc/bison.texinfo: Promote `%long-directive' over
1170 `%long_directive'.
1171 Remove all references to fixed-output-files, yacc is enough.
1172
d99361e6
AD
11732001-12-29 Akim Demaille <akim@epita.fr>
1174
1175 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1176 user prologue. These are defaults.
1177 * tests/actions.at (Mid-rule actions): Make sure the user can
1178 define YYDEBUG and YYERROR_VERBOSE.
1179
b9cecb91
AD
11802001-12-29 Akim Demaille <akim@epita.fr>
1181
1182 * src/output.c (header_output): Don't forget to export YYLTYPE and
1183 yylloc.
1184 * tests/headers.at (export YYLTYPE): New, make sure it does.
1185 * tests/regression.at (%union and --defines, Invalid CPP headers):
1186 Move to...
1187 * tests/headers.at: here.
1188
aea13e97
AD
11892001-12-29 Akim Demaille <akim@epita.fr>
1190
1191 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1192
931394cb
AD
11932001-12-29 Akim Demaille <akim@epita.fr>
1194
1195 * tests/actions.at (Mid-rule actions): Output on a single line
1196 instead of several.
1197
704a47c4
AD
11982001-12-29 Akim Demaille <akim@epita.fr>
1199
1200 * doc/bison.texinfo: Formatting changes.
1201
091e20bb
AD
12022001-12-29 Akim Demaille <akim@epita.fr>
1203
1204 Don't store the token defs in a muscle, just be ready to output it
1205 on command. Now possible via `symbols'. Fixes a memory leak.
1206
1207 * src/output.c (token_definitions_output): New.
1208 (output_parser, header_output): Use it.
1209 * src/reader.c (symbols_save): Remove.
1210
cce71710
AD
12112001-12-29 Akim Demaille <akim@epita.fr>
1212
1213 * src/bison.simple: Do not provide a default for YYSTYPE and
1214 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1215 default.
1216
82c035a8
AD
12172001-12-29 Akim Demaille <akim@epita.fr>
1218
1219 Mid-rule actions are simply... ignored!
1220
1221 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1222 the empty-rule associated to the dummy symbol, not to the host
1223 rule.
1224 * tests/actions.at (Mid-rule actions): New.
1225
8419d367
AD
12262001-12-29 Akim Demaille <akim@epita.fr>
1227
1228 Memory leak.
1229
1230 * src/reader.c (reader): Free grammar.
1231
375d5806
AD
12322001-12-29 Akim Demaille <akim@epita.fr>
1233
1234 Memory leak.
1235
1236 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1237 since it allocates it for each state, although only one is needed.
1238 (allocate_storage): Do it here.
1239
f51cb8ff
AD
12402001-12-29 Akim Demaille <akim@epita.fr>
1241
1242 * src/options.h, src/options.c (create_long_option_table): Rename
1243 as...
1244 (long_option_table_new): this, with a clearer prototype.
1245 (percent_table): Remove, unused,
1246 * src/getargs.c (getargs): Adjust.
1247
29e88316
AD
12482001-12-29 Akim Demaille <akim@epita.fr>
1249
1250 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1251 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1252 as states.
1253
b9f71f19
AD
12542001-12-29 Akim Demaille <akim@epita.fr>
1255
1256 * src/lalr.c (build_relations): Rename `states' as `states1'.
1257 Sorry, I don't understand exactly what it is, no better name...
1258
1a2b5d37
AD
12592001-12-29 Akim Demaille <akim@epita.fr>
1260
1261 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1262 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1263 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1264 as rules.
1265
1cca533e
AD
12662001-12-29 Akim Demaille <akim@epita.fr>
1267
1268 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1269 ago.
1270
c03ae966
AD
12712001-12-29 Akim Demaille <akim@epita.fr>
1272
1273 * src/reader.c, src/reader.h (user_toknums): Remove.
1274 Adjust all users to use symbols[i]->user_token_number.
1275
5a670b1e
AD
12762001-12-29 Akim Demaille <akim@epita.fr>
1277
1278 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1279 Adjust all users to use symbols[i]->prec or ->assoc.
1280
ad949da9
AD
12812001-12-29 Akim Demaille <akim@epita.fr>
1282
1283 * src/reader.c, src/reader.h (tags): Remove.
1284 Adjust all users to use symbols[i]->tag.
1285
0e78e603
AD
12862001-12-29 Akim Demaille <akim@epita.fr>
1287
1288 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1289 and rule_table.
1290 * src/reader.c (packsymbols): Fill this table.
1291 Drop sprec.
1292 * src/conflicts.c (resolve_sr_conflict): Adjust.
1293 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1294 single table.
1295 Use symbols[i]->tag instead of tags[i].
1296
213e640e
AD
12972001-12-29 Akim Demaille <akim@epita.fr>
1298
1299 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1300 In addition, put a comment in there, to replace...
1301 * tests/regression.at (%union and C comments): Remove.
1302
e7b8bef1
AD
13032001-12-29 Akim Demaille <akim@epita.fr>
1304
1305 * tests/regression.at (Web2c Actions): Blindly move the actual
1306 output as expected output. The contents *seem* right to me, but I
1307 can't pretend reading perfectly parser tables... Nonetheless, all
1308 the other tests pass correctly, the table look OK, even though the
1309 presence of `$axiom' is to be noted: AFAICS it is useless (but
1310 harmless).
1311
b68e7744
AD
13122001-12-29 Akim Demaille <akim@epita.fr>
1313
1314 * src/reader.c (readgram): Don't add the rule 0 if there were no
1315 rules read. In other words, add it _after_ having performed
1316 grammar sanity checks.
1317 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1318
78d5bae9
AD
13192001-12-29 Akim Demaille <akim@epita.fr>
1320
1321 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1322 visible, and some states have now a different number.
1323
ff442794
AD
13242001-12-29 Akim Demaille <akim@epita.fr>
1325
1326 * src/reader.c (readgram): Bind the initial rule's lineno to that
1327 of the first rule.
1328 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1329 (Solved SR Conflicts): Adjust rule 0's line number.
1330
610ab194
AD
13312001-12-29 Akim Demaille <akim@epita.fr>
1332
1333 Fix the `GAWK Grammar' failure.
1334
1335 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1336 the reductions of the first state which was mistakenly confused
1337 with the final state because precisely final_state was initialized
1338 to 0.
1339 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1340 now noticed by Bison.
1341 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1342 have a reduction on $default.
1343
29d29c8f
AD
13442001-12-29 Akim Demaille <akim@epita.fr>
1345
1346 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1347 rule line numbers.
1348 * src/closure.c (print_closure): Likewise.
1349 * src/derives.c (print_derives): Likewise.
1350 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1351 now.
1352
7c6b64d0
AD
13532001-12-29 Akim Demaille <akim@epita.fr>
1354
1355 * src/lalr.c (lookaheads_print): New.
1356 (lalr): Call it when --trace-flag.
1357 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1358 are dumped.
1359
3d4daee3
AD
13602001-12-29 Akim Demaille <akim@epita.fr>
1361
1362 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1363 when walking through ritem, even via rule->rhs.
1364 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1365 (useful_production, useless_nonterminals): Likewise.
1366 (reduce_grammar_tables): Likewise, plus update nritems.
1367 * src/nullable.c (set_nullable): Likewise.
1368 * src/lalr.c (build_relations): Likewise.
1369 * tests/sets.at (Nullable): Adjust.
1370 Fortunately, now, the $axiom is no longer nullable.
1371
9e7f6bbd
AD
13722001-12-29 Akim Demaille <akim@epita.fr>
1373
1374 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1375 the 0-sentinel.
1376 * src/gram.c (ritem_longest_rhs): Likewise.
1377 * src/reduce.c (nonterminals_reduce): Likewise.
1378 * src/print_graph.c (print_graph): Likewise.
1379 * src/output.c (output_rule_data): Likewise.
1380 * src/nullable.c (set_nullable): Likewise.
1381
255ef638
AD
13822001-12-29 Akim Demaille <akim@epita.fr>
1383
1384 * src/output.c: Comment changes.
1385
0d8a7363
AD
13862001-12-27 Paul Eggert <eggert@twinsun.com>
1387
1388 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1389 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1390 Sparc, as they were causing more porting problems than the
1391 (minor) performance improvement was worth.
1392
1393 Also, catch up with 1.31's YYSTD.
1394
3db472b9
AD
13952001-12-27 Akim Demaille <akim@epita.fr>
1396
1397 * src/output.c (output_gram): Rely on nritems, not the
1398 0-sentinel. See below.
1399 Use -1 as separator, not 0.
1400 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1401 Rely on -1 as separator in yyrhs, instead of 0.
1402 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1403 twice `Now at end of input', therefore there are two lines less to
1404 expect.
1405
b365aa05
AD
14062001-12-27 Akim Demaille <akim@epita.fr>
1407
1408 * tests/regression.at (Unresolved SR Conflicts):
1409 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1410 below.
1411
30171f79
AD
14122001-12-27 Akim Demaille <akim@epita.fr>
1413
1414 * src/LR0.c (new_state): Recognize the final state by the fact it
1415 is reached by eoftoken.
1416 (insert_start_shifting_state, insert_eof_shifting_state)
1417 (insert_accepting_state, augment_automaton): Remove, since now
1418 these states are automatically computed from the initial state.
1419 (generate_states): Adjust.
1420 * src/print.c: When reporting a rule number to the user, substract
1421 1, so that the axiom rule is rule 0, and the first user rule is 1.
1422 * src/reduce.c: Likewise.
1423 * src/print_graph.c (print_core): For the time being, just as for
1424 the report, depend upon --trace-flags to dump the full set of
1425 items.
1426 * src/reader.c (readgram): Once the grammar read, insert the rule
1427 0: `$axiom: START-SYMBOL $'.
1428 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1429 number of the states has changed (the final state is no longer
1430 necessarily the last), catch up.
1431
75142d45
AD
14322001-12-27 Akim Demaille <akim@epita.fr>
1433
1434 Try to make the use of the eoftoken valid. Given that its value
1435 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1436 is used instead of > 0 where appropriate, (ii), depend upon nritems
1437 instead of the 0-sentinel.
1438
1439 * src/gram.h, src/gram.c (nritems): New.
1440 Expected to be duplication of nitems, but for the time being...
1441 * src/reader.c (packgram): Assert nritems and nitems are equal.
1442 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1443 * src/closure.c (print_closure, print_fderives): Likewise.
1444 * src/gram.c (ritem_print): Likewise.
1445 * src/print.c (print_core, print_grammar): Likewise.
1446 * src/print_graph.c: Likewise.
1447
b7c49edf
AD
14482001-12-27 Akim Demaille <akim@epita.fr>
1449
1450 * src/main.c (main): If there are complains after grammar
1451 reductions, then output the report anyway if requested, then die.
1452 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1453 * src/reader.c (eoftoken): New.
1454 (parse_token_decl): If the token being defined has value `0', it
1455 is the eoftoken.
1456 (packsymbols): No longer hack `tags' to insert `$' by hand.
1457 Be sure to preserve the value of the eoftoken.
1458 (reader): Make sure eoftoken is defined.
1459 Initialize nsyms to 0: now eoftoken is created just like the others.
1460 * src/print.c (print_grammar): Don't special case the eof token.
1461 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1462 lie anyway, albeit pleasant.
1463 * tests/calc.at: Exercise error messages with eoftoken.
1464 Change the grammar so that empty input is invalid.
1465 Adjust expectations.
1466 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1467
ec2da99f
AD
14682001-12-27 Akim Demaille <akim@epita.fr>
1469
1470 * configure.in: Check the protos of strchr ans strspn.
1471 Replace strchr if needed.
1472 * src/system.h: Provide the protos of strchr, strspn and memchr if
1473 missing.
1474 * lib/strchr.c: New.
1475 * src/reader.c (symbols_save): Use strchr.
1476
8adfa272
AD
14772001-12-27 Akim Demaille <akim@epita.fr>
1478
1479 * src/print.c, src/print_graph.c (escape): New.
1480 Use it to quote the TAGS outputs.
1481 * src/print_graph.c (print_state): Now errors are in red, and
1482 reductions in green.
1483 Prefer high to wide: output the state number on a line of its own.
1484
80dac38c
AD
14852001-12-27 Akim Demaille <akim@epita.fr>
1486
1487 * src/state.h, src/state.c (reductions_new): New.
1488 * src/LR0.c (set_state_table): Let all the states have a
1489 `reductions', even if reduced to 0.
1490 (save_reductions): Adjust.
1491 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1492 * src/print.c (print_reductions, print_actions): Adjust.
1493 * src/output.c (action_row): Adjust.
1494
2cec70b9
AD
14952001-12-27 Akim Demaille <akim@epita.fr>
1496
1497 * src/state.h, src/state.c (errs_new, errs_dup): New.
1498 * src/LR0.c (set_state_table): Let all the states have an errs,
1499 even if reduced to 0.
1500 * src/print.c (print_errs, print_reductions): Adjust.
1501 * src/output.c (output_actions, action_row): Adjust.
1502 * src/conflicts.c (resolve_sr_conflict): Adjust.
1503
13ca549a
AD
15042001-12-27 Akim Demaille <akim@epita.fr>
1505
1506 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1507
5092aba5
AD
15082001-12-27 Akim Demaille <akim@epita.fr>
1509
1510 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1511 * src/print.c: here.
1512 (lookaheadset, shiftset): New, used as additional storage by
1513 print_reductions.
1514 (print_results): Adjust.
1515 (print_shifts, print_gotos, print_errs): New, extracted from...
1516 (print_actions): here.
1517 * src/print_graph.c (print_actions): Remove dead code.
1518
11e2beca
AD
15192001-12-27 Akim Demaille <akim@epita.fr>
1520
1521 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1522 `$n' and `@n'.
1523
dac3c910
AD
15242001-12-27 Akim Demaille <akim@epita.fr>
1525
1526 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1527 (build_relations): Adjust.
1528
d0b0fefa
AD
15292001-12-27 Akim Demaille <akim@epita.fr>
1530
1531 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1532 duplication.
1533
adc8c848
AD
15342001-12-27 Akim Demaille <akim@epita.fr>
1535
1536 * src/reader.c (packgram): Catch nitems overflows.
1537
14d293ac
AD
15382001-12-27 Akim Demaille <akim@epita.fr>
1539
1540 * src/files.c, src/files.h (guard_obstack): Remove.
1541 * src/output.c (output): Adjust.
1542 * src/reader.c (parse_braces): New, factoring...
1543 (copy_action, copy_guard): these two which are renamed as...
1544 (parse_action, parse_guard): these.
1545 As a voluntary consequence, using braces around guards is now
1546 mandatory.
1547
f499b062
AD
15482001-12-27 Akim Demaille <akim@epita.fr>
1549
1550 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1551 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1552 members.
1553 (symbol_list_new): Adjust.
1554 (copy_action): action_line is the first line, not the last.
1555 (copy_guard): Just as for actions, store the `action' only, not
1556 the switch/case/break flesh.
1557 Don't parse the user action that might follow the guard, let...
1558 (readgram): do it, i.e., now, there can be an action after a
1559 guard.
1560 In other words the guard is just explicitly optional.
1561 (packgram): Adjust.
1562 * src/output.c (guards_output): New.
1563 (output_parser): Call it when needed.
1564 (output): Also free the guard and attrs obstacks.
1565 * src/files.c, src/files.h (obstack_save): Remove.
1566 (output_files): Remove.
1567 As a result, if one needs the former `.act' file, using an
1568 appropriate skeleton which requires actions and guards is now
1569 required.
1570 * src/main.c (main): Adjust.
1571 * tests/semantic.at: New.
1572 * tests/regression.at: Use `input.y' as input file name.
1573 Avoid 8+3 problems by requiring input.c when the test needs the
1574 parser.
1575
d945f5cd
AD
15762001-12-27 Akim Demaille <akim@epita.fr>
1577
1578 * src/reader.c (symbol_list_new): Be sure to initialize all the
1579 fields.
1580
d200e455
AD
15812001-12-27 Akim Demaille <akim@epita.fr>
1582
1583 All the hacks using a final pseudo state are now useless.
1584
1585 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1586 * src/lalr.c (nLA): New.
1587 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1588 instead of lookaheadsp from the pseudo state (nstate + 1).
1589
f9507c28
AD
15902001-12-27 Akim Demaille <akim@epita.fr>
1591
1592 * src/output.c (action_row, token_actions): Use a state_t instead
1593 of a integer, and nlookaheads instead of the following state's
1594 lookaheadsp.
1595
065fbd27
AD
15962001-12-27 Akim Demaille <akim@epita.fr>
1597
1598 * src/conflicts.c (log_resolution, flush_shift)
1599 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1600 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1601 (conflicts_print, print_reductions): Use a state_t instead of an
1602 integer when referring to a state.
1603 As much as possible, depend upon nlookaheads, instead of the
1604 `lookaheadsp' member of the following state (since lookaheads of
1605 successive states are successive, the difference between state n + 1
1606 and n served as the number of lookaheads for state n).
1607 * src/lalr.c (add_lookback_edge): Likewise.
1608 * src/print.c (print_core, print_actions, print_state)
1609 (print_results): Likewise.
1610 * src/print_graph.c (print_core, print_actions, print_state)
1611 (print_graph): Likewise.
1612 * src/conflicts.h: Adjust.
1613
1b177bd7
AD
16142001-12-27 Akim Demaille <akim@epita.fr>
1615
1616 * src/bison.hairy: Formatting/comment changes.
1617 ANSIfy.
1618 Remove `register' indications.
1619 Add plenty of `static'.
1620
7742ddeb
AD
16212001-12-27 Akim Demaille <akim@epita.fr>
1622
1623 * src/output.c (prepare): Drop the muscle `ntbase' which
1624 duplicates ntokens.
1625 * src/bison.simple: Formatting/comment changes.
1626 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1627 is an undocumented synonym.
1628
1fa14068
AD
16292001-12-22 Akim Demaille <akim@epita.fr>
1630
1631 * src/output.c (output_table_data): Change the prototype to use
1632 `int' for array ranges: some invocations do pass an int, not a
1633 short.
1634 Reported by Wayne Green.
1635
b9752825
AD
16362001-12-22 Akim Demaille <akim@epita.fr>
1637
1638 Some actions of web2c.y are improperly triggered.
1639 Reported by Mike Castle.
1640
1641 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1642 * tests/regression.at (Web2c): Rename as...
1643 (Web2c Report): this.
1644 (Web2c Actions): New.
1645
776209d6
AD
16462001-12-22 Akim Demaille <akim@epita.fr>
1647
1648 Reductions in web2c.y are improperly reported.
1649 Reported by Mike Castle.
1650
1651 * src/conflicts.c (print_reductions): Fix.
1652 * tests/regression.at (Web2c): New.
1653
275fc3ad
AD
16542001-12-18 Akim Demaille <akim@epita.fr>
1655
1656 Some host fail on `assert (!"foo")', which expands to
1657 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1658 Reported by Nelson Beebee.
1659
1660 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1661 `#define it_succeeded 0' and `assert (it_succeeded)'.
1662
897668ee
MA
16632001-12-17 Marc Autret <autret_m@epita.fr>
1664
1665 * src/bison.simple: Don't hard code the skeleton line and filename.
1666 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1667 New line counter 'skeleton_line' (skeleton-line muscle).
1668
ab3399e0
PE
16692001-12-17 Paul Eggert <eggert@twinsun.com>
1670
1671 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1672 YYDEBUG must be defined to a nonzero value.
1673
1674 * src/bison.simple (yytname): Do not assume that the user defines
1675 YYDEBUG to a properly parenthesized expression.
1676
3877f72b
AD
16772001-12-17 Akim Demaille <akim@epita.fr>
1678
1679 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1680 nlookaheads is a new member.
1681 Adjust all users.
1682 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1683 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1684 state.
776209d6 1685
331dbc1b
AD
16862001-12-17 Akim Demaille <akim@epita.fr>
1687
1688 * src/files.h, src/files.c (open_files, close_files): Remove.
1689 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1690 let...
1691 * src/reader.c (reader): Do it.
776209d6 1692
be750e4c
AD
16932001-12-17 Akim Demaille <akim@epita.fr>
1694
1695 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 1696
709ae8c6
AD
16972001-12-17 Akim Demaille <akim@epita.fr>
1698
1699 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1700 (flush_reduce): New.
1701 (resolve_sr_conflict): Adjust.
776209d6 1702
f87685c3
AD
17032001-12-17 Akim Demaille <akim@epita.fr>
1704
1705 * src/output.c (output_obstack): Be static and rename as...
1706 (format_obstack): this, to avoid any confusion with files.c's
1707 output_obstack.
1708 * src/reader.h (muscle_obstack): Move to...
1709 * src/output.h: here, since it's defined in output.c.
1710
837491d8
AD
17112001-12-17 Akim Demaille <akim@epita.fr>
1712
1713 * src/output.c (action_row, save_column, default_goto)
1714 (sort_actions, matching_state, pack_vector): Better variable
1715 locality.
1716
796d61fb
AD
17172001-12-17 Akim Demaille <akim@epita.fr>
1718
1719 * src/output.c: Various formatting changes.
776209d6 1720
64d15509
AD
17212001-12-17 Akim Demaille <akim@epita.fr>
1722
1723 * src/files.c (output_files): Free the output_obstack.
1724 * src/main.c (main): Call print and print_graph conditionally.
1725 * src/print.c (print): Work unconditionally.
1726 * src/print_graph.c (print_graph): Work unconditionally.
1727 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1728
fbc8ecb7
MA
17292001-12-16 Marc Autret <autret_m@epita.fr>
1730
1731 * src/output.c (actions_output): Fix. When we use %no-lines,
1732 there is one less line per action.
1733
f0440388
MA
17342001-12-16 Marc Autret <autret_m@epita.fr>
1735
1736 * src/bison.simple: Remove a useless #line directive.
1737 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1738 * src/output.c (get_lines_number): New.
776209d6 1739 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
1740 output muscles.
1741 Fix line numbering.
1742 (actions_output): Computes the number of lines taken by actions.
1743 (output_master_parser): Insert new skeleton which is the name of
1744 the output parser file name.
1745
a79986b8
MA
17462001-12-15 Marc Autret <autret_m@epita.fr>
1747
1748 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1749
4ec8e00f
MA
17502001-12-15 Marc Autret <autret_m@epita.fr>
1751
1752 * src/output.c (output_gram): Keep track of the hairy one.
1753
1a4648ff
AD
17542001-12-15 Akim Demaille <akim@epita.fr>
1755
1756 Make `make distcheck' work.
1757
1758 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1759 system.h which uses libgettext.h.
1760
9c2c67e6
AD
17612001-12-15 Akim Demaille <akim@epita.fr>
1762
1763 * src/nullable.c (set_nullable): Useless rules must be skipped,
1764 otherwise, since we range over their symbols, we might look at a
1765 nonterminal which no longer ``exists'', i.e., it is not counted in
1766 `nvars', hence we overflow our arrays.
1767
93ede233
AD
17682001-12-15 Akim Demaille <akim@epita.fr>
1769
1770 The header can also be produced directly, without any obstack!
1771 Yahoo!
1772
1773 * src/files.c, src/files.h (defines_obstack): Remove.
1774 (compute_header_macro): Global.
1775 (defines_obstack_save): Remove.
1776 * src/reader.c (parse_union_decl): No longer output to
1777 defines_obstack: its content can be found in the `stype' muscle
1778 anyway.
1779 (output_token_translations): Merge into...
1780 (symbols_output): this.
1781 Rename as...
1782 (symbols_save): this.
1783 (reader): Adjust.
1784 * src/output.c (header_output): New.
1785 (output): Call it.
1786
2666f928
AD
17872001-12-15 Akim Demaille <akim@epita.fr>
1788
1789 * src/reader.c (parse_union_decl): Instead of handling two obstack
1790 simultaneously, use one to define the `stype' muscle, and use the
1791 value of the latter to fill defines_obstack.
1792 (copy_comment): Remove.
1793 (copy_comment2): Work for a single obstack.
1794 Rename as...
1795 (copy_comment): this.
1796
428046f8
AD
17972001-12-15 Akim Demaille <akim@epita.fr>
1798
1799 * src/lex.c, src/lex.h (xgetc): No longer static.
1800 * src/reader.c (parse_union_decl): Revamp.
1801
ea52d706
AD
18022001-12-15 Akim Demaille <akim@epita.fr>
1803
1804 Still making progress in separating Bison into (i) input, (ii)
1805 process, (iii) output: now we can directly output the parser file
1806 without using table_obstack at all.
1807
1808 * src/files.c, src/files.h (table_obstack): Bye bye.
1809 (parser_file_name): New.
1810 * src/files.c (compute_output_file_names): Compute it.
1811 * src/output.c (actions_output, output_parser)
1812 (output_master_parser): To a file instead of an obstack.
1813
3f96f4dc
AD
18142001-12-15 Akim Demaille <akim@epita.fr>
1815
1816 Attach actions to rules, instead of pre-outputting them to
1817 actions_obstack.
1818
1819 * src/gram.h (rule_t): action and action_line are new members.
1820 * src/reader.c (symbol_list): Likewise.
1821 (copy_action): Save the actions within the rule.
1822 (packgram): Save them in rule_table.
1823 * src/output.c (actions_output): New.
1824 (output_parser): Use it on `%%actions'.
1825 (output_rule_data): Don't free rule_table.
1826 (output): Do it.
1827 (prepare): Don't save the `action' muscle.
1828 * src/bison.simple: s/%%action/%%actions/.
1829
51576fb3
AD
18302001-12-15 Akim Demaille <akim@epita.fr>
1831
1832 * src/reader.c (copy_action): When --yacc, don't append a `;'
1833 to the user action: let it fail if lacking.
dee049eb 1834 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 1835
2648a72d
AD
18362001-12-14 Akim Demaille <akim@epita.fr>
1837
1838 * src/lex.c (literalchar): Simply return the char you decoded, non
1839 longer mess around with obstacks and int pointers.
1840 Adjust all callers.
1841
92790e5b
AD
18422001-12-14 Akim Demaille <akim@epita.fr>
1843
1844 * src/lex.c (literalchar): Don't escape the special characters,
1845 just decode them, and keep them as char (before, eol was output as
1846 the 2 char string `\n' etc.).
1847 * src/output.c (output_rule_data): Use quotearg to output the
1848 token strings.
1849
927c1557
PE
18502001-12-13 Paul Eggert <eggert@twinsun.com>
1851
1852 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1853 Do not infringe on the global user namespace when using C++.
1854 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1855 All uses of `fprintf' and `stderr' changed.
1856
1857 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1858
ed8e1f68
AD
18592001-12-13 Akim Demaille <akim@epita.fr>
1860
1861 The computation of nullable is broken: it doesn't handle empty
1862 RHS's properly.
1863
1864 * tests/torture.at (GNU AWK Grammar): New.
1865 * tests/sets.at (Nullable): New.
1866 * src/nullable.c (set_nullable): Instead of blindly looping over
1867 `ritems', loop over the rules, and then over their rhs's.
1868
1869 Work around Autotest bugs.
1870
1871 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1872 frame, because Autotest understand lines starting with a `+' as
1873 traces from the shell. Then, they are not processed properly.
1874 Admittedly an Autotest bug, but we don't have time to wait for
1875 Autotest to catch up.
1876 * tests/regression.at (Broken Closure): Adjust to the new table
1877 frames.
1878 Move to...
1879 * tests/sets.at: here.
1880
cb581495
AD
18812001-12-13 Akim Demaille <akim@epita.fr>
1882
1883 * src/closure.c (closure): Use nrules instead of playing tricks
1884 with BITS_PER_WORD.
1885
2e729273
AD
18862001-12-13 Akim Demaille <akim@epita.fr>
1887
1888 * src/print.c (print_actions): Output the handling of `$' as the
1889 traces do: shifting the token EOF. Before EOF was treated as a
1890 nonterminal.
1891 * tests/regression.at: Adjust some tests.
1892 * src/print_graph.c (print_core): Complete the set of items via
1893 closure. The next-to-final and final states are still unsatisfying,
1894 but that's to be addressed elsewhere.
1895 No longer output the rule numbers, but do output the state number.
1896 A single loop for the shifts + gotos is enough, but picked a
1897 distinct color for each.
1898 (print_graph): Initialize and finalize closure.
1899
107f7dfb
AD
19002001-12-13 Akim Demaille <akim@epita.fr>
1901
1902 * src/reader.c (readgram): Remove dead code, an strip useless
1903 braces.
1904 (get_type): Remove, unused.
1905
9b53a24f
AD
19062001-12-12 Akim Demaille <akim@epita.fr>
1907
1908 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1909 on that of lib/error.c.
1910
dbfb6dcd
AD
19112001-12-12 Akim Demaille <akim@epita.fr>
1912
1913 Some hosts don't like `/' in includes.
1914
1915 * src/system.h: Include libgettext.h without qualifying the path.
1916 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1917 $(top_srcdir).
1918
c25fb648
MA
19192001-12-11 Marc Autret <autret_m@epita.fr>
1920
1921 * src/output.c (output_parser): Remove useless muscle.
1922
710ddc4f
MA
19232001-12-11 Marc Autret <autret_m@epita.fr>
1924
1925 * src/bison.simple: Remove #line just before %%epilogue. It
1926 is now handled in ...
1927 * src/reader.c (read_additionnal_code): Add the output of a
1928 #line for the epilogue.
1929
e83d80b8
MA
19302001-12-10 Marc Autret <autret_m@epita.fr>
1931
927c1557 1932 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
1933 replace precedent remove.
1934 * src/bison.simple: Remove #line before %%prologue because
1935 %%input-line is wrong at this time.
1936
971d5158
MA
19372001-12-10 Marc Autret <autret_m@epita.fr>
1938
1939 * src/reader.c (symbols_output): Clean up.
927c1557 1940 * src/output.c (output_gram, output): Clean up.
971d5158 1941
5edafffd
AD
19422001-12-10 Akim Demaille <akim@epita.fr>
1943
1944 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1945 * src/LR0.c (set_state_table): here.
1946 * src/lalr.c (lalr): Call it.
1947
0279f8e9
AD
19482001-12-10 Akim Demaille <akim@epita.fr>
1949
1950 * src/state.h (shifts): Remove the `number' member: shifts are
1951 attached to state, hence no longer need to be labelled with a
1952 state number.
1953
190c4f5f
AD
19542001-12-10 Akim Demaille <akim@epita.fr>
1955
1956 Now that states have a complete set of members, the linked list of
1957 shifts is useless: just fill directly the state's shifts member.
1958
1959 * src/state.h (shifts): Remove the `next' member.
1960 * src/LR0.c (first_state, last_state): Remove.
1961 Adjust the callers.
1962 (augment_automaton): Don't look for the shifts that must be added
1963 a shift on EOF: it is those of the state we looked for! But now,
1964 since shifts are attached, it is no longer needed to looking
1965 merely by its id: its number.
1966
2a73b93d
AD
19672001-12-10 Akim Demaille <akim@epita.fr>
1968
1969 * src/LR0.c (augment_automaton): Better variable locality.
1970 Remove an impossible branch: if there is a state corresponding to
1971 the start symbol being shifted, then there is shift for the start
1972 symbol from the initial state.
1973
74392f6a
AD
19742001-12-10 Akim Demaille <akim@epita.fr>
1975
1976 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1977 only when appropriate: when insert_start_shifting_state' is not
1978 invoked.
1979 * tests/regression.at (Rule Line Numbers): Adjust.
1980
37c82725
AD
19812001-12-10 Akim Demaille <akim@epita.fr>
1982
1983 * src/LR0.c (augment_automaton): Now that all states have shifts,
1984 merge the two cases addition shifts to the initial state.
1985
6a164e0c
AD
19862001-12-10 Akim Demaille <akim@epita.fr>
1987
1988 * src/lalr.c (set_state_table): Move to...
1989 * src/LR0.c: here.
1990 * src/lalr.c (lalr): Don't call it...
1991 * src/LR0.c (generate_states): do it.
1992 * src/LR0.h (first_state): Remove, only the table is used.
1993
7215de24
AD
19942001-12-10 Akim Demaille <akim@epita.fr>
1995
1996 * src/LR0.h (first_shift, first_reduction): Remove.
1997 * src/lalr.c: Don't use first_shift: find shifts through the
1998 states.
1999
80e25d4d
AD
20002001-12-10 Akim Demaille <akim@epita.fr>
2001
2002 * src/LR0.c: Attach shifts to states as soon as they are
2003 computed.
2004 * src/lalr.c (set_state_table): Instead of assigning shifts to
2005 state, just assert that the mapping was properly done.
2006
0ab3728b
AD
20072001-12-10 Akim Demaille <akim@epita.fr>
2008
2009 * src/LR0.c (insert_start_shift): Rename as...
2010 (insert_start_shifting_state): this.
2011 (insert_eof_shifting_state, insert_accepting_state): New.
2012 (augment_automaton): Adjust.
2013 Better locality of the variables.
2014 When looking if the start_symbol is shifted from the initial
2015 state, using `while (... symbol != start_symbol ...)' sounds
2016 better than `while (... symbol < start_symbol ...)': If fail
2017 to see how the order between symbols could be relevant!
2018
78af9bbc
AD
20192001-12-10 Akim Demaille <akim@epita.fr>
2020
2021 * src/getargs.h: Don't declare `spec_name_prefix' and
2022 `spec_file_prefix', declared by src/files.h.
2023 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2024 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2025 * src/output.c (prepare): Adjust.
2026 * src/reader.c (symbols_output): Likewise.
2027 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2028
bdef2a41
AD
20292001-12-10 Akim Demaille <akim@epita.fr>
2030
2031 * src/muscle_tab.c (muscle_init): NULL is a better default than
2032 `"0"'.
2033
3735969c
AD
20342001-12-10 Akim Demaille <akim@epita.fr>
2035
2036 * src/reader.c (reader): Calling symbols_output once is enough.
2037
49701457
AD
20382001-12-10 Akim Demaille <akim@epita.fr>
2039
2040 Now that states have a complete set of members, the linked list of
2041 reductions is useless: just fill directly the state's reductions
2042 member.
2043
2044 * src/state.h (struct reductions): Remove member `number' and
2045 `next'.
2046 * src/LR0.c (first_reduction, last_reduction): Remove.
2047 (save_reductions): Don't link the new reductions, store them in
2048 this_state.
2049 * src/lalr.c (set_state_table): No need to attach reductions to
2050 states, it's already done.
2051 * src/output.c (output_actions): No longer free the shifts, then
2052 the reductions, then the states: free all the states and their
2053 members.
2054
0edad749
AD
20552001-12-10 Akim Demaille <akim@epita.fr>
2056
2057 * src/options.c (OPTN, DRTV, BOTH): New.
2058 (option_table): Use them.
2059
0edad749
AD
2060 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2061 the job of system.h.
2062 * src/options.c: Don't include stdio.h and xalloc.h for the same
2063 reasons.
2064
5449dd0f
AD
20652001-12-10 Akim Demaille <akim@epita.fr>
2066
2067 * src/output.c (output, prepare): Make sure the values of the
2068 muscles `action' and `prologue' are 0-terminated.
2069
a870c567
AD
20702001-12-10 Akim Demaille <akim@epita.fr>
2071
2072 Clean up GCC warnings.
2073
2074 * src/reader.c (copy_action): `buf' is not used.
2075 (parse_skel_decl): Be static.
2076 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2077 * src/options.h (create_long_option_table): Have a real prototype.
2078 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2079 (hash_delete_at): Return const void *.
2080 Adjust casts to preserve the const.
2081
80df8768
AD
20822001-12-10 Akim Demaille <akim@epita.fr>
2083
2084 * configure.in: Require 2.52g.
2085 M4 is not needed, but AUTOM4TE is.
2086 * m4/m4.m4: Remove.
2087 * tests/Makefile.am: Adjust.
2088
f693ad14
AD
20892001-12-10 Akim Demaille <akim@epita.fr>
2090
2091 One structure for states is enough, even though theoretically
2092 there are LR(0) states and LALR(1) states.
2093
2094 * src/lalr.h (state_t): Remove.
2095 (state_table): Be state_t **, not state_t *.
2096 * src/state.h (core, CORE_ALLOC): Rename as...
2097 (state_t, STATE_ALLOC): this.
2098 Add the LALR(1) members: shifts, reductions, errs.
2099 * src/LR0.c (state_table): Rename as...
2100 (state_hash): this, to avoid name clashes with the global
2101 `state_table'.
2102 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2103 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2104
74ffbcb6
AD
21052001-12-10 Akim Demaille <akim@epita.fr>
2106
2107 Bison dumps core on bash.y.
2108 Reported by Pascal Bart.
2109
2110 * src/warshall.c (bitmatrix_print): New.
2111 (TC): Use it.
2112 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2113 j must be the outer loop.
2114 * tests/regression.at (Broken Closure): New.
2115
07708e19
AD
21162001-12-05 Akim Demaille <akim@epita.fr>
2117
2118 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2119 its argument.
2120