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