]> git.saurik.com Git - bison.git/blame - ChangeLog
(yyparse): Correct error handling to conform to
[bison.git] / ChangeLog
CommitLineData
c0c9ea05
PH
12002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2
3 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
4 type; it isn't always big enough, since it doesn't necessarily
5 include non-terminals.
6 (yytranslate): Expand definition of yy_token_number_type, so that
7 the latter can be removed.
8 (yy_token_number_type): Remove, only one use.
9 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
10 don't use TokenNumberType as element type.
11
12 * tests/regression.at: Modify expected output to agree with change
13 to yyr1 and yytranslate.
14
6390a83f
FK
152002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
16
17 * src/reader.c (parse_action): Use copy_character instead of
18 obstack_1grow.
19
db7c8e9a
AD
202002-05-13 Akim Demaille <akim@epita.fr>
21
22 * tests/regression.at (Token definitions): Prototype yylex and
23 yyerror.
24
fcc61800
PH
252002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
26
158c687b 27 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
28 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
29 32-bit arithmetic.
30 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
31
5683e9b2
AD
322002-05-07 Akim Demaille <akim@epita.fr>
33
34 * tests/synclines.at: Be sure to prototype yylex and yyerror to
35 avoid GCC warnings.
36
0c2d3f4c
AD
372002-05-07 Akim Demaille <akim@epita.fr>
38
39 Kill GCC warnings.
40
41 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
42 over the RHS of each rule.
43 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
44 * src/state.h (state_t): Member `nitems' is unsigned short.
45 * src/LR0.c (get_state): Adjust.
46 * src/reader.c (packgram): Likewise.
47 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
48 `Type'.
49 (muscle_insert_int_table): Remove, unused.
50 (prepare_rules): Remove `max'.
51
1565b720
AD
522002-05-06 Akim Demaille <akim@epita.fr>
53
54 * src/closure.c (print_firsts): Display of the symbol tags.
55 (bitmatrix_print): Move to...
56 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
57 here.
58 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
59
cfaee611
AD
602002-05-06 Akim Demaille <akim@epita.fr>
61
62 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
63 hash_do_for_each.
64
458be8e0
AD
652002-05-06 Akim Demaille <akim@epita.fr>
66
67 * src/LR0.c (new_state, get_state): Instead of using the global
68 `kernel_size' and `kernel_base', have two new arguments:
69 `core_size' and `core'.
70 Adjust callers.
71
a900a624
AD
722002-05-06 Akim Demaille <akim@epita.fr>
73
74 * src/reader.c (packgram): No longer end `ritem' with a 0
75 sentinel: it is not used.
76
d4e7d3a1
AD
772002-05-05 Akim Demaille <akim@epita.fr>
78
79 New experimental feature: display the lookaheads in the report and
80 graph.
81
82 * src/print (print_core): When --trace-flag, display the rules
83 lookaheads.
84 * src/print_graph.c (print_core): Likewise.
85 Swap the arguments.
86 Adjust caller.
87
39ceb25b
AD
882002-05-05 Akim Demaille <akim@epita.fr>
89
90 * tests/torture.at (Many lookaheads): New test.
91
5372019f
AD
922002-05-05 Akim Demaille <akim@epita.fr>
93
94 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
95 (GENERATE_MUSCLE_INSERT_TABLE): this.
96 (output_int_table, output_unsigned_int_table, output_short_table)
97 (output_token_number_table, output_item_number_table): Replace with...
98 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
99 (muscle_insert_short_table, muscle_insert_token_number_table)
100 (muscle_insert_item_number_table): these.
101 Adjust all callers.
102 (prepare_tokens): Don't free `translations', since...
103 * src/reader.h, src/reader.c (grammar_free): do it.
104 Move to...
105 * src/gram.h, src/gram.c (grammar_free): here.
106 * data/bison.simple, data/bison.c++: b4_token_number_max is now
107 b4_translate_max.
108
5df5f6d5
AD
1092002-05-05 Akim Demaille <akim@epita.fr>
110
111 * src/output.c (output_unsigned_int_table): New.
112 (prepare_rules): `i' is unsigned.
113 `prhs', `rline', `r2' are unsigned int.
114 Rename muscle `rhs_number_max' as `rhs_max'.
115 Output muscles `prhs_max', `rline_max', and `r2_max'.
116 Free rline and r1.
117 * data/bison.simple, data/bison.c++: Adjust to use these muscles
118 to compute types instead of constant types.
119 * tests/regression.at (Web2c Actions): Adjust.
120
b87f8b21
AD
1212002-05-04 Akim Demaille <akim@epita.fr>
122
123 * src/symtab.h (SALIAS, SUNDEF): Rename as...
124 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
125 Adjust dependencies.
126 * src/output.c (token_definitions_output): Be sure not to output a
127 `#define 'a'' when fed with `%token 'a' "a"'.
128 * tests/regression.at (Token definitions): New.
129
8bb936e4
PE
1302002-05-03 Paul Eggert <eggert@twinsun.com>
131
132 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
133 for K&R C.
134
1352002-05-03 gettextize <bug-gnu-gettext@gnu.org>
136
137 * Makefile.am (SUBDIRS): Remove intl.
138 (EXTRA_DIST): Add config/config.rpath.
139
53c71a12
AD
1402002-05-03 Akim Demaille <akim@epita.fr>
141
142 * data/bison.simple (m4_if): Don't output empty enums.
143 And actually, output valid enum definitions :(.
144
289dd0cf
AD
1452002-05-03 Akim Demaille <akim@epita.fr>
146
147 * configure.bat: Remove, completely obsolete.
148 * Makefile.am (EXTRA_DIST): Adjust.
149 Don't distribute config.rpath...
150 * config/Makefile.am (EXTRA_DIST): Do it.
151
db85e524
AD
1522002-05-03 Akim Demaille <akim@epita.fr>
153
154 * configure.in (GETTEXT_VERSION): New.
155 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
156
83ccf991
AD
1572002-05-03 Akim Demaille <akim@epita.fr>
158
159 * data/bison.simple (b4_token_enum): New.
160 (b4_token_defines): Use it to output tokens both as #define and
161 enums.
162 Suggested by Paul Eggert.
163 * src/output.c (token_definitions_output): Don't output spurious
164 white spaces.
165
1f418995
AD
1662002-05-03 Akim Demaille <akim@epita.fr>
167
168 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
169
45119f04
RA
1702002-05-02 Robert Anisko <robert@lrde.epita.fr>
171
172 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
173 Update the stack class, give a try to deque as the default container.
174
b2d52318
AD
1752002-05-02 Akim Demaille <akim@epita.fr>
176
177 * data/bison.simple (yyparse): Do not implement @$ = @1.
178 (YYLLOC_DEFAULT): Adjust to do it.
179 * doc/bison.texinfo (Location Default Action): Fix.
180
3a8b4109
AD
1812002-05-02 Akim Demaille <akim@epita.fr>
182
183 * src/reader.c (parse_braces): Merge into...
184 (parse_action): this.
185
84614e13
AD
1862002-05-02 Akim Demaille <akim@epita.fr>
187
188 * configure.in (ALL_LINGUAS): Remove.
189 * po/LINGUAS, hr.po: New.
190
fdbcd8e2
AD
1912002-05-02 Akim Demaille <akim@epita.fr>
192
193 Remove the so called hairy (semantic) parsers.
194
195 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
196 * src/gram.h, src/gram.c (semantic_parser): Remove.
197 (rule_t): Remove the guard and guard_line members.
198 * src/lex.h (token_t): remove tok_guard.
199 * src/options.c (option_table): Remove %guard and %semantic_parser
200 support.
201 * src/output.c, src/output.h (guards_output): Remove.
202 (prepare): Adjust.
203 (token_definitions_output): Don't output the `T'
204 tokens (???).
205 (output_skeleton): Don't output the guards.
206 * src/files.c, src/files.c (attrsfile): Remove.
207 * src/reader.c (symbol_list): Remove the guard and guard_line
208 members.
209 Adjust dependencies.
210 (parse_guard): Remove.
211 * data/bison.hairy: Remove.
212 * doc/bison.texinfo (Environment Variables): Remove occurrences of
213 BISON_HAIRY.
214
82b6cb3f
AD
2152002-05-02 Akim Demaille <akim@epita.fr>
216
217 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
218 (parse_guard): Rename the formal argument `stack_offset' as
219 `rule_length', which is more readable.
220 Adjust callers.
221 (copy_at, copy_dollar): Instead of outputting the hard coded
222 values of $$, $n and so forth, output invocation to b4_lhs_value,
223 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
224 Note: this patch partially drops `semantic-parser' support: it
225 always does `rule_length - n', where semantic parsers ought to
226 always use `-n'.
82b6cb3f
AD
227 * data/bison.simple, data/bison.c++ (b4_lhs_value)
228 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
229
6cbfbcc5
AD
2302002-05-02 Akim Demaille <akim@epita.fr>
231
232 * configure.in (AC_INIT): Bump to 1.49b.
233 (AM_INIT_AUTOMAKE): Short invocation.
234
b8548114
AD
2352002-05-02 Akim Demaille <akim@epita.fr>
236
237 Version 1.49a.
238
c20cd1fa
AD
2392002-05-01 Akim Demaille <akim@epita.fr>
240
241 * src/skeleton.h: Remove.
242
8a9566d4
AD
2432002-05-01 Akim Demaille <akim@epita.fr>
244
245 * src/skeleton.h: Fix the #endif.
246 Reported by Magnus Fromreide.
247
8c6d399a
PE
2482002-04-26 Paul Eggert <eggert@twinsun.com>
249
250 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
251 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 252 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 253
2b7ed18a
RA
2542002-04-25 Robert Anisko <robert@lrde.epita.fr>
255
256 * src/scan-skel.l: Postprocess quadrigraphs.
257
258 * src/reader.c (copy_character): New function, used to output
259 single characters while replacing `[' and `]' with quadrigraphs, to
260 avoid troubles with M4 quotes.
261 (copy_comment): Output characters with copy_character.
262 (read_additionnal_code): Likewise.
263 (copy_string2): Likewise.
264 (copy_definition): Likewise.
265
266 * tests/calc.at: Exercise M4 quoting.
267
34a89c50
AD
2682002-04-25 Akim Demaille <akim@epita.fr>
269
270 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
271 between `!' and the command.
272 Reported by Paul Eggert.
273
0dd1580a
RA
2742002-04-24 Robert Anisko <robert@lrde.epita.fr>
275
276 * tests/calc.at: Exercise prologue splitting.
277
278 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
279 `b4_post_prologue' instead of `b4_prologue'.
280
281 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
282 muscles.
283 (output): Free pre_prologue_obstack and post_prologue_obstack.
284 * src/files.h, src/files.c (attrs_obstack): Remove.
285 (pre_prologue_obstack, post_prologue_obstack): New.
286 * src/reader.c (copy_definition): Add a parameter to specify the
287 obstack to fill, instead of using attrs_obstack unconditionally.
288 (read_declarations): Pass pre_prologue_obstack to copy_definition if
289 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
290
83c1796f
PE
2912002-04-23 Paul Eggert <eggert@twinsun.com>
292
293 * data/bison.simple: Remove unnecessary commentary and white
294 space differences from 1_29-branch.
295 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
296
297 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
298 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
299 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
300 constructors or destructors.
301
302 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
303
1207eeac
AD
3042002-04-23 Akim Demaille <akim@epita.fr>
305
306 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
307 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
308 location with columns.
309 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
310 All reported by Paul Eggert.
311
78ab8f67
AD
3122002-04-22 Akim Demaille <akim@epita.fr>
313
314 * src/reduce.c (dump_grammar): Move to...
315 * src/gram.h, src/gram.c (grammar_dump): here.
316 Be sure to separate long item numbers.
317 Don't read the members of a rule's prec if its nil.
318
133c20e2
AD
3192002-04-22 Akim Demaille <akim@epita.fr>
320
321 * src/output.c (table_size, table_grow): New.
322 (MAXTABLE): Remove, replace uses with table_size.
323 (pack_vector): Instead of dying when the table is too big, grow it.
324
9515e8a7
AD
3252002-04-22 Akim Demaille <akim@epita.fr>
326
327 * data/bison.simple (yyr1): Its type is that of a token number.
328 * data/bison.c++ (r1_): Likewise.
329 * tests/regression.at (Web2c Actions): Adjust.
330
23c5a174
AD
3312002-04-22 Akim Demaille <akim@epita.fr>
332
333 * src/reader.c (token_translations_init): 256 is now the default
334 value for the error token, i.e., it will be assigned another
335 number if the user assigned 256 to one of her tokens.
336 (reader): Don't force 256 to error.
337 * doc/bison.texinfo (Symbols): Adjust.
338 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
339 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
340 etc. instead of 10, 20, 30 (which was used to `jump' over error
341 (256) and undefined (2)).
342
5fbb0954
AD
3432002-04-22 Akim Demaille <akim@epita.fr>
344
345 Propagate more token_number_t.
346
347 * src/gram.h (token_number_as_item_number)
348 (item_number_as_token_number): New.
349 * src/output.c (GENERATE_OUTPUT_TABLE): New.
350 Use it to create output_item_number_table and
351 output_token_number_table.
352 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
353 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
354 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
355 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
356
4f940944
AD
3572002-04-22 Akim Demaille <akim@epita.fr>
358
359 * src/output.h, src/output.c (get_lines_number): Remove.
360
3ded9a63
AD
3612002-04-19 Akim Demaille <akim@epita.fr>
362
363 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
364 as Lex/Flex'.
365 (Debugging): More details about enabling the debugging features.
366 (Table of Symbols): Describe $$, $n, @$, and @n.
367 Suggested by Tim Josling.
368
e0c471a9
AD
3692002-04-19 Akim Demaille <akim@epita.fr>
370
371 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
372
fecc10cd
AD
3732002-04-10 Akim Demaille <akim@epita.fr>
374
375 * src/system.h: Rely on HAVE_LIMITS_H.
376 Suggested by Paul Eggert.
377
51dec47b
AD
3782002-04-09 Akim Demaille <akim@epita.fr>
379
380 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
381 full stderr, and strip it according to the bison options, instead
382 of composing the error message from different bits.
383 This makes it easier to check for several error messages.
384 Adjust all the invocations.
385 Add an invocation exercising the error token.
386 Add an invocation demonstrating a stupid error message.
387 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
388 Adjust the tests.
389 Error message are for stderr, not stdout.
390
007a50a4
AD
3912002-04-09 Akim Demaille <akim@epita.fr>
392
393 * src/gram.h, src/gram.c (error_token_number): Remove, use
394 errtoken->number.
395 * src/reader.c (reader): Don't specify the user token number (2)
396 for $undefined, as it uselessly prevents using it.
397 * src/gram.h (token_number_t): Move to...
398 * src/symtab.h: here.
399 (state_t.number): Is a token_number_t.
400 * src/print.c, src/reader.c: Use undeftoken->number instead of
401 hard coded 2.
402 (Even though this 2 is not the same as above: the number of the
403 undeftoken remains being 2, it is its user token number which
404 might not be 2).
405 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
406 `user_token_number_max'.
407 Output `undef_token_number'.
408 * data/bison.simple, data/bison.c++: Use them.
409 Be sure to map invalid yylex return values to
410 `undef_token_number'. This saves us from gratuitous SEGV.
411
412 * tests/conflicts.at (Solved SR Conflicts)
413 (Unresolved SR Conflicts): Adjust.
414 * tests/regression.at (Web2c Actions): Adjust.
415
06446ccf
AD
4162002-04-08 Akim Demaille <akim@epita.fr>
417
418 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
419 Adding #line.
420 Remove the duplicate `typedefs'.
421 (RhsNumberType): Fix the declaration and various other typos.
422 Use __ofile__.
423 * data/bison.simple: Use __ofile__.
424 * src/scan-skel.l: Handle __ofile__.
425
62a3e4f0
AD
4262002-04-08 Akim Demaille <akim@epita.fr>
427
428 * src/gram.h (item_number_t): New, the type of item numbers in
429 RITEM. Note that it must be able to code symbol numbers as
430 positive number, and the negation of rule numbers as negative
431 numbers.
432 Adjust all dependencies (pretty many).
433 * src/reduce.c (rule): Remove this `short *' pointer: use
434 item_number_t.
435 * src/system.h (MINSHORT, MAXSHORT): Remove.
436 Include `limits.h'.
437 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
438 (shortcpy): Remove.
439 (MAXTABLE): Move to...
440 * src/output.c (MAXTABLE): here.
441 (prepare_rules): Use output_int_table to output rhs.
442 * data/bison.simple, data/bison.c++: Adjust.
443 * tests/torture.at (Big triangle): Move the limit from 254 to
444 500.
445 * tests/regression.at (Web2c Actions): Ajust.
446
447 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
448 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
449 passes, but produces negative #line number, once fixed, GCC is
450 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
451 C), it passes.
452 * src/state.h (state_h): Code input lines on ints, not shorts.
453
bb88b0fc
AD
4542002-04-08 Akim Demaille <akim@epita.fr>
455
456 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
457 and then the grammar.
458
9a636f47
AD
4592002-04-08 Akim Demaille <akim@epita.fr>
460
461 * src/system.h: No longer using strndup.
462
680e8701
AD
4632002-04-07 Akim Demaille <akim@epita.fr>
464
465 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
466 * src/output.c (output_table_data): Return the longest number.
467 (prepare_tokens): Output `token_number_max').
468 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
469 New.
470 Use them to define yy_token_number_type/TokenNumberType.
471 Use this type for yytranslate.
472 * tests/torture.at (Big triangle): Push the limit from 124 to
473 253.
474 * tests/regression.at (Web2c Actions): Adjust.
475
817e9f41
AD
4762002-04-07 Akim Demaille <akim@epita.fr>
477
478 * tests/torture.at (Big triangle): New.
479 (GNU AWK Grammar, GNU Cim Grammar): Move to...
480 * tests/existing.at: here.
481
5123689b
AD
4822002-04-07 Akim Demaille <akim@epita.fr>
483
484 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
485 nritems.
486 Adjust dependencies.
487
f3849179
AD
4882002-04-07 Akim Demaille <akim@epita.fr>
489
490 * src/reader.c: Normalize increments to prefix form.
491
bd02036a
AD
4922002-04-07 Akim Demaille <akim@epita.fr>
493
494 * src/reader.c, symtab.c: Remove debugging code.
495
db8837cb
AD
4962002-04-07 Akim Demaille <akim@epita.fr>
497
498 Rename all the `bucket's as `symbol_t'.
499
500 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
501 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
502 * src/symtab.c, src/symtab.h (bucket): Rename as...
503 (symbol_t): this.
504 (symbol_list_new, bucket_check_defined, bucket_make_alias)
505 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
506 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
507 (buckets_new, buckets_free, buckets_do): Rename as...
508 (symbol_list_new, symbol_check_defined, symbol_make_alias)
509 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
510 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
511 (symbols_new, symbols_free, symbols_do): these.
512
72a23c97
AD
5132002-04-07 Akim Demaille <akim@epita.fr>
514
515 Use lib/hash for the symbol table.
516
517 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
518 EOF.
519 * src/lex.c (lex): Set the `number' member of new terminals.
520 * src/reader.c (bucket_check_defined, bucket_make_alias)
521 (bucket_check_alias_consistence, bucket_translation): New.
522 (reader, grammar_free, readgram, token_translations_init)
523 (packsymbols): Adjust.
524 (reader): Number the predefined tokens.
525 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
526 for predefined tokens.
527 * src/symtab.h (bucket): Remove all the hash table related
528 members.
529 * src/symtab.c (symtab): Replace by...
530 (bucket_table): this.
531 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
532 (buckets_new, buckets_do): New.
533
280a38c3
AD
5342002-04-07 Akim Demaille <akim@epita.fr>
535
536 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
537 (start_symbol, max_user_token_number, semantic_parser)
538 (error_token_number): Initialize.
539 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
540 Initialize.
541 (reader): Don't.
542 (errtoken, eoftoken, undeftoken, axiom): Extern.
543
03b31c0c
AD
5442002-04-07 Akim Demaille <akim@epita.fr>
545
546 * src/gram.h (rule_s): prec and precsym are now pointers
547 to the bucket giving the priority/associativity.
548 Member `associativity' removed: useless.
549 * src/reduce.c, src/conflicts.c: Adjust.
550
8b3df748
AD
5512002-04-07 Akim Demaille <akim@epita.fr>
552
553 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
554 Properly escape the symbols' TAG when outputting them.
555
e601aa1d
AD
5562002-04-07 Akim Demaille <akim@epita.fr>
557
558 * src/lalr.h (LA): Is a bitsetv, not bitset*.
559
b0299a2e
AD
5602002-04-07 Akim Demaille <akim@epita.fr>
561
562 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
563 (LArule): this, which is an array to rule_t*.
564 * src/print.c, src/conflicts.c: Adjust.
565
d7e1f00c
AD
5662002-04-07 Akim Demaille <akim@epita.fr>
567
568 * src/gram.h (rule_t): Rename `number' as `user_number'.
569 `number' is a new member.
570 Adjust dependencies.
571 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
572
cc9305dd
AD
5732002-04-07 Akim Demaille <akim@epita.fr>
574
575 As a result of the previous patch, it is no longer needed
576 to reorder ritem itself.
577
578 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
579
b0940840
AD
5802002-04-07 Akim Demaille <akim@epita.fr>
581
582 Be sure never to walk through RITEMS, but use only data related to
583 the rules themselves. RITEMS should be banished.
584
585 * src/output.c (output_token_translations): Rename as...
586 (prepare_tokens): this.
587 In addition to `translate', prepare the muscles `tname' and
588 `toknum', which were handled by...
589 (output_rule_data): this.
590 Remove, and move the remainder of its outputs into...
591 (prepare_rules): this new routines, which also merges content from
592 (output_gram): this.
593 (prepare_rules): Be sure never to walk through RITEMS.
594 (output_stos): Rename as...
595 (prepare_stos): this.
596 (output): Always invoke prepare_states, after all, just don't use it
597 in the output if you don't need it.
598
643a5994
AD
5992002-04-07 Akim Demaille <akim@epita.fr>
600
601 * src/LR0.c (new_state): Display `nstates' as the name of the
602 newly created state.
603 Adjust to initialize first_state and last_state if needed.
604 Be sure to distinguish the initial from the final state.
605 (new_states): Create the itemset of the initial state, and use
606 new_state.
607 * src/closure.c (closure): Now that the initial state has its
608 items properly set, there is no need for a special case when
609 creating `ruleset'.
610
611 As a result, now the rule 0, reducing to $axiom, is visible in the
612 outputs. Adjust the test suite.
613
614 * tests/conflicts.at (Solved SR Conflicts)
615 (Unresolved SR Conflicts): Adjust.
616 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
617 * tests/conflicts.at (S/R in initial): New.
618
b4c4ccc2
AD
6192002-04-07 Akim Demaille <akim@epita.fr>
620
621 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
622 the RHS of the rules.
623 * src/output.c (output_gram): Likewise.
624
bba97eb2
AD
6252002-04-07 Akim Demaille <akim@epita.fr>
626
627 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
628 bucket.
629 Adjust all dependencies.
630 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
631 `number' of the buckets too.
632 * src/gram.h: Include `symtab.h'.
633 (associativity): Move to...
634 * src/symtab.h: here.
635 No longer include `gram.h'.
636
c3b407f4
AD
6372002-04-07 Akim Demaille <akim@epita.fr>
638
639 * src/gram.h, src/gram.c (rules_rhs_length): New.
640 (ritem_longest_rhs): Use it.
641 * src/gram.h (rule_t): `number' is a new member.
642 * src/reader.c (packgram): Set it.
643 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
644 the end of `rules', and count them out of `nrules'.
645 (reduce_output, dump_grammar): Adjust.
646 * src/print.c (print_grammar): It is no longer needed to check for
647 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
648 * tests/reduce.at (Reduced Automaton): New test.
649
11652ab3
AD
6502002-04-07 Akim Demaille <akim@epita.fr>
651
652 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
653 lacking `+ 1' to nrules, Bison reported as useless a token if it
654 was used solely to set the precedence of the last rule...
655
26b23c1a
AD
6562002-04-07 Akim Demaille <akim@epita.fr>
657
658 * data/bison.c++, data/bison.simple: Don't output the current file
659 name in #line, to avoid useless diffs between two identical
660 outputs under different names.
661
18bcecb0
AD
6622002-04-07 Akim Demaille <akim@epita.fr>
663
664 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
665 Normalize loops to using `< nrules + 1', not `<= nrules'.
666
fa770c86
AD
6672002-04-07 Akim Demaille <akim@epita.fr>
668
669 * TODO: Update.
670
d9b739c3
AD
6712002-04-07 Akim Demaille <akim@epita.fr>
672
673 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
674 bucket.value as bucket.number.
675
99013900
AD
6762002-04-07 Akim Demaille <akim@epita.fr>
677
678 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
679 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
680 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
681 RHS, instead of being an index in RITEMS.
682
e966383b
PE
6832002-04-04 Paul Eggert <eggert@twinsun.com>
684
685 * doc/bison.texinfo: Update copyright date.
686 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
687 (Symbols): Warn about running Bison in one character set,
688 but compiling and/or running in an incompatible one.
689 Warn about character code 256, too.
690
6912002-04-03 Paul Eggert <eggert@twinsun.com>
692
693 * src/bison.data (YYSTACK_ALLOC): Depend on whether
694 YYERROR_VERBOSE is nonzero, not whether it is defined.
695
696 Merge changes from bison-1_29-branch.
c307773e 697
8d6c48b9
PE
6982002-03-20 Paul Eggert <eggert@twinsun.com>
699
700 Merge fixes from Debian bison_1.34-1.diff.
701
702 * configure.in (AC_PREREQ): 2.53.
703
e53c6322
AD
7042002-03-20 Akim Demaille <akim@epita.fr>
705
706 * src/conflicts.c (log_resolution): Argument `resolution' is const.
707
9ffbeca7
PE
7082002-03-19 Paul Eggert <eggert@twinsun.com>
709
21db0b2a
PE
710 * src/bison.simple (YYCOPY): New macro.
711 (YYSTACK_RELOCATE): Use it.
712 Remove Type arg; no longer needed. All callers changed.
713 (yymemcpy): Remove; no longer needed.
714
9ffbeca7
PE
715 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
716 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
717
642cb8f8
AD
7182002-03-19 Akim Demaille <akim@epita.fr>
719
720 Test and fix the #line outputs.
721
722 * tests/atlocal.at (GCC): New.
723 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
724 (Prologue synch line, ,%union synch line, Postprologue synch line)
725 (Action synch line, Epilogue synch line): New tests.
726 * src/reader.c (parse_union_decl): Define the muscle stype_line.
727 * data/bison.simple, data/bison.c++: Use it.
728
3c31a486
AD
7292002-03-19 Akim Demaille <akim@epita.fr>
730
731 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
732 (Solved SR Conflicts, %expect not enough, %expect right)
733 (%expect too much): Move to...
734 * tests/conflicts.at: this new file.
735
0d8bed56
AD
7362002-03-19 Akim Demaille <akim@epita.fr>
737
738 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
739 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
740 that we can move to enums for instance.
741 * src/output.c (token_definitions_output): Output a list of
742 `token-name, token-number' instead of the #define.
743 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
744
9208d17f
AD
7452002-03-14 Akim Demaille <akim@epita.fr>
746
747 Use Gettext 0.11.1.
748
af27eacb
RA
7492002-03-09 Robert Anisko <robert@lrde.epita.fr>
750
751 * data/bison.c++: Make the user able to add members to the generated
752 parser by subclassing.
753
9101a310
RA
7542002-03-05 Robert Anisko <robert@lrde.epita.fr>
755
756 * src/reader.c (read_additionnal_code): `c' should be an integer, not
757 a character.
758 Reported by Nicolas Tisserand and Nicolas Burrus.
759
fff9bf0b
RA
7602002-03-04 Robert Anisko <robert@lrde.epita.fr>
761
762 * src/reader.c: Warn about lacking semi-colons, do not complain.
763
64dba31e
RA
7642002-03-04 Robert Anisko <robert@lrde.epita.fr>
765
766 * data/bison.c++: Remove a debug line.
767
374f5a14
RA
7682002-03-04 Robert Anisko <robert@lrde.epita.fr>
769
770 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
771 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
772 provide a default implementation.
773
bfcf1f3a
AD
7742002-03-04 Akim Demaille <akim@epita.fr>
775
776 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
777 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
778 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
779 * tests/semantic.at (Parsing Guards): Similarly.
780 * src/reader.at (readgram): Complain if the last rule is not ended
781 with a semi-colon.
782
65ccf9fc
AD
7832002-03-04 Akim Demaille <akim@epita.fr>
784
785 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
786 * src/closure.c: here.
787 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
788 RTC.
789 * src/warshall.h, src/warshall.c: Remove.
790 * tests/sets.at (Broken Closure): Adjust.
791
d0039cbc
AD
7922002-03-04 Akim Demaille <akim@epita.fr>
793
794 * src/output.c (output_skeleton): tempdir is const.
795 bytes_read is unused.
796
345cea78
AD
7972002-03-04 Akim Demaille <akim@epita.fr>
798
799 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
800 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
801 Update.
802 From Michael Hayes.
803
564801f7
AD
8042002-03-04 Akim Demaille <akim@epita.fr>
805
806 * src/closure.c (closure): `r' is unused.
807
e5352bc7
AD
8082002-03-04 Akim Demaille <akim@epita.fr>
809
810 * tests/sets.at (Broken Closure): Add the ending `;'.
811 * src/reader.at (readgram): Complain if a rule is not ended with a
812 semi-colon.
813
914feea9
AD
8142002-03-04 Akim Demaille <akim@epita.fr>
815
816 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
817 (count_sr_conflicts): Use bitset_count.
818 * src/reduce.c (inaccessable_symbols): Ditto.
819 (bits_size): Remove.
820 * src/warshall.h, src/warshall.c: Convert to bitsetv.
821
f0250de6
AD
8222002-03-04 Akim Demaille <akim@epita.fr>
823
824 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
825 * src/reduce.c: Remove the `bitset_zero's following the
826 `bitset_create's, as now it is performed by the latter.
827
ef017502
AD
8282002-03-04 Akim Demaille <akim@epita.fr>
829
830 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
831 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
832 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
833 latest sources from Michael.
834
76514394
AD
8352002-03-04 Akim Demaille <akim@epita.fr>
836
837 * src/output.c (output): Don't free the grammar.
838 * src/reader.c (grammar_free): New.
839 * src/main.c (main): Call it and don't free symtab here.
840
55024580
AD
8412002-03-04 Akim Demaille <akim@epita.fr>
842
843 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
844 before returning.
845 Reported by Benoit Perrot.
846
f9abaa2c
AD
8472002-03-04 Akim Demaille <akim@epita.fr>
848
849 Use bitset operations when possible, not loops over bits.
850
851 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
852 bitset_or.
853 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
854 * src/reduce.c (useless_nonterminals): Formatting changes.
855 * src/warshall.c (TC): Use bitset_or.
856
0e721e75
AD
8572002-03-04 Akim Demaille <akim@epita.fr>
858
859 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
860 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
861 Ditto.
862
0fb1ffb1
AD
8632002-03-04 Akim Demaille <akim@epita.fr>
864
865 * src/lalr.c (F): Now a bitset*.
866 Adjust all dependencies.
867
b86796bf
AD
8682002-03-04 Akim Demaille <akim@epita.fr>
869
870 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
871 Adjust all dependencies.
872
602bbf31
AD
8732002-03-04 Akim Demaille <akim@epita.fr>
874
875 * src/L0.c, src/LR0.h (nstates): Be size_t.
876 Adjust comparisons (signed vs unsigned).
877 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
878 bitset*.
879 Adjust all dependencies.
880
d8a0245c
AD
8812002-03-04 Akim Demaille <akim@epita.fr>
882
883 * src/closure.c (firsts): Now, also a bitset.
884 Adjust all dependencies.
885 (varsetsize): Remove, now unused.
886 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
887
34ba9743
AD
8882002-03-04 Akim Demaille <akim@epita.fr>
889
890 * src/print.c: Convert to use bitset.h, not hand coded iterations
891 over ints.
892
ed86e78c
AD
8932002-03-04 Akim Demaille <akim@epita.fr>
894
895 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
896
dfdb1797
AD
8972002-03-04 Akim Demaille <akim@epita.fr>
898
899 * src/closure.c (ruleset): Be a bitset.
900 (rulesetsize): Remove.
901
7086e707
AD
9022002-03-04 Akim Demaille <akim@epita.fr>
903
904 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
905 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
906 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
907 * src/closure.c (fderives): Be an array of bitsets.
908
98254360
RA
9092002-02-28 Robert Anisko <robert@lrde.epita.fr>
910
911 * data/bison.c++: Merge the two generated headers. Insert a copyright
912 notice in each output file.
913
a75c057f
AD
9142002-02-28 Akim Demaille <akim@epita.fr>
915
916 * data/bison.c++: Copy the prologue of bison.simple to fetch
917 useful M4 definitions, such as b4_header_guard.
918
06b00abc
AD
9192002-02-25 Akim Demaille <akim@epita.fr>
920
921 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
922 translator friendly scheme for the bgr
923 copyright notice.
06b00abc 924
70e7d534
AD
9252002-02-25 Akim Demaille <akim@epita.fr>
926
927 * src/output.c (header_output): Remove, now handled completely via
928 M4.
929
abe017f6
AD
9302002-02-25 Akim Demaille <akim@epita.fr>
931
932 * m4/m4.m4: New, from CVS Autoconf.
933 * configure.in: Invoke it.
934 * src/output.c (output_skeleton): Use its result instead of the
935 hard coded name.
936
381fb12e
AD
9372002-02-25 Akim Demaille <akim@epita.fr>
938
939 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
940 Fileutils 4.1.5.
941 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
942 * src/output.c (output_skeleton): Use mkstemp to create a real
943 temporary file.
944 Move the filling of `skeleton' and its muscle to...
945 (prepare): here.
946 (output): Move the definition of the prologue muscle to...
947 (prepare): here.
948 * src/system.h (DEFAULT_TMPDIR): New.
949
6f38107f
PE
9502002-02-14 Paul Eggert <eggert@twinsun.com>
951
952 Remove the support for C++ namespace cleanliness; it was
953 causing more problems than it was curing, since it didn't work
954 properly on some nonstandard C++ compilers. This can wait
955 for a proper C++ parser.
956
957 * NEWS: Document this.
958 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
959 of C++, as it's treated like C now.
960 * src/bison.simple (YYSTD): Remove.
961 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
962 Treat C++ just like Standard C instead of trying to support
963 namespace cleanliness.
964
80cce3da
AD
9652002-02-14 Akim Demaille <akim@epita.fr>
966
967 * tests/regression.at (else): Adjust to Andreas' change.
968
842e8679
AD
9692002-02-14 Akim Demaille <akim@epita.fr>
970
971 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
972
4bda3f10
AD
9732002-02-13 Andreas Schwab <schwab@suse.de>
974
975 * src/output.c (output_rule_data): Don't output NULL, it might
976 not be defined yet.
977
4162fa07 9782002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 979
4162fa07
RA
980 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
981 (Copyright notice): Update.
b418ecd8 982
bd16a5dc
AD
9832002-02-11 Akim Demaille <akim@epita.fr>
984
985 * tests/regression.at (%nonassoc and eof): Don't include
986 nonportable headers.
987
8d69a1a3
RA
9882002-02-08 Robert Anisko <robert@lrde.epita.fr>
989
990 * data/bison.c++: Correct error recovery. Make the user able to
991 initialize the starting location.
992
9b2d0677
AD
9932002-02-07 Akim Demaille <akim@epita.fr>
994
995 * tests/input.at: New.
996
69e2658b
RA
9972002-02-07 Robert Anisko <robert@lrde.epita.fr>
998
999 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 1000 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
1001 directives around tables only needed for debugging.
1002
4aacc3a7
RA
10032002-02-07 Robert Anisko <robert@lrde.epita.fr>
1004
1005 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1006 C++ parsers.
1007 (yy::b4_name::parse): Use print_.
1008
762a801e
RA
10092002-02-07 Robert Anisko <robert@lrde.epita.fr>
1010
1011 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1012
4bb2bc3f
RA
10132002-02-07 Robert Anisko <robert@lrde.epita.fr>
1014
1015 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1016 C++ parsers.
1017 (yy::b4_name::parse): Build verbose error messages, and use error_.
1018
6b45a3ca
RA
10192002-02-06 Robert Anisko <robert@lrde.epita.fr>
1020
1021 * data/bison.c++: Fix m4 quoting in comments.
1022
50997c6e
RA
10232002-02-06 Robert Anisko <robert@lrde.epita.fr>
1024
1025 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1026 not expanded by m4.
1027
3f3eed27
AD
10282002-02-05 Akim Demaille <akim@epita.fr>
1029
1030 * data/bison.c++: Adjust to the M4 back end.
1031 More is certainly needed.
1032
be2a1a68
AD
10332002-02-05 Akim Demaille <akim@epita.fr>
1034
1035 Give a try to M4 as a back end.
1036
1037 * lib/readpipe.c: New, from wdiff.
1038 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1039 BISON_HAIRY.
1040 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1041 specific values. Now it is m4 that performs the lookup.
1042 * src/parse-skel.y: Remove.
1043 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1044 * src/output.c (actions_output, guards_output)
1045 (token_definitions_output): No longer keeps track of the output
1046 line number, hence remove the second argument.
1047 (guards_output): Check against the guard member of a rule, not the
1048 action member.
1049 Adjust callers.
1050 (output_skeleton): Don't look for the skeleton location, let m4 do
1051 that.
1052 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1053 file will be used.
1054 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1055 (prepare): Given that for the time being changesyntax is not
1056 usable in M4, rename the muscles using `-' to `_'.
1057 Define `defines_flag', `output_parser_name' and `output_header_name'.
1058 * src/output.h (actions_output, guards_output)
1059 (token_definitions_output): Adjust prototypes.
1060 * src/scan-skel.l: Instead of scanning the skeletons, it now
1061 processes the output of m4: `__oline__' and `#output'.
1062 * data/bison.simple: Adjust to be used by M4(sugar).
1063 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1064 to date.
1065 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1066 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1067 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1068 shamelessly stolen from CVS Autoconf.
1069
beda758b
AD
10702002-02-05 Akim Demaille <akim@epita.fr>
1071
1072 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1073 * configure.in: Check for the declarations of free and malloc.
1074 * src/muscle_tab.c: Adjust.
1075
5ece6d43
AD
10762002-02-05 Akim Demaille <akim@epita.fr>
1077
1078 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1079 which have no values.
1080
5bb18f9a
AD
10812002-02-05 Akim Demaille <akim@epita.fr>
1082
1083 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1084 * data/: here.
1085
894dd62e
PE
10862002-01-29 Paul Eggert <eggert@twinsun.com>
1087
1088 * src/bison.simple (YYSIZE_T): Do not define merely because
1089 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1090 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1091
82841af7
AD
10922002-01-27 Akim Demaille <akim@epita.fr>
1093
1094 Fix `%nonassoc and eof'.
1095
1096 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1097 which were not properly copied! Replace
1098 memcpy (res->errs, src->errs, src->nerrs);
1099 with
1100 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
1101 !!!
1102 * tests/regression.at (%nonassoc and eof): Adjust to newest
1103 Autotest: `.' is not in the PATH.
1104
318b76e9
AD
11052002-01-27 Akim Demaille <akim@epita.fr>
1106
1107 * tests/sets.at (AT_EXTRACT_SETS): New.
1108 (Nullable): Use it.
1109 (Firsts): New.
1110
30d2f3d5
AD
11112002-01-26 Akim Demaille <akim@epita.fr>
1112
1113 * tests/actions.at, tests/calc.at, tests/headers.at,
1114 * tests/torture.at: Adjust to the newest Autotest which no longer
1115 forces `.' in the PATH.
1116
30f8c395
AD
11172002-01-25 Akim Demaille <akim@epita.fr>
1118
1119 * tests/regression.at (%nonassoc and eof): New.
1120 Suggested by Robert Anisko.
1121
29ae55f1
AD
11222002-01-24 Akim Demaille <akim@epita.fr>
1123
1124 Bison dumps core when trying to complain about broken input files.
1125 Reported by Cris van Pelt.
1126
1127 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
1128 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
1129 into...
1130 (Invalid inputs): Strengthen: exercise parse_percent_token.
1131
2b548aa6
RA
11322002-01-24 Robert Anisko <robert.anisko@epita.fr>
1133
1134 * src/Makefile.am: Add bison.c++.
1135 * src/bison.c++: New skeleton.
1136
bb0146c2
AD
11372002-01-21 Paolo Bonzini <bonzini@gnu.org>
1138
1139 * po/it.po: New.
1140
bec30531
AD
11412002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
1142
1143 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
1144
fc6edc45
MA
11452002-01-20 Marc Autret <marc@gnu.org>
1146
1147 * src/files.c (compute_output_file_names): Fix
1148
5e5d5415
MA
11492002-01-20 Marc Autret <marc@gnu.org>
1150
1151 * tests/output.at: New test.
1152 * src/files.c (compute_base_names): Don't map extensions when
1153 the YACC flag is set, use defaults.
1154 Reported by Evgeny Stambulchik.
1155
44ea3fbd
MA
11562002-01-20 Marc Autret <marc@gnu.org>
1157
bb0146c2 1158 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
1159 compilers as well (i.e. the vendor C compiler).
1160 Suggested by Albert Chin-A-Young.
1161
338963d1
TVH
11622002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
1163
1164 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
1165 canonical definition.
1166 * src/system.h: Use the canonical definition for PARAMS (avoids
1167 a conflict with the macro from lib/hash.h).
1168
c57b2479
AD
11692002-01-11 Akim Demaille <akim@epita.fr>
1170
1171 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 1172 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 1173
b85810ae
AD
11742002-01-09 Akim Demaille <akim@epita.fr>
1175
1176 * src/files.c, src/files.h (output_infix): New.
1177 (tab_extension): Remove.
1178 (compute_base_names): Compute the former, drop the latter.
1179 * src/output.c (prepare): Insert the muscles `output-infix', and
1180 `output-suffix'.
1181 * src/parse-skel.y (string, string.1): New.
1182 (section.header): Use it.
1183 (section.yacc): Remove.
1184 (prefix): Remove too.
1185 * src/scan-skel.l: Adjust.
1186 * src/bison.simple, src/bison.hairy: Adjust.
1187
cae60122
AD
11882002-01-09 Akim Demaille <akim@epita.fr>
1189
1190 * configure.in (WERROR_CFLAGS): Compute it.
1191 * src/Makefile.am (CFLAGS): Pass it.
1192 * tests/atlocal.in (CFLAGS): Idem.
1193 * src/files.c: Fix a few warnings.
1194 (get_extension_index): Remove, unused.
1195
ae404801
AD
11962002-01-08 Akim Demaille <akim@epita.fr>
1197
1198 * src/getargs.c (AS_FILE_NAME): New.
1199 (getargs): Use it to convert DOSish file names.
1200 * src/files.c (base_name): Rename as full_base_name to avoid
1201 clashes with `base_name ()'.
1202 (filename_split): New.
1203 (compute_base_names): N-th rewrite, using filename_split.
1204
22312b71
AD
12052002-01-08 Akim Demaille <akim@epita.fr>
1206
1207 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
1208 New, stolen from the Fileutils 4.1.
1209 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
1210 * configure.in: Check for the presence of memrchr, and of its
1211 prototype.
1212
a67cef01
TVH
12132002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
1214
1215 * lib/hash.h (__P): Added definition for this macro.
1216 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1217 BUILT_SOURCES, to ensure they are generated first.
1218 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1219 %error-verbose to allow bootstrapping with bison 1.30x.
1220
2b25d624
AD
12212002-01-06 Akim Demaille <akim@epita.fr>
1222
1223 * src/reader.c (parse_braces): Don't fetch the next char, the
1224 convention is to fetch on entry.
1225 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1226 'switch' without a following semicolon.
1227 * tests/regression.at (braces parsing): New.
1228
3460813b
AD
12292002-01-06 Akim Demaille <akim@epita.fr>
1230
1231 Bison is dead wrong in its RR conflict reports.
1232
1233 * tests/torture.at (GNU Cim Grammar): New.
1234 * src/conflicts.c (count_rr_conflicts): Fix.
1235
73784c64
AD
12362002-01-06 Akim Demaille <akim@epita.fr>
1237
1238 Creating package.m4 from configure.ac causes too many problems.
1239
1240 * tests/Makefile.am (package.m4): Create it by hand,
1241 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1242
25d81090
AD
12432002-01-06 Akim Demaille <akim@epita.fr>
1244
1245 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1246 skeleton.h.
1247
a9b8959e
PE
12482002-01-04 Paul Eggert <eggert@twinsun.com>
1249
1250 * doc/bison.texinfo (Debugging):
1251 Remove YYSTDERR; it's no longer defined or used.
1252 Also, s/cstdio.h/cstdio/.
1253
25d81090
AD
12542002-01-03 Akim Demaille <akim@epita.fr>
1255
1256 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1257
1109455c
AD
12582002-01-03 Akim Demaille <akim@epita.fr>
1259
1260 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1261 tracing code to --trace, wait for a better --trace option, with
1262 args.
1263
7ea5e977
AD
12642002-01-03 Akim Demaille <akim@epita.fr>
1265
1266 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1267 The ISO C++ standard is extremely clear about it: stderr is
1268 considered a macro, not a regular symbol (see table 94 `Header
1269 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1270 Therefore std:: does not apply to it. It still does with fprintf.
1271 Also, s/cstdio.h/cstdio/.
1272
fab5b110
AD
12732002-01-03 Akim Demaille <akim@epita.fr>
1274
1275 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1276 for non system headers.
1277
aed7fd9b
AD
12782002-01-02 Akim Demaille <akim@epita.fr>
1279
1280 Equip the skeleton chain with location tracking, runtime trace,
1281 pure parser and scanner.
1282
1283 * src/parse-skel.y: Request a pure parser, locations, and prefix
1284 renaming.
1285 (%union): Having several members with the same type does not help
1286 type mismatches, simplify.
1287 (YYPRINT, yyprint): New.
1288 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1289 (skel_error): this.
1290 Handle locations.
1291 * src/scan-skel.l: Adjust to these changes.
1292 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1293 (LOCATION_PRINT, skel_control_t): New.
1294
24fad99e
AD
12952001-12-30 Akim Demaille <akim@epita.fr>
1296
1297 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1298 replace `gb' with BLANKS.
1299 * src/scan-skel.l: Adjust.
1300
a4b36db4
AD
13012001-12-30 Akim Demaille <akim@epita.fr>
1302
1303 * src/system.h: We don't need nor want bcopy.
1304 Throw away MS-DOS crap: we don't need getpid.
1305 * configure.in: We don't need strndup. It was even causing
1306 problems: because Flex includes the headers *before* us,
1307 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1308 not visible.
1309 * lib/xstrndup.c: New.
1310 * src/scan-skel.l: Use it.
1311 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1312 * src/parse-skel.y: Use %directives instead of #defines.
1313
1239777d
AD
13142001-12-30 Akim Demaille <akim@epita.fr>
1315
1316 * src/skeleton.h: New.
1317 * src/output.c (output_parser, output_master_parser): Remove, dead
1318 code.
1319 * src/output.h (get_lines_number, actions_output, guards_output)
1320 (token_definitions_output): Prototype them.
1321 * src/parse-skel.y: Add the license notice.
1322 Include output.h and skeleton.h.
1323 (process_skeleton): Returns void, and takes a single parameter.
1324 * src/scan-skel.l: Add the license notice.
1325 Include skeleton.h.
1326 Don't use %option yylineno: it seems that then Flex imagines
1327 REJECT has been used, and therefore it won't reallocate its
1328 buffers (which makes no other sense to me than a bug). It results
1329 in warnings for `unused: yy_flex_realloc'.
1330
9b3add5b
RA
13312001-12-30 Robert Anisko <robert.anisko@epita.fr>
1332
1333 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1334 (MUSCLE_INSERT_PREFIX): ...to there.
1335 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1336 (MUSCLE_INSERT_PREFIX): Move from here...
1337
1338 * src/bison.hairy: Add a section directive. Put braces around muscle
1339 names. This parser skeleton is still broken, but Bison should not
1340 choke on a bad muscle 'syntax'.
1341 * src/bison.simple: Add a section directive. Put braces around muscle
1342 names.
1343
1344 * src/files.h (strsuffix, stringappend): Add declarations.
1345 (tab_extension): Add declaration.
1346 (short_base_name): Add declaration.
1347
1348 * src/files.c (strsuffix, stringappend): No longer static. These
1349 functions are used in the skeleton parser.
1350 (tab_extension): New.
1351 (compute_base_names): Use the computations done in this function
fab5b110 1352 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
1353 names.
1354 (short_base_name): No longer static.
1355
1356 * src/output.c (output_skeleton): New.
1357 (output): Disable call to output_master_parser, and give a try to
1358 a new skeleton handling system.
1359 (guards_output, actions_output): No longer static.
1360 (token_definitions_output, get_lines_number): No longer static.
1361
1362 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1363
fab5b110 1364 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
1365 parse-skel.y.
1366
1367 * src/parse-skel.y: New file.
1368 * src/scan-skel.l: New file.
1369
b5b61c61
AD
13702001-12-29 Akim Demaille <akim@epita.fr>
1371
1372 %name-prefix is broken.
1373
1374 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1375 Adjust all dependencies.
1376 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1377 %name-prefix.
1378
1379 Renaming yylval but not yylloc is not consistent. Now we do.
1380
1381 * src/bison.simple: Prefix yylloc if used.
1382 * doc/bison.texinfo (Decl Summary): Document that.
1383
8c9a50be
AD
13842001-12-29 Akim Demaille <akim@epita.fr>
1385
1386 * doc/bison.texinfo: Promote `%long-directive' over
1387 `%long_directive'.
1388 Remove all references to fixed-output-files, yacc is enough.
1389
d99361e6
AD
13902001-12-29 Akim Demaille <akim@epita.fr>
1391
1392 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1393 user prologue. These are defaults.
1394 * tests/actions.at (Mid-rule actions): Make sure the user can
1395 define YYDEBUG and YYERROR_VERBOSE.
1396
b9cecb91
AD
13972001-12-29 Akim Demaille <akim@epita.fr>
1398
1399 * src/output.c (header_output): Don't forget to export YYLTYPE and
1400 yylloc.
1401 * tests/headers.at (export YYLTYPE): New, make sure it does.
1402 * tests/regression.at (%union and --defines, Invalid CPP headers):
1403 Move to...
1404 * tests/headers.at: here.
1405
aea13e97
AD
14062001-12-29 Akim Demaille <akim@epita.fr>
1407
1408 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1409
931394cb
AD
14102001-12-29 Akim Demaille <akim@epita.fr>
1411
1412 * tests/actions.at (Mid-rule actions): Output on a single line
1413 instead of several.
1414
704a47c4
AD
14152001-12-29 Akim Demaille <akim@epita.fr>
1416
1417 * doc/bison.texinfo: Formatting changes.
1418
091e20bb
AD
14192001-12-29 Akim Demaille <akim@epita.fr>
1420
1421 Don't store the token defs in a muscle, just be ready to output it
1422 on command. Now possible via `symbols'. Fixes a memory leak.
1423
1424 * src/output.c (token_definitions_output): New.
1425 (output_parser, header_output): Use it.
1426 * src/reader.c (symbols_save): Remove.
1427
cce71710
AD
14282001-12-29 Akim Demaille <akim@epita.fr>
1429
1430 * src/bison.simple: Do not provide a default for YYSTYPE and
1431 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1432 default.
1433
82c035a8
AD
14342001-12-29 Akim Demaille <akim@epita.fr>
1435
1436 Mid-rule actions are simply... ignored!
1437
1438 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1439 the empty-rule associated to the dummy symbol, not to the host
1440 rule.
1441 * tests/actions.at (Mid-rule actions): New.
1442
8419d367
AD
14432001-12-29 Akim Demaille <akim@epita.fr>
1444
1445 Memory leak.
1446
1447 * src/reader.c (reader): Free grammar.
1448
375d5806
AD
14492001-12-29 Akim Demaille <akim@epita.fr>
1450
1451 Memory leak.
1452
1453 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1454 since it allocates it for each state, although only one is needed.
1455 (allocate_storage): Do it here.
1456
f51cb8ff
AD
14572001-12-29 Akim Demaille <akim@epita.fr>
1458
1459 * src/options.h, src/options.c (create_long_option_table): Rename
1460 as...
1461 (long_option_table_new): this, with a clearer prototype.
1462 (percent_table): Remove, unused,
1463 * src/getargs.c (getargs): Adjust.
1464
29e88316
AD
14652001-12-29 Akim Demaille <akim@epita.fr>
1466
1467 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1468 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1469 as states.
1470
b9f71f19
AD
14712001-12-29 Akim Demaille <akim@epita.fr>
1472
1473 * src/lalr.c (build_relations): Rename `states' as `states1'.
1474 Sorry, I don't understand exactly what it is, no better name...
1475
1a2b5d37
AD
14762001-12-29 Akim Demaille <akim@epita.fr>
1477
1478 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1479 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1480 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1481 as rules.
1482
1cca533e
AD
14832001-12-29 Akim Demaille <akim@epita.fr>
1484
1485 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1486 ago.
1487
c03ae966
AD
14882001-12-29 Akim Demaille <akim@epita.fr>
1489
1490 * src/reader.c, src/reader.h (user_toknums): Remove.
1491 Adjust all users to use symbols[i]->user_token_number.
1492
5a670b1e
AD
14932001-12-29 Akim Demaille <akim@epita.fr>
1494
1495 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1496 Adjust all users to use symbols[i]->prec or ->assoc.
1497
ad949da9
AD
14982001-12-29 Akim Demaille <akim@epita.fr>
1499
1500 * src/reader.c, src/reader.h (tags): Remove.
1501 Adjust all users to use symbols[i]->tag.
1502
0e78e603
AD
15032001-12-29 Akim Demaille <akim@epita.fr>
1504
1505 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1506 and rule_table.
1507 * src/reader.c (packsymbols): Fill this table.
1508 Drop sprec.
1509 * src/conflicts.c (resolve_sr_conflict): Adjust.
1510 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1511 single table.
1512 Use symbols[i]->tag instead of tags[i].
1513
213e640e
AD
15142001-12-29 Akim Demaille <akim@epita.fr>
1515
1516 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1517 In addition, put a comment in there, to replace...
1518 * tests/regression.at (%union and C comments): Remove.
1519
e7b8bef1
AD
15202001-12-29 Akim Demaille <akim@epita.fr>
1521
1522 * tests/regression.at (Web2c Actions): Blindly move the actual
1523 output as expected output. The contents *seem* right to me, but I
1524 can't pretend reading perfectly parser tables... Nonetheless, all
1525 the other tests pass correctly, the table look OK, even though the
1526 presence of `$axiom' is to be noted: AFAICS it is useless (but
1527 harmless).
1528
b68e7744
AD
15292001-12-29 Akim Demaille <akim@epita.fr>
1530
1531 * src/reader.c (readgram): Don't add the rule 0 if there were no
1532 rules read. In other words, add it _after_ having performed
1533 grammar sanity checks.
1534 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1535
78d5bae9
AD
15362001-12-29 Akim Demaille <akim@epita.fr>
1537
1538 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1539 visible, and some states have now a different number.
1540
ff442794
AD
15412001-12-29 Akim Demaille <akim@epita.fr>
1542
1543 * src/reader.c (readgram): Bind the initial rule's lineno to that
1544 of the first rule.
1545 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1546 (Solved SR Conflicts): Adjust rule 0's line number.
1547
610ab194
AD
15482001-12-29 Akim Demaille <akim@epita.fr>
1549
1550 Fix the `GAWK Grammar' failure.
1551
1552 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1553 the reductions of the first state which was mistakenly confused
1554 with the final state because precisely final_state was initialized
1555 to 0.
1556 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1557 now noticed by Bison.
1558 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1559 have a reduction on $default.
1560
29d29c8f
AD
15612001-12-29 Akim Demaille <akim@epita.fr>
1562
1563 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1564 rule line numbers.
1565 * src/closure.c (print_closure): Likewise.
1566 * src/derives.c (print_derives): Likewise.
1567 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1568 now.
1569
7c6b64d0
AD
15702001-12-29 Akim Demaille <akim@epita.fr>
1571
1572 * src/lalr.c (lookaheads_print): New.
1573 (lalr): Call it when --trace-flag.
1574 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1575 are dumped.
1576
3d4daee3
AD
15772001-12-29 Akim Demaille <akim@epita.fr>
1578
1579 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1580 when walking through ritem, even via rule->rhs.
1581 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1582 (useful_production, useless_nonterminals): Likewise.
1583 (reduce_grammar_tables): Likewise, plus update nritems.
1584 * src/nullable.c (set_nullable): Likewise.
1585 * src/lalr.c (build_relations): Likewise.
1586 * tests/sets.at (Nullable): Adjust.
1587 Fortunately, now, the $axiom is no longer nullable.
1588
9e7f6bbd
AD
15892001-12-29 Akim Demaille <akim@epita.fr>
1590
1591 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1592 the 0-sentinel.
1593 * src/gram.c (ritem_longest_rhs): Likewise.
1594 * src/reduce.c (nonterminals_reduce): Likewise.
1595 * src/print_graph.c (print_graph): Likewise.
1596 * src/output.c (output_rule_data): Likewise.
1597 * src/nullable.c (set_nullable): Likewise.
1598
255ef638
AD
15992001-12-29 Akim Demaille <akim@epita.fr>
1600
1601 * src/output.c: Comment changes.
1602
0d8a7363
AD
16032001-12-27 Paul Eggert <eggert@twinsun.com>
1604
1605 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1606 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1607 Sparc, as they were causing more porting problems than the
1608 (minor) performance improvement was worth.
1609
1610 Also, catch up with 1.31's YYSTD.
1611
3db472b9
AD
16122001-12-27 Akim Demaille <akim@epita.fr>
1613
1614 * src/output.c (output_gram): Rely on nritems, not the
1615 0-sentinel. See below.
1616 Use -1 as separator, not 0.
1617 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1618 Rely on -1 as separator in yyrhs, instead of 0.
1619 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1620 twice `Now at end of input', therefore there are two lines less to
1621 expect.
1622
b365aa05
AD
16232001-12-27 Akim Demaille <akim@epita.fr>
1624
1625 * tests/regression.at (Unresolved SR Conflicts):
1626 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1627 below.
1628
30171f79
AD
16292001-12-27 Akim Demaille <akim@epita.fr>
1630
1631 * src/LR0.c (new_state): Recognize the final state by the fact it
1632 is reached by eoftoken.
1633 (insert_start_shifting_state, insert_eof_shifting_state)
1634 (insert_accepting_state, augment_automaton): Remove, since now
1635 these states are automatically computed from the initial state.
1636 (generate_states): Adjust.
1637 * src/print.c: When reporting a rule number to the user, substract
1638 1, so that the axiom rule is rule 0, and the first user rule is 1.
1639 * src/reduce.c: Likewise.
1640 * src/print_graph.c (print_core): For the time being, just as for
1641 the report, depend upon --trace-flags to dump the full set of
1642 items.
1643 * src/reader.c (readgram): Once the grammar read, insert the rule
1644 0: `$axiom: START-SYMBOL $'.
1645 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1646 number of the states has changed (the final state is no longer
1647 necessarily the last), catch up.
1648
75142d45
AD
16492001-12-27 Akim Demaille <akim@epita.fr>
1650
1651 Try to make the use of the eoftoken valid. Given that its value
1652 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1653 is used instead of > 0 where appropriate, (ii), depend upon nritems
1654 instead of the 0-sentinel.
1655
1656 * src/gram.h, src/gram.c (nritems): New.
1657 Expected to be duplication of nitems, but for the time being...
1658 * src/reader.c (packgram): Assert nritems and nitems are equal.
1659 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1660 * src/closure.c (print_closure, print_fderives): Likewise.
1661 * src/gram.c (ritem_print): Likewise.
1662 * src/print.c (print_core, print_grammar): Likewise.
1663 * src/print_graph.c: Likewise.
1664
b7c49edf
AD
16652001-12-27 Akim Demaille <akim@epita.fr>
1666
1667 * src/main.c (main): If there are complains after grammar
1668 reductions, then output the report anyway if requested, then die.
1669 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1670 * src/reader.c (eoftoken): New.
1671 (parse_token_decl): If the token being defined has value `0', it
1672 is the eoftoken.
1673 (packsymbols): No longer hack `tags' to insert `$' by hand.
1674 Be sure to preserve the value of the eoftoken.
1675 (reader): Make sure eoftoken is defined.
1676 Initialize nsyms to 0: now eoftoken is created just like the others.
1677 * src/print.c (print_grammar): Don't special case the eof token.
1678 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1679 lie anyway, albeit pleasant.
1680 * tests/calc.at: Exercise error messages with eoftoken.
1681 Change the grammar so that empty input is invalid.
1682 Adjust expectations.
1683 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1684
ec2da99f
AD
16852001-12-27 Akim Demaille <akim@epita.fr>
1686
1687 * configure.in: Check the protos of strchr ans strspn.
1688 Replace strchr if needed.
1689 * src/system.h: Provide the protos of strchr, strspn and memchr if
1690 missing.
1691 * lib/strchr.c: New.
1692 * src/reader.c (symbols_save): Use strchr.
1693
8adfa272
AD
16942001-12-27 Akim Demaille <akim@epita.fr>
1695
1696 * src/print.c, src/print_graph.c (escape): New.
1697 Use it to quote the TAGS outputs.
1698 * src/print_graph.c (print_state): Now errors are in red, and
1699 reductions in green.
1700 Prefer high to wide: output the state number on a line of its own.
1701
80dac38c
AD
17022001-12-27 Akim Demaille <akim@epita.fr>
1703
1704 * src/state.h, src/state.c (reductions_new): New.
1705 * src/LR0.c (set_state_table): Let all the states have a
1706 `reductions', even if reduced to 0.
1707 (save_reductions): Adjust.
1708 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1709 * src/print.c (print_reductions, print_actions): Adjust.
1710 * src/output.c (action_row): Adjust.
1711
2cec70b9
AD
17122001-12-27 Akim Demaille <akim@epita.fr>
1713
1714 * src/state.h, src/state.c (errs_new, errs_dup): New.
1715 * src/LR0.c (set_state_table): Let all the states have an errs,
1716 even if reduced to 0.
1717 * src/print.c (print_errs, print_reductions): Adjust.
1718 * src/output.c (output_actions, action_row): Adjust.
1719 * src/conflicts.c (resolve_sr_conflict): Adjust.
1720
13ca549a
AD
17212001-12-27 Akim Demaille <akim@epita.fr>
1722
1723 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1724
5092aba5
AD
17252001-12-27 Akim Demaille <akim@epita.fr>
1726
1727 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1728 * src/print.c: here.
1729 (lookaheadset, shiftset): New, used as additional storage by
1730 print_reductions.
1731 (print_results): Adjust.
1732 (print_shifts, print_gotos, print_errs): New, extracted from...
1733 (print_actions): here.
1734 * src/print_graph.c (print_actions): Remove dead code.
1735
11e2beca
AD
17362001-12-27 Akim Demaille <akim@epita.fr>
1737
1738 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1739 `$n' and `@n'.
1740
dac3c910
AD
17412001-12-27 Akim Demaille <akim@epita.fr>
1742
1743 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1744 (build_relations): Adjust.
1745
d0b0fefa
AD
17462001-12-27 Akim Demaille <akim@epita.fr>
1747
1748 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1749 duplication.
1750
adc8c848
AD
17512001-12-27 Akim Demaille <akim@epita.fr>
1752
1753 * src/reader.c (packgram): Catch nitems overflows.
1754
14d293ac
AD
17552001-12-27 Akim Demaille <akim@epita.fr>
1756
1757 * src/files.c, src/files.h (guard_obstack): Remove.
1758 * src/output.c (output): Adjust.
1759 * src/reader.c (parse_braces): New, factoring...
1760 (copy_action, copy_guard): these two which are renamed as...
1761 (parse_action, parse_guard): these.
1762 As a voluntary consequence, using braces around guards is now
1763 mandatory.
1764
f499b062
AD
17652001-12-27 Akim Demaille <akim@epita.fr>
1766
1767 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1768 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1769 members.
1770 (symbol_list_new): Adjust.
1771 (copy_action): action_line is the first line, not the last.
1772 (copy_guard): Just as for actions, store the `action' only, not
1773 the switch/case/break flesh.
1774 Don't parse the user action that might follow the guard, let...
1775 (readgram): do it, i.e., now, there can be an action after a
1776 guard.
1777 In other words the guard is just explicitly optional.
1778 (packgram): Adjust.
1779 * src/output.c (guards_output): New.
1780 (output_parser): Call it when needed.
1781 (output): Also free the guard and attrs obstacks.
1782 * src/files.c, src/files.h (obstack_save): Remove.
1783 (output_files): Remove.
1784 As a result, if one needs the former `.act' file, using an
1785 appropriate skeleton which requires actions and guards is now
1786 required.
1787 * src/main.c (main): Adjust.
1788 * tests/semantic.at: New.
1789 * tests/regression.at: Use `input.y' as input file name.
1790 Avoid 8+3 problems by requiring input.c when the test needs the
1791 parser.
1792
d945f5cd
AD
17932001-12-27 Akim Demaille <akim@epita.fr>
1794
1795 * src/reader.c (symbol_list_new): Be sure to initialize all the
1796 fields.
1797
d200e455
AD
17982001-12-27 Akim Demaille <akim@epita.fr>
1799
1800 All the hacks using a final pseudo state are now useless.
1801
1802 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1803 * src/lalr.c (nLA): New.
1804 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1805 instead of lookaheadsp from the pseudo state (nstate + 1).
1806
f9507c28
AD
18072001-12-27 Akim Demaille <akim@epita.fr>
1808
1809 * src/output.c (action_row, token_actions): Use a state_t instead
1810 of a integer, and nlookaheads instead of the following state's
1811 lookaheadsp.
1812
065fbd27
AD
18132001-12-27 Akim Demaille <akim@epita.fr>
1814
1815 * src/conflicts.c (log_resolution, flush_shift)
1816 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1817 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1818 (conflicts_print, print_reductions): Use a state_t instead of an
1819 integer when referring to a state.
1820 As much as possible, depend upon nlookaheads, instead of the
1821 `lookaheadsp' member of the following state (since lookaheads of
1822 successive states are successive, the difference between state n + 1
1823 and n served as the number of lookaheads for state n).
1824 * src/lalr.c (add_lookback_edge): Likewise.
1825 * src/print.c (print_core, print_actions, print_state)
1826 (print_results): Likewise.
1827 * src/print_graph.c (print_core, print_actions, print_state)
1828 (print_graph): Likewise.
1829 * src/conflicts.h: Adjust.
1830
1b177bd7
AD
18312001-12-27 Akim Demaille <akim@epita.fr>
1832
1833 * src/bison.hairy: Formatting/comment changes.
1834 ANSIfy.
1835 Remove `register' indications.
1836 Add plenty of `static'.
1837
7742ddeb
AD
18382001-12-27 Akim Demaille <akim@epita.fr>
1839
1840 * src/output.c (prepare): Drop the muscle `ntbase' which
1841 duplicates ntokens.
1842 * src/bison.simple: Formatting/comment changes.
1843 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1844 is an undocumented synonym.
1845
1fa14068
AD
18462001-12-22 Akim Demaille <akim@epita.fr>
1847
1848 * src/output.c (output_table_data): Change the prototype to use
1849 `int' for array ranges: some invocations do pass an int, not a
1850 short.
1851 Reported by Wayne Green.
1852
b9752825
AD
18532001-12-22 Akim Demaille <akim@epita.fr>
1854
1855 Some actions of web2c.y are improperly triggered.
1856 Reported by Mike Castle.
1857
1858 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1859 * tests/regression.at (Web2c): Rename as...
1860 (Web2c Report): this.
1861 (Web2c Actions): New.
1862
776209d6
AD
18632001-12-22 Akim Demaille <akim@epita.fr>
1864
1865 Reductions in web2c.y are improperly reported.
1866 Reported by Mike Castle.
1867
1868 * src/conflicts.c (print_reductions): Fix.
1869 * tests/regression.at (Web2c): New.
1870
275fc3ad
AD
18712001-12-18 Akim Demaille <akim@epita.fr>
1872
1873 Some host fail on `assert (!"foo")', which expands to
1874 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1875 Reported by Nelson Beebee.
1876
1877 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1878 `#define it_succeeded 0' and `assert (it_succeeded)'.
1879
897668ee
MA
18802001-12-17 Marc Autret <autret_m@epita.fr>
1881
1882 * src/bison.simple: Don't hard code the skeleton line and filename.
1883 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1884 New line counter 'skeleton_line' (skeleton-line muscle).
1885
ab3399e0
PE
18862001-12-17 Paul Eggert <eggert@twinsun.com>
1887
1888 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1889 YYDEBUG must be defined to a nonzero value.
1890
1891 * src/bison.simple (yytname): Do not assume that the user defines
1892 YYDEBUG to a properly parenthesized expression.
1893
3877f72b
AD
18942001-12-17 Akim Demaille <akim@epita.fr>
1895
1896 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1897 nlookaheads is a new member.
1898 Adjust all users.
1899 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1900 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1901 state.
776209d6 1902
331dbc1b
AD
19032001-12-17 Akim Demaille <akim@epita.fr>
1904
1905 * src/files.h, src/files.c (open_files, close_files): Remove.
1906 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1907 let...
1908 * src/reader.c (reader): Do it.
776209d6 1909
be750e4c
AD
19102001-12-17 Akim Demaille <akim@epita.fr>
1911
1912 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 1913
709ae8c6
AD
19142001-12-17 Akim Demaille <akim@epita.fr>
1915
1916 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1917 (flush_reduce): New.
1918 (resolve_sr_conflict): Adjust.
776209d6 1919
f87685c3
AD
19202001-12-17 Akim Demaille <akim@epita.fr>
1921
1922 * src/output.c (output_obstack): Be static and rename as...
1923 (format_obstack): this, to avoid any confusion with files.c's
1924 output_obstack.
1925 * src/reader.h (muscle_obstack): Move to...
1926 * src/output.h: here, since it's defined in output.c.
1927
837491d8
AD
19282001-12-17 Akim Demaille <akim@epita.fr>
1929
1930 * src/output.c (action_row, save_column, default_goto)
1931 (sort_actions, matching_state, pack_vector): Better variable
1932 locality.
1933
796d61fb
AD
19342001-12-17 Akim Demaille <akim@epita.fr>
1935
1936 * src/output.c: Various formatting changes.
776209d6 1937
64d15509
AD
19382001-12-17 Akim Demaille <akim@epita.fr>
1939
1940 * src/files.c (output_files): Free the output_obstack.
1941 * src/main.c (main): Call print and print_graph conditionally.
1942 * src/print.c (print): Work unconditionally.
1943 * src/print_graph.c (print_graph): Work unconditionally.
1944 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1945
fbc8ecb7
MA
19462001-12-16 Marc Autret <autret_m@epita.fr>
1947
1948 * src/output.c (actions_output): Fix. When we use %no-lines,
1949 there is one less line per action.
1950
f0440388
MA
19512001-12-16 Marc Autret <autret_m@epita.fr>
1952
1953 * src/bison.simple: Remove a useless #line directive.
1954 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1955 * src/output.c (get_lines_number): New.
776209d6 1956 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
1957 output muscles.
1958 Fix line numbering.
1959 (actions_output): Computes the number of lines taken by actions.
1960 (output_master_parser): Insert new skeleton which is the name of
1961 the output parser file name.
1962
a79986b8
MA
19632001-12-15 Marc Autret <autret_m@epita.fr>
1964
1965 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1966
4ec8e00f
MA
19672001-12-15 Marc Autret <autret_m@epita.fr>
1968
1969 * src/output.c (output_gram): Keep track of the hairy one.
1970
1a4648ff
AD
19712001-12-15 Akim Demaille <akim@epita.fr>
1972
1973 Make `make distcheck' work.
1974
1975 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1976 system.h which uses libgettext.h.
1977
9c2c67e6
AD
19782001-12-15 Akim Demaille <akim@epita.fr>
1979
1980 * src/nullable.c (set_nullable): Useless rules must be skipped,
1981 otherwise, since we range over their symbols, we might look at a
1982 nonterminal which no longer ``exists'', i.e., it is not counted in
1983 `nvars', hence we overflow our arrays.
1984
93ede233
AD
19852001-12-15 Akim Demaille <akim@epita.fr>
1986
1987 The header can also be produced directly, without any obstack!
1988 Yahoo!
1989
1990 * src/files.c, src/files.h (defines_obstack): Remove.
1991 (compute_header_macro): Global.
1992 (defines_obstack_save): Remove.
1993 * src/reader.c (parse_union_decl): No longer output to
1994 defines_obstack: its content can be found in the `stype' muscle
1995 anyway.
1996 (output_token_translations): Merge into...
1997 (symbols_output): this.
1998 Rename as...
1999 (symbols_save): this.
2000 (reader): Adjust.
2001 * src/output.c (header_output): New.
2002 (output): Call it.
2003
2666f928
AD
20042001-12-15 Akim Demaille <akim@epita.fr>
2005
2006 * src/reader.c (parse_union_decl): Instead of handling two obstack
2007 simultaneously, use one to define the `stype' muscle, and use the
2008 value of the latter to fill defines_obstack.
2009 (copy_comment): Remove.
2010 (copy_comment2): Work for a single obstack.
2011 Rename as...
2012 (copy_comment): this.
2013
428046f8
AD
20142001-12-15 Akim Demaille <akim@epita.fr>
2015
2016 * src/lex.c, src/lex.h (xgetc): No longer static.
2017 * src/reader.c (parse_union_decl): Revamp.
2018
ea52d706
AD
20192001-12-15 Akim Demaille <akim@epita.fr>
2020
2021 Still making progress in separating Bison into (i) input, (ii)
2022 process, (iii) output: now we can directly output the parser file
2023 without using table_obstack at all.
2024
2025 * src/files.c, src/files.h (table_obstack): Bye bye.
2026 (parser_file_name): New.
2027 * src/files.c (compute_output_file_names): Compute it.
2028 * src/output.c (actions_output, output_parser)
2029 (output_master_parser): To a file instead of an obstack.
2030
3f96f4dc
AD
20312001-12-15 Akim Demaille <akim@epita.fr>
2032
2033 Attach actions to rules, instead of pre-outputting them to
2034 actions_obstack.
2035
2036 * src/gram.h (rule_t): action and action_line are new members.
2037 * src/reader.c (symbol_list): Likewise.
2038 (copy_action): Save the actions within the rule.
2039 (packgram): Save them in rule_table.
2040 * src/output.c (actions_output): New.
2041 (output_parser): Use it on `%%actions'.
2042 (output_rule_data): Don't free rule_table.
2043 (output): Do it.
2044 (prepare): Don't save the `action' muscle.
2045 * src/bison.simple: s/%%action/%%actions/.
2046
51576fb3
AD
20472001-12-15 Akim Demaille <akim@epita.fr>
2048
2049 * src/reader.c (copy_action): When --yacc, don't append a `;'
2050 to the user action: let it fail if lacking.
dee049eb 2051 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 2052
2648a72d
AD
20532001-12-14 Akim Demaille <akim@epita.fr>
2054
2055 * src/lex.c (literalchar): Simply return the char you decoded, non
2056 longer mess around with obstacks and int pointers.
2057 Adjust all callers.
2058
92790e5b
AD
20592001-12-14 Akim Demaille <akim@epita.fr>
2060
2061 * src/lex.c (literalchar): Don't escape the special characters,
2062 just decode them, and keep them as char (before, eol was output as
2063 the 2 char string `\n' etc.).
2064 * src/output.c (output_rule_data): Use quotearg to output the
2065 token strings.
2066
927c1557
PE
20672001-12-13 Paul Eggert <eggert@twinsun.com>
2068
2069 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2070 Do not infringe on the global user namespace when using C++.
2071 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2072 All uses of `fprintf' and `stderr' changed.
2073
2074 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2075
ed8e1f68
AD
20762001-12-13 Akim Demaille <akim@epita.fr>
2077
2078 The computation of nullable is broken: it doesn't handle empty
2079 RHS's properly.
2080
2081 * tests/torture.at (GNU AWK Grammar): New.
2082 * tests/sets.at (Nullable): New.
2083 * src/nullable.c (set_nullable): Instead of blindly looping over
2084 `ritems', loop over the rules, and then over their rhs's.
2085
2086 Work around Autotest bugs.
2087
2088 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2089 frame, because Autotest understand lines starting with a `+' as
2090 traces from the shell. Then, they are not processed properly.
2091 Admittedly an Autotest bug, but we don't have time to wait for
2092 Autotest to catch up.
2093 * tests/regression.at (Broken Closure): Adjust to the new table
2094 frames.
2095 Move to...
2096 * tests/sets.at: here.
2097
cb581495
AD
20982001-12-13 Akim Demaille <akim@epita.fr>
2099
2100 * src/closure.c (closure): Use nrules instead of playing tricks
2101 with BITS_PER_WORD.
2102
2e729273
AD
21032001-12-13 Akim Demaille <akim@epita.fr>
2104
2105 * src/print.c (print_actions): Output the handling of `$' as the
2106 traces do: shifting the token EOF. Before EOF was treated as a
2107 nonterminal.
2108 * tests/regression.at: Adjust some tests.
2109 * src/print_graph.c (print_core): Complete the set of items via
2110 closure. The next-to-final and final states are still unsatisfying,
2111 but that's to be addressed elsewhere.
2112 No longer output the rule numbers, but do output the state number.
2113 A single loop for the shifts + gotos is enough, but picked a
2114 distinct color for each.
2115 (print_graph): Initialize and finalize closure.
2116
107f7dfb
AD
21172001-12-13 Akim Demaille <akim@epita.fr>
2118
2119 * src/reader.c (readgram): Remove dead code, an strip useless
2120 braces.
2121 (get_type): Remove, unused.
2122
9b53a24f
AD
21232001-12-12 Akim Demaille <akim@epita.fr>
2124
2125 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
2126 on that of lib/error.c.
2127
dbfb6dcd
AD
21282001-12-12 Akim Demaille <akim@epita.fr>
2129
2130 Some hosts don't like `/' in includes.
2131
2132 * src/system.h: Include libgettext.h without qualifying the path.
2133 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
2134 $(top_srcdir).
2135
c25fb648
MA
21362001-12-11 Marc Autret <autret_m@epita.fr>
2137
2138 * src/output.c (output_parser): Remove useless muscle.
2139
710ddc4f
MA
21402001-12-11 Marc Autret <autret_m@epita.fr>
2141
2142 * src/bison.simple: Remove #line just before %%epilogue. It
2143 is now handled in ...
2144 * src/reader.c (read_additionnal_code): Add the output of a
2145 #line for the epilogue.
2146
e83d80b8
MA
21472001-12-10 Marc Autret <autret_m@epita.fr>
2148
927c1557 2149 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
2150 replace precedent remove.
2151 * src/bison.simple: Remove #line before %%prologue because
2152 %%input-line is wrong at this time.
2153
971d5158
MA
21542001-12-10 Marc Autret <autret_m@epita.fr>
2155
2156 * src/reader.c (symbols_output): Clean up.
927c1557 2157 * src/output.c (output_gram, output): Clean up.
971d5158 2158
5edafffd
AD
21592001-12-10 Akim Demaille <akim@epita.fr>
2160
2161 * src/lalr.c (initialize_lookaheads): New. Extracted from...
2162 * src/LR0.c (set_state_table): here.
2163 * src/lalr.c (lalr): Call it.
2164
0279f8e9
AD
21652001-12-10 Akim Demaille <akim@epita.fr>
2166
2167 * src/state.h (shifts): Remove the `number' member: shifts are
2168 attached to state, hence no longer need to be labelled with a
2169 state number.
2170
190c4f5f
AD
21712001-12-10 Akim Demaille <akim@epita.fr>
2172
2173 Now that states have a complete set of members, the linked list of
2174 shifts is useless: just fill directly the state's shifts member.
2175
2176 * src/state.h (shifts): Remove the `next' member.
2177 * src/LR0.c (first_state, last_state): Remove.
2178 Adjust the callers.
2179 (augment_automaton): Don't look for the shifts that must be added
2180 a shift on EOF: it is those of the state we looked for! But now,
2181 since shifts are attached, it is no longer needed to looking
2182 merely by its id: its number.
2183
2a73b93d
AD
21842001-12-10 Akim Demaille <akim@epita.fr>
2185
2186 * src/LR0.c (augment_automaton): Better variable locality.
2187 Remove an impossible branch: if there is a state corresponding to
2188 the start symbol being shifted, then there is shift for the start
2189 symbol from the initial state.
2190
74392f6a
AD
21912001-12-10 Akim Demaille <akim@epita.fr>
2192
2193 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
2194 only when appropriate: when insert_start_shifting_state' is not
2195 invoked.
2196 * tests/regression.at (Rule Line Numbers): Adjust.
2197
37c82725
AD
21982001-12-10 Akim Demaille <akim@epita.fr>
2199
2200 * src/LR0.c (augment_automaton): Now that all states have shifts,
2201 merge the two cases addition shifts to the initial state.
2202
6a164e0c
AD
22032001-12-10 Akim Demaille <akim@epita.fr>
2204
2205 * src/lalr.c (set_state_table): Move to...
2206 * src/LR0.c: here.
2207 * src/lalr.c (lalr): Don't call it...
2208 * src/LR0.c (generate_states): do it.
2209 * src/LR0.h (first_state): Remove, only the table is used.
2210
7215de24
AD
22112001-12-10 Akim Demaille <akim@epita.fr>
2212
2213 * src/LR0.h (first_shift, first_reduction): Remove.
2214 * src/lalr.c: Don't use first_shift: find shifts through the
2215 states.
2216
80e25d4d
AD
22172001-12-10 Akim Demaille <akim@epita.fr>
2218
2219 * src/LR0.c: Attach shifts to states as soon as they are
2220 computed.
2221 * src/lalr.c (set_state_table): Instead of assigning shifts to
2222 state, just assert that the mapping was properly done.
2223
0ab3728b
AD
22242001-12-10 Akim Demaille <akim@epita.fr>
2225
2226 * src/LR0.c (insert_start_shift): Rename as...
2227 (insert_start_shifting_state): this.
2228 (insert_eof_shifting_state, insert_accepting_state): New.
2229 (augment_automaton): Adjust.
2230 Better locality of the variables.
2231 When looking if the start_symbol is shifted from the initial
2232 state, using `while (... symbol != start_symbol ...)' sounds
2233 better than `while (... symbol < start_symbol ...)': If fail
2234 to see how the order between symbols could be relevant!
2235
78af9bbc
AD
22362001-12-10 Akim Demaille <akim@epita.fr>
2237
2238 * src/getargs.h: Don't declare `spec_name_prefix' and
2239 `spec_file_prefix', declared by src/files.h.
2240 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2241 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2242 * src/output.c (prepare): Adjust.
2243 * src/reader.c (symbols_output): Likewise.
2244 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2245
bdef2a41
AD
22462001-12-10 Akim Demaille <akim@epita.fr>
2247
2248 * src/muscle_tab.c (muscle_init): NULL is a better default than
2249 `"0"'.
2250
3735969c
AD
22512001-12-10 Akim Demaille <akim@epita.fr>
2252
2253 * src/reader.c (reader): Calling symbols_output once is enough.
2254
49701457
AD
22552001-12-10 Akim Demaille <akim@epita.fr>
2256
2257 Now that states have a complete set of members, the linked list of
2258 reductions is useless: just fill directly the state's reductions
2259 member.
2260
2261 * src/state.h (struct reductions): Remove member `number' and
2262 `next'.
2263 * src/LR0.c (first_reduction, last_reduction): Remove.
2264 (save_reductions): Don't link the new reductions, store them in
2265 this_state.
2266 * src/lalr.c (set_state_table): No need to attach reductions to
2267 states, it's already done.
2268 * src/output.c (output_actions): No longer free the shifts, then
2269 the reductions, then the states: free all the states and their
2270 members.
2271
0edad749
AD
22722001-12-10 Akim Demaille <akim@epita.fr>
2273
2274 * src/options.c (OPTN, DRTV, BOTH): New.
2275 (option_table): Use them.
2276
0edad749
AD
2277 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2278 the job of system.h.
2279 * src/options.c: Don't include stdio.h and xalloc.h for the same
2280 reasons.
2281
5449dd0f
AD
22822001-12-10 Akim Demaille <akim@epita.fr>
2283
2284 * src/output.c (output, prepare): Make sure the values of the
2285 muscles `action' and `prologue' are 0-terminated.
2286
a870c567
AD
22872001-12-10 Akim Demaille <akim@epita.fr>
2288
2289 Clean up GCC warnings.
2290
2291 * src/reader.c (copy_action): `buf' is not used.
2292 (parse_skel_decl): Be static.
2293 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2294 * src/options.h (create_long_option_table): Have a real prototype.
2295 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2296 (hash_delete_at): Return const void *.
2297 Adjust casts to preserve the const.
2298
80df8768
AD
22992001-12-10 Akim Demaille <akim@epita.fr>
2300
2301 * configure.in: Require 2.52g.
2302 M4 is not needed, but AUTOM4TE is.
2303 * m4/m4.m4: Remove.
2304 * tests/Makefile.am: Adjust.
2305
f693ad14
AD
23062001-12-10 Akim Demaille <akim@epita.fr>
2307
2308 One structure for states is enough, even though theoretically
2309 there are LR(0) states and LALR(1) states.
2310
2311 * src/lalr.h (state_t): Remove.
2312 (state_table): Be state_t **, not state_t *.
2313 * src/state.h (core, CORE_ALLOC): Rename as...
2314 (state_t, STATE_ALLOC): this.
2315 Add the LALR(1) members: shifts, reductions, errs.
2316 * src/LR0.c (state_table): Rename as...
2317 (state_hash): this, to avoid name clashes with the global
2318 `state_table'.
2319 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2320 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2321
74ffbcb6
AD
23222001-12-10 Akim Demaille <akim@epita.fr>
2323
2324 Bison dumps core on bash.y.
2325 Reported by Pascal Bart.
2326
2327 * src/warshall.c (bitmatrix_print): New.
2328 (TC): Use it.
2329 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2330 j must be the outer loop.
2331 * tests/regression.at (Broken Closure): New.
2332
07708e19
AD
23332001-12-05 Akim Demaille <akim@epita.fr>
2334
2335 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2336 its argument.
2337