]> git.saurik.com Git - bison.git/blame - ChangeLog
* tests/glr-regression.at
[bison.git] / ChangeLog
CommitLineData
f5228370
PE
12005-12-07 Paul Eggert <eggert@cs.ucla.edu>
2
3 * tests/glr-regression.at
4 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5 Close memory leak reported by twlevo.
6
69ce078b
PE
72005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
8
6ff99711
PE
9 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10 all stacks.
11 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
12 * tests/glr-regression.at (No users destructors if stack 0 deleted):
13 New test case.
14 (Duplicated user destructor for lookahead): This test now is expected
15 to succeed.
16
af3412cd
PE
172005-12-01 Paul Eggert <eggert@cs.ucla.edu>
18
32b5b719 19 * NEWS: Document the following change.
af3412cd
PE
20 * data/yacc.c: Say "parser skeleton" rather than "file", since
21 it's no longer just a file.
22 * data/glr.c: Grant a special exception for C GLR parsers, that
23 reads like the already-existing exception for C LALR(1) parsers.
24 * data/glr.cc: Likewise.
25 * data/lalr1.cc: Likewise.
26 * data/location.cc: Likewise.
27 * data/yacc.c: Reword the "written by" statement to clarify that
28 it was the parser skeleton, not the entire output file.
29 * data/glr.c: Written by Paul Hilfinger.
30 * data/glr.cc: Written by Akim Demaille.
31 * data/lalr1.cc: Likewise.
32
035aa4a0
PE
332005-11-18 Paul Eggert <eggert@cs.ucla.edu>
34
d9963c85
PE
35 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
36 Fix typos in previous change that broke 'make check'.
37 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
38 supported in C.
39 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
40 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
41 We can revert this once things settle down.
42
035aa4a0
PE
43 * src/conflicts.c (conflicts_print): Don't print file name twice
44 when %expect fails because there were no conflicts.
45 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
46 change.
47 * tests/conflicts.at (%expect not enough, %expect too much):
48 (%expect with reduce conflicts): Adjust to new behavior.
49
502005-11-18 Akim Demaille <akim@epita.fr>
51
52 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
53 errors.
54 * NEWS: Document this.
55 * doc/bison.texinfo (Expect Decl): Likewise.
56
d1ff7a7c
AD
572005-11-16 Akim Demaille <akim@epita.fr>
58
59 Generalize the display of semantic values and locations in traces.
60 * data/glr.c (yy_reduce_print): Fix indices (again).
61 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
62 literal integers.
63 * data/lalr1.cc (yyreduce_print): Rename as...
64 (yy_reduce_print): this.
65 Display values and locations.
66 * data/yacc.c (yy_reduce_print): Likewise.
67 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
68 (yysymprint): Move higher to be visible from yy_reduce_print).
69 (yyparse): Adjust.
70 * tests/calc.at: Adjust the expected length of the traces.
71
6de5398d
AD
722005-11-14 Akim Demaille <akim@epita.fr>
73
74 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
75 from 1 to N, while values and location start at 0.
76 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
77
a1373f55
AD
782005-11-14 Akim Demaille <akim@epita.fr>
79
80 * data/glr.c (yy_reduce_print): Fix the $ number.
81
613d8952
AD
822005-11-14 Akim Demaille <akim@epita.fr>
83
84 "Use" parse parameters.
85 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
86 * data/glr.c, data/glr.cc: Use them.
87 * data/glr.c (YYUSE): Have a C++ definition that supports
88 non-pointer types.
89
b2741627
AD
902005-11-14 Akim Demaille <akim@epita.fr>
91
92 * data/glr.c (yyexpandGLRStack): Declare only if defined.
93
5059b5c8
AD
942005-11-14 Akim Demaille <akim@epita.fr>
95
42249483
AD
96 * data/glr.cc: New.
97 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 98
4626a15d
AD
992005-11-12 Akim Demaille <akim@epita.fr>
100
101 Let position and location be PODs.
102 * data/location.cc (position::initialize, location::initialize): New.
103 (position::position, location::location): Define only if
104 b4_location_constructors is defined.
105 * data/lalr1.cc (b4_location_constructors): Define it for backward
106 compatibility.
107 * doc/bison.texinfo (Initial Action Decl): Use initialize.
108
1092005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
110
111 * data/lalr1.cc: Move the body of the ctor and dtor into the
112 parser file (instead of the header).
113 Wrap the implementations in a "namespace yy".
114
1152005-11-12 Akim Demaille <akim@epita.fr>
116
117 Have glr.c include its header file when created.
118 * data/glr.c (b4_shared_declarations): New.
119 Output them verbatim in the parser if !%defines, otherwise
120 output then in the header file, and include it instead.
121
1989d947
AD
1222005-11-11 Akim Demaille <akim@epita.fr>
123
124 * data/glr.c: Comment changes.
125
1262005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
127
128 When yydebug, report semantic and location values for reductions.
129 * data/glr.c (yy_reduce_print): Report the semantic values and the
130 locations.
131 (YY_REDUCE_PRINT): Adjust.
132 (yyglrReduce): Use them.
133 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
134 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
135 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
136 traces.
137
02998094
AD
1382005-11-10 Akim Demaille <akim@epita.fr>
139
140 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
141 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
142 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
143
5210672f
PE
1442005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
145
146 * m4/cxx.m4, examples/Makefile.am: Don't build
147 examples/calc++ if no C++ compiler is available. (trivial change)
148
a8991a1d
AD
1492005-11-09 Akim Demaille <akim@epita.fr>
150
151 * src/scan-skel.l: Use a couple of asserts.
152
36b5e963
AD
1532005-11-03 Akim Demaille <akim@epita.fr>
154
155 In some (weird) cases, the final state number is incorrect.
156 Reported by Alexandre Duret-Lutz.
157 * src/LR0.c (state_list_append): Remove the computation of
158 final_state.
159 (save_reductions): Do it here.
160 (get_state): Alpha conversion.
161 (generate_states): Use a for loop.
162 * src/gram.h (item_number_is_rule_number)
163 (item_number_is_symbol_number): New.
164 * src/state.c: Use assert.
165 * src/system.h: Include assert.h.
166 * tests/sets.at (Accept): New.
167
44e7ead1
PH
1682005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
169
170 * data/glr.c (yyfill): Adjust comment.
36b5e963 171 (yyresolveAction): Initialize default location properly
44e7ead1
PH
172 for empty right-hand sides.
173 (yydoAction): Ditto.
174 Add comment explaining apparently dead code.
36b5e963
AD
175 * tests/glr-regression.at
176 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 177 New test.
36b5e963 178
e10a80ee
PE
1792005-10-30 Paul Eggert <eggert@cs.ucla.edu>
180
181 * bootstrap (cleanup_gnulib): New function. Use it to clean up
182 gnulib when interrupted. This fixes some race conditions and
183 works around some portability problems (one noted by Paul
184 Hilfinger).
185
067b32ee
AD
1862005-10-22 Akim <akim@epita.fr>
187
188 * Makefile.cfg: Adjust to config -> build-aux.
189 Reported by twledo.
190
4b367315
AD
1912005-10-21 Akim Demaille <akim@epita.fr>
192
193 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
194 the %parse-params.
195 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
196 * data/yacc.c (b4_Pure_if): Rename as...
197 (b4_yacc_pure_if): this.
198 (YY_SYMBOL_PRINT, yyparse): Adjust.
199 * doc/bison.texinfo: Formatting changes.
200
24cc23d9
AD
2012005-10-21 Akim Demaille <akim@epita.fr>
202
203 Finish the transition config -> build-aux.
204 * configure.ac, Makefile.am: Use build-aux.
205 * config/prev-version, config/announce-gen, config/Makefile.am:
206 Move to...
207 * build-aux/prev-version, build-aux/announce-gen,
208 * build-aux/Makefile.am: here.
209
d4476375
AD
2102005-10-14 Akim Demaille <akim@epita.fr>
211
212 * examples/calc++/test: Use set -x only when VERBOSE.
213
302c0aee
PE
2142005-10-13 Paul Eggert <eggert@cs.ucla.edu>
215
216 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
217 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
218
7625ec2c
AD
2192005-10-13 Akim Demaille <akim@epita.fr>
220
221 * src/scan-skel.l: Output the base name parts of the parser and
222 header file names.
302c0aee 223 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
224 additional checks.
225 Use this to exercise C++ outputs in subdirs.
226 Reported by Oleg Smolsky.
227
ba0fe3c7
PE
2282005-10-12 Paul Eggert <eggert@cs.ucla.edu>
229
230 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
231 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
232 Problem reported by John P. Hartmann.
233 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
234 already defined it.
235
9b8a5ce0
AD
2362005-10-12 Akim Demaille <akim@epita.fr>
237
238 * src/parse-gram.y (version_check): Exit 63 to please missing
239 (stands for "version mismatch).
240 * tests/input.at, doc/bison.texinfo: Adjust.
241
4f6e011e
PE
2422005-10-10 Paul Eggert <eggert@cs.ucla.edu>
243
244 Work around portability problems with Visual Age C compiler
245 (xlc and xlC_r) reported by John P. Hartmann.
246 * data/location.cc (initial_column, initial_line): Remove.
247 All uses replaced by 0 and 1.
248 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
249 that xlc complains about.
250 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 251 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 252 as __STDC__.
4d7aa45e
PE
253 * data/yacc.c (YYMODERN_C): New macro, which also looks at
254 __STDC_VERSION__. Use it everywhere instead of looking at
255 __STDC__ and __cplusplus.
4f6e011e 256
a1b3bf8c
AD
2572005-10-10 Akim Demaille <akim@epita.fr>
258
259 * examples/calc++/test: Be quiet unless VERBOSE.
260
412e44aa
PE
2612005-10-05 Paul Eggert <eggert@cs.ucla.edu>
262
2a4647a3
PE
263 * data/c.m4 (yydestruct, yysymprint):
264 Use YYUSE instead of casting to void.
265 * data/glr.c (YYUSE): New macro.
266 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
267 Use it instead of rolling our own.
268 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
269 (YYCHK1):
270 Use /*CONSTCOND*/ to suppress lint warnings.
271 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
272 (YY_STACK_PRINT): Use 'false' not '0'.
273 (YYUSE): New macro.
274 (yysymprint_, yydestruct_): Use it instead of rolling our own.
275 * data/yacc.c (YYUSE): New macro.
276 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
277 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
278 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
279
280
412e44aa
PE
281 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
282 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
283
88c6637f
PE
2842005-10-04 Paul Eggert <eggert@cs.ucla.edu>
285
2f4f028d
PE
286 Undo the parts of the unlocked-I/O change that substituted
287 putc or puts for printf. This might hurt performance a bit,
288 but some people prefer the printf style.
289 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
290 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
291 All uses replaced by YYFPRINTF and YYDPRINTF.
292 * data/yacc.c: Likewise.
293 * lib/bitset.c (bitset_print): Likewise.
294 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
295 putc and puts.
296 * lib/lbitset.c (debug_lbitset): Likewise.
297 * src/closure.c (print_firsts, print_fderives): Likewise.
298 * src/gram.c (grammar_dump): Likewise.
299 * src/lalr.c (look_ahead_tokens_print): Likewise.
300 * src/output.c (escaped_output): Likewise.
301 (user_actions_output): Break apart two printfs.
302 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
303 * src/reduce.c (reduce_print): Likewise.
304 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
305 * src/system.h: Include unlocked-io.h rathe than stdio.h.
306
88c6637f
PE
307 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
308 Use assignments rather than casts-to-void to suppress
309 unused-variable warnings. This pacifies 'lint'.
310 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
311 unused-variable warnings.
312
fb32e373
JMG
3132005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
314
315 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
316
edb8f44f
PE
3172005-10-02 Paul Eggert <eggert@cs.ucla.edu>
318
fb9c0b33
PE
319 Use unlocked I/O for a minor performance improvement on hosts like
320 GNU/Linux and Solaris that support unlocked I/O. The basic idea
321 is to use the gnlib unlocked-io module, and to prefer putc and
322 puts to printf when either will work (since the latter doesn't
323 come in an unlocked flavor).
324 * bootstrap (gnulib_modules): Add unlocked-io.
325 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
326 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
327 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
328 and similarly for puts and putc and printf.
329 * data/yacc.c: Likewise.
330 * lib/bitset.c (bitset_print): Likewise.
331 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
332 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
333 to printf.
334 * lib/lbitset.c (debug_lbitset): Likewise.
335 * src/closure.c (print_firsts, print_fderives): Likewise.
336 * src/gram.c (grammar_dump): Likewise.
337 * src/lalr.c (look_ahead_tokens_print): Likewise.
338 * src/output.c (escaped_output): Likewise.
339 (user_actions_output): Coalesce two printfs.
2f4f028d 340 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
341 * src/reduce.c (reduce_print): Likewise.
342 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 343 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 344
edb8f44f
PE
345 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
346 this confuses xgettext.
347
b50d2359
AD
3482005-10-02 Akim Demaille <akim@epita.fr>
349
350 * bootstrap (gnulib_modules): Add strverscmp.
351 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
352 * m4/.cvsignore: Add strverscmp.m4.
353 * src/parse-gram.y (%require): New token, new rule.
354 (version_check): New.
355 * src/scan-gram.l (%require): Adjust.
356 * tests/input.at (AT_REQUIRE): New.
357 Use it.
358 * doc/bison.texinfo (Require Decl): New.
359 (Calc++ Parser): Use %require.
360
21667f64
AD
3612005-10-02 Akim Demaille <akim@epita.fr>
362
363 * data/location.cc: New.
364
2b81e969
AD
3652005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
366 Akim Demaille <akim@epita.fr>
367
368 Make sure -odir/foo.cc creates dir/location.hh etc.
369 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
370 (spec_file_prefix, spec_verbose_file, spec_graph_file)
371 (spec_defines_file): Now const.
372 (dir_prefix): New.
373 (short_base_name): Remove.
374 * src/files.c: Adjust.
375 (dirname.h): Include.
376 (base_name): Don't prototype it.
377 (finput): Remove, duplicates gram_in.
378 (full_base_name, short_base_name): Replace by...
379 (all_but_ext, all_but_tab_ext): these.
380 (compute_base_names): Rename as...
381 (compute_file_name_parts): this.
382 Update to compute the new variables, including dir_prefix.
383 Adjust dependencies.
384 * src/output.c (prepare): Output them.
385 * src/reader.c: Adjust to use gram_in, not finput.
386 * src/scan-skel.l (@dir_prefix@): New.
387
ad6a9b97
JMG
3882005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
389
390 * lib/subpipe.c: New function end_of_output_subpipe() added
391 to allow support for non-posix systems. This is a no-op function
392 for posix systems.
393
394 * lib/subpipe.h: New function end_of_output_subpipe() added
395 to allow support for non-posix systems. This is a no-op function
396 for posix systems.
397
398 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
399 handle the lack of pipe/fork functionality on non-posix systems.
400
401 * djgpp/Makefile.maint: DJGPP specific file.
402
403 * djgpp/README.in: DJGPP specific file.
404
405 * djgpp/config.bat: DJGPP specific configuration file.
406
407 * djgpp/config.sed: DJGPP specific configuration file.
408
409 * djgpp/config.site: DJGPP specific configuration file.
410
411 * djgpp/config_h.sed: DJGPP specific configuration file.
412
413 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
414
415 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
416
fc695704
AD
4172005-10-02 Akim Demaille <akim@epita.fr>
418
419 * data/location.cc: New, extract from...
420 * data/lalr1.cc: here.
421 (location.hh): Include it after the user prologue, in case the
422 filename type is defined by the user.
423 Forward declation location and position before the pre-prologue.
424 (yyresult_): Rename as...
425 (yyresult): this, it's a local variable, not an attribute.
426 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
427
4282005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
429
430 * examples/extexi: Restore the #line generation.
431
fb9712a9
AD
4322005-09-30 Akim Demaille <akim@epita.fr>,
433 Alexandre Duret-Lutz <adl@gnu.org>
434
435 Move the token type and YYSTYPE in the parser class.
436 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
437 (parser::token): New, from the moved free definition of tokens.
438 (parser::semantic_value): Now a full definition instead of an
439 indirection to YYSTYPE.
440 (b4_post_prologue): No longer included in the header file, but
441 in the implementation file.
442 * doc/bison.texi (C+ Language Interface): Update.
443 * src/parse-gram.y: Support unary %define.
444 * tests/actions.at: Define global_tokens_and_yystype for backward
445 compatibility until we update the tests.
446 * tests/calc.at: Idem.
447 (first_line, first_column, last_line, last_column): Define for lalr1.cc
448 to simplify the code.
449
55f0c7b1
PE
4502005-09-29 Paul Eggert <eggert@cs.ucla.edu>
451
452 Port to SunOS 4.1.4, which lacks strtoul and strerror.
453 Ah, the good old days! Problem reported by Peter Klein.
454 * bootstrap (gnulib_modules): Add strerror, strtoul.
455 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
456 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
457
fb9712a9 4582005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
459
460 * data/c.m4 (b4_error_verbose_if): New.
461 * data/lalr1.cc: Use it.
462 (YYERROR_VERBOSE_IF): Remove.
463 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
464 parser members, replaced by...
465 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
466 local variables.
467 (yysyntax_error_): Takes the state number as argument.
468 (yyreduce_print_): Use the argument yyrule, not the former
469 attribute yyn_.
470
8a6f72f3
PE
4712005-09-26 Paul Eggert <eggert@cs.ucla.edu>
472
473 * bootstrap (gnulib_modules): Add verify.
474 * lib/.cvsignore: Add verify.h.
475 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
476 * src/system.h (verify): Remove.
477 Include verify.h instead.
478 * src/tables.c (tables_generate): Use new API for 'verify'.
479
0d50976f
PE
4802005-09-21 Paul Eggert <eggert@cs.ucla.edu>
481
ebc3737e
PE
482 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
483 local variables whose names begin with 'yy'.
484 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
485 Trivial changes from Joel E. Denny.
486
0d50976f
PE
487 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
488 it itself.
489 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
490 don't use alloca any more.
491
492 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
493 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 494 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
495 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
496 to match yacc.c, to test more hosts.
497
a05b79df
PE
4982005-09-20 Paul Eggert <eggert@cs.ucla.edu>
499
55289366
PE
500 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
501 doesn't affect behavior.
502 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
503 Solaris, AIX, MSC.
504 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
505 This works a bit better with glibc, if user code has already included
506 stdlib.h.
507 * doc/bison.texinfo (Bison Parser): Document that users can't
508 arbitrarily use malloc and free for other purposes. Document
509 that <alloca.h> and <malloc.h> might be included.
510 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
511 user must declare alloca.
512
a05b79df
PE
513 * HACKING (release): Forwarn the Translation Project about
514 stable releses.
515
3ab2ca22
AD
5162005-09-20 Akim Demaille <akim@epita.fr>
517
518 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
519
a9739e7c
PE
5202005-09-19 Paul Eggert <eggert@cs.ucla.edu>
521
a702593e
PE
522 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
523 (YYSTACK_ALLOC_MAXIMUM): Use it.
524 (yysyntax_error): New function.
525 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
526 multiple syntax errors are reported, and alloca is being used.
527 Instead, reallocate buffers twice as big each time, so that
528 we waste at most half the allocated memory. Start with a small
529 (128-byte) buffer that will suffice in most cases anyway.
530 Use yysyntax_error to do most of the work.
531
532 * doc/bison.texinfo (Error Reporting, Table of Symbols):
533 yynerrs is the number of errors reported, not the number of
534 errors encountered.
535
a9739e7c
PE
536 * tests/glr-regression.at (Duplicated user destructor for lookahead):
537 Mark it as expected to fail.
538 Cast result of malloc; problem reported by twlevo@xs4all.nl.
539 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
540 Don't start user-code symbols with "yy", to avoid name space problems.
541
f479c6c6
AD
5422005-09-19 Akim Demaille <akim@epita.fr>
543
544 Remove the traits, failed experiment.
545 It never proved useful, and anyway because of the current
546 definition, it was not possible to have several specialization of
547 this traits, making it useless.
548 * data/lalr1.cc (yy:traits): Remove.
549 Inline its definitions in the parser class.
550
e2586f82
AD
5512005-09-19 Akim Demaille <akim@epita.fr>
552
553 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
554 least Mac OSX with a /usr/local install of gettext.
555
2e8cf949
AD
5562005-09-19 Akim Demaille <akim@epita.fr>
557
558 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
559 and yytoken for similarity with the other skeletons.
560
c7fb0b90
AD
5612005-09-19 Akim Demaille <akim@epita.fr>
562
563 * NEWS, configure.ac: Bump to 2.1a.
564
1bd0deda
PE
5652005-09-16 Paul Eggert <eggert@cs.ucla.edu>
566
567 * NEWS: Version 2.1.
568
569 * NEWS: Remove notice of yytname change, since it was never in an
570 official release.
571 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
572 diagnostic.
573 * src/output.c (prepare): Likewise.
574 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
575 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
576 is not defined. This is an awful hack, but it's enough for now.
577 All callers changed.
578 * tests/glr-regression-at (make_value): Args are const pointers now,
579 to avoid GCC warning.
580 (Duplicated user destructor for lookahead): New test. Currently
581 skipped. It fails on my host but I'm not sure it'll always fail.
582
5832005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
584
585 * src/symtab.h (struct symbol): Declare the printer and destructor
586 as const, to avoid accidental calls to free.
587 (symbol_destructor_set, symbol_printer_set): Adjust.
588 * src/symtab.c: Adjust.
589
1bd0deda 5902005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
591
592 * data/c.m4 (b4_token_enums): New.
593 (b4_token_defines): Rename as...
594 (b4_token_enums_defines): this.
595 (b4_token_defines): New, output only the #defines.
596 * data/yacc.c, data/glr.c: Adjust.
597 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
598 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
599 as default values.
600
dbcdae2d
AD
6012005-09-16 Akim Demaille <akim@epita.fr>
602
603 * data/lalr1.cc (yylex_): Remove, inline its code.
604 (yyreport_syntax_error_): Remove, replaced by...
605 (yysyntax_error_): this which returns a string and leaves to the
606 caller the call to the users' error function.
607 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
608 Move from members of the parser object...
609 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
610 to local variables of the parse function.
611
70d8f291
AD
6122005-09-16 Akim Demaille <akim@epita.fr>
613
614 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
615 since it's in Bison's name space.
616
b47dbebe
PE
6172005-09-15 Paul Eggert <eggert@cs.ucla.edu>
618
ae199bf1
PE
619 * data/glr.c (yyresolveValue): Add default case to pacify
620 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
621
b47dbebe
PE
622 * NEWS: Document when yyparse started to return 2.
623 * doc/bison.texinfo (Parser Function): Document when yyparse
624 returns 2.
625
626 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
627 (b4_filename_type): Renamed back from b4_file_name_type. All uses
628 changed.
629 (class position): file_name -> filename (reverting). All uses changed.
630
6312005-09-14 Paul Eggert <eggert@cs.ucla.edu>
632
633 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
634 do anything if $@ exists. This reverts part of the 2005-07-07
635 patch.
636
00292f66
PE
6372005-09-11 Paul Eggert <eggert@cs.ucla.edu>
638
639 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
640 contains obsolete information and isn't worth distributing as a
641 separate file anyway.
642 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
643 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
644 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
645 (yyparse): Abort if user code uses longjmp to throw an unexpected
646 value.
647
a420f962
PE
6482005-09-09 Paul Eggert <eggert@cs.ucla.edu>
649
00292f66
PE
650 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
651 Suggested by twlevo@xs4all.nl.
652
127287e9
PE
653 * data/glr.c (YYCHK1): Do not assume YYE is in range.
654 This avoids a diagnostic from gcc -Wswitch-enum.
655 Problem reported by twlevo@xs4all.nl.
656
a420f962
PE
657 * doc/bison.texinfo: Don't use "filename", as per GNU coding
658 standards. Use "file name" or "file" or "name", depending on
659 the context.
660 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
661 not to hack/foo.tab.c.
662 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
663 * data/glr.c: b4_filename -> b4_file_name.
664 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
665 All uses changed.
666 (class position): filename -> file_name. All uses changed.
667 * data/yacc.c: b4_filename -> b4_file_name.
668 * lib/bitset.h: filename -> file_name in local vars.
669 * lib/bitset_stats.c: Likewise.
670 * src/files.c: Likewise.
671 * src/scan-skel.l ("@output ".*\n): Likewise.
672 * src/files.c (file_name_split): Renamed from filename_split.
673 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
674
6752005-09-08 Paul Eggert <eggert@cs.ucla.edu>
676
677 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
678 to accommodate latest gnulib.
679
680 * tests/glr-regression.at (Duplicate representation of merged trees):
681 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
682
683 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
684 needed.
685
42a6501d
PE
6862005-08-26 Paul Eggert <eggert@cs.ucla.edu>
687
688 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
689 All uses changed. Invoke user destructor after an error during a
690 split parse (trivial change from Joel E. Denny).
691
692 * tests/glr-regression.at
693 (User destructor after an error during a split parse): New test case.
694 Problem reported by Joel E. Denny in:
695 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
696
ef9a1faf
PE
6972005-08-25 Paul Eggert <eggert@cs.ucla.edu>
698
5b4aaf78
PE
699 * README-cvs: Give URLs for recommended tools.
700 Mention Gzip version problem, and bootstrapping issues.
701 Remove troubleshooting section, as it's somewhat obsolete.
702
b5240ba5
PE
703 * bootstrap (no_cache): New var, to accommodate different wget
704 variants. Use it instead of '-C off'. Problem reported by
705 twlevo@xs4all.nl.
706
ef9a1faf
PE
707 * data/glr.c (yydestroyStackItem): New function.
708 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
709 debugging information. Problem reported by Joel E. Denny.
710
e6efa9da
AD
7112005-08-25 Akim Demaille <akim@epita.fr>
712
713 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
714
adc90f13
PE
7152005-08-24 Paul Eggert <eggert@cs.ucla.edu>
716
717 * data/glr.c (yyrecoverSyntaxError, yyreturn):
718 Don't invoke destructor on unresolved entries.
719 * tests/glr-regression.at
720 (User destructor for unresolved GLR semantic value): New test case.
721 Problem reported by Joel E. Denny in:
722 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
723
f9315de5
PE
7242005-08-21 Paul Eggert <eggert@cs.ucla.edu>
725
15d29c1f
PE
726 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
727 Add strnlen.c.
728 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
729 lib-prefix.m4, po.m4.
730
dd5f2af2
PE
731 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
732 in yydestruct diagnostic, since it might not be an error.
733 Problem reported by Joel Denny near end of
734 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 735 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
736 * data/yacc.c (yyreturn): Likewise.
737 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
738
739 * src/files.c: Remove obsolete FIXME comment.
740
741 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
742 with the other templates, and to fix bogus run-on messages such
743 as the one reported at the end of
744 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
745 All callers changed to avoid the newline.
746 (yyprocessOneStack): Output two lines rather than one, to accommodate
747 the above change. This changes the debug output format slightly.
748
f9315de5
PE
749 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
750 reported by Joel E. Denny in
751 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
752 (trivial change).
753 * tests/glr-regression.at (Duplicate representation of merged trees):
754 New test, from Joel E. Denny in:
755 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
756 * THANKS: Add Joel E. Denny.
757
758 * configure.ac (AC_INIT): Bump to 2.0c.
759
04098407
PE
7602005-07-24 Paul Eggert <eggert@cs.ucla.edu>
761
762 * NEWS: Version 2.0b.
763
ca5d2013
PE
764 * Makefile.am (SUBDIRS): Put examples before tests, so that
765 "make check" doesn't finish with "All 1 tests passed".
766
3d54b576
PE
767 * tests/regression.at (Token definitions): Don't rely on
768 AT_PARSER_CHECK for data that contains backslashes. It currently
769 uses 'echo', and 'echo' isn't portable if its argument contains
770 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
771 that the byte '\0xff' is not printable in the C locale; it is,
772 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
773 not printable, so use '\0x81' to test.
774
d53ae497
PE
775 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
776 version of GCC, since the macro is used with non-GCC compilers.
777
fc01665e
PE
778 Fix core dump reported by Pablo De Napoli in
779 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
780 * tests/regression.at (Invalid inputs with {}): New test.
781 * src/parse-gram.y (token_name): Translate type before using
782 it as an index.
783
04098407
PE
784 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
785 the user's name space. All uses changed to __attribute__
786 ((__unused__)).
787 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
788 Add __attribute__ ((__noreturn__)).
789
790 * etc/clcommit: Remove. We weren't using it, and it failed
791 "make maintainer-distcheck".
792 * Makefile.maint: Merge from coreutils.
793 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
794 (syntax-check-rules): Change list of rules as described below.
795 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
796 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
797 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
798 (sc_trailing_space): New rules.
799 (sc_xalloc_h_in_src): Remove.
800 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
801 (sc_space_tab, sc_error_exit_success, sc_changelog):
802 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
803 (makefile-check, po-check, author_mark_check):
804 (makefile_path_separator_check, copyright-check):
805 Use grep -n, to make it easier to find violations.
806 Use CVS_LIST and CVS_LIST_EXCEPT.
807 (header_regexp, h_re): Remove.
808 (dd_c): New macro.
809 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
810 (my-distcheck): Use more-modern GCC flags.
811 (signatures, %.asc): Remove.
812 (rel-files, announcement): Remove signatures.
813 Restore old updating code, even though we don't use it, so
814 that we're the same as coreutils.
815 (alpha, beta, major): Depend on news-date-check.
816 Make the upload commands.
817
818 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
819 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
820 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
821 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
822 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
823 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
824 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
825 * tests/sets.at: Likewise.
826
827 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
828 we comment out the Autoconf version number.
829 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
830 it's error-prone and "make maintainer-distcheck" rejects it.
831
832 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
833 Indent calls to "error" to pacify "make maintainer-distcheck",
834 when the calls are not intended to be translated.
835 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
836
837 * src/Makefile.am (DEFS): Use +=, to pacify
838 "make maintainer-distcheck".
839 (bison_SOURCES): Add scan-skel.h.
840 (sc_tight_scope): New rule, from coreutils.
841
842 * src/files.c (src_extension, header_extension):
843 Now static, not extern.
844 * src/getargs.c (short_options): Likewise.
845 * src/muscle_tab.c (muscle_table): Likewise.
846 * src/parse-gram.y (current_class, current_type, current_prec):
847 Likewise.
848 * src/reader.c (grammar_end, previous_rule_end): Likewise.
849 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
850 * src/main.c (main): Cast bindtextdomain and textdomain calls to
851 void, to avoid warning when NLS is disabled.
852 * src/output.c: Include scan-skel.h.
853 (scan_skel): Remove decl, since scan-skel.h does this.
854 (output_skeleton):
855 Indent calls to "error" to pacify "make maintainer-distcheck".
856 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
857 * src/reader.h (gram_end, gram_lineno): New decls to pacify
858 "make maintainer-distcheck".
859 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
860 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
861 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
862 (skel_lex_destroy, scan_skel): Move these decls to...
863 * src/scan-skel.h: New file.
864 * src/uniqstr.c (uniqstr_assert):
865 Indent calls to "error" to pacify "make maintainer-distcheck".
866
867 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
868 not @VAR@.
869
870 * tests/torture.at: Revamp to avoid misuse of atoi that
871 "make maintainer-distcheck" complained about.
872
873 * examples/extexi (message): Don't print a message more than once,
874 and omit line-number decoration that makes Emacs compile think
875 that informative messages are worth worrying about.
876
8772005-07-22 Paul Eggert <eggert@cs.ucla.edu>
878
879 * configure.ac: Update version number.
880
881 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
882 accidentally.
883 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
884 autogenerated by the maintainer.
885 * examples/calc++/.cvsignore: Add *.yy.
886
887 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
888 * lib/bitset_stats.c (bitset_stats_init): Likewise.
889 * lib/bitsetv.c (bitsetv_alloc): Likewise.
890
891 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
892
893 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
894 from maintainer-distcheck about casting the argument of 'free'.
895
896 * NEWS: Mention recent yytname changes.
897 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
898
899 * bootstrap: For translations that have not yet been upgraded to
900 the new runtime-po domain, prime the pump by extracting the
901 relevant strings from the obsolete translations. This code can be
902 removed once the bison-runtime domain has been translated by each
903 team.
904
905 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
906 now that token names are already quoted.
907
908 Fix problem reported by Anthony Heading.
909 * data/glr.c (YYTOKEN_TABLE): New macro.
910 (yytname): Define if YYTOKEN_TABLE.
911 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
912 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
913 (YYERROR_VERBOSE): Define the same way the other skeletons do.
914 * src/output.c (prepare_symbols): Output token_table_flag.
915
0ffda363
PE
9162005-07-21 Paul Eggert <eggert@cs.ucla.edu>
917
918 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
919 again if the first call fails.
920
921 * data/glr.c (yytnamerr): New function.
922 (yyreportSyntaxError): Use it to dequote most string literals.
923 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
924 with other skeletons. All uses changed.
925 (yytnameerr_): New function.
926 (yyreport_syntax_error): Use it to dequote most string literals.
927 * data/yacc.c (yytnamerr): New function.
928 (yyerrlab): Use it to decode most string literals.
929 * doc/bison.texinfo (Decl Summary, Calling Convention):
930 Clarify quoting convention of yytname.
931 * src/output.c (prepare_symbols): Quote all names. This undoes
932 the 2005-04-17 change, which is now accomplished (mostly) via
933 changes in the parsers as described above.
934 * tests/regression.at (Token definitions, Web2c Actions):
935 Undo most 2005-04-17 change here, too.
936
9372005-07-20 Paul Eggert <eggert@cs.ucla.edu>
938
939 Fix more problems reported by twlevo@xs4all.nl.
940 * tests/cxx-type.at: Don't pipe output of ./types through sed to
941 remove trailing spaces. This loses the exit status of ./types,
942 and isn't needed since ./types shouldn't be emitting trailing
943 spaces.
944 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
945 as the stack isn't valid in that case.
946
947 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
948 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
949 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
950 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
951 is used.
952 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
953 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
954 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
955 Likewise.
956
957 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
958 overly-picky compilers that reject 'char *foo = "bar";'.
959
960 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
961 to FILE * parameter, not to stderr. This fixes a typo introduced
962 in the 2005-07-12 change.
963
964 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
965 warnings from GCC 4.
966
967 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
968 (yyglrShiftDefer, yysplitStack):
969 Remove unused parameters b4_pure_formals. All uses changed.
970 (yyglrShift): Remove unused parameters b4_user_formals.
971 All uses changed.
972 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
973
6100a9aa
PE
9742005-07-18 Paul Eggert <eggert@cs.ucla.edu>
975
258b75ca
PE
976 Destructor cleanups and regularization among the three skeletons.
977 * NEWS: Document the behavior changes.
978 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
979 stack before failing, as the cleanup code will do it for us now.
980 * data/lalr1.cc (yyerrlab): Likewise.
981 * data/glr.c (yyparse): Pop everything off the stack before
982 freeing it, so that destructors get called properly.
983 * data/lalr1.cc (yyreturn): Likewise.
984 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
985 This is more consistent.
986 * doc/bison.texinfo (Destructor Decl): Mention more reasons
987 why destructors might be called. 1.875 -> 2.1.
988 (Destructor Decl, Decl Summary, Table of Symbols):
989 Some English-language cleanups for %destructor.
990 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
991 Add output line for destructor of start symbol.
992 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
993 because of that same extra output line.
994
1a059451
PE
995 * NEWS: Document minor wording changes in diagnostics of
996 Bison-generated parsers.
997 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
998 Remove unused formals. All uses changed.
999 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
1000 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
1001 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
1002 Rename yyoverflowab to yyexhaustedlab.
1003 When memory exhaustion occurs during syntax-error reporting,
1004 report it separately rather than in a single diagnostic; this
1005 eases translation.
1006 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
1007 (Memory Exhausted): Renamed from Parser Stack Overflow.
1008 Revamp wording slightly to prefer "memory exhaustion".
1009 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
1010
97460c78
PE
1011 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
1012
30757c8c
PE
1013 Add i18n support to the GLR skeleton. Partially fix the C++
1014 skeleton; a C++ expert needs to finish this. Remove debugging
1015 msgids; there's little point to having them translated, since they
1016 can be understood only by someone who can read the
1017 (English-language) source code.
1018
1019 Generate runtime-po/bison-runtime.pot automatically, so that we
1020 don't have to worry about garbage getting in that file. We'll
1021 make sure after the next official release that old msgids don't
1022 get lost. See
1023 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
1024
1025 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
1026 Now auto-generated.
1027 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
1028 Fix typos in explanations of the runtime file.
1029 * bootstrap: Change gettext keyword from YYI18N to YY_.
1030 Use standard Makefile.in.in in runtime-po, since we'll arrange
1031 for backward-compatible bison-runtime.po files in a different way.
1032 * data/glr.c (YY_): New macro, from yacc.c.
1033 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
1034 Translate messages intended for users.
1035 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
1036 the wording in the other skeletons. We don't know that the memory
1037 is virtual.
1038 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
1039 Use same method that yacc.c uses.
1040 Don't translate debugging messages.
1041 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
1042 it doesn't work (yet), and requires C++ expertise to fix.
1043 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
1044 Move defn to a more logical place, to be consistent with other
1045 skeletons.
1046 Don't translate debugging messages.
1047 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
1048 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
1049 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
1050 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
1051
ac8c5689
PE
1052 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
1053 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
1054 void, not int.
1055 * tests/glr-regression.at (Badly Collapsed GLR States):
1056 Likewise.
1057 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
1058 yylex should return 0 at EOF rather than aborting.
1059
6100a9aa
PE
1060 Improve tests for stack overflow in GLR parser.
1061 Problem reported by twlevo@xs4all.nl.
1062 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
1063 All uses removed.
1064 (yyStackOverflow): Just longjmp, but with value 2 so that caller
1065 can handle the problem.
1066 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
1067 (yyparse): New local variable yyresult to record the result.
1068 Use result of setjmp to set it, rather than storing itinto
1069 struct.
1070 (yyDone): Remove label.
1071 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
1072 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
1073 if YYABORT is used).
1074 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
1075 yyparse status; put status > 1 into diagnostic.
1076 Check that status==2 works.
1077 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
1078 Use exit status 3 for failure to open (which shouldn't happen).
1079
15f40952
PE
10802005-07-17 Paul Eggert <eggert@cs.ucla.edu>
1081
67fd79c4
PE
1082 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
1083 1 on syntax error; just let yyparse do its thing.
1084 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
1085 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
1086 (Exploding the Stack Size with Alloca):
1087 (Exploding the Stack Size with Malloc):
1088 Expect exit status 2, not 1, since the parser is supposed to blow
1089 its stack. Problem reported by twlevo@xs4all.nl.
1090
15f40952
PE
1091 * data/glr.c (yyparse): Don't assume that the initial calls
1092 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
1093 Print a stack-overflow message and fail instead.
1094 Initialize the line-number information before creating the stack,
1095 so that the stack-overflow message can report line zero safely.
1096
f32c66b5
PE
10972005-07-14 Paul Eggert <eggert@cs.ucla.edu>
1098
a22ff96f 1099 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
1100 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
1101 (yyuserMerge): Provide a default case if b4_mergers is empty.
1102 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
1103 * tests/glr-regression.at
1104 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 1105 Add casts to pacify C++ compilers.
1beb0b24
PE
1106 * tests/glr-regression.at (Improper merging of GLR delayed action
1107 sets): Declare yylex before using it.
f32c66b5 1108 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
1109 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
1110 test for valgrind; valgrind is independent of g++.
1111 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
1112 for compatibility with POSIX 1003.1-2001 (if running coreutils).
1113 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
1114 Use a destructor, so that we can expand the stack. Change
1115 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 1116
d741bd1b
PE
11172005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
1118
1119 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
1120 a valgrind failure. Problem reported by twlevo@xs4all.nl.
1121
0410a6e0
PE
11222005-07-13 Paul Eggert <eggert@cs.ucla.edu>
1123
1124 * PACKAGING: New file, suggested by Bruno Haible and taken from
1125 similar wording in gettext's PACKAGING file.
1126 * NEWS: Mention PACKAGING.
1127 * Makefile.am (EXTRA_DIST): Add PACKAGING.
1128
f7ab6a50
PE
11292005-07-12 Paul Eggert <eggert@cs.ucla.edu>
1130
baf785db 1131 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
1132 * bootstrap: Get runtime translations into runtime-po.
1133 Create runtime-po files automatically, if possible.
1134 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
1135 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
1136 does not infringe on the user's name space.
1137 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
1138 * doc/bison.texinfo (Internationalization): Revamp the English
1139 and Texinfo syntax a bit, to try to make it clearer.
1140 (Bison Options, Option Cross Key): Mention --print-localedir.
1141 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
1142 YYENABLE_NLS. Quote a bit more.
1143 * runtime-po/.cvsignore: New file.
1144 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
1145 * runtime-po/Rules-quot: Remove; now created by bootstrap.
1146 * runtime-po/quot.sed: Likewise.
1147 * runtime-po/boldquot.sed: Likewise.
1148 * runtime-po/en@quot.header: Likewise.
1149 * runtime-po/en@boldquot.header: Likewise.
1150 * runtime-po/insert-header.sin: Likewise.
1151 * runtime-po/remove-potcdate.sin: Likewise.
1152 * runtime-po/Makevars: Likewise.
1153 * runtime-po/LINGUAS: Likewise.
1154 * runtime-po/de.po: Likewise; we will rely on the translation project
1155 to maintain this, so "bootstrap" should get it.
0410a6e0 1156 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
1157 its value.
1158 * src/main.c (main): Bind the bison-runtime domain, too.
1159
11602005-07-12 Bruno Haible <bruno@clisp.org>
1161
1162 * data/yacc.c: Include <libintl.h> when NLS is enabled.
1163 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
1164 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
1165 * runtime-po: New directory.
1166 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
1167 $(DOMAIN).pot-update rule, so that old messages are never dropped.
1168 * runtime-po/Rules-quot: New file, copied from po/.
1169 * runtime-po/quot.sed: Likewise.
1170 * runtime-po/boldquot.sed: Likewise.
1171 * runtime-po/en@quot.header: Likewise.
1172 * runtime-po/en@boldquot.header: Likewise.
1173 * runtime-po/insert-header.sin: Likewise.
1174 * runtime-po/remove-potcdate.sin: Likewise.
1175 * runtime-po/Makevars: New file.
1176 * runtime-po/POTFILES.in: New file.
1177 * runtime-po/LINGUAS: New file.
1178 * runtime-po/bison-runtime.pot: New file.
1179 * runtime-po/de.po: New file.
1180 * m4/bison.m4: New file.
1181 * Makefile.am (SUBDIRS): Add runtime-po.
1182 (aclocaldir, aclocal_DATA): New variables.
1183 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
1184 Define aclocaldir.
1185 * src/getargs.c (usage): Document --print-localedir option.
1186 (PRINT_LOCALEDIR_OPTION): New enum item.
1187 (long_options): Add --print-localedir option.
1188 (getargs): Handle --print-localedir option.
1189 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
1190 (Internationalization): New section.
1191
22dda0f0
AD
11922005-07-12 Akim Demaille <akim@epita.fr>
1193
1194 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
1195 for consistency with the rest of the code.
1196 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
1197 Add separators.
1198
82b248ad
AD
11992005-07-12 Akim Demaille <akim@epita.fr>
1200
1201 * src/parse-gram.y: Use %printer instead of YYPRINT.
1202
fa0e9314
AD
12032005-07-12 Akim Demaille <akim@epita.fr>
1204
867a3e00
AD
1205 * src/symtab.h, src/symtab.c (symbol_print): New.
1206 * src/symlist.h, src/symlist.c (symbol_list_print): New.
1207 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
1208
12092005-07-12 Akim Demaille <akim@epita.fr>
1210
1211 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
1212 b4_at_dollar and b4_dollar_dollar.
1213
e054b190
PE
12142005-07-11 Paul Eggert <eggert@cs.ucla.edu>
1215
1216 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
1217 and Pennello's paper.
1218
34160ec4
PE
12192005-07-09 Paul Eggert <eggert@cs.ucla.edu>
1220
407d4a75
PE
1221 * data/yacc.c (yyparse): Undo previous patch. Instead,
1222 set yylsp[0] and yyvsp[0] only if the initial action
1223 sets yylloc and yylval, respectively.
1224
34160ec4
PE
1225 * data/yacc.c (yyparse): In the initial action, set
1226 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
1227 This avoids the use of undefined variables if the initial
1228 action does not set yylloc and/or yylval.
1229
c3d5a4a7
PE
12302005-07-07 Paul Eggert <eggert@cs.ucla.edu>
1231
b34d96c1
PE
1232 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
1233 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
1234 Remove from CVS. These files are automatically generated.
1235 * examples/extexi: Clarify that this file is now part of Bison,
1236 not GNU M4, and that it works with any POSIX-compatible Awk.
1237 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
1238 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
1239 so that we also get calc++-parser.yy. Geneate it.
1240 Use $(AWK), not gawk, since any conforming Awk will do.
1241 Put comment before action, since older 'make' can't handle comment
1242 in action.
1243 $(BUILT_SOURCES): List all built sources, not just some of them.
1244 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
1245 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
1246 $($(calc_sources_generated)): Remove unnecessary test for existence
1247 of target. (This had a shell syntax error anyway; a stray "x".)
1248 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
1249 calc++-parser.yy.
1250 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
1251
c3d5a4a7
PE
1252 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
1253 implied by the other modules.
1254
828c373b
AD
12552005-07-06 Akim Demaille <akim@epita.fr>
1256
1257 Bind examples/calc++ to the package.
1258 * examples/calc++/Makefile: Remove, replaced by...
1259 * examples/calc++/Makefile.am: ... this new file.
1260 * examples/calc++/test: Remove input.
1261 * examples/calc++/compile: Remove.
1262 * examples/Makefile.am: New.
1263 * configure.ac, Makefile.am: Adjust.
1264 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
1265
63cb01d6
PE
12662005-07-05 Paul Eggert <eggert@cs.ucla.edu>
1267
fd2df2ed
PE
1268 * data/glr.c (yyFail): Drastically simplify; since the format argument
1269 never had any % directives, we can simply pass it to yyerror.
1270 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
1271 be modified later, as that is the usual style in glr.c.
1272 Problems reported by Paul Hilfinger.
1273
63cb01d6
PE
1274 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
1275 and size overflow errors.
1276 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
1277 in case the user prolog sets feature-test macros like _GNU_SOURCE.
1278 (YYSIZEMAX): New macro.
1279 (yystpcpy): New function, taken from yacc.c.
1280 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
1281 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
1282 so that we don't have to maintain their signatures.
1283 (yyFail): Check for buffer overflow, by using vsnprintf rather
1284 than vsprintf. Allocate a bigger buffer if possible.
1285 Report an error if buffer allocation fails.
1286 (yyStackOverflow): New function.
1287 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
1288 the initialization was successful. It might fail if storage was
1289 exhausted.
1290 (yyexpandGLRStack): Add more checks for storage allocation failure.
1291 Use yyStackOverflow to report failures.
1292 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
1293 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
1294 Don't assume stack number fits in int.
1295 (yysplitStack): Check for storage allocation failure.
1296 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
1297 can print diagnostics on storage allocation failure. All callers
1298 changed.
1299 (yyresolveValue): Use yybool for boolean.
1300 (yyreportSyntaxError): Check for size-calculation overflow.
1301 This code is taken from yacc.c.
1302 (yyparse): Check for storage allocation errors when allocating
1303 the initial stack.
1304
1c59e0a1
AD
13052005-07-05 Akim Demaille <akim@epita.fr>
1306
1307 Extract calc++ from the documentation.
1308 * doc/bison.texinfo (Calc++): Add the extraction marks.
1309 * examples/extexi: New, from the aborted GNU Programming 2E.
1310 Separate the different paragraph of a file with empty lines.
1311 * examples/Makefile: Use it to extract the whole calc++ example.
1312
8a0adb01
AD
13132005-06-24 Akim Demaille <akim@epita.fr>
1314
1315 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
1316 class typedefs.
1317
12545799
AD
13182005-06-22 Akim Demaille <akim@epita.fr>
1319
1320 * doc/bison.texinfo (C++ Language Interface): First stab.
1321 (C++ Parsers): Remove.
1322
99be0235
AD
13232005-06-22 Akim Demaille <akim@epita.fr>
1324
1325 * data/lalr1.cc (yylex_): Honor %lex-param.
1326
0ffd4fd1
AD
13272005-06-22 Akim Demaille <akim@epita.fr>
1328
1329 Start a set of simple examples.
1330 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
1331 * examples/calc++/calc++-driver.hh,
1332 * examples/calc++/calc++-parser.yy,
1333 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
1334 * examples/calc++/compile, examples/calc++/test: New.
1335
0925ebb4
PE
13362005-06-09 Paul Eggert <eggert@cs.ucla.edu>
1337
1338 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
1339 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
1340 which stems from the 2005-05-27 patch.
1341
43d3b664
PH
13422005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
1343
1344 * data/glr.c: Modify treatment of unused parameters to permit use
1345 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
1346
3062864d
PE
13472005-05-30 Paul Eggert <eggert@cs.ucla.edu>
1348
1349 Fix infringement on user name space reported by Janos Zoltan Szabo.
1350 * data/yacc.c (yyparse): strlen -> yystrlen.
1351
989b5b8e
AD
13522005-05-30 Akim Demaille <akim@epita.fr>
1353
1354 * data/lalr1.cc (_): New.
1355 Translate the various messages.
1356
bedf57f5
PE
13572005-05-27 Paul Eggert <eggert@cs.ucla.edu>
1358
1359 Fix infringement on user name space reported by Bruno Haible.
1360 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
1361 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
1362 the user's name space.
1363 (alloca): Include <stdlib.h> to get it, if it's not built in.
1364 (YYMALLOC, YYFREE): Define only if needed.
1365 (malloc, free): Declare, but only if needed, as this infringes on
1366 the user name space.
1367
4d1801f1
PE
13682005-05-25 Paul Eggert <eggert@cs.ucla.edu>
1369
1370 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
1371 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
1372 with %d format.
1373 * lib/ebitset.c (min, max): Undef before defining.
1374 * lib/vbitset.c (min, max): Likewise.
1375 * lib/subpipe.c (create_subpipe): Save local variables in case
1376 vfork clobbers them.
1377
13782005-05-24 Bruno Haible <bruno@clisp.org>
1379
1380 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
1381 error message syntax used by gcc-4.0.
1382
b94a9e1e
PE
13832005-05-23 Paul Eggert <eggert@cs.ucla.edu>
1384
85ac3861
PE
1385 * README: Mention m4 1.4.3. Remove obsolete advice about
1386 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
1387
b94a9e1e
PE
1388 * bootstrap: Remove workaround for problem I encountered with
1389 gettext 0.14.1; it seems to be fixed now.
1390
51c30d21
PE
13912005-05-22 Paul Eggert <eggert@cs.ucla.edu>
1392
009ce67d
PE
1393 * NEWS: Version 2.0a.
1394
f2a97c62
PE
1395 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
1396 the previous change.
1397
c8775f93
PE
1398 Various maintainer cleanups.
1399 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
1400 conftest*, for benefit of CVS commands run at the same time as
1401 "configure". Add build-aux, since "bootstrap" now creates it and
1402 its subfiles.
1403 * Makefile.cfg (move_if_change): Remove.
1404 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
1405 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
1406 (po_repo, do-po-update, po-update, wget_files, get-targets):
1407 (config.guess-url_prefix, config.sub-url_prefix):
1408 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
1409 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
1410 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
1411 Remove.
1412 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
1413 this is now the recommended name.
1414 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
1415 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
1416 ylwrap. These files now go into build-aux.
1417 * config/move-if-change: Remove.
1418 * config/prev-version.txt: Bump from 1.75 to 2.0.
1419
3ea5f0ec
PE
1420 * bootstrap: Add stdio-safer, unistd-safer modules.
1421 Remove m4/glibc2.m4 (introduced by latest gnulib, but
1422 we don't need it).
1423 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
1424 fopen-safer.c, stdio-safer.h, unistd-safer.h.
1425 * lib/subpipe.c: Include "unistd-safer.h".
1426 (create_subpipe): Make sure all the newly-created
1427 file descriptors are > 2, so that diagnostics don't
1428 get sent down them (which might cause Bison to hang, in theory).
1429 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
1430 * src/files.c (xfopen): Use fopen_safer, not fopen.
1431
51c30d21
PE
1432 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
1433 yesterday's yacc.c fix.
1434
cea1469d
PE
14352005-05-21 Paul Eggert <eggert@cs.ucla.edu>
1436
3ea5f0ec
PE
1437 * data/glr.c, data/lalr1.cc: Update copyright date.
1438
cea1469d
PE
1439 Fix a destructor bug reported by Wolfgang Spraul in
1440 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
1441 * data/yacc.c (yyabortlab): Don't call destructor, and
1442 don't set yychar to EMPTY.
1443 (yyoverflowlab): Don't call destructor.
1444 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
1445 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
1446 since we no longer output the message "discarding lookahead token
1447 end of input ()".
1448
5e6f62f2
PH
14492005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
1450
1451 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
1452 fix a small glitch in debugging output.
1453 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
1454 after YY_SYMBOL_PRINT where needed.
1455
1456 (struct yyGLRState): Add some comments.
1457 (struct yySemanticOption): Add some comments.
1458 (union yyGLRStackItem): Add comment.
1459
1460 (yymergeOptionSets): Correct this to properly perform the union,
1461 avoiding infinite reported by Michael Rosien.
1462 Update comment.
1463
1464 * tests/glr-regression.at: Add test for GLR merging error reported
1465 by M. Rosien.
cea1469d 1466
0fb669f9
PE
14672005-05-13 Paul Eggert <eggert@cs.ucla.edu>
1468
1469 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
1470 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
1471 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
1472 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
1473 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
1474 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
1475 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
1476 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
1477 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
1478 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
1479 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
1480 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
1481 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
1482 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
1483 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
1484 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
1485 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
1486 src/derives.h, src/files.c, src/files.h, src/getargs.c,
1487 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
1488 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
1489 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
1490 src/output.h, src/parse-gram.c, src/parse-gram.h,
1491 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
1492 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
1493 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
1494 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
1495 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
1496 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
1497 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
1498 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
1499 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
1500 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
1501 tests/reduce.at, tests/regression.at, tests/sets.at,
1502 tests/synclines.at, tests/testsuite.at, tests/torture.at:
1503 Update FSF postal mail address.
1504
51f4735e
PE
15052005-05-11 Paul Eggert <eggert@cs.ucla.edu>
1506
1507 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
1508 Problem reported by Ralf Menzel.
1509
80ce3401
PE
15102005-05-01 Paul Eggert <eggert@cs.ucla.edu>
1511
1512 * tests/actions.at: Test that stack overflow invokes destructors.
1513 From Marcus Holland-Moritz.
1514 * data/yacc.c (yyerrlab): Move the code that destroys the stack
1515 from here....
1516 (yyreturn): to here. That way, destructors are called properly
1517 even if the stack overflows, or the user calls YYACCEPT or
1518 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
1519 (yyoverflowlab): Destroy the lookahead.
1520
15212005-04-24 Paul Eggert <eggert@cs.ucla.edu>
1522
1523 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
1524
72f000b0
PE
15252005-04-17 Paul Eggert <eggert@cs.ucla.edu>
1526
1527 * NEWS: Bison-generated C parsers no longer quote literal strings
1528 associated with tokens.
1529 * src/output.c (prepare_symbols): Don't escape strings,
1530 since users don't want to see C escapes.
1531 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
1532 in diagnostics.
c19683bb 1533 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
1534 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
1535
1094323f
PE
15362005-04-16 Paul Eggert <eggert@cs.ucla.edu>
1537
1538 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
1539 the data size is known to be too small and we can't increase it.
1540 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
1541
ca407bdf
PE
15422005-04-15 Paul Eggert <eggert@cs.ucla.edu>
1543
1544 * src/parse-gram.y: Include quotearg.h.
1545 (string_as_id): Quote $1 before using it as a key, since the
1546 lexer no longer quotes it for us.
1547 (string_content): Don't strip quotes, since lexer no longer
1548 quotes it for us.
1549 * src/scan-gram.l: Include quotearg.h.
1550 ("\""): Omit quote.
1551 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
1552 a key, since the rest of the lexer doesn't quote it.
1553 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
1554 * tests/regression.at (Token definitions): Check for backslashes
1555 in token strings.
1556
1557 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
1558 (YYSIZE_T): Define to unsigned long int when using an older compiler.
1559 (yyparse): Revamp code to generate long syntax error message, to
1560 make it easier to translate, and to avoid problems with arithmetic
1561 overflow. Change "virtual memory" to "memory" in diagnostic, since
1562 we don't know whether the memory is virtual.
1563
1ce59070
PE
15642005-04-13 Paul Eggert <eggert@cs.ucla.edu>
1565
1566 * NEWS: Bison-generated C parsers now use the _ macro to
1567 translate strings.
1568 * data/yacc.c (_) [!defined _]: New macro.
1569 All English strings wrapped inside this macro.
1570 * doc/bison.texinfo (Bison Parser): Document _.
1571 * po/POTFILES.in: Include src/parse-gram.c, since it now
1572 includes translateable strings that parse-gram.y doesn't.
1573
a749a695
PE
15742005-04-12 Paul Eggert <eggert@cs.ucla.edu>
1575
1576 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
1577 reverting the 2004-10-11 change to this function.
1578 (symbol_check_alias_consistency): Don't call symbol_type_set
1579 if the type name is already correct.
1580 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
1581
8fb1053b
PE
15822005-03-25 Paul Eggert <eggert@cs.ucla.edu>
1583
1584 * tests/regression.at (Token definitions): Don't use a token named
1585 c, as that generates a "#define c ..." that runs afoul of buggy
1586 stdlib.h that uses the identifier c as a member of struct
1587 drand48_data. Problem reported by Horst Wente.
1588
ff498c4a
PE
15892005-03-21 Paul Eggert <eggert@cs.ucla.edu>
1590
1591 * bootstrap: Change translation URL from
1592 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
1593 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
1594 redirection glitches. Problem reported by twlevo@xs4all.nl.
1595
65211d70
PE
15962005-03-20 Paul Eggert <eggert@cs.ucla.edu>
1597
1598 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
1599 after operands; POSIX says this isn't portable for the c99 command.
1600
9577fb1f
PE
16012005-03-18 Paul Eggert <eggert@cs.ucla.edu>
1602
1603 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
1604 immediately if a data overrun has occurred; this may help us track
1605 down what may be a spurious failure on MacOS.
1606
78b178f7
PE
16072005-03-17 Paul Eggert <eggert@cs.ucla.edu>
1608
a2599d0f
PE
1609 Respond to problems reported by twlevo@xs4all.nl.
1610
1611 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
1612
78b178f7
PE
1613 * src/vcg.h: Comment fix.
1614 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
1615 (G_CMAX): Change to -1 instead of INT_MAX.
1616
1617 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 1618
7296e729
PE
16192005-03-15 Paul Eggert <eggert@cs.ucla.edu>
1620
1621 * src/tables.c (state_number_to_vector_number): Put it inside an
1622 "#if 0", since it's not currently used. Problem reported by
1623 Roland McGrath.
1624
05ac60f3
PE
16252005-03-06 Paul Eggert <eggert@cs.ucla.edu>
1626
1627 * src/output.c (escaped_output): Renamed from
1628 escaped_file_name_output, since we now use it for symbol tags as
1629 well. All uses changed.
1630 (symbol_destructors_output, symbol_printers_output):
1631 Escape symbol tags too.
1632 Problem reported by Matyas Forstner in
1633 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
1634
1635 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
1636 not needed.
1637 * src/output.c (user_actions_output, token_definitions_output,
1638 symbol_destructors_output, symbol_printers_output): Likewise.
1639 * src/reader.c (prologue_augment): Likewise.
1640 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
1641
1642 * src/vcg.c (output_edge): Don't quote linestyle arg.
1643 Problem reported by twlevo@xs4all.nl.
1644
7eb453ac
PE
16452005-02-28 Paul Eggert <eggert@cs.ucla.edu>
1646
1647 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
1648 example, reported by Derek M Jones. Also, make the example even
1649 more outrageous, to better illustrate how bad the problem is.
1650
4c04c52a
PE
16512005-02-24 Paul Eggert <eggert@cs.ucla.edu>
1652
1653 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
1654 putsym. Typo reported by Sebastian Piping.
1655
a61e1620
PE
16562005-02-23 Paul Eggert <eggert@cs.ucla.edu>
1657
1658 * doc/bison.texinfo (Language and Grammar): some -> same
1659 (Epilogue): int he -> in the
1660 Typos reported by Sebastian Piping via Justin Pence.
1661
9ec93868
PE
16622005-02-07 Paul Eggert <eggert@cs.ucla.edu>
1663
1664 * tests/glr-regression.at (Improper handling of embedded actions
1665 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
1666 embedded actions and $-N in GLR parsers", work around an Autoconf bug
1667 with dollar signs in test names.
1668 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
1669 for a similar reason.
1670
73ce7e7e
PE
16712005-01-28 Paul Eggert <eggert@cs.ucla.edu>
1672
1673 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
1674 wants to redefine G_VIEW.
1675
2e72b98e
PE
16762005-01-27 Paul Eggert <eggert@cs.ucla.edu>
1677
1678 * src/vcg.c (get_view_str): Remove case for normal_view.
1679 Problem reported by twlevo@xs4all.nl.
1680
e0d634e5
PE
16812005-01-24 Paul Eggert <eggert@cs.ucla.edu>
1682
ccf830a4
PE
1683 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
1684 Problem reported by twlevo@xs4all.nl.
1685
e0d634e5
PE
1686 * doc/bison.texinfo: Change @dircategory from "GNU programming
1687 tools" to "Software development". Requested by Richard Stallman
1688 via Karl Berry.
1689
7bbc8cb0
PE
16902005-01-23 Paul Eggert <eggert@cs.ucla.edu>
1691
1692 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
1693 Problem reported by twlevo@xs4all.nl.
1694
08b770bc
PE
16952005-01-21 Paul Eggert <eggert@cs.ucla.edu>
1696
1697 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
1698 keyword; it's not needed with modern compilers, and it doesn't
1699 affect correctness with older compilers. Suggested by
1700 twlevo@xs4all.nl.
1701
95f22ad2
PE
17022005-01-17 Paul Eggert <eggert@cs.ucla.edu>
1703
1704 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
1705 gcc -Wswitch-default.
1706 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
1707 * data/yacc.c (yyparse): Likewise.
1708
d229d15c
PE
17092005-01-12 Paul Eggert <eggert@cs.ucla.edu>
1710
1711 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
1712 already. Let config.h define any nonstandard values.
1713
ecadd90f
PE
17142005-01-10 Paul Eggert <eggert@cs.ucla.edu>
1715
1716 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
1717 for the benefit of slower hosts. Problem reported by
1718 Nelson H. F. Beebe.
1719
213744b5
PE
17202005-01-07 Paul Eggert <eggert@cs.ucla.edu>
1721
1722 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
1723 being defined and not used.
1724 * data/lalr1.cc (yyparse): Likewise.
1725 Use "if (false)" rather than "if (0)".
1726
249d3236
PE
17272005-01-05 Paul Eggert <eggert@cs.ucla.edu>
1728
1729 * TODO: Mention that we should allow NUL bytes in tokens.
1730
987cc1fb
PE
17312005-01-02 Paul Eggert <eggert@cs.ucla.edu>
1732
1733 * src/scan-skel.l (<<EOF>>): Don't close standard output.
1734 Problem reported by Hans Aberg.
1735
08fe02d9
PE
17362005-01-01 Paul Eggert <eggert@cs.ucla.edu>
1737
1738 * src/getargs.c (version): Happy new year; update overall
1739 program copyright date from 2004 to 2005.
1740
1741 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
1742 Problem reported by Hans Aberg.
1743 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
1744 (Output file names.): Add a test for the case when standard output
1745 is closed.
1746
010c0266
PE
17472004-12-26 Paul Eggert <eggert@cs.ucla.edu>
1748
1749 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
1750 to fix an oversight in the Bison 2.0 manual.
1751
da12206a
PE
17522004-12-25 Paul Eggert <eggert@cs.ucla.edu>
1753
1754 * NEWS: Version 2.0. Reformat the existing news items since
1755 1.875, so that related items are grouped together.
3a4734aa 1756 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
1757 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
1758
c935d934
PE
1759 * tests/torture.at (Exploding the Stack Size with Alloca): Set
1760 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
1761 otherwise, we're not testing alloca. Unfortunately there's no
1762 simple way to consult HAVE_ALLOCA here.
1763
da12206a
PE
1764 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
1765 for yymsg, too.
1766
1767 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
1768 hand. This avoids a warning about comparing int to size_t when
1769 GCC warnings are enabled.
1770
0a2c5137
PE
17712004-12-22 Paul Eggert <eggert@cs.ucla.edu>
1772
d7e14fc0
PE
1773 * NEWS: Bison-generated parsers no longer default to using the
1774 alloca function (when available) to extend the parser stack, due
1775 to widespread problems in unchecked stack-overflow detection.
1776 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
1777 responsibility to set it to a positive value. This lets the user
1778 specify a value that is not a preprocessor constant.
1779 * data/yacc.c (YYMAXDEPTH): Likewise.
1780 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
1781 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
1782 to be a compile-time constant. However, explain the constraints on it.
1783 Also, explain the constraints on YYINITDEPTH.
1784 (Table of Symbols): Explain that alloca is no longer the default.
1785 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
1786 to 1.
1787
0a2c5137
PE
1788 * doc/bison.texinfo (Location Default Action): Mention that n must
1789 be zero when k is zero. Suggested by Frank Heckenbach.
1790
e019c247
AD
17912004-12-22 Akim Demaille <akim@epita.fr>
1792
1793 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
1794 (parser::state_type, parser::semantic_type, parser::location_type):
1795 Private, not public.
1796 (parser::parse): Return ints, not bool.
1797 Returning a bool introduces a problem: 0 corresponds to false, and
1798 it seems weird to return false on success. Returning true changes
1799 the conventions for yyparse.
1800 Alternatively we could return void and send an exception.
1801 There is no clear consensus (yet?).
1802 (state_stack, semantic_stack, location_stack): Rename as...
1803 (state_stack_type, semantic_stack_type, location_stack_type): these.
1804 Private, not public.
1805 * tests/c++.at: New.
1806 * tests/testsuite.at, tests/Makefile.am: Adjust.
1807
72731bb7
AD
18082004-12-21 Akim Demaille <akim@epita.fr>
1809
1810 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
1811
9a0d8bec
AD
18122004-12-21 Akim Demaille <akim@epita.fr>
1813
1814 Don't impose std::string for filenames.
1815
1816 * data/lalr1.cc (b4_filename_type): New.
1817 (position::filename): Use it.
1818 (parser.hh): Move the inclusion of stack.hh and location.hh below
1819 the user code, so that needed headers for the filename type can be
1820 included first.
72731bb7
AD
1821 Forward declare them before the user code.
1822 * tests/Makefile.am (check-local, installcheck-local): Pass
1823 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 1824
99880de5
AD
18252004-12-20 Akim Demaille <akim@epita.fr>
1826
1827 Use more STL like names: my_class instead of MyClass.
1828
1829 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
1830 (SemanticStack, SemanticType, StateStack, StateType)
1831 (TokenNumberType, Stack, Slice, Traits, Parser::location)
1832 (Parser::value): Rename as...
1833 (location_stack, location_type, rhs_number_type, semantic_stack)
1834 (semantic_type, state_stack, state_type, token_number_type, stack)
1835 (slice, traits, parser::yylloc, parser::yylval): these.
1836
1837 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
1838
9bec482e
PE
18392004-12-19 Paul Eggert <eggert@cs.ucla.edu>
1840
1841 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
1842 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
1843
f6fbd3da
PE
18442004-12-17 Paul Eggert <eggert@cs.ucla.edu>
1845
1846 Remove uses of 'short int' and 'unsigned short int'. This raises
1847 some arbitrary limits. It uses more memory but nowadays that's
1848 not much of an issue.
1849
1850 This change does not affect the generated parsers; that's a different
1851 task, as some users will want to conserve memory there.
1852
1853 Ideally we should use size_t to represent all object counts, and
1854 something like ptrdiff_t to represent signed differences of object
1855 counts; but that will require more code-cleanup than I have the
1856 time to do right now.
1857
1858 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
1859 Use size_t, not int or short int, to count objects.
1860 * src/closure.c (nritemset, closure): Likewise.
1861 * src/closure.h (nritemset, closure): Likewise.
1862 * src/nullable.c (nullable_compute): Likewise.
1863 * src/print.c (print_core): Likewise.
1864 * src/print_graph.c (print_core): Likewise.
1865 * src/state.c (state_compare, state_hash): Likewise.
1866 * src/state.h (struct state): Likewise.
1867 * src/tables.c (default_goto, goto_actions): Likewise.
1868
1869 * src/gram.h (rule_number, rule): Use int, not short int.
1870 * src/output.c (prepare_rules): Likewise.
1871 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
1872 errs, reductions): Likewise.
1873 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
1874 Likewise.
1875 * src/tables.c (vector_number, tally, action_number,
1876 ACTION_NUMBER_MINIMUM): Likewise.
1877 * src/output.c (muscle_insert_short_int_table): Remove.
1878
efeed023
AD
18792004-12-17 Akim Demaille <akim@epita.fr>
1880
1881 * data/lalr1.cc: Extensive Doxygenation.
1882 (error_): Rename as...
1883 (error): this, since it is visible to the user.
1884 Adjust callers.
1885 (Parser::message): Now an automatic variable from...
1886 (Parser::yyreport_syntax_error_): here.
1887 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
1888 Parser::error.
1889 * tests/input.at: Escape $.
1890
bc82c5a5
PE
18912004-12-16 Paul Eggert <eggert@cs.ucla.edu>
1892
1893 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
1894 Parenthesize rhs to avoid obscure problems with mistakes like
1895 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
1896 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
1897 b4_rhs_location): Likewise.
1898 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
1899 b4_rhs_location): Likewise.
1900
fd19f271
AD
19012004-12-16 Akim Demaille <akim@epita.fr>
1902
1903 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
1904 yacc.c: be sure to stay within yycheck_.
1905 * tests/actions.at: Re-enable C++ tests.
1906
10454ea4
AD
19072004-12-16 Akim Demaille <akim@epita.fr>
1908
1909 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
1910 real.
1911
c5b95ccf
AD
19122004-12-16 Akim Demaille <akim@epita.fr>
1913
1914 Use #define to handle the %name-prefix.
1915
1916 * data/glr.c, data/yacc.c: Comment changes.
1917 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
1918 so that one can refer to yylex in the parser file, and have it
1919 renamed, as is the case with other skeletons.
1920
617a8f12
AD
19212004-12-16 Akim Demaille <akim@epita.fr>
1922
1923 Move lalr1.cc internals into yy*.
1924
1925 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
1926 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
1927 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
1928 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
1929 (empty_, final_, terror_, errcode_, ntokens_)
1930 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
1931 (looka_, ilooka_, error_range_, nerrs_):
1932 Rename as...
1933 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
1934 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
1935 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
1936 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
1937 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
1938 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
1939 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
1940 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
1941 these.
1942
1e547e6e
PE
19432004-12-15 Paul Eggert <eggert@cs.ucla.edu>
1944
1945 Fix some problems reported by twlevo at xs4all.
1946 * src/symtab.c (symbol_new): Report an error if the input grammar
1947 contains too many symbols. This is better than calling abort() later.
1948 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
1949 (struct node, struct graph):
1950 Rename member expand to stretch. All uses changed.
1951 (struct graph): Remove member layoutalgorithm. All uses removed.
1952 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
1953 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
1954 All uses changed.
1955 (N_STRETCH): Rename from N_EXPAND. All uses changed.
1956
735d6bd4
AD
19572004-12-15 Akim Demaille <akim@epita.fr>
1958
1959 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
1960 Add more Doxygen comments.
1961 (symprint_, stack_print_, reduce_print_, destruct_, pop)
1962 (report_syntax_error_, translate_): Rename as...
1963 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
1964 (yypop_, yyreport_syntax_error_, yytranslate_): this.
1965
2e1f5829
AD
19662004-12-15 Akim Demaille <akim@epita.fr>
1967
1968 * data/lalr1.cc (lex_): Rename as...
1969 (yylex_): this.
1970 Move the trace here.
1971 Take the %name-prefix into account.
1972 Reported by Alexandre Duret-Lutz.
1973
a3cb6248
AD
19742004-12-15 Akim Demaille <akim@epita.fr>
1975
1976 Simplify the C++ parser constructor.
1977
1978 * data/lalr1.cc (debug_): Rename as...
1979 (yydebug_): so that the parser's internals are always in the yy*
1980 pseudo namespace.
1981 Adjust uses.
1982 (b4_parse_param_decl): Remove the leading comma as it is now only
1983 called as unique argument list.
1984 (Parser::Parser): Remove the constructor accepting a location and
1985 an initial debugging level.
1986 Remove from the other ctor the argument for the debugging level.
1987 (debug_level_type, debug_level, set_debug_level): New.
1988
1989 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
1990 constructor calls.
1991
07fed891
AD
19922004-12-15 Akim Demaille <akim@epita.fr>
1993
1994 Remove b4_root related material: failure experiment
a3cb6248 1995 (which goal was to allow to derive from a class).
07fed891
AD
1996
1997 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
1998 definitions and uses.
1999
e603eaa5
PE
20002004-12-14 Paul Eggert <eggert@cs.ucla.edu>
2001
2002 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
2003 not 2, since it's not portable to subtract 1 from the start of an
2004 array. The new item 0 is never set or used. All uses changed.
2005
2006 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
2007 the default definition of YYLLOC_DEFAULT. Problem reported
2008 by Frank Heckenbach.
2009
fafb007d
PE
20102004-12-12 Paul Eggert <eggert@cs.ucla.edu>
2011
2012 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
2013 the normal case and one for the error case. Just use the
2014 first one uniformly. Problem reported by Frank Heckenbach.
2015 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
2016 use exactly the same macro in both places.
2017 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
2018 so that the normal-case YYRHSLOC works for the error case too.
2019 All uses changed.
2020 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
2021 (YYLLOC_DEFAULT): Use the same macro as glr.c.
2022 * doc/bison.texinfo (Location Default Action): Don't claim that
2023 we have an array of locations. Use the same macro for both glr
2024 and lalr parsers. Mention YYRHSLOC. Mention what happens when
2025 the index is 0.
2026
48814dcd
PE
20272004-12-10 Paul Eggert <eggert@cs.ucla.edu>
2028
a4e1a53b
PE
2029 * HACKING: Update email addresses to send announcements to.
2030
48814dcd
PE
2031 * configure.ac (AC_INIT): Bump version to 1.875f.
2032
337116ba
PE
20332004-12-10 Paul Eggert <eggert@cs.ucla.edu>
2034
2035 * NEWS: Version 1.875e.
2036 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
2037
2038 * src/scan-skel.l: Include "complain.h", for "fatal".
2039
2040 * src/relation.h (relation_print, relation_digraph):
2041 Relation sizes are of type relation_node, not size_t (this is
2042 merely a doc fix, since the two types are equivalent).
2043 (relation_transpose): Relation sizes are of type relation_node,
2044 not int.
2045 * src/relation.c: Likewise.
2046 (top, infinity): Now of type relation_node, not int.
2047 (traverse, relation_transpose): Use relation_node, not int.
2048
2049 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
2050 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
2051 (yyparse): Remove unused local introduced in 2004-10-25 patch.
2052
2053 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 2054 specifying whether the test should be skipped. Use it tp
337116ba 2055 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 2056 fail on some hosts, and should be skipped.
337116ba 2057
da2a7671
PE
20582004-12-08 Paul Eggert <eggert@cs.ucla.edu>
2059
2060 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
2061 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
2062 unless otherwise specified below.
2063
2064 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
2065 to allocate kernel_base, kernel_items, kernel_size, since
2066 they needn't be initialized to 0.
2067 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
2068 * src/closure.c (new_closure): Likewise, for itemset.
2069 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
2070 * src/lalr.c (set_goto_map): Likewise, for temp_map.
2071 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
2072 (build_relations): Likewise for edge, states1, includes.
2073 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
2074 * src/reader.c (packgram): Likewise, for ritem, rules.
2075 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
2076 * src/relation.c (relation_digraph): Likewise for VERTICES.
2077 (relation_transpose): Likewise for new_R, end_R.
2078 * src/symtab.c (symbols_token_translations_init): Likewise for
2079 token_translations.
2080 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
2081 (token_actions): Likewise for yydefact, actrow, conflrow,
2082 conflict_list.
2083 (save_column): Likewise for froms[symno], tos[symno].
2084 (goto_actions): Likewise for state_count.
2085 (pack_table): Likewise for base, pos, check.
2086 (tables_generate): Likewise for width.
2087
2088 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
2089 for initial core. Just have a separate core, so we needn't worry
2090 about whether kernel_size and kernel_base are initialized.
2091
2092 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
2093 kernel_size, kernel_items): Remove unnecessary initialization.
2094 * src/conflicts.c (conflicts): Likewise.
2095 * src/derives.c (derives): Likewise.
2096 * src/muscle_tablc (muscle_insert): Likewise.
2097 * src/relation.c (relation_digraph): Likewise.
2098 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
2099 conflrow, conflict_table, conflict_list, table, check):
2100 Likewise.
2101
2102 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
2103 This is because all callers pass unsigned int.
2104 * src/closure.h (new_closure): Likewise.
2105
2106 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
2107 (build_relations): Initialize includes[i] in all cases.
2108 * src/reader.c (packgram): Always initialize rules[ruleno].prec
2109 and rules[ruleno].precsym. Initialize members in order.
2110 * src/relation.c (relation_transpose): Always initialize new_R[i]
2111 and end_R[i].
2112 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
2113
2114 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
2115 conflict_list[0] was always 0, but now it isn't initialized.
2116
2117 * src/table.c (table_grow): When conflict_table grew, the grown
2118 area wasn't cleared. Fix this.
2119
2120 * lib/.cvsignore: Add strdup.c, strdup.h.
2121 * m4/.cvsignore: Add strdup.m4.
2122
00baeeac
PE
21232004-12-07 Paul Eggert <eggert@cs.ucla.edu>
2124
2125 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
2126 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
2127 GOTO_NUMBER_MAXIMUM, since we occasionally compute
2128 ngotos + 1 without checking for overflow.
2129 (build_relations): Use END_NODE, not -1, to denote end of edges.
2130 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
2131 build_relations): Use goto_number, not int, for goto numbers.
2132 * src/tables.c (save_column, default_goto): Likewise.
2133
be3d9d42
AD
21342004-11-23 Akim Demaille <akim@epita.fr>
2135
2136 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
2137 of #defining from yystype.
2138 Don't typedef yystype, C++ does not need it.
2139 This lets it possible to forward declare it as union.
2140
78e526d5
PE
21412004-11-23 Paul Eggert <eggert@cs.ucla.edu>
2142
2143 * bootstrap (gnulib_modules): Add extensions.
2144 Problem reported by Jim Meyering.
2145
afbb696d
PE
21462004-11-22 Paul Eggert <eggert@cs.ucla.edu>
2147
2148 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
2149 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
2150 src/system.h, src/tables.c: XFREE -> free, to accommodate
2151 recent change to gnulib xalloc.h.
78e526d5 2152 Problem reported by Jim Meyering.
afbb696d 2153
c1f8f16a
AD
21542004-11-17 Akim Demaille <akim@epita.fr>
2155
2156 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
2157
21582004-10-28 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
2159 Alexandre Duret-Lutz <adl@gnu.org>
2160
2161 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
2162 changes.
2163 (YYCDEBUG): Adjust.
2164 Use it instead of cdebug_.
2165 (Parser::debug_stream, Parser::set_debug_stream): New.
2166 (Parser::symprint_): Define cdebug_ for temporary backward
2167 compatibility.
2168 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
2169 debug_stream ().
2170
68e11668
AD
21712004-11-17 Akim Demaille <akim@epita.fr>
2172
2173 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
2174 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
2175 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
2176 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
2177
97cbc73e
PE
21782004-10-27 Paul Eggert <eggert@cs.ucla.edu>
2179
2180 * data/glr.c (yyloc_default): Remove; not used.
2181 Problem reported by Frank Heckenbach.
2182
e342c3be
AD
21832004-10-25 Akim Demaille <akim@epita.fr>
2184
2185 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
2186 Introduce another definition to address simple location arrays.
2187 (yyGLRStack): New member: yyerror_range.
2188 (yyrecoverSyntaxError, yyparse): Update it.
2189 (yyrecoverSyntaxError): Use it when shifting the error token to
2190 have an accurate range, equivalent to the one computed by both
2191 yacc.c and lalr1.cc.
2192 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
2193 that column numbers start at column 0, as per GNU Coding
2194 Standards, the others tests, and the doc.
2195 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
2196 Adjust to the above change (first column is 0).
2197 And adjust the location of the "<error>", now covering the whole
2198 line.
2199
93602feb 22002004-10-22 Akim Demaille <akim@epita.fr>
04098407 2201 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
2202
2203 Remove some arbitrary limits on goto numbers and relations.
2204 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
2205 initial values, since they're never used.
2206 (set_goto_map): ngotos is now unsigned, so test for overflow
2207 by seeing whether it wraps around to zero.
2208 * src/lalr.h (goto_number): Now size_t, not short int.
2209 (GOTO_NUMBER_MAXIMUM): Remove.
2210 * src/relation.c (relation_print, traverse, relation_transpose):
2211 Check for END_NODE rather than looking at sign.
2212 * src/relation.h (END_NODE): New macro.
2213 (relation_node): Now size_t, not short int.
2214
dba08b04
PE
22152004-10-22 Paul Eggert <eggert@cs.ucla.edu>
2216
2217 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
2218 keyword, not an identifier. Problem reported by Baron Schwartz in
2219 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
2220
df09ef2e
AD
22212004-10-11 Akim Demaille <akim@epita.fr>
2222
2223 * src/symtab.c (symbol_check_alias_consistency): Also check
2224 type names, destructors, and printers.
2225 Reported by Alexandre Duret-Lutz.
2226 Recode the handling of associativity and precedence in terms
2227 of symbol_precedence_set.
2228 Accept no redeclaration at all, not even equal to the previous
2229 value.
2230 (redeclaration): New.
2231 Use it to factor redeclaration complaints.
2232 (symbol_make_alias): Don't set the type of the alias, let
2233 symbol_check_alias_consistency do it as for other features.
2234 * src/symtab.h (symbol): Add new member prec_location, and
2235 type_location.
2236 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
2237 * tests/input.at (Incompatible Aliases): New.
2238
146bc99d
PE
22392004-10-09 Paul Eggert <eggert@cs.ucla.edu>
2240
2241 .cvsignore fixes to accommodate gnulib changes,
2242 and the practice of naming build directories "_build".
2243 * .cvsignore: Add "_*". Sort.
2244 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
2245 * m4/.cvsignore: Add "*_gl.m4".
2246
e503aa60
AD
22472004-10-06 Akim Demaille <akim@epita.fr>
2248
2249 * src/parse-gram.y (add_param): Fix the truncation of trailing
2250 spaces.
2251
b4a20338
AD
22522004-10-05 Akim Demaille <akim@epita.fr>
2253
2254 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
2255 whether the reducion was empty or not. This leaves room to
2256 improve the use of YYLLOC_DEFAULT in such a case.
2257 lalr1.cc is still experimental, so changing this is acceptable.
2258 And finally, there are probably not many users who changed the
2259 handling of locations in GLR, so changing is admissible too.
2260
2261 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
2262 empty reduction, set @$ to an empty location ending the previously
2263 stacked symbol.
2264 Adjust uses to make sure the code is triggered on empty
2265 reductions.
2266 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
2267 expected output: empty reductions have empty locations.
2268
f85a5e6f
AD
22692004-09-29 Akim Demaille <akim@epita.fr>
2270
2271 * data/lalr1.cc: Move towards a more standard C++ coding style
2272 for templates: Class < T > -> Class<T>.
2273
b203fc2c
AD
22742004-09-29 Akim Demaille <akim@epita.fr>
2275
2276 * data/lalr1.cc: Reinstall the former ctor, for sake of
2277 compatibility, but warn it will be removed.
2278 Move towards a more standard C++ coding style (i.e., type *var ->
2279 type* var).
2280
5b7e1e73
PE
22812004-09-27 Paul Eggert <eggert@cs.ucla.edu>
2282
3fee967f
PE
2283 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
2284 since it's less likely to work if NULs are involved in the future.
5b7e1e73 2285
0dcca5c2
AD
22862004-09-27 Akim Demaille <akim@epita.fr>
2287
2288 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
2289
6dde1c82
AD
22902004-09-27 Akim Demaille <akim@epita.fr>
2291
2292 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 2293 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
2294 and argument names.
2295 (b4_cc_constructor_call): Likewise.
2296
b233d555
AD
22972004-09-24 Akim Demaille <akim@epita.fr>
2298
2299 * src/parse-gram.y (add_param): Strip the leading and trailing
2300 blanks from a formal argument declaration.
2301 (YY_LOCATION_PRINT): New.
2302
619404e3
AD
23032004-09-24 Akim Demaille <akim@epita.fr>
2304
2305 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
2306 after the location.
2307
dd8d9022
AD
23082004-09-24 Akim Demaille <akim@epita.fr>
2309
2310 * doc/bison.texinfo (Table of Symbols): Sort.
2311
0092f063
AD
23122004-09-21 Akim Demaille <akim@epita.fr>
2313
2314 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
2315 the useless parentheses.
2316 Suggested by Paul Eggert.
2317
451364ed
AD
23182004-09-20 Akim Demaille <akim@epita.fr>
2319
2320 Let the initial-action act on the look-ahead, and use it for the
2321 "initial push" (corresponding to an hypothetical beginning-of-file).
2322 And let lalr1.cc honor %initial-action.
2323
2324 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
2325 example.
2326 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
2327 (Parser::Parser): Remove the ctor that used to initialize it.
2328 (Parser::parse): Like in the other skeletons, issue the "starting
2329 parse" message before any action.
2330 Honor %initial-action.
2331 Initialize the stacks with the lookahead.
2332 * data/yacc.c: Let $$ and @$ in %initial-action designate the
2333 look-ahead.
2334 Push them in the stacks.
2335 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
2336
18d192f0
AD
23372004-09-20 Akim Demaille <akim@epita.fr>
2338
2339 * doc/bison.texinfo (Initial Action Decl): New.
2340
b8458aa5
AD
23412004-09-20 Akim Demaille <akim@epita.fr>
2342
2343 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
2344 clearer criterion to define it.
2345 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
2346 When reducing on an empty RHS, use the latest stacked location as
2347 location.
2348 yylloc is not always available.
2349 * data/glr.c: Likewise.
2350 Also, honor initial-actions.
2351
3fc16193
AD
23522004-09-20 Akim Demaille <akim@epita.fr>
2353
2354 * data/yacc.c (YY_LOCATION_PRINT): New.
2355 Define when we know YYLTYPE's structure, i.e., when the default
2356 YYLLOC_DEFAULT is used.
2357 * data/c.m4 (b4_yysymprint_generate): Use it.
2358 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
2359 value of the result.
2360 (error_start_): Replace with...
2361 (error_range_): this location array.
2362 This allows to replace code relying on the implementation of
2363 locations by portable code.
2364 * data/yacc.c (yylerrsp): Replace with...
2365 (yyerror_range): this.
2366 Every time a token is popped, update yyerror_range[0], to have an
2367 accurate location for the error token.
2368 * data/glr.c (YY_LOCATION_PRINT): New.
2369 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
2370 deference a pointer.
2371 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
2372 report the location in %printers.
2373
2374 * src/scan-skel.l: Instead of abort, report error messages to ease
2375 understanding skeleton scanning failures.
2376
ecfe33e7
AD
23772004-09-16 Akim Demaille <akim@epita.fr>
2378
2379 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
2380 (iterator, const_iterator): these, to be more in the C++ spirit.
2381 Also, return reverse iterators so that when displaying the stack
2382 we display its bottom first.
2383 (Parser::stack_print_, Parser::reduce_print_): Match the messages
2384 from yacc.c.
2385 We should probably use vector here though.
2386
1576d44d
AD
23872004-09-16 Akim Demaille <akim@epita.fr>
2388
2389 Have more complete shift traces.
2390
2391 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
2392 to report Shifts instead of ad hoc YYDPRINTF invocations,
2393 including for the error token.
2394 * data/lalr1.cc (symprint_): Output the location.
2395 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
2396 output the location within the %printer.
2397 Activate GLR tests, at least to make sure they compile properly.
2398 They still don't pass though.
2399 * tests/calc.at: Adjust expect verbose output, since now "Entering
2400 state..." is on a different line than the "Shifting" message.
2401
9c66f418
AD
24022004-09-08 Akim Demaille <akim@epita.fr>
2403
2404 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
2405 Bison directive from the Bison file to the invocation of this
2406 macro, so that these directives are passed to
2407 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
2408 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
2409 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
2410 the extra Bison directives instead of the whole series.
2411 Change the grammar so that there are recoverable errors, and
2412 unrecoverable errors. Now we can have the parser give up before
2413 consuming the whole input. As a result we now can observe that
2414 the lookahead is freed when needed.
2415 Change the parser source to parse argv[1] instead of a hard coded
2416 string.
2417 Simplify yylex, and give a value and location to EOF.
2418 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
2419 passed directives already coded in the file.
2420 Add some tests to check the location of "error".
2421 For some tests, the C++ parser is correct, and not yacc.c.
2422 For other tests, they provide different, but unsatisfying, values,
2423 so keep the C++ value so that at least one parser is "correct"
2424 according to the test suite.
2425 (Actions after errors): Remove, this is subsumed by the
2426 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
2427
52d5733f
AD
24282004-09-06 Akim Demaille <akim@epita.fr>
2429
2430 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 2431 (Parser::pop): New.
52d5733f
AD
2432 Use it.
2433
a0e68930
AD
24342004-09-06 Akim Demaille <akim@epita.fr>
2435
2436 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
2437 argument, an informative message.
2438 Call YY_SYMBOL_PRINT.
2439 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
2440 * data/lalr1.cc (destruct_): Likewise.
2441 In addition, no longer depend on b4_yysymprint_generate and
2442 b4_yydestruct_generate to generate these functions, do it "by
2443 hand".
2444
e757bb10
AD
24452004-09-03 Akim Demaille <akim@epita.fr>
2446
2447 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
2448 invoked, yydestruct the lookahead.
2449 * tests/calc.at (Calculator $1): Update the expected lengths of
2450 traces: there is an added line for the discarded lookahead.
2451 * doc/bison.texinfo (Destructor Decl): Some rewording.
2452 Define "discarded" symbols.
2453
0fe1f06d
AD
24542004-09-02 Akim Demaille <akim@epita.fr>
2455
2456 * data/lalr1.cc (translate_, destruct_): No reason to be static.
2457
284acc8b
AD
24582004-09-02 Akim Demaille <akim@epita.fr>
2459
2460 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
2461 (YYDSYMPRINTF): Rename as...
2462 (YY_SYMBOL_PRINT): this.
2463 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
2464 two.
2465 Use it instead of direct symprint_ calls.
2466 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
2467 one.
2468
a5eb1ed2
AD
24692004-09-02 Akim Demaille <akim@epita.fr>
2470
b7c72fe1
AD
2471 * data/lalr1.cc (b4_yysymprint_generate): New.
2472 (symprint_): New member function, defined when YYDEBUG.
2473 Use it consistently instead of token/nterm debugging output by
2474 hand.
a5eb1ed2
AD
2475 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
2476 %printer calls to use cdebug_ when using lalr1.cc.
2477
417141dd
AD
24782004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
2479
2480 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
2481 with #ifdef YYDEBUG.
2482
2fa09258
AD
24832004-08-26 Akim Demaille <akim@epita.fr>
2484
2485 * doc/bison.texinfo (Implementing Loops): Rename as...
2486 (Implementing Gotos/Loops): this.
2487
9378b508
PE
24882004-08-13 Paul Eggert <eggert@cs.ucla.edu>
2489
2490 Adjust to latest gnulib.
2491 * bootstrap (gnulib_modules): Add xalloc-die.
2492 Set LC_ALL=C so that file names sort consistently.
2493 Prefer the gnulib copies of gettext.m4, glibc21.m4,
2494 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
2495 uintmax_t.m4, ulonglong.m4.
2496 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
2497 po.m4 since we are now using _gl.m4 instead.
2498
87a8ad5c
PE
24992004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
2500
2501 * src/scan-action.l: Remove. Scanning of semantic actions is
2502 handled in scan-gram.l.
2503
dca81a78
PE
25042004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
2505
2506 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
2507
2508 * src/location.h (struct): The file member is a uniqstr.
2509 (equal_boundaries): Use UNIQSTR_EQ for comparison.
2510
c9cbf7c5
PE
25112004-07-22 Paul Eggert <eggert@cs.ucla.edu>
2512
2513 Fix bug with non-%union parsers that have printers or destructors,
2514 which led to a Bison core dump. Reported by Peter Fales in
2515 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 2516
c9cbf7c5
PE
2517 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
2518 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
2519 not to our own type.
2520 * src/output.c (symbol_destructors_output, symbol_printers_output):
2521 Don't assume %union.
2522 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
2523 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
2524 UNION-FLAG. All callers changed.
2525 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
2526 Use type char, not unsigned int, when declaring an array of char;
2527 this lets us remove a cast.
2528 (Printers and Destructors): Add non-%union test cases.
2529
fa7e68c3
PE
25302004-06-21 Paul Eggert <eggert@cs.ucla.edu>
2531
2532 * doc/bison.texinfo: Minor editorial changes, mostly to the new
2533 GLR writeups. E.g., avoid frenchspacing and the future tense,
2534 change "lookahead" to "look-ahead", and change "wrt" to "with
2535 respect to".
2fa09258 2536
fa7e68c3
PE
25372004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
2538
2539 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
2540 New sections, split off from the GLR Parsers section. Put the new
2541 Simple GLR Parser near the start of the GLR section, for clarity.
2542 Rewrite connective text.
2543
99a9344e
PE
25442004-06-21 Frank Heckenbach <frank@g-n-u.de>
2545
2546 * doc/bison.texinfo (Simple GLR Parsers): New section.
2547
8dd162d3
PE
25482004-06-21 Paul Eggert <eggert@cs.ucla.edu>
2549
2550 * NEWS, TODO, doc/bison.texinfo:
2551 Use "look-ahead" instead of "lookahead", to be consistent.
2552 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
2553 while we're fixing "look-ahead".
2554 * src/conflicts.c (shift_set): Renamed from shiftset.
2555 (look_ahead_set): Renamed from lookaheadset.
2556 * src/print.c: Likewise.
2557 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
2558 name for "lookahead".
2559 (report_types, usage): Likewise.
2560 * src/getargs.h (report_look_ahead_tokens): Renamed from
2561 report_lookaheads.
2562 * src/lalr.c (compute_look_ahead_tokens): Renamed from
2563 compute_lookaheads.
2564 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
2565 (look_ahead_tokens_print): Renamed from lookaheads_print.
2566 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
2567 state_rule_lookaheads_print.
2568 * src/state.h: Likewise.
2569 (reductions.look_ahead_tokens): Renamed from lookaheads.
2570 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
2571 AT_DATA_LOOKAHEADS_GRAMMAR.
2572
57a90331
PE
25732004-06-03 Paul Eggert <eggert@cs.ucla.edu>
2574
2575 * README: Update location of patched M4 distribution.
2576
8ed3234a
PE
25772004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
2578
2579 Don't assume the C++ compiler takes the same arguments as the C compiler
2580 (trivial change).
2581 * configure.ac (O0CXXFLAGS): New var.
2582 * tests/atlocal.in (CXXFLAGS): Use it.
2583
07971983
PE
25842004-05-29 Paul Eggert <eggert@cs.ucla.edu>
2585
2586 Fix some "make check" problems with C++ reported by
2587 Albert Chin-A-Young for Tru64 C++ in this thread:
2588 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
2589
2590 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
2591 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
2592 Output to a .cc file for C++, not to a .c file.
2593 * tests/calc.at (AT_CHECK_CALC): Likewise.
2594 * tests/regression.at (AT_CHECK_DANCER): Likewise.
2595 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
2596
29058652
PE
25972004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
2598
2599 * tests/calc.at, tests/actions.at: Workaround for SGI
2600 C++ compiler. (trivial change)
2601
62cb8a99
PE
26022004-05-27 Paul Eggert <eggert@cs.ucla.edu>
2603
fd418816
PE
2604 Spent a few hours checking out which prerequisite versions the
2605 current sources actually require. I went all the way back to
2606 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
2607 a seemingly endless set of combinations of versions more recent
2608 than that. The bottom line is that the current sources require
2609 fairly recent versions of the build tools, and it'll be some work
2610 to change this.
2611 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
2612 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
2613 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
2614 Add comments explaining why those particular versions are
2615 currently needed.
2fa09258 2616
62cb8a99
PE
2617 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
2618 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 2619 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
2620
2621 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
2622 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
2623
caa52c10
PE
26242004-05-26 Paul Eggert <eggert@cs.ucla.edu>
2625
2626 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
2627 0.11.5. Suggested by Bruno Haible.
2628 * bootstrap: Remove gettext version checking.
2629
2630 * doc/bison.texinfo (Decl Summary): Also mention that %union
2631 can depend on prerequisite types. Problem reported by Tim
2632 Van Holder.
2633
4bfd5e4e
PE
26342004-05-25 Paul Eggert <eggert@cs.ucla.edu>
2635
2cef3017
PE
2636 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
2637 * README-alpha: Don't tell people not to package this.
2638
b9c85d5c
PE
2639 * bootstrap: Don't assume $(...) works; use `...` instead.
2640 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
2641 gettext better.
2642
4bfd5e4e
PE
2643 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
2644 put into the -d output file, and mention what to do if YYSTYPE is
2645 defined as a macro.
2646
6a36ff94
PE
26472004-05-24 Paul Eggert <eggert@cs.ucla.edu>
2648
6712933e
PE
2649 Undo change made earlier today: it caused autopoint to not bring
2650 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
2651 autopoint's.
2652
2653 * bootstrap: Check that gettext version matches what's in
2654 configure.ac. Warn users to ignore robots.txt ERROR 404.
2655 * bootstrap: Undo today's earlier change (logged below).
2656 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 2657
6a36ff94
PE
2658 The gettext version checking is causing more trouble than it's
2659 curing; remove it. Problem reported by Paul Hilfinger.
2660
2661 * bootstrap: Issue a warning that one can expect a message
2662 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
2663 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
2664
209ea708
PE
26652004-05-23 Paul Eggert <eggert@cs.ucla.edu>
2666
2667 Ensure that the C++ compiler used for testing actually works on a
2668 simple test program; if not, skip the C++-related tests. Problem
2669 reported by Vin Shelton in:
161a71f3 2670 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
2671
2672 * m4/cxx.m4: New file.
2673 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
2674 * tests/atlocal.in (BISON_CXX_WORKS): Add.
2675 * tests/local.at (AT_COMPILE_CXX): Use it.
2676
41ca2549
PE
26772004-05-21 Paul Eggert <eggert@cs.ucla.edu>
2678
383e69dc
PE
2679 * data/glr.c (yylloc): Output this macro even if locations are not
2680 being generated, as the GLR parser needs it even in that case.
2681 Problem reported by Troy A. Johnson
2682 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
2683
41ca2549
PE
2684 * configure.ac (AC_INIT): Update to 1.875e.
2685
e476c87d
PE
26862004-05-21 Paul Eggert <eggert@cs.ucla.edu>
2687
2688 * NEWS: Version 1.875d.
2689 * configure.ac (AC_INIT): Likewise.
2690 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
2691
2692 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
2693 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
2694 lalr1.cc runs afoul of the first, and the last two are no longer
2695 supported by GCC 3.4.0.
2696 * README: Mention GNU m4 1.4 or later; mention m4 patches.
2697 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
2698
233a88ad
PE
26992004-05-06 Paul Eggert <eggert@cs.ucla.edu>
2700
2701 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
2702 unsigned int, for compatibility with latest gnulib hash module.
2703 * src/state.c (state_hash, state_hasher): Likewise.
2704 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
2705 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 2706
12ffdd28
PE
27072004-05-03 Paul Eggert <eggert@cs.ucla.edu>
2708
2709 * NEWS: Unescaped newlines are no longer allowed in char & strings.
2710
2711 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
2712 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
2713 character and string literals.
2714 (unexpected_end): New function.
2715 (unexpected_eof): Use it.
2716 (unexpected_newline): New function.
2717 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
2718 actions.
e476c87d 2719
12ffdd28
PE
2720 * NEWS: Document %expect-rr.
2721
2722 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
2723 Fix typo by replacing $1 with $option.
2724 Remove more 'intl'-related files.
9668e2be 2725 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
2726
2727 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
2728 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
2729 strtoul.c.
2730 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
2731 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
2732 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
2733 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
2734 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
2735 * src/.cvsignore: Add *.output.
2736
2737 * src/parse-gram.y: Put copyright notice inside %{ %} so it
2738 gets copied to the output file.
e476c87d 2739
1f65350a
PE
27402004-04-28 Paul Eggert <eggert@twinsun.com>
2741
2742 Get files from the gnulib and po repositories, instead of relying
2743 on them being in our CVS. Upgrade to latest versions of gnulib
2744 and Automake.
2745
2746 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
2747 * bootstrap: Bootstrap from gnulib and po repositories.
2748 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
2749 * README-cvs: Document these changes. Remove version numbers from
2750 mentions of build tools, since they change so often. Mention Flex.
2751
2752 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
2753 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
2754 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
2755 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 2756 does this for us.
12ffdd28
PE
2757 (AC_ISC_POSIX): Remove; we no longer support this
2758 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
2759 (AC_HEADER_STDC): Remove: we now assume C89 or better.
2760 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
2761 Do not check for C89 headers, except for locale.h which is used
2762 by the Yacc library and must port to K&R hosts.
2763 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
2764 Do not check for C89 functions, except for setlocale which is
2765 used by the Yacc library.
2766 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
2767 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
2768 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
2769 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
2770 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
2771 AM_GNU_GETTEXT): Remove; now done by:
2772 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
2773 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
2774 for us.
2775
2776 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
2777 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
2778 Define to empty, as gnulib.mk will do the rest for us.
2779 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
2780 for us.
2781 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
2782 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
2783
2784 * src/files.c: Include gnulib's xstrndup.h.
2785
2786 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
2787 (REALLOC): Use xnrealloc, for likewise.
2788 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
2789 (strnlen, memrchr): Remove decls; functions no longer used.
2790 Include <stpcpy.h>.
2791
2792 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
2793 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
2794 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
2795 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
2796 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
2797 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
2798 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
2799 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
2800 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
2801 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
2802 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
2803 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
2804 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
2805 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
2806 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
2807 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
2808 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
2809 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
2810 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
2811 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
2812 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
2813 Remove, as these files are now generated automatically
2814 by bootstrap or automake.
2815
2816 * po/ChangeLog: Remove: all but one entry was a duplicate
2817 of this file, and I moved that 2000-11-02 entry here.
2818
2819 * config/.cvsignore: Add Makefile, depcomp, install-sh.
2820 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
2821 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
2822 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
2823 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
2824 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
2825 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
2826 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
2827 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
2828 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
2829 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
2830 xstrndup.h.
2831 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
2832 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
2833 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
2834 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
2835 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
2836 * src/.cvsignore: Remove *_.c.
2837
2838
2839 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
2840 support it. (The latest stable gzip doesn't.)
2841
28422004-04-27 Paul Eggert <eggert@twinsun.com>
2843
2844 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
2845 case, as stos_ is now used by destructors due to the 2004-02-09
2846 change.
2847
2848 Remove more K&R C support.
2849 * lib/libiberty.y (PARAMS): Remove. All uses removed.
2850 * lib/subpipe.c (errno): Remove decl.
2851 Include <stdlib.h> unconditionally.
2852 (EXIT_FAILURE): Remove macro.
2853 * src/complain.c (vfprintf, strerror): Remove.
2854 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
2855 unconditionally.
2856 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
2857 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
2858 (strchr, strspn, memchr): Remove decls.
2859 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
2860 unconditionally. Do not declare perror.
2861 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
2862 unconditionally.
2863
2864 * src/complain.c (_): Remove useless defn, as system.h defines this.
2865
2866 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
2867 with latest obstack.h.
2868 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
2869 to procedure types, as obstack.h now does that for us.
2870 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
2871
2872 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
2873 so that this include file can stand alone.
2874 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
2875 does this now. Include subpipe.h first after config.h, to
2876 test whether it can stand alone.
2877
2878 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
2879 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
2880 unused declaration.
2881
2882 * tests/synclines.at (%union synch line): Put a dummy member in
2883 the union, because empty unions aren't allowed in C. Caught
2884 by GCC 3.4.0.
2885
4f16766c
PE
28862004-04-13 Jim Meyering <jim@meyering.net>
2887
2888 * src/conflicts.c (conflicts_print): Correct format string typo:
2889 use `%%' to produce literal `%'. (trivial change)
2890
779e7ceb
PE
28912004-03-30 Paul Eggert <eggert@twinsun.com>
2892
2893 * src/getargs.c (version): Update copyright year to 2004.
2894
2895 * data/c.m4 (b4_int_type): Use 'short int' rather than
2896 'short', and similarly for 'long', 'unsigned', etc.
2897 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
2898 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
2899 yy_yypstack, yydumpstack): Likewise.
2900 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
2901 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
2902 Likewise.
2903 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
2904 yy_stack_print, yyparse): Likewise.
2905 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
2906 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
2907 * lib/bitset.c (bitset_print): Likewise.
2908 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
2909 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
2910 * lib/bitsetv.c (bitsetv_dump): Likewise.
2911 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
2912 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
2913 Likewise.
2914 * src/LR0.c (allocate_itemsets): Likewise.
2915 * src/gram.h (rule_number, rule): Likewise.
2916 * src/lalr.h (goto_number): Likewise.
2917 * src/nullable.c (nullable_compute): Likewise.
2918 * src/output.c (prepare_rules): Likewise.
2919 * src/relation.c (relation_print, relation_digraph): Likewise.
2920 * src/relation.h (relation_node): Likewise.
2921 * src/state.h (state_number, transitions, errs, reductions,
2922 struct state): Likewise.
2923 * src/symtab.h (symbol_number, struct symbol): Likewise.
2924 * src/tables.c (vector_number, tally, action_number,
2925 default_goto, goto_actions): Likewise.
2926 * tests/existing.at (GNU Cim Grammar): Likewise.
2927 * tests/regression.at (Web2c Actions): Likewise.
2928
2929 * src/output.c (muscle_insert_short_int_table): Renamed from
2930 muscle_insert_short_table. All uses changed.
2931
d6328241
PH
29322004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2933
2934 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
2935 (declaration): Replace expected_conflicts with expected_sr_conflicts.
2936 Add %expect-rr rule.
4f16766c 2937
d6328241
PH
2938 * src/scan-gram.l: Recognize %expect-rr.
2939
4f16766c 2940 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 2941 expected_conflicts.
4f16766c 2942 (expected_rr_conflicts): Declare.
d6328241
PH
2943
2944 * src/conflicts.c (expected_sr_conflicts): Rename from
2945 expected_conflicts.
2946 (expected_rr_conflicts): Define.
2947 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
2948 for GLR parsers.
2949 Use expected_sr_conflicts in place of expected_conflicts.
2950 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 2951
d6328241 2952 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 2953
1452af69
PE
29542004-03-08 Paul Eggert <eggert@gnu.org>
2955
2956 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 2957 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
2958
2959 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
2960 in lalr1.cc.
2961 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
2962 * src/scan-gram.l (scan_integer): New function.
2963 ({int}): Use it.
2964 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
2965 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
2966 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
2967 Say "long int", not "long", for uniformity with GNU style.
2968
006d217d
PE
29692004-02-25 Paul Eggert <eggert@twinsun.com>
2970
2971 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
2972 compilers. This fixes a problem with Intel's C++ compiler being
2973 chatty, reported by Guido Trentalancia in
161a71f3 2974 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 2975
c2729758
ADL
29762004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
2977
2978 Support %destructor and merge error locations in lalr1.cc.
2979
2980 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
2981 (Parser::stos_): Define unconditionally.
2982 (Parser::destruct_): New method. Generate its body with
2983 b4_yydestruct_generate.
2984 (Parser::error_start_): New attribute.
2985 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
2986 token which are discarded.
2987 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
2988 error_start_ when erroneous token are discarded.
2989 (Parser::parse) <yyerrlab1>: Compute the location of the error
2990 token so that it covers all the discarded tokens.
2991 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
2992 it can be called with `%skeleton "lalr1.cc"', and do that.
2993
dd0e0635
PE
29942004-02-02 Paul Eggert <eggert@twinsun.com>
2995
2996 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
2997 $(top_srcdir)/lib and ../lib. This fixes a bug reported
2998 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
2999 There's no need to mention top_builddir since Automake does that
3000 for us.
3001 (INCLUDES): Remove, as Automake says it's obsolescent.
3002 Contents migrated into AM_CPPFLAGS as described above.
3003 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
3004
30052004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3006
3007 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
3008 (yyreportSyntaxError): Handle case where lookahead token is
3009 YYEMPTY.
3010
be16239b
PH
30112004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3012
3013 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
3014 resulting parsers are compilable with C++.
3015
5fa90832
PE
30162003-12-23 Paul Eggert <eggert@twinsun.com>
3017
3018 * config/depcomp, config/install-sh: Sync with Automake 1.8.
3019 * src/output.c (output_skeleton): Rename local var.
3020 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
3021 Bison tokens, as this runs afoul of the 2003-10-07 change that
3022 disallowed NUL bytes in character constants or string literals.
3023
3024 * tests/local.at: Require Autoconf 2.59's Autotest.
3025 * tests/testsuite.at: Don't include local.at, since we now assume
3026 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
3027 including it.
3028 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
3029 multiple inclusion warnings.
dd0e0635 3030
b165c324
AD
30312003-12-02 Akim Demaille <akim@epita.fr>
3032
3033 * doc/bison.texinfo (How Can I Reset the Parser): More about start
3034 conditions.
3035 From Bruno Haible.
3036
26e06a21
ADL
30372003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
3038
3039 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
3040
92ac3705
PE
30412003-10-07 Paul Eggert <eggert@twinsun.com>
3042
6a5ecb38
PE
3043 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
3044 if testsuite doesn't exist.
3045
92ac3705
PE
3046 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
3047 literals, unfortunately.
3048 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
3049 Complain about NUL bytes in character constants or string literals.
3050
91d2c560
PE
30512003-10-05 Paul Eggert <eggert@twinsun.com>
3052
3053 * NEWS: Don't document %no-default-prec, as it's still
3054 too experimental.
3055 * doc/bison.texinfo: Document %no-default-prec only if
3056 the defaultprec flag is set. Normally it's not.
3057
0cc3da3a
PE
30582003-10-04 Paul Eggert <eggert@twinsun.com>
3059
3060 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
3061 non-modifiable lvalue, instead of a modifiable one.
3062 * doc/bison.texinfo (Actions): Document that $$ can
3063 be assigned to. Do not claim that $$ and $N are
3064 array element references: user code should not rely on this.
3065
22fccf95
PE
30662003-10-01 Paul Eggert <eggert@twinsun.com>
3067
3068 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
3069 (grammar_declaration): Use it.
3070 * src/scan-gram.l: New token %no-default-prec.
3071 * tests/conflicts.at: Revamp tests to use %no-default-prec.
3072 * NEWS, doc/bison.texinfo: Document the above.
3073
fc8f2965
AD
30742003-10-01 Akim Demaille <akim@epita.fr>
3075
3076 VCG no longer supports long_straight_phase.
3077
3078 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
3079 * src/print_graph.c (print_graph): Adjust.
3080
39a06c25
PE
30812003-09-30 Frank Heckenbach <frank@g-n-u.de>
3082 and Paul Eggert <eggert@twinsun.com>
3083
3084 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
3085 Table of Symbols): Document %default-prec.
3086 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
3087 (grammar_declaration): Set default_prec on %default-prec.
3088 * src/scan-gram.l (%default-prec): New token.
3089 * src/reader.h (default_prec): New flag.
3090 * src/reader.c: Likewise.
3091 (packgram): Handle it.
3092 * tests/conflicts.at (%default-prec without %prec,
3093 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 3094
39a06c25
PE
30952003-09-30 Paul Eggert <eggert@twinsun.com>
3096
3097 * tests/testsuite.at: Include local.at, not input.at, fixing
3098 a typo in the 2003-08-25 patch.
3099
62b6aef9
AD
31002003-08-27 Akim Demaille <akim@epita.fr>
3101
3102 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
3103 GCC warnings.
3104
89e1cc61
AD
31052003-08-26 Akim Demaille <akim@epita.fr>
3106
3107 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
3108 "<\#" to avoid magic from Gnus when posting parts of this script.
3109
a08460b0
AD
31102003-08-26 Akim Demaille <akim@epita.fr>
3111
3112 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
3113 (Parser::parse): here.
3114 Adjust: nerrs and errstatus is now replaced by...
3115 (Parser::nerrs_, Parser::errstatus_): New.
3116
603f1cfd
AD
31172003-08-25 Akim Demaille <akim@epita.fr>
3118
3119 * config/announce-gen, Makefile.cfg: New.
3120 * Makefile.am: Adjust.
3121 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
3122 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
3123
cd3684cf
AD
31242003-08-25 Akim Demaille <akim@epita.fr>
3125
3126 When reducing initial empty rules, Bison parser read an initial
3127 location that is not defined. This results in garbage, and that
3128 affects Bison's own parser. Therefore we need (i) to extend Bison
3129 to support a means to initialize this location, and (ii) to use
3130 this CVS Bison to fix CVS Bison's parser.
3131
3132 * src/reader.h, reader.c (epilogue_augment): Remove, replace
3133 with...
3134 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
3135 * src/parse-gram.y: Adjust.
3136 (%initial-action): New.
3137 (%error-verbose): Since we require CVS Bison, there is no reason
3138 not to use it.
3139 * src/scan-gram.l: Adjust.
3140 * src/Makefile.am (YACC): New, to make sure we use our own parser.
3141 * data/yacc.c (yyparse): Use b4_initial_action.
3142
4e03e201
AD
31432003-08-25 Akim Demaille <akim@epita.fr>
3144
3145 * doc/bison.texinfo: Don't promote stdout for error messages.
3146
8c182d05
AD
31472003-08-25 Akim Demaille <akim@epita.fr>
3148
3149 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
3150 From Alexandre Duret-Lutz.
3151
6a60c4cf
PE
31522003-08-25 Akim Demaille <akim@epita.fr>
3153
3154 Version 1.875c.
3155
25f66e1a
AD
31562003-08-25 Akim Demaille <akim@epita.fr>
3157
3158 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
3159 Use them.
3160
5348bfbe
AD
31612003-08-25 Akim Demaille <akim@epita.fr>
3162
3163 * data/lalr1.cc (Parser::reduce_print_): New.
3164 Use it.
3165
47301314
AD
31662003-08-25 Akim Demaille <akim@epita.fr>
3167
3168 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
3169 error recovery loops. This patch is based on
161a71f3 3170 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
3171 Also, augment the similarity between lalr1.cc and yacc.c.
3172 Note: the locations of error recovery rules are not correct yet.
3173
3174 * data/lalr1.cc: Comment changes to augment the similarity between
3175 lalr1.cc and yacc.c.
3176 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
3177 (yyerrlab1): Remove, but where it used to be (now the bottom part of
3178 yyerrlab), when hitting EOF, pop the whole stack here instead of
3179 merely falling thru the default error handling mechanism.
3180 (yyerrorlab): New label, with the old contents of YYERROR,
3181 plus the following change: pop the stack of rhs corresponding
3182 to the production that invoked YYERROR. That is how Yacc
3183 behaves (required by POSIX).
3184 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
3185 fail.
3186
1f7a61ff
AD
31872003-08-25 Akim Demaille <akim@epita.fr>
3188
3189 Tune local.at so that people can "autom4te -l autotest calc.at -o
3190 calc" for instance, to extract a sub test suite.
3191
3192 * tests/testsuite.at: Move the initialization, Autotest version
3193 requirement, and AT_TESTED invocation into...
3194 * tests/local.at: here.
3195 * tests/testsuite.at: Include it for compatibility with Autoconf
3196 2.57.
3197 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
3198 be ignore.
3199
327b5b56
PE
32002003-08-04 Paul Eggert <eggert@twinsun.com>
3201
3202 Rework code slightly to avoid gcc -Wtraditional warnings.
3203 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
3204 The returned value is now stored in *YY0. All callers changed.
3205 * src/output.c (merge_output): Adjust to the above change.
3206
0051e3ed
PE
32072003-07-26 Paul Eggert <eggert@twinsun.com>
3208
3209 * data/glr.c (YYASSERT): New macro.
3210 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
3211 yyresolveStates, yyprocessOneStack):
3212 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
3213 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 3214
137437c6
PE
32152003-07-25 Paul Eggert <eggert@twinsun.com>
3216
5b620e06
PE
3217 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
3218 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 3219 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
3220 by Frank Heckenbach, though I have omitted the structure-initialization
3221 part of his glr-knr.diff patch since I recall that the Portable
3222 C Compiler didn't require that change.
3223
137437c6
PE
3224 Let the user specify how to allocate and free memory.
3225 Derived from a suggestion by Frank Heckenbach in
161a71f3 3226 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
3227 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
3228 All uses of free, malloc, realloc changed to use these macros,
3229 and unnecessary casts removed.
3230 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
3231
ddb85ca5
PE
32322003-07-06 Matthias Mann <MatthiasMann@gmx.de>
3233
3234 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
3235 use s.empty() rather than s == "" to test for empty string; see
161a71f3 3236 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
3237 (trivial change)
3238
39910e09
AD
32392003-06-25 Akim Demaille <akim@epita.fr>
3240
3241 * config/depcomp, config/install-sh: Update from masters.
3242
0ae99356
PE
32432003-06-20 Paul Eggert <eggert@twinsun.com>
3244
3245 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
3246 and return properly parenthesized result.
3247 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
3248 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
3249 Remove unnecessary parentheses from uses.
3250 * doc/bison.texinfo (Location Default Action): Describe the
3251 conventions for parentheses.
3252
cd05d13c
PE
32532003-06-19 Paul Eggert <eggert@twinsun.com>
3254
81fd08ca
PE
3255 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
3256 yyreportTree): Do not assume that size_t is the same width as int,
3257 when printing sizes. Print sizes using an unsigned format.
3258 Problem reported by Frank Heckenbach in
161a71f3 3259 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 3260
cd05d13c
PE
3261 Port to Forte Developer 7 C compiler.
3262 * data/glr.c (struct YYLTYPE): If locations are not being used,
3263 declare a single dummy member, as empty structs do not conform
3264 to the C standard.
3265 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
3266 the Forte Developer 7 C compiler complains that end-of-loop
3267 code is not reached.
3268
4dcf140b
PE
32692003-06-17 Paul Eggert <eggert@twinsun.com>
3270
3271 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
3272 avoid warnings from picky compilers about redefinition of PARAMS.
3273
8dd76bee
PE
32742003-06-17 Paul Eggert <eggert@twinsun.com>
3275
3276 Version 1.875b.
3277
3278 * NEWS: Document 1.875b.
3279
3280 * lib/bbitset.h: Do not include config.h; that's the includer's job.
3281 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
3282 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
3283 Don't use 'index' in comments, as it's a builtin fn on some hosts.
3284 * lib/bitset_stats.c: Include gettext.h unconditionally, as
3285 per recent gettext manual's suggestion.
3286 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
3287 Use prototypes, not old-style definitions.
3288 * lib/lbitset.c (lbitset_unused_clear): Likewise.
3289 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
3290 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
3291 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
3292 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
3293 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
3294 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
3295 vbitset_or_and_cmp, vbitset_copy): Likewise.
3296
3297 * lib/libiberty.h: Do not include config.h; that's the includer's job.
3298 Do not include <stdlib.h>.
3299 (PARAMS): Define unconditionally for C89.
3300 (ATTRIBUTE_NORETURN): Remove.
3301 (ATTRIBUTE_UNUSED): Define unconditionally.
3302
3303 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 3304 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
3305 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
3306 * lib/vbitset.c, lib/vbitset.h: New files.
3307 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
3308 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
3309 from libbitset.
3310
3311 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
3312 `How Can I Reset @code{yyparse}', since texinfo does not allow
3313 arbitrary @ in node names.
3314
3315 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
3316 shouldn't be needed according to the gettext 0.12.1 documentation
3317 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 3318 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 3319 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 3320 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 3321
8dd76bee
PE
3322 * lib/.cvsignore: Add stdbool.h.
3323 * m4/.cvsignore: Add nls.m4, po.m4.
3324
3325 Upgrade to CVS gnulib.
3326 * stdbool_.h: File renamed from stdbool.h.in.
3327 * configure.ac (AM_STDBOOL_H): Invoke this instead of
3328 AC_HEADER_STDBOOL.
3329 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
3330 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
3331 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
3332 (MOSTLYCLEANFILES): New var.
3333 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
3334 (stdbool.h): New rule.
3335 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
3336 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
3337 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
3338 m4/quote.m4: Upgrade to today's gnulib.
3339
3340 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
3341 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
3342 the tests right now.
3343 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
3344 yyerror are declared before use; C99 requires this.
3345
25005f6a
PH
33462003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3347
3348 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
3349 first.
3350 (yyrecoverSyntaxError): Correct the logic for setting and testing
3351 yyerrState.
3352 Correct comment on handling EOF.
3353 Allow states with only a default reduction, rather than failing
8dd76bee 3354 (I can't quite reconstruct why these were not allowed before).
25005f6a 3355
137437c6 3356 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 3357 buffer overruns, corrupting state.
8dd76bee
PE
3358
3359 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
3360 definition.
3361 * src/reader.h (max_left_semantic_context): New variable declaration.
3362 * src/scan-gram.l (max_left_semantic_context): Define.
3363 (handle_action_dollar): Update max_left_semantic_context.
3364 * data/glr.c (YYMAXLEFT): New definition.
3365 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
3366 (yyresolveAction): Ditto.
3367
3368 Fixes to problems with location handling in GLR parsers reported by
3369 Frank Heckenbach (2003/06/05).
3370
3371 * data/glr.c (YYLTYPE): Make trivial if locations not used.
3372 (YYRHSLOC): Add parentheses, and define only if locations used.
3373 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
3374 locations not used.
3375 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
3376 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 3377
25005f6a
PH
3378 * tests/cxx-type.at: Exercise location information; update tests
3379 to differentiate output with and without locations.
8dd76bee 3380 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
3381 because default YYLTYPE not yet defined.
3382 Change semantic actions to compute strings, rather than printing
3383 them directly (to test proper passing of semantics values). Change
3384 output to prefix notation and update test data and expected results.
3385 (yylex): Track locations.
3386 (stmtMerge): Return value rather than printing, and include arguments
3387 in value.
8dd76bee 3388
711f40b7
PE
33892003-06-03 Paul Eggert <eggert@twinsun.com>
3390
3391 Avoid warnings generated by GCC 2.95.4 when Bison is
3392 configured with --enable-gcc-warnings.
3393 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
3394 yy::]b4_parser_class_name[::translate_,
3395 yy::Stack::operator[] (unsigned),
3396 yy::Stack::operator[] (unsigned) const,
3397 yy::Slice::operator[] (unsigned),
3398 yy::Slice::operator[] (unsigned) const):
3399 Rename local vars to avoid warnings.
3400 * tests/glr-regression.at (Improper handling of embedded actions
3401 and $-N in GLR parsers): Remove unused local variable from yylex.
3402 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
3403 (void) as arg when not pure, since we now assume C89 when building
3404 Bison. Pacify GCC by using parameter.
3405
ac695f7d
PE
34062003-06-02 Paul Eggert <eggert@twinsun.com>
3407
3408 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
3409 yy::Location::lines, yy::Location::columns): Rename arguments
3410 to avoid shadowing; this removes a warning generated by GCC 3.3.
3411
26ec81e0
PE
34122003-06-01 Paul Eggert <eggert@twinsun.com>
3413
3414 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
3415 to g++, as GCC 3.3 complains if you do it.
3416 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
3417 everything that WARNING_CFLAGS has, except omit warnings
3418 not suitable for C++.
3419 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
3420 * tests/atlocal.in (CXXFLAGS): New var.
3421 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
3422
3423 Fix a GLR parser bug I reported in February; see
161a71f3 3424 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
3425 The problem was that GLR parsers did not conform to the C standard,
3426 because actions like { $1 = $2 + $3; } expanded to expressions
3427 that invoked YYFILL in separate subexpressions, and YYFILL assigned
3428 to a local variable. The C standard says that expressions
3429 like (var = f ()) + (var = f ()) have undefined behavior.
3430 Another problem was that GCC sometimes issues warnings that
3431 yyfill and its parameters are unused.
3432
3433 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
3434 as possibly unused.
3435 (yyfill): New function.
3436 (YYFILL): Use it.
3437 (yyuserAction): Change type of yynormal to bool, so that it matches
3438 the new yyfill signature. Mark it as possibly unused.
3439
3440
3441 Follow up on a bug I reported in February, where a Bison-generated
3442 parser can loop. Provide a test case and a fix for yacc.c. I
3443 don't have a fix for lalr1.cc or for glr.c, unfortunately.
3444 The original bug report is in:
161a71f3 3445 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
3446
3447 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
3448 macro's size was becoming unwieldy.
3449 (yyerrlab): Do not discard an empty lookahead symbol, as this
3450 might destroy garbage.
3451 (yyerrorlab): New label, with the old contents of YYERROR,
3452 plus the following change: pop the stack of rhs corresponding
3453 to the production that invoked YYERROR. That is how Yacc
3454 behaves, and POSIX requires this behavior.
3455 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
3456 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
3457 Define 'alarm' to do nothing if unistd.h is not available.
3458 Add a new rule "exp: '-' error;" to test the above change to
3459 data/yacc.c. Use 'alarm' to abort any test taking longer than
3460 10 seconds, as it's probably looping.
3461 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
3462 Also, the new yacc.c generates two fewer diagnostics for an
3463 existing test.
3464
d0829076
PE
34652003-05-24 Paul Eggert <eggert@twinsun.com>
3466
c6ae27df
PE
3467 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
3468 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
3469 This fixes a problem reported by John Bowman when the Compaq/HP
3470 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
3471 -ansi -Wall -gall).
3472 * data/yacc.c (union yyalloc): Likewise.
3473 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 3474
d0829076
PE
3475 Switch from 'int' to 'bool' where that makes sense.
3476
3477 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
3478 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
3479 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
3480 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
3481 Return or accept bool, not int. All callers changed.
3482 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
3483 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
3484 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
3485 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
3486 bitset_or_and_cmp_): Likewise.
3487 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
3488 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
3489 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
3490 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
3491 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
3492 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
3493 bitset_stats_or_and_cmp): Likewise.
3494 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
3495 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
3496 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
3497 ebitset_xor_cmp): Likewise.
3498 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
3499 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
3500 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
3501 lbitset_xor_cmp): Likewise.
3502 * lib/bbitset.h: Include <stdbool.h>.
3503 (struct bitset_vtable): The following members now return bool, not
3504 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
3505 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
3506 or_and_cmp).
3507 * src/conflicts.c (count_rr_conflicts): Likewise.
3508 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
3509 All uses changed.
3510 * lib/ebitset.c (ebitset_obstack_init): Likewise.
3511 * lib/lbitset.c (lbitset_obstack_init): Likewise.
3512 * src/getargs.c (debug_flag, defines_flag, locations_flag,
3513 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
3514 graph_flag): Likewise.
3515 * src/getargs.h (debug_flag, defines_flag, locations_flag,
3516 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
3517 graph_flag): Likewise.
3518 * src/output.c (error_verbose): Likewise.
3519 * src/output.h (error_verbose): Likewise.
3520 * src/reader.c (start_flag, typed): Likewise.
3521 * src/reader.h (typed): Likewise.
3522 * src/getargs.c (LOCATIONS_OPTION): New constant.
3523 (long_options, getargs): Use it.
3524 * src/lalr.c (build_relations): Use bool, not int.
3525 * src/nullable.c (nullable_compute): Likewise.
3526 * src/print.c (print_reductions): Likewise.
3527 * src/tables.c (action_row, pack_vector): Likewise.
3528 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
3529 * src/output.c (prepare): Use it.
3530 * src/output.c (token_definitions_output,
3531 symbol_destructors_output, symbol_destructors_output): Use string,
3532 not boolean integer, to keep track of whether to output separator.
3533 * src/print_graph.c (print_core): Likewise.
3534 * src/state.c (state_rule_lookaheads_print): Likewise.
3535
3536 * config/install-sh: Sync from automake 1.7.5.
3537
6b2584b7
PE
35382003-05-14 Paul Eggert <eggert@twinsun.com>
3539
3540 * src/parse-gram.y (rules_or_grammar_declaration): Require a
3541 semicolon after a grammar declaration, in the interest of possible
3542 future changes to the Bison input language.
3543 Do not allow a stray semicolon at the start of the grammar.
3544 (rhses.1): Allow one or more semicolons after any rule, including
3545 just before "|" as required by POSIX.
3546 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
3547 grammar.
3548
caf37a36
ADL
35492003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
3550
3551 %parse-param support for lalr1.cc.
3552
3553 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
3554 b4_cc_constructor_calls, b4_cc_constructor_call,
3555 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
3556 definitions.
3557 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
3558 parse-param arguments.
3559 (yy::b4_parser_class_name): Declare instance variables to
3560 hold parse-param arguments.
3561 * tests/calc.at: s/value/semantic_value/ because value clashes
3562 with a member of yy::b4_parser_class_name. Adjust C++ code
3563 to handle %parse-param. Enable %parse-param test in C++.
3564
3ab37077
PE
35652003-05-12 Paul Eggert <eggert@twinsun.com>
3566
3567 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
3568 English a bit. Fix fclose typo. Change "const char" to "char
3569 const", and use ANSI C rather than K&R for "main". Suggest
3570 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
3571 and suggest yy_switch_to_buffer.
3572
35732003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
3574
3575 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
3576 C89. This avoids a diagnostic on compilers that define __STDC__
3577 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 3578 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 3579
e743727f
PE
35802003-05-03 Paul Eggert <eggert@twinsun.com>
3581
3582 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
3583 Do not overrun array bounds.
3584 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 3585 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 3586
916708d5
AD
35872003-04-29 Akim Demaille <akim@epita.fr>
3588
3589 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
3590 * src/getargs.c, src/getargs.h: here, as bool, not int.
3591 (nondeterministic_parser): New.
3592 * src/parse-gram.y, src/scan-gram.l: Support
3593 %nondeterministic-parser.
3594 * src/output.c (prepare): Use nondeterministic_parser instead
3595 of glr_parser where appropriate.
3596 * src/tables.c (conflict_row, action_row, save_row)
3597 (token_actions, token_actions, pack_vector): Ditto.
3598
a06ea4aa
AD
35992003-04-29 Akim Demaille <akim@epita.fr>
3600
3601 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
3602
211074ca
AD
36032003-04-29 Akim Demaille <akim@epita.fr>
3604
3605 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
3606 with %pure-parser and %locations to exercise the patch from Yakov
3607 Markovitch below.
3608
6175ffe3
PE
36092003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
3610
3611 * data/yacc.c: (b4_lex_param): Corrected for the case where
3612 %lex-param is provided and %pure-parser isn't.
3613
b1e95857
PE
36142003-04-27 Paul Eggert <eggert@twinsun.com>
3615
3616 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 3617 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
3618 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
3619 if it is not defined.
3620 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
3621
acda9df6
PE
36222003-04-26 Paul Eggert <eggert@twinsun.com>
3623
3470c57b
PE
3624 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
3625 Declare to be of type suitable for the ninf value itself, not of
3626 type suitable for the corresponding table, since the latter might
3627 be unsigned but the ninf value might be negative. This fixes a
3628 bug reported by Alexandre Duret-Lutz in
161a71f3 3629 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 3630
acda9df6
PE
3631 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
3632 invokes it. We shouldn't invoke it twice because it will attempt
3633 to put error.o in the archive twice. This fixes a glitch reported
3634 by Martin Mokrejs in
161a71f3 3635 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 3636
b5250f26
PE
36372003-04-21 Paul Eggert <eggert@twinsun.com>
3638
3639 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
3640 to gnulib.
3641
089ac0f1
PE
36422003-04-21 Yakov Markovitch <Markovitch@iso.ru>
3643
3644 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
3645 Fix obvious typo that results in uncompilable GLR parsers
3646 when both %pure-parser and %locations are used. (trivial change)
3647
5ededac6
PE
36482003-04-17 Paul Eggert <eggert@twinsun.com>
3649
1b8f2fff
PE
3650 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
3651 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
3652 Do not insert the expected token via unput, as this runs afoul
3653 of a POSIX-compatibility bug in flex 2.5.31.
3654 All uses changed to BEGIN the parent state,
3655 since we no longer insert the expected token via unput.
3656 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
3657 that is no longer emitted after the above change.
3658
5ededac6
PE
3659 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
3660 the first one. This change is from Paul Hilfinger, and it fixes
3661 regression reported by Werner Lemberg in
161a71f3 3662 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
3663
3664 (resolve_sr_conflict): Don't invoke state_errs_set
3665 unless one or more tokens have been explicitly made errors.
3666 Otherwise, the above change causes Bison to abort.
3667
3668 * tests/existing.at (GNU pic Grammar): New test case, taken from
3669 Lemberg's email.
3670
b8be9132
AD
36712003-03-31 Akim Demaille <akim@epita.fr>
3672
3673 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
3674
d423d460
AD
36752003-03-31 Akim Demaille <akim@epita.fr>
3676
3677 * src/output.c (prepare_symbols): Avoid trailing spaces in the
3678 output.
3679
c7e441b4
AD
36802003-03-31 Akim Demaille <akim@epita.fr>
3681
3682 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
3683 From Paul Hilfinger.
3684
231897ad
AD
36852003-03-29 Akim Demaille <akim@epita.fr>
3686
3687 * m4/error.m4: Do not put under dynamic conditions some code which
3688 expansion is under static control.
3689
5b066063
AD
36902003-03-29 Akim Demaille <akim@epita.fr>
3691
3692 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
3693
22a74fec
AD
36942003-03-29 Akim Demaille <akim@epita.fr>
3695
3696 * doc/bison.texinfo (Strings are Destroyed): New.
3697
0eee27e7
PE
36982003-03-13 Paul Eggert <eggert@twinsun.com>
3699
3700 * .cvsignore: Add configure.lineno.
3701 * src/.cvsignore: Add yacc.
3702 * tests/.cvsignore: Add testsuite.log.
3703 * doc/fdl.texi: Sync with latest FSF version.
3704
f61aad93
PE
37052003-03-12 Paul Eggert <eggert@twinsun.com>
3706
537636c7
PE
3707 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
3708 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
3709 cursor, instead of leaving it undefined. This fixes a bug
3710 reported by Tim Van Holder in
161a71f3 3711 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
3712 * tests/input.at (Torturing the Scanner): Test the scanner on
3713 an empty input file, which was Tim Van Holder's test case.
3714
3715 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
3716 <sys/resource.h> can be included, include sys/time.h and
3717 sys/times.h first, if available. This works around the SunOS
3718 4.1.4 porting bug reported by Bruce Becker in
161a71f3 3719 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
3720
3721 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
3722 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
3723 AC_HEADER_SYS_WAIT.
3724
f61aad93
PE
3725 Merge changes from gnulib. This was prompted because the CVS
3726 snapshot didn't build on Solaris 7 due to strnlen problems.
3727
3728 These changes need to be merged back into gnulib:
3729 * lib/hash.c: Include <stdbool.h> unconditionally.
3730 * m4/onceonly.m4 (m4_quote): New macro.
3731 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
3732 Quote AC_FOREACH variable-expansions properly.
3733 The 2003-01-03 obstack.h change also needs merging.
3734 {end of changes requiring merging}
5b066063 3735
f61aad93
PE
3736 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
3737 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
3738 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
3739 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
3740 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
3741 New files, imported from gnulib.
3742 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
3743 above.
3744
3745 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
3746 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
3747 gnulib sources.
3748
3749 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
3750 Add.
3751 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
3752 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
3753 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
3754 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
3755 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
3756 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
3757 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
3758 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
3759 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
3760 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
3761 (jm_PREREQ_ARGMATCH): Remove.
3762 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
3763 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
3764
3765 * src/system.h: Include <stdbool.h> unconditionally.
3766
3767 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
3768 assuming at least C89 in the bitset code for some time now.
3769
d2ffe116
AD
37702003-03-03 Akim Demaille <akim@epita.fr>
3771
3772 * ro.po: New.
3773
052826fd
AD
37742003-03-02 Akim Demaille <akim@epita.fr>
3775
3776 * doc/bison.texinfo (Table of Symbols): Reactivate the
3777 documentation for %lex-param, and %parse-param.
3778
c4749565
AD
37792003-03-02 Akim Demaille <akim@epita.fr>
3780
3781 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
3782 generate verbose error messages.
3783 Use the number of tokens as an upper bound in yytname, as it
3784 cannot be a non terminal.
3785
d5286af1
AD
37862003-03-02 Akim Demaille <akim@epita.fr>
3787
3788 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
3789 message.
3790
22e304a6
AD
37912003-03-02 Akim Demaille <akim@epita.fr>
3792
22e304a6
AD
3793 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
3794 Use them to exercise yycheck overrun.
3795 Based on Andrew Suffield's grammar.
3796
67a25fed
AD
37972003-03-02 Akim Demaille <akim@epita.fr>
3798
3799 Create tests/local.at for Bison generic testing macros.
3800
3801 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
3802 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
3803 This new file.
3804 * tests/calc.at (AT_CHECK_CALC): Adjust.
3805 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
3806 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
3807 * tests/local.at: here.
3808 (AT_COMPILE_CXX): Tags the tests using it as c++.
3809 Ignore the test if CXX is not functional.
3810
9c2b381f
PE
38112003-03-01 Paul Eggert <eggert@twinsun.com>
3812
3813 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
3814 not loc->end, since loc->end might contain garbage and this leads
3815 to undefined behavior on some platforms.
3816 (id_loc, token_start): Use (IF_LINTed) initial values that do not
3817 depend on *loc, so that the reader doesn't give the the false
3818 impression that *loc is initialized.
3819 (<INITIAL>"%%"): Do not bother setting code_start, since its value
3820 does not survive the return.
3821
0433ba88
AD
38222003-03-01 Akim Demaille <akim@epita.fr>
3823
3824 * src/scan-gram.l (code_start): Always initialize it when entering
3825 into yylex, as SC_EPILOGUE is activated *before* the corresponding
3826 yylex invocation. An alternative would be making it static, but
3827 then it starts with the second %%'s beginning, instead of its end.
3828
b305ea69
PE
38292003-02-28 Paul Eggert <eggert@twinsun.com>
3830
3831 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
3832 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 3833 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 3834
c3d25e01
PE
38352003-02-26 Paul Eggert <eggert@twinsun.com>
3836
3837 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
3838 Remove Sequent/Pyramid discussion (nobody uses them any more).
3839 Merge VMS and MS-DOS discussion; these ports may well be dead
3840 but let's keep mentioning them for now. Put <> around email
3841 addresses. Add copyright notice.
3842
c267ffbc
PE
38432003-02-24 Paul Eggert <eggert@twinsun.com>
3844
3845 * data/glr.c (yy_reduce_print): yylineno -> yylno,
3846 to avoid collision with flex use of yylineno.
3847 Problem reported by Bruce Lilly in
161a71f3 3848 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
3849 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
3850 * data/yacc.c (yy_reduce_print): Likewise.
3851
3852 * config/depcomp: Sync with Automake 1.7.3.
3853
f939fc12
AD
38542003-02-21 Akim Demaille <akim@epita.fr>
3855
3856 * data/lalr1.cc: Use temporary variables instead of casts to
3857 change integer types.
3858 Suggested by Paul Eggert.
3859
95923bd6
AD
38602003-02-21 Akim Demaille <akim@epita.fr>
3861
3862 * doc/bison.texinfo: Use "location" consistently to refer to @n,
3863 to avoid confusions with lalr1.cc's notion of Position.
3864 Suggested by Paul Eggert.
3865
2cdc240e
AD
38662003-02-20 Akim Demaille <akim@epita.fr>
3867
3868 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
3869 before initial_columns.
3870 (location.hh): Use consistent variable names when defining the
3871 operator<<.
3872 Use "last" so that we subtract from Positions, not from unsigned.
3873
5d003116
AD
38742003-02-20 Akim Demaille <akim@epita.fr>
3875
3876 * data/lalr1.cc (position.hh): New subfile, including the extended
3877 and Doxygen'ed documentation of class Position.
3878 (location.hh): Use it.
3879 Document a` la Doxygen.
ba1ecc07 3880 With the help of Benoit Perrot.
5d003116 3881
d02b25f9
AD
38822003-02-20 Akim Demaille <akim@epita.fr>
3883
3884 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
3885 AT_YACC_IF.
3886 Redefine AT_YYERROR_SEES_LOC_IF using it.
3887 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
3888 not defined.
3889 Don't use the location in yy::Parser::error_ and
3890 yy::Parser::print_ when not %locations.
3891 Activate more lalr1.cc tests.
3892
0d1c3a04
AD
38932003-02-19 Akim Demaille <akim@epita.fr>
3894
3895 * data/lalr1.cc: When displaying a line number, be sure to make it
3896 an int.
3897
60a777aa
AD
38982003-02-19 Akim Demaille <akim@epita.fr>
3899
3900 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
3901 Remove, useless.
3902 (YYABORT, YYACCEPT, YYERROR): New.
3903 * tests/calc.at: Renable the lalr1.cc test.
3904
0b86fc41
AD
39052003-02-19 Akim Demaille <akim@epita.fr>
3906
3907 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
3908 error recovery, mixing with/without pops and discarding of the
3909 lookahead.
3910 Exercise YYERROR.
3911 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
3912
da99a5dc
PE
39132003-02-17 Paul Eggert <eggert@twinsun.com>
3914
3915 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
3916 * tests/testsuite.at (AT_COMPILE): Use them.
3917 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 3918 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 3919
93b8c255
PE
39202003-02-12 Paul Eggert <eggert@twinsun.com>
3921
3922 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
3923 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 3924 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
3925 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
3926 Check for malloc failure, for consistency with yacc.c.
3927 (yytname_size): Remove, for consistency with yacc.c.
3928
3929 The bug still remains in data/lalr1.cc, as I didn't have time
3930 to fix it there.
3931
7548fed2
AD
39322003-02-06 Akim Demaille <akim@epita.fr>
3933
3934 * configure.ac (GXX): Rename as...
3935 (CXX): this, to keep the original Autoconf semantics.
3936 Require 2.57.
3937 * data/lalr1.cc: Fix b4_copyright invocations.
3938 If YYDEBUG is not defined, don't depend upon name_ being defined.
3939 (location.hh): Include string and iostream.
3940 (Position::filename): New member.
3941 (Position::Position ()): New.
3942 (operator<< (Position)): New.
3943 (operator- (Position, int)): New.
3944 (Location::first, Location::last): Rename as...
3945 (Location::begin, Location::end): these, to mock the conventional
3946 iterator names.
3947 (operator<< (Location)): New.
3948 * tests/atlocal.in (CXX): New.
3949 * tests/testsuite.at (AT_COMPILE_CXX): New.
3950 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
3951 locations in a more synthetic way.
3952 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
3953 lalr1.cc is used.
3954 Adjust the C locations to match those from Emacs: first column is
3955 column 0.
3956 Change all the expected results.
3957 Conform to the GCS: simplify the locations when applicable.
3958 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
3959 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
3960 these CPP macros with the m4 macros new defined by...
3961 (AT_CHECK_PUSHDEFS): this, i.e.:
3962 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 3963 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
3964 New macros.
3965 (AT_CHECK_POPDEFS): Undefine them.
3966 (AT_CHECK_CALC_LALR1_CC): New.
3967 Use it for the first lalr1.cc test.
3968
43a176ef
AD
39692003-02-04 Akim Demaille <akim@epita.fr>
3970
3971 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
3972 Location as is defined.
3973
fc049e9c
AD
39742003-02-04 Akim Demaille <akim@epita.fr>
3975
3976 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
3977 name_ being defined.
3978
a737b216
PE
39792003-02-03 Paul Eggert <eggert@twinsun.com>
3980
3981 * src/gram.h (start_symbol): Remove unused decl.
3982
3983 Use more-consistent naming conventions for local vars.
3984
3985 * src/derives.c (derives_compute): Change type of local var from
3986 int to rule_number.
3987 * src/gram.c (grammar_rules_partial_print): Likewise.
3988 * src/print.c (print_core): Likewise.
3989 * src/reduce.c (reduce_grammar_tables): Likewise.
3990
3991 * src/gram.c (grammar_dump): Change name of item_number *
3992 local var from r to rp.
3993 * src/nullable.c (nullable_compute): Likewise.
3994
3995 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
3996
3997 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
3998 for symbol or symbol_number var.
3999 * src/reader.c (grammar_start_symbol_set): Likewise.
4000 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
4001 Likewise.
4002 * src/state.c (transitions_to): Likewise.
4003 * src/state.h: Likewise.
4004 * src/tables.c (symbol_number_to_vector_number): Likewise.
4005
4006 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
4007 char * var.
4008
4009 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
4010 var.
4011
4012 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
4013 var.
4014
4015 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
4016 Use str, not s, for char * var. Use ch, not c, for character var.
4017 Use size for size var.
4018
4019 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
4020 char * var.
4021 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
4022 uniqstr var.
4023 * src/uniqstr.h: Likewise.
4024
4025 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
4026 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
4027 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
4028 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
4029 param to have same name as that of enum, so that we don't use
4030 "s" to stand for a non-state.
4031
68e93ad5
AD
40322003-02-02 Akim Demaille <akim@epita.fr>
4033
4034 * src/scan-skel.l: Scan more than one inert character per yylex
4035 invocation.
4036
92898986
PE
40372003-02-01 Paul Eggert <eggert@twinsun.com>
4038
4039 Version 1.875a.
4040
1d9d5d71
PE
4041 * po/LINGUAS: Add ms.
4042
0435d061
AD
40432003-01-30 Akim Demaille <akim@epita.fr>
4044
4045 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
4046
6029a57f
PH
40472003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4048
4049 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
4050 of $1.
0435d061
AD
4051
4052 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 4053 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 4054 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 4055
6029a57f
PH
4056 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
4057 (b4_rhs_location): Ditto.
0435d061 4058 (yyfill): New function to copy from stack tree into array
6029a57f 4059 incrementally.
0435d061
AD
4060 (yyuserAction): Modify to allow incremental move of semantic values
4061 to rhs array when in GLR mode.
4062 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
4063 as needed.
4064 Remove dummy use of yystack, as there is now a guaranteed use.
4065 (yydoAction): Modify to allow incremental move of semantic values
4066 to rhs array when in GLR mode.
4067 (yyresolveAction): Ditto.
4068 (yyglrShiftDefer): Update comment.
0435d061 4069 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
4070 (yyglrReduce): Ditto.
4071 (yydoAction): Ditto
0435d061 4072
6029a57f
PH
4073 * tests/glr-regr1.at: Rename to ...
4074 * tests/glr-regression.at: Add new regression test for the problems
4075 described above (adapted from S. Eken).
4076 Update copyright notice.
4077 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
4078 * tests/Makefile.am: Ditto.
4079
6cee6297
PE
40802003-01-28 Paul Eggert <eggert@twinsun.com>
4081
4082 * data/lalr1.cc: Do not use @output_header_name@ unless
4083 b4_defines_flag is set. This fixes two bugs reported by
4084 Tim Van Holder in
161a71f3
PE
4085 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
4086 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 4087
b2a836b5
PE
40882003-01-21 Paul Eggert <eggert@twinsun.com>
4089
4090 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
4091 we don't need to worry about yyerrlab1 being reported as an
4092 "unused label" by non-GCC C compilers. The downside is that if
4093 locations are used then a couple of statements are duplicated each
4094 time YYERROR is invoked, but the upside is that the warnings
4095 should vanish.
4096 (yyerrlab1): Move code to YERROR.
4097 (yyerrlab2): Remove. Change uses back to yyerrlab1.
4098 This reverts some of the 2002-12-27 change.
4099
4196b931
PE
41002003-01-17 Paul Eggert <eggert@twinsun.com>
4101
4102 * src/output.c (symbol_printers_output): Fix typo that led
4103 to core dump. Problem reported by Antonio Rus in
161a71f3 4104 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 4105
3ae831b4
AD
41062003-01-13 Akim Demaille <akim@epita.fr>,
4107 Quoc Peyrot <chojin@lrde.epita.fr>,
4108 Robert Anisko <anisko_r@lrde.epita.fr>
4109
4110 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
4111 when the stacks contain one element, as the loop would otherwise
4112 free the last state, and then use the top state (the one we just
4113 popped). This means that the initial elements will not be freed
4114 explicitly, as is the case in yacc.c; it is not a problem, as
4115 these elements have fake values.
4116
e3aa65c5
PE
41172003-01-11 Paul Eggert <eggert@twinsun.com>
4118
4119 * NEWS: %expect-violations are now just warnings, reverting
4120 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
4121 bootstrapping problem reported by Matthias Klose; see
161a71f3 4122 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
4123 * src/conflicts.c (conflicts_print): Likewise.
4124 * tests/conflicts.at (%expect not enough, %expect too much,
4125 %expect with reduce conflicts): Likewise.
4126 * doc/bison.texinfo (Expect Decl): Document this. Also mention
4127 that the warning is enabled if the number of conflicts changes
4128 (not necessarily increases).
4129
4130 * src/getargs.c (version): Update copyright year.
4131
f0057011
AD
41322003-01-09 Akim Demaille <akim@epita.fr>
4133
4134 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
4135
1ee6d2a0
PE
41362003-01-08 Paul Eggert <eggert@twinsun.com>
4137
4138 * Makefile.maint (WGETFLAGS):
4139 New macro, containing "-C off" to disable proxy caches.
4140 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
4141 (rel-check): Use $(WGET) instead of wget.
4142
d4fd77c4
PE
41432003-01-06 Paul Eggert <eggert@twinsun.com>
4144
4145 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
4146 the GLR paper of Scott, Johnstone and Hussain.
4147
464c6927
PE
41482003-01-04 Paul Eggert <eggert@twinsun.com>
4149
d600ee67
PE
4150 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
4151 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
4152 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
4153 (EXTRA_LIBRARIES): New var, for liby.a.
4154 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
4155 (EXTRA_SCRIPTS): New var, for yacc.
4156
464c6927
PE
4157 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
4158 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
4159 Problem reported by Nelson H. F. Beebe.
4160
41612003-01-03 Paul Eggert <eggert@twinsun.com>
4162
4163 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
4164 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
4165 when compiling Bison 1.875's `bitset bset = obstack_alloc
4166 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
4167
4168 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
4169 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
4170 grow to a huge size with typical invocation.
d600ee67 4171
464c6927
PE
4172 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
4173 Use the pattern recommended by Autoconf 2.57, except also protect
4174 against double-definition.
4175 * src/system.h: Likewise.
4176 Portability issues reported by Nelson H. F. Beebe.
d600ee67 4177
464c6927
PE
4178 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
4179 All uses changed. Provide a definition in both C and C++.
4180 (yytrue, yyfalse): Define even if defined (__cplusplus).
4181
4182 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
4183 Reported by Nelson H. F. Beebe.
d600ee67 4184
464c6927
PE
4185 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
4186
0f42c7d5
PE
41872003-01-02 Paul Eggert <eggert@twinsun.com>
4188
4189 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
4190 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
4191 Bug reported by Nelson H. F. Beebe.
4192
dc546b0f
PE
41932003-01-01 Paul Eggert <eggert@twinsun.com>
4194
4195 * Version 1.875.
4196
2c09b6a7
PE
41972002-12-30 Paul Eggert <eggert@twinsun.com>
4198
4199 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
4200 Moved here from...
4201 (<INITIAL>","): Here. This causes stray "," to be treated
4202 more uniformly.
4203
dc546b0f 4204 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
4205 last brace in braced code when not in Yacc mode, for compatibility
4206 with Bison 1.35. This resurrects the 2001-12-15 patch to
4207 src/reader.c.
4208
4209 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
4210 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
4211
535c0f63
PE
42122002-12-28 Paul Eggert <eggert@twinsun.com>
4213
4214 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
4215 that of SYM's type. This fixes Debian bug 168069, reported by
4216 Thomas Olsson.
d600ee67 4217
963fcc17
PE
42182002-12-28 Paul Eggert <eggert@twinsun.com>
4219
4220 Version 1.75f.
4221
4222 Switch back to the Yacc style of conflict reports, undoing some
4223 of the 2002-07-30 change.
4224 * doc/bison.texinfo (Understanding): Use Yacc style for
4225 conflict reports. Also, use new way of locating rules.
4226 * src/conflicts.c (conflict_report):
4227 Renamed from conflict_report_yacc, removing the old
4228 'conflict_report'. Translate the entire conflict report at once,
4229 so that we don't assume that "," has the same interpretation in
4230 all languages.
4231 (conflicts_output): Use Yacc-style conflict report for each state,
4232 instead of our more-complicated style.
4233 (conflicts_print): Use Yacc-style conflict report, except print
4234 the input file name when not emulating Yacc.
4235 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
4236 Conflicted Reduction, %expect not enough, %expect too much,
4237 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
4238 * tests/existing.at (GNU Cim Grammar): Likewise.
4239 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
4240
4241 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
4242 fatal): Don't invoke fflush; it's not needed and it might even be
4243 harmful for stdout, as stdout might not be open.
4244 * src/reduce.c (reduce_print): Likewise.
4245
b1efe548
PE
42462002-12-27 Paul Eggert <eggert@twinsun.com>
4247
4248 Fix a bug where error locations were not being recorded correctly.
4249 This problem was originally reported by Paul Hilfinger in
161a71f3 4250 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
4251
4252 * data/yacc.c (yyparse): New local var yylerrsp, to record the
4253 top of the location stack's error locations.
4254 (yyerrlab): Set it. When discarding a token, push its location
4255 onto yylerrsp so that we don't lose track of the error's end.
4256 (yyerrlab1): Now is only the target of YYERROR, so that we can
4257 properly record the location of the action that failed. For GCC
4258 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
4259 GCC warning about yyerrlab1 being unused if YYERROR is unused.
4260 (yyerrlab2): New label, which yyerrlab now falls through to.
4261 Compute the error's location by applying YYLLOC_DEFAULT to
4262 the locations of all the symbols that went into the error.
4263 * doc/bison.texinfo (Location Default Action): Mention that
4264 YYLLOC_DEFAULT is also invoked for syntax errors.
4265 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4266 Error locations include the locations of all the tokens that were
4267 discarded, not just the last token.
d600ee67 4268
983c5c2c
PE
42692002-12-26 Paul Eggert <eggert@twinsun.com>
4270
b1efe548
PE
4271 * src/files.c: Include quote.h.
4272 (compute_output_file_names): Warn if we detect conflicting
4273 outputs to the same file. This should catch the misunderstanding
4274 exemplified by Debian Bug 165349, reported by Bruce Stephens..
4275
4276 * src/conflicts.c (conflicts_print): If the user specifies
4277 "%expect N", report an error if there are any reduce/reduce
4278 conflicts. This is what the manual says should happen.
4279 This fixes Debian bug 130890, reported by Anthony DeRobertis.
4280 * tests/conflicts.at (%expect with reduce conflicts): New test.
4281
983c5c2c
PE
4282 Don't use m4_include on relative file names, as it doesn't work as
4283 desired if there happens to be a file with that name under ".".
d600ee67 4284
983c5c2c
PE
4285 * m4sugar/version.m4: Remove; it was included but it wasn't used.
4286 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
4287 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
4288 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
4289 * src/output.c (output_skeleton): Use full path names when
4290 specifying a file to include; don't rely on include path, as
4291 it's unreliable when the working file contains a file with
4292 that name.
d600ee67 4293
983c5c2c
PE
42942002-12-25 Paul Eggert <eggert@twinsun.com>
4295
4296 Remove obsolete references to bison.simple and bison.hairy.
4297 Problem mentioned by Aubin Mahe in
161a71f3 4298 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
4299 * data/glr.c: Comment fix.
4300 * doc/bison.1: Remove references. Also, mention "yacc".
4301
4302 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
4303 with -g option.
4304
4305 * src/parse-gram.y (declaration): Use enum "report_states" rather
4306 than its numeric value 1.
4307
4308 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
4309 opening a new one. This fixes Debian bug 165349, reported by
4310 Bruce Stephens.
4311
23f2d9dc
PE
43122002-12-24 Paul Eggert <eggert@twinsun.com>
4313
4314 Version 1.75e.
4315
4316 * Makefile.maint (cvs-update): Don't assume that the shell
4317 supports $(...), as Solaris sh doesn't.
4318
4319 * src/parse-gram.y (lloc_default): Remove test for empty
4320 nonterminals at the end, since it didn't change the result.
4321
43222002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
4323
4324 If the user does not define YYSTYPE as a macro, Bison now declares it
4325 using typedef instead of defining it as a macro. POSIX requires this.
4326 For consistency, YYLTYPE is also declared instead of defined.
4327
4328 %union directives can now have a tag before the `{', e.g., the
4329 directive `%union foo {...}' now generates the C code
4330 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
4331 The default union tag is `YYSTYPE', for compatibility with Solaris 9
4332 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
4333 instead of `yyltype'.
4334
4335 `yystype' and `yyltype' are now obsolescent macros instead of being
4336 typedefs or tags; they are no longer documented and will be
4337 withdrawn in a future release.
4338
4339 * data/glr.c (b4_location_type): Remove.
4340 (YYSTYPE): Renamed from yystype.
4341 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
4342 (struct YYLTYPE): Renamed from struct yyltype.
4343 (YYLTYPE): Renamed from yyltype.
4344 (yyltype, yystype): New (and obsolescent) macros,
4345 for backward compatibility.
4346 * data/yacc.c: Likewise.
4347
4348 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
4349 does not specify a union tag. This is for compatibility with
4350 Solaris 9 yacc.
4351
4352 * src/parse-gram.y (add_param): 2nd arg is now char * not char
4353 const *, since it is now modified by stripping surrounding { }.
4354 (current_braced_code): Remove.
4355 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
4356 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
4357 trailing " {...}". Now of type <chars>.
4358 (grammar_declaration): Adjust to bundled tokens.
4359 (code_content): Remove; stripping is now done by add_param.
4360 (print_token_value): Print contents of bundled tokens.
4361 (token_name): New function.
4362
4363 * src/reader.h (braced_code, current_braced_code): Remove.
4364 (token_name): New decl.
4365
4366 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
4367 token_type, not braced_code code_kind. All uses changed.
4368 (SC_PRE_CODE): New state, for scanning after a keyword that
4369 has (or usually has) an immediately-following braced code.
4370 (token_type): New local var, to keep track of which token type
4371 to return when scanning braced code.
4372 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 4373 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
4374 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
4375 instead of returning a token type immediately.
4376 (<INITIAL>"{"): Set token type.
4377 (<SC_BRACED_CODE>"}"): Use it.
4378 (handle_action_dollar, handle_action_at): Now returns bool
4379 indicating success. Fail if ! current_rule; this prevents a core dump.
4380 (handle_symbol_code_dollar, handle_symbol_code_at):
4381 Remove; merge body into caller.
4382 (handle_dollar, handle_at): Complain in invalid contexts.
4383
4384 * NEWS, doc/bison.texinfo: Document the above.
4385 * NEWS: Fix years and program names in copyright notice.
4386
879ca4f8
PE
43872002-12-17 Paul Eggert <eggert@twinsun.com>
4388
4389 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
4390 Reporting, Table of Symbols): Omit mentions of %lex-param and
4391 %parse-param from the documentation for now.
4392
1c5fe69d
PE
43932002-12-15 Paul Eggert <eggert@twinsun.com>
4394
4395 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
4396 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
4397 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
4398 disagreed with the Bison documentation. Bug
4399 reported by Andrew Walrond.
d600ee67 4400
1c5fe69d
PE
4401 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
4402 as the caller now does that.
4403 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
4404 (YYEMPTY): Parenthesize right hand side, since others use it.
4405 (yyparse): Don't assume that our generated code is the only code
4406 that sets yychar.
4407
d1de5372
PE
44082002-12-13 Paul Eggert <eggert@twinsun.com>
4409
4410 Version 1.75d.
4411
4412 POSIX requires a "yacc" command.
4413 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
4414 (MOSTLYCLEANFILES): Add yacc.
4415 (yacc): New rule.
1c5fe69d 4416 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
4417 as an alias for bison y.
4418
4419 * po/LINGUAS: Add da.
d600ee67 4420
d1de5372
PE
4421 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
4422 problem with latest <getopt.h>.
4423 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
4424
4425 * doc/fdl.texi: Upgrade to 1.2.
4426 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
4427 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
4428 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
4429 gnulib.
4430 * config/install-sh: Sync with autotools.
4431
4432 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 4433 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
4434 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
4435 locations are requested.
4436 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
4437 locations are requested.
4438
d0f3fe23
PE
44392002-12-12 Paul Eggert <eggert@twinsun.com>
4440
4441 Remove unportable casts and storage allocation tricks.
4442 While we're at it, remove almost all casts, since they
4443 usually aren't needed and are a sign of trouble.
4444
4445 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
4446
4447 * src/derives.c (derives_compute): Do not subtract NTOKENS from
4448 the pointer DSET returned by malloc; this isn't portable.
4449 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
4450 Similarly for DERIVES.
4451 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
4452 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
4453 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
4454
4455 * src/derives.c (derives_compute): Do not bother invoking
4456 int_of_rule_number, since rule numbers are integers.
4457
4458 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
4459 rather than XMALLOC (char, N).
4460
4461 * src/files.c (filename_split): Rewrite to avoid cast.
4462
4463 * src/gram.h (symbol_number_as_item_number,
4464 item_number_as_symbol_number, rule_number_as_item_number,
4465 item_number_as_rule_number):
4466 Now inline functions rather than macros, to avoid casts.
4467 * src/state.h (state_number_as_int): Likewise.
4468 * src/tables.c (state_number_to_vector_number,
4469 symbol_number_to_vector_number): Likewise.
4470
4471 * src/gram.h (int_of_rule_number): Remove; no longer used.
4472
4473 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
4474 since the resulting storage is always stored into.
4475
4476 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
4477 where it's needed.
4478
4479 * src/muscle_tab.c (muscle_m4_output):
4480 Now inline. Return bool, not int.
4481 * src/state.c (state_compare): Likewise.
4482 * src/symtab.c (symbol_check_defined,
4483 symbol_check_alias_consistency, symbol_pack, symbol_translation,
4484 hash_compare_symbol, hash_symbol):
4485 Likewise.
4486 * src/uniqstr.c (uniqstr_print): Likewise.
4487 * src/muscle_tab.c (muscle_m4_output_processor):
4488 New function, to avoid casts.
4489 * src/state.c (state_comparator, stage_hasher): Likewise.
4490 * src/symtab.c (symbol_check_defined_processor,
4491 symbol_check_alias_consistency_processor, symbol_pack_processor,
4492 symbol_translation_processor, hash_symbol_comparator,
4493 hash_symbol_hasher): Likewise.
4494 * src/uniqstr.c (uniqstr_print_processor): Likewise.
4495 * src/muscle_tab.c (muscles_m4_output):
4496 Use new functions instead of casting old functions unportably.
4497 * src/state.c (state_hash_new): Likewise.
4498 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
4499 symbols_token_translations_init):
4500 Likewise.
4501 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
4502
4503 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
4504 var instead of casting to long, to avoid casts.
4505 (prepare_states): Use MALLOC rather than alloca, so that we don't
4506 have to worry about alloca.
4507 * src/state.c (state_hash_lookup): Likewise.
4508
4509 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
4510 local var instead of casting to unsigned char, to avoid casts.
4511
4512 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
4513 STATE_ALLOC): Remove.
4514 (transitions_new, errs_new, reductions_new, state_new): Use malloc
4515 rather than calloc, and use offsetof to avoid allocating slightly
4516 too much storage.
4517 (state_new): Initialize all members.
4518
4519 * src/state.c (state_hash): Use unsigned accumulator, not signed.
4520
4521 * src/symtab.c (symbol_free): Remove; unused.
4522 (symbol_get): Remove cast in lhs of assignment.
4523 (symbols_do): Now static. Accept generic arguments, not
4524 hashing-related ones.
4525
4526 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
4527 (symbol_processor): Remove.
4528 (symbols_do): Remove decl; now static.
4529
4530 * src/system.h (alloca): Remove; decl no longer needed.
4531 (<stddef.h>): Include, for offsetof.
4532 (<inttypes.>, <stdint.h>): Include if available.
4533 (uintptr_t): New type, if system lacks it.
4534 (CALLOC, MALLOC, REALLOC): New macros.
4535 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
4536 new macros.
4537
4538 * src/tables.c (table_size): Now int, to pacify GCC.
4539 (table_grow, table_ninf_remap): Use signed table size.
4540 (save_row): Don't bother initializing locals when not needed.
4541 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
4542 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
4543
4544 * src/vcg.h: Correct misspellings.
4545
4546 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
4547
4548
4549 * src/getargs.c (getargs): Don't assume EOF == -1.
4550
26b4a969
PE
45512002-12-09 Paul Eggert <eggert@twinsun.com>
4552
4553 Change identifier spellings to avoid collisions with names
4554 that are reserved by POSIX.
4555
4556 Don't use names ending in _t, since POSIX reserves them.
4557 For consistency, remove _e and _s endings -- they're weren't
4558 needed to remove ambiguity. All uses changed.
4559 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
4560 turn was just renamed from struniq_t.
4561 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
4562 which in turn was just renamed from struniq_processor_t.
4563 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
4564 in turn was renamed from hash_compare_struniq_t.
4565 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
4566 (state_list): Renamed from state_list_t.
4567 * src/assoc.h (assoc): Renamed from assoc_t.
4568 * src/conflicts.c (enum conflict_resolution): Renamed from
4569 enum conflict_resolution_e.
4570 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
4571 (rule_list): Renamed from rule_list_t.
4572 * src/getargs.h (enum trace): Renamed from enum trace_e.
4573 (enum report): Renamed from enum report_e.
4574 * src/gram.h (item_number): Renamed from item_number_t.
4575 (rule_number): Renamed from rule_number_t.
4576 (struct rule_s): Remove the "rule_s" part; not used.
4577 (rule): Renamed from rule_t.
4578 (rule_filter): Renamed from rule_filter_t.
4579 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
4580 (goto_list): Renamed from goto_list_t.
4581 * src/lalr.h (goto_number): Renamed from goto_number_t.
4582 * src/location.h (location): Renamed from location_t.
4583 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
4584 and moved here from:
4585 * src/muscle_tab.h (muscle_entry_t): here.
4586 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
4587 (rule_list): Renamed from rule_list_t.
4588 * src/print_graph.c (static_graph): Renamed from graph.
4589 * src/reader.h (braced_code): Renamed from braced_code_t.
4590 Remove brace_code_e tag.
4591 * src/relation.h (relation_node): Renamed from relation_node_t.
4592 (relation_nodes): Renamed from relation_nodes_t.
4593 (relation): Renamed from relation_t.
4594 * src/state.h (state_number): Renamed from state_number_t.
4595 (struct state): Renamed from struct state_s.
4596 (state): Renamed from state_t.
4597 (transitions): Renamed from transitions_t. Unused (and
4598 misspelled) transtion_s tag removed.
4599 (errs): Renamed from errs_t. Unused errs_s tag removed.
4600 (reductions): Renamed from reductions_t. Unused tag
4601 reductions_s removed.
4602 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
4603 (struct symbol_list): Renamed from struct symbol_list_s.
4604 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
4605 (struct symbol): Renamed from struct symbol_s.
4606 (symbol): Renamed from symbol_t.
4607 * src/tables.c (vector_number): Renamed from vector_number_t.
4608 (action_number): Renamed from action_t.
4609 * src/tables.h (base_number): Renamed from base_t.
4610 * src/vcg.h (enum color): Renamed from enum color_e.
4611 (enum textmode): Renamed from enum textmode_e.
4612 (enum shape): Renamed from enum shape_e.
4613 (struct colorentry): Renamed from struct colorentry_s.
4614 (struct classname): Renamed from struct classname_s.
4615 (struct infoname): Renamed from struct infoname_s.
4616 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
4617 (enum decision): Renamed from enum decision_e.
4618 (enum orientation): Renamed from enum orientation_e.
4619 (enum alignment): Renamed from enum alignment_e.
4620 (enum arrow_mode): Renamed from enum arrow_mode_e.
4621 (enum crossing_type): Renamed from enum crossing_type_e.
4622 (enum view): Renamed from enum view_e.
4623 (struct node): Renamed from struct node_s.
4624 (node): Renamed from node_t.
4625 (enum linestyle): Renamed from enum linestyle_e.
4626 (enum arrowstyle): Renamed from enum arrowstyle_e.
4627 (struct edge): Renamed from struct edge.
4628 (edge): Renamed from edge_t.
4629 (struct graph): Renamed from struct graph_s.
4630 (graph): Renamed from graph_t.
4631 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
4632 Rename value_t -> value.
4633 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
4634 value_t_as_yystype -> value_as_yystype.
4635
4636 Don't include <errno.h> in the mainstream code, since it
4637 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
4638 * lib/get-errno.c, lib/get-errno.h: New files.
4639 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
4640 get-errno.c.
4641 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
4642 * src/output.c (output_skeleton): Likewise.
4643 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
4644 instead of errno.
4645 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
4646 Likewise.
4647 (handle_action_dollar, handle_action_at): Likewise.
4648 * src/system.h: Do not include <errno.h>.
4649 (TAB_EXT): Renamed from EXT_TAB.
4650 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
4651
4652 Avoid str[a-z]*, since <string.h> reserves that name space.
4653 Change all instances of "struniq" in names to "uniqstr", and
4654 likewise for "STRUNIQ" and "UNIQSTR".
4655 * src/uniqstr.c: Renamed from src/struniq.c.
4656 * src/uniqstr.h: Renamed from src/struniq.h.
4657 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
4658 * src/files.c (strsuffix): Remove; unused.
4659 (concat2): Renamed from stringappend. Now static.
4660 * src/files.h (strsuffix, stringappend): Remove; unused.
4661 * src/parse-gram.y (<chars>): Renamed from <string>.
4662 (<uniqstr>): Renamed from <struniq>.
4663 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
4664 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
4665 (struct graph_s.expand): Renamed from struct graph_s.stretch.
4666 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
4667 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
4668 (N_EXPAND): Renamed from N_STRETCH.
4669
4670 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
4671 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
4672 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
4673 Remove; unused.
4674 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
4675 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
4676 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
4677 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
4678 (BASE_MAXIMUM): Renamed from BASE_MAX.
4679 (BASE_MINIMUM): Renamed from BASE_MIN.
4680 (ACTION_MAX): Remove; unused.
4681 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
4682 Unnecessary casts removed from above defines.
4683
4684
4685 Fix misspelling in names.
4686 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
4687 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
4688 G_NODE_ALIGNEMENT.
4689
4690
4691 * lib/timevar.c (timevar_report): Renamed from time_report,
4692 for consistency with other names.
4693 * lib/timevar.h (timevar_report): New decl.
4694 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
4695
4696
4697 Sort include-file uses.
4698
4699 Reorder all include files under src to be in the order "system.h".
4700 then the ../lib include files in angle brackets (alphabetized),
4701 then the . include files in double-quotes (alphabetized). Fix
4702 dependency breakages encountered in this process, as follows:
4703 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
4704 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
4705 * src/state.h: Include "symtab.h".
4706
996b1c7e
PE
47072002-12-08 Paul Eggert <eggert@twinsun.com>
4708
4709 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
4710 since this causes problems when __file__ contains character
4711 sequences like "@" that are treated specially by src/scan-skel.l.
4712 Instead, just use the file's basename. This fixes the bug
4713 reported by Martin Mokrejs in
161a71f3 4714 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 4715
e19c4e5d
PE
47162002-12-06 Paul Eggert <eggert@twinsun.com>
4717
4718 Add support for rules that do not have trailing semicolons, as
4719 POSIX requires. Improve the quality of locations in Bison
4720 diagnostics.
26b4a969 4721
e19c4e5d
PE
4722 * src/location.c: Include <quotearg.h>.
4723 (empty_location): Now const.
4724 (location_print): New function. Follow the recommendation of the
4725 GNU Coding Standards for locations that span file boundaries.
4726 * src/location.h: Do not include <quotearg.h>; no longer needed.
4727 (boundary): New type.
4728 (location_t): Use it. This allows locations to span file boundaries.
4729 All member uses changed: file -> start.file or end.file (as needed),
4730 first_line -> start.line, first_column -> start.column,
4731 last_line -> end.line, last_column -> end.column.
4732 (equal_boundaries): New function.
4733 (LOCATION_RESET, LOCATION_STEP): Remove.
4734 (LOCATION_PRINT): Remove. All callers changed to use location_print.
4735 (empty_location): Now const.
4736 (location_print): New decl.
4737 * src/parse-gram.y (lloc_default): New function, which handles
4738 empty locations more accurately.
4739 (YYLLOC_DEFAULT): Use it.
4740 (%token COLON): Remove.
4741 (%token ID_COLON): New token.
26b4a969 4742 (rules): Use it.
e19c4e5d
PE
4743 (declarations, rules): Remove trailing semicolon.
4744 (declaration, rules_or_grammar_declaration):
4745 Allow empty (";") declaration.
4746 (symbol_def): Remove empty actions; no longer needed.
4747 (rules_or_grammar_declaration): Remove trailing semicolon.
4748 (semi_colon.opt): Remove.
4749 * src/reader.h: Include location.h.
4750 (scanner_cursor): New decl.
4751 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
4752 rolling our own.
4753 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
4754 of *loc.
4755 (STEP): Remove. No longer needed, now that adjust_location does
4756 the work. All uses removed.
4757 (scanner_cursor): New var.
4758 (adjust_location): Renamed from extend_location. It now sets
4759 *loc and adjusts the scanner cursor. All uses changed.
4760 Don't bother testing for CR.
4761 (handle_syncline): Remove location arg; now updates scanner cursor.
4762 All callers changed.
4763 (unexpected_end_of_file): Now accepts start boundary of token or
4764 comment, not location. All callers changed. Update scanner cursor,
4765 not the location.
4766 (SC_AFTER_IDENTIFIER): New state.
4767 (context_state): Renamed from c_context. All uses changed.
4768 (id_loc, code_start, token_start): New local vars.
4769 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
4770 processing of Yacc white space and equivalents here.
4771 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
4772 instead of returning ID immediately, since we need to search for
4773 a subsequent colon.
4774 (<INITIAL>"'", "\""): Save token_start.
4775 (<INITIAL>"%{", "{", "%%"): Save code_start.
4776 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
4777 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
4778 BEGIN context_state at end, not INITIAL.
4779 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
4780 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
4781 Return correct token start.
4782 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
4783 the start of a character, string or multiline comment is found.
4784 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
4785 Reduction): Adjust reported locations to match the more-precise
4786 results now expected.
4787 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
4788 * tests/reduce.at (Useless Rules, Reduced Automaton,
4789 Underivable Rules): Likewise.
4790 * tests/regression.at (Invalid inputs): No longer `expecting ";"
4791 or "|"' now that so many other tokens are allowed by the new grammar.
4792
4793 * src/complain.h (current_file): Remove duplicate decl;
4794 current_file is now owned by files.h.
4795 * src/complain.c, src/scan-gram.l: Include files.h.
4796
47972002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 4798
e19c4e5d
PE
4799 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
4800 promotes to int; it might be unsigned int.
4801 * data/yacc.c (yy_reduce_print): Likewise.
4802
4803 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
4804 be #defined in the prologue, not in the Bison declarations.
4805 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 4806
b64755e3
PE
48072002-12-02 Paul Eggert <eggert@twinsun.com>
4808
4809 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
4810 * lib/strtoul.c: New file, from gnulib.
4811 This fixes a porting bug reported by Peter Klein in
161a71f3 4812 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 4813
6e746484
PE
48142002-11-30 Paul Eggert <eggert@twinsun.com>
4815
b64755e3
PE
4816 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
4817 and put only a forward declaration in the prologue. This is for
4818 consistency with the other scanner helper functions.
4819
6ba55592
PE
4820 Type clashes now generate warnings, not errors, since it
4821 appears that POSIX may allow some grammars with type clashes.
4822 * src/reader.c (grammar_current_rule_check): Warn about
4823 type clashes instead of complaining.
4824 * tests/input.at (Type Clashes): Expect warnings, not complaints.
4825
6e746484
PE
4826 Add Yacc library, since POSIX requires it.
4827 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
4828 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
4829 * lib/main.c, lib/yyerror.c: New files.
4830
4831 gram_error can be static; it need not be extern.
4832 * src/reader.h (gram_error): Remove decl.
4833 * src/parse-gram.y (gram_error): Now static. Add static decl.
4834 (print_token_value): Omit parameter names from forward decl,
4835 for consistency.
4836
88510f9c
PE
48372002-11-29 Paul Eggert <eggert@twinsun.com>
4838
6e746484
PE
4839 * doc/bison.texinfo: Emphasize that yylex and yyerror must
4840 be declared before being used. E.g., one should typically
4841 declare them in the prologue. Use GNU coding style in examples.
4842 Put "const" consistently after the type it modifies. Mention
4843 that C99 supports "inline". Mention that yyerror traditionally
4844 returns "int".
4845
88510f9c
PE
4846 %parse-param and %lex-param now take just one argument, the
4847 declaration; the argument name is deduced from the declaration.
4848
4849 * doc/bison.texinfo (Parser Function, Pure Calling, Error
4850 Reporting, Table of Symbols): Document this.
4851 * src/parse-gram.y (add_param): New function.
4852 (COMMA): Remove.
4853 (declaration): Implement new rule for %parse-param and %lex-param.
4854 * src/scan-gram.l: "," now elicits a warning, rather than being
4855 a token; this is more compatible with byacc.
4856 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
4857
bb92250c
PE
48582002-11-27 Paul Eggert <eggert@twinsun.com>
4859
4860 Rename identifiers to avoid real and potential collisions.
4861
4862 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
4863 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 4864 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
4865 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
4866 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
4867 * src/parse-gram.y (print_token_value): Renamed from yyprint.
4868 All uses changed.
4869 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
4870 The name "yycontrol" violates the name space rules, and this stuff
4871 wasn't being used anyway.
4872 (input): Remove action; this stuff wasn't being used.
4873 (gram_error): Rename local variable yylloc -> loc.
4874 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
4875 (YY_DECL): Don't use "yy" at start of local variables.
4876 All uses changed, e.g., yylloc -> loc.
4877 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
4878 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
4879 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
4880 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
4881
4882 * src/parse-gram.y (gram_error): loc is now const *.
4883 * src/reader.h (gram_error): Likewise.
4884
3af4feb2
PE
48852002-11-24 Paul Eggert <eggert@twinsun.com>
4886
4887 Version 1.75c.
4888
4889 * tests/actions.at (Actions after errors): Use an output format
4890 more similar to that of the Printers and Destructors test.
4891 Test the position of the ';' token too.
4892 (Printers and Destructors): Likewise.
4893 (Printers and Destructors: %glr-parser): Remove for now, to avoid
4894 unnecessarily alarming people when the test fails.
4895
4896 * data/yacc.c (yyerrlab1): Move this label down, so that the
4897 parser does not discard the lookahead token if the user code
4898 invokes YYERROR. This change is required for POSIX conformance.
4899
4900 * lib/error.c: Sync with gnulib.
4901
49022002-11-22 Paul Eggert <eggert@twinsun.com>
4903
4904 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
4905 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
4906 * lib/xmalloc.c: Likewise.
26b4a969 4907
58004308
PE
49082002-11-20 Paul Eggert <eggert@twinsun.com>
4909
4910 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
4911
49122002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 4913
58004308
PE
4914 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
4915 should use `if (! x) abort ();' rather than `assert (x);', and
4916 anyway it's one less thing to worry about configuring.
4917
4918 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
4919 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
4920 and replace all instances of assert with abort.
4921 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4922 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
4923
4924 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
4925 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
4926 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
4927 hash_find_entry, hash_rehash, hash_insert): Likewise.
4928 * src/conflicts.c (resolve_sr_conflict): Likewise.
4929 * src/lalr.c (set_goto_map, map_goto): Likewise.
4930 * src/nullable.c (nullable_compute): Likewise.
4931 * src/output.c (prepare_rules, token_definitions_output): Likewise.
4932 * src/reader.c (packgram, reader): Likewise.
4933 * src/state.c (state_new, state_free, state_transitions_set,
4934 state_reduction_find): Likewise.
4935 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
4936 symbol_pack): Likewise.
4937 * src/tables.c (conflict_row, pack_vector): Likewise.
4938 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
4939 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
4940 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
4941 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
4942
4943 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
4944 (ARGMATCH_CONSTRAINT): New macro.
4945 (ARGMATCH_ASSERT): Use it.
4946
4947 * src/system.h (verify): New macro.
4948 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
4949 rather than assert.
4950 * src/tables.c (tables_generate): Likewise.
4951
4952 * src/struniq.c (struniq_assert): Now returns void, and aborts
4953 if the assertion is false.
4954 (struniq_assert_p): Remove.
4955 * src/struniq.h: Likewise.
4956
76ae8198
PE
49572002-11-18 Paul Eggert <eggert@twinsun.com>
4958
4959 * data/glr.c (yygetLRActions): Replace `yyindex' with
4960 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
4961 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 4962 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 4963
d3c4e709
AD
49642002-11-18 Akim Demaille <akim@epita.fr>
4965
4966 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
4967 space.
4968 From Tim Van Holder.
4969
8d8a7238
PE
49702002-11-17 Paul Eggert <eggert@twinsun.com>
4971
4972 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
4973 to "SyntaxError" for consistency with my 2002-11-15 change.
4974
4975 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
4976 not define to {}, since this breaks the common use of `YYDPRINTF
4977 ((...));' if a single statement is desired (e.g. before `else').
4978 Work around GCC warnings by surrounding corresponding calls with
4979 {} if needed.
4980 (yyhasResolvedValue): Remove unused function.
4981 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
4982 loop body.
4983 (yyreportSyntaxError): Renamed from yyreportParseError.
4984 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
4985 All uses changed.
4986 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
4987 extern when possible. Remove unused initializations.
4988
b0937b22
AD
49892002-11-16 Akim Demaille <akim@epita.fr>
4990
4991 Augment the similarity between GLR and LALR traces.
4992
4993 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
4994 (YY_REDUCE_PRINT): New.
4995 (yyparse): Use them.
4996 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
4997 YYDPRINT here.
4998 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
4999 state reached after the reduction/recovery, since...
5000 (yyparse, yyprocessOneStack): Report the state we are entering in.
5001
c5e3e510
AD
50022002-11-16 Akim Demaille <akim@epita.fr>
5003
5004 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
5005 Add support for --trace=skeleton.
5006 * src/scan-skel.l: %option debug.
5007 Scan strings of non-@ or \n instead of character by character.
5008 (scan_skel): Handle trace_skeleton.
5009 (QPUTS): New.
5010 (@output_parser_name@, @output_header_name@): ``Restore'' their
5011 support (used to be M4 macros).
5012 * data/yacc.c: Quote larger chunks, a la glr.c.
5013 * data/lalr1.cc: Likewise.
5014 The header guards are no longer available, so use some other
5015 string than `YYLSP_NEEDED'.
5016
4c6cc1db
AD
50172002-11-16 Akim Demaille <akim@epita.fr>
5018
5019 Make the ``Printers and Destructors'' test more verbose, taking
5020 `yacc.c''s behavior as (possibly wrong) reference.
5021
5022 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
5023 instead of fprint on stdout.
5024 Set and report the last_line of the symbols.
5025 Consistently display values and locations.
5026
6d9e8019
PE
50272002-11-16 Paul Eggert <eggert@twinsun.com>
5028
5029 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
5030
6e649e65
PE
50312002-11-15 Paul Eggert <eggert@twinsun.com>
5032
b25d88f6
PE
5033 * tests/actions.at (Actions after errors): New test case.
5034
6e649e65
PE
5035 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
5036 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
5037 tests/action.at, tests/calc.at, tests/conflicts.at,
5038 tests/cxx-type.at, tests/regression.at:
5039 "parse error" -> "syntax error" for POSIX compatibility.
5040 "parsing stack overflow..." -> "parser stack overflow" so
5041 that code matches Bison documentation.
5042
0f39aab9
AD
50432002-11-15 Akim Demaille <akim@epita.fr>
5044
5045 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
5046 take two BRACED_CODE, not two string_content.
5047 Free the scanner's obstack when we are done.
5048 (code_content): New.
5049 * tests/calc.at: Adjust.
5050 * doc/bison.texinfo: Adjust.
5051 Also, make sure to include the `,' for these declarations.
5052
761c1926
AD
50532002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
5054
5055 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
5056 definition; avoids potential autoreconf problems.
5057
b0f98b10
AD
50582002-11-15 Akim Demaille <akim@epita.fr>
5059
5060 Always check the value returned by yyparse.
5061
5062 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
5063 returned by yyparse.
5064 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
5065 Adjust calls.
5066 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
5067 returned by yyparse.
5068
970785f1
PH
50692002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5070
5071 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
5072 on input.at test.
5073
8fcc7db1
PE
50742002-11-14 Paul Eggert <eggert@twinsun.com>
5075
7ec1b48e
PE
5076 * src/output.c (output_skeleton): Call xfopen instead of
5077 duplicating xfopen's body.
5078
cfff7583 5079 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 5080 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 5081
8fcc7db1
PE
5082 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
5083 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
5084 Group compiler. Instead, use "$CC -E bar.c". Include the .h
5085 file twice in the grammar, as an extra check.
5086
5087 * tests/input.at (Torturing the Scanner): Surround the
5088 backslash-newline tests with "#if 0", to make it less likely that
5089 we'll run into compiler bugs. Bring back solitary \ inside
5090 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 5091 test backslash-newline in C character constant.
8fcc7db1 5092
4e8d992c
AD
50932002-11-14 Akim Demaille <akim@epita.fr>
5094
5095 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
5096 status of the compiler.
f32b346d 5097 Calling `exit 1' is no longer needed.
4e8d992c
AD
5098 Reported by Nelson H. F. Beebe.
5099
9501dc6e
AD
51002002-11-14 Akim Demaille <akim@epita.fr>
5101
5102 * tests/atlocal.in (CPPFLAGS): We have config.h.
5103 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
5104 New.
5105 * tests/actions.at, tests/calc.at, tests/conflicts.at,
5106 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
5107 * tests/regression.at, tests/torture.at: Use them for all the
5108 grammars that are to be compiled.
5109 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
5110 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
5111 * doc/bison.texinfo (GLR Parsers): Document `inline'.
5112
18b519c0
AD
51132002-11-14 Akim Demaille <akim@epita.fr>
5114
5115 * doc/bison.texinfo: Various formatting changes (alignments in
5116 samples, additional @group/@end group, GCS in samples.
5117 Use @deffn instead of simple @table to define the directives,
5118 macros, variables etc.
5119
9a86cdb9
PE
51202002-11-13 Paul Eggert <eggert@twinsun.com>
5121
daa33def 5122 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 5123 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 5124
daa33def 5125 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 5126 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
5127 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
5128 * tests/headers.at (export YYLTYPE): Likewise.
5129
5130 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 5131 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 5132
9a86cdb9
PE
5133 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
5134 comments, since they're not portable. Use GNU coding style.
5135
9c1e26bd
AD
51362002-11-13 Akim Demaille <akim@epita.fr>
5137
5138 * data/yacc.c: Leave bigger chunks of quoted text.
5139 (YYDSYMPRINTF): New.
5140 Use it to report symbol activities.
5141 * data/glr.c (YYDSYMPRINTF): New.
5142 Use it.
5143
87f721cc
PE
51442002-11-12 Paul Eggert <eggert@twinsun.com>
5145
5146 Version 1.75b.
5147
5148 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
5149 (yyglrReduce): Return yyok, not 0.
5150 This should avoid the enumerated-type warnings reported
464c6927 5151 by Nelson H. F. Beebe in
161a71f3 5152 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
5153
5154 * lib/bbitset.h (BITSET_INLINE): Remove.
5155 * lib/bitset.h [! BITSET_INLINE]: Remove.
5156 (bitset_set, bitset_reset, bitset_test): Rename local vars
5157 to avoid shadowing warnings by GCC.
5158
5159 * data/glr.c (inline): Remove #define. It's the user's
5160 responsibility to #define it away, just like 'const'.
464c6927 5161 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 5162 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 5163
87f721cc
PE
5164 * Makefile.maint (po-check): Scan .l and .y files instead of the
5165 .c and the .h files that they generate. This fixes the bug
5166 reported by Tim Van Holder in:
161a71f3 5167 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
5168 Look for N_ as well as for _. Try to avoid matching #define for
5169 N_ and _.
5170 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
5171 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
5172 * src/scan-gram.l: Revamp regular expressions so that " and '
5173 do not confuse xgettext.
5174
5175 * src/struniq.h (struniq_new): Do not declare the return type
5176 to be 'const'; this violates the C standard.
5177 * src/struniq.c (struniq_new): Likewise.
5178
be14ade5
AD
51792002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
5180
5181 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
5182 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
5183 linker.
5184
05291fbc
AD
51852002-11-12 Akim Demaille <akim@epita.fr>
5186
5187 * Makefile.maint: Sync with Autoconf:
5188 (local_updates): New.
5189
1f5fd52e
AD
51902002-11-12 Akim Demaille <akim@epita.fr>
5191
5192 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
5193
283f1e64
AD
51942002-11-12 Akim Demaille <akim@epita.fr>
5195
5196 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
5197 locations.
5198
886b69d1
AD
51992002-11-12 Akim Demaille <akim@epita.fr>
5200
5201 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
5202 not yyvalue.
5203
3df37415
AD
52042002-11-12 Akim Demaille <akim@epita.fr>
5205
5206 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
5207 Use it to test the GLR parser.
5208
7bd6c77e
AD
52092002-11-12 Akim Demaille <akim@epita.fr>
5210
5211 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
5212 defines it.
5213 * data/glr.c (yystos): New.
5214 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
5215 (YYDSYMPRINT): New.
5216 (yyval): Don't define it, it is handled via M4.
5217 (yyrecoverParseError): Free verbosely the discarded symbols.
5218 * data/yacc.c (yysymprint): Remove, rather...
5219 (b4_yysymprint_generate): invoke.
5220 * data/c.m4 (b4_yysymprint_generate): New.
5221 Accept pointers as arguments, as opposed to the version from
5222 yacc.c.
5223 (b4_yydestruct_generate): Likewise.
5224 * tests/cations.at (Printers and Destructors): Use Bison directives
5225 instead of CPP macros.
5226 Don't rely on internal details.
5227
b0400cc6
AD
52282002-11-12 Akim Demaille <akim@epita.fr>
5229
5230 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
5231 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
5232 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
5233 it against YYEMPTY and so forth), work on yytoken (i.e., set
5234 it to YYEMPTY etc.).
5235 (yydestruct): Replace with a b4_yydestruct_generate invocation.
5236 (b4_symbol_actions): Remove.
5237 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
5238 for 0, end-of-input.
5239
72f889cc
AD
52402002-11-12 Akim Demaille <akim@epita.fr>
5241
5242 * doc/bison.texinfo (Destructor Decl): New.
5243
b1ae9233
AD
52442002-11-12 Akim Demaille <akim@epita.fr>
5245
5246 * src/tables.c (tables_generate): Use free for pointers that
5247 cannot be NULL, not XFREE.
5248 (pack_vector): Use assert, not fatal, for bound violations.
5249 * src/state.c (state_new): Likewise.
5250 * src/reader.c (reader): Likewise.
5251 * src/lalr.c (set_goto_map): Likewise.
72f889cc 5252 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
5253 the file name.
5254
7ec2d4cd
AD
52552002-11-12 Akim Demaille <akim@epita.fr>
5256
5257 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
5258 Restore.
5259 * src/scan-gram.l (last_string): Is global to the file, not to
5260 yylex.
5261 * src/parse-gram.y (input): Don't append the epilogue here,
5262 (epilogue.opt): do it here, and free the scanner's obstack.
5263 * src/reader.c (epilogue_set): Rename as...
5264 (epilogue_augment): this.
5265 * data/c.m4 (b4_epilogue): Defaults to empty.
5266
573a6cd3
AD
52672002-11-12 Akim Demaille <akim@epita.fr>
5268
5269 * src/getargs.c (long_options): Remove duplicates.
5270 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
5271 Remove.
5272 * doc/bison.rnh: Remove.
5273 * doc/bison.texinfo (VMS Invocation): Remove.
5274
95612cfa
AD
52752002-11-12 Akim Demaille <akim@epita.fr>
5276
5277 * src/struniq.h, src/struniq.c (struniq_t): Is const.
5278 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
5279
5280 Use struniq for symbols.
5281
5282 * src/symtab.h (symbol_t): The tag member is a struniq.
5283 (symbol_type_set): Adjust.
5284 * src/symtab.c (symbol_new): Takes a struniq.
5285 (symbol_free): Don't free the tag member.
5286 (hash_compare_symbol_t, hash_symbol_t): Rename as...
5287 (hash_compare_symbol, hash_symbol): these.
5288 Use the fact that tags as struniqs.
5289 (symbol_get): Use struniq_new.
5290 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
5291 Returns a strniq.
5292 * src/reader.h (merger_list, grammar_currentmerge_set): The name
5293 and type members are struniqs.
5294 * src/reader.c (get_merge_function)
5295 (grammar_current_rule_merge_set): Adjust.
5296 (TYPE, current_type): Are struniq.
5297
5298 Use struniq for file names.
5299
5300 * src/files.h, src/files.c (infile): Split into...
5301 (grammar_file, current_file): these.
5302 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
5303 * src/reduce.c (reduce_print): Likewise.
5304 * src/getargs.c (getargs): Likewise.
5305 * src/complain.h, src/complain.c: Likewise.
5306 * src/main.c (main): Call struniqs_new early enough to use it for
5307 file names.
5308 Don't free the input file name.
5309
3e6656f9
AD
53102002-11-12 Akim Demaille <akim@epita.fr>
5311
5312 * src/symtab.c (symbol_free): Remove dead deactivated code:
5313 type_name are properly removed.
5314 Don't use XFREE to free items that cannot be NULL.
5315 * src/struniq.h, src/struniq.c: New.
5316 * src/main.c (main): Initialize/free struniqs.
5317 * src/parse-gram.y (%union): Add astruniq member.
5318 (yyprint): Adjust.
5319 * src/scan-gram.l (<{tag}>): Return a struniq.
5320 Free the obstack bit that used to store it.
5321 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
5322
7672019c
PE
53232002-11-11 Paul Eggert <eggert@twinsun.com>
5324
5325 Revamp to fix many (but not all) of the C- and M4-related quoting
5326 problems. Among other things, this fixes the Bison bug reported
5327 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 5328 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
5329
5330 Use new @ escapes consistently. Represent brackets with @{ and @}
5331 rather than @<:@ and @:>@, since this works a bit better with dumb
5332 editors like vi. Represent @ with @@, since @ is now consistently
5333 an escape. Use @oline@ and @ofile@ rather than __oline__ and
5334 __ofile__, to avoid unexpected expansions. Similarly, use @output
5335 rather than #output.
5336
5337 * data/c.m4 (b4_copyright): Omit file name from comment, since
5338 the file name could contain "*/".
5339 (b4_synclines_flag): Don't quote the 2nd argument; it should already
5340 be quoted. All uses changed.
5341
5342 * data/glr.c: Use new @ escapes consistently.
5343 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
5344 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
5345 Remove, since they couldn't handle arbitrary characters in file
5346 names.
5347 * data/lalr1.cc: Likewise.
5348 * data/yacc.c: Likewise.
5349
5350 * src/files.c (output_infix): Remove; all uses removed.
5351 * src/files.h: Likewise.
5352
5353 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
5354 mishandled funny characters in file names, and anyway it isn't
5355 needed any more.
5356 * data/yacc.c: Likewise.
5357 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
5358
5359 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
5360 * data/yacc.c: Likewise.
5361
5362 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
5363 strings now.
5364 (muscle_init): Quote filename as a C string.
5365 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
5366 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
5367 * src/output.c (escaped_file_name_output): New function.
5368 (prepare_symbols): Quote tokens for M4.
5369 (prepare): Don't insert output_infix, output_prefix,
5370 output_parser_name, output_header_name; this is now down by scan-skel.
5371 Insert skeleton as a C string.
5372
5373 * src/output.c (user_actions_output, symbol_destructors_output,
5374 symbol_printers_output): Quote filenames for C and M4.
5375 * src/reader.c (prologue_augment, epilogue_set): Likewise.
5376
5377 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
5378 escapes other than \\ and \'; this simplifies the code.
5379 (<SC_STRING>): Likewise, for \\ and \".
5380 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
5381 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
5382 Use new escapes @{ and @} for [ and ].
5383
5384 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
5385 them with auto vars.
5386 Switch to new escape scheme, where @ is the escape character uniformly.
5387 Abort if a stray escape character is found. Avoid unbounded input
5388 buffer when parsing non-escaped text.
5389
5390 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
5391 __oline__, #output, $@, and @{ do not have unintended meanings.
5392
acea4f3b
PE
53932002-11-09 Paul Eggert <eggert@twinsun.com>
5394
5395 Fix the test failure due to GCC warnings described in
161a71f3 5396 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
5397 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
5398 evaluate to 0 if it's impossible for NINF to be in the respective
5399 table.
5400 (yygetLRActions, yyrecoverParseError): Use them.
5401
5402 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
5403 counted in the token inserted at end of file. Now takes
5404 location_t *, not location_t, so that the location can be
5405 adjusted. All uses changed.
5406
5407 * tests/regression.at (Invalid inputs): Adjust wording in
5408 diagnostic to match the new behavior.
5409
5410 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
5411 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
5412 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
5413 abort ();'. This reduces the runtime of the "Many lookaheads"
5414 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
5415 GCC 3.2.
5416
20ef1ad5
PE
54172002-11-07 Paul Eggert <eggert@twinsun.com>
5418
5419 * src/parse-gram.y (CHARACTER): Remove unused token.
5420 All uses removed.
5421
5422 * src/scan-gram.l: Remove stack option. We no longer use the
5423 stack, since the stack was never deeper than 1; instead, use the
5424 new auto var c_context to record the stacked value.
5425
5426 Remove nounput option. At an unexpected end of file, we now unput
5427 the minimal input necessary to end cleanly; this simplifies the
5428 code.
5429
5430 Avoid unbounded token sizes where this is easy.
5431
5432 (unexpected_end_of_file): New function.
5433 Use it to systematize the error message on unexpected EOF.
5434 (last-string): Now auto, not static.
5435 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
5436 (scanner_last_string_free): Remove; not used.
5437 (percent_percent_count): Move decl to just before use.
5438 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
5439 not the (never otherwised-used) CHARACTER.
5440
93724f13
AD
54412002-11-07 Akim Demaille <akim@epita.fr>
5442
5443 Let yyerror always receive the msg as last argument, so that
5444 yyerror can be variadic.
5445
5446 * data/yacc.c (b4_yyerror_args): New.
5447 Use it when calling yyerror.
5448 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
5449 Use it when calling yyerror.
5450 * doc/bison.texinfo (Error Reporting): Adjust.
5451 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
5452 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
5453
6e40b4eb
AD
54542002-11-06 Akim Demaille <akim@epita.fr>
5455
5456 #line should have quoted strings.
5457 Ideally, this should be done by m4_quotearg.
5458
5459 * src/scan-skel.l: Include quotearg.h.
5460 Quote __ofile__.
5461 * src/output.c (symbol_printers_output)
5462 (symbol_destructors_output): Quote the file name.
5463
2dfbfc12
AD
54642002-11-06 Akim Demaille <akim@epita.fr>
5465
5466 * tests/regression.at (Invalid inputs): Adjust to the recent
5467 messages.
5468
437c2d80
AD
54692002-11-06 Akim Demaille <akim@epita.fr>
5470
5471 Restore --no-lines.
5472 Reported by Jim Kent.
5473
5474 * data/c.m4 (b4_syncline): New.
5475 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
5476 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
5477 * src/output.c (user_actions_output): Likewise.
5478 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 5479 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 5480
900c5db5
AD
54812002-11-06 Akim Demaille <akim@epita.fr>
5482
5483 * src/main.c (main): Free `infile'.
5484 * src/scan-gram.l (handle_syncline): New.
5485 Recognize `#line'.
5486 * src/output.c (user_actions_output, symbol_destructors_output)
5487 (symbol_printers_output): Use the location's file name, not
5488 infile.
5489 * src/reader.c (prologue_augment, epilogue_set): Likewise.
5490
e183b123 54912002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 5492
e183b123 5493 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 5494 either has GLR conflict entries.
e183b123 5495
193eb6b7
PE
54962002-11-05 Paul Eggert <eggert@twinsun.com>
5497
e183b123
PE
5498 * src/scan-gram.l: Use more accurate diagnostics, e.g.
5499 "integer out of range" rather than "invalid value".
5500 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
5501 accordingly.
5502
193eb6b7
PE
5503 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
5504 Also, remove one static variable in the scanner.
5505
5506 * src/scan-gram.l (braces_level): Now auto, not static.
5507 Initialize to zero if the compiler is being picky.
5508 (INITIAL): Clear braces_level instead of incrementing it.
5509 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
5510 as POSIX 1003.1-2001 requires.
5511 * src/system.h (IF_LINT): New macro, taken from coreutils.
5512 * configure.ac: Define "lint" if --enable-gcc-warnings.
5513
29c01725
AD
55142002-11-05 Akim Demaille <akim@epita.fr>
5515
5516 * src/scan-gram.l: When it starts with `%', complain about the
5517 whole directive, not just that `invalid character: %'.
5518
8aeac3ca
AD
55192002-11-04 Akim Demaille <akim@epita.fr>
5520
5521 * Makefile.maint: Update from Autoconf.
5522 (update, cvs-update, po-update, do-po-update): New.
5523
793a58bb
AD
55242002-11-04 Akim Demaille <akim@epita.fr>
5525
5526 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
5527 and yyerror.
5528 Have yyerror `use' its arguments.
5529 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
5530 returns true when location & yacc & pure & parse-param.
5531 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
5532
c4d720cd
AD
55332002-11-04 Akim Demaille <akim@epita.fr>
5534
5535 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
5536 clashes.
5537 * src/scan-gram.l: Use [\'] instead of ['] to pacify
5538 font-lock-mode.
5539 Use complain_at.
5540 Use quote, not quote_n since LOCATION_PRINT no longer uses the
5541 slot 0.
5542
613a0dc5
PE
55432002-11-03 Paul Eggert <eggert@twinsun.com>
5544
5545 * src/reader.c (get_merge_function, grammar_current_rule_check):
5546 Use consistent diagnostics for reporting type name clashes.
5547 Quote the types with <>, for consistency with Yacc.
5548 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
5549
2a8d363a
AD
55502002-11-03 Akim Demaille <akim@epita.fr>
5551
5552 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
5553 New.
5554 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
5555 (b4_parse_param): Remove.
5556 Use b4_identification.
5557 Propagate b4_pure_args where needed to pass them to yyerror.
5558 * data/glr.m4 (b4_parse_param): Remove.
5559 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
5560 (b4_lpure_formals): New.
5561 Use b4_identification.
5562 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
5563 b4_user_formals and b4_user_args.
5564 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
5565 (yyreportAmbiguity): When using a pure parser, also need
5566 the location, and the parse-params.
5567 Adjust callers.
5568 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
5569 When using a pure parser, also need the parse-params.
5570 Adjust callers.
5571 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
5572 (%pure-parser + %parse-param) LALR and GLR parsers.
5573 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
5574 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
5575 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
5576 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
5577 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
5578 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
5579 * doc/bison.texinfo: Untabify the whole file.
5580 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
5581 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
5582 (Error Reporting): Adjust to these new directives.
5583 Document %error-verbose, deprecate YYERROR_VERBOSE.
5584
9e32add8
AD
55852002-11-03 Akim Demaille <akim@epita.fr>
5586
5587 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
5588 AT_CHECK_CALC_GLR invocations to use % directives, instead of
5589 command line options.
5590 * tests/cxx-type.at: Formatting changes.
5591
b02d90a5
PE
55922002-11-03 Paul Eggert <eggert@twinsun.com>
5593
5594 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
5595 to count columns correctly, and to check for invalid inputs.
9e32add8 5596
b02d90a5
PE
5597 Use mbsnwidth to count columns correctly. Account for tabs, too.
5598 Include mbswidth.h.
5599 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
5600 (extend_location): New function.
5601 (YY_LINES): Remove.
5602
5603 Handle CRLF in C code rather than in Lex code.
5604 (YY_INPUT): New macro.
5605 (no_cr_read): New function.
5606
5607 Scan UCNs, even though we don't fully handle them yet.
5608 (convert_ucn_to_byte): New function.
5609
5610 Handle backslash-newline correctly in C code.
5611 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
5612 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
5613 all uses changed.
5614 (tag, splice): New EREs. Do not allow NUL or newline in tags.
5615 Use {splice} wherever C allows backslash-newline.
5616 YY_STEP after space, newline, vertical-tab.
5617 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 5618
b02d90a5
PE
5619 (letter, id): Don't assume ASCII; e.g., spell out a-z.
5620
5621 ({int}, handle_action_dollar, handle_action_at): Check for integer
5622 overflow.
9e32add8 5623
b02d90a5
PE
5624 (YY_STEP): Omit trailing semicolon, so that it's more like C.
5625
5626 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
5627 as well as \000. Check for UCHAR_MAX, not 255.
5628 Allow \x with an arbitrary positive number of digits, as in C.
5629 Check for overflow here.
5630 Allow \? and UCNs, for compatibility with C.
5631
5632 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
5633 with quote slot used by complain_at.
5634
5635 * tests/input.at: Add tests for backslash-newline, m4 quotes
5636 in symbols, long literals, and funny escapes in strings.
5637
5638 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
5639 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
5640 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
5641 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
5642 * m4/mbswidth.m4: New file, from GNU coreutils.
5643
5644 * doc/bison.texinfo (Grammar Outline): Document // comments.
5645 (Symbols): Document that trigraphs have no special meaning in Bison,
5646 nor is backslash-newline allowed.
5647 (Actions): Document that trigraphs have no special meaning.
5648
5649 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
5650 no longer used.
5651
56522002-11-02 Paul Eggert <eggert@twinsun.com>
5653
5654 * src/reader.c: Don't include quote.h; not needed.
5655 (get_merge_function): Reword warning to be consistent with
5656 type clash diagnostic in grammar_current_rule_check.
5657
5658 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
5659 bug in trigraph handling.
5660
5661 * src/output.c (prepare_symbols): When printing token names,
5662 escape "[" as "@<:@" and likewise for "]".
5663
5664 * src/system.h (errno): Remove declaration, as we are now
5665 assuming C89 or better, and C89 guarantees errno.
5666
762b212b
PE
56672002-10-30 Paul Eggert <eggert@twinsun.com>
5668
5669 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
5670 Check for close failures.
5671 * src/files.h (xfclose): Return void, not int, since it always
5672 returned zero.
5673 * src/files.c (xfclose): Likewise. Report I/O error if ferror
5674 indicates one.
5675 * src/output.c (output_skeleton): Use xfclose rather than fclose
5676 and ferror. xfclose now checks ferror.
5677
5678 * data/glr.c (YYLEFTMOST_STATE): Remove.
5679 (yyreportTree): Use a stack-based leftmost state. This avoids
5680 our continuing battles with bogus warnings about initializers.
5681
56100c60
AD
56822002-10-30 Akim Demaille <akim@epita.fr>
5683
5684 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
5685 #if.
5686
51b4a04c
PH
56872002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5688
5689 * tests/glr-regr1.at: New test for reported regressions.
5690 * tests/testsuite.at: Add glr-regr1.at test.
5691 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 5692
bf1ebda2
PE
56932002-10-24 Paul Eggert <eggert@twinsun.com>
5694
5c16c6b1
PE
5695 Version 1.75a.
5696
bf1ebda2
PE
5697 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
5698 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
5699 we use malloc. Don't assume 'A' through 'Z' are contiguous.
5700 Don't assume strdup exists; POSIX says its an XSI extension.
5701 Check for buffer overflow on input.
5702
b526ee61
AD
57032002-10-24 Akim Demaille <akim@epita.fr>
5704
5705 * src/output.c (output_skeleton): Don't disable M4sugar comments
5706 too soon: it results in comments being expanded.
5707 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
5708 first output.
5709
f1886bb2
AD
57102002-10-24 Akim Demaille <akim@epita.fr>
5711
5712 * data/yacc.c (m4_int_type): New.
5713 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
5714 char' as only yacc.c wants K&R portability.
5715 * data/glr.c (yysigned_char): Remove.
5716 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
5717 Reported by Quoc Peyrot.
5718
c5576256
PE
57192002-10-23 Paul Eggert <eggert@twinsun.com>
5720
5721 * src/main.c (main): With --trace=time, report times even if a
5722 non-fatal error occurs. Formerly, the times were reported in some
5723 such cases but not in others.
5724 * src/reader.c (reader): Just return if a complaint has been issued,
5725 instead of exiting, so that 'main' can report times.
5726
27b0ffea
AD
57272002-10-22 Akim Demaille <akim@epita.fr>
5728
5729 * src/system.h: Include sys/types.
5730 Reported by Bert Deknuydt.
5731
223a7883
PE
57322002-10-23 Paul Eggert <eggert@twinsun.com>
5733
5734 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
5735 Suggested by Art Haas.
5736
57372002-10-22 Paul Eggert <eggert@twinsun.com>
5738
5739 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
5740 decl; not needed any more.
5741 * src/main.c (main): Use return to exit, undoing yesterday's change.
5742 The last OS that we could find where this wouldn't work is
5743 SunOS 3.5, and that's too old to worry about now.
5744
5745 * data/glr.c (struct yyltype): Define members even when not
5746 doing locations. This is more consistent with yacc.c, and it
5747 works around the following bug reports:
161a71f3
PE
5748 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
5749 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 5750
223a7883
PE
5751 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
5752 @acronym consistently. Standardize on "Yacc" instead of "YACC",
5753 "Algol" instead of "ALGOL". Give a bit more history about BNF.
5754
8b76775a
AD
57552002-10-22 Akim Demaille <akim@epita.fr>
5756
5757 * data/README: New.
5758
6db10d14
PE
57592002-10-21 Paul Eggert <eggert@twinsun.com>
5760
5761 Be consistent about 'bool'; the old code used an enum in one
5762 module and an int in another, and this violates the C standard.
5763 * m4/stdbool.m4: New file, from coreutils 4.5.3.
5764 * configure.ac (AC_HEADER_STDBOOL): Add.
5765 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
5766 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
5767 * src/symtab.c (hash_compare_symbol_t): Likewise.
5768 * src/system.h (bool, false, true): Use a definition consistent
5769 with ../lib/hash.c. All uses changed.
5770
5771 * src/complain.c (warning_issued): Renamed from warn_message_count,
5772 so that we needn't worry about integer overflow (!).
5773 Now of type bool. All uses changed.
5774 (complaint_issued): Renamed from complain_message_count; likewise.
5775
5776 * src/main.c (main): Use exit to exit with failure.
27b0ffea 5777
6db10d14
PE
5778 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
5779 rather than 1 and 0.
5780 * src/main.c (main): Likewise.
5781 * src/getargs.c (getargs): Likewise.
5782 * src/reader.c (reader): Likewise.
5783
5784 * src/getarg.c (getargs): Remove duplicate code for
5785 "Try `bison --help'".
5786
5787 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
5788 What was that "2" for?
5789
5790 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
5791 * src/getargs.c (usage): Likewise.
5792
5793 * src/getargs.c (getargs): When there are too few operands, report
5794 the last one. When there are too many, report the first extra
5795 one. This is how diffutils does it.
5796
92a060fd
PE
57972002-10-20 Paul Eggert <eggert@twinsun.com>
5798
5799 Remove K&R vestiges.
5800 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
5801 * src/complain.c (VA_START): Remove. Assume prototypes.
5802 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
5803 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
5804 fatal): Assume prototypes.
5805 * src/complain.h: Assume prototypes.
5806 * src/system.h (PARAMS): Remove.
5807 Include <limits.h> unconditionally, since it's guaranteeed even
5808 for a freestanding C89 compiler.
5809 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
5810 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 5811
e7cb57c0
AD
58122002-10-20 Akim Demaille <akim@epita.fr>
5813
5814 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
5815 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
5816 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
5817 (yyresolveStates, yyresolveAction, yyresolveStack)
5818 (yyprocessOneStack): Use them.
5819 (yy_reduce_print): New.
5820 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
5821
0245f82d
AD
58222002-10-20 Akim Demaille <akim@epita.fr>
5823
5824 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
5825 arguments and output `void'.
5826 (b4_c_function): Rename as...
5827 (b4_c_function_def): this.
5828 (b4_c_function_decl, b4_c_ansi_function_def)
5829 (b4_c_ansi_function_decl): New.
5830 Change the interpretation of the arguments: before `int, foo', now
5831 `int foo, foo'.
5832 * data/yacc.c (yyparse): Prototype and define thanks to these.
5833 Adjust b4_c_function_def uses.
5834 * data/glr.c (yyparse): Likewise, but ANSI only.
5835
39912f52
AD
58362002-10-20 Akim Demaille <akim@epita.fr>
5837
5838 * src/output.c (prepare): Move the definition of `tokens_number',
5839 `nterms_number', `undef_token_number', `user_token_number_max'
5840 to...
5841 (prepare_tokens): Here.
5842 (prepare_tokens): Rename as...
5843 (prepare_symbols): this.
5844 (prepare): Move the definition of `rules_number' to...
5845 (prepare_rules): here.
5846 (prepare): Move the definition of `last', `final_state_number',
5847 `states_number' to...
5848 (prepare_states): here.
5849 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
5850
20c1e2ad
AD
58512002-10-20 Akim Demaille <akim@epita.fr>
5852
5853 * src/tables.h, src/tables.c, src/output.c: Comment changes.
5854
21964f43
AD
58552002-10-20 Akim Demaille <akim@epita.fr>
5856
5857 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
5858 * data/c.m4: here.
5859
66d30cd4
AD
58602002-10-20 Akim Demaille <akim@epita.fr>
5861
5862 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
5863 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
5864 `pair'.
5865 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
5866 `name' to...
5867 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
5868 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
5869 These.
5870
95f2c9fe
PE
58712002-10-19 Paul Eggert <eggert@twinsun.com>
5872
5873 Do not create a temporary file, as that involves security and
5874 cleanup headaches. Instead, use a pair of pipes.
5875 Derived from a suggestion by Florian Krohm.
5876 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
5877 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
5878 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
5879 (BISON_PREREQ_SUBPIPE): Add.
5880 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
5881 Add subpipe.h, subpipe.c.
5882 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
5883 * po/POTFILES.in: Add lib/subpipe.c.
5884 * src/output.c: Include "subpipe.h".
5885 (m4_invoke): Remove decl.
5886 (scan_skel): New decl.
5887 (output_skeleton): Use pipe rather than temporary file for m4 input.
5888 Check that m4sugar.m4 is readable, to avoid deadlock.
5889 Check for pipe I/O error.
5890 * src/scan-skel.l (readpipe): Remove decl.
5891 (scan_skel): New function, to be used in place of m4_invoke.
5892 Read from stream rather than file.
66d30cd4 5893
95f2c9fe
PE
5894 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
5895 float, as this generates a warning on Solaris 8 + GCC 3.2 with
5896 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
5897 this generates a more-accurate value anyway.
5898
5899 * lib/timevar.c (timervar_accumulate): Rename locals to
5900 avoid confusion with similarly-named more-global.
5901 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
5902
5903 * src/output.c (prepare): Use xstrdup to convert char const *
5904 to char *, to avoid GCC warning.
5905
c19988b7
AD
59062002-10-19 Akim Demaille <akim@epita.fr>
5907
5908 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
5909 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
5910 Use them to have `calc.y' ready for %pure-parser.
5911 * data/yacc.c (YYLEX): Pass a yylex return type to
5912 b4_c_function_call.
5913
ae7453f2
AD
59142002-10-19 Akim Demaille <akim@epita.fr>
5915
5916 Prototype support of %lex-param and %parse-param.
5917
5918 * src/parse-gram.y: Add the definition of the %lex-param and
5919 %parse-param tokens, plus their rules.
5920 Drop the `_' version of %glr-parser.
5921 Add the "," token.
5922 * src/scan-gram.l (INITIAL): Scan them.
5923 * src/muscle_tab.c: Comment changes.
5924 (muscle_insert, muscle_find): Rename `pair' as `probe'.
5925 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
5926 (muscle_entry_s): The `value' member is no longer const.
5927 Adjust all dependencies.
5928 * src/muscle_tab.c (muscle_init): Adjust: use
5929 MUSCLE_INSERT_STRING.
5930 Initialize the obstack earlier.
5931 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
5932 (muscle_pair_list_grow): New.
5933 * data/c.m4 (b4_c_function_call, b4_c_args): New.
5934 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
5935 * tests/calc.at: Use %locations, not --locations.
5936 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
5937
0e575721
AD
59382002-10-19 Akim Demaille <akim@epita.fr>
5939
5940 * src/getargs.c (usage): Take status as argument and exit
5941 accordingly.
5942 Report the traditional `Try ... --help' message when status != 0.
5943 (usage, version): Don't take a FILE * as arg, it is pointless.
5944 (getargs): When there is an incorrect number of arguments, make it
5945 an error, and report it GNUlically thanks to `usage ()'.
5946
724ce7f5
PE
59472002-10-18 Paul Eggert <eggert@twinsun.com>
5948
3a781eb2
PE
5949 * data/glr.c (yyreportParseError): Don't assume that sprintf
5950 yields the length of the printed string, as this is not true
5951 on SunOS 4.1.4. Reported by Peter Klein.
5952
724ce7f5
PE
5953 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
5954 * tests/conflicts.at (%nonassoc and eof): Likewise.
5955 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
5956
473d0a75
AD
59572002-10-17 Akim Demaille <akim@epita.fr>
5958
5959 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
5960 * src/getargs.c (trace_types, trace_args): Adjust.
5961 * src/reader.c (grammar_current_rule_prec_set)
5962 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
5963 Standardize error messages.
5964 And s/@prec/%prec/!
5965 (reader): Use trace_flag to enable scanner/parser debugging,
5966 instead of an adhoc scheme.
5967 * src/scan-gram.l: Remove trailing debugging code.
5968
e76d2469
PE
59692002-10-16 Paul Eggert <eggert@twinsun.com>
5970
93e2236a
PE
5971 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
5972 MUSCLE_TAB_H.
5973
e76d2469
PE
5974 * NEWS: Officially drop support for building Bison with K&R C,
5975 since it didn't work anyway and it's not worth worrying about.
5976 * Makefile.maint (wget_files): Remove ansi2knr.c.
5977 (ansi2knr.c-url_prefix): Remove.
5978 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
5979 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5980 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5981
5bd1c419
PE
59822002-10-15 Paul Eggert <eggert@twinsun.com>
5983
5984 Stop using the "enum_" trick for K&R-style function definitions;
5985 it confused me, and I was the author! Instead, assume that people
5986 who want to use K&R C compilers (when using these modules in GCC,
5987 perhaps?) will run ansi2knr.
5988
5989 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
5990 All uses of "enum_" changed to "enum ".
5991 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
5992 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 5993
5bd1c419
PE
5994 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
5995 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
5996 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
5997 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
5998 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
5999 abitset_not, abitset_ones, abitset_or, abitset_or_and,
6000 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
6001 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
6002 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
6003 Use function prototypes; this removes the need for declaring
6004 static functions simply to provide their prototypes.
6005 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
6006 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
6007 bitset_count_, bitset_create, bitset_dump, bitset_first,
6008 bitset_free, bitset_init, bitset_last, bitset_next,
6009 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
6010 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
6011 bitset_print, bitset_release_memory, bitset_toggle_,
6012 bitset_type_choose, bitset_type_get, bitset_type_name_get,
6013 debug_bitset): Likewise.
6014 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
6015 * lib/bitset_stats.c (bitset_log_histogram_print,
6016 bitset_percent_histogram_print, bitset_stats_and,
6017 bitset_stats_and_cmp, bitset_stats_and_or,
6018 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
6019 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
6020 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
6021 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
6022 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
6023 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
6024 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
6025 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
6026 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
6027 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
6028 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
6029 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
6030 bitset_stats_zero): Likewise.
6031 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
6032 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
6033 bitsetv_dump, debug_bitsetv): Likewise.
6034 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
6035 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
6036 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
6037 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
6038 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
6039 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
6040 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
6041 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
6042 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
6043 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
6044 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
6045 Likewise.
6046 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
6047 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
6048 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
6049 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
6050 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
6051 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
6052 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
6053 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
6054 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
6055 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
6056 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 6057
ae26e1f0
AD
60582002-10-14 Akim Demaille <akim@epita.fr>
6059
6060 Version 1.75.
6061
d43baf71
AD
60622002-10-14 Akim Demaille <akim@epita.fr>
6063
6064 * tests/Makefile.am (maintainer-check-posix): New.
6065
7ebc83e3
AD
60662002-10-14 Akim Demaille <akim@epita.fr>
6067
6068 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
6069 member.
6070
05846dae
AD
60712002-10-14 Akim Demaille <akim@epita.fr>
6072
6073 * src/tables.c (table_ninf_remap): base -> tab.
6074 Reported by Matt Rosing.
6075
1318e37d
PE
60762002-10-14 Paul Eggert <eggert@twinsun.com>
6077
447fbb17
PE
6078 * tests/action.at, tests/calc.at, tests/conflicts.at,
6079 tests/cxx-type.at, tests/headers.at, tests/input.at,
6080 tests/regression.at, tests/synclines.at, tests/torture.at:
6081 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
6082 so that the tests still work even if POSIXLY_CORRECT is set.
6083 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 6084
1318e37d
PE
6085 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
6086 for portability to K&R hosts. Fix typo: signed char is guaranteed
6087 only to 127, not to 128.
6088 * data/glr.c (yysigned_char): New type.
6089 * data/yacc.c (yysigned_char): Likewise.
6090 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
6091
cc0f0794
PE
60922002-10-13 Paul Eggert <eggert@twinsun.com>
6093
5038f418
PE
6094 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
6095 true due to limited range of data type" warning from GCC.
6096
cc0f0794
PE
6097 * data/c.m4 (b4_token_defines): Protect against double-inclusion
6098 by wrapping enum yytokentype's definition inside #ifndef
6099 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
6100
6fed0802
AD
61012002-10-13 Akim Demaille <akim@epita.fr>
6102
6103 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
6104 Un yy- yyrhs to avoid the name clash with the global YYRHS.
6105
32f0598d
AD
61062002-10-13 Akim Demaille <akim@epita.fr>
6107
6108 * Makefile.maint: Update from Autoconf 2.54.
6109 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
6110
7ea9a33f
AD
61112002-10-13 Akim Demaille <akim@epita.fr>
6112
6113 * src/print.c (print_state): Separate the list of solved conflicts
6114 from the other items.
6115 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
6116
ea99527d
AD
61172002-10-13 Akim Demaille <akim@epita.fr>
6118
6119 Let nondeterministic skeletons be usable with deterministic
6120 tables.
6121
6122 With the patch, GAWK compiled by GCC without -O2 passes its test
6123 suite using a GLR parser driven by LALR tables. It fails with -O2
6124 because `struct stat' gives two different answers on my machine:
6125 88 (definition of an auto var) and later 96 (memset on this var).
6126 Hence the stack is badly corrumpted. The headers inclusion is to
6127 blame: if I move the awk.h inclusion before GLR's system header
6128 inclusion, the two struct stat have the same size.
6129
6130 * src/tables.c (pack_table): Always create conflict_table.
6131 (token_actions): Always create conflict_list.
6132 * data/glr.c (YYFLAG): Remove, unused.
6133
f377f69f
AD
61342002-10-13 Akim Demaille <akim@epita.fr>
6135
6136 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
6137 (O0FLAGS): New.
6138 (VALGRIND, GXX): New.
6139 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
6140 * tests/bison.in: Run $PREBISON a pre-command.
6141 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
6142 (maintainer-check-g++): New.
6143 * Makefile.am (maintainer-check): New.
6144
2a1fe6ed
AD
61452002-10-13 Akim Demaille <akim@epita.fr>
6146
6147 * data/glr.c: Formatting changes.
6148 Tweak some trace messages to match yacc.c's.
6149
f50adbbd
AD
61502002-10-13 Akim Demaille <akim@epita.fr>
6151
6152 GLR parsers sometimes raise parse errors instead of performing the
6153 default reduction.
6154 Reported by Charles-Henry de Boysson.
6155
6156 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 6157 check the length of the traces when %glr.
f50adbbd
AD
6158 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
6159 GLR's traces.
6160 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
6161 Test GLR parsers.
6162 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
6163 (yyltype): Remove the yy prefix from the member names.
6164 (yytable): Complete its comment.
6165 (yygetLRActions): Map error action number from YYTABLE from
6166 YYTABLE_NINF to 0.
6167 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
6168 (which was a bug: it should have been YYTABEL_NINF, and yet it was
6169 not satisfying as we could compare an YYACTION computed from
6170 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
6171 only value for error actions.
6172 (yyreportParseError): In verbose parse error messages, don't issue
6173 `error' in the list of expected tokens.
6174 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
6175 next action to perform to match glr.c's decoding.
6176 (yytable): Complete its comment.
6177
bcbad5b9
PE
61782002-10-13 Paul Eggert <eggert@twinsun.com>
6179
6180 Fix problem reported by Henrik Grubbstroem in
161a71f3 6181 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
6182 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
6183 because the Bison parser reads the second action before reducing
6184 the first one.
6185 * src/scan-gram.l (rule_length): New static var.
6186 Use it to keep track of the rule length in the scanner, since
6187 we can't expect the parser to be in lock-step sync with the scanner.
6188 (handle_action_dollar, handle_action_at): Use this var.
6189 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 6190
14904b89
PE
61912002-10-12 Paul Eggert <eggert@twinsun.com>
6192
1fe611e5
PE
6193 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
6194 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
6195 Include <sys/time.h> when checking for clock_t and struct tms.
6196 Use same include order as source.
6197 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 6198 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 6199
1fe611e5
PE
6200 * lib/timevar.c: Update copyright date and clarify comments.
6201 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 6202
1fe611e5
PE
6203 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
6204 GCC version as of today, then merge Bison's changes.
6205 Change "GCC" to "Bison" in copyright notice. timevar.def's
6206 author is Akim, so change that too.
6207
98194095
PE
6208 * src/reader.c (grammar_current_rule_check):
6209 Don't worry about the default action if $$ is untyped.
6210 Prevents bogus warnings reported by Jim Gifford in
161a71f3 6211 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 6212
14904b89
PE
6213 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
6214 * data/glr.c, data/lalr1.cc, data/yacc.c:
6215 Output token definitions before the first part of user declarations.
6216 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 6217 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 6218
ff6dca18
PE
62192002-10-11 Paul Eggert <eggert@twinsun.com>
6220
6221 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
6222 (yyparse): here. This undoes some of the 2002-07-25 change.
6223 Compatibility problem reported by Ralf S. Engelschall with
6224 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
6225
eb714592
AD
62262002-10-11 Akim Demaille <akim@epita.fr>
6227
6228 * tests/regression.at Characters Escapes): New.
6229 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
6230 characters.
6231 Reported by Jan Nieuwenhuizen.
6232
b7195100
AD
62332002-10-11 Akim Demaille <akim@epita.fr>
6234
6235 * po/id.po: New.
6236
f28a0f2d
PE
62372002-10-10 Paul Eggert <eggert@twinsun.com>
6238
6239 Portability fixes for bitsets; this also avoids several GCC
6240 warnings.
6241
6242 * lib/abitset.c: Include <stddef.h>, for offsetof.
6243 * lib/lbitset.c: Likewise.
6244
6245 * lib/abitset.c (abitset_bytes): Return a size that is aligned
6246 properly for vectors of objects. Do not assume that adding a
6247 header size to a multiple of a word size yields a value that is
6248 properly aligned for the whole union.
6249 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6250
6251 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
6252 unique names for structures.
6253 * lib/ebitset.c (ebitset_bytes): Likewise.
6254 * lib/lbitset.c (lbitset_bytes): Likewise.
6255
6256 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
6257 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
6258 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
6259 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
6260 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
6261 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
6262 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
6263 to improve the type-checking that GCC can do.
6264 * lib/bitset.c (bitset_op4_cmp): Likewise.
6265 * lib/bitset_stats.c (bitset_stats_count,
6266 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
6267 bitset_stats_copy, bitset_stats_disjoint_p,
6268 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
6269 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
6270 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
6271 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
6272 bitset_stats_and_or_cmp, bitset_stats_andn_or,
6273 bitset_stats_andn_or_cmp, bitset_stats_or_and,
6274 bitset_stats_or_and_cmp): Likewise.
6275 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
6276 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
6277 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
6278 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
6279
6280 * lib/abitset.h: Include bitset.h, not bbitset.h.
6281 * lib/ebitset.h: Likewise.
6282 * lib/lbitset.h: Likewise.
6283
6284 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
6285 All instances of parameters of type enum bitset_opts are now of
6286 type enum_bitset_opts, to conform to the C Standard, and similarly
6287 for enum_bitset_type.
6288 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
6289 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
6290
6291 Do not use "struct bitset_struct" to mean different things in
6292 different modules. Not only is this confusing, it violates
6293 the C Standard, which requires that structure types in different
6294 modules must be compatible if one is to be passed to the other.
6295 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
6296 All instances of "struct bitset_struct *" replaced with "bitset".
6297 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
6298 (union bitset_union, struct abitset_struct, struct ebitset_struct,
6299 struct lbitset_struct, struct bitset_stats_struct): New types.
6300 All uses of struct bitset_struct changed to union bitset_union,
6301 etc.
ba0fe3c7 6302 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
6303 struct bitset_struct): Remove.
6304 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
6305 struct bitset_struct): Remove.
6306 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
6307 bitset_struct): Remove.
6308 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
6309 Likewise.
6310
6311 Do not call a function of type T using a call that assumes the
6312 function is of a different type U. Standard C requires that a
6313 function must be called with a type that is compatible with its
6314 definition.
6315 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
6316 New decls.
6317 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
6318 New functions.
6319 * lib/ebitset.c (PFV): Remove.
6320 * lib/lbitset.c (PFV): Likewise.
6321 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
6322 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
6323 decls.
6324 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
6325 (ebitset_vtable): Use them.
6326 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
6327 lbitset_xor): New functions.
6328 (lbitset_vtable): Use them.
6329
6330 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
6331 Declare.
6332
6333 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
6334 GCC warning.
6335 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
6336 Use offsetof, for simplicity.
6337
6fbe4984
PE
63382002-10-06 Paul Eggert <eggert@twinsun.com>
6339
6340 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
6341 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 6342 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
6343 which was inadvertently undone by the 2002-09-30 patch.
6344 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
6345 the same width as int.
6346
420f93c8
PE
63472002-10-04 Paul Eggert <eggert@twinsun.com>
6348
6349 Version 1.50.
6350
6351 * configure.ac (AC_INIT), NEWS: Increment version number.
6352
6353 * doc/bison.texinfo: Minor spelling, grammar, and white space
6354 fixes.
6355 (Symbols): Mention that any negative value returned from yylex
6356 signifies end-of-input. Warn about negative chars. Mention
6357 the portable Standard C character set.
6358
6359 The GNU coding standard says CFLAGS and YFLAGS are reserved
6360 for the installer to set.
6361 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
6362 * src/Makefile.am (AM_CFLAGS): Likewise.
6363 (AM_YFLAGS): Renamed from YFLAGS.
6364
6365 Fix some MAX and MIN problems.
6366 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
6367 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
6368 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
6369 * src/reader.c (reader): Use it.
6370
6371 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
6372 POSIX 1003.1-2001 has removed fgrep.
6373
63742002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
6375
6376 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
6377 interpreted as signed.
6378 * lib/ebitset.c (ebitset_list): Fix bug.
6379
ff68026d
PE
63802002-10-01 Paul Eggert <eggert@twinsun.com>
6381
6382 More fixes for 64-bit hosts and large bitsets.
6383
6384 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
6385 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
6386 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
6387 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
6388 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
6389 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
6390 bitset_count_): Likewise.
6391 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
6392 bitset_first, bitset_last): Likewise.
6393 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
6394 bitset_stats_list_reverse, bitset_stats_size,
6395 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
6396 Likewise.
6397 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6398 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
6399 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
6400 bitsetv_reflexive_transitive_closure): Likewise.
6401 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
6402 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
6403 Likewise.
6404 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
6405 Likewise.
420f93c8 6406
ff68026d
PE
6407 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
6408 Use size_t, not unsigned int, to count bytes.
6409 * lib/abitset.h (abitset_bytes): Likewise.
6410 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
6411 Likewise.
6412 * lib/bitset.h (bitset_bytes): Likewise.
6413 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
6414 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
6415 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6416 * lib/ebitset.c (ebitset_bytes): Likewise.
6417 * lib/ebitset.h (ebitset_bytes): Likewise.
6418 * lib/lbitset.c (lbitset_bytes): Likewise.
6419 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 6420
ff68026d
PE
6421 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
6422 abitset_subset_p, abitset_disjoint_p, abitset_and,
6423 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
6424 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
6425 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
6426 abitset_or_and, abitset_or_and_cmp):
6427 Use bitset_windex instead of unsigned int.
6428 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
6429 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
6430 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
6431 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
6432 Likewise.
6433 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 6434
ff68026d
PE
6435 * lib/bitset.c (bitset_print):
6436 Use proper printf formats for widths of integer types.
6437 * lib/bitset_stats.c (bitset_percent_histogram_print,
6438 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
6439 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6440 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
6441 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 6442
ff68026d
PE
6443 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
6444 BITSET_SIZE_MAX): New macros.
6445 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
6446 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
6447 to BITSET_WINDEX_MAX.
6448
6449 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
6450 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
6451 since we now return the bitset_bindex type (not int).
6452
6453 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
6454 when computing sizes.
6455 * lib/ebitset.c (ebitset_elts_grow): Likewise.
6456
6457 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
6458 and avoid cast to unsigned.
6459
6aa452a6
AD
64602002-09-30 Akim Demaille <akim@epita.fr>
6461
6462 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6463 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
6464 Updates from Michael Hayes.
6465
927f7817
AD
64662002-09-30 Art Haas <ahaas@neosoft.com>
6467
6468 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
6469 invocations.
6470 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
6471 defined.
6472
9738f41e
AD
64732002-09-27 Akim Demaille <akim@epita.fr>
6474
6475 Version 1.49c.
6476
a5c75d7f
AD
64772002-09-27 Akim Demaille <akim@epita.fr>
6478
6479 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
6480 (Because of AC_LIBSOURCE).
6481
8280e179
AD
64822002-09-27 Akim Demaille <akim@epita.fr>
6483
6484 Playing with Autoscan.
6485
6486 * configure.ac: Remove the old LIBOBJ tweaks.
6487 (AC_REPLACE_FUNCS): Add strrchr and strtol.
6488 * lib/strrchr.c: New.
6489 * lib/strtol.c: New, from the Coreutils 4.5.1.
6490
ae64af35
AD
64912002-09-27 Akim Demaille <akim@epita.fr>
6492
6493 Playing with Autoscan.
6494
6495 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
6496 * lib/Makefile.am (libbison_a_SOURCES): No longer include
6497 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
6498 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
6499 Coreutils 4.5.1.
6500
d1a1114f
AD
65012002-09-24 Akim Demaille <akim@epita.fr>
6502
6503 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
6504 (Frequently Asked Questions, Parser Stack Overflow): New.
6505
b906441c
AD
65062002-09-13 Akim Demaille <akim@epita.fr>
6507
6508 Playing with autoscan.
6509
6510 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
6511 * src/files.c (skeleton_find): Remove, unused.
6512 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
6513 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
6514
bd701811
AD
65152002-09-13 Akim Demaille <akim@epita.fr>
6516
6517 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
6518 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
6519
e0a13e7b
AD
65202002-09-13 Akim Demaille <akim@epita.fr>
6521
6522 * configure.ac: Require 2.54.
6523 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
6524 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
6525 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
6526 Remove, provided by Autoconf macros.
6527
c97011bf
AD
65282002-09-12 Akim Demaille <akim@epita.fr>
6529
6530 * m4/prereq.m4: Update, from Coreutils 4.5.1.
6531
d862b1be
AD
65322002-09-12 Akim Demaille <akim@epita.fr>
6533
6534 * m4/prereq.m4: Update, from Fileutils 4.1.5.
6535 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
6536 Reported by Martin Mokrejs.
6537
3d38c03a
AD
65382002-09-10 Akim Demaille <akim@epita.fr>
6539
6540 * src/parse-gram.y: Associate a human readable string to each
6541 token type.
6542 * tests/regression.at (Invalid inputs): Adjust.
6543
b6347355
AD
65442002-09-10 Gary V. Vaughan <gary@gnu.org>
6545
6546 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
6547 with an Autoconf-2.5x style configure.ac.
6548
09ba4ab2
PE
65492002-09-06 Paul Eggert <eggert@twinsun.com>
6550
6551 * doc/bison.texinfo (Conditions): Make explicit that the GPL
6552 exception applies only to yacc.c. This is a modification of a
6553 patch originally suggested by Akim Demaille.
6554
21846f69
AD
65552002-09-06 Akim Demaille <akim@epita.fr>
6556
09ba4ab2
PE
6557 * data/c.m4 (b4_copyright): Move the GPL exception comment from
6558 here to...
6559 * data/yacc.c: here.
6560
21846f69
AD
6561 * data/lalr1.cc (struct yyltype): Don't define it, since we use
6562 LocationType.
6563 (b4_ltype): Default to yy::Location from location.hh.
6564
c0ad8bf3
AD
65652002-09-04 Jim Meyering <jim@meyering.net>
6566
6567 * data/yacc.c: Guard the declaration of yytoknum also with
6568 `#ifdef YYPRINT', so it is declared only when used.
6569
3a93251e
AD
65702002-09-04 Akim Demaille <akim@epita.fr>
6571
6572 * configure.in: Rename as...
6573 * configure.ac: this.
6574 Bump to 1.49c.
6575
427c0dda
AD
65762002-09-04 Akim Demaille <akim@epita.fr>
6577
6578 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
6579 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
6580 translate maintainer only messages.
6581
6a254321
PE
65822002-08-12 Paul Eggert <eggert@twinsun.com>
6583
645e30d1
PE
6584 Version 1.49b.
6585
6a254321
PE
6586 * Makefile.am (SUBDIRS): Remove intl.
6587 (DISTCLEANFILES): Remove.
6588 * NEWS: Mention that GNU M4 is now required. Clarify what is
6589 meant by "larger grammars". Mention the pt_BR translation.
6590 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
6591 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
6592 Bump version from 0.11.2 to 0.11.5.
6593 (BISON_PREREQ_STAGE): Remove.
6594 (AM_GNU_GETTEXT): Use external gettext.
6595 (AC_OUTPUT): Remove intl/Makefile.
6596
6597 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
6598
6599 * data/glr.c: Include string.h, for strlen.
6600 (yyreportParseError): Use size_t for yysize.
6601 (yy_yypstack): No longer nested inside yypstates, as nested
6602 functions are not portable. Do not assume size_t is the
6603 same width as int.
6604 (yypstates): Do not assume that ptrdiff_t is the same width
6605 as int, and similarly for yyposn and YYINDEX.
6606
6607 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
6608
6609 * lib/Makefile.am (INCLUDES): Do not include from the intl
6610 directory, which has been removed.
6611 * src/Makefile.am (INCLUDES): Likewise.
6612
6613 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
6614 (bitsets_sources, additional_bitsets_sources, timevars_sources):
6615 New vars.
6616
6617 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
6618 * tests/Makefile.am (EXTRA_DIST): Likewise.
6619
6620 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
6621 Do not assume that bitset_windex is the same width as unsigned.
6622
6623 * lib/abitset.c (abitset_unused_clear): Do not assume that
6624 bitset_word is the same width as int.
6625 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
6626 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
6627 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
6628 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
6629 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
6630
6631 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
6632 portability to one's complement hosts!).
6633 * lib/ebitset.c (ebitset_op1): Likewise.
6634 * lib/lbitset.c (lbitset_op1): Likewise.
6635
6636 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
6637 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
6638 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
6639 Sync with fileutils.
6640 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
6641 lib/gettext.h: Sync with diffutils.
6642
6643 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
6644 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
6645
6646 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
6647 PROTOTYPES to check for prototypes, and "defined __STDC__" to
6648 check for void *.
6649
6650 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
6651 size_t; the old version tried to do this but casted improperly.
6652 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
6653 (bitset_test): Now returns int, not unsigned long.
6654
6655 * lib/bitset_stats.c: Include "gettext.h".
6656 (_): New macro.
6657 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
6658 name locals "index", as it generates unnecessary warnings on some
6659 hosts that have an "index" function.
6660
6661 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
6662 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
6663 they need translation.
6664 * src/LR0.c (state_list_append, new_itemsets, get_state,
6665 append_states, generate_states): Likewise.
6666 * src/assoc.c (assoc_to_string): Likewise.
6667 * src/closure.c (print_closure, set_firsts, closure): Likewise.
6668 * src/gram.c (grammar_dump): Likewise.
6669 * src/injections.c (injections_compute): Likewise.
6670 * src/lalr.c (lookaheads_print): Likewise.
6671 * src/relation.c (relation_transpose): Likewise.
6672 * src/scan-gram.l: Likewise.
6673 * src/tables.c (table_grow, pack_vector): Likewise.
6674
6675 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
6676 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
6677 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
6678 * m4/mbstate_t.m4: Sync with fileutils.
6679 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
6680
6681 * po/LINGUAS: Add pt_BR.
6682 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
6683 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
6684 lib/timevar.c.
6685 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
6686 manual recommends.
6687 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
6688
6689 * src/complain.c (strerror_r): Remove decl; not needed.
6690 (strerror): Use same pattern as ../lib/error.c.
6691
6692 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
6693
6694 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
6695
6696 * src/main.c (main): Cast result of bindtextdomain and textdomain
6697 to void, to avoid a GCC warning when --disable-nls is in effect.
6698
6699 * src/scan-gram.l: Use strings rather than escapes when possible,
6700 to minimize the number of warnings from xgettext.
6701 (handle_action_dollar, handle_action_at): Don't use isdigit,
6702 as it mishandles negative chars and it may not work as expected
6703 outside the C locale.
6704
6705 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
6706 this is a GCC extension and is not portable to other compilers.
6707
6708 * src/system.h (alloca): Use same pattern as ../lib/error.c.
6709 Do not include <ctype.h>; no longer needed.
6710 Do not include <malloc.h>; no longer needed (and generates
6711 warnings on OpenBSD 3.0).
6712
6713 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
6714 it's not portable.
6715
6716 * tests/regression.at: Do not use 'cc -c input.c -o input';
6717 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
6718
6719 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
6720 exit status as failure, not just exit status 1. Sun C exits
6721 with status 2 sometimes.
6722
6723 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
6724 Use it for the two large tests.
6725
c8f002c7
AD
67262002-08-02 Akim Demaille <akim@epita.fr>
6727
6728 * src/conflicts.c (conflicts_output): Don't output rules never
6729 reduced here, since anyway that computation doesn't work.
6730 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
6731 (rule_useless_p, rule_never_reduced_p): New.
6732 (grammar_rules_partial_print): Use a filter instead of a range.
6733 Display the title only if needed.
6734 (grammar_rules_print): Adjust.
6735 (grammar_rules_never_reduced_report): New.
6736 * src/tables.c (action_row): Move the computation of rules never
6737 reduced to...
6738 (token_actions): here.
6739 * src/main.c (main): Make the parser before making the report, so
6740 that rules never reduced are computed.
6741 Call grammar_rules_never_reduced_report.
6742 * src/print.c (print_results): Report rules never reduced.
6743 * tests/conflicts.at, tests/reduce.at: Adjust.
6744
cd08e51e
AD
67452002-08-01 Akim Demaille <akim@epita.fr>
6746
6747 Instead of attaching lookaheads and duplicating the rules being
6748 reduced by a state, attach the lookaheads to the reductions.
6749
6750 * src/state.h (state_t): Remove the `lookaheads',
6751 `lookaheads_rule' member.
6752 (reductions_t): Add a `lookaheads' member.
6753 Use a regular array for the `rules'.
6754 * src/state.c (reductions_new): Initialize the lookaheads member
6755 to 0.
6756 (state_rule_lookaheads_print): Adjust.
6757 * src/state.h, src/state.c (state_reductions_find): New.
6758 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
6759 (count_rr_conflicts): Adjust.
6760 * src/lalr.c (LArule): Remove.
6761 (add_lookback_edge): Adjust.
6762 (state_lookaheads_count): New.
6763 (states_lookaheads_initialize): Merge into...
6764 (initialize_LA): this.
6765 (lalr_free): Adjust.
6766 * src/main.c (main): Don't free nullable and derives too early: it
6767 is used by --verbose.
6768 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
6769
bb0027a9
AD
67702002-08-01 Akim Demaille <akim@epita.fr>
6771
6772 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
6773 `rule_number_t**'.
6774 (set_derives, free_derives): Rename as...
6775 (derives_compute, derives_free): this.
6776 Adjust all dependencies.
6777 * src/nullable.c (set_nullable, free_nullable): Rename as...
6778 (nullable_compute, nullable_free): these.
6779 (rule_list_t): Store rule_t *, not rule_number_t.
6780 * src/state.c (state_rule_lookaheads_print): Directly compare rule
6781 pointers, instead of their numbers.
6782 * src/main.c (main): Call nullable_free, and derives_free earlier,
6783 as they were lo longer used.
6784
3325ddc4
AD
67852002-08-01 Akim Demaille <akim@epita.fr>
6786
6787 * lib/timevar.c (get_time): Include children time.
6788 * src/lalr.h (LA, LArule): Don't export them: used with the
6789 state_t.
6790 * src/lalr.c (LA, LArule): Static.
6791 * src/lalr.h, src/lalr.c (lalr_free): New.
6792 * src/main.c (main): Call it.
6793 * src/tables.c (pack_vector): Check whether loc is >= to the
6794 table_size, not >.
6795 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
6796 (tables_generate): do it, since that's also it which allocates
6797 them.
6798 Don't free LA and LArule, main does.
6799
c6f1a33c
AD
68002002-07-31 Akim Demaille <akim@epita.fr>
6801
6802 Separate parser tables computation and output.
6803
6804 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
6805 (conflict_list, conflict_list_cnt, table, check, table_ninf)
6806 (yydefgoto, yydefact, high): Move to...
6807 * src/tables.h, src/tables.c: here.
6808 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
6809 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
6810 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
6811 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
6812 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
6813 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
6814 (action_row, save_row, token_actions, save_column, default_goto)
6815 (goto_actions, sort_actions, matching_state, pack_vector)
6816 (table_ninf_remap, pack_table, prepare_actions): Move to...
6817 * src/tables.c: here.
6818 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
6819 * src/output.c (token_actions, output_base, output_conflicts)
6820 (output_check): Merge into...
6821 (prepare_actions): this.
6822 (actions_output): Rename as...
6823 (user_actions_output): this.
6824 * src/main.c (main): Call tables_generate and tables_free.
6825
1509d42f
AD
68262002-07-31 Akim Demaille <akim@epita.fr>
6827
6828 Steal GCC's --time-report support.
6829
6830 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
6831 stolen/adjusted from GCC.
6832 * m4/stage.m4: Remove time related checks.
6833 * m4/timevar.m4: New.
6834 * configure.in: Adjust.
6835 * src/system.h: Adjust to using timevar.h.
6836 * src/getargs.h, src/getargs.c: Support trace_time for
6837 --trace=time.
6838 * src/main.c (stage): Remove.
6839 (main): Replace `stage' invocations with timevar calls.
6840 * src/output.c: Insert pertinent timevar calls.
6841
273a74fa
AD
68422002-07-31 Akim Demaille <akim@epita.fr>
6843
6844 Let --trace have arguments.
6845
6846 * src/getargs.h (enum trace_e): New.
6847 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
6848 (long_options, short_options): --trace/-T takes an optional
6849 argument.
6850 Change all the uses of trace_flag to reflect the new flags.
6851 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
6852
6853 Strengthen `stage' portability.
6854
6855 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
6856 * configure.in: Use it.
6857 Don't check for malloc.h and sys/times.h.
6858 * src/system.h: Include them when appropriate.
6859 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
6860 times and struct tms are available.
6861
217598da
AD
68622002-07-30 Akim Demaille <akim@epita.fr>
6863
6864 In verbose parse error message, don't report `error' as an
6865 expected token.
6866 * tests/actions.at (Printers and Destructors): Adjust.
6867 * tests/calc.at (Calculator $1): Adjust.
6868 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
6869 error message, do not report the parser accepts the error token in
6870 that state.
6871
52489d44
AD
68722002-07-30 Akim Demaille <akim@epita.fr>
6873
6874 Normalize conflict related messages.
6875
6876 * src/complain.h, src/complain.c (warn, complain): New.
6877 * src/conflicts.c (conflicts_print): Use them.
6878 (conflict_report_yacc): New, extracted from...
6879 (conflicts_print): here.
6880 * tests/conflicts.at, tests/existing.at: Adjust.
6881
e8832397
AD
68822002-07-30 Akim Demaille <akim@epita.fr>
6883
6884 Report rules which are never reduced by the parser: those hidden
6885 by conflicts.
6886
6887 * src/LR0.c (save_reductions): Don't make the final state too
6888 different: save its reduction (accept) instead of having a state
6889 without any action (no shift or goto, no reduce).
6890 Note: the final state is now a ``regular'' state, i.e., the
6891 parsers now contain `reduce 0' as default reduction.
6892 Nevertheless, since they decide to `accept' when yystate =
6893 final_state, they still will not reduce rule 0.
6894 * src/print.c (print_actions, print_reduction): Adjust.
6895 * src/output.c (action_row): Track reduced rules.
6896 (token_actions): Report rules never reduced.
6897 * tests/conflicts.at, tests/regression.at: Adjust.
6898
caf23d24
AD
68992002-07-30 Akim Demaille <akim@epita.fr>
6900
6901 `stage' was accidently included in a previous patch.
6902 Initiate its autoconfiscation.
6903
6904 * configure.in: Look for malloc.h and sys/times.h.
6905 * src/main.c (stage): Adjust.
6906 Report only when trace_flag.
6907
640748ee
AD
69082002-07-29 Akim Demaille <akim@epita.fr>
6909
6910 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
6911 state_number_t.
6912 (errs_t): symbol_t*, not symbol_number_t.
6913 (reductions_t): rule_t*, not rule_number_t.
6914 (FOR_EACH_SHIFT): New.
6915 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
6916 * src/print.c, src/print_graph.c: Adjust.
6917
88bce5a2
AD
69182002-07-29 Akim Demaille <akim@epita.fr>
6919
6920 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
6921
6922 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
6923 (endtoken, accept): these.
6924 * src/reader.c (reader): Set endtoken's default tag to "$end".
6925 Set undeftoken's tag to "$undefined" instead of "$undefined.".
6926 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
6927 Adjust.
6928
1bfb97db
AD
69292002-07-29 Akim Demaille <akim@epita.fr>
6930
6931 * src/reduce.c (reduce_grammar): When the language is empty,
6932 complain about the start symbol, not the axiom.
6933 Use its location.
6934 * tests/reduce.at (Empty Language): New.
6935
fc5734fe
AD
69362002-07-26 Akim Demaille <akim@epita.fr>
6937
6938 * src/reader.h, src/reader.c (gram_error): ... can't get
6939 yycontrol without making too strong assumptions on the parser
6940 itself.
6941 * src/output.c (prepare_tokens): Use the real 0th value of
6942 token_translations instead of `0'.
6943 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
6944 visible here.
6945 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
6946 for the time being: %locations ought to provide it to yyerror.
6947
3650b4b8
AD
69482002-07-25 Akim Demaille <akim@epita.fr>
6949
6950 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
6951 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
6952 * tests/regression.at (Web2c Actions): Adjust.
6953
4b3d3a8e
AD
69542002-07-25 Akim Demaille <akim@epita.fr>
6955
6956 Stop storing rules from 1 to nrules + 1.
6957
6958 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
6959 * src/nullable.c, src/output.c, src/print.c, src/reader.c
6960 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
6961 Iterate from 0 to nrules.
6962 Use rule_number_as_item_number and item_number_as_rule_number.
6963 Adjust to `derive' now containing possibly 0.
6964 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
6965 Handle the `- 1' part in rule numbers from/to item numbers.
6966 * src/conflicts.c (log_resolution): Fix the message which reversed
6967 shift and reduce.
6968 * src/output.c (action_row): Initialize default_rule to -1.
6969 (token_actions): Adjust.
6970 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
6971 expected output.
6972 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
6973
4a2a22f4
AD
69742002-07-25 Akim Demaille <akim@epita.fr>
6975
6976 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
6977 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
6978 (b4_c_knr_arg_decl): New.
6979 * data/yacc.c: Use it to define yysymprint, yydestruct, and
6980 yyreport_parse_error.
6981
b8df3223
AD
69822002-07-25 Akim Demaille <akim@epita.fr>
6983
6984 * data/yacc.c (yyreport_parse_error): New, extracted from...
6985 (yyparse): here.
6986 (yydestruct, yysymprint): Move above yyparse.
6987 Be K&R compliant.
6988
a762e609
AD
69892002-07-25 Akim Demaille <akim@epita.fr>
6990
6991 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
6992 replace...
6993 (b4_sint_type, b4_uint_type): these.
6994 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
6995 * tests/regression.at (Web2c Actions): Adjust.
6996
12b0043a
AD
69972002-07-25 Akim Demaille <akim@epita.fr>
6998
6999 * src/gram.h (TIEM_NUMBER_MAX): New.
7000 (item_number_of_rule_number, rule_number_of_item_number): Rename
7001 as...
7002 (rule_number_as_item_number, item_number_as_rule_number): these.
7003 Adjust dependencies.
7004 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
7005 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
7006 (symbol_number_to_vector_number): New.
7007 (order): Of vector_number_t* type.
7008 (base_t, BASE_MAX, BASE_MIN): New.
7009 (froms, tos, width, pos, check): Of base_t type.
7010 (action_number_t, ACTION_MIN, ACTION_MAX): New.
7011 (actrow): Of action_number_t type.
7012 (conflrow): Of unsigned int type.
7013 (table_ninf, base_ninf): New.
7014 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
7015 (muscle_insert_int_table, muscle_insert_base_table)
7016 (muscle_insert_rule_number_table): New.
7017 (prepare_tokens): Output `toknum' as int_table.
7018 (action_row): Returns a rule_number_t.
7019 Use ACTION_MIN, not SHRT_MIN.
7020 (token_actions): yydefact is rule_number_t*.
7021 (table_ninf_remap): New.
7022 (pack_table): Use it for `base' and `table'.
7023 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
7024 replaced with...
7025 (YYPACT_NINF, YYTABLE_NINF): these.
7026 (yypact, yytable): Compute their types instead of hard-coded
7027 `short'.
7028 * tests/regression.at (Web2c Actions): Adjust.
7029
5dde258a
AD
70302002-07-19 Akim Demaille <akim@epita.fr>
7031
7032 * src/scan-gram.l (id): Can start with an underscore.
7033
a945ec39
AD
70342002-07-16 Akim Demaille <akim@epita.fr>
7035
7036 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
7037 Adjust all former `associativity' dependencies.
7038 * src/symtab.c (symbol_new): Default associativity is `undef', not
7039 `right'.
7040 (symbol_check_alias_consistence): Adjust.
7041
fae437e8
AD
70422002-07-09 Akim Demaille <akim@epita.fr>
7043
7044 * doc/bison.texinfo: Properly set the ``header'' part.
7045 Use @dircategory ``GNU programming tools'' as per Texinfo's
7046 documentation.
7047 Use @copying.
7048
1a715ef2
AD
70492002-07-09 Akim Demaille <akim@epita.fr>
7050
7051 * lib/quotearg.h: Protect against multiple inclusions.
7052 * src/location.h (location_t): Add a `file' member.
7053 (LOCATION_RESET, LOCATION_PRINT): Adjust.
7054 * src/complain.c (warn_at, complain_at, fatal_at): Drop
7055 `error_one_per_line' support.
7056
a5d50994
AD
70572002-07-09 Akim Demaille <akim@epita.fr>
7058
7059 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
7060 * src/reader.c (lineno): Remove.
7061 Adjust all dependencies.
7062 (get_merge_function): Take a location and use complain_at.
7063 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
7064 * tests/regression.at (Invalid inputs, Mixing %token styles):
7065 Adjust.
7066
b275314e
AD
70672002-07-09 Akim Demaille <akim@epita.fr>
7068
7069 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
7070 recovery rule, and forbid extensions when --yacc.
7071 (gram_error): Use complain_at.
7072 * src/reader.c (reader): Exit if there were parse errors.
7073
865b9df1
AD
70742002-07-09 Akim Demaille <akim@epita.fr>
7075
7076 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
7077 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
7078 Reported by R Blake <blakers@mac.com>.
7079
c76e14da
AD
70802002-07-09 Akim Demaille <akim@epita.fr>
7081
7082 * data/yacc.c: Output the copyright notive in the header.
7083
7db2ed2d
AD
70842002-07-03 Akim Demaille <akim@epita.fr>
7085
7086 * src/output.c (froms, tos): Are state_number_t.
7087 (save_column): sp, sp1, and sp2 are state_number_t.
7088 (prepare): Rename `final' as `final_state_number', `nnts' as
7089 `nterms_number', `nrules' as `rules_number', `nstates' as
7090 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
7091 unused.
7092 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
7093 * data/lalr1.cc (nsym_): Remove, unused.
7094
e68e0410
AD
70952002-07-03 Akim Demaille <akim@epita.fr>
7096
7097 * src/lalr.h, src/lalr.c (goto_number_t): New.
7098 * src/lalr.c (goto_list_t): New.
7099 Propagate them.
7100 * src/nullable.c (rule_list_t): New.
7101 Propagate.
7102 * src/types.h: Remove.
7103
e1a4f3a4
AD
71042002-07-03 Akim Demaille <akim@epita.fr>
7105
7106 * src/closure.c (print_fderives): Use rule_rhs_print.
7107 * src/derives.c (print_derives): Use rule_rhs_print.
7108 (rule_list_t): New, replaces `shorts'.
7109 (set_derives): Add comments.
7110 * tests/sets.at (Nullable, Firsts): Adjust.
7111
536545f3
AD
71122002-07-03 Akim Demaille <akim@epita.fr>
7113
7114 * src/output.c (prepare_actions): Free `tally' and `width'.
7115 (prepare_actions): Allocate and free `order'.
7116 * src/symtab.c (symbols_free): Free `symbols'.
7117 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
7118 * src/output.c (m4_invoke): Move to...
7119 * src/scan-skel.l: here.
7120 (<<EOF>>): Close yyout, and free its name.
7121
8b752b00
AD
71222002-07-03 Akim Demaille <akim@epita.fr>
7123
7124 Fix some memory leaks, and fix a bug: state 0 was examined twice.
7125
7126 * src/LR0.c (new_state): Merge into...
7127 (state_list_append): this.
7128 (new_states): Merge into...
7129 (generate_states): here.
7130 (set_states): Don't ensure a proper `errs' state member here, do it...
7131 * src/conflicts.c (conflicts_solve): here.
7132 * src/state.h, src/state.c: Comment changes.
7133 (state_t): Rename member `shifts' as `transitions'.
7134 Adjust all dependencies.
7135 (errs_new): For consistency, also take the values as argument.
7136 (errs_dup): Remove.
7137 (state_errs_set): New.
7138 (state_reductions_set, state_transitions_set): Assert that no
7139 previous value was assigned.
7140 (state_free): New.
7141 (states_free): Use it.
7142 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
7143 temporary storage: use `errs' and `nerrs' as elsewhere.
7144 (set_conflicts): Allocate and free this `errs'.
7145
613f5e1a
AD
71462002-07-02 Akim Demaille <akim@epita.fr>
7147
7148 * lib/libiberty.h: New.
7149 * lib: Update the bitset implementation from upstream.
7150 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
7151 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
7152 * src/main.c: Adjust bitset stats calls.
7153
26e0cadc
PE
71542002-07-01 Paul Eggert <eggert@twinsun.com>
7155
7156 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
7157 char, so that negative chars don't collide with $.
7158
1154cced
AD
71592002-06-30 Akim Demaille <akim@epita.fr>
7160
7161 Have the GLR tests be `warning' checked, and fix the warnings.
7162
7163 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
7164 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
7165 (yyremoveDeletes): `yyi' and `yyj' are size_t.
7166 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
7167 (yyaddDeferredAction): static.
7168 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
7169 (yyreportParseError): yyprefix is const.
7170 yytokenp is used only when verbose.
7171 (yy__GNUC__): Replace with __GNUC__.
7172 (yypdumpstack): yyi is size_t.
7173 (yypreference): Un-yy local variables and arguments, to avoid
7174 clashes with `yyr1'. Anyway, we are not in the user name space.
7175 (yytname_size): be an int, as is compared with ints.
7176 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
7177 Use them.
7178 * tests/cxx-gram.at: Use quotation to protect $1.
7179 Use AT_COMPILE to enable warnings hunts.
7180 Prototype yylex and yyerror.
7181 `Use' argc.
7182 Include `string.h', not `strings.h'.
7183 Produce and prototype stmtMerge only when used.
7184 yylex takes a location.
7185
97650f4e
AD
71862002-06-30 Akim Demaille <akim@epita.fr>
7187
7188 We spend a lot of time in quotearg, in particular when --verbose.
7189
7190 * src/symtab.c (symbol_get): Store a quoted version of the key.
7191 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
7192 Adjust all callers.
7193
d2576365
AD
71942002-06-30 Akim Demaille <akim@epita.fr>
7195
7196 * src/state.h (reductions_t): Rename member `nreds' as num.
7197 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
7198 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
7199
ccaf65bc
AD
72002002-06-30 Akim Demaille <akim@epita.fr>
7201
7202 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
7203 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
7204 (shifts_to): Rename as...
7205 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
7206 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
7207 (TRANSITION_IS_DISABLED, transitions_to): these.
7208
87675353
AD
72092002-06-30 Akim Demaille <akim@epita.fr>
7210
7211 * src/print.c (print_shifts, print_gotos): Merge into...
7212 (print_transitions): this.
7213 (print_transitions, print_errs, print_reductions): Align the
7214 lookaheads columns.
7215 (print_core, print_transitions, print_errs, print_state,
7216 print_grammar): Output empty lines separator before, not after.
7217 (state_default_rule_compute): Rename as...
7218 (state_default_rule): this.
7219 * tests/conflicts.at (Defaulted Conflicted Reduction),
7220 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
7221 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
7222
ce4ccb4b
AD
72232002-06-30 Akim Demaille <akim@epita.fr>
7224
7225 Display items as we display rules.
7226
7227 * src/gram.h, src/gram.c (rule_lhs_print): New.
7228 * src/gram.c (grammar_rules_partial_print): Use it.
7229 * src/print.c (print_core): Likewise.
7230 * tests/conflicts.at (Defaulted Conflicted Reduction),
7231 (Unresolved SR Conflicts): Adjust.
7232 (Unresolved SR Conflicts): Adjust and rename as...
7233 (Resolved SR Conflicts): this, as was meant.
7234 * tests/regression.at (Web2c Report): Adjust.
7235
bc933ef1
AD
72362002-06-30 Akim Demaille <akim@epita.fr>
7237
7238 * src/print.c (state_default_rule_compute): New, extracted from...
7239 (print_reductions): here.
7240 Pessimize, but clarify the code.
7241 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
7242
53d4308d
AD
72432002-06-30 Akim Demaille <akim@epita.fr>
7244
7245 * src/output.c (action_row): Let default_rule be always a rule
7246 number.
7247
574fb2d5
AD
72482002-06-30 Akim Demaille <akim@epita.fr>
7249
7250 * src/closure.c (print_firsts, print_fderives, closure):
7251 Use BITSET_EXECUTE.
7252 * src/lalr.c (lookaheads_print): Likewise.
7253 * src/state.c (state_rule_lookaheads_print): Likewise.
7254 * src/print_graph.c (print_core): Likewise.
7255 * src/print.c (print_reductions): Likewise.
7256 * src/output.c (action_row): Likewise.
7257 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
7258
05811fd7
AD
72592002-06-30 Akim Demaille <akim@epita.fr>
7260
7261 * src/print_graph.c: Use report_flag.
7262
0e4d5753
AD
72632002-06-30 Akim Demaille <akim@epita.fr>
7264
7265 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
7266 to...
7267 * src/relation.h, src/relation.c (traverse, relation_digraph)
7268 (relation_print, relation_transpose): New.
7269
24c7d800
AD
72702002-06-30 Akim Demaille <akim@epita.fr>
7271
7272 * src/state.h, src/state.c (shifts_to): New.
7273 * src/lalr.c (build_relations): Use it.
7274
9222837b
AD
72752002-06-30 Akim Demaille <akim@epita.fr>
7276
7277 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
7278 (item_number_of_rule_number, rule_number_of_item_number): New.
7279 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
7280 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
7281 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
7282 Propagate their use.
7283 Much remains to be done, in particular wrt `shorts' from types.h.
7284
260008e5
AD
72852002-06-30 Akim Demaille <akim@epita.fr>
7286
7287 * src/symtab.c (symbol_new): Initialize the `printer' member.
7288
8a731ca8
AD
72892002-06-30 Akim Demaille <akim@epita.fr>
7290
7291 * src/LR0.c (save_reductions): Remove, replaced by...
7292 * src/state.h, src/state.c (state_reductions_set): New.
7293 (reductions, errs): Rename as...
7294 (reductions_t, errs_t): these.
7295 Adjust all dependencies.
7296
32e1e0a4
AD
72972002-06-30 Akim Demaille <akim@epita.fr>
7298
7299 * src/LR0.c (state_list_t, state_list_append): New.
7300 (first_state, last_state): Now symbol_list_t.
7301 (this_state): Remove.
7302 (new_itemsets, append_states, save_reductions): Take a state_t as
7303 argument.
7304 (set_states, generate_states): Adjust.
7305 (save_shifts): Remove, replaced by...
7306 * src/state.h, src/state.c (state_shifts_set): New.
7307 (shifts): Rename as...
7308 (shifts_t): this.
7309 Adjust all dependencies.
7310 * src/state.h (state_t): Remove the `next' member.
7311
e5fb6710
AD
73122002-06-30 Akim Demaille <akim@epita.fr>
7313
7314 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
7315 escaped in slot 0.
7316
c7ca99d4
AD
73172002-06-30 Akim Demaille <akim@epita.fr>
7318
7319 Use hash.h for the state hash table.
7320
7321 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
7322 (allocate_storage): Use state_hash_new.
7323 (free_storage): Use state_hash_free.
7324 (new_state, get_state): Adjust.
7325 * src/lalr.h, src/lalr.c (states): Move to...
7326 * src/states.h (state_t): Remove the `link' member, no longer
7327 used.
7328 * src/states.h, src/states.c: here.
7329 (state_hash_new, state_hash_free, state_hash_lookup)
7330 (state_hash_insert, states_free): New.
7331 * src/states.c (state_table, state_compare, state_hash): New.
7332 * src/output.c (output_actions): Do not free states now, since we
7333 still need to know the final_state number in `prepare', called
7334 afterwards. Do it...
7335 * src/main.c (main): here: call states_free after `output'.
7336
df0e7316
AD
73372002-06-30 Akim Demaille <akim@epita.fr>
7338
7339 * src/state.h, src/state.c (state_new): New, extracted from...
7340 * src/LR0.c (new_state): here.
7341 * src/state.h (STATE_ALLOC): Move to...
7342 * src/state.c: here.
7343 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
7344 * src/state.h, src/state.c: here.
7345
39f41916
AD
73462002-06-30 Akim Demaille <akim@epita.fr>
7347
7348 * src/reader.c (gensym): Rename as...
7349 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
7350 (getsym): Rename as...
7351 (symbol_get): this.
7352
d57650a5
AD
73532002-06-30 Akim Demaille <akim@epita.fr>
7354
7355 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
7356 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
7357 * src/output.c, src/print.c, src/print_graph.c: Propagate.
7358 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
7359
5a08f1ce
AD
73602002-06-30 Akim Demaille <akim@epita.fr>
7361
7362 Make the test suite pass with warnings checked.
7363
7364 * tests/actions.at (Printers and Destructors): Improve.
7365 Avoid unsigned vs. signed issues.
7366 * tests/calc.at: Don't exercise the scanner here, do it...
7367 * tests/input.at (Torturing the Scanner): here.
7368
720623af
PH
73692002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7370
88e7e941 7371 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
7372 reorganize first lines parallel to yacc.c.
7373
fb8135fa
AD
73742002-06-28 Akim Demaille <akim@epita.fr>
7375
7376 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
7377 (b4_token_enum, b4_token_defines): New, factored from...
7378 * data/lalr1.cc, data/yacc.c, glr.c: here.
7379
41442480
AD
73802002-06-28 Akim Demaille <akim@epita.fr>
7381
7382 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
7383 unused variables.
7384 * src/output.c (merger_output): static.
7385
e0e5bf84
AD
73862002-06-28 Akim Demaille <akim@epita.fr>
7387
ba0fe3c7 7388 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
7389 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
7390 pacify GCC.
7391 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 7392
676385e2
PH
73932002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7394
7395 Accumulated changelog for new GLR parsing features.
7396
6a254321 7397 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
7398 conflicts_total_count.
7399 * src/conflicts.h: Ditto.
7400 * src/output.c (token_actions): Use the new name.
7401 (output_conflicts): Change conflp => conflict_list_heads, and
7402 confl => conflict_list for better readability.
7403 * data/glr.c: Use the new names.
7404 * NEWS: Add self to GLR announcement.
e0e5bf84 7405
676385e2
PH
7406 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
7407
7408 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
7409 Akim Demaille.
7410
7411 * data/bison.glr: Change name to glr.c
7412 * data/glr.c: Renamed from bison.glr.
7413 * data/Makefile.am: Add glr.c
e0e5bf84
AD
7414
7415 * src/getargs.c:
7416
676385e2 7417 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 7418 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 7419
676385e2
PH
7420 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7421
7422 * data/bison.glr: Be sure to restore the
7423 current #line when returning to the skeleton contents after having
7424 exposed the input file's #line.
7425
7426 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7427
7428 * data/bison.glr: Bring up to date with changes to bison.simple.
7429
7430 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7431
7432 * data/bison.glr: Correct definitions that use b4_prefix.
7433 Various reformatting.
7434 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
7435 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
7436 yytokenp argument; now part of stack.
7437 (yychar): Define to behave as documented.
7438 (yyclearin): Ditto.
e0e5bf84 7439
676385e2
PH
7440 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7441
7442 * src/reader.h: Add declaration for free_merger_functions.
7443
7444 * src/reader.c (merge_functions): New variable.
7445 (get_merge_function): New function.
7446 (free_merger_functions): New function.
7447 (readgram): Check for %prec that is not followed by a symbol.
7448 Handle %dprec and %merge declarations.
7449 (packgram): Initialize dprec and merger fields in rules array.
7450
7451 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
7452 conflict_list_cnt, conflict_list_free): New variables.
7453 (table_grow): Also grow conflict_table.
e0e5bf84 7454 (prepare_rules): Output dprec and merger tables.
676385e2 7455 (conflict_row): New function.
e0e5bf84 7456 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
7457 default reduction in conflicted states for GLR parser so that there
7458 are spaces for the conflict lists.
7459 (save_row): Also save conflict information.
7460 (token_actions): Allocate conflict list.
7461 (merger_output): New function.
7462 (pack_vector): Pack conflict table, too.
7463 (output_conflicts): New function to output yyconflp and yyconfl.
7464 (output_check): Allocate conflict_tos.
7465 (output_actions): Output conflict tables, also.
7466 (output_skeleton): Output b4_mergers definition.
7467 (prepare): Output b4_max_rhs_length definition.
7468 Use 'bison.glr' as default skeleton for GLR parsers.
7469
7470 * src/gram.c (glr_parser): New flag.
7471 (grammar_free): Call free_merger_functions.
7472
7473 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
7474 all pairs of conflicting reductions, rather than just all tokens
7475 causing conflicts. Needed to size conflict tables.
e0e5bf84 7476 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
7477 interface.
7478 (conflicts_print): Ditto.
7479 (count_total_conflicts): New function.
7480
7481 * src/reader.h (merger_list): New type.
7482 (merge_functions): New variable.
7483
7484 * src/lex.h (tok_dprec, tok_merge): New token types.
7485
7486 * src/gram.h (rule_s): Add dprec and merger fields.
7487 (glr_parser): New flag.
7488
7489 * src/conflicts.h (count_total_conflicts): New function.
7490
7491 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
7492
7493 * doc/bison.texinfo (Generalized LR Parsing): New section.
7494 (GLR Parsers): New section.
7495 (Language and Grammar): Mention GLR parsing.
7496 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
7497 Correct typo ("tge" -> "the").
7498
7499 * data/bison.glr: New skeleton for GLR parsing.
7500
7501 * tests/cxx-gram.at: New tests for GLR parsing.
7502
7503 * tests/testsuite.at: Include cxx-gram.at.
7504
7505 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 7506
676385e2
PH
7507 * src/parse-gram.y:
7508
7509 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
7510
7511 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 7512
b5480d74 75132002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
7514
7515 * src/options.h, src/options.c: Remove.
7516 * src/getargs.c (short_options, long_options): New.
7517
60491a94
AD
75182002-06-27 Akim Demaille <akim@epita.fr>
7519
7520 * data/bison.simple, data/bison.c++: Rename as...
7521 * data/yacc.c, data/lalr1.cc: these.
7522 * doc/bison.texinfo (Environment Variables): Remove.
7523
9be0c25b
AD
75242002-06-25 Raja R Harinath <harinath@cs.umn.edu>
7525
7526 * src/getargs.c (report_argmatch): Initialize strtok().
7527
1ae72863
AD
75282002-06-20 Akim Demaille <akim@epita.fr>
7529
7530 * data/bison.simple (b4_symbol_actions): New, replaces...
7531 (b4_symbol_destructor, b4_symbol_printer): these.
7532 (yysymprint): Be sure to call YYPRINT only for tokens, and using
7533 user token numbers.
7534
87542d29
AD
75352002-06-20 Akim Demaille <akim@epita.fr>
7536
7537 * data/bison.simple (yydestructor): Rename as...
7538 (yydestruct): this.
7539
1a31ed21
AD
75402002-06-20 Akim Demaille <akim@epita.fr>
7541
7542 * src/symtab.h, src/symtab.c (symbol_type_set)
7543 (symbol_destructor_set, symbol_precedence_set): The location is
7544 the last argument.
7545 Adjust all callers.
7546
e776192e
AD
75472002-06-20 Akim Demaille <akim@epita.fr>
7548
7549 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
7550 internals.
7551 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
7552 Takes a location.
7553 * src/symtab.h, src/symtab.c (symbol_class_set)
7554 (symbol_user_token_number_set): Likewise.
7555 Adjust all callers.
7556 Promote complain_at.
7557 * tests/input.at (Type Clashes): Adjust.
7558
5c1180b3
AD
75592002-06-20 Akim Demaille <akim@epita.fr>
7560
7561 * data/bison.simple (YYLEX): Fix the declaration when
7562 %pure-parser.
7563
e3170060
AD
75642002-06-20 Akim Demaille <akim@epita.fr>
7565
7566 * data/bison.simple (yysymprint): Don't print the token number,
7567 just its name.
7568 * tests/actions.at (Destructors): Rename as...
7569 (Printers and Destructors): this.
7570 Also exercise %printer.
7571
253862fd
AD
75722002-06-20 Akim Demaille <akim@epita.fr>
7573
7574 * data/bison.simple (YYDSYMPRINT): New.
7575 Use it to remove many of the #if YYDEBUG/if (yydebug).
7576
366eea36
AD
75772002-06-20 Akim Demaille <akim@epita.fr>
7578
7579 * src/symtab.h, src/symtab.c (symbol_t): printer and
7580 printer_location are new members.
7581 (symbol_printer_set): New.
7582 * src/parse-gram.y (PERCENT_PRINTER): New token.
7583 Handle its associated rule.
7584 * src/scan-gram.l: Adjust.
7585 (handle_destructor_at, handle_destructor_dollar): Rename as...
7586 (handle_symbol_code_at, handle_symbol_code_dollar): these.
7587 * src/output.c (symbol_printers_output): New.
7588 (output_skeleton): Call it.
7589 * data/bison.simple (yysymprint): New. Cannot be named yyprint
7590 since there are already many grammar files with a user `yyprint'.
7591 Replace the calls to YYPRINT to calls to yysymprint.
7592 * tests/calc.at: Adjust.
7593 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
7594 taking advantage of parser very internal details (stack size!).
7595
4f25ebb0
AD
75962002-06-20 Akim Demaille <akim@epita.fr>
7597
7598 * src/scan-gram.l: Complete the scanner with the missing patterns
7599 to pacify Flex.
7600 Use `quote' and `symbol_tag_get' where appropriate.
7601
93b68a0e
AD
76022002-06-19 Akim Demaille <akim@epita.fr>
7603
7604 * tests/actions.at (Destructors): Augment to test locations.
7605 * data/bison.simple (yydestructor): Pass it the current location
7606 if locations are enabled.
7607 Prototype only when __STDC__ or C++.
7608 Change the argument names to move into the yy name space: there is
7609 user code here.
7610
58612f1d
AD
76112002-06-19 Akim Demaille <akim@epita.fr>
7612
74310291
AD
7613 * data/bison.simple (b4_pure_if): New.
7614 Use it instead of #ifdef YYPURE.
7615
76162002-06-19 Akim Demaille <akim@epita.fr>
7617
7618 * data/bison.simple (b4_location_if): New.
58612f1d
AD
7619 Use it instead of #ifdef YYLSP_NEEDED.
7620
f25bfb75
AD
76212002-06-19 Akim Demaille <akim@epita.fr>
7622
7623 Prepare @$ in %destructor, but currently don't bind it in the
7624 skeleton, as %location use is not cleaned up yet.
7625
7626 * src/scan-gram.l (handle_dollar, handle_destructor_at)
7627 (handle_action_at): New.
7628 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
7629 a braced_code_t and a location as additional arguments.
7630 (handle_destructor_dollar): Instead of requiring `b4_eval', just
7631 unquote one when outputting `b4_dollar_dollar'.
7632 Adjust callers.
7633 * data/bison.simple (b4_eval): Remove.
7634 (b4_symbol_destructor): Adjust.
7635 * tests/input.at (Invalid @n): Adjust.
7636
c732d2c6
AD
76372002-06-19 Zack Weinberg <zack@codesourcery.com>
7638
7639 * doc/bison.texinfo: Document ability to have multiple
7640 prologue sections.
7641
8c165d89
AD
76422002-06-18 Akim Demaille <akim@epita.fr>
7643
7644 * src/files.c (compute_base_names): When computing the output file
7645 names from the input file name, strip the directory part.
7646
ca98bf57
AD
76472002-06-18 Akim Demaille <akim@epita.fr>
7648
7649 * data/bison.simple.new: Comment changes.
7650 Reported by Andreas Schwab.
7651
0bfb02ff
AD
76522002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
7653
7654 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
7655 there are no `label `yyoverflowlab' defined but not used' warnings
7656 when yyoverflow is defined.
7657
24c0aad7
AD
76582002-06-18 Akim Demaille <akim@epita.fr>
7659
7660 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
7661 new member.
7662 (symbol_destructor_set): Adjust.
7663 * src/output.c (symbol_destructors_output): Output the destructor
7664 locations.
7665 Output the symbol name.
7666 * data/bison.simple (b4_symbol_destructor): Adjust.
7667
5719c109
AD
76682002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
7669 and Akim Demaille <akim@epita.fr>
7670
7671 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
7672 what's left on the stack when the error recovery hits EOF.
7673 * tests/actions.at (Destructors): Complete to exercise this case.
7674
9280d3ef
AD
76752002-06-17 Akim Demaille <akim@epita.fr>
7676
7677 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
7678 arguments is really empty, not only equal to `[]'.
7679 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
7680 member.
7681 (symbol_destructor_set): New.
7682 * src/output.c (symbol_destructors_output): New.
7683 * src/reader.h (brace_code_t, current_braced_code): New.
7684 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
7685 (handle_dollar): Rename as...
7686 (handle_action_dollar): this.
7687 (handle_destructor_dollar): New.
7688 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
7689 (grammar_declaration): Use it.
7690 * data/bison.simple (yystos): Is always defined.
7691 (yydestructor): New.
7692 * tests/actions.at (Destructors): New.
7693 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
7694
dafdc66f
AD
76952002-06-17 Akim Demaille <akim@epita.fr>
7696
7697 * src/symlist.h, src/symlist.c (symbol_list_length): New.
7698 * src/scan-gram.l (handle_dollar, handle_at): Compute the
7699 rule_length only when needed.
7700 * src/output.c (actions_output, token_definitions_output): Output
7701 the full M4 block.
7702 * src/symtab.c: Don't access directly to the symbol tag, use
7703 symbol_tag_get.
7704 * src/parse-gram.y: Use symbol_list_free.
7705
56c47203
AD
77062002-06-17 Akim Demaille <akim@epita.fr>
7707
7708 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
7709 (symbol_list_prepend, get_type_name): Move to...
7710 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
7711 (symbol_list_prepend, symbol_list_n_type_name_get): here.
7712 Adjust all callers.
7713 (symbol_list_free): New.
7714 * src/scan-gram.l (handle_dollar): Takes a location.
7715 * tests/input.at (Invalid $n): Adjust.
7716
1e0bab92
AD
77172002-06-17 Akim Demaille <akim@epita.fr>
7718
7719 * src/reader.h, src/reader.c (symbol_list_new): Export it.
7720 (symbol_list_prepend): New.
7721 * src/parse-gram.y (%union): `list' is a new member.
7722 (symbols.1): New, replaces...
7723 (terms_to_prec.1, nterms_to_type.1): these.
7724 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
7725 Take a location as additional argument.
7726 Adjust all callers.
7727
04e60654
AD
77282002-06-15 Akim Demaille <akim@epita.fr>
7729
7730 * src/parse-gram.y: Move %token in the declaration section so that
7731 we don't depend upon CVS Bison.
7732
10e5b8bd
AD
77332002-06-15 Akim Demaille <akim@epita.fr>
7734
7735 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
7736 * src/print.c (print_core): Use it.
7737
9801d40c
AD
77382002-06-15 Akim Demaille <akim@epita.fr>
7739
7740 * src/conflicts.c (log_resolution): Accept the rule involved in
7741 the sr conflicts instead of the lookahead number that points to
7742 that rule.
7743 (flush_reduce): Accept the current lookahead vector as argument,
7744 instead of the index in LA.
7745 (resolve_sr_conflict): Accept the current number of lookahead
7746 bitset to consider for the STATE, instead of the index in LA.
7747 (set_conflicts): Adjust.
7748 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
7749
c0263492
AD
77502002-06-15 Akim Demaille <akim@epita.fr>
7751
7752 * src/state.h (state_t): Replace the `lookaheadsp' member, a
7753 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
7754 Adjust all dependencies.
7755 * src/lalr.c (initialize_lookaheads): Split into...
7756 (states_lookaheads_count, states_lookaheads_initialize): these.
7757 (lalr): Adjust.
7758
9757c359
AD
77592002-06-15 Akim Demaille <akim@epita.fr>
7760
7761 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
7762 out of...
7763 (grammar_rules_print): here.
7764 * src/reduce.c (reduce_output): Use it.
7765 * tests/reduce.at (Useless Rules, Reduced Automaton)
7766 (Underivable Rules): Adjust.
7767
6b98e4b5
AD
77682002-06-15 Akim Demaille <akim@epita.fr>
7769
7770 Copy BYacc's nice way to report the grammar.
7771
7772 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
7773 New.
7774 Don't print the rules' location, it is confusing and useless.
7775 (rule_print): Use grammar_rhs_print.
7776 * src/print.c (print_grammar): Use grammar_rules_print.
7777
6b98e4b5
AD
77782002-06-15 Akim Demaille <akim@epita.fr>
7779
7780 Complete and rationalize `useless thing' warnings.
7781
7782 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
7783 (symbol_tag_print): New.
7784 Use them everywhere in place of accessing directly the tag member.
7785 * src/gram.h, src/gram.c (rule_print): New.
7786 Use it where a rule used to be printed `by hand'.
7787 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
7788 (reduce_grammar_tables): Report the useless rules.
7789 (reduce_print): Useless things are a warning, not an error.
7790 Report it as such.
7791 * tests/reduce.at (Useless Nonterminals, Useless Rules):
7792 (Reduced Automaton, Underivable Rules): Adjust.
7793 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
7794 * tests/conflicts.at (Unresolved SR Conflicts)
7795 (Solved SR Conflicts): Adjust.
7796
ee000ba4
AD
77972002-06-15 Akim Demaille <akim@epita.fr>
7798
7799 Let symbols have a location.
7800
7801 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
7802 (getsym): Adjust.
7803 Adjust all callers.
7804 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
7805 Use location_t, not int.
7806 * src/symtab.c (symbol_check_defined): Take advantage of the
7807 location.
7808 * tests/regression.at (Invalid inputs): Adjust.
7809
8efe435c
AD
78102002-06-15 Akim Demaille <akim@epita.fr>
7811
7812 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
7813 (input): Don't try to initialize yylloc here, do it in the
7814 scanner.
7815 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
7816 * src/gram.h (rule_t): Change line and action_line into location
7817 and action_location, of location_t type.
7818 Adjust all dependencies.
7819 * src/location.h, src/location.c (empty_location): New.
7820 * src/reader.h, src/reader.c (grammar_start_symbol_set)
7821 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
7822 (grammar_current_rule_symbol_append)
7823 (grammar_current_rule_action_append): Expect a location as argument.
7824 * src/reader.c (grammar_midrule_action): Adjust to attach an
7825 action's location as dummy symbol location.
7826 * src/symtab.h, src/symtab.c (startsymbol_location): New.
7827 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
7828 the line numbers.
7829
1921f1d7
AD
78302002-06-14 Akim Demaille <akim@epita.fr>
7831
7832 Grammar declarations may be found in the grammar section.
7833
7834 * src/parse-gram.y (rules_or_grammar_declaration): New.
7835 (declarations): Each declaration may end with a semicolon, not
7836 just...
7837 (grammar_declaration): `"%union"'.
7838 (grammar): Branch to rules_or_grammar_declaration.
7839
4515534c
AD
78402002-06-14 Akim Demaille <akim@epita.fr>
7841
7842 * src/main.c (main): Invoke scanner_free.
7843
f958596b
AD
78442002-06-14 Akim Demaille <akim@epita.fr>
7845
7846 * src/output.c (m4_invoke): Extracted from...
7847 (output_skeleton): here.
7848 Free tempfile.
7849
2c569025
AD
78502002-06-14 Akim Demaille <akim@epita.fr>
7851
7852 * src/parse-gram.y (directives, directive, gram)
7853 (grammar_directives, precedence_directives, precedence_directive):
7854 Rename as...
7855 (declarations, declaration, grammar, grammar_declaration)
7856 (precedence_declaration, precedence_declarator): these.
7857 (symbol_declaration): New.
7858
592e8d4d
AD
78592002-06-14 Akim Demaille <akim@epita.fr>
7860
7861 * src/files.c (action_obstack): Remove, unused.
7862 (output_obstack): Remove it, and all its dependencies, as it is no
7863 longer needed.
7864 * src/reader.c (epilogue_set): Build the epilogue in the
7865 muscle_obstack.
7866 * src/output.h, src/output.c (muscle_obstack): Move to...
7867 * src/muscle_tab.h, src/muscle_tab.h: here.
7868 (muscle_init): Initialize muscle_obstack.
7869 (muscle_free): New.
7870 * src/main.c (main): Call it.
7871
0c15323d
AD
78722002-06-14 Akim Demaille <akim@epita.fr>
7873
7874 * src/location.h: New, extracted from...
7875 * src/reader.h: here.
7876 * src/Makefile.am (noinst_HEADERS): Merge into
7877 (bison_SOURCES): this.
7878 Add location.h.
7879 * src/parse-gram.y: Use location_t instead of Bison's.
7880 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
7881 Use location_t instead of ints.
7882
e96c9728
AD
78832002-06-14 Akim Demaille <akim@epita.fr>
7884
7885 * data/bison.simple, data/bison.c++: Be sure to restore the
7886 current #line when returning to the skeleton contents after having
7887 exposed the input file's #line.
7888
75d1fe16
AD
78892002-06-12 Akim Demaille <akim@epita.fr>
7890
7891 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
7892 eager.
7893 * tests/actions.at (Exotic Dollars): New.
7894
6c35d22c
AD
78952002-06-12 Akim Demaille <akim@epita.fr>
7896
7897 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
7898 ['"/] too eagerly.
7899 * tests/input.at (Torturing the Scanner): New.
7900
1d6412ad
AD
79012002-06-11 Akim Demaille <akim@epita.fr>
7902
7903 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
7904 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
7905 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
7906 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
7907 * src/reader.c (reader): Use it.
7908
4cdb01db
AD
79092002-06-11 Akim Demaille <akim@epita.fr>
7910
7911 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
7912 Adjust all callers.
7913 (scanner_last_string_free): New.
7914
44995b2e
AD
79152002-06-11 Akim Demaille <akim@epita.fr>
7916
7917 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
7918 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
7919 (last_string, YY_OBS_FREE): New.
7920 Use them when returning an ID.
7921
e9955c83
AD
79222002-06-11 Akim Demaille <akim@epita.fr>
7923
7924 Have Bison grammars parsed by a Bison grammar.
7925
7926 * src/reader.c, src/reader.h (prologue_augment): New.
7927 * src/reader.c (copy_definition): Remove.
7928
7929 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
7930 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
7931 (grammar_current_rule_prec_set, grammar_current_rule_check)
7932 (grammar_current_rule_symbol_append)
7933 (grammar_current_rule_action_append): Export.
7934 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
7935 (symbol_list_action_append): Remove.
7936 Hook the routines from reader.
7937 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
7938 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
7939
7940 * src/reader.c (read_declarations): Remove, unused.
7941
7942 * src/parse-gram.y: Handle the epilogue.
7943 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
7944 (grammar_start_symbol_set): this.
7945 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
7946 * src/reader.c (readgram): Remove, unused.
7947 (reader): Adjust to insert eoftoken and axiom where appropriate.
7948
7949 * src/reader.c (copy_dollar): Replace with...
7950 * src/scan-gram.h (handle_dollar): this.
7951 * src/parse-gram.y: Remove `%thong'.
7952
7953 * src/reader.c (copy_at): Replace with...
7954 * src/scan-gram.h (handle_at): this.
7955
7956 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
7957 New.
7958
7959 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
7960 time being.
7961
7962 * src/reader.h, src/reader.c (grammar_rule_end): New.
7963
7964 * src/parse.y (current_type, current_class): New.
7965 Implement `%nterm', `%token' support.
7966 Merge `%term' into `%token'.
7967 (string_as_id): New.
7968 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
7969 type name.
7970
7971 * src/parse-gram.y: Be sure to handle properly the beginning of
7972 rules.
7973
7974 * src/parse-gram.y: Handle %type.
7975 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
7976
7977 * src/parse-gram.y: More directives support.
7978 * src/options.c: No longer handle source directives.
7979
7980 * src/parse-gram.y: Fix %output.
7981
7982 * src/parse-gram.y: Handle %union.
7983 Use the prologue locations.
7984 * src/reader.c (parse_union_decl): Remove.
7985
7986 * src/reader.h, src/reader.c (epilogue_set): New.
7987 * src/parse-gram.y: Use it.
7988
7989 * data/bison.simple, data/bison.c++: b4_stype is now either not
7990 defined, then default to int, or to the contents of %union,
7991 without `union' itself.
7992 Adjust.
7993 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
7994
7995 * src/output.c (actions_output): Don't output braces, as they are
7996 already handled by the scanner.
7997
7998 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
7999 characters to themselves.
8000
8001 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
8002 that the epilogue has a proper #line.
8003
8004 * src/parse-gram.y: Handle precedence/associativity.
8005
8006 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
8007 a terminal.
8008 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
8009 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
8010 at all to define terminals that cannot be emitted.
8011
8012 * src/scan-gram.l: Escape M4 characters.
8013
8014 * src/scan-gram.l: Working properly with escapes in user
8015 strings/characters.
8016
8017 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
8018 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
8019 grammar.
8020 Use more modest sizes, as for the time being the parser does not
8021 release memory, and therefore the process swallows a huge amount
8022 of memory.
8023
8024 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
8025 stricter %token grammar.
8026
8027 * src/symtab.h (associativity): Add `undef_assoc'.
8028 (symbol_precedence_set): Do nothing when passed an undef_assoc.
8029 * src/symtab.c (symbol_check_alias_consistence): Adjust.
8030
8031 * tests/regression.at (Invalid %directive): Remove, as it is now
8032 meaningless.
8033 (Invalid inputs): Adjust to the new error messages.
8034 (Token definitions): The new grammar doesn't allow too many
8035 eccentricities.
8036
8037 * src/lex.h, src/lex.c: Remove.
8038 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
8039 (copy_character, copy_string2, copy_string, copy_identifier)
8040 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
8041 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
8042 (parse_action): Remove.
8043 * po/POTFILES.in: Adjust.
8044
2e047461
AD
80452002-06-11 Akim Demaille <akim@epita.fr>
8046
cd05d13c 8047 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
8048 rule's action member: return the action as a string.
8049 Don't require `rule_length' as an argument: compute it.
8050 (grammar_current_rule_symbol_append)
8051 (grammar_current_rule_action_append): New, eved out from
8052 (readgram): here.
8053 Remove `action_flag', `rulelength', unused now.
8054
9af3fbce
AD
80552002-06-11 Akim Demaille <akim@epita.fr>
8056
8057 * src/reader.c (grammar_current_rule_prec_set).
8058 (grammar_current_rule_check): New, eved out from...
8059 (readgram): here.
8060 Remove `xaction', `first_rhs': useless.
8061 * tests/input.at (Type clashes): New.
8062 * tests/existing.at (GNU Cim Grammar): Adjust.
8063
1485e106
AD
80642002-06-11 Akim Demaille <akim@epita.fr>
8065
8066 * src/reader.c (grammar_midrule_action): New, Eved out from
8067 (readgram): here.
8068
da4160c3
AD
80692002-06-11 Akim Demaille <akim@epita.fr>
8070
8071 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
8072 New.
8073 (readgram): Use them as replacement of inlined code, crule and
8074 crule1.
8075
f6d0f937
AD
80762002-06-11 Akim Demaille <akim@epita.fr>
8077
8078 * src/reader.c (grammar_end, grammar_symbol_append): New.
8079 (readgram): Use them.
8080 Make the use of `p' as local as possible.
8081
69078d4b
AD
80822002-06-10 Akim Demaille <akim@epita.fr>
8083
8084 GCJ's parser requires the tokens to be defined before the prologue.
8085
8086 * data/bison.simple: Output the token definition before the user's
8087 prologue.
8088 * tests/regression.at (Braces parsing, Duplicate string)
8089 (Mixing %token styles): Check the output from bison.
8090 (Early token definitions): New.
8091
5e424082
AD
80922002-06-10 Akim Demaille <akim@epita.fr>
8093
8094 * src/symtab.c (symbol_user_token_number_set): Don't complain when
8095 assigning twice the same user number to a token, so that we can
8096 use it in...
8097 * src/lex.c (lex): here.
8098 Also use `symbol_class_set' instead of hand written code.
8099 * src/reader.c (parse_assoc_decl): Likewise.
8100
44536b35
AD
81012002-06-10 Akim Demaille <akim@epita.fr>
8102
8103 * src/symtab.c, src/symtab.c (symbol_class_set)
8104 (symbol_user_token_number_set): New.
8105 * src/reader.c (parse_token_decl): Use them.
8106 Use a switch instead of ifs.
8107 Use a single argument.
8108
8b9f2372
AD
81092002-06-10 Akim Demaille <akim@epita.fr>
8110
8111 Remove `%thong' support as it is undocumented, unused, duplicates
8112 `%token's job, and creates useless e-mail traffic with people who
8113 want to know what it is, why it is undocumented, unused, and
8114 duplicates `%token's job.
8115
8116 * src/reader.c (parse_thong_decl): Remove.
8117 * src/options.c (option_table): Remove "thong".
8118 * src/lex.h (tok_thong): Remove.
8119
3ae2b51f
AD
81202002-06-10 Akim Demaille <akim@epita.fr>
8121
8122 * src/symtab.c, src/symtab.c (symbol_type_set)
8123 (symbol_precedence_set): New.
8124 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
8125 (value_components_used): Remove, unused.
8126
2f1afb73
AD
81272002-06-09 Akim Demaille <akim@epita.fr>
8128
8129 Move symbols handling code out of the reader.
8130
8131 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
8132 (axiom): Move to...
8133 * src/symtab.h, src/symtab.c: here.
8134
8135 * src/gram.c (start_symbol): Remove: use startsymbol->number.
8136 * src/reader.c (startval): Rename as...
8137 * src/symtab.h, src/symtab.c (startsymbol): this.
8138 * src/reader.c: Adjust.
8139
8140 * src/reader.c (symbol_check_defined, symbol_make_alias)
8141 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
8142 (token_translations_init)
8143 Move to...
8144 * src/symtab.c: here.
8145 * src/reader.c (packsymbols): Move to...
8146 * src/symtab.h, src/symtab.c (symbols_pack): here.
8147 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
8148 argument.
8149
e9bca3ad
AD
81502002-06-03 Akim Demaille <akim@epita.fr>
8151
8152 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
8153 then statements.
8154
86eff183
AD
81552002-06-03 Akim Demaille <akim@epita.fr>
8156
8157 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
8158 structs with non literals.
8159 * src/scan-skel.l: never-interactive.
8160 * src/conflicts.c (enum conflict_resolution_e): No trailing
8161 comma.
8162 * src/getargs.c (usage): Split long literal strings.
8163 Reported by Hans Aberg.
8164
717be197
AD
81652002-05-28 Akim Demaille <akim@epita.fr>
8166
8167 * data/bison.c++: Use C++ ostreams.
8168 (cdebug_): New member.
8169
670ddffd
AD
81702002-05-28 Akim Demaille <akim@epita.fr>
8171
8172 * src/output.c (output_skeleton): Be sure to allocate enough room
8173 for `/' _and_ for `\0' in full_skeleton.
8174
769b430f
AD
81752002-05-28 Akim Demaille <akim@epita.fr>
8176
8177 * data/bison.c++: Catch up with bison.simple:
8178 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8179 and Paul Eggert <eggert@twinsun.com>: `error' handing.
8180 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
8181 and popping traces.
8182
7067cb36
PH
81832002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8184
8185 * src/output.c (output_skeleton): Put an explicit path in front of
8186 the skeleton file name, rather than relying on the -I directory,
8187 to partially alleviate effects of having a skeleton file lying around
8188 in the current directory.
769b430f 8189
4a713ec2
PH
81902002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8191
769b430f 8192 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
8193 obstack_printf should be obstack_fgrow1.
8194
b408954b
AD
81952002-05-26 Akim Demaille <akim@epita.fr>
8196
8197 * src/state.h (state_t): `solved_conflicts' is a new member.
8198 * src/LR0.c (new_state): Set it to 0.
8199 * src/conflicts.h, src/conflicts.c (print_conflicts)
8200 (free_conflicts, solve_conflicts): Rename as...
8201 (conflicts_print, conflicts_free, conflicts_solve): these.
8202 Adjust callers.
8203 * src/conflicts.c (enum conflict_resolution_e)
8204 (solved_conflicts_obstack): New, used by...
8205 (log_resolution): this.
8206 Adjust to attach the conflict resolution to each state.
8207 Complete the description with the precedence/associativity
8208 information.
8209 (resolve_sr_conflict): Adjust.
8210 * src/print.c (print_state): Output its solved_conflicts.
8211 * tests/conflicts.at (Unresolved SR Conflicts)
8212 (Solved SR Conflicts): Exercise --report=all.
8213
a49aecd5
AD
82142002-05-26 Akim Demaille <akim@epita.fr>
8215
8216 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
8217 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
8218 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
8219 (token_number_t, item_number_as_token_number)
8220 (token_number_as_item_number, muscle_insert_token_number_table):
8221 Rename as...
8222 (symbol_number_t, item_number_as_symbol_number)
8223 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
8224 these, since it is more appropriate.
8225
5504898e
AD
82262002-05-26 Akim Demaille <akim@epita.fr>
8227
8228 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
8229 `Error:' lines.
8230 * data/bison.simple (yystos) [YYDEBUG]: New.
8231 (yyparse) [YYDEBUG]: Display the symbols which are popped during
8232 error recovery.
8233 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
8234
ec3bc396
AD
82352002-05-25 Akim Demaille <akim@epita.fr>
8236
8237 * doc/bison.texinfo (Debugging): Split into...
8238 (Tracing): this new section, its former contents, and...
8239 (Understanding): this new section.
8240 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
8241 by...
8242 (report_flag): this.
8243 Adjust all dependencies.
8244 (report_args, report_types, report_argmatch): New.
8245 (usage, getargs): Report/support -r, --report.
8246 * src/options.h
8247 (struct option_table_struct): Rename as..,
8248 (struct option_table_s): this.
8249 Rename the `set_flag' member to `flag' to match with getopt_long's
8250 struct.
8251 * src/options.c (option_table): Split verbose into an entry for
8252 %verbose, and another for --verbose.
8253 Support --report/-r, so remove -r from the obsolete --raw.
8254 * src/print.c: Attach full item sets and lookaheads reports to
8255 report_flag instead of trace_flag.
8256 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
8257
78df8250
PE
82582002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8259 and Paul Eggert <eggert@twinsun.com>
769b430f 8260
78df8250
PE
8261 * data/bison.simple (yyparse): Correct error handling to conform to
8262 POSIX and yacc. Specifically, after syntax error is discovered,
8263 do not reduce further before shifting the error token.
8264 Clean up the code a bit by removing the labels yyerrdefault,
8265 yyerrhandle, yyerrpop.
8266 * NEWS: Document the above.
8267
c0c9ea05
PH
82682002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8269
8270 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
8271 type; it isn't always big enough, since it doesn't necessarily
8272 include non-terminals.
769b430f 8273 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
8274 the latter can be removed.
8275 (yy_token_number_type): Remove, only one use.
8276 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
8277 don't use TokenNumberType as element type.
769b430f 8278
c0c9ea05
PH
8279 * tests/regression.at: Modify expected output to agree with change
8280 to yyr1 and yytranslate.
769b430f 8281
6390a83f
FK
82822002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
8283
8284 * src/reader.c (parse_action): Use copy_character instead of
8285 obstack_1grow.
8286
db7c8e9a
AD
82872002-05-13 Akim Demaille <akim@epita.fr>
8288
8289 * tests/regression.at (Token definitions): Prototype yylex and
8290 yyerror.
8291
fcc61800
PH
82922002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8293
158c687b 8294 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
8295 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
8296 32-bit arithmetic.
8297 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
8298
5683e9b2
AD
82992002-05-07 Akim Demaille <akim@epita.fr>
8300
8301 * tests/synclines.at: Be sure to prototype yylex and yyerror to
8302 avoid GCC warnings.
8303
0c2d3f4c
AD
83042002-05-07 Akim Demaille <akim@epita.fr>
8305
8306 Kill GCC warnings.
8307
8308 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
8309 over the RHS of each rule.
8310 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
8311 * src/state.h (state_t): Member `nitems' is unsigned short.
8312 * src/LR0.c (get_state): Adjust.
8313 * src/reader.c (packgram): Likewise.
8314 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
8315 `Type'.
8316 (muscle_insert_int_table): Remove, unused.
8317 (prepare_rules): Remove `max'.
8318
1565b720
AD
83192002-05-06 Akim Demaille <akim@epita.fr>
8320
8321 * src/closure.c (print_firsts): Display of the symbol tags.
8322 (bitmatrix_print): Move to...
8323 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
8324 here.
8325 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
8326
cfaee611
AD
83272002-05-06 Akim Demaille <akim@epita.fr>
8328
8329 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
8330 hash_do_for_each.
8331
458be8e0
AD
83322002-05-06 Akim Demaille <akim@epita.fr>
8333
8334 * src/LR0.c (new_state, get_state): Instead of using the global
8335 `kernel_size' and `kernel_base', have two new arguments:
8336 `core_size' and `core'.
8337 Adjust callers.
8338
a900a624
AD
83392002-05-06 Akim Demaille <akim@epita.fr>
8340
8341 * src/reader.c (packgram): No longer end `ritem' with a 0
8342 sentinel: it is not used.
8343
d4e7d3a1
AD
83442002-05-05 Akim Demaille <akim@epita.fr>
8345
8346 New experimental feature: display the lookaheads in the report and
8347 graph.
8348
8349 * src/print (print_core): When --trace-flag, display the rules
8350 lookaheads.
8351 * src/print_graph.c (print_core): Likewise.
8352 Swap the arguments.
8353 Adjust caller.
8354
39ceb25b
AD
83552002-05-05 Akim Demaille <akim@epita.fr>
8356
8357 * tests/torture.at (Many lookaheads): New test.
8358
5372019f
AD
83592002-05-05 Akim Demaille <akim@epita.fr>
8360
8361 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
8362 (GENERATE_MUSCLE_INSERT_TABLE): this.
8363 (output_int_table, output_unsigned_int_table, output_short_table)
8364 (output_token_number_table, output_item_number_table): Replace with...
8365 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
8366 (muscle_insert_short_table, muscle_insert_token_number_table)
8367 (muscle_insert_item_number_table): these.
8368 Adjust all callers.
8369 (prepare_tokens): Don't free `translations', since...
8370 * src/reader.h, src/reader.c (grammar_free): do it.
8371 Move to...
8372 * src/gram.h, src/gram.c (grammar_free): here.
8373 * data/bison.simple, data/bison.c++: b4_token_number_max is now
8374 b4_translate_max.
8375
5df5f6d5
AD
83762002-05-05 Akim Demaille <akim@epita.fr>
8377
8378 * src/output.c (output_unsigned_int_table): New.
8379 (prepare_rules): `i' is unsigned.
8380 `prhs', `rline', `r2' are unsigned int.
8381 Rename muscle `rhs_number_max' as `rhs_max'.
8382 Output muscles `prhs_max', `rline_max', and `r2_max'.
8383 Free rline and r1.
8384 * data/bison.simple, data/bison.c++: Adjust to use these muscles
8385 to compute types instead of constant types.
8386 * tests/regression.at (Web2c Actions): Adjust.
8387
b87f8b21
AD
83882002-05-04 Akim Demaille <akim@epita.fr>
8389
8390 * src/symtab.h (SALIAS, SUNDEF): Rename as...
8391 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
8392 Adjust dependencies.
8393 * src/output.c (token_definitions_output): Be sure not to output a
8394 `#define 'a'' when fed with `%token 'a' "a"'.
8395 * tests/regression.at (Token definitions): New.
8396
8bb936e4
PE
83972002-05-03 Paul Eggert <eggert@twinsun.com>
8398
8399 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
8400 for K&R C.
8401
84022002-05-03 gettextize <bug-gnu-gettext@gnu.org>
8403
8404 * Makefile.am (SUBDIRS): Remove intl.
8405 (EXTRA_DIST): Add config/config.rpath.
8406
53c71a12
AD
84072002-05-03 Akim Demaille <akim@epita.fr>
8408
8409 * data/bison.simple (m4_if): Don't output empty enums.
8410 And actually, output valid enum definitions :(.
8411
289dd0cf
AD
84122002-05-03 Akim Demaille <akim@epita.fr>
8413
8414 * configure.bat: Remove, completely obsolete.
8415 * Makefile.am (EXTRA_DIST): Adjust.
8416 Don't distribute config.rpath...
8417 * config/Makefile.am (EXTRA_DIST): Do it.
8418
db85e524
AD
84192002-05-03 Akim Demaille <akim@epita.fr>
8420
8421 * configure.in (GETTEXT_VERSION): New.
8422 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
8423
83ccf991
AD
84242002-05-03 Akim Demaille <akim@epita.fr>
8425
8426 * data/bison.simple (b4_token_enum): New.
8427 (b4_token_defines): Use it to output tokens both as #define and
8428 enums.
8429 Suggested by Paul Eggert.
8430 * src/output.c (token_definitions_output): Don't output spurious
8431 white spaces.
8432
1f418995
AD
84332002-05-03 Akim Demaille <akim@epita.fr>
8434
8435 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
8436
45119f04
RA
84372002-05-02 Robert Anisko <robert@lrde.epita.fr>
8438
8439 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
8440 Update the stack class, give a try to deque as the default container.
8441
b2d52318
AD
84422002-05-02 Akim Demaille <akim@epita.fr>
8443
8444 * data/bison.simple (yyparse): Do not implement @$ = @1.
8445 (YYLLOC_DEFAULT): Adjust to do it.
8446 * doc/bison.texinfo (Location Default Action): Fix.
8447
3a8b4109
AD
84482002-05-02 Akim Demaille <akim@epita.fr>
8449
8450 * src/reader.c (parse_braces): Merge into...
8451 (parse_action): this.
8452
84614e13
AD
84532002-05-02 Akim Demaille <akim@epita.fr>
8454
8455 * configure.in (ALL_LINGUAS): Remove.
8456 * po/LINGUAS, hr.po: New.
8457
fdbcd8e2
AD
84582002-05-02 Akim Demaille <akim@epita.fr>
8459
8460 Remove the so called hairy (semantic) parsers.
8461
8462 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
8463 * src/gram.h, src/gram.c (semantic_parser): Remove.
8464 (rule_t): Remove the guard and guard_line members.
8465 * src/lex.h (token_t): remove tok_guard.
8466 * src/options.c (option_table): Remove %guard and %semantic_parser
8467 support.
8468 * src/output.c, src/output.h (guards_output): Remove.
8469 (prepare): Adjust.
8470 (token_definitions_output): Don't output the `T'
8471 tokens (???).
8472 (output_skeleton): Don't output the guards.
8473 * src/files.c, src/files.c (attrsfile): Remove.
8474 * src/reader.c (symbol_list): Remove the guard and guard_line
8475 members.
8476 Adjust dependencies.
8477 (parse_guard): Remove.
8478 * data/bison.hairy: Remove.
8479 * doc/bison.texinfo (Environment Variables): Remove occurrences of
8480 BISON_HAIRY.
8481
82b6cb3f
AD
84822002-05-02 Akim Demaille <akim@epita.fr>
8483
8484 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
8485 (parse_guard): Rename the formal argument `stack_offset' as
8486 `rule_length', which is more readable.
8487 Adjust callers.
8488 (copy_at, copy_dollar): Instead of outputting the hard coded
8489 values of $$, $n and so forth, output invocation to b4_lhs_value,
8490 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
8491 Note: this patch partially drops `semantic-parser' support: it
8492 always does `rule_length - n', where semantic parsers ought to
8493 always use `-n'.
82b6cb3f
AD
8494 * data/bison.simple, data/bison.c++ (b4_lhs_value)
8495 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
8496
6cbfbcc5
AD
84972002-05-02 Akim Demaille <akim@epita.fr>
8498
8499 * configure.in (AC_INIT): Bump to 1.49b.
8500 (AM_INIT_AUTOMAKE): Short invocation.
8501
b8548114
AD
85022002-05-02 Akim Demaille <akim@epita.fr>
8503
8504 Version 1.49a.
8505
c20cd1fa
AD
85062002-05-01 Akim Demaille <akim@epita.fr>
8507
8508 * src/skeleton.h: Remove.
8509
8a9566d4
AD
85102002-05-01 Akim Demaille <akim@epita.fr>
8511
8512 * src/skeleton.h: Fix the #endif.
8513 Reported by Magnus Fromreide.
8514
8c6d399a
PE
85152002-04-26 Paul Eggert <eggert@twinsun.com>
8516
8517 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
8518 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 8519 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 8520
2b7ed18a
RA
85212002-04-25 Robert Anisko <robert@lrde.epita.fr>
8522
8523 * src/scan-skel.l: Postprocess quadrigraphs.
8524
8525 * src/reader.c (copy_character): New function, used to output
8526 single characters while replacing `[' and `]' with quadrigraphs, to
8527 avoid troubles with M4 quotes.
8528 (copy_comment): Output characters with copy_character.
8529 (read_additionnal_code): Likewise.
8530 (copy_string2): Likewise.
8531 (copy_definition): Likewise.
8532
8533 * tests/calc.at: Exercise M4 quoting.
8534
34a89c50
AD
85352002-04-25 Akim Demaille <akim@epita.fr>
8536
8537 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
8538 between `!' and the command.
8539 Reported by Paul Eggert.
8540
0dd1580a
RA
85412002-04-24 Robert Anisko <robert@lrde.epita.fr>
8542
8543 * tests/calc.at: Exercise prologue splitting.
8544
8545 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
8546 `b4_post_prologue' instead of `b4_prologue'.
8547
8548 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
8549 muscles.
8550 (output): Free pre_prologue_obstack and post_prologue_obstack.
8551 * src/files.h, src/files.c (attrs_obstack): Remove.
8552 (pre_prologue_obstack, post_prologue_obstack): New.
8553 * src/reader.c (copy_definition): Add a parameter to specify the
8554 obstack to fill, instead of using attrs_obstack unconditionally.
8555 (read_declarations): Pass pre_prologue_obstack to copy_definition if
8556 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
8557
83c1796f
PE
85582002-04-23 Paul Eggert <eggert@twinsun.com>
8559
8560 * data/bison.simple: Remove unnecessary commentary and white
8561 space differences from 1_29-branch.
8562 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
8563
8564 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
8565 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
8566 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
8567 constructors or destructors.
8568
8569 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
8570
1207eeac
AD
85712002-04-23 Akim Demaille <akim@epita.fr>
8572
8573 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
8574 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
8575 location with columns.
8576 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
8577 All reported by Paul Eggert.
8578
78ab8f67
AD
85792002-04-22 Akim Demaille <akim@epita.fr>
8580
8581 * src/reduce.c (dump_grammar): Move to...
8582 * src/gram.h, src/gram.c (grammar_dump): here.
8583 Be sure to separate long item numbers.
8584 Don't read the members of a rule's prec if its nil.
8585
133c20e2
AD
85862002-04-22 Akim Demaille <akim@epita.fr>
8587
8588 * src/output.c (table_size, table_grow): New.
8589 (MAXTABLE): Remove, replace uses with table_size.
8590 (pack_vector): Instead of dying when the table is too big, grow it.
8591
9515e8a7
AD
85922002-04-22 Akim Demaille <akim@epita.fr>
8593
8594 * data/bison.simple (yyr1): Its type is that of a token number.
8595 * data/bison.c++ (r1_): Likewise.
8596 * tests/regression.at (Web2c Actions): Adjust.
8597
23c5a174
AD
85982002-04-22 Akim Demaille <akim@epita.fr>
8599
8600 * src/reader.c (token_translations_init): 256 is now the default
8601 value for the error token, i.e., it will be assigned another
8602 number if the user assigned 256 to one of her tokens.
8603 (reader): Don't force 256 to error.
8604 * doc/bison.texinfo (Symbols): Adjust.
8605 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
8606 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
8607 etc. instead of 10, 20, 30 (which was used to `jump' over error
8608 (256) and undefined (2)).
8609
5fbb0954
AD
86102002-04-22 Akim Demaille <akim@epita.fr>
8611
8612 Propagate more token_number_t.
8613
8614 * src/gram.h (token_number_as_item_number)
8615 (item_number_as_token_number): New.
8616 * src/output.c (GENERATE_OUTPUT_TABLE): New.
8617 Use it to create output_item_number_table and
8618 output_token_number_table.
8619 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
8620 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
8621 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
8622 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
8623
4f940944
AD
86242002-04-22 Akim Demaille <akim@epita.fr>
8625
8626 * src/output.h, src/output.c (get_lines_number): Remove.
8627
3ded9a63
AD
86282002-04-19 Akim Demaille <akim@epita.fr>
8629
8630 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
8631 as Lex/Flex'.
8632 (Debugging): More details about enabling the debugging features.
8633 (Table of Symbols): Describe $$, $n, @$, and @n.
8634 Suggested by Tim Josling.
8635
e0c471a9
AD
86362002-04-19 Akim Demaille <akim@epita.fr>
8637
8638 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
8639
fecc10cd
AD
86402002-04-10 Akim Demaille <akim@epita.fr>
8641
8642 * src/system.h: Rely on HAVE_LIMITS_H.
8643 Suggested by Paul Eggert.
8644
51dec47b
AD
86452002-04-09 Akim Demaille <akim@epita.fr>
8646
8647 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
8648 full stderr, and strip it according to the bison options, instead
8649 of composing the error message from different bits.
8650 This makes it easier to check for several error messages.
8651 Adjust all the invocations.
8652 Add an invocation exercising the error token.
8653 Add an invocation demonstrating a stupid error message.
8654 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
8655 Adjust the tests.
8656 Error message are for stderr, not stdout.
8657
007a50a4
AD
86582002-04-09 Akim Demaille <akim@epita.fr>
8659
8660 * src/gram.h, src/gram.c (error_token_number): Remove, use
8661 errtoken->number.
8662 * src/reader.c (reader): Don't specify the user token number (2)
8663 for $undefined, as it uselessly prevents using it.
8664 * src/gram.h (token_number_t): Move to...
8665 * src/symtab.h: here.
8666 (state_t.number): Is a token_number_t.
8667 * src/print.c, src/reader.c: Use undeftoken->number instead of
8668 hard coded 2.
8669 (Even though this 2 is not the same as above: the number of the
8670 undeftoken remains being 2, it is its user token number which
8671 might not be 2).
8672 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
8673 `user_token_number_max'.
8674 Output `undef_token_number'.
8675 * data/bison.simple, data/bison.c++: Use them.
8676 Be sure to map invalid yylex return values to
8677 `undef_token_number'. This saves us from gratuitous SEGV.
8678
8679 * tests/conflicts.at (Solved SR Conflicts)
8680 (Unresolved SR Conflicts): Adjust.
8681 * tests/regression.at (Web2c Actions): Adjust.
8682
06446ccf
AD
86832002-04-08 Akim Demaille <akim@epita.fr>
8684
8685 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
8686 Adding #line.
8687 Remove the duplicate `typedefs'.
8688 (RhsNumberType): Fix the declaration and various other typos.
8689 Use __ofile__.
8690 * data/bison.simple: Use __ofile__.
8691 * src/scan-skel.l: Handle __ofile__.
8692
62a3e4f0
AD
86932002-04-08 Akim Demaille <akim@epita.fr>
8694
8695 * src/gram.h (item_number_t): New, the type of item numbers in
8696 RITEM. Note that it must be able to code symbol numbers as
8697 positive number, and the negation of rule numbers as negative
8698 numbers.
8699 Adjust all dependencies (pretty many).
8700 * src/reduce.c (rule): Remove this `short *' pointer: use
8701 item_number_t.
8702 * src/system.h (MINSHORT, MAXSHORT): Remove.
8703 Include `limits.h'.
8704 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
8705 (shortcpy): Remove.
8706 (MAXTABLE): Move to...
8707 * src/output.c (MAXTABLE): here.
8708 (prepare_rules): Use output_int_table to output rhs.
8709 * data/bison.simple, data/bison.c++: Adjust.
8710 * tests/torture.at (Big triangle): Move the limit from 254 to
8711 500.
8712 * tests/regression.at (Web2c Actions): Ajust.
8713
8714 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
8715 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
8716 passes, but produces negative #line number, once fixed, GCC is
8717 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
8718 C), it passes.
8719 * src/state.h (state_h): Code input lines on ints, not shorts.
8720
bb88b0fc
AD
87212002-04-08 Akim Demaille <akim@epita.fr>
8722
8723 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
8724 and then the grammar.
8725
9a636f47
AD
87262002-04-08 Akim Demaille <akim@epita.fr>
8727
8728 * src/system.h: No longer using strndup.
8729
680e8701
AD
87302002-04-07 Akim Demaille <akim@epita.fr>
8731
8732 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
8733 * src/output.c (output_table_data): Return the longest number.
8734 (prepare_tokens): Output `token_number_max').
8735 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
8736 New.
8737 Use them to define yy_token_number_type/TokenNumberType.
8738 Use this type for yytranslate.
8739 * tests/torture.at (Big triangle): Push the limit from 124 to
8740 253.
8741 * tests/regression.at (Web2c Actions): Adjust.
8742
817e9f41
AD
87432002-04-07 Akim Demaille <akim@epita.fr>
8744
8745 * tests/torture.at (Big triangle): New.
8746 (GNU AWK Grammar, GNU Cim Grammar): Move to...
8747 * tests/existing.at: here.
8748
5123689b
AD
87492002-04-07 Akim Demaille <akim@epita.fr>
8750
8751 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
8752 nritems.
8753 Adjust dependencies.
8754
f3849179
AD
87552002-04-07 Akim Demaille <akim@epita.fr>
8756
8757 * src/reader.c: Normalize increments to prefix form.
8758
bd02036a
AD
87592002-04-07 Akim Demaille <akim@epita.fr>
8760
8761 * src/reader.c, symtab.c: Remove debugging code.
8762
db8837cb
AD
87632002-04-07 Akim Demaille <akim@epita.fr>
8764
8765 Rename all the `bucket's as `symbol_t'.
8766
8767 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
8768 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
8769 * src/symtab.c, src/symtab.h (bucket): Rename as...
8770 (symbol_t): this.
8771 (symbol_list_new, bucket_check_defined, bucket_make_alias)
8772 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
8773 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
8774 (buckets_new, buckets_free, buckets_do): Rename as...
8775 (symbol_list_new, symbol_check_defined, symbol_make_alias)
8776 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
8777 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
8778 (symbols_new, symbols_free, symbols_do): these.
8779
72a23c97
AD
87802002-04-07 Akim Demaille <akim@epita.fr>
8781
8782 Use lib/hash for the symbol table.
8783
8784 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
8785 EOF.
8786 * src/lex.c (lex): Set the `number' member of new terminals.
8787 * src/reader.c (bucket_check_defined, bucket_make_alias)
8788 (bucket_check_alias_consistence, bucket_translation): New.
8789 (reader, grammar_free, readgram, token_translations_init)
8790 (packsymbols): Adjust.
8791 (reader): Number the predefined tokens.
8792 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
8793 for predefined tokens.
8794 * src/symtab.h (bucket): Remove all the hash table related
8795 members.
8796 * src/symtab.c (symtab): Replace by...
8797 (bucket_table): this.
8798 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
8799 (buckets_new, buckets_do): New.
8800
280a38c3
AD
88012002-04-07 Akim Demaille <akim@epita.fr>
8802
8803 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
8804 (start_symbol, max_user_token_number, semantic_parser)
8805 (error_token_number): Initialize.
8806 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
8807 Initialize.
8808 (reader): Don't.
8809 (errtoken, eoftoken, undeftoken, axiom): Extern.
8810
03b31c0c
AD
88112002-04-07 Akim Demaille <akim@epita.fr>
8812
8813 * src/gram.h (rule_s): prec and precsym are now pointers
8814 to the bucket giving the priority/associativity.
8815 Member `associativity' removed: useless.
8816 * src/reduce.c, src/conflicts.c: Adjust.
8817
8b3df748
AD
88182002-04-07 Akim Demaille <akim@epita.fr>
8819
8820 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
8821 Properly escape the symbols' TAG when outputting them.
8822
e601aa1d
AD
88232002-04-07 Akim Demaille <akim@epita.fr>
8824
8825 * src/lalr.h (LA): Is a bitsetv, not bitset*.
8826
b0299a2e
AD
88272002-04-07 Akim Demaille <akim@epita.fr>
8828
8829 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
8830 (LArule): this, which is an array to rule_t*.
8831 * src/print.c, src/conflicts.c: Adjust.
8832
d7e1f00c
AD
88332002-04-07 Akim Demaille <akim@epita.fr>
8834
8835 * src/gram.h (rule_t): Rename `number' as `user_number'.
8836 `number' is a new member.
8837 Adjust dependencies.
8838 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
8839
cc9305dd
AD
88402002-04-07 Akim Demaille <akim@epita.fr>
8841
8842 As a result of the previous patch, it is no longer needed
8843 to reorder ritem itself.
8844
8845 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
8846
b0940840
AD
88472002-04-07 Akim Demaille <akim@epita.fr>
8848
8849 Be sure never to walk through RITEMS, but use only data related to
8850 the rules themselves. RITEMS should be banished.
8851
8852 * src/output.c (output_token_translations): Rename as...
8853 (prepare_tokens): this.
8854 In addition to `translate', prepare the muscles `tname' and
8855 `toknum', which were handled by...
8856 (output_rule_data): this.
8857 Remove, and move the remainder of its outputs into...
8858 (prepare_rules): this new routines, which also merges content from
8859 (output_gram): this.
8860 (prepare_rules): Be sure never to walk through RITEMS.
8861 (output_stos): Rename as...
8862 (prepare_stos): this.
8863 (output): Always invoke prepare_states, after all, just don't use it
8864 in the output if you don't need it.
8865
643a5994
AD
88662002-04-07 Akim Demaille <akim@epita.fr>
8867
8868 * src/LR0.c (new_state): Display `nstates' as the name of the
8869 newly created state.
8870 Adjust to initialize first_state and last_state if needed.
8871 Be sure to distinguish the initial from the final state.
8872 (new_states): Create the itemset of the initial state, and use
8873 new_state.
8874 * src/closure.c (closure): Now that the initial state has its
8875 items properly set, there is no need for a special case when
8876 creating `ruleset'.
8877
8878 As a result, now the rule 0, reducing to $axiom, is visible in the
8879 outputs. Adjust the test suite.
8880
8881 * tests/conflicts.at (Solved SR Conflicts)
8882 (Unresolved SR Conflicts): Adjust.
8883 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
8884 * tests/conflicts.at (S/R in initial): New.
8885
b4c4ccc2
AD
88862002-04-07 Akim Demaille <akim@epita.fr>
8887
8888 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
8889 the RHS of the rules.
8890 * src/output.c (output_gram): Likewise.
8891
bba97eb2
AD
88922002-04-07 Akim Demaille <akim@epita.fr>
8893
8894 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
8895 bucket.
8896 Adjust all dependencies.
8897 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
8898 `number' of the buckets too.
8899 * src/gram.h: Include `symtab.h'.
8900 (associativity): Move to...
8901 * src/symtab.h: here.
8902 No longer include `gram.h'.
8903
c3b407f4
AD
89042002-04-07 Akim Demaille <akim@epita.fr>
8905
8906 * src/gram.h, src/gram.c (rules_rhs_length): New.
8907 (ritem_longest_rhs): Use it.
8908 * src/gram.h (rule_t): `number' is a new member.
8909 * src/reader.c (packgram): Set it.
8910 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
8911 the end of `rules', and count them out of `nrules'.
8912 (reduce_output, dump_grammar): Adjust.
8913 * src/print.c (print_grammar): It is no longer needed to check for
8914 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
8915 * tests/reduce.at (Reduced Automaton): New test.
8916
11652ab3
AD
89172002-04-07 Akim Demaille <akim@epita.fr>
8918
8919 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
8920 lacking `+ 1' to nrules, Bison reported as useless a token if it
8921 was used solely to set the precedence of the last rule...
8922
26b23c1a
AD
89232002-04-07 Akim Demaille <akim@epita.fr>
8924
8925 * data/bison.c++, data/bison.simple: Don't output the current file
8926 name in #line, to avoid useless diffs between two identical
8927 outputs under different names.
8928
18bcecb0
AD
89292002-04-07 Akim Demaille <akim@epita.fr>
8930
8931 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
8932 Normalize loops to using `< nrules + 1', not `<= nrules'.
8933
fa770c86
AD
89342002-04-07 Akim Demaille <akim@epita.fr>
8935
8936 * TODO: Update.
8937
d9b739c3
AD
89382002-04-07 Akim Demaille <akim@epita.fr>
8939
8940 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
8941 bucket.value as bucket.number.
8942
99013900
AD
89432002-04-07 Akim Demaille <akim@epita.fr>
8944
8945 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
8946 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
8947 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
8948 RHS, instead of being an index in RITEMS.
8949
e966383b
PE
89502002-04-04 Paul Eggert <eggert@twinsun.com>
8951
8952 * doc/bison.texinfo: Update copyright date.
8953 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
8954 (Symbols): Warn about running Bison in one character set,
8955 but compiling and/or running in an incompatible one.
8956 Warn about character code 256, too.
8957
89582002-04-03 Paul Eggert <eggert@twinsun.com>
8959
8960 * src/bison.data (YYSTACK_ALLOC): Depend on whether
8961 YYERROR_VERBOSE is nonzero, not whether it is defined.
8962
8963 Merge changes from bison-1_29-branch.
c307773e 8964
8d6c48b9
PE
89652002-03-20 Paul Eggert <eggert@twinsun.com>
8966
8967 Merge fixes from Debian bison_1.34-1.diff.
8968
8969 * configure.in (AC_PREREQ): 2.53.
8970
e53c6322
AD
89712002-03-20 Akim Demaille <akim@epita.fr>
8972
8973 * src/conflicts.c (log_resolution): Argument `resolution' is const.
8974
9ffbeca7
PE
89752002-03-19 Paul Eggert <eggert@twinsun.com>
8976
21db0b2a
PE
8977 * src/bison.simple (YYCOPY): New macro.
8978 (YYSTACK_RELOCATE): Use it.
8979 Remove Type arg; no longer needed. All callers changed.
8980 (yymemcpy): Remove; no longer needed.
8981
9ffbeca7
PE
8982 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
8983 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8984
642cb8f8
AD
89852002-03-19 Akim Demaille <akim@epita.fr>
8986
8987 Test and fix the #line outputs.
8988
8989 * tests/atlocal.at (GCC): New.
8990 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 8991 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
8992 (Action synch line, Epilogue synch line): New tests.
8993 * src/reader.c (parse_union_decl): Define the muscle stype_line.
8994 * data/bison.simple, data/bison.c++: Use it.
8995
3c31a486
AD
89962002-03-19 Akim Demaille <akim@epita.fr>
8997
8998 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
8999 (Solved SR Conflicts, %expect not enough, %expect right)
9000 (%expect too much): Move to...
9001 * tests/conflicts.at: this new file.
9002
0d8bed56
AD
90032002-03-19 Akim Demaille <akim@epita.fr>
9004
9005 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
9006 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
9007 that we can move to enums for instance.
9008 * src/output.c (token_definitions_output): Output a list of
9009 `token-name, token-number' instead of the #define.
9010 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
9011
9208d17f
AD
90122002-03-14 Akim Demaille <akim@epita.fr>
9013
9014 Use Gettext 0.11.1.
9015
af27eacb
RA
90162002-03-09 Robert Anisko <robert@lrde.epita.fr>
9017
9018 * data/bison.c++: Make the user able to add members to the generated
9019 parser by subclassing.
9020
9101a310
RA
90212002-03-05 Robert Anisko <robert@lrde.epita.fr>
9022
9023 * src/reader.c (read_additionnal_code): `c' should be an integer, not
9024 a character.
9025 Reported by Nicolas Tisserand and Nicolas Burrus.
9026
fff9bf0b
RA
90272002-03-04 Robert Anisko <robert@lrde.epita.fr>
9028
9029 * src/reader.c: Warn about lacking semi-colons, do not complain.
9030
64dba31e
RA
90312002-03-04 Robert Anisko <robert@lrde.epita.fr>
9032
9033 * data/bison.c++: Remove a debug line.
9034
374f5a14
RA
90352002-03-04 Robert Anisko <robert@lrde.epita.fr>
9036
9037 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
9038 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
9039 provide a default implementation.
9040
bfcf1f3a
AD
90412002-03-04 Akim Demaille <akim@epita.fr>
9042
9043 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
9044 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
9045 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
9046 * tests/semantic.at (Parsing Guards): Similarly.
9047 * src/reader.at (readgram): Complain if the last rule is not ended
9048 with a semi-colon.
9049
65ccf9fc
AD
90502002-03-04 Akim Demaille <akim@epita.fr>
9051
9052 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
9053 * src/closure.c: here.
9054 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
9055 RTC.
9056 * src/warshall.h, src/warshall.c: Remove.
9057 * tests/sets.at (Broken Closure): Adjust.
9058
d0039cbc
AD
90592002-03-04 Akim Demaille <akim@epita.fr>
9060
9061 * src/output.c (output_skeleton): tempdir is const.
9062 bytes_read is unused.
9063
345cea78
AD
90642002-03-04 Akim Demaille <akim@epita.fr>
9065
9066 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
9067 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
9068 Update.
9069 From Michael Hayes.
9070
564801f7
AD
90712002-03-04 Akim Demaille <akim@epita.fr>
9072
9073 * src/closure.c (closure): `r' is unused.
9074
e5352bc7
AD
90752002-03-04 Akim Demaille <akim@epita.fr>
9076
9077 * tests/sets.at (Broken Closure): Add the ending `;'.
9078 * src/reader.at (readgram): Complain if a rule is not ended with a
9079 semi-colon.
9080
914feea9
AD
90812002-03-04 Akim Demaille <akim@epita.fr>
9082
9083 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
9084 (count_sr_conflicts): Use bitset_count.
9085 * src/reduce.c (inaccessable_symbols): Ditto.
9086 (bits_size): Remove.
9087 * src/warshall.h, src/warshall.c: Convert to bitsetv.
9088
f0250de6
AD
90892002-03-04 Akim Demaille <akim@epita.fr>
9090
9091 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
9092 * src/reduce.c: Remove the `bitset_zero's following the
9093 `bitset_create's, as now it is performed by the latter.
9094
ef017502
AD
90952002-03-04 Akim Demaille <akim@epita.fr>
9096
9097 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
9098 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
9099 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
9100 latest sources from Michael.
9101
76514394
AD
91022002-03-04 Akim Demaille <akim@epita.fr>
9103
9104 * src/output.c (output): Don't free the grammar.
9105 * src/reader.c (grammar_free): New.
9106 * src/main.c (main): Call it and don't free symtab here.
9107
55024580
AD
91082002-03-04 Akim Demaille <akim@epita.fr>
9109
9110 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
9111 before returning.
9112 Reported by Benoit Perrot.
9113
f9abaa2c
AD
91142002-03-04 Akim Demaille <akim@epita.fr>
9115
9116 Use bitset operations when possible, not loops over bits.
9117
9118 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
9119 bitset_or.
9120 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
9121 * src/reduce.c (useless_nonterminals): Formatting changes.
9122 * src/warshall.c (TC): Use bitset_or.
9123
0e721e75
AD
91242002-03-04 Akim Demaille <akim@epita.fr>
9125
9126 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
9127 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
9128 Ditto.
9129
0fb1ffb1
AD
91302002-03-04 Akim Demaille <akim@epita.fr>
9131
9132 * src/lalr.c (F): Now a bitset*.
9133 Adjust all dependencies.
9134
b86796bf
AD
91352002-03-04 Akim Demaille <akim@epita.fr>
9136
9137 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
9138 Adjust all dependencies.
9139
602bbf31
AD
91402002-03-04 Akim Demaille <akim@epita.fr>
9141
9142 * src/L0.c, src/LR0.h (nstates): Be size_t.
9143 Adjust comparisons (signed vs unsigned).
9144 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
9145 bitset*.
9146 Adjust all dependencies.
9147
d8a0245c
AD
91482002-03-04 Akim Demaille <akim@epita.fr>
9149
9150 * src/closure.c (firsts): Now, also a bitset.
9151 Adjust all dependencies.
9152 (varsetsize): Remove, now unused.
9153 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
9154
34ba9743
AD
91552002-03-04 Akim Demaille <akim@epita.fr>
9156
9157 * src/print.c: Convert to use bitset.h, not hand coded iterations
9158 over ints.
9159
ed86e78c
AD
91602002-03-04 Akim Demaille <akim@epita.fr>
9161
9162 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
9163
dfdb1797
AD
91642002-03-04 Akim Demaille <akim@epita.fr>
9165
9166 * src/closure.c (ruleset): Be a bitset.
9167 (rulesetsize): Remove.
9168
7086e707
AD
91692002-03-04 Akim Demaille <akim@epita.fr>
9170
9171 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
9172 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
9173 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
9174 * src/closure.c (fderives): Be an array of bitsets.
9175
98254360
RA
91762002-02-28 Robert Anisko <robert@lrde.epita.fr>
9177
9178 * data/bison.c++: Merge the two generated headers. Insert a copyright
9179 notice in each output file.
9180
a75c057f
AD
91812002-02-28 Akim Demaille <akim@epita.fr>
9182
9183 * data/bison.c++: Copy the prologue of bison.simple to fetch
9184 useful M4 definitions, such as b4_header_guard.
9185
06b00abc
AD
91862002-02-25 Akim Demaille <akim@epita.fr>
9187
9188 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
9189 translator friendly scheme for the bgr
9190 copyright notice.
06b00abc 9191
70e7d534
AD
91922002-02-25 Akim Demaille <akim@epita.fr>
9193
9194 * src/output.c (header_output): Remove, now handled completely via
9195 M4.
9196
abe017f6
AD
91972002-02-25 Akim Demaille <akim@epita.fr>
9198
9199 * m4/m4.m4: New, from CVS Autoconf.
9200 * configure.in: Invoke it.
9201 * src/output.c (output_skeleton): Use its result instead of the
9202 hard coded name.
9203
381fb12e
AD
92042002-02-25 Akim Demaille <akim@epita.fr>
9205
9206 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
9207 Fileutils 4.1.5.
9208 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
9209 * src/output.c (output_skeleton): Use mkstemp to create a real
9210 temporary file.
9211 Move the filling of `skeleton' and its muscle to...
9212 (prepare): here.
9213 (output): Move the definition of the prologue muscle to...
9214 (prepare): here.
9215 * src/system.h (DEFAULT_TMPDIR): New.
9216
6f38107f
PE
92172002-02-14 Paul Eggert <eggert@twinsun.com>
9218
9219 Remove the support for C++ namespace cleanliness; it was
9220 causing more problems than it was curing, since it didn't work
9221 properly on some nonstandard C++ compilers. This can wait
9222 for a proper C++ parser.
9223
9224 * NEWS: Document this.
9225 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
9226 of C++, as it's treated like C now.
9227 * src/bison.simple (YYSTD): Remove.
9228 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
9229 Treat C++ just like Standard C instead of trying to support
9230 namespace cleanliness.
9231
80cce3da
AD
92322002-02-14 Akim Demaille <akim@epita.fr>
9233
9234 * tests/regression.at (else): Adjust to Andreas' change.
9235
842e8679
AD
92362002-02-14 Akim Demaille <akim@epita.fr>
9237
9238 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
9239
4bda3f10
AD
92402002-02-13 Andreas Schwab <schwab@suse.de>
9241
9242 * src/output.c (output_rule_data): Don't output NULL, it might
9243 not be defined yet.
9244
4162fa07 92452002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 9246
4162fa07
RA
9247 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
9248 (Copyright notice): Update.
b418ecd8 9249
bd16a5dc
AD
92502002-02-11 Akim Demaille <akim@epita.fr>
9251
9252 * tests/regression.at (%nonassoc and eof): Don't include
9253 nonportable headers.
9254
8d69a1a3
RA
92552002-02-08 Robert Anisko <robert@lrde.epita.fr>
9256
9257 * data/bison.c++: Correct error recovery. Make the user able to
9258 initialize the starting location.
9259
9b2d0677
AD
92602002-02-07 Akim Demaille <akim@epita.fr>
9261
9262 * tests/input.at: New.
9263
69e2658b
RA
92642002-02-07 Robert Anisko <robert@lrde.epita.fr>
9265
9266 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 9267 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
9268 directives around tables only needed for debugging.
9269
4aacc3a7
RA
92702002-02-07 Robert Anisko <robert@lrde.epita.fr>
9271
9272 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
9273 C++ parsers.
9274 (yy::b4_name::parse): Use print_.
9275
762a801e
RA
92762002-02-07 Robert Anisko <robert@lrde.epita.fr>
9277
9278 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
9279
4bb2bc3f
RA
92802002-02-07 Robert Anisko <robert@lrde.epita.fr>
9281
9282 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
9283 C++ parsers.
9284 (yy::b4_name::parse): Build verbose error messages, and use error_.
9285
6b45a3ca
RA
92862002-02-06 Robert Anisko <robert@lrde.epita.fr>
9287
9288 * data/bison.c++: Fix m4 quoting in comments.
9289
50997c6e
RA
92902002-02-06 Robert Anisko <robert@lrde.epita.fr>
9291
9292 * data/bison.c++: Adjust the parser code. Fix some muscles that were
9293 not expanded by m4.
9294
3f3eed27
AD
92952002-02-05 Akim Demaille <akim@epita.fr>
9296
9297 * data/bison.c++: Adjust to the M4 back end.
9298 More is certainly needed.
9299
be2a1a68
AD
93002002-02-05 Akim Demaille <akim@epita.fr>
9301
9302 Give a try to M4 as a back end.
9303
9304 * lib/readpipe.c: New, from wdiff.
9305 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
9306 BISON_HAIRY.
9307 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
9308 specific values. Now it is m4 that performs the lookup.
9309 * src/parse-skel.y: Remove.
9310 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
9311 * src/output.c (actions_output, guards_output)
9312 (token_definitions_output): No longer keeps track of the output
9313 line number, hence remove the second argument.
9314 (guards_output): Check against the guard member of a rule, not the
9315 action member.
9316 Adjust callers.
9317 (output_skeleton): Don't look for the skeleton location, let m4 do
9318 that.
9319 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
9320 file will be used.
9321 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
9322 (prepare): Given that for the time being changesyntax is not
9323 usable in M4, rename the muscles using `-' to `_'.
9324 Define `defines_flag', `output_parser_name' and `output_header_name'.
9325 * src/output.h (actions_output, guards_output)
9326 (token_definitions_output): Adjust prototypes.
9327 * src/scan-skel.l: Instead of scanning the skeletons, it now
9328 processes the output of m4: `__oline__' and `#output'.
9329 * data/bison.simple: Adjust to be used by M4(sugar).
9330 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
9331 to date.
9332 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
9333 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
9334 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
9335 shamelessly stolen from CVS Autoconf.
9336
beda758b
AD
93372002-02-05 Akim Demaille <akim@epita.fr>
9338
9339 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
9340 * configure.in: Check for the declarations of free and malloc.
9341 * src/muscle_tab.c: Adjust.
9342
5ece6d43
AD
93432002-02-05 Akim Demaille <akim@epita.fr>
9344
9345 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
9346 which have no values.
9347
5bb18f9a
AD
93482002-02-05 Akim Demaille <akim@epita.fr>
9349
9350 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
9351 * data/: here.
9352
894dd62e
PE
93532002-01-29 Paul Eggert <eggert@twinsun.com>
9354
9355 * src/bison.simple (YYSIZE_T): Do not define merely because
9356 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
9357 On some platforms, <alloca.h> does not declare YYSTD (size_t).
9358
82841af7
AD
93592002-01-27 Akim Demaille <akim@epita.fr>
9360
9361 Fix `%nonassoc and eof'.
9362
9363 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
9364 which were not properly copied! Replace
9365 memcpy (res->errs, src->errs, src->nerrs);
9366 with
9367 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
9368 !!!
9369 * tests/regression.at (%nonassoc and eof): Adjust to newest
9370 Autotest: `.' is not in the PATH.
9371
318b76e9
AD
93722002-01-27 Akim Demaille <akim@epita.fr>
9373
9374 * tests/sets.at (AT_EXTRACT_SETS): New.
9375 (Nullable): Use it.
9376 (Firsts): New.
9377
30d2f3d5
AD
93782002-01-26 Akim Demaille <akim@epita.fr>
9379
9380 * tests/actions.at, tests/calc.at, tests/headers.at,
9381 * tests/torture.at: Adjust to the newest Autotest which no longer
9382 forces `.' in the PATH.
9383
30f8c395
AD
93842002-01-25 Akim Demaille <akim@epita.fr>
9385
9386 * tests/regression.at (%nonassoc and eof): New.
9387 Suggested by Robert Anisko.
9388
29ae55f1
AD
93892002-01-24 Akim Demaille <akim@epita.fr>
9390
9391 Bison dumps core when trying to complain about broken input files.
9392 Reported by Cris van Pelt.
9393
9394 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
9395 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
9396 into...
9397 (Invalid inputs): Strengthen: exercise parse_percent_token.
9398
2b548aa6
RA
93992002-01-24 Robert Anisko <robert.anisko@epita.fr>
9400
9401 * src/Makefile.am: Add bison.c++.
9402 * src/bison.c++: New skeleton.
9403
bb0146c2
AD
94042002-01-21 Paolo Bonzini <bonzini@gnu.org>
9405
9406 * po/it.po: New.
9407
bec30531
AD
94082002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
9409
9410 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
9411
fc6edc45
MA
94122002-01-20 Marc Autret <marc@gnu.org>
9413
9414 * src/files.c (compute_output_file_names): Fix
9415
5e5d5415
MA
94162002-01-20 Marc Autret <marc@gnu.org>
9417
9418 * tests/output.at: New test.
9419 * src/files.c (compute_base_names): Don't map extensions when
9420 the YACC flag is set, use defaults.
9421 Reported by Evgeny Stambulchik.
9422
44ea3fbd
MA
94232002-01-20 Marc Autret <marc@gnu.org>
9424
ba0fe3c7
PE
9425 * src/system.h: Need to define __attribute__ away for non-GCC
9426 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
9427 Suggested by Albert Chin-A-Young.
9428
338963d1
TVH
94292002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
9430
9431 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
9432 canonical definition.
9433 * src/system.h: Use the canonical definition for PARAMS (avoids
9434 a conflict with the macro from lib/hash.h).
9435
c57b2479
AD
94362002-01-11 Akim Demaille <akim@epita.fr>
9437
9438 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 9439 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 9440
b85810ae
AD
94412002-01-09 Akim Demaille <akim@epita.fr>
9442
9443 * src/files.c, src/files.h (output_infix): New.
9444 (tab_extension): Remove.
9445 (compute_base_names): Compute the former, drop the latter.
9446 * src/output.c (prepare): Insert the muscles `output-infix', and
9447 `output-suffix'.
9448 * src/parse-skel.y (string, string.1): New.
9449 (section.header): Use it.
9450 (section.yacc): Remove.
9451 (prefix): Remove too.
9452 * src/scan-skel.l: Adjust.
9453 * src/bison.simple, src/bison.hairy: Adjust.
9454
cae60122
AD
94552002-01-09 Akim Demaille <akim@epita.fr>
9456
9457 * configure.in (WERROR_CFLAGS): Compute it.
9458 * src/Makefile.am (CFLAGS): Pass it.
9459 * tests/atlocal.in (CFLAGS): Idem.
9460 * src/files.c: Fix a few warnings.
9461 (get_extension_index): Remove, unused.
9462
ae404801
AD
94632002-01-08 Akim Demaille <akim@epita.fr>
9464
9465 * src/getargs.c (AS_FILE_NAME): New.
9466 (getargs): Use it to convert DOSish file names.
9467 * src/files.c (base_name): Rename as full_base_name to avoid
9468 clashes with `base_name ()'.
9469 (filename_split): New.
9470 (compute_base_names): N-th rewrite, using filename_split.
9471
22312b71
AD
94722002-01-08 Akim Demaille <akim@epita.fr>
9473
9474 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
9475 New, stolen from the Fileutils 4.1.
9476 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
9477 * configure.in: Check for the presence of memrchr, and of its
9478 prototype.
9479
a67cef01
TVH
94802002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
9481
9482 * lib/hash.h (__P): Added definition for this macro.
9483 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
9484 BUILT_SOURCES, to ensure they are generated first.
9485 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
9486 %error-verbose to allow bootstrapping with bison 1.30x.
9487
2b25d624
AD
94882002-01-06 Akim Demaille <akim@epita.fr>
9489
9490 * src/reader.c (parse_braces): Don't fetch the next char, the
9491 convention is to fetch on entry.
9492 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
9493 'switch' without a following semicolon.
9494 * tests/regression.at (braces parsing): New.
9495
3460813b
AD
94962002-01-06 Akim Demaille <akim@epita.fr>
9497
9498 Bison is dead wrong in its RR conflict reports.
9499
9500 * tests/torture.at (GNU Cim Grammar): New.
9501 * src/conflicts.c (count_rr_conflicts): Fix.
9502
73784c64
AD
95032002-01-06 Akim Demaille <akim@epita.fr>
9504
9505 Creating package.m4 from configure.ac causes too many problems.
9506
9507 * tests/Makefile.am (package.m4): Create it by hand,
9508 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
9509
25d81090
AD
95102002-01-06 Akim Demaille <akim@epita.fr>
9511
9512 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
9513 skeleton.h.
9514
a9b8959e
PE
95152002-01-04 Paul Eggert <eggert@twinsun.com>
9516
9517 * doc/bison.texinfo (Debugging):
9518 Remove YYSTDERR; it's no longer defined or used.
9519 Also, s/cstdio.h/cstdio/.
9520
25d81090
AD
95212002-01-03 Akim Demaille <akim@epita.fr>
9522
9523 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
9524
1109455c
AD
95252002-01-03 Akim Demaille <akim@epita.fr>
9526
9527 * src/parse-skel.y (process_skeleton): Don't bind the parser's
9528 tracing code to --trace, wait for a better --trace option, with
9529 args.
9530
7ea5e977
AD
95312002-01-03 Akim Demaille <akim@epita.fr>
9532
9533 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
9534 The ISO C++ standard is extremely clear about it: stderr is
9535 considered a macro, not a regular symbol (see table 94 `Header
9536 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
9537 Therefore std:: does not apply to it. It still does with fprintf.
9538 Also, s/cstdio.h/cstdio/.
9539
fab5b110
AD
95402002-01-03 Akim Demaille <akim@epita.fr>
9541
9542 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
9543 for non system headers.
9544
aed7fd9b
AD
95452002-01-02 Akim Demaille <akim@epita.fr>
9546
9547 Equip the skeleton chain with location tracking, runtime trace,
9548 pure parser and scanner.
9549
9550 * src/parse-skel.y: Request a pure parser, locations, and prefix
9551 renaming.
9552 (%union): Having several members with the same type does not help
9553 type mismatches, simplify.
9554 (YYPRINT, yyprint): New.
9555 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
9556 (skel_error): this.
9557 Handle locations.
9558 * src/scan-skel.l: Adjust to these changes.
9559 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
9560 (LOCATION_PRINT, skel_control_t): New.
9561
24fad99e
AD
95622001-12-30 Akim Demaille <akim@epita.fr>
9563
9564 * src/parse-skel.y: Get rid of the shift/reduce conflict:
9565 replace `gb' with BLANKS.
9566 * src/scan-skel.l: Adjust.
9567
a4b36db4
AD
95682001-12-30 Akim Demaille <akim@epita.fr>
9569
9570 * src/system.h: We don't need nor want bcopy.
9571 Throw away MS-DOS crap: we don't need getpid.
9572 * configure.in: We don't need strndup. It was even causing
9573 problems: because Flex includes the headers *before* us,
9574 _GNU_SOURCE is not defined by config.h, and therefore strndup was
9575 not visible.
9576 * lib/xstrndup.c: New.
9577 * src/scan-skel.l: Use it.
9578 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
9579 * src/parse-skel.y: Use %directives instead of #defines.
9580
1239777d
AD
95812001-12-30 Akim Demaille <akim@epita.fr>
9582
9583 * src/skeleton.h: New.
9584 * src/output.c (output_parser, output_master_parser): Remove, dead
9585 code.
9586 * src/output.h (get_lines_number, actions_output, guards_output)
9587 (token_definitions_output): Prototype them.
9588 * src/parse-skel.y: Add the license notice.
9589 Include output.h and skeleton.h.
9590 (process_skeleton): Returns void, and takes a single parameter.
9591 * src/scan-skel.l: Add the license notice.
9592 Include skeleton.h.
9593 Don't use %option yylineno: it seems that then Flex imagines
9594 REJECT has been used, and therefore it won't reallocate its
9595 buffers (which makes no other sense to me than a bug). It results
9596 in warnings for `unused: yy_flex_realloc'.
9597
9b3add5b
RA
95982001-12-30 Robert Anisko <robert.anisko@epita.fr>
9599
9600 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
9601 (MUSCLE_INSERT_PREFIX): ...to there.
9602 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
9603 (MUSCLE_INSERT_PREFIX): Move from here...
9604
9605 * src/bison.hairy: Add a section directive. Put braces around muscle
9606 names. This parser skeleton is still broken, but Bison should not
9607 choke on a bad muscle 'syntax'.
9608 * src/bison.simple: Add a section directive. Put braces around muscle
9609 names.
9610
9611 * src/files.h (strsuffix, stringappend): Add declarations.
9612 (tab_extension): Add declaration.
9613 (short_base_name): Add declaration.
9614
9615 * src/files.c (strsuffix, stringappend): No longer static. These
9616 functions are used in the skeleton parser.
9617 (tab_extension): New.
9618 (compute_base_names): Use the computations done in this function
fab5b110 9619 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
9620 names.
9621 (short_base_name): No longer static.
9622
9623 * src/output.c (output_skeleton): New.
9624 (output): Disable call to output_master_parser, and give a try to
9625 a new skeleton handling system.
9626 (guards_output, actions_output): No longer static.
9627 (token_definitions_output, get_lines_number): No longer static.
9628
9629 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
9630
fab5b110 9631 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
9632 parse-skel.y.
9633
9634 * src/parse-skel.y: New file.
9635 * src/scan-skel.l: New file.
9636
b5b61c61
AD
96372001-12-29 Akim Demaille <akim@epita.fr>
9638
9639 %name-prefix is broken.
9640
9641 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
9642 Adjust all dependencies.
9643 * tests/headers.at (export YYLTYPE): Strengthen this test: use
9644 %name-prefix.
9645
9646 Renaming yylval but not yylloc is not consistent. Now we do.
9647
9648 * src/bison.simple: Prefix yylloc if used.
9649 * doc/bison.texinfo (Decl Summary): Document that.
9650
8c9a50be
AD
96512001-12-29 Akim Demaille <akim@epita.fr>
9652
9653 * doc/bison.texinfo: Promote `%long-directive' over
9654 `%long_directive'.
9655 Remove all references to fixed-output-files, yacc is enough.
9656
d99361e6
AD
96572001-12-29 Akim Demaille <akim@epita.fr>
9658
9659 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
9660 user prologue. These are defaults.
9661 * tests/actions.at (Mid-rule actions): Make sure the user can
9662 define YYDEBUG and YYERROR_VERBOSE.
9663
b9cecb91
AD
96642001-12-29 Akim Demaille <akim@epita.fr>
9665
9666 * src/output.c (header_output): Don't forget to export YYLTYPE and
9667 yylloc.
9668 * tests/headers.at (export YYLTYPE): New, make sure it does.
9669 * tests/regression.at (%union and --defines, Invalid CPP headers):
9670 Move to...
9671 * tests/headers.at: here.
9672
aea13e97
AD
96732001-12-29 Akim Demaille <akim@epita.fr>
9674
9675 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
9676
931394cb
AD
96772001-12-29 Akim Demaille <akim@epita.fr>
9678
9679 * tests/actions.at (Mid-rule actions): Output on a single line
9680 instead of several.
9681
704a47c4
AD
96822001-12-29 Akim Demaille <akim@epita.fr>
9683
9684 * doc/bison.texinfo: Formatting changes.
9685
091e20bb
AD
96862001-12-29 Akim Demaille <akim@epita.fr>
9687
9688 Don't store the token defs in a muscle, just be ready to output it
9689 on command. Now possible via `symbols'. Fixes a memory leak.
9690
9691 * src/output.c (token_definitions_output): New.
9692 (output_parser, header_output): Use it.
9693 * src/reader.c (symbols_save): Remove.
9694
cce71710
AD
96952001-12-29 Akim Demaille <akim@epita.fr>
9696
9697 * src/bison.simple: Do not provide a default for YYSTYPE and
9698 YYLTYPE before the user's prologue. Otherwise it's hardly... a
9699 default.
9700
82c035a8
AD
97012001-12-29 Akim Demaille <akim@epita.fr>
9702
9703 Mid-rule actions are simply... ignored!
9704
9705 * src/reader.c (readgram): Be sure to attach mid-rule actions to
9706 the empty-rule associated to the dummy symbol, not to the host
9707 rule.
9708 * tests/actions.at (Mid-rule actions): New.
9709
8419d367
AD
97102001-12-29 Akim Demaille <akim@epita.fr>
9711
9712 Memory leak.
9713
9714 * src/reader.c (reader): Free grammar.
9715
375d5806
AD
97162001-12-29 Akim Demaille <akim@epita.fr>
9717
9718 Memory leak.
9719
9720 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
9721 since it allocates it for each state, although only one is needed.
9722 (allocate_storage): Do it here.
9723
f51cb8ff
AD
97242001-12-29 Akim Demaille <akim@epita.fr>
9725
9726 * src/options.h, src/options.c (create_long_option_table): Rename
9727 as...
9728 (long_option_table_new): this, with a clearer prototype.
9729 (percent_table): Remove, unused,
9730 * src/getargs.c (getargs): Adjust.
9731
29e88316
AD
97322001-12-29 Akim Demaille <akim@epita.fr>
9733
9734 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
9735 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
9736 as states.
9737
b9f71f19
AD
97382001-12-29 Akim Demaille <akim@epita.fr>
9739
9740 * src/lalr.c (build_relations): Rename `states' as `states1'.
9741 Sorry, I don't understand exactly what it is, no better name...
9742
1a2b5d37
AD
97432001-12-29 Akim Demaille <akim@epita.fr>
9744
9745 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
9746 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
9747 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
9748 as rules.
9749
1cca533e
AD
97502001-12-29 Akim Demaille <akim@epita.fr>
9751
9752 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
9753 ago.
9754
c03ae966
AD
97552001-12-29 Akim Demaille <akim@epita.fr>
9756
9757 * src/reader.c, src/reader.h (user_toknums): Remove.
9758 Adjust all users to use symbols[i]->user_token_number.
9759
5a670b1e
AD
97602001-12-29 Akim Demaille <akim@epita.fr>
9761
9762 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
9763 Adjust all users to use symbols[i]->prec or ->assoc.
9764
ad949da9
AD
97652001-12-29 Akim Demaille <akim@epita.fr>
9766
9767 * src/reader.c, src/reader.h (tags): Remove.
9768 Adjust all users to use symbols[i]->tag.
9769
0e78e603
AD
97702001-12-29 Akim Demaille <akim@epita.fr>
9771
9772 * src/gram.h, src/gram.c (symbols): New, similar to state_table
9773 and rule_table.
9774 * src/reader.c (packsymbols): Fill this table.
9775 Drop sprec.
9776 * src/conflicts.c (resolve_sr_conflict): Adjust.
9777 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
9778 single table.
9779 Use symbols[i]->tag instead of tags[i].
9780
213e640e
AD
97812001-12-29 Akim Demaille <akim@epita.fr>
9782
9783 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
9784 In addition, put a comment in there, to replace...
9785 * tests/regression.at (%union and C comments): Remove.
9786
e7b8bef1
AD
97872001-12-29 Akim Demaille <akim@epita.fr>
9788
9789 * tests/regression.at (Web2c Actions): Blindly move the actual
9790 output as expected output. The contents *seem* right to me, but I
9791 can't pretend reading perfectly parser tables... Nonetheless, all
9792 the other tests pass correctly, the table look OK, even though the
9793 presence of `$axiom' is to be noted: AFAICS it is useless (but
9794 harmless).
9795
b68e7744
AD
97962001-12-29 Akim Demaille <akim@epita.fr>
9797
9798 * src/reader.c (readgram): Don't add the rule 0 if there were no
9799 rules read. In other words, add it _after_ having performed
9800 grammar sanity checks.
9801 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
9802
78d5bae9
AD
98032001-12-29 Akim Demaille <akim@epita.fr>
9804
9805 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
9806 visible, and some states have now a different number.
9807
ff442794
AD
98082001-12-29 Akim Demaille <akim@epita.fr>
9809
9810 * src/reader.c (readgram): Bind the initial rule's lineno to that
9811 of the first rule.
9812 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
9813 (Solved SR Conflicts): Adjust rule 0's line number.
9814
610ab194
AD
98152001-12-29 Akim Demaille <akim@epita.fr>
9816
9817 Fix the `GAWK Grammar' failure.
9818
9819 * src/LR0.c (final_state): Initialize to -1 so that we do compute
9820 the reductions of the first state which was mistakenly confused
9821 with the final state because precisely final_state was initialized
9822 to 0.
9823 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
9824 now noticed by Bison.
9825 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
9826 have a reduction on $default.
9827
29d29c8f
AD
98282001-12-29 Akim Demaille <akim@epita.fr>
9829
9830 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
9831 rule line numbers.
9832 * src/closure.c (print_closure): Likewise.
9833 * src/derives.c (print_derives): Likewise.
9834 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
9835 now.
9836
7c6b64d0
AD
98372001-12-29 Akim Demaille <akim@epita.fr>
9838
9839 * src/lalr.c (lookaheads_print): New.
9840 (lalr): Call it when --trace-flag.
9841 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
9842 are dumped.
9843
3d4daee3
AD
98442001-12-29 Akim Demaille <akim@epita.fr>
9845
9846 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
9847 when walking through ritem, even via rule->rhs.
9848 * src/reduce.c (dump_grammar, useful_production, reduce_output)
9849 (useful_production, useless_nonterminals): Likewise.
9850 (reduce_grammar_tables): Likewise, plus update nritems.
9851 * src/nullable.c (set_nullable): Likewise.
9852 * src/lalr.c (build_relations): Likewise.
9853 * tests/sets.at (Nullable): Adjust.
9854 Fortunately, now, the $axiom is no longer nullable.
9855
9e7f6bbd
AD
98562001-12-29 Akim Demaille <akim@epita.fr>
9857
9858 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
9859 the 0-sentinel.
9860 * src/gram.c (ritem_longest_rhs): Likewise.
9861 * src/reduce.c (nonterminals_reduce): Likewise.
9862 * src/print_graph.c (print_graph): Likewise.
9863 * src/output.c (output_rule_data): Likewise.
9864 * src/nullable.c (set_nullable): Likewise.
9865
255ef638
AD
98662001-12-29 Akim Demaille <akim@epita.fr>
9867
9868 * src/output.c: Comment changes.
9869
0d8a7363
AD
98702001-12-27 Paul Eggert <eggert@twinsun.com>
9871
9872 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
9873 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
9874 Sparc, as they were causing more porting problems than the
9875 (minor) performance improvement was worth.
9876
9877 Also, catch up with 1.31's YYSTD.
9878
3db472b9
AD
98792001-12-27 Akim Demaille <akim@epita.fr>
9880
9881 * src/output.c (output_gram): Rely on nritems, not the
9882 0-sentinel. See below.
9883 Use -1 as separator, not 0.
9884 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
9885 Rely on -1 as separator in yyrhs, instead of 0.
9886 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
9887 twice `Now at end of input', therefore there are two lines less to
9888 expect.
9889
b365aa05
AD
98902001-12-27 Akim Demaille <akim@epita.fr>
9891
9892 * tests/regression.at (Unresolved SR Conflicts):
9893 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
9894 below.
9895
30171f79
AD
98962001-12-27 Akim Demaille <akim@epita.fr>
9897
9898 * src/LR0.c (new_state): Recognize the final state by the fact it
9899 is reached by eoftoken.
9900 (insert_start_shifting_state, insert_eof_shifting_state)
9901 (insert_accepting_state, augment_automaton): Remove, since now
9902 these states are automatically computed from the initial state.
9903 (generate_states): Adjust.
9904 * src/print.c: When reporting a rule number to the user, substract
9905 1, so that the axiom rule is rule 0, and the first user rule is 1.
9906 * src/reduce.c: Likewise.
9907 * src/print_graph.c (print_core): For the time being, just as for
9908 the report, depend upon --trace-flags to dump the full set of
9909 items.
9910 * src/reader.c (readgram): Once the grammar read, insert the rule
9911 0: `$axiom: START-SYMBOL $'.
9912 * tests/set.at: Adjust: rule 0 is now displayed, and since the
9913 number of the states has changed (the final state is no longer
9914 necessarily the last), catch up.
9915
75142d45
AD
99162001-12-27 Akim Demaille <akim@epita.fr>
9917
9918 Try to make the use of the eoftoken valid. Given that its value
9919 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
9920 is used instead of > 0 where appropriate, (ii), depend upon nritems
9921 instead of the 0-sentinel.
9922
9923 * src/gram.h, src/gram.c (nritems): New.
9924 Expected to be duplication of nitems, but for the time being...
9925 * src/reader.c (packgram): Assert nritems and nitems are equal.
9926 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
9927 * src/closure.c (print_closure, print_fderives): Likewise.
9928 * src/gram.c (ritem_print): Likewise.
9929 * src/print.c (print_core, print_grammar): Likewise.
9930 * src/print_graph.c: Likewise.
9931
b7c49edf
AD
99322001-12-27 Akim Demaille <akim@epita.fr>
9933
9934 * src/main.c (main): If there are complains after grammar
9935 reductions, then output the report anyway if requested, then die.
9936 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
9937 * src/reader.c (eoftoken): New.
9938 (parse_token_decl): If the token being defined has value `0', it
9939 is the eoftoken.
9940 (packsymbols): No longer hack `tags' to insert `$' by hand.
9941 Be sure to preserve the value of the eoftoken.
9942 (reader): Make sure eoftoken is defined.
9943 Initialize nsyms to 0: now eoftoken is created just like the others.
9944 * src/print.c (print_grammar): Don't special case the eof token.
9945 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
9946 lie anyway, albeit pleasant.
9947 * tests/calc.at: Exercise error messages with eoftoken.
9948 Change the grammar so that empty input is invalid.
9949 Adjust expectations.
9950 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
9951
ec2da99f
AD
99522001-12-27 Akim Demaille <akim@epita.fr>
9953
9954 * configure.in: Check the protos of strchr ans strspn.
9955 Replace strchr if needed.
9956 * src/system.h: Provide the protos of strchr, strspn and memchr if
9957 missing.
9958 * lib/strchr.c: New.
9959 * src/reader.c (symbols_save): Use strchr.
9960
8adfa272
AD
99612001-12-27 Akim Demaille <akim@epita.fr>
9962
9963 * src/print.c, src/print_graph.c (escape): New.
9964 Use it to quote the TAGS outputs.
9965 * src/print_graph.c (print_state): Now errors are in red, and
9966 reductions in green.
9967 Prefer high to wide: output the state number on a line of its own.
9968
80dac38c
AD
99692001-12-27 Akim Demaille <akim@epita.fr>
9970
9971 * src/state.h, src/state.c (reductions_new): New.
9972 * src/LR0.c (set_state_table): Let all the states have a
9973 `reductions', even if reduced to 0.
9974 (save_reductions): Adjust.
9975 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
9976 * src/print.c (print_reductions, print_actions): Adjust.
9977 * src/output.c (action_row): Adjust.
9978
2cec70b9
AD
99792001-12-27 Akim Demaille <akim@epita.fr>
9980
9981 * src/state.h, src/state.c (errs_new, errs_dup): New.
9982 * src/LR0.c (set_state_table): Let all the states have an errs,
9983 even if reduced to 0.
9984 * src/print.c (print_errs, print_reductions): Adjust.
9985 * src/output.c (output_actions, action_row): Adjust.
9986 * src/conflicts.c (resolve_sr_conflict): Adjust.
9987
13ca549a
AD
99882001-12-27 Akim Demaille <akim@epita.fr>
9989
9990 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
9991
5092aba5
AD
99922001-12-27 Akim Demaille <akim@epita.fr>
9993
9994 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
9995 * src/print.c: here.
9996 (lookaheadset, shiftset): New, used as additional storage by
9997 print_reductions.
9998 (print_results): Adjust.
9999 (print_shifts, print_gotos, print_errs): New, extracted from...
10000 (print_actions): here.
10001 * src/print_graph.c (print_actions): Remove dead code.
10002
11e2beca
AD
100032001-12-27 Akim Demaille <akim@epita.fr>
10004
10005 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
10006 `$n' and `@n'.
10007
dac3c910
AD
100082001-12-27 Akim Demaille <akim@epita.fr>
10009
10010 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
10011 (build_relations): Adjust.
10012
d0b0fefa
AD
100132001-12-27 Akim Demaille <akim@epita.fr>
10014
10015 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
10016 duplication.
10017
adc8c848
AD
100182001-12-27 Akim Demaille <akim@epita.fr>
10019
10020 * src/reader.c (packgram): Catch nitems overflows.
10021
14d293ac
AD
100222001-12-27 Akim Demaille <akim@epita.fr>
10023
10024 * src/files.c, src/files.h (guard_obstack): Remove.
10025 * src/output.c (output): Adjust.
10026 * src/reader.c (parse_braces): New, factoring...
10027 (copy_action, copy_guard): these two which are renamed as...
10028 (parse_action, parse_guard): these.
10029 As a voluntary consequence, using braces around guards is now
10030 mandatory.
10031
f499b062
AD
100322001-12-27 Akim Demaille <akim@epita.fr>
10033
10034 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
10035 * src/reader.c (symbol_list): `guard' and `guard_line' are new
10036 members.
10037 (symbol_list_new): Adjust.
10038 (copy_action): action_line is the first line, not the last.
10039 (copy_guard): Just as for actions, store the `action' only, not
10040 the switch/case/break flesh.
10041 Don't parse the user action that might follow the guard, let...
10042 (readgram): do it, i.e., now, there can be an action after a
10043 guard.
10044 In other words the guard is just explicitly optional.
10045 (packgram): Adjust.
10046 * src/output.c (guards_output): New.
10047 (output_parser): Call it when needed.
10048 (output): Also free the guard and attrs obstacks.
10049 * src/files.c, src/files.h (obstack_save): Remove.
10050 (output_files): Remove.
10051 As a result, if one needs the former `.act' file, using an
10052 appropriate skeleton which requires actions and guards is now
10053 required.
10054 * src/main.c (main): Adjust.
10055 * tests/semantic.at: New.
10056 * tests/regression.at: Use `input.y' as input file name.
10057 Avoid 8+3 problems by requiring input.c when the test needs the
10058 parser.
10059
d945f5cd
AD
100602001-12-27 Akim Demaille <akim@epita.fr>
10061
10062 * src/reader.c (symbol_list_new): Be sure to initialize all the
10063 fields.
10064
d200e455
AD
100652001-12-27 Akim Demaille <akim@epita.fr>
10066
10067 All the hacks using a final pseudo state are now useless.
10068
10069 * src/LR0.c (set_state_table): state_table holds exactly nstates.
10070 * src/lalr.c (nLA): New.
10071 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
10072 instead of lookaheadsp from the pseudo state (nstate + 1).
10073
f9507c28
AD
100742001-12-27 Akim Demaille <akim@epita.fr>
10075
10076 * src/output.c (action_row, token_actions): Use a state_t instead
10077 of a integer, and nlookaheads instead of the following state's
10078 lookaheadsp.
10079
065fbd27
AD
100802001-12-27 Akim Demaille <akim@epita.fr>
10081
10082 * src/conflicts.c (log_resolution, flush_shift)
10083 (resolve_sr_conflict, set_conflicts, solve_conflicts)
10084 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
10085 (conflicts_print, print_reductions): Use a state_t instead of an
10086 integer when referring to a state.
10087 As much as possible, depend upon nlookaheads, instead of the
10088 `lookaheadsp' member of the following state (since lookaheads of
10089 successive states are successive, the difference between state n + 1
10090 and n served as the number of lookaheads for state n).
10091 * src/lalr.c (add_lookback_edge): Likewise.
10092 * src/print.c (print_core, print_actions, print_state)
10093 (print_results): Likewise.
10094 * src/print_graph.c (print_core, print_actions, print_state)
10095 (print_graph): Likewise.
10096 * src/conflicts.h: Adjust.
10097
1b177bd7
AD
100982001-12-27 Akim Demaille <akim@epita.fr>
10099
10100 * src/bison.hairy: Formatting/comment changes.
10101 ANSIfy.
10102 Remove `register' indications.
10103 Add plenty of `static'.
10104
7742ddeb
AD
101052001-12-27 Akim Demaille <akim@epita.fr>
10106
10107 * src/output.c (prepare): Drop the muscle `ntbase' which
10108 duplicates ntokens.
10109 * src/bison.simple: Formatting/comment changes.
10110 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
10111 is an undocumented synonym.
10112
1fa14068
AD
101132001-12-22 Akim Demaille <akim@epita.fr>
10114
10115 * src/output.c (output_table_data): Change the prototype to use
10116 `int' for array ranges: some invocations do pass an int, not a
10117 short.
10118 Reported by Wayne Green.
10119
b9752825
AD
101202001-12-22 Akim Demaille <akim@epita.fr>
10121
10122 Some actions of web2c.y are improperly triggered.
10123 Reported by Mike Castle.
10124
10125 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
10126 * tests/regression.at (Web2c): Rename as...
10127 (Web2c Report): this.
10128 (Web2c Actions): New.
10129
776209d6
AD
101302001-12-22 Akim Demaille <akim@epita.fr>
10131
10132 Reductions in web2c.y are improperly reported.
10133 Reported by Mike Castle.
10134
10135 * src/conflicts.c (print_reductions): Fix.
10136 * tests/regression.at (Web2c): New.
10137
275fc3ad
AD
101382001-12-18 Akim Demaille <akim@epita.fr>
10139
10140 Some host fail on `assert (!"foo")', which expands to
10141 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
10142 Reported by Nelson Beebee.
10143
10144 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
10145 `#define it_succeeded 0' and `assert (it_succeeded)'.
10146
897668ee
MA
101472001-12-17 Marc Autret <autret_m@epita.fr>
10148
10149 * src/bison.simple: Don't hard code the skeleton line and filename.
10150 * src/output.c (output_parser): Rename 'line' as 'output_line'.
10151 New line counter 'skeleton_line' (skeleton-line muscle).
10152
ab3399e0
PE
101532001-12-17 Paul Eggert <eggert@twinsun.com>
10154
10155 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
10156 YYDEBUG must be defined to a nonzero value.
10157
10158 * src/bison.simple (yytname): Do not assume that the user defines
10159 YYDEBUG to a properly parenthesized expression.
10160
3877f72b
AD
101612001-12-17 Akim Demaille <akim@epita.fr>
10162
10163 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
10164 nlookaheads is a new member.
10165 Adjust all users.
10166 * src/lalr.h (nlookaheads): Remove this orphan declaration.
10167 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
10168 state.
776209d6 10169
331dbc1b
AD
101702001-12-17 Akim Demaille <akim@epita.fr>
10171
10172 * src/files.h, src/files.c (open_files, close_files): Remove.
10173 * src/main.c (main): Don't open/close files, nor invoke lex_free,
10174 let...
10175 * src/reader.c (reader): Do it.
776209d6 10176
be750e4c
AD
101772001-12-17 Akim Demaille <akim@epita.fr>
10178
10179 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 10180
709ae8c6
AD
101812001-12-17 Akim Demaille <akim@epita.fr>
10182
10183 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
10184 (flush_reduce): New.
10185 (resolve_sr_conflict): Adjust.
776209d6 10186
f87685c3
AD
101872001-12-17 Akim Demaille <akim@epita.fr>
10188
10189 * src/output.c (output_obstack): Be static and rename as...
10190 (format_obstack): this, to avoid any confusion with files.c's
10191 output_obstack.
10192 * src/reader.h (muscle_obstack): Move to...
10193 * src/output.h: here, since it's defined in output.c.
10194
837491d8
AD
101952001-12-17 Akim Demaille <akim@epita.fr>
10196
10197 * src/output.c (action_row, save_column, default_goto)
10198 (sort_actions, matching_state, pack_vector): Better variable
10199 locality.
10200
796d61fb
AD
102012001-12-17 Akim Demaille <akim@epita.fr>
10202
10203 * src/output.c: Various formatting changes.
776209d6 10204
64d15509
AD
102052001-12-17 Akim Demaille <akim@epita.fr>
10206
10207 * src/files.c (output_files): Free the output_obstack.
10208 * src/main.c (main): Call print and print_graph conditionally.
10209 * src/print.c (print): Work unconditionally.
10210 * src/print_graph.c (print_graph): Work unconditionally.
10211 * src/conflicts.c (log_resolution): Output only if verbose_flag.
10212
fbc8ecb7
MA
102132001-12-16 Marc Autret <autret_m@epita.fr>
10214
10215 * src/output.c (actions_output): Fix. When we use %no-lines,
10216 there is one less line per action.
10217
f0440388
MA
102182001-12-16 Marc Autret <autret_m@epita.fr>
10219
10220 * src/bison.simple: Remove a useless #line directive.
10221 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
10222 * src/output.c (get_lines_number): New.
776209d6 10223 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
10224 output muscles.
10225 Fix line numbering.
10226 (actions_output): Computes the number of lines taken by actions.
10227 (output_master_parser): Insert new skeleton which is the name of
10228 the output parser file name.
10229
a79986b8
MA
102302001-12-15 Marc Autret <autret_m@epita.fr>
10231
10232 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
10233
4ec8e00f
MA
102342001-12-15 Marc Autret <autret_m@epita.fr>
10235
10236 * src/output.c (output_gram): Keep track of the hairy one.
10237
1a4648ff
AD
102382001-12-15 Akim Demaille <akim@epita.fr>
10239
10240 Make `make distcheck' work.
10241
10242 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
10243 system.h which uses libgettext.h.
10244
9c2c67e6
AD
102452001-12-15 Akim Demaille <akim@epita.fr>
10246
10247 * src/nullable.c (set_nullable): Useless rules must be skipped,
10248 otherwise, since we range over their symbols, we might look at a
10249 nonterminal which no longer ``exists'', i.e., it is not counted in
10250 `nvars', hence we overflow our arrays.
10251
93ede233
AD
102522001-12-15 Akim Demaille <akim@epita.fr>
10253
10254 The header can also be produced directly, without any obstack!
10255 Yahoo!
10256
10257 * src/files.c, src/files.h (defines_obstack): Remove.
10258 (compute_header_macro): Global.
10259 (defines_obstack_save): Remove.
10260 * src/reader.c (parse_union_decl): No longer output to
10261 defines_obstack: its content can be found in the `stype' muscle
10262 anyway.
10263 (output_token_translations): Merge into...
10264 (symbols_output): this.
10265 Rename as...
10266 (symbols_save): this.
10267 (reader): Adjust.
10268 * src/output.c (header_output): New.
10269 (output): Call it.
10270
2666f928
AD
102712001-12-15 Akim Demaille <akim@epita.fr>
10272
10273 * src/reader.c (parse_union_decl): Instead of handling two obstack
10274 simultaneously, use one to define the `stype' muscle, and use the
10275 value of the latter to fill defines_obstack.
10276 (copy_comment): Remove.
10277 (copy_comment2): Work for a single obstack.
10278 Rename as...
10279 (copy_comment): this.
10280
428046f8
AD
102812001-12-15 Akim Demaille <akim@epita.fr>
10282
10283 * src/lex.c, src/lex.h (xgetc): No longer static.
10284 * src/reader.c (parse_union_decl): Revamp.
10285
ea52d706
AD
102862001-12-15 Akim Demaille <akim@epita.fr>
10287
10288 Still making progress in separating Bison into (i) input, (ii)
10289 process, (iii) output: now we can directly output the parser file
10290 without using table_obstack at all.
10291
10292 * src/files.c, src/files.h (table_obstack): Bye bye.
10293 (parser_file_name): New.
10294 * src/files.c (compute_output_file_names): Compute it.
10295 * src/output.c (actions_output, output_parser)
10296 (output_master_parser): To a file instead of an obstack.
10297
3f96f4dc
AD
102982001-12-15 Akim Demaille <akim@epita.fr>
10299
10300 Attach actions to rules, instead of pre-outputting them to
10301 actions_obstack.
10302
10303 * src/gram.h (rule_t): action and action_line are new members.
10304 * src/reader.c (symbol_list): Likewise.
10305 (copy_action): Save the actions within the rule.
10306 (packgram): Save them in rule_table.
10307 * src/output.c (actions_output): New.
10308 (output_parser): Use it on `%%actions'.
10309 (output_rule_data): Don't free rule_table.
10310 (output): Do it.
10311 (prepare): Don't save the `action' muscle.
10312 * src/bison.simple: s/%%action/%%actions/.
10313
51576fb3
AD
103142001-12-15 Akim Demaille <akim@epita.fr>
10315
10316 * src/reader.c (copy_action): When --yacc, don't append a `;'
10317 to the user action: let it fail if lacking.
dee049eb 10318 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 10319
2648a72d
AD
103202001-12-14 Akim Demaille <akim@epita.fr>
10321
10322 * src/lex.c (literalchar): Simply return the char you decoded, non
10323 longer mess around with obstacks and int pointers.
10324 Adjust all callers.
10325
92790e5b
AD
103262001-12-14 Akim Demaille <akim@epita.fr>
10327
10328 * src/lex.c (literalchar): Don't escape the special characters,
10329 just decode them, and keep them as char (before, eol was output as
10330 the 2 char string `\n' etc.).
10331 * src/output.c (output_rule_data): Use quotearg to output the
10332 token strings.
10333
927c1557
PE
103342001-12-13 Paul Eggert <eggert@twinsun.com>
10335
10336 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
10337 Do not infringe on the global user namespace when using C++.
10338 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
10339 All uses of `fprintf' and `stderr' changed.
10340
10341 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
10342
ed8e1f68
AD
103432001-12-13 Akim Demaille <akim@epita.fr>
10344
10345 The computation of nullable is broken: it doesn't handle empty
10346 RHS's properly.
10347
10348 * tests/torture.at (GNU AWK Grammar): New.
10349 * tests/sets.at (Nullable): New.
10350 * src/nullable.c (set_nullable): Instead of blindly looping over
10351 `ritems', loop over the rules, and then over their rhs's.
10352
10353 Work around Autotest bugs.
10354
10355 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
10356 frame, because Autotest understand lines starting with a `+' as
10357 traces from the shell. Then, they are not processed properly.
10358 Admittedly an Autotest bug, but we don't have time to wait for
10359 Autotest to catch up.
10360 * tests/regression.at (Broken Closure): Adjust to the new table
10361 frames.
10362 Move to...
10363 * tests/sets.at: here.
10364
cb581495
AD
103652001-12-13 Akim Demaille <akim@epita.fr>
10366
10367 * src/closure.c (closure): Use nrules instead of playing tricks
10368 with BITS_PER_WORD.
10369
2e729273
AD
103702001-12-13 Akim Demaille <akim@epita.fr>
10371
10372 * src/print.c (print_actions): Output the handling of `$' as the
10373 traces do: shifting the token EOF. Before EOF was treated as a
10374 nonterminal.
10375 * tests/regression.at: Adjust some tests.
10376 * src/print_graph.c (print_core): Complete the set of items via
10377 closure. The next-to-final and final states are still unsatisfying,
10378 but that's to be addressed elsewhere.
10379 No longer output the rule numbers, but do output the state number.
10380 A single loop for the shifts + gotos is enough, but picked a
10381 distinct color for each.
10382 (print_graph): Initialize and finalize closure.
10383
107f7dfb
AD
103842001-12-13 Akim Demaille <akim@epita.fr>
10385
10386 * src/reader.c (readgram): Remove dead code, an strip useless
10387 braces.
10388 (get_type): Remove, unused.
10389
9b53a24f
AD
103902001-12-12 Akim Demaille <akim@epita.fr>
10391
10392 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
10393 on that of lib/error.c.
10394
dbfb6dcd
AD
103952001-12-12 Akim Demaille <akim@epita.fr>
10396
10397 Some hosts don't like `/' in includes.
10398
10399 * src/system.h: Include libgettext.h without qualifying the path.
10400 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
10401 $(top_srcdir).
10402
c25fb648
MA
104032001-12-11 Marc Autret <autret_m@epita.fr>
10404
10405 * src/output.c (output_parser): Remove useless muscle.
10406
710ddc4f
MA
104072001-12-11 Marc Autret <autret_m@epita.fr>
10408
10409 * src/bison.simple: Remove #line just before %%epilogue. It
10410 is now handled in ...
10411 * src/reader.c (read_additionnal_code): Add the output of a
10412 #line for the epilogue.
10413
e83d80b8
MA
104142001-12-10 Marc Autret <autret_m@epita.fr>
10415
927c1557 10416 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
10417 replace precedent remove.
10418 * src/bison.simple: Remove #line before %%prologue because
10419 %%input-line is wrong at this time.
10420
971d5158
MA
104212001-12-10 Marc Autret <autret_m@epita.fr>
10422
10423 * src/reader.c (symbols_output): Clean up.
927c1557 10424 * src/output.c (output_gram, output): Clean up.
971d5158 10425
5edafffd
AD
104262001-12-10 Akim Demaille <akim@epita.fr>
10427
10428 * src/lalr.c (initialize_lookaheads): New. Extracted from...
10429 * src/LR0.c (set_state_table): here.
10430 * src/lalr.c (lalr): Call it.
10431
0279f8e9
AD
104322001-12-10 Akim Demaille <akim@epita.fr>
10433
10434 * src/state.h (shifts): Remove the `number' member: shifts are
10435 attached to state, hence no longer need to be labelled with a
10436 state number.
10437
190c4f5f
AD
104382001-12-10 Akim Demaille <akim@epita.fr>
10439
10440 Now that states have a complete set of members, the linked list of
10441 shifts is useless: just fill directly the state's shifts member.
10442
10443 * src/state.h (shifts): Remove the `next' member.
10444 * src/LR0.c (first_state, last_state): Remove.
10445 Adjust the callers.
10446 (augment_automaton): Don't look for the shifts that must be added
10447 a shift on EOF: it is those of the state we looked for! But now,
10448 since shifts are attached, it is no longer needed to looking
10449 merely by its id: its number.
10450
2a73b93d
AD
104512001-12-10 Akim Demaille <akim@epita.fr>
10452
10453 * src/LR0.c (augment_automaton): Better variable locality.
10454 Remove an impossible branch: if there is a state corresponding to
10455 the start symbol being shifted, then there is shift for the start
10456 symbol from the initial state.
10457
74392f6a
AD
104582001-12-10 Akim Demaille <akim@epita.fr>
10459
10460 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
10461 only when appropriate: when insert_start_shifting_state' is not
10462 invoked.
10463 * tests/regression.at (Rule Line Numbers): Adjust.
10464
37c82725
AD
104652001-12-10 Akim Demaille <akim@epita.fr>
10466
10467 * src/LR0.c (augment_automaton): Now that all states have shifts,
10468 merge the two cases addition shifts to the initial state.
10469
6a164e0c
AD
104702001-12-10 Akim Demaille <akim@epita.fr>
10471
10472 * src/lalr.c (set_state_table): Move to...
10473 * src/LR0.c: here.
10474 * src/lalr.c (lalr): Don't call it...
10475 * src/LR0.c (generate_states): do it.
10476 * src/LR0.h (first_state): Remove, only the table is used.
10477
7215de24
AD
104782001-12-10 Akim Demaille <akim@epita.fr>
10479
10480 * src/LR0.h (first_shift, first_reduction): Remove.
10481 * src/lalr.c: Don't use first_shift: find shifts through the
10482 states.
10483
80e25d4d
AD
104842001-12-10 Akim Demaille <akim@epita.fr>
10485
10486 * src/LR0.c: Attach shifts to states as soon as they are
10487 computed.
10488 * src/lalr.c (set_state_table): Instead of assigning shifts to
10489 state, just assert that the mapping was properly done.
10490
0ab3728b
AD
104912001-12-10 Akim Demaille <akim@epita.fr>
10492
10493 * src/LR0.c (insert_start_shift): Rename as...
10494 (insert_start_shifting_state): this.
10495 (insert_eof_shifting_state, insert_accepting_state): New.
10496 (augment_automaton): Adjust.
10497 Better locality of the variables.
10498 When looking if the start_symbol is shifted from the initial
10499 state, using `while (... symbol != start_symbol ...)' sounds
10500 better than `while (... symbol < start_symbol ...)': If fail
10501 to see how the order between symbols could be relevant!
10502
78af9bbc
AD
105032001-12-10 Akim Demaille <akim@epita.fr>
10504
10505 * src/getargs.h: Don't declare `spec_name_prefix' and
10506 `spec_file_prefix', declared by src/files.h.
10507 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
10508 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
10509 * src/output.c (prepare): Adjust.
10510 * src/reader.c (symbols_output): Likewise.
10511 * src/vmsgetargs.c: Vaguely adjust, but who cares?
10512
bdef2a41
AD
105132001-12-10 Akim Demaille <akim@epita.fr>
10514
10515 * src/muscle_tab.c (muscle_init): NULL is a better default than
10516 `"0"'.
10517
3735969c
AD
105182001-12-10 Akim Demaille <akim@epita.fr>
10519
10520 * src/reader.c (reader): Calling symbols_output once is enough.
10521
49701457
AD
105222001-12-10 Akim Demaille <akim@epita.fr>
10523
10524 Now that states have a complete set of members, the linked list of
10525 reductions is useless: just fill directly the state's reductions
10526 member.
10527
10528 * src/state.h (struct reductions): Remove member `number' and
10529 `next'.
10530 * src/LR0.c (first_reduction, last_reduction): Remove.
10531 (save_reductions): Don't link the new reductions, store them in
10532 this_state.
10533 * src/lalr.c (set_state_table): No need to attach reductions to
10534 states, it's already done.
10535 * src/output.c (output_actions): No longer free the shifts, then
10536 the reductions, then the states: free all the states and their
10537 members.
10538
0edad749
AD
105392001-12-10 Akim Demaille <akim@epita.fr>
10540
10541 * src/options.c (OPTN, DRTV, BOTH): New.
10542 (option_table): Use them.
10543
0edad749
AD
10544 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
10545 the job of system.h.
10546 * src/options.c: Don't include stdio.h and xalloc.h for the same
10547 reasons.
10548
5449dd0f
AD
105492001-12-10 Akim Demaille <akim@epita.fr>
10550
10551 * src/output.c (output, prepare): Make sure the values of the
10552 muscles `action' and `prologue' are 0-terminated.
10553
a870c567
AD
105542001-12-10 Akim Demaille <akim@epita.fr>
10555
10556 Clean up GCC warnings.
10557
10558 * src/reader.c (copy_action): `buf' is not used.
10559 (parse_skel_decl): Be static.
10560 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
10561 * src/options.h (create_long_option_table): Have a real prototype.
10562 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
10563 (hash_delete_at): Return const void *.
10564 Adjust casts to preserve the const.
10565
80df8768
AD
105662001-12-10 Akim Demaille <akim@epita.fr>
10567
10568 * configure.in: Require 2.52g.
10569 M4 is not needed, but AUTOM4TE is.
10570 * m4/m4.m4: Remove.
10571 * tests/Makefile.am: Adjust.
10572
f693ad14
AD
105732001-12-10 Akim Demaille <akim@epita.fr>
10574
10575 One structure for states is enough, even though theoretically
10576 there are LR(0) states and LALR(1) states.
10577
10578 * src/lalr.h (state_t): Remove.
10579 (state_table): Be state_t **, not state_t *.
10580 * src/state.h (core, CORE_ALLOC): Rename as...
10581 (state_t, STATE_ALLOC): this.
10582 Add the LALR(1) members: shifts, reductions, errs.
10583 * src/LR0.c (state_table): Rename as...
10584 (state_hash): this, to avoid name clashes with the global
10585 `state_table'.
10586 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
10587 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
10588
74ffbcb6
AD
105892001-12-10 Akim Demaille <akim@epita.fr>
10590
10591 Bison dumps core on bash.y.
10592 Reported by Pascal Bart.
10593
10594 * src/warshall.c (bitmatrix_print): New.
10595 (TC): Use it.
ba0fe3c7 10596 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
10597 j must be the outer loop.
10598 * tests/regression.at (Broken Closure): New.
10599
07708e19
AD
106002001-12-05 Akim Demaille <akim@epita.fr>
10601
10602 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
10603 its argument.
ba1ecc07 10604 Reported by Peter Hamorsky.
07708e19 10605
92b16366
AD
106062001-12-05 Akim Demaille <akim@epita.fr>
10607
10608 * src/conflicts.c (err_table): Remove.
10609 (resolve_sr_conflict): Adjust.
10610 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
10611 Rename as...
10612 (state_t.reductions, state_t.shifts): this.
10613
076ab033
AD
106142001-12-05 Akim Demaille <akim@epita.fr>
10615
10616 * src/reduce.c (reduce_grammar_tables): No longer disable the
10617 removal of useless rules via CPP but via `if (0)', so that the
10618 compiler still check the code is valid.
10619 For instance, it should have noticed `rline' no longer exists: use
10620 the `line' member of rule_t.
10621 * src/gram.c (dummy, rline): Remove, unused.
10622
3843c413
AD
106232001-12-05 Akim Demaille <akim@epita.fr>
10624
10625 * src/output.c (pack_vector): Use assert, not berror.
10626 * src/main.c (berror): Remove, unused.
10627
43168960
AD
106282001-12-05 Akim Demaille <akim@epita.fr>
10629
10630 New experimental feature: if --verbose --trace output all the
10631 items of a state, not only its kernel.
10632
10633 * src/print.c (print_core): If `trace_flag', then invoke closure
10634 before outputting the items of the state (print_core is no longer
10635 a correct name them).
10636 (print_results): Invoke new_closure/free_closure if needed.
10637
b2872512
AD
106382001-12-05 Akim Demaille <akim@epita.fr>
10639
10640 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
10641 * src/closure.c, src/closure.h (itemsetsize): Rename as...
10642 (nitemset): for consistency with the rest of the project.
10643
23cbcc6c
AD
106442001-12-05 Akim Demaille <akim@epita.fr>
10645
10646 * src/closure.c (print_closure): Improve.
10647 (closure): Use it for printing input and output.
10648
03ec521c
AD
106492001-12-05 Akim Demaille <akim@epita.fr>
10650
10651 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
10652 indexed by nonterminals.
10653
3a7456dd
AD
106542001-12-05 Akim Demaille <akim@epita.fr>
10655
10656 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
10657 what it was!).
10658 * src/warshall.h: Remove accidental duplication of the content.
10659
1cbcf2e7
AD
106602001-12-05 Akim Demaille <akim@epita.fr>
10661
10662 * src/closure.c (set_fderives): De-obfuscate.
10663
84182270
AD
106642001-12-05 Akim Demaille <akim@epita.fr>
10665
10666 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
10667
3f6f053c
AD
106682001-12-05 Akim Demaille <akim@epita.fr>
10669
10670 * src/closure.c (set_firsts): De-obfuscate.
10671
7a5350ba
AD
106722001-12-05 Akim Demaille <akim@epita.fr>
10673
10674 * src/output.c (action_row): De-obfuscate
10675 using the good o' techniques: arrays not pointers, variable
10676 locality, BITISSET, RESETBIT etc.
10677
d954473d
AD
106782001-12-05 Akim Demaille <akim@epita.fr>
10679
10680 Pessimize the code to simplify it: from now on, all the states
10681 have a valid SHIFTS, which NSHIFTS is possibly 0.
10682
10683 * src/LR0.c (shifts_new): Be global and move to..
10684 * src/state.c, src/state.h: here.
10685 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
10686 * src/print_graph: Adjust.
10687
9839bbe5
AD
106882001-12-05 Akim Demaille <akim@epita.fr>
10689
10690 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
10691 * src/conflicts.c: Use it.
10692 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
10693 incorrectly ``simplified''.
10694
9f136c07
AD
106952001-12-05 Akim Demaille <akim@epita.fr>
10696
10697 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
10698 using the good o' techniques: arrays not pointers, variable
10699 locality, BITISSET, RESETBIT etc.
10700
b608206e
AD
107012001-12-05 Akim Demaille <akim@epita.fr>
10702
10703 * src/state.h (SHIFT_SYMBOL): New.
10704 * src/conflicts.c: Use it to deobfuscate.
10705
52afa962
AD
107062001-12-05 Akim Demaille <akim@epita.fr>
10707
10708 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
10709 (print_reductions): De-obfuscate using the good o' techniques:
10710 arrays not pointers, variable locality, BITISSET.
10711
e74dc321
AD
107122001-12-05 Akim Demaille <akim@epita.fr>
10713
10714 * src/conflicts.c (print_reductions): Arrays, not pointers.
10715 Use BITISSET.
10716
768fca83
AD
107172001-12-05 Akim Demaille <akim@epita.fr>
10718
10719 * src/conflicts.c (print_reductions): Pessimize, but clarify.
10720
a17e599f
AD
107212001-12-05 Akim Demaille <akim@epita.fr>
10722
10723 * src/conflicts.c (print_reductions): Improve variable locality.
10724
a04bc341
AD
107252001-12-05 Akim Demaille <akim@epita.fr>
10726
10727 * src/conflicts.c (print_reductions): Pessimize, but clarify.
10728
c8ea038e
AD
107292001-12-05 Akim Demaille <akim@epita.fr>
10730
10731 * src/conflicts.c (print_reductions): Improve variable locality.
10732
aa2aab3c
AD
107332001-12-05 Akim Demaille <akim@epita.fr>
10734
10735 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
10736 * src/lalr.c: Use them.
10737
b178c8cc
AD
107382001-12-05 Akim Demaille <akim@epita.fr>
10739
10740 * src/LR0.c (augment_automaton): Formatting changes.
10741 Better variable locality.
10742
f67d13aa
AD
107432001-12-05 Akim Demaille <akim@epita.fr>
10744
10745 * src/lalr.c (matrix_print): New.
10746 (transpose): Use it.
10747 Use arrays instead of pointers.
10748
c2713865
AD
107492001-12-05 Akim Demaille <akim@epita.fr>
10750
10751 * src/lalr.c (maxrhs): Move to...
10752 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
10753 * src/lalr.c (build_relations): Adjust.
10754
9887c18a
AD
107552001-12-05 Akim Demaille <akim@epita.fr>
10756
10757 * src/lalr.c (transpose): Free the memory allocated to the
10758 argument, as it is replaced by the results by the unique caller.
10759 (build_relations): Merely invoke transpose: it handles the memory
10760 deallocation.
10761 Improve variable locality.
10762 Avoid variables used as mere abbreviations.
10763 (compute_lookaheads): Use arrays instead of pointers.
10764
4d4f699c
AD
107652001-12-05 Akim Demaille <akim@epita.fr>
10766
10767 * src/lalr.c (initialize_F): Improve variable locality.
10768 Avoid variables used as mere abbreviations.
10769
80a69750
AD
107702001-12-05 Akim Demaille <akim@epita.fr>
10771
10772 * src/derives.c (print_derives): Display the ruleno.
10773 * src/lalr.c (initialize_F, transpose): Better variable locality
10774 to improve readability.
10775 Avoid variables used as mere abbreviations.
10776
fe961097
AD
107772001-12-05 Akim Demaille <akim@epita.fr>
10778
10779 * src/lalr.c (traverse): Use arrays instead of pointers.
10780
e3e4e814
AD
107812001-12-05 Akim Demaille <akim@epita.fr>
10782
10783 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
10784 the handling of squeue.
10785 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
10786
630e182b
AD
107872001-12-05 Akim Demaille <akim@epita.fr>
10788
10789 Because useless nonterminals are now kept alive (instead of being
10790 `destroyed'), we now sometimes examine them, and store information
10791 related to them. Hence we need to know their number, and adjust
10792 memory allocations.
10793
10794 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
10795 static.
10796 * src/LR0.c (allocate_itemsets): The memory allocated to
10797 `symbol_count' was used for two different purpose: once to count
10798 the number of occurrences of each symbol, and later reassigned to
10799 `shift_symbol', containing the symbol that can be shifted from a
10800 given state.
10801 Deobfuscate, i.e., allocate, use and free `symbol_count' here
10802 only, and...
10803 (new_itemsets): Allocate `shift_symbol' here.
10804 (allocate_itemsets): symbol_count includes useless nonterminals.
10805 Make room for them.
10806 (free_storage): Use `free', not `XFREE', for pointers that cannot
10807 be null.
10808
81b51460
AD
108092001-12-05 Akim Demaille <akim@epita.fr>
10810
10811 * src/nullable.c (set_nullable): Deobfuscate the handling of
10812 ritem.
10813 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
10814
3067fbef
AD
108152001-12-05 Akim Demaille <akim@epita.fr>
10816
10817 * src/gram.c, src/gram.h (ritem_print): New.
10818 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
10819 (This useless function was defined only to work around VMS linkers
10820 that can't handle compilation units with variables only).
10821 * src/reduce.c (dump_grammar): Use it to trace the construction of
10822 ritem.
10823
c2bea5f9
PE
108242001-12-04 Paul Eggert <eggert@twinsun.com>
10825
7d27c823
PE
10826 * src/bison.simple (union yyalloc): Change member names
10827 to be the same as the stack names.
10828 (yyparse): yyptr is now union yyalloc *, not char *.
10829 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
10830 and may generate better code on some machines.
c2bea5f9
PE
10831 (yystpcpy): Use prototype if __STDC__ is defined, not just
10832 if __cplusplus is defined.
35687a9d 10833
2c8a9dfa
AD
108342001-11-30 Akim Demaille <akim@epita.fr>
10835
10836 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
10837 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
10838 Gettext doesn't compile cleanly, and dies with -Werror.
10839 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
10840 Include WARNING_CFLAGS here.
10841 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
10842 before being defined.
10843
f4e421e6
AD
108442001-11-27 Paul Eggert <eggert@twinsun.com>
10845
10846 * lib/quotearg.h (quotearg_n, quotearg_n_style):
10847 First arg is int, not unsigned.
10848 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
10849 (SIZE_MAX, UINT_MAX): New macros.
10850 (quotearg_n_options): Abort if N is negative.
10851 Avoid overflow check on hosts where size_t is 64 bits and int
10852 is 32 bits, as overflow is impossible there.
10853 Fix off-by-one typo that caused unnecessary reallocation.
10854
7093d0f5
AD
108552001-11-29 Paul Eggert <eggert@twinsun.com>
10856
10857 Name space cleanup in generated parser.
10858
10859 * doc/bison.texinfo (Bison Parser): Discuss system headers
10860 and their effect on the user name space.
10861
10862 * src/bison.simple:
10863 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
10864 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
10865 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
10866
10867 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
10868 on user names when possible.
10869
10870 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
10871 Simplify test for whather <alloca.h> exists.
10872
10873 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
10874
10875 (<stdio.h>): Include if YYDEBUG.
10876
10877 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
10878 ! defined (yyoverflow) && ! defined (yymemcpy).
10879
10880 (yymemcpy, yyparse): Rename local variables as needed so that
10881 they all begin with 'yy'.
10882
10883 (yystrlen, yystpcpy): New functions.
10884
10885 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
10886 All uses changed.
10887
10888 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
10889 instead of relying on string.h functions. Use YYSTACK_ALLOC
10890 and YYSTACK_FREE instead of malloc and free.
10891
fd51e5ff
AD
108922001-11-30 Akim Demaille <akim@epita.fr>
10893
10894 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
10895 before their first uses.
10896 (YYBISON, YYPURE): Move to the top of the output.
10897
7d13ff5f
AD
108982001-11-30 Akim Demaille <akim@epita.fr>
10899
10900 * tests/reduce.at (Useless Nonterminals): Fix.
10901
892a3995
AD
109022001-11-30 Akim Demaille <akim@epita.fr>
10903
10904 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
10905 if body instead of `;' to pacify GCC's warnings.
10906
68f1e3ed
AD
109072001-11-30 Akim Demaille <akim@epita.fr>
10908
10909 Instead of mapping the LHS of unused rules to -1, keep the LHS
10910 valid, but flag the rules as invalid.
10911
10912 * src/gram.h (rule_t): `useful' is a new member.
10913 * src/print.c (print_grammar): Adjust.
10914 * src/derives.c (set_derives): Likewise.
10915 * src/reader.c (packgram, reduce_output): Likewise.
10916 * src/reduce.c (reduce_grammar_tables): Likewise.
10917 * tests/reduce.at (Underivable Rules, Useless Rules): New.
10918
d2d1b42b
AD
109192001-11-30 Akim Demaille <akim@epita.fr>
10920
10921 * src/reduce.c (reduce_output): Formatting changes.
10922 * src/print.c (print_results, print_grammar): Likewise.
10923 * tests/regression.at (Rule Line Numbers)
10924 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
10925
760b53a8
AD
109262001-11-30 Akim Demaille <akim@epita.fr>
10927
10928 * src/reduce.c (nonterminals_reduce): Instead of throwing away
10929 useless nonterminals, move them at the end of the symbol arrays.
10930 (reduce_output): Adjust.
10931 * tests/reduce.at (Useless Nonterminals): Adjust.
10932
00238958
AD
109332001-11-30 Akim Demaille <akim@epita.fr>
10934
10935 * src/reduce.c: Various comment/formatting changes.
10936 (nonterminals_reduce): New, extracted from...
10937 (reduce_grammar_tables): here.
10938 (reduce_grammar): Call nonterminals_reduce.
10939
396452de
PE
109402001-11-29 Paul Eggert <eggert@twinsun.com>
10941
10942 * src/bison.simple (YYSTACK_REALLOC): Remove.
10943 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
10944 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
10945 New macros.
10946 (union yyalloc): New type.
10947 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
10948 an arbitrary restriction on hosts where size_t is wider than int.
10949
10950 (yyparse): Don't dump core if alloca or malloc fails; instead, report
10951 a parser stack overflow. Allocate just one block of memory for all
10952 three stacks, instead of allocating three blocks; this typically is
10953 faster and reduces fragmentation.
10954
10955 Do not limit the number of items in the stack to a value that fits
10956 in 'int', as this is an arbitrary limit on hosts with 64-bit
10957 size_t and 32-bit int.
10958
147e184c
MA
109592001-11-29 Marc Autret <autret_m@epita.fr>
10960
10961 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
10962 of defining YYERROR_VERBOSE.
10963 [AT_DATA]: $4 is now out of C declarations in the prologue.
10964
426cf563
MA
109652001-11-28 Marc Autret <autret_m@epita.fr>
10966
10967 * src/reader.c (parse_dquoted_param): New.
10968 (parse_skel_decl): Use it.
10969 * src/lex.h: Add its prototype.
10970 * src/lex.c (literalchar): Become not static.
10971
c7925b99
MA
109722001-11-28 Marc Autret <autret_m@epita.fr>
10973
10974 * src/output.h: And put its extern declaration here.
10975 * src/output.c (error_verbose): Define here.
10976 (prepare): Echo name modification.
10977 * src/getargs.h: Clean its extern declaration.
10978 * src/getargs.c (error_verbose_flag): Remove.
10979 (getargs): Remove case 'e'.
10980 * src/options.c (option_table): 'error-verbose' is now seen as simple
10981 percent option.
10982 Include output.h.
10983
10984 * src/reader.c (read_declarations): Remove case tok_include.
10985 (parse_include_decl): Remove.
10986 * src/lex.h (token_t): Remove tok_include.
10987 * src/options.c (option_table): 'include' is now a simple command line
10988 option.
10989
5b5d1929
MA
109902001-11-28 Marc Autret <autret_m@epita.fr>
10991
10992 * src/bison.simple: Adjust muscle names.
10993 * src/muscle_tab.c (muscle_init): Also rename the muscles.
10994 * src/output.c (prepare): s/_/-/ for the muscles names.
10995 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
10996
8850be4b
MA
109972001-11-28 Marc Autret <autret_m@epita.fr>
10998
10999 * src/bison.simple: Fix debug.
11000 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
11001
4a38e613
AD
110022001-11-28 Akim Demaille <akim@epita.fr>
11003
11004 * src/LR0.c (shifts_new): New.
11005 (save_shifts, insert_start_shift, augment_automaton): Use it.
11006
4b35e1c1
AD
110072001-11-28 Akim Demaille <akim@epita.fr>
11008
11009 * src/closure.c (closure): `b' and `ruleno' denote the same value:
11010 keep ruleno only.
11011
d2b04478
AD
110122001-11-28 Akim Demaille <akim@epita.fr>
11013
11014 * src/closure.c (closure): Instead of looping over word in array
11015 then bits in words, loop over bits in array.
11016
2c4c30aa
AD
110172001-11-28 Akim Demaille <akim@epita.fr>
11018
11019 * src/closure.c (closure): No longer optimize the special case
11020 where all the bits of `ruleset[r]' are set to 0, to make the code
11021 clearer.
11022
576890b7
AD
110232001-11-28 Akim Demaille <akim@epita.fr>
11024
11025 * src/closure.c (closure): `r' and `c' are new variables, used to
11026 de-obfuscate accesses to RULESET and CORE.
11027
cb487d7d
AD
110282001-11-28 Akim Demaille <akim@epita.fr>
11029
11030 * src/reduce.c (reduce_print): Use ngettext.
11031 (dump_grammar): Improve the trace accuracy.
11032
6013d43f
AD
110332001-11-28 Akim Demaille <akim@epita.fr>
11034
11035 * src/reduce.c (dump_grammar): Don't translate trace messages.
11036
cb4956ee
AD
110372001-11-28 Akim Demaille <akim@epita.fr>
11038
11039 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
11040 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
11041 as all tags are free'ed afterwards.
11042 From Enrico Scholz.
11043
648185ab
PE
110442001-11-27 Paul Eggert <eggert@twinsun.com>
11045
11046 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
11047 use alloca when we didn't want to, and vice versa.
11048
68254a03
MA
110492001-11-27 Marc Autret <autret_m@epita.fr>
11050
9113b58f
AD
11051 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
11052 initialization.
68254a03
MA
11053 * src/output.c (prepare): Remove its update.
11054
04d843a2
MA
110552001-11-27 Marc Autret <autret_m@epita.fr>
11056
11057 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
11058 Use %error-verbose.
11059
d2079671 110602001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
11061
11062 * src/bison.simple: Remove YYERROR_VERBOSE using.
11063 Use %%error_verbose.
11064 (yyparse): Likewise.
11065 * src/output.c (prepare): Give its final value.
11066 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
11067 * src/getargs.h: Add its extern declaration.
11068 * src/getargs.c (error_verbose_flag): New int.
11069 (getargs): Update to catch new case.
11070 * src/options.c (option_table): 'error-verbose' is a new option.
11071 (shortopts): Update.
11072
e0327bc8
AD
110732001-11-27 Akim Demaille <akim@epita.fr>
11074
11075 * src/system.h: Use intl/libgettext.h.
11076 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
11077
000f1a3c
AD
110782001-11-27 Akim Demaille <akim@epita.fr>
11079
11080 * tests/torture.at (Exploding the Stack Size with Malloc):
11081 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
11082
26cfe0be
AD
110832001-11-27 Akim Demaille <akim@epita.fr>
11084
11085 * src/files.c: Include error.h.
11086 Reported by Hans Aberg.
11087
f6bd5427
MA
110882001-11-26 Marc Autret <autret_m@epita.fr>
11089
d2079671 11090 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
11091 (read_declarations): Add case tok_include.
11092 * src/getargs.h (include): Add its extern definition.
11093 * src/getargs.c (include): New const char *.
11094 (getargs): Add case '-I'.
11095 * src/options.c (option_table): Add include as command line and
11096 percent option.
11097 * src/lex.h (token_t): Add tok_include.
11098
2ca209c1
AD
110992001-11-26 Akim Demaille <akim@epita.fr>
11100
11101 * src/reader.c (readgram): Make sure rules for mid-rule actions
11102 have a lineno equal to that of their host rule.
11103 Reported by Hans Aberg.
11104 * tests/regression.at (Rule Line Numbers): New.
11105
0e41b407
AD
111062001-11-26 Akim Demaille <akim@epita.fr>
11107
11108 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
11109 size_ts.
11110
111112001-11-26 Akim Demaille <akim@epita.fr>
11112
11113 * src/complain.c, src/complain.h (error): Remove, provided by
11114 lib/error.[ch].
11115
e0c40012
AD
111162001-11-26 Akim Demaille <akim@epita.fr>
11117
11118 * src/reader.c (read_declarations): Don't abort on tok_illegal,
11119 issue an error message.
11120 * tests/regression.at (Invalid %directive): New.
11121 Reported by Hans Aberg.
11122
5e147124
AD
111232001-11-26 Akim Demaille <akim@epita.fr>
11124
11125 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
11126 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
11127
a034c8b8
AD
111282001-11-26 Akim Demaille <akim@epita.fr>
11129
11130 * src/conflicts.c (conflicts_print): Don't complain at all when
11131 there are no reduce/reduce conflicts, and as many shift/reduce
11132 conflicts as expected.
11133 * tests/regression.at (%expect right): Adjust.
11134
c64a20f3
AD
111352001-11-23 Akim Demaille <akim@epita.fr>
11136
11137 * lib/alloca.c: Update, from fileutils.
11138
5b0d29bb
AD
111392001-11-23 Akim Demaille <akim@epita.fr>
11140
11141 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
11142
722c4bfe
AD
111432001-11-23 Akim Demaille <akim@epita.fr>
11144
11145 * src/system.h: Include alloca.h.
11146 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
11147
6255b435
AD
111482001-11-23 Akim Demaille <akim@epita.fr>
11149
11150 * src/print_graph.c (print_actions): Remove `rule', unused.
11151 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
11152 pacify GCC's signed < unsigned warnings.
11153 * src/closure.c (itemsetsize): Likewise.
11154 * src/reader.c (symbol_list_new): Static.
11155
b29b2ed5
AD
111562001-11-23 Akim Demaille <akim@epita.fr>
11157
11158 Attaching lineno to buckets is stupid, since only one copy of each
11159 symbol is kept, only the line of the first occurrence is kept too.
11160
11161 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
11162 * src/reader.c (rline_allocated): Remove, unused.
11163 (symbol_list): Have a `line' member.
11164 (symbol_list_new): New.
11165 (readgram): Use it.
11166 * src/print.c (print_grammar): Output the rule line numbers.
11167 * tests/regression.at (Solved SR Conflicts)
11168 (Unresolved SR Conflicts): Adjust.
11169 Reported by Hans Aberg.
11170
a81b1d4a
MA
111712001-11-22 Marc Autret <autret_m@epita.fr>
11172
11173 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
11174
c1ecb3c1
MA
111752001-11-22 Marc Autret <autret_m@epita.fr>
11176
11177 * src/muscle_tab.c (muscle_init): Remove initialization of
11178 skeleton muscle.
11179 * src/output.c (output_master_parser): Do it here.
11180
fbe01355
AD
111812001-11-20 Akim Demaille <akim@epita.fr>
11182
11183 * po/sv.po: New.
11184 * configure.in (ALL_LINGUAS): Adjust.
11185 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
11186 longer contains strings to translate.
11187
81e895c0
AD
111882001-11-19 Akim Demaille <akim@epita.fr>
11189
11190 * src/conflicts.c (conflicts_print): Add a missing \n.
11191
6bb1878b
AD
111922001-11-19 Akim Demaille <akim@epita.fr>
11193
11194 * src/nullable.c (nullable_print): New.
11195 (set_nullable): Call it when tracing.
11196 Better locality of variables.
11197
d9ec2d07
AD
111982001-11-19 Akim Demaille <akim@epita.fr>
11199
11200 * src/print.c (print_actions): Better locality of variables.
11201
720e5c1b
AD
112022001-11-19 Akim Demaille <akim@epita.fr>
11203
11204 * src/derives.c (print_derives): Fix and enrich.
11205 * src/closure.c (print_fderives): Likewise.
11206
fb908786
AD
112072001-11-19 Akim Demaille <akim@epita.fr>
11208
11209 * src/closure.c (itemsetend): Remove, replaced with...
11210 (itemsetsize): new.
11211
125ecb56
AD
112122001-11-19 Akim Demaille <akim@epita.fr>
11213
11214 * src/LR0.c (kernel_end): Remove, replaced with...
11215 (kernel_size): new.
11216
d8cf039f
AD
112172001-11-19 Akim Demaille <akim@epita.fr>
11218
11219 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
11220 to clarify.
11221
7bec0760
AD
112222001-11-19 Akim Demaille <akim@epita.fr>
11223
11224 * src/closure.c (closure): Use arrays instead of pointers to clarify.
11225
c87d4863
AD
112262001-11-19 Akim Demaille <akim@epita.fr>
11227
11228 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
11229 trace messages.
11230 * src/LR0.c: Likewise.
11231 (allocate_itemsets): Use arrays instead of pointers to clarify.
11232
9bfe901c
AD
112332001-11-19 Akim Demaille <akim@epita.fr>
11234
11235 * src/getargs.c (statistics_flag): Replace with...
11236 (trace_flag): New.
11237 (longopts): Accept --trace instead of --statistics.
11238 * src/getargs.h, src/options.c: Adjust.
11239 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
11240 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
11241
97db7bd4
AD
112422001-11-19 Akim Demaille <akim@epita.fr>
11243
cc72668c 11244 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
11245 pointers to clarify the code.
11246 (save_reductions, save_shifts): Factor common parts of alternatives.
11247
2c5f66ed
AD
112482001-11-19 Akim Demaille <akim@epita.fr>
11249
11250 * src/LR0.c (new_state, get_state): Complete TRACE code.
11251 * src/closure.c: Include `reader.h' to get `tags', needed by the
11252 trace code.
11253 Rename the conditional DEBUG as TRACE.
11254 Output consistently TRACEs to stderr, not stdout.
11255 * src/derives.c: Likewise.
11256 * src/reduce.c: (inaccessable_symbols): Using if is better style
11257 than goto.
11258 Use `#if TRACE' instead of `#if 0' for tracing code.
11259
300f275f
AD
112602001-11-19 Akim Demaille <akim@epita.fr>
11261
11262 * src/system.h (LIST_FREE, shortcpy): New.
11263 * src/LR0.c: Use them.
11264 * src/output.c (free_itemsets, free_reductions, free_shifts):
11265 Remove, replaced by LIST_FREE.
11266
f59c437a
AD
112672001-11-19 Akim Demaille <akim@epita.fr>
11268
11269 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
11270 (REDUCTIONS_ALLOC): New.
11271 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
11272 allocation.
11273
6986fd9e
AD
112742001-11-19 Akim Demaille <akim@epita.fr>
11275
11276 * src/LR0.c (new_state): Complete trace code.
11277 * src/nullable.c (set_nullable): Don't translate traces.
11278
4bc30f78
AD
112792001-11-19 Akim Demaille <akim@epita.fr>
11280
11281 * src/print_graph.c (print_core): Better locality of variables.
11282 * src/print.c (print_core): Likewise.
11283
08a946e0
AD
112842001-11-19 Akim Demaille <akim@epita.fr>
11285
11286 * src/vcg.c: You do the output, so you are responsible of the
11287 handling of VCG syntax, in particular: use quotearg.
11288 * src/print_graph.c: Don't.
11289 (print_actions): Don't output the actions as part of the nodes,
11290 since that's the job of the edges.
11291 (print_state): Don't output by hand: fill the node description,
9bfe901c 11292 and ask for its output.
08a946e0 11293
f0473484
AD
112942001-11-19 Akim Demaille <akim@epita.fr>
11295
cc72668c
AD
11296 * src/bison.simple (yyparse): When verbosely reporting an error,
11297 no longer put additional quotes around token names.
f0473484
AD
11298 * tests/calc.at: Adjust.
11299
e41dc700
AD
113002001-11-19 Akim Demaille <akim@epita.fr>
11301
11302 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
11303 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
11304 * src/output.c: Adjust.
11305
652a871c
AD
113062001-11-19 Akim Demaille <akim@epita.fr>
11307
11308 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
11309 (rule_t): this.
11310 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
11311
b2ed6e58
AD
113122001-11-19 Akim Demaille <akim@epita.fr>
11313
11314 * src/gram.h (rule_t): New.
11315 (rule_table): New.
11316 (rrhs, rlhs): Remove, part of state_t.
11317 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
11318 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
11319 * src/reader.c, src/reduce.c: Adjust.
11320
edad7067
AD
113212001-11-19 Akim Demaille <akim@epita.fr>
11322
11323 * src/reader.c (symbols_output): New, extracted from...
11324 (packsymbols): Here.
11325 (reader): Call it.
11326
3feec034
AD
113272001-11-19 Akim Demaille <akim@epita.fr>
11328
11329 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
11330 (maxrhs): this new function.
11331
ddcd5fdf
AD
113322001-11-19 Akim Demaille <akim@epita.fr>
11333
cc72668c 11334 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
11335 Adjust.
11336
bb527fc2
AD
113372001-11-19 Akim Demaille <akim@epita.fr>
11338
cc72668c 11339 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
11340 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
11341 * src/lalr.c: Adjust.
11342
a845a697
AD
113432001-11-19 Akim Demaille <akim@epita.fr>
11344
11345 * src/lalr.c (initialize_LA): Only initialize LA. Let...
11346 (set_state_table): handle the `lookaheads' members.
11347
f004bf6a
AD
113482001-11-19 Akim Demaille <akim@epita.fr>
11349
cc72668c
AD
11350 * src/lalr.h (lookaheads): Removed array, whose contents is now
11351 a member of...
f004bf6a
AD
11352 (state_t): this structure.
11353 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
11354 Adjust.
11355
de326cc0
AD
113562001-11-19 Akim Demaille <akim@epita.fr>
11357
cc72668c
AD
11358 * src/lalr.h (consistent): Removed array, whose contents is now
11359 a member of...
de326cc0
AD
11360 (state_t): this structure.
11361 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
11362 Adjust.
11363
90b4416b
AD
113642001-11-19 Akim Demaille <akim@epita.fr>
11365
cc72668c
AD
11366 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
11367 contents are now members of...
90b4416b
AD
11368 (state_t): this structure.
11369 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
11370 Adjust.
11371
9703cc49
AD
113722001-11-19 Akim Demaille <akim@epita.fr>
11373
11374 * src/lalr.h (state_t): New.
11375 (state_table): Be a state_t * instead of a core **.
11376 (accessing_symbol): Remove, part of state_t.
11377 * src/lalr.c: Adjust.
11378 (set_accessing_symbol): Merge into...
11379 (set_state_table): this.
11380 * src/print_graph.c, src/conflicts.c: Adjust.
11381
d803322e
AD
113822001-11-14 Akim Demaille <akim@epita.fr>
11383
11384 * tests/calc.at, tests/output.at, tests/regression.at,
11385 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
11386 now the tests are run in private dirs, therefore AC_CLEANUP and
11387 family can be simplified to 0-ary.
11388 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
11389 use abs. path to find config.h.
11390 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
11391 stderr, there can be way too much random noise.
11392 Instead pass -Werror to GCC and rely on the exit status.
11393 Reported by Wolfram Wagner.
11394
3d76b07d
AD
113952001-11-14 Akim Demaille <akim@epita.fr>
11396
11397 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
11398 defined only if yyoverflow is defined, to avoid `warning: unused
11399 variable `yyvs1''.
11400 Reported by The Test Suite.
11401
09b503c8
AD
114022001-11-14 Akim Demaille <akim@epita.fr>
11403
11404 * src/print.c: Include reduce.h.
11405 Reported by Hans Aberg.
11406
114072001-11-14 Akim Demaille <akim@epita.fr>
11408
11409 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
11410 Revert a previous patch: these are really const.
11411 * src/conflicts.c (conflict_report): Additional useless pair of
11412 braces to pacify GCC's warnings for `if () if () {} else {}'.
11413 * src/lex.c (parse_percent_token): Replace equal_offset with
11414 arg_offset.
11415 arg is const.
11416 Be sure to strdup `arg' when used, since there is no reason for
11417 token_buffer not to change.
11418
0f37a994
AD
114192001-11-14 Akim Demaille <akim@epita.fr>
11420
11421 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
11422 definition.
11423 * src/main.c (main): Use them.
11424 Suggested by Hans Aberg.
11425
d39d93b8
AD
114262001-11-12 Akim Demaille <akim@epita.fr>
11427
11428 * src/system.h (ngettext): Now that we use ngettext, be sure to
11429 provide a default definition when NLS are not used.
11430
9edcd895
AD
114312001-11-12 Akim Demaille <akim@epita.fr>
11432
11433 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
11434 Use @kbd to denote user input.
11435 (Language and Grammar): ANSIfy the example.
11436 Adjust its layout for info/notinfo.
11437 (Location Tracking Calc): Output error messages to stderr.
11438 Output locations in a more GNUtically correct way.
11439 Fix a couple of Englishos.
11440 Adjust @group/@end group pairs.
11441
7da99ede
AD
114422001-11-12 Akim Demaille <akim@epita.fr>
11443
e3aa65c5 11444 %expect was not functioning at all.
7da99ede
AD
11445
11446 * src/conflicts.c (expected_conflicts): Set to -1.
11447 (conflict_report): Use ngettext.
11448 (conflicts_print): Check %expect and make its violation an error.
11449 * doc/bison.texinfo (Expect Decl): Adjust.
11450 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
11451 * tests/regression.at (%expect not enough, %expect right)
11452 (%expect too much): New.
11453
ba9dda1a
AD
114542001-11-12 Akim Demaille <akim@epita.fr>
11455
11456 * tests/regression.at (Conflicts): Rename as...
11457 (Unresolved SR Conflicts): this.
11458 (Solved SR Conflicts): New.
11459
337c5bd1
AD
114602001-11-12 Akim Demaille <akim@epita.fr>
11461
11462 * src/reduce.c (print_results): Rename as...
11463 (reduce_output): This.
11464 Output to OUT, passed as argument, instead of output_obstack.
11465 (dump_grammar): Likewise.
11466 (reduce_free): New.
11467 Also free V1.
11468 (reduce_grammar): No longer call reduce_output, since...
11469 * src/print.c (print_results): do it.
11470 * src/main.c (main): Call reduce_free;
11471
c73a41af
AD
114722001-11-12 Akim Demaille <akim@epita.fr>
11473
11474 * src/conflicts.c (print_reductions): Accept OUT as argument.
11475 Output to it, not to output_obstack.
11476 * src/print.c (print_actions): Adjust.
11477
0df87bb6
AD
114782001-11-12 Akim Demaille <akim@epita.fr>
11479
11480 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
11481 the result instead of using...
11482 (src_total, rrc_total, src_count, rrc_count): Remove.
11483 (any_conflicts): Remove.
11484 (print_conflicts): Split into...
11485 (conflicts_print, conflicts_output): New.
11486 * src/conflicts.h: Adjust.
11487 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 11488 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
11489 * tests/regression.at (Conflicts): New.
11490 Reported by Tom Lane.
11491
e4d3d4de
AD
114922001-11-12 Akim Demaille <akim@epita.fr>
11493
11494 * tests/regression.at (Invalid input): Remove, duplicate with
11495 ``Invalid input: 1''.
11496
6d7d248e
AD
114972001-11-12 Akim Demaille <akim@epita.fr>
11498
11499 * tests/torture.at (AT_DATA_STACK_TORTURE)
11500 (Exploding the Stack Size with Alloca)
11501 (Exploding the Stack Size with Malloc): New.
11502
e9e4c321
AD
115032001-11-12 Akim Demaille <akim@epita.fr>
11504
11505 * src/bison.simple (YYSTACK_REALLOC): New.
11506 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 11507 Reported by Per Allansson.
e9e4c321 11508
5f7e0832
AD
115092001-11-12 Pascal Bart <pascal.bart@epita.fr>
11510
11511 * src/bison.simple: Define type yystype instead of YYSTYPE, and
11512 define CPP macro, which substitute YYSTYPE by yystype.
11513 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
11514 with yyltype/YYLTYPE. This allows inclusion of the generated
11515 header within the parser if the compiler, such as GGC, accepts
11516 multiple equivalent #defines.
11517 From Akim.
11518
e3f1699f
AD
115192001-11-05 Akim Demaille <akim@epita.fr>
11520
11521 * src/reader.c (symbols_output): New, extracted from...
11522 (packsymbols): here.
11523 (reader): Adjust.
11524
65be0866
AD
115252001-11-05 Akim Demaille <akim@epita.fr>
11526
11527 * src/lex.c (parse_percent_token): s/quotearg/quote/.
11528
e4d910bf
AD
115292001-11-05 Akim Demaille <akim@epita.fr>
11530
11531 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
11532 pattern.
11533
951366c1
AD
115342001-11-05 Akim Demaille <akim@epita.fr>
11535
11536 * src/options.h (struct option_table_struct): set_flags is void*.
11537 * src/options.c (longopts): Support `--output' and `%output'.
11538 (usage): Adjust.
11539 * src/lex.h (tok_setopt): Remove, replaced with...
11540 (tok_intopt, tok_stropt): these new guys.
11541 * src/lex.c (getopt.h): Not needed.
11542 (token_buffer, unlexed_token_buffer): Not const.
11543 (percent_table): Promote `-' over `_' in directive names.
11544 Active `%name-prefix', `file-prefix', and `output'.
11545 (parse_percent_token): Accept possible arguments to directives.
11546 Promote `-' over `_' in directive names.
11547
d8988b2f
AD
115482001-11-04 Akim Demaille <akim@epita.fr>
11549
11550 * doc/bison.texinfo (Decl Summary): Split the list into
11551 `directives for grammars' and `directives for bison'.
11552 Sort'em.
11553 Add description of `%name-prefix', `file-prefix', and `output'.
11554 Promote `-' over `_' in directive names.
11555 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
11556 Simplify the description of `--name-prefix'.
11557 Promote `-' over `_' in directive names.
11558 Promote `--output' over `--output-file'.
11559 Fix the description of `--defines'.
11560 * tests/output.at: Exercise %file-prefix and %output.
11561
6468d18e
AD
115622001-11-02 Akim Demaille <akim@epita.fr>
11563
11564 * doc/refcard.tex: Update.
11565
6b7e85b9
AD
115662001-11-02 Akim Demaille <akim@epita.fr>
11567
11568 * src/symtab.h (SUNDEF): New.
11569 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
11570 stand for `uninitialized', instead of 0.
11571 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
11572 * src/lex.c (lex): Adjust.
11573
11574 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
11575 Number it 0.
11576 Let yylex return it instead of a plain 0.
11577 Reported by Dick Streefland.
11578
cd5aafcf
AD
115792001-11-02 Akim Demaille <akim@epita.fr>
11580
11581 * tests/regression.at (Mixing %token styles): New test.
11582
037ca2f1
AD
115832001-11-02 Akim Demaille <akim@epita.fr>
11584
11585 * src/reader.c (parse_thong_decl): Formatting changes.
11586 (token_translations_init): New, extracted from...
11587 (packsymbols): Here.
11588 Adjust.
11589
270a173c
AD
115902001-11-01 Akim Demaille <akim@epita.fr>
11591
11592 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
11593 Check that `9foo.y' produces correct cpp guards.
11594 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
11595 guards.
11596 Reported by Wwp.
11597
561f9a30
AD
115982001-11-01 Akim Demaille <akim@epita.fr>
11599
11600 * tests/regression.at (Invalid input: 2): New.
11601 * src/lex.c (unlexed_token_buffer): New.
11602 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
11603 too.
11604 Reported by Wwp.
11605
f987e9d2
AD
116062001-11-01 Akim Demaille <akim@epita.fr>
11607
11608 * tests/calc.at: Catch up with 1.30.
11609 * configure.in: Bump to 1.49a.
11610 Adjust to newer Autotest.
11611
0846f581
PB
116122001-10-19 Pascal Bart <pascal.bart@epita.fr>
11613
11614 * src/conflicts.c: Move global variables rrc_total and src_total ...
11615 (print_conflicts): here.
11616 * src/output.c (output): Free global variable user_toknums.
11617 * src/lex.c (token_obstack): Become static.
11618
3c1a79b3
AD
116192001-10-18 Akim Demaille <akim@epita.fr>
11620
11621 * tests/atlocal.in (GCC): Add.
11622 * tests/calc.at: s/m4_match/m4_bmatch/.
11623 s/m4_patsubst/m4_bpatsubst/.
11624 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
11625 * configure.in: AC_SUBST(GCC).
11626
5d52e7d0
MA
116272001-10-14 Marc Autret <autret_m@epita.fr>
11628
11629 * src/options.c (create_long_option_table): Fix.
11630
631aa1d3
AD
116312001-10-10 Akim Demaille <akim@epita.fr>
11632
11633 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
11634
f6ec6d13
AD
116352001-10-04 Akim Demaille <akim@epita.fr>
11636
11637 * src/reader.c (parse_union_decl): Push the caracters in
11638 union_obstack, not attrs_obstack.
11639
342b8b6e
AD
116402001-10-04 Akim Demaille <akim@epita.fr>
11641
11642 Merge in the branch 1.29.
11643
11644 * src/reader.c (packsymbols): Use a temporary obstack for
11645 `%%tokendef', since output_stack is already used elsewhere.
11646
11647 2001-10-02 Akim Demaille <akim@epita.fr>
11648
11649 Bump 1.29d.
11650
11651 2001-10-02 Akim Demaille <akim@epita.fr>
11652
11653 Version 1.29c.
11654
11655 2001-10-02 Akim Demaille <akim@epita.fr>
11656
11657 * tests/regression.at (Invalid CPP headers): New.
11658 From Alexander Belopolsky.
11659 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
11660
11661 2001-10-02 Akim Demaille <akim@epita.fr>
11662
11663 * tests/regression.at (Invalid input): New.
11664 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
11665 Reported by Shura.
11666
11667 2001-10-02 Akim Demaille <akim@epita.fr>
11668
11669 * tests/calc.at: Now that --debug works, the tests must be adjusted.
11670
11671 2001-10-02 Akim Demaille <akim@epita.fr>
11672
11673 * src/output.c (output_parser): Assert `skeleton'.
11674 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
11675 systems.
11676 From Shura.
11677
11678 2001-10-01 Marc Autret <autret_m@epita.fr>
11679
11680 * src/lex.h: Echo modifications.
11681 * src/lex.c (unlex): Parameter is now token_t.
11682 From Hans Aberg.
11683
11684 2001-10-01 Marc Autret <autret_m@epita.fr>
11685
11686 * src/main.c: Include lex.h.
11687 From Hans Aberg.
11688
11689 2001-09-29 Akim Demaille <akim@epita.fr>
11690
11691 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
11692
11693 2001-09-28 Akim Demaille <akim@epita.fr>
11694
11695 * tests/testsuite.at: Update to newer Autotest.
11696 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
11697
11698 2001-09-27 Akim Demaille <akim@epita.fr>
11699
11700 Position independent wrapper.
11701
11702 * tests/bison: Remove.
11703 * tests/bison.in: New.
11704 * configure.in: Adjust.
11705
11706 2001-09-27 Paul Eggert <eggert@twinsun.com>
11707
11708 Port quotearg fixes from tar 1.13.24.
11709
11710 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
11711 tm to be declared.
11712 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
11713 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
11714
11715 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
11716 * m4/mbrtowc.m4: New file.
11717 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
11718 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
11719
11720 2001-09-27 Akim Demaille <akim@epita.fr>
11721
11722 Bump to 1.29c.
11723
11724 2001-09-27 Akim Demaille <akim@epita.fr>
11725
11726 Version 1.29b.
11727
11728 2001-09-25 Akim Demaille <akim@epita.fr>
11729
11730 * src/system.h: Include `xalloc.h'.
11731 Remove it from the C files.
11732 * src/files.c (output_files): Free the obstacks.
11733 * src/lex.c (init_lex): Rename as...
11734 (lex_init): this.
11735 (lex_free): New.
11736 * src/main.c (main): Use it.
11737
11738 2001-09-24 Marc Autret <autret_m@epita.fr>
11739
11740 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
11741 to output informations in fout (FILE*).
11742 (open_graph, close_graph): Likewise.
11743 (output_graph, output_edge, output_node): Likewise.
11744 * src/vcg.h: Update function prototypes.
11745 * src/print_graph.c (print_graph): Open output graph file.
11746 (print_actions): Adjust.
11747 * src/files.h: Remove extern declaration.
11748 * src/files.c: Remove graph_obstack declaration.
11749 (open_files): Remove graph_obstack initialization.
11750 (output_files): Remove graph_obstack saving.
11751
11752 2001-09-24 Marc Autret <autret_m@epita.fr>
11753
11754 * src/files.c (compute_output_file_names): Fix.
11755
11756 2001-09-24 Marc Autret <autret_m@epita.fr>,
11757 Akim Demaille <akim@epita.fr>
11758
11759 * src/reader.c (reader): Remove call to free_symtab ().
11760 * src/main.c (main): Call it here.
11761 Include symtab.h.
11762 * src/conflicts.c (initialize_conflicts): Rename as...
11763 (solve_conflicts): this.
11764 * src/print.c (print_core, print_actions, print_state)
11765 (print_grammar): Dump to a file instead a `output_obstack'.
11766 (print_results): Dump `output_obstack', and then proceed with the
11767 FILE *.
11768 * src/files.c (compute_output_file_names, close_files): New.
11769 (output_files): Adjust.
11770 * src/main.c (main): Adjust.
11771
11772 2001-09-23 Marc Autret <autret_m@epita.fr>
11773
11774 * src/files.c (compute_header_macro): Computes header macro name
11775 from spec_defines_file when given.
11776
11777 2001-09-23 Marc Autret <autret_m@epita.fr>
11778
11779 * src/files.c (output_files): Add default extensions.
11780
11781 2001-09-22 Akim Demaille <akim@epita.fr>
11782
11783 * src/conflicts.c (finalize_conflicts): Rename as...
11784 (free_conflicts): this.
11785
11786 2001-09-22 Akim Demaille <akim@epita.fr>
11787
11788 * src/gram.c (gram_free): Rename back as...
11789 (dummy): this.
11790 (output_token_translations): Free `token_translations'.
11791 * src/symtab.c (free_symtab): Free the tag field.
11792
11793 2001-09-22 Akim Demaille <akim@epita.fr>
11794
11795 Remove `translations' as it is always set to true.
11796
11797 * src/gram.h: Adjust.
11798 * src/reader.c (packsymbols, parse_token_decl): Adjust
11799 * src/print.c (print_grammar): Adjust.
11800 * src/output.c (output_token_translations): Adjust.
11801 * src/lex.c (lex): Adjust.
11802 * src/gram.c: Be sure the set pointers to NULL.
11803 (dummy): Rename as...
11804 (gram_free): this.
11805
11806 2001-09-22 Akim Demaille <akim@epita.fr>
11807
11808 * configure.in: Invoke AM_LIB_DMALLOC.
11809 * src/system.h: Use dmalloc.
11810 * src/LR0.c: Be sure to have pointers initialized to NULL.
11811 (allocate_itemsets): Allocate kernel_items only if needed.
11812
11813 2001-09-22 Akim Demaille <akim@epita.fr>
11814
11815 * configure.in: Bump to 1.29b.
11816 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
11817 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
11818 need xmalloc.c in calc.y.
11819 From Pascal Bart.
11820
11821 2001-09-21 Akim Demaille <akim@epita.fr>
11822
11823 Version 1.29a.
11824 * Makefile.maint, config/config.guess, config/config.sub,
11825 * config/missing: Update from masters.
11826 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
11827 upon package.m4.
11828 * configure.in (ALL_LINGUAS): Add `tr'.
11829
11830 2001-09-21 Akim Demaille <akim@epita.fr>
11831
11832 * tests/Makefile.am (package.m4): Move to...
11833 ($(srcdir)/$(TESTSUITE)): here.
11834
11835 2001-09-20 Akim Demaille <akim@epita.fr>
11836
11837 * src/complain.c: No longer try to be standalone: use system.h.
11838 Don't assume __STDC__ is defined to 1. Just test if it is defined.
11839 * src/complain.h: Likewise.
11840 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
11841 Remove the unused variable `n'.
11842 From Albert Chin-A-Young.
11843
11844 2001-09-18 Marc Autret <autret_m@epita.fr>
11845
11846 * doc/bison.1: Update.
11847 * doc/bison.texinfo (Bison Options): Update --defines and --graph
11848 descriptions.
11849 (Option Cross Key): Update.
11850 Add --graph.
11851
11852 2001-09-18 Marc Autret <autret_m@epita.fr>
11853
11854 * tests/regression.at: New test (comment in %union).
11855
11856 2001-09-18 Marc Autret <autret_m@epita.fr>
11857
11858 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
11859 do that.
11860 Reported by Keith Browne.
11861
11862 2001-09-18 Marc Autret <autret_m@epita.fr>
11863
11864 * tests/output.at: Add tests for --defines and --graph.
11865
11866 2001-09-18 Marc Autret <autret_m@epita.fr>
11867
11868 * tests/output.at: Removes tests of %{header,src}_extension features.
11869
11870 2001-09-18 Akim Demaille <akim@epita.fr>
11871
11872 * tests/Makefile.am (package.m4): New.
11873 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
11874 (_AT_CHECK_CALC_ERROR): Likewise.
11875 Factor the `, ' part of verbose error messages.
11876
11877 2001-09-18 Marc Autret <autret_m@epita.fr>
11878
11879 * src/getargs.c (longopts): Declare --defines and --graph as options
11880 with optional arguments.
11881 * src/files.h: Add extern declarations.
11882 * src/files.c (spec_graph_file, spec_defines_file): New.
11883 (output_files): Update.
11884 Remove CPP-outed code.
11885
11886 2001-09-18 Marc Autret <autret_m@epita.fr>
11887
11888 Turn off %{source,header}_extension feature.
11889
11890 * src/files.c (compute_exts_from_gf): Update.
11891 (compute_exts_from_src): Update.
11892 (output_files): CPP-out useless code.
11893 * src/files.h: Remove {header,source}_extension extern declarations.
11894 * src/reader.c (parse_dquoted_param): CPP-out.
11895 (parse_header_extension_decl): Remove.
11896 (parse_source_extension_decl): Remove.
11897 (read_declarations): Remove cases tok_{hdrext,srcext}.
11898 * src/lex.c (percent_table): Remove {header,source}_extension entries.
11899 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
11900
11901 2001-09-10 Akim Demaille <akim@epita.fr>
11902
11903 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
11904 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
11905 (AT_CHECK_OUTPUT): this.
11906 Merely check ls' exit status, its output is useless.
11907
11908 2001-09-10 Akim Demaille <akim@epita.fr>
11909
11910 * tests/calc.at: Use m4_match.
11911 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
11912
11913 2001-09-10 Marc Autret <autret_m@epita.fr>,
11914 Akim Demaille <akim@epita.fr>
11915
11916 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
11917 enum color_e.
11918 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
11919 to `normal'.
11920 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
11921 * src/lex.h: Adjust prototype.
11922 (token_t): Add `tok_undef'.
11923 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
11924 (parse_percent_token): Now returns token_t.
11925 Add default statement in switch.
11926 (lex): Separate `c' as an input variable, from the token_t result
11927 part.
11928 (unlexed): Is a token_t.
11929
11930 2001-09-10 Akim Demaille <akim@epita.fr>
11931
11932 * configure.in: Bump to 1.29a.
11933
11934 2001-09-07 Akim Demaille <akim@epita.fr>
11935
11936 Version 1.29.
11937
11938 2001-08-30 Akim Demaille <akim@epita.fr>
11939
11940 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
11941 * m4/atconfig.m4: Remove.
11942 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
11943 * tests/bison: New.
11944 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
11945 m4_if, m4_patsubst, and m4_regexp.
11946 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
11947 `input' file instead of echo.
11948
11949 2001-08-29 Akim Demaille <akim@epita.fr>
11950
11951 Bump to 1.28e.
11952
11953 2001-08-29 Akim Demaille <akim@epita.fr>
11954
11955 Version 1.28d.
11956
11957 2001-08-29 Paul Eggert <eggert@twinsun.com>
11958
11959 * src/bison.simple (yyparse): Don't take the address of an
11960 item before the start of an array, as that doesn't conform to
11961 the C Standard.
11962
11963 2001-08-29 Robert Anisko <anisko_r@epita.fr>
11964
11965 * doc/bison.texinfo (Location Tracking Calc): New node.
11966
11967 2001-08-29 Paul Eggert <eggert@twinsun.com>
11968
11969 * src/output.c (output): Do not define const, as this now
11970 causes more problems than it cures.
11971
11972 2001-08-29 Akim Demaille <akim@epita.fr>
11973
11974 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
11975 the nodes.
11976 Be sure to tag the `detailmenu'.
11977
11978 2001-08-29 Akim Demaille <akim@epita.fr>
11979
11980 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
11981 download in a tmp dir.
11982
11983 2001-08-28 Marc Autret <autret_m@epita.fr>
11984
11985 * config/depcomp: New file.
11986
11987 2001-08-28 Marc Autret <autret_m@epita.fr>
11988
11989 * doc/bison.1 (mandoc): Adjust.
11990 From Juan Manuel Guerrero.
11991
11992 2001-08-28 Marc Autret <autret_m@epita.fr>
11993
11994 * src/print_graph.c (print_state): Fix.
11995
11996 2001-08-27 Marc Autret <autret_m@epita.fr>
11997
11998 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
11999 char * members.
12000 Echo modifications to the functions prototypes.
12001 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
12002
12003 2001-08-27 Marc Autret <autret_m@epita.fr>
12004
12005 * src/vcg.c: Include `xalloc.h'.
12006 (add_colorentry): New.
12007 (add_classname): New.
12008 (add_infoname): New.
12009 * src/vcg.h: Add new prototypes.
12010
12011 2001-08-27 Akim Demaille <akim@epita.fr>
12012
12013 * Makefile.maint: Sync. again with CVS Autoconf.
12014
12015 2001-08-27 Akim Demaille <akim@epita.fr>
12016
12017 * Makefile.maint: Formatting changes.
12018 (po-update, cvs-update, update): New targets.
12019 (AMTAR): Remove.
12020
12021 2001-08-27 Akim Demaille <akim@epita.fr>
12022
12023 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
12024 * Makefile.maint: Sync. with CVS Autoconf.
12025
12026 2001-08-27 Marc Autret <autret_m@epita.fr>
12027
12028 * src/vcg.h (struct infoname_s): New.
12029 (struct colorentry_s): New.
12030 (graph_s): New fields {vertical,horizontal}_order in structure.
12031 Add `infoname' field.
12032 Add `colorentry' field;
12033 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
12034 (G_HORIZONTAL_ORDER): New.
12035 (G_INFONAME): New.
12036 (G_COLORENTRY): New.
12037 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
12038 Add output of `infoname'.
12039 Add output of `colorentry'.
12040
12041 2001-08-27 Marc Autret <autret_m@epita.fr>
12042
12043 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
12044 This one shadowed a global parameter.
12045
12046 2001-08-24 Marc Autret <autret_m@epita.fr>
12047
12048 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
12049 instead of `unsigned'.
12050 (print_state): Do not call obstack_object_size () in obstack_grow ()
12051 to avoid macro variables shadowing.
12052
12053 2001-08-23 Marc Autret <autret_m@epita.fr>
12054
12055 * src/lex.c (percent_table): Typo: s/naem/name/.
12056 Add graph option.
12057 Normalize new options declarations.
12058
12059 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
12060
12061 * tests/suite.at: Exercise %header_extension and %source_extension.
12062
12063 2001-08-16 Marc Autret <autret_m@epita.fr>
12064
12065 * src/reader.c (parse_dquoted_param): New.
12066 (parse_header_extension_decl): Use it.
12067 (parse_source_extension_decl): Likewise.
12068
12069 2001-08-16 Marc Autret <autret_m@epita.fr>
12070
12071 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
12072 (get_xxxx_str): Use assert () instead of complain ().
12073 Remove return invokations in default cases.
12074 (get_decision_str): Modify default behaviour. Remove second argument.
12075 Echo modifications on calls.
12076 (output_graph): Fix.
12077
12078 2001-08-16 Marc Autret <autret_m@epita.fr>
12079
12080 * src/getargs.c (usage): Update with ``-g, --graph''.
12081
12082 2001-08-16 Marc Autret <autret_m@epita.fr>
12083
12084 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
12085 (Option Cross Key): Likewise.
12086 * doc/bison.1: Update.
12087
1c8c2190
PB
120882001-09-25 Pascal Bart <pascal.bart@epita.fr>
12089
12090 * src/output.c (output_master_parser): Don't finish action_obstack.
12091 (output_parser): Don't care about the muscle action, here.
12092 (prepare): Copy the action_obstack in the action muscle.
12093 (output): Free action_obstack.
12094
180d45ba
PB
120952001-09-23 Pascal Bart <pascal.bart@epita.fr>
12096
12097 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
12098 will contain `%union' declaration.
12099 (parse_union_decl): Delete #line directive output.
12100 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
12101 informations about %union.
12102 (parse_union_decl): Copy the union_obstack in the muscle stype.
12103 * src/bison.simple: Add new #line directive.
12104 Add typdef %%stype YYSTYPE.
12105
c51d1a19
PB
121062001-09-23 Pascal Bart <pascal.bart@epita.fr>
12107
12108 * src/bison.simple: Add new `#line' directive.
12109
6f9344da
PB
121102001-09-22 Pascal Bart <pascal.bart@epita.fr>
12111
12112 * src/bison.simple: New `#line' directive.
12113 * src/output.c (output_parser): Support new dynamic muscle input_line.
12114
652def80
MA
121152001-09-22 Marc Autret <autret_m@epita.fr>
12116
12117 * src/output.c (output_master_parser): New.
12118 (output_parser): Be more re-entrant.
12119
25b222fa
MA
121202001-09-21 Marc Autret <autret_m@epita.fr>
12121
12122 * src/reader.c (copy_definition, parse_union_decl): Update and use
12123 `linef' muscle.
12124 (copy_action): Likewise.
12125 Use obstack_1grow ().
12126 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
12127
6bc35ae5
MA
121282001-09-21 Marc Autret <autret_m@epita.fr>
12129
12130 * src/options.c (option_table): Adjust.
12131 * src/lex.c (parse_percent_token): Fix.
12132
c0629aa1
PB
121332001-09-20 Pascal Bart <pascal.bart@epita.fr>
12134
12135 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 12136
82b6d266
PB
121372001-09-20 Pascal Bart <pascal.bart@epita.fr>
12138
12139 * src/lex.c (parse_percent_token): Change type of variable `tx', which
12140 is now an option_table_struct*.
12141 (option_strcmp): New function option_strcmp.
12142 (parse_percent_token): Call option_strcmp.
12143 * src/getargs.c (xalloc.h, options.h): Include it.
12144 (getargs): Call create_long_option_table.
12145 (getargs): Free longopts at the end of the function.
12146 (shortopts): Move in options.c.
12147 * src/options.c (create_long_option_table): New function. Convert
12148 information from option_table to option structure.
12149 * src/reader.c (options.h): Include it.
12150
12151 * src/Makefile.am: Adjust.
12152 * src/options.c (option_table): Create from longopts and percent_table.
12153 * src/getargs.c (longopts): Delete.
12154 * src/lex.c (struct percent_table_struct): Delete.
12155 (percent_table): Delete.
12156 (options.h): Include it.
12157 * src/options.c: Create.
12158 * src/options.h: Create.
12159 Declare enum opt_access_e.
12160 Define struct option_table_struct.
12161
75f5aaea
MA
121622001-09-20 Marc Autret <autret_m@epita.fr>
12163
12164 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
12165 sections of Bison.
12166
f508cb0a
PB
121672001-09-19 Pascal Bart <pascal.bart@epita.fr>
12168
12169 * src/bison.simple: s/%%filename/%%skeleton.
12170 * src/muscle_tab.c (getargs.h): Include it.
12171 (muscle_init): Insert new muscle skeleton.
12172
13105fc1
PB
121732001-09-18 Pascal Bart <pascal.bart@epita.fr>
12174
12175 * src/output.c (output_parser): Delete unused variable actions_dumped.
12176
b0c4483e
PB
121772001-09-07 Pascal Bart <pascal.bart@epita.fr>
12178
12179 * src/output.c (output): Delete call to reader_output_yylsp.
12180 * src/reader.c (reader): Likewise.
ba0fe3c7 12181 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 12182
11d82f03
MA
121832001-09-02 Marc Autret <autret_m@epita.fr>
12184
12185 * src/reader.c: Include muscle_tab.h.
12186 (parse_union_decl): Update.
12187 (parse_macro_decl): Rename parse_muscle_decl.
12188 Update to use renamed functions and variable.
12189 (read_declarations, copy_action, read_additionnal_code, : Updated
12190 with correct variables and functions names.
12191 (packsymbols, reader): Likewise.
342b8b6e 12192
11d82f03 12193 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 12194
11d82f03
MA
12195 * src/output.c: Include muscle_tab.h
12196 In all functions using macro_insert, change by using muscle_insert ().
12197 (macro_obstack): Rename muscle_obstack.
12198 Echo modifications in the whole file.
12199 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
12200 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
12201 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
12202
12203 * src/muscle_tab.h: Update double inclusion macros.
12204 (macro_entry_s): Rename muscle_entry_s.
12205 Update prototypes.
342b8b6e 12206
11d82f03
MA
12207 * src/muscle_tab.c: Include muscle_tab.h.
12208 Rename macro_tabble to muscle_table.
12209 (mhash1, mhash2, mcmp): Use muscle_entry.
12210 (macro_init): Rename muscle_init. Update.
12211 (macro_insert): Rename muscle_insert. Update.
12212 (macro_find): Rename muscle_find. Update.
12213
12214 * src/main.c: Include muscle_tab.h.
12215 (main): Call muscle_init ().
12216 * src/Makefile.am (bison_SOURCES): Echo modifications.
12217
93a37297
MA
122182001-09-02 Marc Autret <autret_m@epita.fr>
12219
f753cd62 12220 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 12221
f753cd62
MA
12222 * src/muscle_tab.c, src/muscle_tab.h: Add files.
12223
122242001-09-02 Marc Autret <autret_m@epita.fr>
12225
12226 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 12227
682d48cd
PB
122282001-09-01 Pascal Bart <pascal.bart@epita.fr>
12229
342b8b6e 12230 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
12231 filename.
12232
087c8fda
MA
122332001-09-01 Marc Autret <autret_m@epita.fr>
12234
12235 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
12236 to an explicit value to activate the feature. We do it here.
12237
dda680cb
PB
122382001-08-31 Pascal Bart <pascal.bart@epita.fr>
12239
12240 * src/output.c (prepare): Delete the `filename' muscule insertion.
12241 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
12242 (parse_union_decl): Likewise.
12243 * src/macrotab.c (macro_init): Initialize filename by infile.
12244
9e644e64
MA
122452001-08-31 Marc Autret <autret_m@epita.fr>
12246
12247 * src/bison.simple (YYLSP_NEEDED): New definition.
12248 * src/output.c (prepare): Add macro insertion of `locations_flag'
12249
17da6427
PB
122502001-08-31 Pascal Bart <pascal.bart@epita.fr>
12251
12252 * src/output.c (prepare): Delete insertion of previous muscles,
12253 and insert the `prefix' muscles.
12254 * src/macrotab.c (macro_init): Likewise.
12255 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 12256 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
12257 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
12258 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 12259 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
12260 name_prefix.
12261
e8cb70b9
PB
122622001-08-31 Pascal Bart <pascal.bart@epita.fr>
12263
12264 * src/main.c (main): Standardize.
12265 * src/output.c (output_table_data, output_parser): Likewise.
12266 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
12267
63c2d5de
MA
122682001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
12269
342b8b6e 12270 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
12271 %%epilogue.
12272 * src/output.c (output): Rename %%declarations to %%prologue.
12273 * src/bison.simple: Echo modifications.
342b8b6e 12274
d8cb5183
MA
122752001-08-31 Marc Autret <autret_m@epita.fr>
12276
12277 * src/reader.c (readgram): CleanUp.
12278 (output_token_defines): Likewise.
12279 (packsymbols): Likewise.
12280 (reader): Likewise.
12281 * src/output.c (output): CPP-out useless code.
12282
6c686258
PB
122832001-08-31 Pascal Bart <pascal.bart@epita.fr>
12284
342b8b6e 12285 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
12286 output_trailers and output_headers.
12287 * src/output.h: Remove obsolete functions prototypes of output_headers
12288 and output_trailers.
12289
8f451ef7
PB
122902001-08-30 Pascal Bart <pascal.bart@epita.fr>
12291
12292 * src/main.c: Include macrotab.h.
342b8b6e 12293 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
12294 Adjust functions prototypes.
12295 * src/macrotab.c (macro_insert): Constify key and value.
12296 (macro_find): Constify key.
12297 (macro_insert): Include 'xalloc.h'
12298 (macro_insert): Use XMALLOC.
12299 (macro_find): Constify return value.
12300 * src/output.c (output_table_data): Rename table to table_data.
12301 (output_parser): Constify macro_key, macro_value.
12302
997b6fd0 123032001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
12304
12305 * src/reader.c (parse_skel_decl): New.
342b8b6e 12306 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
12307 * src/lex.h (token_t): New token `tok_skel'.
12308 * src/lex.c (percent_table): Add skeleton option entry.
12309 Standardize.
12310
ff48177d
MA
123112001-08-29 Marc Autret <autret_m@epita.fr>
12312
12313 * src/bison.simple: Add %%user_code directive at the end.
12314 * src/reader.c (read_additionnal_code): New.
12315 (reader): Use it.
12316 * src/output.c (output_program): Remove.
12317 (output): Update.
12318
b33160bf
MA
123192001-08-28 Marc Autret <autret_m@epita.fr>
12320
12321 * src/output.c (output_actions): Clean up.
4e5caae2 12322 (output_gram): CPP-out useless code.
b33160bf
MA
12323 * src/reader.c (reader): Clean up, CPP-out useless code.
12324
d1a2daf7
PB
123252001-08-28 Pascal Bart <pascal.bart@epita.fr>
12326
342b8b6e 12327 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 12328 directive.
d1a2daf7
PB
12329 * src/bison.simple: Add `%%definitions'.
12330
2b763dfe
MA
123312001-08-28 Marc Autret <autret_m@epita.fr>
12332
12333 * config/depcomp: New file.
12334
f1a87ef6
PE
123352001-08-27 Paul Eggert <eggert@twinsun.com>
12336
12337 * src/bison.simple (yyparse): Don't take the address of an
12338 item before the start of an array, as that doesn't conform to
12339 the C Standard.
12340
82e236e2
RA
123412001-08-27 Robert Anisko <robert.anisko@epita.fr>
12342
f1a87ef6 12343 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
12344 obstack. It was done too late here.
12345
12346 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
12347 completely wrong.
12348 (reader): Initialize the macro obstack here, since we need it to grow
12349 '%define' directives.
12350
12351 * src/reader.h: Declare the macro obstack as extern.
12352
b0cfa28a
RA
123532001-08-27 Robert Anisko <robert.anisko@epita.fr>
12354
12355 * src/output.c (output_parser): Fix. Store single '%' characters in
12356 the output obstack instead of throwing them away.
12357
6fc74234
AD
123582001-08-27 Akim Demaille <akim@epita.fr>
12359
12360 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
12361
9c76d118
RA
123622001-08-25 Robert Anisko <robert.anisko@epita.fr>
12363
12364 * lib/Makefile.am: Adjust.
12365
a8289c62
RA
123662001-08-25 Robert Anisko <robert.anisko@epita.fr>
12367
12368 * src/bison.simple: Update and add '%%' directives.
12369
b6610515
RA
123702001-08-25 Robert Anisko <robert.anisko@epita.fr>
12371
12372 * src/reader.c (reader): Remove calls to 'output_headers' and
12373 'output_trailers'. Remove some C output.
12374 (readgram): Disable a piece of code that was writing a default
12375 definition for 'YYSTYPE'.
12376 (reader_output_yylsp): Remove.
12377 (packsymbols): Output token defintions to a macro.
12378 (copy_definition): Disable C output.
6fc74234 12379
b6610515
RA
12380 * src/reader.c (parse_macro_decl): New function used to parse macro
12381 declarations.
12382 (copy_string2): Put the body of copy_string into this new function.
12383 Add a parameter to let the caller choose whether he wants to copy the
12384 string delimiters or not.
12385 (copy_string): Be a simple call to copy_string2 with the last argument
12386 bound to true.
12387 (read_declarations): Add case for macro definition.
12388 (copy_identifier): New.
6fc74234 12389 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
12390 rather than lex.
12391
26f609ff
RA
123922001-08-25 Robert Anisko <robert.anisko@epita.fr>
12393
12394 * src/output.c (prepare): Add prefixed names.
12395 (output_parser): Output semantic actions.
12396 (output_parser): Fix bug on '%%line' directives.
6fc74234 12397
26f609ff
RA
12398 * src/output.c (output_headers): Remove. The C code printed by this
12399 function should now be in the skeletons.
12400 (output_trailers): Remove.
12401 (output): Disable call to 'reader_output_yylsp'.
12402 (output_rule_data): Do not output tables to the table obstack.
12403
12404 * src/output.c: Remove some C dedicated output.
12405 Improve the use of macro and output obstacks.
12406 (output_defines): Remove.
6fc74234 12407
26f609ff
RA
12408 * src/output.c (output_token_translations): Associate 'translate'
12409 table with a macro. No output to the table obstack.
12410 (output_gram): Same for 'rhs' and 'prhs'.
12411 (output_stos): Same for 'stos'.
12412 (output_rule_data): Same for 'r1' and 'r2'.
12413 (token_actions): Same for 'defact'.
12414 (goto_actions): Same for 'defgoto'.
12415 (output_base): Same for 'pact' and 'pgoto'.
12416 (output_table): Same for 'table'.
12417 (output_check): Same for 'check'.
6fc74234 12418
26f609ff
RA
12419 * src/output.c (output_table_data): New function.
12420 (output_short_table): Remove.
12421 (output_short_or_char_table): Remove.
6fc74234 12422
26f609ff
RA
12423 * src/output.c (output_parser): Replace most of the skeleton copy code
12424 with something new. Skeletons are now processed character by character
12425 rather than line by line, and Bison looks for '%%' macros. This is the
12426 first step in making Bison's output process (a lot) more flexible.
12427 (output_parser): Use the macro table.
12428
6f43b113
RA
124292001-08-25 Robert Anisko <robert.anisko@epita.fr>
12430
12431 * src/main.c (main): Initialize the macro table.
12432
dd3127cf
RA
124332001-08-25 Robert Anisko <robert.anisko@epita.fr>
12434
12435 * src/lex.c (percent_table): Add tok_define.
12436 * src/lex.h: Add tok_define.
12437
aa321494
RA
124382001-08-25 Robert Anisko <robert.anisko@epita.fr>
12439
12440 * src/macrotab.c: New file.
12441 * src/macrotab.h: New file.
12442 * src/Makefile.am: Update.
12443
68bd3b6b
RA
124442001-08-25 Robert Anisko <robert.anisko@epita.fr>
12445
12446 * lib/hash.c: New file.
12447 * lib/hash.h: New file.
12448 * lib/Makefile.am: Update.
12449
45f8dd1e
AD
124502001-08-15 Akim Demaille <akim@epita.fr>
12451
12452 Version 1.28c.
12453
40a64a7a 124542001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
12455
12456 * src/reader.c (readgram): Indent output macro YYSTYPE.
12457 (packsymbols): Likewise.
12458 (output_token_defines): Likewise.
12459 * src/files.c: Standardize.
12460 (compute_header_macro): New.
12461 (defines_obstack_save): New. Use compute_header_macro.
12462 (output_files): Update. Use defines_obstack_save.
12463
f9a8293a
AD
124642001-08-15 Akim Demaille <akim@epita.fr>
12465
12466 * doc/bison.texinfo (Table of Symbols): Document
12467 YYSTACK_USE_ALLOCA.
12468
150ca7a7
AD
124692001-08-15 Akim Demaille <akim@epita.fr>
12470
12471 * missing: Update from CVS Automake.
12472 * config/config.guess, config/config.sub, config/texinfo.tex:
12473 Update from gnu.org.
12474
69b5cec4
AD
124752001-08-15 Akim Demaille <akim@epita.fr>
12476
12477 * Makefile.maint: Sync with CVS Autoconf.
12478
f2b5126e
PB
124792001-08-14 Pascal Bart <pascal.bart@epita.fr>
12480
69b5cec4 12481 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
12482 `fdl.texi'.
12483 * doc/fdl.texi: Add to package.
12484
4ecbf796
MA
124852001-08-14 Marc Autret <autret_m@epita.fr>
12486
12487 Turn on %{source,header}_extension features.
12488
69b5cec4 12489 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
12490 source_extension.
12491 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 12492 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
12493 between options.
12494
95fb5662
MA
124952001-08-14 Marc Autret <autret_m@epita.fr>
12496
12497 * src/files.c (compute_base_names): Add extensions computing when
12498 `--file-prefix' used.
12499 Standardize function calls.
12500
78d09da9
MA
125012001-08-13 Marc Autret <autret_m@epita.fr>
12502
69b5cec4 12503 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
12504 defining it (defined but null disables alloca).
12505
5a009f2c
MA
125062001-08-13 Marc Autret <autret_m@epita.fr>
12507
12508 * src/bison.simple (_yy_memcpy): CPP reformat.
12509
1e41465a
PB
125102001-08-13 Pascal Bart <pascal.bart@epita.fr>
12511
12512 * tests/atconfig.in (CPPFLAGS): Fix.
12513
c67a198d
PB
125142001-08-10 Pascal Bart <pascal.bart@epita.fr>
12515
79282c6c 12516 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
12517 `gpl.texi'.
12518 * doc/gpl.texi: Add to package.
12519
09a6de7e
MA
125202001-08-10 Marc Autret <autret_m@epita.fr>
12521
12522 * src/print_graph.h: Fix.
12523 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
12524
b77b9ee0
AD
125252001-08-10 Akim Demaille <akim@epita.fr>
12526
12527 * src/system.h: Provide default declarations for stpcpy, strndup,
12528 and strnlen.
12529
3e259915
MA
125302001-08-10 Robert Anisko <anisko_r@epita.fr>
12531
12532 * doc/bison.texinfo (Locations): Update @$ stuff.
12533
ca96bc2d
MA
125342001-08-09 Robert Anisko <anisko_r@epita.fr>
12535
12536 * src/bison.simple (YYLLOC_DEFAULT): Update.
12537 (yyparse): Adjust.
12538
fdc6758b
MA
125392001-08-08 Marc Autret <autret_m@epita.fr>
12540
b77b9ee0 12541 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
12542 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
12543 Reported by Fabrice Bauzac.
957d4dbf 12544
600cad3b
MA
125452001-08-08 Marc Autret <autret_m@epita.fr>
12546
12547 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
12548 * src/vcg.c (output_node): Fix.
12549 * src/vcg.h: Cleanup.
12550 * src/print_graph.c: Add comments.
b77b9ee0 12551 (node_output_size): New global variable. Simplify the formatting of
600cad3b 12552 the VCG graph output.
b77b9ee0 12553 (print_actions): Unused code is now used. It notifies the final state
600cad3b 12554 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 12555 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
12556 blue.
12557 Get the current node name and node_obstack by argument.
12558 (node_obstack): New variable.
12559 (print_state): Manage node_obstack.
12560 (print_core): Use node_obstack given by argument.
12561 A node is not only computed here but in print_actions also.
12562 (print_graph): CPP out useless code instead of commenting it.
12563
976e528f
AD
125642001-08-07 Pascal Bart <pascal.bart@epita.fr>
12565
12566 * tests/atconfig.in (CPPFLAGS): Fix.
12567
20e8e5ca
AD
125682001-08-07 Akim Demaille <akim@epita.fr>
12569
12570 * src/print_graph.c (quote): New.
12571 (print_core): Use it.
12572
957d4dbf 125732001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 12574
3e3da797
AD
12575 * src/vcg.c (complain.h): Include it.
12576 Unepitaize `return' invocations.
c4b66126 12577 [NDEBUG] (main): Remove.
79282c6c 12578 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
12579 * src/files.c (open_files): Initialize graph_obstack.
12580 * src/print_graph.c (print_actions): CPP out useless code.
12581 (print_core): Don't output the last `\n' in labels.
12582 Use `quote'.
12583 * src/files.c (output_files): Output the VCG file.
12584 * src/main.c (main): Invoke print_graph ();
3e3da797 12585
957d4dbf 125862001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
12587
12588 Automaton VCG graph output.
12589 Using option ``-g'' or long option ``--graph'', you can generate
12590 a gram_filename.vcg file containing a VCG description of the LALR (1)
12591 automaton of your grammar.
12592
12593 * src/main.c: Call to print_graph() function.
12594 * src/getargs.h: Update.
12595 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
12596 (graph_flag): New flag.
12597 (longopts): Update.
12598 (getargs): Add case `g'.
12599 * src/files.c (graph_obstack): New obstack struct.
12600 (open_files): Initialize new obstack.
12601 (output_files): Saves graph_obstack if required.
12602 * src/files.h (graph_obstack): New extern declaration.
12603 * src/Makefile.am: Add new source files.
12604
927c1557 126052001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
12606
12607 * src/print_graph.c, src/print_graph.h (graph): New.
12608 * src/vcg.h: New file.
12609 * src/vcg.c: New file, VCG graph handling.
12610
7333d403
AD
126112001-08-06 Marc Autret <autret_m@epita.fr>
12612
12613 Add of %source_extension and %header_extension which specify
12614 the source or/and the header output file extension.
12615
12616 * src/files.c (compute_base_names): Remove initialisation of
12617 src_extension and header_extension.
12618 (compute_exts_from_gf): Update.
12619 (compute_exts_from_src): Update.
12620 (output_files): Update.
12621 * src/reader.c (parse_header_extension_decl): New.
12622 (parse_source_extension_decl): New.
12623 (read_declarations): New case statements for the new tokens.
12624 * src/lex.c (percent_table): Add entries for %source_extension
12625 and %header_extension.
12626 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
12627
84163231
AD
126282001-08-06 Marc Autret <autret_m@epita.fr>
12629
12630 * configure.in: Bump to 1.28c.
12631 * doc/bison.texinfo: Texinfo thingies.
12632
8303fc42
AD
126332001-08-04 Pascal Bart <pascal.bart@epita.fr>
12634
12635 * tests/atconfig.in (CPPFLAGS): Add.
12636 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
12637
70a84437
AD
126382001-08-03 Akim Demaille <akim@epita.fr>
12639
12640 Version 1.28b.
12641
2ce10144
AD
126422001-08-03 Akim Demaille <akim@epita.fr>
12643
12644 * tests/Makefile.am (check-local): Ship testsuite.
12645 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
12646 Include `string.h'.
12647
1e3e4bc1
AD
126482001-08-03 Akim Demaille <akim@epita.fr>
12649
12650 * configure.in: Try using -Wformat when compiling.
12651
42b45b7f
AD
126522001-08-03 Akim Demaille <akim@epita.fr>
12653
12654 * configure.in: Bump to 1.28b.
12655
8f13fe33
AD
126562001-08-03 Akim Demaille <akim@epita.fr>
12657
12658 * src/complain.c: Adjust strerror_r portability issues.
12659
b37ba92c
AD
126602001-08-03 Akim Demaille <akim@epita.fr>
12661
12662 Version 1.28a.
12663
b0ce6046
AD
126642001-08-03 Akim Demaille <akim@epita.fr>
12665
12666 * src/getargs.c, src/getarg.h (skeleton)): Constify.
12667 * src/lex.c (literalchar): Avoid name clashes on `buf'.
12668 * src/getargs.c: Include complain.h.
12669 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
12670 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
12671
d01c415b
AD
126722001-08-03 Akim Demaille <akim@epita.fr>
12673
12674 * src/reader.c (readgram): Display hidden chars in error messages.
12675
459dd1a6
AD
126762001-08-03 Akim Demaille <akim@epita.fr>
12677
12678 Update to gettext 0.10.39.
12679
53b74c0c
AD
126802001-08-03 Akim Demaille <akim@epita.fr>
12681
12682 * lib/strspn.c: New.
12683
234a3be3
AD
126842001-08-01 Marc Autret <autret_m@epita.fr>
12685
12686 * doc/bison.texinfo: Update.
12687 * doc/bison.1 (mandoc): Update.
12688 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
12689 * src/files.c: Support output files extensions computing.
12690 (src_extension): New static variable.
12691 (header_extension): New static variable.
12692 (tr): New function.
12693 (get_extension_index): New function, gets the index of an extension
12694 filename in a string.
12695 (compute_exts_from_gf): New function, computes extensions from the
12696 grammar file extension.
12697 (compute_exts_from_src): New functions, computes extensions from the
12698 C source file extension, file given by ``-o'' option.
12699 (compute_base_names): Update.
12700 (output_files): Update.
12701
847bf1f5
AD
127022001-08-01 Robert Anisko <anisko_r@epita.fr>
12703
d995fee7 12704 * doc/bison.texi: Document @$.
847bf1f5
AD
12705 (Locations): New section.
12706
d074a105
AD
127072001-07-18 Akim Demaille <akim@epita.fr>
12708
12709 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
12710 * config/prev-version.txt, config/move-if-change: New.
12711 * Makefile.am: Adjust.
12712
3419715d
AD
127132001-07-08 Pascal Bart <pascal.bart@epita.fr>
12714
12715 * src/bison.simple (yyparse): Suppress warning `comparaison
12716 between signed and unsigned'.
12717
62ab6972
AD
127182001-07-05 Pascal Bart <pascal.bart@epita.fr>
12719
12720 * src/getargs.h (raw_flag): Remove.
12721 * src/getargs.c: Die on `-r'/`--raw'.
12722 * src/lex.c (parse_percent_token): Die on `%raw'.
12723 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
12724 * tests/calc.at: Suppress test with option `--raw'.
12725
1e24cc5b
AD
127262001-07-14 Akim Demaille <akim@epita.fr>
12727
12728 * config/: New.
12729 * configure.in: Require Autoconf 2.50.
12730 Update to gettext 0.10.38.
12731
32dfccf8
AD
127322001-03-16 Akim Demaille <akim@epita.fr>
12733
12734 * doc/bison.texinfo: ANSIfy the examples.
12735
cd5bd6ac
AD
127362001-03-16 Akim Demaille <akim@epita.fr>
12737
12738 * getargs.c (skeleton): New variable.
12739 (longopts): --skeleton is a new option.
12740 (shortopts, getargs): -S is a new option.
12741 * getargs.h: Declare skeleton.
12742 * output.c (output_parser): Use it.
12743
5141b016
AD
127442001-03-16 Akim Demaille <akim@epita.fr>
12745
12746 * m4/strerror_r.m4: New.
12747 * m4/error.m4: Run AC_FUNC_STRERROR_R.
12748 * lib/error.h, lib/error.c: Update.
12749
447992b9
AD
127502001-03-16 Akim Demaille <akim@epita.fr>
12751
12752 * src/getargs.c (longopts): Clean up.
12753
274d42ce
AD
127542001-02-21 Akim Demaille <akim@epita.fr>
12755
12756 * src/reader.c (gensym): `gensym_count' is your own.
12757 Use a static buf to create the symbol name, as token_buffer is no
12758 longer a buffer.
12759
22c821f3
AD
127602001-02-08 Akim Demaille <akim@epita.fr>
12761
12762 * src/conflicts.c (conflict_report): Be sure not to append to res
12763 between two calls, which could happen if both first sprintf were
12764 skipped, but not the first cp += strlen.
12765
18569462
AD
127662001-02-08 Akim Demaille <akim@epita.fr>
12767
12768 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
12769 New, from fileutils 4.0.37.
12770 * configure.in: Require Autoconf 2.49c. I took some time before
12771 making this decision. This is the only way out for portability
12772 issues in Bison, it would mean way too much duplicate effort to
12773 import in Bison features implemented in 2.49c since 2.13.
12774 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
12775
0d8f3c8a
AD
127762001-02-02 Akim Demaille <akim@epita.fr>
12777
12778 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 12779 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 12780
f17bcd1f
AD
127812001-01-19 Akim Demaille <akim@epita.fr>
12782
12783 Get rid of the ad hoc handling of token_buffer in the scanner: use
12784 the obstacks.
12785
12786 * src/lex.c (token_obstack): New.
12787 (init_lex): Initialize it. No longer call...
12788 (grow_token_buffer): this. Remove it.
12789 Adjust all the places which used it to use the obstack.
12790
511e79b3
AD
127912001-01-19 Akim Demaille <akim@epita.fr>
12792
12793 * src/lex.h: Rename all the tokens:
12794 s/\bENDFILE\b/tok_eof/g;
12795 s/\bIDENTIFIER\b/tok_identifier/g;
12796 etc.
12797 Let them be enums, not #define, to ease debugging.
12798 Adjust all the code.
12799
0d6508ef
AD
128002001-01-18 Akim Demaille <akim@epita.fr>
12801
12802 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
12803 * src/lex.c (maxtoken, grow_token_buffer): Static.
12804
6deb4447
AD
128052001-01-18 Akim Demaille <akim@epita.fr>
12806
12807 Since we now use obstacks, more % directives can be enabled.
12808
12809 * src/lex.c (percent_table): Also accept `%yacc',
12810 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
12811 `%debug'.
12812 Handle the actions for `%semantic_parser' and `%pure_parser' here,
12813 instead of returning a token.
12814 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
12815 * src/reader.c (read_declarations): Adjust.
12816 * src/files.c (open_files): Don't call `compute_base_names', don't
12817 compute `attrsfile' since they depend upon data which might be
12818 *in* the input file now.
12819 (output_files): Do it here.
12820 * src/output.c (output_headers): Document the fact that this patch
12821 introduces a guaranteed SEGV for semantic parsers.
12822 * doc/bison.texinfo: Document them.
12823 * tests/suite.at: Exercise these %options.
12824
ff4423cc
AD
128252000-12-20 Akim Demaille <akim@epita.fr>
12826
12827 Also handle the output file (--verbose) with obstacks.
12828
12829 * files.c (foutput): Remove.
12830 (output_obstack): New.
12831 Adjust all dependencies.
12832 * src/conflicts.c: Return a string.
12833 * src/system.h (obstack_grow_string): Rename as...
12834 (obstack_sgrow): this. Be ready to work with non literals.
12835 (obstack_fgrow4): New.
12836
956dba3a
AD
128372000-12-20 Akim Demaille <akim@epita.fr>
12838
12839 * src/files.c (open_files): Fix the computation of short_base_name
12840 in the case of `-o foo.tab.c'.
12841
337bab46
AD
128422000-12-20 Akim Demaille <akim@epita.fr>
12843
12844 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
12845 (copy_dollar): Now that everything uses obstacks, get rid of the
12846 FILE * parameters.
12847
5d3214b8
AD
128482000-12-20 Akim Demaille <akim@epita.fr>
12849
12850 * src/files.c (open_files): Actually the `.output' file is based
12851 on the short_base_name, not base_name.
12852 * tests/suite.at (Checking output file names): Adjust.
12853
29092a57
AD
128542000-12-20 Akim Demaille <akim@epita.fr>
12855
12856 * src/bison.s1: Remove, we now use directly...
12857 * src/bison.simple: this.
12858 * src/Makefile.am: Use pkgdata instead of data.
12859
ea5607fd
AD
128602000-12-20 Akim Demaille <akim@epita.fr>
12861
12862 * src/files.c (guard_obstack): New.
12863 (open_files): Initialize it.
12864 (output_files): Dump it...
12865 * src/files.h: Export it.
12866 * src/reader.c (copy_guard): Use it.
12867
27110317
AD
128682000-12-19 Akim Demaille <akim@epita.fr>
12869
12870 * src/files.c (outfile, defsfile, actfile): Removed as global
12871 vars.
12872 (open_files): Don't compute them.
12873 (output_files): Adjust.
12874 (base_name, short_base_name): Be global.
12875 Adjust dependencies.
12876
19c50364
AD
128772000-12-19 Akim Demaille <akim@epita.fr>
12878
12879 * src/files.c (strsuffix): New.
12880 (stringappend): Be just like strcat but allocate.
12881 (base_names): Eve out from open_files.
12882 Try to simplify the rather hairy computation of base_name and
12883 short_base_name.
12884 (open_files): Use it.
12885 * tests/suite.at (Checking output file names): New test.
12886
573c1d9f
AD
128872000-12-19 Akim Demaille <akim@epita.fr>
12888
12889 * src/system.h (obstack_grow_literal_string): Rename as...
12890 (obstack_grow_string): this.
12891 * src/output.c (output_parser): Recognize `%% actions' instead of
12892 `$'.
12893 * src/bison.s1: s/$/%% actions/.
12894 * src/bison.hairy: Likewise.
12895
ef7ddedd
AD
128962000-12-19 Akim Demaille <akim@epita.fr>
12897
12898 * src/output.c (output_parser): Compute the `#line' lines when
12899 there are.
12900 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
12901 Suggested by Hans Aberg.
12902
ff61dabd
AD
129032000-12-19 Akim Demaille <akim@epita.fr>
12904
12905 Let the handling of the skeleton files be local to the procedures
12906 that use it.
12907
12908 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
12909 longer static.
12910 (fparser, open_extra_files): Remove.
12911 (open_files, output_files): Don't take care of fparser.
12912 * src/files.h: Adjust.
12913 * src/output.c (output_parser): Open and close the file to the
12914 skeleton.
12915 * src/reader.c (read_declarations): When %semantic_parser, open
12916 fguard.
12917
55b96341
AD
129182000-12-19 Akim Demaille <akim@epita.fr>
12919
12920 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
12921 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
12922
358c15b7
AD
129232000-12-19 Akim Demaille <akim@epita.fr>
12924
12925 * src/files.c (open_files): Yipee! We no longer need all the code
12926 looking for `/tmp' since we have no tmp file.
12927
7de3329e
AD
129282000-12-19 Akim Demaille <akim@epita.fr>
12929
12930 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
12931 New macros.
12932 * src/files.c (open_files): Less dependency on MSDOS etc.
12933
3abcd459
AD
129342000-12-14 Akim Demaille <akim@epita.fr>
12935
12936 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
12937 Provide a default definition.
12938 Use it when executing the default @ action.
12939 * src/reader.c (reader_output_yylsp): No longer include
12940 `timestamp' and `text' in the default YYLTYPE.
12941
2a91a95e
AD
129422000-12-12 Akim Demaille <akim@epita.fr>
12943
12944 * src/reader.c (copy_definition, parse_union_decl, copy_action)
12945 (copy_guard): Quote the file names.
12946 Reported by Laurent Mascherpa.
12947
14d3eb9b
AD
129482000-12-12 Akim Demaille <akim@epita.fr>
12949
12950 * src/output.c (output_headers, output_program, output): Be sure
12951 to escape special characters when outputting filenames.
12952 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
12953 (output_headers): Don't depend on them, Use ACTSTR.
12954
d7045ec6
AD
129552000-11-17 Akim Demaille <akim@epita.fr>
12956
12957 * lib/obstack.h: Formatting changes.
12958 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
12959 prevents type checking.
12960 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
12961 cast the value to (void *): assigning a `foo *' to a `void *'
12962 variable is valid.
12963 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
12964 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
12965 append characters.
12966
6fd54b73
AD
129672000-11-17 Akim Demaille <akim@epita.fr>
12968
12969 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
12970 as...
12971 (suite.m4, regression.m4, calc.m4): these.
12972 * tests/atgeneral.m4: Update from CVS Autoconf.
12973
4c50eae6
AD
129742000-11-17 Akim Demaille <akim@epita.fr>
12975
12976 * tests/regression.m4 (%union and --defines): New test,
12977 demonstrating a current bug in the obstack implementation.
12978
a35f64ea
AD
129792000-11-17 Akim Demaille <akim@epita.fr>
12980
12981 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
12982 macros.
12983 Use them to declare the variables which are global or local to
12984 `yyparse'.
12985
7de23534
AD
129862000-11-17 Akim Demaille <akim@epita.fr>
12987
12988 * acconfig.h: Remove, no longer used.
12989
aa7815f5
AD
129902000-11-07 Akim Demaille <akim@epita.fr>
12991
12992 * src: s/Copyright (C)/Copyright/g.
12993
5af1f549
AD
129942000-11-07 Akim Demaille <akim@epita.fr>
12995
12996 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
12997 defining.
12998 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
12999
553e2b22
AD
130002000-11-07 Akim Demaille <akim@epita.fr>
13001
13002 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
13003 Merge in a single CPP if/else.
13004
8a4f41d6
AD
130052000-11-07 Akim Demaille <akim@epita.fr>
13006
13007 * src/output.c (output): Remove useless variables.
13008 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
13009 argument `data' for consistency with the prototypes.
13010 Qualify it `const'.
13011 (obstack_copy, obstack_copy0): Rename the second argument as
13012 `address' for consistency. Qualify it `const'.
13013 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
13014 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
13015 `const' their input argument (`data' or `address').
13016 Adjust the corresponding macros to include `const' in casts.
13017
095a3fb5
AD
130182000-11-03 Akim Demaille <akim@epita.fr>
13019
13020 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
13021 s/PFILE1/BISON_HAIRY/.
13022 Adjust dependencies.
13023
d1cdce7c
AD
130242000-11-03 Akim Demaille <akim@epita.fr>
13025
090c5ebf 13026 For some reason, this was not applied.
d1cdce7c
AD
13027
13028 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
13029 `unlink': it's no longer used.
13030
9311529b
AD
130312000-11-03 Akim Demaille <akim@epita.fr>
13032
13033 * src/files.c (skeleton_find): New function, eved out of...
13034 (open_files, open_extra_files): here.
13035
d8880f69
AD
130362000-11-03 Akim Demaille <akim@epita.fr>
13037
13038 Don't use `atexit'.
13039
13040 * src/files.c (obstack_save): New function.
13041 (done): Rename as...
13042 (output_files): this.
13043 Use `obstack_save'.
13044 * src/main.c (main): Don't use `atexit' to register `done', since
13045 it no longer has to remove tmp files, just call `output_files'
13046 when there are no errors.
13047
0dbb648e
AD
130482000-11-02 Akim Demaille <akim@epita.fr>
13049
13050 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
13051 `unlink': it's no longer used.
13052 * src/files.h: Formatting changes.
13053
896fe5c1
AD
130542000-11-02 Akim Demaille <akim@epita.fr>
13055
13056 Remove the last uses of mktemp and unlink/delete.
13057
13058 * src/files.c (fdefines, ftable): Removed.
13059 (defines_ostack, table_obstack): New.
13060 Adjust dependencies of the former into uses of the latter.
13061 * src/output.c (output_short_or_char_table, output_short_table):
13062 Convert to using obstacks.
13063 * src/reader.c (copy_comment2): Accept one FILE * and two
13064 obstacks.
13065 (output_token_defines, reader_output_yylsp): Use obstacks.
13066 * src/system.h (obstack_fgrow3): New.
1f65350a 13067 * po/POTFILES.in: Adjust.
896fe5c1 13068
dd60faec
AD
130692000-11-01 Akim Demaille <akim@epita.fr>
13070
13071 Change each use of `fattrs' into a use of `attrs_obstack'.
13072
13073 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
13074 * src/files.c (fattrs): Remove.
13075 (attrs_obstack): New.
13076 Adjust all dependencies.
13077 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
13078
8c7ebe49
AD
130792000-11-01 Akim Demaille <akim@epita.fr>
13080
13081 Introduce obstacks.
13082 Change each use of `faction' into a use of `action_obstack'.
13083
13084 * lib/obstack.h, lib/obstack.c: New files.
13085 * src/files.c (faction): Remove.
13086 (action_obstack): New.
13087 Adjust all dependencies.
13088
77aee789
AD
130892000-10-20 Akim Demaille <akim@epita.fr>
13090
13091 * lib/quote.h (PARAMS): New macro. Use it.
13092
43591cec
AD
130932000-10-16 Akim Demaille <akim@epita.fr>
13094
13095 * src/output.c (output_short_or_char_table): New function.
13096 (output_short_table, output_token_translations): Use it.
13097 (goto_actions): Use output_short_table.
13098
1e9798d5
AD
130992000-10-16 Akim Demaille <akim@epita.fr>
13100
13101 * src/symtab.c (bucket_new): New function.
13102 (getsym): Use it.
13103
13104 * src/output.c (output_short_table): New argument to display the
13105 comment associated with the table.
13106 Adjust dependencies.
13107 (output_gram): Use it.
13108 (output_rule_data): Nicer output layout for YYTNAME.
13109
f282676b
AD
131102000-10-16 Akim Demaille <akim@epita.fr>
13111
13112 * src/lex.c (read_typename): New function.
13113 (lex): Use it.
13114 * src/reader.c (copy_dollar): Likewise.
13115
550a72a3
AD
131162000-10-16 Akim Demaille <akim@epita.fr>
13117
13118 * src/reader.c (copy_comment2): Expect the input stream to be on
13119 the `/' which is suspected to open a comment, instead of being
13120 called after `//' or `/*' was read.
13121 (copy_comment, copy_definition, parse_union_decl, copy_action)
13122 (copy_guard): Adjust.
13123
131e2fef
AD
131242000-10-16 Akim Demaille <akim@epita.fr>
13125
13126 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
13127 `read_signed_integer'.
13128
79282c5a
AD
131292000-10-16 Akim Demaille <akim@epita.fr>
13130
13131 * src/reader.c (copy_dollar): New function.
13132 (copy_guard, copy_action): Use it.
13133
ff4a34be
AD
131342000-10-16 Akim Demaille <akim@epita.fr>
13135
13136 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
13137 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
13138 New files, from Fileutils 4.0.27.
13139 * src/main.c (printable_version): Remove.
13140 * src/lex.c, src/reader.c: Use `quote'.
13141
131422000-10-04 Akim Demaille <akim@epita.fr>
13143
13144 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
13145
14ded682
AD
131462000-10-04 Akim Demaille <akim@epita.fr>
13147
13148 * doc/bison.texinfo: Various typos spotted by Neil Booth.
13149
8e03724b
AD
131502000-10-04 Akim Demaille <akim@epita.fr>
13151
13152 When a literal string is used to define two different tokens,
13153 `bison -v' segfaults.
13154 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
13155
13156 * tests/regression.m4: New file.
13157 Include the core of the sample provided by Piotr Gackiewicz.
13158 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
13159 properly.
13160
a9e64249
AD
131612000-10-04 Akim Demaille <akim@epita.fr>
13162
13163 * src/reader.c (parse_expect_decl): Keep `count' within the size
13164 of `buffer'.
13165 From Neil Booth.
13166
da9abf43
AD
131672000-10-02 Paul Eggert <eggert@twinsun.com>
13168
13169 * bison.s1 (yyparse): Assign the default value
13170 unconditionally, to avoid a GCC warning and make the parser a
13171 tad smaller.
13172
c33638bb
AD
131732000-10-02 Akim Demaille <akim@epita.fr>
13174
13175 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
13176 options.
13177
444c570a
AD
131782000-10-02 Akim Demaille <akim@epita.fr>
13179
13180 * src/derives.c, src/print.c, src/reduce.c: To ease the
13181 translation, move some `\n' out of the translated strings.
13182
89cab50d
AD
131832000-10-02 Akim Demaille <akim@epita.fr>
13184
13185 The location tracking mechanism is precious for parse error
13186 messages. Nevertheless, it is enabled only when `@n' is used in
13187 the grammar, which is a different issue (you can use it in error
13188 message, but not in the grammar per se). Therefore, there should
13189 be another means to enable it.
13190
13191 * src/getargs.c (getargs): Support `--locations'.
13192 (usage): Report it.
13193 * src/getargs.h (locationsflag): Export it.
13194 * src/lex.c (percent_table): Support `%locations'.
13195 * src/reader.c (yylsp_needed): Remove this variable, now replaced
13196 with `locationsflag'.
13197 * doc/bison.texinfo: Document `--locations' and `%locations'.
13198 Sort the options.
13199 * tests/calc.m4: Test it.
13200
13201 For regularity of the names, replace each
13202 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
13203 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
13204 In addition replace each `flag' with `_flag'.
13205
d6c2cba0
AD
132062000-10-02 Akim Demaille <akim@epita.fr>
13207
13208 Also test parse error messages, including with YYERROR_VERBOSE.
13209
13210 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
13211 associative).
13212 Use it to check the computations.
13213 Use it to check `nonassoc' is honored.
13214 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
13215 `--yyerror-verbose'.
13216 (_AT_CHECK_CALC): Adjust to this option.
13217 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
13218
5a35a6cb
AD
132192000-10-02 Akim Demaille <akim@epita.fr>
13220
13221 Test also `--verbose', `--defines' and `--name-prefix'. Testing
13222 the latter demonstrates a flaw in the handling of non debugging
13223 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
13224 was used in order to simplify:
13225
13226 #if YYDEBUG
13227 if (yydebug)
13228 {
13229 ...
13230 }
13231 #endif
13232
13233 into
13234
13235 if (yydebug)
13236 {
13237 ...
13238 }
13239
13240 unfortunately this leads to a CPP conflict when
13241 `--name-prefix=foo' is used since it produces `#define yydebug
13242 foodebug'.
13243
13244 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
13245 (YYDPRINTF): New macro.
13246 Spread its use.
13247 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
13248 the bison options.
13249 Also test `--verbose', `--defines' and `--name-prefix'.
13250
71da9eea
AD
132512000-10-02 Akim Demaille <akim@epita.fr>
13252
13253 Improve the readability of the produced parsers.
13254
13255 * src/bison.s1: Formatting changes.
13256 Improve the comment related to the `$' mark.
13257 (yydefault): Don't fall through to `yyresume': `goto' there.
13258 * src/output.c (output_parser): When the `$' is met, skip the end
13259 of its line.
13260 New variable, `number_of_dollar_signs', to check there's exactly
13261 one `$' in the parser skeleton.
13262
95e36146
AD
132632000-10-02 Akim Demaille <akim@epita.fr>
13264
13265 * lib/xstrdup.c: New file, from the fileutils.
13266 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
13267 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
13268 instead of strlen + xmalloc + strcpy.
13269 * src/symtab.c (copys): Remove, use xstrdup instead.
13270
d7020c20
AD
132712000-10-02 Akim Demaille <akim@epita.fr>
13272
13273 * src/gram.h (associativity): New enum type which replaces the
13274 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
13275 `right_assoc', `left_assoc' and `non_assoc'.
13276 Adjust all dependencies.
13277 * src/reader.c: Formatting changes.
13278 (LTYPESTR): Don't define it, use it as a literal in
13279 `reader_output_yylsp'.
13280 * src/symtab.h (symbol_class): New enum type which replaces the
13281 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
13282 `sunknown', `stoken and `snterm'.
13283
1916f98e
AD
132842000-10-02 Akim Demaille <akim@epita.fr>
13285
13286 * src/getargs.c (fixed_outfiles): Rename as...
13287 (yaccflag): for consistency and accuracy.
13288 Adjust dependencies.
13289
d7913476
AD
132902000-10-02 Akim Demaille <akim@epita.fr>
13291
13292 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
13293 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
13294 difficult and introduced a lot of core dump. It turns out that
13295 Bison used an implementation of `xmalloc' based on `calloc', and
13296 at various places it does depend upon the initialization to 0. I
13297 have not tried to isolate the pertinent places, and all the former
13298 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
13299 someone should address this issue.
13300
13301 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
13302 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
13303 files.
13304 Adjust dependencies.
13305 * src/warshall.h: New file.
13306 Propagate.
13307
340ef489
AD
133082000-10-02 Akim Demaille <akim@epita.fr>
13309
13310 Various anti-`extern in *.c' changes.
13311
13312 * src/system.h: Include `assert.h'.
13313
b2ca4022
AD
133142000-10-02 Akim Demaille <akim@epita.fr>
13315
13316 * src/state.h (nstates, final_state, first_state, first_shift)
13317 (first_reduction): Move their exportation from here...
13318 * src/LR0.h: to here.
13319 Adjust dependencies.
13320 * src/getargs.c (statisticsflag): New variable.
13321 Add support for `--statistics'.
13322 Adjust dependencies.
13323
13324 Remove a lot of now useless `extern' statements in most files.
13325
403b315b
AD
133262000-10-02 Akim Demaille <akim@epita.fr>
13327
13328 * src/LR0.h: New file.
13329 Propagate its use.
13330
07a58c13
AD
133312000-10-02 Akim Demaille <akim@epita.fr>
13332
13333 * src/print.h: New file.
13334 Propagate its use.
13335 * src/print.c: Formatting and ordering changes.
13336 (verbose, terse): Replace with...
13337 (print_results): this new function.
13338 Adjust dependencies.
13339
0619caf0
AD
133402000-10-02 Akim Demaille <akim@epita.fr>
13341
13342 * src/conflicts.c (conflict_report): New function.
13343 (conflict_log, verbose_conflict_log): Replace with...
13344 (print_conflicts): this function.
13345 Adjust dependencies.
13346 * src/conflicts.h: New file.
13347 Propagate its inclusion.
13348
3519ec76
AD
133492000-10-02 Akim Demaille <akim@epita.fr>
13350
13351 * src/nullable.h: New file.
13352 Propagate its inclusion.
13353 * src/nullable.c: Formatting changes.
13354
015acc48
AD
133552000-10-02 Akim Demaille <akim@epita.fr>
13356
13357 * src/reduce.h: New file.
13358 Propagate its inclusion.
13359 * src/reduce.c: Topological sort and other formatting changes.
13360 (bool, TRUE, FALSE): Move their definition to...
13361 * src/system.h: here.
13362
8963a27b
AD
133632000-10-02 Akim Demaille <akim@epita.fr>
13364
13365 * src/files.c: Formatting changes.
13366 (tryopen, tryclose, openfiles): Rename as...
13367 (xfopen, xfclose, open_files): this.
13368 (stringappend): static.
13369 * src/files.h: Complete the list of exported symbols.
13370 Propagate its use.
13371
a70083a3
AD
133722000-10-02 Akim Demaille <akim@epita.fr>
13373
13374 * src/reader.h: New file.
13375 Propagate its use instead of tedious list of `extern' and
13376 prototypes.
13377 * src/reader.c: Formatting changes, topological sort,
13378 s/register//.
13379
abadc117
AD
133802000-10-02 Akim Demaille <akim@epita.fr>
13381
13382 * src/lex.h: Prototype `lex.c' exported functions.
13383 * src/reader.c: Adjust.
13384 * src/lex.c: Formatting changes.
13385 (safegetc): Rename as...
13386 (xgetc): this.
13387
720d742f
AD
133882000-10-02 Akim Demaille <akim@epita.fr>
13389
13390 * src/lalr.h: New file.
13391 Propagate its inclusion instead of prototypes and `extern'.
13392 * src/lalr.c: Formatting changes, topological sorting etc.
13393
f2acea59
AD
133942000-10-02 Akim Demaille <akim@epita.fr>
13395
13396 * src/output.c (token_actions): Introduce a temporary array,
13397 YYDEFACT, that makes it possible for this function to use
13398 output_short_table.
13399
d019d655
AD
134002000-10-02 Akim Demaille <akim@epita.fr>
13401
13402 `user_toknums' is output as a `short[]' in `output.c', while it is
13403 defined as a `int[]' in `reader.c'. For consistency with the
13404 other output tables, `user_toknums' is now defined as a table of
13405 shorts.
13406
13407 * src/reader.c (user_toknums): Be a short table instead of an int
13408 table.
13409 Adjust dependencies.
13410
13411 Factor the short table outputs.
13412
13413 * src/output.c (output_short_table): New function.
13414 * src/output.c (output_gram, output_stos, output_rule_data)
13415 (output_base, output_table, output_check): Use it.
13416
6c89f1c1
AD
134172000-10-02 Akim Demaille <akim@epita.fr>
13418
13419 * src/output.c (output): Topological sort of the functions, in
13420 order to get rid of the `static' prototypes.
13421 No longer use `register'.
13422 * src/output.h: New file.
13423 Propagate its inclusion in files explicitly prototyping functions
13424 from output.c.
13425
d9efd181
AD
134262000-09-21 Akim Demaille <akim@epita.fr>
13427
13428 * src/atgeneral.m4: Update from Autoconf.
13429
c29240e7 134302000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
13431
13432 * src/closure.h: New file.
13433 * src/closure.c: Formatting changes, topological sort over the
13434 functions, use of closure.h.
13435 (initialize_closure, finalize_closure): Rename as...
13436 (new_closure, free_closure): these. Adjust dependencies.
13437 * src/LR0.c: Formatting changes, topological sort, use of
13438 cloture.h.
13439 (initialize_states): Rename as...
13440 (new_states): this.
13441 * src/Makefile.am (noinst_HEADERS): Adjust.
13442
499daa50
AD
134432000-09-20 Akim Demaille <akim@epita.fr>
13444
13445 * src/acconfig.h: Don't protect config.h against multiple
13446 inclusion.
13447 Don't define PARAMS.
13448 * src/system.h: Define PARAMS.
13449 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
13450 purpose of config.h. system.h must not try to fix wrong
13451 definitions in config.h.
13452
cc84fd5d
AD
134532000-09-20 Akim Demaille <akim@epita.fr>
13454
13455 * src/derives.h: New file.
13456 * src/main.c, src/derives.h: Use it.
13457 Formatting changes.
13458 * src/Makefile.am (noinst_HEADERS): Adjust.
13459
db5b3a89
AD
134602000-09-20 Akim Demaille <akim@epita.fr>
13461
13462 * tests/atgeneral.m4: Update from Autoconf.
13463 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
13464 (AT_CHECK_CALC): New macros.
13465 Use these macros to test bison with options `', `--raw',
13466 `--debug', `--yacc', `--yacc --debug'.
13467
ceed8467
AD
134682000-09-19 Akim Demaille <akim@epita.fr>
13469
13470 * src/output.c: Formatting changes.
13471 * src/machine.h: Remove, leaving its contents in...
13472 * src/system.h: here.
13473 Include stdio.h.
13474 Adjust all dependencies on stdio.h and machine.h.
13475 * src/getargs.h: New file.
13476 Let all `extern' declarations about getargs.c be replaced with
13477 inclusion of `getargs.h'.
13478 * src/Makefile.am (noinst_HEADERS): Adjust.
13479
13480 * tests/calc.m4 (yyin): Be initialized in main, not on the global
13481 scope.
13482 (yyerror): Returns void, not int.
13483 * doc/bison.texinfo: Formatting changes.
13484
05a1d24b
AD
134852000-09-19 Akim Demaille <akim@epita.fr>
13486
13487 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
13488 portable.
13489
cbd25751
AD
134902000-09-18 Akim Demaille <akim@epita.fr>
13491
13492 * configure.in: Append WARNING_CFLAGS to CFLAGS.
13493 * src/Makefile.am (INCLUDES): Don't.
13494 Be ready to fetch headers in lib/.
13495
13863333
AD
134962000-09-18 Akim Demaille <akim@epita.fr>
13497
13498 * doc/bison.texinfo: Update the copyright.
13499 ANSIfy and GNUify the examples.
13500 Remove the old menu.
13501
0d533154
AD
135022000-09-18 Akim Demaille <akim@epita.fr>
13503
13504 First set of tests: use the `calc' example from the documentation.
13505
13506 * src/bison.s1 (yyparse): Condition the code using `yytname' which
13507 is defined only when YYDEBUG is.
13508 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
13509 * src/files.c (tryopen, tryclose): Formatting changes.
13510 Move to the top and be static.
13511 * src/reader.c (read_signed_integer): Likewise.
13512 * tests/calc.m4: New file.
13513 * Makefile.am, suite.m4: Adjust.
13514 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
13515
e79137ac
AD
135162000-09-18 Akim Demaille <akim@epita.fr>
13517
13518 Add support for an Autotest test suite for Bison.
13519
13520 * m4/m4.m4, m4/atconfig.m4: New files.
13521 * m4/Makefile.am (EXTRA_DIST): Adjust.
13522 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
13523 files.
13524 * src/getargs.c: Display a more standard --version message.
13525 * src/reader.c (reader): Formatting changes.
13526 No longer depend upon VERSION_STRING.
13527 * configure.in: No longer use `dnl'.
13528 Set up the test suite and the new directory `tests/.
13529 (VERSION_STRING): Remove.
13530
27821bff
AD
135312000-04-14 Akim Demaille <akim@epita.fr>
13532
13533 * src/reader.c (copy_comment2): New function, same as former
13534 `copy_comment', but outputs into two FILE *.
13535 (copy_comment): Use it.
13536 (parse_union_decl): Use it.
13537 (get_type, parse_start_decl): Use the same `invalid' message.
13538 (parse_start_decl, parse_union_decl): Use the same `multiple'
13539 message.
13540 (parse_union_decl, copy_guard, copy_action): Use the same
13541 `unmatched' message.
13542 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
13543
cfe5fbc0
AD
135442000-03-31 Akim Demaille <akim@epita.fr>
13545
13546 * src/files.c (tryopen, tryclose): Move to the top.
13547 Be static.
13548
cb7db13e
AD
135492000-03-31 Akim Demaille <akim@epita.fr>
13550
13551 * src/main.c (main): Don't call `done', exit does it.
13552
a0f6b076
AD
135532000-03-31 Akim Demaille <akim@epita.fr>
13554
36281465
AD
13555 * allocate.c: s/return (foo)/return foo/.
13556 * lalr.c: Likewise.
13557 * LR0.c: Likewise.
13558 * output.c: Likewise.
13559 * reader.c: Likewise.
13560 * symtab.c: Likewise.
13561 * vmsgetargs.c: Likewise.
13562
135632000-03-31 Akim Demaille <akim@epita.fr>
13564
13565 Clean up the error reporting functions.
a0f6b076
AD
13566
13567 * src/report.c: New file.
13568 * src/report.h: Likewise.
13569 * src/Makefile.am: Adjust.
13570 * m4/error.m4: New file.
13571 * m4/Makefile.am: Adjust.
13572 * configure.in (jm_PREREQ_ERROR): Call it.
13573 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
13574 Remove.
13575 (fatal, fatals): Remove. All callers use complain.c::fatal.
13576 (warn, warni, warns, warnss, warnss): Remove. All callers use
13577 complain.c::complain.
13578 (toomany): Remove, use fatal instead.
13579 * src/files.c (done): No argument, use complain_message_count.
13580 * src/main.c (main): Register `done' to `atexit'.
13581
13582 * src/getargs.c (usage): More `fputs', less `fprintf'.
13583
18539825
AD
135842000-03-28 Akim Demaille <akim@epita.fr>
13585
13586 * lib/: New directory.
13587 * Makefile.am (SUBDIRS): Adjust.
13588 * configure.in: Adjust.
13589 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
13590 useless.
13591 * src/alloca.c: Moved to lib/.
13592 * src/getopt.c: Likewise.
13593 * src/getopt1.c: Likewise.
13594 * src/getopt.h: Likewise.
13595 * src/ansi2knr.c: Likewise.
13596 * src/ansi2knr.1: Likewise.
13597 * src/Makefile.am: Adjust.
13598 * lib/Makefile.am: New file.
13599
9f306f2a
AD
136002000-03-28 Akim Demaille <akim@epita.fr>
13601
13602 * src/getargs.c (usage): Refresh the help message.
13603
0ba347b6
AD
136042000-03-17 Akim Demaille <akim@epita.fr>
13605
13606 * src/getopt1.c: Updated from textutils 2.0e
13607 * src/getopt.c: Likewise.
13608 * src/getopt.h: Likewise.
13609
dbe7f271
AD
136102000-03-17 Akim Demaille <akim@epita.fr>
13611
13612 * src/Makefile.am (bison.simple): Fix the awk program: quote only
13613 the file name, not the whole `#line LINE FILE'.
13614
75bbe78d
AD
136152000-03-17 Akim Demaille <akim@epita.fr>
13616
13617 On syntax errors, report the token on which we choked.
13618
aa5fd0ee
AD
13619 * src/bison.s1 (yyparse): In the label yyerrlab, when
13620 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 13621
7b306f52
AD
136222000-03-17 Akim Demaille <akim@epita.fr>
13623
aa5fd0ee 13624 * src/reader.c (copy_at): New function.
7b306f52
AD
13625 (copy_guard): Use it.
13626 (copy_action): Use it.
13627
e87b5700
AD
136282000-03-17 Akim Demaille <akim@epita.fr>
13629
13630 Be kind to translators, save some useless translations.
13631
aa5fd0ee 13632 * src/main.c (banner): New function.
e87b5700
AD
13633 (fatal_banner): Use it.
13634 (warn_banner): Use it.
13635
ae3c3164
AD
136362000-03-17 Akim Demaille <akim@epita.fr>
13637
aa5fd0ee
AD
13638 * src/reader.c (copy_definition): Use copy_string and
13639 copy_comment. Removed now unused `match', `ended',
13640 `cplus_comment'.
ae3c3164
AD
13641 (copy_comment, copy_string): Moved, to be visible from
13642 copy_definition.
13643
4dc58e7c
AD
136442000-03-17 Akim Demaille <akim@epita.fr>
13645
aa5fd0ee
AD
13646 * src/reader.c (copy_string): Declare `static inline'. No
13647 problems with inline, since it is checked by configure.
4dc58e7c
AD
13648 (copy_comment): Likewise.
13649
0a6384c4
AD
136502000-03-17 Akim Demaille <akim@epita.fr>
13651
aa5fd0ee 13652 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 13653
3cef001a
AD
136542000-03-17 Akim Demaille <akim@epita.fr>
13655
aa5fd0ee 13656 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
13657 (copy_action): Use it. Removed now unused `match', `ended',
13658 `cplus_comment'.
13659 (copy_guard): Likewise.
13660
ca36d2ef
AD
136612000-03-17 Akim Demaille <akim@epita.fr>
13662
aa5fd0ee 13663 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
13664 (copy_action): Use it.
13665 (copy_guard): Likewise.
13666
6666f98f
AD
136672000-03-17 Akim Demaille <akim@epita.fr>
13668
13669 Change the handling of @s so that they behave exactly like $s.
13670 There is now a pseudo variable @$ (readble and writable), location
13671 of the lhs of the rule (by default ranging from the location of
13672 the first symbol of the rhs, to the location of the last symbol,
13673 or, if the rhs is empty, YYLLOC).
13674
13675 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
13676 yyval.
13677 (yyparse): When providing a default semantic action, provide a
13678 default location action.
13679 (after the $): No longer change `*YYLSP', just stack YYLOC the
13680 same way you stack YYVAL.
13681 * src/reader.c (read_declarations): Use warns.
13682 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
13683 (copy_action, case '@'): Likewise.
13684 Use a standard error message, to save useless work from
13685 translators.
13686
41aca2e0
AD
136872000-03-17 Akim Demaille <akim@epita.fr>
13688
aa5fd0ee
AD
13689 * src/bison.s1: Formatting and cosmetics changes.
13690 * src/reader.c: Likewise.
41aca2e0
AD
13691 Update the Copyright notice.
13692
dc08c1d5
AD
136932000-03-17 Akim Demaille <akim@epita.fr>
13694
aa5fd0ee
AD
13695 * src/bison.s1 (#line): All set to `#line' only, since the
13696 Makefile now handles them.
dc08c1d5 13697
9ee3c97b
AD
136982000-03-16 Akim Demaille <akim@epita.fr>
13699
13700 * src/output.c (output_rule_data): Output the documentation of
13701 some of the tables.
13702 (Copyright notice): Update.
13703 Formatting changes.
13704
0de741ca
AD
137052000-03-16 Akim Demaille <akim@epita.fr>
13706
13707 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
13708 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
13709 One `#if YYDEBUG' remains, since it uses variables which are
13710 defined only if `YYDEBUG != 0'.
13711
bb10be54
AD
137122000-03-16 Akim Demaille <akim@epita.fr>
13713
13714 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
13715 and related variables so that the similarities are highlighted.
13716
b07b484a
AD
137172000-03-16 Akim Demaille <akim@epita.fr>
13718
13719 * src/bison.s1: Properly indent CPP directives.
13720
361f60b3
AD
137212000-03-16 Akim Demaille <akim@epita.fr>
13722
13723 * src/bison.s1: Properly indent the `alloca' CPP section.
13724
8c44d3ec
AD
137252000-03-16 Akim Demaille <akim@epita.fr>
13726
13727 Do not hard code values of directories in `configure.in'.
13728 Update the `configure' tool chain.
13729
13730 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
13731 src/makefile.am.
13732 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
13733 (AC_OUTPUT): Add m4/Makefile.
13734 Bump to bison 1.28a, 1.29 has never been released.
13735 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
13736 handled via src/Makefile.am.
13737 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
13738 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
13739 autoheader.
13740 * Makefile.am (SUBDIRS): Add m4.
13741 (ACLOCAL_AM_FLAGS): New variable.
13742 (AUTOMAKE_OPTIONS): Add check-news.
13743 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
13744 the proper line number and file name.
13745 (DEFS): Propagate the location of bison library files and of the
13746 locale files.
13747 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
13748 builddir.
13749 * acinclude.m4: Remove, replaced by the directory m4.
13750 * m4/Makefile.am (EXTRA_DIST): New variable.
13751 * m4/gettext.m4: New file, from the fileutils.
13752 * m4/lcmessage.m4: Likewise
13753 * m4/progtest.m4: Likewise.
13754 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
13755
f95997e7
AD
137562000-03-10 Akim Demaille <akim@epita.fr>
13757
13758 * src/closure.c:
13759 Formatting changes of various comments.
13760 Respect the GNU coding standards at various places.
13761 Don't use `_()' when no translation is needed.
13762
137631999-12-13 Jesse Thilo <jthilo@gnu.org>
13764
13765 * src/files.c:
13766 OS/2 honors TMPDIR environment variable.
13767
137681999-12-13 Jesse Thilo <jthilo@gnu.org>
13769
13770 * doc/bison.texinfo: Tweaked spelling and grammar.
13771 Updated ISBN.
13772 Removed reference to price of printed copy.
13773 Mention BISON_SIMPLE and BISON_HAIRY.
13774
137751999-12-13 Jesse Thilo <jthilo@gnu.org>
13776
13777 * configure.in, NEWS:
13778 Bison 1.29 released.
13779
137801999-10-27 Jesse Thilo <jthilo@gnu.org>
13781
13782 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
13783 Added reference card.
13784
137851999-07-26 Jesse Thilo <jthilo@gnu.org>
13786
13787 * po/ru.po: Added Russian translation.
13788
137891999-07-26 Jesse Thilo <jthilo@gnu.org>
13790
13791 * configure.in: Added Russian translation.
13792
137931999-07-06 Jesse Thilo <jthilo@gnu.org>
13794
13795 * configure.in, NEWS, README:
13796 Released version 1.28.
13797
137981999-06-14 Jesse Thilo <jthilo@gnu.org>
13799
13800 * src/system.h:
13801 Squashed redefinition warning on some systems.
13802
13803 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
13804 Have configure build version string instead of relying on ANSI string
13805 concatentation.
13806
138071999-06-14 Jesse Thilo <jthilo@gnu.org>
13808
13809 * po/POTFILES.in: Got rid of version.c.
13810
138111999-06-14 Jesse Thilo <jthilo@gnu.org>
13812
13813 * acconfig.h, configure.in:
13814 Have configure build version string instead of relying on ANSI string
13815 concatentation.
13816
138171999-06-08 Jesse Thilo <jthilo@gnu.org>
13818
13819 * doc/bison.1:
13820 Dropped mention of `+' for long-named options.
13821
138221999-05-30 Jesse Thilo <jthilo@gnu.org>
13823
13824 * src/files.c: Added <unistd.h> for unlink().
13825
13826 * src/Makefile.am, src/system.h:
13827 I18n fixes.
13828
138291999-05-30 Jesse Thilo <jthilo@gnu.org>
13830
13831 * README: Added a FAQ list.
13832
13833 * configure.in, acconfig.h:
13834 I18n fixes.
13835
138361999-05-30 Jesse Thilo <jthilo@gnu.org>
13837
13838 * doc/FAQ, doc/Makefile.am:
13839 Added a FAQ list.
13840
138411999-05-19 Jesse Thilo <jthilo@gnu.org>
13842
13843 * src/alloc.h, src/symtab.h, src/version.c:
13844 Protected inclusion of "config.h" with HAVE_CONFIG_H.
13845
138461999-04-18 Jesse Thilo <jthilo@gnu.org>
13847
13848 * src/.cvsignore, src/Makefile.am:
13849 Reorganized: sources in `src', documentation in `doc'.
13850
13851 * src/lex.c (literalchar):
13852 fixed the code for escaping double quotes (thanks
13853 Jonathan Czisny.)
13854
138551999-04-18 Jesse Thilo <jthilo@gnu.org>
13856
13857 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
13858 Adjusted paths to reflect directory reorganization.
13859
138601999-04-18 Jesse Thilo <jthilo@gnu.org>
13861
13862 * doc/.cvsignore, doc/Makefile.am:
13863 Reorganized: sources in `src', documentation in `doc'.
13864
138651999-04-18 Jesse Thilo <jthilo@gnu.org>
13866
13867 * configure.in:
13868 Updated AC_INIT file to reflect directory reorganization.
13869
13870 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
13871 Reorganized: sources in `src', documentation in `doc'.
13872
138731999-04-13 Jesse Thilo <jthilo@gnu.org>
13874
13875 * src/allocate.c:
13876 Don't declare calloc() and realloc() if not necessary.
13877
138781999-04-13 Jesse Thilo <jthilo@gnu.org>
13879
13880 * configure.in, acconfig.h, acinclude.m4:
13881 Don't declare calloc() and realloc() if not necessary.
13882
138831999-03-23 Jesse Thilo <jthilo@gnu.org>
13884
13885 * po/.cvsignore: Added i18n support.
13886
138871999-03-23 Jesse Thilo <jthilo@gnu.org>
13888
13889 * acconfig.h, configure.in, Makefile.am:
13890 Added i18n support.
13891
138921999-03-22 Jesse Thilo <jthilo@gnu.org>
13893
13894 * src/bison.s1: Fixed #line numbers.
13895
138961999-03-15 Jesse Thilo <jthilo@gnu.org>
13897
13898 * po/es.po, po/fr.po, po/nl.po, po/de.po:
13899 Added PO files from Translation Project.
13900
139011999-03-03 Jesse Thilo <jthilo@gnu.org>
13902
13903 * Makefile.am:
13904 Added support for non-ANSI compilers (ansi2knr).
13905
139061999-02-16 Jesse Thilo <jthilo@gnu.org>
13907
13908 * configure.in: Bumped version number to 1.27.
13909
13910 * Makefile.am:
13911 Added `bison.simple' to list of files removed by `make distclean'.
13912
139131999-02-12 Jesse Thilo <jthilo@gnu.org>
13914
13915 * src/files.c, src/files.h:
13916 Defined locations of parser files in config.h instead of Makefile.
13917
139181999-02-12 Jesse Thilo <jthilo@gnu.org>
13919
13920 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
13921 Defined locations of parser files in config.h instead of Makefile.
13922
139231999-02-09 Jesse Thilo <jthilo@gnu.org>
13924
13925 * Makefile.am:
13926 Removed inappropriate use of $< macro.
13927
139281999-02-05 Jesse Thilo <jthilo@gnu.org>
13929
13930 * po/Makefile.in.in, po/POTFILES.in:
13931 Add `po' directory skeleton.
13932
139331999-01-27 Jesse Thilo <jthilo@gnu.org>
13934
13935 * README: Document help-bison list.
13936
13937 * configure.in: Add check for mkstemp().
13938
139391999-01-20 Jesse Thilo <jthilo@gnu.org>
13940
13941 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
13942 Hush a few compiler warnings.
13943
13944 * src/files.c:
13945 Add tryclose(), which verifies that fclose was successful.
13946 Hush a couple of compiler warnings.
13947
139481999-01-20 Jesse Thilo <jthilo@gnu.org>
13949
13950 * Makefile.am, OChangeLog:
13951 ChangeLog is now automatically generated. Include the old version as
13952 OChangeLog.
13953
139541999-01-14 Jesse Thilo <jthilo@gnu.org>
13955
13956 * src/gram.h, src/lalr.c, src/lex.c, src/lex.h, src/machine.h, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/state.h, src/symtab.c, src/symtab.h, src/types.h, src/vmsgetargs.c, src/warshall.c, src/allocate.c, src/alloc.h, src/bison.s1, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/files.h, src/getargs.c, src/gram.c, src/LR0.c:
13957 Update FSF address.
13958
139591999-01-14 Jesse Thilo <jthilo@gnu.org>
13960
13961 * doc/bison.texinfo: Fix formatting glitch.
13962
13963 * doc/bison.texinfo: Update FSF address.
13964
139651999-01-14 Jesse Thilo <jthilo@gnu.org>
13966
13967 * acconfig.h: Update FSF address.
13968
139691999-01-08 Jesse Thilo <jthilo@gnu.org>
13970
13971 * src/system.h:
13972 Don't define PACKAGE here, since config.h defines it.
13973
139741998-12-30 Jesse Thilo <jthilo@gnu.org>
13975
13976 * src/reader.c: Update copyright date.
13977
13978 * src/main.c:
13979 Ditch sprintf to statically-sized buffers in fatal/warn functions in
13980 favor of output directly to stderr (avoids buffer overruns).
13981
13982 * src/reader.c: Some checks for premature EOF.
13983
13984 * src/allocate.c, src/alloc.h, src/closure.c, src/conflicts.c, src/derives.c, src/getargs.c, src/gram.c, src/lalr.c, src/lex.c, src/LR0.c, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reduce.c, src/symtab.c, src/symtab.h, src/warshall.c:
13985 Use prototypes if the compiler understands them.
13986
13987 * src/files.c: Honor TMPDIR on Unix hosts.
13988 Use prototypes if the compiler understands them.
13989
13990 * src/reader.c:
13991 Fix a couple of buffer overrun bugs.
13992 Use prototypes if the compiler understands them.
13993
13994 * src/system.h: Include unistd.h and ctype.h.
13995 Use #ifdef instead of #if for NLS symbols.
13996
139971998-12-30 Jesse Thilo <jthilo@gnu.org>
13998
13999 * doc/bison.texinfo:
14000 Delete comment "consider using @set for edition number, etc..." since
14001 we now are doing so.
14002
140031998-12-30 Jesse Thilo <jthilo@gnu.org>
14004
14005 * configure.in:
14006 Use prototypes if the compiler understands them.
14007
14008 * NEWS: Document 1.26 highlights.
14009
14010 * Makefile.am: Require Automake 1.3 or later.
14011
14012 * acconfig.h:
14013 Use prototypes if the compiler understands them.
14014
140151998-12-29 Jesse Thilo <jthilo@gnu.org>
14016
14017 * src/version.c:
14018 Use VERSION symbol from automake for version number.
14019
140201998-12-29 Jesse Thilo <jthilo@gnu.org>
14021
14022 * acconfig.h, configure.in, version.cin:
14023 Use VERSION symbol from automake for version number.
14024
140251998-11-28 Jesse Thilo <jthilo@gnu.org>
14026
14027 * Makefile.am:
14028 Distribute original version of simple parser (bison.s1), not built
14029 version (bison.simple).
14030
140311998-11-28 Jesse Thilo <jthilo@gnu.org>
14032
14033 * doc/bison.texinfo: Add info dir entry.
14034
14035 * doc/bison.texinfo:
14036 Let automake put version number into documentation.
14037
140381998-11-26 Jesse Thilo <jthilo@gnu.org>
14039
14040 * src/bison.cld, src/build.com, src/vmshlp.mar:
14041 Add non-RCS files from /gd/gnu/bison.
14042
140431998-11-26 Jesse Thilo <jthilo@gnu.org>
14044
14045 * doc/bison.1:
14046 Document the BISON_HAIRY and BISON_SIMPLE variables.
14047
140481998-11-25 Jesse Thilo <jthilo@gnu.org>
14049
14050 * src/version.c: Build version.c automatically.
14051
14052 * src/reader.c:
14053 Fix token numbering (used to start at 258, not 257).
14054
14055 * src/system.h: Include config.h.
14056
14057 * src/getargs.c: Update bug report address.
14058
14059 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
14060 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
14061
140621998-11-25 Jesse Thilo <jthilo@gnu.org>
14063
14064 * Makefile.am:
14065 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
14066
14067 * configure.in, version.cin:
14068 Build version.c automatically.
14069
14070 * AUTHORS: Add AUTHORS file.
14071
14072 * README: Update bug report address.
14073
14074 * bison.simple:
14075 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
14076
14077 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
14078 Add automake stuff.
14079
140801998-11-25 Jesse Thilo <jthilo@gnu.org>
14081
14082 * doc/bison.texinfo: Clean up some formatting.
14083
140841998-05-05 Richard Stallman <rms@gnu.org>
14085
14086 * doc/bison.texinfo:
14087 Explain better why to make a pure parser.
14088
140891998-01-05 Richard Stallman <rms@gnu.org>
14090
14091 * src/files.c (openfiles):
14092 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
14093 find a temporary directory, if possible. Do not unlink files while
14094 they are open.
14095
140961997-08-25 Richard Stallman <rms@gnu.org>
14097
14098 * src/reader.c (stack_offset;):
14099 Change some warni to warns.
14100
14101 * src/lex.c (literalchar): Use warns, not warni.
14102
141031997-06-28 Richard Stallman <rms@gnu.org>
14104
14105 * src/bison.s1: Add a Bison version comment.
14106
14107 * src/main.c (fatal, warn, berror):
14108 Use program_name.
14109
141101997-06-28 Richard Stallman <rms@gnu.org>
14111
14112 * Makefile.in (bison_version): New variable.
14113 (dist): Use that variable.
14114 (bison.s1): Substitute the Bison version into bison.simple.
14115
14116 * bison.simple: Add a Bison version comment.
14117
141181997-06-18 Richard Stallman <rms@gnu.org>
14119
14120 * src/main.c (fatal, warn, berror):
14121 Make error messages standard.
14122 (toomany): Improve error message text.
14123
14124 * src/LR0.c, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/lalr.c, src/lex.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/symtab.c:
14125 new.h renamed to alloc.h.
14126
141271997-06-18 Richard Stallman <rms@gnu.org>
14128
14129 * Makefile.in: new.h renamed to alloc.h.
14130
141311997-05-24 Richard Stallman <rms@gnu.org>
14132
14133 * src/lex.c (literalchar):
14134 Fix the code for escaping \, " and '.
14135
14136 (lex): Avoid trouble when there are many chars
14137 to discard in a char literal with just several chars in it.
14138
141391997-05-17 Richard Stallman <rms@gnu.org>
14140
14141 * src/bison.s1:
14142 Use malloc, if using alloca is troublesome.
14143 (YYSTACK_USE_ALLOCA): New flag macro.
14144 Define it for some systems and compilers.
14145 (YYSTACK_ALLOC): New macro.
14146 (yyparse): Use YYSTACK_ALLOC to allocate stack.
14147 If it was malloc'd, free it.
14148
141491997-05-17 Richard Stallman <rms@gnu.org>
14150
14151 * bison.simple:
14152 Use malloc, if using alloca is troublesome.
14153 (YYSTACK_USE_ALLOCA): New flag macro.
14154 Define it for some systems and compilers.
14155 (YYSTACK_ALLOC): New macro.
14156 (yyparse): Use YYSTACK_ALLOC to allocate stack.
14157 If it was malloc'd, free it.
14158
141591997-04-23 Richard Stallman <rms@gnu.org>
14160
14161 * src/bison.s1:
14162 (alloca) [__hpux]: Always define as __builtin_alloca.
14163
141641997-04-23 Richard Stallman <rms@gnu.org>
14165
14166 * bison.simple:
14167 (alloca) [__hpux]: Always define as __builtin_alloca.
14168
141691997-04-22 Richard Stallman <rms@gnu.org>
14170
14171 * src/bison.s1:
14172 [__hpux]: Include alloca.h (right for HPUX 10)
14173 instead of declaring alloca (right for HPUX 9).
14174
14175 * src/bison.s1 (__yy_memcpy):
14176 Declare arg `count' as unsigned int.
14177 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
14178
141791997-04-22 Richard Stallman <rms@gnu.org>
14180
14181 * bison.simple:
14182 [__hpux]: Include alloca.h (right for HPUX 10)
14183 instead of declaring alloca (right for HPUX 9).
14184
14185 * bison.simple (__yy_memcpy):
14186 Declare arg `count' as unsigned int.
14187 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
14188
141891997-01-03 Richard Stallman <rms@gnu.org>
14190
14191 * src/allocate.c: [__STDC__ or _MSC_VER]:
14192 Declare calloc and realloc to return void *.
14193
141941997-01-02 Richard Stallman <rms@gnu.org>
14195
14196 * src/system.h:
14197 [_MSC_VER]: Include stdlib.h and process.h.
14198 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
14199
14200 * src/main.c (main): Return FAILURE as a value.
14201 (printable_version): Declare arg as int, not char.
14202
142031997-01-02 Richard Stallman <rms@gnu.org>
14204
14205 * Makefile.in (dist):
14206 Explicitly check for symlinks, and copy them.
14207
142081996-12-19 Richard Stallman <rms@gnu.org>
14209
14210 * src/files.c:
14211 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
14212
142131996-12-18 Paul Eggert <eggert@gnu.org>
14214
14215 * src/bison.s1 (yyparse):
14216 If __GNUC__ and YYPARSE_PARAM are both defined,
14217 declare yyparse to have a void * argument.
14218
142191996-12-18 Paul Eggert <eggert@gnu.org>
14220
14221 * bison.simple (yyparse):
14222 If __GNUC__ and YYPARSE_PARAM are both defined,
14223 declare yyparse to have a void * argument.
14224
142251996-12-17 Richard Stallman <rms@gnu.org>
14226
14227 * src/reduce.c (nbits): Add some casts.
14228
142291996-08-12 Richard Stallman <rms@gnu.org>
14230
14231 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
14232
142331996-08-12 Richard Stallman <rms@gnu.org>
14234
14235 * bison.simple: Test _MSDOS as well as _MSDOS_.
14236
142371996-07-31 Richard Stallman <rms@gnu.org>
14238
14239 * src/bison.s1:
14240 [__sun && __i386]: Include alloca.h.
14241
142421996-07-31 Richard Stallman <rms@gnu.org>
14243
14244 * bison.simple:
14245 [__sun && __i386]: Include alloca.h.
14246
142471996-07-30 Richard Stallman <rms@gnu.org>
14248
14249 * src/bison.s1: Comment change.
14250
14251 * src/bison.s1: Test _MSDOS_, not MSDOS.
14252
142531996-07-30 Richard Stallman <rms@gnu.org>
14254
14255 * bison.simple: Comment change.
14256
14257 * bison.simple: Test _MSDOS_, not MSDOS.
14258
142591996-06-01 Richard Stallman <rms@gnu.org>
14260
14261 * src/reduce.c, src/reader.c, src/print.c, src/output.c, src/nullable.c, src/lex.c, src/lalr.c, src/getargs.c, src/derives.c, src/conflicts.c, src/closure.c, src/allocate.c:
14262 Insert `_' macro around many string constants.
14263
14264 * src/main.c:
14265 Insert `_' macro around many string constants.
14266
14267 (main): Call setlocale, bindtextdomain and textdomain.
14268
14269 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
14270 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
14271 [ENABLE_NLS]: Include libintl.h.
14272 [ENABLE_NLS] (gettext): Define.
14273 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
14274 (N_, PACKAGE, LOCALEDIR): New macros.
14275
142761996-06-01 Richard Stallman <rms@gnu.org>
14277
14278 * POTFILES.in: New file.
14279
14280 * Makefile.in (allocate.o):
14281 Define target explicitly.
14282
14283 * Makefile.in (CFLAGS): Set to @CFLAGS@.
14284 (LDFLAGS): Set to @LDFLAGS@.
14285 (configure): Run autoconf only if preceding `cd' succeeds.
14286 (bison.s1): Redirect output to temporary file then move the
14287 temporary to the target, rather than redirecting directly to bison.s1.
14288 (clean): Remove config.status and config.log.
14289 (distclean): Don't remove config.status here.
14290
142911996-05-12 Richard Stallman <rms@gnu.org>
14292
14293 * src/bison.s1:
14294 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
14295
142961996-05-12 Richard Stallman <rms@gnu.org>
14297
14298 * bison.simple:
14299 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
14300
143011996-05-11 Richard Stallman <rms@gnu.org>
14302
14303 * src/bison.s1 (__yy_memcpy):
14304 Really reorder the args, as was supposedly done on Feb 14 1995.
14305 (yyparse): Calls changed accordingly.
14306
143071996-05-11 Richard Stallman <rms@gnu.org>
14308
14309 * Makefile.in (dist): Don't use $(srcdir).
14310
14311 * bison.simple (__yy_memcpy):
14312 Really reorder the args, as was supposedly done on Feb 14 1995.
14313 (yyparse): Calls changed accordingly.
14314
143151996-01-27 Richard Stallman <rms@gnu.org>
14316
14317 * src/output.c (output_rule_data):
14318 Test YYERROR_VERBOSE in the conditional
14319 around the definition of ttyname.
14320
143211995-12-29 Richard Stallman <rms@gnu.org>
14322
14323 * src/bison.s1:
14324 Fix line numbers in #line commands.
14325
143261995-12-29 Richard Stallman <rms@gnu.org>
14327
14328 * bison.simple:
14329 Fix line numbers in #line commands.
14330
143311995-12-27 Richard Stallman <rms@gnu.org>
14332
14333 * src/bison.s1 (YYPARSE_PARAM_DECL):
14334 In C++, make it always null.
14335 (YYPARSE_PARAM_ARG): New macro.
14336 (yyparse): Use YYPARSE_PARAM_ARG.
14337
143381995-12-27 Richard Stallman <rms@gnu.org>
14339
14340 * bison.simple (YYPARSE_PARAM_DECL):
14341 In C++, make it always null.
14342 (YYPARSE_PARAM_ARG): New macro.
14343 (yyparse): Use YYPARSE_PARAM_ARG.
14344
143451995-11-29 Richard Stallman <rms@gnu.org>
14346
14347 * doc/bison.texinfo:
14348 Describe literal string tokens, %raw, %no_lines, %token_table.
14349
143501995-11-29 Daniel Hagerty <hag@gnu.org>
14351
14352 * doc/bison.texinfo: Fixed update date
14353
143541995-10-16 Richard Stallman <rms@gnu.org>
14355
14356 * src/version.c: Version 1.25.
14357
143581995-10-16 Richard Stallman <rms@gnu.org>
14359
14360 * NEWS: *** empty log message ***
14361
143621995-10-16 Richard Stallman <rms@gnu.org>
14363
14364 * doc/bison.1, doc/bison.rnh:
14365 Add new options.
14366
143671995-10-15 Richard Stallman <rms@gnu.org>
14368
14369 * src/vmsgetargs.c, src/getargs.c:
14370 Added -n, -k, and -raw switches.
14371 (noparserflag, toknumflag, rawtoknumflag): New variables.
14372
14373 * src/symtab.h (SALIAS):
14374 New #define for adding aliases to %token.
14375 (struct bucket): Added `alias' field.
14376
14377 * src/reduce.c (reduce_grammar):
14378 Revise error message.
14379 (print_notices): Remove final `.' from error message.
14380
14381 * src/reader.c (reader_output_yylsp):
14382 New function.
14383 (readgram): Use `#if 0' around code that accepted %command
14384 inside grammar rules: The documentation doesn't allow it,
14385 and it will fail since the %command processors scan for the next %.
14386 (parse_token_decl): Extended the %token
14387 declaration to allow a multi-character symbol as an alias.
14388 (parse_thong_decl): New function.
14389 (read_declarations): Added %thong declarations.
14390 (read_declarations): Handle NOOP to deal with allowing
14391 % declarations as another means to specify the flags.
14392 (readgram): Allow %prec prior to semantics embedded in a rule.
14393 (skip_to_char, read_declarations, copy_definition)
14394 (parse_token_decl, parse_start_decl, parse_type_decl)
14395 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
14396 (get_type_name, copy_guard, copy_action, readgram)
14397 (get_type, packsymbols): Revised most error messages.
14398 Changed `fatal' to `warnxxx' to avoid aborting for error.
14399 Revised and use multiple warnxxx functions to avoid using VARARGS1.
14400 (read_declarations): Improve the error message for
14401 an invalid character. Do not abort.
14402 (read_declarations, copy_guard, copy_action): Use
14403 printable_version to avoid unprintable characters in printed output.
14404 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
14405 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
14406 Allow the type of a non-terminal can be given
14407 more than once, as long as all specifications give the same type.
14408
14409 * src/output.c:
14410 (output_headers, output_trailers, output, output_gram)
14411 (output_rule_data): Implement noparserflag variable.
14412 Implement toknumflag variable.
14413 (output): Call reader_output_yylsp to output LTYPESTR.
14414
14415 * src/main.c (main):
14416 If reader sees an error, don't process the grammar.
14417 (fatals): Updated to not use VARARGS1.
14418 (printable_version, int_to_string, warn, warni, warns, warnss)
14419 (warnsss): New error reporting functions. Avoid abort for error.
14420
14421 * src/lex.h:
14422 Added THONG and NOOP for alias processing.
14423 Added SETOPT for the new code that allows setting options with %flags.
14424
14425 * src/lex.c:
14426 Include getopt.h. Add some extern decls.
14427 (safegetc): New function to deal with EOF gracefully.
14428 (literalchar); new function to deal with reading \ escapes.
14429 (lex): Use literalchar.
14430 (lex): Implemented "..." tokens.
14431 (literalchar, lex, parse_percent_token): Made tokenbuffer
14432 always contain the token. This includes growing the token
14433 buffer while reading an integer.
14434 (parse_percent_token): Replaced if-else statement with percent_table.
14435 (parse_percent_token): Added % declarations as another
14436 way to specify the flags -n, -l, and -r. Also added hooks for
14437 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
14438 major changes to files.c.
14439 (lex) Retain in the incoming stream a character following
14440 an incorrect '/'.
14441 (skip_white_space, lex): Revised most error messages
14442 and changed fatal to warn to avoid aborting.
14443 (percent_table): Added %thong declarations.
14444
14445 * src/gram.h: Comment changes.
14446
14447 * src/files.c (openfiles, open_extra_files, done):
14448 Add faction flag
14449 and actfile file. Handle noparserflag. Both for -n switch.
14450
14451 * src/conflicts.c (resolve_sr_conflict):
14452 Remove use of alloca.
14453
144541995-06-01 Jim Meyering <meyering@gnu.org>
14455
14456 * doc/bison.texinfo: *** empty log message ***
14457
144581995-05-06 Richard Stallman <rms@gnu.org>
14459
14460 * src/bison.s1: Comment change.
14461
144621995-05-06 Richard Stallman <rms@gnu.org>
14463
14464 * bison.simple: Comment change.
14465
144661995-05-03 Richard Stallman <rms@gnu.org>
14467
14468 * src/version.c: Version now 1.24.
14469
14470 * src/bison.s1: Change distribution terms.
14471
14472 * src/version.c: Version now 1.23.
14473
144741995-05-03 Richard Stallman <rms@gnu.org>
14475
14476 * doc/bison.texinfo:
14477 Rewrite "Conditions for Using Bison".
14478 Update version to 1.24.
14479
144801995-05-03 Richard Stallman <rms@gnu.org>
14481
14482 * bison.simple: Change distribution terms.
14483
144841995-02-23 Richard Stallman <rms@gnu.org>
14485
14486 * src/files.c: Test __VMS_POSIX as well as VMS.
14487
144881995-02-14 Jim Meyering <meyering@gnu.org>
14489
14490 * src/bison.s1 (__yy_memcpy):
14491 Renamed from __yy_bcopy to avoid
14492 confusion. Reverse FROM and TO arguments to be consistent with
14493 those of memcpy.
14494
144951995-02-14 Jim Meyering <meyering@gnu.org>
14496
14497 * bison.simple (__yy_memcpy):
14498 Renamed from __yy_bcopy to avoid
14499 confusion. Reverse FROM and TO arguments to be consistent with
14500 those of memcpy.
14501
145021994-11-10 David J. MacKenzie <djm@gnu.org>
14503
14504 * NEWS: reformat
14505
14506 * NEWS: New file.
14507
14508 * Makefile.in (DISTFILES): Include NEWS.
14509
14510 * Makefile.in (DISTFILES):
14511 Include install-sh, not install.sh.
14512
14513 * configure.in: Update to Autoconf v2 macro names.
14514
145151994-10-05 David J. MacKenzie <djm@gnu.org>
14516
14517 * Makefile.in: fix typo
14518
14519 * Makefile.in (prefix, exec_prefix):
14520 Let configure set them.
14521
145221994-09-28 David J. MacKenzie <djm@gnu.org>
14523
14524 * Makefile.in: Set datadir to $(prefix)/share.
14525
145261994-09-15 Richard Stallman <rms@gnu.org>
14527
14528 * src/bison.s1:
14529 Update copyright notice and GPL version.
14530
145311994-09-15 Richard Stallman <rms@gnu.org>
14532
14533 * bison.simple:
14534 Update copyright notice and GPL version.
14535
145361994-07-12 Richard Stallman <rms@gnu.org>
14537
14538 * src/reduce.c, src/reader.c:
14539 entered into RCS
14540
145411994-05-05 David J. MacKenzie <djm@gnu.org>
14542
14543 * Makefile.in: entered into RCS
14544
145451994-03-26 Richard Stallman <rms@gnu.org>
14546
14547 * src/bison.s1: entered into RCS
14548
145491994-03-26 Richard Stallman <rms@gnu.org>
14550
14551 * bison.simple: entered into RCS
14552
145531994-03-25 Richard Stallman <rms@gnu.org>
14554
14555 * src/main.c: entered into RCS
14556
145571994-03-24 Richard Stallman <rms@gnu.org>
14558
14559 * src/conflicts.c: entered into RCS
14560
145611994-01-02 Richard Stallman <rms@gnu.org>
14562
14563 * Makefile.in: *** empty log message ***
14564
145651993-11-21 Richard Stallman <rms@gnu.org>
14566
14567 * src/bison.s1: *** empty log message ***
14568
145691993-11-21 Richard Stallman <rms@gnu.org>
14570
14571 * doc/bison.texinfo: entered into RCS
14572
14573 * doc/bison.texinfo: *** empty log message ***
14574
145751993-11-21 Richard Stallman <rms@gnu.org>
14576
14577 * bison.simple: *** empty log message ***
14578
145791993-10-25 David J. MacKenzie <djm@gnu.org>
14580
14581 * doc/bison.texinfo: *** empty log message ***
14582
145831993-10-19 Richard Stallman <rms@gnu.org>
14584
14585 * src/bison.s1: *** empty log message ***
14586
145871993-10-19 Richard Stallman <rms@gnu.org>
14588
14589 * bison.simple: *** empty log message ***
14590
145911993-10-14 Richard Stallman <rms@gnu.org>
14592
14593 * src/bison.s1: *** empty log message ***
14594
145951993-10-14 Richard Stallman <rms@gnu.org>
14596
14597 * bison.simple: *** empty log message ***
14598
145991993-09-14 David J. MacKenzie <djm@gnu.org>
14600
14601 * doc/bison.texinfo: *** empty log message ***
14602
146031993-09-13 Noah Friedman <friedman@gnu.org>
14604
14605 * Makefile.in: *** empty log message ***
14606
146071993-09-10 Richard Stallman <rms@gnu.org>
14608
14609 * src/conflicts.c: *** empty log message ***
14610
14611 * src/system.h: entered into RCS
14612
146131993-09-10 Richard Stallman <rms@gnu.org>
14614
14615 * doc/bison.1: entered into RCS
14616
146171993-09-06 Noah Friedman <friedman@gnu.org>
14618
14619 * src/version.c: entered into RCS
14620
146211993-09-06 Noah Friedman <friedman@gnu.org>
14622
14623 * Makefile.in: *** empty log message ***
14624
146251993-07-30 David J. MacKenzie <djm@gnu.org>
14626
14627 * Makefile.in: *** empty log message ***
14628
146291993-07-24 Richard Stallman <rms@gnu.org>
14630
14631 * src/bison.s1: *** empty log message ***
14632
146331993-07-24 Richard Stallman <rms@gnu.org>
14634
14635 * bison.simple: *** empty log message ***
14636
146371993-07-08 David J. MacKenzie <djm@gnu.org>
14638
14639 * Makefile.in: *** empty log message ***
14640
146411993-07-04 Richard Stallman <rms@gnu.org>
14642
14643 * src/bison.s1: *** empty log message ***
14644
146451993-07-04 Richard Stallman <rms@gnu.org>
14646
14647 * bison.simple: *** empty log message ***
14648
146491993-06-26 David J. MacKenzie <djm@gnu.org>
14650
14651 * src/getargs.c: entered into RCS
14652
146531993-06-26 David J. MacKenzie <djm@gnu.org>
14654
14655 * doc/bison.texinfo: *** empty log message ***
14656
14657 * doc/bison.1: New file.
14658
146591993-06-25 Richard Stallman <rms@gnu.org>
14660
14661 * src/getargs.c: New file.
14662
146631993-06-16 Richard Stallman <rms@gnu.org>
14664
14665 * src/bison.s1: *** empty log message ***
14666
146671993-06-16 Richard Stallman <rms@gnu.org>
14668
14669 * bison.simple: *** empty log message ***
14670
146711993-06-03 Richard Stallman <rms@gnu.org>
14672
14673 * src/bison.s1: New file.
14674
146751993-06-03 Richard Stallman <rms@gnu.org>
14676
14677 * doc/bison.texinfo: *** empty log message ***
14678
146791993-06-03 Richard Stallman <rms@gnu.org>
14680
14681 * bison.simple: New file.
14682
146831993-05-19 Richard Stallman <rms@gnu.org>
14684
14685 * doc/bison.texinfo: New file.
14686
146871993-05-07 Noah Friedman <friedman@gnu.org>
14688
14689 * Makefile.in: *** empty log message ***
14690
146911993-04-28 Noah Friedman <friedman@gnu.org>
14692
14693 * src/reader.c: *** empty log message ***
14694
146951993-04-23 Noah Friedman <friedman@gnu.org>
14696
14697 * src/alloc.h: entered into RCS
14698
146991993-04-20 David J. MacKenzie <djm@gnu.org>
14700
14701 * src/version.c: *** empty log message ***
14702
14703 * src/files.c, src/allocate.c:
14704 entered into RCS
14705
14706 * src/reader.c: *** empty log message ***
14707
14708 * src/lex.c: entered into RCS
14709
14710 * src/conflicts.c: New file.
14711
14712 * src/symtab.c: entered into RCS
14713
14714 * src/alloc.h: New file.
14715
14716 * src/LR0.c: entered into RCS
14717
147181993-04-18 Noah Friedman <friedman@gnu.org>
14719
14720 * src/reader.c: New file.
14721
14722 * src/version.c: *** empty log message ***
14723
147241993-04-18 Noah Friedman <friedman@gnu.org>
14725
14726 * Makefile.in: *** empty log message ***
14727
147281993-04-17 Noah Friedman <friedman@gnu.org>
14729
14730 * Makefile.in: *** empty log message ***
14731
147321993-04-15 Richard Stallman <rms@gnu.org>
14733
14734 * src/main.c, src/files.c:
14735 New file.
14736
147371993-04-15 Noah Friedman <friedman@gnu.org>
14738
14739 * configure.in: entered into RCS
14740
14741 * configure.in: *** empty log message ***
14742
14743 * configure.in: New file.
14744
147451993-04-14 Richard Stallman <rms@gnu.org>
14746
14747 * Makefile.in: New file.
14748
147491993-04-13 Richard Stallman <rms@gnu.org>
14750
14751 * src/version.c: New file.
14752
147531993-03-25 Richard Stallman <rms@gnu.org>
14754
14755 * src/output.c: entered into RCS
14756
147571992-09-25 Richard Stallman <rms@gnu.org>
14758
14759 * configure.bat: entered into RCS
14760
147611992-06-22 Richard Stallman <rms@gnu.org>
14762
14763 * src/vmsgetargs.c: entered into RCS
14764
147651992-06-22 Richard Stallman <rms@gnu.org>
14766
14767 * doc/bison.rnh: entered into RCS
14768
147691992-04-20 David J. MacKenzie <djm@gnu.org>
14770
14771 * README: entered into RCS
14772
147731992-01-22 Richard Stallman <rms@gnu.org>
14774
14775 * src/machine.h: entered into RCS
14776
147771991-12-21 Richard Stallman <rms@gnu.org>
14778
14779 * src/lalr.c, src/closure.c:
14780 entered into RCS
14781
147821991-12-20 Richard Stallman <rms@gnu.org>
14783
14784 * src/state.h: entered into RCS
14785
147861991-12-18 Richard Stallman <rms@gnu.org>
14787
14788 * src/print.c, src/nullable.c, src/derives.c:
14789 entered into RCS
14790
147911991-11-03 David J. MacKenzie <djm@gnu.org>
14792
14793 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
14794 entered into RCS
14795
147961988-09-09 Richard Stallman <rms@gnu.org>
14797
14798 * src/bison.hairy: entered into RCS
14799
148001987-12-16 Richard Stallman <rms@gnu.org>
14801
14802 * REFERENCES: entered into RCS
dc546b0f 14803
f294a2c2 14804
04098407 14805 -----
f294a2c2 14806
04098407
PE
14807 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
14808 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
14809 Foundation, Inc.
f294a2c2 14810
04098407
PE
14811 Copying and distribution of this file, with or without
14812 modification, are permitted provided the copyright notice and this
14813 notice are preserved.