]> git.saurik.com Git - bison.git/blame - ChangeLog
* NEWS (2.3a+): In the %code entry, reference section `Bison
[bison.git] / ChangeLog
CommitLineData
5a43d418
JD
12007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 * src/Makefile.am (yacc): Quote target action commands properly so
4 that the yacc script isn't corrupt. Reported by Hans Aberg at
5 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6
0c650a20
JD
7 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
8 the case of pure parsers. Reported by Frans Englich at
9 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
10 * THANKS: Add Frans Englich.
11
61fee93e
JD
12 * NEWS (2.3a+): In the %code entry, reference section `Bison
13 Declaration Summary' from the manual now since the %code summary has
14 moved there.
15 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
16 in the rules section must be terminated by semicolons.
17
f124d423
JD
182007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
19
20 Extend the front-end API for %define variables to more completely
21 mirror the back-end. This will be useful in the future.
22 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
23 Update comments to mention the new front-end counterparts of these
24 macros.
25 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
26 for muscle_string_decode and muscle_location_decode.
27 (muscle_string_decode): New static function.
28 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
29 (muscle_percent_define_get, muscle_percent_define_ifdef): New
30 functions.
31 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
32 muscle_percent_define_get to mimic the b4_percent_define_flag_if
33 implementation more closely.
34 (muscle_percent_define_invalid_value): New function.
35 * src/muscle_tab.h (muscle_percent_define_get,
36 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
37 Prototype.
38
75ad86ee
JD
392007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
40
41 * NEWS (2.3a+): Mention yesterday's state-removal change.
42 (2.3a): Remove the %language entry, which was added after 2.3a.
43 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
44 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
45 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
46 tests/existing.at: Update copyright date.
47
5967f0cf
JD
482007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
49
50 If conflict resolution makes states unreachable, remove those states,
51 report rules that are then unused, and don't report conflicts in those
52 states.
53 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
54 New global function.
55 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
56 function.
57 * src/main.c (main): After conflict resolution, remove the unreachable
58 states and update all data structures that reference states by number.
59 * src/state.c (state_new): Initialize each state's reachable member to
60 false.
61 (state_mark_reachable_states): New static function.
62 (state_remove_unreachable_states): New global function.
63 * src/state.h (struct state): Add member bool reachable.
64 (state_remove_unreachable_states): Prototype.
65 * tests/conflicts.at (Unreachable States After Conflict Resolution):
66 New test case.
67 * tests/existing.at (GNU pic Grammar): Update test case output now that
68 an unused rule is discovered.
69
b09f4f48
JD
702007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
71
72 Minor code cleanup in parser table construction.
73 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
74 (new_itemsets, save_reductions): Update for rename to nitemset.
75 * src/closure.c (nritemset): Rename to...
76 (nitemset): ... this since the "r" appears to meaningless and isn't
77 used in the comments.
78 (closure): Update for rename.
79 * src/closure.h (nritemset): Update extern to...
80 (nitemset): ... this.
81 * src/lalr.c (LA): Fix a typo in comments.
82 * src/print.c (print_core): Update for rename to nitemset.
83 * src/print_graph.c (print_graph): Likewise.
84 * src/state.h: Fix some typos in header comments.
85
bbb44d83
PE
862007-04-04 Paul Eggert <eggert@cs.ucla.edu>
87
9b33de72
PE
88 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
89 still sticks to ASCII. Sorry!
90
bbb44d83
PE
91 * README-hacking: New file, taken mostly from coreutils, with changes
92 for Bison. Contains much of the contents of:
93 * README-cvs: Remove.
94 * bootstrap: Sync from gnulib.
95 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
96 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
97
29553547
JD
982007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
99
100 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
101 Setzer.
102 (Java Differences): Fix some typos.
103 * THANKS: Add Sebastian Setzer.
104
01b477c6
PB
1052007-03-07 Paolo Bonzini <bonzini@gnu.org>
106
107 * data/java.m4 (b4_single_class_if): Remove.
108 (b4_abstract_if): Look at "%define abstract".
109 (b4_lexer_if): New.
110 (b4_union_name): Rename...
111 (b4_yystype): ... to this. Map to "%define stype".
112 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
113 b4_maybe_throws): Fix quoting.
114 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
115 * data/lalr1.java (Lexer interface): Always define.
116 (Lexer interface within parser class): Remove.
117 (YYLexer class): New, used when "%code lexer" is present.
118 (constructor): When "%code lexer" is used, pass %lex-param
119 to the lexer constructor.
120 (yylex, yyparse): Remove %lex-param from method invocations
121 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
122
123 * doc/bison.texinfo (Java Bison Interface): Mention "%define
124 abstract". Rename "%define union_name" to "%define stype".
125 Rename method names according to previous patch.
126 (Java Scanner Interface): Describe "%code lexer" instead of
127 "%pure-parser" and "%define single_class".
128 (Java Differences): Mention "%code lexer".
129
130 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
131 Include scanner here, using macros from tests/local.at.
132 (AT_DATA_CALC_Y): Remove final argument.
133 (_AT_CHECK_JAVA_CALC): Likewise.
134 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
135 of %locations and %error-verbose.
136 (main): Test with and without %lex-param.
137 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
138 (AT_BISON_OPTION_POPDEFS): Pop it.
139
122bea3a
JMG
1402007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
141
142 DJGPP spefic issue. Inhibit the use of disallowed characters for
143 file name genertion on Win98, WinXP, etc. These are |<>":?*\
144 and concern testsuite case 46.
145 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
146 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
147 * djgpp/config.bat: Inhibit the use of disallowed characters.
148
9611cfa2
JD
1492007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
150
151 Miscellaneous %define and %code cleanup.
152 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
153 values are interpreted.
154 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
155 documentation a little more.
156 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
157 muscle_percent_define_insert, muscle_percent_code_grow): New
158 functions/macros.
159 * src/muscle_tab.h (muscle_percent_define_insert,
160 muscle_percent_code_grow): Prototype.
161 * src/parse-gram.y (prologue_declaration): Use
162 muscle_percent_define_insert and muscle_percent_code_grow when parsing
163 %define and %code directives.
164
165 Make it easy to share %define boolean variables between the front-end
166 and back-end. Though not used yet, this will be useful in the future.
167 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
168 Bison uses of names rather than just skeleton uses of names.
169 (b4_percent_define_get, b4_percent_define_ifdef): Rename
170 b4_percent_define_skeleton_variables(VARIABLE) to
171 b4_percent_define_bison_variables(VARIABLE).
172 (b4_percent_code_get, b4_percent_code_ifdef): Rename
173 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
174 b4_percent_code_bison_qualifiers(QUALIFIER).
175 (b4_check_user_names_wrap): Update for renames.
176 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
177 muscle_percent_define_default): New functions mimicking
178 b4_percent_define_flag_if and b4_percent_define_default.
179
180 For %define variables, report locations for invalid values and
bbb44d83 181 redefinitions.
9611cfa2
JD
182 * data/bison.m4 (b4_percent_define_flag_if): Read
183 b4_percent_define_loc(VARIABLE) to report the location of an invalid
184 value for VARIABLE.
185 (b4_percent_define_default): Save a special location in
186 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
187 must later be reported as invalid.
188 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
189 functions.
190 (muscle_percent_define_insert): Record the location of VARIABLE in
191 muscle percent_define_loc(VARIABLE), and use it to report the previous
192 location for a redefinition.
193 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
194 (muscle_percent_define_default): Update like b4_percent_define_default.
195 (muscle_grow_user_name_list): Rename to...
196 (muscle_user_name_list_grow): ... this for consistency and use
197 muscle_location_grow.
198 * src/muscle_tab.h (muscle_location_grow): Prototype.
199 * tests/input.at (%define errors): Update expected output.
200 * tests/skeletons.at (%define boolean variables: invalid skeleton
201 defaults): New test case.
202
0bf92491
JD
2032007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
204
205 * src/print.c (lookahead_set, state_default_rule): Remove.
206 (print_reductions): Replace state_default_rule invocation with
207 equivalent use of yydefact, which was computed in token_actions in
208 tables.c.
209 (print_results): Don't allocate lookahead_set.
210
d3b12988
PB
2112007-02-27 Paolo Bonzini <bonzini@gnu.org>
212
213 * data/lalr1.java: Prefix all private members with yy.
214
f57a7536
JD
2152007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
216
217 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 218 Sebastien Fricker at
f57a7536 219 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 220 * THANKS: Add Sebastien Fricker.
f57a7536
JD
221 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
222 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
223 accept a variable number of arguments.
224
6404a5bf
JD
2252007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
226
227 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
228
e4e09639
JMG
2292007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
230
231 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
232 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
233 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
234
d7e0a1a7
PE
2352007-02-11 Paul Eggert <eggert@cs.ucla.edu>
236
237 Undo my 2007-02-07 change, switching back to the c-strcase module
238 introduced in the 2007-02-03 change. Bruno Haible reported that
239 the 2007-02-07 change would be dangerous in Turkish if we add a
240 language whose name contains "i", since "i" is not lowercase "I"
241 in Turkish.
242 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
243 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
244 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
245 * m4/.cvsignore: Remove strcase.m4.
246 * src/getargs.c: Revert 2007-02-07 change, as follows.
247 Include c-strcase.h.
248 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
249
deee93a1
JD
2502007-02-11 Bruno Haible <bruno@clisp.org>
251
252 Enable the Java related testsuite tests when the only Java compiler
253 found is a gcj < 4.3. Discussed at
254 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
255 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
256
574add85
JD
2572007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
258
259 * data/Makefile.am: Update copyright date.
260 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
261 yypstate_new returns NULL.
262 (yypstate_new): Return NULL if malloc does.
263 * src/reader.c (packgram): Move translation of rule actions from the
264 beginning of packgram to...
265 (check_and_convert_grammar): ... here right before packgram is invoked
266 so it's easier to write more complete comments, and remove redundant
267 code.
268
e785ccf7
JD
2692007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
270
271 As in semantic actions, make @$ in %initial-action, %destructor, and
272 %printer imply %locations.
273 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
274 scanning @$.
275 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
276 (@$ in %initial-action implies %locations,
277 @$ in %destructor implies %locations,
278 @$ in %printer implies %locations): ... these new test cases.
279
1cfe1ed7
PE
2802007-02-07 Paul Eggert <eggert@cs.ucla.edu>
281
282 Undo most of the 2007-02-03 change, switching to the strcase module
283 now that gnulib strcase has been fixed.
284 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
285 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
286 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
287 * m4/.cvsignore: Add strcase.m4.
288 * src/getargs.c: Revert 2007-02-03 change, as follows.
289 Don't include c-strcase.h.
290 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
291 strcasecmp has "unspecified behavior" outside the POSIX locale,
292 but it works fine in practice if at least one argument is ASCII,
293 as is the case in Bison.
294
0049ec86
PB
2952007-02-07 Paolo Bonzini <bonzini@gnu.org>
296
297 * tests/java.at: Skip tests if only one of javac/java is present.
298 Reported by Joel E. Denny.
299 * tests/atlocal.in: Adjust copyright years.
300
3012007-02-05 Paolo Bonzini <bonzini@gnu.org>
302
303 * data/lalr1.java (Stack): Work around old verifiers that disallow
304 access to the private fields of an inner class, from the outer class.
305 We can make Stack's fields public because user code doesn't have access
306 to the instance of Stack used by parse(). Reported by Paul Eggert.
307
2c2b7220
PE
3082007-02-03 Paul Eggert <eggert@cs.ucla.edu>
309
310 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
311 the right spot for these files?
312 * bootstrap.conf (gnulib_modules): Add c-strcase.
313 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
314 c-strncasecmp.c.
315 * src/getargs.c: Include c-strcase.h.
316 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
317 to avoid unspecified behavior.
318
b2b81dae
JD
3192007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
320
321 * doc/bison.texinfo (Decl Summary): Correct typo.
322
c1d19e10
PB
3232007-01-30 Paolo Bonzini <bonzini@gnu.org>
324
325 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
326 Complain if the value does not match empty, "true" or "false".
327 * data/c++.m4: Adjust default definitions of %define variables.
328 * data/java.m4: Adjust default definitions of %define variables.
329 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
330 to above behavior.
331 * tests/input.at (Boolean %define variables): Test new behavior.
332
8405b70c
PB
3332007-01-29 Paolo Bonzini <bonzini@gnu.org>
334
335 * NEWS: Mention java.
336 * TODO: Remove things that are done.
337 * bootstrap.conf: Add javacomp-script and javaexec-script.
338 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
339
340 * data/Makefile.am: Add new files.
341 * data/java-skel.m4: New.
342 * data/java.m4: New.
343 * data/lalr1.java: New.
344
345 * doc/bison.texinfo: Put "A Complete C++ Example" under
346 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
347 under Other Languages.
348
349 * src/getargs.c (valid_languages): Add Java.
350 * src/getargs.h (struct bison_language): Update size of string fields.
351
352 * tests/Makefile.am: Add java.at.
353 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
354 * tests/java.at: New.
355 * tests/testsuite.at: Include it.
356
3eb82471
JD
3572007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
358
359 Clean up.
360 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
361 at_directive_argv arguments so these no longer have to be global
362 variables. Also, update the implementation for the following changes.
363 (fail_for_at_directive_too_many_args,
364 fail_for_at_directive_too_few_args): Add at_directive_name argument.
365 (at_directive_name): Remove as at_directive_argv[0] will be used for
366 this now.
367 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
368 for the directive name.
369 (at_directive_argc, at_directive_argv): Make these local within
370 skel_lex instead of global.
371 (INITIAL): Update directive start action for above changes.
372 (SC_AT_DIRECTIVE_ARG): Rename to...
373 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
374 (SC_AT_DIRECTIVE_SKIP_WS): Update.
375 (scan_skel): Move yylex_destroy to...
376 (skel_scanner_free): ... here.
377 * tests/skeletons.at (installed skeleton file name): Rename to...
378 (installed skeleton file names): ... this.
379
148d66d8
JD
3802007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
381
382 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
383 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
384 Summary" not "Directives".
385 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
386 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
387 since the former is now the more complete one.
388 (Prologue Alternatives): Likewise and do the same for %defines.
389 (Table of Symbols): Add summary of %code, add summary of %define, and
390 move full %code documentation to...
391 (Decl Summary): ... here for consistency with other entries in these
392 sections.
393 Move %define entry in order to keep this list alphabetized.
394 Reword %define entry a little to put less emphasis on the skeleton
395 concept, which most users shouldn't have to think about.
396
665f0c24
PE
3972007-01-26 Paul Eggert <eggert@cs.ucla.edu>
398
399 Adjust to recent gnulib changes.
400 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
401 Add string.h, string_.h, unistd_.h, wchar_.h.
402 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
403 * src/system.h: Don't include <stpcpy.h>; this is now done by
404 <string.h>.
405
592d0b1e
PB
4062007-01-23 Paolo Bonzini <bonzini@gnu.org>
407
408 Simplify implementation of unqualified %code, implement macros for
409 uniform treatment of boolean %define flags. Document %define.
410 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
411 b4_percent_code_ifdef): New.
412 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
413 * data/c++.m4: Define default value for global_tokens_and_yystype.
414 * data/glr.cc: Likewise.
415 * data/location.cc: Use b4_percent_define_flag_if.
416
148d66d8 417 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
418
419 * src/parse-gram.y (Unqualified %code): Change muscle name to
420 b4_percent_code().
421 (content.opt): Default to empty.
422
a7867f53
JD
4232007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
424
425 Implement support for relative and absolute skeleton file names.
426 Discussed starting at
427 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
428 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
429 (Bison Options): Document in --skeleton entry.
430 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
431 full_skeleton can't necessarily hold all of pkgdatadir.
432 If the specified skeleton file name contains a `/', don't prepend
433 pkgdatadir.
434 * src/parse-gram.y (prologue_declaration): If the specified skeleton
435 file name contains a `/', prepend the grammar file directory.
436 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
437 * skeletons.at: New file.
438 (relative skeleton file names): New test case.
439 (installed skeleton file names): New test case.
440 * tests/testsuite.at: Include skeletons.at.
441
442 * bootstrap: Update copyright to 2007.
443
830c9b18
PB
4442007-01-17 Paolo Bonzini <bonzini@gnu.org>
445
446 * bootstrap: Remove occurrences of .#bootmp from the files.
447
a8c2e813
AD
4482007-01-17 Akim Demaille <akim@epita.fr>
449
450 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
451 nonterminals.
452 Use per-type %printer.
453
279cabb6
JD
4542007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
455
456 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
457 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
458 djgpp/config.site, src/files.c, src/files.h, src/main.c,
459 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
460 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
461 tests/glr-regression.at, tests/input.at, tests/local.at,
462 tests/output.at, tests/torture.at: Update copyright to 2007.
463
bb32f4f2
AD
4642007-01-16 Akim Demaille <akim@epita.fr>
465
466 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
467 error code.
468 (Calc++ Scanner): Exit with failure if we can't open the input
469 file.
470 Accept "-" standing for stdin.
471 (Calc++ Top Level): Print the result only if the parsing was
472 successful.
473
7cff04b5
AD
4742007-01-16 Akim Demaille <akim@epita.fr>
475
476 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
477
a4e25e1d
JD
4782007-01-15 Paolo Bonzini <bonzini@gnu.org>
479 and Joel E. Denny <jdenny@ces.clemson.edu>
480
481 Clean up %define and %code implementation in M4 some. Most
482 importantly, rename all related macros to be in the b4_percent_define
483 and b4_percent_code namespaces. Also, complete support for `.' in
484 %define variable names and %code qualifiers.
485 * data/bison.m4 (b4_check_user_names): Check for special
486 "SKELETON-NAMESPACE(name)" macros instead of using two nested
487 m4_foreach loops.
488 (b4_get_percent_define, b4_get_percent_code): Rename to...
489 (b4_percent_define_get, b4_percent_code_get): ... these.
490 Extend documentation with examples.
491 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
492 b4_percent_define_skeleton_variables and
493 b4_percent_code_skeleton_qualifiers.
494 Expect any value for the %define variable `foo' to be stored in the
495 macro named `b4_percent_define(foo)'; expect any %code blocks for the
496 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
497 expect any unqualified %code blocks to be stored in a macro named
498 `b4_percent_code_unqualified'.
499 Use m4_indir so that %define variable names and %code qualifiers can
500 contain `.', which is allowed by the grammar parser.
501 (b4_percent_define_default): New macro to set a default value for a
502 %define variable.
503 (m4_wrap): Update wrapped code, and fix some underquoting.
504 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
505 Expect grammar uses of %define variables and %code qualifiers to be
506 defined in b4_percent_define_user_variables and
507 b4_percent_code_user_qualifiers.
508 * data/c++.m4: Use b4_percent_define_default rather than
509 m4_define_default. Fix some underquoting. Skeleton usage of %define
510 variable define_location_comparison now implies skeleton usage of
511 %define variable filename_type.
512 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
513 data/push.c, data/yacc.c: Update macro names.
514 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
515 muscle names.
516
e37c665c
JMG
5172007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
518
519 DJGPP specific issues.
520
521 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
522 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
523
7d2d521f
JD
5242007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
525
526 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
527 run parsers in all tests so that Valgrind is invoked during
528 maintainer-check-valgrind.
529 (Duplicate representation of merged trees): Free all semantic values.
530 (Duplicated user destructor for lookahead): Likewise.
531
e0ac9b4b
JD
5322007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
533
534 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
535 command-line prefix.
536 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
537 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
538 miss Valgrind messages.
539 (Exploding the Stack Size with Malloc): Likewise.
540
78143faa
JD
5412007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
542
543 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
544 locals. Reported by Juan Manuel Guerrero at
545 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
546 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
547 Fix some indentation also.
548 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
549 explaining this issue.
550
7ecec4dd
JD
5512007-01-09 Paolo Bonzini <bonzini@gnu.org>
552 and Joel E. Denny <jdenny@ces.clemson.edu>
553
554 Simplify union and prologue handling, and escape union and lex/parse
555 params with digraphs.
556 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
557 values to the empty string since these are no longer guaranteed
558 initialized by the front-end.
559 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
560 braces around b4_user_stype since this is no longer done by the
561 front-end.
562 * src/files.c, src/files.h (pre_prologue_obstack,
563 post_prologue_obstack): Remove.
564 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
565 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
566 with digraphs. This fixes lex params and parse params.
567 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
568 * src/output.c (prepare): Remove muscle insertion of the prologues.
569 (output): Remove freeing of pre_prologue_obstack and
570 post_prologue_obstack.
571 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
572 than prologue_augment for prologue parsing so you don't need prologue
573 obstacks.
5c80250c
JD
574 (grammar_declaration): For %union RHS, use `braceless' instead of
575 "{...}" so that braces are already stripped and code is escaped with
576 digraphs.
7ecec4dd
JD
577 * src/reader.c (prologue_augment): Remove.
578 (reader): Remove initialization of pre_prologue_obstack and
579 post_prologue_obstack.
580 * src/reader.h (prologue_augment): Remove.
581
582 * data/c.m4: Remove stray parenthesis.
583
16dc6a9e
JD
5842007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
585
586 Remove quotes from variables names in %define directives and from
587 qualifiers in %code directives, and restrict the characters that are
588 allowed in them to M4-friendly ones. For %define, continue to support
589 the quoted form as a deprecated feature. Discussed starting at
590 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
591 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
592 %code.
593 * doc/bison.texinfo (Prologue Alternatives): Update.
594 (Bison Declaration Summary): In %defines entry, update mention of
595 `%code requires' and `%code provides'.
596 (C++ Location Values): Update %define uses.
597 (Calc++ Parser Interface): Likewise.
598 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 599 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
600 * src/parse-gram.y (prologue_declaration): For %define variables, use
601 `variable' instead of `STRING'.
602 (grammar_declaration): For %code qualifiers, use `ID' instead of
603 `STRING'.
604 (variable): New nonterminal that takes an `ID' or a `STRING'.
605 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
606 and %define uses.
607 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
608 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
609 (%define errors): Update %define uses.
610
e9813cd4
JD
6112007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
612
613 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
614 instead of muscle_insert for %define values so that M4-special
615 characters are replaced with digraphs.
616 * tests/input.at (%define errors): Extend to check weird values.
617
6afc30cc
JD
6182007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
619
620 Instead of having skeletons declare all valid %define variables and
621 %code qualifiers, provide macros that retrieve the associated values
622 and build these lists automatically. Thus Bison will now warn when a
623 variable or qualifier is not used by the skeleton in the current
624 invocation regardless of whether it might sometimes be used by that
625 skeleton in other invocations. Also, move all %define value macros to
626 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
627 form, which is replaced by %code.
628 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
629 (b4_check_user_names): ... this, and change the series of valid name
630 arguments to a single list argument for names used in the skeleton
631 similar to the existing list argument for names used in the grammar.
632 Warn instead of complaining.
633 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
634 values and %code code, to format %code code properly, and to build
635 lists of all %define variables and %code qualifiers used in the
636 skeleton: b4_skeleton_percent_define_variables and
637 b4_skeleton_percent_code_qualifiers.
638 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
639 Remove, and...
640 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
641 the skeleton names lists can finish building first. In place of
642 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
643 expect the lists b4_user_percent_define_variables and
644 b4_user_percent_code_qualifiers.
645 * data/c++.m4: Where setting default values for b4_parser_class_name,
646 b4_location_type, b4_filename_type, b4_namespace, and
647 b4_define_location_comparison, update their names to the
648 b4_percent_define_ namespace.
649 * data/glr.c: Don't use b4_check_percent_define_variables and
650 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
651 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
652 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 653 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
654 * data/location.cc: Use b4_get_percent_define.
655 * data/push.c: Don't use b4_check_percent_define_variables and
656 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
657 * data/yacc.c: Likewise, and don't call m4_exit in
658 b4_use_push_for_pull_if or m4_wrap code will never execute.
659 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
660 Rename to...
661 (muscle_grow_user_name_list): ... this for consistency with the
662 terminology used in bison.m4.
663 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
664 %define variable names, and rename muscle used_percent_define_variables
665 to user_percent_define_variables.
666 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
667 user_percent_code_qualifiers.
668 (content): Remove.
669 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
670 {CODE} form is no longer accepted.
671 * tests/input.at (Reject bad %code qualifiers): Rename to...
672 (Reject unused %code qualifiers): ... this, and update test output.
673 (%define error): Update test output.
674
7eb8a0bc
JD
6752007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
676
677 Check for unrecognized %define variables similar to checking for
678 unrecognized %code qualifiers. Check for redefined %define variables.
679 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
680 generalizes...
681 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
682 (b4_check_percent_define_variables): New, also wraps it.
683 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
684 variables using b4_check_percent_define_variables.
685 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
686 all those exercised in the test suite and all those listed in the
687 `Default values' section of c++.m4. Are there others?
688 * data/push.c, data/yacc.c: Declare no valid %define variables.
689 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
690 similar to muscle_find, but it works even when the muscle stores a
691 const value.
692 (muscle_grow_used_name_list): New function for constructing the used
693 name list muscles that b4_check_for_unrecognized_names requires.
694 * src/parse-gram.y (prologue_declaration): Warn if a variable is
695 %define'd more than once. Define the b4_used_percent_define_variables
696 muscle with muscle_grow_used_name_list.
697 (grammar_declaration): Abbreviate %code code with
698 muscle_grow_used_name_list.
699 * tests/input.at (%define errors): New.
700
3fc65ead
JD
7012007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
702
703 Provide warn_at, complain_at, and fatal_at function callbacks to the
704 skeletons, and use this for %code qualifier complaints.
705 * data/bison.m4 (b4_error_at): New, invoked by...
706 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
707 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
708 @fatal_at(...@) directives.
709 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
710 qualifiers in b4_used_percent_code_qualifiers and to use
711 b4_complain_at.
712 * src/location.c, src/location.h (boundary_set_from_string): New global
713 function.
714 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
715 function.
716 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
717 to b4_used_percent_code_qualifiers.
718 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
719 function.
720 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
721 (lineno): Rename to...
722 (out_lineno): ... this so I don't misunderstand it again.
723 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
724 here; these newlines are in the input but not the output file.
725 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
726 (at_directive_perform): ... this new static function, and add handling
727 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
728 directives.
729 * tests/input.at (Reject bad %code qualifiers): Update test output with
730 locations and extend.
731
732 * tests/output.at (Output file name: [, Output file name: ]): Remove
733 bogus comment about these tests failing.
734
1c7b7e1d
JD
7352007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
736
737 Clean up b4_check_percent_code_qualifiers a little.
738 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
739 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
740 documentation and add examples.
741 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
742 qualifiers here.
743
08af01c2
JD
7442007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
745
746 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
747 unreliable -- especially when they're hidden inside another macro.
748 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
749 data/c.m4: Remove m4_divert(-1).
750 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
751 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
752 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 753 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
754 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
755 pushed and popped by m4sugar, should be first on the stack.
756
757 Provide warn, complain, and fatal function callbacks to the skeletons.
758 This provides more flexibility than m4_fatal, improves the error
759 message format, and captures messages for translation. Discussed
760 starting at
761 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
762 * data/bison.m4 (b4_error): New, invoked by...
763 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
764 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
765 directives. Because these M4 macros might be called when the current
766 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
767 the previous removal of uses of m4_divert, which caused trouble.
768 (b4_check_percent_code_qualifiers): Use b4_complain instead of
769 m4_fatal to report unrecognized %code qualifiers.
770 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
771 push parser requests.
772 * data/glr.c: Use b4_complain instead of m4_fatal to report
773 non-deterministic push parser requests.
774 Update @output usage to @output(...@) form.
775 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
776 report missing %defines. Update @output usage to @output(...@) form.
777 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
778 @output(...@) form.
779 * src/main.c (main): Invoke skel_scanner_free.
780 * src/scan-skel.h (skel_scanner_free): Prototype new function.
781 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
782 obstack_for_string from flex-scanner.h.
783 (YY_DECL): Use to declare skel_lex static.
784 (decode_at_digraphs): Remove; now handled in the new
785 SC_AT_DIRECTIVE_ARG start condition.
786 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
787 functions.
788 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
789 at_directive_argv): New static globals.
790 (INITIAL): Use fail_for_invalid_at.
791 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
792 recognize the start of a generalized `@directive(...@)' form and
793 start...
794 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
795 directive args (using the new obstack_for_string), to decode the
796 contained @ diagraphs, and to perform the directive. It recognizes
797 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
798 @output(...@).
799 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
800 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
801 `@,'.
802 (scan_skel): Initialize obstack_for_string on the first call.
803 (skel_scanner_free): New function to free obstack_for_string.
804 * tests/input.at (Reject bad %code qualifiers): Update test output.
805
8e0a5e9e
JD
8062007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
807
808 Consolidate the 4 prologue alternative directives (%code, %requires,
809 %provides, and %code-top) into a single %code directive with an
810 optional qualifier field. Discussed at
811 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
812 * NEWS (2.3a+): Rewrite the existing entry for the prologue
813 alternatives.
814 * doc/bison.texinfo (Prologue Alternatives): Update.
815 (Decl Summary): Update to %code "requires" and %code "provides".
816 (Calc++ Parser): Update to %code "requires".
148d66d8 817 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
818 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
819 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
820 are replaced by b4_percent_code_provides and b4_percent_code_requires,
821 which are skeleton-specific.
822 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
823 declare what %code qualifiers it supports and to complain if any other
824 qualifiers were used in the grammar.
825 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
826 and b4_user_code([b4_percent_code_provides]) in place of
827 b4_user_requires and b4_user_provides.
828 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
829 Add b4_user_code([b4_percent_code_top]) and
830 b4_user_code([b4_percent_code]).
831 Invoke b4_check_percent_code_qualifiers.
832 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
833 PERCENT_REQUIRES): Remove.
834 (grammar_declaration): Remove RHS's for %code-top, %provides, and
835 %requires. Rewrite the %code RHS as the unqualified form defining the
836 muscle b4_percent_code. Add another RHS for the qualified %code form,
837 which defines muscles of the form b4_percent_code_QUALIFIER and the
838 b4_used_percent_code_qualifiers muscle.
839 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
840 PERCENT_REQUIRES): Remove.
841 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
842 %code "requires" and %code "provides".
843 * tests/input.at (Reject bad %code qualifiers): New.
844
95021767
JD
8452007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
846
847 Use the new code_props interface for destructors and printers.
848 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
849 printer_location members, and change the type of the destructor and
850 printer members to code_props.
851 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
852 symbol_printer_get, semantic_type_destructor_set,
853 semantic_type_printer_set, default_tagged_destructor_set,
854 default_tagless_destructor_set, default_tagged_printer_set,
855 default_tagless_printer_set): Use code_props in arguments and return
856 types in place of char const * and location.
857 (symbol_destructor_location_get, symbol_printer_location_get): Remove
858 since the locations are now contained in the return of
859 symbol_destructor_get and symbol_printer_get.
860 * src/output.c (symbol_destructors_output, symbol_printers_output):
861 Replace with...
862 (symbol_code_props_output): ... this to eliminate duplicate code.
863 (output_skeleton): Update to use symbol_code_props_output.
864 * src/reader.c (symbol_should_be_used): Update use of
865 symbol_destructor_get.
866 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
867 Update uses of the various _destructor_set and _printer_set functions.
868 * src/symtab.c: (default_tagged_destructor_location,
869 default_tagless_destructor_location, default_tagged_printer_location,
870 default_tagless_printer_location): Remove since we...
871 (default_tagged_destructor, default_tagless_destructor,
872 default_tagged_printer, default_tagless_printer): ... change the type
873 of these to code_props.
874 (symbol_new, semantic_type_new, symbol_destructor_set,
875 semantic_type_destructor_set, symbol_destructor_get,
876 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
877 symbol_check_alias_consistency, default_tagged_destructor_set,
878 default_tagless_destructor_set, default_tagged_printer_set,
879 default_tagless_printer_set): Update.
880 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
881 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
882 code_props members.
883 (symbol_print): Use SYMBOL_CODE_PRINT.
884
f6857bbf
JD
8852007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
886
887 Use the new code_props interface for rule actions.
888 * src/symlist.h (symbol_list): Replace action, action_location, and
889 used members with a code_props action_props member.
890 * src/reader.c (symbol_should_be_used, grammar_rule_check,
891 grammar_midrule_action, grammar_current_rule_merge_set,
892 grammar_current_rule_symbol_append, packgram): Update.
893 * src/scan-code.h (translate_rule_action): Remove, no longer used.
894 * src/scan-code.l (handle_action_dollar): Update.
895 (translate_rule_action): Remove, no longer used.
896 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
897
7c0c6181
JD
8982007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
899
900 Use the new code_props interface in parse-gram.y.
901 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
902 Update all uses of translate_* functions to use the new code_props
903 interface and to use gram_scanner_last_string_free and
904 code_scanner_last_string_free where possible.
905 (grammar_declaration): symbol_list_destructor_set and
906 symbol_list_printer_set now perform the translation, so don't do it
907 here. Use gram_scanner_last_string_free where possible.
908 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
909 translate_code): Remove, no longer used.
910 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
911 symbol_list_printer_set): Perform code translation here rather than
912 depending on the caller to do so.
913
914 * src/symlist.h (struct symbol_list): Correct some documentation typos.
915 * src/scan-gram.h (gram_last_string): Remove declaration.
916 * src/scan-gram.l (last_string): Declare it static.
917
28e52c0d
JD
9182007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
919
920 Encapsulate code properties and related functionality for the various
921 destructors, printers, and actions into a code_props structure and
922 interface. This patch merely implements code_props in scan-code.h and
923 scan-code.l. Future patches will rewrite other modules to use it.
924 Discussed starting at
925 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
926 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
927 consistently initialize const structs that have an empty location
928 field.
929 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
930 to ensure consistency.
931 * src/scan-code.h (code_props): New structure.
932 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
933 function, macro, and const global variable for initializing a
934 code_props with no code.
935 (code_props_plain_init, code_props_symbol_action_init,
936 code_props_rule_action_init, code_props_translate_code): The rest of
937 the new code_props functional interface. Among other things, the init
938 functions set the code_props kind field so that
939 code_props_translate_code will know whether to behave like
940 translate_symbol_action, translate_rule_action, or translate_code.
941 These old translate functions must remain until all other modules are
942 updated to use the new code_props interface.
943 (code_scanner_last_string_free): New function similar to
944 gram_scanner_last_string_free.
945 (code_scanner_free): Add documentation.
946 * src/scan-code.l: Implement the new interface.
947 (code_lex): Make it static, add a code_props* argument, and remove the
948 rule argument.
949 (last_string): New static global similar to the one in scan-gram.l.
950 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
951 instead of rule.
952 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
953 code_props since Bison may one day use this information for destructors
954 and printers.
955 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
956 (handle_action_dollar): Use symbol_list_n_get and set used flag
957 directly since symbol_list_n_used_set is removed.
958 (translate_action): Add a code_props* argument and remove the rule,
959 action, and location arguments. Pass the code_props* on to code_lex.
960 (translate_rule_action, translate_symbol_action, translate_code):
961 Rewrite as wrappers around the new code_props interface.
962 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
963 it would eventually need to break the encapsulation of code_props.
964
96034983
JD
9652007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
966
967 * etc/.cvsignore: New.
968
945e396c
JD
9692007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
970
971 Add maintainer-push-check to run maintainer-check using push parsing in
972 place of pull parsing where available.
973 * Makefile.am (maintainer-push-check): New.
974 * data/bison.m4 (b4_use_push_for_pull_if): New.
975 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
976 appropriately based on their existing values.
977 (yypush_parse): Don't print push-parser-specific diagnostics if push
978 parsing is being used in place of pull parsing.
979 * data/yacc.c: If push parsing should replace pull parsing, redirect to
980 push.c.
981 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
982 variable, and insert b4_use_push_for_pull_flag into muscles.
983 * tests/Makefile.am (maintainer-push-check): New.
984
7d596384
JD
9852006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
986
987 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
988 (whether successful or failed) so that yypush_parse can be invoked
989 again to start a new parse using the same yypstate.
990 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
991 check multiple yypull_parse invocations on the same yypstate. For pull
992 mode, extend to check multiple yyparse invocations.
993 (Exploding the Stack Size with Alloca): Extend to try with
994 %push-pull-parser.
995 (Exploding the Stack Size with Malloc): Likewise.
996
997 * tests/calc.at (Simple LALR Calculator): Don't specify
998 %skeleton "push.c" since %push-pull-parser implies that now.
999 * tests/headers.at (export YYLTYPE): Don't check for the push
1000 declarations. Otherwise, this test case can't be used to see if push
1001 mode can truly emulate pull mode.
1002 * tests/input.at (Torturing the Scanner): Likewise.
1003 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
1004 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
1005 AT_YACC_IF, which now includes the case of push mode since %skeleton
1006 need not be used for push mode. This will be more intuitive once
1007 push.c is renamed to yacc.c.
1008
7172e23e
JD
10092006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1010
1011 For push mode, convert yyparse from a macro to a function, invoke yylex
1012 instead of passing a yylexp argument to yypull_parse, and don't
1013 generate yypull_parse or yyparse unless %push-pull-parser is declared.
1014 Discussed starting at
1015 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
1016 * data/bison.m4 (b4_pull_if): New.
1017 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
1018 * data/push.c: Improve M4 quoting a little.
1019 (b4_generate_macro_args, b4_parenthesize): Remove.
1020 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
1021 any time a pull parser is requested.
1022 Don't #define this as a wrapper around yypull_parse. Instead, when
1023 both push and pull are requested, make it a function that does that
1024 same thing.
1025 (yypull_parse): If there's a b4_prefix, #define this to
1026 b4_prefix[pull_parse] when both push and pull are requested.
1027 Don't define this as a function unless both push and pull are
1028 requested.
1029 Remove the yylexp argument and hard-code yylex invocation instead.
1030 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
1031 %push-parser.
1032 * src/getargs.c (pull_parser): New global initialized to true.
1033 * getargs.h (pull_parser): extern it.
1034 * src/output.c (prepare): Insert pull_flag muscle.
1035 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
1036 (prologue_declaration): Set both push_parser and pull_parser = true for
1037 %push-pull-parser. Set push_parser = true and pull_parser = false for
1038 %push-parser.
1039 * src/scan-gram.l: Don't accept %push_parser as an alternative to
1040 %push-parser since there's no backward-compatibility concern here.
1041 Scan %push-pull-parser.
1042 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
1043 instead of %push-parser.
1044 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
1045 prototype it in the module that calls yyparse.
1046 * tests/input.at (Torturing the Scanner): Likewise.
1047 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
1048
2e7944cb
JD
10492006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
1050
1051 Update etc/bench.pl. Optimize push mode a little (the yyn change
1052 deserves most of the credit).
1053 * Makefile.am (SUBDIRS): Add etc subdirectory.
1054 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
1055 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
1056 yytoken, yyval, and yyloc declarations to...
1057 (yyparse or yypush_parse): ... here to improve performance. For
1058 yypush_parse invocations after the first, be sure to assign yyn its old
1059 value again.
1060 (yypstate_new): Don't bother initializing the yyresult field since the
1061 initial value isn't used.
1062 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
1063 remove the #define that, in push mode, set it to yyps->NAME.
1064 * etc/Makefile.am: New.
1065 * etc/bench.pl: Remove and build it instead from...
1066 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
1067 "tests/bison" from the build directory by default rather than just
1068 invoking "bison" from $PATH.
1069 (calc_grammar): Update push parser code: don't declare yylval globally,
1070 don't define yyparse_wrapper, and don't #define yyparse.
1071 (bench_grammar): Update to check all working combinations of yacc.c,
1072 push.c, impure, pure, pull, and push.
1073
c3d50342
JD
10742006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1075
1076 For push mode, add pull wrappers around yypush_parse.
1077 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
1078 (yypull_parse): New function wrapping yypush_parse.
1079 (yyparse): New #define wrapping yypull_parse.
1080 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
1081 is declared.
1082 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
1083 prototype yylex in the module that calls yyparse, and don't prototype
1084 yyparse there. Otherwise, the yyparse expansion won't compile.
1085 * tests/input.at (Torturing the Scanner): Likewise.
1086
94ebeba5
JD
10872006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1088
1089 Enable push parsers to operate in impure mode. Thus, %push-parser no
1090 longer implies %pure-parser. The point of this change is to move
1091 towards being able to test the push parser code by running the entire
1092 test suite as if %push-parser had been declared.
1093 * data/push.c (yypush_parse): For impure mode, remove the
1094 yypushed_char, yypushed_val, and yypushed_loc arguments.
1095 Instead, declare these as local variables initialized to the global
1096 yychar, yylval, and yylloc.
1097 For the first yypush_parse invocation only, restore the initial values
1098 of these global variables when it's time to read a token since they
1099 have been overwritten.
1100 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
1101 %push-parser.
1102 * tests/calc.at (Simple LALR(1) Calculator): Always declare
1103 %pure-parser along with %push-parser since this test case was designed
1104 for pure push parsers.
1105 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
1106 (AT_YACC_OR_PUSH_IF): New.
1107 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
1108 add a note that it's still wrong for some cases (as it has been for a
1109 while).
1110 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
1111 %push-parser no longer implies %pure-parser.
1112
a0633178
JD
11132006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1114
1115 Remove some unnecessary differences between the pull parser code and
1116 the push parser code. This patch enables yynerrs in push mode.
1117 * data/push.c: Reformat M4 a little.
1118 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
1119 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
1120 because push mode is on. Instead, if pure mode is on, move yynerrs
1121 to...
1122 (b4_declare_parser_state_variables): ... here.
1123 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
1124 to yyps->NAME so it can be used in yypush_parse.
1125 (yypush_parse): Don't omit uses of yynerrs in push mode.
1126
8646b6a3
JD
11272006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1128
1129 Fix bug such that the first pushed token's value and location are
1130 sometimes overwritten (sometimes by %initial-action) before being used.
1131 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
1132 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
1133 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
1134 more closely mimic the pull parser logic.
1135 Don't copy the pushed token to yychar, yylval, and yylloc until it's
1136 time to read a token, which is after any initialization of yylval and
1137 yylloc.
1138 (gottoken): Rename label to...
1139 (yyread_pushed_token): ... for clarity and to avoid infringing on the
1140 user namespace.
1141
9baf4d74
JD
11422006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1143
1144 Rearrange initialization of the parser state variables so that the
1145 skeleton doesn't have to have a copy for pull mode and another for push
1146 mode. This patch also fixes at least a bug such that yylloc was not
1147 initialized (with b4_location_initial_line and
1148 b4_location_initial_column) upon calling yypush_parse. However, that
1149 initialization now overwrites the first token's location;
1150 %initial-action assigning @$ already did the same thing, and both bugs
1151 will be fixed in a later patch.
1152 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
1153 (b4_declare_parser_state_variables): Remove initialization of yytoken,
1154 yyss, yyvs, yyls, and yystacksize.
1155 (yypstate_new): Remove initialization of some yypstate fields: yystate,
1156 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
1157 yylsp.
1158 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
1159 yyps->NAME so it can be used in yypush_parse.
1160 (yyparse or yypush_parse): For yypush_parse, don't print the
1161 "Starting parse" diagnostic for invocations after the first.
1162 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
1163 yypush_parse, only do it for the first invocation.
1164 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
1165 initialization to occur in yypush_parse but only on the first
1166 invocation.
1167
23522164
JD
11682006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1169
1170 * data/push.c: Add CPP guards around push parser declarations in both
1171 the header and the code file.
1172 In the code file, move the push parser declarations to the same place
1173 they appear in the header file.
1174 Clean up the M4 some, especially the inconsistent underquoting in
1175 some b4_c_function_def and b4_c_function_decl uses.
1176
bb010fe5
JD
11772006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1178
1179 Encapsulate the push parser state variables into an M4 macro so the
1180 push skeleton doesn't have to list them again for pull mode's yyparse.
1181 For push mode, remove yypush_parse's local equivalents of these
1182 variables to eliminate unnecessary copying between the two sets at
1183 run-time. This patch also fixes at least a bug related to multiple
1184 %initial-action invocations in push mode.
1185 * data/push.c (b4_declare_parser_variables): Rename to...
1186 (b4_declare_scanner_communication_variables): ... this for clarity and
1187 update both uses.
1188 (b4_declare_yyparse_variables): Remove and move its contents to the one
1189 spot where it was invoked.
1190 (b4_declare_parser_state_variables): New macro containing the parser
1191 state variables required by push mode.
1192 (struct yypstate): Replace all fields but yynew with
1193 b4_declare_parser_state_variables.
1194 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
1195 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
1196 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
1197 (yyparse or yypush_parse): For yyparse in pull mode, replace local
1198 parser state variable declarations with
1199 b4_declare_parser_state_variables.
1200 Don't initialize parser state variables when calling yypush_parse since
1201 yypstate_new already does that.
1202 Invoke the user's initial action only upon the first yypush_parse
1203 invocation.
1204 Remove all code that copies between the local parser state variables
1205 and the yypstate.
1206
2d212f8c
JD
12072006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1208
1209 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
1210 prevent a name collision in a future patch where these names will
1211 sometimes be #define'd.
1212 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
1213 since it no longer has the same name as the existing argument.
1214 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
1215
e6e704dc
JD
12162006-12-19 Paolo Bonzini <bonzini@gnu.org>
1217 and Joel E. Denny <jdenny@ces.clemson.edu>
1218
1219 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1220 that the argument is case-insensitive, and there's no `=' here.
1221 For the %skeleton entry, mention that %language is better.
1222 (Bison Options): Likewise for --language and --skeleton. Move the
1223 --skeleton entry so that the `Tuning the parser' section is sorted
1224 alphabetically on long options.
1225 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
1226 %language directive in detail here; cross-reference the %language
1227 documentation instead.
1228 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
1229 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 1230 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
1231 * examples/extexi (normalize): Instead of replacing every %require
1232 argument with the current Bison version, just substitute for
1233 `@value{VERSION}'. This guarantees that we're testing what actually
1234 appears in the documentation.
1235 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
1236 rather than `@VERSION@'.
1237
0e021770
PE
12382006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1239
fd575f05
PE
1240 * NEWS: Reword the %language news a bit, and put it earlier.
1241
0e021770
PE
1242 * src/getargs.c (skeleton_arg): Last arg is now location const *.
1243 Rewrite to simplify the logic.
1244 (language_argmatch): Likewise.
fd575f05
PE
1245 (program_name): We now own this var.
1246 * src/getargs.h (struct bison_language): Use char[] rather than
1247 const char *.
0e021770
PE
1248
1249 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
1250 Java is supported.
1251 * src/complain.c (program_name): Remove decl; no longer needed.
1252 * src/main.c (program_name): Remove; now belongs to getargs.
1253
12542006-12-18 Paolo Bonzini <bonzini@gnu.org>
1255
1256 * NEWS: Document %language.
1257
1258 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
1259
1260 * data/c-skel.m4, data/c++-skel.m4: New files.
1261 * data/glr.c: Complain on push parsers.
1262
1263 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
1264 over %skeleton.
148d66d8 1265 (Decl Summary): Document %language and %skeleton.
0e021770
PE
1266 (Command line): Document -L.
1267
1268 * examples/extexi: Rewrite %require directive.
1269 * examples/calc++/Makefile.am: Pass VERSION to extexi.
1270
1271 * src/files.c (compute_exts_from_gc): Look in language structure
1272 for .y extension.
1273 (compute_file_name_parts): Check whether .tab should be added.
1274 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
1275 (language, skeleton_arg, language_argmatch): New.
1276 (long_options): Add --language.
1277 (getargs): Use skeleton_arg, add -L/--language.
1278 * src/getargs.h: Include location.h.
1279 (struct bison_language, language, skeleton_arg, language_argmatch): New.
1280 * src/output.c (prepare): Pick default skeleton from struct language.
1281 Don't dispatch C skeletons here.
1282 * src/parse-gram.y (PERCENT_LANGUAGE): New.
1283 (prologue_declaration): Add "%language" rule, use skeleton_arg.
1284 * src/scan-gram.l ("%language"): New rule.
1285
1286 * tests/calc.at: Test %skeleton and %language.
1287 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
1288 (AT_GLR_IF): Look for %skeleton "glr.cc".
1289 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
1290 (AT_YACC_IF): Reject %language.
1291
5691bf57
PE
12922006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1293
db06f0ce
PE
1294 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
1295 since it wasn't used; only the typedef name 'semantic_type' is needed.
1296 Also, omit trailing white space.
1297
5691bf57
PE
1298 * bootstrap: Sync from coreutils.
1299 (gnulib_extra_files): Add build-aux/announce.gen.
1300 (slurp): Adjust .gitignore files like .cvsignore files.
1301 * build-aux/announce-gen: Remove from CVS, since bootstrap
1302 now creates this.
1303
791934e4
JD
13042006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
1305
1306 Make %push-parser imply %pure-parser. This fixes several bugs; see
1307 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
1308 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
1309 pure_parser = true.
1310 * data/push.c: Don't bother testing b4_push_if when deciding whether
1311 to expand b4_declare_parser_variables globally.
1312 (yypush_parse): Likewise in here.
1313
1314 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
1315 (yy_reduce_print): Reformat M4 for readability.
1316
ee5abb37
JD
13172006-12-15 Bob Rossi <bob@brasko.net>
1318 and Joel Denny <jdenny@ces.clemson.edu>
1319
1320 * data/push.c (yypstate): Add typedef, and update all uses of
1321 struct yypstate to just yypstate.
1322 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
1323
16ca01f9
JD
13242006-12-14 Bob Rossi <bob@brasko.net>
1325
1326 * data/push.c (yypush_parse): Declare prototype regardless of
1327 %locations option.
1328
ab8e7e1a
JD
13292006-12-14 Bob Rossi <bob@brasko.net>
1330
1331 * data/push.c (yyparse): Remove the prototype and the #define when in
1332 push-parser mode.
1333
9bf32be3
JD
13342006-12-13 Bob Rossi <bob@brasko.net>
1335
1336 * data/push.c (yypstate_init): Rename to...
1337 (yypstate_new): ... this and use b4_c_function_def.
1338 (yypstate_delete): New.
1339 (yypush_parse): Change parameters yynval and yynlloc to be const.
1340 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
1341 yypstate_delete functions.
1342
f02e2948
JD
13432006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
1344
1345 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
1346 strange test case titles. Reported by Bob Rossi.
1347
38eb7751
PE
13482006-12-13 Paul Eggert <eggert@cs.ucla.edu>
1349
1350 * TODO: Add pointer to Sylvain Schmitz's work on static detection
1351 of potential ambiguities in GLR grammers.
1352
bd9d212b
JD
13532006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
1354
1355 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
1356 `bison ', use m4_index instead of m4_substr since chopping up a string
1357 containing M4-special characters causes problems here.
1358
1359 Fix a couple of bugs related to special characters in user-specified
1360 file names, and make it easier for skeletons to compute output file
1361 names with the same file name prefix as Bison-computed output file
1362 names.
1363 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
1364 b4_parser_file_name and b4_spec_defines_file instead of
1365 @output_parser_name@ and @output_header_name@, which are now redundant.
1366 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
1367 b4_parser_file_name, b4_spec_defines_file, and the new
1368 @basename(FILENAME@) instead of @output_parser_name@ and
1369 @output_header_name@, which inappropriately escaped the file names as
1370 C string literals.
1371 * src/files.c (all_but_ext): Remove static qualifier.
1372 (compute_output_file_names): Move `free (all_but_ext)' to...
1373 (output_file_names_free): ... here since all_but_ext is needed later.
1374 * src/files.h (all_but_ext): Extern.
1375 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
1376 exactly what MUSCLE_INSERT_STRING used to do.
1377 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
1378 characters are escaped properly.
1379 * src/output.c (prepare): Define muscle file_name_all_but_ext as
1380 all_but_ext.
1381 For pkgdatadir muscle, maintain previous functionality by using
1382 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
1383 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
1384 digraphs would never be expanded. Hopefully no one has M4-special
1385 characters in his Bison installation path.
1386 * src/scan-skel.l: Don't parse @output_header_name@ and
1387 @output_parser_name@ anymore since they're now redundant.
1388 In @output, use decode_at_digraphs.
1389 Parse a new @basename command that invokes last_component.
1390 (decode_at_digraphs): New.
1391 (BASE_QPUTS): Remove unused.
1392 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
1393 (Output file name): New tests.
1394
3f7ca628
JD
13952006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
1396
1397 Warn about output files that are generated by the skeletons and that
1398 conflict with other output files.
1399 * data/glr.c: Don't generate the header file here when glr.cc does.
1400 * src/files.c (file_names, file_names_count): New static globals.
1401 (compute_output_file_names): Invoke output_file_name_check for files
1402 not generated by the skeletons and remove existing checks.
1403 (output_file_name_check): New function that warns about conflicting
1404 output file names.
1405 (output_file_names_free): Free file_names.
1406 * src/files.h (output_file_name_check): Declare.
1407 * src/scan-skel.l: Invoke output_file_name_check for files generated by
1408 the skeletons.
1409 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
1410 (Conflicting output files): New tests.
1411
178e123e
PE
14122006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1413
1414 * doc/bison.texinfo: Fix a couple of typos.
1415
14162006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
1417
1418 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
1419 Rename to...
1420 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
1421 update all uses.
1422 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
1423 (yypush_parse): Rename yypvars argument to yyps and remove redundant
1424 local pv.
1425 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
1426 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
1427
ea17f233
JD
14282006-12-07 Bob Rossi <bob@brasko.net>
1429 and Joel Denny <jdenny@ces.clemson.edu>
1430
1431 * data/push.c (yypvarsinit): Change return type from void* to struct
1432 yypvars*. No longer cast to void* on return.
1433 (struct yypvars): Remove yylen since it need not be remembered between
1434 yypushparse invocations.
1435 (yypushparse): Don't copy between yylen and pv->yylen.
1436
55a30bda
JD
14372006-12-05 Bob Rossi <bob@brasko.net>
1438
1439 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
1440 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
1441 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
1442 (struct yypvars): Remove b4_declare_parser_variables.
1443 (yypvarsinit): Remove init code for removed variables.
1444 (global scope): Do not declare b4_declare_parser_variables if
1445 push or pure mode.
1446 (yypushparse): Add b4_declare_parser_variables.
1447 Init new local variables, and remove init code for removed
1448 yypvars variables.
1449 (yyparse): Delete.
1450 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
1451 and yyparse for other modes.
1452 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
1453 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
1454 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
1455 (AT_PURE_LEX_IF): True if pure or push parser.
1456
85894313
JD
14572006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
1458
1459 Document Yacc prologue alternatives and default %destructor's and
1460 %printer's as experimental. Don't mention Java yet. Discussed at
1461 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
1462 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
1463 (2.3a): Annotate this entry to say the old forms of these features were
1464 also experimental.
1465 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 1466 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
1467 of Java (we'll want this back eventually).
1468
02975b9a
JD
14692006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1470
1471 Support a file name argument to %defines. Deprecate `=' in
1472 %file-prefix, %name-prefix, and %output. Discussed at
1473 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
1474 * NEWS (2.3a+): Mention.
148d66d8 1475 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
1476 form of %defines, and remove `=' from entries for %file-prefix,
1477 %name-prefix, and %output.
1478 * src/parse-gram.y (prologue_declaration): Implement.
1479 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
1480 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
1481 all but one occurrence of %name-prefix.
1482 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
1483 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
1484 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
1485 occurrence of each of %file-prefix and %output. Add check for %defines
1486 with argument.
1487 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
1488 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
1489 Remove the `=' from %output.
1490
287b314e
JD
14912006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
1492
1493 Don't escape $ in test case titles since Autoconf 2.61 now does that
1494 correctly.
1495 * tests/actions.at (Default %printer and %destructor are not for error
1496 or $undefined): Here.
1497 (Default %printer and %destructor are not for $accept): Here.
1498 * tests/input.at (Invalid $n and @n): Here.
1499
3ebecc24
JD
15002006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
1501
1502 Rename <!> to <>. Discussed starting at
1503 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
1504 * NEWS (2.3a+): Update.
148d66d8 1505 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
1506 Update.
1507 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
1508 * src/scan-gram.l (INITIAL): Implement.
1509 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
1510 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
1511 comment.
1512 * tests/actions.at (Default tagless %printer and %destructor,
1513 Default tagged and per-type %printer and %destructor,
1514 Default %printer and %destructor are not for error or $undefined,
1515 Default %printer and %destructor are not for $accept,
1516 Default %printer and %destructor for mid-rule values): Update.
1517 * tests/input.at (Default %printer and %destructor redeclared,
1518 Unused values with default %destructor): Update.
1519
26b8a438
JD
15202006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1521
1522 Don't let %prec take a nonterminal.
1523 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
1524 token.
1525 * tests/input.at (%prec takes a token): New test checking that %prec
1526 won't take a nonterminal.
1527
07c39ae9
JD
15282006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1529
405d53b7
JD
1530 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
1531 it was double-quoted.
07c39ae9
JD
1532 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
1533 grammar is maintained with Bison's highest standards.
1534 * src/getargs.c: Fix some typos in Doxygen comments.
1535
580b8926
JD
15362006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1537
1538 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
1539 later. Reported by Paul Eggert in
1540 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
1541 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
1542 * src/scan-code.l (translate_action): Don't bother invoking
1543 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
1544 (code_scanner_free): Instead of invoking
1545 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
1546 which frees more.
1547 * src/scan-gram.l (gram_scanner_free): Likewise.
1548 * src/scan-skel.l (scan_skel): Likewise.
1549
4502eadc
JD
15502006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
1551
1552 * src/files.c (tr): Change return type to void.
1553 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
1554 has been called previously for the same key.
1555 (muscle_find): Return storage instead of value so that
1556 --enable-gcc-warnings doesn't produce warnings that the return discards
1557 const. aver that the value and storage are the same since storage
1558 could potentially be NULL when value is not.
1559 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
1560 same as 0.
1561
7746c8f6
PE
15622006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1563
1564 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
1565 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
1566 us a slightly cleaner distribution, and also works.
1567 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
1568 gnulib changes.
1569
eb095650
PE
15702006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
1571 and Paul Eggert <eggert@cs.ucla.edu>
1572
1573 Don't let Bison leak memory except when it complains.
1574 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
1575 (spec_defines_file, dir_prefix): Now char *, not const char *,
1576 since they are freed.
1577 * src/files.c: Likewise.
1578 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
1579 Likewise.
1580 (tr): Now operates in-place. All uses changed.
1581 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
1582 values.
1583 (compute_file_name_parts, compute_output_file_names): Don't store
1584 read-only data in variables that will be freed.
1585 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
1586 src_extension, and header_extension.
1587 (output_file_names_free): New public function to free
1588 spec_verbose_file, spec_graph_file, spec_defines_file,
1589 parser_file_name, and dir_prefix.
1590 * src/getargs.c (getargs): Don't store read-only data in variables that
1591 will be freed.
1592 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
1593 (which previously existed but was unused), and quotearg_free.
1594 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
1595 * src/muscle_tab.c: Likewise.
1596 (muscle_entry): Make the value char const *,
1597 and add a new storage member that is char * and can be freed.
1598 (muscle_entry_free): New private function.
1599 (muscle_init): Use it instead of free.
1600 (muscle_insert, muscle_grow): Update and use new storage member.
1601 (muscle_code_grow): Free the string passed to muscle_grow
1602 since it's not needed anymore.
1603 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
1604 add a new `char *code' member.
1605 ("{...}"): Declare semantic type as code.
1606 * src/scan-code.h (translate_rule_action):
1607 (translate_symbol_action, translate_code, translate_action): Return
1608 `char const *' rather than `char *' since external code should not free
1609 these strings.
1610 * src/scan-code.l: Likewise.
1611 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
1612 which is "{...}" in the parser.
1613 * tests/Makefile.am (maintainer-check-valgrind): Set
1614 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
1615 Valgrind.
1616 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
1617 complain.
1618 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
1619 expecting a non-zero exit status sets --leak-check=summary and
1620 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
1621 this case, and we don't want to hear about it.
1622
ac564be4
PE
16232006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1624
1625 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
1626 instead of from the template, to simplify configuration a bit.
1627 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
1628 and m4/wint_t.m4, as they are needed with the latest gnulib.
1629
17bd8a73
JD
16302006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1631
1632 Disable unset/unused mid-rule value warnings by default, and recognize
1633 --warnings=midrule-values to enable them. Discussed starting at
1634 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
1635 * NEWS (2.3a+): Mention.
1636 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
1637 warnings): Add entry for midrule-values subargument.
1638 * src/reader.c (symbol_should_be_used): Don't return true just because
1639 the value is a set/used mid-rule value unless
1640 --warnings=midrule-values was specified.
1641 * tests/input.at (Unused values, Unused values before symbol
1642 declarations): Run tests with and without --warnings=midrule-values.
1643
1644 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
1645 than LIST_FREE directly.
1646
89eb3c76
JD
16472006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1648
1649 Finish implementing --warnings=error, which should not be implied by
1650 --warnings=all (or by its synonyms -W and --warnings without
1651 subarguments).
1652 * src/complain.c (set_warning_issued): New function to report that
1653 warnings are being treated as errors and to record an error if so.
1654 Invoke...
1655 (warn_at, warn): ... here.
1656 * src/getargs.c (warnings_args, warnings_types): Reorder so that
1657 "error - warnings are errors" does not appear above "all - all of the
1658 above".
1659 (getargs): For -W and --warnings without subarguments, don't let
1660 FLAGS_ARGMATCH set warnings_error in warnings_flag.
1661 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
1662
ba7560e2
JD
16632006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1664
1665 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
1666 empty subargument list. For example: `bison --warnings= parser.y'.
1667
31283fc3
JD
16682006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1669
1670 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
1671 the parser header file so that gcc doesn't warn.
1672
12e35840
JD
16732006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1674
1675 Split the default %destructor/%printer into two kinds: <*> and <!>.
1676 Discussed starting at
1677 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
1678 * NEWS (2.3a+): Mention.
1679 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
1680 previous change today related to mid-rules.
148d66d8 1681 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 1682 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
1683 (TYPE_TAG_ANY): Add as <*>.
1684 (TYPE_TAG_NONE): Add as <!>.
1685 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
1686 for <*> and <!>.
1687 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
1688 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
1689 * src/symlist.c (symbol_list_default_new): Split into tagged and
1690 tagless versions.
1691 (symbol_list_destructor_set, symbol_list_printer_set): Split
1692 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
1693 SYMLIST_DEFAULT_TAGLESS.
1694 * src/symlist.h: Update symbol_list_default*_new prototypes.
1695 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
1696 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
1697 * src/symtab.c (default_destructor, default_destructor_location,
1698 default_printer, default_printer_location): Split each into tagged and
1699 tagless versions.
1700 (symbol_destructor_get, symbol_destructor_location_get,
1701 symbol_printer_get, symbol_printer_location_get): Implement tagged
1702 default and tagless default cases.
1703 (default_destructor_set, default_printer_set): Split each into tagged
1704 and tagless versions.
1705 * src/symtab.h: Update prototypes.
1706 * tests/actions.at (Default %printer and %destructor): Rename to...
1707 (Default tagless %printer and %destructor): ... this, and extend.
1708 (Per-type %printer and %destructor): Rename to...
1709 (Default tagged and per-type %printer and %destructor): ... this, and
1710 extend.
1711 (Default %printer and %destructor for user-defined end token): Extend.
1712 (Default %printer and %destructor are not for error or $undefined):
1713 Update.
1714 (Default %printer and %destructor are not for $accept): Update.
1715 (Default %printer and %destructor for mid-rule values): Extend.
1716 * tests/input.at (Default %printer and %destructor redeclared): Extend.
1717 (Unused values with default %destructor): Extend.
1718
f91b1629
JD
17192006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1720
1721 Don't apply the default %destructor/%printer to an unreferenced midrule
1722 value. Mentioned at
1723 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
1724 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
1725 like $@n instead of just @n so that the default %destructor/%printer
1726 logic doesn't see them as user-defined symbols.
1727 (symbol_is_dummy): Check for both forms of the name.
1728 * src/reader.c (packgram): Remove the `$' from each midrule symbol
1729 name for which the midrule value is referenced in any action.
1730 * tests/actions.at (Default %printer and %destructor for mid-rule
1731 values): New test.
1732 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
1733 for change to dummy symbol names.
1734
519d0004
JD
17352006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1736
1737 Warn about unset midrule $$ if the corresponding $n is used.
1738 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
1739 $n usage.
1740 (packgram): Before invoking grammar_rule_check on any rule, make sure
1741 all actions have already been scanned in order to set `used' flags.
1742 Otherwise, checking that a midrule's $$ is set will not always work
1743 properly because the midrule check must forward-reference the midrule's
1744 parent rule.
1745 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
1746 warning.
1747
a501eca9
JD
17482006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1749
1750 More improvements to the documentation of the prologue alternatives:
1751 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
1752 Bison manual.
1753 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
1754 some text to clarify the relative importance of the new directives and
1755 to show how these directives may be viewed as code labels.
1756
2cbe6b7f
JD
17572006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
1758
1759 Similar to the recently removed %before-header, add %code-top as the
1760 alternative to the pre-prologue. Mentioned at
1761 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
1762 Also, let the prologue alternatives appear in the grammar section.
1763 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
1764 (prologue_declaration): Move the existing prologue alternatives to...
1765 (grammar_declaration): ... here and add %code-top.
1766 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
1767
1768 Clean up and extend documentation for the prologue alternatives.
1769 * NEWS (2.3a+): Describe prologue alternatives.
1770 * doc/bison.texinfo (Prologue): Move discussion of prologue
1771 alternatives to...
1772 (Prologue Alternatives): ... this new section, and extend it to discuss
1773 all 4 directives in detail.
148d66d8
JD
1774 (Table of Symbols): Clean up discussion of prologue alternatives and
1775 add %code-top.
2cbe6b7f 1776
e557d3ea
JMG
17772006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1778
1779 DJGPP specific issues.
1780
1781 * djgpp/config.bat: config.hin has been moved to lib. Adjust
1782 config.bat accordingly.
1783 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
1784 * djgpp/config.site: Likewise.
1785
136a0f76
PB
17862006-10-16 Paolo Bonzini <bonzini@gnu.org>
1787
27bd5d67
PB
1788 Replace %*-header with %provides, %requires, %code. See discussion at
1789 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
1790
136a0f76
PB
1791 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
1792 (b4_user_start_header): Remove.
1793 * data/glr.c: Use new macros instead of b4_*start_header
1794 and b4_*end_header.
1795 * data/glr.cc: Likewise.
1796 * data/lalr1.cc: Likewise.
1797 * data/push.c: Likewise.
1798 * data/yacc.c: Likewise.
1799
1800 * doc/bison.texinfo: Remove %before-header, rename
1801 %{start,end,after}-header to %requires, %provides, %code.
1802
1803 * src/parse-gram.y: Likewise (also rename token names accordingly).
1804 * src/scan-gram.l: Likewise.
1805 * tests/actions.at: Likewise.
1806
10f429ef
PE
18072006-10-14 Paul Eggert <eggert@cs.ucla.edu>
1808
1809 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
1810 Problem reported by Joel E. Denny.
1811
18122006-10-14 Jim Meyering <jim@meyering.net>
1813
1814 (Sync from coreutils.)
1815 Work also when the working directory (with e.g. coreutils sources)
1816 is version controlled with git, rather than CVS.
1817 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
1818 rather than CVS.
1819 In messages and comments, say e.g., "checked-out sources",
1820 rather than "CVS sources".
1821 (version_controlled_file): New function. Work for git as well as
1822 for CVS. Don't use grep's -q option.
1823 (slurp): Call it here, in place of CVS-specific code.
1824
c4bd5bf7
JD
18252006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
1826
1827 Fix testsuite for ./configure --enable-gcc-warnings:
1828 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
1829 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
1830 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
1831 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
1832 * test/regression.at (Diagnostic that expects two alternatives):
1833 Likewise.
1834
46356ea4
PE
18352006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1836
231ed89a
PE
1837 * bootstrap.conf (gnulib_modules): Add config-h.
1838 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
1839 worry about HAVE_CONFIG_H.
1840 * lib/abitset.c: Likewise.
1841 * lib/bitset.c: Likewise.
1842 * lib/bitset_stats.c: Likewise.
1843 * lib/bitsetv-print.c: Likewise.
1844 * lib/bitsetv.c: Likewise.
1845 * lib/ebitset.c: Likewise.
1846 * lib/get-errno.c: Likewise.
1847 * lib/lbitset.c: Likewise.
1848 * lib/subpipe.c: Likewise.
1849 * lib/timevar.c: Likewise.
1850 * lib/vbitset.c: Likewise.
1851 * lib/bitset.c: Include "bitset.h" first, to test interface.
1852 * lib/bitset_stats.c: Include "bitset_stats.h" first.
1853 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
1854 * lib/bitsetv.c: Include "bitsetv.h" first.
1855 * lib/get-errno.c: Include "get-errno.h" first.
1856 * m4/.cvsignore: Add config-h.m4.
1857 * tests/actions.at (Default %printer and %destructor for ...):
1858 Adjust expected line numbers in output to reflect removal of #if
1859 HAVE_CONFIG_H lines.
1860 * tests/glr-regression.at (Missed %merge type warnings when ...):
1861 Likewise.
1862 * tests/regression.at (Braced code in declaration in rules section):
1863 Likewise.
1864 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
1865 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
1866 Include <config.h> unconditionally.
1867
46356ea4
PE
1868 * bootstrap: Sync from coreutils, as follows:
1869
1870 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1871
1872 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
1873 variable was sometimes used without being initialized. This
1874 messed up the installation of the INSTALL file in some cases.
1875
1876 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1877
1878 * bootstrap (usage, main program, symlink_to_gnulib): Add option
1879 --copy. Inspired by a suggestion from Bruno Haible.
1880
1881 2006-10-03 Jim Meyering <jim@meyering.net>
1882
1883 * bootstrap: Undo last change to this file, since now gnulib-tool
1884 sticks with the automake default in generating dependencies.
1885
dd4bf078
PE
18862006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1887
cf2a5f7c
PE
1888 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
1889 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
1890
1891 * doc/bison.1: Add copyright notice.
1892
1893 * data/glr.c: Don't include <stdarg.h>; not used.
1894
35fe0834
PE
1895 * NEWS: The -g and --graph options now output graphs in Graphviz
1896 DOT format, not VCG format.
1897 * doc/bison.1: Likewise.
1898 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
1899 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
1900 of this change in
1901 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
1902 * TODO: Remove Graphviz entry.
1903 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
1904 remove vcg.c, vcg.h, vcg_defaults.h.
1905 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
1906 * src/graphviz.c, src/graphviz.h: New files.
1907 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
1908 * src/files.h: Make comment more generic.
1909 * src/main.c (main): Likewise.
1910 * src/print_graph.h: Likewise.
1911 * src/getargs.c (usage): Make usage description more generic.
1912 * src/print_graph.c: Include graphviz.h rather than vcg.h.
1913 (static_graph, fgraph): Remove. All uses changed to pass
1914 arguments instead of sharing a static var.
1915 (print_core, print_actions, print_state, print_graph):
1916 Output graphviz format rather than VCG format.
1917 * tests/.cvsignore: Remove *.vcg; add *.dot.
1918 * tests/output.at: Expect *.dot files, not *.vcg files.
1919
dd4bf078
PE
1920 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
1921 accommodates the 2006-10-08 change.
1922
efdd7421
PE
19232006-10-11 Bob Rossi <bob@brasko.net>
1924
1925 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
1926 (b4_yyssa, b4_yyerror_range): New macros.
1927 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
1928 (yypvarsinit): Remove init of removed fields.
1929 (yypushparse): Remove use of removed fields; use new macros instead.
1930
96a1981a
PE
19312006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1932
1933 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
1934 in a push parser. Reindent slightly to match yacc.c better.
1935
19362006-10-11 Bob Rossi <bob@brasko.net>
1937
46356ea4
PE
1938 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
1939 yymsg_alloc fields.
1940 (yypvarsinit, yypushparse): Remove init of removed fields.
1941 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 1942
c1630a8b
PE
19432006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1944
1945 * THANKS: Add Paolo Bonzini and Bob Rossi.
1946
90b9908d
PB
19472006-10-08 Paolo Bonzini <bonzini@gnu.org>
1948
1949 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
1950 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
1951 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
1952 b4_define_user_cde and uses): Remove.
1953 (b4_comment, b4_prefix, b4_sync_start): New.
1954 * data/bison.m4: New file, with most of the content removed from c.m4.
1955 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
1956 * src/output.c (output_skeleton): Pass bison.m4.
1957 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
1958 only if specified.
1959
cf806753
PE
19602006-10-05 Paul Eggert <eggert@cs.ucla.edu>
1961
1962 Fix test failure reported by Tom Lane in
1963 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
1964 and try to make such failures easier to catch in the future.
1965 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
1966 that's now the caller's responsibility.
1967 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
1968 Set yychar = YYEOF if it's negative.
1969 * tests/actions.at (yylex): Abort if asked to read past EOF.
1970 * tests/conflicts.at (yylex): Likewise.
1971 * tests/cxx-type.at (yylex): Likewise.
1972 * tests/glr-regression.at (yylex): Likewise.
1973 * tests/input.at (yylex): Likewise.
1974 * tests/regression.at (yylex): Likewise.
1975 * tests/torture.at (yylex): Likewise.
1976
0e2f006a
PE
19772006-10-01 Paul Eggert <eggert@cs.ucla.edu>
1978
1979 Fix problems with translating English-language diagnostics.
1980 * bootstrap: Fix bug introduced in recent bootstrap changes, with
1981 respect to bison-runtime pot generation. The YY_ stuff
1982 wasn't being captured.
1983 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
1984 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
1985 * runtime-po/POTFILES.in: Add data/push.c.
1986
e3ddc1e3
PE
19872006-09-29 Paul Eggert <eggert@cs.ucla.edu>
1988
1989 Merge bootstrap changes from coreutils.
1990
1991 2006-09-28 Jim Meyering <jim@meyering.net>
1992
1993 Automatically generated dependencies are important even
1994 when all of the sources in a directory come from gnulib.
1995 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
1996 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
1997
1998 2006-09-23 Jim Meyering <jim@meyering.net>
1999
2000 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
2001
2002 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2003
2004 * bootstrap: Add support for --force.
2005 (usage): New function. Describe usage less tersely.
2006 (CVS_only_file): New var.
2007
01e972b3
PE
20082006-09-21 Paul Eggert <eggert@cs.ucla.edu>
2009
2010 * data/push.c (YYPUSH_MORE): Make it an enum instead.
2011 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
2012 Adjust white space and comments to match GNU style better.
2013
c63d3e90
PE
20142006-09-20 Bob Rossi <bob@brasko.net>
2015
2016 * data/push.c (yyresult_get): Remove function.
2017 (YYPUSH_MORE): Add #define.
2018 (yypushparse): Modify return value.
2019
e70f46d1
PE
20202006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2021
2022 * stamp-h.in: Remove; no longer needed.
2023 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
2024 Remove config.h, config.hin, intl (no longer created).
2025 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
2026 stamp-h1.
2027
2028 Sync bootstrap from coreutils, as follows:
2029
2030 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
2031
2032 * bootstrap (symlink_to_gnulib): New function.
2033 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
2034 to copies-of-gnulib.
2035 (cp_mark_as_generated, slurp, gnulib_files):
2036 Avoid making a copy if it's the same as the old version.
2037 (gnulib_files): Add support for this variable (used by Bison).
2038
a92be413
PE
20392006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2040
2041 * src/getargs.c (usage): Rework to use conventions similar to
2042 coreutils, to make translation a bit easier and the code a bit
2043 smaller. Problem reported by Tim Van Holder.
2044
4f82b42a
PE
20452006-09-15 Paul Eggert <eggert@cs.ucla.edu>
2046
3b2942e6
PE
2047 Use some of gnulib's new modules, taken from coreutils.
2048
2049 * bootstrap: Sync from coreutils, except add support for gnulib_files.
2050 * bootstrap.conf: New file.
2051 (gnulib_modules): Add configmake, inttypes, unistd.
2052 (XGETTEXT_OPTIONS): Add complain, complain_at,
2053 fatal, fatal_at, warn, warn_at, unexpected_end.
2054 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
2055 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
2056 (gl_EARLY): Add.
2057 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
2058 (gl_INIT): Add
2059 (GNULIB_AUTOCONF_SNIPPET): Remove.
2060 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
2061 the pickiest.
2062 * lib/.cvsignore: Add inttypes_.h.
2063 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
2064 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
2065 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
2066 no-longer-necessary initializations.
2067 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
2068 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
2069 use the unistd module.
2070 * src/system.h: Likewise.
2071 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
2072 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
2073 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
2074 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
2075 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
2076 * src/system.h: Include inttypes.h unconditionally, now that we
2077 use the inttypes module. Don't bother to include stdint.h, since
2078 inttypes.h now does that for us.
2079 (LOCALEDIR): Remove, now that we use the configmake module.
2080 * src/getargs.c: Include configmake.h.
2081 * src/main.c: Likewise.
2082 * src/output.c: Likewise.
2083 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
2084 not from $abs_top_builddir, since config.h moved.
2085
2086
4f82b42a
PE
2087 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
2088 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
2089
2090 * src/parse-gram.y (symbol_declaration): Don't put statements
2091 before declarations; it's not portable to C89.
2092 * src/scan-code.l (handle_action_at): Likewise.
2093
2094 * src/scan-code.l: Always initialize braces_level; the old code
2095 left it uninitialized and therefore had undefined behavior.
2096
2097 Don't attempt to redefine 'assert', since it runs afoul of
2098 systems where standard headers (mistakenly) include <assert.h>.
2099 Instead, define and use our own alternative, called 'aver'.
2100 * src/reader.c: Don't include assert.h, since we no longer
2101 use assert.
2102 * src/scan-code.l: Likewise.
2103 * src/system.h (assert): Remove, replacing with....
2104 (aver): New function, taking a bool arg. All uses changed.
2105 * src/tables.c (pack_vector): Ensure that aver arg is bool,
2106 not merely an integer.
2107
31c10e38
PE
21082006-09-15 Bob Rossi <bob@brasko.net>
2109
2110 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
2111 * data/c.m4 (YYPUSH): New.
2112 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
2113 * src/getargs.c (push_parser): New var.
2114 * src/getargs.h (push_parser): New declaration.
2115 * src/output.c (prepare): Add macro insertion of `push_flag'.
2116 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
2117 (prologue_declaration): Parse %push-parser.
2118 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
2119 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
2120 list of removed lines from the traces observed.
2121 (AT_CHECK_CALC_LALR): Added push parser tests.
2122
fa7b79c0
PE
21232006-09-13 Paul Eggert <eggert@cs.ucla.edu>
2124
21fe08ca
PE
2125 * NEWS: Version 2.3a.
2126 * configure.ac (AC_INIT): Likewise.
2127
e8ec4d9b
PE
2128 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
2129 "#define YYSTYPE int" that caused "make maintainer-check" to fail
2130 due to header ordering dependencies. I don't know why the #define
2131 was there.
2132
fa7b79c0
PE
2133 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
2134 runtime cost when YYDEBUG is not defined, and so that some tests
2135 that used to fail now work. Problem and initial suggestion by
2136 Paolo Bonzini.
2137 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
2138 * data/glr.cc (b4_parser_class_name):
2139 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
2140 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
2141 (yydebug_) [YYDEBUG]: New member.
2142 (yycdebug_): Now defined only if YYDEBUG.
2143 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
2144 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
2145 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
2146 if YYYDEBUG.
2147 (debug_stream, set_debug_stream, debug_level, set_debug_level):
2148 Define only if YYDEBUG.
2149 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
2150 set_debug_level.
2151 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
2152 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
2153 AT_CHECK_CALC_GLR_CC that are working now.
2154
4ec13d60
PE
21552006-09-12 Paul Eggert <eggert@cs.ucla.edu>
2156
2157 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
2158 We don't need them in glr.cc, and glr.c defines them.
2159 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
2160 assumes that defining it to anything is the same as defining
2161 it to 1. Problem reported by Paolo Bonzini.
2162
8e1687ae
PE
21632006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2164
2165 * data/c.m4 (b4_null, b4_case): Define.
2166 * src/output.c (prepare_symbols): Use b4_null.
2167 (user_actions_output): Use b4_case.
2168
3dc5e96b
PE
21692006-09-11 Paul Eggert <eggert@cs.ucla.edu>
2170
aef3da86
PE
2171 * data/glr.c (b4_shared_declarations): Put start-header first,
2172 before any #includes that we generate, so that feature-test
2173 macros work. Problem reported by Michael Deutschmann in
2174 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
2175 * data/lalr1.cc: Likewise.
2176 * doc/bison.texinfo (Prologue): Document that feature-test macros
2177 should be defined before any Bison declarations.
2178 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
2179 that depend on location.hh after, not before, Bison decls, since
2180 we now include location.hh after the first user prologue.
2181
3dc5e96b
PE
2182 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
2183 Sander Brandenburg in
2184 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
2185 Also, fix minor white space and comment issues.
aef3da86
PE
2186 (Prologue): Mention that it's better to define feature-test macros
2187 before Bison declarations. Problem reported by Michael Deutschmann.
2188
2189 * README-cvs: Fix typo: "&" should be "&&". Problem reported
2190 by Jim Meyering.
2191 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
2192 This adjusts to recent gnulib changes.
3dc5e96b 2193
b2a0b7ca
JD
21942006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2195
2196 Finish implementation of per-type %destructor/%printer. Discussed
2197 starting at
2198 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
2199 and
2200 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
2201 * NEWS (2.3+): Add a description of this feature to the default
2202 %destructor/%printer description.
2203 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
2204 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2205 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
2206 list node contains a semantic type.
2207 * src/symtab.c, src/symtab.h: Extend with a table that associates
2208 semantic types with their %destructor's and %printer's.
2209 (semantic_type_from_uniqstr, semantic_type_get,
2210 semantic_type_destructor_set, semantic_type_printer_set): New functions
2211 composing the public interface of that table.
2212 (symbol_destructor_get, symbol_destructor_location_get,
2213 symbol_printer_get, symbol_printer_location_get): If there's no
2214 per-symbol %destructor/%printer, look up the per-type before trying
2215 the default.
2216 * tests/actions.at (Per-type %printer and %destructor): New test case.
2217 * tests/input.at (Default %printer and %destructor redeclared):
2218 Extend to check that multiple occurrences of %symbol-default in a
2219 single %destructor/%printer declaration is an error.
2220 (Per-type %printer and %destructor redeclared, Unused values with
2221 per-type %destructor): New test cases.
2222
3be03b13
JD
22232006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2224
2225 Require default %destructor/%printer to be declared using
2226 %symbol-default instead of an empty symbol list, and start working on
2227 new per-type %destructor/%printer. Discussed at
2228 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
2229 * NEWS (2.3+): Add %symbol-default to example.
2230 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 2231 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
2232 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
2233 (generic_symlist, generic_symlist_item): New nonterminals for creating
2234 a list in which each item is a symbol, semantic type, or
2235 %symbol-default.
2236 (grammar_declaration): Use generic_symlist in %destructor and %printer
2237 declarations instead of symbols.1 or an empty list.
2238 (symbol_declaration, precedence_declaration, symbols.1): Update actions
2239 for changes to symbol_list.
2240 * src/reader.c: Update for changes to symbol_list.
2241 * src/scan-code.l: Likewise.
2242 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
2243 * src/symlist.c, src/symlist.h: Extend such that a list node may
2244 represent a semantic type or a %symbol-default in addition to just an
2245 ordinary symbol. Add switched functions for setting %destructor's and
2246 %printer's.
2247 * tests/actions.at, tests/input.at: Add %symbol-default to all default
2248 %destructor/%printer declarations.
2249
3508ce36
JD
22502006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
2251
2252 Whether the default %destructor/%printer applies to a particular symbol
2253 isn't a question of whether the user *declares* that symbol (in %token,
2254 for example). It's a question of whether the user by any means
2255 *defines* the symbol at all (by simply using a char token, for
2256 example). $end is defined by Bison whereas any other token with token
2257 number 0 is defined by the user. The error token is always defined by
2258 Bison regardless of whether the user declares it with %token, but we
2259 may one day let the user define error as a nonterminal instead.
2260 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
2261 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
2262 the meaning of "user-defined".
2263 * tests/actions.at (Default %printer and %destructor for user-declared
2264 end token): Rename to...
2265 (Default %printer and %destructor for user-defined end token): ...
2266 this.
2267
2268 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
2269 computation of whether to apply the default, don't maintain a list of
2270 every Bison-defined symbol. Instead, just check for a first character
2271 of '$', which a user symbol cannot have, and check for the error token.
2272
9350499c
JD
22732006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
2274
2275 Don't apply the default %destructor or %printer to the error token,
2276 $undefined, or $accept. This change fits the general rule that the
2277 default %destructor and %printer are only for user-declared symbols,
2278 and it solves several difficulties that are described in the new test
2279 cases listed below.
2280 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
2281 * tests/actions.at (Default %printer and %destructor are not for error
2282 or $undefined, Default %printer and %destructor are not for $accept):
2283 New test cases.
2284
4d7370cb
JD
22852006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
2286
2287 Allow %start after the first rule.
2288 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
2289 when parsing the first rule.
2290 (check_and_convert_grammar): Search for it here after all grammar
2291 declarations have been parsed. Skip midrules, which have dummy LHS
2292 nonterminals.
2293 * src/symtab.c (symbol_is_dummy): New function.
2294 * src/symtab.h (symbol_is_dummy): Declare it.
2295 * tests/input.at (%start after first rule): New test.
2296
6d0ef4ec
JD
22972006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2298
2299 Redo some of the previous commit: add back the ability to use
2300 non-aliased/undeclared string literals since it might be useful to
2301 those declaring %token-table.
2302 * src/reader.c (check_and_convert_grammar): Undo changes in previous
2303 commit: don't worry about complaints from symbols_pack.
2304 * src/symtab.c (symbol_new, symbol_class_set,
2305 symbol_check_alias_consistency): Undo changes in previous commit: count
2306 each string literal as a new symbol and token, assign it a symbol
2307 number, and don't complain about non-aliased string literals.
2308 (symbols_pack): Since symbol_make_alias still does not decrement symbol
2309 and token counts but does still set aliased tokens to the same number,
2310 symbol_pack_processor now leaves empty slots in the symbols array.
2311 Remove those slots.
2312 * tests/regression.at (Undeclared string literal): Remove test case
2313 added in previous commit since non-aliased string literals are allowed
2314 again.
2315 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
2316 remove unnecessary string literal declarations.
2317 * tests/sets.at (Firsts): Likewise.
2318
965537bc
JD
23192006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2320
2321 Don't allow an undeclared string literal, but allow a string literal to
2322 be used before its declaration.
2323 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
2324 symbols_pack complained.
2325 * src/symtab.c (symbol_new): Don't count a string literal as a new
2326 symbol.
2327 (symbol_class_set): Don't count a string literal as a new token, and
2328 don't assign it a symbol number since symbol_make_alias does that.
2329 (symbol_make_alias): It's not necessary to decrement the symbol and
2330 token counts anymore. Don't assume that an alias declaration occurs
2331 before any uses of the identifier or string, and thus don't assert that
2332 one of them has the highest symbol number so far.
2333 (symbol_check_alias_consistency): Complain if there's a string literal
2334 that wasn't declared as an alias.
2335 (symbols_pack): Bail if symbol_check_alias_consistency failed since
2336 symbol_pack asserts that every token has been assigned a symbol number
2337 although undeclared string literals have not.
2338 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 2339 string literal): New test cases.
965537bc
JD
2340 (Characters Escapes, Web2c Actions): Declare string literals as
2341 aliases.
2342 * tests/sets.at (Firsts): Likewise.
2343
47aee066
JD
23442006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
2345
2346 In the grammar scanner, STRING_FINISH unclosed constructs and return
2347 them to the parser in order to improve error messages.
2348 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
2349 SC_BRACED_CODE, SC_PROLOGUE): Implement.
2350 * tests/input.at (Unclosed constructs): New test case.
2351 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
2352 seen.
2353
2354 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
2355 unused global.
2356
1f6b3679
JD
23572006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
2358
2359 Handle string aliases for character tokens correctly.
2360 * src/symtab.c (symbol_user_token_number_set): If the token has an
2361 alias, check and set its alias's user token number instead of its own,
2362 which is set to indicate the alias. Previously, every occurrence of
2363 the character token in the grammar overwrote that alias indicator with
2364 the character code.
2365 * tests/input.at (String aliases for character tokens): New test.
2366
219741d8
JD
23672006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
2368
2369 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
2370
11daa4e7
PE
23712006-08-11 Paul Eggert <eggert@cs.ucla.edu>
2372
2373 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
2374 to prevent failures when building on older platforms.
2375 Check for autopoint failure.
2376 Set XGETTEXT_OPTIONS to values that check for C format strings,
2377 so that translators are warned about them (this also helps
2378 prevent core dumps).
2379
2380 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
2381 function, since it simplifies our code a bit.
2382
2383 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
2384 rather than -W, so we don't get bogus warnings about sign comparisons.
2385 Add -Wpointer-arith, since that warning is useful (it reports code
2386 that does not conform to C89 and that some compilers reject).
2387 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
2388 since it's no longer needed.
2389
f9bfc42a
JD
23902006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
2391
2392 Clean up scanners a bit.
2393 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
2394 definitions so gcc won't warn when obstack_for_string is unused.
2395 * src/scan-code.l: config.h and system.h are already #include'd by
2396 scan-code-c.c, so get rid of them here.
2397 * src/scan-gram.l: Likewise.
2398 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
2399 definitions rather than duplicating the rest of it.
2400 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
2401
06e8700a
JD
24022006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
2403
2404 Suppress signed/unsigned comparison warnings for yycheck.
2405 * data/c.m4 (b4_safest_int_type): New macro.
2406 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
2407 a signed int type, cast it to b4_safest_int_type first.
2408 * data/yacc.c: Likewise.
2409 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
2410 also overwritten.
2411
9c437126
PE
24122006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2413
2414 * doc/bison.texinfo: Fix some typos.
2415
284d8a13
PE
24162006-08-02 Paul Eggert <eggert@cs.ucla.edu>
2417
2418 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
2419 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
2420
2421 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
2422 the latest gnulib does this a different way.
2423 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
2424 translation was patched, so stop omitting it.
2425
ec5479ce
JD
24262006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2427
2428 Enable declaration of default %printer/%destructor. Make the parser
2429 use these for all user-declared grammar symbols for which the user does
2430 not declare a specific %printer/%destructor. Thus, the parser uses it
2431 for token 0 if the user declares it but not if Bison generates it as
2432 $end. Discussed starting at
2433 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
2434 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
2435 and
2436 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
2437 * NEWS (2.3+): Mention.
2438 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
2439 declare a %destructor for a mid-rule's semantic value. It's just
2440 impossible to declare one specific to it.
2441 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
2442 code. Describe default %destructor form.
2443 * src/parse-gram.y (grammar_declaration): Parse default
2444 %printer/%destructor declarations.
2445 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
2446 and symbol_destructor_location_get rather than accessing the destructor
2447 and destructor_location members of struct symbol.
2448 (symbol_printers_output): Likewise but for %printer's.
2449 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
2450 again.
2451 * src/symtab.c (default_destructor, default_destructor_location,
2452 default_printer, default_printer_location): New static global
2453 variables to record the default %destructor and %printer.
2454 (symbol_destructor_get, symbol_destructor_location_get,
2455 symbol_printer_get, symbol_printer_location_get): New functions to
2456 compute the appropriate %destructor and %printer for a symbol.
2457 (default_destructor_set, default_printer_set): New functions to set the
2458 default %destructor and %printer.
2459 * src/symtab.h: Prototype all those new functions.
2460 * tests/actions.at (Default %printer and %destructor): New test to
2461 check that the right %printer and %destructor are called, that they're
2462 not called for $end, and that $$ and @$ work correctly.
2463 (Default %printer and %destructor for user-declared end token): New
2464 test to check that the default %printer and %destructor are called for
2465 a user-declared end token.
2466 * tests/input.at (Default %printer and %destructor redeclared, Unused
2467 values with default %destructor): New tests to check related grammar
2468 warnings and errors.
2469
868d2d96
JD
24702006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2471
2472 Clean up handling of %destructor for the end token (token 0).
2473 Discussed starting at
2474 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
2475 and
2476 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
2477
2478 Make the skeletons consistent in how they pop the end token and invoke
2479 its %destructor.
2480 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
2481 state, which has token number 0, since this would invoke the
2482 %destructor for the end token.
2483 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
2484 until after shifting the end token, or else it won't be popped.
2485 * data/yacc.c (yyparse): Likewise.
2486
2487 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
2488 it's the end token. Upon termination, destroy an unshifted lookahead
2489 even when it's the end token.
2490 * data/lalr1.cc (yy::parser::parse): Likewise.
2491 * data/yacc.c (yyparse): Likewise.
2492
2493 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
2494 value warnings for the end token when the user gives the end token a
2495 %destructor.
2496
2497 * tests/actions.at (Printers and Destructors): Test all the above.
2498
62a9592d
PE
24992006-07-24 Paul Eggert <eggert@cs.ucla.edu>
2500
2501 Update to latest gnulib and gettext versions.
2502 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
2503 Add fopen-safer.
2504 (gnulib_files): Add m4/warning.m4. Don't worry about files
2505 overwritten by autopoint.
2506 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
2507 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
2508 rejects them.
2509 Don't use autoreconf; instead, invoke autopoint etc. by hand,
2510 so that we can remove the intl files at a better time.
2511 (intl_files_to_remove): Remove aclocal.m4, since it gets
2512 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
2513 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
2514 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
2515 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
2516 Remove datarootdir hack; no longer needed.
2517 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
2518 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
2519 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
2520 strdup.h.
2521 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
2522 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
2523
10d6970f
PE
25242006-07-20 Paul Eggert <eggert@cs.ucla.edu>
2525
2526 * bootstrap: Adjust to today's change to gnulib-tool by invoking
2527 it with --assume-autoconf='latest-stable'.
2528
50a33993
JD
25292006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
2530
2531 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
2532 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
2533 YYSTYPE' and `{'.
2534 * src/muscle_tab.h (muscle_grow): Replace the header comments with
2535 those from muscle_tab.c since the old ones are misleading.
2536
2ce4ed68
AD
25372006-07-13 Akim Demaille <akim@epita.fr>
2538
2539 Support %define "KEY" {VALUE}.
2540 * src/scan-code.h, src/scan-code.l (translate_action)
2541 (translate_rule_action, translate_symbol_action, translate_code):
2542 Return char *, not const char *.
2543 * src/parse-gram.y (declaration): Rename as...
2544 (prologue_declaration): this.
2545 (string_content): Remove this nonterminal, use STRING.
2546 (braceless, content, content.opt): New nonterminal.
2547 Use them.
2548 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
2549 as value.
2550 * src/scan-gram.l (getargs.h): Don't include it.
2551
db7e5eb5
PE
25522006-07-12 Paul Eggert <eggert@cs.ucla.edu>
2553
2554 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
2555 rather than a for-loop that declares a local bool variable. This
2556 should work around a compatibility problem with a Cray x1e C++
2557 compiler reported by Hung Nguyen in
2558 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
2559 The for-loop was introduced in the 2004-11-17 change but I don't
2560 know why it was needed.
2561
a5d80ba5
AD
25622006-07-12 Akim Demaille <akim@epita.fr>
2563
2564 * data/c.m4: Comment changes.
2565
23eb2a69
AD
25662006-07-10 Akim Demaille <akim@lrde.epita.fr>
2567
2568 * src/complain.c (error_message, ERROR_MESSAGE): New.
2569 To factor...
2570 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
2571 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
2572
ddc8ede1
PE
25732006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2574
2575 * NEWS: Instead of %union, you can define and use your own union type
2576 YYSTYPE if your grammar contains at least one <type> tag.
2577 Your YYSTYPE need not be a macro; it can be a typedef.
2578 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
2579 (Union Decl, Decl Summary): Document this.
2580 * data/glr.c (YYSTYPE): Implement this.
2581 * data/glr.cc (YYSTYPE): Likewise.
2582 * data/lalr1.cc (YYSTYPE): Likewise.
2583 * data/yacc.c (YYSTYPE): Likewise.
2584 * src/output.c (prepare): Output tag_seen_flag.
2585 * src/parse-gram.y (declaration, grammar_declaration):
2586 Use 'union_seen' rather than 'typed' to determine whether
2587 %union has been seen, since grammars can now be typed without
2588 %union.
2589 (symbol_declaration, type.opt, symbol_def):
2590 Keep track of whether a tag has been seen.
2591 * src/reader.c (union_seen, tag_seen): New vars.
2592 (typed): remove.
2593 * src/reader.h (union_seen, tag_seen, typed): Likewise.
2594 * src/scan-code.l (untyped_var_seen): New variable.
2595 (handle_action_dollar): Adjust to above changes.
2596 (handle_action_dollar, handle_action_at):
2597 Improve overflow checking for outlandish numbers.
2598 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
2599 avoid new diagnostics generated by above changes.
2600 * tests/regression.at (YYSTYPE typedef): Add test to check
2601 for type tags without %union.
2602
2603 * src/symlist.c (symbol_list_length): Return int, not unsigned
2604 int, since callers expect int. This may need to get revisited
2605 once we have proper integer overflow checking.
2606
2607 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
2608 object is now static.
2609
2610 * src/getargs.c (flags_argmatch): Return void, not int,
2611 to pacify ./configure --enable-gcc-warnings.
2612
2613 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
2614 since last_string is already defined to FLEX_PREFIX (last_string).
2615
7b42569e
AD
26162006-07-09 Akim Demaille <akim@lrde.epita.fr>
2617
2618 Implement --warnings/-W.
2619 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
2620 replaced by...
2621 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
2622 Adjust callers.
2623 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
2624 (warnings_args, warnings_types): New.
2625 (getargs, short_options, long_options): Accept -W/--warnings.
2626 Sort the options by alphabetical order, upper case letter right
2627 before its lower case.
2628
3b452f4e
JD
26292006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2630
2631 Change %merge result type clash warnings to errors. Discussed at
2632 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
2633 * src/reader.c (record_merge_function_type): Use complain_at.
2634 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2635 declared later): Update test case results.
2636
b8a41559
AD
26372006-07-09 Akim Demaille <akim@lrde.epita.fr>
2638
2639 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
2640 to be in alphabetical order.
2641 (trace_args): Spelling fixes.
2642
cd9e1ba2
PE
26432006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2644
2645 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
2646 so they don't collide with user-defined macros.
2647 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
2648 this was never guaranteed, and now that we're using gnulib stdint,
2649 which defines int_fast16_t to long int, the problem is exposed.
2650
cb48f191
PE
26512006-07-08 Paul Eggert <eggert@cs.ucla.edu>
2652
b8445a15
PE
2653 * data/c.m4 (b4_basename): Simplify a bit, since we don't
2654 need the full POSIX semantics (and weren't implementing them
2655 anyway).
2656
cb48f191
PE
2657 Adjust to Autoconf 2.60 and today's gnulib.
2658 * bootstrap (gnulib_modules): Add stdint.
2659 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
2660 no longer copies it.
2661 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
2662 since stdint needs the former and wcwidth (which is now required
2663 by mbswidth) needs the latter.
2664 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
2665 work around a compatibility glitch between gettext 0.14.6 and
2666 Autoconf 2.60.
2667 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
2668 Do not check for uintptr_t, since new stdint module does the right
2669 thing.
2670 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
2671 Add stdint.h, stdint_.h, wcwidth.h.
2672 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
2673 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
2674 stdint.m4, wchar_t.m4, wcwidth.m4.
2675 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
2676 usual order for ../lib/*.h files.
2677 (file_name_split): Use last_component, not base_name, to adjust
2678 to gnulib changes.
2679 * src/parse-gram.h: Include <strverscmp.h> in the usual order
2680 for ../lib/*.h files.
2681 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
2682 Define unconditionally, since we now assume the stdint module.
2683 * src/scan-skel.l: Include <dirname.h>.
2684 (BASE_QPUTS): Use last_component, not base_name.
2685 * src/system.h: Include <unlocked-io.h> in the usual order
2686 for ../lib/*.h files. Include <stdint.h> unconditionally,
2687 since we now use the stdint module.
2688 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
2689 HAVE_UINTPTR_T, since we now use the stdint module.
2690 (base_name): Remove decl, since files now include <dirname.h>
2691 to get the decl.
2692
cd48d21d
AD
26932006-07-08 Akim Demaille <akim@lrde.epita.fr>
2694
2695 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
2696 New, default to 1.
2697 * data/yacc.c, data/glr.c, data/location.cc: Use them.
2698 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
2699 default.
2700 * tests/calc.at: Adjust.
2701
8ec0a172
AD
27022006-07-08 Akim Demaille <akim@lrde.epita.fr>
2703
b8445a15 2704 * data/c.m4 (b4_basename): New.
8ec0a172
AD
2705 (b4_syncline): Also output the location of its invocation (from
2706 the skeleton).
2707 (b4_user_action, b4_define_user_action, b4_user_actions)
2708 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
2709 (b4_user_stype): New.
2710 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
2711
4a678af8
JD
27122006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2713
2714 In the grammar file, the first column is 1 not 0 on the first line as
2715 on every other line.
2716 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
2717 * tests/input.at (Torturing the Scanner): Update output.
2718
2719 * src/scan-gram.l (scanner_cursor): Declare it static.
2720
dd60572a
JD
27212006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2722
2723 In warnings, say "previous declaration" rather than "first
2724 declaration".
2725 * src/symtab.c (redeclaration): Do that here.
2726 * src/reader.c (record_merge_function_type): In the case of a result
2727 type clash, report the previous declaration rather than the very first
2728 one in the grammar file.
2729 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2730 declared later): Add a third declaration to check this behavior.
2731 * tests/input.at (Incompatible Aliases): Update output.
2732
2073e1b6
AD
27332006-06-27 Akim Demaille <akim@epita.fr>
2734
2735 * doc/Doxyfile.in: New.
2736 * doc/Makefile.am: Use it.
2737 * src/lalr.h, src/symtab.h: Initial doxygenation.
2738
8ee5b538
JD
27392006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2740
2741 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
2742 declared after the %merge. This continues the effort of the previous
2743 patch.
8ee5b538
JD
2744 * src/reader.c (get_merge_function): Don't set the merger type yet.
2745 (record_merge_function_type): New function for setting the merger type
2746 and checking for clashes.
2747 (grammar_current_rule_merge_set): Set the location of the %merge for
2748 the current rule.
2749 (packgram): Invoke record_merge_function_type for each rule now that
2750 all symbol type declarations have been parsed.
2751 * src/reader.h (merger_list.type_declaration_location): New member
2752 storing the location of the first %merge from which the type for this
2753 merging function was derived.
2754 * src/symlist.h (symbol_list.merger_declaration_location): New member
2755 storing the location of a rule's %merge, if any.
2756 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2757 declared later): New test to catch the error fixed by the above patch.
2758
ffa4ba3a
JD
27592006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2760
2761 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
2762 declarations appear after the rules. Discussed at
2763 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
2764 and
2765 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
2766 Don't mistake the type of $$ in a midrule to be that of its parent
2767 rule's $$.
ffa4ba3a
JD
2768 * src/reader.c (grammar_current_rule_end): Don't invoke
2769 grammar_rule_check yet since not all symbol declarations may have been
2770 parsed yet.
2771 (grammar_midrule_action): Likewise.
2772 Don't record whether the midrule's $$ has been used yet since actions
2773 haven't been translated yet.
2774 Record the midrule's parent rule and its RHS index within the parent
2775 rule.
2776 (grammar_current_rule_action_append): Don't translate the action yet
2777 since not all symbol declarations may have been parsed yet and, thus,
2778 warnings about types for $$, $n, @$, and @n can't be reported yet.
2779 (packgram): Translate the action and invoke grammar_rule_check now that
2780 all symbol declarations have been parsed.
2781 * src/scan-code.l (handle_action_dollar): Now that this is invoked
2782 after parsing the entire grammar file, the symbol list here in the case
2783 of a midrule is actually the midrule's empty RHS, so reference its
2784 parent rule's RHS where necessary.
2785 On the other hand, now that you can already know it's a midrule, you
2786 aren't forced to think $$ has the same type as its parent rule's $$.
2787 (handle_action_at): In the case of a midrule, reference the parent rule
2788 where necessary.
2789 * src/symlist.c (symbol_list_new): Initialize new midrule-related
2790 members.
2791 (symbol_list_length): Now that this is invoked after all rules have
2792 been parsed, a NULL symbol (rather than a NULL symbol list node)
2793 terminates a rule. symbol_list_print already does this correctly.
2794 * src/symlist.h (symbol_list.midrule_parent_rule,
2795 symbol_list.midrule_parent_rhs_index): New members so that midrules can
2796 remember their relationships with their parents.
2797 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
2798 fixed by the above patch.
2799 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
2800 implementing...
2801 (Unused values): ... this old test case and...
2802 (Unused values before symbol declarations): ... this new test case.
2803 This one is the same as `Unused values' except that all symbol
2804 declarations appear after the rules in order to catch the rest of the
2805 errors fixed by the above patch.
2806
e256e17f
JD
28072006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2808
300a1930
JD
2809 More cleanup.
2810 * src/reader.c (current_rule): Declare it static since it's no longer
2811 used outside this file.
2812 (grammar_current_rule_action_append): Remove redundant arguments from
2813 translate_rule_action invocation.
2814 * src/reader.h (current_rule): Remove this unused extern.
2815 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
2816 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 2817
381ecb06
JD
28182006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
2819
2820 Clean up yesterday's patch.
2821 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
2822 to...
2823 * src/reader.c (grammar_current_rule_action_append): ... here for
2824 consistency with grammar_current_rule_symbol_append.
2825 * tests/regression.at (Braced code in declaration in rules section):
2826 Make yyerror and yylex static as usual.
2827
4210cd0b
JD
28282006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
2829
2830 Fix bug that mistakes braced code in a declaration in the rules section
2831 to be a rule action. Mentioned at
2832 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
2833 * src/scan-gram.l: Move midrule action detection from the start of the
2834 scanning of any braced code to...
2835 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
2836 action. For readability, use $2 and @2 rather than the equivalent
2837 global variables.
2838 * tests/regression.at (Braced code in declaration in rules section):
2839 New test to catch the error fixed by the above patch.
2840
2841 Work on code readability some.
2842 * src/scan-code.l (current_rule): Get rid of this misleading and
2843 redundant declaration: it's actually extern'ed in reader.h.
2844 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
2845 translate_action): Add a rule argument and use it instead of the global
2846 current_rule.
2847 (translate_rule_action): This already receives current_rule through an
2848 argument, so pass it on to translate_action instead of assigning
2849 current_rule to current_rule.
2850 (translate_symbol_action, translate_code): Pass rule = NULL to
2851 translate_action.
2852
34f98f46
JD
28532006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
2854
2855 Rename %before-definitions to %start-header and %after-definitions to
2856 %end-header. Don't use these declarations to separate pre-prologue
2857 blocks from post-prologue blocks. Add new order-independent
2858 declarations %before-header and %after-header as alternatives to the
2859 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
2860 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
2861 * NEWS (2.3+): Update for these changes.
2862 * data/glr.c (b4_before_definitions): Update to...
2863 (b4_start_header): ... this.
2864 (b4_after_definitions): Update to...
2865 (b4_end_header): ... this.
2866 * data/glr.cc: Likewise.
2867 * data/lalr1.cc: Likewise.
2868 * data/yacc.c: Likewise.
2869 * doc/bison.texinfo (The prologue): Update names, and replace remaining
2870 prologue blocks with %*-header declarations.
2871 (Calc++ Parser): Likewise.
2872 (Bison Declaration Summary): Update names.
148d66d8 2873 (Table of Symbols): Update description.
34f98f46
JD
2874 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
2875 (PERCENT_END_HEADER): ... this.
2876 (PERCENT_BEFORE_DEFINITIONS): Update to...
2877 (PERCENT_START_HEADER): ... this.
2878 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2879 (declaration): Update token names and m4 macro names.
2880 When parsing %end-header and %start-header, invoke translate_code
2881 before muscle_code_grow, and no longer set global booleans to remember
2882 whether these declarations have been seen.
2883 Parse new %after-header and %before-header.
2884 * src/reader.c (before_definitions, after_definitions): Remove.
2885 (prologue_augment): Accept a new bool argument to specify whether to
2886 augment the pre-prologue or post-prologue.
2887 * src/reader.h (before_definitions, after_definitions): Remove these
2888 extern's.
2889 (prologue_augment): Add new bool argument.
2890 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
2891 (PERCENT_END_HEADER): ... this.
2892 (PERCENT_BEFORE_DEFINITIONS): Update to...
2893 (PERCENT_START_HEADER): ... this.
2894 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2895 * tests/actions.at (Printers and Destructors): Update names.
2896
31b2b07e
JD
28972006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
2898
2899 Add comparison operators for C++ location classes. Discussed at
2900 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
2901 * data/c++.m4 (b4_define_location_comparison): New boolean %define
2902 declaration indicating whether filename_type has an operator==. If
2903 filename_type is `std::string', it defaults to `1', `0' otherwise.
2904 * data/location.cc: Iff b4_define_location_comparison is `1', add
2905 operator== and operator!= for class position and for class location.
2906
2907 Some minor fixes.
2908 * src/scan-action.l: Remove unused file.
2909 * src/symtab.c (symbol_printer_set): Use printer_location not
2910 destructor_location.
2911 * src/symtab.h (struct symbol): Replace incorrect source comment for
2912 printer members.
2913 * tests/input.at (Incompatible Aliases): Update output with correct
2914 printer location.
2915
9bc0dd67
JD
29162006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
2917
2918 Don't put the pre-prologue in the header file. For the yacc.c code
2919 file and the glr.c header and code files, move the pre-prologue before
2920 the token definitions. Add new %before-definitions and
2921 %after-definitions to declare code that will go in both the header file
2922 and code file. Discussed at
2923 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
2924 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
2925 and
2926 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
2927 * NEWS (2.3+): Describe these changes.
2928 * data/glr.c (b4_pre_prologue): Move from within to before...
2929 (b4_shared_declarations): ... this.
2930 Add new b4_before_definitions before b4_token_enums.
2931 Add new b4_after_definitions at the end.
2932 * data/glr.cc (b4_pre_prologue): Replace with...
2933 (b4_before_definitions): ... this in the header file.
2934 (b4_after_definitions): New near the end of the header file.
2935 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
2936 code file right before including the header file.
2937 (b4_before_definitions): New in the previous position of
2938 b4_pre_prologue in the header file.
2939 (b4_after_definitions): New near the end of the header file.
2940 * data/yacc.c: Clean up some m4 quoting especially in the header file.
2941 (b4_token_enums_defines): In the code file, move to right before
2942 YYSTYPE for consistency with the header file.
2943 (b4_before_definitions): New right before b4_token_enums_defines in
2944 both the header and code file.
2945 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
2946 header and code file.
2947 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
2948 of prologues for %union dependencies.
2949 (Bison Declaration Summary): In %defines description, mention the
2950 effect of %before-definitions and %after-definitions on the header
2951 file.
2952 (Calc++ Parser): Forward declare driver in a %before-definitions rather
2953 than in the pre-prologue so that make check succeeds.
148d66d8 2954 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
2955 %after-definitions.
2956 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
2957 %before-definitions.
2958 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
2959 (declaration): Parse those declarations and append to
2960 b4_before_definitions and b4_after_definitions, respectively.
2961 * src/reader.c (before_definitions, after_definitions): New bools to
2962 track whether those declarations have been seen.
2963 (prologue_augment): Add to the post-prologue if %union,
2964 %before-definitions, or %after-definitions has been seen.
2965 * src/reader.h (before_definitions, after_definitions): New extern's.
2966 * src/scan-gram.l: Scan the new declarations.
2967 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
2968 prologue block in a %before-definitions or a %after-definitions based
2969 on whether the %union is declared.
2970 * tests/regression.at (Early token definitions with --yacc, Early token
2971 definitions without --yacc): Move tests for token definitions into the
2972 post-prologue since token names are no longer defined in the
2973 pre-prologue.
2974
203b9274
AD
29752006-06-20 Akim Demaille <akim@epita.fr>
2976
2977 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
2978 (symbol_get): Use it.
2979 * src/parse-gram.y: Use it.
2980
a7ee59cf
JD
29812006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
2982
2983 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
2984 build succeeds when configured with --enable-gcc-warnings.
2985
5a2baae7
PE
29862006-06-19 Paul Eggert <eggert@cs.ucla.edu>
2987
33ad1a9c
PE
2988 * src/parse-gram.y (char_name): New function.
2989 (CHAR, STRING, string_content): For %printer, properly escape.
2990 (ID): Prefer fputs to fprintf.
2991 (id): Reindent to be consistent with other rules.
2992 Properly quote char.
2993
5a2baae7
PE
2994 The Translation Project changed its way of publishing translations
2995 to maintainers. I haven't received any responses to my request
2996 for supporting the old way, or for documenting the new way. I
2997 have modified 'bootstrap' to use screen scraping
2998 (in this case, HTML scraping). This is unreliable and inelegant,
2999 but I don't see any better way. Yuck.
3000 * bootstrap (TP_URL, WGET_COMMAND): New vars.
3001 (get_translations): New function, which uses HTML scraping to
3002 deduce locations of latest translations.
3003 Use this function to grab both bison and bison-runtime .po files.
3004 Don't bother priming the pump for the runtime-po domain any more,
3005 as it's now translated better than bison is.
3006
58d7a1a1
AD
30072006-06-19 Akim Demaille <akim@epita.fr>
3008
3009 * src/scan-gram.l: No longer "parse" things after `%union' until
3010 `{'. Rather, return a single "%union" token.
3011 No longer make symbols: return strings, and leave the conversion
3012 to symbols to the parser.
3013 (SC_PRE_CODE, token_type): Remove.
3014 * src/parse-gram.y (%union): New field `character'.
3015 Sort tokens.
3016 (CHAR): New token.
3017 (ID, ID_COLON): Now that the scanner no longer makes them
3018 identifiers, adjust all uses to invoke symbol_get.
3019 (id_colon): New, wraps the conversion from string to symbol.
3020 (%union): Accept a possible union_name.
3021 (symbol): Now can be a char.
3022 * data/c.m4 (b4_union_name): Leave a default value.
3023 * data/glr.c, data/yacc.c: Use it.
3024
b931235e
JD
30252006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
3026
3027 For associating token numbers with token names for "yacc.c", don't use
3028 #define statements unless `--yacc' is specified; always use enum
3029 yytokentype. Most important discussions start at:
3030 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
3031 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
3032 and
3033 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
3034 * NEWS (2.3+): Mention.
3035 * data/c.m4 (b4_yacc_if): New.
3036 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
3037 token #define's.
3038 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
3039 on token name definitions.
3040 * src/getargs.c (usage): Capitalize `Yacc' in English.
3041 * src/output.c (prepare): Define b4_yacc_flag.
3042 * tests/regression.at (Early token definitions): Test that tokens names
3043 are defined before the pre-prologue not just before the post-prologue.
3044 Remove this test case and copy to...
3045 (Early token definitions with --yacc): ... this to test #define's.
3046 (Early token definitions without --yacc): ... and this to test enums.
3047
9e6e7ed2
PE
30482006-06-11 Paul Eggert <eggert@cs.ucla.edu>
3049
3050 * NEWS: Reword the post-2.3 change to not be so optimistic about
3051 removing the old "look-ahead" spelling.
3052 Update previous look-ahead/lookahead change reports.
3053 * REFERENCES: look-ahead -> lookahead (since that's
3054 what he actually wrote).
3055 * doc/refcard.tex: look ahead -> lookahead,
3056 look-ahead -> lookahead
3057
742e4900
JD
30582006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
3059
3060 For consistency, use `lookahead' instead of `look-ahead' or
3061 `look_ahead'. Discussed starting at
3062 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
3063 and then at
3064 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
3065 * NEWS: For the next release, note the change to `--report'.
3066 * TODO, doc/bison.1: Update English.
3067 * doc/bison.texinfo: Update English.
3068 (Understanding Your Parser, Bison Options): Document as
3069 `--report=lookahead' rather than `--report=look-ahead'.
3070 * src/conflicts.c: Update English in comments.
3071 (lookahead_set): Rename from look_ahead_set.
3072 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
3073 (resolve_sr_conflict): Rename local look_ahead_tokens to
3074 lookahead_tokens, and update other uses.
3075 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
3076 count_rr_conflicts, conflicts_free): Update uses.
3077 * src/getargs.c (report_args): Move "lookahead" before alternate
3078 spellings.
3079 (report_types): Update uses.
3080 (usage): For `--report' usage description, state `lookahead' spelling
3081 rather than `look-ahead'.
3082 * src/getargs.h (report.report_lookahead_tokens): Rename from
3083 report_look_ahead_tokens.
3084 * src/lalr.c: Update English in comments.
3085 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
3086 (state_lookahead_tokens_count): Rename from
3087 state_look_ahead_tokens_count.
3088 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3089 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
3090 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3091 Update other uses.
3092 Update English in output.
3093 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
3094 * src/print.c: Update English in comments.
3095 (lookahead_set): Rename from look_ahead_set.
3096 (print_reduction): Rename argument lookahead_token from
3097 look_ahead_token.
3098 (print_core, state_default_rule, print_reductions, print_results):
3099 Update uses.
3100 * src/print_graph.c: Update English in comments.
3101 (print_core): Update uses.
3102 * src/state.c: Update English in comments.
3103 (reductions_new): Update uses.
3104 (state_rule_lookahead_tokens_print): Rename from
3105 state_rule_look_ahead_tokens_print, and update other uses.
3106 * src/state.h: Update English in comments.
3107 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
3108 (state_rule_lookahead_tokens_print): Rename from
3109 state_rule_look_ahead_tokens_print.
3110 * src/tables.c: Update English in comments.
3111 (conflict_row, action_row): Update uses.
3112 * tests/glr-regression.at
3113 (Incorrect lookahead during deterministic GLR,
3114 Incorrect lookahead during nondeterministic GLR): Rename
3115 print_look_ahead to print_lookahead.
3116 * tests/torture.at: Update English in comments.
3117 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
3118 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
3119 (Many lookahead tokens): Update uses.
3120 * data/glr.c: Update English in comments.
3121 * lalr1.cc: Likewise.
3122 * yacc.c: Likewise.
3123 * src/conflicts.h: Likewise.
3124 * src/lalr.h: Likewise.
3125 * src/main.c: Likewise.
3126 * src/output.c: Likewise.
3127 * src/parse-gram.c: Likewise.
3128 * src/tables.h: Likewise.
3129 * tests/calc.at: Likewise.
3130
3c40d0b5
JD
31312006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
3132
3133 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
3134
5d278082
PE
31352006-06-07 Paul Eggert <eggert@cs.ucla.edu>
3136
3137 * TODO: Add request from Nelson H. F. Beebe to be able to install
3138 Bison without installing the yacc script.
3139
9e668899
JD
31402006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3141
3142 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
3143 and yytext if they're already #define'd.
3144 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
3145 * src/scan-code-c.c: ... here.
3146 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
3147 <config.h>.
3148
0c8e079f
JD
31492006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3150
3151 Get Bison to build again when configured with --enable-gcc-warnings.
3152 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
3153 missing #include's.
3154 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
3155 loc argument as it shadows a global.
3156 * src/scan-gram.l: Remove stray comma that prevents boundary_set
3157 invocation.
3158
3159 * src/.cvsignore: Add scan-code.c.
3160
2346344a
AD
31612006-06-07 Akim Demaille <akim@epita.fr>
3162
3163 * src/scan-gram.l: Move the "add a trailing ; to actions" code
3164 to...
3165 * src/scan-code.l: here.
3166 * tests/input.at (Torturing the Scanner): Fix another location
3167 error.
3168
4862bdfd
AD
31692006-06-07 Akim Demaille <akim@epita.fr>
3170
3171 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
3172
e9071366
AD
31732006-06-06 Akim Demaille <akim@epita.fr>
3174
3175 Extract the parsing of user actions from the grammar scanner.
3176 As a consequence, the relation between the grammar scanner and
3177 parser is much simpler. We can also split "composite tokens" back
3178 into simple tokens.
3179 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
3180 * src/scan-gram.l (add_column_width, adjust_location): Move to and
3181 rename as...
3182 * src/location.h, src/location.c (add_column_width)
3183 (location_compute): these.
3184 Fix the column count: the initial column is 0.
3185 (location_print): Be robust to ending column being 0.
3186 * src/location.h (boundary_set): New.
3187 * src/main.c: Adjust to scanner_free being renamed as
3188 gram_scanner_free.
3189 * src/output.c: Include scan-code.h.
3190 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
3191 Use boundary_set.
3192 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
3193 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
3194 which is now, again, a separate token.
3195 Adjust all dependencies.
3196 Whereever actions with $ and @ are used, use translate_code.
3197 (action): Remove this nonterminal which is now useless.
3198 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
3199 (grammar_current_rule_action_append): Use translate_code.
3200 (packgram): Bound check ruleno, itemno, and rule_length.
3201 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
3202 (last_string, last_braced_code_loc, max_left_semantic_context)
3203 (scanner_initialize, scanner_free, scanner_last_string_free)
3204 (gram_out, gram_lineno, YY_DECL_): Move to...
3205 * src/scan-gram.h: this new file.
3206 (YY_DECL): Rename as...
3207 (GRAM_DECL): this.
3208 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
3209 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3210 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3211 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3212 Move these declarations, and...
3213 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
3214 these to...
3215 * src/flex-scanner.h: this new file.
3216 * src/scan-gram.l (rule_length, rule_length_overflow)
3217 (increment_rule_length): Remove.
3218 (last_braced_code_loc): Rename as...
3219 (gram_last_braced_code_loc): this.
3220 Adjust to the changes of the parser.
3221 Move all the handling of $ and @ into...
3222 * src/scan-code.l: here.
3223 * src/scan-gram.l (handle_dollar, handle_at): Remove.
3224 (handle_action_dollar, handle_action_at): Move to...
3225 * src/scan-code.l: here.
3226 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
3227 scan-code.h, scan-code-c.c, scan-gram.h.
3228 (EXTRA_bison_SOURCES): Add scan-code.l.
3229 (BUILT_SOURCES): Add scan-code.c.
3230 (yacc): Be robust to white spaces.
3231
3232 * tests/conflicts.at, tests/input.at, tests/reduce.at,
3233 * tests/regression.at: Adjust the column numbers.
3234 * tests/regression.at: Adjust the error message.
7891a7c4 3235
184e42f0
JD
32362006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3237
3238 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3239 Use Akim's wording from
3240 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
3241
7891a7c4
JD
32422006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3243
3244 Between Bison releases, manually append `+' to the previous Bison
3245 release number, and use that as a signal to automatically print the
3246 ChangeLog's CVS Id keyword from --version. Discussed starting at
3247 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
3248 * ChangeLog: Add Id header.
3249 * configure.ac (AC_INIT): Append `+' to `2.3'.
3250 * src/.cvsignore: Add revision.c.
3251 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
3252 (BUILT_SOURCES): Add revision.c.
3253 (revision.c): New target rule. This file defines a new global variable
3254 named revision. It initializes it with either the Id from ChangeLog
3255 or, if VERSION doesn't contain `+', with the empty string.
3256 * src/getargs.c (version): Print the value of revision.
3257 * src/revision.h: Extern revision.
3258
4ad3ed84
PE
32592006-06-05 Paul Eggert <eggert@cs.ucla.edu>
3260
3261 * NEWS: Version 2.3.
3262 * configure.ac (AC_INIT): Likewise.
3263
02103984
PE
32642006-05-30 Paul Eggert <eggert@cs.ucla.edu>
3265
3266 * data/glr.c (YYRECOVERING): Define to be a function-like macro
3267 with no arguments, not as an object-like macro. This is for
3268 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
3269 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
3270 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
3271 Document this.
3272
2c08afa5
JD
32732006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
3274
3275 * src/getargs.c (usage): Back out yesterday's modification of the
3276 --help output so that we don't have to wait for translation before
3277 releasing 2.3.
3278
6077da58
PE
32792006-05-29 Paul Eggert <eggert@cs.ucla.edu>
3280
3281 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
3282 Problem reported by Akim Demaille.
3283
2a26b6c2
JD
32842006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3285
3286 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3287
aefef0d6
PE
32882006-05-26 Paul Eggert <eggert@cs.ucla.edu>
3289
3290 * data/yacc.c (yy_reduce_print): Omit trailing white space in
3291 generated source code. Problem reported by Frans Englich in
3292 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
3293
fcd8e201
PE
32942006-05-22 Paul Eggert <eggert@cs.ucla.edu>
3295
3296 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
3297 shell, not within 'make', so that 'make' by an ordinary builder
3298 (using GNU make) does not worry about configuring gzip. This also
3299 works around a bug reported independently by Keith Thompson and by
3300 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
3301 stderr rather than stdout, messing up the build logs.
3302
7b5cdcbd
JD
33032006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3304
3305 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
3306 to make sure that YYID will never be unused. This fixes a 'make
3307 maintainer-check' failure caused by the recent changes to the 'Trivial
3308 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
3309 not used.
3310 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
3311
5ad0a449
JD
33122006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3313
3314 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
3315 state before an empty RHS is always resolved here. Only the location
3316 of that state is guaranteed to be resolved, and that's enough. This
3317 fixes the remaining bug reported by Derek M. Jones in
3318 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3319 * tests/glr-regression.at (Uninitialized location when reporting
3320 ambiguity): Test the above case.
3321 Also, the embedded comments in this test case claim it checks the case
3322 of an empty RHS that has inherited the initial location. However, the
3323 corresponding LHS was already resolved, so yyresolveLocations didn't
3324 actually have reason to modify it. Fix this by forcing
3325 nondeterministic operation at the beginning of the parse.
3326
50cce58e
PE
33272006-05-20 Paul Eggert <eggert@cs.ucla.edu>
3328
3329 * data/c.m4 (b4_yy_symbol_print_generate):
3330 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
3331 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
3332 of the bugs reported today by Derek M Jones in
3333 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3334 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
3335 defined to be a type name without parens or brackets.
3336 (Location Type): Similarly for YYLTYPE.
3337 * tests/regression.at (Trivial grammars): Put in a test for this
3338 bug that will be caught by 'make maintainer-check' (though not,
3339 alas, by 'make check' unless your compiler is picky).
3340
ab8d9dc5
PE
33412006-05-19 Paul Eggert <eggert@cs.ucla.edu>
3342
0d2c8934 3343 * NEWS: Version 2.2.
ab8d9dc5
PE
3344 * configure.ac (AC_INIT): Likewise.
3345
9138c575
JD
33462006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
3347
3348 * data/glr.c (yyreportTree): Make room in yystates for the state
3349 preceding the RHS. This fixes the segmentation fault reported by Derek
3350 M. Jones in
3351 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
3352 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
3353 to the user. Reported for yyreportTree by Derek M. Jones later in the
3354 same thread.
3355 * THANKS: Add Derek M. Jones.
3356 Update my email address.
3357 Fix typo in Steve Murphy's name.
3358
276f48df
PE
33592006-05-14 Paul Eggert <eggert@cs.ucla.edu>
3360
d6645148
PE
3361 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
3362 checking against YYLAST that caused the parser to miss a potential
3363 alternative in its diagnostic.
3364 Problem reported by Maria Jose Moron Fernandez in
3365 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
3366 * data/lalr1.cc (yysyntax_error_): Likewise.
3367 * data/yacc.c (yysyntax_error): Likewise.
3368 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
3369 tokens, in case we run into an older C compiler.
3370 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
3371 Use them to check for the off-by-one error fixed above.
3372
276f48df
PE
3373 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
3374 YYSIZE_T, not size_t.
3375 * tests/regression.at (Trivial grammars): New test, to catch
3376 the error fixed by the above patch.
3377
cd8b5791
AD
33782006-05-14 Akim Demaille <akim@lrde.epita.fr>
3379
3380 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
3381 scheme.
3382 Reported by Steve Murphy.
3383
34376418
AD
33842006-05-14 Akim Demaille <akim@lrde.epita.fr>
3385
3386 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
3387 * data/glr.cc: b4_location_flag is now b4_locations_flag.
3388
327afc7c
AD
33892006-05-14 Akim Demaille <akim@lrde.epita.fr>
3390
3391 Implement --trace=m4.
3392 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
3393 * src/output.c (output_skeleton): When set, pass -dV to m4.
3394
3395 Factor the handling of flags in m4.
3396 * src/output.c (prepare): Rename the muscle names debug, defines,
3397 error_verbose to debug_flag, defines_flag, error_verbose_flag.
3398 * data/c.m4: Adjust.
3399 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
3400 Use b4_define_flag_if to define other b4_FLAG_if macros.
3401 (b4_location_if): As a consequence, rename as...
3402 (b4_locations_if): this, for consistency.
3403 Adjust all the skeletons.
3404
ba9ecd19
AD
34052006-05-14 Akim Demaille <akim@lrde.epita.fr>
3406
3407 * etc/bench.pm: Shorten bench names.
3408
4e83ea15
AD
34092006-05-14 Akim Demaille <akim@lrde.epita.fr>
3410
3411 * src/output.h, src/output.c (error_verbose): Move to...
3412 * src/getargs.h, src/getargs.c: here.
3413 Sort the flags.
3414 Adjust dependencies.
3415
6e93d810
PE
34162006-05-13 Paul Eggert <eggert@cs.ucla.edu>
3417
3418 * data/c.m4 (b4_copyright): Put the special exception for Bison
3419 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
3420 uses changed. Suggested by Akim Demaille. Also, wrap the
3421 copyright notice, in case it is longer than 80 columns. Replace
3422 comma by newline after title.
6e93d810 3423
eaea13f5
PE
34242006-05-11 Paul Eggert <eggert@cs.ucla.edu>
3425
3426 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
3427 incompatibility, not a bug. Mention that it wasn't fixed as of
3428 flex 2.5.33.
3429
3cf084ec
AD
34302006-05-11 Akim Demaille <akim@lrde.epita.fr>
3431
3432 * examples/extexi: Enforce the precedence of concatenation over
3433 >>.
0a9f1c7d 3434 Reported by Tommy Nordgren.
3cf084ec 3435
32c96bd7
AD
34362006-05-11 Akim Demaille <akim@lrde.epita.fr>
3437
3438 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
3439 with the member "token".
f94705b2 3440 Reported by Martin Nylin.
32c96bd7 3441
eaea13f5
PE
34422006-05-08 Paul Eggert <eggert@cs.ucla.edu>
3443
3444 * data/glr.c: Switch to Bison 2.2 special-exception language in
3445 the copyright notice. Use more-regular format for titles and
3446 copyright notices.
3447 * data/glr.cc: Likewise.
3448 * data/location.cc: Likewise.
3449 * data/yacc.cc: Likewise.
3450 * doc/bison.texinfo (Conditions): Document this.
3451 * NEWS: likewise. Upgrade version to 2.2.
3452
6e2d1146
AD
34532006-04-27 Akim Demaille <akim@lrde.epita.fr>
3454
3455 * data/glr.cc: Remove dead code.
3456
47671055
PE
34572006-04-25 Paul Eggert <eggert@cs.ucla.edu>
3458
3459 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
3460 that variable and the line breaks the bootstrap. Problem reported
3461 by Juan M. Guerrero.
3462
ed2e6384
AD
34632006-04-24 Akim Demaille <akim@lrde.epita.fr>
3464
3465 * doc/bison.texinfo (Multiple start-symbols): New.
3466
3cedc2dc
AD
34672006-04-24 Akim Demaille <akim@lrde.epita.fr>
3468
3469 * etc/README, etc/bench.pl: New.
3470
b2ddc3f3
AD
34712006-04-03 Akim Demaille <akim@lrde.epita.fr>
3472
3473 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
3474 rule.
3475 Reported by Mickael Labau.
3476 * tests/input.at (Torturing the Scanner): Test it.
3477
91e3ac9a
PE
34782006-03-16 Paul Eggert <eggert@cs.ucla.edu>
3479
3480 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
3481 Problem reported by Bob Rossi.
3482
34832006-03-13 Paul Eggert <eggert@cs.ucla.edu>
3484
3485 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
3486 and didn't really work.
3487 For the index, use @ifnotinfo, not @iftex.
3488 Minor cleanups of spacing and terminology.
3489
5cf61e93
AD
34902006-03-12 Akim Demaille <akim@lrde.epita.fr>
3491
3492 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
3493 of AT_NAME_PREFIX when %name-prefix is not used.
3494
aa08666d
AD
34952006-03-12 Akim Demaille <akim@lrde.epita.fr>
3496
3497 Apply --prefix to C++ skeletons too: they change the namespace.
3498 The test suite already exercize these cases.
3499 * data/c++.m4 (b4_namespace): New.
3500 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
3501 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
3502 * data/yacc.c, data/glr.c: Remove a useless `[]'.
3503 * doc/bison.texinfo: Document it.
3504 (Option Cross Key): Use @multitable in all formats. It looks
3505 nicer, even in TeX outputs.
3506 (Rules): Use the same code whatever the output type is.
3507 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
3508 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
3509 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 3510
45567173
AD
35112006-03-10 Akim Demaille <akim@lrde.epita.fr>
3512
3513 * TODO: Remove dead items.
3514
e9d8f881 35152006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
3516
3517 * doc/FAQ: Remove, merged into...
3518 * doc/bison.texinfo (FAQ): this.
3519 * doc/Makefile.am (EXTRA_DIST): Adjust.
3520
c095d689
AD
35212006-03-10 Akim Demaille <akim@lrde.epita.fr>
3522
3523 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
3524 even if empty.
3525 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
3526 * doc/bison.texinfo (Calc++ Scanner): Use it.
3527
6e0f8287
PE
35282006-03-09 Paul Eggert <eggert@cs.ucla.edu>
3529
3530 Fix two nits reported by twlevo, plus one more that I discovered.
3531
3532 * src/assoc.h (assoc_to_string): Give a name to the arg, as
3533 this is the usual Bison style.
3534 * src/location.h (location_print): Likewise.
3535
3536 * src/reader.h (token_name): Likewise.
3537
d6b771c3
PE
35382006-03-08 Paul Eggert <eggert@cs.ucla.edu>
3539
3540 Fix some nits reported by twlevo.
3541 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
3542 and "POSIX". Use more-modern syntax for URLs. Mention C++
3543 and ask for Java. Don't hardwire OS version numbers. Add
3544 copyright notice.
3545 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
3546 * src/conflicts.c (solved_conflicts_obstack): Now static.
3547
1e137b71
JD
35482006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3549
3550 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
3551 page. Say "you can use it" not "you may use it" as on the web page;
3552 we're describing capabilities not granting permission.
3553
73f2e47e
PE
35542006-03-06 Paul Eggert <eggert@cs.ucla.edu>
3555
6d05403d
PE
3556 * data/glr.c (yyresolveLocations): Rename local variables to avoid
3557 shadowing warnings. Use usual patter for iterating through RHS.
3558 * tests/glr-regression.at
3559 (Uninitialized location when reporting ambiguity):
3560 Modify yylex so that it uses its argument, rather than trying
3561 to rely on ARGSUSED (which doesn't work for gcc with warnings).
3562 const char -> char const.
3563
73f2e47e
PE
3564 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
3565 Don't use tabs inside commands; it messes up 'ps'.
3566 Problem reported by twlevo.
3567
8710fc41
JD
35682006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
3569
3570 * tests/glr-regression.at (Uninitialized location when reporting
3571 ambiguity): New test case.
3572 * data/glr.c (yyresolveLocations): New function, which uses
3573 YYLLOC_DEFAULT.
3574 (yyresolveValue): Invoke yyresolveLocations before reporting an
3575 ambiguity.
3576 * doc/bison.texinfo (Default Action for Locations): Note
3577 YYLLOC_DEFAULT's usage for ambiguity locations.
3578 (GLR Semantic Actions): Cross-reference those notes.
3579
ae952af2
JD
35802006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
3581
3582 * tests/glr-regression.at (Leaked semantic values when reporting
3583 ambiguity): Remove unnecessary union and type declarations.
3584 (Leaked lookahead after nondeterministic parse syntax error): New test
3585 case.
3586 * data/glr.c (yyparse): Check for zero stacks remaining before
3587 attempting to shift the lookahead so that you don't lose it.
3588
35ee866a
JD
35892006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3590
3591 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
3592 * tests/glr-regression.at (Leaked semantic values when reporting
3593 ambiguity): New test case.
3594 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
3595 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
3596 now unnecessary yystackp parameter.
3597 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
3598 destructors can be called.
3599
3600 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
3601 in existing testcases.
3602
520181ab
JD
36032006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3604
3605 Don't leak semantic values for parent RHS when a user action cuts the
3606 parser, and clean up related code a bit.
3607 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
3608 cuts parse): Rename to...
3609 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
3610 for leaked parent RHS values.
3611 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
3612 between an unresolved state (non-empty chain of semantic options) and
3613 an incomplete one (signaled by an empty chain).
ae952af2 3614 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
3615 successfully or unsuccessfully resolved yyGLRState to...
3616 (yyresolveValue): ... here so that yyresolveValue always leaves a
3617 yyGLRState with consistent data and thus is easier to understand.
3618 Remove the yyvalp and yylocp parameters since they are always just
3619 taken from the yys parameter. When reporting a discarded merged value
3620 in debugging output, note that it is incompletely merged. Document the
3621 interface.
3622 (yyresolveAction): If resolving any of the RHS states fails, destroy
3623 them all rather than leaking them. Thus, as long as user actions are
3624 written to clean up the RHS correctly, yyresolveAction always cleans up
3625 the RHS of a semantic option. Document the interface.
3626
18d9185c
PE
36272006-02-27 Paul Eggert <eggert@cs.ucla.edu>
3628
3629 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
3630 led to a segmentation fault in GNU Pascal. Problem reported
3631 by Waldek Hebisch.
3632
841a7737
JD
36332006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
3634
3635 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
3636 mid-rule action inside a nonterminal symbol in order to declare a
3637 destructor for its semantic value.
3638
fc3f467f
PE
36392006-02-16 Paul Eggert <eggert@cs.ucla.edu>
3640
3641 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
3642 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
3643 __cplusplus && ! defined _STDLIB_H && !
3644 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
3645 defined free))]: Include <stdlib.h> rather than rolling our own
3646 declarations of malloc and free, to avoid problems with
3647 incompatible declarations (using 'throw') C++'s stdlib.h. This
3648 should fix Debian bug 340012
3649 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
3650 reported by Guillaume Melquiond.
3651
a3af26dd
PE
36522006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3653
4d7bc38c
PE
3654 * NEWS: Clarify symbols versus types in unused-value warnings.
3655
a3af26dd
PE
3656 * configure.ac (AC_INIT): Bump version number.
3657
4e26c69e
PE
36582006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3659
3660 * NEWS: Version 2.1a.
3661 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
3662 since C99 requires this.
3663
498e897c
PE
36642006-02-11 Paul Eggert <eggert@cs.ucla.edu>
3665
3666 * m4/c-working.m4: New file.
3667 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
3668
57bb17ca
PE
36692006-02-10 Paul Eggert <eggert@cs.ucla.edu>
3670
3671 * Makefile.maint: Merge from coreutils.
3672
0be105dc
PE
36732006-02-09 Paul Eggert <eggert@cs.ucla.edu>
3674
3675 More portability fixes for problems summarized by Nelson H. F. Beebe.
3676
3677 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
3678 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
3679 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
3680 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
3681 messes up because C++ code is compiled in 32-bit mode but linked
3682 in 64-bit mode.
3683
6fc0c024
PE
36842006-02-08 Paul Eggert <eggert@cs.ucla.edu>
3685
3686 More portability fixes for problems summarized by Nelson H. F. Beebe.
3687
7870f699
PE
3688 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
3689 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
3690
6fc0c024
PE
3691 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
3692 nodist_PROGRAMS, since we don't need to actually compile the
3693 example if we're just doing a plain 'make'. This avoids bothering
3694 the installer unnecessarily about problems due to weird C++
3695 compilers.
3696
fe6c2fde
PE
36972006-02-06 Paul Eggert <eggert@cs.ucla.edu>
3698
3699 More portability fixes for problems summarized by Nelson H. F. Beebe.
3700
3701 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
3702 than #include "...", and compile with -I'.'. The old method was
3703 not portable, according to Posix and the C standard, and it does
3704 not work with Sun C 5.7, where previous #line directives affect
3705 the working directory used in later #include "..." directives.
3706
927b425b
JMG
37072006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3708
3709 Various DJGGP specific issues in /djgpp
3710
d9735e9e
PE
37112006-02-02 Paul Eggert <eggert@cs.ucla.edu>
3712
3713 More portability fixes for problems summarized by Nelson H. F. Beebe.
3714
3715 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
3716 '#include <map>' works and that you can apply ++ to iterators.
3717
5a6755af
PE
37182006-02-01 Paul Eggert <eggert@cs.ucla.edu>
3719
67a0dc4f
PE
3720 Work around portability problems summarized by Nelson H. F. Beebe in
3721 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
3722
8c86f0ef
PE
3723 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3724 that '#include <string>' works.
3725
de35dd59
PE
3726 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
3727 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
3728 "warning: sorry: semantics of inline function static data `const
3729 unsigned char translate_table[262]' are wrong (you'll wind up with
3730 multiple copies)".
3731
67a0dc4f
PE
3732 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
3733 or, xor to not_, and_, or_, and xor_, respectively. This works
3734 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
3735 random system header somewhere that includes the equivalent of
3736 <iso646.h>.
3737
5a6755af
PE
3738 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
3739 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 3740 Suite Version 2.0.
5a6755af 3741
3f001415
JD
37422006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
3743
3744 During deterministic GLR operation, user actions should be able to
3745 influence the parse by changing yychar. To make this easier to fix and
3746 to make glr.c easier to evolve in general, don't maintain yytoken in
3747 parallel with yychar; just compute yytoken when needed.
3748 * tests/glr-regression.at (Incorrect lookahead during deterministic
3749 GLR): Check that setting yychar in a user action has the intended
3750 effect.
3751 * data/glr.c (yyGLRStack): Remove yytokenp member.
3752 (yyclearin): Don't set *yytokenp.
3753 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
3754 yychar rather than *yytokenp to determine the current lookahead.
3755 Compute yytoken locally when needed.
3756 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
3757 point to.
3758
3759 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
3760 after `--report' documentation.
3761
e2a8c0f5
PE
37622006-01-30 Paul Eggert <eggert@cs.ucla.edu>
3763
3764 * src/parse-gram.y (grammar_declaration): Location of printer
3765 symbol is @1, not list->location. Bug reported by twlevo.
3766 * tests/input.at (Incompatible Aliases): Adjust to above change.
3767
6b702268
PE
37682006-01-29 Paul Eggert <eggert@cs.ucla.edu>
3769
27622431
PE
3770 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
3771 all the test at once. This makes the output easier to read in the
3772 normal case.
3773
6b702268
PE
3774 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
3775 got from <http://bro-ids.org/download.html>. The bug is that
3776 when two actions appeared in succession, the second one was
3777 scanned before the first one was added to the grammar rule
3778 as a midrule action. Bison then output the incorrect warning
3779 "parse.y:905.17-906.36: warning: unused value: $3".
3780 * src/parse-gram.y (BRACED_CODE, action): These are no longer
3781 associated with a value.
3782 (rhs): Don't invoke grammar_current_rule_action_append.
3783 (action): Invoke it here instead.
3784 * src/reader.c (grammar_midrule_action): Now extern.
3785 (grammar_current_rule_action_append): Don't invoke
3786 grammar_midrule_action; that is now the scanner's job.
3787 * src/reader.h (last_string, last_braced_code_loc):
3788 (grammar_midrule_action): New decls.
3789 * src/scan-gram.l (last_string): Now extern, sigh.
3790 (last_braced_code_loc): New extern variable.
3791 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
3792 rule already has an action.
3793 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
3794 * tests/input.at (AT_CHECK_UNUSED_VALUES):
3795 Add some tests to check that the above changes fixed the bug.
3796
d40ba6c2
PE
37972006-01-27 Paul Eggert <eggert@cs.ucla.edu>
3798
3799 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
3800 All used changed. Check whether the symbol has a destructor,
3801 not whether it is typed.
3802 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
3803 that the values are still reported as unused. All line numbers
3804 adjusted.
3805
401aace6
PE
38062006-01-23 Paul Eggert <eggert@cs.ucla.edu>
3807
3808 Work around a bug in bro 0.8, which underparenthesizes its
3809 definition of YYLLOC_DEFAULT.
3810 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
3811 their arguments.
3812 * data/lalr1.cc: Likewise.
3813 * data/yacc.cc: Likewise.
3814
06f01bc4
PE
38152006-01-22 Paul Eggert <eggert@cs.ucla.edu>
3816
401aace6
PE
3817 Work around a bug in Pike 7.0, and give the Pike folks a
3818 better way to override the usual int widths.
3819 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
3820 user can override the types.
3821 (short): #undef, to work around a bug in Pike 7.0.
3822 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
3823 (union yyalloc.yyss): Use yytype_int16 rather than short.
3824 All uses changed.
3825 (yysigned_char): Remove.
3826 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
3827 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
3828 * tests/regression.at (Web2c Actions): Adjust to above changes.
3829
3830 * src/reader.c (check_and_convert_grammar): New function.
3831 (reader): Close the input file even if something went wrong during
3832 parsing. Minor file descriptor leak reported by twlevo.
3833
06f01bc4
PE
3834 * src/assoc.c (assoc_to_string): Use a default: abort (); case
3835 to pacify gcc -Wswitch-default.
3836 * src/scan-gram.l (adjust_location): Use a default: break; case
3837 to pacify gcc -Wswitch-default.
3838 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
3839 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3840 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3841 Move these decls to scan-skel.l, since they don't need to be
3842 visible elsewhere.
3843 * src/scan-skel.l: Accept the above decls.
3844 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
3845 is used.
3846
02650b7f
PE
38472006-01-21 Paul Eggert <eggert@cs.ucla.edu>
3848
3849 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
3850 since we don't want to insist on a version number at the start
3851 of the changelog every time.
3852 * Makefile.maint: Sync from coreutils a bit better.
3853 (sc_trailing_blank): Renamed from sc_trailing_space.
3854 All uses changed.
3855 (sc_no_if_have_config_h, sc_require_config_h):
3856 (sc_prohibit_assert_without_use): New rules.
3857 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
3858 (sc_dd_max_sym_length): Fix leading spaces in rule.
3859 (sc_system_h_headers): Prefix with @.
3860 (sc_useless_cpp_parens, m4-check): Output line numbers.
3861 (changelog-check): Allow version only in head.
3862 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
3863 satisfy new Makefile.maint rule.
3864 * data/glr.c: Likewise.
3865 * data/glr.cc: Likewise.
3866 * data/lalr1.cc: Likewise.
3867 * data/yacc.c: Likewise.
3868 * lib/ebitsetv.c: Likewise.
3869 * lib/lbitset.c: Likewise.
3870 * lib/subpipe.c: Likewise.
3871 * lib/timevar.c: Likewise.
3872 * src/system.h: Likewise.
3873 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
3874 * djgpp/Makefile.maint: Add copyright notice.
3875 * djgpp/README.in: Likewise.
3876 * djgpp/config.bat: Likewise.
3877 * djgpp/config.site: Likewise.
3878 * djgpp/config_h.sed: Likewise.
3879 * djgpp/djunpack.bat: Likewise.
3880 * djgpp/config.sed: Fix copyright notice to match standard format.
3881 * djgpp/subpipe.h: Likewise.
3882 * lib/bitsetv-print.c: Likewise.
3883 * lib/bitsetv.c: Likewise.
3884 * lib/subpipe.h: Likewise.
3885 * lib/timevar.c: Likewise.
3886 * lib/timevar.h: Likewise.
3887 * djgpp/subpipe.c: Use standard recipe for config.h.
3888 * lib/abitset.c: Likewise.
3889 * lib/bitset.c: Likewise.
3890 * lib/bitset_stats.c: Likewise.
3891 * lib/bitsetv-print.c: Likewise.
3892 * lib/bitsetv.c: Likewise.
3893 * lib/ebitsetv.c: Likewise.
3894 * lib/get-errno.c: Likewise.
3895 * lib/lbitset.c: Likewise.
3896 * lib/subpipe.c: Likewise.
3897 * lib/timevar.c: Likewise.
3898 * lib/vbitset.c: Likewise.
3899 * tests/local.at: Likewise.
3900 * src/scan-gram.l: Don't include verify.h, since system.h does
3901 that for us.
3902 * .x-sc_require_config_h: New file.
3903 * .x-sc_unmarked_diagnostics: New file.
3904
287c78f6
PE
39052006-01-20 Paul Eggert <eggert@cs.ucla.edu>
3906
287c78f6
PE
3907 Be a bit more systematic about using 'abort'.
3908 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
3909 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
3910 Put 'default: abort ();' before some other case, to satisfy older
3911 pedantic compilers.
3912 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3913 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
3914 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
3915 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
3916 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
3917 (get_decision_str, get_orientation_str, get_node_alignment_str):
3918 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
3919 (get_linestyle_str, get_arrowstyle_str): Likewise.
3920 * src/conflicts.c (resolve_sr_conflict):
3921 Use a default case rather than one for the one remaining enum
3922 value, to catch invalid enum values as well.
3923 * src/lalr.c (set_goto_map, map_goto):
3924 Prefer "assert (FOO);" to "if (!FOO) abort ();".
3925 * src/nullable.c (nullable_compute, token_definitions_output):
3926 Likewise.
3927 * src/reader.c (packgram, reader): Likewise.
3928 * src/state.c (transitions_to, state_new, state_reduction_find):
3929 Likewise.
3930 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
3931 (symbol_pack): Likewise.
3932 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
3933 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
3934 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
3935 * src/system.h: Don't include <assert.h>.
3936 (assert): New macro.
3937
3938 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
3939 (Destructor Decl, Parser Function, Pure Calling):
3940 Describe rules for braces inside C code more carefully.
287c78f6 3941
c66dfadd
PE
39422006-01-19 Paul Eggert <eggert@cs.ucla.edu>
3943
c21493b8
PE
3944 Fix some porting glitches found by Nelson H. F. Beebe.
3945 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
3946 compilers that don't understand that abort () does not return.
3947 * src/state.c (transitions_to): Likewise.
3948 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3949 that '#include <cstdlib>' works.
3950 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
3951 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
3952 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
3953 for the benefit of some pre-C99 compilers.
3954
b6e3facf
PE
3955 * bootstrap: Undo changes to gnulib files that autoreconf made.
3956
c66dfadd
PE
3957 Minor fixups to get 'make maintainer-check' to work.
3958 * configure.ac: Don't use -Wnested-externs, as it's incompatible
3959 with the new verify.h implementation.
3960 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
3961 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
3962 * data/yacc.c (YYUSE): Likewise.
3963 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
3964 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
3965 * src/parse-gram.y (declaration): Don't pass a string constant
3966 to a function that expects char *, since GCC might complain
3967 about the constant value.
3968 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
3969 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
3970 before #defining them.
3971 * tests/glr-regression.at
3972 (Incorrectly initialized location for empty right-hand side in GLR):
3973 In yyerror, use the msg arg.
3974 (Corrupted semantic options if user action cuts parse):
3975 (Incorrect lookahead during deterministic GLR):
3976 (Incorrect lookahead during nondeterministic GLR):
3977 Don't name a local var 'index'; it shadows string.h's 'index'.
3978
ed94ef2a
AD
39792006-01-19 Akim Demaille <akim@epita.fr>
3980
3981 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
3982 location, not just parts of it.
3983
e9ad4aec
PE
39842006-01-18 Paul Eggert <eggert@cs.ucla.edu>
3985
d6ca7905
PE
3986 * NEWS: Document the fact that multiple %unions are now allowed.
3987 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
3988 * TODO: This feature is now implemented, so remove it from
3989 the wishlist.
d6ca7905 3990
ef1b70e0
PE
3991 * Makefile.maint: Merge with coreutils Makefile.maint.
3992 (CVS_LIST): Use build-aux version if available.
3993 (VERSION_REGEXP): New macro.
3994 (syntax-check-rules): Add sc_no_if_have_config_h,
3995 sc_prohibit_assert_without_use, sc_require_config_h,
3996 sc_useless_cpp_parens.
3997 (sc_obsolete_symbols): Check for O_NDELAY.
3998 (sc_dd_max_sym_length): Track coreutils.
3999 (sc_unmarked_diagnostics): Look in all files, not just *.c.
4000 (sc_useless_cpp_parens): New rule.
4001 (news-date-check): Look for version or today's date.
4002 (changelog-check): Don't require version number near head.
4003 (copyright-check): Use current year instead of hardwiring 2005.
4004 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
4005 (announcement): Add --gpg-key-ID.
4006
4007 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
4008 with "file system".
4009
2073ce56 4010 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
4011 array. Problem reported by twlevo.
4012 * src/reader.c (packgram): Prepend a new sentinel before ritem.
4013 * src/lalr.c (build_relations): Rely on new sentinel.
4014 * src/gram.c (gram_free): Adjust to new sentinel.
4015
b7691f15
JD
40162006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
4017
4018 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
4019 yylookaheadNeeds. All uses updated.
4020 (yysplitStack): Rename local yynewLookaheadStatuses to
4021 yynewLookaheadNeeds.
4022 * data/glr-regression.at (Incorrect lookahead during nondeterministic
4023 GLR): In comments, change `lookahead status' to `lookahead need'.
4024
ddee1b06
PH
40252006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4026
4027 * data/glr.c (yysplitStack): A little stylistic rewrite.
4028
12f4614d
PH
40292006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4030
4031 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
4032
32c29292
JD
40332006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
4034
4035 * doc/bison.texinfo: Fix some typos.
4036 (GLR Semantic Actions): New subsection discussing special
4037 considerations because GLR semantic actions might be deferred.
4038 (Actions): Mention look-ahead usage of yylval.
4039 (Actions and Locations): Mention look-ahead usage of yylloc.
4040 (Special Features for Use in Actions): Add YYEOF entry and mention it
4041 in the yychar entry.
4042 In the yychar entry, remove mention of the local yychar case (pure
4043 parser) since this is irrelevant information when writing semantic
148d66d8 4044 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
4045 yychar is otherwise described as an external variable.
4046 In the yychar entry, don't call it the `current' look-ahead since it
4047 isn't when semantic actions are deferred.
4048 In the yychar and yyclearin entries, add note about deferred semantic
4049 actions.
4050 Add yylloc and yylval entries discussing look-ahead usage.
4051 (Look-Ahead Tokens): When discussing yychar, don't call it the
4052 `current' look-ahead, and do mention yylval and yylloc.
4053 (Error Recovery): Cross-reference `Action Features' when mentioning
4054 yyclearin.
148d66d8 4055 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
4056 look-ahead.
4057 In the yylloc and yylval entries, mention look-ahead usage.
4058
de366a2f 40592006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
4060
4061 * tests/glr-regression.at: Update copyright year to 2006.
4062
bf70fa87
JD
40632006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4064
4065 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
4066 use during nondeterministic operation to track which stacks have
4067 actually needed the current lookahead.
4068 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
4069 Allocate, deallocate, resize, and otherwise shuffle space for
4070 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
4071 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
4072 appropriately during nondeterministic operation.
4073 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
4074 members to store the current lookahead to be used by the deferred
4075 user action.
4076 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
4077 from which the RHS is taken. Set the lookahead members of the new
4078 yySemanticOption according to the lookahead status for stack yyk.
4079 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
4080 yyaddDeferredAction.
4081 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
4082 members of yySemanticOption before invoking yyuserAction, and then set
4083 them back to their current values afterward.
4084 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
4085 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
4086 * tests/glr-regression.at: Remove `.' from the ends of recent test case
4087 titles for consistency.
4088 (Leaked merged semantic value if user action cuts parse): In order to
4089 suppress lint warnings, use arguments in merge function, and assign
4090 char value < 128 in main.
4091 (Incorrect lookahead during deterministic GLR): New test case.
4092 (Incorrect lookahead during nondeterministic GLR): New test case.
4093
05449a2c
JD
40942006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4095
de366a2f 4096 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
4097 !yyvaluep as signal that no semantic value is available to print.
4098 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
4099 to print a semantic value.
4100
4158e0a1 41012006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 4102
4158e0a1
JD
4103 * tests/glr-regression.at: For consistency with my newer test cases,
4104 don't thank myself.
4105
d659304d
JD
41062006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4107
4108 * data/glr.c (yyresolveValue): When merging semantic options, if at
4109 least one user action succeeds but a later one cuts the parse, then
4110 destroy the semantic value before returning rather than leaking it.
4111 (yyresolveStates): If a user action cuts the parse and thus
4112 yyresolveValue fails, ignore the (unset) semantic value rather than
4113 corrupting the yyGLRState, and empty the semantic options list since
4114 the user actions should have called all necessary destructors.
4115 Simplify code with YYCHK.
4116 * tests/glr-regression.at (Corrupted semantic options if user action
4117 cuts parse): New test case.
4118 (Undesirable destructors if user action cuts parse): New test case.
4119 Before applying any of this patch, this test case never actually failed
4120 for me... but only because the corrupted semantic options usually
4121 masked this bug.
4122 (Leaked merged semantic value if user action cuts parse): New test
4123 case.
4124
6ec2c0f2
AD
41252006-01-05 Akim Demaille <akim@epita.fr>
4126
4127 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
4128
1b9c21fb
PE
41292006-01-04 Paul Eggert <eggert@cs.ucla.edu>
4130
4131 * data/c.m4 (b4_c_modern): New macro, with a new provision for
4132 _MSC_VER. Problem reported by Cenzato Marco.
4133 (b4_c_function_def): Use it.
4134 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
4135 b4_c_modern.
4136 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
4137 than rolling our own.
4138
84866159
AD
41392006-01-04 Akim Demaille <akim@epita.fr>
4140
4141 Also warn about non-used mid-rule values.
4142 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
4143 member.
4144 (symbol_list_new): Adjust.
4145 * src/reader.c (symbol_typed_p): New.
4146 (grammar_rule_check): Use it.
4147 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
4148 Check its rule.
4149 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
4150 Use it.
4151 * tests/actions.at (Exotic Dollars): Adjust.
4152
378f4bd8
AD
41532006-01-04 Akim Demaille <akim@epita.fr>
4154
4155 * src/reader.c (grammar_midrule_action): If $$ is set in a
4156 mid-rule, move the `used' bit to its lhs.
4157 * tests/input.at (Unused values): New.
4158 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
4159
e2a21b6f
PE
41602006-01-03 Paul Eggert <eggert@cs.ucla.edu>
4161
54662697
PE
4162 * doc/bison.texinfo (Bison Options): Say more accurately what
4163 --yacc does.
4164 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
4165 about declarations in the grammar when in Yacc mode, as POSIX does
4166 not require a diagnostic when the grammar uses extensions.
4167
4168 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
4169
073f9288
PE
4170 Warn about dubious constructions like "%token T T".
4171 Reported by twlevo.
4172 * src/symtab.h (struct symbol.declared): New member.
4173 * src/symtab.c (symbol_new): Initialize it to false.
4174 (symbol_class_set): New arg DECLARING, specifying whether
4175 this is a declaration that we want to warn about, if there
4176 is more than one of them. All uses changed.
4177
1221b78a
PE
4178 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
4179 Allow multiple %union directives, whose contents concatenate.
4180 * src/parse-gram.y (grammar_declaration): Likewise.
4181 Use muscle_code_grow, so that we don't need stype_line any more.
4182 All uses changed.
4183
4184 * src/muscle_tab.c (muscle_grow): Fix comment.
4185
e2a21b6f
PE
4186 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
4187 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
4188 Update copyright year to 2006.
4189
8f7e3cf9
AD
41902006-01-03 Akim Demaille <akim@epita.fr>
4191
4192 Have glr.cc pass (some of) the calc.at tests.
4193 * data/glr.cc (b4_parse_param_orig): New.
4194 (b4_parse_param): Improve its definition, and bound it more
4195 clearly in the skeleton.
4196 (b4_epilogue): Append, instead of prepending, in order to keep
4197 #line consistency.
4198 Simplify the generation of auxiliary functions: locations and
4199 purity are mandated.
4200 (b4_global_tokens_and_yystype): Honor it.
4201 * data/location.cc (c++.m4): Don't include it.
4202 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
4203 and AT_SKEL_CC_IF.
4204 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
4205 AT_LALR1_CC_IF.
4206 Be sure to initialize the first position's filename.
4207 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
4208 mandated anyway.
4209 (AT_CHECK_CALC_GLR_CC): New.
4210 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
4211
3953ed88
AD
42122006-01-02 Akim Demaille <akim@epita.fr>
4213
4214 * src/output.c (output_skeleton): Don't hard wire the inclusion of
4215 c.m4.
0a96ba81 4216 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
4217 * data/glr.cc: Do not include stack.hh.
4218
9ecafbbf
AD
42192006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4220
4221 * data/glr.c: Reformat whitespace with tabs.
4222 (b4_lpure_formals): Remove this unused m4 macro.
4223 * tests/cxx-type.at: Reformat whitespace with tabs.
4224 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
4225 since it's a member. Rename type to isNterm for clarity.
4226
c4d497a0
AD
42272005-12-29 Akim <akim@sulaco.local>
4228
4229 Let glr.cc catch up with symbol_value_print.
4230 * data/glr.cc (b4_yysymprint_generate): Replace by...
4231 (b4_yy_symbol_print_generate): this.
4232 (yy_symbol_print, yy_symbol_value_print): Declare them.
4233
4517da37
PE
42342005-12-28 Paul Eggert <eggert@cs.ucla.edu>
4235
4236 * src/location.h (boundary): Note that a line or column equal
4237 to INT_MAX indicates an overflow.
4238 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
4239 (rule_length_overflow, increment_rule_length, add_column_width):
4240 New functions.
4241 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
4242 (<SC_BRACED_CODE>"}"):
4243 Use increment_rule_length rather than incrementing it by hand.
4244 (adjust_location, handle_syncline): Diagnose overflow.
4245 (handle_action_dollar, handle_action_at):
4246 Fix bug with monstrosities like $-2147483648.
4247 Remove now-unnecessary checks.
4248 (scan_integer): Verify assumptions and remove now-unnecessary checks.
4249 (convert_ucn_to_byte): Verify assumptions.
4250 (handle_syncline): New arg LOC. All callers changed.
4251 Don't store through a value derived from char const * pointer.
4252
4253 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
4254 GCC warnings.
4255
e3233bf6
PE
42562005-12-27 Paul Eggert <eggert@cs.ucla.edu>
4257
4258 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
4259 Remove unnecessary forward static decls.
4260
8f3596a6
AD
42612005-12-27 Akim Demaille <akim@epita.fr>
4262
4263 * src/reader.c (grammar_current_rule_check): Also check that $$
4264 is used.
4265 Take the rule to check as argument, hence rename as...
4266 (grammar_rule_check): this.
4267 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
4268 Rename as...
4269 (grammar_rule_begin, grammar_rule_end): these, for consistency.
4270 (grammar_midrule_action, grammar_symbol_append): Now static.
4271 * tests/torture.at (input): Don't rely on the default action
4272 being always performed.
4273 * tests/calc.at: "Set" $$ even when the action is "cut" with
4274 YYERROR or other.
4275 * tests/actions.at (Exotic Dollars): Instead of using unused
4276 values, check that the warning is issued.
4277
721be13c
PE
42782005-12-22 Paul Eggert <eggert@cs.ucla.edu>
4279
4280 * NEWS: Improve wording for unused-value warnings.
4281
a0af42fc
AD
42822005-12-22 Akim Demaille <akim@epita.fr>
4283
4284 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
4285 (b4_yysymprint_generate): Rename as...
4286 (b4_yy_symbol_print_generate): this.
4287 Generate yy_symbol_print instead of yysymprint.
4288 Generate also yy_symbol_value_print, and use it.
4289
affac613
AD
42902005-12-22 Akim Demaille <akim@epita.fr>
4291
721be13c 4292 * NEWS: Warn about unused values.
affac613
AD
4293 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
4294 a `used' member.
4295 (symbol_list_n_get, symbol_list_n_used_set): New.
4296 (symbol_list_n_type_name_get): Use symbol_list_n_get.
4297 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
4298 * src/reader.c (grammar_current_rule_check): Check that values are
4299 used.
4300 * src/symtab.c (symbol_print): Accept 0.
4301 * tests/existing.at: Remove the type information.
4302 Empty the actions.
4303 Remove useless actions (beware of mid-rule actions: perl -000
4304 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
4305 * tests/actions.at (Exotic Dollars): Use unused values.
4306 * tests/calc.at: Likewise.
4307 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4308 Likewise.
4309
4310 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
4311 rule_useful_p.
4312
9d9b8b70
PE
43132005-12-21 Paul Eggert <eggert@cs.ucla.edu>
4314
8bb4c753
PE
4315 Undo 2005-12-01 tentative license wording change. The wording is
4316 still being reviewed by the lawyers, and we don't want to wait for
4317 them before publishing a test release. For now, revert to the
4318 previous wording.
4319 * NEWS: Undo 2005-12-01 change.
4320 * data/glr.c: Revert to previous license wording.
4321 * data/glr.cc: Likewise.
4322 * data/lalr1.cc: Likewise.
4323 * data/location.cc: Likewise.
4324 * data/yacc.c: Likewise.
4325
9d9b8b70
PE
4326 * NEWS: Reword %destructor vs YYABORT etc.
4327 * data/glr.c: Use American spacing, for consistency.
4328 * data/glr.cc: Likewise.
4329 * data/lalr1.cc: Likewise.
4330 * data/yacc.c: Likewise.
4331 * data/yacc.c: Reformat comments slightly.
4332 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
4333 for consistency. Fix some spelling errors and reword recently-included
4334 text slightly.
4335 * tests/cxx-type.at: Cast results of malloc, for C++.
4336
2c3b392a
AD
43372005-12-21 Joel E. Denny <address@hidden>
4338
4339 * tests/cxx-type.at: Construct a tree, count the parents of shared
4340 nodes, and free each node once and only once. Previously, the memory
4341 for semantic values was leaked instead.
4342
d6cff4dc
AD
43432005-12-21 Joel E. Denny <address@hidden>
4344
4345 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
4346 (yylval, yylloc): If pure, #define to yystackp->yyval and
4347 yystackp->yyloc similar to yychar and yynerrs.
4348 (yyparse): If pure, remove local yylval and yylloc. Add local
4349 yystackp to accommodate pure definitions of yylval and yylloc.
4350 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
4351 yylvalp and yyllocp to &yylval and &yylloc.
4352 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
4353 namespace. Previously, nerrs and char were missing, but lval and lloc
4354 weren't necessary.
4355 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
4356 yylvalp and yyllocp parameters since, if pure, these are now always
4357 accessible through yystackp. If not pure, they are still accessible
4358 globally.
4359 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
4360 `if (YYID (N))' to pacify lint.
4361
a85284cf
AD
43622005-12-21 Akim Demaille <akim@epita.fr>
4363
4364 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
4365 destroy the RHS symbols of a rule.
4366 * data/yacc.c (yylen): Initialize to 0.
4367 Keep its value to the number of items to possibly shift.
4368 In particular, a regular successful parse that ends on YYFINAL by
4369 a (internal) YYACCEPT must not have yylen != 0.
4370 (yyerrorlab, yyreturn): Pop the RHS.
4371 Reorder a bit to emphasize the `shifting' bits of code.
4372 (YYPOPSTACK): Now accept a number of items to pop.
4373 * data/lalr1.cc: Likewise.
4374 * data/glr.c: Formatting changes.
4375 Use goto instead of fall through.
4376 * doc/bison.texinfo (Destructor Decl): Complete.
4377
d508c281
JMG
43782005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4379
4380 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4381 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
4382 * djgpp/config.bat: Replace every occurence of the file name
4383 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4384 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4385 * djgpp/config.sed: Replace every occurence of the file name
4386 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4387 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4388 * djgpp/djunpack.bat: DJGPP specific file.
4389 * djgpp/fnchange.lst: DJGPP specific file.
4390 * djgpp/README.in: Add new information about how to unpack the bison
4391 source on MSDOS and other systems which have 8.3 file name restrictions
4392 using djunpack.bat and fnchange.lst.
4393
3e7a2cd9
PE
43942005-12-12 Paul Eggert <eggert@cs.ucla.edu>
4395
4396 * bootstrap (build_cvs_prefix): Remove; unused.
4397 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
4398 when getting gnulib.
4399
44002005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
4401
4402 * data/glr.c: Reorder typedef declarations for structs to match order
4403 of struct declarations.
4404 Rename yystack everywhere to yystackp except in yyparse where it's not
4405 a pointer.
4406 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
4407 consistency.
4408 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
4409 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
4410 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
4411 lint.
4412
877519f8
PE
44132005-12-09 Paul Eggert <eggert@cs.ucla.edu>
4414
0eca5a39
PE
4415 * tests/sets.at (Accept): Fix typos in regular expression used to
4416 sed out the final state number.
4417
2cec9080
PE
4418 Work around portability problem on Solaris 10: flex-generated
4419 files include <stdio.h> before <config.h>, which messes up
4420 because the latter defines __EXTENSIONS__. Address the problem
4421 by creating two new little files that include <config.h> first,
4422 then include the flex-generated files. Rewrite everyone else
4423 to include <config.h> first, as well.
4424 * lib/timevar.c: Always include "config.h".
4425 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
4426 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
4427 (EXTRA_bison_SOURCES): New macro.
4428 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
4429 * src/system.h: Don't include config.h.
4430 * src/LR0.c: Include <config.h> first.
4431 * src/assoc.c: Likewise.
4432 * src/closure.c: Likewise.
4433 * src/complain.c: Likewise.
4434 * src/conflicts.c: Likewise.
4435 * src/derives.c: Likewise.
4436 * src/files.c: Likewise.
4437 * src/getargs.c: Likewise.
4438 * src/gram.c: Likewise.
4439 * src/lalr.c: Likewise.
4440 * src/location.c: Likewise.
4441 * src/main.c: Likewise.
4442 * src/muscle_tab.c: Likewise.
4443 * src/nullable.c: Likewise.
4444 * src/output.c: Likewise.
4445 * src/parse-gram.y: Likewise.
4446 * src/print.c: Likewise.
4447 * src/print_graph.c: Likewise.
4448 * src/reader.c: Likewise.
4449 * src/reduce.c: Likewise.
4450 * src/relation.c: Likewise.
4451 * src/state.c: Likewise.
4452 * src/symlist.c: Likewise.
4453 * src/symtab.c: Likewise.
4454 * src/tables.c: Likewise.
4455 * src/uniqstr.c: Likewise.
4456 * src/vcg.c: Likewise.
4457
877519f8
PE
4458 * src/parse-gram.y: Fix minor problems uncovered by lint.
4459 (current_lhs, current_lhs_location): Now static.
4460 (current_assoc): Remove unused variable.
4461
4462 Cleanups so that Bison-generated parsers have less lint.
4463 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
4464 Prepend /*ARGSUSED*/, for lint's sake.
4465 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
4466 definition if 'lint' is defined.
4467 (YYID): New macro (or function, if lint).
4468 All uses of /*CONSTCOND*/0 replaced by YYID(0).
4469 * data/yacc.c: Likewise.
4470 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
4471 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
4472 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
4473 is C++ only.
4474 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
4475 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
4476 Use YYID(0) rather than 0, for lint.
4477 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
4478 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
4479
f5228370
PE
44802005-12-07 Paul Eggert <eggert@cs.ucla.edu>
4481
4482 * tests/glr-regression.at
4483 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4484 Close memory leak reported by twlevo.
4485
69ce078b
PE
44862005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
4487
6ff99711
PE
4488 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
4489 all stacks.
4490 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
4491 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4492 New test case.
4493 (Duplicated user destructor for lookahead): This test now is expected
4494 to succeed.
4495
af3412cd
PE
44962005-12-01 Paul Eggert <eggert@cs.ucla.edu>
4497
32b5b719 4498 * NEWS: Document the following change.
af3412cd
PE
4499 * data/yacc.c: Say "parser skeleton" rather than "file", since
4500 it's no longer just a file.
4501 * data/glr.c: Grant a special exception for C GLR parsers, that
4502 reads like the already-existing exception for C LALR(1) parsers.
4503 * data/glr.cc: Likewise.
4504 * data/lalr1.cc: Likewise.
4505 * data/location.cc: Likewise.
4506 * data/yacc.c: Reword the "written by" statement to clarify that
4507 it was the parser skeleton, not the entire output file.
4508 * data/glr.c: Written by Paul Hilfinger.
4509 * data/glr.cc: Written by Akim Demaille.
4510 * data/lalr1.cc: Likewise.
4511
035aa4a0
PE
45122005-11-18 Paul Eggert <eggert@cs.ucla.edu>
4513
d9963c85
PE
4514 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
4515 Fix typos in previous change that broke 'make check'.
4516 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
4517 supported in C.
4518 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
4519 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
4520 We can revert this once things settle down.
4521
035aa4a0
PE
4522 * src/conflicts.c (conflicts_print): Don't print file name twice
4523 when %expect fails because there were no conflicts.
4524 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
4525 change.
4526 * tests/conflicts.at (%expect not enough, %expect too much):
4527 (%expect with reduce conflicts): Adjust to new behavior.
4528
45292005-11-18 Akim Demaille <akim@epita.fr>
4530
4531 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
4532 errors.
4533 * NEWS: Document this.
4534 * doc/bison.texinfo (Expect Decl): Likewise.
4535
d1ff7a7c
AD
45362005-11-16 Akim Demaille <akim@epita.fr>
4537
4538 Generalize the display of semantic values and locations in traces.
4539 * data/glr.c (yy_reduce_print): Fix indices (again).
4540 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
4541 literal integers.
4542 * data/lalr1.cc (yyreduce_print): Rename as...
4543 (yy_reduce_print): this.
4544 Display values and locations.
4545 * data/yacc.c (yy_reduce_print): Likewise.
4546 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
4547 (yysymprint): Move higher to be visible from yy_reduce_print).
4548 (yyparse): Adjust.
4549 * tests/calc.at: Adjust the expected length of the traces.
4550
6de5398d
AD
45512005-11-14 Akim Demaille <akim@epita.fr>
4552
4553 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
4554 from 1 to N, while values and location start at 0.
4555 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
4556
a1373f55
AD
45572005-11-14 Akim Demaille <akim@epita.fr>
4558
4559 * data/glr.c (yy_reduce_print): Fix the $ number.
4560
613d8952
AD
45612005-11-14 Akim Demaille <akim@epita.fr>
4562
4563 "Use" parse parameters.
4564 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
4565 * data/glr.c, data/glr.cc: Use them.
4566 * data/glr.c (YYUSE): Have a C++ definition that supports
4567 non-pointer types.
4568
b2741627
AD
45692005-11-14 Akim Demaille <akim@epita.fr>
4570
4571 * data/glr.c (yyexpandGLRStack): Declare only if defined.
4572
5059b5c8
AD
45732005-11-14 Akim Demaille <akim@epita.fr>
4574
42249483
AD
4575 * data/glr.cc: New.
4576 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 4577
4626a15d
AD
45782005-11-12 Akim Demaille <akim@epita.fr>
4579
4580 Let position and location be PODs.
4581 * data/location.cc (position::initialize, location::initialize): New.
4582 (position::position, location::location): Define only if
4583 b4_location_constructors is defined.
4584 * data/lalr1.cc (b4_location_constructors): Define it for backward
4585 compatibility.
4586 * doc/bison.texinfo (Initial Action Decl): Use initialize.
4587
45882005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
4589
4590 * data/lalr1.cc: Move the body of the ctor and dtor into the
4591 parser file (instead of the header).
4592 Wrap the implementations in a "namespace yy".
4593
45942005-11-12 Akim Demaille <akim@epita.fr>
4595
4596 Have glr.c include its header file when created.
4597 * data/glr.c (b4_shared_declarations): New.
4598 Output them verbatim in the parser if !%defines, otherwise
4599 output then in the header file, and include it instead.
4600
1989d947
AD
46012005-11-11 Akim Demaille <akim@epita.fr>
4602
4603 * data/glr.c: Comment changes.
4604
46052005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
4606
4607 When yydebug, report semantic and location values for reductions.
4608 * data/glr.c (yy_reduce_print): Report the semantic values and the
4609 locations.
4610 (YY_REDUCE_PRINT): Adjust.
4611 (yyglrReduce): Use them.
4612 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
4613 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
4614 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
4615 traces.
4616
02998094
AD
46172005-11-10 Akim Demaille <akim@epita.fr>
4618
4619 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
4620 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
4621 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
4622
5210672f
PE
46232005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
4624
4625 * m4/cxx.m4, examples/Makefile.am: Don't build
4626 examples/calc++ if no C++ compiler is available. (trivial change)
4627
a8991a1d
AD
46282005-11-09 Akim Demaille <akim@epita.fr>
4629
4630 * src/scan-skel.l: Use a couple of asserts.
4631
36b5e963
AD
46322005-11-03 Akim Demaille <akim@epita.fr>
4633
4634 In some (weird) cases, the final state number is incorrect.
4635 Reported by Alexandre Duret-Lutz.
4636 * src/LR0.c (state_list_append): Remove the computation of
4637 final_state.
4638 (save_reductions): Do it here.
4639 (get_state): Alpha conversion.
4640 (generate_states): Use a for loop.
4641 * src/gram.h (item_number_is_rule_number)
4642 (item_number_is_symbol_number): New.
4643 * src/state.c: Use assert.
4644 * src/system.h: Include assert.h.
4645 * tests/sets.at (Accept): New.
4646
44e7ead1
PH
46472005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4648
4649 * data/glr.c (yyfill): Adjust comment.
36b5e963 4650 (yyresolveAction): Initialize default location properly
44e7ead1
PH
4651 for empty right-hand sides.
4652 (yydoAction): Ditto.
4653 Add comment explaining apparently dead code.
36b5e963
AD
4654 * tests/glr-regression.at
4655 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 4656 New test.
36b5e963 4657
e10a80ee
PE
46582005-10-30 Paul Eggert <eggert@cs.ucla.edu>
4659
4660 * bootstrap (cleanup_gnulib): New function. Use it to clean up
4661 gnulib when interrupted. This fixes some race conditions and
4662 works around some portability problems (one noted by Paul
4663 Hilfinger).
4664
067b32ee
AD
46652005-10-22 Akim <akim@epita.fr>
4666
4667 * Makefile.cfg: Adjust to config -> build-aux.
4668 Reported by twledo.
4669
4b367315
AD
46702005-10-21 Akim Demaille <akim@epita.fr>
4671
4672 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
4673 the %parse-params.
4674 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
4675 * data/yacc.c (b4_Pure_if): Rename as...
4676 (b4_yacc_pure_if): this.
4677 (YY_SYMBOL_PRINT, yyparse): Adjust.
4678 * doc/bison.texinfo: Formatting changes.
4679
24cc23d9
AD
46802005-10-21 Akim Demaille <akim@epita.fr>
4681
4682 Finish the transition config -> build-aux.
4683 * configure.ac, Makefile.am: Use build-aux.
4684 * config/prev-version, config/announce-gen, config/Makefile.am:
4685 Move to...
4686 * build-aux/prev-version, build-aux/announce-gen,
4687 * build-aux/Makefile.am: here.
4688
d4476375
AD
46892005-10-14 Akim Demaille <akim@epita.fr>
4690
4691 * examples/calc++/test: Use set -x only when VERBOSE.
4692
302c0aee
PE
46932005-10-13 Paul Eggert <eggert@cs.ucla.edu>
4694
4695 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
4696 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
4697
7625ec2c
AD
46982005-10-13 Akim Demaille <akim@epita.fr>
4699
4700 * src/scan-skel.l: Output the base name parts of the parser and
4701 header file names.
302c0aee 4702 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
4703 additional checks.
4704 Use this to exercise C++ outputs in subdirs.
4705 Reported by Oleg Smolsky.
4706
ba0fe3c7
PE
47072005-10-12 Paul Eggert <eggert@cs.ucla.edu>
4708
4709 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
4710 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
4711 Problem reported by John P. Hartmann.
4712 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
4713 already defined it.
4714
9b8a5ce0
AD
47152005-10-12 Akim Demaille <akim@epita.fr>
4716
4717 * src/parse-gram.y (version_check): Exit 63 to please missing
4718 (stands for "version mismatch).
4719 * tests/input.at, doc/bison.texinfo: Adjust.
4720
4f6e011e
PE
47212005-10-10 Paul Eggert <eggert@cs.ucla.edu>
4722
4723 Work around portability problems with Visual Age C compiler
4724 (xlc and xlC_r) reported by John P. Hartmann.
4725 * data/location.cc (initial_column, initial_line): Remove.
4726 All uses replaced by 0 and 1.
4727 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
4728 that xlc complains about.
4729 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 4730 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 4731 as __STDC__.
4d7aa45e
PE
4732 * data/yacc.c (YYMODERN_C): New macro, which also looks at
4733 __STDC_VERSION__. Use it everywhere instead of looking at
4734 __STDC__ and __cplusplus.
4f6e011e 4735
a1b3bf8c
AD
47362005-10-10 Akim Demaille <akim@epita.fr>
4737
4738 * examples/calc++/test: Be quiet unless VERBOSE.
4739
412e44aa
PE
47402005-10-05 Paul Eggert <eggert@cs.ucla.edu>
4741
2a4647a3
PE
4742 * data/c.m4 (yydestruct, yysymprint):
4743 Use YYUSE instead of casting to void.
4744 * data/glr.c (YYUSE): New macro.
4745 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4746 Use it instead of rolling our own.
4747 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4748 (YYCHK1):
4749 Use /*CONSTCOND*/ to suppress lint warnings.
4750 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4751 (YY_STACK_PRINT): Use 'false' not '0'.
4752 (YYUSE): New macro.
4753 (yysymprint_, yydestruct_): Use it instead of rolling our own.
4754 * data/yacc.c (YYUSE): New macro.
4755 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
4756 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
4757 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
4758
4759
412e44aa
PE
4760 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
4761 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
4762
88c6637f
PE
47632005-10-04 Paul Eggert <eggert@cs.ucla.edu>
4764
2f4f028d
PE
4765 Undo the parts of the unlocked-I/O change that substituted
4766 putc or puts for printf. This might hurt performance a bit,
4767 but some people prefer the printf style.
4768 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
4769 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
4770 All uses replaced by YYFPRINTF and YYDPRINTF.
4771 * data/yacc.c: Likewise.
4772 * lib/bitset.c (bitset_print): Likewise.
4773 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
4774 putc and puts.
4775 * lib/lbitset.c (debug_lbitset): Likewise.
4776 * src/closure.c (print_firsts, print_fderives): Likewise.
4777 * src/gram.c (grammar_dump): Likewise.
4778 * src/lalr.c (look_ahead_tokens_print): Likewise.
4779 * src/output.c (escaped_output): Likewise.
4780 (user_actions_output): Break apart two printfs.
4781 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
4782 * src/reduce.c (reduce_print): Likewise.
4783 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4784 * src/system.h: Include unlocked-io.h rathe than stdio.h.
4785
88c6637f
PE
4786 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4787 Use assignments rather than casts-to-void to suppress
4788 unused-variable warnings. This pacifies 'lint'.
4789 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
4790 unused-variable warnings.
4791
fb32e373
JMG
47922005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4793
4794 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4795
edb8f44f
PE
47962005-10-02 Paul Eggert <eggert@cs.ucla.edu>
4797
fb9c0b33
PE
4798 Use unlocked I/O for a minor performance improvement on hosts like
4799 GNU/Linux and Solaris that support unlocked I/O. The basic idea
4800 is to use the gnlib unlocked-io module, and to prefer putc and
4801 puts to printf when either will work (since the latter doesn't
4802 come in an unlocked flavor).
4803 * bootstrap (gnulib_modules): Add unlocked-io.
4804 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
4805 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
4806 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
4807 and similarly for puts and putc and printf.
4808 * data/yacc.c: Likewise.
4809 * lib/bitset.c (bitset_print): Likewise.
4810 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
4811 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
4812 to printf.
4813 * lib/lbitset.c (debug_lbitset): Likewise.
4814 * src/closure.c (print_firsts, print_fderives): Likewise.
4815 * src/gram.c (grammar_dump): Likewise.
4816 * src/lalr.c (look_ahead_tokens_print): Likewise.
4817 * src/output.c (escaped_output): Likewise.
4818 (user_actions_output): Coalesce two printfs.
2f4f028d 4819 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
4820 * src/reduce.c (reduce_print): Likewise.
4821 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 4822 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 4823
edb8f44f
PE
4824 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
4825 this confuses xgettext.
4826
b50d2359
AD
48272005-10-02 Akim Demaille <akim@epita.fr>
4828
4829 * bootstrap (gnulib_modules): Add strverscmp.
4830 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
4831 * m4/.cvsignore: Add strverscmp.m4.
4832 * src/parse-gram.y (%require): New token, new rule.
4833 (version_check): New.
4834 * src/scan-gram.l (%require): Adjust.
4835 * tests/input.at (AT_REQUIRE): New.
4836 Use it.
4837 * doc/bison.texinfo (Require Decl): New.
4838 (Calc++ Parser): Use %require.
4839
21667f64
AD
48402005-10-02 Akim Demaille <akim@epita.fr>
4841
4842 * data/location.cc: New.
4843
2b81e969
AD
48442005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
4845 Akim Demaille <akim@epita.fr>
4846
4847 Make sure -odir/foo.cc creates dir/location.hh etc.
4848 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
4849 (spec_file_prefix, spec_verbose_file, spec_graph_file)
4850 (spec_defines_file): Now const.
4851 (dir_prefix): New.
4852 (short_base_name): Remove.
4853 * src/files.c: Adjust.
4854 (dirname.h): Include.
4855 (base_name): Don't prototype it.
4856 (finput): Remove, duplicates gram_in.
4857 (full_base_name, short_base_name): Replace by...
4858 (all_but_ext, all_but_tab_ext): these.
4859 (compute_base_names): Rename as...
4860 (compute_file_name_parts): this.
4861 Update to compute the new variables, including dir_prefix.
4862 Adjust dependencies.
4863 * src/output.c (prepare): Output them.
4864 * src/reader.c: Adjust to use gram_in, not finput.
4865 * src/scan-skel.l (@dir_prefix@): New.
4866
ad6a9b97
JMG
48672005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4868
4869 * lib/subpipe.c: New function end_of_output_subpipe() added
4870 to allow support for non-posix systems. This is a no-op function
4871 for posix systems.
4872
4873 * lib/subpipe.h: New function end_of_output_subpipe() added
4874 to allow support for non-posix systems. This is a no-op function
4875 for posix systems.
4876
4877 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
4878 handle the lack of pipe/fork functionality on non-posix systems.
4879
4880 * djgpp/Makefile.maint: DJGPP specific file.
4881
4882 * djgpp/README.in: DJGPP specific file.
4883
4884 * djgpp/config.bat: DJGPP specific configuration file.
4885
4886 * djgpp/config.sed: DJGPP specific configuration file.
4887
4888 * djgpp/config.site: DJGPP specific configuration file.
4889
4890 * djgpp/config_h.sed: DJGPP specific configuration file.
4891
4892 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
4893
4894 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
4895
fc695704
AD
48962005-10-02 Akim Demaille <akim@epita.fr>
4897
4898 * data/location.cc: New, extract from...
4899 * data/lalr1.cc: here.
4900 (location.hh): Include it after the user prologue, in case the
4901 filename type is defined by the user.
4902 Forward declation location and position before the pre-prologue.
4903 (yyresult_): Rename as...
4904 (yyresult): this, it's a local variable, not an attribute.
4905 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
4906
49072005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
4908
4909 * examples/extexi: Restore the #line generation.
4910
fb9712a9
AD
49112005-09-30 Akim Demaille <akim@epita.fr>,
4912 Alexandre Duret-Lutz <adl@gnu.org>
4913
4914 Move the token type and YYSTYPE in the parser class.
4915 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
4916 (parser::token): New, from the moved free definition of tokens.
4917 (parser::semantic_value): Now a full definition instead of an
4918 indirection to YYSTYPE.
4919 (b4_post_prologue): No longer included in the header file, but
4920 in the implementation file.
4921 * doc/bison.texi (C+ Language Interface): Update.
4922 * src/parse-gram.y: Support unary %define.
4923 * tests/actions.at: Define global_tokens_and_yystype for backward
4924 compatibility until we update the tests.
4925 * tests/calc.at: Idem.
4926 (first_line, first_column, last_line, last_column): Define for lalr1.cc
4927 to simplify the code.
4928
55f0c7b1
PE
49292005-09-29 Paul Eggert <eggert@cs.ucla.edu>
4930
4931 Port to SunOS 4.1.4, which lacks strtoul and strerror.
4932 Ah, the good old days! Problem reported by Peter Klein.
4933 * bootstrap (gnulib_modules): Add strerror, strtoul.
4934 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
4935 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
4936
fb9712a9 49372005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
4938
4939 * data/c.m4 (b4_error_verbose_if): New.
4940 * data/lalr1.cc: Use it.
4941 (YYERROR_VERBOSE_IF): Remove.
4942 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
4943 parser members, replaced by...
4944 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
4945 local variables.
4946 (yysyntax_error_): Takes the state number as argument.
4947 (yyreduce_print_): Use the argument yyrule, not the former
4948 attribute yyn_.
4949
8a6f72f3
PE
49502005-09-26 Paul Eggert <eggert@cs.ucla.edu>
4951
4952 * bootstrap (gnulib_modules): Add verify.
4953 * lib/.cvsignore: Add verify.h.
4954 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
4955 * src/system.h (verify): Remove.
4956 Include verify.h instead.
4957 * src/tables.c (tables_generate): Use new API for 'verify'.
4958
0d50976f
PE
49592005-09-21 Paul Eggert <eggert@cs.ucla.edu>
4960
ebc3737e
PE
4961 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
4962 local variables whose names begin with 'yy'.
4963 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4964 Trivial changes from Joel E. Denny.
4965
0d50976f
PE
4966 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
4967 it itself.
4968 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
4969 don't use alloca any more.
4970
4971 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
4972 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 4973 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
4974 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
4975 to match yacc.c, to test more hosts.
4976
a05b79df
PE
49772005-09-20 Paul Eggert <eggert@cs.ucla.edu>
4978
55289366
PE
4979 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
4980 doesn't affect behavior.
4981 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
4982 Solaris, AIX, MSC.
4983 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
4984 This works a bit better with glibc, if user code has already included
4985 stdlib.h.
4986 * doc/bison.texinfo (Bison Parser): Document that users can't
4987 arbitrarily use malloc and free for other purposes. Document
4988 that <alloca.h> and <malloc.h> might be included.
4989 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
4990 user must declare alloca.
4991
a05b79df
PE
4992 * HACKING (release): Forwarn the Translation Project about
4993 stable releses.
4994
3ab2ca22
AD
49952005-09-20 Akim Demaille <akim@epita.fr>
4996
4997 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
4998
a9739e7c
PE
49992005-09-19 Paul Eggert <eggert@cs.ucla.edu>
5000
a702593e
PE
5001 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
5002 (YYSTACK_ALLOC_MAXIMUM): Use it.
5003 (yysyntax_error): New function.
5004 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
5005 multiple syntax errors are reported, and alloca is being used.
5006 Instead, reallocate buffers twice as big each time, so that
5007 we waste at most half the allocated memory. Start with a small
5008 (128-byte) buffer that will suffice in most cases anyway.
5009 Use yysyntax_error to do most of the work.
5010
5011 * doc/bison.texinfo (Error Reporting, Table of Symbols):
5012 yynerrs is the number of errors reported, not the number of
5013 errors encountered.
5014
a9739e7c
PE
5015 * tests/glr-regression.at (Duplicated user destructor for lookahead):
5016 Mark it as expected to fail.
5017 Cast result of malloc; problem reported by twlevo@xs4all.nl.
5018 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
5019 Don't start user-code symbols with "yy", to avoid name space problems.
5020
f479c6c6
AD
50212005-09-19 Akim Demaille <akim@epita.fr>
5022
5023 Remove the traits, failed experiment.
5024 It never proved useful, and anyway because of the current
5025 definition, it was not possible to have several specialization of
5026 this traits, making it useless.
5027 * data/lalr1.cc (yy:traits): Remove.
5028 Inline its definitions in the parser class.
5029
e2586f82
AD
50302005-09-19 Akim Demaille <akim@epita.fr>
5031
5032 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
5033 least Mac OSX with a /usr/local install of gettext.
5034
2e8cf949
AD
50352005-09-19 Akim Demaille <akim@epita.fr>
5036
5037 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
5038 and yytoken for similarity with the other skeletons.
5039
c7fb0b90
AD
50402005-09-19 Akim Demaille <akim@epita.fr>
5041
4e26c69e 5042 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 5043
1bd0deda
PE
50442005-09-16 Paul Eggert <eggert@cs.ucla.edu>
5045
5046 * NEWS: Version 2.1.
5047
5048 * NEWS: Remove notice of yytname change, since it was never in an
5049 official release.
5050 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
5051 diagnostic.
5052 * src/output.c (prepare): Likewise.
5053 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
5054 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
5055 is not defined. This is an awful hack, but it's enough for now.
5056 All callers changed.
5057 * tests/glr-regression-at (make_value): Args are const pointers now,
5058 to avoid GCC warning.
5059 (Duplicated user destructor for lookahead): New test. Currently
5060 skipped. It fails on my host but I'm not sure it'll always fail.
5061
50622005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
5063
5064 * src/symtab.h (struct symbol): Declare the printer and destructor
5065 as const, to avoid accidental calls to free.
5066 (symbol_destructor_set, symbol_printer_set): Adjust.
5067 * src/symtab.c: Adjust.
5068
1bd0deda 50692005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
5070
5071 * data/c.m4 (b4_token_enums): New.
5072 (b4_token_defines): Rename as...
5073 (b4_token_enums_defines): this.
5074 (b4_token_defines): New, output only the #defines.
5075 * data/yacc.c, data/glr.c: Adjust.
5076 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
5077 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
5078 as default values.
5079
dbcdae2d
AD
50802005-09-16 Akim Demaille <akim@epita.fr>
5081
5082 * data/lalr1.cc (yylex_): Remove, inline its code.
5083 (yyreport_syntax_error_): Remove, replaced by...
5084 (yysyntax_error_): this which returns a string and leaves to the
5085 caller the call to the users' error function.
5086 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
5087 Move from members of the parser object...
5088 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
5089 to local variables of the parse function.
5090
70d8f291
AD
50912005-09-16 Akim Demaille <akim@epita.fr>
5092
5093 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
5094 since it's in Bison's name space.
5095
b47dbebe
PE
50962005-09-15 Paul Eggert <eggert@cs.ucla.edu>
5097
ae199bf1
PE
5098 * data/glr.c (yyresolveValue): Add default case to pacify
5099 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
5100
b47dbebe
PE
5101 * NEWS: Document when yyparse started to return 2.
5102 * doc/bison.texinfo (Parser Function): Document when yyparse
5103 returns 2.
5104
5105 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
5106 (b4_filename_type): Renamed back from b4_file_name_type. All uses
5107 changed.
5108 (class position): file_name -> filename (reverting). All uses changed.
5109
51102005-09-14 Paul Eggert <eggert@cs.ucla.edu>
5111
5112 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
5113 do anything if $@ exists. This reverts part of the 2005-07-07
5114 patch.
5115
00292f66
PE
51162005-09-11 Paul Eggert <eggert@cs.ucla.edu>
5117
5118 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
5119 contains obsolete information and isn't worth distributing as a
5120 separate file anyway.
5121 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
5122 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
5123 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
5124 (yyparse): Abort if user code uses longjmp to throw an unexpected
5125 value.
5126
a420f962
PE
51272005-09-09 Paul Eggert <eggert@cs.ucla.edu>
5128
00292f66
PE
5129 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
5130 Suggested by twlevo@xs4all.nl.
5131
127287e9
PE
5132 * data/glr.c (YYCHK1): Do not assume YYE is in range.
5133 This avoids a diagnostic from gcc -Wswitch-enum.
5134 Problem reported by twlevo@xs4all.nl.
5135
a420f962
PE
5136 * doc/bison.texinfo: Don't use "filename", as per GNU coding
5137 standards. Use "file name" or "file" or "name", depending on
5138 the context.
5139 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
5140 not to hack/foo.tab.c.
5141 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
5142 * data/glr.c: b4_filename -> b4_file_name.
5143 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
5144 All uses changed.
5145 (class position): filename -> file_name. All uses changed.
5146 * data/yacc.c: b4_filename -> b4_file_name.
5147 * lib/bitset.h: filename -> file_name in local vars.
5148 * lib/bitset_stats.c: Likewise.
5149 * src/files.c: Likewise.
5150 * src/scan-skel.l ("@output ".*\n): Likewise.
5151 * src/files.c (file_name_split): Renamed from filename_split.
5152 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
5153
51542005-09-08 Paul Eggert <eggert@cs.ucla.edu>
5155
5156 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
5157 to accommodate latest gnulib.
5158
5159 * tests/glr-regression.at (Duplicate representation of merged trees):
5160 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
5161
5162 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
5163 needed.
5164
42a6501d
PE
51652005-08-26 Paul Eggert <eggert@cs.ucla.edu>
5166
5167 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
5168 All uses changed. Invoke user destructor after an error during a
5169 split parse (trivial change from Joel E. Denny).
5170
5171 * tests/glr-regression.at
5172 (User destructor after an error during a split parse): New test case.
5173 Problem reported by Joel E. Denny in:
5174 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
5175
ef9a1faf
PE
51762005-08-25 Paul Eggert <eggert@cs.ucla.edu>
5177
5b4aaf78
PE
5178 * README-cvs: Give URLs for recommended tools.
5179 Mention Gzip version problem, and bootstrapping issues.
5180 Remove troubleshooting section, as it's somewhat obsolete.
5181
b5240ba5
PE
5182 * bootstrap (no_cache): New var, to accommodate different wget
5183 variants. Use it instead of '-C off'. Problem reported by
5184 twlevo@xs4all.nl.
5185
ef9a1faf
PE
5186 * data/glr.c (yydestroyStackItem): New function.
5187 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
5188 debugging information. Problem reported by Joel E. Denny.
5189
e6efa9da
AD
51902005-08-25 Akim Demaille <akim@epita.fr>
5191
5192 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
5193
adc90f13
PE
51942005-08-24 Paul Eggert <eggert@cs.ucla.edu>
5195
5196 * data/glr.c (yyrecoverSyntaxError, yyreturn):
5197 Don't invoke destructor on unresolved entries.
5198 * tests/glr-regression.at
5199 (User destructor for unresolved GLR semantic value): New test case.
5200 Problem reported by Joel E. Denny in:
5201 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
5202
f9315de5
PE
52032005-08-21 Paul Eggert <eggert@cs.ucla.edu>
5204
15d29c1f
PE
5205 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
5206 Add strnlen.c.
5207 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
5208 lib-prefix.m4, po.m4.
5209
dd5f2af2
PE
5210 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
5211 in yydestruct diagnostic, since it might not be an error.
5212 Problem reported by Joel Denny near end of
5213 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 5214 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
5215 * data/yacc.c (yyreturn): Likewise.
5216 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
5217
5218 * src/files.c: Remove obsolete FIXME comment.
5219
5220 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
5221 with the other templates, and to fix bogus run-on messages such
5222 as the one reported at the end of
5223 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5224 All callers changed to avoid the newline.
5225 (yyprocessOneStack): Output two lines rather than one, to accommodate
5226 the above change. This changes the debug output format slightly.
5227
f9315de5
PE
5228 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
5229 reported by Joel E. Denny in
5230 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
5231 (trivial change).
5232 * tests/glr-regression.at (Duplicate representation of merged trees):
5233 New test, from Joel E. Denny in:
5234 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
5235 * THANKS: Add Joel E. Denny.
5236
5237 * configure.ac (AC_INIT): Bump to 2.0c.
5238
04098407
PE
52392005-07-24 Paul Eggert <eggert@cs.ucla.edu>
5240
5241 * NEWS: Version 2.0b.
5242
ca5d2013
PE
5243 * Makefile.am (SUBDIRS): Put examples before tests, so that
5244 "make check" doesn't finish with "All 1 tests passed".
5245
3d54b576
PE
5246 * tests/regression.at (Token definitions): Don't rely on
5247 AT_PARSER_CHECK for data that contains backslashes. It currently
5248 uses 'echo', and 'echo' isn't portable if its argument contains
5249 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
5250 that the byte '\0xff' is not printable in the C locale; it is,
5251 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
5252 not printable, so use '\0x81' to test.
5253
d53ae497
PE
5254 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
5255 version of GCC, since the macro is used with non-GCC compilers.
5256
fc01665e
PE
5257 Fix core dump reported by Pablo De Napoli in
5258 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
5259 * tests/regression.at (Invalid inputs with {}): New test.
5260 * src/parse-gram.y (token_name): Translate type before using
5261 it as an index.
5262
04098407
PE
5263 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
5264 the user's name space. All uses changed to __attribute__
5265 ((__unused__)).
5266 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
5267 Add __attribute__ ((__noreturn__)).
5268
5269 * etc/clcommit: Remove. We weren't using it, and it failed
5270 "make maintainer-distcheck".
5271 * Makefile.maint: Merge from coreutils.
5272 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
5273 (syntax-check-rules): Change list of rules as described below.
5274 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
5275 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
5276 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
5277 (sc_trailing_space): New rules.
5278 (sc_xalloc_h_in_src): Remove.
5279 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
5280 (sc_space_tab, sc_error_exit_success, sc_changelog):
5281 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
5282 (makefile-check, po-check, author_mark_check):
5283 (makefile_path_separator_check, copyright-check):
5284 Use grep -n, to make it easier to find violations.
5285 Use CVS_LIST and CVS_LIST_EXCEPT.
5286 (header_regexp, h_re): Remove.
5287 (dd_c): New macro.
5288 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
5289 (my-distcheck): Use more-modern GCC flags.
5290 (signatures, %.asc): Remove.
5291 (rel-files, announcement): Remove signatures.
5292 Restore old updating code, even though we don't use it, so
5293 that we're the same as coreutils.
5294 (alpha, beta, major): Depend on news-date-check.
5295 Make the upload commands.
5296
5297 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
5298 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
5299 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
5300 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
5301 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
5302 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
5303 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
5304 * tests/sets.at: Likewise.
5305
5306 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
5307 we comment out the Autoconf version number.
5308 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
5309 it's error-prone and "make maintainer-distcheck" rejects it.
5310
5311 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
5312 Indent calls to "error" to pacify "make maintainer-distcheck",
5313 when the calls are not intended to be translated.
5314 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
5315
5316 * src/Makefile.am (DEFS): Use +=, to pacify
5317 "make maintainer-distcheck".
5318 (bison_SOURCES): Add scan-skel.h.
5319 (sc_tight_scope): New rule, from coreutils.
5320
5321 * src/files.c (src_extension, header_extension):
5322 Now static, not extern.
5323 * src/getargs.c (short_options): Likewise.
5324 * src/muscle_tab.c (muscle_table): Likewise.
5325 * src/parse-gram.y (current_class, current_type, current_prec):
5326 Likewise.
5327 * src/reader.c (grammar_end, previous_rule_end): Likewise.
5328 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
5329 * src/main.c (main): Cast bindtextdomain and textdomain calls to
5330 void, to avoid warning when NLS is disabled.
5331 * src/output.c: Include scan-skel.h.
5332 (scan_skel): Remove decl, since scan-skel.h does this.
5333 (output_skeleton):
5334 Indent calls to "error" to pacify "make maintainer-distcheck".
5335 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
5336 * src/reader.h (gram_end, gram_lineno): New decls to pacify
5337 "make maintainer-distcheck".
5338 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
5339 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
5340 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
5341 (skel_lex_destroy, scan_skel): Move these decls to...
5342 * src/scan-skel.h: New file.
5343 * src/uniqstr.c (uniqstr_assert):
5344 Indent calls to "error" to pacify "make maintainer-distcheck".
5345
5346 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
5347 not @VAR@.
5348
5349 * tests/torture.at: Revamp to avoid misuse of atoi that
5350 "make maintainer-distcheck" complained about.
5351
5352 * examples/extexi (message): Don't print a message more than once,
5353 and omit line-number decoration that makes Emacs compile think
5354 that informative messages are worth worrying about.
5355
53562005-07-22 Paul Eggert <eggert@cs.ucla.edu>
5357
5358 * configure.ac: Update version number.
5359
5360 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
5361 accidentally.
5362 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
5363 autogenerated by the maintainer.
5364 * examples/calc++/.cvsignore: Add *.yy.
5365
5366 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
5367 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5368 * lib/bitsetv.c (bitsetv_alloc): Likewise.
5369
5370 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
5371
5372 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
5373 from maintainer-distcheck about casting the argument of 'free'.
5374
5375 * NEWS: Mention recent yytname changes.
5376 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
5377
5378 * bootstrap: For translations that have not yet been upgraded to
5379 the new runtime-po domain, prime the pump by extracting the
5380 relevant strings from the obsolete translations. This code can be
5381 removed once the bison-runtime domain has been translated by each
5382 team.
5383
5384 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
5385 now that token names are already quoted.
5386
5387 Fix problem reported by Anthony Heading.
5388 * data/glr.c (YYTOKEN_TABLE): New macro.
5389 (yytname): Define if YYTOKEN_TABLE.
5390 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
5391 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
5392 (YYERROR_VERBOSE): Define the same way the other skeletons do.
5393 * src/output.c (prepare_symbols): Output token_table_flag.
5394
0ffda363
PE
53952005-07-21 Paul Eggert <eggert@cs.ucla.edu>
5396
5397 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
5398 again if the first call fails.
5399
5400 * data/glr.c (yytnamerr): New function.
5401 (yyreportSyntaxError): Use it to dequote most string literals.
5402 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
5403 with other skeletons. All uses changed.
5404 (yytnameerr_): New function.
5405 (yyreport_syntax_error): Use it to dequote most string literals.
5406 * data/yacc.c (yytnamerr): New function.
5407 (yyerrlab): Use it to decode most string literals.
5408 * doc/bison.texinfo (Decl Summary, Calling Convention):
5409 Clarify quoting convention of yytname.
5410 * src/output.c (prepare_symbols): Quote all names. This undoes
5411 the 2005-04-17 change, which is now accomplished (mostly) via
5412 changes in the parsers as described above.
5413 * tests/regression.at (Token definitions, Web2c Actions):
5414 Undo most 2005-04-17 change here, too.
5415
54162005-07-20 Paul Eggert <eggert@cs.ucla.edu>
5417
5418 Fix more problems reported by twlevo@xs4all.nl.
5419 * tests/cxx-type.at: Don't pipe output of ./types through sed to
5420 remove trailing spaces. This loses the exit status of ./types,
5421 and isn't needed since ./types shouldn't be emitting trailing
5422 spaces.
5423 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
5424 as the stack isn't valid in that case.
5425
5426 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5427 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5428 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5429 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
5430 is used.
5431 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
5432 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5433 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5434 Likewise.
5435
5436 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
5437 overly-picky compilers that reject 'char *foo = "bar";'.
5438
5439 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
5440 to FILE * parameter, not to stderr. This fixes a typo introduced
5441 in the 2005-07-12 change.
5442
5443 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
5444 warnings from GCC 4.
5445
5446 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
5447 (yyglrShiftDefer, yysplitStack):
5448 Remove unused parameters b4_pure_formals. All uses changed.
5449 (yyglrShift): Remove unused parameters b4_user_formals.
5450 All uses changed.
5451 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
5452
6100a9aa
PE
54532005-07-18 Paul Eggert <eggert@cs.ucla.edu>
5454
258b75ca
PE
5455 Destructor cleanups and regularization among the three skeletons.
5456 * NEWS: Document the behavior changes.
5457 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
5458 stack before failing, as the cleanup code will do it for us now.
5459 * data/lalr1.cc (yyerrlab): Likewise.
5460 * data/glr.c (yyparse): Pop everything off the stack before
5461 freeing it, so that destructors get called properly.
5462 * data/lalr1.cc (yyreturn): Likewise.
5463 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
5464 This is more consistent.
5465 * doc/bison.texinfo (Destructor Decl): Mention more reasons
5466 why destructors might be called. 1.875 -> 2.1.
5467 (Destructor Decl, Decl Summary, Table of Symbols):
5468 Some English-language cleanups for %destructor.
5469 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5470 Add output line for destructor of start symbol.
5471 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
5472 because of that same extra output line.
5473
1a059451
PE
5474 * NEWS: Document minor wording changes in diagnostics of
5475 Bison-generated parsers.
5476 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
5477 Remove unused formals. All uses changed.
5478 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
5479 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
5480 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
5481 Rename yyoverflowab to yyexhaustedlab.
5482 When memory exhaustion occurs during syntax-error reporting,
5483 report it separately rather than in a single diagnostic; this
5484 eases translation.
5485 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
5486 (Memory Exhausted): Renamed from Parser Stack Overflow.
5487 Revamp wording slightly to prefer "memory exhaustion".
5488 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
5489
97460c78
PE
5490 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
5491
30757c8c
PE
5492 Add i18n support to the GLR skeleton. Partially fix the C++
5493 skeleton; a C++ expert needs to finish this. Remove debugging
5494 msgids; there's little point to having them translated, since they
5495 can be understood only by someone who can read the
5496 (English-language) source code.
5497
5498 Generate runtime-po/bison-runtime.pot automatically, so that we
5499 don't have to worry about garbage getting in that file. We'll
5500 make sure after the next official release that old msgids don't
5501 get lost. See
5502 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
5503
5504 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
5505 Now auto-generated.
5506 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
5507 Fix typos in explanations of the runtime file.
5508 * bootstrap: Change gettext keyword from YYI18N to YY_.
5509 Use standard Makefile.in.in in runtime-po, since we'll arrange
5510 for backward-compatible bison-runtime.po files in a different way.
5511 * data/glr.c (YY_): New macro, from yacc.c.
5512 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
5513 Translate messages intended for users.
5514 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
5515 the wording in the other skeletons. We don't know that the memory
5516 is virtual.
5517 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
5518 Use same method that yacc.c uses.
5519 Don't translate debugging messages.
5520 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
5521 it doesn't work (yet), and requires C++ expertise to fix.
5522 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
5523 Move defn to a more logical place, to be consistent with other
5524 skeletons.
5525 Don't translate debugging messages.
5526 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
5527 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
5528 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
5529 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
5530
ac8c5689
PE
5531 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
5532 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
5533 void, not int.
5534 * tests/glr-regression.at (Badly Collapsed GLR States):
5535 Likewise.
5536 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5537 yylex should return 0 at EOF rather than aborting.
5538
6100a9aa
PE
5539 Improve tests for stack overflow in GLR parser.
5540 Problem reported by twlevo@xs4all.nl.
5541 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
5542 All uses removed.
5543 (yyStackOverflow): Just longjmp, but with value 2 so that caller
5544 can handle the problem.
5545 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
5546 (yyparse): New local variable yyresult to record the result.
5547 Use result of setjmp to set it, rather than storing itinto
5548 struct.
5549 (yyDone): Remove label.
5550 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
5551 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
5552 if YYABORT is used).
5553 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
5554 yyparse status; put status > 1 into diagnostic.
5555 Check that status==2 works.
5556 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
5557 Use exit status 3 for failure to open (which shouldn't happen).
5558
15f40952
PE
55592005-07-17 Paul Eggert <eggert@cs.ucla.edu>
5560
67fd79c4
PE
5561 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
5562 1 on syntax error; just let yyparse do its thing.
5563 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
5564 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
5565 (Exploding the Stack Size with Alloca):
5566 (Exploding the Stack Size with Malloc):
5567 Expect exit status 2, not 1, since the parser is supposed to blow
5568 its stack. Problem reported by twlevo@xs4all.nl.
5569
15f40952
PE
5570 * data/glr.c (yyparse): Don't assume that the initial calls
5571 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
5572 Print a stack-overflow message and fail instead.
5573 Initialize the line-number information before creating the stack,
5574 so that the stack-overflow message can report line zero safely.
5575
f32c66b5
PE
55762005-07-14 Paul Eggert <eggert@cs.ucla.edu>
5577
a22ff96f 5578 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
5579 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
5580 (yyuserMerge): Provide a default case if b4_mergers is empty.
5581 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
5582 * tests/glr-regression.at
5583 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 5584 Add casts to pacify C++ compilers.
1beb0b24
PE
5585 * tests/glr-regression.at (Improper merging of GLR delayed action
5586 sets): Declare yylex before using it.
f32c66b5 5587 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
5588 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
5589 test for valgrind; valgrind is independent of g++.
5590 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
5591 for compatibility with POSIX 1003.1-2001 (if running coreutils).
5592 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
5593 Use a destructor, so that we can expand the stack. Change
5594 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 5595
d741bd1b
PE
55962005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5597
5598 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
5599 a valgrind failure. Problem reported by twlevo@xs4all.nl.
5600
0410a6e0
PE
56012005-07-13 Paul Eggert <eggert@cs.ucla.edu>
5602
5603 * PACKAGING: New file, suggested by Bruno Haible and taken from
5604 similar wording in gettext's PACKAGING file.
5605 * NEWS: Mention PACKAGING.
5606 * Makefile.am (EXTRA_DIST): Add PACKAGING.
5607
f7ab6a50
PE
56082005-07-12 Paul Eggert <eggert@cs.ucla.edu>
5609
baf785db 5610 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
5611 * bootstrap: Get runtime translations into runtime-po.
5612 Create runtime-po files automatically, if possible.
5613 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
5614 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
5615 does not infringe on the user's name space.
5616 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
5617 * doc/bison.texinfo (Internationalization): Revamp the English
5618 and Texinfo syntax a bit, to try to make it clearer.
5619 (Bison Options, Option Cross Key): Mention --print-localedir.
5620 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
5621 YYENABLE_NLS. Quote a bit more.
5622 * runtime-po/.cvsignore: New file.
5623 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
5624 * runtime-po/Rules-quot: Remove; now created by bootstrap.
5625 * runtime-po/quot.sed: Likewise.
5626 * runtime-po/boldquot.sed: Likewise.
5627 * runtime-po/en@quot.header: Likewise.
5628 * runtime-po/en@boldquot.header: Likewise.
5629 * runtime-po/insert-header.sin: Likewise.
5630 * runtime-po/remove-potcdate.sin: Likewise.
5631 * runtime-po/Makevars: Likewise.
5632 * runtime-po/LINGUAS: Likewise.
5633 * runtime-po/de.po: Likewise; we will rely on the translation project
5634 to maintain this, so "bootstrap" should get it.
0410a6e0 5635 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
5636 its value.
5637 * src/main.c (main): Bind the bison-runtime domain, too.
5638
56392005-07-12 Bruno Haible <bruno@clisp.org>
5640
5641 * data/yacc.c: Include <libintl.h> when NLS is enabled.
5642 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
5643 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
5644 * runtime-po: New directory.
5645 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
5646 $(DOMAIN).pot-update rule, so that old messages are never dropped.
5647 * runtime-po/Rules-quot: New file, copied from po/.
5648 * runtime-po/quot.sed: Likewise.
5649 * runtime-po/boldquot.sed: Likewise.
5650 * runtime-po/en@quot.header: Likewise.
5651 * runtime-po/en@boldquot.header: Likewise.
5652 * runtime-po/insert-header.sin: Likewise.
5653 * runtime-po/remove-potcdate.sin: Likewise.
5654 * runtime-po/Makevars: New file.
5655 * runtime-po/POTFILES.in: New file.
5656 * runtime-po/LINGUAS: New file.
5657 * runtime-po/bison-runtime.pot: New file.
5658 * runtime-po/de.po: New file.
5659 * m4/bison.m4: New file.
5660 * Makefile.am (SUBDIRS): Add runtime-po.
5661 (aclocaldir, aclocal_DATA): New variables.
5662 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
5663 Define aclocaldir.
5664 * src/getargs.c (usage): Document --print-localedir option.
5665 (PRINT_LOCALEDIR_OPTION): New enum item.
5666 (long_options): Add --print-localedir option.
5667 (getargs): Handle --print-localedir option.
5668 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
5669 (Internationalization): New section.
5670
22dda0f0
AD
56712005-07-12 Akim Demaille <akim@epita.fr>
5672
5673 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
5674 for consistency with the rest of the code.
5675 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
5676 Add separators.
5677
82b248ad
AD
56782005-07-12 Akim Demaille <akim@epita.fr>
5679
5680 * src/parse-gram.y: Use %printer instead of YYPRINT.
5681
fa0e9314
AD
56822005-07-12 Akim Demaille <akim@epita.fr>
5683
867a3e00
AD
5684 * src/symtab.h, src/symtab.c (symbol_print): New.
5685 * src/symlist.h, src/symlist.c (symbol_list_print): New.
5686 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
5687
56882005-07-12 Akim Demaille <akim@epita.fr>
5689
5690 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
5691 b4_at_dollar and b4_dollar_dollar.
5692
e054b190
PE
56932005-07-11 Paul Eggert <eggert@cs.ucla.edu>
5694
5695 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
5696 and Pennello's paper.
5697
34160ec4
PE
56982005-07-09 Paul Eggert <eggert@cs.ucla.edu>
5699
407d4a75
PE
5700 * data/yacc.c (yyparse): Undo previous patch. Instead,
5701 set yylsp[0] and yyvsp[0] only if the initial action
5702 sets yylloc and yylval, respectively.
5703
34160ec4
PE
5704 * data/yacc.c (yyparse): In the initial action, set
5705 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
5706 This avoids the use of undefined variables if the initial
5707 action does not set yylloc and/or yylval.
5708
c3d5a4a7
PE
57092005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5710
b34d96c1
PE
5711 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
5712 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
5713 Remove from CVS. These files are automatically generated.
5714 * examples/extexi: Clarify that this file is now part of Bison,
5715 not GNU M4, and that it works with any POSIX-compatible Awk.
5716 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
5717 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
5718 so that we also get calc++-parser.yy. Geneate it.
5719 Use $(AWK), not gawk, since any conforming Awk will do.
5720 Put comment before action, since older 'make' can't handle comment
5721 in action.
5722 $(BUILT_SOURCES): List all built sources, not just some of them.
5723 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
5724 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
5725 $($(calc_sources_generated)): Remove unnecessary test for existence
5726 of target. (This had a shell syntax error anyway; a stray "x".)
5727 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
5728 calc++-parser.yy.
5729 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
5730
c3d5a4a7
PE
5731 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
5732 implied by the other modules.
5733
828c373b
AD
57342005-07-06 Akim Demaille <akim@epita.fr>
5735
5736 Bind examples/calc++ to the package.
5737 * examples/calc++/Makefile: Remove, replaced by...
5738 * examples/calc++/Makefile.am: ... this new file.
5739 * examples/calc++/test: Remove input.
5740 * examples/calc++/compile: Remove.
5741 * examples/Makefile.am: New.
5742 * configure.ac, Makefile.am: Adjust.
5743 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
5744
63cb01d6
PE
57452005-07-05 Paul Eggert <eggert@cs.ucla.edu>
5746
fd2df2ed
PE
5747 * data/glr.c (yyFail): Drastically simplify; since the format argument
5748 never had any % directives, we can simply pass it to yyerror.
5749 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
5750 be modified later, as that is the usual style in glr.c.
5751 Problems reported by Paul Hilfinger.
5752
63cb01d6
PE
5753 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
5754 and size overflow errors.
5755 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
5756 in case the user prolog sets feature-test macros like _GNU_SOURCE.
5757 (YYSIZEMAX): New macro.
5758 (yystpcpy): New function, taken from yacc.c.
5759 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
5760 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
5761 so that we don't have to maintain their signatures.
5762 (yyFail): Check for buffer overflow, by using vsnprintf rather
5763 than vsprintf. Allocate a bigger buffer if possible.
5764 Report an error if buffer allocation fails.
5765 (yyStackOverflow): New function.
5766 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
5767 the initialization was successful. It might fail if storage was
5768 exhausted.
5769 (yyexpandGLRStack): Add more checks for storage allocation failure.
5770 Use yyStackOverflow to report failures.
5771 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
5772 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
5773 Don't assume stack number fits in int.
5774 (yysplitStack): Check for storage allocation failure.
5775 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
5776 can print diagnostics on storage allocation failure. All callers
5777 changed.
5778 (yyresolveValue): Use yybool for boolean.
5779 (yyreportSyntaxError): Check for size-calculation overflow.
5780 This code is taken from yacc.c.
5781 (yyparse): Check for storage allocation errors when allocating
5782 the initial stack.
5783
1c59e0a1
AD
57842005-07-05 Akim Demaille <akim@epita.fr>
5785
5786 Extract calc++ from the documentation.
5787 * doc/bison.texinfo (Calc++): Add the extraction marks.
5788 * examples/extexi: New, from the aborted GNU Programming 2E.
5789 Separate the different paragraph of a file with empty lines.
5790 * examples/Makefile: Use it to extract the whole calc++ example.
5791
8a0adb01
AD
57922005-06-24 Akim Demaille <akim@epita.fr>
5793
5794 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
5795 class typedefs.
5796
12545799
AD
57972005-06-22 Akim Demaille <akim@epita.fr>
5798
5799 * doc/bison.texinfo (C++ Language Interface): First stab.
5800 (C++ Parsers): Remove.
5801
99be0235
AD
58022005-06-22 Akim Demaille <akim@epita.fr>
5803
5804 * data/lalr1.cc (yylex_): Honor %lex-param.
5805
0ffd4fd1
AD
58062005-06-22 Akim Demaille <akim@epita.fr>
5807
5808 Start a set of simple examples.
5809 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
5810 * examples/calc++/calc++-driver.hh,
5811 * examples/calc++/calc++-parser.yy,
5812 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
5813 * examples/calc++/compile, examples/calc++/test: New.
5814
0925ebb4
PE
58152005-06-09 Paul Eggert <eggert@cs.ucla.edu>
5816
5817 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
5818 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
5819 which stems from the 2005-05-27 patch.
5820
43d3b664
PH
58212005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5822
5823 * data/glr.c: Modify treatment of unused parameters to permit use
5824 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
5825
3062864d
PE
58262005-05-30 Paul Eggert <eggert@cs.ucla.edu>
5827
5828 Fix infringement on user name space reported by Janos Zoltan Szabo.
5829 * data/yacc.c (yyparse): strlen -> yystrlen.
5830
989b5b8e
AD
58312005-05-30 Akim Demaille <akim@epita.fr>
5832
5833 * data/lalr1.cc (_): New.
5834 Translate the various messages.
5835
bedf57f5
PE
58362005-05-27 Paul Eggert <eggert@cs.ucla.edu>
5837
5838 Fix infringement on user name space reported by Bruno Haible.
5839 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
5840 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
5841 the user's name space.
5842 (alloca): Include <stdlib.h> to get it, if it's not built in.
5843 (YYMALLOC, YYFREE): Define only if needed.
5844 (malloc, free): Declare, but only if needed, as this infringes on
5845 the user name space.
5846
4d1801f1
PE
58472005-05-25 Paul Eggert <eggert@cs.ucla.edu>
5848
5849 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
5850 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
5851 with %d format.
5852 * lib/ebitset.c (min, max): Undef before defining.
5853 * lib/vbitset.c (min, max): Likewise.
5854 * lib/subpipe.c (create_subpipe): Save local variables in case
5855 vfork clobbers them.
5856
58572005-05-24 Bruno Haible <bruno@clisp.org>
5858
5859 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
5860 error message syntax used by gcc-4.0.
5861
b94a9e1e
PE
58622005-05-23 Paul Eggert <eggert@cs.ucla.edu>
5863
85ac3861
PE
5864 * README: Mention m4 1.4.3. Remove obsolete advice about
5865 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
5866
b94a9e1e
PE
5867 * bootstrap: Remove workaround for problem I encountered with
5868 gettext 0.14.1; it seems to be fixed now.
5869
51c30d21
PE
58702005-05-22 Paul Eggert <eggert@cs.ucla.edu>
5871
009ce67d
PE
5872 * NEWS: Version 2.0a.
5873
f2a97c62
PE
5874 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
5875 the previous change.
5876
c8775f93
PE
5877 Various maintainer cleanups.
5878 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
5879 conftest*, for benefit of CVS commands run at the same time as
5880 "configure". Add build-aux, since "bootstrap" now creates it and
5881 its subfiles.
5882 * Makefile.cfg (move_if_change): Remove.
5883 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
5884 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
5885 (po_repo, do-po-update, po-update, wget_files, get-targets):
5886 (config.guess-url_prefix, config.sub-url_prefix):
5887 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
5888 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
5889 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
5890 Remove.
5891 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
5892 this is now the recommended name.
5893 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
5894 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
5895 ylwrap. These files now go into build-aux.
5896 * config/move-if-change: Remove.
5897 * config/prev-version.txt: Bump from 1.75 to 2.0.
5898
3ea5f0ec
PE
5899 * bootstrap: Add stdio-safer, unistd-safer modules.
5900 Remove m4/glibc2.m4 (introduced by latest gnulib, but
5901 we don't need it).
5902 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
5903 fopen-safer.c, stdio-safer.h, unistd-safer.h.
5904 * lib/subpipe.c: Include "unistd-safer.h".
5905 (create_subpipe): Make sure all the newly-created
5906 file descriptors are > 2, so that diagnostics don't
5907 get sent down them (which might cause Bison to hang, in theory).
5908 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
5909 * src/files.c (xfopen): Use fopen_safer, not fopen.
5910
51c30d21
PE
5911 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
5912 yesterday's yacc.c fix.
5913
cea1469d
PE
59142005-05-21 Paul Eggert <eggert@cs.ucla.edu>
5915
3ea5f0ec
PE
5916 * data/glr.c, data/lalr1.cc: Update copyright date.
5917
cea1469d
PE
5918 Fix a destructor bug reported by Wolfgang Spraul in
5919 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
5920 * data/yacc.c (yyabortlab): Don't call destructor, and
5921 don't set yychar to EMPTY.
5922 (yyoverflowlab): Don't call destructor.
5923 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
5924 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
5925 since we no longer output the message "discarding lookahead token
5926 end of input ()".
5927
5e6f62f2
PH
59282005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5929
5930 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
5931 fix a small glitch in debugging output.
5932 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
5933 after YY_SYMBOL_PRINT where needed.
5934
5935 (struct yyGLRState): Add some comments.
5936 (struct yySemanticOption): Add some comments.
5937 (union yyGLRStackItem): Add comment.
5938
5939 (yymergeOptionSets): Correct this to properly perform the union,
5940 avoiding infinite reported by Michael Rosien.
5941 Update comment.
5942
5943 * tests/glr-regression.at: Add test for GLR merging error reported
5944 by M. Rosien.
cea1469d 5945
0fb669f9
PE
59462005-05-13 Paul Eggert <eggert@cs.ucla.edu>
5947
5948 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
5949 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
5950 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
5951 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
5952 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
5953 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
5954 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
5955 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
5956 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
5957 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
5958 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
5959 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
5960 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
5961 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
5962 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
5963 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
5964 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
5965 src/derives.h, src/files.c, src/files.h, src/getargs.c,
5966 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
5967 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
5968 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
5969 src/output.h, src/parse-gram.c, src/parse-gram.h,
5970 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
5971 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
5972 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
5973 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
5974 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
5975 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
5976 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
5977 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
5978 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
5979 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
5980 tests/reduce.at, tests/regression.at, tests/sets.at,
5981 tests/synclines.at, tests/testsuite.at, tests/torture.at:
5982 Update FSF postal mail address.
5983
51f4735e
PE
59842005-05-11 Paul Eggert <eggert@cs.ucla.edu>
5985
5986 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
5987 Problem reported by Ralf Menzel.
5988
80ce3401
PE
59892005-05-01 Paul Eggert <eggert@cs.ucla.edu>
5990
5991 * tests/actions.at: Test that stack overflow invokes destructors.
5992 From Marcus Holland-Moritz.
5993 * data/yacc.c (yyerrlab): Move the code that destroys the stack
5994 from here....
5995 (yyreturn): to here. That way, destructors are called properly
5996 even if the stack overflows, or the user calls YYACCEPT or
5997 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
5998 (yyoverflowlab): Destroy the lookahead.
5999
60002005-04-24 Paul Eggert <eggert@cs.ucla.edu>
6001
6002 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
6003
72f000b0
PE
60042005-04-17 Paul Eggert <eggert@cs.ucla.edu>
6005
6006 * NEWS: Bison-generated C parsers no longer quote literal strings
6007 associated with tokens.
6008 * src/output.c (prepare_symbols): Don't escape strings,
6009 since users don't want to see C escapes.
6010 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
6011 in diagnostics.
c19683bb 6012 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
6013 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
6014
1094323f
PE
60152005-04-16 Paul Eggert <eggert@cs.ucla.edu>
6016
6017 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
6018 the data size is known to be too small and we can't increase it.
6019 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
6020
ca407bdf
PE
60212005-04-15 Paul Eggert <eggert@cs.ucla.edu>
6022
6023 * src/parse-gram.y: Include quotearg.h.
6024 (string_as_id): Quote $1 before using it as a key, since the
6025 lexer no longer quotes it for us.
6026 (string_content): Don't strip quotes, since lexer no longer
6027 quotes it for us.
6028 * src/scan-gram.l: Include quotearg.h.
6029 ("\""): Omit quote.
6030 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
6031 a key, since the rest of the lexer doesn't quote it.
6032 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
6033 * tests/regression.at (Token definitions): Check for backslashes
6034 in token strings.
6035
6036 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
6037 (YYSIZE_T): Define to unsigned long int when using an older compiler.
6038 (yyparse): Revamp code to generate long syntax error message, to
6039 make it easier to translate, and to avoid problems with arithmetic
6040 overflow. Change "virtual memory" to "memory" in diagnostic, since
6041 we don't know whether the memory is virtual.
6042
1ce59070
PE
60432005-04-13 Paul Eggert <eggert@cs.ucla.edu>
6044
6045 * NEWS: Bison-generated C parsers now use the _ macro to
6046 translate strings.
6047 * data/yacc.c (_) [!defined _]: New macro.
6048 All English strings wrapped inside this macro.
6049 * doc/bison.texinfo (Bison Parser): Document _.
6050 * po/POTFILES.in: Include src/parse-gram.c, since it now
6051 includes translateable strings that parse-gram.y doesn't.
6052
a749a695
PE
60532005-04-12 Paul Eggert <eggert@cs.ucla.edu>
6054
6055 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
6056 reverting the 2004-10-11 change to this function.
6057 (symbol_check_alias_consistency): Don't call symbol_type_set
6058 if the type name is already correct.
6059 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
6060
8fb1053b
PE
60612005-03-25 Paul Eggert <eggert@cs.ucla.edu>
6062
6063 * tests/regression.at (Token definitions): Don't use a token named
6064 c, as that generates a "#define c ..." that runs afoul of buggy
6065 stdlib.h that uses the identifier c as a member of struct
6066 drand48_data. Problem reported by Horst Wente.
6067
ff498c4a
PE
60682005-03-21 Paul Eggert <eggert@cs.ucla.edu>
6069
6070 * bootstrap: Change translation URL from
6071 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
6072 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
6073 redirection glitches. Problem reported by twlevo@xs4all.nl.
6074
65211d70
PE
60752005-03-20 Paul Eggert <eggert@cs.ucla.edu>
6076
6077 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
6078 after operands; POSIX says this isn't portable for the c99 command.
6079
9577fb1f
PE
60802005-03-18 Paul Eggert <eggert@cs.ucla.edu>
6081
6082 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
6083 immediately if a data overrun has occurred; this may help us track
6084 down what may be a spurious failure on MacOS.
6085
78b178f7
PE
60862005-03-17 Paul Eggert <eggert@cs.ucla.edu>
6087
a2599d0f
PE
6088 Respond to problems reported by twlevo@xs4all.nl.
6089
6090 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
6091
78b178f7
PE
6092 * src/vcg.h: Comment fix.
6093 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
6094 (G_CMAX): Change to -1 instead of INT_MAX.
6095
6096 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 6097
7296e729
PE
60982005-03-15 Paul Eggert <eggert@cs.ucla.edu>
6099
6100 * src/tables.c (state_number_to_vector_number): Put it inside an
6101 "#if 0", since it's not currently used. Problem reported by
6102 Roland McGrath.
6103
05ac60f3
PE
61042005-03-06 Paul Eggert <eggert@cs.ucla.edu>
6105
6106 * src/output.c (escaped_output): Renamed from
6107 escaped_file_name_output, since we now use it for symbol tags as
6108 well. All uses changed.
6109 (symbol_destructors_output, symbol_printers_output):
6110 Escape symbol tags too.
6111 Problem reported by Matyas Forstner in
6112 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
6113
6114 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
6115 not needed.
6116 * src/output.c (user_actions_output, token_definitions_output,
6117 symbol_destructors_output, symbol_printers_output): Likewise.
6118 * src/reader.c (prologue_augment): Likewise.
6119 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
6120
6121 * src/vcg.c (output_edge): Don't quote linestyle arg.
6122 Problem reported by twlevo@xs4all.nl.
6123
7eb453ac
PE
61242005-02-28 Paul Eggert <eggert@cs.ucla.edu>
6125
6126 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
6127 example, reported by Derek M Jones. Also, make the example even
6128 more outrageous, to better illustrate how bad the problem is.
6129
4c04c52a
PE
61302005-02-24 Paul Eggert <eggert@cs.ucla.edu>
6131
6132 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
6133 putsym. Typo reported by Sebastian Piping.
6134
a61e1620
PE
61352005-02-23 Paul Eggert <eggert@cs.ucla.edu>
6136
6137 * doc/bison.texinfo (Language and Grammar): some -> same
6138 (Epilogue): int he -> in the
6139 Typos reported by Sebastian Piping via Justin Pence.
6140
9ec93868
PE
61412005-02-07 Paul Eggert <eggert@cs.ucla.edu>
6142
6143 * tests/glr-regression.at (Improper handling of embedded actions
6144 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
6145 embedded actions and $-N in GLR parsers", work around an Autoconf bug
6146 with dollar signs in test names.
6147 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
6148 for a similar reason.
6149
73ce7e7e
PE
61502005-01-28 Paul Eggert <eggert@cs.ucla.edu>
6151
6152 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
6153 wants to redefine G_VIEW.
6154
2e72b98e
PE
61552005-01-27 Paul Eggert <eggert@cs.ucla.edu>
6156
6157 * src/vcg.c (get_view_str): Remove case for normal_view.
6158 Problem reported by twlevo@xs4all.nl.
6159
e0d634e5
PE
61602005-01-24 Paul Eggert <eggert@cs.ucla.edu>
6161
ccf830a4
PE
6162 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
6163 Problem reported by twlevo@xs4all.nl.
6164
e0d634e5
PE
6165 * doc/bison.texinfo: Change @dircategory from "GNU programming
6166 tools" to "Software development". Requested by Richard Stallman
6167 via Karl Berry.
6168
7bbc8cb0
PE
61692005-01-23 Paul Eggert <eggert@cs.ucla.edu>
6170
6171 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
6172 Problem reported by twlevo@xs4all.nl.
6173
08b770bc
PE
61742005-01-21 Paul Eggert <eggert@cs.ucla.edu>
6175
6176 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
6177 keyword; it's not needed with modern compilers, and it doesn't
6178 affect correctness with older compilers. Suggested by
6179 twlevo@xs4all.nl.
6180
95f22ad2
PE
61812005-01-17 Paul Eggert <eggert@cs.ucla.edu>
6182
6183 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
6184 gcc -Wswitch-default.
6185 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6186 * data/yacc.c (yyparse): Likewise.
6187
d229d15c
PE
61882005-01-12 Paul Eggert <eggert@cs.ucla.edu>
6189
6190 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
6191 already. Let config.h define any nonstandard values.
6192
ecadd90f
PE
61932005-01-10 Paul Eggert <eggert@cs.ucla.edu>
6194
6195 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
6196 for the benefit of slower hosts. Problem reported by
6197 Nelson H. F. Beebe.
6198
213744b5
PE
61992005-01-07 Paul Eggert <eggert@cs.ucla.edu>
6200
6201 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
6202 being defined and not used.
6203 * data/lalr1.cc (yyparse): Likewise.
6204 Use "if (false)" rather than "if (0)".
6205
249d3236
PE
62062005-01-05 Paul Eggert <eggert@cs.ucla.edu>
6207
6208 * TODO: Mention that we should allow NUL bytes in tokens.
6209
987cc1fb
PE
62102005-01-02 Paul Eggert <eggert@cs.ucla.edu>
6211
6212 * src/scan-skel.l (<<EOF>>): Don't close standard output.
6213 Problem reported by Hans Aberg.
6214
08fe02d9
PE
62152005-01-01 Paul Eggert <eggert@cs.ucla.edu>
6216
6217 * src/getargs.c (version): Happy new year; update overall
6218 program copyright date from 2004 to 2005.
6219
6220 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
6221 Problem reported by Hans Aberg.
6222 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
6223 (Output file names.): Add a test for the case when standard output
6224 is closed.
6225
010c0266
PE
62262004-12-26 Paul Eggert <eggert@cs.ucla.edu>
6227
6228 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
6229 to fix an oversight in the Bison 2.0 manual.
6230
da12206a
PE
62312004-12-25 Paul Eggert <eggert@cs.ucla.edu>
6232
6233 * NEWS: Version 2.0. Reformat the existing news items since
6234 1.875, so that related items are grouped together.
3a4734aa 6235 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
6236 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
6237
c935d934
PE
6238 * tests/torture.at (Exploding the Stack Size with Alloca): Set
6239 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
6240 otherwise, we're not testing alloca. Unfortunately there's no
6241 simple way to consult HAVE_ALLOCA here.
6242
da12206a
PE
6243 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
6244 for yymsg, too.
6245
6246 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
6247 hand. This avoids a warning about comparing int to size_t when
6248 GCC warnings are enabled.
6249
0a2c5137
PE
62502004-12-22 Paul Eggert <eggert@cs.ucla.edu>
6251
d7e14fc0
PE
6252 * NEWS: Bison-generated parsers no longer default to using the
6253 alloca function (when available) to extend the parser stack, due
6254 to widespread problems in unchecked stack-overflow detection.
6255 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
6256 responsibility to set it to a positive value. This lets the user
6257 specify a value that is not a preprocessor constant.
6258 * data/yacc.c (YYMAXDEPTH): Likewise.
6259 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
6260 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
6261 to be a compile-time constant. However, explain the constraints on it.
6262 Also, explain the constraints on YYINITDEPTH.
6263 (Table of Symbols): Explain that alloca is no longer the default.
6264 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
6265 to 1.
6266
0a2c5137
PE
6267 * doc/bison.texinfo (Location Default Action): Mention that n must
6268 be zero when k is zero. Suggested by Frank Heckenbach.
6269
e019c247
AD
62702004-12-22 Akim Demaille <akim@epita.fr>
6271
6272 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
6273 (parser::state_type, parser::semantic_type, parser::location_type):
6274 Private, not public.
6275 (parser::parse): Return ints, not bool.
6276 Returning a bool introduces a problem: 0 corresponds to false, and
6277 it seems weird to return false on success. Returning true changes
6278 the conventions for yyparse.
6279 Alternatively we could return void and send an exception.
6280 There is no clear consensus (yet?).
6281 (state_stack, semantic_stack, location_stack): Rename as...
6282 (state_stack_type, semantic_stack_type, location_stack_type): these.
6283 Private, not public.
6284 * tests/c++.at: New.
6285 * tests/testsuite.at, tests/Makefile.am: Adjust.
6286
72731bb7
AD
62872004-12-21 Akim Demaille <akim@epita.fr>
6288
6289 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
6290
9a0d8bec
AD
62912004-12-21 Akim Demaille <akim@epita.fr>
6292
6293 Don't impose std::string for filenames.
6294
6295 * data/lalr1.cc (b4_filename_type): New.
6296 (position::filename): Use it.
6297 (parser.hh): Move the inclusion of stack.hh and location.hh below
6298 the user code, so that needed headers for the filename type can be
6299 included first.
72731bb7
AD
6300 Forward declare them before the user code.
6301 * tests/Makefile.am (check-local, installcheck-local): Pass
6302 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 6303
99880de5
AD
63042004-12-20 Akim Demaille <akim@epita.fr>
6305
6306 Use more STL like names: my_class instead of MyClass.
6307
6308 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
6309 (SemanticStack, SemanticType, StateStack, StateType)
6310 (TokenNumberType, Stack, Slice, Traits, Parser::location)
6311 (Parser::value): Rename as...
6312 (location_stack, location_type, rhs_number_type, semantic_stack)
6313 (semantic_type, state_stack, state_type, token_number_type, stack)
6314 (slice, traits, parser::yylloc, parser::yylval): these.
6315
6316 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
6317
9bec482e
PE
63182004-12-19 Paul Eggert <eggert@cs.ucla.edu>
6319
6320 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
6321 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6322
f6fbd3da
PE
63232004-12-17 Paul Eggert <eggert@cs.ucla.edu>
6324
6325 Remove uses of 'short int' and 'unsigned short int'. This raises
6326 some arbitrary limits. It uses more memory but nowadays that's
6327 not much of an issue.
6328
6329 This change does not affect the generated parsers; that's a different
6330 task, as some users will want to conserve memory there.
6331
6332 Ideally we should use size_t to represent all object counts, and
6333 something like ptrdiff_t to represent signed differences of object
6334 counts; but that will require more code-cleanup than I have the
6335 time to do right now.
6336
6337 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
6338 Use size_t, not int or short int, to count objects.
6339 * src/closure.c (nritemset, closure): Likewise.
6340 * src/closure.h (nritemset, closure): Likewise.
6341 * src/nullable.c (nullable_compute): Likewise.
6342 * src/print.c (print_core): Likewise.
6343 * src/print_graph.c (print_core): Likewise.
6344 * src/state.c (state_compare, state_hash): Likewise.
6345 * src/state.h (struct state): Likewise.
6346 * src/tables.c (default_goto, goto_actions): Likewise.
6347
6348 * src/gram.h (rule_number, rule): Use int, not short int.
6349 * src/output.c (prepare_rules): Likewise.
6350 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
6351 errs, reductions): Likewise.
6352 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
6353 Likewise.
6354 * src/tables.c (vector_number, tally, action_number,
6355 ACTION_NUMBER_MINIMUM): Likewise.
6356 * src/output.c (muscle_insert_short_int_table): Remove.
6357
efeed023
AD
63582004-12-17 Akim Demaille <akim@epita.fr>
6359
6360 * data/lalr1.cc: Extensive Doxygenation.
6361 (error_): Rename as...
6362 (error): this, since it is visible to the user.
6363 Adjust callers.
6364 (Parser::message): Now an automatic variable from...
6365 (Parser::yyreport_syntax_error_): here.
6366 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
6367 Parser::error.
6368 * tests/input.at: Escape $.
6369
bc82c5a5
PE
63702004-12-16 Paul Eggert <eggert@cs.ucla.edu>
6371
6372 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
6373 Parenthesize rhs to avoid obscure problems with mistakes like
6374 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
6375 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6376 b4_rhs_location): Likewise.
6377 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6378 b4_rhs_location): Likewise.
6379
fd19f271
AD
63802004-12-16 Akim Demaille <akim@epita.fr>
6381
6382 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
6383 yacc.c: be sure to stay within yycheck_.
6384 * tests/actions.at: Re-enable C++ tests.
6385
10454ea4
AD
63862004-12-16 Akim Demaille <akim@epita.fr>
6387
6388 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
6389 real.
6390
c5b95ccf
AD
63912004-12-16 Akim Demaille <akim@epita.fr>
6392
6393 Use #define to handle the %name-prefix.
6394
6395 * data/glr.c, data/yacc.c: Comment changes.
6396 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
6397 so that one can refer to yylex in the parser file, and have it
6398 renamed, as is the case with other skeletons.
6399
617a8f12
AD
64002004-12-16 Akim Demaille <akim@epita.fr>
6401
6402 Move lalr1.cc internals into yy*.
6403
6404 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
6405 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
6406 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
6407 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
6408 (empty_, final_, terror_, errcode_, ntokens_)
6409 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
6410 (looka_, ilooka_, error_range_, nerrs_):
6411 Rename as...
6412 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
6413 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
6414 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
6415 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
6416 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
6417 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
6418 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
6419 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
6420 these.
6421
1e547e6e
PE
64222004-12-15 Paul Eggert <eggert@cs.ucla.edu>
6423
6424 Fix some problems reported by twlevo at xs4all.
6425 * src/symtab.c (symbol_new): Report an error if the input grammar
6426 contains too many symbols. This is better than calling abort() later.
6427 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
6428 (struct node, struct graph):
6429 Rename member expand to stretch. All uses changed.
6430 (struct graph): Remove member layoutalgorithm. All uses removed.
6431 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
6432 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
6433 All uses changed.
6434 (N_STRETCH): Rename from N_EXPAND. All uses changed.
6435
735d6bd4
AD
64362004-12-15 Akim Demaille <akim@epita.fr>
6437
6438 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
6439 Add more Doxygen comments.
6440 (symprint_, stack_print_, reduce_print_, destruct_, pop)
6441 (report_syntax_error_, translate_): Rename as...
6442 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
6443 (yypop_, yyreport_syntax_error_, yytranslate_): this.
6444
2e1f5829
AD
64452004-12-15 Akim Demaille <akim@epita.fr>
6446
6447 * data/lalr1.cc (lex_): Rename as...
6448 (yylex_): this.
6449 Move the trace here.
6450 Take the %name-prefix into account.
6451 Reported by Alexandre Duret-Lutz.
6452
a3cb6248
AD
64532004-12-15 Akim Demaille <akim@epita.fr>
6454
6455 Simplify the C++ parser constructor.
6456
6457 * data/lalr1.cc (debug_): Rename as...
6458 (yydebug_): so that the parser's internals are always in the yy*
6459 pseudo namespace.
6460 Adjust uses.
6461 (b4_parse_param_decl): Remove the leading comma as it is now only
6462 called as unique argument list.
6463 (Parser::Parser): Remove the constructor accepting a location and
6464 an initial debugging level.
6465 Remove from the other ctor the argument for the debugging level.
6466 (debug_level_type, debug_level, set_debug_level): New.
6467
6468 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
6469 constructor calls.
6470
07fed891
AD
64712004-12-15 Akim Demaille <akim@epita.fr>
6472
6473 Remove b4_root related material: failure experiment
a3cb6248 6474 (which goal was to allow to derive from a class).
07fed891
AD
6475
6476 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
6477 definitions and uses.
6478
e603eaa5
PE
64792004-12-14 Paul Eggert <eggert@cs.ucla.edu>
6480
6481 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
6482 not 2, since it's not portable to subtract 1 from the start of an
6483 array. The new item 0 is never set or used. All uses changed.
6484
6485 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
6486 the default definition of YYLLOC_DEFAULT. Problem reported
6487 by Frank Heckenbach.
6488
fafb007d
PE
64892004-12-12 Paul Eggert <eggert@cs.ucla.edu>
6490
6491 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
6492 the normal case and one for the error case. Just use the
6493 first one uniformly. Problem reported by Frank Heckenbach.
6494 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
6495 use exactly the same macro in both places.
6496 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
6497 so that the normal-case YYRHSLOC works for the error case too.
6498 All uses changed.
6499 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
6500 (YYLLOC_DEFAULT): Use the same macro as glr.c.
6501 * doc/bison.texinfo (Location Default Action): Don't claim that
6502 we have an array of locations. Use the same macro for both glr
6503 and lalr parsers. Mention YYRHSLOC. Mention what happens when
6504 the index is 0.
6505
48814dcd
PE
65062004-12-10 Paul Eggert <eggert@cs.ucla.edu>
6507
a4e1a53b
PE
6508 * HACKING: Update email addresses to send announcements to.
6509
48814dcd
PE
6510 * configure.ac (AC_INIT): Bump version to 1.875f.
6511
337116ba
PE
65122004-12-10 Paul Eggert <eggert@cs.ucla.edu>
6513
6514 * NEWS: Version 1.875e.
6515 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
6516
6517 * src/scan-skel.l: Include "complain.h", for "fatal".
6518
6519 * src/relation.h (relation_print, relation_digraph):
6520 Relation sizes are of type relation_node, not size_t (this is
6521 merely a doc fix, since the two types are equivalent).
6522 (relation_transpose): Relation sizes are of type relation_node,
6523 not int.
6524 * src/relation.c: Likewise.
6525 (top, infinity): Now of type relation_node, not int.
6526 (traverse, relation_transpose): Use relation_node, not int.
6527
6528 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
6529 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
6530 (yyparse): Remove unused local introduced in 2004-10-25 patch.
6531
6532 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 6533 specifying whether the test should be skipped. Use it tp
337116ba 6534 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 6535 fail on some hosts, and should be skipped.
337116ba 6536
da2a7671
PE
65372004-12-08 Paul Eggert <eggert@cs.ucla.edu>
6538
6539 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
6540 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
6541 unless otherwise specified below.
6542
6543 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
6544 to allocate kernel_base, kernel_items, kernel_size, since
6545 they needn't be initialized to 0.
6546 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
6547 * src/closure.c (new_closure): Likewise, for itemset.
6548 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
6549 * src/lalr.c (set_goto_map): Likewise, for temp_map.
6550 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
6551 (build_relations): Likewise for edge, states1, includes.
6552 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
6553 * src/reader.c (packgram): Likewise, for ritem, rules.
6554 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
6555 * src/relation.c (relation_digraph): Likewise for VERTICES.
6556 (relation_transpose): Likewise for new_R, end_R.
6557 * src/symtab.c (symbols_token_translations_init): Likewise for
6558 token_translations.
6559 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
6560 (token_actions): Likewise for yydefact, actrow, conflrow,
6561 conflict_list.
6562 (save_column): Likewise for froms[symno], tos[symno].
6563 (goto_actions): Likewise for state_count.
6564 (pack_table): Likewise for base, pos, check.
6565 (tables_generate): Likewise for width.
6566
6567 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
6568 for initial core. Just have a separate core, so we needn't worry
6569 about whether kernel_size and kernel_base are initialized.
6570
6571 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
6572 kernel_size, kernel_items): Remove unnecessary initialization.
6573 * src/conflicts.c (conflicts): Likewise.
6574 * src/derives.c (derives): Likewise.
6575 * src/muscle_tablc (muscle_insert): Likewise.
6576 * src/relation.c (relation_digraph): Likewise.
6577 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
6578 conflrow, conflict_table, conflict_list, table, check):
6579 Likewise.
6580
6581 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
6582 This is because all callers pass unsigned int.
6583 * src/closure.h (new_closure): Likewise.
6584
6585 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
6586 (build_relations): Initialize includes[i] in all cases.
6587 * src/reader.c (packgram): Always initialize rules[ruleno].prec
6588 and rules[ruleno].precsym. Initialize members in order.
6589 * src/relation.c (relation_transpose): Always initialize new_R[i]
6590 and end_R[i].
6591 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
6592
6593 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
6594 conflict_list[0] was always 0, but now it isn't initialized.
6595
6596 * src/table.c (table_grow): When conflict_table grew, the grown
6597 area wasn't cleared. Fix this.
6598
6599 * lib/.cvsignore: Add strdup.c, strdup.h.
6600 * m4/.cvsignore: Add strdup.m4.
6601
00baeeac
PE
66022004-12-07 Paul Eggert <eggert@cs.ucla.edu>
6603
6604 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
6605 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
6606 GOTO_NUMBER_MAXIMUM, since we occasionally compute
6607 ngotos + 1 without checking for overflow.
6608 (build_relations): Use END_NODE, not -1, to denote end of edges.
6609 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
6610 build_relations): Use goto_number, not int, for goto numbers.
6611 * src/tables.c (save_column, default_goto): Likewise.
6612
be3d9d42
AD
66132004-11-23 Akim Demaille <akim@epita.fr>
6614
6615 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
6616 of #defining from yystype.
6617 Don't typedef yystype, C++ does not need it.
6618 This lets it possible to forward declare it as union.
6619
78e526d5
PE
66202004-11-23 Paul Eggert <eggert@cs.ucla.edu>
6621
6622 * bootstrap (gnulib_modules): Add extensions.
6623 Problem reported by Jim Meyering.
6624
afbb696d
PE
66252004-11-22 Paul Eggert <eggert@cs.ucla.edu>
6626
6627 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
6628 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
6629 src/system.h, src/tables.c: XFREE -> free, to accommodate
6630 recent change to gnulib xalloc.h.
78e526d5 6631 Problem reported by Jim Meyering.
afbb696d 6632
c1f8f16a
AD
66332004-11-17 Akim Demaille <akim@epita.fr>
6634
6635 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
6636
db7e5eb5 66372004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
6638 Alexandre Duret-Lutz <adl@gnu.org>
6639
6640 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
6641 changes.
6642 (YYCDEBUG): Adjust.
6643 Use it instead of cdebug_.
6644 (Parser::debug_stream, Parser::set_debug_stream): New.
6645 (Parser::symprint_): Define cdebug_ for temporary backward
6646 compatibility.
6647 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
6648 debug_stream ().
6649
68e11668
AD
66502004-11-17 Akim Demaille <akim@epita.fr>
6651
6652 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
6653 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
6654 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
6655 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
6656
97cbc73e
PE
66572004-10-27 Paul Eggert <eggert@cs.ucla.edu>
6658
6659 * data/glr.c (yyloc_default): Remove; not used.
6660 Problem reported by Frank Heckenbach.
6661
e342c3be
AD
66622004-10-25 Akim Demaille <akim@epita.fr>
6663
6664 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
6665 Introduce another definition to address simple location arrays.
6666 (yyGLRStack): New member: yyerror_range.
6667 (yyrecoverSyntaxError, yyparse): Update it.
6668 (yyrecoverSyntaxError): Use it when shifting the error token to
6669 have an accurate range, equivalent to the one computed by both
6670 yacc.c and lalr1.cc.
6671 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
6672 that column numbers start at column 0, as per GNU Coding
6673 Standards, the others tests, and the doc.
6674 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
6675 Adjust to the above change (first column is 0).
6676 And adjust the location of the "<error>", now covering the whole
6677 line.
6678
93602feb 66792004-10-22 Akim Demaille <akim@epita.fr>
04098407 6680 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
6681
6682 Remove some arbitrary limits on goto numbers and relations.
6683 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
6684 initial values, since they're never used.
6685 (set_goto_map): ngotos is now unsigned, so test for overflow
6686 by seeing whether it wraps around to zero.
6687 * src/lalr.h (goto_number): Now size_t, not short int.
6688 (GOTO_NUMBER_MAXIMUM): Remove.
6689 * src/relation.c (relation_print, traverse, relation_transpose):
6690 Check for END_NODE rather than looking at sign.
6691 * src/relation.h (END_NODE): New macro.
6692 (relation_node): Now size_t, not short int.
6693
dba08b04
PE
66942004-10-22 Paul Eggert <eggert@cs.ucla.edu>
6695
6696 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
6697 keyword, not an identifier. Problem reported by Baron Schwartz in
6698 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
6699
df09ef2e
AD
67002004-10-11 Akim Demaille <akim@epita.fr>
6701
6702 * src/symtab.c (symbol_check_alias_consistency): Also check
6703 type names, destructors, and printers.
6704 Reported by Alexandre Duret-Lutz.
6705 Recode the handling of associativity and precedence in terms
6706 of symbol_precedence_set.
6707 Accept no redeclaration at all, not even equal to the previous
6708 value.
6709 (redeclaration): New.
6710 Use it to factor redeclaration complaints.
6711 (symbol_make_alias): Don't set the type of the alias, let
6712 symbol_check_alias_consistency do it as for other features.
6713 * src/symtab.h (symbol): Add new member prec_location, and
6714 type_location.
6715 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
6716 * tests/input.at (Incompatible Aliases): New.
6717
146bc99d
PE
67182004-10-09 Paul Eggert <eggert@cs.ucla.edu>
6719
6720 .cvsignore fixes to accommodate gnulib changes,
6721 and the practice of naming build directories "_build".
6722 * .cvsignore: Add "_*". Sort.
6723 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
6724 * m4/.cvsignore: Add "*_gl.m4".
6725
e503aa60
AD
67262004-10-06 Akim Demaille <akim@epita.fr>
6727
6728 * src/parse-gram.y (add_param): Fix the truncation of trailing
6729 spaces.
6730
b4a20338
AD
67312004-10-05 Akim Demaille <akim@epita.fr>
6732
6733 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
6734 whether the reducion was empty or not. This leaves room to
6735 improve the use of YYLLOC_DEFAULT in such a case.
6736 lalr1.cc is still experimental, so changing this is acceptable.
6737 And finally, there are probably not many users who changed the
6738 handling of locations in GLR, so changing is admissible too.
6739
6740 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
6741 empty reduction, set @$ to an empty location ending the previously
6742 stacked symbol.
6743 Adjust uses to make sure the code is triggered on empty
6744 reductions.
6745 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
6746 expected output: empty reductions have empty locations.
6747
f85a5e6f
AD
67482004-09-29 Akim Demaille <akim@epita.fr>
6749
6750 * data/lalr1.cc: Move towards a more standard C++ coding style
6751 for templates: Class < T > -> Class<T>.
6752
b203fc2c
AD
67532004-09-29 Akim Demaille <akim@epita.fr>
6754
6755 * data/lalr1.cc: Reinstall the former ctor, for sake of
6756 compatibility, but warn it will be removed.
6757 Move towards a more standard C++ coding style (i.e., type *var ->
6758 type* var).
6759
5b7e1e73
PE
67602004-09-27 Paul Eggert <eggert@cs.ucla.edu>
6761
3fee967f
PE
6762 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
6763 since it's less likely to work if NULs are involved in the future.
5b7e1e73 6764
0dcca5c2
AD
67652004-09-27 Akim Demaille <akim@epita.fr>
6766
6767 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
6768
6dde1c82
AD
67692004-09-27 Akim Demaille <akim@epita.fr>
6770
6771 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 6772 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
6773 and argument names.
6774 (b4_cc_constructor_call): Likewise.
6775
b233d555
AD
67762004-09-24 Akim Demaille <akim@epita.fr>
6777
6778 * src/parse-gram.y (add_param): Strip the leading and trailing
6779 blanks from a formal argument declaration.
6780 (YY_LOCATION_PRINT): New.
6781
619404e3
AD
67822004-09-24 Akim Demaille <akim@epita.fr>
6783
6784 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
6785 after the location.
6786
dd8d9022
AD
67872004-09-24 Akim Demaille <akim@epita.fr>
6788
6789 * doc/bison.texinfo (Table of Symbols): Sort.
6790
0092f063
AD
67912004-09-21 Akim Demaille <akim@epita.fr>
6792
6793 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
6794 the useless parentheses.
6795 Suggested by Paul Eggert.
6796
451364ed
AD
67972004-09-20 Akim Demaille <akim@epita.fr>
6798
6799 Let the initial-action act on the look-ahead, and use it for the
6800 "initial push" (corresponding to an hypothetical beginning-of-file).
6801 And let lalr1.cc honor %initial-action.
6802
6803 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
6804 example.
6805 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
6806 (Parser::Parser): Remove the ctor that used to initialize it.
6807 (Parser::parse): Like in the other skeletons, issue the "starting
6808 parse" message before any action.
6809 Honor %initial-action.
6810 Initialize the stacks with the lookahead.
6811 * data/yacc.c: Let $$ and @$ in %initial-action designate the
6812 look-ahead.
6813 Push them in the stacks.
6814 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
6815
18d192f0
AD
68162004-09-20 Akim Demaille <akim@epita.fr>
6817
6818 * doc/bison.texinfo (Initial Action Decl): New.
6819
b8458aa5
AD
68202004-09-20 Akim Demaille <akim@epita.fr>
6821
6822 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
6823 clearer criterion to define it.
6824 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
6825 When reducing on an empty RHS, use the latest stacked location as
6826 location.
6827 yylloc is not always available.
6828 * data/glr.c: Likewise.
6829 Also, honor initial-actions.
6830
3fc16193
AD
68312004-09-20 Akim Demaille <akim@epita.fr>
6832
6833 * data/yacc.c (YY_LOCATION_PRINT): New.
6834 Define when we know YYLTYPE's structure, i.e., when the default
6835 YYLLOC_DEFAULT is used.
6836 * data/c.m4 (b4_yysymprint_generate): Use it.
6837 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
6838 value of the result.
6839 (error_start_): Replace with...
6840 (error_range_): this location array.
6841 This allows to replace code relying on the implementation of
6842 locations by portable code.
6843 * data/yacc.c (yylerrsp): Replace with...
6844 (yyerror_range): this.
6845 Every time a token is popped, update yyerror_range[0], to have an
6846 accurate location for the error token.
6847 * data/glr.c (YY_LOCATION_PRINT): New.
6848 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
6849 deference a pointer.
6850 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
6851 report the location in %printers.
6852
6853 * src/scan-skel.l: Instead of abort, report error messages to ease
6854 understanding skeleton scanning failures.
6855
ecfe33e7
AD
68562004-09-16 Akim Demaille <akim@epita.fr>
6857
6858 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
6859 (iterator, const_iterator): these, to be more in the C++ spirit.
6860 Also, return reverse iterators so that when displaying the stack
6861 we display its bottom first.
6862 (Parser::stack_print_, Parser::reduce_print_): Match the messages
6863 from yacc.c.
6864 We should probably use vector here though.
6865
1576d44d
AD
68662004-09-16 Akim Demaille <akim@epita.fr>
6867
6868 Have more complete shift traces.
6869
6870 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
6871 to report Shifts instead of ad hoc YYDPRINTF invocations,
6872 including for the error token.
6873 * data/lalr1.cc (symprint_): Output the location.
6874 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
6875 output the location within the %printer.
6876 Activate GLR tests, at least to make sure they compile properly.
6877 They still don't pass though.
6878 * tests/calc.at: Adjust expect verbose output, since now "Entering
6879 state..." is on a different line than the "Shifting" message.
6880
9c66f418
AD
68812004-09-08 Akim Demaille <akim@epita.fr>
6882
6883 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
6884 Bison directive from the Bison file to the invocation of this
6885 macro, so that these directives are passed to
6886 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
6887 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
6888 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
6889 the extra Bison directives instead of the whole series.
6890 Change the grammar so that there are recoverable errors, and
6891 unrecoverable errors. Now we can have the parser give up before
6892 consuming the whole input. As a result we now can observe that
6893 the lookahead is freed when needed.
6894 Change the parser source to parse argv[1] instead of a hard coded
6895 string.
6896 Simplify yylex, and give a value and location to EOF.
6897 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
6898 passed directives already coded in the file.
6899 Add some tests to check the location of "error".
6900 For some tests, the C++ parser is correct, and not yacc.c.
6901 For other tests, they provide different, but unsatisfying, values,
6902 so keep the C++ value so that at least one parser is "correct"
6903 according to the test suite.
6904 (Actions after errors): Remove, this is subsumed by the
6905 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
6906
52d5733f
AD
69072004-09-06 Akim Demaille <akim@epita.fr>
6908
6909 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 6910 (Parser::pop): New.
52d5733f
AD
6911 Use it.
6912
a0e68930
AD
69132004-09-06 Akim Demaille <akim@epita.fr>
6914
6915 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
6916 argument, an informative message.
6917 Call YY_SYMBOL_PRINT.
6918 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
6919 * data/lalr1.cc (destruct_): Likewise.
6920 In addition, no longer depend on b4_yysymprint_generate and
6921 b4_yydestruct_generate to generate these functions, do it "by
6922 hand".
6923
e757bb10
AD
69242004-09-03 Akim Demaille <akim@epita.fr>
6925
6926 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
6927 invoked, yydestruct the lookahead.
6928 * tests/calc.at (Calculator $1): Update the expected lengths of
6929 traces: there is an added line for the discarded lookahead.
6930 * doc/bison.texinfo (Destructor Decl): Some rewording.
6931 Define "discarded" symbols.
6932
0fe1f06d
AD
69332004-09-02 Akim Demaille <akim@epita.fr>
6934
6935 * data/lalr1.cc (translate_, destruct_): No reason to be static.
6936
284acc8b
AD
69372004-09-02 Akim Demaille <akim@epita.fr>
6938
6939 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
6940 (YYDSYMPRINTF): Rename as...
6941 (YY_SYMBOL_PRINT): this.
6942 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
6943 two.
6944 Use it instead of direct symprint_ calls.
6945 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
6946 one.
6947
a5eb1ed2
AD
69482004-09-02 Akim Demaille <akim@epita.fr>
6949
b7c72fe1
AD
6950 * data/lalr1.cc (b4_yysymprint_generate): New.
6951 (symprint_): New member function, defined when YYDEBUG.
6952 Use it consistently instead of token/nterm debugging output by
6953 hand.
a5eb1ed2
AD
6954 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
6955 %printer calls to use cdebug_ when using lalr1.cc.
6956
417141dd
AD
69572004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
6958
6959 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
6960 with #ifdef YYDEBUG.
6961
2fa09258
AD
69622004-08-26 Akim Demaille <akim@epita.fr>
6963
6964 * doc/bison.texinfo (Implementing Loops): Rename as...
6965 (Implementing Gotos/Loops): this.
6966
9378b508
PE
69672004-08-13 Paul Eggert <eggert@cs.ucla.edu>
6968
6969 Adjust to latest gnulib.
6970 * bootstrap (gnulib_modules): Add xalloc-die.
6971 Set LC_ALL=C so that file names sort consistently.
6972 Prefer the gnulib copies of gettext.m4, glibc21.m4,
6973 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
6974 uintmax_t.m4, ulonglong.m4.
6975 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
6976 po.m4 since we are now using _gl.m4 instead.
6977
87a8ad5c
PE
69782004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
6979
6980 * src/scan-action.l: Remove. Scanning of semantic actions is
6981 handled in scan-gram.l.
6982
dca81a78
PE
69832004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
6984
6985 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
6986
6987 * src/location.h (struct): The file member is a uniqstr.
6988 (equal_boundaries): Use UNIQSTR_EQ for comparison.
6989
c9cbf7c5
PE
69902004-07-22 Paul Eggert <eggert@cs.ucla.edu>
6991
6992 Fix bug with non-%union parsers that have printers or destructors,
6993 which led to a Bison core dump. Reported by Peter Fales in
6994 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 6995
c9cbf7c5
PE
6996 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
6997 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
6998 not to our own type.
6999 * src/output.c (symbol_destructors_output, symbol_printers_output):
7000 Don't assume %union.
7001 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
7002 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
7003 UNION-FLAG. All callers changed.
7004 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
7005 Use type char, not unsigned int, when declaring an array of char;
7006 this lets us remove a cast.
7007 (Printers and Destructors): Add non-%union test cases.
7008
fa7e68c3
PE
70092004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7010
7011 * doc/bison.texinfo: Minor editorial changes, mostly to the new
7012 GLR writeups. E.g., avoid frenchspacing and the future tense,
7013 change "lookahead" to "look-ahead", and change "wrt" to "with
7014 respect to".
2fa09258 7015
fa7e68c3
PE
70162004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7017
7018 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
7019 New sections, split off from the GLR Parsers section. Put the new
7020 Simple GLR Parser near the start of the GLR section, for clarity.
7021 Rewrite connective text.
7022
99a9344e
PE
70232004-06-21 Frank Heckenbach <frank@g-n-u.de>
7024
7025 * doc/bison.texinfo (Simple GLR Parsers): New section.
7026
8dd162d3
PE
70272004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7028
7029 * NEWS, TODO, doc/bison.texinfo:
7030 Use "look-ahead" instead of "lookahead", to be consistent.
7031 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
7032 while we're fixing "look-ahead".
7033 * src/conflicts.c (shift_set): Renamed from shiftset.
7034 (look_ahead_set): Renamed from lookaheadset.
7035 * src/print.c: Likewise.
7036 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
7037 name for "lookahead".
7038 (report_types, usage): Likewise.
7039 * src/getargs.h (report_look_ahead_tokens): Renamed from
7040 report_lookaheads.
7041 * src/lalr.c (compute_look_ahead_tokens): Renamed from
7042 compute_lookaheads.
7043 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
7044 (look_ahead_tokens_print): Renamed from lookaheads_print.
7045 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
7046 state_rule_lookaheads_print.
7047 * src/state.h: Likewise.
7048 (reductions.look_ahead_tokens): Renamed from lookaheads.
7049 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
7050 AT_DATA_LOOKAHEADS_GRAMMAR.
7051
57a90331
PE
70522004-06-03 Paul Eggert <eggert@cs.ucla.edu>
7053
7054 * README: Update location of patched M4 distribution.
7055
8ed3234a
PE
70562004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
7057
7058 Don't assume the C++ compiler takes the same arguments as the C compiler
7059 (trivial change).
7060 * configure.ac (O0CXXFLAGS): New var.
7061 * tests/atlocal.in (CXXFLAGS): Use it.
7062
07971983
PE
70632004-05-29 Paul Eggert <eggert@cs.ucla.edu>
7064
7065 Fix some "make check" problems with C++ reported by
7066 Albert Chin-A-Young for Tru64 C++ in this thread:
7067 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
7068
7069 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
7070 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7071 Output to a .cc file for C++, not to a .c file.
7072 * tests/calc.at (AT_CHECK_CALC): Likewise.
7073 * tests/regression.at (AT_CHECK_DANCER): Likewise.
7074 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
7075
29058652
PE
70762004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
7077
7078 * tests/calc.at, tests/actions.at: Workaround for SGI
7079 C++ compiler. (trivial change)
7080
62cb8a99
PE
70812004-05-27 Paul Eggert <eggert@cs.ucla.edu>
7082
fd418816
PE
7083 Spent a few hours checking out which prerequisite versions the
7084 current sources actually require. I went all the way back to
7085 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
7086 a seemingly endless set of combinations of versions more recent
7087 than that. The bottom line is that the current sources require
7088 fairly recent versions of the build tools, and it'll be some work
7089 to change this.
7090 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
7091 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
7092 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
7093 Add comments explaining why those particular versions are
7094 currently needed.
2fa09258 7095
62cb8a99
PE
7096 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
7097 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 7098 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
7099
7100 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
7101 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
7102
caa52c10
PE
71032004-05-26 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
7106 0.11.5. Suggested by Bruno Haible.
7107 * bootstrap: Remove gettext version checking.
7108
7109 * doc/bison.texinfo (Decl Summary): Also mention that %union
7110 can depend on prerequisite types. Problem reported by Tim
7111 Van Holder.
7112
4bfd5e4e
PE
71132004-05-25 Paul Eggert <eggert@cs.ucla.edu>
7114
2cef3017
PE
7115 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
7116 * README-alpha: Don't tell people not to package this.
7117
b9c85d5c
PE
7118 * bootstrap: Don't assume $(...) works; use `...` instead.
7119 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
7120 gettext better.
7121
4bfd5e4e
PE
7122 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
7123 put into the -d output file, and mention what to do if YYSTYPE is
7124 defined as a macro.
7125
6a36ff94
PE
71262004-05-24 Paul Eggert <eggert@cs.ucla.edu>
7127
6712933e
PE
7128 Undo change made earlier today: it caused autopoint to not bring
7129 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
7130 autopoint's.
7131
7132 * bootstrap: Check that gettext version matches what's in
7133 configure.ac. Warn users to ignore robots.txt ERROR 404.
7134 * bootstrap: Undo today's earlier change (logged below).
7135 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 7136
6a36ff94
PE
7137 The gettext version checking is causing more trouble than it's
7138 curing; remove it. Problem reported by Paul Hilfinger.
7139
7140 * bootstrap: Issue a warning that one can expect a message
7141 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
7142 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
7143
209ea708
PE
71442004-05-23 Paul Eggert <eggert@cs.ucla.edu>
7145
7146 Ensure that the C++ compiler used for testing actually works on a
7147 simple test program; if not, skip the C++-related tests. Problem
7148 reported by Vin Shelton in:
161a71f3 7149 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
7150
7151 * m4/cxx.m4: New file.
7152 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
7153 * tests/atlocal.in (BISON_CXX_WORKS): Add.
7154 * tests/local.at (AT_COMPILE_CXX): Use it.
7155
41ca2549
PE
71562004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7157
383e69dc
PE
7158 * data/glr.c (yylloc): Output this macro even if locations are not
7159 being generated, as the GLR parser needs it even in that case.
7160 Problem reported by Troy A. Johnson
7161 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
7162
41ca2549
PE
7163 * configure.ac (AC_INIT): Update to 1.875e.
7164
e476c87d
PE
71652004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7166
7167 * NEWS: Version 1.875d.
7168 * configure.ac (AC_INIT): Likewise.
7169 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
7170
7171 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
7172 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
7173 lalr1.cc runs afoul of the first, and the last two are no longer
7174 supported by GCC 3.4.0.
7175 * README: Mention GNU m4 1.4 or later; mention m4 patches.
7176 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
7177
233a88ad
PE
71782004-05-06 Paul Eggert <eggert@cs.ucla.edu>
7179
7180 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
7181 unsigned int, for compatibility with latest gnulib hash module.
7182 * src/state.c (state_hash, state_hasher): Likewise.
7183 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
7184 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 7185
12ffdd28
PE
71862004-05-03 Paul Eggert <eggert@cs.ucla.edu>
7187
7188 * NEWS: Unescaped newlines are no longer allowed in char & strings.
7189
7190 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
7191 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
7192 character and string literals.
7193 (unexpected_end): New function.
7194 (unexpected_eof): Use it.
7195 (unexpected_newline): New function.
7196 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
7197 actions.
e476c87d 7198
12ffdd28
PE
7199 * NEWS: Document %expect-rr.
7200
7201 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
7202 Fix typo by replacing $1 with $option.
7203 Remove more 'intl'-related files.
9668e2be 7204 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
7205
7206 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
7207 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
7208 strtoul.c.
7209 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
7210 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
7211 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
7212 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
7213 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
7214 * src/.cvsignore: Add *.output.
7215
7216 * src/parse-gram.y: Put copyright notice inside %{ %} so it
7217 gets copied to the output file.
e476c87d 7218
1f65350a
PE
72192004-04-28 Paul Eggert <eggert@twinsun.com>
7220
7221 Get files from the gnulib and po repositories, instead of relying
7222 on them being in our CVS. Upgrade to latest versions of gnulib
7223 and Automake.
7224
7225 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
7226 * bootstrap: Bootstrap from gnulib and po repositories.
7227 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
7228 * README-cvs: Document these changes. Remove version numbers from
7229 mentions of build tools, since they change so often. Mention Flex.
7230
7231 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
7232 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
7233 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
7234 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 7235 does this for us.
12ffdd28
PE
7236 (AC_ISC_POSIX): Remove; we no longer support this
7237 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
7238 (AC_HEADER_STDC): Remove: we now assume C89 or better.
7239 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
7240 Do not check for C89 headers, except for locale.h which is used
7241 by the Yacc library and must port to K&R hosts.
7242 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
7243 Do not check for C89 functions, except for setlocale which is
7244 used by the Yacc library.
7245 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
7246 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
7247 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
7248 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
7249 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
7250 AM_GNU_GETTEXT): Remove; now done by:
7251 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
7252 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
7253 for us.
7254
7255 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
7256 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
7257 Define to empty, as gnulib.mk will do the rest for us.
7258 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
7259 for us.
7260 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
7261 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
7262
7263 * src/files.c: Include gnulib's xstrndup.h.
7264
7265 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
7266 (REALLOC): Use xnrealloc, for likewise.
7267 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
7268 (strnlen, memrchr): Remove decls; functions no longer used.
7269 Include <stpcpy.h>.
7270
7271 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
7272 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7273 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
7274 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
7275 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
7276 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
7277 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
7278 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
7279 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
7280 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
7281 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
7282 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7283 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
7284 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
7285 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
7286 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
7287 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
7288 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
7289 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
7290 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
7291 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
7292 Remove, as these files are now generated automatically
7293 by bootstrap or automake.
7294
7295 * po/ChangeLog: Remove: all but one entry was a duplicate
7296 of this file, and I moved that 2000-11-02 entry here.
7297
7298 * config/.cvsignore: Add Makefile, depcomp, install-sh.
7299 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
7300 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
7301 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
7302 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
7303 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
7304 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
7305 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
7306 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
7307 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
7308 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
7309 xstrndup.h.
7310 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
7311 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
7312 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
7313 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
7314 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
7315 * src/.cvsignore: Remove *_.c.
7316
7317
7318 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
7319 support it. (The latest stable gzip doesn't.)
7320
73212004-04-27 Paul Eggert <eggert@twinsun.com>
7322
7323 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
7324 case, as stos_ is now used by destructors due to the 2004-02-09
7325 change.
7326
7327 Remove more K&R C support.
7328 * lib/libiberty.y (PARAMS): Remove. All uses removed.
7329 * lib/subpipe.c (errno): Remove decl.
7330 Include <stdlib.h> unconditionally.
7331 (EXIT_FAILURE): Remove macro.
7332 * src/complain.c (vfprintf, strerror): Remove.
7333 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
7334 unconditionally.
7335 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
7336 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
7337 (strchr, strspn, memchr): Remove decls.
7338 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
7339 unconditionally. Do not declare perror.
7340 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
7341 unconditionally.
7342
7343 * src/complain.c (_): Remove useless defn, as system.h defines this.
7344
7345 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
7346 with latest obstack.h.
7347 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
7348 to procedure types, as obstack.h now does that for us.
7349 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
7350
7351 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
7352 so that this include file can stand alone.
7353 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
7354 does this now. Include subpipe.h first after config.h, to
7355 test whether it can stand alone.
7356
7357 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
7358 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
7359 unused declaration.
7360
7361 * tests/synclines.at (%union synch line): Put a dummy member in
7362 the union, because empty unions aren't allowed in C. Caught
7363 by GCC 3.4.0.
7364
4f16766c
PE
73652004-04-13 Jim Meyering <jim@meyering.net>
7366
7367 * src/conflicts.c (conflicts_print): Correct format string typo:
7368 use `%%' to produce literal `%'. (trivial change)
7369
779e7ceb
PE
73702004-03-30 Paul Eggert <eggert@twinsun.com>
7371
7372 * src/getargs.c (version): Update copyright year to 2004.
7373
7374 * data/c.m4 (b4_int_type): Use 'short int' rather than
7375 'short', and similarly for 'long', 'unsigned', etc.
7376 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
7377 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
7378 yy_yypstack, yydumpstack): Likewise.
7379 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
7380 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
7381 Likewise.
7382 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
7383 yy_stack_print, yyparse): Likewise.
7384 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
7385 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
7386 * lib/bitset.c (bitset_print): Likewise.
7387 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
7388 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7389 * lib/bitsetv.c (bitsetv_dump): Likewise.
7390 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
7391 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
7392 Likewise.
7393 * src/LR0.c (allocate_itemsets): Likewise.
7394 * src/gram.h (rule_number, rule): Likewise.
7395 * src/lalr.h (goto_number): Likewise.
7396 * src/nullable.c (nullable_compute): Likewise.
7397 * src/output.c (prepare_rules): Likewise.
7398 * src/relation.c (relation_print, relation_digraph): Likewise.
7399 * src/relation.h (relation_node): Likewise.
7400 * src/state.h (state_number, transitions, errs, reductions,
7401 struct state): Likewise.
7402 * src/symtab.h (symbol_number, struct symbol): Likewise.
7403 * src/tables.c (vector_number, tally, action_number,
7404 default_goto, goto_actions): Likewise.
7405 * tests/existing.at (GNU Cim Grammar): Likewise.
7406 * tests/regression.at (Web2c Actions): Likewise.
7407
7408 * src/output.c (muscle_insert_short_int_table): Renamed from
7409 muscle_insert_short_table. All uses changed.
7410
d6328241
PH
74112004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7412
7413 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
7414 (declaration): Replace expected_conflicts with expected_sr_conflicts.
7415 Add %expect-rr rule.
4f16766c 7416
d6328241
PH
7417 * src/scan-gram.l: Recognize %expect-rr.
7418
4f16766c 7419 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 7420 expected_conflicts.
4f16766c 7421 (expected_rr_conflicts): Declare.
d6328241
PH
7422
7423 * src/conflicts.c (expected_sr_conflicts): Rename from
7424 expected_conflicts.
7425 (expected_rr_conflicts): Define.
7426 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
7427 for GLR parsers.
7428 Use expected_sr_conflicts in place of expected_conflicts.
7429 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 7430
d6328241 7431 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 7432
1452af69
PE
74332004-03-08 Paul Eggert <eggert@gnu.org>
7434
7435 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 7436 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
7437
7438 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
7439 in lalr1.cc.
7440 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
7441 * src/scan-gram.l (scan_integer): New function.
7442 ({int}): Use it.
7443 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
7444 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
7445 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
7446 Say "long int", not "long", for uniformity with GNU style.
7447
006d217d
PE
74482004-02-25 Paul Eggert <eggert@twinsun.com>
7449
7450 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
7451 compilers. This fixes a problem with Intel's C++ compiler being
7452 chatty, reported by Guido Trentalancia in
161a71f3 7453 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 7454
c2729758
ADL
74552004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
7456
7457 Support %destructor and merge error locations in lalr1.cc.
7458
7459 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
7460 (Parser::stos_): Define unconditionally.
7461 (Parser::destruct_): New method. Generate its body with
7462 b4_yydestruct_generate.
7463 (Parser::error_start_): New attribute.
7464 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
7465 token which are discarded.
7466 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
7467 error_start_ when erroneous token are discarded.
7468 (Parser::parse) <yyerrlab1>: Compute the location of the error
7469 token so that it covers all the discarded tokens.
7470 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
7471 it can be called with `%skeleton "lalr1.cc"', and do that.
7472
dd0e0635
PE
74732004-02-02 Paul Eggert <eggert@twinsun.com>
7474
7475 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
7476 $(top_srcdir)/lib and ../lib. This fixes a bug reported
7477 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
7478 There's no need to mention top_builddir since Automake does that
7479 for us.
7480 (INCLUDES): Remove, as Automake says it's obsolescent.
7481 Contents migrated into AM_CPPFLAGS as described above.
7482 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
7483
74842004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7485
7486 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
7487 (yyreportSyntaxError): Handle case where lookahead token is
7488 YYEMPTY.
7489
be16239b
PH
74902004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7491
7492 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
7493 resulting parsers are compilable with C++.
7494
5fa90832
PE
74952003-12-23 Paul Eggert <eggert@twinsun.com>
7496
7497 * config/depcomp, config/install-sh: Sync with Automake 1.8.
7498 * src/output.c (output_skeleton): Rename local var.
7499 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
7500 Bison tokens, as this runs afoul of the 2003-10-07 change that
7501 disallowed NUL bytes in character constants or string literals.
7502
7503 * tests/local.at: Require Autoconf 2.59's Autotest.
7504 * tests/testsuite.at: Don't include local.at, since we now assume
7505 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
7506 including it.
7507 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
7508 multiple inclusion warnings.
dd0e0635 7509
b165c324
AD
75102003-12-02 Akim Demaille <akim@epita.fr>
7511
7512 * doc/bison.texinfo (How Can I Reset the Parser): More about start
7513 conditions.
7514 From Bruno Haible.
7515
26e06a21
ADL
75162003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
7517
7518 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
7519
92ac3705
PE
75202003-10-07 Paul Eggert <eggert@twinsun.com>
7521
6a5ecb38
PE
7522 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
7523 if testsuite doesn't exist.
7524
92ac3705
PE
7525 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
7526 literals, unfortunately.
7527 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
7528 Complain about NUL bytes in character constants or string literals.
7529
91d2c560
PE
75302003-10-05 Paul Eggert <eggert@twinsun.com>
7531
7532 * NEWS: Don't document %no-default-prec, as it's still
7533 too experimental.
7534 * doc/bison.texinfo: Document %no-default-prec only if
7535 the defaultprec flag is set. Normally it's not.
7536
0cc3da3a
PE
75372003-10-04 Paul Eggert <eggert@twinsun.com>
7538
7539 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
7540 non-modifiable lvalue, instead of a modifiable one.
7541 * doc/bison.texinfo (Actions): Document that $$ can
7542 be assigned to. Do not claim that $$ and $N are
7543 array element references: user code should not rely on this.
7544
22fccf95
PE
75452003-10-01 Paul Eggert <eggert@twinsun.com>
7546
7547 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
7548 (grammar_declaration): Use it.
7549 * src/scan-gram.l: New token %no-default-prec.
7550 * tests/conflicts.at: Revamp tests to use %no-default-prec.
7551 * NEWS, doc/bison.texinfo: Document the above.
7552
fc8f2965
AD
75532003-10-01 Akim Demaille <akim@epita.fr>
7554
7555 VCG no longer supports long_straight_phase.
7556
7557 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
7558 * src/print_graph.c (print_graph): Adjust.
7559
39a06c25
PE
75602003-09-30 Frank Heckenbach <frank@g-n-u.de>
7561 and Paul Eggert <eggert@twinsun.com>
7562
7563 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
7564 Table of Symbols): Document %default-prec.
7565 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
7566 (grammar_declaration): Set default_prec on %default-prec.
7567 * src/scan-gram.l (%default-prec): New token.
7568 * src/reader.h (default_prec): New flag.
7569 * src/reader.c: Likewise.
7570 (packgram): Handle it.
7571 * tests/conflicts.at (%default-prec without %prec,
7572 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 7573
39a06c25
PE
75742003-09-30 Paul Eggert <eggert@twinsun.com>
7575
7576 * tests/testsuite.at: Include local.at, not input.at, fixing
7577 a typo in the 2003-08-25 patch.
7578
62b6aef9
AD
75792003-08-27 Akim Demaille <akim@epita.fr>
7580
7581 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
7582 GCC warnings.
7583
89e1cc61
AD
75842003-08-26 Akim Demaille <akim@epita.fr>
7585
7586 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
7587 "<\#" to avoid magic from Gnus when posting parts of this script.
7588
a08460b0
AD
75892003-08-26 Akim Demaille <akim@epita.fr>
7590
7591 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
7592 (Parser::parse): here.
7593 Adjust: nerrs and errstatus is now replaced by...
7594 (Parser::nerrs_, Parser::errstatus_): New.
7595
603f1cfd
AD
75962003-08-25 Akim Demaille <akim@epita.fr>
7597
7598 * config/announce-gen, Makefile.cfg: New.
7599 * Makefile.am: Adjust.
7600 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
7601 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
7602
cd3684cf
AD
76032003-08-25 Akim Demaille <akim@epita.fr>
7604
7605 When reducing initial empty rules, Bison parser read an initial
7606 location that is not defined. This results in garbage, and that
7607 affects Bison's own parser. Therefore we need (i) to extend Bison
7608 to support a means to initialize this location, and (ii) to use
7609 this CVS Bison to fix CVS Bison's parser.
7610
7611 * src/reader.h, reader.c (epilogue_augment): Remove, replace
7612 with...
7613 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
7614 * src/parse-gram.y: Adjust.
7615 (%initial-action): New.
7616 (%error-verbose): Since we require CVS Bison, there is no reason
7617 not to use it.
7618 * src/scan-gram.l: Adjust.
7619 * src/Makefile.am (YACC): New, to make sure we use our own parser.
7620 * data/yacc.c (yyparse): Use b4_initial_action.
7621
4e03e201
AD
76222003-08-25 Akim Demaille <akim@epita.fr>
7623
7624 * doc/bison.texinfo: Don't promote stdout for error messages.
7625
8c182d05
AD
76262003-08-25 Akim Demaille <akim@epita.fr>
7627
7628 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
7629 From Alexandre Duret-Lutz.
7630
6a60c4cf
PE
76312003-08-25 Akim Demaille <akim@epita.fr>
7632
7633 Version 1.875c.
7634
25f66e1a
AD
76352003-08-25 Akim Demaille <akim@epita.fr>
7636
7637 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
7638 Use them.
7639
5348bfbe
AD
76402003-08-25 Akim Demaille <akim@epita.fr>
7641
7642 * data/lalr1.cc (Parser::reduce_print_): New.
7643 Use it.
7644
47301314
AD
76452003-08-25 Akim Demaille <akim@epita.fr>
7646
7647 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
7648 error recovery loops. This patch is based on
161a71f3 7649 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
7650 Also, augment the similarity between lalr1.cc and yacc.c.
7651 Note: the locations of error recovery rules are not correct yet.
7652
7653 * data/lalr1.cc: Comment changes to augment the similarity between
7654 lalr1.cc and yacc.c.
7655 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
7656 (yyerrlab1): Remove, but where it used to be (now the bottom part of
7657 yyerrlab), when hitting EOF, pop the whole stack here instead of
7658 merely falling thru the default error handling mechanism.
7659 (yyerrorlab): New label, with the old contents of YYERROR,
7660 plus the following change: pop the stack of rhs corresponding
7661 to the production that invoked YYERROR. That is how Yacc
7662 behaves (required by POSIX).
7663 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
7664 fail.
7665
1f7a61ff
AD
76662003-08-25 Akim Demaille <akim@epita.fr>
7667
7668 Tune local.at so that people can "autom4te -l autotest calc.at -o
7669 calc" for instance, to extract a sub test suite.
7670
7671 * tests/testsuite.at: Move the initialization, Autotest version
7672 requirement, and AT_TESTED invocation into...
7673 * tests/local.at: here.
7674 * tests/testsuite.at: Include it for compatibility with Autoconf
7675 2.57.
7676 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
7677 be ignore.
7678
327b5b56
PE
76792003-08-04 Paul Eggert <eggert@twinsun.com>
7680
7681 Rework code slightly to avoid gcc -Wtraditional warnings.
7682 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
7683 The returned value is now stored in *YY0. All callers changed.
7684 * src/output.c (merge_output): Adjust to the above change.
7685
0051e3ed
PE
76862003-07-26 Paul Eggert <eggert@twinsun.com>
7687
7688 * data/glr.c (YYASSERT): New macro.
7689 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
7690 yyresolveStates, yyprocessOneStack):
7691 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
7692 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 7693
137437c6
PE
76942003-07-25 Paul Eggert <eggert@twinsun.com>
7695
5b620e06
PE
7696 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
7697 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 7698 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
7699 by Frank Heckenbach, though I have omitted the structure-initialization
7700 part of his glr-knr.diff patch since I recall that the Portable
7701 C Compiler didn't require that change.
7702
137437c6
PE
7703 Let the user specify how to allocate and free memory.
7704 Derived from a suggestion by Frank Heckenbach in
161a71f3 7705 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
7706 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
7707 All uses of free, malloc, realloc changed to use these macros,
7708 and unnecessary casts removed.
7709 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
7710
ddb85ca5
PE
77112003-07-06 Matthias Mann <MatthiasMann@gmx.de>
7712
7713 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
7714 use s.empty() rather than s == "" to test for empty string; see
161a71f3 7715 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
7716 (trivial change)
7717
39910e09
AD
77182003-06-25 Akim Demaille <akim@epita.fr>
7719
7720 * config/depcomp, config/install-sh: Update from masters.
7721
0ae99356
PE
77222003-06-20 Paul Eggert <eggert@twinsun.com>
7723
7724 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
7725 and return properly parenthesized result.
7726 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
7727 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7728 Remove unnecessary parentheses from uses.
7729 * doc/bison.texinfo (Location Default Action): Describe the
7730 conventions for parentheses.
7731
cd05d13c
PE
77322003-06-19 Paul Eggert <eggert@twinsun.com>
7733
81fd08ca
PE
7734 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
7735 yyreportTree): Do not assume that size_t is the same width as int,
7736 when printing sizes. Print sizes using an unsigned format.
7737 Problem reported by Frank Heckenbach in
161a71f3 7738 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 7739
cd05d13c
PE
7740 Port to Forte Developer 7 C compiler.
7741 * data/glr.c (struct YYLTYPE): If locations are not being used,
7742 declare a single dummy member, as empty structs do not conform
7743 to the C standard.
7744 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
7745 the Forte Developer 7 C compiler complains that end-of-loop
7746 code is not reached.
7747
4dcf140b
PE
77482003-06-17 Paul Eggert <eggert@twinsun.com>
7749
7750 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
7751 avoid warnings from picky compilers about redefinition of PARAMS.
7752
8dd76bee
PE
77532003-06-17 Paul Eggert <eggert@twinsun.com>
7754
7755 Version 1.875b.
7756
7757 * NEWS: Document 1.875b.
7758
7759 * lib/bbitset.h: Do not include config.h; that's the includer's job.
7760 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
7761 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
7762 Don't use 'index' in comments, as it's a builtin fn on some hosts.
7763 * lib/bitset_stats.c: Include gettext.h unconditionally, as
7764 per recent gettext manual's suggestion.
7765 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
7766 Use prototypes, not old-style definitions.
7767 * lib/lbitset.c (lbitset_unused_clear): Likewise.
7768 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
7769 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
7770 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
7771 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
7772 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
7773 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
7774 vbitset_or_and_cmp, vbitset_copy): Likewise.
7775
7776 * lib/libiberty.h: Do not include config.h; that's the includer's job.
7777 Do not include <stdlib.h>.
7778 (PARAMS): Define unconditionally for C89.
7779 (ATTRIBUTE_NORETURN): Remove.
7780 (ATTRIBUTE_UNUSED): Define unconditionally.
7781
7782 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 7783 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
7784 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
7785 * lib/vbitset.c, lib/vbitset.h: New files.
7786 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
7787 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
7788 from libbitset.
7789
7790 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
7791 `How Can I Reset @code{yyparse}', since texinfo does not allow
7792 arbitrary @ in node names.
7793
7794 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
7795 shouldn't be needed according to the gettext 0.12.1 documentation
7796 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 7797 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 7798 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 7799 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 7800
8dd76bee
PE
7801 * lib/.cvsignore: Add stdbool.h.
7802 * m4/.cvsignore: Add nls.m4, po.m4.
7803
7804 Upgrade to CVS gnulib.
7805 * stdbool_.h: File renamed from stdbool.h.in.
7806 * configure.ac (AM_STDBOOL_H): Invoke this instead of
7807 AC_HEADER_STDBOOL.
7808 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
7809 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
7810 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
7811 (MOSTLYCLEANFILES): New var.
7812 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
7813 (stdbool.h): New rule.
7814 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
7815 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
7816 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
7817 m4/quote.m4: Upgrade to today's gnulib.
7818
7819 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
7820 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
7821 the tests right now.
7822 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
7823 yyerror are declared before use; C99 requires this.
7824
25005f6a
PH
78252003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7826
7827 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
7828 first.
7829 (yyrecoverSyntaxError): Correct the logic for setting and testing
7830 yyerrState.
7831 Correct comment on handling EOF.
7832 Allow states with only a default reduction, rather than failing
8dd76bee 7833 (I can't quite reconstruct why these were not allowed before).
25005f6a 7834
137437c6 7835 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 7836 buffer overruns, corrupting state.
8dd76bee
PE
7837
7838 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
7839 definition.
7840 * src/reader.h (max_left_semantic_context): New variable declaration.
7841 * src/scan-gram.l (max_left_semantic_context): Define.
7842 (handle_action_dollar): Update max_left_semantic_context.
7843 * data/glr.c (YYMAXLEFT): New definition.
7844 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
7845 (yyresolveAction): Ditto.
7846
7847 Fixes to problems with location handling in GLR parsers reported by
7848 Frank Heckenbach (2003/06/05).
7849
7850 * data/glr.c (YYLTYPE): Make trivial if locations not used.
7851 (YYRHSLOC): Add parentheses, and define only if locations used.
7852 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
7853 locations not used.
7854 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
7855 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 7856
25005f6a
PH
7857 * tests/cxx-type.at: Exercise location information; update tests
7858 to differentiate output with and without locations.
8dd76bee 7859 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
7860 because default YYLTYPE not yet defined.
7861 Change semantic actions to compute strings, rather than printing
7862 them directly (to test proper passing of semantics values). Change
7863 output to prefix notation and update test data and expected results.
7864 (yylex): Track locations.
7865 (stmtMerge): Return value rather than printing, and include arguments
7866 in value.
8dd76bee 7867
711f40b7
PE
78682003-06-03 Paul Eggert <eggert@twinsun.com>
7869
7870 Avoid warnings generated by GCC 2.95.4 when Bison is
7871 configured with --enable-gcc-warnings.
7872 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
7873 yy::]b4_parser_class_name[::translate_,
7874 yy::Stack::operator[] (unsigned),
7875 yy::Stack::operator[] (unsigned) const,
7876 yy::Slice::operator[] (unsigned),
7877 yy::Slice::operator[] (unsigned) const):
7878 Rename local vars to avoid warnings.
7879 * tests/glr-regression.at (Improper handling of embedded actions
7880 and $-N in GLR parsers): Remove unused local variable from yylex.
7881 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
7882 (void) as arg when not pure, since we now assume C89 when building
7883 Bison. Pacify GCC by using parameter.
7884
ac695f7d
PE
78852003-06-02 Paul Eggert <eggert@twinsun.com>
7886
7887 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
7888 yy::Location::lines, yy::Location::columns): Rename arguments
7889 to avoid shadowing; this removes a warning generated by GCC 3.3.
7890
26ec81e0
PE
78912003-06-01 Paul Eggert <eggert@twinsun.com>
7892
7893 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
7894 to g++, as GCC 3.3 complains if you do it.
7895 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
7896 everything that WARNING_CFLAGS has, except omit warnings
7897 not suitable for C++.
7898 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
7899 * tests/atlocal.in (CXXFLAGS): New var.
7900 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
7901
7902 Fix a GLR parser bug I reported in February; see
161a71f3 7903 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
7904 The problem was that GLR parsers did not conform to the C standard,
7905 because actions like { $1 = $2 + $3; } expanded to expressions
7906 that invoked YYFILL in separate subexpressions, and YYFILL assigned
7907 to a local variable. The C standard says that expressions
7908 like (var = f ()) + (var = f ()) have undefined behavior.
7909 Another problem was that GCC sometimes issues warnings that
7910 yyfill and its parameters are unused.
7911
7912 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
7913 as possibly unused.
7914 (yyfill): New function.
7915 (YYFILL): Use it.
7916 (yyuserAction): Change type of yynormal to bool, so that it matches
7917 the new yyfill signature. Mark it as possibly unused.
7918
7919
7920 Follow up on a bug I reported in February, where a Bison-generated
7921 parser can loop. Provide a test case and a fix for yacc.c. I
7922 don't have a fix for lalr1.cc or for glr.c, unfortunately.
7923 The original bug report is in:
161a71f3 7924 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
7925
7926 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
7927 macro's size was becoming unwieldy.
7928 (yyerrlab): Do not discard an empty lookahead symbol, as this
7929 might destroy garbage.
7930 (yyerrorlab): New label, with the old contents of YYERROR,
7931 plus the following change: pop the stack of rhs corresponding
7932 to the production that invoked YYERROR. That is how Yacc
7933 behaves, and POSIX requires this behavior.
7934 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
7935 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
7936 Define 'alarm' to do nothing if unistd.h is not available.
7937 Add a new rule "exp: '-' error;" to test the above change to
7938 data/yacc.c. Use 'alarm' to abort any test taking longer than
7939 10 seconds, as it's probably looping.
7940 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
7941 Also, the new yacc.c generates two fewer diagnostics for an
7942 existing test.
7943
d0829076
PE
79442003-05-24 Paul Eggert <eggert@twinsun.com>
7945
c6ae27df
PE
7946 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
7947 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
7948 This fixes a problem reported by John Bowman when the Compaq/HP
7949 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
7950 -ansi -Wall -gall).
7951 * data/yacc.c (union yyalloc): Likewise.
7952 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 7953
d0829076
PE
7954 Switch from 'int' to 'bool' where that makes sense.
7955
7956 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
7957 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
7958 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
7959 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
7960 Return or accept bool, not int. All callers changed.
7961 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
7962 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
7963 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
7964 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
7965 bitset_or_and_cmp_): Likewise.
7966 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
7967 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
7968 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
7969 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
7970 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
7971 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
7972 bitset_stats_or_and_cmp): Likewise.
7973 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
7974 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
7975 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
7976 ebitset_xor_cmp): Likewise.
7977 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
7978 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
7979 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
7980 lbitset_xor_cmp): Likewise.
7981 * lib/bbitset.h: Include <stdbool.h>.
7982 (struct bitset_vtable): The following members now return bool, not
7983 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
7984 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
7985 or_and_cmp).
7986 * src/conflicts.c (count_rr_conflicts): Likewise.
7987 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
7988 All uses changed.
7989 * lib/ebitset.c (ebitset_obstack_init): Likewise.
7990 * lib/lbitset.c (lbitset_obstack_init): Likewise.
7991 * src/getargs.c (debug_flag, defines_flag, locations_flag,
7992 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7993 graph_flag): Likewise.
7994 * src/getargs.h (debug_flag, defines_flag, locations_flag,
7995 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7996 graph_flag): Likewise.
7997 * src/output.c (error_verbose): Likewise.
7998 * src/output.h (error_verbose): Likewise.
7999 * src/reader.c (start_flag, typed): Likewise.
8000 * src/reader.h (typed): Likewise.
8001 * src/getargs.c (LOCATIONS_OPTION): New constant.
8002 (long_options, getargs): Use it.
8003 * src/lalr.c (build_relations): Use bool, not int.
8004 * src/nullable.c (nullable_compute): Likewise.
8005 * src/print.c (print_reductions): Likewise.
8006 * src/tables.c (action_row, pack_vector): Likewise.
8007 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
8008 * src/output.c (prepare): Use it.
8009 * src/output.c (token_definitions_output,
8010 symbol_destructors_output, symbol_destructors_output): Use string,
8011 not boolean integer, to keep track of whether to output separator.
8012 * src/print_graph.c (print_core): Likewise.
8013 * src/state.c (state_rule_lookaheads_print): Likewise.
8014
8015 * config/install-sh: Sync from automake 1.7.5.
8016
6b2584b7
PE
80172003-05-14 Paul Eggert <eggert@twinsun.com>
8018
8019 * src/parse-gram.y (rules_or_grammar_declaration): Require a
8020 semicolon after a grammar declaration, in the interest of possible
8021 future changes to the Bison input language.
8022 Do not allow a stray semicolon at the start of the grammar.
8023 (rhses.1): Allow one or more semicolons after any rule, including
8024 just before "|" as required by POSIX.
8025 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
8026 grammar.
8027
caf37a36
ADL
80282003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
8029
8030 %parse-param support for lalr1.cc.
8031
8032 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
8033 b4_cc_constructor_calls, b4_cc_constructor_call,
8034 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
8035 definitions.
8036 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
8037 parse-param arguments.
8038 (yy::b4_parser_class_name): Declare instance variables to
8039 hold parse-param arguments.
8040 * tests/calc.at: s/value/semantic_value/ because value clashes
8041 with a member of yy::b4_parser_class_name. Adjust C++ code
8042 to handle %parse-param. Enable %parse-param test in C++.
8043
3ab37077
PE
80442003-05-12 Paul Eggert <eggert@twinsun.com>
8045
8046 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
8047 English a bit. Fix fclose typo. Change "const char" to "char
8048 const", and use ANSI C rather than K&R for "main". Suggest
8049 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
8050 and suggest yy_switch_to_buffer.
8051
80522003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
8053
8054 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
8055 C89. This avoids a diagnostic on compilers that define __STDC__
8056 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 8057 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 8058
e743727f
PE
80592003-05-03 Paul Eggert <eggert@twinsun.com>
8060
8061 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
8062 Do not overrun array bounds.
8063 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 8064 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 8065
916708d5
AD
80662003-04-29 Akim Demaille <akim@epita.fr>
8067
8068 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
8069 * src/getargs.c, src/getargs.h: here, as bool, not int.
8070 (nondeterministic_parser): New.
8071 * src/parse-gram.y, src/scan-gram.l: Support
8072 %nondeterministic-parser.
8073 * src/output.c (prepare): Use nondeterministic_parser instead
8074 of glr_parser where appropriate.
8075 * src/tables.c (conflict_row, action_row, save_row)
8076 (token_actions, token_actions, pack_vector): Ditto.
8077
a06ea4aa
AD
80782003-04-29 Akim Demaille <akim@epita.fr>
8079
8080 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
8081
211074ca
AD
80822003-04-29 Akim Demaille <akim@epita.fr>
8083
8084 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
8085 with %pure-parser and %locations to exercise the patch from Yakov
8086 Markovitch below.
8087
6175ffe3
PE
80882003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
8089
8090 * data/yacc.c: (b4_lex_param): Corrected for the case where
8091 %lex-param is provided and %pure-parser isn't.
8092
b1e95857
PE
80932003-04-27 Paul Eggert <eggert@twinsun.com>
8094
8095 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 8096 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
8097 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
8098 if it is not defined.
8099 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
8100
acda9df6
PE
81012003-04-26 Paul Eggert <eggert@twinsun.com>
8102
3470c57b
PE
8103 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
8104 Declare to be of type suitable for the ninf value itself, not of
8105 type suitable for the corresponding table, since the latter might
8106 be unsigned but the ninf value might be negative. This fixes a
8107 bug reported by Alexandre Duret-Lutz in
161a71f3 8108 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 8109
acda9df6
PE
8110 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
8111 invokes it. We shouldn't invoke it twice because it will attempt
8112 to put error.o in the archive twice. This fixes a glitch reported
8113 by Martin Mokrejs in
161a71f3 8114 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 8115
b5250f26
PE
81162003-04-21 Paul Eggert <eggert@twinsun.com>
8117
8118 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
8119 to gnulib.
8120
089ac0f1
PE
81212003-04-21 Yakov Markovitch <Markovitch@iso.ru>
8122
8123 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
8124 Fix obvious typo that results in uncompilable GLR parsers
8125 when both %pure-parser and %locations are used. (trivial change)
8126
5ededac6
PE
81272003-04-17 Paul Eggert <eggert@twinsun.com>
8128
1b8f2fff
PE
8129 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
8130 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
8131 Do not insert the expected token via unput, as this runs afoul
8132 of a POSIX-compatibility bug in flex 2.5.31.
8133 All uses changed to BEGIN the parent state,
8134 since we no longer insert the expected token via unput.
8135 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
8136 that is no longer emitted after the above change.
8137
5ededac6
PE
8138 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
8139 the first one. This change is from Paul Hilfinger, and it fixes
8140 regression reported by Werner Lemberg in
161a71f3 8141 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
8142
8143 (resolve_sr_conflict): Don't invoke state_errs_set
8144 unless one or more tokens have been explicitly made errors.
8145 Otherwise, the above change causes Bison to abort.
8146
8147 * tests/existing.at (GNU pic Grammar): New test case, taken from
8148 Lemberg's email.
8149
b8be9132
AD
81502003-03-31 Akim Demaille <akim@epita.fr>
8151
8152 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
8153
d423d460
AD
81542003-03-31 Akim Demaille <akim@epita.fr>
8155
8156 * src/output.c (prepare_symbols): Avoid trailing spaces in the
8157 output.
8158
c7e441b4
AD
81592003-03-31 Akim Demaille <akim@epita.fr>
8160
8161 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
8162 From Paul Hilfinger.
8163
231897ad
AD
81642003-03-29 Akim Demaille <akim@epita.fr>
8165
8166 * m4/error.m4: Do not put under dynamic conditions some code which
8167 expansion is under static control.
8168
5b066063
AD
81692003-03-29 Akim Demaille <akim@epita.fr>
8170
8171 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
8172
22a74fec
AD
81732003-03-29 Akim Demaille <akim@epita.fr>
8174
8175 * doc/bison.texinfo (Strings are Destroyed): New.
8176
0eee27e7
PE
81772003-03-13 Paul Eggert <eggert@twinsun.com>
8178
8179 * .cvsignore: Add configure.lineno.
8180 * src/.cvsignore: Add yacc.
8181 * tests/.cvsignore: Add testsuite.log.
8182 * doc/fdl.texi: Sync with latest FSF version.
8183
f61aad93
PE
81842003-03-12 Paul Eggert <eggert@twinsun.com>
8185
537636c7
PE
8186 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
8187 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
8188 cursor, instead of leaving it undefined. This fixes a bug
8189 reported by Tim Van Holder in
161a71f3 8190 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
8191 * tests/input.at (Torturing the Scanner): Test the scanner on
8192 an empty input file, which was Tim Van Holder's test case.
8193
8194 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
8195 <sys/resource.h> can be included, include sys/time.h and
8196 sys/times.h first, if available. This works around the SunOS
8197 4.1.4 porting bug reported by Bruce Becker in
161a71f3 8198 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
8199
8200 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
8201 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
8202 AC_HEADER_SYS_WAIT.
8203
f61aad93
PE
8204 Merge changes from gnulib. This was prompted because the CVS
8205 snapshot didn't build on Solaris 7 due to strnlen problems.
8206
8207 These changes need to be merged back into gnulib:
8208 * lib/hash.c: Include <stdbool.h> unconditionally.
8209 * m4/onceonly.m4 (m4_quote): New macro.
8210 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
8211 Quote AC_FOREACH variable-expansions properly.
8212 The 2003-01-03 obstack.h change also needs merging.
8213 {end of changes requiring merging}
5b066063 8214
f61aad93
PE
8215 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8216 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
8217 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
8218 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
8219 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
8220 New files, imported from gnulib.
8221 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
8222 above.
8223
8224 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
8225 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
8226 gnulib sources.
8227
8228 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
8229 Add.
8230 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
8231 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
8232 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
8233 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
8234 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
8235 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
8236 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
8237 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
8238 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
8239 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
8240 (jm_PREREQ_ARGMATCH): Remove.
8241 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
8242 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
8243
8244 * src/system.h: Include <stdbool.h> unconditionally.
8245
8246 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
8247 assuming at least C89 in the bitset code for some time now.
8248
d2ffe116
AD
82492003-03-03 Akim Demaille <akim@epita.fr>
8250
8251 * ro.po: New.
8252
052826fd
AD
82532003-03-02 Akim Demaille <akim@epita.fr>
8254
8255 * doc/bison.texinfo (Table of Symbols): Reactivate the
8256 documentation for %lex-param, and %parse-param.
8257
c4749565
AD
82582003-03-02 Akim Demaille <akim@epita.fr>
8259
8260 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
8261 generate verbose error messages.
8262 Use the number of tokens as an upper bound in yytname, as it
8263 cannot be a non terminal.
8264
d5286af1
AD
82652003-03-02 Akim Demaille <akim@epita.fr>
8266
8267 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
8268 message.
8269
22e304a6
AD
82702003-03-02 Akim Demaille <akim@epita.fr>
8271
22e304a6
AD
8272 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
8273 Use them to exercise yycheck overrun.
8274 Based on Andrew Suffield's grammar.
8275
67a25fed
AD
82762003-03-02 Akim Demaille <akim@epita.fr>
8277
8278 Create tests/local.at for Bison generic testing macros.
8279
8280 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
8281 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
8282 This new file.
8283 * tests/calc.at (AT_CHECK_CALC): Adjust.
8284 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
8285 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
8286 * tests/local.at: here.
8287 (AT_COMPILE_CXX): Tags the tests using it as c++.
8288 Ignore the test if CXX is not functional.
8289
9c2b381f
PE
82902003-03-01 Paul Eggert <eggert@twinsun.com>
8291
8292 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
8293 not loc->end, since loc->end might contain garbage and this leads
8294 to undefined behavior on some platforms.
8295 (id_loc, token_start): Use (IF_LINTed) initial values that do not
8296 depend on *loc, so that the reader doesn't give the the false
8297 impression that *loc is initialized.
8298 (<INITIAL>"%%"): Do not bother setting code_start, since its value
8299 does not survive the return.
8300
0433ba88
AD
83012003-03-01 Akim Demaille <akim@epita.fr>
8302
8303 * src/scan-gram.l (code_start): Always initialize it when entering
8304 into yylex, as SC_EPILOGUE is activated *before* the corresponding
8305 yylex invocation. An alternative would be making it static, but
8306 then it starts with the second %%'s beginning, instead of its end.
8307
b305ea69
PE
83082003-02-28 Paul Eggert <eggert@twinsun.com>
8309
8310 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
8311 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 8312 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 8313
c3d25e01
PE
83142003-02-26 Paul Eggert <eggert@twinsun.com>
8315
8316 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
8317 Remove Sequent/Pyramid discussion (nobody uses them any more).
8318 Merge VMS and MS-DOS discussion; these ports may well be dead
8319 but let's keep mentioning them for now. Put <> around email
8320 addresses. Add copyright notice.
8321
c267ffbc
PE
83222003-02-24 Paul Eggert <eggert@twinsun.com>
8323
8324 * data/glr.c (yy_reduce_print): yylineno -> yylno,
8325 to avoid collision with flex use of yylineno.
8326 Problem reported by Bruce Lilly in
161a71f3 8327 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
8328 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8329 * data/yacc.c (yy_reduce_print): Likewise.
8330
8331 * config/depcomp: Sync with Automake 1.7.3.
8332
f939fc12
AD
83332003-02-21 Akim Demaille <akim@epita.fr>
8334
8335 * data/lalr1.cc: Use temporary variables instead of casts to
8336 change integer types.
8337 Suggested by Paul Eggert.
8338
95923bd6
AD
83392003-02-21 Akim Demaille <akim@epita.fr>
8340
8341 * doc/bison.texinfo: Use "location" consistently to refer to @n,
8342 to avoid confusions with lalr1.cc's notion of Position.
8343 Suggested by Paul Eggert.
8344
2cdc240e
AD
83452003-02-20 Akim Demaille <akim@epita.fr>
8346
8347 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
8348 before initial_columns.
8349 (location.hh): Use consistent variable names when defining the
8350 operator<<.
8351 Use "last" so that we subtract from Positions, not from unsigned.
8352
5d003116
AD
83532003-02-20 Akim Demaille <akim@epita.fr>
8354
8355 * data/lalr1.cc (position.hh): New subfile, including the extended
8356 and Doxygen'ed documentation of class Position.
8357 (location.hh): Use it.
8358 Document a` la Doxygen.
ba1ecc07 8359 With the help of Benoit Perrot.
5d003116 8360
d02b25f9
AD
83612003-02-20 Akim Demaille <akim@epita.fr>
8362
8363 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
8364 AT_YACC_IF.
8365 Redefine AT_YYERROR_SEES_LOC_IF using it.
8366 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
8367 not defined.
8368 Don't use the location in yy::Parser::error_ and
8369 yy::Parser::print_ when not %locations.
8370 Activate more lalr1.cc tests.
8371
0d1c3a04
AD
83722003-02-19 Akim Demaille <akim@epita.fr>
8373
8374 * data/lalr1.cc: When displaying a line number, be sure to make it
8375 an int.
8376
60a777aa
AD
83772003-02-19 Akim Demaille <akim@epita.fr>
8378
8379 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
8380 Remove, useless.
8381 (YYABORT, YYACCEPT, YYERROR): New.
8382 * tests/calc.at: Renable the lalr1.cc test.
8383
0b86fc41
AD
83842003-02-19 Akim Demaille <akim@epita.fr>
8385
8386 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
8387 error recovery, mixing with/without pops and discarding of the
8388 lookahead.
8389 Exercise YYERROR.
8390 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
8391
da99a5dc
PE
83922003-02-17 Paul Eggert <eggert@twinsun.com>
8393
8394 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
8395 * tests/testsuite.at (AT_COMPILE): Use them.
8396 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 8397 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 8398
93b8c255
PE
83992003-02-12 Paul Eggert <eggert@twinsun.com>
8400
8401 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
8402 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 8403 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
8404 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
8405 Check for malloc failure, for consistency with yacc.c.
8406 (yytname_size): Remove, for consistency with yacc.c.
8407
8408 The bug still remains in data/lalr1.cc, as I didn't have time
8409 to fix it there.
8410
7548fed2
AD
84112003-02-06 Akim Demaille <akim@epita.fr>
8412
8413 * configure.ac (GXX): Rename as...
8414 (CXX): this, to keep the original Autoconf semantics.
8415 Require 2.57.
8416 * data/lalr1.cc: Fix b4_copyright invocations.
8417 If YYDEBUG is not defined, don't depend upon name_ being defined.
8418 (location.hh): Include string and iostream.
8419 (Position::filename): New member.
8420 (Position::Position ()): New.
8421 (operator<< (Position)): New.
8422 (operator- (Position, int)): New.
8423 (Location::first, Location::last): Rename as...
8424 (Location::begin, Location::end): these, to mock the conventional
8425 iterator names.
8426 (operator<< (Location)): New.
8427 * tests/atlocal.in (CXX): New.
8428 * tests/testsuite.at (AT_COMPILE_CXX): New.
8429 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
8430 locations in a more synthetic way.
8431 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
8432 lalr1.cc is used.
8433 Adjust the C locations to match those from Emacs: first column is
8434 column 0.
8435 Change all the expected results.
8436 Conform to the GCS: simplify the locations when applicable.
8437 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
8438 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
8439 these CPP macros with the m4 macros new defined by...
8440 (AT_CHECK_PUSHDEFS): this, i.e.:
8441 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 8442 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
8443 New macros.
8444 (AT_CHECK_POPDEFS): Undefine them.
8445 (AT_CHECK_CALC_LALR1_CC): New.
8446 Use it for the first lalr1.cc test.
8447
43a176ef
AD
84482003-02-04 Akim Demaille <akim@epita.fr>
8449
8450 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
8451 Location as is defined.
8452
fc049e9c
AD
84532003-02-04 Akim Demaille <akim@epita.fr>
8454
8455 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
8456 name_ being defined.
8457
a737b216
PE
84582003-02-03 Paul Eggert <eggert@twinsun.com>
8459
8460 * src/gram.h (start_symbol): Remove unused decl.
8461
8462 Use more-consistent naming conventions for local vars.
8463
8464 * src/derives.c (derives_compute): Change type of local var from
8465 int to rule_number.
8466 * src/gram.c (grammar_rules_partial_print): Likewise.
8467 * src/print.c (print_core): Likewise.
8468 * src/reduce.c (reduce_grammar_tables): Likewise.
8469
8470 * src/gram.c (grammar_dump): Change name of item_number *
8471 local var from r to rp.
8472 * src/nullable.c (nullable_compute): Likewise.
8473
8474 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
8475
8476 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
8477 for symbol or symbol_number var.
8478 * src/reader.c (grammar_start_symbol_set): Likewise.
8479 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
8480 Likewise.
8481 * src/state.c (transitions_to): Likewise.
8482 * src/state.h: Likewise.
8483 * src/tables.c (symbol_number_to_vector_number): Likewise.
8484
8485 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
8486 char * var.
8487
8488 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
8489 var.
8490
8491 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
8492 var.
8493
8494 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
8495 Use str, not s, for char * var. Use ch, not c, for character var.
8496 Use size for size var.
8497
8498 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
8499 char * var.
8500 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
8501 uniqstr var.
8502 * src/uniqstr.h: Likewise.
8503
8504 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8505 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8506 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
8507 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
8508 param to have same name as that of enum, so that we don't use
8509 "s" to stand for a non-state.
8510
68e93ad5
AD
85112003-02-02 Akim Demaille <akim@epita.fr>
8512
8513 * src/scan-skel.l: Scan more than one inert character per yylex
8514 invocation.
8515
92898986
PE
85162003-02-01 Paul Eggert <eggert@twinsun.com>
8517
8518 Version 1.875a.
8519
1d9d5d71
PE
8520 * po/LINGUAS: Add ms.
8521
0435d061
AD
85222003-01-30 Akim Demaille <akim@epita.fr>
8523
8524 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
8525
6029a57f
PH
85262003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8527
8528 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
8529 of $1.
0435d061
AD
8530
8531 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 8532 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 8533 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 8534
6029a57f
PH
8535 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
8536 (b4_rhs_location): Ditto.
0435d061 8537 (yyfill): New function to copy from stack tree into array
6029a57f 8538 incrementally.
0435d061
AD
8539 (yyuserAction): Modify to allow incremental move of semantic values
8540 to rhs array when in GLR mode.
8541 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
8542 as needed.
8543 Remove dummy use of yystack, as there is now a guaranteed use.
8544 (yydoAction): Modify to allow incremental move of semantic values
8545 to rhs array when in GLR mode.
8546 (yyresolveAction): Ditto.
8547 (yyglrShiftDefer): Update comment.
0435d061 8548 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
8549 (yyglrReduce): Ditto.
8550 (yydoAction): Ditto
0435d061 8551
6029a57f
PH
8552 * tests/glr-regr1.at: Rename to ...
8553 * tests/glr-regression.at: Add new regression test for the problems
8554 described above (adapted from S. Eken).
8555 Update copyright notice.
8556 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
8557 * tests/Makefile.am: Ditto.
8558
6cee6297
PE
85592003-01-28 Paul Eggert <eggert@twinsun.com>
8560
8561 * data/lalr1.cc: Do not use @output_header_name@ unless
8562 b4_defines_flag is set. This fixes two bugs reported by
8563 Tim Van Holder in
161a71f3
PE
8564 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
8565 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 8566
b2a836b5
PE
85672003-01-21 Paul Eggert <eggert@twinsun.com>
8568
8569 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
8570 we don't need to worry about yyerrlab1 being reported as an
8571 "unused label" by non-GCC C compilers. The downside is that if
8572 locations are used then a couple of statements are duplicated each
8573 time YYERROR is invoked, but the upside is that the warnings
8574 should vanish.
8575 (yyerrlab1): Move code to YERROR.
8576 (yyerrlab2): Remove. Change uses back to yyerrlab1.
8577 This reverts some of the 2002-12-27 change.
8578
4196b931
PE
85792003-01-17 Paul Eggert <eggert@twinsun.com>
8580
8581 * src/output.c (symbol_printers_output): Fix typo that led
8582 to core dump. Problem reported by Antonio Rus in
161a71f3 8583 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 8584
3ae831b4
AD
85852003-01-13 Akim Demaille <akim@epita.fr>,
8586 Quoc Peyrot <chojin@lrde.epita.fr>,
8587 Robert Anisko <anisko_r@lrde.epita.fr>
8588
8589 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
8590 when the stacks contain one element, as the loop would otherwise
8591 free the last state, and then use the top state (the one we just
8592 popped). This means that the initial elements will not be freed
8593 explicitly, as is the case in yacc.c; it is not a problem, as
8594 these elements have fake values.
8595
e3aa65c5
PE
85962003-01-11 Paul Eggert <eggert@twinsun.com>
8597
8598 * NEWS: %expect-violations are now just warnings, reverting
8599 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
8600 bootstrapping problem reported by Matthias Klose; see
161a71f3 8601 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
8602 * src/conflicts.c (conflicts_print): Likewise.
8603 * tests/conflicts.at (%expect not enough, %expect too much,
8604 %expect with reduce conflicts): Likewise.
8605 * doc/bison.texinfo (Expect Decl): Document this. Also mention
8606 that the warning is enabled if the number of conflicts changes
8607 (not necessarily increases).
8608
8609 * src/getargs.c (version): Update copyright year.
8610
f0057011
AD
86112003-01-09 Akim Demaille <akim@epita.fr>
8612
8613 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
8614
1ee6d2a0
PE
86152003-01-08 Paul Eggert <eggert@twinsun.com>
8616
8617 * Makefile.maint (WGETFLAGS):
8618 New macro, containing "-C off" to disable proxy caches.
8619 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
8620 (rel-check): Use $(WGET) instead of wget.
8621
d4fd77c4
PE
86222003-01-06 Paul Eggert <eggert@twinsun.com>
8623
8624 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
8625 the GLR paper of Scott, Johnstone and Hussain.
8626
464c6927
PE
86272003-01-04 Paul Eggert <eggert@twinsun.com>
8628
d600ee67
PE
8629 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
8630 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
8631 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
8632 (EXTRA_LIBRARIES): New var, for liby.a.
8633 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
8634 (EXTRA_SCRIPTS): New var, for yacc.
8635
464c6927
PE
8636 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
8637 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
8638 Problem reported by Nelson H. F. Beebe.
8639
86402003-01-03 Paul Eggert <eggert@twinsun.com>
8641
8642 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
8643 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8644 when compiling Bison 1.875's `bitset bset = obstack_alloc
8645 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8646
8647 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
8648 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
8649 grow to a huge size with typical invocation.
d600ee67 8650
464c6927
PE
8651 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
8652 Use the pattern recommended by Autoconf 2.57, except also protect
8653 against double-definition.
8654 * src/system.h: Likewise.
8655 Portability issues reported by Nelson H. F. Beebe.
d600ee67 8656
464c6927
PE
8657 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
8658 All uses changed. Provide a definition in both C and C++.
8659 (yytrue, yyfalse): Define even if defined (__cplusplus).
8660
8661 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
8662 Reported by Nelson H. F. Beebe.
d600ee67 8663
464c6927
PE
8664 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
8665
0f42c7d5
PE
86662003-01-02 Paul Eggert <eggert@twinsun.com>
8667
8668 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
8669 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
8670 Bug reported by Nelson H. F. Beebe.
8671
dc546b0f
PE
86722003-01-01 Paul Eggert <eggert@twinsun.com>
8673
8674 * Version 1.875.
8675
2c09b6a7
PE
86762002-12-30 Paul Eggert <eggert@twinsun.com>
8677
8678 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
8679 Moved here from...
8680 (<INITIAL>","): Here. This causes stray "," to be treated
8681 more uniformly.
8682
dc546b0f 8683 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
8684 last brace in braced code when not in Yacc mode, for compatibility
8685 with Bison 1.35. This resurrects the 2001-12-15 patch to
8686 src/reader.c.
8687
8688 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
8689 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
8690
535c0f63
PE
86912002-12-28 Paul Eggert <eggert@twinsun.com>
8692
8693 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
8694 that of SYM's type. This fixes Debian bug 168069, reported by
8695 Thomas Olsson.
d600ee67 8696
963fcc17
PE
86972002-12-28 Paul Eggert <eggert@twinsun.com>
8698
8699 Version 1.75f.
8700
8701 Switch back to the Yacc style of conflict reports, undoing some
8702 of the 2002-07-30 change.
8703 * doc/bison.texinfo (Understanding): Use Yacc style for
8704 conflict reports. Also, use new way of locating rules.
8705 * src/conflicts.c (conflict_report):
8706 Renamed from conflict_report_yacc, removing the old
8707 'conflict_report'. Translate the entire conflict report at once,
8708 so that we don't assume that "," has the same interpretation in
8709 all languages.
8710 (conflicts_output): Use Yacc-style conflict report for each state,
8711 instead of our more-complicated style.
8712 (conflicts_print): Use Yacc-style conflict report, except print
8713 the input file name when not emulating Yacc.
8714 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
8715 Conflicted Reduction, %expect not enough, %expect too much,
8716 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
8717 * tests/existing.at (GNU Cim Grammar): Likewise.
8718 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
8719
8720 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
8721 fatal): Don't invoke fflush; it's not needed and it might even be
8722 harmful for stdout, as stdout might not be open.
8723 * src/reduce.c (reduce_print): Likewise.
8724
b1efe548
PE
87252002-12-27 Paul Eggert <eggert@twinsun.com>
8726
8727 Fix a bug where error locations were not being recorded correctly.
8728 This problem was originally reported by Paul Hilfinger in
161a71f3 8729 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
8730
8731 * data/yacc.c (yyparse): New local var yylerrsp, to record the
8732 top of the location stack's error locations.
8733 (yyerrlab): Set it. When discarding a token, push its location
8734 onto yylerrsp so that we don't lose track of the error's end.
8735 (yyerrlab1): Now is only the target of YYERROR, so that we can
8736 properly record the location of the action that failed. For GCC
8737 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
8738 GCC warning about yyerrlab1 being unused if YYERROR is unused.
8739 (yyerrlab2): New label, which yyerrlab now falls through to.
8740 Compute the error's location by applying YYLLOC_DEFAULT to
8741 the locations of all the symbols that went into the error.
8742 * doc/bison.texinfo (Location Default Action): Mention that
8743 YYLLOC_DEFAULT is also invoked for syntax errors.
8744 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8745 Error locations include the locations of all the tokens that were
8746 discarded, not just the last token.
d600ee67 8747
983c5c2c
PE
87482002-12-26 Paul Eggert <eggert@twinsun.com>
8749
b1efe548
PE
8750 * src/files.c: Include quote.h.
8751 (compute_output_file_names): Warn if we detect conflicting
8752 outputs to the same file. This should catch the misunderstanding
8753 exemplified by Debian Bug 165349, reported by Bruce Stephens..
8754
8755 * src/conflicts.c (conflicts_print): If the user specifies
8756 "%expect N", report an error if there are any reduce/reduce
8757 conflicts. This is what the manual says should happen.
8758 This fixes Debian bug 130890, reported by Anthony DeRobertis.
8759 * tests/conflicts.at (%expect with reduce conflicts): New test.
8760
983c5c2c
PE
8761 Don't use m4_include on relative file names, as it doesn't work as
8762 desired if there happens to be a file with that name under ".".
d600ee67 8763
983c5c2c
PE
8764 * m4sugar/version.m4: Remove; it was included but it wasn't used.
8765 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
8766 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
8767 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
8768 * src/output.c (output_skeleton): Use full path names when
8769 specifying a file to include; don't rely on include path, as
8770 it's unreliable when the working file contains a file with
8771 that name.
d600ee67 8772
983c5c2c
PE
87732002-12-25 Paul Eggert <eggert@twinsun.com>
8774
8775 Remove obsolete references to bison.simple and bison.hairy.
8776 Problem mentioned by Aubin Mahe in
161a71f3 8777 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
8778 * data/glr.c: Comment fix.
8779 * doc/bison.1: Remove references. Also, mention "yacc".
8780
8781 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
8782 with -g option.
8783
8784 * src/parse-gram.y (declaration): Use enum "report_states" rather
8785 than its numeric value 1.
8786
8787 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
8788 opening a new one. This fixes Debian bug 165349, reported by
8789 Bruce Stephens.
8790
23f2d9dc
PE
87912002-12-24 Paul Eggert <eggert@twinsun.com>
8792
8793 Version 1.75e.
8794
8795 * Makefile.maint (cvs-update): Don't assume that the shell
8796 supports $(...), as Solaris sh doesn't.
8797
8798 * src/parse-gram.y (lloc_default): Remove test for empty
8799 nonterminals at the end, since it didn't change the result.
8800
88012002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
8802
8803 If the user does not define YYSTYPE as a macro, Bison now declares it
8804 using typedef instead of defining it as a macro. POSIX requires this.
8805 For consistency, YYLTYPE is also declared instead of defined.
8806
8807 %union directives can now have a tag before the `{', e.g., the
8808 directive `%union foo {...}' now generates the C code
8809 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
8810 The default union tag is `YYSTYPE', for compatibility with Solaris 9
8811 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
8812 instead of `yyltype'.
8813
8814 `yystype' and `yyltype' are now obsolescent macros instead of being
8815 typedefs or tags; they are no longer documented and will be
8816 withdrawn in a future release.
8817
8818 * data/glr.c (b4_location_type): Remove.
8819 (YYSTYPE): Renamed from yystype.
8820 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
8821 (struct YYLTYPE): Renamed from struct yyltype.
8822 (YYLTYPE): Renamed from yyltype.
8823 (yyltype, yystype): New (and obsolescent) macros,
8824 for backward compatibility.
8825 * data/yacc.c: Likewise.
8826
8827 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
8828 does not specify a union tag. This is for compatibility with
8829 Solaris 9 yacc.
8830
8831 * src/parse-gram.y (add_param): 2nd arg is now char * not char
8832 const *, since it is now modified by stripping surrounding { }.
8833 (current_braced_code): Remove.
8834 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
8835 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
8836 trailing " {...}". Now of type <chars>.
8837 (grammar_declaration): Adjust to bundled tokens.
8838 (code_content): Remove; stripping is now done by add_param.
8839 (print_token_value): Print contents of bundled tokens.
8840 (token_name): New function.
8841
8842 * src/reader.h (braced_code, current_braced_code): Remove.
8843 (token_name): New decl.
8844
8845 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
8846 token_type, not braced_code code_kind. All uses changed.
8847 (SC_PRE_CODE): New state, for scanning after a keyword that
8848 has (or usually has) an immediately-following braced code.
8849 (token_type): New local var, to keep track of which token type
8850 to return when scanning braced code.
8851 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 8852 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
8853 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
8854 instead of returning a token type immediately.
8855 (<INITIAL>"{"): Set token type.
8856 (<SC_BRACED_CODE>"}"): Use it.
8857 (handle_action_dollar, handle_action_at): Now returns bool
8858 indicating success. Fail if ! current_rule; this prevents a core dump.
8859 (handle_symbol_code_dollar, handle_symbol_code_at):
8860 Remove; merge body into caller.
8861 (handle_dollar, handle_at): Complain in invalid contexts.
8862
8863 * NEWS, doc/bison.texinfo: Document the above.
8864 * NEWS: Fix years and program names in copyright notice.
8865
879ca4f8
PE
88662002-12-17 Paul Eggert <eggert@twinsun.com>
8867
8868 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
8869 Reporting, Table of Symbols): Omit mentions of %lex-param and
8870 %parse-param from the documentation for now.
8871
1c5fe69d
PE
88722002-12-15 Paul Eggert <eggert@twinsun.com>
8873
8874 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
8875 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
8876 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
8877 disagreed with the Bison documentation. Bug
8878 reported by Andrew Walrond.
d600ee67 8879
1c5fe69d
PE
8880 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
8881 as the caller now does that.
8882 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
8883 (YYEMPTY): Parenthesize right hand side, since others use it.
8884 (yyparse): Don't assume that our generated code is the only code
8885 that sets yychar.
8886
d1de5372
PE
88872002-12-13 Paul Eggert <eggert@twinsun.com>
8888
8889 Version 1.75d.
8890
8891 POSIX requires a "yacc" command.
8892 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
8893 (MOSTLYCLEANFILES): Add yacc.
8894 (yacc): New rule.
1c5fe69d 8895 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
8896 as an alias for bison y.
8897
8898 * po/LINGUAS: Add da.
d600ee67 8899
d1de5372
PE
8900 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
8901 problem with latest <getopt.h>.
8902 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
8903
8904 * doc/fdl.texi: Upgrade to 1.2.
8905 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
8906 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
8907 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
8908 gnulib.
8909 * config/install-sh: Sync with autotools.
8910
8911 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 8912 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
8913 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
8914 locations are requested.
8915 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
8916 locations are requested.
8917
d0f3fe23
PE
89182002-12-12 Paul Eggert <eggert@twinsun.com>
8919
8920 Remove unportable casts and storage allocation tricks.
8921 While we're at it, remove almost all casts, since they
8922 usually aren't needed and are a sign of trouble.
8923
8924 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
8925
8926 * src/derives.c (derives_compute): Do not subtract NTOKENS from
8927 the pointer DSET returned by malloc; this isn't portable.
8928 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
8929 Similarly for DERIVES.
8930 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
8931 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
8932 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
8933
8934 * src/derives.c (derives_compute): Do not bother invoking
8935 int_of_rule_number, since rule numbers are integers.
8936
8937 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
8938 rather than XMALLOC (char, N).
8939
8940 * src/files.c (filename_split): Rewrite to avoid cast.
8941
8942 * src/gram.h (symbol_number_as_item_number,
8943 item_number_as_symbol_number, rule_number_as_item_number,
8944 item_number_as_rule_number):
8945 Now inline functions rather than macros, to avoid casts.
8946 * src/state.h (state_number_as_int): Likewise.
8947 * src/tables.c (state_number_to_vector_number,
8948 symbol_number_to_vector_number): Likewise.
8949
8950 * src/gram.h (int_of_rule_number): Remove; no longer used.
8951
8952 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
8953 since the resulting storage is always stored into.
8954
8955 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
8956 where it's needed.
8957
8958 * src/muscle_tab.c (muscle_m4_output):
8959 Now inline. Return bool, not int.
8960 * src/state.c (state_compare): Likewise.
8961 * src/symtab.c (symbol_check_defined,
8962 symbol_check_alias_consistency, symbol_pack, symbol_translation,
8963 hash_compare_symbol, hash_symbol):
8964 Likewise.
8965 * src/uniqstr.c (uniqstr_print): Likewise.
8966 * src/muscle_tab.c (muscle_m4_output_processor):
8967 New function, to avoid casts.
8968 * src/state.c (state_comparator, stage_hasher): Likewise.
8969 * src/symtab.c (symbol_check_defined_processor,
8970 symbol_check_alias_consistency_processor, symbol_pack_processor,
8971 symbol_translation_processor, hash_symbol_comparator,
8972 hash_symbol_hasher): Likewise.
8973 * src/uniqstr.c (uniqstr_print_processor): Likewise.
8974 * src/muscle_tab.c (muscles_m4_output):
8975 Use new functions instead of casting old functions unportably.
8976 * src/state.c (state_hash_new): Likewise.
8977 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
8978 symbols_token_translations_init):
8979 Likewise.
8980 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
8981
8982 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
8983 var instead of casting to long, to avoid casts.
8984 (prepare_states): Use MALLOC rather than alloca, so that we don't
8985 have to worry about alloca.
8986 * src/state.c (state_hash_lookup): Likewise.
8987
8988 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
8989 local var instead of casting to unsigned char, to avoid casts.
8990
8991 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
8992 STATE_ALLOC): Remove.
8993 (transitions_new, errs_new, reductions_new, state_new): Use malloc
8994 rather than calloc, and use offsetof to avoid allocating slightly
8995 too much storage.
8996 (state_new): Initialize all members.
8997
8998 * src/state.c (state_hash): Use unsigned accumulator, not signed.
8999
9000 * src/symtab.c (symbol_free): Remove; unused.
9001 (symbol_get): Remove cast in lhs of assignment.
9002 (symbols_do): Now static. Accept generic arguments, not
9003 hashing-related ones.
9004
9005 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
9006 (symbol_processor): Remove.
9007 (symbols_do): Remove decl; now static.
9008
9009 * src/system.h (alloca): Remove; decl no longer needed.
9010 (<stddef.h>): Include, for offsetof.
9011 (<inttypes.>, <stdint.h>): Include if available.
9012 (uintptr_t): New type, if system lacks it.
9013 (CALLOC, MALLOC, REALLOC): New macros.
9014 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
9015 new macros.
9016
9017 * src/tables.c (table_size): Now int, to pacify GCC.
9018 (table_grow, table_ninf_remap): Use signed table size.
9019 (save_row): Don't bother initializing locals when not needed.
9020 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
9021 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
9022
9023 * src/vcg.h: Correct misspellings.
9024
9025 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
9026
9027
9028 * src/getargs.c (getargs): Don't assume EOF == -1.
9029
26b4a969
PE
90302002-12-09 Paul Eggert <eggert@twinsun.com>
9031
9032 Change identifier spellings to avoid collisions with names
9033 that are reserved by POSIX.
9034
9035 Don't use names ending in _t, since POSIX reserves them.
9036 For consistency, remove _e and _s endings -- they're weren't
9037 needed to remove ambiguity. All uses changed.
9038 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
9039 turn was just renamed from struniq_t.
9040 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
9041 which in turn was just renamed from struniq_processor_t.
9042 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
9043 in turn was renamed from hash_compare_struniq_t.
9044 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
9045 (state_list): Renamed from state_list_t.
9046 * src/assoc.h (assoc): Renamed from assoc_t.
9047 * src/conflicts.c (enum conflict_resolution): Renamed from
9048 enum conflict_resolution_e.
9049 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
9050 (rule_list): Renamed from rule_list_t.
9051 * src/getargs.h (enum trace): Renamed from enum trace_e.
9052 (enum report): Renamed from enum report_e.
9053 * src/gram.h (item_number): Renamed from item_number_t.
9054 (rule_number): Renamed from rule_number_t.
9055 (struct rule_s): Remove the "rule_s" part; not used.
9056 (rule): Renamed from rule_t.
9057 (rule_filter): Renamed from rule_filter_t.
9058 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
9059 (goto_list): Renamed from goto_list_t.
9060 * src/lalr.h (goto_number): Renamed from goto_number_t.
9061 * src/location.h (location): Renamed from location_t.
9062 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
9063 and moved here from:
9064 * src/muscle_tab.h (muscle_entry_t): here.
9065 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
9066 (rule_list): Renamed from rule_list_t.
9067 * src/print_graph.c (static_graph): Renamed from graph.
9068 * src/reader.h (braced_code): Renamed from braced_code_t.
9069 Remove brace_code_e tag.
9070 * src/relation.h (relation_node): Renamed from relation_node_t.
9071 (relation_nodes): Renamed from relation_nodes_t.
9072 (relation): Renamed from relation_t.
9073 * src/state.h (state_number): Renamed from state_number_t.
9074 (struct state): Renamed from struct state_s.
9075 (state): Renamed from state_t.
9076 (transitions): Renamed from transitions_t. Unused (and
9077 misspelled) transtion_s tag removed.
9078 (errs): Renamed from errs_t. Unused errs_s tag removed.
9079 (reductions): Renamed from reductions_t. Unused tag
9080 reductions_s removed.
9081 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
9082 (struct symbol_list): Renamed from struct symbol_list_s.
9083 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
9084 (struct symbol): Renamed from struct symbol_s.
9085 (symbol): Renamed from symbol_t.
9086 * src/tables.c (vector_number): Renamed from vector_number_t.
9087 (action_number): Renamed from action_t.
9088 * src/tables.h (base_number): Renamed from base_t.
9089 * src/vcg.h (enum color): Renamed from enum color_e.
9090 (enum textmode): Renamed from enum textmode_e.
9091 (enum shape): Renamed from enum shape_e.
9092 (struct colorentry): Renamed from struct colorentry_s.
9093 (struct classname): Renamed from struct classname_s.
9094 (struct infoname): Renamed from struct infoname_s.
9095 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
9096 (enum decision): Renamed from enum decision_e.
9097 (enum orientation): Renamed from enum orientation_e.
9098 (enum alignment): Renamed from enum alignment_e.
9099 (enum arrow_mode): Renamed from enum arrow_mode_e.
9100 (enum crossing_type): Renamed from enum crossing_type_e.
9101 (enum view): Renamed from enum view_e.
9102 (struct node): Renamed from struct node_s.
9103 (node): Renamed from node_t.
9104 (enum linestyle): Renamed from enum linestyle_e.
9105 (enum arrowstyle): Renamed from enum arrowstyle_e.
9106 (struct edge): Renamed from struct edge.
9107 (edge): Renamed from edge_t.
9108 (struct graph): Renamed from struct graph_s.
9109 (graph): Renamed from graph_t.
9110 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
9111 Rename value_t -> value.
9112 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
9113 value_t_as_yystype -> value_as_yystype.
9114
9115 Don't include <errno.h> in the mainstream code, since it
9116 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
9117 * lib/get-errno.c, lib/get-errno.h: New files.
9118 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
9119 get-errno.c.
9120 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
9121 * src/output.c (output_skeleton): Likewise.
9122 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
9123 instead of errno.
9124 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
9125 Likewise.
9126 (handle_action_dollar, handle_action_at): Likewise.
9127 * src/system.h: Do not include <errno.h>.
9128 (TAB_EXT): Renamed from EXT_TAB.
9129 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
9130
9131 Avoid str[a-z]*, since <string.h> reserves that name space.
9132 Change all instances of "struniq" in names to "uniqstr", and
9133 likewise for "STRUNIQ" and "UNIQSTR".
9134 * src/uniqstr.c: Renamed from src/struniq.c.
9135 * src/uniqstr.h: Renamed from src/struniq.h.
9136 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
9137 * src/files.c (strsuffix): Remove; unused.
9138 (concat2): Renamed from stringappend. Now static.
9139 * src/files.h (strsuffix, stringappend): Remove; unused.
9140 * src/parse-gram.y (<chars>): Renamed from <string>.
9141 (<uniqstr>): Renamed from <struniq>.
9142 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
9143 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
9144 (struct graph_s.expand): Renamed from struct graph_s.stretch.
9145 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
9146 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
9147 (N_EXPAND): Renamed from N_STRETCH.
9148
9149 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
9150 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
9151 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
9152 Remove; unused.
9153 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
9154 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
9155 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
9156 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
9157 (BASE_MAXIMUM): Renamed from BASE_MAX.
9158 (BASE_MINIMUM): Renamed from BASE_MIN.
9159 (ACTION_MAX): Remove; unused.
9160 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
9161 Unnecessary casts removed from above defines.
9162
9163
9164 Fix misspelling in names.
9165 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
9166 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
9167 G_NODE_ALIGNEMENT.
9168
9169
9170 * lib/timevar.c (timevar_report): Renamed from time_report,
9171 for consistency with other names.
9172 * lib/timevar.h (timevar_report): New decl.
9173 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
9174
9175
9176 Sort include-file uses.
9177
9178 Reorder all include files under src to be in the order "system.h".
9179 then the ../lib include files in angle brackets (alphabetized),
9180 then the . include files in double-quotes (alphabetized). Fix
9181 dependency breakages encountered in this process, as follows:
9182 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
9183 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
9184 * src/state.h: Include "symtab.h".
9185
996b1c7e
PE
91862002-12-08 Paul Eggert <eggert@twinsun.com>
9187
9188 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
9189 since this causes problems when __file__ contains character
9190 sequences like "@" that are treated specially by src/scan-skel.l.
9191 Instead, just use the file's basename. This fixes the bug
9192 reported by Martin Mokrejs in
161a71f3 9193 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 9194
e19c4e5d
PE
91952002-12-06 Paul Eggert <eggert@twinsun.com>
9196
9197 Add support for rules that do not have trailing semicolons, as
9198 POSIX requires. Improve the quality of locations in Bison
9199 diagnostics.
26b4a969 9200
e19c4e5d
PE
9201 * src/location.c: Include <quotearg.h>.
9202 (empty_location): Now const.
9203 (location_print): New function. Follow the recommendation of the
9204 GNU Coding Standards for locations that span file boundaries.
9205 * src/location.h: Do not include <quotearg.h>; no longer needed.
9206 (boundary): New type.
9207 (location_t): Use it. This allows locations to span file boundaries.
9208 All member uses changed: file -> start.file or end.file (as needed),
9209 first_line -> start.line, first_column -> start.column,
9210 last_line -> end.line, last_column -> end.column.
9211 (equal_boundaries): New function.
9212 (LOCATION_RESET, LOCATION_STEP): Remove.
9213 (LOCATION_PRINT): Remove. All callers changed to use location_print.
9214 (empty_location): Now const.
9215 (location_print): New decl.
9216 * src/parse-gram.y (lloc_default): New function, which handles
9217 empty locations more accurately.
9218 (YYLLOC_DEFAULT): Use it.
9219 (%token COLON): Remove.
9220 (%token ID_COLON): New token.
26b4a969 9221 (rules): Use it.
e19c4e5d
PE
9222 (declarations, rules): Remove trailing semicolon.
9223 (declaration, rules_or_grammar_declaration):
9224 Allow empty (";") declaration.
9225 (symbol_def): Remove empty actions; no longer needed.
9226 (rules_or_grammar_declaration): Remove trailing semicolon.
9227 (semi_colon.opt): Remove.
9228 * src/reader.h: Include location.h.
9229 (scanner_cursor): New decl.
9230 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
9231 rolling our own.
9232 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
9233 of *loc.
9234 (STEP): Remove. No longer needed, now that adjust_location does
9235 the work. All uses removed.
9236 (scanner_cursor): New var.
9237 (adjust_location): Renamed from extend_location. It now sets
9238 *loc and adjusts the scanner cursor. All uses changed.
9239 Don't bother testing for CR.
9240 (handle_syncline): Remove location arg; now updates scanner cursor.
9241 All callers changed.
9242 (unexpected_end_of_file): Now accepts start boundary of token or
9243 comment, not location. All callers changed. Update scanner cursor,
9244 not the location.
9245 (SC_AFTER_IDENTIFIER): New state.
9246 (context_state): Renamed from c_context. All uses changed.
9247 (id_loc, code_start, token_start): New local vars.
9248 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
9249 processing of Yacc white space and equivalents here.
9250 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
9251 instead of returning ID immediately, since we need to search for
9252 a subsequent colon.
9253 (<INITIAL>"'", "\""): Save token_start.
9254 (<INITIAL>"%{", "{", "%%"): Save code_start.
9255 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
9256 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
9257 BEGIN context_state at end, not INITIAL.
9258 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
9259 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
9260 Return correct token start.
9261 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
9262 the start of a character, string or multiline comment is found.
9263 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
9264 Reduction): Adjust reported locations to match the more-precise
9265 results now expected.
9266 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
9267 * tests/reduce.at (Useless Rules, Reduced Automaton,
9268 Underivable Rules): Likewise.
9269 * tests/regression.at (Invalid inputs): No longer `expecting ";"
9270 or "|"' now that so many other tokens are allowed by the new grammar.
9271
9272 * src/complain.h (current_file): Remove duplicate decl;
9273 current_file is now owned by files.h.
9274 * src/complain.c, src/scan-gram.l: Include files.h.
9275
92762002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 9277
e19c4e5d
PE
9278 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
9279 promotes to int; it might be unsigned int.
9280 * data/yacc.c (yy_reduce_print): Likewise.
9281
9282 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
9283 be #defined in the prologue, not in the Bison declarations.
9284 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 9285
b64755e3
PE
92862002-12-02 Paul Eggert <eggert@twinsun.com>
9287
9288 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
9289 * lib/strtoul.c: New file, from gnulib.
9290 This fixes a porting bug reported by Peter Klein in
161a71f3 9291 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 9292
6e746484
PE
92932002-11-30 Paul Eggert <eggert@twinsun.com>
9294
b64755e3
PE
9295 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
9296 and put only a forward declaration in the prologue. This is for
9297 consistency with the other scanner helper functions.
9298
6ba55592
PE
9299 Type clashes now generate warnings, not errors, since it
9300 appears that POSIX may allow some grammars with type clashes.
9301 * src/reader.c (grammar_current_rule_check): Warn about
9302 type clashes instead of complaining.
9303 * tests/input.at (Type Clashes): Expect warnings, not complaints.
9304
6e746484
PE
9305 Add Yacc library, since POSIX requires it.
9306 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
9307 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
9308 * lib/main.c, lib/yyerror.c: New files.
9309
9310 gram_error can be static; it need not be extern.
9311 * src/reader.h (gram_error): Remove decl.
9312 * src/parse-gram.y (gram_error): Now static. Add static decl.
9313 (print_token_value): Omit parameter names from forward decl,
9314 for consistency.
9315
88510f9c
PE
93162002-11-29 Paul Eggert <eggert@twinsun.com>
9317
6e746484
PE
9318 * doc/bison.texinfo: Emphasize that yylex and yyerror must
9319 be declared before being used. E.g., one should typically
9320 declare them in the prologue. Use GNU coding style in examples.
9321 Put "const" consistently after the type it modifies. Mention
9322 that C99 supports "inline". Mention that yyerror traditionally
9323 returns "int".
9324
88510f9c
PE
9325 %parse-param and %lex-param now take just one argument, the
9326 declaration; the argument name is deduced from the declaration.
9327
9328 * doc/bison.texinfo (Parser Function, Pure Calling, Error
9329 Reporting, Table of Symbols): Document this.
9330 * src/parse-gram.y (add_param): New function.
9331 (COMMA): Remove.
9332 (declaration): Implement new rule for %parse-param and %lex-param.
9333 * src/scan-gram.l: "," now elicits a warning, rather than being
9334 a token; this is more compatible with byacc.
9335 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
9336
bb92250c
PE
93372002-11-27 Paul Eggert <eggert@twinsun.com>
9338
9339 Rename identifiers to avoid real and potential collisions.
9340
9341 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
9342 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 9343 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
9344 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9345 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
9346 * src/parse-gram.y (print_token_value): Renamed from yyprint.
9347 All uses changed.
9348 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
9349 The name "yycontrol" violates the name space rules, and this stuff
9350 wasn't being used anyway.
9351 (input): Remove action; this stuff wasn't being used.
9352 (gram_error): Rename local variable yylloc -> loc.
9353 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
9354 (YY_DECL): Don't use "yy" at start of local variables.
9355 All uses changed, e.g., yylloc -> loc.
9356 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
9357 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
9358 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
9359 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
9360
9361 * src/parse-gram.y (gram_error): loc is now const *.
9362 * src/reader.h (gram_error): Likewise.
9363
3af4feb2
PE
93642002-11-24 Paul Eggert <eggert@twinsun.com>
9365
9366 Version 1.75c.
9367
9368 * tests/actions.at (Actions after errors): Use an output format
9369 more similar to that of the Printers and Destructors test.
9370 Test the position of the ';' token too.
9371 (Printers and Destructors): Likewise.
9372 (Printers and Destructors: %glr-parser): Remove for now, to avoid
9373 unnecessarily alarming people when the test fails.
9374
9375 * data/yacc.c (yyerrlab1): Move this label down, so that the
9376 parser does not discard the lookahead token if the user code
9377 invokes YYERROR. This change is required for POSIX conformance.
9378
9379 * lib/error.c: Sync with gnulib.
9380
93812002-11-22 Paul Eggert <eggert@twinsun.com>
9382
9383 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
9384 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
9385 * lib/xmalloc.c: Likewise.
26b4a969 9386
58004308
PE
93872002-11-20 Paul Eggert <eggert@twinsun.com>
9388
9389 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
9390
93912002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 9392
58004308
PE
9393 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
9394 should use `if (! x) abort ();' rather than `assert (x);', and
9395 anyway it's one less thing to worry about configuring.
9396
9397 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
9398 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
9399 and replace all instances of assert with abort.
9400 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9401 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
9402
9403 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
9404 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
9405 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
9406 hash_find_entry, hash_rehash, hash_insert): Likewise.
9407 * src/conflicts.c (resolve_sr_conflict): Likewise.
9408 * src/lalr.c (set_goto_map, map_goto): Likewise.
9409 * src/nullable.c (nullable_compute): Likewise.
9410 * src/output.c (prepare_rules, token_definitions_output): Likewise.
9411 * src/reader.c (packgram, reader): Likewise.
9412 * src/state.c (state_new, state_free, state_transitions_set,
9413 state_reduction_find): Likewise.
9414 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
9415 symbol_pack): Likewise.
9416 * src/tables.c (conflict_row, pack_vector): Likewise.
9417 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9418 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9419 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
9420 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
9421
9422 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
9423 (ARGMATCH_CONSTRAINT): New macro.
9424 (ARGMATCH_ASSERT): Use it.
9425
9426 * src/system.h (verify): New macro.
9427 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
9428 rather than assert.
9429 * src/tables.c (tables_generate): Likewise.
9430
9431 * src/struniq.c (struniq_assert): Now returns void, and aborts
9432 if the assertion is false.
9433 (struniq_assert_p): Remove.
9434 * src/struniq.h: Likewise.
9435
76ae8198
PE
94362002-11-18 Paul Eggert <eggert@twinsun.com>
9437
9438 * data/glr.c (yygetLRActions): Replace `yyindex' with
9439 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
9440 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 9441 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 9442
d3c4e709
AD
94432002-11-18 Akim Demaille <akim@epita.fr>
9444
9445 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
9446 space.
9447 From Tim Van Holder.
9448
8d8a7238
PE
94492002-11-17 Paul Eggert <eggert@twinsun.com>
9450
9451 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
9452 to "SyntaxError" for consistency with my 2002-11-15 change.
9453
9454 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
9455 not define to {}, since this breaks the common use of `YYDPRINTF
9456 ((...));' if a single statement is desired (e.g. before `else').
9457 Work around GCC warnings by surrounding corresponding calls with
9458 {} if needed.
9459 (yyhasResolvedValue): Remove unused function.
9460 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
9461 loop body.
9462 (yyreportSyntaxError): Renamed from yyreportParseError.
9463 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
9464 All uses changed.
9465 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
9466 extern when possible. Remove unused initializations.
9467
b0937b22
AD
94682002-11-16 Akim Demaille <akim@epita.fr>
9469
9470 Augment the similarity between GLR and LALR traces.
9471
9472 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
9473 (YY_REDUCE_PRINT): New.
9474 (yyparse): Use them.
9475 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
9476 YYDPRINT here.
9477 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
9478 state reached after the reduction/recovery, since...
9479 (yyparse, yyprocessOneStack): Report the state we are entering in.
9480
c5e3e510
AD
94812002-11-16 Akim Demaille <akim@epita.fr>
9482
9483 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
9484 Add support for --trace=skeleton.
9485 * src/scan-skel.l: %option debug.
9486 Scan strings of non-@ or \n instead of character by character.
9487 (scan_skel): Handle trace_skeleton.
9488 (QPUTS): New.
9489 (@output_parser_name@, @output_header_name@): ``Restore'' their
9490 support (used to be M4 macros).
9491 * data/yacc.c: Quote larger chunks, a la glr.c.
9492 * data/lalr1.cc: Likewise.
9493 The header guards are no longer available, so use some other
9494 string than `YYLSP_NEEDED'.
9495
4c6cc1db
AD
94962002-11-16 Akim Demaille <akim@epita.fr>
9497
9498 Make the ``Printers and Destructors'' test more verbose, taking
9499 `yacc.c''s behavior as (possibly wrong) reference.
9500
9501 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
9502 instead of fprint on stdout.
9503 Set and report the last_line of the symbols.
9504 Consistently display values and locations.
9505
6d9e8019
PE
95062002-11-16 Paul Eggert <eggert@twinsun.com>
9507
9508 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
9509
6e649e65
PE
95102002-11-15 Paul Eggert <eggert@twinsun.com>
9511
b25d88f6
PE
9512 * tests/actions.at (Actions after errors): New test case.
9513
6e649e65
PE
9514 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
9515 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
9516 tests/action.at, tests/calc.at, tests/conflicts.at,
9517 tests/cxx-type.at, tests/regression.at:
9518 "parse error" -> "syntax error" for POSIX compatibility.
9519 "parsing stack overflow..." -> "parser stack overflow" so
9520 that code matches Bison documentation.
9521
0f39aab9
AD
95222002-11-15 Akim Demaille <akim@epita.fr>
9523
9524 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
9525 take two BRACED_CODE, not two string_content.
9526 Free the scanner's obstack when we are done.
9527 (code_content): New.
9528 * tests/calc.at: Adjust.
9529 * doc/bison.texinfo: Adjust.
9530 Also, make sure to include the `,' for these declarations.
9531
761c1926
AD
95322002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
9533
9534 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
9535 definition; avoids potential autoreconf problems.
9536
b0f98b10
AD
95372002-11-15 Akim Demaille <akim@epita.fr>
9538
9539 Always check the value returned by yyparse.
9540
9541 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
9542 returned by yyparse.
9543 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
9544 Adjust calls.
9545 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
9546 returned by yyparse.
9547
970785f1
PH
95482002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9549
9550 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
9551 on input.at test.
9552
8fcc7db1
PE
95532002-11-14 Paul Eggert <eggert@twinsun.com>
9554
7ec1b48e
PE
9555 * src/output.c (output_skeleton): Call xfopen instead of
9556 duplicating xfopen's body.
9557
cfff7583 9558 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 9559 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 9560
8fcc7db1
PE
9561 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
9562 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
9563 Group compiler. Instead, use "$CC -E bar.c". Include the .h
9564 file twice in the grammar, as an extra check.
9565
9566 * tests/input.at (Torturing the Scanner): Surround the
9567 backslash-newline tests with "#if 0", to make it less likely that
9568 we'll run into compiler bugs. Bring back solitary \ inside
9569 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 9570 test backslash-newline in C character constant.
8fcc7db1 9571
4e8d992c
AD
95722002-11-14 Akim Demaille <akim@epita.fr>
9573
9574 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
9575 status of the compiler.
f32b346d 9576 Calling `exit 1' is no longer needed.
4e8d992c
AD
9577 Reported by Nelson H. F. Beebe.
9578
9501dc6e
AD
95792002-11-14 Akim Demaille <akim@epita.fr>
9580
9581 * tests/atlocal.in (CPPFLAGS): We have config.h.
9582 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
9583 New.
9584 * tests/actions.at, tests/calc.at, tests/conflicts.at,
9585 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
9586 * tests/regression.at, tests/torture.at: Use them for all the
9587 grammars that are to be compiled.
9588 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
9589 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
9590 * doc/bison.texinfo (GLR Parsers): Document `inline'.
9591
18b519c0
AD
95922002-11-14 Akim Demaille <akim@epita.fr>
9593
9594 * doc/bison.texinfo: Various formatting changes (alignments in
9595 samples, additional @group/@end group, GCS in samples.
9596 Use @deffn instead of simple @table to define the directives,
9597 macros, variables etc.
9598
9a86cdb9
PE
95992002-11-13 Paul Eggert <eggert@twinsun.com>
9600
daa33def 9601 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 9602 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 9603
daa33def 9604 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 9605 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
9606 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
9607 * tests/headers.at (export YYLTYPE): Likewise.
9608
9609 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 9610 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 9611
9a86cdb9
PE
9612 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
9613 comments, since they're not portable. Use GNU coding style.
9614
9c1e26bd
AD
96152002-11-13 Akim Demaille <akim@epita.fr>
9616
9617 * data/yacc.c: Leave bigger chunks of quoted text.
9618 (YYDSYMPRINTF): New.
9619 Use it to report symbol activities.
9620 * data/glr.c (YYDSYMPRINTF): New.
9621 Use it.
9622
87f721cc
PE
96232002-11-12 Paul Eggert <eggert@twinsun.com>
9624
9625 Version 1.75b.
9626
9627 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
9628 (yyglrReduce): Return yyok, not 0.
9629 This should avoid the enumerated-type warnings reported
464c6927 9630 by Nelson H. F. Beebe in
161a71f3 9631 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
9632
9633 * lib/bbitset.h (BITSET_INLINE): Remove.
9634 * lib/bitset.h [! BITSET_INLINE]: Remove.
9635 (bitset_set, bitset_reset, bitset_test): Rename local vars
9636 to avoid shadowing warnings by GCC.
9637
9638 * data/glr.c (inline): Remove #define. It's the user's
9639 responsibility to #define it away, just like 'const'.
464c6927 9640 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 9641 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 9642
87f721cc
PE
9643 * Makefile.maint (po-check): Scan .l and .y files instead of the
9644 .c and the .h files that they generate. This fixes the bug
9645 reported by Tim Van Holder in:
161a71f3 9646 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
9647 Look for N_ as well as for _. Try to avoid matching #define for
9648 N_ and _.
9649 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
9650 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
9651 * src/scan-gram.l: Revamp regular expressions so that " and '
9652 do not confuse xgettext.
9653
9654 * src/struniq.h (struniq_new): Do not declare the return type
9655 to be 'const'; this violates the C standard.
9656 * src/struniq.c (struniq_new): Likewise.
9657
be14ade5
AD
96582002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
9659
9660 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
9661 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
9662 linker.
9663
05291fbc
AD
96642002-11-12 Akim Demaille <akim@epita.fr>
9665
9666 * Makefile.maint: Sync with Autoconf:
9667 (local_updates): New.
9668
1f5fd52e
AD
96692002-11-12 Akim Demaille <akim@epita.fr>
9670
9671 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
9672
283f1e64
AD
96732002-11-12 Akim Demaille <akim@epita.fr>
9674
9675 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
9676 locations.
9677
886b69d1
AD
96782002-11-12 Akim Demaille <akim@epita.fr>
9679
9680 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
9681 not yyvalue.
9682
3df37415
AD
96832002-11-12 Akim Demaille <akim@epita.fr>
9684
9685 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
9686 Use it to test the GLR parser.
9687
7bd6c77e
AD
96882002-11-12 Akim Demaille <akim@epita.fr>
9689
9690 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
9691 defines it.
9692 * data/glr.c (yystos): New.
9693 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
9694 (YYDSYMPRINT): New.
9695 (yyval): Don't define it, it is handled via M4.
9696 (yyrecoverParseError): Free verbosely the discarded symbols.
9697 * data/yacc.c (yysymprint): Remove, rather...
9698 (b4_yysymprint_generate): invoke.
9699 * data/c.m4 (b4_yysymprint_generate): New.
9700 Accept pointers as arguments, as opposed to the version from
9701 yacc.c.
9702 (b4_yydestruct_generate): Likewise.
9703 * tests/cations.at (Printers and Destructors): Use Bison directives
9704 instead of CPP macros.
9705 Don't rely on internal details.
9706
b0400cc6
AD
97072002-11-12 Akim Demaille <akim@epita.fr>
9708
9709 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
9710 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
9711 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
9712 it against YYEMPTY and so forth), work on yytoken (i.e., set
9713 it to YYEMPTY etc.).
9714 (yydestruct): Replace with a b4_yydestruct_generate invocation.
9715 (b4_symbol_actions): Remove.
9716 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
9717 for 0, end-of-input.
9718
72f889cc
AD
97192002-11-12 Akim Demaille <akim@epita.fr>
9720
9721 * doc/bison.texinfo (Destructor Decl): New.
9722
b1ae9233
AD
97232002-11-12 Akim Demaille <akim@epita.fr>
9724
9725 * src/tables.c (tables_generate): Use free for pointers that
9726 cannot be NULL, not XFREE.
9727 (pack_vector): Use assert, not fatal, for bound violations.
9728 * src/state.c (state_new): Likewise.
9729 * src/reader.c (reader): Likewise.
9730 * src/lalr.c (set_goto_map): Likewise.
72f889cc 9731 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
9732 the file name.
9733
7ec2d4cd
AD
97342002-11-12 Akim Demaille <akim@epita.fr>
9735
9736 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
9737 Restore.
9738 * src/scan-gram.l (last_string): Is global to the file, not to
9739 yylex.
9740 * src/parse-gram.y (input): Don't append the epilogue here,
9741 (epilogue.opt): do it here, and free the scanner's obstack.
9742 * src/reader.c (epilogue_set): Rename as...
9743 (epilogue_augment): this.
9744 * data/c.m4 (b4_epilogue): Defaults to empty.
9745
573a6cd3
AD
97462002-11-12 Akim Demaille <akim@epita.fr>
9747
9748 * src/getargs.c (long_options): Remove duplicates.
9749 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
9750 Remove.
9751 * doc/bison.rnh: Remove.
9752 * doc/bison.texinfo (VMS Invocation): Remove.
9753
95612cfa
AD
97542002-11-12 Akim Demaille <akim@epita.fr>
9755
9756 * src/struniq.h, src/struniq.c (struniq_t): Is const.
9757 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
9758
9759 Use struniq for symbols.
9760
9761 * src/symtab.h (symbol_t): The tag member is a struniq.
9762 (symbol_type_set): Adjust.
9763 * src/symtab.c (symbol_new): Takes a struniq.
9764 (symbol_free): Don't free the tag member.
9765 (hash_compare_symbol_t, hash_symbol_t): Rename as...
9766 (hash_compare_symbol, hash_symbol): these.
9767 Use the fact that tags as struniqs.
9768 (symbol_get): Use struniq_new.
9769 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
9770 Returns a strniq.
9771 * src/reader.h (merger_list, grammar_currentmerge_set): The name
9772 and type members are struniqs.
9773 * src/reader.c (get_merge_function)
9774 (grammar_current_rule_merge_set): Adjust.
9775 (TYPE, current_type): Are struniq.
9776
9777 Use struniq for file names.
9778
9779 * src/files.h, src/files.c (infile): Split into...
9780 (grammar_file, current_file): these.
9781 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
9782 * src/reduce.c (reduce_print): Likewise.
9783 * src/getargs.c (getargs): Likewise.
9784 * src/complain.h, src/complain.c: Likewise.
9785 * src/main.c (main): Call struniqs_new early enough to use it for
9786 file names.
9787 Don't free the input file name.
9788
3e6656f9
AD
97892002-11-12 Akim Demaille <akim@epita.fr>
9790
9791 * src/symtab.c (symbol_free): Remove dead deactivated code:
9792 type_name are properly removed.
9793 Don't use XFREE to free items that cannot be NULL.
9794 * src/struniq.h, src/struniq.c: New.
9795 * src/main.c (main): Initialize/free struniqs.
9796 * src/parse-gram.y (%union): Add astruniq member.
9797 (yyprint): Adjust.
9798 * src/scan-gram.l (<{tag}>): Return a struniq.
9799 Free the obstack bit that used to store it.
9800 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
9801
7672019c
PE
98022002-11-11 Paul Eggert <eggert@twinsun.com>
9803
9804 Revamp to fix many (but not all) of the C- and M4-related quoting
9805 problems. Among other things, this fixes the Bison bug reported
9806 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 9807 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
9808
9809 Use new @ escapes consistently. Represent brackets with @{ and @}
9810 rather than @<:@ and @:>@, since this works a bit better with dumb
9811 editors like vi. Represent @ with @@, since @ is now consistently
9812 an escape. Use @oline@ and @ofile@ rather than __oline__ and
9813 __ofile__, to avoid unexpected expansions. Similarly, use @output
9814 rather than #output.
9815
9816 * data/c.m4 (b4_copyright): Omit file name from comment, since
9817 the file name could contain "*/".
9818 (b4_synclines_flag): Don't quote the 2nd argument; it should already
9819 be quoted. All uses changed.
9820
9821 * data/glr.c: Use new @ escapes consistently.
9822 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
9823 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
9824 Remove, since they couldn't handle arbitrary characters in file
9825 names.
9826 * data/lalr1.cc: Likewise.
9827 * data/yacc.c: Likewise.
9828
9829 * src/files.c (output_infix): Remove; all uses removed.
9830 * src/files.h: Likewise.
9831
9832 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
9833 mishandled funny characters in file names, and anyway it isn't
9834 needed any more.
9835 * data/yacc.c: Likewise.
9836 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
9837
9838 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
9839 * data/yacc.c: Likewise.
9840
9841 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
9842 strings now.
9843 (muscle_init): Quote filename as a C string.
9844 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
9845 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
9846 * src/output.c (escaped_file_name_output): New function.
9847 (prepare_symbols): Quote tokens for M4.
9848 (prepare): Don't insert output_infix, output_prefix,
9849 output_parser_name, output_header_name; this is now down by scan-skel.
9850 Insert skeleton as a C string.
9851
9852 * src/output.c (user_actions_output, symbol_destructors_output,
9853 symbol_printers_output): Quote filenames for C and M4.
9854 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9855
9856 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
9857 escapes other than \\ and \'; this simplifies the code.
9858 (<SC_STRING>): Likewise, for \\ and \".
9859 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
9860 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
9861 Use new escapes @{ and @} for [ and ].
9862
9863 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
9864 them with auto vars.
9865 Switch to new escape scheme, where @ is the escape character uniformly.
9866 Abort if a stray escape character is found. Avoid unbounded input
9867 buffer when parsing non-escaped text.
9868
9869 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
9870 __oline__, #output, $@, and @{ do not have unintended meanings.
9871
acea4f3b
PE
98722002-11-09 Paul Eggert <eggert@twinsun.com>
9873
9874 Fix the test failure due to GCC warnings described in
161a71f3 9875 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
9876 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
9877 evaluate to 0 if it's impossible for NINF to be in the respective
9878 table.
9879 (yygetLRActions, yyrecoverParseError): Use them.
9880
9881 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
9882 counted in the token inserted at end of file. Now takes
9883 location_t *, not location_t, so that the location can be
9884 adjusted. All uses changed.
9885
9886 * tests/regression.at (Invalid inputs): Adjust wording in
9887 diagnostic to match the new behavior.
9888
9889 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
9890 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
9891 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
9892 abort ();'. This reduces the runtime of the "Many lookaheads"
9893 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
9894 GCC 3.2.
9895
20ef1ad5
PE
98962002-11-07 Paul Eggert <eggert@twinsun.com>
9897
9898 * src/parse-gram.y (CHARACTER): Remove unused token.
9899 All uses removed.
9900
9901 * src/scan-gram.l: Remove stack option. We no longer use the
9902 stack, since the stack was never deeper than 1; instead, use the
9903 new auto var c_context to record the stacked value.
9904
9905 Remove nounput option. At an unexpected end of file, we now unput
9906 the minimal input necessary to end cleanly; this simplifies the
9907 code.
9908
9909 Avoid unbounded token sizes where this is easy.
9910
9911 (unexpected_end_of_file): New function.
9912 Use it to systematize the error message on unexpected EOF.
9913 (last-string): Now auto, not static.
9914 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
9915 (scanner_last_string_free): Remove; not used.
9916 (percent_percent_count): Move decl to just before use.
9917 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
9918 not the (never otherwised-used) CHARACTER.
9919
93724f13
AD
99202002-11-07 Akim Demaille <akim@epita.fr>
9921
9922 Let yyerror always receive the msg as last argument, so that
9923 yyerror can be variadic.
9924
9925 * data/yacc.c (b4_yyerror_args): New.
9926 Use it when calling yyerror.
9927 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
9928 Use it when calling yyerror.
9929 * doc/bison.texinfo (Error Reporting): Adjust.
9930 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
9931 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
9932
6e40b4eb
AD
99332002-11-06 Akim Demaille <akim@epita.fr>
9934
9935 #line should have quoted strings.
9936 Ideally, this should be done by m4_quotearg.
9937
9938 * src/scan-skel.l: Include quotearg.h.
9939 Quote __ofile__.
9940 * src/output.c (symbol_printers_output)
9941 (symbol_destructors_output): Quote the file name.
9942
2dfbfc12
AD
99432002-11-06 Akim Demaille <akim@epita.fr>
9944
9945 * tests/regression.at (Invalid inputs): Adjust to the recent
9946 messages.
9947
437c2d80
AD
99482002-11-06 Akim Demaille <akim@epita.fr>
9949
9950 Restore --no-lines.
9951 Reported by Jim Kent.
9952
9953 * data/c.m4 (b4_syncline): New.
9954 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
9955 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
9956 * src/output.c (user_actions_output): Likewise.
9957 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 9958 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 9959
900c5db5
AD
99602002-11-06 Akim Demaille <akim@epita.fr>
9961
9962 * src/main.c (main): Free `infile'.
9963 * src/scan-gram.l (handle_syncline): New.
9964 Recognize `#line'.
9965 * src/output.c (user_actions_output, symbol_destructors_output)
9966 (symbol_printers_output): Use the location's file name, not
9967 infile.
9968 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9969
e183b123 99702002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 9971
e183b123 9972 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 9973 either has GLR conflict entries.
e183b123 9974
193eb6b7
PE
99752002-11-05 Paul Eggert <eggert@twinsun.com>
9976
e183b123
PE
9977 * src/scan-gram.l: Use more accurate diagnostics, e.g.
9978 "integer out of range" rather than "invalid value".
9979 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
9980 accordingly.
9981
193eb6b7
PE
9982 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
9983 Also, remove one static variable in the scanner.
9984
9985 * src/scan-gram.l (braces_level): Now auto, not static.
9986 Initialize to zero if the compiler is being picky.
9987 (INITIAL): Clear braces_level instead of incrementing it.
9988 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
9989 as POSIX 1003.1-2001 requires.
9990 * src/system.h (IF_LINT): New macro, taken from coreutils.
9991 * configure.ac: Define "lint" if --enable-gcc-warnings.
9992
29c01725
AD
99932002-11-05 Akim Demaille <akim@epita.fr>
9994
9995 * src/scan-gram.l: When it starts with `%', complain about the
9996 whole directive, not just that `invalid character: %'.
9997
8aeac3ca
AD
99982002-11-04 Akim Demaille <akim@epita.fr>
9999
10000 * Makefile.maint: Update from Autoconf.
10001 (update, cvs-update, po-update, do-po-update): New.
10002
793a58bb
AD
100032002-11-04 Akim Demaille <akim@epita.fr>
10004
10005 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
10006 and yyerror.
10007 Have yyerror `use' its arguments.
10008 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
10009 returns true when location & yacc & pure & parse-param.
10010 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
10011
c4d720cd
AD
100122002-11-04 Akim Demaille <akim@epita.fr>
10013
10014 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
10015 clashes.
10016 * src/scan-gram.l: Use [\'] instead of ['] to pacify
10017 font-lock-mode.
10018 Use complain_at.
10019 Use quote, not quote_n since LOCATION_PRINT no longer uses the
10020 slot 0.
10021
613a0dc5
PE
100222002-11-03 Paul Eggert <eggert@twinsun.com>
10023
10024 * src/reader.c (get_merge_function, grammar_current_rule_check):
10025 Use consistent diagnostics for reporting type name clashes.
10026 Quote the types with <>, for consistency with Yacc.
10027 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
10028
2a8d363a
AD
100292002-11-03 Akim Demaille <akim@epita.fr>
10030
10031 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
10032 New.
10033 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
10034 (b4_parse_param): Remove.
10035 Use b4_identification.
10036 Propagate b4_pure_args where needed to pass them to yyerror.
10037 * data/glr.m4 (b4_parse_param): Remove.
10038 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
10039 (b4_lpure_formals): New.
10040 Use b4_identification.
10041 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
10042 b4_user_formals and b4_user_args.
10043 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
10044 (yyreportAmbiguity): When using a pure parser, also need
10045 the location, and the parse-params.
10046 Adjust callers.
10047 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
10048 When using a pure parser, also need the parse-params.
10049 Adjust callers.
10050 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
10051 (%pure-parser + %parse-param) LALR and GLR parsers.
10052 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
10053 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
10054 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
10055 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
10056 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
10057 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
10058 * doc/bison.texinfo: Untabify the whole file.
10059 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
10060 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
10061 (Error Reporting): Adjust to these new directives.
10062 Document %error-verbose, deprecate YYERROR_VERBOSE.
10063
9e32add8
AD
100642002-11-03 Akim Demaille <akim@epita.fr>
10065
10066 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
10067 AT_CHECK_CALC_GLR invocations to use % directives, instead of
10068 command line options.
10069 * tests/cxx-type.at: Formatting changes.
10070
b02d90a5
PE
100712002-11-03 Paul Eggert <eggert@twinsun.com>
10072
10073 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
10074 to count columns correctly, and to check for invalid inputs.
9e32add8 10075
b02d90a5
PE
10076 Use mbsnwidth to count columns correctly. Account for tabs, too.
10077 Include mbswidth.h.
10078 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
10079 (extend_location): New function.
10080 (YY_LINES): Remove.
10081
10082 Handle CRLF in C code rather than in Lex code.
10083 (YY_INPUT): New macro.
10084 (no_cr_read): New function.
10085
10086 Scan UCNs, even though we don't fully handle them yet.
10087 (convert_ucn_to_byte): New function.
10088
10089 Handle backslash-newline correctly in C code.
10090 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
10091 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
10092 all uses changed.
10093 (tag, splice): New EREs. Do not allow NUL or newline in tags.
10094 Use {splice} wherever C allows backslash-newline.
10095 YY_STEP after space, newline, vertical-tab.
10096 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 10097
b02d90a5
PE
10098 (letter, id): Don't assume ASCII; e.g., spell out a-z.
10099
10100 ({int}, handle_action_dollar, handle_action_at): Check for integer
10101 overflow.
9e32add8 10102
b02d90a5
PE
10103 (YY_STEP): Omit trailing semicolon, so that it's more like C.
10104
10105 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
10106 as well as \000. Check for UCHAR_MAX, not 255.
10107 Allow \x with an arbitrary positive number of digits, as in C.
10108 Check for overflow here.
10109 Allow \? and UCNs, for compatibility with C.
10110
10111 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
10112 with quote slot used by complain_at.
10113
10114 * tests/input.at: Add tests for backslash-newline, m4 quotes
10115 in symbols, long literals, and funny escapes in strings.
10116
10117 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
10118 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
10119 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
10120 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
10121 * m4/mbswidth.m4: New file, from GNU coreutils.
10122
10123 * doc/bison.texinfo (Grammar Outline): Document // comments.
10124 (Symbols): Document that trigraphs have no special meaning in Bison,
10125 nor is backslash-newline allowed.
10126 (Actions): Document that trigraphs have no special meaning.
10127
10128 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
10129 no longer used.
10130
101312002-11-02 Paul Eggert <eggert@twinsun.com>
10132
10133 * src/reader.c: Don't include quote.h; not needed.
10134 (get_merge_function): Reword warning to be consistent with
10135 type clash diagnostic in grammar_current_rule_check.
10136
10137 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
10138 bug in trigraph handling.
10139
10140 * src/output.c (prepare_symbols): When printing token names,
10141 escape "[" as "@<:@" and likewise for "]".
10142
10143 * src/system.h (errno): Remove declaration, as we are now
10144 assuming C89 or better, and C89 guarantees errno.
10145
762b212b
PE
101462002-10-30 Paul Eggert <eggert@twinsun.com>
10147
10148 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
10149 Check for close failures.
10150 * src/files.h (xfclose): Return void, not int, since it always
10151 returned zero.
10152 * src/files.c (xfclose): Likewise. Report I/O error if ferror
10153 indicates one.
10154 * src/output.c (output_skeleton): Use xfclose rather than fclose
10155 and ferror. xfclose now checks ferror.
10156
10157 * data/glr.c (YYLEFTMOST_STATE): Remove.
10158 (yyreportTree): Use a stack-based leftmost state. This avoids
10159 our continuing battles with bogus warnings about initializers.
10160
56100c60
AD
101612002-10-30 Akim Demaille <akim@epita.fr>
10162
10163 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
10164 #if.
10165
51b4a04c
PH
101662002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10167
10168 * tests/glr-regr1.at: New test for reported regressions.
10169 * tests/testsuite.at: Add glr-regr1.at test.
10170 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 10171
bf1ebda2
PE
101722002-10-24 Paul Eggert <eggert@twinsun.com>
10173
5c16c6b1
PE
10174 Version 1.75a.
10175
bf1ebda2
PE
10176 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
10177 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
10178 we use malloc. Don't assume 'A' through 'Z' are contiguous.
10179 Don't assume strdup exists; POSIX says its an XSI extension.
10180 Check for buffer overflow on input.
10181
b526ee61
AD
101822002-10-24 Akim Demaille <akim@epita.fr>
10183
10184 * src/output.c (output_skeleton): Don't disable M4sugar comments
10185 too soon: it results in comments being expanded.
10186 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
10187 first output.
10188
f1886bb2
AD
101892002-10-24 Akim Demaille <akim@epita.fr>
10190
10191 * data/yacc.c (m4_int_type): New.
10192 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
10193 char' as only yacc.c wants K&R portability.
10194 * data/glr.c (yysigned_char): Remove.
10195 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
10196 Reported by Quoc Peyrot.
10197
c5576256
PE
101982002-10-23 Paul Eggert <eggert@twinsun.com>
10199
10200 * src/main.c (main): With --trace=time, report times even if a
10201 non-fatal error occurs. Formerly, the times were reported in some
10202 such cases but not in others.
10203 * src/reader.c (reader): Just return if a complaint has been issued,
10204 instead of exiting, so that 'main' can report times.
10205
27b0ffea
AD
102062002-10-22 Akim Demaille <akim@epita.fr>
10207
10208 * src/system.h: Include sys/types.
10209 Reported by Bert Deknuydt.
10210
223a7883
PE
102112002-10-23 Paul Eggert <eggert@twinsun.com>
10212
10213 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
10214 Suggested by Art Haas.
10215
102162002-10-22 Paul Eggert <eggert@twinsun.com>
10217
10218 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
10219 decl; not needed any more.
10220 * src/main.c (main): Use return to exit, undoing yesterday's change.
10221 The last OS that we could find where this wouldn't work is
10222 SunOS 3.5, and that's too old to worry about now.
10223
10224 * data/glr.c (struct yyltype): Define members even when not
10225 doing locations. This is more consistent with yacc.c, and it
10226 works around the following bug reports:
161a71f3
PE
10227 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
10228 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 10229
223a7883
PE
10230 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
10231 @acronym consistently. Standardize on "Yacc" instead of "YACC",
10232 "Algol" instead of "ALGOL". Give a bit more history about BNF.
10233
8b76775a
AD
102342002-10-22 Akim Demaille <akim@epita.fr>
10235
10236 * data/README: New.
10237
6db10d14
PE
102382002-10-21 Paul Eggert <eggert@twinsun.com>
10239
10240 Be consistent about 'bool'; the old code used an enum in one
10241 module and an int in another, and this violates the C standard.
10242 * m4/stdbool.m4: New file, from coreutils 4.5.3.
10243 * configure.ac (AC_HEADER_STDBOOL): Add.
10244 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
10245 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
10246 * src/symtab.c (hash_compare_symbol_t): Likewise.
10247 * src/system.h (bool, false, true): Use a definition consistent
10248 with ../lib/hash.c. All uses changed.
10249
10250 * src/complain.c (warning_issued): Renamed from warn_message_count,
10251 so that we needn't worry about integer overflow (!).
10252 Now of type bool. All uses changed.
10253 (complaint_issued): Renamed from complain_message_count; likewise.
10254
10255 * src/main.c (main): Use exit to exit with failure.
27b0ffea 10256
6db10d14
PE
10257 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
10258 rather than 1 and 0.
10259 * src/main.c (main): Likewise.
10260 * src/getargs.c (getargs): Likewise.
10261 * src/reader.c (reader): Likewise.
10262
10263 * src/getarg.c (getargs): Remove duplicate code for
10264 "Try `bison --help'".
10265
10266 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
10267 What was that "2" for?
10268
10269 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
10270 * src/getargs.c (usage): Likewise.
10271
10272 * src/getargs.c (getargs): When there are too few operands, report
10273 the last one. When there are too many, report the first extra
10274 one. This is how diffutils does it.
10275
92a060fd
PE
102762002-10-20 Paul Eggert <eggert@twinsun.com>
10277
10278 Remove K&R vestiges.
10279 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
10280 * src/complain.c (VA_START): Remove. Assume prototypes.
10281 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
10282 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
10283 fatal): Assume prototypes.
10284 * src/complain.h: Assume prototypes.
10285 * src/system.h (PARAMS): Remove.
10286 Include <limits.h> unconditionally, since it's guaranteeed even
10287 for a freestanding C89 compiler.
10288 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
10289 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 10290
e7cb57c0
AD
102912002-10-20 Akim Demaille <akim@epita.fr>
10292
10293 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
10294 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
10295 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
10296 (yyresolveStates, yyresolveAction, yyresolveStack)
10297 (yyprocessOneStack): Use them.
10298 (yy_reduce_print): New.
10299 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
10300
0245f82d
AD
103012002-10-20 Akim Demaille <akim@epita.fr>
10302
10303 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
10304 arguments and output `void'.
10305 (b4_c_function): Rename as...
10306 (b4_c_function_def): this.
10307 (b4_c_function_decl, b4_c_ansi_function_def)
10308 (b4_c_ansi_function_decl): New.
10309 Change the interpretation of the arguments: before `int, foo', now
10310 `int foo, foo'.
10311 * data/yacc.c (yyparse): Prototype and define thanks to these.
10312 Adjust b4_c_function_def uses.
10313 * data/glr.c (yyparse): Likewise, but ANSI only.
10314
39912f52
AD
103152002-10-20 Akim Demaille <akim@epita.fr>
10316
10317 * src/output.c (prepare): Move the definition of `tokens_number',
10318 `nterms_number', `undef_token_number', `user_token_number_max'
10319 to...
10320 (prepare_tokens): Here.
10321 (prepare_tokens): Rename as...
10322 (prepare_symbols): this.
10323 (prepare): Move the definition of `rules_number' to...
10324 (prepare_rules): here.
10325 (prepare): Move the definition of `last', `final_state_number',
10326 `states_number' to...
10327 (prepare_states): here.
10328 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
10329
20c1e2ad
AD
103302002-10-20 Akim Demaille <akim@epita.fr>
10331
10332 * src/tables.h, src/tables.c, src/output.c: Comment changes.
10333
21964f43
AD
103342002-10-20 Akim Demaille <akim@epita.fr>
10335
10336 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
10337 * data/c.m4: here.
10338
66d30cd4
AD
103392002-10-20 Akim Demaille <akim@epita.fr>
10340
10341 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
10342 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
10343 `pair'.
10344 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
10345 `name' to...
10346 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
10347 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
10348 These.
10349
95f2c9fe
PE
103502002-10-19 Paul Eggert <eggert@twinsun.com>
10351
10352 Do not create a temporary file, as that involves security and
10353 cleanup headaches. Instead, use a pair of pipes.
10354 Derived from a suggestion by Florian Krohm.
10355 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
10356 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
10357 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
10358 (BISON_PREREQ_SUBPIPE): Add.
10359 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
10360 Add subpipe.h, subpipe.c.
10361 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
10362 * po/POTFILES.in: Add lib/subpipe.c.
10363 * src/output.c: Include "subpipe.h".
10364 (m4_invoke): Remove decl.
10365 (scan_skel): New decl.
10366 (output_skeleton): Use pipe rather than temporary file for m4 input.
10367 Check that m4sugar.m4 is readable, to avoid deadlock.
10368 Check for pipe I/O error.
10369 * src/scan-skel.l (readpipe): Remove decl.
10370 (scan_skel): New function, to be used in place of m4_invoke.
10371 Read from stream rather than file.
66d30cd4 10372
95f2c9fe
PE
10373 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
10374 float, as this generates a warning on Solaris 8 + GCC 3.2 with
10375 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
10376 this generates a more-accurate value anyway.
10377
10378 * lib/timevar.c (timervar_accumulate): Rename locals to
10379 avoid confusion with similarly-named more-global.
10380 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
10381
10382 * src/output.c (prepare): Use xstrdup to convert char const *
10383 to char *, to avoid GCC warning.
10384
c19988b7
AD
103852002-10-19 Akim Demaille <akim@epita.fr>
10386
10387 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
10388 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
10389 Use them to have `calc.y' ready for %pure-parser.
10390 * data/yacc.c (YYLEX): Pass a yylex return type to
10391 b4_c_function_call.
10392
ae7453f2
AD
103932002-10-19 Akim Demaille <akim@epita.fr>
10394
10395 Prototype support of %lex-param and %parse-param.
10396
10397 * src/parse-gram.y: Add the definition of the %lex-param and
10398 %parse-param tokens, plus their rules.
10399 Drop the `_' version of %glr-parser.
10400 Add the "," token.
10401 * src/scan-gram.l (INITIAL): Scan them.
10402 * src/muscle_tab.c: Comment changes.
10403 (muscle_insert, muscle_find): Rename `pair' as `probe'.
10404 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
10405 (muscle_entry_s): The `value' member is no longer const.
10406 Adjust all dependencies.
10407 * src/muscle_tab.c (muscle_init): Adjust: use
10408 MUSCLE_INSERT_STRING.
10409 Initialize the obstack earlier.
10410 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
10411 (muscle_pair_list_grow): New.
10412 * data/c.m4 (b4_c_function_call, b4_c_args): New.
10413 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
10414 * tests/calc.at: Use %locations, not --locations.
10415 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
10416
0e575721
AD
104172002-10-19 Akim Demaille <akim@epita.fr>
10418
10419 * src/getargs.c (usage): Take status as argument and exit
10420 accordingly.
10421 Report the traditional `Try ... --help' message when status != 0.
10422 (usage, version): Don't take a FILE * as arg, it is pointless.
10423 (getargs): When there is an incorrect number of arguments, make it
10424 an error, and report it GNUlically thanks to `usage ()'.
10425
724ce7f5
PE
104262002-10-18 Paul Eggert <eggert@twinsun.com>
10427
3a781eb2
PE
10428 * data/glr.c (yyreportParseError): Don't assume that sprintf
10429 yields the length of the printed string, as this is not true
10430 on SunOS 4.1.4. Reported by Peter Klein.
10431
724ce7f5
PE
10432 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
10433 * tests/conflicts.at (%nonassoc and eof): Likewise.
10434 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
10435
473d0a75
AD
104362002-10-17 Akim Demaille <akim@epita.fr>
10437
10438 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
10439 * src/getargs.c (trace_types, trace_args): Adjust.
10440 * src/reader.c (grammar_current_rule_prec_set)
10441 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
10442 Standardize error messages.
10443 And s/@prec/%prec/!
10444 (reader): Use trace_flag to enable scanner/parser debugging,
10445 instead of an adhoc scheme.
10446 * src/scan-gram.l: Remove trailing debugging code.
10447
e76d2469
PE
104482002-10-16 Paul Eggert <eggert@twinsun.com>
10449
93e2236a
PE
10450 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
10451 MUSCLE_TAB_H.
10452
e76d2469
PE
10453 * NEWS: Officially drop support for building Bison with K&R C,
10454 since it didn't work anyway and it's not worth worrying about.
10455 * Makefile.maint (wget_files): Remove ansi2knr.c.
10456 (ansi2knr.c-url_prefix): Remove.
10457 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
10458 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10459 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10460
5bd1c419
PE
104612002-10-15 Paul Eggert <eggert@twinsun.com>
10462
10463 Stop using the "enum_" trick for K&R-style function definitions;
10464 it confused me, and I was the author! Instead, assume that people
10465 who want to use K&R C compilers (when using these modules in GCC,
10466 perhaps?) will run ansi2knr.
10467
10468 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
10469 All uses of "enum_" changed to "enum ".
10470 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10471 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 10472
5bd1c419
PE
10473 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
10474 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
10475 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
10476 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
10477 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
10478 abitset_not, abitset_ones, abitset_or, abitset_or_and,
10479 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
10480 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
10481 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
10482 Use function prototypes; this removes the need for declaring
10483 static functions simply to provide their prototypes.
10484 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
10485 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
10486 bitset_count_, bitset_create, bitset_dump, bitset_first,
10487 bitset_free, bitset_init, bitset_last, bitset_next,
10488 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
10489 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
10490 bitset_print, bitset_release_memory, bitset_toggle_,
10491 bitset_type_choose, bitset_type_get, bitset_type_name_get,
10492 debug_bitset): Likewise.
10493 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
10494 * lib/bitset_stats.c (bitset_log_histogram_print,
10495 bitset_percent_histogram_print, bitset_stats_and,
10496 bitset_stats_and_cmp, bitset_stats_and_or,
10497 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
10498 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
10499 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
10500 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
10501 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
10502 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
10503 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
10504 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
10505 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
10506 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
10507 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
10508 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
10509 bitset_stats_zero): Likewise.
10510 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10511 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10512 bitsetv_dump, debug_bitsetv): Likewise.
10513 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
10514 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
10515 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
10516 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
10517 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
10518 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
10519 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
10520 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
10521 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
10522 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
10523 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
10524 Likewise.
10525 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
10526 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
10527 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
10528 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
10529 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
10530 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
10531 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
10532 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
10533 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
10534 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
10535 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 10536
ae26e1f0
AD
105372002-10-14 Akim Demaille <akim@epita.fr>
10538
10539 Version 1.75.
10540
d43baf71
AD
105412002-10-14 Akim Demaille <akim@epita.fr>
10542
10543 * tests/Makefile.am (maintainer-check-posix): New.
10544
7ebc83e3
AD
105452002-10-14 Akim Demaille <akim@epita.fr>
10546
10547 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
10548 member.
10549
05846dae
AD
105502002-10-14 Akim Demaille <akim@epita.fr>
10551
10552 * src/tables.c (table_ninf_remap): base -> tab.
10553 Reported by Matt Rosing.
10554
1318e37d
PE
105552002-10-14 Paul Eggert <eggert@twinsun.com>
10556
447fbb17
PE
10557 * tests/action.at, tests/calc.at, tests/conflicts.at,
10558 tests/cxx-type.at, tests/headers.at, tests/input.at,
10559 tests/regression.at, tests/synclines.at, tests/torture.at:
10560 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
10561 so that the tests still work even if POSIXLY_CORRECT is set.
10562 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 10563
1318e37d
PE
10564 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
10565 for portability to K&R hosts. Fix typo: signed char is guaranteed
10566 only to 127, not to 128.
10567 * data/glr.c (yysigned_char): New type.
10568 * data/yacc.c (yysigned_char): Likewise.
10569 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
10570
cc0f0794
PE
105712002-10-13 Paul Eggert <eggert@twinsun.com>
10572
5038f418
PE
10573 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
10574 true due to limited range of data type" warning from GCC.
10575
cc0f0794
PE
10576 * data/c.m4 (b4_token_defines): Protect against double-inclusion
10577 by wrapping enum yytokentype's definition inside #ifndef
10578 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
10579
6fed0802
AD
105802002-10-13 Akim Demaille <akim@epita.fr>
10581
10582 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
10583 Un yy- yyrhs to avoid the name clash with the global YYRHS.
10584
32f0598d
AD
105852002-10-13 Akim Demaille <akim@epita.fr>
10586
10587 * Makefile.maint: Update from Autoconf 2.54.
10588 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
10589
7ea9a33f
AD
105902002-10-13 Akim Demaille <akim@epita.fr>
10591
10592 * src/print.c (print_state): Separate the list of solved conflicts
10593 from the other items.
10594 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
10595
ea99527d
AD
105962002-10-13 Akim Demaille <akim@epita.fr>
10597
10598 Let nondeterministic skeletons be usable with deterministic
10599 tables.
10600
10601 With the patch, GAWK compiled by GCC without -O2 passes its test
10602 suite using a GLR parser driven by LALR tables. It fails with -O2
10603 because `struct stat' gives two different answers on my machine:
10604 88 (definition of an auto var) and later 96 (memset on this var).
10605 Hence the stack is badly corrumpted. The headers inclusion is to
10606 blame: if I move the awk.h inclusion before GLR's system header
10607 inclusion, the two struct stat have the same size.
10608
10609 * src/tables.c (pack_table): Always create conflict_table.
10610 (token_actions): Always create conflict_list.
10611 * data/glr.c (YYFLAG): Remove, unused.
10612
f377f69f
AD
106132002-10-13 Akim Demaille <akim@epita.fr>
10614
10615 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
10616 (O0FLAGS): New.
10617 (VALGRIND, GXX): New.
10618 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
10619 * tests/bison.in: Run $PREBISON a pre-command.
10620 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
10621 (maintainer-check-g++): New.
10622 * Makefile.am (maintainer-check): New.
10623
2a1fe6ed
AD
106242002-10-13 Akim Demaille <akim@epita.fr>
10625
10626 * data/glr.c: Formatting changes.
10627 Tweak some trace messages to match yacc.c's.
10628
f50adbbd
AD
106292002-10-13 Akim Demaille <akim@epita.fr>
10630
10631 GLR parsers sometimes raise parse errors instead of performing the
10632 default reduction.
10633 Reported by Charles-Henry de Boysson.
10634
10635 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 10636 check the length of the traces when %glr.
f50adbbd
AD
10637 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
10638 GLR's traces.
10639 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
10640 Test GLR parsers.
10641 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
10642 (yyltype): Remove the yy prefix from the member names.
10643 (yytable): Complete its comment.
10644 (yygetLRActions): Map error action number from YYTABLE from
10645 YYTABLE_NINF to 0.
10646 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
10647 (which was a bug: it should have been YYTABEL_NINF, and yet it was
10648 not satisfying as we could compare an YYACTION computed from
10649 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
10650 only value for error actions.
10651 (yyreportParseError): In verbose parse error messages, don't issue
10652 `error' in the list of expected tokens.
10653 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
10654 next action to perform to match glr.c's decoding.
10655 (yytable): Complete its comment.
10656
bcbad5b9
PE
106572002-10-13 Paul Eggert <eggert@twinsun.com>
10658
10659 Fix problem reported by Henrik Grubbstroem in
161a71f3 10660 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
10661 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
10662 because the Bison parser reads the second action before reducing
10663 the first one.
10664 * src/scan-gram.l (rule_length): New static var.
10665 Use it to keep track of the rule length in the scanner, since
10666 we can't expect the parser to be in lock-step sync with the scanner.
10667 (handle_action_dollar, handle_action_at): Use this var.
10668 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 10669
14904b89
PE
106702002-10-12 Paul Eggert <eggert@twinsun.com>
10671
1fe611e5
PE
10672 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
10673 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
10674 Include <sys/time.h> when checking for clock_t and struct tms.
10675 Use same include order as source.
10676 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 10677 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 10678
1fe611e5
PE
10679 * lib/timevar.c: Update copyright date and clarify comments.
10680 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 10681
1fe611e5
PE
10682 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
10683 GCC version as of today, then merge Bison's changes.
10684 Change "GCC" to "Bison" in copyright notice. timevar.def's
10685 author is Akim, so change that too.
10686
98194095
PE
10687 * src/reader.c (grammar_current_rule_check):
10688 Don't worry about the default action if $$ is untyped.
10689 Prevents bogus warnings reported by Jim Gifford in
161a71f3 10690 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 10691
14904b89
PE
10692 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
10693 * data/glr.c, data/lalr1.cc, data/yacc.c:
10694 Output token definitions before the first part of user declarations.
10695 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 10696 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 10697
ff6dca18
PE
106982002-10-11 Paul Eggert <eggert@twinsun.com>
10699
10700 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
10701 (yyparse): here. This undoes some of the 2002-07-25 change.
10702 Compatibility problem reported by Ralf S. Engelschall with
10703 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
10704
eb714592
AD
107052002-10-11 Akim Demaille <akim@epita.fr>
10706
10707 * tests/regression.at Characters Escapes): New.
10708 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
10709 characters.
10710 Reported by Jan Nieuwenhuizen.
10711
b7195100
AD
107122002-10-11 Akim Demaille <akim@epita.fr>
10713
10714 * po/id.po: New.
10715
f28a0f2d
PE
107162002-10-10 Paul Eggert <eggert@twinsun.com>
10717
10718 Portability fixes for bitsets; this also avoids several GCC
10719 warnings.
10720
10721 * lib/abitset.c: Include <stddef.h>, for offsetof.
10722 * lib/lbitset.c: Likewise.
10723
10724 * lib/abitset.c (abitset_bytes): Return a size that is aligned
10725 properly for vectors of objects. Do not assume that adding a
10726 header size to a multiple of a word size yields a value that is
10727 properly aligned for the whole union.
10728 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10729
10730 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
10731 unique names for structures.
10732 * lib/ebitset.c (ebitset_bytes): Likewise.
10733 * lib/lbitset.c (lbitset_bytes): Likewise.
10734
10735 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
10736 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
10737 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
10738 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
10739 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
10740 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
10741 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
10742 to improve the type-checking that GCC can do.
10743 * lib/bitset.c (bitset_op4_cmp): Likewise.
10744 * lib/bitset_stats.c (bitset_stats_count,
10745 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
10746 bitset_stats_copy, bitset_stats_disjoint_p,
10747 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
10748 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
10749 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
10750 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
10751 bitset_stats_and_or_cmp, bitset_stats_andn_or,
10752 bitset_stats_andn_or_cmp, bitset_stats_or_and,
10753 bitset_stats_or_and_cmp): Likewise.
10754 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
10755 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
10756 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
10757 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
10758
10759 * lib/abitset.h: Include bitset.h, not bbitset.h.
10760 * lib/ebitset.h: Likewise.
10761 * lib/lbitset.h: Likewise.
10762
10763 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
10764 All instances of parameters of type enum bitset_opts are now of
10765 type enum_bitset_opts, to conform to the C Standard, and similarly
10766 for enum_bitset_type.
10767 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10768 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10769
10770 Do not use "struct bitset_struct" to mean different things in
10771 different modules. Not only is this confusing, it violates
10772 the C Standard, which requires that structure types in different
10773 modules must be compatible if one is to be passed to the other.
10774 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
10775 All instances of "struct bitset_struct *" replaced with "bitset".
10776 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
10777 (union bitset_union, struct abitset_struct, struct ebitset_struct,
10778 struct lbitset_struct, struct bitset_stats_struct): New types.
10779 All uses of struct bitset_struct changed to union bitset_union,
10780 etc.
ba0fe3c7 10781 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
10782 struct bitset_struct): Remove.
10783 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
10784 struct bitset_struct): Remove.
10785 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
10786 bitset_struct): Remove.
10787 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
10788 Likewise.
10789
10790 Do not call a function of type T using a call that assumes the
10791 function is of a different type U. Standard C requires that a
10792 function must be called with a type that is compatible with its
10793 definition.
10794 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10795 New decls.
10796 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10797 New functions.
10798 * lib/ebitset.c (PFV): Remove.
10799 * lib/lbitset.c (PFV): Likewise.
10800 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
10801 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
10802 decls.
10803 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
10804 (ebitset_vtable): Use them.
10805 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
10806 lbitset_xor): New functions.
10807 (lbitset_vtable): Use them.
10808
10809 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
10810 Declare.
10811
10812 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
10813 GCC warning.
10814 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
10815 Use offsetof, for simplicity.
10816
6fbe4984
PE
108172002-10-06 Paul Eggert <eggert@twinsun.com>
10818
10819 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
10820 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 10821 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
10822 which was inadvertently undone by the 2002-09-30 patch.
10823 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
10824 the same width as int.
10825
420f93c8
PE
108262002-10-04 Paul Eggert <eggert@twinsun.com>
10827
10828 Version 1.50.
10829
10830 * configure.ac (AC_INIT), NEWS: Increment version number.
10831
10832 * doc/bison.texinfo: Minor spelling, grammar, and white space
10833 fixes.
10834 (Symbols): Mention that any negative value returned from yylex
10835 signifies end-of-input. Warn about negative chars. Mention
10836 the portable Standard C character set.
10837
10838 The GNU coding standard says CFLAGS and YFLAGS are reserved
10839 for the installer to set.
10840 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
10841 * src/Makefile.am (AM_CFLAGS): Likewise.
10842 (AM_YFLAGS): Renamed from YFLAGS.
10843
10844 Fix some MAX and MIN problems.
10845 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
10846 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
10847 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
10848 * src/reader.c (reader): Use it.
10849
10850 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
10851 POSIX 1003.1-2001 has removed fgrep.
10852
108532002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
10854
10855 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
10856 interpreted as signed.
10857 * lib/ebitset.c (ebitset_list): Fix bug.
10858
ff68026d
PE
108592002-10-01 Paul Eggert <eggert@twinsun.com>
10860
10861 More fixes for 64-bit hosts and large bitsets.
10862
10863 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
10864 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
10865 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
10866 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
10867 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
10868 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
10869 bitset_count_): Likewise.
10870 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
10871 bitset_first, bitset_last): Likewise.
10872 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
10873 bitset_stats_list_reverse, bitset_stats_size,
10874 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
10875 Likewise.
10876 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10877 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10878 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10879 bitsetv_reflexive_transitive_closure): Likewise.
10880 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
10881 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
10882 Likewise.
10883 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
10884 Likewise.
420f93c8 10885
ff68026d
PE
10886 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
10887 Use size_t, not unsigned int, to count bytes.
10888 * lib/abitset.h (abitset_bytes): Likewise.
10889 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
10890 Likewise.
10891 * lib/bitset.h (bitset_bytes): Likewise.
10892 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
10893 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
10894 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10895 * lib/ebitset.c (ebitset_bytes): Likewise.
10896 * lib/ebitset.h (ebitset_bytes): Likewise.
10897 * lib/lbitset.c (lbitset_bytes): Likewise.
10898 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 10899
ff68026d
PE
10900 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
10901 abitset_subset_p, abitset_disjoint_p, abitset_and,
10902 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
10903 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
10904 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
10905 abitset_or_and, abitset_or_and_cmp):
10906 Use bitset_windex instead of unsigned int.
10907 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10908 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
10909 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
10910 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
10911 Likewise.
10912 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 10913
ff68026d
PE
10914 * lib/bitset.c (bitset_print):
10915 Use proper printf formats for widths of integer types.
10916 * lib/bitset_stats.c (bitset_percent_histogram_print,
10917 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
10918 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10919 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10920 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 10921
ff68026d
PE
10922 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
10923 BITSET_SIZE_MAX): New macros.
10924 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
10925 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
10926 to BITSET_WINDEX_MAX.
10927
10928 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
10929 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
10930 since we now return the bitset_bindex type (not int).
10931
10932 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
10933 when computing sizes.
10934 * lib/ebitset.c (ebitset_elts_grow): Likewise.
10935
10936 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
10937 and avoid cast to unsigned.
10938
6aa452a6
AD
109392002-09-30 Akim Demaille <akim@epita.fr>
10940
10941 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10942 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
10943 Updates from Michael Hayes.
10944
927f7817
AD
109452002-09-30 Art Haas <ahaas@neosoft.com>
10946
10947 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
10948 invocations.
10949 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
10950 defined.
10951
9738f41e
AD
109522002-09-27 Akim Demaille <akim@epita.fr>
10953
10954 Version 1.49c.
10955
a5c75d7f
AD
109562002-09-27 Akim Demaille <akim@epita.fr>
10957
10958 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
10959 (Because of AC_LIBSOURCE).
10960
8280e179
AD
109612002-09-27 Akim Demaille <akim@epita.fr>
10962
10963 Playing with Autoscan.
10964
10965 * configure.ac: Remove the old LIBOBJ tweaks.
10966 (AC_REPLACE_FUNCS): Add strrchr and strtol.
10967 * lib/strrchr.c: New.
10968 * lib/strtol.c: New, from the Coreutils 4.5.1.
10969
ae64af35
AD
109702002-09-27 Akim Demaille <akim@epita.fr>
10971
10972 Playing with Autoscan.
10973
10974 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
10975 * lib/Makefile.am (libbison_a_SOURCES): No longer include
10976 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
10977 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
10978 Coreutils 4.5.1.
10979
d1a1114f
AD
109802002-09-24 Akim Demaille <akim@epita.fr>
10981
10982 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
10983 (Frequently Asked Questions, Parser Stack Overflow): New.
10984
b906441c
AD
109852002-09-13 Akim Demaille <akim@epita.fr>
10986
10987 Playing with autoscan.
10988
10989 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
10990 * src/files.c (skeleton_find): Remove, unused.
10991 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
10992 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
10993
bd701811
AD
109942002-09-13 Akim Demaille <akim@epita.fr>
10995
10996 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
10997 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
10998
e0a13e7b
AD
109992002-09-13 Akim Demaille <akim@epita.fr>
11000
11001 * configure.ac: Require 2.54.
11002 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
11003 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
11004 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
11005 Remove, provided by Autoconf macros.
11006
c97011bf
AD
110072002-09-12 Akim Demaille <akim@epita.fr>
11008
11009 * m4/prereq.m4: Update, from Coreutils 4.5.1.
11010
d862b1be
AD
110112002-09-12 Akim Demaille <akim@epita.fr>
11012
11013 * m4/prereq.m4: Update, from Fileutils 4.1.5.
11014 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
11015 Reported by Martin Mokrejs.
11016
3d38c03a
AD
110172002-09-10 Akim Demaille <akim@epita.fr>
11018
11019 * src/parse-gram.y: Associate a human readable string to each
11020 token type.
11021 * tests/regression.at (Invalid inputs): Adjust.
11022
b6347355
AD
110232002-09-10 Gary V. Vaughan <gary@gnu.org>
11024
11025 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
11026 with an Autoconf-2.5x style configure.ac.
11027
09ba4ab2
PE
110282002-09-06 Paul Eggert <eggert@twinsun.com>
11029
11030 * doc/bison.texinfo (Conditions): Make explicit that the GPL
11031 exception applies only to yacc.c. This is a modification of a
11032 patch originally suggested by Akim Demaille.
11033
21846f69
AD
110342002-09-06 Akim Demaille <akim@epita.fr>
11035
09ba4ab2
PE
11036 * data/c.m4 (b4_copyright): Move the GPL exception comment from
11037 here to...
11038 * data/yacc.c: here.
11039
21846f69
AD
11040 * data/lalr1.cc (struct yyltype): Don't define it, since we use
11041 LocationType.
11042 (b4_ltype): Default to yy::Location from location.hh.
11043
c0ad8bf3
AD
110442002-09-04 Jim Meyering <jim@meyering.net>
11045
11046 * data/yacc.c: Guard the declaration of yytoknum also with
11047 `#ifdef YYPRINT', so it is declared only when used.
11048
3a93251e
AD
110492002-09-04 Akim Demaille <akim@epita.fr>
11050
11051 * configure.in: Rename as...
11052 * configure.ac: this.
11053 Bump to 1.49c.
11054
427c0dda
AD
110552002-09-04 Akim Demaille <akim@epita.fr>
11056
11057 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
11058 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
11059 translate maintainer only messages.
11060
6a254321
PE
110612002-08-12 Paul Eggert <eggert@twinsun.com>
11062
645e30d1
PE
11063 Version 1.49b.
11064
6a254321
PE
11065 * Makefile.am (SUBDIRS): Remove intl.
11066 (DISTCLEANFILES): Remove.
11067 * NEWS: Mention that GNU M4 is now required. Clarify what is
11068 meant by "larger grammars". Mention the pt_BR translation.
11069 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
11070 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
11071 Bump version from 0.11.2 to 0.11.5.
11072 (BISON_PREREQ_STAGE): Remove.
11073 (AM_GNU_GETTEXT): Use external gettext.
11074 (AC_OUTPUT): Remove intl/Makefile.
11075
11076 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
11077
11078 * data/glr.c: Include string.h, for strlen.
11079 (yyreportParseError): Use size_t for yysize.
11080 (yy_yypstack): No longer nested inside yypstates, as nested
11081 functions are not portable. Do not assume size_t is the
11082 same width as int.
11083 (yypstates): Do not assume that ptrdiff_t is the same width
11084 as int, and similarly for yyposn and YYINDEX.
11085
11086 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
11087
11088 * lib/Makefile.am (INCLUDES): Do not include from the intl
11089 directory, which has been removed.
11090 * src/Makefile.am (INCLUDES): Likewise.
11091
11092 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
11093 (bitsets_sources, additional_bitsets_sources, timevars_sources):
11094 New vars.
11095
11096 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
11097 * tests/Makefile.am (EXTRA_DIST): Likewise.
11098
11099 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
11100 Do not assume that bitset_windex is the same width as unsigned.
11101
11102 * lib/abitset.c (abitset_unused_clear): Do not assume that
11103 bitset_word is the same width as int.
11104 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
11105 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
11106 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
11107 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
11108 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
11109
11110 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
11111 portability to one's complement hosts!).
11112 * lib/ebitset.c (ebitset_op1): Likewise.
11113 * lib/lbitset.c (lbitset_op1): Likewise.
11114
11115 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
11116 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11117 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
11118 Sync with fileutils.
11119 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
11120 lib/gettext.h: Sync with diffutils.
11121
11122 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
11123 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
11124
11125 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
11126 PROTOTYPES to check for prototypes, and "defined __STDC__" to
11127 check for void *.
11128
11129 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
11130 size_t; the old version tried to do this but casted improperly.
11131 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
11132 (bitset_test): Now returns int, not unsigned long.
11133
11134 * lib/bitset_stats.c: Include "gettext.h".
11135 (_): New macro.
11136 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
11137 name locals "index", as it generates unnecessary warnings on some
11138 hosts that have an "index" function.
11139
11140 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
11141 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
11142 they need translation.
11143 * src/LR0.c (state_list_append, new_itemsets, get_state,
11144 append_states, generate_states): Likewise.
11145 * src/assoc.c (assoc_to_string): Likewise.
11146 * src/closure.c (print_closure, set_firsts, closure): Likewise.
11147 * src/gram.c (grammar_dump): Likewise.
11148 * src/injections.c (injections_compute): Likewise.
11149 * src/lalr.c (lookaheads_print): Likewise.
11150 * src/relation.c (relation_transpose): Likewise.
11151 * src/scan-gram.l: Likewise.
11152 * src/tables.c (table_grow, pack_vector): Likewise.
11153
11154 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
11155 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
11156 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
11157 * m4/mbstate_t.m4: Sync with fileutils.
11158 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
11159
11160 * po/LINGUAS: Add pt_BR.
11161 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
11162 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
11163 lib/timevar.c.
11164 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
11165 manual recommends.
11166 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
11167
11168 * src/complain.c (strerror_r): Remove decl; not needed.
11169 (strerror): Use same pattern as ../lib/error.c.
11170
11171 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
11172
11173 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
11174
11175 * src/main.c (main): Cast result of bindtextdomain and textdomain
11176 to void, to avoid a GCC warning when --disable-nls is in effect.
11177
11178 * src/scan-gram.l: Use strings rather than escapes when possible,
11179 to minimize the number of warnings from xgettext.
11180 (handle_action_dollar, handle_action_at): Don't use isdigit,
11181 as it mishandles negative chars and it may not work as expected
11182 outside the C locale.
11183
11184 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
11185 this is a GCC extension and is not portable to other compilers.
11186
11187 * src/system.h (alloca): Use same pattern as ../lib/error.c.
11188 Do not include <ctype.h>; no longer needed.
11189 Do not include <malloc.h>; no longer needed (and generates
11190 warnings on OpenBSD 3.0).
11191
11192 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
11193 it's not portable.
11194
11195 * tests/regression.at: Do not use 'cc -c input.c -o input';
11196 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
11197
11198 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
11199 exit status as failure, not just exit status 1. Sun C exits
11200 with status 2 sometimes.
11201
11202 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
11203 Use it for the two large tests.
11204
c8f002c7
AD
112052002-08-02 Akim Demaille <akim@epita.fr>
11206
11207 * src/conflicts.c (conflicts_output): Don't output rules never
11208 reduced here, since anyway that computation doesn't work.
11209 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
11210 (rule_useless_p, rule_never_reduced_p): New.
11211 (grammar_rules_partial_print): Use a filter instead of a range.
11212 Display the title only if needed.
11213 (grammar_rules_print): Adjust.
11214 (grammar_rules_never_reduced_report): New.
11215 * src/tables.c (action_row): Move the computation of rules never
11216 reduced to...
11217 (token_actions): here.
11218 * src/main.c (main): Make the parser before making the report, so
11219 that rules never reduced are computed.
11220 Call grammar_rules_never_reduced_report.
11221 * src/print.c (print_results): Report rules never reduced.
11222 * tests/conflicts.at, tests/reduce.at: Adjust.
11223
cd08e51e
AD
112242002-08-01 Akim Demaille <akim@epita.fr>
11225
11226 Instead of attaching lookaheads and duplicating the rules being
11227 reduced by a state, attach the lookaheads to the reductions.
11228
11229 * src/state.h (state_t): Remove the `lookaheads',
11230 `lookaheads_rule' member.
11231 (reductions_t): Add a `lookaheads' member.
11232 Use a regular array for the `rules'.
11233 * src/state.c (reductions_new): Initialize the lookaheads member
11234 to 0.
11235 (state_rule_lookaheads_print): Adjust.
11236 * src/state.h, src/state.c (state_reductions_find): New.
11237 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
11238 (count_rr_conflicts): Adjust.
11239 * src/lalr.c (LArule): Remove.
11240 (add_lookback_edge): Adjust.
11241 (state_lookaheads_count): New.
11242 (states_lookaheads_initialize): Merge into...
11243 (initialize_LA): this.
11244 (lalr_free): Adjust.
11245 * src/main.c (main): Don't free nullable and derives too early: it
11246 is used by --verbose.
11247 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
11248
bb0027a9
AD
112492002-08-01 Akim Demaille <akim@epita.fr>
11250
11251 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
11252 `rule_number_t**'.
11253 (set_derives, free_derives): Rename as...
11254 (derives_compute, derives_free): this.
11255 Adjust all dependencies.
11256 * src/nullable.c (set_nullable, free_nullable): Rename as...
11257 (nullable_compute, nullable_free): these.
11258 (rule_list_t): Store rule_t *, not rule_number_t.
11259 * src/state.c (state_rule_lookaheads_print): Directly compare rule
11260 pointers, instead of their numbers.
11261 * src/main.c (main): Call nullable_free, and derives_free earlier,
11262 as they were lo longer used.
11263
3325ddc4
AD
112642002-08-01 Akim Demaille <akim@epita.fr>
11265
11266 * lib/timevar.c (get_time): Include children time.
11267 * src/lalr.h (LA, LArule): Don't export them: used with the
11268 state_t.
11269 * src/lalr.c (LA, LArule): Static.
11270 * src/lalr.h, src/lalr.c (lalr_free): New.
11271 * src/main.c (main): Call it.
11272 * src/tables.c (pack_vector): Check whether loc is >= to the
11273 table_size, not >.
11274 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
11275 (tables_generate): do it, since that's also it which allocates
11276 them.
11277 Don't free LA and LArule, main does.
11278
c6f1a33c
AD
112792002-07-31 Akim Demaille <akim@epita.fr>
11280
11281 Separate parser tables computation and output.
11282
11283 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
11284 (conflict_list, conflict_list_cnt, table, check, table_ninf)
11285 (yydefgoto, yydefact, high): Move to...
11286 * src/tables.h, src/tables.c: here.
11287 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11288 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11289 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
11290 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
11291 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
11292 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
11293 (action_row, save_row, token_actions, save_column, default_goto)
11294 (goto_actions, sort_actions, matching_state, pack_vector)
11295 (table_ninf_remap, pack_table, prepare_actions): Move to...
11296 * src/tables.c: here.
11297 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
11298 * src/output.c (token_actions, output_base, output_conflicts)
11299 (output_check): Merge into...
11300 (prepare_actions): this.
11301 (actions_output): Rename as...
11302 (user_actions_output): this.
11303 * src/main.c (main): Call tables_generate and tables_free.
11304
1509d42f
AD
113052002-07-31 Akim Demaille <akim@epita.fr>
11306
11307 Steal GCC's --time-report support.
11308
11309 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
11310 stolen/adjusted from GCC.
11311 * m4/stage.m4: Remove time related checks.
11312 * m4/timevar.m4: New.
11313 * configure.in: Adjust.
11314 * src/system.h: Adjust to using timevar.h.
11315 * src/getargs.h, src/getargs.c: Support trace_time for
11316 --trace=time.
11317 * src/main.c (stage): Remove.
11318 (main): Replace `stage' invocations with timevar calls.
11319 * src/output.c: Insert pertinent timevar calls.
11320
273a74fa
AD
113212002-07-31 Akim Demaille <akim@epita.fr>
11322
11323 Let --trace have arguments.
11324
11325 * src/getargs.h (enum trace_e): New.
11326 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
11327 (long_options, short_options): --trace/-T takes an optional
11328 argument.
11329 Change all the uses of trace_flag to reflect the new flags.
11330 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
11331
11332 Strengthen `stage' portability.
11333
11334 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
11335 * configure.in: Use it.
11336 Don't check for malloc.h and sys/times.h.
11337 * src/system.h: Include them when appropriate.
11338 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
11339 times and struct tms are available.
11340
217598da
AD
113412002-07-30 Akim Demaille <akim@epita.fr>
11342
11343 In verbose parse error message, don't report `error' as an
11344 expected token.
11345 * tests/actions.at (Printers and Destructors): Adjust.
11346 * tests/calc.at (Calculator $1): Adjust.
11347 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
11348 error message, do not report the parser accepts the error token in
11349 that state.
11350
52489d44
AD
113512002-07-30 Akim Demaille <akim@epita.fr>
11352
11353 Normalize conflict related messages.
11354
11355 * src/complain.h, src/complain.c (warn, complain): New.
11356 * src/conflicts.c (conflicts_print): Use them.
11357 (conflict_report_yacc): New, extracted from...
11358 (conflicts_print): here.
11359 * tests/conflicts.at, tests/existing.at: Adjust.
11360
e8832397
AD
113612002-07-30 Akim Demaille <akim@epita.fr>
11362
11363 Report rules which are never reduced by the parser: those hidden
11364 by conflicts.
11365
11366 * src/LR0.c (save_reductions): Don't make the final state too
11367 different: save its reduction (accept) instead of having a state
11368 without any action (no shift or goto, no reduce).
11369 Note: the final state is now a ``regular'' state, i.e., the
11370 parsers now contain `reduce 0' as default reduction.
11371 Nevertheless, since they decide to `accept' when yystate =
11372 final_state, they still will not reduce rule 0.
11373 * src/print.c (print_actions, print_reduction): Adjust.
11374 * src/output.c (action_row): Track reduced rules.
11375 (token_actions): Report rules never reduced.
11376 * tests/conflicts.at, tests/regression.at: Adjust.
11377
caf23d24
AD
113782002-07-30 Akim Demaille <akim@epita.fr>
11379
11380 `stage' was accidently included in a previous patch.
11381 Initiate its autoconfiscation.
11382
11383 * configure.in: Look for malloc.h and sys/times.h.
11384 * src/main.c (stage): Adjust.
11385 Report only when trace_flag.
11386
640748ee
AD
113872002-07-29 Akim Demaille <akim@epita.fr>
11388
11389 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
11390 state_number_t.
11391 (errs_t): symbol_t*, not symbol_number_t.
11392 (reductions_t): rule_t*, not rule_number_t.
11393 (FOR_EACH_SHIFT): New.
11394 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
11395 * src/print.c, src/print_graph.c: Adjust.
11396
88bce5a2
AD
113972002-07-29 Akim Demaille <akim@epita.fr>
11398
11399 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
11400
11401 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
11402 (endtoken, accept): these.
11403 * src/reader.c (reader): Set endtoken's default tag to "$end".
11404 Set undeftoken's tag to "$undefined" instead of "$undefined.".
11405 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
11406 Adjust.
11407
1bfb97db
AD
114082002-07-29 Akim Demaille <akim@epita.fr>
11409
11410 * src/reduce.c (reduce_grammar): When the language is empty,
11411 complain about the start symbol, not the axiom.
11412 Use its location.
11413 * tests/reduce.at (Empty Language): New.
11414
fc5734fe
AD
114152002-07-26 Akim Demaille <akim@epita.fr>
11416
11417 * src/reader.h, src/reader.c (gram_error): ... can't get
11418 yycontrol without making too strong assumptions on the parser
11419 itself.
11420 * src/output.c (prepare_tokens): Use the real 0th value of
11421 token_translations instead of `0'.
11422 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
11423 visible here.
11424 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
11425 for the time being: %locations ought to provide it to yyerror.
11426
3650b4b8
AD
114272002-07-25 Akim Demaille <akim@epita.fr>
11428
11429 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
11430 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
11431 * tests/regression.at (Web2c Actions): Adjust.
11432
4b3d3a8e
AD
114332002-07-25 Akim Demaille <akim@epita.fr>
11434
11435 Stop storing rules from 1 to nrules + 1.
11436
11437 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
11438 * src/nullable.c, src/output.c, src/print.c, src/reader.c
11439 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
11440 Iterate from 0 to nrules.
11441 Use rule_number_as_item_number and item_number_as_rule_number.
11442 Adjust to `derive' now containing possibly 0.
11443 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
11444 Handle the `- 1' part in rule numbers from/to item numbers.
11445 * src/conflicts.c (log_resolution): Fix the message which reversed
11446 shift and reduce.
11447 * src/output.c (action_row): Initialize default_rule to -1.
11448 (token_actions): Adjust.
11449 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
11450 expected output.
11451 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
11452
4a2a22f4
AD
114532002-07-25 Akim Demaille <akim@epita.fr>
11454
11455 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
11456 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
11457 (b4_c_knr_arg_decl): New.
11458 * data/yacc.c: Use it to define yysymprint, yydestruct, and
11459 yyreport_parse_error.
11460
b8df3223
AD
114612002-07-25 Akim Demaille <akim@epita.fr>
11462
11463 * data/yacc.c (yyreport_parse_error): New, extracted from...
11464 (yyparse): here.
11465 (yydestruct, yysymprint): Move above yyparse.
11466 Be K&R compliant.
11467
a762e609
AD
114682002-07-25 Akim Demaille <akim@epita.fr>
11469
11470 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
11471 replace...
11472 (b4_sint_type, b4_uint_type): these.
11473 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
11474 * tests/regression.at (Web2c Actions): Adjust.
11475
12b0043a
AD
114762002-07-25 Akim Demaille <akim@epita.fr>
11477
11478 * src/gram.h (TIEM_NUMBER_MAX): New.
11479 (item_number_of_rule_number, rule_number_of_item_number): Rename
11480 as...
11481 (rule_number_as_item_number, item_number_as_rule_number): these.
11482 Adjust dependencies.
11483 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11484 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11485 (symbol_number_to_vector_number): New.
11486 (order): Of vector_number_t* type.
11487 (base_t, BASE_MAX, BASE_MIN): New.
11488 (froms, tos, width, pos, check): Of base_t type.
11489 (action_number_t, ACTION_MIN, ACTION_MAX): New.
11490 (actrow): Of action_number_t type.
11491 (conflrow): Of unsigned int type.
11492 (table_ninf, base_ninf): New.
11493 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
11494 (muscle_insert_int_table, muscle_insert_base_table)
11495 (muscle_insert_rule_number_table): New.
11496 (prepare_tokens): Output `toknum' as int_table.
11497 (action_row): Returns a rule_number_t.
11498 Use ACTION_MIN, not SHRT_MIN.
11499 (token_actions): yydefact is rule_number_t*.
11500 (table_ninf_remap): New.
11501 (pack_table): Use it for `base' and `table'.
11502 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
11503 replaced with...
11504 (YYPACT_NINF, YYTABLE_NINF): these.
11505 (yypact, yytable): Compute their types instead of hard-coded
11506 `short'.
11507 * tests/regression.at (Web2c Actions): Adjust.
11508
5dde258a
AD
115092002-07-19 Akim Demaille <akim@epita.fr>
11510
11511 * src/scan-gram.l (id): Can start with an underscore.
11512
a945ec39
AD
115132002-07-16 Akim Demaille <akim@epita.fr>
11514
11515 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
11516 Adjust all former `associativity' dependencies.
11517 * src/symtab.c (symbol_new): Default associativity is `undef', not
11518 `right'.
11519 (symbol_check_alias_consistence): Adjust.
11520
fae437e8
AD
115212002-07-09 Akim Demaille <akim@epita.fr>
11522
11523 * doc/bison.texinfo: Properly set the ``header'' part.
11524 Use @dircategory ``GNU programming tools'' as per Texinfo's
11525 documentation.
11526 Use @copying.
11527
1a715ef2
AD
115282002-07-09 Akim Demaille <akim@epita.fr>
11529
11530 * lib/quotearg.h: Protect against multiple inclusions.
11531 * src/location.h (location_t): Add a `file' member.
11532 (LOCATION_RESET, LOCATION_PRINT): Adjust.
11533 * src/complain.c (warn_at, complain_at, fatal_at): Drop
11534 `error_one_per_line' support.
11535
a5d50994
AD
115362002-07-09 Akim Demaille <akim@epita.fr>
11537
11538 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
11539 * src/reader.c (lineno): Remove.
11540 Adjust all dependencies.
11541 (get_merge_function): Take a location and use complain_at.
11542 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
11543 * tests/regression.at (Invalid inputs, Mixing %token styles):
11544 Adjust.
11545
b275314e
AD
115462002-07-09 Akim Demaille <akim@epita.fr>
11547
11548 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
11549 recovery rule, and forbid extensions when --yacc.
11550 (gram_error): Use complain_at.
11551 * src/reader.c (reader): Exit if there were parse errors.
11552
865b9df1
AD
115532002-07-09 Akim Demaille <akim@epita.fr>
11554
11555 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
11556 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
11557 Reported by R Blake <blakers@mac.com>.
11558
c76e14da
AD
115592002-07-09 Akim Demaille <akim@epita.fr>
11560
11561 * data/yacc.c: Output the copyright notive in the header.
11562
7db2ed2d
AD
115632002-07-03 Akim Demaille <akim@epita.fr>
11564
11565 * src/output.c (froms, tos): Are state_number_t.
11566 (save_column): sp, sp1, and sp2 are state_number_t.
11567 (prepare): Rename `final' as `final_state_number', `nnts' as
11568 `nterms_number', `nrules' as `rules_number', `nstates' as
11569 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
11570 unused.
11571 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
11572 * data/lalr1.cc (nsym_): Remove, unused.
11573
e68e0410
AD
115742002-07-03 Akim Demaille <akim@epita.fr>
11575
11576 * src/lalr.h, src/lalr.c (goto_number_t): New.
11577 * src/lalr.c (goto_list_t): New.
11578 Propagate them.
11579 * src/nullable.c (rule_list_t): New.
11580 Propagate.
11581 * src/types.h: Remove.
11582
e1a4f3a4
AD
115832002-07-03 Akim Demaille <akim@epita.fr>
11584
11585 * src/closure.c (print_fderives): Use rule_rhs_print.
11586 * src/derives.c (print_derives): Use rule_rhs_print.
11587 (rule_list_t): New, replaces `shorts'.
11588 (set_derives): Add comments.
11589 * tests/sets.at (Nullable, Firsts): Adjust.
11590
536545f3
AD
115912002-07-03 Akim Demaille <akim@epita.fr>
11592
11593 * src/output.c (prepare_actions): Free `tally' and `width'.
11594 (prepare_actions): Allocate and free `order'.
11595 * src/symtab.c (symbols_free): Free `symbols'.
11596 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
11597 * src/output.c (m4_invoke): Move to...
11598 * src/scan-skel.l: here.
11599 (<<EOF>>): Close yyout, and free its name.
11600
8b752b00
AD
116012002-07-03 Akim Demaille <akim@epita.fr>
11602
11603 Fix some memory leaks, and fix a bug: state 0 was examined twice.
11604
11605 * src/LR0.c (new_state): Merge into...
11606 (state_list_append): this.
11607 (new_states): Merge into...
11608 (generate_states): here.
11609 (set_states): Don't ensure a proper `errs' state member here, do it...
11610 * src/conflicts.c (conflicts_solve): here.
11611 * src/state.h, src/state.c: Comment changes.
11612 (state_t): Rename member `shifts' as `transitions'.
11613 Adjust all dependencies.
11614 (errs_new): For consistency, also take the values as argument.
11615 (errs_dup): Remove.
11616 (state_errs_set): New.
11617 (state_reductions_set, state_transitions_set): Assert that no
11618 previous value was assigned.
11619 (state_free): New.
11620 (states_free): Use it.
11621 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
11622 temporary storage: use `errs' and `nerrs' as elsewhere.
11623 (set_conflicts): Allocate and free this `errs'.
11624
613f5e1a
AD
116252002-07-02 Akim Demaille <akim@epita.fr>
11626
11627 * lib/libiberty.h: New.
11628 * lib: Update the bitset implementation from upstream.
11629 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
11630 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
11631 * src/main.c: Adjust bitset stats calls.
11632
26e0cadc
PE
116332002-07-01 Paul Eggert <eggert@twinsun.com>
11634
11635 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
11636 char, so that negative chars don't collide with $.
11637
1154cced
AD
116382002-06-30 Akim Demaille <akim@epita.fr>
11639
11640 Have the GLR tests be `warning' checked, and fix the warnings.
11641
11642 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
11643 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
11644 (yyremoveDeletes): `yyi' and `yyj' are size_t.
11645 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
11646 (yyaddDeferredAction): static.
11647 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
11648 (yyreportParseError): yyprefix is const.
11649 yytokenp is used only when verbose.
11650 (yy__GNUC__): Replace with __GNUC__.
11651 (yypdumpstack): yyi is size_t.
11652 (yypreference): Un-yy local variables and arguments, to avoid
11653 clashes with `yyr1'. Anyway, we are not in the user name space.
11654 (yytname_size): be an int, as is compared with ints.
11655 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
11656 Use them.
11657 * tests/cxx-gram.at: Use quotation to protect $1.
11658 Use AT_COMPILE to enable warnings hunts.
11659 Prototype yylex and yyerror.
11660 `Use' argc.
11661 Include `string.h', not `strings.h'.
11662 Produce and prototype stmtMerge only when used.
11663 yylex takes a location.
11664
97650f4e
AD
116652002-06-30 Akim Demaille <akim@epita.fr>
11666
11667 We spend a lot of time in quotearg, in particular when --verbose.
11668
11669 * src/symtab.c (symbol_get): Store a quoted version of the key.
11670 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
11671 Adjust all callers.
11672
d2576365
AD
116732002-06-30 Akim Demaille <akim@epita.fr>
11674
11675 * src/state.h (reductions_t): Rename member `nreds' as num.
11676 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
11677 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
11678
ccaf65bc
AD
116792002-06-30 Akim Demaille <akim@epita.fr>
11680
11681 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
11682 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
11683 (shifts_to): Rename as...
11684 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
11685 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
11686 (TRANSITION_IS_DISABLED, transitions_to): these.
11687
87675353
AD
116882002-06-30 Akim Demaille <akim@epita.fr>
11689
11690 * src/print.c (print_shifts, print_gotos): Merge into...
11691 (print_transitions): this.
11692 (print_transitions, print_errs, print_reductions): Align the
11693 lookaheads columns.
11694 (print_core, print_transitions, print_errs, print_state,
11695 print_grammar): Output empty lines separator before, not after.
11696 (state_default_rule_compute): Rename as...
11697 (state_default_rule): this.
11698 * tests/conflicts.at (Defaulted Conflicted Reduction),
11699 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
11700 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
11701
ce4ccb4b
AD
117022002-06-30 Akim Demaille <akim@epita.fr>
11703
11704 Display items as we display rules.
11705
11706 * src/gram.h, src/gram.c (rule_lhs_print): New.
11707 * src/gram.c (grammar_rules_partial_print): Use it.
11708 * src/print.c (print_core): Likewise.
11709 * tests/conflicts.at (Defaulted Conflicted Reduction),
11710 (Unresolved SR Conflicts): Adjust.
11711 (Unresolved SR Conflicts): Adjust and rename as...
11712 (Resolved SR Conflicts): this, as was meant.
11713 * tests/regression.at (Web2c Report): Adjust.
11714
bc933ef1
AD
117152002-06-30 Akim Demaille <akim@epita.fr>
11716
11717 * src/print.c (state_default_rule_compute): New, extracted from...
11718 (print_reductions): here.
11719 Pessimize, but clarify the code.
11720 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
11721
53d4308d
AD
117222002-06-30 Akim Demaille <akim@epita.fr>
11723
11724 * src/output.c (action_row): Let default_rule be always a rule
11725 number.
11726
574fb2d5
AD
117272002-06-30 Akim Demaille <akim@epita.fr>
11728
11729 * src/closure.c (print_firsts, print_fderives, closure):
11730 Use BITSET_EXECUTE.
11731 * src/lalr.c (lookaheads_print): Likewise.
11732 * src/state.c (state_rule_lookaheads_print): Likewise.
11733 * src/print_graph.c (print_core): Likewise.
11734 * src/print.c (print_reductions): Likewise.
11735 * src/output.c (action_row): Likewise.
11736 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
11737
05811fd7
AD
117382002-06-30 Akim Demaille <akim@epita.fr>
11739
11740 * src/print_graph.c: Use report_flag.
11741
0e4d5753
AD
117422002-06-30 Akim Demaille <akim@epita.fr>
11743
11744 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
11745 to...
11746 * src/relation.h, src/relation.c (traverse, relation_digraph)
11747 (relation_print, relation_transpose): New.
11748
24c7d800
AD
117492002-06-30 Akim Demaille <akim@epita.fr>
11750
11751 * src/state.h, src/state.c (shifts_to): New.
11752 * src/lalr.c (build_relations): Use it.
11753
9222837b
AD
117542002-06-30 Akim Demaille <akim@epita.fr>
11755
11756 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
11757 (item_number_of_rule_number, rule_number_of_item_number): New.
11758 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
11759 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
11760 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
11761 Propagate their use.
11762 Much remains to be done, in particular wrt `shorts' from types.h.
11763
260008e5
AD
117642002-06-30 Akim Demaille <akim@epita.fr>
11765
11766 * src/symtab.c (symbol_new): Initialize the `printer' member.
11767
8a731ca8
AD
117682002-06-30 Akim Demaille <akim@epita.fr>
11769
11770 * src/LR0.c (save_reductions): Remove, replaced by...
11771 * src/state.h, src/state.c (state_reductions_set): New.
11772 (reductions, errs): Rename as...
11773 (reductions_t, errs_t): these.
11774 Adjust all dependencies.
11775
32e1e0a4
AD
117762002-06-30 Akim Demaille <akim@epita.fr>
11777
11778 * src/LR0.c (state_list_t, state_list_append): New.
11779 (first_state, last_state): Now symbol_list_t.
11780 (this_state): Remove.
11781 (new_itemsets, append_states, save_reductions): Take a state_t as
11782 argument.
11783 (set_states, generate_states): Adjust.
11784 (save_shifts): Remove, replaced by...
11785 * src/state.h, src/state.c (state_shifts_set): New.
11786 (shifts): Rename as...
11787 (shifts_t): this.
11788 Adjust all dependencies.
11789 * src/state.h (state_t): Remove the `next' member.
11790
e5fb6710
AD
117912002-06-30 Akim Demaille <akim@epita.fr>
11792
11793 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
11794 escaped in slot 0.
11795
c7ca99d4
AD
117962002-06-30 Akim Demaille <akim@epita.fr>
11797
11798 Use hash.h for the state hash table.
11799
11800 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
11801 (allocate_storage): Use state_hash_new.
11802 (free_storage): Use state_hash_free.
11803 (new_state, get_state): Adjust.
11804 * src/lalr.h, src/lalr.c (states): Move to...
11805 * src/states.h (state_t): Remove the `link' member, no longer
11806 used.
11807 * src/states.h, src/states.c: here.
11808 (state_hash_new, state_hash_free, state_hash_lookup)
11809 (state_hash_insert, states_free): New.
11810 * src/states.c (state_table, state_compare, state_hash): New.
11811 * src/output.c (output_actions): Do not free states now, since we
11812 still need to know the final_state number in `prepare', called
11813 afterwards. Do it...
11814 * src/main.c (main): here: call states_free after `output'.
11815
df0e7316
AD
118162002-06-30 Akim Demaille <akim@epita.fr>
11817
11818 * src/state.h, src/state.c (state_new): New, extracted from...
11819 * src/LR0.c (new_state): here.
11820 * src/state.h (STATE_ALLOC): Move to...
11821 * src/state.c: here.
11822 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
11823 * src/state.h, src/state.c: here.
11824
39f41916
AD
118252002-06-30 Akim Demaille <akim@epita.fr>
11826
11827 * src/reader.c (gensym): Rename as...
11828 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
11829 (getsym): Rename as...
11830 (symbol_get): this.
11831
d57650a5
AD
118322002-06-30 Akim Demaille <akim@epita.fr>
11833
11834 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
11835 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
11836 * src/output.c, src/print.c, src/print_graph.c: Propagate.
11837 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
11838
5a08f1ce
AD
118392002-06-30 Akim Demaille <akim@epita.fr>
11840
11841 Make the test suite pass with warnings checked.
11842
11843 * tests/actions.at (Printers and Destructors): Improve.
11844 Avoid unsigned vs. signed issues.
11845 * tests/calc.at: Don't exercise the scanner here, do it...
11846 * tests/input.at (Torturing the Scanner): here.
11847
720623af
PH
118482002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11849
88e7e941 11850 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
11851 reorganize first lines parallel to yacc.c.
11852
fb8135fa
AD
118532002-06-28 Akim Demaille <akim@epita.fr>
11854
11855 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
11856 (b4_token_enum, b4_token_defines): New, factored from...
11857 * data/lalr1.cc, data/yacc.c, glr.c: here.
11858
41442480
AD
118592002-06-28 Akim Demaille <akim@epita.fr>
11860
11861 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
11862 unused variables.
11863 * src/output.c (merger_output): static.
11864
e0e5bf84
AD
118652002-06-28 Akim Demaille <akim@epita.fr>
11866
ba0fe3c7 11867 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
11868 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
11869 pacify GCC.
11870 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 11871
676385e2
PH
118722002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11873
11874 Accumulated changelog for new GLR parsing features.
11875
6a254321 11876 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
11877 conflicts_total_count.
11878 * src/conflicts.h: Ditto.
11879 * src/output.c (token_actions): Use the new name.
11880 (output_conflicts): Change conflp => conflict_list_heads, and
11881 confl => conflict_list for better readability.
11882 * data/glr.c: Use the new names.
11883 * NEWS: Add self to GLR announcement.
e0e5bf84 11884
676385e2
PH
11885 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
11886
11887 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
11888 Akim Demaille.
11889
11890 * data/bison.glr: Change name to glr.c
11891 * data/glr.c: Renamed from bison.glr.
11892 * data/Makefile.am: Add glr.c
e0e5bf84
AD
11893
11894 * src/getargs.c:
11895
676385e2 11896 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 11897 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 11898
676385e2
PH
11899 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11900
11901 * data/bison.glr: Be sure to restore the
11902 current #line when returning to the skeleton contents after having
11903 exposed the input file's #line.
11904
11905 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11906
11907 * data/bison.glr: Bring up to date with changes to bison.simple.
11908
11909 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11910
11911 * data/bison.glr: Correct definitions that use b4_prefix.
11912 Various reformatting.
11913 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
11914 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
11915 yytokenp argument; now part of stack.
11916 (yychar): Define to behave as documented.
11917 (yyclearin): Ditto.
e0e5bf84 11918
676385e2
PH
11919 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11920
11921 * src/reader.h: Add declaration for free_merger_functions.
11922
11923 * src/reader.c (merge_functions): New variable.
11924 (get_merge_function): New function.
11925 (free_merger_functions): New function.
11926 (readgram): Check for %prec that is not followed by a symbol.
11927 Handle %dprec and %merge declarations.
11928 (packgram): Initialize dprec and merger fields in rules array.
11929
11930 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
11931 conflict_list_cnt, conflict_list_free): New variables.
11932 (table_grow): Also grow conflict_table.
e0e5bf84 11933 (prepare_rules): Output dprec and merger tables.
676385e2 11934 (conflict_row): New function.
e0e5bf84 11935 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
11936 default reduction in conflicted states for GLR parser so that there
11937 are spaces for the conflict lists.
11938 (save_row): Also save conflict information.
11939 (token_actions): Allocate conflict list.
11940 (merger_output): New function.
11941 (pack_vector): Pack conflict table, too.
11942 (output_conflicts): New function to output yyconflp and yyconfl.
11943 (output_check): Allocate conflict_tos.
11944 (output_actions): Output conflict tables, also.
11945 (output_skeleton): Output b4_mergers definition.
11946 (prepare): Output b4_max_rhs_length definition.
11947 Use 'bison.glr' as default skeleton for GLR parsers.
11948
11949 * src/gram.c (glr_parser): New flag.
11950 (grammar_free): Call free_merger_functions.
11951
11952 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
11953 all pairs of conflicting reductions, rather than just all tokens
11954 causing conflicts. Needed to size conflict tables.
e0e5bf84 11955 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
11956 interface.
11957 (conflicts_print): Ditto.
11958 (count_total_conflicts): New function.
11959
11960 * src/reader.h (merger_list): New type.
11961 (merge_functions): New variable.
11962
11963 * src/lex.h (tok_dprec, tok_merge): New token types.
11964
11965 * src/gram.h (rule_s): Add dprec and merger fields.
11966 (glr_parser): New flag.
11967
11968 * src/conflicts.h (count_total_conflicts): New function.
11969
11970 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
11971
11972 * doc/bison.texinfo (Generalized LR Parsing): New section.
11973 (GLR Parsers): New section.
11974 (Language and Grammar): Mention GLR parsing.
11975 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
11976 Correct typo ("tge" -> "the").
11977
11978 * data/bison.glr: New skeleton for GLR parsing.
11979
11980 * tests/cxx-gram.at: New tests for GLR parsing.
11981
11982 * tests/testsuite.at: Include cxx-gram.at.
11983
11984 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 11985
676385e2
PH
11986 * src/parse-gram.y:
11987
11988 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
11989
11990 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 11991
b5480d74 119922002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
11993
11994 * src/options.h, src/options.c: Remove.
11995 * src/getargs.c (short_options, long_options): New.
11996
60491a94
AD
119972002-06-27 Akim Demaille <akim@epita.fr>
11998
11999 * data/bison.simple, data/bison.c++: Rename as...
12000 * data/yacc.c, data/lalr1.cc: these.
12001 * doc/bison.texinfo (Environment Variables): Remove.
12002
9be0c25b
AD
120032002-06-25 Raja R Harinath <harinath@cs.umn.edu>
12004
12005 * src/getargs.c (report_argmatch): Initialize strtok().
12006
1ae72863
AD
120072002-06-20 Akim Demaille <akim@epita.fr>
12008
12009 * data/bison.simple (b4_symbol_actions): New, replaces...
12010 (b4_symbol_destructor, b4_symbol_printer): these.
12011 (yysymprint): Be sure to call YYPRINT only for tokens, and using
12012 user token numbers.
12013
87542d29
AD
120142002-06-20 Akim Demaille <akim@epita.fr>
12015
12016 * data/bison.simple (yydestructor): Rename as...
12017 (yydestruct): this.
12018
1a31ed21
AD
120192002-06-20 Akim Demaille <akim@epita.fr>
12020
12021 * src/symtab.h, src/symtab.c (symbol_type_set)
12022 (symbol_destructor_set, symbol_precedence_set): The location is
12023 the last argument.
12024 Adjust all callers.
12025
e776192e
AD
120262002-06-20 Akim Demaille <akim@epita.fr>
12027
12028 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
12029 internals.
12030 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
12031 Takes a location.
12032 * src/symtab.h, src/symtab.c (symbol_class_set)
12033 (symbol_user_token_number_set): Likewise.
12034 Adjust all callers.
12035 Promote complain_at.
12036 * tests/input.at (Type Clashes): Adjust.
12037
5c1180b3
AD
120382002-06-20 Akim Demaille <akim@epita.fr>
12039
12040 * data/bison.simple (YYLEX): Fix the declaration when
12041 %pure-parser.
12042
e3170060
AD
120432002-06-20 Akim Demaille <akim@epita.fr>
12044
12045 * data/bison.simple (yysymprint): Don't print the token number,
12046 just its name.
12047 * tests/actions.at (Destructors): Rename as...
12048 (Printers and Destructors): this.
12049 Also exercise %printer.
12050
253862fd
AD
120512002-06-20 Akim Demaille <akim@epita.fr>
12052
12053 * data/bison.simple (YYDSYMPRINT): New.
12054 Use it to remove many of the #if YYDEBUG/if (yydebug).
12055
366eea36
AD
120562002-06-20 Akim Demaille <akim@epita.fr>
12057
12058 * src/symtab.h, src/symtab.c (symbol_t): printer and
12059 printer_location are new members.
12060 (symbol_printer_set): New.
12061 * src/parse-gram.y (PERCENT_PRINTER): New token.
12062 Handle its associated rule.
12063 * src/scan-gram.l: Adjust.
12064 (handle_destructor_at, handle_destructor_dollar): Rename as...
12065 (handle_symbol_code_at, handle_symbol_code_dollar): these.
12066 * src/output.c (symbol_printers_output): New.
12067 (output_skeleton): Call it.
12068 * data/bison.simple (yysymprint): New. Cannot be named yyprint
12069 since there are already many grammar files with a user `yyprint'.
12070 Replace the calls to YYPRINT to calls to yysymprint.
12071 * tests/calc.at: Adjust.
12072 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
12073 taking advantage of parser very internal details (stack size!).
12074
4f25ebb0
AD
120752002-06-20 Akim Demaille <akim@epita.fr>
12076
12077 * src/scan-gram.l: Complete the scanner with the missing patterns
12078 to pacify Flex.
12079 Use `quote' and `symbol_tag_get' where appropriate.
12080
93b68a0e
AD
120812002-06-19 Akim Demaille <akim@epita.fr>
12082
12083 * tests/actions.at (Destructors): Augment to test locations.
12084 * data/bison.simple (yydestructor): Pass it the current location
12085 if locations are enabled.
12086 Prototype only when __STDC__ or C++.
12087 Change the argument names to move into the yy name space: there is
12088 user code here.
12089
58612f1d
AD
120902002-06-19 Akim Demaille <akim@epita.fr>
12091
74310291
AD
12092 * data/bison.simple (b4_pure_if): New.
12093 Use it instead of #ifdef YYPURE.
12094
120952002-06-19 Akim Demaille <akim@epita.fr>
12096
12097 * data/bison.simple (b4_location_if): New.
58612f1d
AD
12098 Use it instead of #ifdef YYLSP_NEEDED.
12099
f25bfb75
AD
121002002-06-19 Akim Demaille <akim@epita.fr>
12101
12102 Prepare @$ in %destructor, but currently don't bind it in the
12103 skeleton, as %location use is not cleaned up yet.
12104
12105 * src/scan-gram.l (handle_dollar, handle_destructor_at)
12106 (handle_action_at): New.
12107 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
12108 a braced_code_t and a location as additional arguments.
12109 (handle_destructor_dollar): Instead of requiring `b4_eval', just
12110 unquote one when outputting `b4_dollar_dollar'.
12111 Adjust callers.
12112 * data/bison.simple (b4_eval): Remove.
12113 (b4_symbol_destructor): Adjust.
12114 * tests/input.at (Invalid @n): Adjust.
12115
c732d2c6
AD
121162002-06-19 Zack Weinberg <zack@codesourcery.com>
12117
12118 * doc/bison.texinfo: Document ability to have multiple
12119 prologue sections.
12120
8c165d89
AD
121212002-06-18 Akim Demaille <akim@epita.fr>
12122
12123 * src/files.c (compute_base_names): When computing the output file
12124 names from the input file name, strip the directory part.
12125
ca98bf57
AD
121262002-06-18 Akim Demaille <akim@epita.fr>
12127
12128 * data/bison.simple.new: Comment changes.
12129 Reported by Andreas Schwab.
12130
0bfb02ff
AD
121312002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
12132
12133 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
12134 there are no `label `yyoverflowlab' defined but not used' warnings
12135 when yyoverflow is defined.
12136
24c0aad7
AD
121372002-06-18 Akim Demaille <akim@epita.fr>
12138
12139 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
12140 new member.
12141 (symbol_destructor_set): Adjust.
12142 * src/output.c (symbol_destructors_output): Output the destructor
12143 locations.
12144 Output the symbol name.
12145 * data/bison.simple (b4_symbol_destructor): Adjust.
12146
5719c109
AD
121472002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
12148 and Akim Demaille <akim@epita.fr>
12149
12150 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
12151 what's left on the stack when the error recovery hits EOF.
12152 * tests/actions.at (Destructors): Complete to exercise this case.
12153
9280d3ef
AD
121542002-06-17 Akim Demaille <akim@epita.fr>
12155
12156 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
12157 arguments is really empty, not only equal to `[]'.
12158 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
12159 member.
12160 (symbol_destructor_set): New.
12161 * src/output.c (symbol_destructors_output): New.
12162 * src/reader.h (brace_code_t, current_braced_code): New.
12163 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
12164 (handle_dollar): Rename as...
12165 (handle_action_dollar): this.
12166 (handle_destructor_dollar): New.
12167 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
12168 (grammar_declaration): Use it.
12169 * data/bison.simple (yystos): Is always defined.
12170 (yydestructor): New.
12171 * tests/actions.at (Destructors): New.
12172 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
12173
dafdc66f
AD
121742002-06-17 Akim Demaille <akim@epita.fr>
12175
12176 * src/symlist.h, src/symlist.c (symbol_list_length): New.
12177 * src/scan-gram.l (handle_dollar, handle_at): Compute the
12178 rule_length only when needed.
12179 * src/output.c (actions_output, token_definitions_output): Output
12180 the full M4 block.
12181 * src/symtab.c: Don't access directly to the symbol tag, use
12182 symbol_tag_get.
12183 * src/parse-gram.y: Use symbol_list_free.
12184
56c47203
AD
121852002-06-17 Akim Demaille <akim@epita.fr>
12186
12187 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
12188 (symbol_list_prepend, get_type_name): Move to...
12189 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
12190 (symbol_list_prepend, symbol_list_n_type_name_get): here.
12191 Adjust all callers.
12192 (symbol_list_free): New.
12193 * src/scan-gram.l (handle_dollar): Takes a location.
12194 * tests/input.at (Invalid $n): Adjust.
12195
1e0bab92
AD
121962002-06-17 Akim Demaille <akim@epita.fr>
12197
12198 * src/reader.h, src/reader.c (symbol_list_new): Export it.
12199 (symbol_list_prepend): New.
12200 * src/parse-gram.y (%union): `list' is a new member.
12201 (symbols.1): New, replaces...
12202 (terms_to_prec.1, nterms_to_type.1): these.
12203 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
12204 Take a location as additional argument.
12205 Adjust all callers.
12206
04e60654
AD
122072002-06-15 Akim Demaille <akim@epita.fr>
12208
12209 * src/parse-gram.y: Move %token in the declaration section so that
12210 we don't depend upon CVS Bison.
12211
10e5b8bd
AD
122122002-06-15 Akim Demaille <akim@epita.fr>
12213
12214 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
12215 * src/print.c (print_core): Use it.
12216
9801d40c
AD
122172002-06-15 Akim Demaille <akim@epita.fr>
12218
12219 * src/conflicts.c (log_resolution): Accept the rule involved in
12220 the sr conflicts instead of the lookahead number that points to
12221 that rule.
12222 (flush_reduce): Accept the current lookahead vector as argument,
12223 instead of the index in LA.
12224 (resolve_sr_conflict): Accept the current number of lookahead
12225 bitset to consider for the STATE, instead of the index in LA.
12226 (set_conflicts): Adjust.
12227 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
12228
c0263492
AD
122292002-06-15 Akim Demaille <akim@epita.fr>
12230
12231 * src/state.h (state_t): Replace the `lookaheadsp' member, a
12232 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
12233 Adjust all dependencies.
12234 * src/lalr.c (initialize_lookaheads): Split into...
12235 (states_lookaheads_count, states_lookaheads_initialize): these.
12236 (lalr): Adjust.
12237
9757c359
AD
122382002-06-15 Akim Demaille <akim@epita.fr>
12239
12240 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
12241 out of...
12242 (grammar_rules_print): here.
12243 * src/reduce.c (reduce_output): Use it.
12244 * tests/reduce.at (Useless Rules, Reduced Automaton)
12245 (Underivable Rules): Adjust.
12246
6b98e4b5
AD
122472002-06-15 Akim Demaille <akim@epita.fr>
12248
12249 Copy BYacc's nice way to report the grammar.
12250
12251 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
12252 New.
12253 Don't print the rules' location, it is confusing and useless.
12254 (rule_print): Use grammar_rhs_print.
12255 * src/print.c (print_grammar): Use grammar_rules_print.
12256
6b98e4b5
AD
122572002-06-15 Akim Demaille <akim@epita.fr>
12258
12259 Complete and rationalize `useless thing' warnings.
12260
12261 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
12262 (symbol_tag_print): New.
12263 Use them everywhere in place of accessing directly the tag member.
12264 * src/gram.h, src/gram.c (rule_print): New.
12265 Use it where a rule used to be printed `by hand'.
12266 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
12267 (reduce_grammar_tables): Report the useless rules.
12268 (reduce_print): Useless things are a warning, not an error.
12269 Report it as such.
12270 * tests/reduce.at (Useless Nonterminals, Useless Rules):
12271 (Reduced Automaton, Underivable Rules): Adjust.
12272 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
12273 * tests/conflicts.at (Unresolved SR Conflicts)
12274 (Solved SR Conflicts): Adjust.
12275
ee000ba4
AD
122762002-06-15 Akim Demaille <akim@epita.fr>
12277
12278 Let symbols have a location.
12279
12280 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
12281 (getsym): Adjust.
12282 Adjust all callers.
12283 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
12284 Use location_t, not int.
12285 * src/symtab.c (symbol_check_defined): Take advantage of the
12286 location.
12287 * tests/regression.at (Invalid inputs): Adjust.
12288
8efe435c
AD
122892002-06-15 Akim Demaille <akim@epita.fr>
12290
12291 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
12292 (input): Don't try to initialize yylloc here, do it in the
12293 scanner.
12294 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
12295 * src/gram.h (rule_t): Change line and action_line into location
12296 and action_location, of location_t type.
12297 Adjust all dependencies.
12298 * src/location.h, src/location.c (empty_location): New.
12299 * src/reader.h, src/reader.c (grammar_start_symbol_set)
12300 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
12301 (grammar_current_rule_symbol_append)
12302 (grammar_current_rule_action_append): Expect a location as argument.
12303 * src/reader.c (grammar_midrule_action): Adjust to attach an
12304 action's location as dummy symbol location.
12305 * src/symtab.h, src/symtab.c (startsymbol_location): New.
12306 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
12307 the line numbers.
12308
1921f1d7
AD
123092002-06-14 Akim Demaille <akim@epita.fr>
12310
12311 Grammar declarations may be found in the grammar section.
12312
12313 * src/parse-gram.y (rules_or_grammar_declaration): New.
12314 (declarations): Each declaration may end with a semicolon, not
12315 just...
12316 (grammar_declaration): `"%union"'.
12317 (grammar): Branch to rules_or_grammar_declaration.
12318
4515534c
AD
123192002-06-14 Akim Demaille <akim@epita.fr>
12320
12321 * src/main.c (main): Invoke scanner_free.
12322
f958596b
AD
123232002-06-14 Akim Demaille <akim@epita.fr>
12324
12325 * src/output.c (m4_invoke): Extracted from...
12326 (output_skeleton): here.
12327 Free tempfile.
12328
2c569025
AD
123292002-06-14 Akim Demaille <akim@epita.fr>
12330
12331 * src/parse-gram.y (directives, directive, gram)
12332 (grammar_directives, precedence_directives, precedence_directive):
12333 Rename as...
12334 (declarations, declaration, grammar, grammar_declaration)
12335 (precedence_declaration, precedence_declarator): these.
12336 (symbol_declaration): New.
12337
592e8d4d
AD
123382002-06-14 Akim Demaille <akim@epita.fr>
12339
12340 * src/files.c (action_obstack): Remove, unused.
12341 (output_obstack): Remove it, and all its dependencies, as it is no
12342 longer needed.
12343 * src/reader.c (epilogue_set): Build the epilogue in the
12344 muscle_obstack.
12345 * src/output.h, src/output.c (muscle_obstack): Move to...
12346 * src/muscle_tab.h, src/muscle_tab.h: here.
12347 (muscle_init): Initialize muscle_obstack.
12348 (muscle_free): New.
12349 * src/main.c (main): Call it.
12350
0c15323d
AD
123512002-06-14 Akim Demaille <akim@epita.fr>
12352
12353 * src/location.h: New, extracted from...
12354 * src/reader.h: here.
12355 * src/Makefile.am (noinst_HEADERS): Merge into
12356 (bison_SOURCES): this.
12357 Add location.h.
12358 * src/parse-gram.y: Use location_t instead of Bison's.
12359 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
12360 Use location_t instead of ints.
12361
e96c9728
AD
123622002-06-14 Akim Demaille <akim@epita.fr>
12363
12364 * data/bison.simple, data/bison.c++: Be sure to restore the
12365 current #line when returning to the skeleton contents after having
12366 exposed the input file's #line.
12367
75d1fe16
AD
123682002-06-12 Akim Demaille <akim@epita.fr>
12369
12370 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
12371 eager.
12372 * tests/actions.at (Exotic Dollars): New.
12373
6c35d22c
AD
123742002-06-12 Akim Demaille <akim@epita.fr>
12375
12376 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
12377 ['"/] too eagerly.
12378 * tests/input.at (Torturing the Scanner): New.
12379
1d6412ad
AD
123802002-06-11 Akim Demaille <akim@epita.fr>
12381
12382 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
12383 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
12384 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
12385 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
12386 * src/reader.c (reader): Use it.
12387
4cdb01db
AD
123882002-06-11 Akim Demaille <akim@epita.fr>
12389
12390 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
12391 Adjust all callers.
12392 (scanner_last_string_free): New.
12393
44995b2e
AD
123942002-06-11 Akim Demaille <akim@epita.fr>
12395
12396 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
12397 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
12398 (last_string, YY_OBS_FREE): New.
12399 Use them when returning an ID.
12400
e9955c83
AD
124012002-06-11 Akim Demaille <akim@epita.fr>
12402
12403 Have Bison grammars parsed by a Bison grammar.
12404
12405 * src/reader.c, src/reader.h (prologue_augment): New.
12406 * src/reader.c (copy_definition): Remove.
12407
12408 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
12409 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
12410 (grammar_current_rule_prec_set, grammar_current_rule_check)
12411 (grammar_current_rule_symbol_append)
12412 (grammar_current_rule_action_append): Export.
12413 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
12414 (symbol_list_action_append): Remove.
12415 Hook the routines from reader.
12416 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
12417 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
12418
12419 * src/reader.c (read_declarations): Remove, unused.
12420
12421 * src/parse-gram.y: Handle the epilogue.
12422 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
12423 (grammar_start_symbol_set): this.
12424 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
12425 * src/reader.c (readgram): Remove, unused.
12426 (reader): Adjust to insert eoftoken and axiom where appropriate.
12427
12428 * src/reader.c (copy_dollar): Replace with...
12429 * src/scan-gram.h (handle_dollar): this.
12430 * src/parse-gram.y: Remove `%thong'.
12431
12432 * src/reader.c (copy_at): Replace with...
12433 * src/scan-gram.h (handle_at): this.
12434
12435 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
12436 New.
12437
12438 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
12439 time being.
12440
12441 * src/reader.h, src/reader.c (grammar_rule_end): New.
12442
12443 * src/parse.y (current_type, current_class): New.
12444 Implement `%nterm', `%token' support.
12445 Merge `%term' into `%token'.
12446 (string_as_id): New.
12447 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
12448 type name.
12449
12450 * src/parse-gram.y: Be sure to handle properly the beginning of
12451 rules.
12452
12453 * src/parse-gram.y: Handle %type.
12454 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
12455
12456 * src/parse-gram.y: More directives support.
12457 * src/options.c: No longer handle source directives.
12458
12459 * src/parse-gram.y: Fix %output.
12460
12461 * src/parse-gram.y: Handle %union.
12462 Use the prologue locations.
12463 * src/reader.c (parse_union_decl): Remove.
12464
12465 * src/reader.h, src/reader.c (epilogue_set): New.
12466 * src/parse-gram.y: Use it.
12467
12468 * data/bison.simple, data/bison.c++: b4_stype is now either not
12469 defined, then default to int, or to the contents of %union,
12470 without `union' itself.
12471 Adjust.
12472 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
12473
12474 * src/output.c (actions_output): Don't output braces, as they are
12475 already handled by the scanner.
12476
12477 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
12478 characters to themselves.
12479
12480 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
12481 that the epilogue has a proper #line.
12482
12483 * src/parse-gram.y: Handle precedence/associativity.
12484
12485 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
12486 a terminal.
12487 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
12488 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
12489 at all to define terminals that cannot be emitted.
12490
12491 * src/scan-gram.l: Escape M4 characters.
12492
12493 * src/scan-gram.l: Working properly with escapes in user
12494 strings/characters.
12495
12496 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
12497 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
12498 grammar.
12499 Use more modest sizes, as for the time being the parser does not
12500 release memory, and therefore the process swallows a huge amount
12501 of memory.
12502
12503 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
12504 stricter %token grammar.
12505
12506 * src/symtab.h (associativity): Add `undef_assoc'.
12507 (symbol_precedence_set): Do nothing when passed an undef_assoc.
12508 * src/symtab.c (symbol_check_alias_consistence): Adjust.
12509
12510 * tests/regression.at (Invalid %directive): Remove, as it is now
12511 meaningless.
12512 (Invalid inputs): Adjust to the new error messages.
12513 (Token definitions): The new grammar doesn't allow too many
12514 eccentricities.
12515
12516 * src/lex.h, src/lex.c: Remove.
12517 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
12518 (copy_character, copy_string2, copy_string, copy_identifier)
12519 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
12520 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
12521 (parse_action): Remove.
12522 * po/POTFILES.in: Adjust.
12523
2e047461
AD
125242002-06-11 Akim Demaille <akim@epita.fr>
12525
cd05d13c 12526 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
12527 rule's action member: return the action as a string.
12528 Don't require `rule_length' as an argument: compute it.
12529 (grammar_current_rule_symbol_append)
12530 (grammar_current_rule_action_append): New, eved out from
12531 (readgram): here.
12532 Remove `action_flag', `rulelength', unused now.
12533
9af3fbce
AD
125342002-06-11 Akim Demaille <akim@epita.fr>
12535
12536 * src/reader.c (grammar_current_rule_prec_set).
12537 (grammar_current_rule_check): New, eved out from...
12538 (readgram): here.
12539 Remove `xaction', `first_rhs': useless.
12540 * tests/input.at (Type clashes): New.
12541 * tests/existing.at (GNU Cim Grammar): Adjust.
12542
1485e106
AD
125432002-06-11 Akim Demaille <akim@epita.fr>
12544
12545 * src/reader.c (grammar_midrule_action): New, Eved out from
12546 (readgram): here.
12547
da4160c3
AD
125482002-06-11 Akim Demaille <akim@epita.fr>
12549
12550 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
12551 New.
12552 (readgram): Use them as replacement of inlined code, crule and
12553 crule1.
12554
f6d0f937
AD
125552002-06-11 Akim Demaille <akim@epita.fr>
12556
12557 * src/reader.c (grammar_end, grammar_symbol_append): New.
12558 (readgram): Use them.
12559 Make the use of `p' as local as possible.
12560
69078d4b
AD
125612002-06-10 Akim Demaille <akim@epita.fr>
12562
12563 GCJ's parser requires the tokens to be defined before the prologue.
12564
12565 * data/bison.simple: Output the token definition before the user's
12566 prologue.
12567 * tests/regression.at (Braces parsing, Duplicate string)
12568 (Mixing %token styles): Check the output from bison.
12569 (Early token definitions): New.
12570
5e424082
AD
125712002-06-10 Akim Demaille <akim@epita.fr>
12572
12573 * src/symtab.c (symbol_user_token_number_set): Don't complain when
12574 assigning twice the same user number to a token, so that we can
12575 use it in...
12576 * src/lex.c (lex): here.
12577 Also use `symbol_class_set' instead of hand written code.
12578 * src/reader.c (parse_assoc_decl): Likewise.
12579
44536b35
AD
125802002-06-10 Akim Demaille <akim@epita.fr>
12581
12582 * src/symtab.c, src/symtab.c (symbol_class_set)
12583 (symbol_user_token_number_set): New.
12584 * src/reader.c (parse_token_decl): Use them.
12585 Use a switch instead of ifs.
12586 Use a single argument.
12587
8b9f2372
AD
125882002-06-10 Akim Demaille <akim@epita.fr>
12589
12590 Remove `%thong' support as it is undocumented, unused, duplicates
12591 `%token's job, and creates useless e-mail traffic with people who
12592 want to know what it is, why it is undocumented, unused, and
12593 duplicates `%token's job.
12594
12595 * src/reader.c (parse_thong_decl): Remove.
12596 * src/options.c (option_table): Remove "thong".
12597 * src/lex.h (tok_thong): Remove.
12598
3ae2b51f
AD
125992002-06-10 Akim Demaille <akim@epita.fr>
12600
12601 * src/symtab.c, src/symtab.c (symbol_type_set)
12602 (symbol_precedence_set): New.
12603 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
12604 (value_components_used): Remove, unused.
12605
2f1afb73
AD
126062002-06-09 Akim Demaille <akim@epita.fr>
12607
12608 Move symbols handling code out of the reader.
12609
12610 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
12611 (axiom): Move to...
12612 * src/symtab.h, src/symtab.c: here.
12613
12614 * src/gram.c (start_symbol): Remove: use startsymbol->number.
12615 * src/reader.c (startval): Rename as...
12616 * src/symtab.h, src/symtab.c (startsymbol): this.
12617 * src/reader.c: Adjust.
12618
12619 * src/reader.c (symbol_check_defined, symbol_make_alias)
12620 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12621 (token_translations_init)
12622 Move to...
12623 * src/symtab.c: here.
12624 * src/reader.c (packsymbols): Move to...
12625 * src/symtab.h, src/symtab.c (symbols_pack): here.
12626 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
12627 argument.
12628
e9bca3ad
AD
126292002-06-03 Akim Demaille <akim@epita.fr>
12630
12631 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
12632 then statements.
12633
86eff183
AD
126342002-06-03 Akim Demaille <akim@epita.fr>
12635
12636 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
12637 structs with non literals.
12638 * src/scan-skel.l: never-interactive.
12639 * src/conflicts.c (enum conflict_resolution_e): No trailing
12640 comma.
12641 * src/getargs.c (usage): Split long literal strings.
12642 Reported by Hans Aberg.
12643
717be197
AD
126442002-05-28 Akim Demaille <akim@epita.fr>
12645
12646 * data/bison.c++: Use C++ ostreams.
12647 (cdebug_): New member.
12648
670ddffd
AD
126492002-05-28 Akim Demaille <akim@epita.fr>
12650
12651 * src/output.c (output_skeleton): Be sure to allocate enough room
12652 for `/' _and_ for `\0' in full_skeleton.
12653
769b430f
AD
126542002-05-28 Akim Demaille <akim@epita.fr>
12655
12656 * data/bison.c++: Catch up with bison.simple:
12657 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12658 and Paul Eggert <eggert@twinsun.com>: `error' handing.
12659 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
12660 and popping traces.
12661
7067cb36
PH
126622002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12663
12664 * src/output.c (output_skeleton): Put an explicit path in front of
12665 the skeleton file name, rather than relying on the -I directory,
12666 to partially alleviate effects of having a skeleton file lying around
12667 in the current directory.
769b430f 12668
4a713ec2
PH
126692002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12670
769b430f 12671 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
12672 obstack_printf should be obstack_fgrow1.
12673
b408954b
AD
126742002-05-26 Akim Demaille <akim@epita.fr>
12675
12676 * src/state.h (state_t): `solved_conflicts' is a new member.
12677 * src/LR0.c (new_state): Set it to 0.
12678 * src/conflicts.h, src/conflicts.c (print_conflicts)
12679 (free_conflicts, solve_conflicts): Rename as...
12680 (conflicts_print, conflicts_free, conflicts_solve): these.
12681 Adjust callers.
12682 * src/conflicts.c (enum conflict_resolution_e)
12683 (solved_conflicts_obstack): New, used by...
12684 (log_resolution): this.
12685 Adjust to attach the conflict resolution to each state.
12686 Complete the description with the precedence/associativity
12687 information.
12688 (resolve_sr_conflict): Adjust.
12689 * src/print.c (print_state): Output its solved_conflicts.
12690 * tests/conflicts.at (Unresolved SR Conflicts)
12691 (Solved SR Conflicts): Exercise --report=all.
12692
a49aecd5
AD
126932002-05-26 Akim Demaille <akim@epita.fr>
12694
12695 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12696 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12697 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
12698 (token_number_t, item_number_as_token_number)
12699 (token_number_as_item_number, muscle_insert_token_number_table):
12700 Rename as...
12701 (symbol_number_t, item_number_as_symbol_number)
12702 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
12703 these, since it is more appropriate.
12704
5504898e
AD
127052002-05-26 Akim Demaille <akim@epita.fr>
12706
12707 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
12708 `Error:' lines.
12709 * data/bison.simple (yystos) [YYDEBUG]: New.
12710 (yyparse) [YYDEBUG]: Display the symbols which are popped during
12711 error recovery.
12712 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
12713
ec3bc396
AD
127142002-05-25 Akim Demaille <akim@epita.fr>
12715
12716 * doc/bison.texinfo (Debugging): Split into...
12717 (Tracing): this new section, its former contents, and...
12718 (Understanding): this new section.
12719 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
12720 by...
12721 (report_flag): this.
12722 Adjust all dependencies.
12723 (report_args, report_types, report_argmatch): New.
12724 (usage, getargs): Report/support -r, --report.
12725 * src/options.h
12726 (struct option_table_struct): Rename as..,
12727 (struct option_table_s): this.
12728 Rename the `set_flag' member to `flag' to match with getopt_long's
12729 struct.
12730 * src/options.c (option_table): Split verbose into an entry for
12731 %verbose, and another for --verbose.
12732 Support --report/-r, so remove -r from the obsolete --raw.
12733 * src/print.c: Attach full item sets and lookaheads reports to
12734 report_flag instead of trace_flag.
12735 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
12736
78df8250
PE
127372002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12738 and Paul Eggert <eggert@twinsun.com>
769b430f 12739
78df8250
PE
12740 * data/bison.simple (yyparse): Correct error handling to conform to
12741 POSIX and yacc. Specifically, after syntax error is discovered,
12742 do not reduce further before shifting the error token.
12743 Clean up the code a bit by removing the labels yyerrdefault,
12744 yyerrhandle, yyerrpop.
12745 * NEWS: Document the above.
12746
c0c9ea05
PH
127472002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12748
12749 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
12750 type; it isn't always big enough, since it doesn't necessarily
12751 include non-terminals.
769b430f 12752 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
12753 the latter can be removed.
12754 (yy_token_number_type): Remove, only one use.
12755 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
12756 don't use TokenNumberType as element type.
769b430f 12757
c0c9ea05
PH
12758 * tests/regression.at: Modify expected output to agree with change
12759 to yyr1 and yytranslate.
769b430f 12760
6390a83f
FK
127612002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
12762
12763 * src/reader.c (parse_action): Use copy_character instead of
12764 obstack_1grow.
12765
db7c8e9a
AD
127662002-05-13 Akim Demaille <akim@epita.fr>
12767
12768 * tests/regression.at (Token definitions): Prototype yylex and
12769 yyerror.
12770
fcc61800
PH
127712002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12772
158c687b 12773 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
12774 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
12775 32-bit arithmetic.
12776 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
12777
5683e9b2
AD
127782002-05-07 Akim Demaille <akim@epita.fr>
12779
12780 * tests/synclines.at: Be sure to prototype yylex and yyerror to
12781 avoid GCC warnings.
12782
0c2d3f4c
AD
127832002-05-07 Akim Demaille <akim@epita.fr>
12784
12785 Kill GCC warnings.
12786
12787 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
12788 over the RHS of each rule.
12789 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
12790 * src/state.h (state_t): Member `nitems' is unsigned short.
12791 * src/LR0.c (get_state): Adjust.
12792 * src/reader.c (packgram): Likewise.
12793 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
12794 `Type'.
12795 (muscle_insert_int_table): Remove, unused.
12796 (prepare_rules): Remove `max'.
12797
1565b720
AD
127982002-05-06 Akim Demaille <akim@epita.fr>
12799
12800 * src/closure.c (print_firsts): Display of the symbol tags.
12801 (bitmatrix_print): Move to...
12802 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
12803 here.
12804 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
12805
cfaee611
AD
128062002-05-06 Akim Demaille <akim@epita.fr>
12807
12808 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
12809 hash_do_for_each.
12810
458be8e0
AD
128112002-05-06 Akim Demaille <akim@epita.fr>
12812
12813 * src/LR0.c (new_state, get_state): Instead of using the global
12814 `kernel_size' and `kernel_base', have two new arguments:
12815 `core_size' and `core'.
12816 Adjust callers.
12817
a900a624
AD
128182002-05-06 Akim Demaille <akim@epita.fr>
12819
12820 * src/reader.c (packgram): No longer end `ritem' with a 0
12821 sentinel: it is not used.
12822
d4e7d3a1
AD
128232002-05-05 Akim Demaille <akim@epita.fr>
12824
12825 New experimental feature: display the lookaheads in the report and
12826 graph.
12827
12828 * src/print (print_core): When --trace-flag, display the rules
12829 lookaheads.
12830 * src/print_graph.c (print_core): Likewise.
12831 Swap the arguments.
12832 Adjust caller.
12833
39ceb25b
AD
128342002-05-05 Akim Demaille <akim@epita.fr>
12835
12836 * tests/torture.at (Many lookaheads): New test.
12837
5372019f
AD
128382002-05-05 Akim Demaille <akim@epita.fr>
12839
12840 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
12841 (GENERATE_MUSCLE_INSERT_TABLE): this.
12842 (output_int_table, output_unsigned_int_table, output_short_table)
12843 (output_token_number_table, output_item_number_table): Replace with...
12844 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
12845 (muscle_insert_short_table, muscle_insert_token_number_table)
12846 (muscle_insert_item_number_table): these.
12847 Adjust all callers.
12848 (prepare_tokens): Don't free `translations', since...
12849 * src/reader.h, src/reader.c (grammar_free): do it.
12850 Move to...
12851 * src/gram.h, src/gram.c (grammar_free): here.
12852 * data/bison.simple, data/bison.c++: b4_token_number_max is now
12853 b4_translate_max.
12854
5df5f6d5
AD
128552002-05-05 Akim Demaille <akim@epita.fr>
12856
12857 * src/output.c (output_unsigned_int_table): New.
12858 (prepare_rules): `i' is unsigned.
12859 `prhs', `rline', `r2' are unsigned int.
12860 Rename muscle `rhs_number_max' as `rhs_max'.
12861 Output muscles `prhs_max', `rline_max', and `r2_max'.
12862 Free rline and r1.
12863 * data/bison.simple, data/bison.c++: Adjust to use these muscles
12864 to compute types instead of constant types.
12865 * tests/regression.at (Web2c Actions): Adjust.
12866
b87f8b21
AD
128672002-05-04 Akim Demaille <akim@epita.fr>
12868
12869 * src/symtab.h (SALIAS, SUNDEF): Rename as...
12870 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
12871 Adjust dependencies.
12872 * src/output.c (token_definitions_output): Be sure not to output a
12873 `#define 'a'' when fed with `%token 'a' "a"'.
12874 * tests/regression.at (Token definitions): New.
12875
8bb936e4
PE
128762002-05-03 Paul Eggert <eggert@twinsun.com>
12877
12878 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
12879 for K&R C.
12880
128812002-05-03 gettextize <bug-gnu-gettext@gnu.org>
12882
12883 * Makefile.am (SUBDIRS): Remove intl.
12884 (EXTRA_DIST): Add config/config.rpath.
12885
53c71a12
AD
128862002-05-03 Akim Demaille <akim@epita.fr>
12887
12888 * data/bison.simple (m4_if): Don't output empty enums.
12889 And actually, output valid enum definitions :(.
12890
289dd0cf
AD
128912002-05-03 Akim Demaille <akim@epita.fr>
12892
12893 * configure.bat: Remove, completely obsolete.
12894 * Makefile.am (EXTRA_DIST): Adjust.
12895 Don't distribute config.rpath...
12896 * config/Makefile.am (EXTRA_DIST): Do it.
12897
db85e524
AD
128982002-05-03 Akim Demaille <akim@epita.fr>
12899
12900 * configure.in (GETTEXT_VERSION): New.
12901 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
12902
83ccf991
AD
129032002-05-03 Akim Demaille <akim@epita.fr>
12904
12905 * data/bison.simple (b4_token_enum): New.
12906 (b4_token_defines): Use it to output tokens both as #define and
12907 enums.
12908 Suggested by Paul Eggert.
12909 * src/output.c (token_definitions_output): Don't output spurious
12910 white spaces.
12911
1f418995
AD
129122002-05-03 Akim Demaille <akim@epita.fr>
12913
12914 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12915
45119f04
RA
129162002-05-02 Robert Anisko <robert@lrde.epita.fr>
12917
12918 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
12919 Update the stack class, give a try to deque as the default container.
12920
b2d52318
AD
129212002-05-02 Akim Demaille <akim@epita.fr>
12922
12923 * data/bison.simple (yyparse): Do not implement @$ = @1.
12924 (YYLLOC_DEFAULT): Adjust to do it.
12925 * doc/bison.texinfo (Location Default Action): Fix.
12926
3a8b4109
AD
129272002-05-02 Akim Demaille <akim@epita.fr>
12928
12929 * src/reader.c (parse_braces): Merge into...
12930 (parse_action): this.
12931
84614e13
AD
129322002-05-02 Akim Demaille <akim@epita.fr>
12933
12934 * configure.in (ALL_LINGUAS): Remove.
12935 * po/LINGUAS, hr.po: New.
12936
fdbcd8e2
AD
129372002-05-02 Akim Demaille <akim@epita.fr>
12938
12939 Remove the so called hairy (semantic) parsers.
12940
12941 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
12942 * src/gram.h, src/gram.c (semantic_parser): Remove.
12943 (rule_t): Remove the guard and guard_line members.
12944 * src/lex.h (token_t): remove tok_guard.
12945 * src/options.c (option_table): Remove %guard and %semantic_parser
12946 support.
12947 * src/output.c, src/output.h (guards_output): Remove.
12948 (prepare): Adjust.
12949 (token_definitions_output): Don't output the `T'
12950 tokens (???).
12951 (output_skeleton): Don't output the guards.
12952 * src/files.c, src/files.c (attrsfile): Remove.
12953 * src/reader.c (symbol_list): Remove the guard and guard_line
12954 members.
12955 Adjust dependencies.
12956 (parse_guard): Remove.
12957 * data/bison.hairy: Remove.
12958 * doc/bison.texinfo (Environment Variables): Remove occurrences of
12959 BISON_HAIRY.
12960
82b6cb3f
AD
129612002-05-02 Akim Demaille <akim@epita.fr>
12962
12963 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
12964 (parse_guard): Rename the formal argument `stack_offset' as
12965 `rule_length', which is more readable.
12966 Adjust callers.
12967 (copy_at, copy_dollar): Instead of outputting the hard coded
12968 values of $$, $n and so forth, output invocation to b4_lhs_value,
12969 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
12970 Note: this patch partially drops `semantic-parser' support: it
12971 always does `rule_length - n', where semantic parsers ought to
12972 always use `-n'.
82b6cb3f
AD
12973 * data/bison.simple, data/bison.c++ (b4_lhs_value)
12974 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12975
6cbfbcc5
AD
129762002-05-02 Akim Demaille <akim@epita.fr>
12977
12978 * configure.in (AC_INIT): Bump to 1.49b.
12979 (AM_INIT_AUTOMAKE): Short invocation.
12980
b8548114
AD
129812002-05-02 Akim Demaille <akim@epita.fr>
12982
12983 Version 1.49a.
12984
c20cd1fa
AD
129852002-05-01 Akim Demaille <akim@epita.fr>
12986
12987 * src/skeleton.h: Remove.
12988
8a9566d4
AD
129892002-05-01 Akim Demaille <akim@epita.fr>
12990
12991 * src/skeleton.h: Fix the #endif.
12992 Reported by Magnus Fromreide.
12993
8c6d399a
PE
129942002-04-26 Paul Eggert <eggert@twinsun.com>
12995
12996 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
12997 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 12998 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 12999
2b7ed18a
RA
130002002-04-25 Robert Anisko <robert@lrde.epita.fr>
13001
13002 * src/scan-skel.l: Postprocess quadrigraphs.
13003
13004 * src/reader.c (copy_character): New function, used to output
13005 single characters while replacing `[' and `]' with quadrigraphs, to
13006 avoid troubles with M4 quotes.
13007 (copy_comment): Output characters with copy_character.
13008 (read_additionnal_code): Likewise.
13009 (copy_string2): Likewise.
13010 (copy_definition): Likewise.
13011
13012 * tests/calc.at: Exercise M4 quoting.
13013
34a89c50
AD
130142002-04-25 Akim Demaille <akim@epita.fr>
13015
13016 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
13017 between `!' and the command.
13018 Reported by Paul Eggert.
13019
0dd1580a
RA
130202002-04-24 Robert Anisko <robert@lrde.epita.fr>
13021
13022 * tests/calc.at: Exercise prologue splitting.
13023
13024 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
13025 `b4_post_prologue' instead of `b4_prologue'.
13026
13027 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
13028 muscles.
13029 (output): Free pre_prologue_obstack and post_prologue_obstack.
13030 * src/files.h, src/files.c (attrs_obstack): Remove.
13031 (pre_prologue_obstack, post_prologue_obstack): New.
13032 * src/reader.c (copy_definition): Add a parameter to specify the
13033 obstack to fill, instead of using attrs_obstack unconditionally.
13034 (read_declarations): Pass pre_prologue_obstack to copy_definition if
13035 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
13036
83c1796f
PE
130372002-04-23 Paul Eggert <eggert@twinsun.com>
13038
13039 * data/bison.simple: Remove unnecessary commentary and white
13040 space differences from 1_29-branch.
13041 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
13042
13043 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
13044 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
13045 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
13046 constructors or destructors.
13047
13048 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
13049
1207eeac
AD
130502002-04-23 Akim Demaille <akim@epita.fr>
13051
13052 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
13053 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
13054 location with columns.
13055 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
13056 All reported by Paul Eggert.
13057
78ab8f67
AD
130582002-04-22 Akim Demaille <akim@epita.fr>
13059
13060 * src/reduce.c (dump_grammar): Move to...
13061 * src/gram.h, src/gram.c (grammar_dump): here.
13062 Be sure to separate long item numbers.
13063 Don't read the members of a rule's prec if its nil.
13064
133c20e2
AD
130652002-04-22 Akim Demaille <akim@epita.fr>
13066
13067 * src/output.c (table_size, table_grow): New.
13068 (MAXTABLE): Remove, replace uses with table_size.
13069 (pack_vector): Instead of dying when the table is too big, grow it.
13070
9515e8a7
AD
130712002-04-22 Akim Demaille <akim@epita.fr>
13072
13073 * data/bison.simple (yyr1): Its type is that of a token number.
13074 * data/bison.c++ (r1_): Likewise.
13075 * tests/regression.at (Web2c Actions): Adjust.
13076
23c5a174
AD
130772002-04-22 Akim Demaille <akim@epita.fr>
13078
13079 * src/reader.c (token_translations_init): 256 is now the default
13080 value for the error token, i.e., it will be assigned another
13081 number if the user assigned 256 to one of her tokens.
13082 (reader): Don't force 256 to error.
13083 * doc/bison.texinfo (Symbols): Adjust.
13084 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
13085 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
13086 etc. instead of 10, 20, 30 (which was used to `jump' over error
13087 (256) and undefined (2)).
13088
5fbb0954
AD
130892002-04-22 Akim Demaille <akim@epita.fr>
13090
13091 Propagate more token_number_t.
13092
13093 * src/gram.h (token_number_as_item_number)
13094 (item_number_as_token_number): New.
13095 * src/output.c (GENERATE_OUTPUT_TABLE): New.
13096 Use it to create output_item_number_table and
13097 output_token_number_table.
13098 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13099 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
13100 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
13101 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
13102
4f940944
AD
131032002-04-22 Akim Demaille <akim@epita.fr>
13104
13105 * src/output.h, src/output.c (get_lines_number): Remove.
13106
3ded9a63
AD
131072002-04-19 Akim Demaille <akim@epita.fr>
13108
13109 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
13110 as Lex/Flex'.
13111 (Debugging): More details about enabling the debugging features.
13112 (Table of Symbols): Describe $$, $n, @$, and @n.
13113 Suggested by Tim Josling.
13114
e0c471a9
AD
131152002-04-19 Akim Demaille <akim@epita.fr>
13116
13117 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
13118
fecc10cd
AD
131192002-04-10 Akim Demaille <akim@epita.fr>
13120
13121 * src/system.h: Rely on HAVE_LIMITS_H.
13122 Suggested by Paul Eggert.
13123
51dec47b
AD
131242002-04-09 Akim Demaille <akim@epita.fr>
13125
13126 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
13127 full stderr, and strip it according to the bison options, instead
13128 of composing the error message from different bits.
13129 This makes it easier to check for several error messages.
13130 Adjust all the invocations.
13131 Add an invocation exercising the error token.
13132 Add an invocation demonstrating a stupid error message.
13133 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
13134 Adjust the tests.
13135 Error message are for stderr, not stdout.
13136
007a50a4
AD
131372002-04-09 Akim Demaille <akim@epita.fr>
13138
13139 * src/gram.h, src/gram.c (error_token_number): Remove, use
13140 errtoken->number.
13141 * src/reader.c (reader): Don't specify the user token number (2)
13142 for $undefined, as it uselessly prevents using it.
13143 * src/gram.h (token_number_t): Move to...
13144 * src/symtab.h: here.
13145 (state_t.number): Is a token_number_t.
13146 * src/print.c, src/reader.c: Use undeftoken->number instead of
13147 hard coded 2.
13148 (Even though this 2 is not the same as above: the number of the
13149 undeftoken remains being 2, it is its user token number which
13150 might not be 2).
13151 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
13152 `user_token_number_max'.
13153 Output `undef_token_number'.
13154 * data/bison.simple, data/bison.c++: Use them.
13155 Be sure to map invalid yylex return values to
13156 `undef_token_number'. This saves us from gratuitous SEGV.
13157
13158 * tests/conflicts.at (Solved SR Conflicts)
13159 (Unresolved SR Conflicts): Adjust.
13160 * tests/regression.at (Web2c Actions): Adjust.
13161
06446ccf
AD
131622002-04-08 Akim Demaille <akim@epita.fr>
13163
13164 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
13165 Adding #line.
13166 Remove the duplicate `typedefs'.
13167 (RhsNumberType): Fix the declaration and various other typos.
13168 Use __ofile__.
13169 * data/bison.simple: Use __ofile__.
13170 * src/scan-skel.l: Handle __ofile__.
13171
62a3e4f0
AD
131722002-04-08 Akim Demaille <akim@epita.fr>
13173
13174 * src/gram.h (item_number_t): New, the type of item numbers in
13175 RITEM. Note that it must be able to code symbol numbers as
13176 positive number, and the negation of rule numbers as negative
13177 numbers.
13178 Adjust all dependencies (pretty many).
13179 * src/reduce.c (rule): Remove this `short *' pointer: use
13180 item_number_t.
13181 * src/system.h (MINSHORT, MAXSHORT): Remove.
13182 Include `limits.h'.
13183 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
13184 (shortcpy): Remove.
13185 (MAXTABLE): Move to...
13186 * src/output.c (MAXTABLE): here.
13187 (prepare_rules): Use output_int_table to output rhs.
13188 * data/bison.simple, data/bison.c++: Adjust.
13189 * tests/torture.at (Big triangle): Move the limit from 254 to
13190 500.
13191 * tests/regression.at (Web2c Actions): Ajust.
13192
13193 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
13194 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
13195 passes, but produces negative #line number, once fixed, GCC is
13196 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
13197 C), it passes.
13198 * src/state.h (state_h): Code input lines on ints, not shorts.
13199
bb88b0fc
AD
132002002-04-08 Akim Demaille <akim@epita.fr>
13201
13202 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
13203 and then the grammar.
13204
9a636f47
AD
132052002-04-08 Akim Demaille <akim@epita.fr>
13206
13207 * src/system.h: No longer using strndup.
13208
680e8701
AD
132092002-04-07 Akim Demaille <akim@epita.fr>
13210
13211 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
13212 * src/output.c (output_table_data): Return the longest number.
13213 (prepare_tokens): Output `token_number_max').
13214 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
13215 New.
13216 Use them to define yy_token_number_type/TokenNumberType.
13217 Use this type for yytranslate.
13218 * tests/torture.at (Big triangle): Push the limit from 124 to
13219 253.
13220 * tests/regression.at (Web2c Actions): Adjust.
13221
817e9f41
AD
132222002-04-07 Akim Demaille <akim@epita.fr>
13223
13224 * tests/torture.at (Big triangle): New.
13225 (GNU AWK Grammar, GNU Cim Grammar): Move to...
13226 * tests/existing.at: here.
13227
5123689b
AD
132282002-04-07 Akim Demaille <akim@epita.fr>
13229
13230 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
13231 nritems.
13232 Adjust dependencies.
13233
f3849179
AD
132342002-04-07 Akim Demaille <akim@epita.fr>
13235
13236 * src/reader.c: Normalize increments to prefix form.
13237
bd02036a
AD
132382002-04-07 Akim Demaille <akim@epita.fr>
13239
13240 * src/reader.c, symtab.c: Remove debugging code.
13241
db8837cb
AD
132422002-04-07 Akim Demaille <akim@epita.fr>
13243
13244 Rename all the `bucket's as `symbol_t'.
13245
13246 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
13247 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
13248 * src/symtab.c, src/symtab.h (bucket): Rename as...
13249 (symbol_t): this.
13250 (symbol_list_new, bucket_check_defined, bucket_make_alias)
13251 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
13252 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13253 (buckets_new, buckets_free, buckets_do): Rename as...
13254 (symbol_list_new, symbol_check_defined, symbol_make_alias)
13255 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13256 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
13257 (symbols_new, symbols_free, symbols_do): these.
13258
72a23c97
AD
132592002-04-07 Akim Demaille <akim@epita.fr>
13260
13261 Use lib/hash for the symbol table.
13262
13263 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
13264 EOF.
13265 * src/lex.c (lex): Set the `number' member of new terminals.
13266 * src/reader.c (bucket_check_defined, bucket_make_alias)
13267 (bucket_check_alias_consistence, bucket_translation): New.
13268 (reader, grammar_free, readgram, token_translations_init)
13269 (packsymbols): Adjust.
13270 (reader): Number the predefined tokens.
13271 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
13272 for predefined tokens.
13273 * src/symtab.h (bucket): Remove all the hash table related
13274 members.
13275 * src/symtab.c (symtab): Replace by...
13276 (bucket_table): this.
13277 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13278 (buckets_new, buckets_do): New.
13279
280a38c3
AD
132802002-04-07 Akim Demaille <akim@epita.fr>
13281
13282 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
13283 (start_symbol, max_user_token_number, semantic_parser)
13284 (error_token_number): Initialize.
13285 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
13286 Initialize.
13287 (reader): Don't.
13288 (errtoken, eoftoken, undeftoken, axiom): Extern.
13289
03b31c0c
AD
132902002-04-07 Akim Demaille <akim@epita.fr>
13291
13292 * src/gram.h (rule_s): prec and precsym are now pointers
13293 to the bucket giving the priority/associativity.
13294 Member `associativity' removed: useless.
13295 * src/reduce.c, src/conflicts.c: Adjust.
13296
8b3df748
AD
132972002-04-07 Akim Demaille <akim@epita.fr>
13298
13299 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
13300 Properly escape the symbols' TAG when outputting them.
13301
e601aa1d
AD
133022002-04-07 Akim Demaille <akim@epita.fr>
13303
13304 * src/lalr.h (LA): Is a bitsetv, not bitset*.
13305
b0299a2e
AD
133062002-04-07 Akim Demaille <akim@epita.fr>
13307
13308 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
13309 (LArule): this, which is an array to rule_t*.
13310 * src/print.c, src/conflicts.c: Adjust.
13311
d7e1f00c
AD
133122002-04-07 Akim Demaille <akim@epita.fr>
13313
13314 * src/gram.h (rule_t): Rename `number' as `user_number'.
13315 `number' is a new member.
13316 Adjust dependencies.
13317 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
13318
cc9305dd
AD
133192002-04-07 Akim Demaille <akim@epita.fr>
13320
13321 As a result of the previous patch, it is no longer needed
13322 to reorder ritem itself.
13323
13324 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
13325
b0940840
AD
133262002-04-07 Akim Demaille <akim@epita.fr>
13327
13328 Be sure never to walk through RITEMS, but use only data related to
13329 the rules themselves. RITEMS should be banished.
13330
13331 * src/output.c (output_token_translations): Rename as...
13332 (prepare_tokens): this.
13333 In addition to `translate', prepare the muscles `tname' and
13334 `toknum', which were handled by...
13335 (output_rule_data): this.
13336 Remove, and move the remainder of its outputs into...
13337 (prepare_rules): this new routines, which also merges content from
13338 (output_gram): this.
13339 (prepare_rules): Be sure never to walk through RITEMS.
13340 (output_stos): Rename as...
13341 (prepare_stos): this.
13342 (output): Always invoke prepare_states, after all, just don't use it
13343 in the output if you don't need it.
13344
643a5994
AD
133452002-04-07 Akim Demaille <akim@epita.fr>
13346
13347 * src/LR0.c (new_state): Display `nstates' as the name of the
13348 newly created state.
13349 Adjust to initialize first_state and last_state if needed.
13350 Be sure to distinguish the initial from the final state.
13351 (new_states): Create the itemset of the initial state, and use
13352 new_state.
13353 * src/closure.c (closure): Now that the initial state has its
13354 items properly set, there is no need for a special case when
13355 creating `ruleset'.
13356
13357 As a result, now the rule 0, reducing to $axiom, is visible in the
13358 outputs. Adjust the test suite.
13359
13360 * tests/conflicts.at (Solved SR Conflicts)
13361 (Unresolved SR Conflicts): Adjust.
13362 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
13363 * tests/conflicts.at (S/R in initial): New.
13364
b4c4ccc2
AD
133652002-04-07 Akim Demaille <akim@epita.fr>
13366
13367 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
13368 the RHS of the rules.
13369 * src/output.c (output_gram): Likewise.
13370
bba97eb2
AD
133712002-04-07 Akim Demaille <akim@epita.fr>
13372
13373 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
13374 bucket.
13375 Adjust all dependencies.
13376 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
13377 `number' of the buckets too.
13378 * src/gram.h: Include `symtab.h'.
13379 (associativity): Move to...
13380 * src/symtab.h: here.
13381 No longer include `gram.h'.
13382
c3b407f4
AD
133832002-04-07 Akim Demaille <akim@epita.fr>
13384
13385 * src/gram.h, src/gram.c (rules_rhs_length): New.
13386 (ritem_longest_rhs): Use it.
13387 * src/gram.h (rule_t): `number' is a new member.
13388 * src/reader.c (packgram): Set it.
13389 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
13390 the end of `rules', and count them out of `nrules'.
13391 (reduce_output, dump_grammar): Adjust.
13392 * src/print.c (print_grammar): It is no longer needed to check for
13393 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
13394 * tests/reduce.at (Reduced Automaton): New test.
13395
11652ab3
AD
133962002-04-07 Akim Demaille <akim@epita.fr>
13397
13398 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
13399 lacking `+ 1' to nrules, Bison reported as useless a token if it
13400 was used solely to set the precedence of the last rule...
13401
26b23c1a
AD
134022002-04-07 Akim Demaille <akim@epita.fr>
13403
13404 * data/bison.c++, data/bison.simple: Don't output the current file
13405 name in #line, to avoid useless diffs between two identical
13406 outputs under different names.
13407
18bcecb0
AD
134082002-04-07 Akim Demaille <akim@epita.fr>
13409
13410 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
13411 Normalize loops to using `< nrules + 1', not `<= nrules'.
13412
fa770c86
AD
134132002-04-07 Akim Demaille <akim@epita.fr>
13414
13415 * TODO: Update.
13416
d9b739c3
AD
134172002-04-07 Akim Demaille <akim@epita.fr>
13418
13419 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
13420 bucket.value as bucket.number.
13421
99013900
AD
134222002-04-07 Akim Demaille <akim@epita.fr>
13423
13424 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
13425 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13426 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
13427 RHS, instead of being an index in RITEMS.
13428
e966383b
PE
134292002-04-04 Paul Eggert <eggert@twinsun.com>
13430
13431 * doc/bison.texinfo: Update copyright date.
13432 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
13433 (Symbols): Warn about running Bison in one character set,
13434 but compiling and/or running in an incompatible one.
13435 Warn about character code 256, too.
13436
134372002-04-03 Paul Eggert <eggert@twinsun.com>
13438
13439 * src/bison.data (YYSTACK_ALLOC): Depend on whether
13440 YYERROR_VERBOSE is nonzero, not whether it is defined.
13441
13442 Merge changes from bison-1_29-branch.
c307773e 13443
8d6c48b9
PE
134442002-03-20 Paul Eggert <eggert@twinsun.com>
13445
13446 Merge fixes from Debian bison_1.34-1.diff.
13447
13448 * configure.in (AC_PREREQ): 2.53.
13449
e53c6322
AD
134502002-03-20 Akim Demaille <akim@epita.fr>
13451
13452 * src/conflicts.c (log_resolution): Argument `resolution' is const.
13453
9ffbeca7
PE
134542002-03-19 Paul Eggert <eggert@twinsun.com>
13455
21db0b2a
PE
13456 * src/bison.simple (YYCOPY): New macro.
13457 (YYSTACK_RELOCATE): Use it.
13458 Remove Type arg; no longer needed. All callers changed.
13459 (yymemcpy): Remove; no longer needed.
13460
9ffbeca7
PE
13461 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
13462 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13463
642cb8f8
AD
134642002-03-19 Akim Demaille <akim@epita.fr>
13465
13466 Test and fix the #line outputs.
13467
13468 * tests/atlocal.at (GCC): New.
13469 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 13470 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
13471 (Action synch line, Epilogue synch line): New tests.
13472 * src/reader.c (parse_union_decl): Define the muscle stype_line.
13473 * data/bison.simple, data/bison.c++: Use it.
13474
3c31a486
AD
134752002-03-19 Akim Demaille <akim@epita.fr>
13476
13477 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
13478 (Solved SR Conflicts, %expect not enough, %expect right)
13479 (%expect too much): Move to...
13480 * tests/conflicts.at: this new file.
13481
0d8bed56
AD
134822002-03-19 Akim Demaille <akim@epita.fr>
13483
13484 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13485 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
13486 that we can move to enums for instance.
13487 * src/output.c (token_definitions_output): Output a list of
13488 `token-name, token-number' instead of the #define.
13489 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
13490
9208d17f
AD
134912002-03-14 Akim Demaille <akim@epita.fr>
13492
13493 Use Gettext 0.11.1.
13494
af27eacb
RA
134952002-03-09 Robert Anisko <robert@lrde.epita.fr>
13496
13497 * data/bison.c++: Make the user able to add members to the generated
13498 parser by subclassing.
13499
9101a310
RA
135002002-03-05 Robert Anisko <robert@lrde.epita.fr>
13501
13502 * src/reader.c (read_additionnal_code): `c' should be an integer, not
13503 a character.
13504 Reported by Nicolas Tisserand and Nicolas Burrus.
13505
fff9bf0b
RA
135062002-03-04 Robert Anisko <robert@lrde.epita.fr>
13507
13508 * src/reader.c: Warn about lacking semi-colons, do not complain.
13509
64dba31e
RA
135102002-03-04 Robert Anisko <robert@lrde.epita.fr>
13511
13512 * data/bison.c++: Remove a debug line.
13513
374f5a14
RA
135142002-03-04 Robert Anisko <robert@lrde.epita.fr>
13515
13516 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
13517 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
13518 provide a default implementation.
13519
bfcf1f3a
AD
135202002-03-04 Akim Demaille <akim@epita.fr>
13521
13522 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
13523 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
13524 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
13525 * tests/semantic.at (Parsing Guards): Similarly.
13526 * src/reader.at (readgram): Complain if the last rule is not ended
13527 with a semi-colon.
13528
65ccf9fc
AD
135292002-03-04 Akim Demaille <akim@epita.fr>
13530
13531 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
13532 * src/closure.c: here.
13533 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
13534 RTC.
13535 * src/warshall.h, src/warshall.c: Remove.
13536 * tests/sets.at (Broken Closure): Adjust.
13537
d0039cbc
AD
135382002-03-04 Akim Demaille <akim@epita.fr>
13539
13540 * src/output.c (output_skeleton): tempdir is const.
13541 bytes_read is unused.
13542
345cea78
AD
135432002-03-04 Akim Demaille <akim@epita.fr>
13544
13545 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13546 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
13547 Update.
13548 From Michael Hayes.
13549
564801f7
AD
135502002-03-04 Akim Demaille <akim@epita.fr>
13551
13552 * src/closure.c (closure): `r' is unused.
13553
e5352bc7
AD
135542002-03-04 Akim Demaille <akim@epita.fr>
13555
13556 * tests/sets.at (Broken Closure): Add the ending `;'.
13557 * src/reader.at (readgram): Complain if a rule is not ended with a
13558 semi-colon.
13559
914feea9
AD
135602002-03-04 Akim Demaille <akim@epita.fr>
13561
13562 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
13563 (count_sr_conflicts): Use bitset_count.
13564 * src/reduce.c (inaccessable_symbols): Ditto.
13565 (bits_size): Remove.
13566 * src/warshall.h, src/warshall.c: Convert to bitsetv.
13567
f0250de6
AD
135682002-03-04 Akim Demaille <akim@epita.fr>
13569
13570 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
13571 * src/reduce.c: Remove the `bitset_zero's following the
13572 `bitset_create's, as now it is performed by the latter.
13573
ef017502
AD
135742002-03-04 Akim Demaille <akim@epita.fr>
13575
13576 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
13577 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
13578 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
13579 latest sources from Michael.
13580
76514394
AD
135812002-03-04 Akim Demaille <akim@epita.fr>
13582
13583 * src/output.c (output): Don't free the grammar.
13584 * src/reader.c (grammar_free): New.
13585 * src/main.c (main): Call it and don't free symtab here.
13586
55024580
AD
135872002-03-04 Akim Demaille <akim@epita.fr>
13588
13589 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
13590 before returning.
13591 Reported by Benoit Perrot.
13592
f9abaa2c
AD
135932002-03-04 Akim Demaille <akim@epita.fr>
13594
13595 Use bitset operations when possible, not loops over bits.
13596
13597 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
13598 bitset_or.
13599 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
13600 * src/reduce.c (useless_nonterminals): Formatting changes.
13601 * src/warshall.c (TC): Use bitset_or.
13602
0e721e75
AD
136032002-03-04 Akim Demaille <akim@epita.fr>
13604
13605 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
13606 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
13607 Ditto.
13608
0fb1ffb1
AD
136092002-03-04 Akim Demaille <akim@epita.fr>
13610
13611 * src/lalr.c (F): Now a bitset*.
13612 Adjust all dependencies.
13613
b86796bf
AD
136142002-03-04 Akim Demaille <akim@epita.fr>
13615
13616 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
13617 Adjust all dependencies.
13618
602bbf31
AD
136192002-03-04 Akim Demaille <akim@epita.fr>
13620
13621 * src/L0.c, src/LR0.h (nstates): Be size_t.
13622 Adjust comparisons (signed vs unsigned).
13623 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
13624 bitset*.
13625 Adjust all dependencies.
13626
d8a0245c
AD
136272002-03-04 Akim Demaille <akim@epita.fr>
13628
13629 * src/closure.c (firsts): Now, also a bitset.
13630 Adjust all dependencies.
13631 (varsetsize): Remove, now unused.
13632 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
13633
34ba9743
AD
136342002-03-04 Akim Demaille <akim@epita.fr>
13635
13636 * src/print.c: Convert to use bitset.h, not hand coded iterations
13637 over ints.
13638
ed86e78c
AD
136392002-03-04 Akim Demaille <akim@epita.fr>
13640
13641 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
13642
dfdb1797
AD
136432002-03-04 Akim Demaille <akim@epita.fr>
13644
13645 * src/closure.c (ruleset): Be a bitset.
13646 (rulesetsize): Remove.
13647
7086e707
AD
136482002-03-04 Akim Demaille <akim@epita.fr>
13649
13650 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13651 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
13652 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
13653 * src/closure.c (fderives): Be an array of bitsets.
13654
98254360
RA
136552002-02-28 Robert Anisko <robert@lrde.epita.fr>
13656
13657 * data/bison.c++: Merge the two generated headers. Insert a copyright
13658 notice in each output file.
13659
a75c057f
AD
136602002-02-28 Akim Demaille <akim@epita.fr>
13661
13662 * data/bison.c++: Copy the prologue of bison.simple to fetch
13663 useful M4 definitions, such as b4_header_guard.
13664
06b00abc
AD
136652002-02-25 Akim Demaille <akim@epita.fr>
13666
13667 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
13668 translator friendly scheme for the bgr
13669 copyright notice.
06b00abc 13670
70e7d534
AD
136712002-02-25 Akim Demaille <akim@epita.fr>
13672
13673 * src/output.c (header_output): Remove, now handled completely via
13674 M4.
13675
abe017f6
AD
136762002-02-25 Akim Demaille <akim@epita.fr>
13677
13678 * m4/m4.m4: New, from CVS Autoconf.
13679 * configure.in: Invoke it.
13680 * src/output.c (output_skeleton): Use its result instead of the
13681 hard coded name.
13682
381fb12e
AD
136832002-02-25 Akim Demaille <akim@epita.fr>
13684
13685 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
13686 Fileutils 4.1.5.
13687 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
13688 * src/output.c (output_skeleton): Use mkstemp to create a real
13689 temporary file.
13690 Move the filling of `skeleton' and its muscle to...
13691 (prepare): here.
13692 (output): Move the definition of the prologue muscle to...
13693 (prepare): here.
13694 * src/system.h (DEFAULT_TMPDIR): New.
13695
6f38107f
PE
136962002-02-14 Paul Eggert <eggert@twinsun.com>
13697
13698 Remove the support for C++ namespace cleanliness; it was
13699 causing more problems than it was curing, since it didn't work
13700 properly on some nonstandard C++ compilers. This can wait
13701 for a proper C++ parser.
13702
13703 * NEWS: Document this.
13704 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
13705 of C++, as it's treated like C now.
13706 * src/bison.simple (YYSTD): Remove.
13707 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
13708 Treat C++ just like Standard C instead of trying to support
13709 namespace cleanliness.
13710
80cce3da
AD
137112002-02-14 Akim Demaille <akim@epita.fr>
13712
13713 * tests/regression.at (else): Adjust to Andreas' change.
13714
842e8679
AD
137152002-02-14 Akim Demaille <akim@epita.fr>
13716
13717 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
13718
4bda3f10
AD
137192002-02-13 Andreas Schwab <schwab@suse.de>
13720
13721 * src/output.c (output_rule_data): Don't output NULL, it might
13722 not be defined yet.
13723
4162fa07 137242002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 13725
4162fa07
RA
13726 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
13727 (Copyright notice): Update.
b418ecd8 13728
bd16a5dc
AD
137292002-02-11 Akim Demaille <akim@epita.fr>
13730
13731 * tests/regression.at (%nonassoc and eof): Don't include
13732 nonportable headers.
13733
8d69a1a3
RA
137342002-02-08 Robert Anisko <robert@lrde.epita.fr>
13735
13736 * data/bison.c++: Correct error recovery. Make the user able to
13737 initialize the starting location.
13738
9b2d0677
AD
137392002-02-07 Akim Demaille <akim@epita.fr>
13740
13741 * tests/input.at: New.
13742
69e2658b
RA
137432002-02-07 Robert Anisko <robert@lrde.epita.fr>
13744
13745 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 13746 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
13747 directives around tables only needed for debugging.
13748
4aacc3a7
RA
137492002-02-07 Robert Anisko <robert@lrde.epita.fr>
13750
13751 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
13752 C++ parsers.
13753 (yy::b4_name::parse): Use print_.
13754
762a801e
RA
137552002-02-07 Robert Anisko <robert@lrde.epita.fr>
13756
13757 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
13758
4bb2bc3f
RA
137592002-02-07 Robert Anisko <robert@lrde.epita.fr>
13760
13761 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
13762 C++ parsers.
13763 (yy::b4_name::parse): Build verbose error messages, and use error_.
13764
6b45a3ca
RA
137652002-02-06 Robert Anisko <robert@lrde.epita.fr>
13766
13767 * data/bison.c++: Fix m4 quoting in comments.
13768
50997c6e
RA
137692002-02-06 Robert Anisko <robert@lrde.epita.fr>
13770
13771 * data/bison.c++: Adjust the parser code. Fix some muscles that were
13772 not expanded by m4.
13773
3f3eed27
AD
137742002-02-05 Akim Demaille <akim@epita.fr>
13775
13776 * data/bison.c++: Adjust to the M4 back end.
13777 More is certainly needed.
13778
be2a1a68
AD
137792002-02-05 Akim Demaille <akim@epita.fr>
13780
13781 Give a try to M4 as a back end.
13782
13783 * lib/readpipe.c: New, from wdiff.
13784 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
13785 BISON_HAIRY.
13786 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
13787 specific values. Now it is m4 that performs the lookup.
13788 * src/parse-skel.y: Remove.
13789 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
13790 * src/output.c (actions_output, guards_output)
13791 (token_definitions_output): No longer keeps track of the output
13792 line number, hence remove the second argument.
13793 (guards_output): Check against the guard member of a rule, not the
13794 action member.
13795 Adjust callers.
13796 (output_skeleton): Don't look for the skeleton location, let m4 do
13797 that.
13798 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
13799 file will be used.
13800 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
13801 (prepare): Given that for the time being changesyntax is not
13802 usable in M4, rename the muscles using `-' to `_'.
13803 Define `defines_flag', `output_parser_name' and `output_header_name'.
13804 * src/output.h (actions_output, guards_output)
13805 (token_definitions_output): Adjust prototypes.
13806 * src/scan-skel.l: Instead of scanning the skeletons, it now
13807 processes the output of m4: `__oline__' and `#output'.
13808 * data/bison.simple: Adjust to be used by M4(sugar).
13809 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
13810 to date.
13811 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
13812 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
13813 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
13814 shamelessly stolen from CVS Autoconf.
13815
beda758b
AD
138162002-02-05 Akim Demaille <akim@epita.fr>
13817
13818 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
13819 * configure.in: Check for the declarations of free and malloc.
13820 * src/muscle_tab.c: Adjust.
13821
5ece6d43
AD
138222002-02-05 Akim Demaille <akim@epita.fr>
13823
13824 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
13825 which have no values.
13826
5bb18f9a
AD
138272002-02-05 Akim Demaille <akim@epita.fr>
13828
13829 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
13830 * data/: here.
13831
894dd62e
PE
138322002-01-29 Paul Eggert <eggert@twinsun.com>
13833
13834 * src/bison.simple (YYSIZE_T): Do not define merely because
13835 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
13836 On some platforms, <alloca.h> does not declare YYSTD (size_t).
13837
82841af7
AD
138382002-01-27 Akim Demaille <akim@epita.fr>
13839
13840 Fix `%nonassoc and eof'.
13841
13842 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
13843 which were not properly copied! Replace
13844 memcpy (res->errs, src->errs, src->nerrs);
13845 with
13846 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
13847 !!!
13848 * tests/regression.at (%nonassoc and eof): Adjust to newest
13849 Autotest: `.' is not in the PATH.
13850
318b76e9
AD
138512002-01-27 Akim Demaille <akim@epita.fr>
13852
13853 * tests/sets.at (AT_EXTRACT_SETS): New.
13854 (Nullable): Use it.
13855 (Firsts): New.
13856
30d2f3d5
AD
138572002-01-26 Akim Demaille <akim@epita.fr>
13858
13859 * tests/actions.at, tests/calc.at, tests/headers.at,
13860 * tests/torture.at: Adjust to the newest Autotest which no longer
13861 forces `.' in the PATH.
13862
30f8c395
AD
138632002-01-25 Akim Demaille <akim@epita.fr>
13864
13865 * tests/regression.at (%nonassoc and eof): New.
13866 Suggested by Robert Anisko.
13867
29ae55f1
AD
138682002-01-24 Akim Demaille <akim@epita.fr>
13869
13870 Bison dumps core when trying to complain about broken input files.
13871 Reported by Cris van Pelt.
13872
13873 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
13874 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
13875 into...
13876 (Invalid inputs): Strengthen: exercise parse_percent_token.
13877
2b548aa6
RA
138782002-01-24 Robert Anisko <robert.anisko@epita.fr>
13879
13880 * src/Makefile.am: Add bison.c++.
13881 * src/bison.c++: New skeleton.
13882
bb0146c2
AD
138832002-01-21 Paolo Bonzini <bonzini@gnu.org>
13884
13885 * po/it.po: New.
13886
bec30531
AD
138872002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
13888
13889 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
13890
fc6edc45
MA
138912002-01-20 Marc Autret <marc@gnu.org>
13892
13893 * src/files.c (compute_output_file_names): Fix
13894
5e5d5415
MA
138952002-01-20 Marc Autret <marc@gnu.org>
13896
13897 * tests/output.at: New test.
13898 * src/files.c (compute_base_names): Don't map extensions when
13899 the YACC flag is set, use defaults.
13900 Reported by Evgeny Stambulchik.
13901
44ea3fbd
MA
139022002-01-20 Marc Autret <marc@gnu.org>
13903
ba0fe3c7
PE
13904 * src/system.h: Need to define __attribute__ away for non-GCC
13905 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
13906 Suggested by Albert Chin-A-Young.
13907
338963d1
TVH
139082002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
13909
13910 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
13911 canonical definition.
13912 * src/system.h: Use the canonical definition for PARAMS (avoids
13913 a conflict with the macro from lib/hash.h).
13914
c57b2479
AD
139152002-01-11 Akim Demaille <akim@epita.fr>
13916
13917 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 13918 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 13919
b85810ae
AD
139202002-01-09 Akim Demaille <akim@epita.fr>
13921
13922 * src/files.c, src/files.h (output_infix): New.
13923 (tab_extension): Remove.
13924 (compute_base_names): Compute the former, drop the latter.
13925 * src/output.c (prepare): Insert the muscles `output-infix', and
13926 `output-suffix'.
13927 * src/parse-skel.y (string, string.1): New.
13928 (section.header): Use it.
13929 (section.yacc): Remove.
13930 (prefix): Remove too.
13931 * src/scan-skel.l: Adjust.
13932 * src/bison.simple, src/bison.hairy: Adjust.
13933
cae60122
AD
139342002-01-09 Akim Demaille <akim@epita.fr>
13935
13936 * configure.in (WERROR_CFLAGS): Compute it.
13937 * src/Makefile.am (CFLAGS): Pass it.
13938 * tests/atlocal.in (CFLAGS): Idem.
13939 * src/files.c: Fix a few warnings.
13940 (get_extension_index): Remove, unused.
13941
ae404801
AD
139422002-01-08 Akim Demaille <akim@epita.fr>
13943
13944 * src/getargs.c (AS_FILE_NAME): New.
13945 (getargs): Use it to convert DOSish file names.
13946 * src/files.c (base_name): Rename as full_base_name to avoid
13947 clashes with `base_name ()'.
13948 (filename_split): New.
13949 (compute_base_names): N-th rewrite, using filename_split.
13950
22312b71
AD
139512002-01-08 Akim Demaille <akim@epita.fr>
13952
13953 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
13954 New, stolen from the Fileutils 4.1.
13955 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13956 * configure.in: Check for the presence of memrchr, and of its
13957 prototype.
13958
a67cef01
TVH
139592002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
13960
13961 * lib/hash.h (__P): Added definition for this macro.
13962 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
13963 BUILT_SOURCES, to ensure they are generated first.
13964 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
13965 %error-verbose to allow bootstrapping with bison 1.30x.
13966
2b25d624
AD
139672002-01-06 Akim Demaille <akim@epita.fr>
13968
13969 * src/reader.c (parse_braces): Don't fetch the next char, the
13970 convention is to fetch on entry.
13971 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
13972 'switch' without a following semicolon.
13973 * tests/regression.at (braces parsing): New.
13974
3460813b
AD
139752002-01-06 Akim Demaille <akim@epita.fr>
13976
13977 Bison is dead wrong in its RR conflict reports.
13978
13979 * tests/torture.at (GNU Cim Grammar): New.
13980 * src/conflicts.c (count_rr_conflicts): Fix.
13981
73784c64
AD
139822002-01-06 Akim Demaille <akim@epita.fr>
13983
13984 Creating package.m4 from configure.ac causes too many problems.
13985
13986 * tests/Makefile.am (package.m4): Create it by hand,
13987 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
13988
25d81090
AD
139892002-01-06 Akim Demaille <akim@epita.fr>
13990
13991 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
13992 skeleton.h.
13993
a9b8959e
PE
139942002-01-04 Paul Eggert <eggert@twinsun.com>
13995
13996 * doc/bison.texinfo (Debugging):
13997 Remove YYSTDERR; it's no longer defined or used.
13998 Also, s/cstdio.h/cstdio/.
13999
25d81090
AD
140002002-01-03 Akim Demaille <akim@epita.fr>
14001
14002 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
14003
1109455c
AD
140042002-01-03 Akim Demaille <akim@epita.fr>
14005
14006 * src/parse-skel.y (process_skeleton): Don't bind the parser's
14007 tracing code to --trace, wait for a better --trace option, with
14008 args.
14009
7ea5e977
AD
140102002-01-03 Akim Demaille <akim@epita.fr>
14011
14012 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
14013 The ISO C++ standard is extremely clear about it: stderr is
14014 considered a macro, not a regular symbol (see table 94 `Header
14015 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
14016 Therefore std:: does not apply to it. It still does with fprintf.
14017 Also, s/cstdio.h/cstdio/.
14018
fab5b110
AD
140192002-01-03 Akim Demaille <akim@epita.fr>
14020
14021 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
14022 for non system headers.
14023
aed7fd9b
AD
140242002-01-02 Akim Demaille <akim@epita.fr>
14025
14026 Equip the skeleton chain with location tracking, runtime trace,
14027 pure parser and scanner.
14028
14029 * src/parse-skel.y: Request a pure parser, locations, and prefix
14030 renaming.
14031 (%union): Having several members with the same type does not help
14032 type mismatches, simplify.
14033 (YYPRINT, yyprint): New.
14034 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
14035 (skel_error): this.
14036 Handle locations.
14037 * src/scan-skel.l: Adjust to these changes.
14038 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
14039 (LOCATION_PRINT, skel_control_t): New.
14040
24fad99e
AD
140412001-12-30 Akim Demaille <akim@epita.fr>
14042
14043 * src/parse-skel.y: Get rid of the shift/reduce conflict:
14044 replace `gb' with BLANKS.
14045 * src/scan-skel.l: Adjust.
14046
a4b36db4
AD
140472001-12-30 Akim Demaille <akim@epita.fr>
14048
14049 * src/system.h: We don't need nor want bcopy.
14050 Throw away MS-DOS crap: we don't need getpid.
14051 * configure.in: We don't need strndup. It was even causing
14052 problems: because Flex includes the headers *before* us,
14053 _GNU_SOURCE is not defined by config.h, and therefore strndup was
14054 not visible.
14055 * lib/xstrndup.c: New.
14056 * src/scan-skel.l: Use it.
14057 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
14058 * src/parse-skel.y: Use %directives instead of #defines.
14059
1239777d
AD
140602001-12-30 Akim Demaille <akim@epita.fr>
14061
14062 * src/skeleton.h: New.
14063 * src/output.c (output_parser, output_master_parser): Remove, dead
14064 code.
14065 * src/output.h (get_lines_number, actions_output, guards_output)
14066 (token_definitions_output): Prototype them.
14067 * src/parse-skel.y: Add the license notice.
14068 Include output.h and skeleton.h.
14069 (process_skeleton): Returns void, and takes a single parameter.
14070 * src/scan-skel.l: Add the license notice.
14071 Include skeleton.h.
14072 Don't use %option yylineno: it seems that then Flex imagines
14073 REJECT has been used, and therefore it won't reallocate its
14074 buffers (which makes no other sense to me than a bug). It results
14075 in warnings for `unused: yy_flex_realloc'.
14076
9b3add5b
RA
140772001-12-30 Robert Anisko <robert.anisko@epita.fr>
14078
14079 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14080 (MUSCLE_INSERT_PREFIX): ...to there.
14081 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14082 (MUSCLE_INSERT_PREFIX): Move from here...
14083
14084 * src/bison.hairy: Add a section directive. Put braces around muscle
14085 names. This parser skeleton is still broken, but Bison should not
14086 choke on a bad muscle 'syntax'.
14087 * src/bison.simple: Add a section directive. Put braces around muscle
14088 names.
14089
14090 * src/files.h (strsuffix, stringappend): Add declarations.
14091 (tab_extension): Add declaration.
14092 (short_base_name): Add declaration.
14093
14094 * src/files.c (strsuffix, stringappend): No longer static. These
14095 functions are used in the skeleton parser.
14096 (tab_extension): New.
14097 (compute_base_names): Use the computations done in this function
fab5b110 14098 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
14099 names.
14100 (short_base_name): No longer static.
14101
14102 * src/output.c (output_skeleton): New.
14103 (output): Disable call to output_master_parser, and give a try to
14104 a new skeleton handling system.
14105 (guards_output, actions_output): No longer static.
14106 (token_definitions_output, get_lines_number): No longer static.
14107
14108 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
14109
fab5b110 14110 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
14111 parse-skel.y.
14112
14113 * src/parse-skel.y: New file.
14114 * src/scan-skel.l: New file.
14115
b5b61c61
AD
141162001-12-29 Akim Demaille <akim@epita.fr>
14117
14118 %name-prefix is broken.
14119
14120 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
14121 Adjust all dependencies.
14122 * tests/headers.at (export YYLTYPE): Strengthen this test: use
14123 %name-prefix.
14124
14125 Renaming yylval but not yylloc is not consistent. Now we do.
14126
14127 * src/bison.simple: Prefix yylloc if used.
14128 * doc/bison.texinfo (Decl Summary): Document that.
14129
8c9a50be
AD
141302001-12-29 Akim Demaille <akim@epita.fr>
14131
14132 * doc/bison.texinfo: Promote `%long-directive' over
14133 `%long_directive'.
14134 Remove all references to fixed-output-files, yacc is enough.
14135
d99361e6
AD
141362001-12-29 Akim Demaille <akim@epita.fr>
14137
14138 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
14139 user prologue. These are defaults.
14140 * tests/actions.at (Mid-rule actions): Make sure the user can
14141 define YYDEBUG and YYERROR_VERBOSE.
14142
b9cecb91
AD
141432001-12-29 Akim Demaille <akim@epita.fr>
14144
14145 * src/output.c (header_output): Don't forget to export YYLTYPE and
14146 yylloc.
14147 * tests/headers.at (export YYLTYPE): New, make sure it does.
14148 * tests/regression.at (%union and --defines, Invalid CPP headers):
14149 Move to...
14150 * tests/headers.at: here.
14151
aea13e97
AD
141522001-12-29 Akim Demaille <akim@epita.fr>
14153
14154 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
14155
931394cb
AD
141562001-12-29 Akim Demaille <akim@epita.fr>
14157
14158 * tests/actions.at (Mid-rule actions): Output on a single line
14159 instead of several.
14160
704a47c4
AD
141612001-12-29 Akim Demaille <akim@epita.fr>
14162
14163 * doc/bison.texinfo: Formatting changes.
14164
091e20bb
AD
141652001-12-29 Akim Demaille <akim@epita.fr>
14166
14167 Don't store the token defs in a muscle, just be ready to output it
14168 on command. Now possible via `symbols'. Fixes a memory leak.
14169
14170 * src/output.c (token_definitions_output): New.
14171 (output_parser, header_output): Use it.
14172 * src/reader.c (symbols_save): Remove.
14173
cce71710
AD
141742001-12-29 Akim Demaille <akim@epita.fr>
14175
14176 * src/bison.simple: Do not provide a default for YYSTYPE and
14177 YYLTYPE before the user's prologue. Otherwise it's hardly... a
14178 default.
14179
82c035a8
AD
141802001-12-29 Akim Demaille <akim@epita.fr>
14181
14182 Mid-rule actions are simply... ignored!
14183
14184 * src/reader.c (readgram): Be sure to attach mid-rule actions to
14185 the empty-rule associated to the dummy symbol, not to the host
14186 rule.
14187 * tests/actions.at (Mid-rule actions): New.
14188
8419d367
AD
141892001-12-29 Akim Demaille <akim@epita.fr>
14190
14191 Memory leak.
14192
14193 * src/reader.c (reader): Free grammar.
14194
375d5806
AD
141952001-12-29 Akim Demaille <akim@epita.fr>
14196
14197 Memory leak.
14198
14199 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
14200 since it allocates it for each state, although only one is needed.
14201 (allocate_storage): Do it here.
14202
f51cb8ff
AD
142032001-12-29 Akim Demaille <akim@epita.fr>
14204
14205 * src/options.h, src/options.c (create_long_option_table): Rename
14206 as...
14207 (long_option_table_new): this, with a clearer prototype.
14208 (percent_table): Remove, unused,
14209 * src/getargs.c (getargs): Adjust.
14210
29e88316
AD
142112001-12-29 Akim Demaille <akim@epita.fr>
14212
14213 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
14214 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
14215 as states.
14216
b9f71f19
AD
142172001-12-29 Akim Demaille <akim@epita.fr>
14218
14219 * src/lalr.c (build_relations): Rename `states' as `states1'.
14220 Sorry, I don't understand exactly what it is, no better name...
14221
1a2b5d37
AD
142222001-12-29 Akim Demaille <akim@epita.fr>
14223
14224 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
14225 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
14226 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
14227 as rules.
14228
1cca533e
AD
142292001-12-29 Akim Demaille <akim@epita.fr>
14230
14231 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
14232 ago.
14233
c03ae966
AD
142342001-12-29 Akim Demaille <akim@epita.fr>
14235
14236 * src/reader.c, src/reader.h (user_toknums): Remove.
14237 Adjust all users to use symbols[i]->user_token_number.
14238
5a670b1e
AD
142392001-12-29 Akim Demaille <akim@epita.fr>
14240
14241 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
14242 Adjust all users to use symbols[i]->prec or ->assoc.
14243
ad949da9
AD
142442001-12-29 Akim Demaille <akim@epita.fr>
14245
14246 * src/reader.c, src/reader.h (tags): Remove.
14247 Adjust all users to use symbols[i]->tag.
14248
0e78e603
AD
142492001-12-29 Akim Demaille <akim@epita.fr>
14250
14251 * src/gram.h, src/gram.c (symbols): New, similar to state_table
14252 and rule_table.
14253 * src/reader.c (packsymbols): Fill this table.
14254 Drop sprec.
14255 * src/conflicts.c (resolve_sr_conflict): Adjust.
14256 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
14257 single table.
14258 Use symbols[i]->tag instead of tags[i].
14259
213e640e
AD
142602001-12-29 Akim Demaille <akim@epita.fr>
14261
14262 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
14263 In addition, put a comment in there, to replace...
14264 * tests/regression.at (%union and C comments): Remove.
14265
e7b8bef1
AD
142662001-12-29 Akim Demaille <akim@epita.fr>
14267
14268 * tests/regression.at (Web2c Actions): Blindly move the actual
14269 output as expected output. The contents *seem* right to me, but I
14270 can't pretend reading perfectly parser tables... Nonetheless, all
14271 the other tests pass correctly, the table look OK, even though the
14272 presence of `$axiom' is to be noted: AFAICS it is useless (but
14273 harmless).
14274
b68e7744
AD
142752001-12-29 Akim Demaille <akim@epita.fr>
14276
14277 * src/reader.c (readgram): Don't add the rule 0 if there were no
14278 rules read. In other words, add it _after_ having performed
14279 grammar sanity checks.
14280 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
14281
78d5bae9
AD
142822001-12-29 Akim Demaille <akim@epita.fr>
14283
14284 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
14285 visible, and some states have now a different number.
14286
ff442794
AD
142872001-12-29 Akim Demaille <akim@epita.fr>
14288
14289 * src/reader.c (readgram): Bind the initial rule's lineno to that
14290 of the first rule.
14291 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
14292 (Solved SR Conflicts): Adjust rule 0's line number.
14293
610ab194
AD
142942001-12-29 Akim Demaille <akim@epita.fr>
14295
14296 Fix the `GAWK Grammar' failure.
14297
14298 * src/LR0.c (final_state): Initialize to -1 so that we do compute
14299 the reductions of the first state which was mistakenly confused
14300 with the final state because precisely final_state was initialized
14301 to 0.
14302 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
14303 now noticed by Bison.
14304 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
14305 have a reduction on $default.
14306
29d29c8f
AD
143072001-12-29 Akim Demaille <akim@epita.fr>
14308
14309 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
14310 rule line numbers.
14311 * src/closure.c (print_closure): Likewise.
14312 * src/derives.c (print_derives): Likewise.
14313 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
14314 now.
14315
7c6b64d0
AD
143162001-12-29 Akim Demaille <akim@epita.fr>
14317
14318 * src/lalr.c (lookaheads_print): New.
14319 (lalr): Call it when --trace-flag.
14320 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
14321 are dumped.
14322
3d4daee3
AD
143232001-12-29 Akim Demaille <akim@epita.fr>
14324
14325 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
14326 when walking through ritem, even via rule->rhs.
14327 * src/reduce.c (dump_grammar, useful_production, reduce_output)
14328 (useful_production, useless_nonterminals): Likewise.
14329 (reduce_grammar_tables): Likewise, plus update nritems.
14330 * src/nullable.c (set_nullable): Likewise.
14331 * src/lalr.c (build_relations): Likewise.
14332 * tests/sets.at (Nullable): Adjust.
14333 Fortunately, now, the $axiom is no longer nullable.
14334
9e7f6bbd
AD
143352001-12-29 Akim Demaille <akim@epita.fr>
14336
14337 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
14338 the 0-sentinel.
14339 * src/gram.c (ritem_longest_rhs): Likewise.
14340 * src/reduce.c (nonterminals_reduce): Likewise.
14341 * src/print_graph.c (print_graph): Likewise.
14342 * src/output.c (output_rule_data): Likewise.
14343 * src/nullable.c (set_nullable): Likewise.
14344
255ef638
AD
143452001-12-29 Akim Demaille <akim@epita.fr>
14346
14347 * src/output.c: Comment changes.
14348
0d8a7363
AD
143492001-12-27 Paul Eggert <eggert@twinsun.com>
14350
14351 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
14352 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
14353 Sparc, as they were causing more porting problems than the
14354 (minor) performance improvement was worth.
14355
14356 Also, catch up with 1.31's YYSTD.
14357
3db472b9
AD
143582001-12-27 Akim Demaille <akim@epita.fr>
14359
14360 * src/output.c (output_gram): Rely on nritems, not the
14361 0-sentinel. See below.
14362 Use -1 as separator, not 0.
14363 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
14364 Rely on -1 as separator in yyrhs, instead of 0.
14365 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
14366 twice `Now at end of input', therefore there are two lines less to
14367 expect.
14368
b365aa05
AD
143692001-12-27 Akim Demaille <akim@epita.fr>
14370
14371 * tests/regression.at (Unresolved SR Conflicts):
14372 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
14373 below.
14374
30171f79
AD
143752001-12-27 Akim Demaille <akim@epita.fr>
14376
14377 * src/LR0.c (new_state): Recognize the final state by the fact it
14378 is reached by eoftoken.
14379 (insert_start_shifting_state, insert_eof_shifting_state)
14380 (insert_accepting_state, augment_automaton): Remove, since now
14381 these states are automatically computed from the initial state.
14382 (generate_states): Adjust.
14383 * src/print.c: When reporting a rule number to the user, substract
14384 1, so that the axiom rule is rule 0, and the first user rule is 1.
14385 * src/reduce.c: Likewise.
14386 * src/print_graph.c (print_core): For the time being, just as for
14387 the report, depend upon --trace-flags to dump the full set of
14388 items.
14389 * src/reader.c (readgram): Once the grammar read, insert the rule
14390 0: `$axiom: START-SYMBOL $'.
14391 * tests/set.at: Adjust: rule 0 is now displayed, and since the
14392 number of the states has changed (the final state is no longer
14393 necessarily the last), catch up.
14394
75142d45
AD
143952001-12-27 Akim Demaille <akim@epita.fr>
14396
14397 Try to make the use of the eoftoken valid. Given that its value
14398 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
14399 is used instead of > 0 where appropriate, (ii), depend upon nritems
14400 instead of the 0-sentinel.
14401
14402 * src/gram.h, src/gram.c (nritems): New.
14403 Expected to be duplication of nitems, but for the time being...
14404 * src/reader.c (packgram): Assert nritems and nitems are equal.
14405 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
14406 * src/closure.c (print_closure, print_fderives): Likewise.
14407 * src/gram.c (ritem_print): Likewise.
14408 * src/print.c (print_core, print_grammar): Likewise.
14409 * src/print_graph.c: Likewise.
14410
b7c49edf
AD
144112001-12-27 Akim Demaille <akim@epita.fr>
14412
14413 * src/main.c (main): If there are complains after grammar
14414 reductions, then output the report anyway if requested, then die.
14415 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
14416 * src/reader.c (eoftoken): New.
14417 (parse_token_decl): If the token being defined has value `0', it
14418 is the eoftoken.
14419 (packsymbols): No longer hack `tags' to insert `$' by hand.
14420 Be sure to preserve the value of the eoftoken.
14421 (reader): Make sure eoftoken is defined.
14422 Initialize nsyms to 0: now eoftoken is created just like the others.
14423 * src/print.c (print_grammar): Don't special case the eof token.
14424 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
14425 lie anyway, albeit pleasant.
14426 * tests/calc.at: Exercise error messages with eoftoken.
14427 Change the grammar so that empty input is invalid.
14428 Adjust expectations.
14429 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
14430
ec2da99f
AD
144312001-12-27 Akim Demaille <akim@epita.fr>
14432
14433 * configure.in: Check the protos of strchr ans strspn.
14434 Replace strchr if needed.
14435 * src/system.h: Provide the protos of strchr, strspn and memchr if
14436 missing.
14437 * lib/strchr.c: New.
14438 * src/reader.c (symbols_save): Use strchr.
14439
8adfa272
AD
144402001-12-27 Akim Demaille <akim@epita.fr>
14441
14442 * src/print.c, src/print_graph.c (escape): New.
14443 Use it to quote the TAGS outputs.
14444 * src/print_graph.c (print_state): Now errors are in red, and
14445 reductions in green.
14446 Prefer high to wide: output the state number on a line of its own.
14447
80dac38c
AD
144482001-12-27 Akim Demaille <akim@epita.fr>
14449
14450 * src/state.h, src/state.c (reductions_new): New.
14451 * src/LR0.c (set_state_table): Let all the states have a
14452 `reductions', even if reduced to 0.
14453 (save_reductions): Adjust.
14454 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
14455 * src/print.c (print_reductions, print_actions): Adjust.
14456 * src/output.c (action_row): Adjust.
14457
2cec70b9
AD
144582001-12-27 Akim Demaille <akim@epita.fr>
14459
14460 * src/state.h, src/state.c (errs_new, errs_dup): New.
14461 * src/LR0.c (set_state_table): Let all the states have an errs,
14462 even if reduced to 0.
14463 * src/print.c (print_errs, print_reductions): Adjust.
14464 * src/output.c (output_actions, action_row): Adjust.
14465 * src/conflicts.c (resolve_sr_conflict): Adjust.
14466
13ca549a
AD
144672001-12-27 Akim Demaille <akim@epita.fr>
14468
14469 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
14470
5092aba5
AD
144712001-12-27 Akim Demaille <akim@epita.fr>
14472
14473 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
14474 * src/print.c: here.
14475 (lookaheadset, shiftset): New, used as additional storage by
14476 print_reductions.
14477 (print_results): Adjust.
14478 (print_shifts, print_gotos, print_errs): New, extracted from...
14479 (print_actions): here.
14480 * src/print_graph.c (print_actions): Remove dead code.
14481
11e2beca
AD
144822001-12-27 Akim Demaille <akim@epita.fr>
14483
14484 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
14485 `$n' and `@n'.
14486
dac3c910
AD
144872001-12-27 Akim Demaille <akim@epita.fr>
14488
14489 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
14490 (build_relations): Adjust.
14491
d0b0fefa
AD
144922001-12-27 Akim Demaille <akim@epita.fr>
14493
14494 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
14495 duplication.
14496
adc8c848
AD
144972001-12-27 Akim Demaille <akim@epita.fr>
14498
14499 * src/reader.c (packgram): Catch nitems overflows.
14500
14d293ac
AD
145012001-12-27 Akim Demaille <akim@epita.fr>
14502
14503 * src/files.c, src/files.h (guard_obstack): Remove.
14504 * src/output.c (output): Adjust.
14505 * src/reader.c (parse_braces): New, factoring...
14506 (copy_action, copy_guard): these two which are renamed as...
14507 (parse_action, parse_guard): these.
14508 As a voluntary consequence, using braces around guards is now
14509 mandatory.
14510
f499b062
AD
145112001-12-27 Akim Demaille <akim@epita.fr>
14512
14513 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
14514 * src/reader.c (symbol_list): `guard' and `guard_line' are new
14515 members.
14516 (symbol_list_new): Adjust.
14517 (copy_action): action_line is the first line, not the last.
14518 (copy_guard): Just as for actions, store the `action' only, not
14519 the switch/case/break flesh.
14520 Don't parse the user action that might follow the guard, let...
14521 (readgram): do it, i.e., now, there can be an action after a
14522 guard.
14523 In other words the guard is just explicitly optional.
14524 (packgram): Adjust.
14525 * src/output.c (guards_output): New.
14526 (output_parser): Call it when needed.
14527 (output): Also free the guard and attrs obstacks.
14528 * src/files.c, src/files.h (obstack_save): Remove.
14529 (output_files): Remove.
14530 As a result, if one needs the former `.act' file, using an
14531 appropriate skeleton which requires actions and guards is now
14532 required.
14533 * src/main.c (main): Adjust.
14534 * tests/semantic.at: New.
14535 * tests/regression.at: Use `input.y' as input file name.
14536 Avoid 8+3 problems by requiring input.c when the test needs the
14537 parser.
14538
d945f5cd
AD
145392001-12-27 Akim Demaille <akim@epita.fr>
14540
14541 * src/reader.c (symbol_list_new): Be sure to initialize all the
14542 fields.
14543
d200e455
AD
145442001-12-27 Akim Demaille <akim@epita.fr>
14545
14546 All the hacks using a final pseudo state are now useless.
14547
14548 * src/LR0.c (set_state_table): state_table holds exactly nstates.
14549 * src/lalr.c (nLA): New.
14550 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
14551 instead of lookaheadsp from the pseudo state (nstate + 1).
14552
f9507c28
AD
145532001-12-27 Akim Demaille <akim@epita.fr>
14554
14555 * src/output.c (action_row, token_actions): Use a state_t instead
14556 of a integer, and nlookaheads instead of the following state's
14557 lookaheadsp.
14558
065fbd27
AD
145592001-12-27 Akim Demaille <akim@epita.fr>
14560
14561 * src/conflicts.c (log_resolution, flush_shift)
14562 (resolve_sr_conflict, set_conflicts, solve_conflicts)
14563 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
14564 (conflicts_print, print_reductions): Use a state_t instead of an
14565 integer when referring to a state.
14566 As much as possible, depend upon nlookaheads, instead of the
14567 `lookaheadsp' member of the following state (since lookaheads of
14568 successive states are successive, the difference between state n + 1
14569 and n served as the number of lookaheads for state n).
14570 * src/lalr.c (add_lookback_edge): Likewise.
14571 * src/print.c (print_core, print_actions, print_state)
14572 (print_results): Likewise.
14573 * src/print_graph.c (print_core, print_actions, print_state)
14574 (print_graph): Likewise.
14575 * src/conflicts.h: Adjust.
14576
1b177bd7
AD
145772001-12-27 Akim Demaille <akim@epita.fr>
14578
14579 * src/bison.hairy: Formatting/comment changes.
14580 ANSIfy.
14581 Remove `register' indications.
14582 Add plenty of `static'.
14583
7742ddeb
AD
145842001-12-27 Akim Demaille <akim@epita.fr>
14585
14586 * src/output.c (prepare): Drop the muscle `ntbase' which
14587 duplicates ntokens.
14588 * src/bison.simple: Formatting/comment changes.
14589 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
14590 is an undocumented synonym.
14591
1fa14068
AD
145922001-12-22 Akim Demaille <akim@epita.fr>
14593
14594 * src/output.c (output_table_data): Change the prototype to use
14595 `int' for array ranges: some invocations do pass an int, not a
14596 short.
14597 Reported by Wayne Green.
14598
b9752825
AD
145992001-12-22 Akim Demaille <akim@epita.fr>
14600
14601 Some actions of web2c.y are improperly triggered.
14602 Reported by Mike Castle.
14603
14604 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
14605 * tests/regression.at (Web2c): Rename as...
14606 (Web2c Report): this.
14607 (Web2c Actions): New.
14608
776209d6
AD
146092001-12-22 Akim Demaille <akim@epita.fr>
14610
14611 Reductions in web2c.y are improperly reported.
14612 Reported by Mike Castle.
14613
14614 * src/conflicts.c (print_reductions): Fix.
14615 * tests/regression.at (Web2c): New.
14616
275fc3ad
AD
146172001-12-18 Akim Demaille <akim@epita.fr>
14618
14619 Some host fail on `assert (!"foo")', which expands to
14620 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
14621 Reported by Nelson Beebee.
14622
14623 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
14624 `#define it_succeeded 0' and `assert (it_succeeded)'.
14625
897668ee
MA
146262001-12-17 Marc Autret <autret_m@epita.fr>
14627
14628 * src/bison.simple: Don't hard code the skeleton line and filename.
14629 * src/output.c (output_parser): Rename 'line' as 'output_line'.
14630 New line counter 'skeleton_line' (skeleton-line muscle).
14631
ab3399e0
PE
146322001-12-17 Paul Eggert <eggert@twinsun.com>
14633
14634 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
14635 YYDEBUG must be defined to a nonzero value.
14636
14637 * src/bison.simple (yytname): Do not assume that the user defines
14638 YYDEBUG to a properly parenthesized expression.
14639
3877f72b
AD
146402001-12-17 Akim Demaille <akim@epita.fr>
14641
14642 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
14643 nlookaheads is a new member.
14644 Adjust all users.
14645 * src/lalr.h (nlookaheads): Remove this orphan declaration.
14646 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
14647 state.
776209d6 14648
331dbc1b
AD
146492001-12-17 Akim Demaille <akim@epita.fr>
14650
14651 * src/files.h, src/files.c (open_files, close_files): Remove.
14652 * src/main.c (main): Don't open/close files, nor invoke lex_free,
14653 let...
14654 * src/reader.c (reader): Do it.
776209d6 14655
be750e4c
AD
146562001-12-17 Akim Demaille <akim@epita.fr>
14657
14658 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 14659
709ae8c6
AD
146602001-12-17 Akim Demaille <akim@epita.fr>
14661
14662 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
14663 (flush_reduce): New.
14664 (resolve_sr_conflict): Adjust.
776209d6 14665
f87685c3
AD
146662001-12-17 Akim Demaille <akim@epita.fr>
14667
14668 * src/output.c (output_obstack): Be static and rename as...
14669 (format_obstack): this, to avoid any confusion with files.c's
14670 output_obstack.
14671 * src/reader.h (muscle_obstack): Move to...
14672 * src/output.h: here, since it's defined in output.c.
14673
837491d8
AD
146742001-12-17 Akim Demaille <akim@epita.fr>
14675
14676 * src/output.c (action_row, save_column, default_goto)
14677 (sort_actions, matching_state, pack_vector): Better variable
14678 locality.
14679
796d61fb
AD
146802001-12-17 Akim Demaille <akim@epita.fr>
14681
14682 * src/output.c: Various formatting changes.
776209d6 14683
64d15509
AD
146842001-12-17 Akim Demaille <akim@epita.fr>
14685
14686 * src/files.c (output_files): Free the output_obstack.
14687 * src/main.c (main): Call print and print_graph conditionally.
14688 * src/print.c (print): Work unconditionally.
14689 * src/print_graph.c (print_graph): Work unconditionally.
14690 * src/conflicts.c (log_resolution): Output only if verbose_flag.
14691
fbc8ecb7
MA
146922001-12-16 Marc Autret <autret_m@epita.fr>
14693
14694 * src/output.c (actions_output): Fix. When we use %no-lines,
14695 there is one less line per action.
14696
f0440388
MA
146972001-12-16 Marc Autret <autret_m@epita.fr>
14698
14699 * src/bison.simple: Remove a useless #line directive.
14700 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
14701 * src/output.c (get_lines_number): New.
776209d6 14702 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
14703 output muscles.
14704 Fix line numbering.
14705 (actions_output): Computes the number of lines taken by actions.
14706 (output_master_parser): Insert new skeleton which is the name of
14707 the output parser file name.
14708
a79986b8
MA
147092001-12-15 Marc Autret <autret_m@epita.fr>
14710
14711 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
14712
4ec8e00f
MA
147132001-12-15 Marc Autret <autret_m@epita.fr>
14714
14715 * src/output.c (output_gram): Keep track of the hairy one.
14716
1a4648ff
AD
147172001-12-15 Akim Demaille <akim@epita.fr>
14718
14719 Make `make distcheck' work.
14720
14721 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
14722 system.h which uses libgettext.h.
14723
9c2c67e6
AD
147242001-12-15 Akim Demaille <akim@epita.fr>
14725
14726 * src/nullable.c (set_nullable): Useless rules must be skipped,
14727 otherwise, since we range over their symbols, we might look at a
14728 nonterminal which no longer ``exists'', i.e., it is not counted in
14729 `nvars', hence we overflow our arrays.
14730
93ede233
AD
147312001-12-15 Akim Demaille <akim@epita.fr>
14732
14733 The header can also be produced directly, without any obstack!
14734 Yahoo!
14735
14736 * src/files.c, src/files.h (defines_obstack): Remove.
14737 (compute_header_macro): Global.
14738 (defines_obstack_save): Remove.
14739 * src/reader.c (parse_union_decl): No longer output to
14740 defines_obstack: its content can be found in the `stype' muscle
14741 anyway.
14742 (output_token_translations): Merge into...
14743 (symbols_output): this.
14744 Rename as...
14745 (symbols_save): this.
14746 (reader): Adjust.
14747 * src/output.c (header_output): New.
14748 (output): Call it.
14749
2666f928
AD
147502001-12-15 Akim Demaille <akim@epita.fr>
14751
14752 * src/reader.c (parse_union_decl): Instead of handling two obstack
14753 simultaneously, use one to define the `stype' muscle, and use the
14754 value of the latter to fill defines_obstack.
14755 (copy_comment): Remove.
14756 (copy_comment2): Work for a single obstack.
14757 Rename as...
14758 (copy_comment): this.
14759
428046f8
AD
147602001-12-15 Akim Demaille <akim@epita.fr>
14761
14762 * src/lex.c, src/lex.h (xgetc): No longer static.
14763 * src/reader.c (parse_union_decl): Revamp.
14764
ea52d706
AD
147652001-12-15 Akim Demaille <akim@epita.fr>
14766
14767 Still making progress in separating Bison into (i) input, (ii)
14768 process, (iii) output: now we can directly output the parser file
14769 without using table_obstack at all.
14770
14771 * src/files.c, src/files.h (table_obstack): Bye bye.
14772 (parser_file_name): New.
14773 * src/files.c (compute_output_file_names): Compute it.
14774 * src/output.c (actions_output, output_parser)
14775 (output_master_parser): To a file instead of an obstack.
14776
3f96f4dc
AD
147772001-12-15 Akim Demaille <akim@epita.fr>
14778
14779 Attach actions to rules, instead of pre-outputting them to
14780 actions_obstack.
14781
14782 * src/gram.h (rule_t): action and action_line are new members.
14783 * src/reader.c (symbol_list): Likewise.
14784 (copy_action): Save the actions within the rule.
14785 (packgram): Save them in rule_table.
14786 * src/output.c (actions_output): New.
14787 (output_parser): Use it on `%%actions'.
14788 (output_rule_data): Don't free rule_table.
14789 (output): Do it.
14790 (prepare): Don't save the `action' muscle.
14791 * src/bison.simple: s/%%action/%%actions/.
14792
51576fb3
AD
147932001-12-15 Akim Demaille <akim@epita.fr>
14794
14795 * src/reader.c (copy_action): When --yacc, don't append a `;'
14796 to the user action: let it fail if lacking.
dee049eb 14797 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 14798
2648a72d
AD
147992001-12-14 Akim Demaille <akim@epita.fr>
14800
14801 * src/lex.c (literalchar): Simply return the char you decoded, non
14802 longer mess around with obstacks and int pointers.
14803 Adjust all callers.
14804
92790e5b
AD
148052001-12-14 Akim Demaille <akim@epita.fr>
14806
14807 * src/lex.c (literalchar): Don't escape the special characters,
14808 just decode them, and keep them as char (before, eol was output as
14809 the 2 char string `\n' etc.).
14810 * src/output.c (output_rule_data): Use quotearg to output the
14811 token strings.
14812
927c1557
PE
148132001-12-13 Paul Eggert <eggert@twinsun.com>
14814
14815 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
14816 Do not infringe on the global user namespace when using C++.
14817 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
14818 All uses of `fprintf' and `stderr' changed.
14819
14820 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
14821
ed8e1f68
AD
148222001-12-13 Akim Demaille <akim@epita.fr>
14823
14824 The computation of nullable is broken: it doesn't handle empty
14825 RHS's properly.
14826
14827 * tests/torture.at (GNU AWK Grammar): New.
14828 * tests/sets.at (Nullable): New.
14829 * src/nullable.c (set_nullable): Instead of blindly looping over
14830 `ritems', loop over the rules, and then over their rhs's.
14831
14832 Work around Autotest bugs.
14833
14834 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
14835 frame, because Autotest understand lines starting with a `+' as
14836 traces from the shell. Then, they are not processed properly.
14837 Admittedly an Autotest bug, but we don't have time to wait for
14838 Autotest to catch up.
14839 * tests/regression.at (Broken Closure): Adjust to the new table
14840 frames.
14841 Move to...
14842 * tests/sets.at: here.
14843
cb581495
AD
148442001-12-13 Akim Demaille <akim@epita.fr>
14845
14846 * src/closure.c (closure): Use nrules instead of playing tricks
14847 with BITS_PER_WORD.
14848
2e729273
AD
148492001-12-13 Akim Demaille <akim@epita.fr>
14850
14851 * src/print.c (print_actions): Output the handling of `$' as the
14852 traces do: shifting the token EOF. Before EOF was treated as a
14853 nonterminal.
14854 * tests/regression.at: Adjust some tests.
14855 * src/print_graph.c (print_core): Complete the set of items via
14856 closure. The next-to-final and final states are still unsatisfying,
14857 but that's to be addressed elsewhere.
14858 No longer output the rule numbers, but do output the state number.
14859 A single loop for the shifts + gotos is enough, but picked a
14860 distinct color for each.
14861 (print_graph): Initialize and finalize closure.
14862
107f7dfb
AD
148632001-12-13 Akim Demaille <akim@epita.fr>
14864
14865 * src/reader.c (readgram): Remove dead code, an strip useless
14866 braces.
14867 (get_type): Remove, unused.
14868
9b53a24f
AD
148692001-12-12 Akim Demaille <akim@epita.fr>
14870
14871 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
14872 on that of lib/error.c.
14873
dbfb6dcd
AD
148742001-12-12 Akim Demaille <akim@epita.fr>
14875
14876 Some hosts don't like `/' in includes.
14877
14878 * src/system.h: Include libgettext.h without qualifying the path.
14879 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
14880 $(top_srcdir).
14881
c25fb648
MA
148822001-12-11 Marc Autret <autret_m@epita.fr>
14883
14884 * src/output.c (output_parser): Remove useless muscle.
14885
710ddc4f
MA
148862001-12-11 Marc Autret <autret_m@epita.fr>
14887
14888 * src/bison.simple: Remove #line just before %%epilogue. It
14889 is now handled in ...
14890 * src/reader.c (read_additionnal_code): Add the output of a
14891 #line for the epilogue.
14892
e83d80b8
MA
148932001-12-10 Marc Autret <autret_m@epita.fr>
14894
927c1557 14895 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
14896 replace precedent remove.
14897 * src/bison.simple: Remove #line before %%prologue because
14898 %%input-line is wrong at this time.
14899
971d5158
MA
149002001-12-10 Marc Autret <autret_m@epita.fr>
14901
14902 * src/reader.c (symbols_output): Clean up.
927c1557 14903 * src/output.c (output_gram, output): Clean up.
971d5158 14904
5edafffd
AD
149052001-12-10 Akim Demaille <akim@epita.fr>
14906
14907 * src/lalr.c (initialize_lookaheads): New. Extracted from...
14908 * src/LR0.c (set_state_table): here.
14909 * src/lalr.c (lalr): Call it.
14910
0279f8e9
AD
149112001-12-10 Akim Demaille <akim@epita.fr>
14912
14913 * src/state.h (shifts): Remove the `number' member: shifts are
14914 attached to state, hence no longer need to be labelled with a
14915 state number.
14916
190c4f5f
AD
149172001-12-10 Akim Demaille <akim@epita.fr>
14918
14919 Now that states have a complete set of members, the linked list of
14920 shifts is useless: just fill directly the state's shifts member.
14921
14922 * src/state.h (shifts): Remove the `next' member.
14923 * src/LR0.c (first_state, last_state): Remove.
14924 Adjust the callers.
14925 (augment_automaton): Don't look for the shifts that must be added
14926 a shift on EOF: it is those of the state we looked for! But now,
14927 since shifts are attached, it is no longer needed to looking
14928 merely by its id: its number.
14929
2a73b93d
AD
149302001-12-10 Akim Demaille <akim@epita.fr>
14931
14932 * src/LR0.c (augment_automaton): Better variable locality.
14933 Remove an impossible branch: if there is a state corresponding to
14934 the start symbol being shifted, then there is shift for the start
14935 symbol from the initial state.
14936
74392f6a
AD
149372001-12-10 Akim Demaille <akim@epita.fr>
14938
14939 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
14940 only when appropriate: when insert_start_shifting_state' is not
14941 invoked.
14942 * tests/regression.at (Rule Line Numbers): Adjust.
14943
37c82725
AD
149442001-12-10 Akim Demaille <akim@epita.fr>
14945
14946 * src/LR0.c (augment_automaton): Now that all states have shifts,
14947 merge the two cases addition shifts to the initial state.
14948
6a164e0c
AD
149492001-12-10 Akim Demaille <akim@epita.fr>
14950
14951 * src/lalr.c (set_state_table): Move to...
14952 * src/LR0.c: here.
14953 * src/lalr.c (lalr): Don't call it...
14954 * src/LR0.c (generate_states): do it.
14955 * src/LR0.h (first_state): Remove, only the table is used.
14956
7215de24
AD
149572001-12-10 Akim Demaille <akim@epita.fr>
14958
14959 * src/LR0.h (first_shift, first_reduction): Remove.
14960 * src/lalr.c: Don't use first_shift: find shifts through the
14961 states.
14962
80e25d4d
AD
149632001-12-10 Akim Demaille <akim@epita.fr>
14964
14965 * src/LR0.c: Attach shifts to states as soon as they are
14966 computed.
14967 * src/lalr.c (set_state_table): Instead of assigning shifts to
14968 state, just assert that the mapping was properly done.
14969
0ab3728b
AD
149702001-12-10 Akim Demaille <akim@epita.fr>
14971
14972 * src/LR0.c (insert_start_shift): Rename as...
14973 (insert_start_shifting_state): this.
14974 (insert_eof_shifting_state, insert_accepting_state): New.
14975 (augment_automaton): Adjust.
14976 Better locality of the variables.
14977 When looking if the start_symbol is shifted from the initial
14978 state, using `while (... symbol != start_symbol ...)' sounds
14979 better than `while (... symbol < start_symbol ...)': If fail
14980 to see how the order between symbols could be relevant!
14981
78af9bbc
AD
149822001-12-10 Akim Demaille <akim@epita.fr>
14983
14984 * src/getargs.h: Don't declare `spec_name_prefix' and
14985 `spec_file_prefix', declared by src/files.h.
14986 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
14987 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
14988 * src/output.c (prepare): Adjust.
14989 * src/reader.c (symbols_output): Likewise.
14990 * src/vmsgetargs.c: Vaguely adjust, but who cares?
14991
bdef2a41
AD
149922001-12-10 Akim Demaille <akim@epita.fr>
14993
14994 * src/muscle_tab.c (muscle_init): NULL is a better default than
14995 `"0"'.
14996
3735969c
AD
149972001-12-10 Akim Demaille <akim@epita.fr>
14998
14999 * src/reader.c (reader): Calling symbols_output once is enough.
15000
49701457
AD
150012001-12-10 Akim Demaille <akim@epita.fr>
15002
15003 Now that states have a complete set of members, the linked list of
15004 reductions is useless: just fill directly the state's reductions
15005 member.
15006
15007 * src/state.h (struct reductions): Remove member `number' and
15008 `next'.
15009 * src/LR0.c (first_reduction, last_reduction): Remove.
15010 (save_reductions): Don't link the new reductions, store them in
15011 this_state.
15012 * src/lalr.c (set_state_table): No need to attach reductions to
15013 states, it's already done.
15014 * src/output.c (output_actions): No longer free the shifts, then
15015 the reductions, then the states: free all the states and their
15016 members.
15017
0edad749
AD
150182001-12-10 Akim Demaille <akim@epita.fr>
15019
15020 * src/options.c (OPTN, DRTV, BOTH): New.
15021 (option_table): Use them.
15022
0edad749
AD
15023 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
15024 the job of system.h.
15025 * src/options.c: Don't include stdio.h and xalloc.h for the same
15026 reasons.
15027
5449dd0f
AD
150282001-12-10 Akim Demaille <akim@epita.fr>
15029
15030 * src/output.c (output, prepare): Make sure the values of the
15031 muscles `action' and `prologue' are 0-terminated.
15032
a870c567
AD
150332001-12-10 Akim Demaille <akim@epita.fr>
15034
15035 Clean up GCC warnings.
15036
15037 * src/reader.c (copy_action): `buf' is not used.
15038 (parse_skel_decl): Be static.
15039 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
15040 * src/options.h (create_long_option_table): Have a real prototype.
15041 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
15042 (hash_delete_at): Return const void *.
15043 Adjust casts to preserve the const.
15044
80df8768
AD
150452001-12-10 Akim Demaille <akim@epita.fr>
15046
15047 * configure.in: Require 2.52g.
15048 M4 is not needed, but AUTOM4TE is.
15049 * m4/m4.m4: Remove.
15050 * tests/Makefile.am: Adjust.
15051
f693ad14
AD
150522001-12-10 Akim Demaille <akim@epita.fr>
15053
15054 One structure for states is enough, even though theoretically
15055 there are LR(0) states and LALR(1) states.
15056
15057 * src/lalr.h (state_t): Remove.
15058 (state_table): Be state_t **, not state_t *.
15059 * src/state.h (core, CORE_ALLOC): Rename as...
15060 (state_t, STATE_ALLOC): this.
15061 Add the LALR(1) members: shifts, reductions, errs.
15062 * src/LR0.c (state_table): Rename as...
15063 (state_hash): this, to avoid name clashes with the global
15064 `state_table'.
15065 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
15066 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
15067
74ffbcb6
AD
150682001-12-10 Akim Demaille <akim@epita.fr>
15069
15070 Bison dumps core on bash.y.
15071 Reported by Pascal Bart.
15072
15073 * src/warshall.c (bitmatrix_print): New.
15074 (TC): Use it.
ba0fe3c7 15075 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
15076 j must be the outer loop.
15077 * tests/regression.at (Broken Closure): New.
15078
07708e19
AD
150792001-12-05 Akim Demaille <akim@epita.fr>
15080
15081 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
15082 its argument.
ba1ecc07 15083 Reported by Peter Hamorsky.
07708e19 15084
92b16366
AD
150852001-12-05 Akim Demaille <akim@epita.fr>
15086
15087 * src/conflicts.c (err_table): Remove.
15088 (resolve_sr_conflict): Adjust.
15089 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
15090 Rename as...
15091 (state_t.reductions, state_t.shifts): this.
15092
076ab033
AD
150932001-12-05 Akim Demaille <akim@epita.fr>
15094
15095 * src/reduce.c (reduce_grammar_tables): No longer disable the
15096 removal of useless rules via CPP but via `if (0)', so that the
15097 compiler still check the code is valid.
15098 For instance, it should have noticed `rline' no longer exists: use
15099 the `line' member of rule_t.
15100 * src/gram.c (dummy, rline): Remove, unused.
15101
3843c413
AD
151022001-12-05 Akim Demaille <akim@epita.fr>
15103
15104 * src/output.c (pack_vector): Use assert, not berror.
15105 * src/main.c (berror): Remove, unused.
15106
43168960
AD
151072001-12-05 Akim Demaille <akim@epita.fr>
15108
15109 New experimental feature: if --verbose --trace output all the
15110 items of a state, not only its kernel.
15111
15112 * src/print.c (print_core): If `trace_flag', then invoke closure
15113 before outputting the items of the state (print_core is no longer
15114 a correct name them).
15115 (print_results): Invoke new_closure/free_closure if needed.
15116
b2872512
AD
151172001-12-05 Akim Demaille <akim@epita.fr>
15118
15119 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
15120 * src/closure.c, src/closure.h (itemsetsize): Rename as...
15121 (nitemset): for consistency with the rest of the project.
15122
23cbcc6c
AD
151232001-12-05 Akim Demaille <akim@epita.fr>
15124
15125 * src/closure.c (print_closure): Improve.
15126 (closure): Use it for printing input and output.
15127
03ec521c
AD
151282001-12-05 Akim Demaille <akim@epita.fr>
15129
15130 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
15131 indexed by nonterminals.
15132
3a7456dd
AD
151332001-12-05 Akim Demaille <akim@epita.fr>
15134
15135 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
15136 what it was!).
15137 * src/warshall.h: Remove accidental duplication of the content.
15138
1cbcf2e7
AD
151392001-12-05 Akim Demaille <akim@epita.fr>
15140
15141 * src/closure.c (set_fderives): De-obfuscate.
15142
84182270
AD
151432001-12-05 Akim Demaille <akim@epita.fr>
15144
15145 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
15146
3f6f053c
AD
151472001-12-05 Akim Demaille <akim@epita.fr>
15148
15149 * src/closure.c (set_firsts): De-obfuscate.
15150
7a5350ba
AD
151512001-12-05 Akim Demaille <akim@epita.fr>
15152
15153 * src/output.c (action_row): De-obfuscate
15154 using the good o' techniques: arrays not pointers, variable
15155 locality, BITISSET, RESETBIT etc.
15156
d954473d
AD
151572001-12-05 Akim Demaille <akim@epita.fr>
15158
15159 Pessimize the code to simplify it: from now on, all the states
15160 have a valid SHIFTS, which NSHIFTS is possibly 0.
15161
15162 * src/LR0.c (shifts_new): Be global and move to..
15163 * src/state.c, src/state.h: here.
15164 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
15165 * src/print_graph: Adjust.
15166
9839bbe5
AD
151672001-12-05 Akim Demaille <akim@epita.fr>
15168
15169 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
15170 * src/conflicts.c: Use it.
15171 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
15172 incorrectly ``simplified''.
15173
9f136c07
AD
151742001-12-05 Akim Demaille <akim@epita.fr>
15175
15176 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
15177 using the good o' techniques: arrays not pointers, variable
15178 locality, BITISSET, RESETBIT etc.
15179
b608206e
AD
151802001-12-05 Akim Demaille <akim@epita.fr>
15181
15182 * src/state.h (SHIFT_SYMBOL): New.
15183 * src/conflicts.c: Use it to deobfuscate.
15184
52afa962
AD
151852001-12-05 Akim Demaille <akim@epita.fr>
15186
15187 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
15188 (print_reductions): De-obfuscate using the good o' techniques:
15189 arrays not pointers, variable locality, BITISSET.
15190
e74dc321
AD
151912001-12-05 Akim Demaille <akim@epita.fr>
15192
15193 * src/conflicts.c (print_reductions): Arrays, not pointers.
15194 Use BITISSET.
15195
768fca83
AD
151962001-12-05 Akim Demaille <akim@epita.fr>
15197
15198 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15199
a17e599f
AD
152002001-12-05 Akim Demaille <akim@epita.fr>
15201
15202 * src/conflicts.c (print_reductions): Improve variable locality.
15203
a04bc341
AD
152042001-12-05 Akim Demaille <akim@epita.fr>
15205
15206 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15207
c8ea038e
AD
152082001-12-05 Akim Demaille <akim@epita.fr>
15209
15210 * src/conflicts.c (print_reductions): Improve variable locality.
15211
aa2aab3c
AD
152122001-12-05 Akim Demaille <akim@epita.fr>
15213
15214 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
15215 * src/lalr.c: Use them.
15216
b178c8cc
AD
152172001-12-05 Akim Demaille <akim@epita.fr>
15218
15219 * src/LR0.c (augment_automaton): Formatting changes.
15220 Better variable locality.
15221
f67d13aa
AD
152222001-12-05 Akim Demaille <akim@epita.fr>
15223
15224 * src/lalr.c (matrix_print): New.
15225 (transpose): Use it.
15226 Use arrays instead of pointers.
15227
c2713865
AD
152282001-12-05 Akim Demaille <akim@epita.fr>
15229
15230 * src/lalr.c (maxrhs): Move to...
15231 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
15232 * src/lalr.c (build_relations): Adjust.
15233
9887c18a
AD
152342001-12-05 Akim Demaille <akim@epita.fr>
15235
15236 * src/lalr.c (transpose): Free the memory allocated to the
15237 argument, as it is replaced by the results by the unique caller.
15238 (build_relations): Merely invoke transpose: it handles the memory
15239 deallocation.
15240 Improve variable locality.
15241 Avoid variables used as mere abbreviations.
15242 (compute_lookaheads): Use arrays instead of pointers.
15243
4d4f699c
AD
152442001-12-05 Akim Demaille <akim@epita.fr>
15245
15246 * src/lalr.c (initialize_F): Improve variable locality.
15247 Avoid variables used as mere abbreviations.
15248
80a69750
AD
152492001-12-05 Akim Demaille <akim@epita.fr>
15250
15251 * src/derives.c (print_derives): Display the ruleno.
15252 * src/lalr.c (initialize_F, transpose): Better variable locality
15253 to improve readability.
15254 Avoid variables used as mere abbreviations.
15255
fe961097
AD
152562001-12-05 Akim Demaille <akim@epita.fr>
15257
15258 * src/lalr.c (traverse): Use arrays instead of pointers.
15259
e3e4e814
AD
152602001-12-05 Akim Demaille <akim@epita.fr>
15261
15262 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
15263 the handling of squeue.
15264 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15265
630e182b
AD
152662001-12-05 Akim Demaille <akim@epita.fr>
15267
15268 Because useless nonterminals are now kept alive (instead of being
15269 `destroyed'), we now sometimes examine them, and store information
15270 related to them. Hence we need to know their number, and adjust
15271 memory allocations.
15272
15273 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
15274 static.
15275 * src/LR0.c (allocate_itemsets): The memory allocated to
15276 `symbol_count' was used for two different purpose: once to count
15277 the number of occurrences of each symbol, and later reassigned to
15278 `shift_symbol', containing the symbol that can be shifted from a
15279 given state.
15280 Deobfuscate, i.e., allocate, use and free `symbol_count' here
15281 only, and...
15282 (new_itemsets): Allocate `shift_symbol' here.
15283 (allocate_itemsets): symbol_count includes useless nonterminals.
15284 Make room for them.
15285 (free_storage): Use `free', not `XFREE', for pointers that cannot
15286 be null.
15287
81b51460
AD
152882001-12-05 Akim Demaille <akim@epita.fr>
15289
15290 * src/nullable.c (set_nullable): Deobfuscate the handling of
15291 ritem.
15292 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15293
3067fbef
AD
152942001-12-05 Akim Demaille <akim@epita.fr>
15295
15296 * src/gram.c, src/gram.h (ritem_print): New.
15297 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
15298 (This useless function was defined only to work around VMS linkers
15299 that can't handle compilation units with variables only).
15300 * src/reduce.c (dump_grammar): Use it to trace the construction of
15301 ritem.
15302
c2bea5f9
PE
153032001-12-04 Paul Eggert <eggert@twinsun.com>
15304
7d27c823
PE
15305 * src/bison.simple (union yyalloc): Change member names
15306 to be the same as the stack names.
15307 (yyparse): yyptr is now union yyalloc *, not char *.
15308 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
15309 and may generate better code on some machines.
c2bea5f9
PE
15310 (yystpcpy): Use prototype if __STDC__ is defined, not just
15311 if __cplusplus is defined.
35687a9d 15312
2c8a9dfa
AD
153132001-11-30 Akim Demaille <akim@epita.fr>
15314
15315 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
15316 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
15317 Gettext doesn't compile cleanly, and dies with -Werror.
15318 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
15319 Include WARNING_CFLAGS here.
15320 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
15321 before being defined.
15322
f4e421e6
AD
153232001-11-27 Paul Eggert <eggert@twinsun.com>
15324
15325 * lib/quotearg.h (quotearg_n, quotearg_n_style):
15326 First arg is int, not unsigned.
15327 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
15328 (SIZE_MAX, UINT_MAX): New macros.
15329 (quotearg_n_options): Abort if N is negative.
15330 Avoid overflow check on hosts where size_t is 64 bits and int
15331 is 32 bits, as overflow is impossible there.
15332 Fix off-by-one typo that caused unnecessary reallocation.
15333
7093d0f5
AD
153342001-11-29 Paul Eggert <eggert@twinsun.com>
15335
15336 Name space cleanup in generated parser.
15337
15338 * doc/bison.texinfo (Bison Parser): Discuss system headers
15339 and their effect on the user name space.
15340
15341 * src/bison.simple:
15342 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
15343 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
15344 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
15345
15346 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
15347 on user names when possible.
15348
15349 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
15350 Simplify test for whather <alloca.h> exists.
15351
15352 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
15353
15354 (<stdio.h>): Include if YYDEBUG.
15355
15356 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
15357 ! defined (yyoverflow) && ! defined (yymemcpy).
15358
15359 (yymemcpy, yyparse): Rename local variables as needed so that
15360 they all begin with 'yy'.
15361
15362 (yystrlen, yystpcpy): New functions.
15363
15364 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
15365 All uses changed.
15366
15367 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
15368 instead of relying on string.h functions. Use YYSTACK_ALLOC
15369 and YYSTACK_FREE instead of malloc and free.
15370
fd51e5ff
AD
153712001-11-30 Akim Demaille <akim@epita.fr>
15372
15373 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
15374 before their first uses.
15375 (YYBISON, YYPURE): Move to the top of the output.
15376
7d13ff5f
AD
153772001-11-30 Akim Demaille <akim@epita.fr>
15378
15379 * tests/reduce.at (Useless Nonterminals): Fix.
15380
892a3995
AD
153812001-11-30 Akim Demaille <akim@epita.fr>
15382
15383 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
15384 if body instead of `;' to pacify GCC's warnings.
15385
68f1e3ed
AD
153862001-11-30 Akim Demaille <akim@epita.fr>
15387
15388 Instead of mapping the LHS of unused rules to -1, keep the LHS
15389 valid, but flag the rules as invalid.
15390
15391 * src/gram.h (rule_t): `useful' is a new member.
15392 * src/print.c (print_grammar): Adjust.
15393 * src/derives.c (set_derives): Likewise.
15394 * src/reader.c (packgram, reduce_output): Likewise.
15395 * src/reduce.c (reduce_grammar_tables): Likewise.
15396 * tests/reduce.at (Underivable Rules, Useless Rules): New.
15397
d2d1b42b
AD
153982001-11-30 Akim Demaille <akim@epita.fr>
15399
15400 * src/reduce.c (reduce_output): Formatting changes.
15401 * src/print.c (print_results, print_grammar): Likewise.
15402 * tests/regression.at (Rule Line Numbers)
15403 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
15404
760b53a8
AD
154052001-11-30 Akim Demaille <akim@epita.fr>
15406
15407 * src/reduce.c (nonterminals_reduce): Instead of throwing away
15408 useless nonterminals, move them at the end of the symbol arrays.
15409 (reduce_output): Adjust.
15410 * tests/reduce.at (Useless Nonterminals): Adjust.
15411
00238958
AD
154122001-11-30 Akim Demaille <akim@epita.fr>
15413
15414 * src/reduce.c: Various comment/formatting changes.
15415 (nonterminals_reduce): New, extracted from...
15416 (reduce_grammar_tables): here.
15417 (reduce_grammar): Call nonterminals_reduce.
15418
396452de
PE
154192001-11-29 Paul Eggert <eggert@twinsun.com>
15420
15421 * src/bison.simple (YYSTACK_REALLOC): Remove.
15422 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
15423 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
15424 New macros.
15425 (union yyalloc): New type.
15426 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
15427 an arbitrary restriction on hosts where size_t is wider than int.
15428
15429 (yyparse): Don't dump core if alloca or malloc fails; instead, report
15430 a parser stack overflow. Allocate just one block of memory for all
15431 three stacks, instead of allocating three blocks; this typically is
15432 faster and reduces fragmentation.
15433
15434 Do not limit the number of items in the stack to a value that fits
15435 in 'int', as this is an arbitrary limit on hosts with 64-bit
15436 size_t and 32-bit int.
15437
147e184c
MA
154382001-11-29 Marc Autret <autret_m@epita.fr>
15439
15440 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
15441 of defining YYERROR_VERBOSE.
15442 [AT_DATA]: $4 is now out of C declarations in the prologue.
15443
426cf563
MA
154442001-11-28 Marc Autret <autret_m@epita.fr>
15445
15446 * src/reader.c (parse_dquoted_param): New.
15447 (parse_skel_decl): Use it.
15448 * src/lex.h: Add its prototype.
15449 * src/lex.c (literalchar): Become not static.
15450
c7925b99
MA
154512001-11-28 Marc Autret <autret_m@epita.fr>
15452
15453 * src/output.h: And put its extern declaration here.
15454 * src/output.c (error_verbose): Define here.
15455 (prepare): Echo name modification.
15456 * src/getargs.h: Clean its extern declaration.
15457 * src/getargs.c (error_verbose_flag): Remove.
15458 (getargs): Remove case 'e'.
15459 * src/options.c (option_table): 'error-verbose' is now seen as simple
15460 percent option.
15461 Include output.h.
15462
15463 * src/reader.c (read_declarations): Remove case tok_include.
15464 (parse_include_decl): Remove.
15465 * src/lex.h (token_t): Remove tok_include.
15466 * src/options.c (option_table): 'include' is now a simple command line
15467 option.
15468
5b5d1929
MA
154692001-11-28 Marc Autret <autret_m@epita.fr>
15470
15471 * src/bison.simple: Adjust muscle names.
15472 * src/muscle_tab.c (muscle_init): Also rename the muscles.
15473 * src/output.c (prepare): s/_/-/ for the muscles names.
15474 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
15475
8850be4b
MA
154762001-11-28 Marc Autret <autret_m@epita.fr>
15477
15478 * src/bison.simple: Fix debug.
15479 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
15480
4a38e613
AD
154812001-11-28 Akim Demaille <akim@epita.fr>
15482
15483 * src/LR0.c (shifts_new): New.
15484 (save_shifts, insert_start_shift, augment_automaton): Use it.
15485
4b35e1c1
AD
154862001-11-28 Akim Demaille <akim@epita.fr>
15487
15488 * src/closure.c (closure): `b' and `ruleno' denote the same value:
15489 keep ruleno only.
15490
d2b04478
AD
154912001-11-28 Akim Demaille <akim@epita.fr>
15492
15493 * src/closure.c (closure): Instead of looping over word in array
15494 then bits in words, loop over bits in array.
15495
2c4c30aa
AD
154962001-11-28 Akim Demaille <akim@epita.fr>
15497
15498 * src/closure.c (closure): No longer optimize the special case
15499 where all the bits of `ruleset[r]' are set to 0, to make the code
15500 clearer.
15501
576890b7
AD
155022001-11-28 Akim Demaille <akim@epita.fr>
15503
15504 * src/closure.c (closure): `r' and `c' are new variables, used to
15505 de-obfuscate accesses to RULESET and CORE.
15506
cb487d7d
AD
155072001-11-28 Akim Demaille <akim@epita.fr>
15508
15509 * src/reduce.c (reduce_print): Use ngettext.
15510 (dump_grammar): Improve the trace accuracy.
15511
6013d43f
AD
155122001-11-28 Akim Demaille <akim@epita.fr>
15513
15514 * src/reduce.c (dump_grammar): Don't translate trace messages.
15515
cb4956ee
AD
155162001-11-28 Akim Demaille <akim@epita.fr>
15517
15518 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
15519 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
15520 as all tags are free'ed afterwards.
15521 From Enrico Scholz.
15522
648185ab
PE
155232001-11-27 Paul Eggert <eggert@twinsun.com>
15524
15525 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
15526 use alloca when we didn't want to, and vice versa.
15527
68254a03
MA
155282001-11-27 Marc Autret <autret_m@epita.fr>
15529
9113b58f
AD
15530 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
15531 initialization.
68254a03
MA
15532 * src/output.c (prepare): Remove its update.
15533
04d843a2
MA
155342001-11-27 Marc Autret <autret_m@epita.fr>
15535
15536 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
15537 Use %error-verbose.
15538
d2079671 155392001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
15540
15541 * src/bison.simple: Remove YYERROR_VERBOSE using.
15542 Use %%error_verbose.
15543 (yyparse): Likewise.
15544 * src/output.c (prepare): Give its final value.
15545 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
15546 * src/getargs.h: Add its extern declaration.
15547 * src/getargs.c (error_verbose_flag): New int.
15548 (getargs): Update to catch new case.
15549 * src/options.c (option_table): 'error-verbose' is a new option.
15550 (shortopts): Update.
15551
e0327bc8
AD
155522001-11-27 Akim Demaille <akim@epita.fr>
15553
15554 * src/system.h: Use intl/libgettext.h.
15555 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
15556
000f1a3c
AD
155572001-11-27 Akim Demaille <akim@epita.fr>
15558
15559 * tests/torture.at (Exploding the Stack Size with Malloc):
15560 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
15561
26cfe0be
AD
155622001-11-27 Akim Demaille <akim@epita.fr>
15563
15564 * src/files.c: Include error.h.
15565 Reported by Hans Aberg.
15566
f6bd5427
MA
155672001-11-26 Marc Autret <autret_m@epita.fr>
15568
d2079671 15569 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
15570 (read_declarations): Add case tok_include.
15571 * src/getargs.h (include): Add its extern definition.
15572 * src/getargs.c (include): New const char *.
15573 (getargs): Add case '-I'.
15574 * src/options.c (option_table): Add include as command line and
15575 percent option.
15576 * src/lex.h (token_t): Add tok_include.
15577
2ca209c1
AD
155782001-11-26 Akim Demaille <akim@epita.fr>
15579
15580 * src/reader.c (readgram): Make sure rules for mid-rule actions
15581 have a lineno equal to that of their host rule.
15582 Reported by Hans Aberg.
15583 * tests/regression.at (Rule Line Numbers): New.
15584
0e41b407
AD
155852001-11-26 Akim Demaille <akim@epita.fr>
15586
15587 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
15588 size_ts.
15589
155902001-11-26 Akim Demaille <akim@epita.fr>
15591
15592 * src/complain.c, src/complain.h (error): Remove, provided by
15593 lib/error.[ch].
15594
e0c40012
AD
155952001-11-26 Akim Demaille <akim@epita.fr>
15596
15597 * src/reader.c (read_declarations): Don't abort on tok_illegal,
15598 issue an error message.
15599 * tests/regression.at (Invalid %directive): New.
15600 Reported by Hans Aberg.
15601
5e147124
AD
156022001-11-26 Akim Demaille <akim@epita.fr>
15603
15604 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
15605 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15606
a034c8b8
AD
156072001-11-26 Akim Demaille <akim@epita.fr>
15608
15609 * src/conflicts.c (conflicts_print): Don't complain at all when
15610 there are no reduce/reduce conflicts, and as many shift/reduce
15611 conflicts as expected.
15612 * tests/regression.at (%expect right): Adjust.
15613
c64a20f3
AD
156142001-11-23 Akim Demaille <akim@epita.fr>
15615
15616 * lib/alloca.c: Update, from fileutils.
15617
5b0d29bb
AD
156182001-11-23 Akim Demaille <akim@epita.fr>
15619
15620 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
15621
722c4bfe
AD
156222001-11-23 Akim Demaille <akim@epita.fr>
15623
15624 * src/system.h: Include alloca.h.
15625 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
15626
6255b435
AD
156272001-11-23 Akim Demaille <akim@epita.fr>
15628
15629 * src/print_graph.c (print_actions): Remove `rule', unused.
15630 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
15631 pacify GCC's signed < unsigned warnings.
15632 * src/closure.c (itemsetsize): Likewise.
15633 * src/reader.c (symbol_list_new): Static.
15634
b29b2ed5
AD
156352001-11-23 Akim Demaille <akim@epita.fr>
15636
15637 Attaching lineno to buckets is stupid, since only one copy of each
15638 symbol is kept, only the line of the first occurrence is kept too.
15639
15640 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
15641 * src/reader.c (rline_allocated): Remove, unused.
15642 (symbol_list): Have a `line' member.
15643 (symbol_list_new): New.
15644 (readgram): Use it.
15645 * src/print.c (print_grammar): Output the rule line numbers.
15646 * tests/regression.at (Solved SR Conflicts)
15647 (Unresolved SR Conflicts): Adjust.
15648 Reported by Hans Aberg.
15649
a81b1d4a
MA
156502001-11-22 Marc Autret <autret_m@epita.fr>
15651
15652 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
15653
c1ecb3c1
MA
156542001-11-22 Marc Autret <autret_m@epita.fr>
15655
15656 * src/muscle_tab.c (muscle_init): Remove initialization of
15657 skeleton muscle.
15658 * src/output.c (output_master_parser): Do it here.
15659
fbe01355
AD
156602001-11-20 Akim Demaille <akim@epita.fr>
15661
15662 * po/sv.po: New.
15663 * configure.in (ALL_LINGUAS): Adjust.
15664 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
15665 longer contains strings to translate.
15666
81e895c0
AD
156672001-11-19 Akim Demaille <akim@epita.fr>
15668
15669 * src/conflicts.c (conflicts_print): Add a missing \n.
15670
6bb1878b
AD
156712001-11-19 Akim Demaille <akim@epita.fr>
15672
15673 * src/nullable.c (nullable_print): New.
15674 (set_nullable): Call it when tracing.
15675 Better locality of variables.
15676
d9ec2d07
AD
156772001-11-19 Akim Demaille <akim@epita.fr>
15678
15679 * src/print.c (print_actions): Better locality of variables.
15680
720e5c1b
AD
156812001-11-19 Akim Demaille <akim@epita.fr>
15682
15683 * src/derives.c (print_derives): Fix and enrich.
15684 * src/closure.c (print_fderives): Likewise.
15685
fb908786
AD
156862001-11-19 Akim Demaille <akim@epita.fr>
15687
15688 * src/closure.c (itemsetend): Remove, replaced with...
15689 (itemsetsize): new.
15690
125ecb56
AD
156912001-11-19 Akim Demaille <akim@epita.fr>
15692
15693 * src/LR0.c (kernel_end): Remove, replaced with...
15694 (kernel_size): new.
15695
d8cf039f
AD
156962001-11-19 Akim Demaille <akim@epita.fr>
15697
15698 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
15699 to clarify.
15700
7bec0760
AD
157012001-11-19 Akim Demaille <akim@epita.fr>
15702
15703 * src/closure.c (closure): Use arrays instead of pointers to clarify.
15704
c87d4863
AD
157052001-11-19 Akim Demaille <akim@epita.fr>
15706
15707 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
15708 trace messages.
15709 * src/LR0.c: Likewise.
15710 (allocate_itemsets): Use arrays instead of pointers to clarify.
15711
9bfe901c
AD
157122001-11-19 Akim Demaille <akim@epita.fr>
15713
15714 * src/getargs.c (statistics_flag): Replace with...
15715 (trace_flag): New.
15716 (longopts): Accept --trace instead of --statistics.
15717 * src/getargs.h, src/options.c: Adjust.
15718 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
15719 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
15720
97db7bd4
AD
157212001-11-19 Akim Demaille <akim@epita.fr>
15722
cc72668c 15723 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
15724 pointers to clarify the code.
15725 (save_reductions, save_shifts): Factor common parts of alternatives.
15726
2c5f66ed
AD
157272001-11-19 Akim Demaille <akim@epita.fr>
15728
15729 * src/LR0.c (new_state, get_state): Complete TRACE code.
15730 * src/closure.c: Include `reader.h' to get `tags', needed by the
15731 trace code.
15732 Rename the conditional DEBUG as TRACE.
15733 Output consistently TRACEs to stderr, not stdout.
15734 * src/derives.c: Likewise.
15735 * src/reduce.c: (inaccessable_symbols): Using if is better style
15736 than goto.
15737 Use `#if TRACE' instead of `#if 0' for tracing code.
15738
300f275f
AD
157392001-11-19 Akim Demaille <akim@epita.fr>
15740
15741 * src/system.h (LIST_FREE, shortcpy): New.
15742 * src/LR0.c: Use them.
15743 * src/output.c (free_itemsets, free_reductions, free_shifts):
15744 Remove, replaced by LIST_FREE.
15745
f59c437a
AD
157462001-11-19 Akim Demaille <akim@epita.fr>
15747
15748 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
15749 (REDUCTIONS_ALLOC): New.
15750 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
15751 allocation.
15752
6986fd9e
AD
157532001-11-19 Akim Demaille <akim@epita.fr>
15754
15755 * src/LR0.c (new_state): Complete trace code.
15756 * src/nullable.c (set_nullable): Don't translate traces.
15757
4bc30f78
AD
157582001-11-19 Akim Demaille <akim@epita.fr>
15759
15760 * src/print_graph.c (print_core): Better locality of variables.
15761 * src/print.c (print_core): Likewise.
15762
08a946e0
AD
157632001-11-19 Akim Demaille <akim@epita.fr>
15764
15765 * src/vcg.c: You do the output, so you are responsible of the
15766 handling of VCG syntax, in particular: use quotearg.
15767 * src/print_graph.c: Don't.
15768 (print_actions): Don't output the actions as part of the nodes,
15769 since that's the job of the edges.
15770 (print_state): Don't output by hand: fill the node description,
9bfe901c 15771 and ask for its output.
08a946e0 15772
f0473484
AD
157732001-11-19 Akim Demaille <akim@epita.fr>
15774
cc72668c
AD
15775 * src/bison.simple (yyparse): When verbosely reporting an error,
15776 no longer put additional quotes around token names.
f0473484
AD
15777 * tests/calc.at: Adjust.
15778
e41dc700
AD
157792001-11-19 Akim Demaille <akim@epita.fr>
15780
15781 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
15782 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
15783 * src/output.c: Adjust.
15784
652a871c
AD
157852001-11-19 Akim Demaille <akim@epita.fr>
15786
15787 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
15788 (rule_t): this.
15789 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
15790
b2ed6e58
AD
157912001-11-19 Akim Demaille <akim@epita.fr>
15792
15793 * src/gram.h (rule_t): New.
15794 (rule_table): New.
15795 (rrhs, rlhs): Remove, part of state_t.
15796 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
15797 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15798 * src/reader.c, src/reduce.c: Adjust.
15799
edad7067
AD
158002001-11-19 Akim Demaille <akim@epita.fr>
15801
15802 * src/reader.c (symbols_output): New, extracted from...
15803 (packsymbols): Here.
15804 (reader): Call it.
15805
3feec034
AD
158062001-11-19 Akim Demaille <akim@epita.fr>
15807
15808 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
15809 (maxrhs): this new function.
15810
ddcd5fdf
AD
158112001-11-19 Akim Demaille <akim@epita.fr>
15812
cc72668c 15813 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
15814 Adjust.
15815
bb527fc2
AD
158162001-11-19 Akim Demaille <akim@epita.fr>
15817
cc72668c 15818 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
15819 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15820 * src/lalr.c: Adjust.
15821
a845a697
AD
158222001-11-19 Akim Demaille <akim@epita.fr>
15823
15824 * src/lalr.c (initialize_LA): Only initialize LA. Let...
15825 (set_state_table): handle the `lookaheads' members.
15826
f004bf6a
AD
158272001-11-19 Akim Demaille <akim@epita.fr>
15828
cc72668c
AD
15829 * src/lalr.h (lookaheads): Removed array, whose contents is now
15830 a member of...
f004bf6a
AD
15831 (state_t): this structure.
15832 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15833 Adjust.
15834
de326cc0
AD
158352001-11-19 Akim Demaille <akim@epita.fr>
15836
cc72668c
AD
15837 * src/lalr.h (consistent): Removed array, whose contents is now
15838 a member of...
de326cc0
AD
15839 (state_t): this structure.
15840 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15841 Adjust.
15842
90b4416b
AD
158432001-11-19 Akim Demaille <akim@epita.fr>
15844
cc72668c
AD
15845 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
15846 contents are now members of...
90b4416b
AD
15847 (state_t): this structure.
15848 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15849 Adjust.
15850
9703cc49
AD
158512001-11-19 Akim Demaille <akim@epita.fr>
15852
15853 * src/lalr.h (state_t): New.
15854 (state_table): Be a state_t * instead of a core **.
15855 (accessing_symbol): Remove, part of state_t.
15856 * src/lalr.c: Adjust.
15857 (set_accessing_symbol): Merge into...
15858 (set_state_table): this.
15859 * src/print_graph.c, src/conflicts.c: Adjust.
15860
d803322e
AD
158612001-11-14 Akim Demaille <akim@epita.fr>
15862
15863 * tests/calc.at, tests/output.at, tests/regression.at,
15864 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
15865 now the tests are run in private dirs, therefore AC_CLEANUP and
15866 family can be simplified to 0-ary.
15867 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
15868 use abs. path to find config.h.
15869 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
15870 stderr, there can be way too much random noise.
15871 Instead pass -Werror to GCC and rely on the exit status.
15872 Reported by Wolfram Wagner.
15873
3d76b07d
AD
158742001-11-14 Akim Demaille <akim@epita.fr>
15875
15876 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
15877 defined only if yyoverflow is defined, to avoid `warning: unused
15878 variable `yyvs1''.
15879 Reported by The Test Suite.
15880
09b503c8
AD
158812001-11-14 Akim Demaille <akim@epita.fr>
15882
15883 * src/print.c: Include reduce.h.
15884 Reported by Hans Aberg.
15885
158862001-11-14 Akim Demaille <akim@epita.fr>
15887
15888 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
15889 Revert a previous patch: these are really const.
15890 * src/conflicts.c (conflict_report): Additional useless pair of
15891 braces to pacify GCC's warnings for `if () if () {} else {}'.
15892 * src/lex.c (parse_percent_token): Replace equal_offset with
15893 arg_offset.
15894 arg is const.
15895 Be sure to strdup `arg' when used, since there is no reason for
15896 token_buffer not to change.
15897
0f37a994
AD
158982001-11-14 Akim Demaille <akim@epita.fr>
15899
15900 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
15901 definition.
15902 * src/main.c (main): Use them.
15903 Suggested by Hans Aberg.
15904
d39d93b8
AD
159052001-11-12 Akim Demaille <akim@epita.fr>
15906
15907 * src/system.h (ngettext): Now that we use ngettext, be sure to
15908 provide a default definition when NLS are not used.
15909
9edcd895
AD
159102001-11-12 Akim Demaille <akim@epita.fr>
15911
15912 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
15913 Use @kbd to denote user input.
15914 (Language and Grammar): ANSIfy the example.
15915 Adjust its layout for info/notinfo.
15916 (Location Tracking Calc): Output error messages to stderr.
15917 Output locations in a more GNUtically correct way.
15918 Fix a couple of Englishos.
15919 Adjust @group/@end group pairs.
15920
7da99ede
AD
159212001-11-12 Akim Demaille <akim@epita.fr>
15922
e3aa65c5 15923 %expect was not functioning at all.
7da99ede
AD
15924
15925 * src/conflicts.c (expected_conflicts): Set to -1.
15926 (conflict_report): Use ngettext.
15927 (conflicts_print): Check %expect and make its violation an error.
15928 * doc/bison.texinfo (Expect Decl): Adjust.
15929 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
15930 * tests/regression.at (%expect not enough, %expect right)
15931 (%expect too much): New.
15932
ba9dda1a
AD
159332001-11-12 Akim Demaille <akim@epita.fr>
15934
15935 * tests/regression.at (Conflicts): Rename as...
15936 (Unresolved SR Conflicts): this.
15937 (Solved SR Conflicts): New.
15938
337c5bd1
AD
159392001-11-12 Akim Demaille <akim@epita.fr>
15940
15941 * src/reduce.c (print_results): Rename as...
15942 (reduce_output): This.
15943 Output to OUT, passed as argument, instead of output_obstack.
15944 (dump_grammar): Likewise.
15945 (reduce_free): New.
15946 Also free V1.
15947 (reduce_grammar): No longer call reduce_output, since...
15948 * src/print.c (print_results): do it.
15949 * src/main.c (main): Call reduce_free;
15950
c73a41af
AD
159512001-11-12 Akim Demaille <akim@epita.fr>
15952
15953 * src/conflicts.c (print_reductions): Accept OUT as argument.
15954 Output to it, not to output_obstack.
15955 * src/print.c (print_actions): Adjust.
15956
0df87bb6
AD
159572001-11-12 Akim Demaille <akim@epita.fr>
15958
15959 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
15960 the result instead of using...
15961 (src_total, rrc_total, src_count, rrc_count): Remove.
15962 (any_conflicts): Remove.
15963 (print_conflicts): Split into...
15964 (conflicts_print, conflicts_output): New.
15965 * src/conflicts.h: Adjust.
15966 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 15967 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
15968 * tests/regression.at (Conflicts): New.
15969 Reported by Tom Lane.
15970
e4d3d4de
AD
159712001-11-12 Akim Demaille <akim@epita.fr>
15972
15973 * tests/regression.at (Invalid input): Remove, duplicate with
15974 ``Invalid input: 1''.
15975
6d7d248e
AD
159762001-11-12 Akim Demaille <akim@epita.fr>
15977
15978 * tests/torture.at (AT_DATA_STACK_TORTURE)
15979 (Exploding the Stack Size with Alloca)
15980 (Exploding the Stack Size with Malloc): New.
15981
e9e4c321
AD
159822001-11-12 Akim Demaille <akim@epita.fr>
15983
15984 * src/bison.simple (YYSTACK_REALLOC): New.
15985 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 15986 Reported by Per Allansson.
e9e4c321 15987
5f7e0832
AD
159882001-11-12 Pascal Bart <pascal.bart@epita.fr>
15989
15990 * src/bison.simple: Define type yystype instead of YYSTYPE, and
15991 define CPP macro, which substitute YYSTYPE by yystype.
15992 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
15993 with yyltype/YYLTYPE. This allows inclusion of the generated
15994 header within the parser if the compiler, such as GGC, accepts
15995 multiple equivalent #defines.
15996 From Akim.
15997
e3f1699f
AD
159982001-11-05 Akim Demaille <akim@epita.fr>
15999
16000 * src/reader.c (symbols_output): New, extracted from...
16001 (packsymbols): here.
16002 (reader): Adjust.
16003
65be0866
AD
160042001-11-05 Akim Demaille <akim@epita.fr>
16005
16006 * src/lex.c (parse_percent_token): s/quotearg/quote/.
16007
e4d910bf
AD
160082001-11-05 Akim Demaille <akim@epita.fr>
16009
16010 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
16011 pattern.
16012
951366c1
AD
160132001-11-05 Akim Demaille <akim@epita.fr>
16014
16015 * src/options.h (struct option_table_struct): set_flags is void*.
16016 * src/options.c (longopts): Support `--output' and `%output'.
16017 (usage): Adjust.
16018 * src/lex.h (tok_setopt): Remove, replaced with...
16019 (tok_intopt, tok_stropt): these new guys.
16020 * src/lex.c (getopt.h): Not needed.
16021 (token_buffer, unlexed_token_buffer): Not const.
16022 (percent_table): Promote `-' over `_' in directive names.
16023 Active `%name-prefix', `file-prefix', and `output'.
16024 (parse_percent_token): Accept possible arguments to directives.
16025 Promote `-' over `_' in directive names.
16026
d8988b2f
AD
160272001-11-04 Akim Demaille <akim@epita.fr>
16028
16029 * doc/bison.texinfo (Decl Summary): Split the list into
16030 `directives for grammars' and `directives for bison'.
16031 Sort'em.
16032 Add description of `%name-prefix', `file-prefix', and `output'.
16033 Promote `-' over `_' in directive names.
16034 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
16035 Simplify the description of `--name-prefix'.
16036 Promote `-' over `_' in directive names.
16037 Promote `--output' over `--output-file'.
16038 Fix the description of `--defines'.
16039 * tests/output.at: Exercise %file-prefix and %output.
16040
6468d18e
AD
160412001-11-02 Akim Demaille <akim@epita.fr>
16042
16043 * doc/refcard.tex: Update.
16044
6b7e85b9
AD
160452001-11-02 Akim Demaille <akim@epita.fr>
16046
16047 * src/symtab.h (SUNDEF): New.
16048 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
16049 stand for `uninitialized', instead of 0.
16050 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
16051 * src/lex.c (lex): Adjust.
16052
16053 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
16054 Number it 0.
16055 Let yylex return it instead of a plain 0.
16056 Reported by Dick Streefland.
16057
cd5aafcf
AD
160582001-11-02 Akim Demaille <akim@epita.fr>
16059
16060 * tests/regression.at (Mixing %token styles): New test.
16061
037ca2f1
AD
160622001-11-02 Akim Demaille <akim@epita.fr>
16063
16064 * src/reader.c (parse_thong_decl): Formatting changes.
16065 (token_translations_init): New, extracted from...
16066 (packsymbols): Here.
16067 Adjust.
16068
270a173c
AD
160692001-11-01 Akim Demaille <akim@epita.fr>
16070
16071 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
16072 Check that `9foo.y' produces correct cpp guards.
16073 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
16074 guards.
16075 Reported by Wwp.
16076
561f9a30
AD
160772001-11-01 Akim Demaille <akim@epita.fr>
16078
16079 * tests/regression.at (Invalid input: 2): New.
16080 * src/lex.c (unlexed_token_buffer): New.
16081 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
16082 too.
16083 Reported by Wwp.
16084
f987e9d2
AD
160852001-11-01 Akim Demaille <akim@epita.fr>
16086
16087 * tests/calc.at: Catch up with 1.30.
16088 * configure.in: Bump to 1.49a.
16089 Adjust to newer Autotest.
16090
0846f581
PB
160912001-10-19 Pascal Bart <pascal.bart@epita.fr>
16092
16093 * src/conflicts.c: Move global variables rrc_total and src_total ...
16094 (print_conflicts): here.
16095 * src/output.c (output): Free global variable user_toknums.
16096 * src/lex.c (token_obstack): Become static.
16097
3c1a79b3
AD
160982001-10-18 Akim Demaille <akim@epita.fr>
16099
16100 * tests/atlocal.in (GCC): Add.
16101 * tests/calc.at: s/m4_match/m4_bmatch/.
16102 s/m4_patsubst/m4_bpatsubst/.
16103 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
16104 * configure.in: AC_SUBST(GCC).
16105
5d52e7d0
MA
161062001-10-14 Marc Autret <autret_m@epita.fr>
16107
16108 * src/options.c (create_long_option_table): Fix.
16109
631aa1d3
AD
161102001-10-10 Akim Demaille <akim@epita.fr>
16111
16112 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
16113
f6ec6d13
AD
161142001-10-04 Akim Demaille <akim@epita.fr>
16115
16116 * src/reader.c (parse_union_decl): Push the caracters in
16117 union_obstack, not attrs_obstack.
16118
342b8b6e
AD
161192001-10-04 Akim Demaille <akim@epita.fr>
16120
16121 Merge in the branch 1.29.
16122
16123 * src/reader.c (packsymbols): Use a temporary obstack for
16124 `%%tokendef', since output_stack is already used elsewhere.
16125
16126 2001-10-02 Akim Demaille <akim@epita.fr>
16127
16128 Bump 1.29d.
16129
16130 2001-10-02 Akim Demaille <akim@epita.fr>
16131
16132 Version 1.29c.
16133
16134 2001-10-02 Akim Demaille <akim@epita.fr>
16135
16136 * tests/regression.at (Invalid CPP headers): New.
16137 From Alexander Belopolsky.
16138 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
16139
16140 2001-10-02 Akim Demaille <akim@epita.fr>
16141
16142 * tests/regression.at (Invalid input): New.
16143 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
16144 Reported by Shura.
16145
16146 2001-10-02 Akim Demaille <akim@epita.fr>
16147
16148 * tests/calc.at: Now that --debug works, the tests must be adjusted.
16149
16150 2001-10-02 Akim Demaille <akim@epita.fr>
16151
16152 * src/output.c (output_parser): Assert `skeleton'.
16153 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
16154 systems.
16155 From Shura.
16156
16157 2001-10-01 Marc Autret <autret_m@epita.fr>
16158
16159 * src/lex.h: Echo modifications.
16160 * src/lex.c (unlex): Parameter is now token_t.
16161 From Hans Aberg.
16162
16163 2001-10-01 Marc Autret <autret_m@epita.fr>
16164
16165 * src/main.c: Include lex.h.
16166 From Hans Aberg.
16167
16168 2001-09-29 Akim Demaille <akim@epita.fr>
16169
16170 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
16171
16172 2001-09-28 Akim Demaille <akim@epita.fr>
16173
16174 * tests/testsuite.at: Update to newer Autotest.
16175 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
16176
16177 2001-09-27 Akim Demaille <akim@epita.fr>
16178
16179 Position independent wrapper.
16180
16181 * tests/bison: Remove.
16182 * tests/bison.in: New.
16183 * configure.in: Adjust.
16184
16185 2001-09-27 Paul Eggert <eggert@twinsun.com>
16186
16187 Port quotearg fixes from tar 1.13.24.
16188
16189 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
16190 tm to be declared.
16191 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
16192 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
16193
16194 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
16195 * m4/mbrtowc.m4: New file.
16196 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
16197 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
16198
16199 2001-09-27 Akim Demaille <akim@epita.fr>
16200
16201 Bump to 1.29c.
16202
16203 2001-09-27 Akim Demaille <akim@epita.fr>
16204
16205 Version 1.29b.
16206
16207 2001-09-25 Akim Demaille <akim@epita.fr>
16208
16209 * src/system.h: Include `xalloc.h'.
16210 Remove it from the C files.
16211 * src/files.c (output_files): Free the obstacks.
16212 * src/lex.c (init_lex): Rename as...
16213 (lex_init): this.
16214 (lex_free): New.
16215 * src/main.c (main): Use it.
16216
16217 2001-09-24 Marc Autret <autret_m@epita.fr>
16218
16219 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
16220 to output informations in fout (FILE*).
16221 (open_graph, close_graph): Likewise.
16222 (output_graph, output_edge, output_node): Likewise.
16223 * src/vcg.h: Update function prototypes.
16224 * src/print_graph.c (print_graph): Open output graph file.
16225 (print_actions): Adjust.
16226 * src/files.h: Remove extern declaration.
16227 * src/files.c: Remove graph_obstack declaration.
16228 (open_files): Remove graph_obstack initialization.
16229 (output_files): Remove graph_obstack saving.
16230
16231 2001-09-24 Marc Autret <autret_m@epita.fr>
16232
16233 * src/files.c (compute_output_file_names): Fix.
16234
16235 2001-09-24 Marc Autret <autret_m@epita.fr>,
16236 Akim Demaille <akim@epita.fr>
16237
16238 * src/reader.c (reader): Remove call to free_symtab ().
16239 * src/main.c (main): Call it here.
16240 Include symtab.h.
16241 * src/conflicts.c (initialize_conflicts): Rename as...
16242 (solve_conflicts): this.
16243 * src/print.c (print_core, print_actions, print_state)
16244 (print_grammar): Dump to a file instead a `output_obstack'.
16245 (print_results): Dump `output_obstack', and then proceed with the
16246 FILE *.
16247 * src/files.c (compute_output_file_names, close_files): New.
16248 (output_files): Adjust.
16249 * src/main.c (main): Adjust.
16250
16251 2001-09-23 Marc Autret <autret_m@epita.fr>
16252
16253 * src/files.c (compute_header_macro): Computes header macro name
16254 from spec_defines_file when given.
16255
16256 2001-09-23 Marc Autret <autret_m@epita.fr>
16257
16258 * src/files.c (output_files): Add default extensions.
16259
16260 2001-09-22 Akim Demaille <akim@epita.fr>
16261
16262 * src/conflicts.c (finalize_conflicts): Rename as...
16263 (free_conflicts): this.
16264
16265 2001-09-22 Akim Demaille <akim@epita.fr>
16266
16267 * src/gram.c (gram_free): Rename back as...
16268 (dummy): this.
16269 (output_token_translations): Free `token_translations'.
16270 * src/symtab.c (free_symtab): Free the tag field.
16271
16272 2001-09-22 Akim Demaille <akim@epita.fr>
16273
16274 Remove `translations' as it is always set to true.
16275
16276 * src/gram.h: Adjust.
16277 * src/reader.c (packsymbols, parse_token_decl): Adjust
16278 * src/print.c (print_grammar): Adjust.
16279 * src/output.c (output_token_translations): Adjust.
16280 * src/lex.c (lex): Adjust.
16281 * src/gram.c: Be sure the set pointers to NULL.
16282 (dummy): Rename as...
16283 (gram_free): this.
16284
16285 2001-09-22 Akim Demaille <akim@epita.fr>
16286
16287 * configure.in: Invoke AM_LIB_DMALLOC.
16288 * src/system.h: Use dmalloc.
16289 * src/LR0.c: Be sure to have pointers initialized to NULL.
16290 (allocate_itemsets): Allocate kernel_items only if needed.
16291
16292 2001-09-22 Akim Demaille <akim@epita.fr>
16293
16294 * configure.in: Bump to 1.29b.
16295 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
16296 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
16297 need xmalloc.c in calc.y.
16298 From Pascal Bart.
16299
16300 2001-09-21 Akim Demaille <akim@epita.fr>
16301
16302 Version 1.29a.
16303 * Makefile.maint, config/config.guess, config/config.sub,
16304 * config/missing: Update from masters.
16305 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
16306 upon package.m4.
16307 * configure.in (ALL_LINGUAS): Add `tr'.
16308
16309 2001-09-21 Akim Demaille <akim@epita.fr>
16310
16311 * tests/Makefile.am (package.m4): Move to...
16312 ($(srcdir)/$(TESTSUITE)): here.
16313
16314 2001-09-20 Akim Demaille <akim@epita.fr>
16315
16316 * src/complain.c: No longer try to be standalone: use system.h.
16317 Don't assume __STDC__ is defined to 1. Just test if it is defined.
16318 * src/complain.h: Likewise.
16319 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
16320 Remove the unused variable `n'.
16321 From Albert Chin-A-Young.
16322
16323 2001-09-18 Marc Autret <autret_m@epita.fr>
16324
16325 * doc/bison.1: Update.
16326 * doc/bison.texinfo (Bison Options): Update --defines and --graph
16327 descriptions.
16328 (Option Cross Key): Update.
16329 Add --graph.
16330
16331 2001-09-18 Marc Autret <autret_m@epita.fr>
16332
16333 * tests/regression.at: New test (comment in %union).
16334
16335 2001-09-18 Marc Autret <autret_m@epita.fr>
16336
16337 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
16338 do that.
16339 Reported by Keith Browne.
16340
16341 2001-09-18 Marc Autret <autret_m@epita.fr>
16342
16343 * tests/output.at: Add tests for --defines and --graph.
16344
16345 2001-09-18 Marc Autret <autret_m@epita.fr>
16346
16347 * tests/output.at: Removes tests of %{header,src}_extension features.
16348
16349 2001-09-18 Akim Demaille <akim@epita.fr>
16350
16351 * tests/Makefile.am (package.m4): New.
16352 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
16353 (_AT_CHECK_CALC_ERROR): Likewise.
16354 Factor the `, ' part of verbose error messages.
16355
16356 2001-09-18 Marc Autret <autret_m@epita.fr>
16357
16358 * src/getargs.c (longopts): Declare --defines and --graph as options
16359 with optional arguments.
16360 * src/files.h: Add extern declarations.
16361 * src/files.c (spec_graph_file, spec_defines_file): New.
16362 (output_files): Update.
16363 Remove CPP-outed code.
16364
16365 2001-09-18 Marc Autret <autret_m@epita.fr>
16366
16367 Turn off %{source,header}_extension feature.
16368
16369 * src/files.c (compute_exts_from_gf): Update.
16370 (compute_exts_from_src): Update.
16371 (output_files): CPP-out useless code.
16372 * src/files.h: Remove {header,source}_extension extern declarations.
16373 * src/reader.c (parse_dquoted_param): CPP-out.
16374 (parse_header_extension_decl): Remove.
16375 (parse_source_extension_decl): Remove.
16376 (read_declarations): Remove cases tok_{hdrext,srcext}.
16377 * src/lex.c (percent_table): Remove {header,source}_extension entries.
16378 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
16379
16380 2001-09-10 Akim Demaille <akim@epita.fr>
16381
16382 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
16383 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
16384 (AT_CHECK_OUTPUT): this.
16385 Merely check ls' exit status, its output is useless.
16386
16387 2001-09-10 Akim Demaille <akim@epita.fr>
16388
16389 * tests/calc.at: Use m4_match.
16390 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
16391
16392 2001-09-10 Marc Autret <autret_m@epita.fr>,
16393 Akim Demaille <akim@epita.fr>
16394
16395 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
16396 enum color_e.
16397 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
16398 to `normal'.
16399 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
16400 * src/lex.h: Adjust prototype.
16401 (token_t): Add `tok_undef'.
16402 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
16403 (parse_percent_token): Now returns token_t.
16404 Add default statement in switch.
16405 (lex): Separate `c' as an input variable, from the token_t result
16406 part.
16407 (unlexed): Is a token_t.
16408
16409 2001-09-10 Akim Demaille <akim@epita.fr>
16410
16411 * configure.in: Bump to 1.29a.
16412
16413 2001-09-07 Akim Demaille <akim@epita.fr>
16414
16415 Version 1.29.
16416
16417 2001-08-30 Akim Demaille <akim@epita.fr>
16418
16419 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
16420 * m4/atconfig.m4: Remove.
16421 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
16422 * tests/bison: New.
16423 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
16424 m4_if, m4_patsubst, and m4_regexp.
16425 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
16426 `input' file instead of echo.
16427
16428 2001-08-29 Akim Demaille <akim@epita.fr>
16429
16430 Bump to 1.28e.
16431
16432 2001-08-29 Akim Demaille <akim@epita.fr>
16433
16434 Version 1.28d.
16435
16436 2001-08-29 Paul Eggert <eggert@twinsun.com>
16437
16438 * src/bison.simple (yyparse): Don't take the address of an
16439 item before the start of an array, as that doesn't conform to
16440 the C Standard.
16441
16442 2001-08-29 Robert Anisko <anisko_r@epita.fr>
16443
16444 * doc/bison.texinfo (Location Tracking Calc): New node.
16445
16446 2001-08-29 Paul Eggert <eggert@twinsun.com>
16447
16448 * src/output.c (output): Do not define const, as this now
16449 causes more problems than it cures.
16450
16451 2001-08-29 Akim Demaille <akim@epita.fr>
16452
16453 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
16454 the nodes.
16455 Be sure to tag the `detailmenu'.
16456
16457 2001-08-29 Akim Demaille <akim@epita.fr>
16458
16459 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
16460 download in a tmp dir.
16461
16462 2001-08-28 Marc Autret <autret_m@epita.fr>
16463
16464 * config/depcomp: New file.
16465
16466 2001-08-28 Marc Autret <autret_m@epita.fr>
16467
16468 * doc/bison.1 (mandoc): Adjust.
16469 From Juan Manuel Guerrero.
16470
16471 2001-08-28 Marc Autret <autret_m@epita.fr>
16472
16473 * src/print_graph.c (print_state): Fix.
16474
16475 2001-08-27 Marc Autret <autret_m@epita.fr>
16476
16477 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
16478 char * members.
16479 Echo modifications to the functions prototypes.
16480 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
16481
16482 2001-08-27 Marc Autret <autret_m@epita.fr>
16483
16484 * src/vcg.c: Include `xalloc.h'.
16485 (add_colorentry): New.
16486 (add_classname): New.
16487 (add_infoname): New.
16488 * src/vcg.h: Add new prototypes.
16489
16490 2001-08-27 Akim Demaille <akim@epita.fr>
16491
16492 * Makefile.maint: Sync. again with CVS Autoconf.
16493
16494 2001-08-27 Akim Demaille <akim@epita.fr>
16495
16496 * Makefile.maint: Formatting changes.
16497 (po-update, cvs-update, update): New targets.
16498 (AMTAR): Remove.
16499
16500 2001-08-27 Akim Demaille <akim@epita.fr>
16501
16502 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16503 * Makefile.maint: Sync. with CVS Autoconf.
16504
16505 2001-08-27 Marc Autret <autret_m@epita.fr>
16506
16507 * src/vcg.h (struct infoname_s): New.
16508 (struct colorentry_s): New.
16509 (graph_s): New fields {vertical,horizontal}_order in structure.
16510 Add `infoname' field.
16511 Add `colorentry' field;
16512 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
16513 (G_HORIZONTAL_ORDER): New.
16514 (G_INFONAME): New.
16515 (G_COLORENTRY): New.
16516 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
16517 Add output of `infoname'.
16518 Add output of `colorentry'.
16519
16520 2001-08-27 Marc Autret <autret_m@epita.fr>
16521
16522 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
16523 This one shadowed a global parameter.
16524
16525 2001-08-24 Marc Autret <autret_m@epita.fr>
16526
16527 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
16528 instead of `unsigned'.
16529 (print_state): Do not call obstack_object_size () in obstack_grow ()
16530 to avoid macro variables shadowing.
16531
16532 2001-08-23 Marc Autret <autret_m@epita.fr>
16533
16534 * src/lex.c (percent_table): Typo: s/naem/name/.
16535 Add graph option.
16536 Normalize new options declarations.
16537
16538 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
16539
16540 * tests/suite.at: Exercise %header_extension and %source_extension.
16541
16542 2001-08-16 Marc Autret <autret_m@epita.fr>
16543
16544 * src/reader.c (parse_dquoted_param): New.
16545 (parse_header_extension_decl): Use it.
16546 (parse_source_extension_decl): Likewise.
16547
16548 2001-08-16 Marc Autret <autret_m@epita.fr>
16549
16550 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
16551 (get_xxxx_str): Use assert () instead of complain ().
16552 Remove return invokations in default cases.
16553 (get_decision_str): Modify default behaviour. Remove second argument.
16554 Echo modifications on calls.
16555 (output_graph): Fix.
16556
16557 2001-08-16 Marc Autret <autret_m@epita.fr>
16558
16559 * src/getargs.c (usage): Update with ``-g, --graph''.
16560
16561 2001-08-16 Marc Autret <autret_m@epita.fr>
16562
16563 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
16564 (Option Cross Key): Likewise.
16565 * doc/bison.1: Update.
16566
1c8c2190
PB
165672001-09-25 Pascal Bart <pascal.bart@epita.fr>
16568
16569 * src/output.c (output_master_parser): Don't finish action_obstack.
16570 (output_parser): Don't care about the muscle action, here.
16571 (prepare): Copy the action_obstack in the action muscle.
16572 (output): Free action_obstack.
16573
180d45ba
PB
165742001-09-23 Pascal Bart <pascal.bart@epita.fr>
16575
16576 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
16577 will contain `%union' declaration.
16578 (parse_union_decl): Delete #line directive output.
16579 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
16580 informations about %union.
16581 (parse_union_decl): Copy the union_obstack in the muscle stype.
16582 * src/bison.simple: Add new #line directive.
16583 Add typdef %%stype YYSTYPE.
16584
c51d1a19
PB
165852001-09-23 Pascal Bart <pascal.bart@epita.fr>
16586
16587 * src/bison.simple: Add new `#line' directive.
16588
6f9344da
PB
165892001-09-22 Pascal Bart <pascal.bart@epita.fr>
16590
16591 * src/bison.simple: New `#line' directive.
16592 * src/output.c (output_parser): Support new dynamic muscle input_line.
16593
652def80
MA
165942001-09-22 Marc Autret <autret_m@epita.fr>
16595
16596 * src/output.c (output_master_parser): New.
16597 (output_parser): Be more re-entrant.
16598
25b222fa
MA
165992001-09-21 Marc Autret <autret_m@epita.fr>
16600
16601 * src/reader.c (copy_definition, parse_union_decl): Update and use
16602 `linef' muscle.
16603 (copy_action): Likewise.
16604 Use obstack_1grow ().
16605 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
16606
6bc35ae5
MA
166072001-09-21 Marc Autret <autret_m@epita.fr>
16608
16609 * src/options.c (option_table): Adjust.
16610 * src/lex.c (parse_percent_token): Fix.
16611
c0629aa1
PB
166122001-09-20 Pascal Bart <pascal.bart@epita.fr>
16613
16614 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 16615
82b6d266
PB
166162001-09-20 Pascal Bart <pascal.bart@epita.fr>
16617
16618 * src/lex.c (parse_percent_token): Change type of variable `tx', which
16619 is now an option_table_struct*.
16620 (option_strcmp): New function option_strcmp.
16621 (parse_percent_token): Call option_strcmp.
16622 * src/getargs.c (xalloc.h, options.h): Include it.
16623 (getargs): Call create_long_option_table.
16624 (getargs): Free longopts at the end of the function.
16625 (shortopts): Move in options.c.
16626 * src/options.c (create_long_option_table): New function. Convert
16627 information from option_table to option structure.
16628 * src/reader.c (options.h): Include it.
16629
16630 * src/Makefile.am: Adjust.
16631 * src/options.c (option_table): Create from longopts and percent_table.
16632 * src/getargs.c (longopts): Delete.
16633 * src/lex.c (struct percent_table_struct): Delete.
16634 (percent_table): Delete.
16635 (options.h): Include it.
16636 * src/options.c: Create.
16637 * src/options.h: Create.
16638 Declare enum opt_access_e.
16639 Define struct option_table_struct.
16640
75f5aaea
MA
166412001-09-20 Marc Autret <autret_m@epita.fr>
16642
16643 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
16644 sections of Bison.
16645
f508cb0a
PB
166462001-09-19 Pascal Bart <pascal.bart@epita.fr>
16647
16648 * src/bison.simple: s/%%filename/%%skeleton.
16649 * src/muscle_tab.c (getargs.h): Include it.
16650 (muscle_init): Insert new muscle skeleton.
16651
13105fc1
PB
166522001-09-18 Pascal Bart <pascal.bart@epita.fr>
16653
16654 * src/output.c (output_parser): Delete unused variable actions_dumped.
16655
b0c4483e
PB
166562001-09-07 Pascal Bart <pascal.bart@epita.fr>
16657
16658 * src/output.c (output): Delete call to reader_output_yylsp.
16659 * src/reader.c (reader): Likewise.
ba0fe3c7 16660 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 16661
11d82f03
MA
166622001-09-02 Marc Autret <autret_m@epita.fr>
16663
16664 * src/reader.c: Include muscle_tab.h.
16665 (parse_union_decl): Update.
16666 (parse_macro_decl): Rename parse_muscle_decl.
16667 Update to use renamed functions and variable.
16668 (read_declarations, copy_action, read_additionnal_code, : Updated
16669 with correct variables and functions names.
16670 (packsymbols, reader): Likewise.
342b8b6e 16671
11d82f03 16672 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 16673
11d82f03
MA
16674 * src/output.c: Include muscle_tab.h
16675 In all functions using macro_insert, change by using muscle_insert ().
16676 (macro_obstack): Rename muscle_obstack.
16677 Echo modifications in the whole file.
16678 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
16679 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
16680 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
16681
16682 * src/muscle_tab.h: Update double inclusion macros.
16683 (macro_entry_s): Rename muscle_entry_s.
16684 Update prototypes.
342b8b6e 16685
11d82f03
MA
16686 * src/muscle_tab.c: Include muscle_tab.h.
16687 Rename macro_tabble to muscle_table.
16688 (mhash1, mhash2, mcmp): Use muscle_entry.
16689 (macro_init): Rename muscle_init. Update.
16690 (macro_insert): Rename muscle_insert. Update.
16691 (macro_find): Rename muscle_find. Update.
16692
16693 * src/main.c: Include muscle_tab.h.
16694 (main): Call muscle_init ().
16695 * src/Makefile.am (bison_SOURCES): Echo modifications.
16696
93a37297
MA
166972001-09-02 Marc Autret <autret_m@epita.fr>
16698
f753cd62 16699 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 16700
f753cd62
MA
16701 * src/muscle_tab.c, src/muscle_tab.h: Add files.
16702
167032001-09-02 Marc Autret <autret_m@epita.fr>
16704
16705 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 16706
682d48cd
PB
167072001-09-01 Pascal Bart <pascal.bart@epita.fr>
16708
342b8b6e 16709 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
16710 filename.
16711
087c8fda
MA
167122001-09-01 Marc Autret <autret_m@epita.fr>
16713
16714 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
16715 to an explicit value to activate the feature. We do it here.
16716
dda680cb
PB
167172001-08-31 Pascal Bart <pascal.bart@epita.fr>
16718
16719 * src/output.c (prepare): Delete the `filename' muscule insertion.
16720 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
16721 (parse_union_decl): Likewise.
16722 * src/macrotab.c (macro_init): Initialize filename by infile.
16723
9e644e64
MA
167242001-08-31 Marc Autret <autret_m@epita.fr>
16725
16726 * src/bison.simple (YYLSP_NEEDED): New definition.
16727 * src/output.c (prepare): Add macro insertion of `locations_flag'
16728
17da6427
PB
167292001-08-31 Pascal Bart <pascal.bart@epita.fr>
16730
16731 * src/output.c (prepare): Delete insertion of previous muscles,
16732 and insert the `prefix' muscles.
16733 * src/macrotab.c (macro_init): Likewise.
16734 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 16735 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
16736 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
16737 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 16738 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
16739 name_prefix.
16740
e8cb70b9
PB
167412001-08-31 Pascal Bart <pascal.bart@epita.fr>
16742
16743 * src/main.c (main): Standardize.
16744 * src/output.c (output_table_data, output_parser): Likewise.
16745 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
16746
63c2d5de
MA
167472001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
16748
342b8b6e 16749 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
16750 %%epilogue.
16751 * src/output.c (output): Rename %%declarations to %%prologue.
16752 * src/bison.simple: Echo modifications.
342b8b6e 16753
d8cb5183
MA
167542001-08-31 Marc Autret <autret_m@epita.fr>
16755
16756 * src/reader.c (readgram): CleanUp.
16757 (output_token_defines): Likewise.
16758 (packsymbols): Likewise.
16759 (reader): Likewise.
16760 * src/output.c (output): CPP-out useless code.
16761
6c686258
PB
167622001-08-31 Pascal Bart <pascal.bart@epita.fr>
16763
342b8b6e 16764 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
16765 output_trailers and output_headers.
16766 * src/output.h: Remove obsolete functions prototypes of output_headers
16767 and output_trailers.
16768
8f451ef7
PB
167692001-08-30 Pascal Bart <pascal.bart@epita.fr>
16770
16771 * src/main.c: Include macrotab.h.
342b8b6e 16772 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
16773 Adjust functions prototypes.
16774 * src/macrotab.c (macro_insert): Constify key and value.
16775 (macro_find): Constify key.
16776 (macro_insert): Include 'xalloc.h'
16777 (macro_insert): Use XMALLOC.
16778 (macro_find): Constify return value.
16779 * src/output.c (output_table_data): Rename table to table_data.
16780 (output_parser): Constify macro_key, macro_value.
16781
997b6fd0 167822001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
16783
16784 * src/reader.c (parse_skel_decl): New.
342b8b6e 16785 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
16786 * src/lex.h (token_t): New token `tok_skel'.
16787 * src/lex.c (percent_table): Add skeleton option entry.
16788 Standardize.
16789
ff48177d
MA
167902001-08-29 Marc Autret <autret_m@epita.fr>
16791
16792 * src/bison.simple: Add %%user_code directive at the end.
16793 * src/reader.c (read_additionnal_code): New.
16794 (reader): Use it.
16795 * src/output.c (output_program): Remove.
16796 (output): Update.
16797
b33160bf
MA
167982001-08-28 Marc Autret <autret_m@epita.fr>
16799
16800 * src/output.c (output_actions): Clean up.
4e5caae2 16801 (output_gram): CPP-out useless code.
b33160bf
MA
16802 * src/reader.c (reader): Clean up, CPP-out useless code.
16803
d1a2daf7
PB
168042001-08-28 Pascal Bart <pascal.bart@epita.fr>
16805
342b8b6e 16806 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 16807 directive.
d1a2daf7
PB
16808 * src/bison.simple: Add `%%definitions'.
16809
2b763dfe
MA
168102001-08-28 Marc Autret <autret_m@epita.fr>
16811
16812 * config/depcomp: New file.
16813
f1a87ef6
PE
168142001-08-27 Paul Eggert <eggert@twinsun.com>
16815
16816 * src/bison.simple (yyparse): Don't take the address of an
16817 item before the start of an array, as that doesn't conform to
16818 the C Standard.
16819
82e236e2
RA
168202001-08-27 Robert Anisko <robert.anisko@epita.fr>
16821
f1a87ef6 16822 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
16823 obstack. It was done too late here.
16824
16825 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
16826 completely wrong.
16827 (reader): Initialize the macro obstack here, since we need it to grow
16828 '%define' directives.
16829
16830 * src/reader.h: Declare the macro obstack as extern.
16831
b0cfa28a
RA
168322001-08-27 Robert Anisko <robert.anisko@epita.fr>
16833
16834 * src/output.c (output_parser): Fix. Store single '%' characters in
16835 the output obstack instead of throwing them away.
16836
6fc74234
AD
168372001-08-27 Akim Demaille <akim@epita.fr>
16838
16839 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16840
9c76d118
RA
168412001-08-25 Robert Anisko <robert.anisko@epita.fr>
16842
16843 * lib/Makefile.am: Adjust.
16844
a8289c62
RA
168452001-08-25 Robert Anisko <robert.anisko@epita.fr>
16846
16847 * src/bison.simple: Update and add '%%' directives.
16848
b6610515
RA
168492001-08-25 Robert Anisko <robert.anisko@epita.fr>
16850
16851 * src/reader.c (reader): Remove calls to 'output_headers' and
16852 'output_trailers'. Remove some C output.
16853 (readgram): Disable a piece of code that was writing a default
16854 definition for 'YYSTYPE'.
16855 (reader_output_yylsp): Remove.
16856 (packsymbols): Output token defintions to a macro.
16857 (copy_definition): Disable C output.
6fc74234 16858
b6610515
RA
16859 * src/reader.c (parse_macro_decl): New function used to parse macro
16860 declarations.
16861 (copy_string2): Put the body of copy_string into this new function.
16862 Add a parameter to let the caller choose whether he wants to copy the
16863 string delimiters or not.
16864 (copy_string): Be a simple call to copy_string2 with the last argument
16865 bound to true.
16866 (read_declarations): Add case for macro definition.
16867 (copy_identifier): New.
6fc74234 16868 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
16869 rather than lex.
16870
26f609ff
RA
168712001-08-25 Robert Anisko <robert.anisko@epita.fr>
16872
16873 * src/output.c (prepare): Add prefixed names.
16874 (output_parser): Output semantic actions.
16875 (output_parser): Fix bug on '%%line' directives.
6fc74234 16876
26f609ff
RA
16877 * src/output.c (output_headers): Remove. The C code printed by this
16878 function should now be in the skeletons.
16879 (output_trailers): Remove.
16880 (output): Disable call to 'reader_output_yylsp'.
16881 (output_rule_data): Do not output tables to the table obstack.
16882
16883 * src/output.c: Remove some C dedicated output.
16884 Improve the use of macro and output obstacks.
16885 (output_defines): Remove.
6fc74234 16886
26f609ff
RA
16887 * src/output.c (output_token_translations): Associate 'translate'
16888 table with a macro. No output to the table obstack.
16889 (output_gram): Same for 'rhs' and 'prhs'.
16890 (output_stos): Same for 'stos'.
16891 (output_rule_data): Same for 'r1' and 'r2'.
16892 (token_actions): Same for 'defact'.
16893 (goto_actions): Same for 'defgoto'.
16894 (output_base): Same for 'pact' and 'pgoto'.
16895 (output_table): Same for 'table'.
16896 (output_check): Same for 'check'.
6fc74234 16897
26f609ff
RA
16898 * src/output.c (output_table_data): New function.
16899 (output_short_table): Remove.
16900 (output_short_or_char_table): Remove.
6fc74234 16901
26f609ff
RA
16902 * src/output.c (output_parser): Replace most of the skeleton copy code
16903 with something new. Skeletons are now processed character by character
16904 rather than line by line, and Bison looks for '%%' macros. This is the
16905 first step in making Bison's output process (a lot) more flexible.
16906 (output_parser): Use the macro table.
16907
6f43b113
RA
169082001-08-25 Robert Anisko <robert.anisko@epita.fr>
16909
16910 * src/main.c (main): Initialize the macro table.
16911
dd3127cf
RA
169122001-08-25 Robert Anisko <robert.anisko@epita.fr>
16913
16914 * src/lex.c (percent_table): Add tok_define.
16915 * src/lex.h: Add tok_define.
16916
aa321494
RA
169172001-08-25 Robert Anisko <robert.anisko@epita.fr>
16918
16919 * src/macrotab.c: New file.
16920 * src/macrotab.h: New file.
16921 * src/Makefile.am: Update.
16922
68bd3b6b
RA
169232001-08-25 Robert Anisko <robert.anisko@epita.fr>
16924
16925 * lib/hash.c: New file.
16926 * lib/hash.h: New file.
16927 * lib/Makefile.am: Update.
16928
45f8dd1e
AD
169292001-08-15 Akim Demaille <akim@epita.fr>
16930
16931 Version 1.28c.
16932
40a64a7a 169332001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
16934
16935 * src/reader.c (readgram): Indent output macro YYSTYPE.
16936 (packsymbols): Likewise.
16937 (output_token_defines): Likewise.
16938 * src/files.c: Standardize.
16939 (compute_header_macro): New.
16940 (defines_obstack_save): New. Use compute_header_macro.
16941 (output_files): Update. Use defines_obstack_save.
16942
f9a8293a
AD
169432001-08-15 Akim Demaille <akim@epita.fr>
16944
16945 * doc/bison.texinfo (Table of Symbols): Document
16946 YYSTACK_USE_ALLOCA.
16947
150ca7a7
AD
169482001-08-15 Akim Demaille <akim@epita.fr>
16949
16950 * missing: Update from CVS Automake.
16951 * config/config.guess, config/config.sub, config/texinfo.tex:
16952 Update from gnu.org.
16953
69b5cec4
AD
169542001-08-15 Akim Demaille <akim@epita.fr>
16955
16956 * Makefile.maint: Sync with CVS Autoconf.
16957
f2b5126e
PB
169582001-08-14 Pascal Bart <pascal.bart@epita.fr>
16959
69b5cec4 16960 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
16961 `fdl.texi'.
16962 * doc/fdl.texi: Add to package.
16963
4ecbf796
MA
169642001-08-14 Marc Autret <autret_m@epita.fr>
16965
16966 Turn on %{source,header}_extension features.
16967
69b5cec4 16968 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
16969 source_extension.
16970 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 16971 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
16972 between options.
16973
95fb5662
MA
169742001-08-14 Marc Autret <autret_m@epita.fr>
16975
16976 * src/files.c (compute_base_names): Add extensions computing when
16977 `--file-prefix' used.
16978 Standardize function calls.
16979
78d09da9
MA
169802001-08-13 Marc Autret <autret_m@epita.fr>
16981
69b5cec4 16982 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
16983 defining it (defined but null disables alloca).
16984
5a009f2c
MA
169852001-08-13 Marc Autret <autret_m@epita.fr>
16986
16987 * src/bison.simple (_yy_memcpy): CPP reformat.
16988
1e41465a
PB
169892001-08-13 Pascal Bart <pascal.bart@epita.fr>
16990
16991 * tests/atconfig.in (CPPFLAGS): Fix.
16992
c67a198d
PB
169932001-08-10 Pascal Bart <pascal.bart@epita.fr>
16994
79282c6c 16995 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
16996 `gpl.texi'.
16997 * doc/gpl.texi: Add to package.
16998
09a6de7e
MA
169992001-08-10 Marc Autret <autret_m@epita.fr>
17000
17001 * src/print_graph.h: Fix.
17002 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
17003
b77b9ee0
AD
170042001-08-10 Akim Demaille <akim@epita.fr>
17005
17006 * src/system.h: Provide default declarations for stpcpy, strndup,
17007 and strnlen.
17008
3e259915
MA
170092001-08-10 Robert Anisko <anisko_r@epita.fr>
17010
17011 * doc/bison.texinfo (Locations): Update @$ stuff.
17012
ca96bc2d
MA
170132001-08-09 Robert Anisko <anisko_r@epita.fr>
17014
17015 * src/bison.simple (YYLLOC_DEFAULT): Update.
17016 (yyparse): Adjust.
17017
fdc6758b
MA
170182001-08-08 Marc Autret <autret_m@epita.fr>
17019
b77b9ee0 17020 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
17021 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
17022 Reported by Fabrice Bauzac.
957d4dbf 17023
600cad3b
MA
170242001-08-08 Marc Autret <autret_m@epita.fr>
17025
17026 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
17027 * src/vcg.c (output_node): Fix.
17028 * src/vcg.h: Cleanup.
17029 * src/print_graph.c: Add comments.
b77b9ee0 17030 (node_output_size): New global variable. Simplify the formatting of
600cad3b 17031 the VCG graph output.
b77b9ee0 17032 (print_actions): Unused code is now used. It notifies the final state
600cad3b 17033 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 17034 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
17035 blue.
17036 Get the current node name and node_obstack by argument.
17037 (node_obstack): New variable.
17038 (print_state): Manage node_obstack.
17039 (print_core): Use node_obstack given by argument.
17040 A node is not only computed here but in print_actions also.
17041 (print_graph): CPP out useless code instead of commenting it.
17042
976e528f
AD
170432001-08-07 Pascal Bart <pascal.bart@epita.fr>
17044
17045 * tests/atconfig.in (CPPFLAGS): Fix.
17046
20e8e5ca
AD
170472001-08-07 Akim Demaille <akim@epita.fr>
17048
17049 * src/print_graph.c (quote): New.
17050 (print_core): Use it.
17051
957d4dbf 170522001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 17053
3e3da797
AD
17054 * src/vcg.c (complain.h): Include it.
17055 Unepitaize `return' invocations.
c4b66126 17056 [NDEBUG] (main): Remove.
79282c6c 17057 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
17058 * src/files.c (open_files): Initialize graph_obstack.
17059 * src/print_graph.c (print_actions): CPP out useless code.
17060 (print_core): Don't output the last `\n' in labels.
17061 Use `quote'.
17062 * src/files.c (output_files): Output the VCG file.
17063 * src/main.c (main): Invoke print_graph ();
3e3da797 17064
957d4dbf 170652001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
17066
17067 Automaton VCG graph output.
17068 Using option ``-g'' or long option ``--graph'', you can generate
17069 a gram_filename.vcg file containing a VCG description of the LALR (1)
17070 automaton of your grammar.
17071
17072 * src/main.c: Call to print_graph() function.
17073 * src/getargs.h: Update.
17074 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
17075 (graph_flag): New flag.
17076 (longopts): Update.
17077 (getargs): Add case `g'.
17078 * src/files.c (graph_obstack): New obstack struct.
17079 (open_files): Initialize new obstack.
17080 (output_files): Saves graph_obstack if required.
17081 * src/files.h (graph_obstack): New extern declaration.
17082 * src/Makefile.am: Add new source files.
17083
927c1557 170842001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
17085
17086 * src/print_graph.c, src/print_graph.h (graph): New.
17087 * src/vcg.h: New file.
17088 * src/vcg.c: New file, VCG graph handling.
17089
7333d403
AD
170902001-08-06 Marc Autret <autret_m@epita.fr>
17091
17092 Add of %source_extension and %header_extension which specify
17093 the source or/and the header output file extension.
17094
17095 * src/files.c (compute_base_names): Remove initialisation of
17096 src_extension and header_extension.
17097 (compute_exts_from_gf): Update.
17098 (compute_exts_from_src): Update.
17099 (output_files): Update.
17100 * src/reader.c (parse_header_extension_decl): New.
17101 (parse_source_extension_decl): New.
17102 (read_declarations): New case statements for the new tokens.
17103 * src/lex.c (percent_table): Add entries for %source_extension
17104 and %header_extension.
17105 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
17106
84163231
AD
171072001-08-06 Marc Autret <autret_m@epita.fr>
17108
17109 * configure.in: Bump to 1.28c.
17110 * doc/bison.texinfo: Texinfo thingies.
17111
8303fc42
AD
171122001-08-04 Pascal Bart <pascal.bart@epita.fr>
17113
17114 * tests/atconfig.in (CPPFLAGS): Add.
17115 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
17116
70a84437
AD
171172001-08-03 Akim Demaille <akim@epita.fr>
17118
17119 Version 1.28b.
17120
2ce10144
AD
171212001-08-03 Akim Demaille <akim@epita.fr>
17122
17123 * tests/Makefile.am (check-local): Ship testsuite.
17124 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
17125 Include `string.h'.
17126
1e3e4bc1
AD
171272001-08-03 Akim Demaille <akim@epita.fr>
17128
17129 * configure.in: Try using -Wformat when compiling.
17130
42b45b7f
AD
171312001-08-03 Akim Demaille <akim@epita.fr>
17132
17133 * configure.in: Bump to 1.28b.
17134
8f13fe33
AD
171352001-08-03 Akim Demaille <akim@epita.fr>
17136
17137 * src/complain.c: Adjust strerror_r portability issues.
17138
b37ba92c
AD
171392001-08-03 Akim Demaille <akim@epita.fr>
17140
17141 Version 1.28a.
17142
b0ce6046
AD
171432001-08-03 Akim Demaille <akim@epita.fr>
17144
17145 * src/getargs.c, src/getarg.h (skeleton)): Constify.
17146 * src/lex.c (literalchar): Avoid name clashes on `buf'.
17147 * src/getargs.c: Include complain.h.
17148 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
17149 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
17150
d01c415b
AD
171512001-08-03 Akim Demaille <akim@epita.fr>
17152
17153 * src/reader.c (readgram): Display hidden chars in error messages.
17154
459dd1a6
AD
171552001-08-03 Akim Demaille <akim@epita.fr>
17156
17157 Update to gettext 0.10.39.
17158
53b74c0c
AD
171592001-08-03 Akim Demaille <akim@epita.fr>
17160
17161 * lib/strspn.c: New.
17162
234a3be3
AD
171632001-08-01 Marc Autret <autret_m@epita.fr>
17164
17165 * doc/bison.texinfo: Update.
17166 * doc/bison.1 (mandoc): Update.
17167 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
17168 * src/files.c: Support output files extensions computing.
17169 (src_extension): New static variable.
17170 (header_extension): New static variable.
17171 (tr): New function.
17172 (get_extension_index): New function, gets the index of an extension
17173 filename in a string.
17174 (compute_exts_from_gf): New function, computes extensions from the
17175 grammar file extension.
17176 (compute_exts_from_src): New functions, computes extensions from the
17177 C source file extension, file given by ``-o'' option.
17178 (compute_base_names): Update.
17179 (output_files): Update.
17180
847bf1f5
AD
171812001-08-01 Robert Anisko <anisko_r@epita.fr>
17182
d995fee7 17183 * doc/bison.texi: Document @$.
847bf1f5
AD
17184 (Locations): New section.
17185
d074a105
AD
171862001-07-18 Akim Demaille <akim@epita.fr>
17187
17188 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
17189 * config/prev-version.txt, config/move-if-change: New.
17190 * Makefile.am: Adjust.
17191
3419715d
AD
171922001-07-08 Pascal Bart <pascal.bart@epita.fr>
17193
17194 * src/bison.simple (yyparse): Suppress warning `comparaison
17195 between signed and unsigned'.
17196
62ab6972
AD
171972001-07-05 Pascal Bart <pascal.bart@epita.fr>
17198
17199 * src/getargs.h (raw_flag): Remove.
17200 * src/getargs.c: Die on `-r'/`--raw'.
17201 * src/lex.c (parse_percent_token): Die on `%raw'.
17202 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
17203 * tests/calc.at: Suppress test with option `--raw'.
17204
1e24cc5b
AD
172052001-07-14 Akim Demaille <akim@epita.fr>
17206
17207 * config/: New.
17208 * configure.in: Require Autoconf 2.50.
17209 Update to gettext 0.10.38.
17210
32dfccf8
AD
172112001-03-16 Akim Demaille <akim@epita.fr>
17212
17213 * doc/bison.texinfo: ANSIfy the examples.
17214
cd5bd6ac
AD
172152001-03-16 Akim Demaille <akim@epita.fr>
17216
17217 * getargs.c (skeleton): New variable.
17218 (longopts): --skeleton is a new option.
17219 (shortopts, getargs): -S is a new option.
17220 * getargs.h: Declare skeleton.
17221 * output.c (output_parser): Use it.
17222
5141b016
AD
172232001-03-16 Akim Demaille <akim@epita.fr>
17224
17225 * m4/strerror_r.m4: New.
17226 * m4/error.m4: Run AC_FUNC_STRERROR_R.
17227 * lib/error.h, lib/error.c: Update.
17228
447992b9
AD
172292001-03-16 Akim Demaille <akim@epita.fr>
17230
17231 * src/getargs.c (longopts): Clean up.
17232
274d42ce
AD
172332001-02-21 Akim Demaille <akim@epita.fr>
17234
17235 * src/reader.c (gensym): `gensym_count' is your own.
17236 Use a static buf to create the symbol name, as token_buffer is no
17237 longer a buffer.
17238
22c821f3
AD
172392001-02-08 Akim Demaille <akim@epita.fr>
17240
17241 * src/conflicts.c (conflict_report): Be sure not to append to res
17242 between two calls, which could happen if both first sprintf were
17243 skipped, but not the first cp += strlen.
17244
18569462
AD
172452001-02-08 Akim Demaille <akim@epita.fr>
17246
17247 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
17248 New, from fileutils 4.0.37.
17249 * configure.in: Require Autoconf 2.49c. I took some time before
17250 making this decision. This is the only way out for portability
17251 issues in Bison, it would mean way too much duplicate effort to
17252 import in Bison features implemented in 2.49c since 2.13.
17253 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
17254
0d8f3c8a
AD
172552001-02-02 Akim Demaille <akim@epita.fr>
17256
17257 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 17258 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 17259
f17bcd1f
AD
172602001-01-19 Akim Demaille <akim@epita.fr>
17261
17262 Get rid of the ad hoc handling of token_buffer in the scanner: use
17263 the obstacks.
17264
17265 * src/lex.c (token_obstack): New.
17266 (init_lex): Initialize it. No longer call...
17267 (grow_token_buffer): this. Remove it.
17268 Adjust all the places which used it to use the obstack.
17269
511e79b3
AD
172702001-01-19 Akim Demaille <akim@epita.fr>
17271
17272 * src/lex.h: Rename all the tokens:
17273 s/\bENDFILE\b/tok_eof/g;
17274 s/\bIDENTIFIER\b/tok_identifier/g;
17275 etc.
17276 Let them be enums, not #define, to ease debugging.
17277 Adjust all the code.
17278
0d6508ef
AD
172792001-01-18 Akim Demaille <akim@epita.fr>
17280
17281 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
17282 * src/lex.c (maxtoken, grow_token_buffer): Static.
17283
6deb4447
AD
172842001-01-18 Akim Demaille <akim@epita.fr>
17285
17286 Since we now use obstacks, more % directives can be enabled.
17287
17288 * src/lex.c (percent_table): Also accept `%yacc',
17289 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
17290 `%debug'.
17291 Handle the actions for `%semantic_parser' and `%pure_parser' here,
17292 instead of returning a token.
17293 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
17294 * src/reader.c (read_declarations): Adjust.
17295 * src/files.c (open_files): Don't call `compute_base_names', don't
17296 compute `attrsfile' since they depend upon data which might be
17297 *in* the input file now.
17298 (output_files): Do it here.
17299 * src/output.c (output_headers): Document the fact that this patch
17300 introduces a guaranteed SEGV for semantic parsers.
17301 * doc/bison.texinfo: Document them.
17302 * tests/suite.at: Exercise these %options.
17303
ff4423cc
AD
173042000-12-20 Akim Demaille <akim@epita.fr>
17305
17306 Also handle the output file (--verbose) with obstacks.
17307
17308 * files.c (foutput): Remove.
17309 (output_obstack): New.
17310 Adjust all dependencies.
17311 * src/conflicts.c: Return a string.
17312 * src/system.h (obstack_grow_string): Rename as...
17313 (obstack_sgrow): this. Be ready to work with non literals.
17314 (obstack_fgrow4): New.
17315
956dba3a
AD
173162000-12-20 Akim Demaille <akim@epita.fr>
17317
17318 * src/files.c (open_files): Fix the computation of short_base_name
17319 in the case of `-o foo.tab.c'.
17320
337bab46
AD
173212000-12-20 Akim Demaille <akim@epita.fr>
17322
17323 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
17324 (copy_dollar): Now that everything uses obstacks, get rid of the
17325 FILE * parameters.
17326
5d3214b8
AD
173272000-12-20 Akim Demaille <akim@epita.fr>
17328
17329 * src/files.c (open_files): Actually the `.output' file is based
17330 on the short_base_name, not base_name.
17331 * tests/suite.at (Checking output file names): Adjust.
17332
29092a57
AD
173332000-12-20 Akim Demaille <akim@epita.fr>
17334
17335 * src/bison.s1: Remove, we now use directly...
17336 * src/bison.simple: this.
17337 * src/Makefile.am: Use pkgdata instead of data.
17338
ea5607fd
AD
173392000-12-20 Akim Demaille <akim@epita.fr>
17340
17341 * src/files.c (guard_obstack): New.
17342 (open_files): Initialize it.
17343 (output_files): Dump it...
17344 * src/files.h: Export it.
17345 * src/reader.c (copy_guard): Use it.
17346
27110317
AD
173472000-12-19 Akim Demaille <akim@epita.fr>
17348
17349 * src/files.c (outfile, defsfile, actfile): Removed as global
17350 vars.
17351 (open_files): Don't compute them.
17352 (output_files): Adjust.
17353 (base_name, short_base_name): Be global.
17354 Adjust dependencies.
17355
19c50364
AD
173562000-12-19 Akim Demaille <akim@epita.fr>
17357
17358 * src/files.c (strsuffix): New.
17359 (stringappend): Be just like strcat but allocate.
17360 (base_names): Eve out from open_files.
17361 Try to simplify the rather hairy computation of base_name and
17362 short_base_name.
17363 (open_files): Use it.
17364 * tests/suite.at (Checking output file names): New test.
17365
573c1d9f
AD
173662000-12-19 Akim Demaille <akim@epita.fr>
17367
17368 * src/system.h (obstack_grow_literal_string): Rename as...
17369 (obstack_grow_string): this.
17370 * src/output.c (output_parser): Recognize `%% actions' instead of
17371 `$'.
17372 * src/bison.s1: s/$/%% actions/.
17373 * src/bison.hairy: Likewise.
17374
ef7ddedd
AD
173752000-12-19 Akim Demaille <akim@epita.fr>
17376
17377 * src/output.c (output_parser): Compute the `#line' lines when
17378 there are.
17379 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
17380 Suggested by Hans Aberg.
17381
ff61dabd
AD
173822000-12-19 Akim Demaille <akim@epita.fr>
17383
17384 Let the handling of the skeleton files be local to the procedures
17385 that use it.
17386
17387 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
17388 longer static.
17389 (fparser, open_extra_files): Remove.
17390 (open_files, output_files): Don't take care of fparser.
17391 * src/files.h: Adjust.
17392 * src/output.c (output_parser): Open and close the file to the
17393 skeleton.
17394 * src/reader.c (read_declarations): When %semantic_parser, open
17395 fguard.
17396
55b96341
AD
173972000-12-19 Akim Demaille <akim@epita.fr>
17398
17399 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
17400 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
17401
358c15b7
AD
174022000-12-19 Akim Demaille <akim@epita.fr>
17403
17404 * src/files.c (open_files): Yipee! We no longer need all the code
17405 looking for `/tmp' since we have no tmp file.
17406
7de3329e
AD
174072000-12-19 Akim Demaille <akim@epita.fr>
17408
17409 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
17410 New macros.
17411 * src/files.c (open_files): Less dependency on MSDOS etc.
17412
3abcd459
AD
174132000-12-14 Akim Demaille <akim@epita.fr>
17414
17415 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
17416 Provide a default definition.
17417 Use it when executing the default @ action.
17418 * src/reader.c (reader_output_yylsp): No longer include
17419 `timestamp' and `text' in the default YYLTYPE.
17420
2a91a95e
AD
174212000-12-12 Akim Demaille <akim@epita.fr>
17422
17423 * src/reader.c (copy_definition, parse_union_decl, copy_action)
17424 (copy_guard): Quote the file names.
17425 Reported by Laurent Mascherpa.
17426
14d3eb9b
AD
174272000-12-12 Akim Demaille <akim@epita.fr>
17428
17429 * src/output.c (output_headers, output_program, output): Be sure
17430 to escape special characters when outputting filenames.
17431 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
17432 (output_headers): Don't depend on them, Use ACTSTR.
17433
d7045ec6
AD
174342000-11-17 Akim Demaille <akim@epita.fr>
17435
17436 * lib/obstack.h: Formatting changes.
17437 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
17438 prevents type checking.
17439 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
17440 cast the value to (void *): assigning a `foo *' to a `void *'
17441 variable is valid.
17442 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
17443 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
17444 append characters.
17445
6fd54b73
AD
174462000-11-17 Akim Demaille <akim@epita.fr>
17447
17448 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
17449 as...
17450 (suite.m4, regression.m4, calc.m4): these.
17451 * tests/atgeneral.m4: Update from CVS Autoconf.
17452
4c50eae6
AD
174532000-11-17 Akim Demaille <akim@epita.fr>
17454
17455 * tests/regression.m4 (%union and --defines): New test,
17456 demonstrating a current bug in the obstack implementation.
17457
a35f64ea
AD
174582000-11-17 Akim Demaille <akim@epita.fr>
17459
17460 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
17461 macros.
17462 Use them to declare the variables which are global or local to
17463 `yyparse'.
17464
7de23534
AD
174652000-11-17 Akim Demaille <akim@epita.fr>
17466
17467 * acconfig.h: Remove, no longer used.
17468
aa7815f5
AD
174692000-11-07 Akim Demaille <akim@epita.fr>
17470
17471 * src: s/Copyright (C)/Copyright/g.
17472
5af1f549
AD
174732000-11-07 Akim Demaille <akim@epita.fr>
17474
17475 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
17476 defining.
17477 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
17478
553e2b22
AD
174792000-11-07 Akim Demaille <akim@epita.fr>
17480
17481 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
17482 Merge in a single CPP if/else.
17483
8a4f41d6
AD
174842000-11-07 Akim Demaille <akim@epita.fr>
17485
17486 * src/output.c (output): Remove useless variables.
17487 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
17488 argument `data' for consistency with the prototypes.
17489 Qualify it `const'.
17490 (obstack_copy, obstack_copy0): Rename the second argument as
17491 `address' for consistency. Qualify it `const'.
17492 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
17493 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
17494 `const' their input argument (`data' or `address').
17495 Adjust the corresponding macros to include `const' in casts.
17496
095a3fb5
AD
174972000-11-03 Akim Demaille <akim@epita.fr>
17498
17499 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
17500 s/PFILE1/BISON_HAIRY/.
17501 Adjust dependencies.
17502
d1cdce7c
AD
175032000-11-03 Akim Demaille <akim@epita.fr>
17504
090c5ebf 17505 For some reason, this was not applied.
d1cdce7c
AD
17506
17507 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
17508 `unlink': it's no longer used.
17509
9311529b
AD
175102000-11-03 Akim Demaille <akim@epita.fr>
17511
17512 * src/files.c (skeleton_find): New function, eved out of...
17513 (open_files, open_extra_files): here.
17514
d8880f69
AD
175152000-11-03 Akim Demaille <akim@epita.fr>
17516
17517 Don't use `atexit'.
17518
17519 * src/files.c (obstack_save): New function.
17520 (done): Rename as...
17521 (output_files): this.
17522 Use `obstack_save'.
17523 * src/main.c (main): Don't use `atexit' to register `done', since
17524 it no longer has to remove tmp files, just call `output_files'
17525 when there are no errors.
17526
0dbb648e
AD
175272000-11-02 Akim Demaille <akim@epita.fr>
17528
17529 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
17530 `unlink': it's no longer used.
17531 * src/files.h: Formatting changes.
17532
896fe5c1
AD
175332000-11-02 Akim Demaille <akim@epita.fr>
17534
17535 Remove the last uses of mktemp and unlink/delete.
17536
17537 * src/files.c (fdefines, ftable): Removed.
17538 (defines_ostack, table_obstack): New.
17539 Adjust dependencies of the former into uses of the latter.
17540 * src/output.c (output_short_or_char_table, output_short_table):
17541 Convert to using obstacks.
17542 * src/reader.c (copy_comment2): Accept one FILE * and two
17543 obstacks.
17544 (output_token_defines, reader_output_yylsp): Use obstacks.
17545 * src/system.h (obstack_fgrow3): New.
1f65350a 17546 * po/POTFILES.in: Adjust.
896fe5c1 17547
dd60faec
AD
175482000-11-01 Akim Demaille <akim@epita.fr>
17549
17550 Change each use of `fattrs' into a use of `attrs_obstack'.
17551
17552 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
17553 * src/files.c (fattrs): Remove.
17554 (attrs_obstack): New.
17555 Adjust all dependencies.
17556 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
17557
8c7ebe49
AD
175582000-11-01 Akim Demaille <akim@epita.fr>
17559
17560 Introduce obstacks.
17561 Change each use of `faction' into a use of `action_obstack'.
17562
17563 * lib/obstack.h, lib/obstack.c: New files.
17564 * src/files.c (faction): Remove.
17565 (action_obstack): New.
17566 Adjust all dependencies.
17567
77aee789
AD
175682000-10-20 Akim Demaille <akim@epita.fr>
17569
17570 * lib/quote.h (PARAMS): New macro. Use it.
17571
43591cec
AD
175722000-10-16 Akim Demaille <akim@epita.fr>
17573
17574 * src/output.c (output_short_or_char_table): New function.
17575 (output_short_table, output_token_translations): Use it.
17576 (goto_actions): Use output_short_table.
17577
1e9798d5
AD
175782000-10-16 Akim Demaille <akim@epita.fr>
17579
17580 * src/symtab.c (bucket_new): New function.
17581 (getsym): Use it.
17582
17583 * src/output.c (output_short_table): New argument to display the
17584 comment associated with the table.
17585 Adjust dependencies.
17586 (output_gram): Use it.
17587 (output_rule_data): Nicer output layout for YYTNAME.
17588
f282676b
AD
175892000-10-16 Akim Demaille <akim@epita.fr>
17590
17591 * src/lex.c (read_typename): New function.
17592 (lex): Use it.
17593 * src/reader.c (copy_dollar): Likewise.
17594
550a72a3
AD
175952000-10-16 Akim Demaille <akim@epita.fr>
17596
17597 * src/reader.c (copy_comment2): Expect the input stream to be on
17598 the `/' which is suspected to open a comment, instead of being
17599 called after `//' or `/*' was read.
17600 (copy_comment, copy_definition, parse_union_decl, copy_action)
17601 (copy_guard): Adjust.
17602
131e2fef
AD
176032000-10-16 Akim Demaille <akim@epita.fr>
17604
17605 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
17606 `read_signed_integer'.
17607
79282c5a
AD
176082000-10-16 Akim Demaille <akim@epita.fr>
17609
17610 * src/reader.c (copy_dollar): New function.
17611 (copy_guard, copy_action): Use it.
17612
ff4a34be
AD
176132000-10-16 Akim Demaille <akim@epita.fr>
17614
17615 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
17616 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
17617 New files, from Fileutils 4.0.27.
17618 * src/main.c (printable_version): Remove.
17619 * src/lex.c, src/reader.c: Use `quote'.
17620
176212000-10-04 Akim Demaille <akim@epita.fr>
17622
17623 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
17624
14ded682
AD
176252000-10-04 Akim Demaille <akim@epita.fr>
17626
17627 * doc/bison.texinfo: Various typos spotted by Neil Booth.
17628
8e03724b
AD
176292000-10-04 Akim Demaille <akim@epita.fr>
17630
17631 When a literal string is used to define two different tokens,
17632 `bison -v' segfaults.
17633 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
17634
17635 * tests/regression.m4: New file.
17636 Include the core of the sample provided by Piotr Gackiewicz.
17637 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
17638 properly.
17639
a9e64249
AD
176402000-10-04 Akim Demaille <akim@epita.fr>
17641
17642 * src/reader.c (parse_expect_decl): Keep `count' within the size
17643 of `buffer'.
17644 From Neil Booth.
17645
da9abf43
AD
176462000-10-02 Paul Eggert <eggert@twinsun.com>
17647
17648 * bison.s1 (yyparse): Assign the default value
17649 unconditionally, to avoid a GCC warning and make the parser a
17650 tad smaller.
17651
c33638bb
AD
176522000-10-02 Akim Demaille <akim@epita.fr>
17653
17654 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
17655 options.
17656
444c570a
AD
176572000-10-02 Akim Demaille <akim@epita.fr>
17658
17659 * src/derives.c, src/print.c, src/reduce.c: To ease the
17660 translation, move some `\n' out of the translated strings.
17661
89cab50d
AD
176622000-10-02 Akim Demaille <akim@epita.fr>
17663
17664 The location tracking mechanism is precious for parse error
17665 messages. Nevertheless, it is enabled only when `@n' is used in
17666 the grammar, which is a different issue (you can use it in error
17667 message, but not in the grammar per se). Therefore, there should
17668 be another means to enable it.
17669
17670 * src/getargs.c (getargs): Support `--locations'.
17671 (usage): Report it.
17672 * src/getargs.h (locationsflag): Export it.
17673 * src/lex.c (percent_table): Support `%locations'.
17674 * src/reader.c (yylsp_needed): Remove this variable, now replaced
17675 with `locationsflag'.
17676 * doc/bison.texinfo: Document `--locations' and `%locations'.
17677 Sort the options.
17678 * tests/calc.m4: Test it.
17679
17680 For regularity of the names, replace each
17681 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
17682 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
17683 In addition replace each `flag' with `_flag'.
17684
d6c2cba0
AD
176852000-10-02 Akim Demaille <akim@epita.fr>
17686
17687 Also test parse error messages, including with YYERROR_VERBOSE.
17688
17689 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
17690 associative).
17691 Use it to check the computations.
17692 Use it to check `nonassoc' is honored.
17693 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
17694 `--yyerror-verbose'.
17695 (_AT_CHECK_CALC): Adjust to this option.
17696 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
17697
5a35a6cb
AD
176982000-10-02 Akim Demaille <akim@epita.fr>
17699
17700 Test also `--verbose', `--defines' and `--name-prefix'. Testing
17701 the latter demonstrates a flaw in the handling of non debugging
17702 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
17703 was used in order to simplify:
17704
17705 #if YYDEBUG
17706 if (yydebug)
17707 {
17708 ...
17709 }
17710 #endif
17711
17712 into
17713
17714 if (yydebug)
17715 {
17716 ...
17717 }
17718
17719 unfortunately this leads to a CPP conflict when
17720 `--name-prefix=foo' is used since it produces `#define yydebug
17721 foodebug'.
17722
17723 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
17724 (YYDPRINTF): New macro.
17725 Spread its use.
17726 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
17727 the bison options.
17728 Also test `--verbose', `--defines' and `--name-prefix'.
17729
71da9eea
AD
177302000-10-02 Akim Demaille <akim@epita.fr>
17731
17732 Improve the readability of the produced parsers.
17733
17734 * src/bison.s1: Formatting changes.
17735 Improve the comment related to the `$' mark.
17736 (yydefault): Don't fall through to `yyresume': `goto' there.
17737 * src/output.c (output_parser): When the `$' is met, skip the end
17738 of its line.
17739 New variable, `number_of_dollar_signs', to check there's exactly
17740 one `$' in the parser skeleton.
17741
95e36146
AD
177422000-10-02 Akim Demaille <akim@epita.fr>
17743
17744 * lib/xstrdup.c: New file, from the fileutils.
17745 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
17746 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
17747 instead of strlen + xmalloc + strcpy.
17748 * src/symtab.c (copys): Remove, use xstrdup instead.
17749
d7020c20
AD
177502000-10-02 Akim Demaille <akim@epita.fr>
17751
17752 * src/gram.h (associativity): New enum type which replaces the
17753 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
17754 `right_assoc', `left_assoc' and `non_assoc'.
17755 Adjust all dependencies.
17756 * src/reader.c: Formatting changes.
17757 (LTYPESTR): Don't define it, use it as a literal in
17758 `reader_output_yylsp'.
17759 * src/symtab.h (symbol_class): New enum type which replaces the
17760 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
17761 `sunknown', `stoken and `snterm'.
17762
1916f98e
AD
177632000-10-02 Akim Demaille <akim@epita.fr>
17764
17765 * src/getargs.c (fixed_outfiles): Rename as...
17766 (yaccflag): for consistency and accuracy.
17767 Adjust dependencies.
17768
d7913476
AD
177692000-10-02 Akim Demaille <akim@epita.fr>
17770
17771 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
17772 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
17773 difficult and introduced a lot of core dump. It turns out that
17774 Bison used an implementation of `xmalloc' based on `calloc', and
17775 at various places it does depend upon the initialization to 0. I
17776 have not tried to isolate the pertinent places, and all the former
17777 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
17778 someone should address this issue.
17779
17780 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
17781 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
17782 files.
17783 Adjust dependencies.
17784 * src/warshall.h: New file.
17785 Propagate.
17786
340ef489
AD
177872000-10-02 Akim Demaille <akim@epita.fr>
17788
17789 Various anti-`extern in *.c' changes.
17790
17791 * src/system.h: Include `assert.h'.
17792
b2ca4022
AD
177932000-10-02 Akim Demaille <akim@epita.fr>
17794
17795 * src/state.h (nstates, final_state, first_state, first_shift)
17796 (first_reduction): Move their exportation from here...
17797 * src/LR0.h: to here.
17798 Adjust dependencies.
17799 * src/getargs.c (statisticsflag): New variable.
17800 Add support for `--statistics'.
17801 Adjust dependencies.
17802
17803 Remove a lot of now useless `extern' statements in most files.
17804
403b315b
AD
178052000-10-02 Akim Demaille <akim@epita.fr>
17806
17807 * src/LR0.h: New file.
17808 Propagate its use.
17809
07a58c13
AD
178102000-10-02 Akim Demaille <akim@epita.fr>
17811
17812 * src/print.h: New file.
17813 Propagate its use.
17814 * src/print.c: Formatting and ordering changes.
17815 (verbose, terse): Replace with...
17816 (print_results): this new function.
17817 Adjust dependencies.
17818
0619caf0
AD
178192000-10-02 Akim Demaille <akim@epita.fr>
17820
17821 * src/conflicts.c (conflict_report): New function.
17822 (conflict_log, verbose_conflict_log): Replace with...
17823 (print_conflicts): this function.
17824 Adjust dependencies.
17825 * src/conflicts.h: New file.
17826 Propagate its inclusion.
17827
3519ec76
AD
178282000-10-02 Akim Demaille <akim@epita.fr>
17829
17830 * src/nullable.h: New file.
17831 Propagate its inclusion.
17832 * src/nullable.c: Formatting changes.
17833
015acc48
AD
178342000-10-02 Akim Demaille <akim@epita.fr>
17835
17836 * src/reduce.h: New file.
17837 Propagate its inclusion.
17838 * src/reduce.c: Topological sort and other formatting changes.
17839 (bool, TRUE, FALSE): Move their definition to...
17840 * src/system.h: here.
17841
8963a27b
AD
178422000-10-02 Akim Demaille <akim@epita.fr>
17843
17844 * src/files.c: Formatting changes.
17845 (tryopen, tryclose, openfiles): Rename as...
17846 (xfopen, xfclose, open_files): this.
17847 (stringappend): static.
17848 * src/files.h: Complete the list of exported symbols.
17849 Propagate its use.
17850
a70083a3
AD
178512000-10-02 Akim Demaille <akim@epita.fr>
17852
17853 * src/reader.h: New file.
17854 Propagate its use instead of tedious list of `extern' and
17855 prototypes.
17856 * src/reader.c: Formatting changes, topological sort,
17857 s/register//.
17858
abadc117
AD
178592000-10-02 Akim Demaille <akim@epita.fr>
17860
17861 * src/lex.h: Prototype `lex.c' exported functions.
17862 * src/reader.c: Adjust.
17863 * src/lex.c: Formatting changes.
17864 (safegetc): Rename as...
17865 (xgetc): this.
17866
720d742f
AD
178672000-10-02 Akim Demaille <akim@epita.fr>
17868
17869 * src/lalr.h: New file.
17870 Propagate its inclusion instead of prototypes and `extern'.
17871 * src/lalr.c: Formatting changes, topological sorting etc.
17872
f2acea59
AD
178732000-10-02 Akim Demaille <akim@epita.fr>
17874
17875 * src/output.c (token_actions): Introduce a temporary array,
17876 YYDEFACT, that makes it possible for this function to use
17877 output_short_table.
17878
d019d655
AD
178792000-10-02 Akim Demaille <akim@epita.fr>
17880
17881 `user_toknums' is output as a `short[]' in `output.c', while it is
17882 defined as a `int[]' in `reader.c'. For consistency with the
17883 other output tables, `user_toknums' is now defined as a table of
17884 shorts.
17885
17886 * src/reader.c (user_toknums): Be a short table instead of an int
17887 table.
17888 Adjust dependencies.
17889
17890 Factor the short table outputs.
17891
17892 * src/output.c (output_short_table): New function.
17893 * src/output.c (output_gram, output_stos, output_rule_data)
17894 (output_base, output_table, output_check): Use it.
17895
6c89f1c1
AD
178962000-10-02 Akim Demaille <akim@epita.fr>
17897
17898 * src/output.c (output): Topological sort of the functions, in
17899 order to get rid of the `static' prototypes.
17900 No longer use `register'.
17901 * src/output.h: New file.
17902 Propagate its inclusion in files explicitly prototyping functions
17903 from output.c.
17904
d9efd181
AD
179052000-09-21 Akim Demaille <akim@epita.fr>
17906
17907 * src/atgeneral.m4: Update from Autoconf.
17908
c29240e7 179092000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
17910
17911 * src/closure.h: New file.
17912 * src/closure.c: Formatting changes, topological sort over the
17913 functions, use of closure.h.
17914 (initialize_closure, finalize_closure): Rename as...
17915 (new_closure, free_closure): these. Adjust dependencies.
17916 * src/LR0.c: Formatting changes, topological sort, use of
17917 cloture.h.
17918 (initialize_states): Rename as...
17919 (new_states): this.
17920 * src/Makefile.am (noinst_HEADERS): Adjust.
17921
499daa50
AD
179222000-09-20 Akim Demaille <akim@epita.fr>
17923
17924 * src/acconfig.h: Don't protect config.h against multiple
17925 inclusion.
17926 Don't define PARAMS.
17927 * src/system.h: Define PARAMS.
17928 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
17929 purpose of config.h. system.h must not try to fix wrong
17930 definitions in config.h.
17931
cc84fd5d
AD
179322000-09-20 Akim Demaille <akim@epita.fr>
17933
17934 * src/derives.h: New file.
17935 * src/main.c, src/derives.h: Use it.
17936 Formatting changes.
17937 * src/Makefile.am (noinst_HEADERS): Adjust.
17938
db5b3a89
AD
179392000-09-20 Akim Demaille <akim@epita.fr>
17940
17941 * tests/atgeneral.m4: Update from Autoconf.
17942 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
17943 (AT_CHECK_CALC): New macros.
17944 Use these macros to test bison with options `', `--raw',
17945 `--debug', `--yacc', `--yacc --debug'.
17946
ceed8467
AD
179472000-09-19 Akim Demaille <akim@epita.fr>
17948
17949 * src/output.c: Formatting changes.
17950 * src/machine.h: Remove, leaving its contents in...
17951 * src/system.h: here.
17952 Include stdio.h.
17953 Adjust all dependencies on stdio.h and machine.h.
17954 * src/getargs.h: New file.
17955 Let all `extern' declarations about getargs.c be replaced with
17956 inclusion of `getargs.h'.
17957 * src/Makefile.am (noinst_HEADERS): Adjust.
17958
17959 * tests/calc.m4 (yyin): Be initialized in main, not on the global
17960 scope.
17961 (yyerror): Returns void, not int.
17962 * doc/bison.texinfo: Formatting changes.
17963
05a1d24b
AD
179642000-09-19 Akim Demaille <akim@epita.fr>
17965
17966 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
17967 portable.
17968
cbd25751
AD
179692000-09-18 Akim Demaille <akim@epita.fr>
17970
17971 * configure.in: Append WARNING_CFLAGS to CFLAGS.
17972 * src/Makefile.am (INCLUDES): Don't.
17973 Be ready to fetch headers in lib/.
17974
13863333
AD
179752000-09-18 Akim Demaille <akim@epita.fr>
17976
17977 * doc/bison.texinfo: Update the copyright.
17978 ANSIfy and GNUify the examples.
17979 Remove the old menu.
17980
0d533154
AD
179812000-09-18 Akim Demaille <akim@epita.fr>
17982
17983 First set of tests: use the `calc' example from the documentation.
17984
17985 * src/bison.s1 (yyparse): Condition the code using `yytname' which
17986 is defined only when YYDEBUG is.
17987 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
17988 * src/files.c (tryopen, tryclose): Formatting changes.
17989 Move to the top and be static.
17990 * src/reader.c (read_signed_integer): Likewise.
17991 * tests/calc.m4: New file.
17992 * Makefile.am, suite.m4: Adjust.
17993 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
17994
e79137ac
AD
179952000-09-18 Akim Demaille <akim@epita.fr>
17996
17997 Add support for an Autotest test suite for Bison.
17998
17999 * m4/m4.m4, m4/atconfig.m4: New files.
18000 * m4/Makefile.am (EXTRA_DIST): Adjust.
18001 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
18002 files.
18003 * src/getargs.c: Display a more standard --version message.
18004 * src/reader.c (reader): Formatting changes.
18005 No longer depend upon VERSION_STRING.
18006 * configure.in: No longer use `dnl'.
18007 Set up the test suite and the new directory `tests/.
18008 (VERSION_STRING): Remove.
18009
27821bff
AD
180102000-04-14 Akim Demaille <akim@epita.fr>
18011
18012 * src/reader.c (copy_comment2): New function, same as former
18013 `copy_comment', but outputs into two FILE *.
18014 (copy_comment): Use it.
18015 (parse_union_decl): Use it.
18016 (get_type, parse_start_decl): Use the same `invalid' message.
18017 (parse_start_decl, parse_union_decl): Use the same `multiple'
18018 message.
18019 (parse_union_decl, copy_guard, copy_action): Use the same
18020 `unmatched' message.
18021 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
18022
cfe5fbc0
AD
180232000-03-31 Akim Demaille <akim@epita.fr>
18024
18025 * src/files.c (tryopen, tryclose): Move to the top.
18026 Be static.
18027
cb7db13e
AD
180282000-03-31 Akim Demaille <akim@epita.fr>
18029
18030 * src/main.c (main): Don't call `done', exit does it.
18031
a0f6b076
AD
180322000-03-31 Akim Demaille <akim@epita.fr>
18033
36281465
AD
18034 * allocate.c: s/return (foo)/return foo/.
18035 * lalr.c: Likewise.
18036 * LR0.c: Likewise.
18037 * output.c: Likewise.
18038 * reader.c: Likewise.
18039 * symtab.c: Likewise.
18040 * vmsgetargs.c: Likewise.
18041
180422000-03-31 Akim Demaille <akim@epita.fr>
18043
18044 Clean up the error reporting functions.
a0f6b076
AD
18045
18046 * src/report.c: New file.
18047 * src/report.h: Likewise.
18048 * src/Makefile.am: Adjust.
18049 * m4/error.m4: New file.
18050 * m4/Makefile.am: Adjust.
18051 * configure.in (jm_PREREQ_ERROR): Call it.
18052 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
18053 Remove.
18054 (fatal, fatals): Remove. All callers use complain.c::fatal.
18055 (warn, warni, warns, warnss, warnss): Remove. All callers use
18056 complain.c::complain.
18057 (toomany): Remove, use fatal instead.
18058 * src/files.c (done): No argument, use complain_message_count.
18059 * src/main.c (main): Register `done' to `atexit'.
18060
18061 * src/getargs.c (usage): More `fputs', less `fprintf'.
18062
18539825
AD
180632000-03-28 Akim Demaille <akim@epita.fr>
18064
18065 * lib/: New directory.
18066 * Makefile.am (SUBDIRS): Adjust.
18067 * configure.in: Adjust.
18068 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
18069 useless.
18070 * src/alloca.c: Moved to lib/.
18071 * src/getopt.c: Likewise.
18072 * src/getopt1.c: Likewise.
18073 * src/getopt.h: Likewise.
18074 * src/ansi2knr.c: Likewise.
18075 * src/ansi2knr.1: Likewise.
18076 * src/Makefile.am: Adjust.
18077 * lib/Makefile.am: New file.
18078
9f306f2a
AD
180792000-03-28 Akim Demaille <akim@epita.fr>
18080
18081 * src/getargs.c (usage): Refresh the help message.
18082
0ba347b6
AD
180832000-03-17 Akim Demaille <akim@epita.fr>
18084
18085 * src/getopt1.c: Updated from textutils 2.0e
18086 * src/getopt.c: Likewise.
18087 * src/getopt.h: Likewise.
18088
dbe7f271
AD
180892000-03-17 Akim Demaille <akim@epita.fr>
18090
18091 * src/Makefile.am (bison.simple): Fix the awk program: quote only
18092 the file name, not the whole `#line LINE FILE'.
18093
75bbe78d
AD
180942000-03-17 Akim Demaille <akim@epita.fr>
18095
18096 On syntax errors, report the token on which we choked.
18097
aa5fd0ee
AD
18098 * src/bison.s1 (yyparse): In the label yyerrlab, when
18099 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 18100
7b306f52
AD
181012000-03-17 Akim Demaille <akim@epita.fr>
18102
aa5fd0ee 18103 * src/reader.c (copy_at): New function.
7b306f52
AD
18104 (copy_guard): Use it.
18105 (copy_action): Use it.
18106
e87b5700
AD
181072000-03-17 Akim Demaille <akim@epita.fr>
18108
18109 Be kind to translators, save some useless translations.
18110
aa5fd0ee 18111 * src/main.c (banner): New function.
e87b5700
AD
18112 (fatal_banner): Use it.
18113 (warn_banner): Use it.
18114
ae3c3164
AD
181152000-03-17 Akim Demaille <akim@epita.fr>
18116
aa5fd0ee
AD
18117 * src/reader.c (copy_definition): Use copy_string and
18118 copy_comment. Removed now unused `match', `ended',
18119 `cplus_comment'.
ae3c3164
AD
18120 (copy_comment, copy_string): Moved, to be visible from
18121 copy_definition.
18122
4dc58e7c
AD
181232000-03-17 Akim Demaille <akim@epita.fr>
18124
aa5fd0ee
AD
18125 * src/reader.c (copy_string): Declare `static inline'. No
18126 problems with inline, since it is checked by configure.
4dc58e7c
AD
18127 (copy_comment): Likewise.
18128
0a6384c4
AD
181292000-03-17 Akim Demaille <akim@epita.fr>
18130
aa5fd0ee 18131 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 18132
3cef001a
AD
181332000-03-17 Akim Demaille <akim@epita.fr>
18134
aa5fd0ee 18135 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
18136 (copy_action): Use it. Removed now unused `match', `ended',
18137 `cplus_comment'.
18138 (copy_guard): Likewise.
18139
ca36d2ef
AD
181402000-03-17 Akim Demaille <akim@epita.fr>
18141
aa5fd0ee 18142 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
18143 (copy_action): Use it.
18144 (copy_guard): Likewise.
18145
6666f98f
AD
181462000-03-17 Akim Demaille <akim@epita.fr>
18147
18148 Change the handling of @s so that they behave exactly like $s.
18149 There is now a pseudo variable @$ (readble and writable), location
18150 of the lhs of the rule (by default ranging from the location of
18151 the first symbol of the rhs, to the location of the last symbol,
18152 or, if the rhs is empty, YYLLOC).
18153
18154 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
18155 yyval.
18156 (yyparse): When providing a default semantic action, provide a
18157 default location action.
18158 (after the $): No longer change `*YYLSP', just stack YYLOC the
18159 same way you stack YYVAL.
18160 * src/reader.c (read_declarations): Use warns.
18161 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
18162 (copy_action, case '@'): Likewise.
18163 Use a standard error message, to save useless work from
18164 translators.
18165
41aca2e0
AD
181662000-03-17 Akim Demaille <akim@epita.fr>
18167
aa5fd0ee
AD
18168 * src/bison.s1: Formatting and cosmetics changes.
18169 * src/reader.c: Likewise.
41aca2e0
AD
18170 Update the Copyright notice.
18171
dc08c1d5
AD
181722000-03-17 Akim Demaille <akim@epita.fr>
18173
aa5fd0ee
AD
18174 * src/bison.s1 (#line): All set to `#line' only, since the
18175 Makefile now handles them.
dc08c1d5 18176
9ee3c97b
AD
181772000-03-16 Akim Demaille <akim@epita.fr>
18178
18179 * src/output.c (output_rule_data): Output the documentation of
18180 some of the tables.
18181 (Copyright notice): Update.
18182 Formatting changes.
18183
0de741ca
AD
181842000-03-16 Akim Demaille <akim@epita.fr>
18185
18186 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
18187 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
18188 One `#if YYDEBUG' remains, since it uses variables which are
18189 defined only if `YYDEBUG != 0'.
18190
bb10be54
AD
181912000-03-16 Akim Demaille <akim@epita.fr>
18192
18193 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
18194 and related variables so that the similarities are highlighted.
18195
b07b484a
AD
181962000-03-16 Akim Demaille <akim@epita.fr>
18197
18198 * src/bison.s1: Properly indent CPP directives.
18199
361f60b3
AD
182002000-03-16 Akim Demaille <akim@epita.fr>
18201
18202 * src/bison.s1: Properly indent the `alloca' CPP section.
18203
8c44d3ec
AD
182042000-03-16 Akim Demaille <akim@epita.fr>
18205
18206 Do not hard code values of directories in `configure.in'.
18207 Update the `configure' tool chain.
18208
18209 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
18210 src/makefile.am.
18211 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
18212 (AC_OUTPUT): Add m4/Makefile.
18213 Bump to bison 1.28a, 1.29 has never been released.
18214 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
18215 handled via src/Makefile.am.
18216 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
18217 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
18218 autoheader.
18219 * Makefile.am (SUBDIRS): Add m4.
18220 (ACLOCAL_AM_FLAGS): New variable.
18221 (AUTOMAKE_OPTIONS): Add check-news.
18222 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
18223 the proper line number and file name.
18224 (DEFS): Propagate the location of bison library files and of the
18225 locale files.
18226 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
18227 builddir.
18228 * acinclude.m4: Remove, replaced by the directory m4.
18229 * m4/Makefile.am (EXTRA_DIST): New variable.
18230 * m4/gettext.m4: New file, from the fileutils.
18231 * m4/lcmessage.m4: Likewise
18232 * m4/progtest.m4: Likewise.
18233 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
18234
f95997e7
AD
182352000-03-10 Akim Demaille <akim@epita.fr>
18236
18237 * src/closure.c:
18238 Formatting changes of various comments.
18239 Respect the GNU coding standards at various places.
18240 Don't use `_()' when no translation is needed.
18241
182421999-12-13 Jesse Thilo <jthilo@gnu.org>
18243
18244 * src/files.c:
18245 OS/2 honors TMPDIR environment variable.
18246
182471999-12-13 Jesse Thilo <jthilo@gnu.org>
18248
18249 * doc/bison.texinfo: Tweaked spelling and grammar.
18250 Updated ISBN.
18251 Removed reference to price of printed copy.
18252 Mention BISON_SIMPLE and BISON_HAIRY.
18253
182541999-12-13 Jesse Thilo <jthilo@gnu.org>
18255
18256 * configure.in, NEWS:
18257 Bison 1.29 released.
18258
182591999-10-27 Jesse Thilo <jthilo@gnu.org>
18260
18261 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
18262 Added reference card.
18263
182641999-07-26 Jesse Thilo <jthilo@gnu.org>
18265
18266 * po/ru.po: Added Russian translation.
18267
182681999-07-26 Jesse Thilo <jthilo@gnu.org>
18269
18270 * configure.in: Added Russian translation.
18271
182721999-07-06 Jesse Thilo <jthilo@gnu.org>
18273
18274 * configure.in, NEWS, README:
18275 Released version 1.28.
18276
182771999-06-14 Jesse Thilo <jthilo@gnu.org>
18278
18279 * src/system.h:
18280 Squashed redefinition warning on some systems.
18281
18282 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
18283 Have configure build version string instead of relying on ANSI string
18284 concatentation.
18285
182861999-06-14 Jesse Thilo <jthilo@gnu.org>
18287
18288 * po/POTFILES.in: Got rid of version.c.
18289
182901999-06-14 Jesse Thilo <jthilo@gnu.org>
18291
18292 * acconfig.h, configure.in:
18293 Have configure build version string instead of relying on ANSI string
18294 concatentation.
18295
182961999-06-08 Jesse Thilo <jthilo@gnu.org>
18297
18298 * doc/bison.1:
18299 Dropped mention of `+' for long-named options.
18300
183011999-05-30 Jesse Thilo <jthilo@gnu.org>
18302
18303 * src/files.c: Added <unistd.h> for unlink().
18304
18305 * src/Makefile.am, src/system.h:
18306 I18n fixes.
18307
183081999-05-30 Jesse Thilo <jthilo@gnu.org>
18309
18310 * README: Added a FAQ list.
18311
18312 * configure.in, acconfig.h:
18313 I18n fixes.
18314
183151999-05-30 Jesse Thilo <jthilo@gnu.org>
18316
18317 * doc/FAQ, doc/Makefile.am:
18318 Added a FAQ list.
18319
183201999-05-19 Jesse Thilo <jthilo@gnu.org>
18321
18322 * src/alloc.h, src/symtab.h, src/version.c:
18323 Protected inclusion of "config.h" with HAVE_CONFIG_H.
18324
183251999-04-18 Jesse Thilo <jthilo@gnu.org>
18326
18327 * src/.cvsignore, src/Makefile.am:
18328 Reorganized: sources in `src', documentation in `doc'.
18329
18330 * src/lex.c (literalchar):
18331 fixed the code for escaping double quotes (thanks
18332 Jonathan Czisny.)
18333
183341999-04-18 Jesse Thilo <jthilo@gnu.org>
18335
18336 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
18337 Adjusted paths to reflect directory reorganization.
18338
183391999-04-18 Jesse Thilo <jthilo@gnu.org>
18340
18341 * doc/.cvsignore, doc/Makefile.am:
18342 Reorganized: sources in `src', documentation in `doc'.
18343
183441999-04-18 Jesse Thilo <jthilo@gnu.org>
18345
18346 * configure.in:
18347 Updated AC_INIT file to reflect directory reorganization.
18348
18349 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
18350 Reorganized: sources in `src', documentation in `doc'.
18351
183521999-04-13 Jesse Thilo <jthilo@gnu.org>
18353
18354 * src/allocate.c:
18355 Don't declare calloc() and realloc() if not necessary.
18356
183571999-04-13 Jesse Thilo <jthilo@gnu.org>
18358
18359 * configure.in, acconfig.h, acinclude.m4:
18360 Don't declare calloc() and realloc() if not necessary.
18361
183621999-03-23 Jesse Thilo <jthilo@gnu.org>
18363
18364 * po/.cvsignore: Added i18n support.
18365
183661999-03-23 Jesse Thilo <jthilo@gnu.org>
18367
18368 * acconfig.h, configure.in, Makefile.am:
18369 Added i18n support.
18370
183711999-03-22 Jesse Thilo <jthilo@gnu.org>
18372
18373 * src/bison.s1: Fixed #line numbers.
18374
183751999-03-15 Jesse Thilo <jthilo@gnu.org>
18376
18377 * po/es.po, po/fr.po, po/nl.po, po/de.po:
18378 Added PO files from Translation Project.
18379
183801999-03-03 Jesse Thilo <jthilo@gnu.org>
18381
18382 * Makefile.am:
18383 Added support for non-ANSI compilers (ansi2knr).
18384
183851999-02-16 Jesse Thilo <jthilo@gnu.org>
18386
18387 * configure.in: Bumped version number to 1.27.
18388
18389 * Makefile.am:
18390 Added `bison.simple' to list of files removed by `make distclean'.
18391
183921999-02-12 Jesse Thilo <jthilo@gnu.org>
18393
18394 * src/files.c, src/files.h:
18395 Defined locations of parser files in config.h instead of Makefile.
18396
183971999-02-12 Jesse Thilo <jthilo@gnu.org>
18398
18399 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
18400 Defined locations of parser files in config.h instead of Makefile.
18401
184021999-02-09 Jesse Thilo <jthilo@gnu.org>
18403
18404 * Makefile.am:
18405 Removed inappropriate use of $< macro.
18406
184071999-02-05 Jesse Thilo <jthilo@gnu.org>
18408
18409 * po/Makefile.in.in, po/POTFILES.in:
18410 Add `po' directory skeleton.
18411
184121999-01-27 Jesse Thilo <jthilo@gnu.org>
18413
18414 * README: Document help-bison list.
18415
18416 * configure.in: Add check for mkstemp().
18417
184181999-01-20 Jesse Thilo <jthilo@gnu.org>
18419
18420 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
18421 Hush a few compiler warnings.
18422
18423 * src/files.c:
18424 Add tryclose(), which verifies that fclose was successful.
18425 Hush a couple of compiler warnings.
18426
184271999-01-20 Jesse Thilo <jthilo@gnu.org>
18428
18429 * Makefile.am, OChangeLog:
18430 ChangeLog is now automatically generated. Include the old version as
18431 OChangeLog.
18432
184331999-01-14 Jesse Thilo <jthilo@gnu.org>
18434
18435 * 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:
18436 Update FSF address.
18437
184381999-01-14 Jesse Thilo <jthilo@gnu.org>
18439
18440 * doc/bison.texinfo: Fix formatting glitch.
18441
18442 * doc/bison.texinfo: Update FSF address.
18443
184441999-01-14 Jesse Thilo <jthilo@gnu.org>
18445
18446 * acconfig.h: Update FSF address.
18447
184481999-01-08 Jesse Thilo <jthilo@gnu.org>
18449
18450 * src/system.h:
18451 Don't define PACKAGE here, since config.h defines it.
18452
184531998-12-30 Jesse Thilo <jthilo@gnu.org>
18454
18455 * src/reader.c: Update copyright date.
18456
18457 * src/main.c:
18458 Ditch sprintf to statically-sized buffers in fatal/warn functions in
18459 favor of output directly to stderr (avoids buffer overruns).
18460
18461 * src/reader.c: Some checks for premature EOF.
18462
18463 * 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:
18464 Use prototypes if the compiler understands them.
18465
18466 * src/files.c: Honor TMPDIR on Unix hosts.
18467 Use prototypes if the compiler understands them.
18468
18469 * src/reader.c:
18470 Fix a couple of buffer overrun bugs.
18471 Use prototypes if the compiler understands them.
18472
18473 * src/system.h: Include unistd.h and ctype.h.
18474 Use #ifdef instead of #if for NLS symbols.
18475
184761998-12-30 Jesse Thilo <jthilo@gnu.org>
18477
18478 * doc/bison.texinfo:
18479 Delete comment "consider using @set for edition number, etc..." since
18480 we now are doing so.
18481
184821998-12-30 Jesse Thilo <jthilo@gnu.org>
18483
18484 * configure.in:
18485 Use prototypes if the compiler understands them.
18486
18487 * NEWS: Document 1.26 highlights.
18488
18489 * Makefile.am: Require Automake 1.3 or later.
18490
18491 * acconfig.h:
18492 Use prototypes if the compiler understands them.
18493
184941998-12-29 Jesse Thilo <jthilo@gnu.org>
18495
18496 * src/version.c:
18497 Use VERSION symbol from automake for version number.
18498
184991998-12-29 Jesse Thilo <jthilo@gnu.org>
18500
18501 * acconfig.h, configure.in, version.cin:
18502 Use VERSION symbol from automake for version number.
18503
185041998-11-28 Jesse Thilo <jthilo@gnu.org>
18505
18506 * Makefile.am:
18507 Distribute original version of simple parser (bison.s1), not built
18508 version (bison.simple).
18509
185101998-11-28 Jesse Thilo <jthilo@gnu.org>
18511
18512 * doc/bison.texinfo: Add info dir entry.
18513
18514 * doc/bison.texinfo:
18515 Let automake put version number into documentation.
18516
185171998-11-26 Jesse Thilo <jthilo@gnu.org>
18518
18519 * src/bison.cld, src/build.com, src/vmshlp.mar:
18520 Add non-RCS files from /gd/gnu/bison.
18521
185221998-11-26 Jesse Thilo <jthilo@gnu.org>
18523
18524 * doc/bison.1:
18525 Document the BISON_HAIRY and BISON_SIMPLE variables.
18526
185271998-11-25 Jesse Thilo <jthilo@gnu.org>
18528
18529 * src/version.c: Build version.c automatically.
18530
18531 * src/reader.c:
18532 Fix token numbering (used to start at 258, not 257).
18533
18534 * src/system.h: Include config.h.
18535
18536 * src/getargs.c: Update bug report address.
18537
18538 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
18539 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
18540
185411998-11-25 Jesse Thilo <jthilo@gnu.org>
18542
18543 * Makefile.am:
18544 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
18545
18546 * configure.in, version.cin:
18547 Build version.c automatically.
18548
18549 * AUTHORS: Add AUTHORS file.
18550
18551 * README: Update bug report address.
18552
18553 * bison.simple:
18554 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
18555
18556 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
18557 Add automake stuff.
18558
185591998-11-25 Jesse Thilo <jthilo@gnu.org>
18560
18561 * doc/bison.texinfo: Clean up some formatting.
18562
185631998-05-05 Richard Stallman <rms@gnu.org>
18564
18565 * doc/bison.texinfo:
18566 Explain better why to make a pure parser.
18567
185681998-01-05 Richard Stallman <rms@gnu.org>
18569
18570 * src/files.c (openfiles):
18571 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
18572 find a temporary directory, if possible. Do not unlink files while
18573 they are open.
18574
185751997-08-25 Richard Stallman <rms@gnu.org>
18576
18577 * src/reader.c (stack_offset;):
18578 Change some warni to warns.
18579
18580 * src/lex.c (literalchar): Use warns, not warni.
18581
185821997-06-28 Richard Stallman <rms@gnu.org>
18583
18584 * src/bison.s1: Add a Bison version comment.
18585
18586 * src/main.c (fatal, warn, berror):
18587 Use program_name.
18588
185891997-06-28 Richard Stallman <rms@gnu.org>
18590
18591 * Makefile.in (bison_version): New variable.
18592 (dist): Use that variable.
18593 (bison.s1): Substitute the Bison version into bison.simple.
18594
18595 * bison.simple: Add a Bison version comment.
18596
185971997-06-18 Richard Stallman <rms@gnu.org>
18598
18599 * src/main.c (fatal, warn, berror):
18600 Make error messages standard.
18601 (toomany): Improve error message text.
18602
18603 * 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:
18604 new.h renamed to alloc.h.
18605
186061997-06-18 Richard Stallman <rms@gnu.org>
18607
18608 * Makefile.in: new.h renamed to alloc.h.
18609
186101997-05-24 Richard Stallman <rms@gnu.org>
18611
18612 * src/lex.c (literalchar):
18613 Fix the code for escaping \, " and '.
18614
18615 (lex): Avoid trouble when there are many chars
18616 to discard in a char literal with just several chars in it.
18617
186181997-05-17 Richard Stallman <rms@gnu.org>
18619
18620 * src/bison.s1:
18621 Use malloc, if using alloca is troublesome.
18622 (YYSTACK_USE_ALLOCA): New flag macro.
18623 Define it for some systems and compilers.
18624 (YYSTACK_ALLOC): New macro.
18625 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18626 If it was malloc'd, free it.
18627
186281997-05-17 Richard Stallman <rms@gnu.org>
18629
18630 * bison.simple:
18631 Use malloc, if using alloca is troublesome.
18632 (YYSTACK_USE_ALLOCA): New flag macro.
18633 Define it for some systems and compilers.
18634 (YYSTACK_ALLOC): New macro.
18635 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18636 If it was malloc'd, free it.
18637
186381997-04-23 Richard Stallman <rms@gnu.org>
18639
18640 * src/bison.s1:
18641 (alloca) [__hpux]: Always define as __builtin_alloca.
18642
186431997-04-23 Richard Stallman <rms@gnu.org>
18644
18645 * bison.simple:
18646 (alloca) [__hpux]: Always define as __builtin_alloca.
18647
186481997-04-22 Richard Stallman <rms@gnu.org>
18649
18650 * src/bison.s1:
18651 [__hpux]: Include alloca.h (right for HPUX 10)
18652 instead of declaring alloca (right for HPUX 9).
18653
18654 * src/bison.s1 (__yy_memcpy):
18655 Declare arg `count' as unsigned int.
18656 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18657
186581997-04-22 Richard Stallman <rms@gnu.org>
18659
18660 * bison.simple:
18661 [__hpux]: Include alloca.h (right for HPUX 10)
18662 instead of declaring alloca (right for HPUX 9).
18663
18664 * bison.simple (__yy_memcpy):
18665 Declare arg `count' as unsigned int.
18666 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18667
186681997-01-03 Richard Stallman <rms@gnu.org>
18669
18670 * src/allocate.c: [__STDC__ or _MSC_VER]:
18671 Declare calloc and realloc to return void *.
18672
186731997-01-02 Richard Stallman <rms@gnu.org>
18674
18675 * src/system.h:
18676 [_MSC_VER]: Include stdlib.h and process.h.
18677 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
18678
18679 * src/main.c (main): Return FAILURE as a value.
18680 (printable_version): Declare arg as int, not char.
18681
186821997-01-02 Richard Stallman <rms@gnu.org>
18683
18684 * Makefile.in (dist):
18685 Explicitly check for symlinks, and copy them.
18686
186871996-12-19 Richard Stallman <rms@gnu.org>
18688
18689 * src/files.c:
18690 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
18691
186921996-12-18 Paul Eggert <eggert@gnu.org>
18693
18694 * src/bison.s1 (yyparse):
18695 If __GNUC__ and YYPARSE_PARAM are both defined,
18696 declare yyparse to have a void * argument.
18697
186981996-12-18 Paul Eggert <eggert@gnu.org>
18699
18700 * bison.simple (yyparse):
18701 If __GNUC__ and YYPARSE_PARAM are both defined,
18702 declare yyparse to have a void * argument.
18703
187041996-12-17 Richard Stallman <rms@gnu.org>
18705
18706 * src/reduce.c (nbits): Add some casts.
18707
187081996-08-12 Richard Stallman <rms@gnu.org>
18709
18710 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
18711
187121996-08-12 Richard Stallman <rms@gnu.org>
18713
18714 * bison.simple: Test _MSDOS as well as _MSDOS_.
18715
187161996-07-31 Richard Stallman <rms@gnu.org>
18717
18718 * src/bison.s1:
18719 [__sun && __i386]: Include alloca.h.
18720
187211996-07-31 Richard Stallman <rms@gnu.org>
18722
18723 * bison.simple:
18724 [__sun && __i386]: Include alloca.h.
18725
187261996-07-30 Richard Stallman <rms@gnu.org>
18727
18728 * src/bison.s1: Comment change.
18729
18730 * src/bison.s1: Test _MSDOS_, not MSDOS.
18731
187321996-07-30 Richard Stallman <rms@gnu.org>
18733
18734 * bison.simple: Comment change.
18735
18736 * bison.simple: Test _MSDOS_, not MSDOS.
18737
187381996-06-01 Richard Stallman <rms@gnu.org>
18739
18740 * 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:
18741 Insert `_' macro around many string constants.
18742
18743 * src/main.c:
18744 Insert `_' macro around many string constants.
18745
18746 (main): Call setlocale, bindtextdomain and textdomain.
18747
18748 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
18749 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
18750 [ENABLE_NLS]: Include libintl.h.
18751 [ENABLE_NLS] (gettext): Define.
18752 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
18753 (N_, PACKAGE, LOCALEDIR): New macros.
18754
187551996-06-01 Richard Stallman <rms@gnu.org>
18756
18757 * POTFILES.in: New file.
18758
18759 * Makefile.in (allocate.o):
18760 Define target explicitly.
18761
18762 * Makefile.in (CFLAGS): Set to @CFLAGS@.
18763 (LDFLAGS): Set to @LDFLAGS@.
18764 (configure): Run autoconf only if preceding `cd' succeeds.
18765 (bison.s1): Redirect output to temporary file then move the
18766 temporary to the target, rather than redirecting directly to bison.s1.
18767 (clean): Remove config.status and config.log.
18768 (distclean): Don't remove config.status here.
18769
187701996-05-12 Richard Stallman <rms@gnu.org>
18771
18772 * src/bison.s1:
18773 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18774
187751996-05-12 Richard Stallman <rms@gnu.org>
18776
18777 * bison.simple:
18778 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18779
187801996-05-11 Richard Stallman <rms@gnu.org>
18781
18782 * src/bison.s1 (__yy_memcpy):
18783 Really reorder the args, as was supposedly done on Feb 14 1995.
18784 (yyparse): Calls changed accordingly.
18785
187861996-05-11 Richard Stallman <rms@gnu.org>
18787
18788 * Makefile.in (dist): Don't use $(srcdir).
18789
18790 * bison.simple (__yy_memcpy):
18791 Really reorder the args, as was supposedly done on Feb 14 1995.
18792 (yyparse): Calls changed accordingly.
18793
187941996-01-27 Richard Stallman <rms@gnu.org>
18795
18796 * src/output.c (output_rule_data):
18797 Test YYERROR_VERBOSE in the conditional
18798 around the definition of ttyname.
18799
188001995-12-29 Richard Stallman <rms@gnu.org>
18801
18802 * src/bison.s1:
18803 Fix line numbers in #line commands.
18804
188051995-12-29 Richard Stallman <rms@gnu.org>
18806
18807 * bison.simple:
18808 Fix line numbers in #line commands.
18809
188101995-12-27 Richard Stallman <rms@gnu.org>
18811
18812 * src/bison.s1 (YYPARSE_PARAM_DECL):
18813 In C++, make it always null.
18814 (YYPARSE_PARAM_ARG): New macro.
18815 (yyparse): Use YYPARSE_PARAM_ARG.
18816
188171995-12-27 Richard Stallman <rms@gnu.org>
18818
18819 * bison.simple (YYPARSE_PARAM_DECL):
18820 In C++, make it always null.
18821 (YYPARSE_PARAM_ARG): New macro.
18822 (yyparse): Use YYPARSE_PARAM_ARG.
18823
188241995-11-29 Richard Stallman <rms@gnu.org>
18825
18826 * doc/bison.texinfo:
18827 Describe literal string tokens, %raw, %no_lines, %token_table.
18828
188291995-11-29 Daniel Hagerty <hag@gnu.org>
18830
18831 * doc/bison.texinfo: Fixed update date
18832
188331995-10-16 Richard Stallman <rms@gnu.org>
18834
18835 * src/version.c: Version 1.25.
18836
188371995-10-16 Richard Stallman <rms@gnu.org>
18838
18839 * NEWS: *** empty log message ***
18840
188411995-10-16 Richard Stallman <rms@gnu.org>
18842
18843 * doc/bison.1, doc/bison.rnh:
18844 Add new options.
18845
188461995-10-15 Richard Stallman <rms@gnu.org>
18847
18848 * src/vmsgetargs.c, src/getargs.c:
18849 Added -n, -k, and -raw switches.
18850 (noparserflag, toknumflag, rawtoknumflag): New variables.
18851
18852 * src/symtab.h (SALIAS):
18853 New #define for adding aliases to %token.
18854 (struct bucket): Added `alias' field.
18855
18856 * src/reduce.c (reduce_grammar):
18857 Revise error message.
18858 (print_notices): Remove final `.' from error message.
18859
18860 * src/reader.c (reader_output_yylsp):
18861 New function.
18862 (readgram): Use `#if 0' around code that accepted %command
18863 inside grammar rules: The documentation doesn't allow it,
18864 and it will fail since the %command processors scan for the next %.
18865 (parse_token_decl): Extended the %token
18866 declaration to allow a multi-character symbol as an alias.
18867 (parse_thong_decl): New function.
18868 (read_declarations): Added %thong declarations.
18869 (read_declarations): Handle NOOP to deal with allowing
18870 % declarations as another means to specify the flags.
18871 (readgram): Allow %prec prior to semantics embedded in a rule.
18872 (skip_to_char, read_declarations, copy_definition)
18873 (parse_token_decl, parse_start_decl, parse_type_decl)
18874 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
18875 (get_type_name, copy_guard, copy_action, readgram)
18876 (get_type, packsymbols): Revised most error messages.
18877 Changed `fatal' to `warnxxx' to avoid aborting for error.
18878 Revised and use multiple warnxxx functions to avoid using VARARGS1.
18879 (read_declarations): Improve the error message for
18880 an invalid character. Do not abort.
18881 (read_declarations, copy_guard, copy_action): Use
18882 printable_version to avoid unprintable characters in printed output.
18883 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
18884 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
18885 Allow the type of a non-terminal can be given
18886 more than once, as long as all specifications give the same type.
18887
18888 * src/output.c:
18889 (output_headers, output_trailers, output, output_gram)
18890 (output_rule_data): Implement noparserflag variable.
18891 Implement toknumflag variable.
18892 (output): Call reader_output_yylsp to output LTYPESTR.
18893
18894 * src/main.c (main):
18895 If reader sees an error, don't process the grammar.
18896 (fatals): Updated to not use VARARGS1.
18897 (printable_version, int_to_string, warn, warni, warns, warnss)
18898 (warnsss): New error reporting functions. Avoid abort for error.
18899
18900 * src/lex.h:
18901 Added THONG and NOOP for alias processing.
18902 Added SETOPT for the new code that allows setting options with %flags.
18903
18904 * src/lex.c:
18905 Include getopt.h. Add some extern decls.
18906 (safegetc): New function to deal with EOF gracefully.
18907 (literalchar); new function to deal with reading \ escapes.
18908 (lex): Use literalchar.
18909 (lex): Implemented "..." tokens.
18910 (literalchar, lex, parse_percent_token): Made tokenbuffer
18911 always contain the token. This includes growing the token
18912 buffer while reading an integer.
18913 (parse_percent_token): Replaced if-else statement with percent_table.
18914 (parse_percent_token): Added % declarations as another
18915 way to specify the flags -n, -l, and -r. Also added hooks for
18916 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
18917 major changes to files.c.
18918 (lex) Retain in the incoming stream a character following
18919 an incorrect '/'.
18920 (skip_white_space, lex): Revised most error messages
18921 and changed fatal to warn to avoid aborting.
18922 (percent_table): Added %thong declarations.
18923
18924 * src/gram.h: Comment changes.
18925
18926 * src/files.c (openfiles, open_extra_files, done):
18927 Add faction flag
18928 and actfile file. Handle noparserflag. Both for -n switch.
18929
18930 * src/conflicts.c (resolve_sr_conflict):
18931 Remove use of alloca.
18932
189331995-06-01 Jim Meyering <meyering@gnu.org>
18934
18935 * doc/bison.texinfo: *** empty log message ***
18936
189371995-05-06 Richard Stallman <rms@gnu.org>
18938
18939 * src/bison.s1: Comment change.
18940
189411995-05-06 Richard Stallman <rms@gnu.org>
18942
18943 * bison.simple: Comment change.
18944
189451995-05-03 Richard Stallman <rms@gnu.org>
18946
18947 * src/version.c: Version now 1.24.
18948
18949 * src/bison.s1: Change distribution terms.
18950
18951 * src/version.c: Version now 1.23.
18952
189531995-05-03 Richard Stallman <rms@gnu.org>
18954
18955 * doc/bison.texinfo:
18956 Rewrite "Conditions for Using Bison".
18957 Update version to 1.24.
18958
189591995-05-03 Richard Stallman <rms@gnu.org>
18960
18961 * bison.simple: Change distribution terms.
18962
189631995-02-23 Richard Stallman <rms@gnu.org>
18964
18965 * src/files.c: Test __VMS_POSIX as well as VMS.
18966
189671995-02-14 Jim Meyering <meyering@gnu.org>
18968
18969 * src/bison.s1 (__yy_memcpy):
18970 Renamed from __yy_bcopy to avoid
18971 confusion. Reverse FROM and TO arguments to be consistent with
18972 those of memcpy.
18973
189741995-02-14 Jim Meyering <meyering@gnu.org>
18975
18976 * bison.simple (__yy_memcpy):
18977 Renamed from __yy_bcopy to avoid
18978 confusion. Reverse FROM and TO arguments to be consistent with
18979 those of memcpy.
18980
189811994-11-10 David J. MacKenzie <djm@gnu.org>
18982
18983 * NEWS: reformat
18984
18985 * NEWS: New file.
18986
18987 * Makefile.in (DISTFILES): Include NEWS.
18988
18989 * Makefile.in (DISTFILES):
18990 Include install-sh, not install.sh.
18991
18992 * configure.in: Update to Autoconf v2 macro names.
18993
189941994-10-05 David J. MacKenzie <djm@gnu.org>
18995
18996 * Makefile.in: fix typo
18997
18998 * Makefile.in (prefix, exec_prefix):
18999 Let configure set them.
19000
190011994-09-28 David J. MacKenzie <djm@gnu.org>
19002
19003 * Makefile.in: Set datadir to $(prefix)/share.
19004
190051994-09-15 Richard Stallman <rms@gnu.org>
19006
19007 * src/bison.s1:
19008 Update copyright notice and GPL version.
19009
190101994-09-15 Richard Stallman <rms@gnu.org>
19011
19012 * bison.simple:
19013 Update copyright notice and GPL version.
19014
190151994-07-12 Richard Stallman <rms@gnu.org>
19016
19017 * src/reduce.c, src/reader.c:
19018 entered into RCS
19019
190201994-05-05 David J. MacKenzie <djm@gnu.org>
19021
19022 * Makefile.in: entered into RCS
19023
190241994-03-26 Richard Stallman <rms@gnu.org>
19025
19026 * src/bison.s1: entered into RCS
19027
190281994-03-26 Richard Stallman <rms@gnu.org>
19029
19030 * bison.simple: entered into RCS
19031
190321994-03-25 Richard Stallman <rms@gnu.org>
19033
19034 * src/main.c: entered into RCS
19035
190361994-03-24 Richard Stallman <rms@gnu.org>
19037
19038 * src/conflicts.c: entered into RCS
19039
190401994-01-02 Richard Stallman <rms@gnu.org>
19041
19042 * Makefile.in: *** empty log message ***
19043
190441993-11-21 Richard Stallman <rms@gnu.org>
19045
19046 * src/bison.s1: *** empty log message ***
19047
190481993-11-21 Richard Stallman <rms@gnu.org>
19049
19050 * doc/bison.texinfo: entered into RCS
19051
19052 * doc/bison.texinfo: *** empty log message ***
19053
190541993-11-21 Richard Stallman <rms@gnu.org>
19055
19056 * bison.simple: *** empty log message ***
19057
190581993-10-25 David J. MacKenzie <djm@gnu.org>
19059
19060 * doc/bison.texinfo: *** empty log message ***
19061
190621993-10-19 Richard Stallman <rms@gnu.org>
19063
19064 * src/bison.s1: *** empty log message ***
19065
190661993-10-19 Richard Stallman <rms@gnu.org>
19067
19068 * bison.simple: *** empty log message ***
19069
190701993-10-14 Richard Stallman <rms@gnu.org>
19071
19072 * src/bison.s1: *** empty log message ***
19073
190741993-10-14 Richard Stallman <rms@gnu.org>
19075
19076 * bison.simple: *** empty log message ***
19077
190781993-09-14 David J. MacKenzie <djm@gnu.org>
19079
19080 * doc/bison.texinfo: *** empty log message ***
19081
190821993-09-13 Noah Friedman <friedman@gnu.org>
19083
19084 * Makefile.in: *** empty log message ***
19085
190861993-09-10 Richard Stallman <rms@gnu.org>
19087
19088 * src/conflicts.c: *** empty log message ***
19089
19090 * src/system.h: entered into RCS
19091
190921993-09-10 Richard Stallman <rms@gnu.org>
19093
19094 * doc/bison.1: entered into RCS
19095
190961993-09-06 Noah Friedman <friedman@gnu.org>
19097
19098 * src/version.c: entered into RCS
19099
191001993-09-06 Noah Friedman <friedman@gnu.org>
19101
19102 * Makefile.in: *** empty log message ***
19103
191041993-07-30 David J. MacKenzie <djm@gnu.org>
19105
19106 * Makefile.in: *** empty log message ***
19107
191081993-07-24 Richard Stallman <rms@gnu.org>
19109
19110 * src/bison.s1: *** empty log message ***
19111
191121993-07-24 Richard Stallman <rms@gnu.org>
19113
19114 * bison.simple: *** empty log message ***
19115
191161993-07-08 David J. MacKenzie <djm@gnu.org>
19117
19118 * Makefile.in: *** empty log message ***
19119
191201993-07-04 Richard Stallman <rms@gnu.org>
19121
19122 * src/bison.s1: *** empty log message ***
19123
191241993-07-04 Richard Stallman <rms@gnu.org>
19125
19126 * bison.simple: *** empty log message ***
19127
191281993-06-26 David J. MacKenzie <djm@gnu.org>
19129
19130 * src/getargs.c: entered into RCS
19131
191321993-06-26 David J. MacKenzie <djm@gnu.org>
19133
19134 * doc/bison.texinfo: *** empty log message ***
19135
19136 * doc/bison.1: New file.
19137
191381993-06-25 Richard Stallman <rms@gnu.org>
19139
19140 * src/getargs.c: New file.
19141
191421993-06-16 Richard Stallman <rms@gnu.org>
19143
19144 * src/bison.s1: *** empty log message ***
19145
191461993-06-16 Richard Stallman <rms@gnu.org>
19147
19148 * bison.simple: *** empty log message ***
19149
191501993-06-03 Richard Stallman <rms@gnu.org>
19151
19152 * src/bison.s1: New file.
19153
191541993-06-03 Richard Stallman <rms@gnu.org>
19155
19156 * doc/bison.texinfo: *** empty log message ***
19157
191581993-06-03 Richard Stallman <rms@gnu.org>
19159
19160 * bison.simple: New file.
19161
191621993-05-19 Richard Stallman <rms@gnu.org>
19163
19164 * doc/bison.texinfo: New file.
19165
191661993-05-07 Noah Friedman <friedman@gnu.org>
19167
19168 * Makefile.in: *** empty log message ***
19169
191701993-04-28 Noah Friedman <friedman@gnu.org>
19171
19172 * src/reader.c: *** empty log message ***
19173
191741993-04-23 Noah Friedman <friedman@gnu.org>
19175
19176 * src/alloc.h: entered into RCS
19177
191781993-04-20 David J. MacKenzie <djm@gnu.org>
19179
19180 * src/version.c: *** empty log message ***
19181
19182 * src/files.c, src/allocate.c:
19183 entered into RCS
19184
19185 * src/reader.c: *** empty log message ***
19186
19187 * src/lex.c: entered into RCS
19188
19189 * src/conflicts.c: New file.
19190
19191 * src/symtab.c: entered into RCS
19192
19193 * src/alloc.h: New file.
19194
19195 * src/LR0.c: entered into RCS
19196
191971993-04-18 Noah Friedman <friedman@gnu.org>
19198
19199 * src/reader.c: New file.
19200
19201 * src/version.c: *** empty log message ***
19202
192031993-04-18 Noah Friedman <friedman@gnu.org>
19204
19205 * Makefile.in: *** empty log message ***
19206
192071993-04-17 Noah Friedman <friedman@gnu.org>
19208
19209 * Makefile.in: *** empty log message ***
19210
192111993-04-15 Richard Stallman <rms@gnu.org>
19212
19213 * src/main.c, src/files.c:
19214 New file.
19215
192161993-04-15 Noah Friedman <friedman@gnu.org>
19217
19218 * configure.in: entered into RCS
19219
19220 * configure.in: *** empty log message ***
19221
19222 * configure.in: New file.
19223
192241993-04-14 Richard Stallman <rms@gnu.org>
19225
19226 * Makefile.in: New file.
19227
192281993-04-13 Richard Stallman <rms@gnu.org>
19229
19230 * src/version.c: New file.
19231
192321993-03-25 Richard Stallman <rms@gnu.org>
19233
19234 * src/output.c: entered into RCS
19235
192361992-09-25 Richard Stallman <rms@gnu.org>
19237
19238 * configure.bat: entered into RCS
19239
192401992-06-22 Richard Stallman <rms@gnu.org>
19241
19242 * src/vmsgetargs.c: entered into RCS
19243
192441992-06-22 Richard Stallman <rms@gnu.org>
19245
19246 * doc/bison.rnh: entered into RCS
19247
192481992-04-20 David J. MacKenzie <djm@gnu.org>
19249
19250 * README: entered into RCS
19251
192521992-01-22 Richard Stallman <rms@gnu.org>
19253
19254 * src/machine.h: entered into RCS
19255
192561991-12-21 Richard Stallman <rms@gnu.org>
19257
19258 * src/lalr.c, src/closure.c:
19259 entered into RCS
19260
192611991-12-20 Richard Stallman <rms@gnu.org>
19262
19263 * src/state.h: entered into RCS
19264
192651991-12-18 Richard Stallman <rms@gnu.org>
19266
19267 * src/print.c, src/nullable.c, src/derives.c:
19268 entered into RCS
19269
192701991-11-03 David J. MacKenzie <djm@gnu.org>
19271
19272 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
19273 entered into RCS
19274
192751988-09-09 Richard Stallman <rms@gnu.org>
19276
19277 * src/bison.hairy: entered into RCS
19278
192791987-12-16 Richard Stallman <rms@gnu.org>
19280
19281 * REFERENCES: entered into RCS
dc546b0f 19282
f294a2c2 19283
04098407 19284 -----
f294a2c2 19285
04098407 19286 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
95021767
JD
19287 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
19288 Free Software Foundation, Inc.
f294a2c2 19289
04098407
PE
19290 Copying and distribution of this file, with or without
19291 modification, are permitted provided the copyright notice and this
19292 notice are preserved.
e9071366
AD
19293
19294$Id$