]> git.saurik.com Git - bison.git/blame - ChangeLog
Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
[bison.git] / ChangeLog
CommitLineData
47301314
AD
12003-08-25 Akim Demaille <akim@epita.fr>
2
3 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
4 error recovery loops. This patch is based on
5 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
6 Also, augment the similarity between lalr1.cc and yacc.c.
7 Note: the locations of error recovery rules are not correct yet.
8
9 * data/lalr1.cc: Comment changes to augment the similarity between
10 lalr1.cc and yacc.c.
11 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13 yyerrlab), when hitting EOF, pop the whole stack here instead of
14 merely falling thru the default error handling mechanism.
15 (yyerrorlab): New label, with the old contents of YYERROR,
16 plus the following change: pop the stack of rhs corresponding
17 to the production that invoked YYERROR. That is how Yacc
18 behaves (required by POSIX).
19 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
20 fail.
21
1f7a61ff
AD
222003-08-25 Akim Demaille <akim@epita.fr>
23
24 Tune local.at so that people can "autom4te -l autotest calc.at -o
25 calc" for instance, to extract a sub test suite.
26
27 * tests/testsuite.at: Move the initialization, Autotest version
28 requirement, and AT_TESTED invocation into...
29 * tests/local.at: here.
30 * tests/testsuite.at: Include it for compatibility with Autoconf
31 2.57.
32 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
33 be ignore.
34
327b5b56
PE
352003-08-04 Paul Eggert <eggert@twinsun.com>
36
37 Rework code slightly to avoid gcc -Wtraditional warnings.
38 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
39 The returned value is now stored in *YY0. All callers changed.
40 * src/output.c (merge_output): Adjust to the above change.
41
0051e3ed
PE
422003-07-26 Paul Eggert <eggert@twinsun.com>
43
44 * data/glr.c (YYASSERT): New macro.
45 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
46 yyresolveStates, yyprocessOneStack):
47 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
48 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 49
137437c6
PE
502003-07-25 Paul Eggert <eggert@twinsun.com>
51
5b620e06
PE
52 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
53 for portability to K&R C (after ansi2knr, presumably). See
54 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
55 by Frank Heckenbach, though I have omitted the structure-initialization
56 part of his glr-knr.diff patch since I recall that the Portable
57 C Compiler didn't require that change.
58
137437c6
PE
59 Let the user specify how to allocate and free memory.
60 Derived from a suggestion by Frank Heckenbach in
61 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
62 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
63 All uses of free, malloc, realloc changed to use these macros,
64 and unnecessary casts removed.
65 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
66
ddb85ca5
PE
672003-07-06 Matthias Mann <MatthiasMann@gmx.de>
68
69 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
70 use s.empty() rather than s == "" to test for empty string; see
71 <http://mail.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
72 (trivial change)
73
39910e09
AD
742003-06-25 Akim Demaille <akim@epita.fr>
75
76 * config/depcomp, config/install-sh: Update from masters.
77
0ae99356
PE
782003-06-20 Paul Eggert <eggert@twinsun.com>
79
80 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
81 and return properly parenthesized result.
82 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
83 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
84 Remove unnecessary parentheses from uses.
85 * doc/bison.texinfo (Location Default Action): Describe the
86 conventions for parentheses.
87
cd05d13c
PE
882003-06-19 Paul Eggert <eggert@twinsun.com>
89
81fd08ca
PE
90 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
91 yyreportTree): Do not assume that size_t is the same width as int,
92 when printing sizes. Print sizes using an unsigned format.
93 Problem reported by Frank Heckenbach in
94 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 95
cd05d13c
PE
96 Port to Forte Developer 7 C compiler.
97 * data/glr.c (struct YYLTYPE): If locations are not being used,
98 declare a single dummy member, as empty structs do not conform
99 to the C standard.
100 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
101 the Forte Developer 7 C compiler complains that end-of-loop
102 code is not reached.
103
4dcf140b
PE
1042003-06-17 Paul Eggert <eggert@twinsun.com>
105
106 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
107 avoid warnings from picky compilers about redefinition of PARAMS.
108
8dd76bee
PE
1092003-06-17 Paul Eggert <eggert@twinsun.com>
110
111 Version 1.875b.
112
113 * NEWS: Document 1.875b.
114
115 * lib/bbitset.h: Do not include config.h; that's the includer's job.
116 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
117 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
118 Don't use 'index' in comments, as it's a builtin fn on some hosts.
119 * lib/bitset_stats.c: Include gettext.h unconditionally, as
120 per recent gettext manual's suggestion.
121 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
122 Use prototypes, not old-style definitions.
123 * lib/lbitset.c (lbitset_unused_clear): Likewise.
124 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
125 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
126 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
127 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
128 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
129 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
130 vbitset_or_and_cmp, vbitset_copy): Likewise.
131
132 * lib/libiberty.h: Do not include config.h; that's the includer's job.
133 Do not include <stdlib.h>.
134 (PARAMS): Define unconditionally for C89.
135 (ATTRIBUTE_NORETURN): Remove.
136 (ATTRIBUTE_UNUSED): Define unconditionally.
137
138 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
139 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
140 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
141 * lib/vbitset.c, lib/vbitset.h: New files.
142 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
143 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
144 from libbitset.
145
146 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
147 `How Can I Reset @code{yyparse}', since texinfo does not allow
148 arbitrary @ in node names.
149
150 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
151 shouldn't be needed according to the gettext 0.12.1 documentation
152 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 153 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 154 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 155 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 156
8dd76bee
PE
157 * lib/.cvsignore: Add stdbool.h.
158 * m4/.cvsignore: Add nls.m4, po.m4.
159
160 Upgrade to CVS gnulib.
161 * stdbool_.h: File renamed from stdbool.h.in.
162 * configure.ac (AM_STDBOOL_H): Invoke this instead of
163 AC_HEADER_STDBOOL.
164 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
165 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
166 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
167 (MOSTLYCLEANFILES): New var.
168 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
169 (stdbool.h): New rule.
170 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
171 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
172 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
173 m4/quote.m4: Upgrade to today's gnulib.
174
175 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
176 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
177 the tests right now.
178 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
179 yyerror are declared before use; C99 requires this.
180
25005f6a
PH
1812003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
182
183 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
184 first.
185 (yyrecoverSyntaxError): Correct the logic for setting and testing
186 yyerrState.
187 Correct comment on handling EOF.
188 Allow states with only a default reduction, rather than failing
8dd76bee 189 (I can't quite reconstruct why these were not allowed before).
25005f6a 190
137437c6 191 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 192 buffer overruns, corrupting state.
8dd76bee
PE
193
194 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
195 definition.
196 * src/reader.h (max_left_semantic_context): New variable declaration.
197 * src/scan-gram.l (max_left_semantic_context): Define.
198 (handle_action_dollar): Update max_left_semantic_context.
199 * data/glr.c (YYMAXLEFT): New definition.
200 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
201 (yyresolveAction): Ditto.
202
203 Fixes to problems with location handling in GLR parsers reported by
204 Frank Heckenbach (2003/06/05).
205
206 * data/glr.c (YYLTYPE): Make trivial if locations not used.
207 (YYRHSLOC): Add parentheses, and define only if locations used.
208 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
209 locations not used.
210 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
211 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 212
25005f6a
PH
213 * tests/cxx-type.at: Exercise location information; update tests
214 to differentiate output with and without locations.
8dd76bee 215 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
216 because default YYLTYPE not yet defined.
217 Change semantic actions to compute strings, rather than printing
218 them directly (to test proper passing of semantics values). Change
219 output to prefix notation and update test data and expected results.
220 (yylex): Track locations.
221 (stmtMerge): Return value rather than printing, and include arguments
222 in value.
8dd76bee 223
711f40b7
PE
2242003-06-03 Paul Eggert <eggert@twinsun.com>
225
226 Avoid warnings generated by GCC 2.95.4 when Bison is
227 configured with --enable-gcc-warnings.
228 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
229 yy::]b4_parser_class_name[::translate_,
230 yy::Stack::operator[] (unsigned),
231 yy::Stack::operator[] (unsigned) const,
232 yy::Slice::operator[] (unsigned),
233 yy::Slice::operator[] (unsigned) const):
234 Rename local vars to avoid warnings.
235 * tests/glr-regression.at (Improper handling of embedded actions
236 and $-N in GLR parsers): Remove unused local variable from yylex.
237 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
238 (void) as arg when not pure, since we now assume C89 when building
239 Bison. Pacify GCC by using parameter.
240
ac695f7d
PE
2412003-06-02 Paul Eggert <eggert@twinsun.com>
242
243 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
244 yy::Location::lines, yy::Location::columns): Rename arguments
245 to avoid shadowing; this removes a warning generated by GCC 3.3.
246
26ec81e0
PE
2472003-06-01 Paul Eggert <eggert@twinsun.com>
248
249 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
250 to g++, as GCC 3.3 complains if you do it.
251 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
252 everything that WARNING_CFLAGS has, except omit warnings
253 not suitable for C++.
254 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
255 * tests/atlocal.in (CXXFLAGS): New var.
256 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
257
258 Fix a GLR parser bug I reported in February; see
259 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
260 The problem was that GLR parsers did not conform to the C standard,
261 because actions like { $1 = $2 + $3; } expanded to expressions
262 that invoked YYFILL in separate subexpressions, and YYFILL assigned
263 to a local variable. The C standard says that expressions
264 like (var = f ()) + (var = f ()) have undefined behavior.
265 Another problem was that GCC sometimes issues warnings that
266 yyfill and its parameters are unused.
267
268 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
269 as possibly unused.
270 (yyfill): New function.
271 (YYFILL): Use it.
272 (yyuserAction): Change type of yynormal to bool, so that it matches
273 the new yyfill signature. Mark it as possibly unused.
274
275
276 Follow up on a bug I reported in February, where a Bison-generated
277 parser can loop. Provide a test case and a fix for yacc.c. I
278 don't have a fix for lalr1.cc or for glr.c, unfortunately.
279 The original bug report is in:
280 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
281
282 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
283 macro's size was becoming unwieldy.
284 (yyerrlab): Do not discard an empty lookahead symbol, as this
285 might destroy garbage.
286 (yyerrorlab): New label, with the old contents of YYERROR,
287 plus the following change: pop the stack of rhs corresponding
288 to the production that invoked YYERROR. That is how Yacc
289 behaves, and POSIX requires this behavior.
290 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
291 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
292 Define 'alarm' to do nothing if unistd.h is not available.
293 Add a new rule "exp: '-' error;" to test the above change to
294 data/yacc.c. Use 'alarm' to abort any test taking longer than
295 10 seconds, as it's probably looping.
296 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
297 Also, the new yacc.c generates two fewer diagnostics for an
298 existing test.
299
d0829076
PE
3002003-05-24 Paul Eggert <eggert@twinsun.com>
301
c6ae27df
PE
302 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
303 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
304 This fixes a problem reported by John Bowman when the Compaq/HP
305 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
306 -ansi -Wall -gall).
307 * data/yacc.c (union yyalloc): Likewise.
308 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 309
d0829076
PE
310 Switch from 'int' to 'bool' where that makes sense.
311
312 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
313 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
314 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
315 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
316 Return or accept bool, not int. All callers changed.
317 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
318 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
319 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
320 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
321 bitset_or_and_cmp_): Likewise.
322 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
323 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
324 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
325 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
326 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
327 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
328 bitset_stats_or_and_cmp): Likewise.
329 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
330 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
331 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
332 ebitset_xor_cmp): Likewise.
333 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
334 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
335 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
336 lbitset_xor_cmp): Likewise.
337 * lib/bbitset.h: Include <stdbool.h>.
338 (struct bitset_vtable): The following members now return bool, not
339 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
340 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
341 or_and_cmp).
342 * src/conflicts.c (count_rr_conflicts): Likewise.
343 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
344 All uses changed.
345 * lib/ebitset.c (ebitset_obstack_init): Likewise.
346 * lib/lbitset.c (lbitset_obstack_init): Likewise.
347 * src/getargs.c (debug_flag, defines_flag, locations_flag,
348 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
349 graph_flag): Likewise.
350 * src/getargs.h (debug_flag, defines_flag, locations_flag,
351 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
352 graph_flag): Likewise.
353 * src/output.c (error_verbose): Likewise.
354 * src/output.h (error_verbose): Likewise.
355 * src/reader.c (start_flag, typed): Likewise.
356 * src/reader.h (typed): Likewise.
357 * src/getargs.c (LOCATIONS_OPTION): New constant.
358 (long_options, getargs): Use it.
359 * src/lalr.c (build_relations): Use bool, not int.
360 * src/nullable.c (nullable_compute): Likewise.
361 * src/print.c (print_reductions): Likewise.
362 * src/tables.c (action_row, pack_vector): Likewise.
363 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
364 * src/output.c (prepare): Use it.
365 * src/output.c (token_definitions_output,
366 symbol_destructors_output, symbol_destructors_output): Use string,
367 not boolean integer, to keep track of whether to output separator.
368 * src/print_graph.c (print_core): Likewise.
369 * src/state.c (state_rule_lookaheads_print): Likewise.
370
371 * config/install-sh: Sync from automake 1.7.5.
372
6b2584b7
PE
3732003-05-14 Paul Eggert <eggert@twinsun.com>
374
375 * src/parse-gram.y (rules_or_grammar_declaration): Require a
376 semicolon after a grammar declaration, in the interest of possible
377 future changes to the Bison input language.
378 Do not allow a stray semicolon at the start of the grammar.
379 (rhses.1): Allow one or more semicolons after any rule, including
380 just before "|" as required by POSIX.
381 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
382 grammar.
383
caf37a36
ADL
3842003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
385
386 %parse-param support for lalr1.cc.
387
388 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
389 b4_cc_constructor_calls, b4_cc_constructor_call,
390 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
391 definitions.
392 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
393 parse-param arguments.
394 (yy::b4_parser_class_name): Declare instance variables to
395 hold parse-param arguments.
396 * tests/calc.at: s/value/semantic_value/ because value clashes
397 with a member of yy::b4_parser_class_name. Adjust C++ code
398 to handle %parse-param. Enable %parse-param test in C++.
399
3ab37077
PE
4002003-05-12 Paul Eggert <eggert@twinsun.com>
401
402 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
403 English a bit. Fix fclose typo. Change "const char" to "char
404 const", and use ANSI C rather than K&R for "main". Suggest
405 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
406 and suggest yy_switch_to_buffer.
407
4082003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
409
410 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
411 C89. This avoids a diagnostic on compilers that define __STDC__
412 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
413 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
414
e743727f
PE
4152003-05-03 Paul Eggert <eggert@twinsun.com>
416
417 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
418 Do not overrun array bounds.
419 This should fix a bug reported today by Olatunji Oluwabukunmi in
420 <http://mail.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
421
916708d5
AD
4222003-04-29 Akim Demaille <akim@epita.fr>
423
424 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
425 * src/getargs.c, src/getargs.h: here, as bool, not int.
426 (nondeterministic_parser): New.
427 * src/parse-gram.y, src/scan-gram.l: Support
428 %nondeterministic-parser.
429 * src/output.c (prepare): Use nondeterministic_parser instead
430 of glr_parser where appropriate.
431 * src/tables.c (conflict_row, action_row, save_row)
432 (token_actions, token_actions, pack_vector): Ditto.
433
a06ea4aa
AD
4342003-04-29 Akim Demaille <akim@epita.fr>
435
436 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
437
211074ca
AD
4382003-04-29 Akim Demaille <akim@epita.fr>
439
440 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
441 with %pure-parser and %locations to exercise the patch from Yakov
442 Markovitch below.
443
6175ffe3
PE
4442003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
445
446 * data/yacc.c: (b4_lex_param): Corrected for the case where
447 %lex-param is provided and %pure-parser isn't.
448
b1e95857
PE
4492003-04-27 Paul Eggert <eggert@twinsun.com>
450
451 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
452 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
453 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
454 if it is not defined.
455 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
456
acda9df6
PE
4572003-04-26 Paul Eggert <eggert@twinsun.com>
458
3470c57b
PE
459 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
460 Declare to be of type suitable for the ninf value itself, not of
461 type suitable for the corresponding table, since the latter might
462 be unsigned but the ninf value might be negative. This fixes a
463 bug reported by Alexandre Duret-Lutz in
464 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
465
acda9df6
PE
466 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
467 invokes it. We shouldn't invoke it twice because it will attempt
468 to put error.o in the archive twice. This fixes a glitch reported
469 by Martin Mokrejs in
470 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
471
b5250f26
PE
4722003-04-21 Paul Eggert <eggert@twinsun.com>
473
474 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
475 to gnulib.
476
089ac0f1
PE
4772003-04-21 Yakov Markovitch <Markovitch@iso.ru>
478
479 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
480 Fix obvious typo that results in uncompilable GLR parsers
481 when both %pure-parser and %locations are used. (trivial change)
482
5ededac6
PE
4832003-04-17 Paul Eggert <eggert@twinsun.com>
484
1b8f2fff
PE
485 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
486 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
487 Do not insert the expected token via unput, as this runs afoul
488 of a POSIX-compatibility bug in flex 2.5.31.
489 All uses changed to BEGIN the parent state,
490 since we no longer insert the expected token via unput.
491 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
492 that is no longer emitted after the above change.
493
5ededac6
PE
494 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
495 the first one. This change is from Paul Hilfinger, and it fixes
496 regression reported by Werner Lemberg in
497 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
498
499 (resolve_sr_conflict): Don't invoke state_errs_set
500 unless one or more tokens have been explicitly made errors.
501 Otherwise, the above change causes Bison to abort.
502
503 * tests/existing.at (GNU pic Grammar): New test case, taken from
504 Lemberg's email.
505
b8be9132
AD
5062003-03-31 Akim Demaille <akim@epita.fr>
507
508 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
509
d423d460
AD
5102003-03-31 Akim Demaille <akim@epita.fr>
511
512 * src/output.c (prepare_symbols): Avoid trailing spaces in the
513 output.
514
c7e441b4
AD
5152003-03-31 Akim Demaille <akim@epita.fr>
516
517 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
518 From Paul Hilfinger.
519
231897ad
AD
5202003-03-29 Akim Demaille <akim@epita.fr>
521
522 * m4/error.m4: Do not put under dynamic conditions some code which
523 expansion is under static control.
524
5b066063
AD
5252003-03-29 Akim Demaille <akim@epita.fr>
526
527 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
528
22a74fec
AD
5292003-03-29 Akim Demaille <akim@epita.fr>
530
531 * doc/bison.texinfo (Strings are Destroyed): New.
532
0eee27e7
PE
5332003-03-13 Paul Eggert <eggert@twinsun.com>
534
535 * .cvsignore: Add configure.lineno.
536 * src/.cvsignore: Add yacc.
537 * tests/.cvsignore: Add testsuite.log.
538 * doc/fdl.texi: Sync with latest FSF version.
539
f61aad93
PE
5402003-03-12 Paul Eggert <eggert@twinsun.com>
541
537636c7
PE
542 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
543 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
544 cursor, instead of leaving it undefined. This fixes a bug
545 reported by Tim Van Holder in
546 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
547 * tests/input.at (Torturing the Scanner): Test the scanner on
548 an empty input file, which was Tim Van Holder's test case.
549
550 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
551 <sys/resource.h> can be included, include sys/time.h and
552 sys/times.h first, if available. This works around the SunOS
553 4.1.4 porting bug reported by Bruce Becker in
554 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
555
556 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
557 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
558 AC_HEADER_SYS_WAIT.
559
f61aad93
PE
560 Merge changes from gnulib. This was prompted because the CVS
561 snapshot didn't build on Solaris 7 due to strnlen problems.
562
563 These changes need to be merged back into gnulib:
564 * lib/hash.c: Include <stdbool.h> unconditionally.
565 * m4/onceonly.m4 (m4_quote): New macro.
566 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
567 Quote AC_FOREACH variable-expansions properly.
568 The 2003-01-03 obstack.h change also needs merging.
569 {end of changes requiring merging}
5b066063 570
f61aad93
PE
571 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
572 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
573 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
574 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
575 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
576 New files, imported from gnulib.
577 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
578 above.
579
580 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
581 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
582 gnulib sources.
583
584 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
585 Add.
586 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
587 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
588 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
589 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
590 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
591 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
592 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
593 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
594 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
595 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
596 (jm_PREREQ_ARGMATCH): Remove.
597 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
598 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
599
600 * src/system.h: Include <stdbool.h> unconditionally.
601
602 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
603 assuming at least C89 in the bitset code for some time now.
604
d2ffe116
AD
6052003-03-03 Akim Demaille <akim@epita.fr>
606
607 * ro.po: New.
608
052826fd
AD
6092003-03-02 Akim Demaille <akim@epita.fr>
610
611 * doc/bison.texinfo (Table of Symbols): Reactivate the
612 documentation for %lex-param, and %parse-param.
613
c4749565
AD
6142003-03-02 Akim Demaille <akim@epita.fr>
615
616 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
617 generate verbose error messages.
618 Use the number of tokens as an upper bound in yytname, as it
619 cannot be a non terminal.
620
d5286af1
AD
6212003-03-02 Akim Demaille <akim@epita.fr>
622
623 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
624 message.
625
22e304a6
AD
6262003-03-02 Akim Demaille <akim@epita.fr>
627
22e304a6
AD
628 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
629 Use them to exercise yycheck overrun.
630 Based on Andrew Suffield's grammar.
631
67a25fed
AD
6322003-03-02 Akim Demaille <akim@epita.fr>
633
634 Create tests/local.at for Bison generic testing macros.
635
636 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
637 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
638 This new file.
639 * tests/calc.at (AT_CHECK_CALC): Adjust.
640 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
641 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
642 * tests/local.at: here.
643 (AT_COMPILE_CXX): Tags the tests using it as c++.
644 Ignore the test if CXX is not functional.
645
9c2b381f
PE
6462003-03-01 Paul Eggert <eggert@twinsun.com>
647
648 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
649 not loc->end, since loc->end might contain garbage and this leads
650 to undefined behavior on some platforms.
651 (id_loc, token_start): Use (IF_LINTed) initial values that do not
652 depend on *loc, so that the reader doesn't give the the false
653 impression that *loc is initialized.
654 (<INITIAL>"%%"): Do not bother setting code_start, since its value
655 does not survive the return.
656
0433ba88
AD
6572003-03-01 Akim Demaille <akim@epita.fr>
658
659 * src/scan-gram.l (code_start): Always initialize it when entering
660 into yylex, as SC_EPILOGUE is activated *before* the corresponding
661 yylex invocation. An alternative would be making it static, but
662 then it starts with the second %%'s beginning, instead of its end.
663
b305ea69
PE
6642003-02-28 Paul Eggert <eggert@twinsun.com>
665
666 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
667 around a UnixWare 7.1.1 porting bug reported by John Hughes in
668 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
669
c3d25e01
PE
6702003-02-26 Paul Eggert <eggert@twinsun.com>
671
672 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
673 Remove Sequent/Pyramid discussion (nobody uses them any more).
674 Merge VMS and MS-DOS discussion; these ports may well be dead
675 but let's keep mentioning them for now. Put <> around email
676 addresses. Add copyright notice.
677
c267ffbc
PE
6782003-02-24 Paul Eggert <eggert@twinsun.com>
679
680 * data/glr.c (yy_reduce_print): yylineno -> yylno,
681 to avoid collision with flex use of yylineno.
682 Problem reported by Bruce Lilly in
683 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
684 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
685 * data/yacc.c (yy_reduce_print): Likewise.
686
687 * config/depcomp: Sync with Automake 1.7.3.
688
f939fc12
AD
6892003-02-21 Akim Demaille <akim@epita.fr>
690
691 * data/lalr1.cc: Use temporary variables instead of casts to
692 change integer types.
693 Suggested by Paul Eggert.
694
95923bd6
AD
6952003-02-21 Akim Demaille <akim@epita.fr>
696
697 * doc/bison.texinfo: Use "location" consistently to refer to @n,
698 to avoid confusions with lalr1.cc's notion of Position.
699 Suggested by Paul Eggert.
700
2cdc240e
AD
7012003-02-20 Akim Demaille <akim@epita.fr>
702
703 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
704 before initial_columns.
705 (location.hh): Use consistent variable names when defining the
706 operator<<.
707 Use "last" so that we subtract from Positions, not from unsigned.
708
5d003116
AD
7092003-02-20 Akim Demaille <akim@epita.fr>
710
711 * data/lalr1.cc (position.hh): New subfile, including the extended
712 and Doxygen'ed documentation of class Position.
713 (location.hh): Use it.
714 Document a` la Doxygen.
ba1ecc07 715 With the help of Benoit Perrot.
5d003116 716
d02b25f9
AD
7172003-02-20 Akim Demaille <akim@epita.fr>
718
719 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
720 AT_YACC_IF.
721 Redefine AT_YYERROR_SEES_LOC_IF using it.
722 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
723 not defined.
724 Don't use the location in yy::Parser::error_ and
725 yy::Parser::print_ when not %locations.
726 Activate more lalr1.cc tests.
727
0d1c3a04
AD
7282003-02-19 Akim Demaille <akim@epita.fr>
729
730 * data/lalr1.cc: When displaying a line number, be sure to make it
731 an int.
732
60a777aa
AD
7332003-02-19 Akim Demaille <akim@epita.fr>
734
735 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
736 Remove, useless.
737 (YYABORT, YYACCEPT, YYERROR): New.
738 * tests/calc.at: Renable the lalr1.cc test.
739
0b86fc41
AD
7402003-02-19 Akim Demaille <akim@epita.fr>
741
742 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
743 error recovery, mixing with/without pops and discarding of the
744 lookahead.
745 Exercise YYERROR.
746 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
747
da99a5dc
PE
7482003-02-17 Paul Eggert <eggert@twinsun.com>
749
750 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
751 * tests/testsuite.at (AT_COMPILE): Use them.
752 This fixes the testsuite problem reported by Robert Lentz in
753 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
754
93b8c255
PE
7552003-02-12 Paul Eggert <eggert@twinsun.com>
756
757 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
758 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
759 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
760 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
761 Check for malloc failure, for consistency with yacc.c.
762 (yytname_size): Remove, for consistency with yacc.c.
763
764 The bug still remains in data/lalr1.cc, as I didn't have time
765 to fix it there.
766
7548fed2
AD
7672003-02-06 Akim Demaille <akim@epita.fr>
768
769 * configure.ac (GXX): Rename as...
770 (CXX): this, to keep the original Autoconf semantics.
771 Require 2.57.
772 * data/lalr1.cc: Fix b4_copyright invocations.
773 If YYDEBUG is not defined, don't depend upon name_ being defined.
774 (location.hh): Include string and iostream.
775 (Position::filename): New member.
776 (Position::Position ()): New.
777 (operator<< (Position)): New.
778 (operator- (Position, int)): New.
779 (Location::first, Location::last): Rename as...
780 (Location::begin, Location::end): these, to mock the conventional
781 iterator names.
782 (operator<< (Location)): New.
783 * tests/atlocal.in (CXX): New.
784 * tests/testsuite.at (AT_COMPILE_CXX): New.
785 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
786 locations in a more synthetic way.
787 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
788 lalr1.cc is used.
789 Adjust the C locations to match those from Emacs: first column is
790 column 0.
791 Change all the expected results.
792 Conform to the GCS: simplify the locations when applicable.
793 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
794 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
795 these CPP macros with the m4 macros new defined by...
796 (AT_CHECK_PUSHDEFS): this, i.e.:
797 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 798 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
799 New macros.
800 (AT_CHECK_POPDEFS): Undefine them.
801 (AT_CHECK_CALC_LALR1_CC): New.
802 Use it for the first lalr1.cc test.
803
43a176ef
AD
8042003-02-04 Akim Demaille <akim@epita.fr>
805
806 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
807 Location as is defined.
808
fc049e9c
AD
8092003-02-04 Akim Demaille <akim@epita.fr>
810
811 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
812 name_ being defined.
813
a737b216
PE
8142003-02-03 Paul Eggert <eggert@twinsun.com>
815
816 * src/gram.h (start_symbol): Remove unused decl.
817
818 Use more-consistent naming conventions for local vars.
819
820 * src/derives.c (derives_compute): Change type of local var from
821 int to rule_number.
822 * src/gram.c (grammar_rules_partial_print): Likewise.
823 * src/print.c (print_core): Likewise.
824 * src/reduce.c (reduce_grammar_tables): Likewise.
825
826 * src/gram.c (grammar_dump): Change name of item_number *
827 local var from r to rp.
828 * src/nullable.c (nullable_compute): Likewise.
829
830 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
831
832 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
833 for symbol or symbol_number var.
834 * src/reader.c (grammar_start_symbol_set): Likewise.
835 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
836 Likewise.
837 * src/state.c (transitions_to): Likewise.
838 * src/state.h: Likewise.
839 * src/tables.c (symbol_number_to_vector_number): Likewise.
840
841 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
842 char * var.
843
844 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
845 var.
846
847 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
848 var.
849
850 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
851 Use str, not s, for char * var. Use ch, not c, for character var.
852 Use size for size var.
853
854 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
855 char * var.
856 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
857 uniqstr var.
858 * src/uniqstr.h: Likewise.
859
860 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
861 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
862 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
863 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
864 param to have same name as that of enum, so that we don't use
865 "s" to stand for a non-state.
866
68e93ad5
AD
8672003-02-02 Akim Demaille <akim@epita.fr>
868
869 * src/scan-skel.l: Scan more than one inert character per yylex
870 invocation.
871
92898986
PE
8722003-02-01 Paul Eggert <eggert@twinsun.com>
873
874 Version 1.875a.
875
1d9d5d71
PE
876 * po/LINGUAS: Add ms.
877
0435d061
AD
8782003-01-30 Akim Demaille <akim@epita.fr>
879
880 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
881
6029a57f
PH
8822003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
883
884 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
885 of $1.
0435d061
AD
886
887 Changes in response to error report by S. Eken: GLR mode does not
6029a57f
PH
888 handle negative $ indices or $ indices in embedded rules correctly.
889 See <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 890
6029a57f
PH
891 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
892 (b4_rhs_location): Ditto.
0435d061 893 (yyfill): New function to copy from stack tree into array
6029a57f 894 incrementally.
0435d061
AD
895 (yyuserAction): Modify to allow incremental move of semantic values
896 to rhs array when in GLR mode.
897 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
898 as needed.
899 Remove dummy use of yystack, as there is now a guaranteed use.
900 (yydoAction): Modify to allow incremental move of semantic values
901 to rhs array when in GLR mode.
902 (yyresolveAction): Ditto.
903 (yyglrShiftDefer): Update comment.
0435d061 904 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
905 (yyglrReduce): Ditto.
906 (yydoAction): Ditto
0435d061 907
6029a57f
PH
908 * tests/glr-regr1.at: Rename to ...
909 * tests/glr-regression.at: Add new regression test for the problems
910 described above (adapted from S. Eken).
911 Update copyright notice.
912 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
913 * tests/Makefile.am: Ditto.
914
6cee6297
PE
9152003-01-28 Paul Eggert <eggert@twinsun.com>
916
917 * data/lalr1.cc: Do not use @output_header_name@ unless
918 b4_defines_flag is set. This fixes two bugs reported by
919 Tim Van Holder in
920 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
921 and <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
922
b2a836b5
PE
9232003-01-21 Paul Eggert <eggert@twinsun.com>
924
925 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
926 we don't need to worry about yyerrlab1 being reported as an
927 "unused label" by non-GCC C compilers. The downside is that if
928 locations are used then a couple of statements are duplicated each
929 time YYERROR is invoked, but the upside is that the warnings
930 should vanish.
931 (yyerrlab1): Move code to YERROR.
932 (yyerrlab2): Remove. Change uses back to yyerrlab1.
933 This reverts some of the 2002-12-27 change.
934
4196b931
PE
9352003-01-17 Paul Eggert <eggert@twinsun.com>
936
937 * src/output.c (symbol_printers_output): Fix typo that led
938 to core dump. Problem reported by Antonio Rus in
939 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
940
3ae831b4
AD
9412003-01-13 Akim Demaille <akim@epita.fr>,
942 Quoc Peyrot <chojin@lrde.epita.fr>,
943 Robert Anisko <anisko_r@lrde.epita.fr>
944
945 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
946 when the stacks contain one element, as the loop would otherwise
947 free the last state, and then use the top state (the one we just
948 popped). This means that the initial elements will not be freed
949 explicitly, as is the case in yacc.c; it is not a problem, as
950 these elements have fake values.
951
e3aa65c5
PE
9522003-01-11 Paul Eggert <eggert@twinsun.com>
953
954 * NEWS: %expect-violations are now just warnings, reverting
955 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
956 bootstrapping problem reported by Matthias Klose; see
957 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
958 * src/conflicts.c (conflicts_print): Likewise.
959 * tests/conflicts.at (%expect not enough, %expect too much,
960 %expect with reduce conflicts): Likewise.
961 * doc/bison.texinfo (Expect Decl): Document this. Also mention
962 that the warning is enabled if the number of conflicts changes
963 (not necessarily increases).
964
965 * src/getargs.c (version): Update copyright year.
966
f0057011
AD
9672003-01-09 Akim Demaille <akim@epita.fr>
968
969 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
970
1ee6d2a0
PE
9712003-01-08 Paul Eggert <eggert@twinsun.com>
972
973 * Makefile.maint (WGETFLAGS):
974 New macro, containing "-C off" to disable proxy caches.
975 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
976 (rel-check): Use $(WGET) instead of wget.
977
d4fd77c4
PE
9782003-01-06 Paul Eggert <eggert@twinsun.com>
979
980 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
981 the GLR paper of Scott, Johnstone and Hussain.
982
464c6927
PE
9832003-01-04 Paul Eggert <eggert@twinsun.com>
984
d600ee67
PE
985 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
986 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
987 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
988 (EXTRA_LIBRARIES): New var, for liby.a.
989 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
990 (EXTRA_SCRIPTS): New var, for yacc.
991
464c6927
PE
992 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
993 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
994 Problem reported by Nelson H. F. Beebe.
995
9962003-01-03 Paul Eggert <eggert@twinsun.com>
997
998 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
999 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
1000 when compiling Bison 1.875's `bitset bset = obstack_alloc
1001 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
1002
1003 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
1004 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
1005 grow to a huge size with typical invocation.
d600ee67 1006
464c6927
PE
1007 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
1008 Use the pattern recommended by Autoconf 2.57, except also protect
1009 against double-definition.
1010 * src/system.h: Likewise.
1011 Portability issues reported by Nelson H. F. Beebe.
d600ee67 1012
464c6927
PE
1013 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
1014 All uses changed. Provide a definition in both C and C++.
1015 (yytrue, yyfalse): Define even if defined (__cplusplus).
1016
1017 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
1018 Reported by Nelson H. F. Beebe.
d600ee67 1019
464c6927
PE
1020 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
1021
0f42c7d5
PE
10222003-01-02 Paul Eggert <eggert@twinsun.com>
1023
1024 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
1025 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
1026 Bug reported by Nelson H. F. Beebe.
1027
dc546b0f
PE
10282003-01-01 Paul Eggert <eggert@twinsun.com>
1029
1030 * Version 1.875.
1031
2c09b6a7
PE
10322002-12-30 Paul Eggert <eggert@twinsun.com>
1033
1034 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
1035 Moved here from...
1036 (<INITIAL>","): Here. This causes stray "," to be treated
1037 more uniformly.
1038
dc546b0f 1039 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
1040 last brace in braced code when not in Yacc mode, for compatibility
1041 with Bison 1.35. This resurrects the 2001-12-15 patch to
1042 src/reader.c.
1043
1044 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
1045 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
1046
535c0f63
PE
10472002-12-28 Paul Eggert <eggert@twinsun.com>
1048
1049 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
1050 that of SYM's type. This fixes Debian bug 168069, reported by
1051 Thomas Olsson.
d600ee67 1052
963fcc17
PE
10532002-12-28 Paul Eggert <eggert@twinsun.com>
1054
1055 Version 1.75f.
1056
1057 Switch back to the Yacc style of conflict reports, undoing some
1058 of the 2002-07-30 change.
1059 * doc/bison.texinfo (Understanding): Use Yacc style for
1060 conflict reports. Also, use new way of locating rules.
1061 * src/conflicts.c (conflict_report):
1062 Renamed from conflict_report_yacc, removing the old
1063 'conflict_report'. Translate the entire conflict report at once,
1064 so that we don't assume that "," has the same interpretation in
1065 all languages.
1066 (conflicts_output): Use Yacc-style conflict report for each state,
1067 instead of our more-complicated style.
1068 (conflicts_print): Use Yacc-style conflict report, except print
1069 the input file name when not emulating Yacc.
1070 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
1071 Conflicted Reduction, %expect not enough, %expect too much,
1072 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
1073 * tests/existing.at (GNU Cim Grammar): Likewise.
1074 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
1075
1076 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
1077 fatal): Don't invoke fflush; it's not needed and it might even be
1078 harmful for stdout, as stdout might not be open.
1079 * src/reduce.c (reduce_print): Likewise.
1080
b1efe548
PE
10812002-12-27 Paul Eggert <eggert@twinsun.com>
1082
1083 Fix a bug where error locations were not being recorded correctly.
1084 This problem was originally reported by Paul Hilfinger in
e3aa65c5 1085 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
1086
1087 * data/yacc.c (yyparse): New local var yylerrsp, to record the
1088 top of the location stack's error locations.
1089 (yyerrlab): Set it. When discarding a token, push its location
1090 onto yylerrsp so that we don't lose track of the error's end.
1091 (yyerrlab1): Now is only the target of YYERROR, so that we can
1092 properly record the location of the action that failed. For GCC
1093 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
1094 GCC warning about yyerrlab1 being unused if YYERROR is unused.
1095 (yyerrlab2): New label, which yyerrlab now falls through to.
1096 Compute the error's location by applying YYLLOC_DEFAULT to
1097 the locations of all the symbols that went into the error.
1098 * doc/bison.texinfo (Location Default Action): Mention that
1099 YYLLOC_DEFAULT is also invoked for syntax errors.
1100 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
1101 Error locations include the locations of all the tokens that were
1102 discarded, not just the last token.
d600ee67 1103
983c5c2c
PE
11042002-12-26 Paul Eggert <eggert@twinsun.com>
1105
b1efe548
PE
1106 * src/files.c: Include quote.h.
1107 (compute_output_file_names): Warn if we detect conflicting
1108 outputs to the same file. This should catch the misunderstanding
1109 exemplified by Debian Bug 165349, reported by Bruce Stephens..
1110
1111 * src/conflicts.c (conflicts_print): If the user specifies
1112 "%expect N", report an error if there are any reduce/reduce
1113 conflicts. This is what the manual says should happen.
1114 This fixes Debian bug 130890, reported by Anthony DeRobertis.
1115 * tests/conflicts.at (%expect with reduce conflicts): New test.
1116
983c5c2c
PE
1117 Don't use m4_include on relative file names, as it doesn't work as
1118 desired if there happens to be a file with that name under ".".
d600ee67 1119
983c5c2c
PE
1120 * m4sugar/version.m4: Remove; it was included but it wasn't used.
1121 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
1122 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
1123 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
1124 * src/output.c (output_skeleton): Use full path names when
1125 specifying a file to include; don't rely on include path, as
1126 it's unreliable when the working file contains a file with
1127 that name.
d600ee67 1128
983c5c2c
PE
11292002-12-25 Paul Eggert <eggert@twinsun.com>
1130
1131 Remove obsolete references to bison.simple and bison.hairy.
1132 Problem mentioned by Aubin Mahe in
e3aa65c5 1133 <http://mail.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
1134 * data/glr.c: Comment fix.
1135 * doc/bison.1: Remove references. Also, mention "yacc".
1136
1137 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
1138 with -g option.
1139
1140 * src/parse-gram.y (declaration): Use enum "report_states" rather
1141 than its numeric value 1.
1142
1143 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
1144 opening a new one. This fixes Debian bug 165349, reported by
1145 Bruce Stephens.
1146
23f2d9dc
PE
11472002-12-24 Paul Eggert <eggert@twinsun.com>
1148
1149 Version 1.75e.
1150
1151 * Makefile.maint (cvs-update): Don't assume that the shell
1152 supports $(...), as Solaris sh doesn't.
1153
1154 * src/parse-gram.y (lloc_default): Remove test for empty
1155 nonterminals at the end, since it didn't change the result.
1156
11572002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
1158
1159 If the user does not define YYSTYPE as a macro, Bison now declares it
1160 using typedef instead of defining it as a macro. POSIX requires this.
1161 For consistency, YYLTYPE is also declared instead of defined.
1162
1163 %union directives can now have a tag before the `{', e.g., the
1164 directive `%union foo {...}' now generates the C code
1165 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
1166 The default union tag is `YYSTYPE', for compatibility with Solaris 9
1167 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
1168 instead of `yyltype'.
1169
1170 `yystype' and `yyltype' are now obsolescent macros instead of being
1171 typedefs or tags; they are no longer documented and will be
1172 withdrawn in a future release.
1173
1174 * data/glr.c (b4_location_type): Remove.
1175 (YYSTYPE): Renamed from yystype.
1176 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
1177 (struct YYLTYPE): Renamed from struct yyltype.
1178 (YYLTYPE): Renamed from yyltype.
1179 (yyltype, yystype): New (and obsolescent) macros,
1180 for backward compatibility.
1181 * data/yacc.c: Likewise.
1182
1183 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
1184 does not specify a union tag. This is for compatibility with
1185 Solaris 9 yacc.
1186
1187 * src/parse-gram.y (add_param): 2nd arg is now char * not char
1188 const *, since it is now modified by stripping surrounding { }.
1189 (current_braced_code): Remove.
1190 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
1191 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
1192 trailing " {...}". Now of type <chars>.
1193 (grammar_declaration): Adjust to bundled tokens.
1194 (code_content): Remove; stripping is now done by add_param.
1195 (print_token_value): Print contents of bundled tokens.
1196 (token_name): New function.
1197
1198 * src/reader.h (braced_code, current_braced_code): Remove.
1199 (token_name): New decl.
1200
1201 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
1202 token_type, not braced_code code_kind. All uses changed.
1203 (SC_PRE_CODE): New state, for scanning after a keyword that
1204 has (or usually has) an immediately-following braced code.
1205 (token_type): New local var, to keep track of which token type
1206 to return when scanning braced code.
1207 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 1208 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
1209 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
1210 instead of returning a token type immediately.
1211 (<INITIAL>"{"): Set token type.
1212 (<SC_BRACED_CODE>"}"): Use it.
1213 (handle_action_dollar, handle_action_at): Now returns bool
1214 indicating success. Fail if ! current_rule; this prevents a core dump.
1215 (handle_symbol_code_dollar, handle_symbol_code_at):
1216 Remove; merge body into caller.
1217 (handle_dollar, handle_at): Complain in invalid contexts.
1218
1219 * NEWS, doc/bison.texinfo: Document the above.
1220 * NEWS: Fix years and program names in copyright notice.
1221
879ca4f8
PE
12222002-12-17 Paul Eggert <eggert@twinsun.com>
1223
1224 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
1225 Reporting, Table of Symbols): Omit mentions of %lex-param and
1226 %parse-param from the documentation for now.
1227
1c5fe69d
PE
12282002-12-15 Paul Eggert <eggert@twinsun.com>
1229
1230 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
1231 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
1232 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
1233 disagreed with the Bison documentation. Bug
1234 reported by Andrew Walrond.
d600ee67 1235
1c5fe69d
PE
1236 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
1237 as the caller now does that.
1238 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
1239 (YYEMPTY): Parenthesize right hand side, since others use it.
1240 (yyparse): Don't assume that our generated code is the only code
1241 that sets yychar.
1242
d1de5372
PE
12432002-12-13 Paul Eggert <eggert@twinsun.com>
1244
1245 Version 1.75d.
1246
1247 POSIX requires a "yacc" command.
1248 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
1249 (MOSTLYCLEANFILES): Add yacc.
1250 (yacc): New rule.
1c5fe69d 1251 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
1252 as an alias for bison y.
1253
1254 * po/LINGUAS: Add da.
d600ee67 1255
d1de5372
PE
1256 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
1257 problem with latest <getopt.h>.
1258 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
1259
1260 * doc/fdl.texi: Upgrade to 1.2.
1261 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
1262 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
1263 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
1264 gnulib.
1265 * config/install-sh: Sync with autotools.
1266
1267 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
e3aa65c5 1268 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
1269 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
1270 locations are requested.
1271 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
1272 locations are requested.
1273
d0f3fe23
PE
12742002-12-12 Paul Eggert <eggert@twinsun.com>
1275
1276 Remove unportable casts and storage allocation tricks.
1277 While we're at it, remove almost all casts, since they
1278 usually aren't needed and are a sign of trouble.
1279
1280 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
1281
1282 * src/derives.c (derives_compute): Do not subtract NTOKENS from
1283 the pointer DSET returned by malloc; this isn't portable.
1284 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
1285 Similarly for DERIVES.
1286 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
1287 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
1288 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
1289
1290 * src/derives.c (derives_compute): Do not bother invoking
1291 int_of_rule_number, since rule numbers are integers.
1292
1293 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
1294 rather than XMALLOC (char, N).
1295
1296 * src/files.c (filename_split): Rewrite to avoid cast.
1297
1298 * src/gram.h (symbol_number_as_item_number,
1299 item_number_as_symbol_number, rule_number_as_item_number,
1300 item_number_as_rule_number):
1301 Now inline functions rather than macros, to avoid casts.
1302 * src/state.h (state_number_as_int): Likewise.
1303 * src/tables.c (state_number_to_vector_number,
1304 symbol_number_to_vector_number): Likewise.
1305
1306 * src/gram.h (int_of_rule_number): Remove; no longer used.
1307
1308 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
1309 since the resulting storage is always stored into.
1310
1311 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
1312 where it's needed.
1313
1314 * src/muscle_tab.c (muscle_m4_output):
1315 Now inline. Return bool, not int.
1316 * src/state.c (state_compare): Likewise.
1317 * src/symtab.c (symbol_check_defined,
1318 symbol_check_alias_consistency, symbol_pack, symbol_translation,
1319 hash_compare_symbol, hash_symbol):
1320 Likewise.
1321 * src/uniqstr.c (uniqstr_print): Likewise.
1322 * src/muscle_tab.c (muscle_m4_output_processor):
1323 New function, to avoid casts.
1324 * src/state.c (state_comparator, stage_hasher): Likewise.
1325 * src/symtab.c (symbol_check_defined_processor,
1326 symbol_check_alias_consistency_processor, symbol_pack_processor,
1327 symbol_translation_processor, hash_symbol_comparator,
1328 hash_symbol_hasher): Likewise.
1329 * src/uniqstr.c (uniqstr_print_processor): Likewise.
1330 * src/muscle_tab.c (muscles_m4_output):
1331 Use new functions instead of casting old functions unportably.
1332 * src/state.c (state_hash_new): Likewise.
1333 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
1334 symbols_token_translations_init):
1335 Likewise.
1336 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
1337
1338 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
1339 var instead of casting to long, to avoid casts.
1340 (prepare_states): Use MALLOC rather than alloca, so that we don't
1341 have to worry about alloca.
1342 * src/state.c (state_hash_lookup): Likewise.
1343
1344 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
1345 local var instead of casting to unsigned char, to avoid casts.
1346
1347 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
1348 STATE_ALLOC): Remove.
1349 (transitions_new, errs_new, reductions_new, state_new): Use malloc
1350 rather than calloc, and use offsetof to avoid allocating slightly
1351 too much storage.
1352 (state_new): Initialize all members.
1353
1354 * src/state.c (state_hash): Use unsigned accumulator, not signed.
1355
1356 * src/symtab.c (symbol_free): Remove; unused.
1357 (symbol_get): Remove cast in lhs of assignment.
1358 (symbols_do): Now static. Accept generic arguments, not
1359 hashing-related ones.
1360
1361 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
1362 (symbol_processor): Remove.
1363 (symbols_do): Remove decl; now static.
1364
1365 * src/system.h (alloca): Remove; decl no longer needed.
1366 (<stddef.h>): Include, for offsetof.
1367 (<inttypes.>, <stdint.h>): Include if available.
1368 (uintptr_t): New type, if system lacks it.
1369 (CALLOC, MALLOC, REALLOC): New macros.
1370 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
1371 new macros.
1372
1373 * src/tables.c (table_size): Now int, to pacify GCC.
1374 (table_grow, table_ninf_remap): Use signed table size.
1375 (save_row): Don't bother initializing locals when not needed.
1376 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
1377 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
1378
1379 * src/vcg.h: Correct misspellings.
1380
1381 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
1382
1383
1384 * src/getargs.c (getargs): Don't assume EOF == -1.
1385
26b4a969
PE
13862002-12-09 Paul Eggert <eggert@twinsun.com>
1387
1388 Change identifier spellings to avoid collisions with names
1389 that are reserved by POSIX.
1390
1391 Don't use names ending in _t, since POSIX reserves them.
1392 For consistency, remove _e and _s endings -- they're weren't
1393 needed to remove ambiguity. All uses changed.
1394 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
1395 turn was just renamed from struniq_t.
1396 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
1397 which in turn was just renamed from struniq_processor_t.
1398 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
1399 in turn was renamed from hash_compare_struniq_t.
1400 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
1401 (state_list): Renamed from state_list_t.
1402 * src/assoc.h (assoc): Renamed from assoc_t.
1403 * src/conflicts.c (enum conflict_resolution): Renamed from
1404 enum conflict_resolution_e.
1405 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
1406 (rule_list): Renamed from rule_list_t.
1407 * src/getargs.h (enum trace): Renamed from enum trace_e.
1408 (enum report): Renamed from enum report_e.
1409 * src/gram.h (item_number): Renamed from item_number_t.
1410 (rule_number): Renamed from rule_number_t.
1411 (struct rule_s): Remove the "rule_s" part; not used.
1412 (rule): Renamed from rule_t.
1413 (rule_filter): Renamed from rule_filter_t.
1414 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
1415 (goto_list): Renamed from goto_list_t.
1416 * src/lalr.h (goto_number): Renamed from goto_number_t.
1417 * src/location.h (location): Renamed from location_t.
1418 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
1419 and moved here from:
1420 * src/muscle_tab.h (muscle_entry_t): here.
1421 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
1422 (rule_list): Renamed from rule_list_t.
1423 * src/print_graph.c (static_graph): Renamed from graph.
1424 * src/reader.h (braced_code): Renamed from braced_code_t.
1425 Remove brace_code_e tag.
1426 * src/relation.h (relation_node): Renamed from relation_node_t.
1427 (relation_nodes): Renamed from relation_nodes_t.
1428 (relation): Renamed from relation_t.
1429 * src/state.h (state_number): Renamed from state_number_t.
1430 (struct state): Renamed from struct state_s.
1431 (state): Renamed from state_t.
1432 (transitions): Renamed from transitions_t. Unused (and
1433 misspelled) transtion_s tag removed.
1434 (errs): Renamed from errs_t. Unused errs_s tag removed.
1435 (reductions): Renamed from reductions_t. Unused tag
1436 reductions_s removed.
1437 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
1438 (struct symbol_list): Renamed from struct symbol_list_s.
1439 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
1440 (struct symbol): Renamed from struct symbol_s.
1441 (symbol): Renamed from symbol_t.
1442 * src/tables.c (vector_number): Renamed from vector_number_t.
1443 (action_number): Renamed from action_t.
1444 * src/tables.h (base_number): Renamed from base_t.
1445 * src/vcg.h (enum color): Renamed from enum color_e.
1446 (enum textmode): Renamed from enum textmode_e.
1447 (enum shape): Renamed from enum shape_e.
1448 (struct colorentry): Renamed from struct colorentry_s.
1449 (struct classname): Renamed from struct classname_s.
1450 (struct infoname): Renamed from struct infoname_s.
1451 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
1452 (enum decision): Renamed from enum decision_e.
1453 (enum orientation): Renamed from enum orientation_e.
1454 (enum alignment): Renamed from enum alignment_e.
1455 (enum arrow_mode): Renamed from enum arrow_mode_e.
1456 (enum crossing_type): Renamed from enum crossing_type_e.
1457 (enum view): Renamed from enum view_e.
1458 (struct node): Renamed from struct node_s.
1459 (node): Renamed from node_t.
1460 (enum linestyle): Renamed from enum linestyle_e.
1461 (enum arrowstyle): Renamed from enum arrowstyle_e.
1462 (struct edge): Renamed from struct edge.
1463 (edge): Renamed from edge_t.
1464 (struct graph): Renamed from struct graph_s.
1465 (graph): Renamed from graph_t.
1466 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
1467 Rename value_t -> value.
1468 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
1469 value_t_as_yystype -> value_as_yystype.
1470
1471 Don't include <errno.h> in the mainstream code, since it
1472 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
1473 * lib/get-errno.c, lib/get-errno.h: New files.
1474 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
1475 get-errno.c.
1476 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
1477 * src/output.c (output_skeleton): Likewise.
1478 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
1479 instead of errno.
1480 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
1481 Likewise.
1482 (handle_action_dollar, handle_action_at): Likewise.
1483 * src/system.h: Do not include <errno.h>.
1484 (TAB_EXT): Renamed from EXT_TAB.
1485 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
1486
1487 Avoid str[a-z]*, since <string.h> reserves that name space.
1488 Change all instances of "struniq" in names to "uniqstr", and
1489 likewise for "STRUNIQ" and "UNIQSTR".
1490 * src/uniqstr.c: Renamed from src/struniq.c.
1491 * src/uniqstr.h: Renamed from src/struniq.h.
1492 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
1493 * src/files.c (strsuffix): Remove; unused.
1494 (concat2): Renamed from stringappend. Now static.
1495 * src/files.h (strsuffix, stringappend): Remove; unused.
1496 * src/parse-gram.y (<chars>): Renamed from <string>.
1497 (<uniqstr>): Renamed from <struniq>.
1498 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
1499 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
1500 (struct graph_s.expand): Renamed from struct graph_s.stretch.
1501 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
1502 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
1503 (N_EXPAND): Renamed from N_STRETCH.
1504
1505 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
1506 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
1507 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
1508 Remove; unused.
1509 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
1510 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
1511 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
1512 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
1513 (BASE_MAXIMUM): Renamed from BASE_MAX.
1514 (BASE_MINIMUM): Renamed from BASE_MIN.
1515 (ACTION_MAX): Remove; unused.
1516 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
1517 Unnecessary casts removed from above defines.
1518
1519
1520 Fix misspelling in names.
1521 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
1522 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
1523 G_NODE_ALIGNEMENT.
1524
1525
1526 * lib/timevar.c (timevar_report): Renamed from time_report,
1527 for consistency with other names.
1528 * lib/timevar.h (timevar_report): New decl.
1529 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
1530
1531
1532 Sort include-file uses.
1533
1534 Reorder all include files under src to be in the order "system.h".
1535 then the ../lib include files in angle brackets (alphabetized),
1536 then the . include files in double-quotes (alphabetized). Fix
1537 dependency breakages encountered in this process, as follows:
1538 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
1539 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
1540 * src/state.h: Include "symtab.h".
1541
996b1c7e
PE
15422002-12-08 Paul Eggert <eggert@twinsun.com>
1543
1544 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
1545 since this causes problems when __file__ contains character
1546 sequences like "@" that are treated specially by src/scan-skel.l.
1547 Instead, just use the file's basename. This fixes the bug
1548 reported by Martin Mokrejs in
e3aa65c5 1549 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 1550
e19c4e5d
PE
15512002-12-06 Paul Eggert <eggert@twinsun.com>
1552
1553 Add support for rules that do not have trailing semicolons, as
1554 POSIX requires. Improve the quality of locations in Bison
1555 diagnostics.
26b4a969 1556
e19c4e5d
PE
1557 * src/location.c: Include <quotearg.h>.
1558 (empty_location): Now const.
1559 (location_print): New function. Follow the recommendation of the
1560 GNU Coding Standards for locations that span file boundaries.
1561 * src/location.h: Do not include <quotearg.h>; no longer needed.
1562 (boundary): New type.
1563 (location_t): Use it. This allows locations to span file boundaries.
1564 All member uses changed: file -> start.file or end.file (as needed),
1565 first_line -> start.line, first_column -> start.column,
1566 last_line -> end.line, last_column -> end.column.
1567 (equal_boundaries): New function.
1568 (LOCATION_RESET, LOCATION_STEP): Remove.
1569 (LOCATION_PRINT): Remove. All callers changed to use location_print.
1570 (empty_location): Now const.
1571 (location_print): New decl.
1572 * src/parse-gram.y (lloc_default): New function, which handles
1573 empty locations more accurately.
1574 (YYLLOC_DEFAULT): Use it.
1575 (%token COLON): Remove.
1576 (%token ID_COLON): New token.
26b4a969 1577 (rules): Use it.
e19c4e5d
PE
1578 (declarations, rules): Remove trailing semicolon.
1579 (declaration, rules_or_grammar_declaration):
1580 Allow empty (";") declaration.
1581 (symbol_def): Remove empty actions; no longer needed.
1582 (rules_or_grammar_declaration): Remove trailing semicolon.
1583 (semi_colon.opt): Remove.
1584 * src/reader.h: Include location.h.
1585 (scanner_cursor): New decl.
1586 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
1587 rolling our own.
1588 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
1589 of *loc.
1590 (STEP): Remove. No longer needed, now that adjust_location does
1591 the work. All uses removed.
1592 (scanner_cursor): New var.
1593 (adjust_location): Renamed from extend_location. It now sets
1594 *loc and adjusts the scanner cursor. All uses changed.
1595 Don't bother testing for CR.
1596 (handle_syncline): Remove location arg; now updates scanner cursor.
1597 All callers changed.
1598 (unexpected_end_of_file): Now accepts start boundary of token or
1599 comment, not location. All callers changed. Update scanner cursor,
1600 not the location.
1601 (SC_AFTER_IDENTIFIER): New state.
1602 (context_state): Renamed from c_context. All uses changed.
1603 (id_loc, code_start, token_start): New local vars.
1604 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
1605 processing of Yacc white space and equivalents here.
1606 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
1607 instead of returning ID immediately, since we need to search for
1608 a subsequent colon.
1609 (<INITIAL>"'", "\""): Save token_start.
1610 (<INITIAL>"%{", "{", "%%"): Save code_start.
1611 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
1612 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
1613 BEGIN context_state at end, not INITIAL.
1614 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
1615 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
1616 Return correct token start.
1617 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
1618 the start of a character, string or multiline comment is found.
1619 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
1620 Reduction): Adjust reported locations to match the more-precise
1621 results now expected.
1622 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
1623 * tests/reduce.at (Useless Rules, Reduced Automaton,
1624 Underivable Rules): Likewise.
1625 * tests/regression.at (Invalid inputs): No longer `expecting ";"
1626 or "|"' now that so many other tokens are allowed by the new grammar.
1627
1628 * src/complain.h (current_file): Remove duplicate decl;
1629 current_file is now owned by files.h.
1630 * src/complain.c, src/scan-gram.l: Include files.h.
1631
16322002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 1633
e19c4e5d
PE
1634 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
1635 promotes to int; it might be unsigned int.
1636 * data/yacc.c (yy_reduce_print): Likewise.
1637
1638 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
1639 be #defined in the prologue, not in the Bison declarations.
1640 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 1641
b64755e3
PE
16422002-12-02 Paul Eggert <eggert@twinsun.com>
1643
1644 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
1645 * lib/strtoul.c: New file, from gnulib.
1646 This fixes a porting bug reported by Peter Klein in
e3aa65c5 1647 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 1648
6e746484
PE
16492002-11-30 Paul Eggert <eggert@twinsun.com>
1650
b64755e3
PE
1651 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
1652 and put only a forward declaration in the prologue. This is for
1653 consistency with the other scanner helper functions.
1654
6ba55592
PE
1655 Type clashes now generate warnings, not errors, since it
1656 appears that POSIX may allow some grammars with type clashes.
1657 * src/reader.c (grammar_current_rule_check): Warn about
1658 type clashes instead of complaining.
1659 * tests/input.at (Type Clashes): Expect warnings, not complaints.
1660
6e746484
PE
1661 Add Yacc library, since POSIX requires it.
1662 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
1663 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
1664 * lib/main.c, lib/yyerror.c: New files.
1665
1666 gram_error can be static; it need not be extern.
1667 * src/reader.h (gram_error): Remove decl.
1668 * src/parse-gram.y (gram_error): Now static. Add static decl.
1669 (print_token_value): Omit parameter names from forward decl,
1670 for consistency.
1671
88510f9c
PE
16722002-11-29 Paul Eggert <eggert@twinsun.com>
1673
6e746484
PE
1674 * doc/bison.texinfo: Emphasize that yylex and yyerror must
1675 be declared before being used. E.g., one should typically
1676 declare them in the prologue. Use GNU coding style in examples.
1677 Put "const" consistently after the type it modifies. Mention
1678 that C99 supports "inline". Mention that yyerror traditionally
1679 returns "int".
1680
88510f9c
PE
1681 %parse-param and %lex-param now take just one argument, the
1682 declaration; the argument name is deduced from the declaration.
1683
1684 * doc/bison.texinfo (Parser Function, Pure Calling, Error
1685 Reporting, Table of Symbols): Document this.
1686 * src/parse-gram.y (add_param): New function.
1687 (COMMA): Remove.
1688 (declaration): Implement new rule for %parse-param and %lex-param.
1689 * src/scan-gram.l: "," now elicits a warning, rather than being
1690 a token; this is more compatible with byacc.
1691 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
1692
bb92250c
PE
16932002-11-27 Paul Eggert <eggert@twinsun.com>
1694
1695 Rename identifiers to avoid real and potential collisions.
1696
1697 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
1698 to avoid collision with lex macro described by Bruce Lilly in
e3aa65c5 1699 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
1700 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
1701 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
1702 * src/parse-gram.y (print_token_value): Renamed from yyprint.
1703 All uses changed.
1704 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
1705 The name "yycontrol" violates the name space rules, and this stuff
1706 wasn't being used anyway.
1707 (input): Remove action; this stuff wasn't being used.
1708 (gram_error): Rename local variable yylloc -> loc.
1709 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
1710 (YY_DECL): Don't use "yy" at start of local variables.
1711 All uses changed, e.g., yylloc -> loc.
1712 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
1713 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
1714 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
1715 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
1716
1717 * src/parse-gram.y (gram_error): loc is now const *.
1718 * src/reader.h (gram_error): Likewise.
1719
3af4feb2
PE
17202002-11-24 Paul Eggert <eggert@twinsun.com>
1721
1722 Version 1.75c.
1723
1724 * tests/actions.at (Actions after errors): Use an output format
1725 more similar to that of the Printers and Destructors test.
1726 Test the position of the ';' token too.
1727 (Printers and Destructors): Likewise.
1728 (Printers and Destructors: %glr-parser): Remove for now, to avoid
1729 unnecessarily alarming people when the test fails.
1730
1731 * data/yacc.c (yyerrlab1): Move this label down, so that the
1732 parser does not discard the lookahead token if the user code
1733 invokes YYERROR. This change is required for POSIX conformance.
1734
1735 * lib/error.c: Sync with gnulib.
1736
17372002-11-22 Paul Eggert <eggert@twinsun.com>
1738
1739 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
1740 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
1741 * lib/xmalloc.c: Likewise.
26b4a969 1742
58004308
PE
17432002-11-20 Paul Eggert <eggert@twinsun.com>
1744
1745 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
1746
17472002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 1748
58004308
PE
1749 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
1750 should use `if (! x) abort ();' rather than `assert (x);', and
1751 anyway it's one less thing to worry about configuring.
1752
1753 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
1754 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
1755 and replace all instances of assert with abort.
1756 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
1757 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
1758
1759 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
1760 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
1761 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
1762 hash_find_entry, hash_rehash, hash_insert): Likewise.
1763 * src/conflicts.c (resolve_sr_conflict): Likewise.
1764 * src/lalr.c (set_goto_map, map_goto): Likewise.
1765 * src/nullable.c (nullable_compute): Likewise.
1766 * src/output.c (prepare_rules, token_definitions_output): Likewise.
1767 * src/reader.c (packgram, reader): Likewise.
1768 * src/state.c (state_new, state_free, state_transitions_set,
1769 state_reduction_find): Likewise.
1770 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
1771 symbol_pack): Likewise.
1772 * src/tables.c (conflict_row, pack_vector): Likewise.
1773 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
1774 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
1775 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
1776 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
1777
1778 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
1779 (ARGMATCH_CONSTRAINT): New macro.
1780 (ARGMATCH_ASSERT): Use it.
1781
1782 * src/system.h (verify): New macro.
1783 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
1784 rather than assert.
1785 * src/tables.c (tables_generate): Likewise.
1786
1787 * src/struniq.c (struniq_assert): Now returns void, and aborts
1788 if the assertion is false.
1789 (struniq_assert_p): Remove.
1790 * src/struniq.h: Likewise.
1791
76ae8198
PE
17922002-11-18 Paul Eggert <eggert@twinsun.com>
1793
1794 * data/glr.c (yygetLRActions): Replace `yyindex' with
1795 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
1796 This fixes the regression with Sun ONE Studio 7 cc that I reported in
e3aa65c5 1797 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 1798
d3c4e709
AD
17992002-11-18 Akim Demaille <akim@epita.fr>
1800
1801 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
1802 space.
1803 From Tim Van Holder.
1804
8d8a7238
PE
18052002-11-17 Paul Eggert <eggert@twinsun.com>
1806
1807 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
1808 to "SyntaxError" for consistency with my 2002-11-15 change.
1809
1810 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
1811 not define to {}, since this breaks the common use of `YYDPRINTF
1812 ((...));' if a single statement is desired (e.g. before `else').
1813 Work around GCC warnings by surrounding corresponding calls with
1814 {} if needed.
1815 (yyhasResolvedValue): Remove unused function.
1816 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
1817 loop body.
1818 (yyreportSyntaxError): Renamed from yyreportParseError.
1819 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
1820 All uses changed.
1821 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
1822 extern when possible. Remove unused initializations.
1823
b0937b22
AD
18242002-11-16 Akim Demaille <akim@epita.fr>
1825
1826 Augment the similarity between GLR and LALR traces.
1827
1828 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
1829 (YY_REDUCE_PRINT): New.
1830 (yyparse): Use them.
1831 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
1832 YYDPRINT here.
1833 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
1834 state reached after the reduction/recovery, since...
1835 (yyparse, yyprocessOneStack): Report the state we are entering in.
1836
c5e3e510
AD
18372002-11-16 Akim Demaille <akim@epita.fr>
1838
1839 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
1840 Add support for --trace=skeleton.
1841 * src/scan-skel.l: %option debug.
1842 Scan strings of non-@ or \n instead of character by character.
1843 (scan_skel): Handle trace_skeleton.
1844 (QPUTS): New.
1845 (@output_parser_name@, @output_header_name@): ``Restore'' their
1846 support (used to be M4 macros).
1847 * data/yacc.c: Quote larger chunks, a la glr.c.
1848 * data/lalr1.cc: Likewise.
1849 The header guards are no longer available, so use some other
1850 string than `YYLSP_NEEDED'.
1851
4c6cc1db
AD
18522002-11-16 Akim Demaille <akim@epita.fr>
1853
1854 Make the ``Printers and Destructors'' test more verbose, taking
1855 `yacc.c''s behavior as (possibly wrong) reference.
1856
1857 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
1858 instead of fprint on stdout.
1859 Set and report the last_line of the symbols.
1860 Consistently display values and locations.
1861
6d9e8019
PE
18622002-11-16 Paul Eggert <eggert@twinsun.com>
1863
1864 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
1865
6e649e65
PE
18662002-11-15 Paul Eggert <eggert@twinsun.com>
1867
b25d88f6
PE
1868 * tests/actions.at (Actions after errors): New test case.
1869
6e649e65
PE
1870 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
1871 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
1872 tests/action.at, tests/calc.at, tests/conflicts.at,
1873 tests/cxx-type.at, tests/regression.at:
1874 "parse error" -> "syntax error" for POSIX compatibility.
1875 "parsing stack overflow..." -> "parser stack overflow" so
1876 that code matches Bison documentation.
1877
0f39aab9
AD
18782002-11-15 Akim Demaille <akim@epita.fr>
1879
1880 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
1881 take two BRACED_CODE, not two string_content.
1882 Free the scanner's obstack when we are done.
1883 (code_content): New.
1884 * tests/calc.at: Adjust.
1885 * doc/bison.texinfo: Adjust.
1886 Also, make sure to include the `,' for these declarations.
1887
761c1926
AD
18882002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
1889
1890 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
1891 definition; avoids potential autoreconf problems.
1892
b0f98b10
AD
18932002-11-15 Akim Demaille <akim@epita.fr>
1894
1895 Always check the value returned by yyparse.
1896
1897 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
1898 returned by yyparse.
1899 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
1900 Adjust calls.
1901 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
1902 returned by yyparse.
1903
970785f1
PH
19042002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1905
1906 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
1907 on input.at test.
1908
8fcc7db1
PE
19092002-11-14 Paul Eggert <eggert@twinsun.com>
1910
7ec1b48e
PE
1911 * src/output.c (output_skeleton): Call xfopen instead of
1912 duplicating xfopen's body.
1913
cfff7583 1914 Fix bugs reported by Nelson H. F. Beebe in
e3aa65c5 1915 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 1916
8fcc7db1
PE
1917 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
1918 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
1919 Group compiler. Instead, use "$CC -E bar.c". Include the .h
1920 file twice in the grammar, as an extra check.
1921
1922 * tests/input.at (Torturing the Scanner): Surround the
1923 backslash-newline tests with "#if 0", to make it less likely that
1924 we'll run into compiler bugs. Bring back solitary \ inside
1925 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 1926 test backslash-newline in C character constant.
8fcc7db1 1927
4e8d992c
AD
19282002-11-14 Akim Demaille <akim@epita.fr>
1929
1930 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
1931 status of the compiler.
f32b346d 1932 Calling `exit 1' is no longer needed.
4e8d992c
AD
1933 Reported by Nelson H. F. Beebe.
1934
9501dc6e
AD
19352002-11-14 Akim Demaille <akim@epita.fr>
1936
1937 * tests/atlocal.in (CPPFLAGS): We have config.h.
1938 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
1939 New.
1940 * tests/actions.at, tests/calc.at, tests/conflicts.at,
1941 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
1942 * tests/regression.at, tests/torture.at: Use them for all the
1943 grammars that are to be compiled.
1944 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
1945 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
1946 * doc/bison.texinfo (GLR Parsers): Document `inline'.
1947
18b519c0
AD
19482002-11-14 Akim Demaille <akim@epita.fr>
1949
1950 * doc/bison.texinfo: Various formatting changes (alignments in
1951 samples, additional @group/@end group, GCS in samples.
1952 Use @deffn instead of simple @table to define the directives,
1953 macros, variables etc.
1954
9a86cdb9
PE
19552002-11-13 Paul Eggert <eggert@twinsun.com>
1956
daa33def 1957 Fix some bugs reported by Albert Chin-A-Young in
e3aa65c5 1958 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 1959
daa33def 1960 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 1961 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
1962 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
1963 * tests/headers.at (export YYLTYPE): Likewise.
1964
1965 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 1966 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 1967
9a86cdb9
PE
1968 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
1969 comments, since they're not portable. Use GNU coding style.
1970
9c1e26bd
AD
19712002-11-13 Akim Demaille <akim@epita.fr>
1972
1973 * data/yacc.c: Leave bigger chunks of quoted text.
1974 (YYDSYMPRINTF): New.
1975 Use it to report symbol activities.
1976 * data/glr.c (YYDSYMPRINTF): New.
1977 Use it.
1978
87f721cc
PE
19792002-11-12 Paul Eggert <eggert@twinsun.com>
1980
1981 Version 1.75b.
1982
1983 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
1984 (yyglrReduce): Return yyok, not 0.
1985 This should avoid the enumerated-type warnings reported
464c6927 1986 by Nelson H. F. Beebe in
e3aa65c5 1987 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
1988
1989 * lib/bbitset.h (BITSET_INLINE): Remove.
1990 * lib/bitset.h [! BITSET_INLINE]: Remove.
1991 (bitset_set, bitset_reset, bitset_test): Rename local vars
1992 to avoid shadowing warnings by GCC.
1993
1994 * data/glr.c (inline): Remove #define. It's the user's
1995 responsibility to #define it away, just like 'const'.
464c6927 1996 This fixes one of the bugs reported by Nelson H. F. Beebe in
e3aa65c5 1997 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 1998
87f721cc
PE
1999 * Makefile.maint (po-check): Scan .l and .y files instead of the
2000 .c and the .h files that they generate. This fixes the bug
2001 reported by Tim Van Holder in:
e3aa65c5 2002 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
2003 Look for N_ as well as for _. Try to avoid matching #define for
2004 N_ and _.
2005 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
2006 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
2007 * src/scan-gram.l: Revamp regular expressions so that " and '
2008 do not confuse xgettext.
2009
2010 * src/struniq.h (struniq_new): Do not declare the return type
2011 to be 'const'; this violates the C standard.
2012 * src/struniq.c (struniq_new): Likewise.
2013
be14ade5
AD
20142002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
2015
2016 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
2017 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
2018 linker.
2019
05291fbc
AD
20202002-11-12 Akim Demaille <akim@epita.fr>
2021
2022 * Makefile.maint: Sync with Autoconf:
2023 (local_updates): New.
2024
1f5fd52e
AD
20252002-11-12 Akim Demaille <akim@epita.fr>
2026
2027 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
2028
283f1e64
AD
20292002-11-12 Akim Demaille <akim@epita.fr>
2030
2031 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
2032 locations.
2033
886b69d1
AD
20342002-11-12 Akim Demaille <akim@epita.fr>
2035
2036 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
2037 not yyvalue.
2038
3df37415
AD
20392002-11-12 Akim Demaille <akim@epita.fr>
2040
2041 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
2042 Use it to test the GLR parser.
2043
7bd6c77e
AD
20442002-11-12 Akim Demaille <akim@epita.fr>
2045
2046 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
2047 defines it.
2048 * data/glr.c (yystos): New.
2049 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
2050 (YYDSYMPRINT): New.
2051 (yyval): Don't define it, it is handled via M4.
2052 (yyrecoverParseError): Free verbosely the discarded symbols.
2053 * data/yacc.c (yysymprint): Remove, rather...
2054 (b4_yysymprint_generate): invoke.
2055 * data/c.m4 (b4_yysymprint_generate): New.
2056 Accept pointers as arguments, as opposed to the version from
2057 yacc.c.
2058 (b4_yydestruct_generate): Likewise.
2059 * tests/cations.at (Printers and Destructors): Use Bison directives
2060 instead of CPP macros.
2061 Don't rely on internal details.
2062
b0400cc6
AD
20632002-11-12 Akim Demaille <akim@epita.fr>
2064
2065 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
2066 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
2067 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
2068 it against YYEMPTY and so forth), work on yytoken (i.e., set
2069 it to YYEMPTY etc.).
2070 (yydestruct): Replace with a b4_yydestruct_generate invocation.
2071 (b4_symbol_actions): Remove.
2072 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
2073 for 0, end-of-input.
2074
72f889cc
AD
20752002-11-12 Akim Demaille <akim@epita.fr>
2076
2077 * doc/bison.texinfo (Destructor Decl): New.
2078
b1ae9233
AD
20792002-11-12 Akim Demaille <akim@epita.fr>
2080
2081 * src/tables.c (tables_generate): Use free for pointers that
2082 cannot be NULL, not XFREE.
2083 (pack_vector): Use assert, not fatal, for bound violations.
2084 * src/state.c (state_new): Likewise.
2085 * src/reader.c (reader): Likewise.
2086 * src/lalr.c (set_goto_map): Likewise.
72f889cc 2087 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
2088 the file name.
2089
7ec2d4cd
AD
20902002-11-12 Akim Demaille <akim@epita.fr>
2091
2092 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
2093 Restore.
2094 * src/scan-gram.l (last_string): Is global to the file, not to
2095 yylex.
2096 * src/parse-gram.y (input): Don't append the epilogue here,
2097 (epilogue.opt): do it here, and free the scanner's obstack.
2098 * src/reader.c (epilogue_set): Rename as...
2099 (epilogue_augment): this.
2100 * data/c.m4 (b4_epilogue): Defaults to empty.
2101
573a6cd3
AD
21022002-11-12 Akim Demaille <akim@epita.fr>
2103
2104 * src/getargs.c (long_options): Remove duplicates.
2105 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
2106 Remove.
2107 * doc/bison.rnh: Remove.
2108 * doc/bison.texinfo (VMS Invocation): Remove.
2109
95612cfa
AD
21102002-11-12 Akim Demaille <akim@epita.fr>
2111
2112 * src/struniq.h, src/struniq.c (struniq_t): Is const.
2113 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
2114
2115 Use struniq for symbols.
2116
2117 * src/symtab.h (symbol_t): The tag member is a struniq.
2118 (symbol_type_set): Adjust.
2119 * src/symtab.c (symbol_new): Takes a struniq.
2120 (symbol_free): Don't free the tag member.
2121 (hash_compare_symbol_t, hash_symbol_t): Rename as...
2122 (hash_compare_symbol, hash_symbol): these.
2123 Use the fact that tags as struniqs.
2124 (symbol_get): Use struniq_new.
2125 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
2126 Returns a strniq.
2127 * src/reader.h (merger_list, grammar_currentmerge_set): The name
2128 and type members are struniqs.
2129 * src/reader.c (get_merge_function)
2130 (grammar_current_rule_merge_set): Adjust.
2131 (TYPE, current_type): Are struniq.
2132
2133 Use struniq for file names.
2134
2135 * src/files.h, src/files.c (infile): Split into...
2136 (grammar_file, current_file): these.
2137 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
2138 * src/reduce.c (reduce_print): Likewise.
2139 * src/getargs.c (getargs): Likewise.
2140 * src/complain.h, src/complain.c: Likewise.
2141 * src/main.c (main): Call struniqs_new early enough to use it for
2142 file names.
2143 Don't free the input file name.
2144
3e6656f9
AD
21452002-11-12 Akim Demaille <akim@epita.fr>
2146
2147 * src/symtab.c (symbol_free): Remove dead deactivated code:
2148 type_name are properly removed.
2149 Don't use XFREE to free items that cannot be NULL.
2150 * src/struniq.h, src/struniq.c: New.
2151 * src/main.c (main): Initialize/free struniqs.
2152 * src/parse-gram.y (%union): Add astruniq member.
2153 (yyprint): Adjust.
2154 * src/scan-gram.l (<{tag}>): Return a struniq.
2155 Free the obstack bit that used to store it.
2156 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
2157
7672019c
PE
21582002-11-11 Paul Eggert <eggert@twinsun.com>
2159
2160 Revamp to fix many (but not all) of the C- and M4-related quoting
2161 problems. Among other things, this fixes the Bison bug reported
2162 by Jan Hubicka when processing the Bash grammar; see:
e3aa65c5 2163 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
2164
2165 Use new @ escapes consistently. Represent brackets with @{ and @}
2166 rather than @<:@ and @:>@, since this works a bit better with dumb
2167 editors like vi. Represent @ with @@, since @ is now consistently
2168 an escape. Use @oline@ and @ofile@ rather than __oline__ and
2169 __ofile__, to avoid unexpected expansions. Similarly, use @output
2170 rather than #output.
2171
2172 * data/c.m4 (b4_copyright): Omit file name from comment, since
2173 the file name could contain "*/".
2174 (b4_synclines_flag): Don't quote the 2nd argument; it should already
2175 be quoted. All uses changed.
2176
2177 * data/glr.c: Use new @ escapes consistently.
2178 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
2179 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
2180 Remove, since they couldn't handle arbitrary characters in file
2181 names.
2182 * data/lalr1.cc: Likewise.
2183 * data/yacc.c: Likewise.
2184
2185 * src/files.c (output_infix): Remove; all uses removed.
2186 * src/files.h: Likewise.
2187
2188 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
2189 mishandled funny characters in file names, and anyway it isn't
2190 needed any more.
2191 * data/yacc.c: Likewise.
2192 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
2193
2194 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
2195 * data/yacc.c: Likewise.
2196
2197 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
2198 strings now.
2199 (muscle_init): Quote filename as a C string.
2200 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
2201 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
2202 * src/output.c (escaped_file_name_output): New function.
2203 (prepare_symbols): Quote tokens for M4.
2204 (prepare): Don't insert output_infix, output_prefix,
2205 output_parser_name, output_header_name; this is now down by scan-skel.
2206 Insert skeleton as a C string.
2207
2208 * src/output.c (user_actions_output, symbol_destructors_output,
2209 symbol_printers_output): Quote filenames for C and M4.
2210 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2211
2212 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
2213 escapes other than \\ and \'; this simplifies the code.
2214 (<SC_STRING>): Likewise, for \\ and \".
2215 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
2216 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
2217 Use new escapes @{ and @} for [ and ].
2218
2219 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
2220 them with auto vars.
2221 Switch to new escape scheme, where @ is the escape character uniformly.
2222 Abort if a stray escape character is found. Avoid unbounded input
2223 buffer when parsing non-escaped text.
2224
2225 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
2226 __oline__, #output, $@, and @{ do not have unintended meanings.
2227
acea4f3b
PE
22282002-11-09 Paul Eggert <eggert@twinsun.com>
2229
2230 Fix the test failure due to GCC warnings described in
e3aa65c5 2231 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
2232 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
2233 evaluate to 0 if it's impossible for NINF to be in the respective
2234 table.
2235 (yygetLRActions, yyrecoverParseError): Use them.
2236
2237 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
2238 counted in the token inserted at end of file. Now takes
2239 location_t *, not location_t, so that the location can be
2240 adjusted. All uses changed.
2241
2242 * tests/regression.at (Invalid inputs): Adjust wording in
2243 diagnostic to match the new behavior.
2244
2245 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
2246 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
2247 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
2248 abort ();'. This reduces the runtime of the "Many lookaheads"
2249 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
2250 GCC 3.2.
2251
20ef1ad5
PE
22522002-11-07 Paul Eggert <eggert@twinsun.com>
2253
2254 * src/parse-gram.y (CHARACTER): Remove unused token.
2255 All uses removed.
2256
2257 * src/scan-gram.l: Remove stack option. We no longer use the
2258 stack, since the stack was never deeper than 1; instead, use the
2259 new auto var c_context to record the stacked value.
2260
2261 Remove nounput option. At an unexpected end of file, we now unput
2262 the minimal input necessary to end cleanly; this simplifies the
2263 code.
2264
2265 Avoid unbounded token sizes where this is easy.
2266
2267 (unexpected_end_of_file): New function.
2268 Use it to systematize the error message on unexpected EOF.
2269 (last-string): Now auto, not static.
2270 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
2271 (scanner_last_string_free): Remove; not used.
2272 (percent_percent_count): Move decl to just before use.
2273 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
2274 not the (never otherwised-used) CHARACTER.
2275
93724f13
AD
22762002-11-07 Akim Demaille <akim@epita.fr>
2277
2278 Let yyerror always receive the msg as last argument, so that
2279 yyerror can be variadic.
2280
2281 * data/yacc.c (b4_yyerror_args): New.
2282 Use it when calling yyerror.
2283 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
2284 Use it when calling yyerror.
2285 * doc/bison.texinfo (Error Reporting): Adjust.
2286 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
2287 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
2288
6e40b4eb
AD
22892002-11-06 Akim Demaille <akim@epita.fr>
2290
2291 #line should have quoted strings.
2292 Ideally, this should be done by m4_quotearg.
2293
2294 * src/scan-skel.l: Include quotearg.h.
2295 Quote __ofile__.
2296 * src/output.c (symbol_printers_output)
2297 (symbol_destructors_output): Quote the file name.
2298
2dfbfc12
AD
22992002-11-06 Akim Demaille <akim@epita.fr>
2300
2301 * tests/regression.at (Invalid inputs): Adjust to the recent
2302 messages.
2303
437c2d80
AD
23042002-11-06 Akim Demaille <akim@epita.fr>
2305
2306 Restore --no-lines.
2307 Reported by Jim Kent.
2308
2309 * data/c.m4 (b4_syncline): New.
2310 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
2311 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
2312 * src/output.c (user_actions_output): Likewise.
2313 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 2314 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 2315
900c5db5
AD
23162002-11-06 Akim Demaille <akim@epita.fr>
2317
2318 * src/main.c (main): Free `infile'.
2319 * src/scan-gram.l (handle_syncline): New.
2320 Recognize `#line'.
2321 * src/output.c (user_actions_output, symbol_destructors_output)
2322 (symbol_printers_output): Use the location's file name, not
2323 infile.
2324 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2325
e183b123 23262002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 2327
e183b123 2328 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 2329 either has GLR conflict entries.
e183b123 2330
193eb6b7
PE
23312002-11-05 Paul Eggert <eggert@twinsun.com>
2332
e183b123
PE
2333 * src/scan-gram.l: Use more accurate diagnostics, e.g.
2334 "integer out of range" rather than "invalid value".
2335 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
2336 accordingly.
2337
193eb6b7
PE
2338 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
2339 Also, remove one static variable in the scanner.
2340
2341 * src/scan-gram.l (braces_level): Now auto, not static.
2342 Initialize to zero if the compiler is being picky.
2343 (INITIAL): Clear braces_level instead of incrementing it.
2344 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
2345 as POSIX 1003.1-2001 requires.
2346 * src/system.h (IF_LINT): New macro, taken from coreutils.
2347 * configure.ac: Define "lint" if --enable-gcc-warnings.
2348
29c01725
AD
23492002-11-05 Akim Demaille <akim@epita.fr>
2350
2351 * src/scan-gram.l: When it starts with `%', complain about the
2352 whole directive, not just that `invalid character: %'.
2353
8aeac3ca
AD
23542002-11-04 Akim Demaille <akim@epita.fr>
2355
2356 * Makefile.maint: Update from Autoconf.
2357 (update, cvs-update, po-update, do-po-update): New.
2358
793a58bb
AD
23592002-11-04 Akim Demaille <akim@epita.fr>
2360
2361 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
2362 and yyerror.
2363 Have yyerror `use' its arguments.
2364 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
2365 returns true when location & yacc & pure & parse-param.
2366 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
2367
c4d720cd
AD
23682002-11-04 Akim Demaille <akim@epita.fr>
2369
2370 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
2371 clashes.
2372 * src/scan-gram.l: Use [\'] instead of ['] to pacify
2373 font-lock-mode.
2374 Use complain_at.
2375 Use quote, not quote_n since LOCATION_PRINT no longer uses the
2376 slot 0.
2377
613a0dc5
PE
23782002-11-03 Paul Eggert <eggert@twinsun.com>
2379
2380 * src/reader.c (get_merge_function, grammar_current_rule_check):
2381 Use consistent diagnostics for reporting type name clashes.
2382 Quote the types with <>, for consistency with Yacc.
2383 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
2384
2a8d363a
AD
23852002-11-03 Akim Demaille <akim@epita.fr>
2386
2387 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
2388 New.
2389 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
2390 (b4_parse_param): Remove.
2391 Use b4_identification.
2392 Propagate b4_pure_args where needed to pass them to yyerror.
2393 * data/glr.m4 (b4_parse_param): Remove.
2394 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
2395 (b4_lpure_formals): New.
2396 Use b4_identification.
2397 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
2398 b4_user_formals and b4_user_args.
2399 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
2400 (yyreportAmbiguity): When using a pure parser, also need
2401 the location, and the parse-params.
2402 Adjust callers.
2403 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
2404 When using a pure parser, also need the parse-params.
2405 Adjust callers.
2406 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
2407 (%pure-parser + %parse-param) LALR and GLR parsers.
2408 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
2409 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
2410 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
2411 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
2412 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
2413 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
2414 * doc/bison.texinfo: Untabify the whole file.
2415 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
2416 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
2417 (Error Reporting): Adjust to these new directives.
2418 Document %error-verbose, deprecate YYERROR_VERBOSE.
2419
9e32add8
AD
24202002-11-03 Akim Demaille <akim@epita.fr>
2421
2422 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
2423 AT_CHECK_CALC_GLR invocations to use % directives, instead of
2424 command line options.
2425 * tests/cxx-type.at: Formatting changes.
2426
b02d90a5
PE
24272002-11-03 Paul Eggert <eggert@twinsun.com>
2428
2429 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
2430 to count columns correctly, and to check for invalid inputs.
9e32add8 2431
b02d90a5
PE
2432 Use mbsnwidth to count columns correctly. Account for tabs, too.
2433 Include mbswidth.h.
2434 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
2435 (extend_location): New function.
2436 (YY_LINES): Remove.
2437
2438 Handle CRLF in C code rather than in Lex code.
2439 (YY_INPUT): New macro.
2440 (no_cr_read): New function.
2441
2442 Scan UCNs, even though we don't fully handle them yet.
2443 (convert_ucn_to_byte): New function.
2444
2445 Handle backslash-newline correctly in C code.
2446 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
2447 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
2448 all uses changed.
2449 (tag, splice): New EREs. Do not allow NUL or newline in tags.
2450 Use {splice} wherever C allows backslash-newline.
2451 YY_STEP after space, newline, vertical-tab.
2452 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 2453
b02d90a5
PE
2454 (letter, id): Don't assume ASCII; e.g., spell out a-z.
2455
2456 ({int}, handle_action_dollar, handle_action_at): Check for integer
2457 overflow.
9e32add8 2458
b02d90a5
PE
2459 (YY_STEP): Omit trailing semicolon, so that it's more like C.
2460
2461 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
2462 as well as \000. Check for UCHAR_MAX, not 255.
2463 Allow \x with an arbitrary positive number of digits, as in C.
2464 Check for overflow here.
2465 Allow \? and UCNs, for compatibility with C.
2466
2467 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
2468 with quote slot used by complain_at.
2469
2470 * tests/input.at: Add tests for backslash-newline, m4 quotes
2471 in symbols, long literals, and funny escapes in strings.
2472
2473 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
2474 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
2475 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
2476 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
2477 * m4/mbswidth.m4: New file, from GNU coreutils.
2478
2479 * doc/bison.texinfo (Grammar Outline): Document // comments.
2480 (Symbols): Document that trigraphs have no special meaning in Bison,
2481 nor is backslash-newline allowed.
2482 (Actions): Document that trigraphs have no special meaning.
2483
2484 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
2485 no longer used.
2486
24872002-11-02 Paul Eggert <eggert@twinsun.com>
2488
2489 * src/reader.c: Don't include quote.h; not needed.
2490 (get_merge_function): Reword warning to be consistent with
2491 type clash diagnostic in grammar_current_rule_check.
2492
2493 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
2494 bug in trigraph handling.
2495
2496 * src/output.c (prepare_symbols): When printing token names,
2497 escape "[" as "@<:@" and likewise for "]".
2498
2499 * src/system.h (errno): Remove declaration, as we are now
2500 assuming C89 or better, and C89 guarantees errno.
2501
762b212b
PE
25022002-10-30 Paul Eggert <eggert@twinsun.com>
2503
2504 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
2505 Check for close failures.
2506 * src/files.h (xfclose): Return void, not int, since it always
2507 returned zero.
2508 * src/files.c (xfclose): Likewise. Report I/O error if ferror
2509 indicates one.
2510 * src/output.c (output_skeleton): Use xfclose rather than fclose
2511 and ferror. xfclose now checks ferror.
2512
2513 * data/glr.c (YYLEFTMOST_STATE): Remove.
2514 (yyreportTree): Use a stack-based leftmost state. This avoids
2515 our continuing battles with bogus warnings about initializers.
2516
56100c60
AD
25172002-10-30 Akim Demaille <akim@epita.fr>
2518
2519 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
2520 #if.
2521
51b4a04c
PH
25222002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2523
2524 * tests/glr-regr1.at: New test for reported regressions.
2525 * tests/testsuite.at: Add glr-regr1.at test.
2526 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 2527
bf1ebda2
PE
25282002-10-24 Paul Eggert <eggert@twinsun.com>
2529
5c16c6b1
PE
2530 Version 1.75a.
2531
bf1ebda2
PE
2532 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
2533 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
2534 we use malloc. Don't assume 'A' through 'Z' are contiguous.
2535 Don't assume strdup exists; POSIX says its an XSI extension.
2536 Check for buffer overflow on input.
2537
b526ee61
AD
25382002-10-24 Akim Demaille <akim@epita.fr>
2539
2540 * src/output.c (output_skeleton): Don't disable M4sugar comments
2541 too soon: it results in comments being expanded.
2542 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
2543 first output.
2544
f1886bb2
AD
25452002-10-24 Akim Demaille <akim@epita.fr>
2546
2547 * data/yacc.c (m4_int_type): New.
2548 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
2549 char' as only yacc.c wants K&R portability.
2550 * data/glr.c (yysigned_char): Remove.
2551 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
2552 Reported by Quoc Peyrot.
2553
c5576256
PE
25542002-10-23 Paul Eggert <eggert@twinsun.com>
2555
2556 * src/main.c (main): With --trace=time, report times even if a
2557 non-fatal error occurs. Formerly, the times were reported in some
2558 such cases but not in others.
2559 * src/reader.c (reader): Just return if a complaint has been issued,
2560 instead of exiting, so that 'main' can report times.
2561
27b0ffea
AD
25622002-10-22 Akim Demaille <akim@epita.fr>
2563
2564 * src/system.h: Include sys/types.
2565 Reported by Bert Deknuydt.
2566
223a7883
PE
25672002-10-23 Paul Eggert <eggert@twinsun.com>
2568
2569 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
2570 Suggested by Art Haas.
2571
25722002-10-22 Paul Eggert <eggert@twinsun.com>
2573
2574 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
2575 decl; not needed any more.
2576 * src/main.c (main): Use return to exit, undoing yesterday's change.
2577 The last OS that we could find where this wouldn't work is
2578 SunOS 3.5, and that's too old to worry about now.
2579
2580 * data/glr.c (struct yyltype): Define members even when not
2581 doing locations. This is more consistent with yacc.c, and it
2582 works around the following bug reports:
e3aa65c5
PE
2583 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
2584 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 2585
223a7883
PE
2586 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
2587 @acronym consistently. Standardize on "Yacc" instead of "YACC",
2588 "Algol" instead of "ALGOL". Give a bit more history about BNF.
2589
8b76775a
AD
25902002-10-22 Akim Demaille <akim@epita.fr>
2591
2592 * data/README: New.
2593
6db10d14
PE
25942002-10-21 Paul Eggert <eggert@twinsun.com>
2595
2596 Be consistent about 'bool'; the old code used an enum in one
2597 module and an int in another, and this violates the C standard.
2598 * m4/stdbool.m4: New file, from coreutils 4.5.3.
2599 * configure.ac (AC_HEADER_STDBOOL): Add.
2600 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
2601 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
2602 * src/symtab.c (hash_compare_symbol_t): Likewise.
2603 * src/system.h (bool, false, true): Use a definition consistent
2604 with ../lib/hash.c. All uses changed.
2605
2606 * src/complain.c (warning_issued): Renamed from warn_message_count,
2607 so that we needn't worry about integer overflow (!).
2608 Now of type bool. All uses changed.
2609 (complaint_issued): Renamed from complain_message_count; likewise.
2610
2611 * src/main.c (main): Use exit to exit with failure.
27b0ffea 2612
6db10d14
PE
2613 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
2614 rather than 1 and 0.
2615 * src/main.c (main): Likewise.
2616 * src/getargs.c (getargs): Likewise.
2617 * src/reader.c (reader): Likewise.
2618
2619 * src/getarg.c (getargs): Remove duplicate code for
2620 "Try `bison --help'".
2621
2622 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
2623 What was that "2" for?
2624
2625 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
2626 * src/getargs.c (usage): Likewise.
2627
2628 * src/getargs.c (getargs): When there are too few operands, report
2629 the last one. When there are too many, report the first extra
2630 one. This is how diffutils does it.
2631
92a060fd
PE
26322002-10-20 Paul Eggert <eggert@twinsun.com>
2633
2634 Remove K&R vestiges.
2635 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
2636 * src/complain.c (VA_START): Remove. Assume prototypes.
2637 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
2638 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
2639 fatal): Assume prototypes.
2640 * src/complain.h: Assume prototypes.
2641 * src/system.h (PARAMS): Remove.
2642 Include <limits.h> unconditionally, since it's guaranteeed even
2643 for a freestanding C89 compiler.
2644 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
2645 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 2646
e7cb57c0
AD
26472002-10-20 Akim Demaille <akim@epita.fr>
2648
2649 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
2650 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
2651 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
2652 (yyresolveStates, yyresolveAction, yyresolveStack)
2653 (yyprocessOneStack): Use them.
2654 (yy_reduce_print): New.
2655 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
2656
0245f82d
AD
26572002-10-20 Akim Demaille <akim@epita.fr>
2658
2659 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
2660 arguments and output `void'.
2661 (b4_c_function): Rename as...
2662 (b4_c_function_def): this.
2663 (b4_c_function_decl, b4_c_ansi_function_def)
2664 (b4_c_ansi_function_decl): New.
2665 Change the interpretation of the arguments: before `int, foo', now
2666 `int foo, foo'.
2667 * data/yacc.c (yyparse): Prototype and define thanks to these.
2668 Adjust b4_c_function_def uses.
2669 * data/glr.c (yyparse): Likewise, but ANSI only.
2670
39912f52
AD
26712002-10-20 Akim Demaille <akim@epita.fr>
2672
2673 * src/output.c (prepare): Move the definition of `tokens_number',
2674 `nterms_number', `undef_token_number', `user_token_number_max'
2675 to...
2676 (prepare_tokens): Here.
2677 (prepare_tokens): Rename as...
2678 (prepare_symbols): this.
2679 (prepare): Move the definition of `rules_number' to...
2680 (prepare_rules): here.
2681 (prepare): Move the definition of `last', `final_state_number',
2682 `states_number' to...
2683 (prepare_states): here.
2684 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
2685
20c1e2ad
AD
26862002-10-20 Akim Demaille <akim@epita.fr>
2687
2688 * src/tables.h, src/tables.c, src/output.c: Comment changes.
2689
21964f43
AD
26902002-10-20 Akim Demaille <akim@epita.fr>
2691
2692 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
2693 * data/c.m4: here.
2694
66d30cd4
AD
26952002-10-20 Akim Demaille <akim@epita.fr>
2696
2697 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
2698 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
2699 `pair'.
2700 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
2701 `name' to...
2702 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
2703 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
2704 These.
2705
95f2c9fe
PE
27062002-10-19 Paul Eggert <eggert@twinsun.com>
2707
2708 Do not create a temporary file, as that involves security and
2709 cleanup headaches. Instead, use a pair of pipes.
2710 Derived from a suggestion by Florian Krohm.
2711 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
2712 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
2713 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
2714 (BISON_PREREQ_SUBPIPE): Add.
2715 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
2716 Add subpipe.h, subpipe.c.
2717 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
2718 * po/POTFILES.in: Add lib/subpipe.c.
2719 * src/output.c: Include "subpipe.h".
2720 (m4_invoke): Remove decl.
2721 (scan_skel): New decl.
2722 (output_skeleton): Use pipe rather than temporary file for m4 input.
2723 Check that m4sugar.m4 is readable, to avoid deadlock.
2724 Check for pipe I/O error.
2725 * src/scan-skel.l (readpipe): Remove decl.
2726 (scan_skel): New function, to be used in place of m4_invoke.
2727 Read from stream rather than file.
66d30cd4 2728
95f2c9fe
PE
2729 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
2730 float, as this generates a warning on Solaris 8 + GCC 3.2 with
2731 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
2732 this generates a more-accurate value anyway.
2733
2734 * lib/timevar.c (timervar_accumulate): Rename locals to
2735 avoid confusion with similarly-named more-global.
2736 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
2737
2738 * src/output.c (prepare): Use xstrdup to convert char const *
2739 to char *, to avoid GCC warning.
2740
c19988b7
AD
27412002-10-19 Akim Demaille <akim@epita.fr>
2742
2743 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
2744 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
2745 Use them to have `calc.y' ready for %pure-parser.
2746 * data/yacc.c (YYLEX): Pass a yylex return type to
2747 b4_c_function_call.
2748
ae7453f2
AD
27492002-10-19 Akim Demaille <akim@epita.fr>
2750
2751 Prototype support of %lex-param and %parse-param.
2752
2753 * src/parse-gram.y: Add the definition of the %lex-param and
2754 %parse-param tokens, plus their rules.
2755 Drop the `_' version of %glr-parser.
2756 Add the "," token.
2757 * src/scan-gram.l (INITIAL): Scan them.
2758 * src/muscle_tab.c: Comment changes.
2759 (muscle_insert, muscle_find): Rename `pair' as `probe'.
2760 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
2761 (muscle_entry_s): The `value' member is no longer const.
2762 Adjust all dependencies.
2763 * src/muscle_tab.c (muscle_init): Adjust: use
2764 MUSCLE_INSERT_STRING.
2765 Initialize the obstack earlier.
2766 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
2767 (muscle_pair_list_grow): New.
2768 * data/c.m4 (b4_c_function_call, b4_c_args): New.
2769 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
2770 * tests/calc.at: Use %locations, not --locations.
2771 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
2772
0e575721
AD
27732002-10-19 Akim Demaille <akim@epita.fr>
2774
2775 * src/getargs.c (usage): Take status as argument and exit
2776 accordingly.
2777 Report the traditional `Try ... --help' message when status != 0.
2778 (usage, version): Don't take a FILE * as arg, it is pointless.
2779 (getargs): When there is an incorrect number of arguments, make it
2780 an error, and report it GNUlically thanks to `usage ()'.
2781
724ce7f5
PE
27822002-10-18 Paul Eggert <eggert@twinsun.com>
2783
3a781eb2
PE
2784 * data/glr.c (yyreportParseError): Don't assume that sprintf
2785 yields the length of the printed string, as this is not true
2786 on SunOS 4.1.4. Reported by Peter Klein.
2787
724ce7f5
PE
2788 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
2789 * tests/conflicts.at (%nonassoc and eof): Likewise.
2790 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
2791
473d0a75
AD
27922002-10-17 Akim Demaille <akim@epita.fr>
2793
2794 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
2795 * src/getargs.c (trace_types, trace_args): Adjust.
2796 * src/reader.c (grammar_current_rule_prec_set)
2797 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
2798 Standardize error messages.
2799 And s/@prec/%prec/!
2800 (reader): Use trace_flag to enable scanner/parser debugging,
2801 instead of an adhoc scheme.
2802 * src/scan-gram.l: Remove trailing debugging code.
2803
e76d2469
PE
28042002-10-16 Paul Eggert <eggert@twinsun.com>
2805
93e2236a
PE
2806 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
2807 MUSCLE_TAB_H.
2808
e76d2469
PE
2809 * NEWS: Officially drop support for building Bison with K&R C,
2810 since it didn't work anyway and it's not worth worrying about.
2811 * Makefile.maint (wget_files): Remove ansi2knr.c.
2812 (ansi2knr.c-url_prefix): Remove.
2813 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
2814 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2815 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2816
5bd1c419
PE
28172002-10-15 Paul Eggert <eggert@twinsun.com>
2818
2819 Stop using the "enum_" trick for K&R-style function definitions;
2820 it confused me, and I was the author! Instead, assume that people
2821 who want to use K&R C compilers (when using these modules in GCC,
2822 perhaps?) will run ansi2knr.
2823
2824 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
2825 All uses of "enum_" changed to "enum ".
2826 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
2827 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 2828
5bd1c419
PE
2829 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
2830 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
2831 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
2832 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
2833 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
2834 abitset_not, abitset_ones, abitset_or, abitset_or_and,
2835 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
2836 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
2837 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
2838 Use function prototypes; this removes the need for declaring
2839 static functions simply to provide their prototypes.
2840 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
2841 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
2842 bitset_count_, bitset_create, bitset_dump, bitset_first,
2843 bitset_free, bitset_init, bitset_last, bitset_next,
2844 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
2845 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
2846 bitset_print, bitset_release_memory, bitset_toggle_,
2847 bitset_type_choose, bitset_type_get, bitset_type_name_get,
2848 debug_bitset): Likewise.
2849 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
2850 * lib/bitset_stats.c (bitset_log_histogram_print,
2851 bitset_percent_histogram_print, bitset_stats_and,
2852 bitset_stats_and_cmp, bitset_stats_and_or,
2853 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
2854 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
2855 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
2856 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
2857 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
2858 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
2859 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
2860 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
2861 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
2862 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
2863 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
2864 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
2865 bitset_stats_zero): Likewise.
2866 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
2867 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
2868 bitsetv_dump, debug_bitsetv): Likewise.
2869 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
2870 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
2871 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
2872 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
2873 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
2874 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
2875 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
2876 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
2877 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
2878 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
2879 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
2880 Likewise.
2881 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
2882 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
2883 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
2884 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
2885 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
2886 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
2887 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
2888 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
2889 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
2890 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
2891 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 2892
ae26e1f0
AD
28932002-10-14 Akim Demaille <akim@epita.fr>
2894
2895 Version 1.75.
2896
d43baf71
AD
28972002-10-14 Akim Demaille <akim@epita.fr>
2898
2899 * tests/Makefile.am (maintainer-check-posix): New.
2900
7ebc83e3
AD
29012002-10-14 Akim Demaille <akim@epita.fr>
2902
2903 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
2904 member.
2905
05846dae
AD
29062002-10-14 Akim Demaille <akim@epita.fr>
2907
2908 * src/tables.c (table_ninf_remap): base -> tab.
2909 Reported by Matt Rosing.
2910
1318e37d
PE
29112002-10-14 Paul Eggert <eggert@twinsun.com>
2912
447fbb17
PE
2913 * tests/action.at, tests/calc.at, tests/conflicts.at,
2914 tests/cxx-type.at, tests/headers.at, tests/input.at,
2915 tests/regression.at, tests/synclines.at, tests/torture.at:
2916 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
2917 so that the tests still work even if POSIXLY_CORRECT is set.
2918 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 2919
1318e37d
PE
2920 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
2921 for portability to K&R hosts. Fix typo: signed char is guaranteed
2922 only to 127, not to 128.
2923 * data/glr.c (yysigned_char): New type.
2924 * data/yacc.c (yysigned_char): Likewise.
2925 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
2926
cc0f0794
PE
29272002-10-13 Paul Eggert <eggert@twinsun.com>
2928
5038f418
PE
2929 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
2930 true due to limited range of data type" warning from GCC.
2931
cc0f0794
PE
2932 * data/c.m4 (b4_token_defines): Protect against double-inclusion
2933 by wrapping enum yytokentype's definition inside #ifndef
2934 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
2935
6fed0802
AD
29362002-10-13 Akim Demaille <akim@epita.fr>
2937
2938 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
2939 Un yy- yyrhs to avoid the name clash with the global YYRHS.
2940
32f0598d
AD
29412002-10-13 Akim Demaille <akim@epita.fr>
2942
2943 * Makefile.maint: Update from Autoconf 2.54.
2944 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
2945
7ea9a33f
AD
29462002-10-13 Akim Demaille <akim@epita.fr>
2947
2948 * src/print.c (print_state): Separate the list of solved conflicts
2949 from the other items.
2950 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
2951
ea99527d
AD
29522002-10-13 Akim Demaille <akim@epita.fr>
2953
2954 Let nondeterministic skeletons be usable with deterministic
2955 tables.
2956
2957 With the patch, GAWK compiled by GCC without -O2 passes its test
2958 suite using a GLR parser driven by LALR tables. It fails with -O2
2959 because `struct stat' gives two different answers on my machine:
2960 88 (definition of an auto var) and later 96 (memset on this var).
2961 Hence the stack is badly corrumpted. The headers inclusion is to
2962 blame: if I move the awk.h inclusion before GLR's system header
2963 inclusion, the two struct stat have the same size.
2964
2965 * src/tables.c (pack_table): Always create conflict_table.
2966 (token_actions): Always create conflict_list.
2967 * data/glr.c (YYFLAG): Remove, unused.
2968
f377f69f
AD
29692002-10-13 Akim Demaille <akim@epita.fr>
2970
2971 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
2972 (O0FLAGS): New.
2973 (VALGRIND, GXX): New.
2974 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
2975 * tests/bison.in: Run $PREBISON a pre-command.
2976 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
2977 (maintainer-check-g++): New.
2978 * Makefile.am (maintainer-check): New.
2979
2a1fe6ed
AD
29802002-10-13 Akim Demaille <akim@epita.fr>
2981
2982 * data/glr.c: Formatting changes.
2983 Tweak some trace messages to match yacc.c's.
2984
f50adbbd
AD
29852002-10-13 Akim Demaille <akim@epita.fr>
2986
2987 GLR parsers sometimes raise parse errors instead of performing the
2988 default reduction.
2989 Reported by Charles-Henry de Boysson.
2990
2991 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
2992 check the length of the traces when %glr.
2993 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
2994 GLR's traces.
2995 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
2996 Test GLR parsers.
2997 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
2998 (yyltype): Remove the yy prefix from the member names.
2999 (yytable): Complete its comment.
3000 (yygetLRActions): Map error action number from YYTABLE from
3001 YYTABLE_NINF to 0.
3002 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
3003 (which was a bug: it should have been YYTABEL_NINF, and yet it was
3004 not satisfying as we could compare an YYACTION computed from
3005 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
3006 only value for error actions.
3007 (yyreportParseError): In verbose parse error messages, don't issue
3008 `error' in the list of expected tokens.
3009 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
3010 next action to perform to match glr.c's decoding.
3011 (yytable): Complete its comment.
3012
bcbad5b9
PE
30132002-10-13 Paul Eggert <eggert@twinsun.com>
3014
3015 Fix problem reported by Henrik Grubbstroem in
e3aa65c5 3016 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
3017 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
3018 because the Bison parser reads the second action before reducing
3019 the first one.
3020 * src/scan-gram.l (rule_length): New static var.
3021 Use it to keep track of the rule length in the scanner, since
3022 we can't expect the parser to be in lock-step sync with the scanner.
3023 (handle_action_dollar, handle_action_at): Use this var.
3024 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 3025
14904b89
PE
30262002-10-12 Paul Eggert <eggert@twinsun.com>
3027
1fe611e5
PE
3028 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
3029 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
3030 Include <sys/time.h> when checking for clock_t and struct tms.
3031 Use same include order as source.
3032 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
e3aa65c5 3033 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 3034
1fe611e5
PE
3035 * lib/timevar.c: Update copyright date and clarify comments.
3036 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 3037
1fe611e5
PE
3038 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
3039 GCC version as of today, then merge Bison's changes.
3040 Change "GCC" to "Bison" in copyright notice. timevar.def's
3041 author is Akim, so change that too.
3042
98194095
PE
3043 * src/reader.c (grammar_current_rule_check):
3044 Don't worry about the default action if $$ is untyped.
3045 Prevents bogus warnings reported by Jim Gifford in
e3aa65c5 3046 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 3047
14904b89
PE
3048 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
3049 * data/glr.c, data/lalr1.cc, data/yacc.c:
3050 Output token definitions before the first part of user declarations.
3051 Fixes compatibility problem reported by Jim Gifford for kbd in
e3aa65c5 3052 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 3053
ff6dca18
PE
30542002-10-11 Paul Eggert <eggert@twinsun.com>
3055
3056 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
3057 (yyparse): here. This undoes some of the 2002-07-25 change.
3058 Compatibility problem reported by Ralf S. Engelschall with
3059 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
3060
eb714592
AD
30612002-10-11 Akim Demaille <akim@epita.fr>
3062
3063 * tests/regression.at Characters Escapes): New.
3064 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
3065 characters.
3066 Reported by Jan Nieuwenhuizen.
3067
b7195100
AD
30682002-10-11 Akim Demaille <akim@epita.fr>
3069
3070 * po/id.po: New.
3071
f28a0f2d
PE
30722002-10-10 Paul Eggert <eggert@twinsun.com>
3073
3074 Portability fixes for bitsets; this also avoids several GCC
3075 warnings.
3076
3077 * lib/abitset.c: Include <stddef.h>, for offsetof.
3078 * lib/lbitset.c: Likewise.
3079
3080 * lib/abitset.c (abitset_bytes): Return a size that is aligned
3081 properly for vectors of objects. Do not assume that adding a
3082 header size to a multiple of a word size yields a value that is
3083 properly aligned for the whole union.
3084 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3085
3086 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
3087 unique names for structures.
3088 * lib/ebitset.c (ebitset_bytes): Likewise.
3089 * lib/lbitset.c (lbitset_bytes): Likewise.
3090
3091 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
3092 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
3093 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
3094 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
3095 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
3096 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
3097 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
3098 to improve the type-checking that GCC can do.
3099 * lib/bitset.c (bitset_op4_cmp): Likewise.
3100 * lib/bitset_stats.c (bitset_stats_count,
3101 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
3102 bitset_stats_copy, bitset_stats_disjoint_p,
3103 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
3104 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
3105 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
3106 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
3107 bitset_stats_and_or_cmp, bitset_stats_andn_or,
3108 bitset_stats_andn_or_cmp, bitset_stats_or_and,
3109 bitset_stats_or_and_cmp): Likewise.
3110 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
3111 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
3112 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
3113 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
3114
3115 * lib/abitset.h: Include bitset.h, not bbitset.h.
3116 * lib/ebitset.h: Likewise.
3117 * lib/lbitset.h: Likewise.
3118
3119 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
3120 All instances of parameters of type enum bitset_opts are now of
3121 type enum_bitset_opts, to conform to the C Standard, and similarly
3122 for enum_bitset_type.
3123 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
3124 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
3125
3126 Do not use "struct bitset_struct" to mean different things in
3127 different modules. Not only is this confusing, it violates
3128 the C Standard, which requires that structure types in different
3129 modules must be compatible if one is to be passed to the other.
3130 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
3131 All instances of "struct bitset_struct *" replaced with "bitset".
3132 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
3133 (union bitset_union, struct abitset_struct, struct ebitset_struct,
3134 struct lbitset_struct, struct bitset_stats_struct): New types.
3135 All uses of struct bitset_struct changed to union bitset_union,
3136 etc.
3137 * lib/abitset.c (struct abitset_struct, abitset,
3138 struct bitset_struct): Remove.
3139 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
3140 struct bitset_struct): Remove.
3141 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
3142 bitset_struct): Remove.
3143 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
3144 Likewise.
3145
3146 Do not call a function of type T using a call that assumes the
3147 function is of a different type U. Standard C requires that a
3148 function must be called with a type that is compatible with its
3149 definition.
3150 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3151 New decls.
3152 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3153 New functions.
3154 * lib/ebitset.c (PFV): Remove.
3155 * lib/lbitset.c (PFV): Likewise.
3156 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
3157 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
3158 decls.
3159 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
3160 (ebitset_vtable): Use them.
3161 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
3162 lbitset_xor): New functions.
3163 (lbitset_vtable): Use them.
3164
3165 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
3166 Declare.
3167
3168 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
3169 GCC warning.
3170 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
3171 Use offsetof, for simplicity.
3172
6fbe4984
PE
31732002-10-06 Paul Eggert <eggert@twinsun.com>
3174
3175 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
3176 the same width as int. This reapplies a hunk of the 2002-08-12 patch
e3aa65c5 3177 <http://mail.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
3178 which was inadvertently undone by the 2002-09-30 patch.
3179 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
3180 the same width as int.
3181
420f93c8
PE
31822002-10-04 Paul Eggert <eggert@twinsun.com>
3183
3184 Version 1.50.
3185
3186 * configure.ac (AC_INIT), NEWS: Increment version number.
3187
3188 * doc/bison.texinfo: Minor spelling, grammar, and white space
3189 fixes.
3190 (Symbols): Mention that any negative value returned from yylex
3191 signifies end-of-input. Warn about negative chars. Mention
3192 the portable Standard C character set.
3193
3194 The GNU coding standard says CFLAGS and YFLAGS are reserved
3195 for the installer to set.
3196 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
3197 * src/Makefile.am (AM_CFLAGS): Likewise.
3198 (AM_YFLAGS): Renamed from YFLAGS.
3199
3200 Fix some MAX and MIN problems.
3201 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
3202 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
3203 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
3204 * src/reader.c (reader): Use it.
3205
3206 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
3207 POSIX 1003.1-2001 has removed fgrep.
3208
32092002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
3210
3211 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
3212 interpreted as signed.
3213 * lib/ebitset.c (ebitset_list): Fix bug.
3214
ff68026d
PE
32152002-10-01 Paul Eggert <eggert@twinsun.com>
3216
3217 More fixes for 64-bit hosts and large bitsets.
3218
3219 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
3220 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
3221 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
3222 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
3223 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
3224 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
3225 bitset_count_): Likewise.
3226 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
3227 bitset_first, bitset_last): Likewise.
3228 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
3229 bitset_stats_list_reverse, bitset_stats_size,
3230 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
3231 Likewise.
3232 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3233 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
3234 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
3235 bitsetv_reflexive_transitive_closure): Likewise.
3236 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
3237 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
3238 Likewise.
3239 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
3240 Likewise.
420f93c8 3241
ff68026d
PE
3242 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
3243 Use size_t, not unsigned int, to count bytes.
3244 * lib/abitset.h (abitset_bytes): Likewise.
3245 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
3246 Likewise.
3247 * lib/bitset.h (bitset_bytes): Likewise.
3248 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
3249 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
3250 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3251 * lib/ebitset.c (ebitset_bytes): Likewise.
3252 * lib/ebitset.h (ebitset_bytes): Likewise.
3253 * lib/lbitset.c (lbitset_bytes): Likewise.
3254 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 3255
ff68026d
PE
3256 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
3257 abitset_subset_p, abitset_disjoint_p, abitset_and,
3258 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
3259 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
3260 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
3261 abitset_or_and, abitset_or_and_cmp):
3262 Use bitset_windex instead of unsigned int.
3263 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3264 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
3265 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
3266 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
3267 Likewise.
3268 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 3269
ff68026d
PE
3270 * lib/bitset.c (bitset_print):
3271 Use proper printf formats for widths of integer types.
3272 * lib/bitset_stats.c (bitset_percent_histogram_print,
3273 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
3274 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3275 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3276 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 3277
ff68026d
PE
3278 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
3279 BITSET_SIZE_MAX): New macros.
3280 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
3281 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
3282 to BITSET_WINDEX_MAX.
3283
3284 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
3285 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
3286 since we now return the bitset_bindex type (not int).
3287
3288 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
3289 when computing sizes.
3290 * lib/ebitset.c (ebitset_elts_grow): Likewise.
3291
3292 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
3293 and avoid cast to unsigned.
3294
6aa452a6
AD
32952002-09-30 Akim Demaille <akim@epita.fr>
3296
3297 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
3298 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
3299 Updates from Michael Hayes.
3300
927f7817
AD
33012002-09-30 Art Haas <ahaas@neosoft.com>
3302
3303 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
3304 invocations.
3305 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
3306 defined.
3307
9738f41e
AD
33082002-09-27 Akim Demaille <akim@epita.fr>
3309
3310 Version 1.49c.
3311
a5c75d7f
AD
33122002-09-27 Akim Demaille <akim@epita.fr>
3313
3314 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
3315 (Because of AC_LIBSOURCE).
3316
8280e179
AD
33172002-09-27 Akim Demaille <akim@epita.fr>
3318
3319 Playing with Autoscan.
3320
3321 * configure.ac: Remove the old LIBOBJ tweaks.
3322 (AC_REPLACE_FUNCS): Add strrchr and strtol.
3323 * lib/strrchr.c: New.
3324 * lib/strtol.c: New, from the Coreutils 4.5.1.
3325
ae64af35
AD
33262002-09-27 Akim Demaille <akim@epita.fr>
3327
3328 Playing with Autoscan.
3329
3330 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
3331 * lib/Makefile.am (libbison_a_SOURCES): No longer include
3332 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
3333 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
3334 Coreutils 4.5.1.
3335
d1a1114f
AD
33362002-09-24 Akim Demaille <akim@epita.fr>
3337
3338 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
3339 (Frequently Asked Questions, Parser Stack Overflow): New.
3340
b906441c
AD
33412002-09-13 Akim Demaille <akim@epita.fr>
3342
3343 Playing with autoscan.
3344
3345 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
3346 * src/files.c (skeleton_find): Remove, unused.
3347 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
3348 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
3349
bd701811
AD
33502002-09-13 Akim Demaille <akim@epita.fr>
3351
3352 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
3353 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
3354
e0a13e7b
AD
33552002-09-13 Akim Demaille <akim@epita.fr>
3356
3357 * configure.ac: Require 2.54.
3358 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
3359 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
3360 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
3361 Remove, provided by Autoconf macros.
3362
c97011bf
AD
33632002-09-12 Akim Demaille <akim@epita.fr>
3364
3365 * m4/prereq.m4: Update, from Coreutils 4.5.1.
3366
d862b1be
AD
33672002-09-12 Akim Demaille <akim@epita.fr>
3368
3369 * m4/prereq.m4: Update, from Fileutils 4.1.5.
3370 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
3371 Reported by Martin Mokrejs.
3372
3d38c03a
AD
33732002-09-10 Akim Demaille <akim@epita.fr>
3374
3375 * src/parse-gram.y: Associate a human readable string to each
3376 token type.
3377 * tests/regression.at (Invalid inputs): Adjust.
3378
b6347355
AD
33792002-09-10 Gary V. Vaughan <gary@gnu.org>
3380
3381 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
3382 with an Autoconf-2.5x style configure.ac.
3383
09ba4ab2
PE
33842002-09-06 Paul Eggert <eggert@twinsun.com>
3385
3386 * doc/bison.texinfo (Conditions): Make explicit that the GPL
3387 exception applies only to yacc.c. This is a modification of a
3388 patch originally suggested by Akim Demaille.
3389
21846f69
AD
33902002-09-06 Akim Demaille <akim@epita.fr>
3391
09ba4ab2
PE
3392 * data/c.m4 (b4_copyright): Move the GPL exception comment from
3393 here to...
3394 * data/yacc.c: here.
3395
21846f69
AD
3396 * data/lalr1.cc (struct yyltype): Don't define it, since we use
3397 LocationType.
3398 (b4_ltype): Default to yy::Location from location.hh.
3399
c0ad8bf3
AD
34002002-09-04 Jim Meyering <jim@meyering.net>
3401
3402 * data/yacc.c: Guard the declaration of yytoknum also with
3403 `#ifdef YYPRINT', so it is declared only when used.
3404
3a93251e
AD
34052002-09-04 Akim Demaille <akim@epita.fr>
3406
3407 * configure.in: Rename as...
3408 * configure.ac: this.
3409 Bump to 1.49c.
3410
427c0dda
AD
34112002-09-04 Akim Demaille <akim@epita.fr>
3412
3413 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
3414 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
3415 translate maintainer only messages.
3416
6a254321
PE
34172002-08-12 Paul Eggert <eggert@twinsun.com>
3418
645e30d1
PE
3419 Version 1.49b.
3420
6a254321
PE
3421 * Makefile.am (SUBDIRS): Remove intl.
3422 (DISTCLEANFILES): Remove.
3423 * NEWS: Mention that GNU M4 is now required. Clarify what is
3424 meant by "larger grammars". Mention the pt_BR translation.
3425 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
3426 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
3427 Bump version from 0.11.2 to 0.11.5.
3428 (BISON_PREREQ_STAGE): Remove.
3429 (AM_GNU_GETTEXT): Use external gettext.
3430 (AC_OUTPUT): Remove intl/Makefile.
3431
3432 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
3433
3434 * data/glr.c: Include string.h, for strlen.
3435 (yyreportParseError): Use size_t for yysize.
3436 (yy_yypstack): No longer nested inside yypstates, as nested
3437 functions are not portable. Do not assume size_t is the
3438 same width as int.
3439 (yypstates): Do not assume that ptrdiff_t is the same width
3440 as int, and similarly for yyposn and YYINDEX.
3441
3442 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
3443
3444 * lib/Makefile.am (INCLUDES): Do not include from the intl
3445 directory, which has been removed.
3446 * src/Makefile.am (INCLUDES): Likewise.
3447
3448 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
3449 (bitsets_sources, additional_bitsets_sources, timevars_sources):
3450 New vars.
3451
3452 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
3453 * tests/Makefile.am (EXTRA_DIST): Likewise.
3454
3455 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
3456 Do not assume that bitset_windex is the same width as unsigned.
3457
3458 * lib/abitset.c (abitset_unused_clear): Do not assume that
3459 bitset_word is the same width as int.
3460 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
3461 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
3462 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
3463 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
3464 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
3465
3466 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
3467 portability to one's complement hosts!).
3468 * lib/ebitset.c (ebitset_op1): Likewise.
3469 * lib/lbitset.c (lbitset_op1): Likewise.
3470
3471 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
3472 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
3473 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
3474 Sync with fileutils.
3475 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
3476 lib/gettext.h: Sync with diffutils.
3477
3478 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
3479 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
3480
3481 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
3482 PROTOTYPES to check for prototypes, and "defined __STDC__" to
3483 check for void *.
3484
3485 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
3486 size_t; the old version tried to do this but casted improperly.
3487 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
3488 (bitset_test): Now returns int, not unsigned long.
3489
3490 * lib/bitset_stats.c: Include "gettext.h".
3491 (_): New macro.
3492 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
3493 name locals "index", as it generates unnecessary warnings on some
3494 hosts that have an "index" function.
3495
3496 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
3497 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
3498 they need translation.
3499 * src/LR0.c (state_list_append, new_itemsets, get_state,
3500 append_states, generate_states): Likewise.
3501 * src/assoc.c (assoc_to_string): Likewise.
3502 * src/closure.c (print_closure, set_firsts, closure): Likewise.
3503 * src/gram.c (grammar_dump): Likewise.
3504 * src/injections.c (injections_compute): Likewise.
3505 * src/lalr.c (lookaheads_print): Likewise.
3506 * src/relation.c (relation_transpose): Likewise.
3507 * src/scan-gram.l: Likewise.
3508 * src/tables.c (table_grow, pack_vector): Likewise.
3509
3510 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
3511 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
3512 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
3513 * m4/mbstate_t.m4: Sync with fileutils.
3514 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
3515
3516 * po/LINGUAS: Add pt_BR.
3517 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
3518 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
3519 lib/timevar.c.
3520 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
3521 manual recommends.
3522 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
3523
3524 * src/complain.c (strerror_r): Remove decl; not needed.
3525 (strerror): Use same pattern as ../lib/error.c.
3526
3527 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
3528
3529 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
3530
3531 * src/main.c (main): Cast result of bindtextdomain and textdomain
3532 to void, to avoid a GCC warning when --disable-nls is in effect.
3533
3534 * src/scan-gram.l: Use strings rather than escapes when possible,
3535 to minimize the number of warnings from xgettext.
3536 (handle_action_dollar, handle_action_at): Don't use isdigit,
3537 as it mishandles negative chars and it may not work as expected
3538 outside the C locale.
3539
3540 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
3541 this is a GCC extension and is not portable to other compilers.
3542
3543 * src/system.h (alloca): Use same pattern as ../lib/error.c.
3544 Do not include <ctype.h>; no longer needed.
3545 Do not include <malloc.h>; no longer needed (and generates
3546 warnings on OpenBSD 3.0).
3547
3548 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
3549 it's not portable.
3550
3551 * tests/regression.at: Do not use 'cc -c input.c -o input';
3552 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
3553
3554 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
3555 exit status as failure, not just exit status 1. Sun C exits
3556 with status 2 sometimes.
3557
3558 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
3559 Use it for the two large tests.
3560
c8f002c7
AD
35612002-08-02 Akim Demaille <akim@epita.fr>
3562
3563 * src/conflicts.c (conflicts_output): Don't output rules never
3564 reduced here, since anyway that computation doesn't work.
3565 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
3566 (rule_useless_p, rule_never_reduced_p): New.
3567 (grammar_rules_partial_print): Use a filter instead of a range.
3568 Display the title only if needed.
3569 (grammar_rules_print): Adjust.
3570 (grammar_rules_never_reduced_report): New.
3571 * src/tables.c (action_row): Move the computation of rules never
3572 reduced to...
3573 (token_actions): here.
3574 * src/main.c (main): Make the parser before making the report, so
3575 that rules never reduced are computed.
3576 Call grammar_rules_never_reduced_report.
3577 * src/print.c (print_results): Report rules never reduced.
3578 * tests/conflicts.at, tests/reduce.at: Adjust.
3579
cd08e51e
AD
35802002-08-01 Akim Demaille <akim@epita.fr>
3581
3582 Instead of attaching lookaheads and duplicating the rules being
3583 reduced by a state, attach the lookaheads to the reductions.
3584
3585 * src/state.h (state_t): Remove the `lookaheads',
3586 `lookaheads_rule' member.
3587 (reductions_t): Add a `lookaheads' member.
3588 Use a regular array for the `rules'.
3589 * src/state.c (reductions_new): Initialize the lookaheads member
3590 to 0.
3591 (state_rule_lookaheads_print): Adjust.
3592 * src/state.h, src/state.c (state_reductions_find): New.
3593 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
3594 (count_rr_conflicts): Adjust.
3595 * src/lalr.c (LArule): Remove.
3596 (add_lookback_edge): Adjust.
3597 (state_lookaheads_count): New.
3598 (states_lookaheads_initialize): Merge into...
3599 (initialize_LA): this.
3600 (lalr_free): Adjust.
3601 * src/main.c (main): Don't free nullable and derives too early: it
3602 is used by --verbose.
3603 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
3604
bb0027a9
AD
36052002-08-01 Akim Demaille <akim@epita.fr>
3606
3607 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
3608 `rule_number_t**'.
3609 (set_derives, free_derives): Rename as...
3610 (derives_compute, derives_free): this.
3611 Adjust all dependencies.
3612 * src/nullable.c (set_nullable, free_nullable): Rename as...
3613 (nullable_compute, nullable_free): these.
3614 (rule_list_t): Store rule_t *, not rule_number_t.
3615 * src/state.c (state_rule_lookaheads_print): Directly compare rule
3616 pointers, instead of their numbers.
3617 * src/main.c (main): Call nullable_free, and derives_free earlier,
3618 as they were lo longer used.
3619
3325ddc4
AD
36202002-08-01 Akim Demaille <akim@epita.fr>
3621
3622 * lib/timevar.c (get_time): Include children time.
3623 * src/lalr.h (LA, LArule): Don't export them: used with the
3624 state_t.
3625 * src/lalr.c (LA, LArule): Static.
3626 * src/lalr.h, src/lalr.c (lalr_free): New.
3627 * src/main.c (main): Call it.
3628 * src/tables.c (pack_vector): Check whether loc is >= to the
3629 table_size, not >.
3630 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
3631 (tables_generate): do it, since that's also it which allocates
3632 them.
3633 Don't free LA and LArule, main does.
3634
c6f1a33c
AD
36352002-07-31 Akim Demaille <akim@epita.fr>
3636
3637 Separate parser tables computation and output.
3638
3639 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
3640 (conflict_list, conflict_list_cnt, table, check, table_ninf)
3641 (yydefgoto, yydefact, high): Move to...
3642 * src/tables.h, src/tables.c: here.
3643 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
3644 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
3645 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
3646 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
3647 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
3648 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
3649 (action_row, save_row, token_actions, save_column, default_goto)
3650 (goto_actions, sort_actions, matching_state, pack_vector)
3651 (table_ninf_remap, pack_table, prepare_actions): Move to...
3652 * src/tables.c: here.
3653 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
3654 * src/output.c (token_actions, output_base, output_conflicts)
3655 (output_check): Merge into...
3656 (prepare_actions): this.
3657 (actions_output): Rename as...
3658 (user_actions_output): this.
3659 * src/main.c (main): Call tables_generate and tables_free.
3660
1509d42f
AD
36612002-07-31 Akim Demaille <akim@epita.fr>
3662
3663 Steal GCC's --time-report support.
3664
3665 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
3666 stolen/adjusted from GCC.
3667 * m4/stage.m4: Remove time related checks.
3668 * m4/timevar.m4: New.
3669 * configure.in: Adjust.
3670 * src/system.h: Adjust to using timevar.h.
3671 * src/getargs.h, src/getargs.c: Support trace_time for
3672 --trace=time.
3673 * src/main.c (stage): Remove.
3674 (main): Replace `stage' invocations with timevar calls.
3675 * src/output.c: Insert pertinent timevar calls.
3676
273a74fa
AD
36772002-07-31 Akim Demaille <akim@epita.fr>
3678
3679 Let --trace have arguments.
3680
3681 * src/getargs.h (enum trace_e): New.
3682 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
3683 (long_options, short_options): --trace/-T takes an optional
3684 argument.
3685 Change all the uses of trace_flag to reflect the new flags.
3686 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
3687
3688 Strengthen `stage' portability.
3689
3690 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
3691 * configure.in: Use it.
3692 Don't check for malloc.h and sys/times.h.
3693 * src/system.h: Include them when appropriate.
3694 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
3695 times and struct tms are available.
3696
217598da
AD
36972002-07-30 Akim Demaille <akim@epita.fr>
3698
3699 In verbose parse error message, don't report `error' as an
3700 expected token.
3701 * tests/actions.at (Printers and Destructors): Adjust.
3702 * tests/calc.at (Calculator $1): Adjust.
3703 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
3704 error message, do not report the parser accepts the error token in
3705 that state.
3706
52489d44
AD
37072002-07-30 Akim Demaille <akim@epita.fr>
3708
3709 Normalize conflict related messages.
3710
3711 * src/complain.h, src/complain.c (warn, complain): New.
3712 * src/conflicts.c (conflicts_print): Use them.
3713 (conflict_report_yacc): New, extracted from...
3714 (conflicts_print): here.
3715 * tests/conflicts.at, tests/existing.at: Adjust.
3716
e8832397
AD
37172002-07-30 Akim Demaille <akim@epita.fr>
3718
3719 Report rules which are never reduced by the parser: those hidden
3720 by conflicts.
3721
3722 * src/LR0.c (save_reductions): Don't make the final state too
3723 different: save its reduction (accept) instead of having a state
3724 without any action (no shift or goto, no reduce).
3725 Note: the final state is now a ``regular'' state, i.e., the
3726 parsers now contain `reduce 0' as default reduction.
3727 Nevertheless, since they decide to `accept' when yystate =
3728 final_state, they still will not reduce rule 0.
3729 * src/print.c (print_actions, print_reduction): Adjust.
3730 * src/output.c (action_row): Track reduced rules.
3731 (token_actions): Report rules never reduced.
3732 * tests/conflicts.at, tests/regression.at: Adjust.
3733
caf23d24
AD
37342002-07-30 Akim Demaille <akim@epita.fr>
3735
3736 `stage' was accidently included in a previous patch.
3737 Initiate its autoconfiscation.
3738
3739 * configure.in: Look for malloc.h and sys/times.h.
3740 * src/main.c (stage): Adjust.
3741 Report only when trace_flag.
3742
640748ee
AD
37432002-07-29 Akim Demaille <akim@epita.fr>
3744
3745 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
3746 state_number_t.
3747 (errs_t): symbol_t*, not symbol_number_t.
3748 (reductions_t): rule_t*, not rule_number_t.
3749 (FOR_EACH_SHIFT): New.
3750 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
3751 * src/print.c, src/print_graph.c: Adjust.
3752
88bce5a2
AD
37532002-07-29 Akim Demaille <akim@epita.fr>
3754
3755 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
3756
3757 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
3758 (endtoken, accept): these.
3759 * src/reader.c (reader): Set endtoken's default tag to "$end".
3760 Set undeftoken's tag to "$undefined" instead of "$undefined.".
3761 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
3762 Adjust.
3763
1bfb97db
AD
37642002-07-29 Akim Demaille <akim@epita.fr>
3765
3766 * src/reduce.c (reduce_grammar): When the language is empty,
3767 complain about the start symbol, not the axiom.
3768 Use its location.
3769 * tests/reduce.at (Empty Language): New.
3770
fc5734fe
AD
37712002-07-26 Akim Demaille <akim@epita.fr>
3772
3773 * src/reader.h, src/reader.c (gram_error): ... can't get
3774 yycontrol without making too strong assumptions on the parser
3775 itself.
3776 * src/output.c (prepare_tokens): Use the real 0th value of
3777 token_translations instead of `0'.
3778 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
3779 visible here.
3780 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
3781 for the time being: %locations ought to provide it to yyerror.
3782
3650b4b8
AD
37832002-07-25 Akim Demaille <akim@epita.fr>
3784
3785 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
3786 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
3787 * tests/regression.at (Web2c Actions): Adjust.
3788
4b3d3a8e
AD
37892002-07-25 Akim Demaille <akim@epita.fr>
3790
3791 Stop storing rules from 1 to nrules + 1.
3792
3793 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
3794 * src/nullable.c, src/output.c, src/print.c, src/reader.c
3795 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
3796 Iterate from 0 to nrules.
3797 Use rule_number_as_item_number and item_number_as_rule_number.
3798 Adjust to `derive' now containing possibly 0.
3799 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
3800 Handle the `- 1' part in rule numbers from/to item numbers.
3801 * src/conflicts.c (log_resolution): Fix the message which reversed
3802 shift and reduce.
3803 * src/output.c (action_row): Initialize default_rule to -1.
3804 (token_actions): Adjust.
3805 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
3806 expected output.
3807 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
3808
4a2a22f4
AD
38092002-07-25 Akim Demaille <akim@epita.fr>
3810
3811 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
3812 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
3813 (b4_c_knr_arg_decl): New.
3814 * data/yacc.c: Use it to define yysymprint, yydestruct, and
3815 yyreport_parse_error.
3816
b8df3223
AD
38172002-07-25 Akim Demaille <akim@epita.fr>
3818
3819 * data/yacc.c (yyreport_parse_error): New, extracted from...
3820 (yyparse): here.
3821 (yydestruct, yysymprint): Move above yyparse.
3822 Be K&R compliant.
3823
a762e609
AD
38242002-07-25 Akim Demaille <akim@epita.fr>
3825
3826 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
3827 replace...
3828 (b4_sint_type, b4_uint_type): these.
3829 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
3830 * tests/regression.at (Web2c Actions): Adjust.
3831
12b0043a
AD
38322002-07-25 Akim Demaille <akim@epita.fr>
3833
3834 * src/gram.h (TIEM_NUMBER_MAX): New.
3835 (item_number_of_rule_number, rule_number_of_item_number): Rename
3836 as...
3837 (rule_number_as_item_number, item_number_as_rule_number): these.
3838 Adjust dependencies.
3839 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
3840 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
3841 (symbol_number_to_vector_number): New.
3842 (order): Of vector_number_t* type.
3843 (base_t, BASE_MAX, BASE_MIN): New.
3844 (froms, tos, width, pos, check): Of base_t type.
3845 (action_number_t, ACTION_MIN, ACTION_MAX): New.
3846 (actrow): Of action_number_t type.
3847 (conflrow): Of unsigned int type.
3848 (table_ninf, base_ninf): New.
3849 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
3850 (muscle_insert_int_table, muscle_insert_base_table)
3851 (muscle_insert_rule_number_table): New.
3852 (prepare_tokens): Output `toknum' as int_table.
3853 (action_row): Returns a rule_number_t.
3854 Use ACTION_MIN, not SHRT_MIN.
3855 (token_actions): yydefact is rule_number_t*.
3856 (table_ninf_remap): New.
3857 (pack_table): Use it for `base' and `table'.
3858 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
3859 replaced with...
3860 (YYPACT_NINF, YYTABLE_NINF): these.
3861 (yypact, yytable): Compute their types instead of hard-coded
3862 `short'.
3863 * tests/regression.at (Web2c Actions): Adjust.
3864
5dde258a
AD
38652002-07-19 Akim Demaille <akim@epita.fr>
3866
3867 * src/scan-gram.l (id): Can start with an underscore.
3868
a945ec39
AD
38692002-07-16 Akim Demaille <akim@epita.fr>
3870
3871 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
3872 Adjust all former `associativity' dependencies.
3873 * src/symtab.c (symbol_new): Default associativity is `undef', not
3874 `right'.
3875 (symbol_check_alias_consistence): Adjust.
3876
fae437e8
AD
38772002-07-09 Akim Demaille <akim@epita.fr>
3878
3879 * doc/bison.texinfo: Properly set the ``header'' part.
3880 Use @dircategory ``GNU programming tools'' as per Texinfo's
3881 documentation.
3882 Use @copying.
3883
1a715ef2
AD
38842002-07-09 Akim Demaille <akim@epita.fr>
3885
3886 * lib/quotearg.h: Protect against multiple inclusions.
3887 * src/location.h (location_t): Add a `file' member.
3888 (LOCATION_RESET, LOCATION_PRINT): Adjust.
3889 * src/complain.c (warn_at, complain_at, fatal_at): Drop
3890 `error_one_per_line' support.
3891
a5d50994
AD
38922002-07-09 Akim Demaille <akim@epita.fr>
3893
3894 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
3895 * src/reader.c (lineno): Remove.
3896 Adjust all dependencies.
3897 (get_merge_function): Take a location and use complain_at.
3898 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
3899 * tests/regression.at (Invalid inputs, Mixing %token styles):
3900 Adjust.
3901
b275314e
AD
39022002-07-09 Akim Demaille <akim@epita.fr>
3903
3904 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
3905 recovery rule, and forbid extensions when --yacc.
3906 (gram_error): Use complain_at.
3907 * src/reader.c (reader): Exit if there were parse errors.
3908
865b9df1
AD
39092002-07-09 Akim Demaille <akim@epita.fr>
3910
3911 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
3912 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
3913 Reported by R Blake <blakers@mac.com>.
3914
c76e14da
AD
39152002-07-09 Akim Demaille <akim@epita.fr>
3916
3917 * data/yacc.c: Output the copyright notive in the header.
3918
7db2ed2d
AD
39192002-07-03 Akim Demaille <akim@epita.fr>
3920
3921 * src/output.c (froms, tos): Are state_number_t.
3922 (save_column): sp, sp1, and sp2 are state_number_t.
3923 (prepare): Rename `final' as `final_state_number', `nnts' as
3924 `nterms_number', `nrules' as `rules_number', `nstates' as
3925 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
3926 unused.
3927 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
3928 * data/lalr1.cc (nsym_): Remove, unused.
3929
e68e0410
AD
39302002-07-03 Akim Demaille <akim@epita.fr>
3931
3932 * src/lalr.h, src/lalr.c (goto_number_t): New.
3933 * src/lalr.c (goto_list_t): New.
3934 Propagate them.
3935 * src/nullable.c (rule_list_t): New.
3936 Propagate.
3937 * src/types.h: Remove.
3938
e1a4f3a4
AD
39392002-07-03 Akim Demaille <akim@epita.fr>
3940
3941 * src/closure.c (print_fderives): Use rule_rhs_print.
3942 * src/derives.c (print_derives): Use rule_rhs_print.
3943 (rule_list_t): New, replaces `shorts'.
3944 (set_derives): Add comments.
3945 * tests/sets.at (Nullable, Firsts): Adjust.
3946
536545f3
AD
39472002-07-03 Akim Demaille <akim@epita.fr>
3948
3949 * src/output.c (prepare_actions): Free `tally' and `width'.
3950 (prepare_actions): Allocate and free `order'.
3951 * src/symtab.c (symbols_free): Free `symbols'.
3952 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
3953 * src/output.c (m4_invoke): Move to...
3954 * src/scan-skel.l: here.
3955 (<<EOF>>): Close yyout, and free its name.
3956
8b752b00
AD
39572002-07-03 Akim Demaille <akim@epita.fr>
3958
3959 Fix some memory leaks, and fix a bug: state 0 was examined twice.
3960
3961 * src/LR0.c (new_state): Merge into...
3962 (state_list_append): this.
3963 (new_states): Merge into...
3964 (generate_states): here.
3965 (set_states): Don't ensure a proper `errs' state member here, do it...
3966 * src/conflicts.c (conflicts_solve): here.
3967 * src/state.h, src/state.c: Comment changes.
3968 (state_t): Rename member `shifts' as `transitions'.
3969 Adjust all dependencies.
3970 (errs_new): For consistency, also take the values as argument.
3971 (errs_dup): Remove.
3972 (state_errs_set): New.
3973 (state_reductions_set, state_transitions_set): Assert that no
3974 previous value was assigned.
3975 (state_free): New.
3976 (states_free): Use it.
3977 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
3978 temporary storage: use `errs' and `nerrs' as elsewhere.
3979 (set_conflicts): Allocate and free this `errs'.
3980
613f5e1a
AD
39812002-07-02 Akim Demaille <akim@epita.fr>
3982
3983 * lib/libiberty.h: New.
3984 * lib: Update the bitset implementation from upstream.
3985 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
3986 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
3987 * src/main.c: Adjust bitset stats calls.
3988
26e0cadc
PE
39892002-07-01 Paul Eggert <eggert@twinsun.com>
3990
3991 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
3992 char, so that negative chars don't collide with $.
3993
1154cced
AD
39942002-06-30 Akim Demaille <akim@epita.fr>
3995
3996 Have the GLR tests be `warning' checked, and fix the warnings.
3997
3998 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
3999 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
4000 (yyremoveDeletes): `yyi' and `yyj' are size_t.
4001 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
4002 (yyaddDeferredAction): static.
4003 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
4004 (yyreportParseError): yyprefix is const.
4005 yytokenp is used only when verbose.
4006 (yy__GNUC__): Replace with __GNUC__.
4007 (yypdumpstack): yyi is size_t.
4008 (yypreference): Un-yy local variables and arguments, to avoid
4009 clashes with `yyr1'. Anyway, we are not in the user name space.
4010 (yytname_size): be an int, as is compared with ints.
4011 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
4012 Use them.
4013 * tests/cxx-gram.at: Use quotation to protect $1.
4014 Use AT_COMPILE to enable warnings hunts.
4015 Prototype yylex and yyerror.
4016 `Use' argc.
4017 Include `string.h', not `strings.h'.
4018 Produce and prototype stmtMerge only when used.
4019 yylex takes a location.
4020
97650f4e
AD
40212002-06-30 Akim Demaille <akim@epita.fr>
4022
4023 We spend a lot of time in quotearg, in particular when --verbose.
4024
4025 * src/symtab.c (symbol_get): Store a quoted version of the key.
4026 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
4027 Adjust all callers.
4028
d2576365
AD
40292002-06-30 Akim Demaille <akim@epita.fr>
4030
4031 * src/state.h (reductions_t): Rename member `nreds' as num.
4032 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
4033 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
4034
ccaf65bc
AD
40352002-06-30 Akim Demaille <akim@epita.fr>
4036
4037 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
4038 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
4039 (shifts_to): Rename as...
4040 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
4041 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
4042 (TRANSITION_IS_DISABLED, transitions_to): these.
4043
87675353
AD
40442002-06-30 Akim Demaille <akim@epita.fr>
4045
4046 * src/print.c (print_shifts, print_gotos): Merge into...
4047 (print_transitions): this.
4048 (print_transitions, print_errs, print_reductions): Align the
4049 lookaheads columns.
4050 (print_core, print_transitions, print_errs, print_state,
4051 print_grammar): Output empty lines separator before, not after.
4052 (state_default_rule_compute): Rename as...
4053 (state_default_rule): this.
4054 * tests/conflicts.at (Defaulted Conflicted Reduction),
4055 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
4056 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
4057
ce4ccb4b
AD
40582002-06-30 Akim Demaille <akim@epita.fr>
4059
4060 Display items as we display rules.
4061
4062 * src/gram.h, src/gram.c (rule_lhs_print): New.
4063 * src/gram.c (grammar_rules_partial_print): Use it.
4064 * src/print.c (print_core): Likewise.
4065 * tests/conflicts.at (Defaulted Conflicted Reduction),
4066 (Unresolved SR Conflicts): Adjust.
4067 (Unresolved SR Conflicts): Adjust and rename as...
4068 (Resolved SR Conflicts): this, as was meant.
4069 * tests/regression.at (Web2c Report): Adjust.
4070
bc933ef1
AD
40712002-06-30 Akim Demaille <akim@epita.fr>
4072
4073 * src/print.c (state_default_rule_compute): New, extracted from...
4074 (print_reductions): here.
4075 Pessimize, but clarify the code.
4076 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
4077
53d4308d
AD
40782002-06-30 Akim Demaille <akim@epita.fr>
4079
4080 * src/output.c (action_row): Let default_rule be always a rule
4081 number.
4082
574fb2d5
AD
40832002-06-30 Akim Demaille <akim@epita.fr>
4084
4085 * src/closure.c (print_firsts, print_fderives, closure):
4086 Use BITSET_EXECUTE.
4087 * src/lalr.c (lookaheads_print): Likewise.
4088 * src/state.c (state_rule_lookaheads_print): Likewise.
4089 * src/print_graph.c (print_core): Likewise.
4090 * src/print.c (print_reductions): Likewise.
4091 * src/output.c (action_row): Likewise.
4092 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
4093
05811fd7
AD
40942002-06-30 Akim Demaille <akim@epita.fr>
4095
4096 * src/print_graph.c: Use report_flag.
4097
0e4d5753
AD
40982002-06-30 Akim Demaille <akim@epita.fr>
4099
4100 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
4101 to...
4102 * src/relation.h, src/relation.c (traverse, relation_digraph)
4103 (relation_print, relation_transpose): New.
4104
24c7d800
AD
41052002-06-30 Akim Demaille <akim@epita.fr>
4106
4107 * src/state.h, src/state.c (shifts_to): New.
4108 * src/lalr.c (build_relations): Use it.
4109
9222837b
AD
41102002-06-30 Akim Demaille <akim@epita.fr>
4111
4112 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
4113 (item_number_of_rule_number, rule_number_of_item_number): New.
4114 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
4115 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
4116 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
4117 Propagate their use.
4118 Much remains to be done, in particular wrt `shorts' from types.h.
4119
260008e5
AD
41202002-06-30 Akim Demaille <akim@epita.fr>
4121
4122 * src/symtab.c (symbol_new): Initialize the `printer' member.
4123
8a731ca8
AD
41242002-06-30 Akim Demaille <akim@epita.fr>
4125
4126 * src/LR0.c (save_reductions): Remove, replaced by...
4127 * src/state.h, src/state.c (state_reductions_set): New.
4128 (reductions, errs): Rename as...
4129 (reductions_t, errs_t): these.
4130 Adjust all dependencies.
4131
32e1e0a4
AD
41322002-06-30 Akim Demaille <akim@epita.fr>
4133
4134 * src/LR0.c (state_list_t, state_list_append): New.
4135 (first_state, last_state): Now symbol_list_t.
4136 (this_state): Remove.
4137 (new_itemsets, append_states, save_reductions): Take a state_t as
4138 argument.
4139 (set_states, generate_states): Adjust.
4140 (save_shifts): Remove, replaced by...
4141 * src/state.h, src/state.c (state_shifts_set): New.
4142 (shifts): Rename as...
4143 (shifts_t): this.
4144 Adjust all dependencies.
4145 * src/state.h (state_t): Remove the `next' member.
4146
e5fb6710
AD
41472002-06-30 Akim Demaille <akim@epita.fr>
4148
4149 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
4150 escaped in slot 0.
4151
c7ca99d4
AD
41522002-06-30 Akim Demaille <akim@epita.fr>
4153
4154 Use hash.h for the state hash table.
4155
4156 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
4157 (allocate_storage): Use state_hash_new.
4158 (free_storage): Use state_hash_free.
4159 (new_state, get_state): Adjust.
4160 * src/lalr.h, src/lalr.c (states): Move to...
4161 * src/states.h (state_t): Remove the `link' member, no longer
4162 used.
4163 * src/states.h, src/states.c: here.
4164 (state_hash_new, state_hash_free, state_hash_lookup)
4165 (state_hash_insert, states_free): New.
4166 * src/states.c (state_table, state_compare, state_hash): New.
4167 * src/output.c (output_actions): Do not free states now, since we
4168 still need to know the final_state number in `prepare', called
4169 afterwards. Do it...
4170 * src/main.c (main): here: call states_free after `output'.
4171
df0e7316
AD
41722002-06-30 Akim Demaille <akim@epita.fr>
4173
4174 * src/state.h, src/state.c (state_new): New, extracted from...
4175 * src/LR0.c (new_state): here.
4176 * src/state.h (STATE_ALLOC): Move to...
4177 * src/state.c: here.
4178 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
4179 * src/state.h, src/state.c: here.
4180
39f41916
AD
41812002-06-30 Akim Demaille <akim@epita.fr>
4182
4183 * src/reader.c (gensym): Rename as...
4184 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
4185 (getsym): Rename as...
4186 (symbol_get): this.
4187
d57650a5
AD
41882002-06-30 Akim Demaille <akim@epita.fr>
4189
4190 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
4191 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
4192 * src/output.c, src/print.c, src/print_graph.c: Propagate.
4193 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
4194
5a08f1ce
AD
41952002-06-30 Akim Demaille <akim@epita.fr>
4196
4197 Make the test suite pass with warnings checked.
4198
4199 * tests/actions.at (Printers and Destructors): Improve.
4200 Avoid unsigned vs. signed issues.
4201 * tests/calc.at: Don't exercise the scanner here, do it...
4202 * tests/input.at (Torturing the Scanner): here.
4203
720623af
PH
42042002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4205
88e7e941 4206 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
4207 reorganize first lines parallel to yacc.c.
4208
fb8135fa
AD
42092002-06-28 Akim Demaille <akim@epita.fr>
4210
4211 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
4212 (b4_token_enum, b4_token_defines): New, factored from...
4213 * data/lalr1.cc, data/yacc.c, glr.c: here.
4214
41442480
AD
42152002-06-28 Akim Demaille <akim@epita.fr>
4216
4217 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
4218 unused variables.
4219 * src/output.c (merger_output): static.
4220
e0e5bf84
AD
42212002-06-28 Akim Demaille <akim@epita.fr>
4222
4223 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
4224 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
4225 pacify GCC.
4226 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 4227
676385e2
PH
42282002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4229
4230 Accumulated changelog for new GLR parsing features.
4231
6a254321 4232 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
4233 conflicts_total_count.
4234 * src/conflicts.h: Ditto.
4235 * src/output.c (token_actions): Use the new name.
4236 (output_conflicts): Change conflp => conflict_list_heads, and
4237 confl => conflict_list for better readability.
4238 * data/glr.c: Use the new names.
4239 * NEWS: Add self to GLR announcement.
e0e5bf84 4240
676385e2
PH
4241 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
4242
4243 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
4244 Akim Demaille.
4245
4246 * data/bison.glr: Change name to glr.c
4247 * data/glr.c: Renamed from bison.glr.
4248 * data/Makefile.am: Add glr.c
e0e5bf84
AD
4249
4250 * src/getargs.c:
4251
676385e2
PH
4252 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
4253 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 4254
676385e2
PH
4255 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4256
4257 * data/bison.glr: Be sure to restore the
4258 current #line when returning to the skeleton contents after having
4259 exposed the input file's #line.
4260
4261 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4262
4263 * data/bison.glr: Bring up to date with changes to bison.simple.
4264
4265 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4266
4267 * data/bison.glr: Correct definitions that use b4_prefix.
4268 Various reformatting.
4269 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
4270 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
4271 yytokenp argument; now part of stack.
4272 (yychar): Define to behave as documented.
4273 (yyclearin): Ditto.
e0e5bf84 4274
676385e2
PH
4275 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4276
4277 * src/reader.h: Add declaration for free_merger_functions.
4278
4279 * src/reader.c (merge_functions): New variable.
4280 (get_merge_function): New function.
4281 (free_merger_functions): New function.
4282 (readgram): Check for %prec that is not followed by a symbol.
4283 Handle %dprec and %merge declarations.
4284 (packgram): Initialize dprec and merger fields in rules array.
4285
4286 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
4287 conflict_list_cnt, conflict_list_free): New variables.
4288 (table_grow): Also grow conflict_table.
e0e5bf84 4289 (prepare_rules): Output dprec and merger tables.
676385e2 4290 (conflict_row): New function.
e0e5bf84 4291 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
4292 default reduction in conflicted states for GLR parser so that there
4293 are spaces for the conflict lists.
4294 (save_row): Also save conflict information.
4295 (token_actions): Allocate conflict list.
4296 (merger_output): New function.
4297 (pack_vector): Pack conflict table, too.
4298 (output_conflicts): New function to output yyconflp and yyconfl.
4299 (output_check): Allocate conflict_tos.
4300 (output_actions): Output conflict tables, also.
4301 (output_skeleton): Output b4_mergers definition.
4302 (prepare): Output b4_max_rhs_length definition.
4303 Use 'bison.glr' as default skeleton for GLR parsers.
4304
4305 * src/gram.c (glr_parser): New flag.
4306 (grammar_free): Call free_merger_functions.
4307
4308 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
4309 all pairs of conflicting reductions, rather than just all tokens
4310 causing conflicts. Needed to size conflict tables.
e0e5bf84 4311 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
4312 interface.
4313 (conflicts_print): Ditto.
4314 (count_total_conflicts): New function.
4315
4316 * src/reader.h (merger_list): New type.
4317 (merge_functions): New variable.
4318
4319 * src/lex.h (tok_dprec, tok_merge): New token types.
4320
4321 * src/gram.h (rule_s): Add dprec and merger fields.
4322 (glr_parser): New flag.
4323
4324 * src/conflicts.h (count_total_conflicts): New function.
4325
4326 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
4327
4328 * doc/bison.texinfo (Generalized LR Parsing): New section.
4329 (GLR Parsers): New section.
4330 (Language and Grammar): Mention GLR parsing.
4331 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
4332 Correct typo ("tge" -> "the").
4333
4334 * data/bison.glr: New skeleton for GLR parsing.
4335
4336 * tests/cxx-gram.at: New tests for GLR parsing.
4337
4338 * tests/testsuite.at: Include cxx-gram.at.
4339
4340 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 4341
676385e2
PH
4342 * src/parse-gram.y:
4343
4344 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
4345
4346 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 4347
b5480d74 43482002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
4349
4350 * src/options.h, src/options.c: Remove.
4351 * src/getargs.c (short_options, long_options): New.
4352
60491a94
AD
43532002-06-27 Akim Demaille <akim@epita.fr>
4354
4355 * data/bison.simple, data/bison.c++: Rename as...
4356 * data/yacc.c, data/lalr1.cc: these.
4357 * doc/bison.texinfo (Environment Variables): Remove.
4358
9be0c25b
AD
43592002-06-25 Raja R Harinath <harinath@cs.umn.edu>
4360
4361 * src/getargs.c (report_argmatch): Initialize strtok().
4362
1ae72863
AD
43632002-06-20 Akim Demaille <akim@epita.fr>
4364
4365 * data/bison.simple (b4_symbol_actions): New, replaces...
4366 (b4_symbol_destructor, b4_symbol_printer): these.
4367 (yysymprint): Be sure to call YYPRINT only for tokens, and using
4368 user token numbers.
4369
87542d29
AD
43702002-06-20 Akim Demaille <akim@epita.fr>
4371
4372 * data/bison.simple (yydestructor): Rename as...
4373 (yydestruct): this.
4374
1a31ed21
AD
43752002-06-20 Akim Demaille <akim@epita.fr>
4376
4377 * src/symtab.h, src/symtab.c (symbol_type_set)
4378 (symbol_destructor_set, symbol_precedence_set): The location is
4379 the last argument.
4380 Adjust all callers.
4381
e776192e
AD
43822002-06-20 Akim Demaille <akim@epita.fr>
4383
4384 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
4385 internals.
4386 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
4387 Takes a location.
4388 * src/symtab.h, src/symtab.c (symbol_class_set)
4389 (symbol_user_token_number_set): Likewise.
4390 Adjust all callers.
4391 Promote complain_at.
4392 * tests/input.at (Type Clashes): Adjust.
4393
5c1180b3
AD
43942002-06-20 Akim Demaille <akim@epita.fr>
4395
4396 * data/bison.simple (YYLEX): Fix the declaration when
4397 %pure-parser.
4398
e3170060
AD
43992002-06-20 Akim Demaille <akim@epita.fr>
4400
4401 * data/bison.simple (yysymprint): Don't print the token number,
4402 just its name.
4403 * tests/actions.at (Destructors): Rename as...
4404 (Printers and Destructors): this.
4405 Also exercise %printer.
4406
253862fd
AD
44072002-06-20 Akim Demaille <akim@epita.fr>
4408
4409 * data/bison.simple (YYDSYMPRINT): New.
4410 Use it to remove many of the #if YYDEBUG/if (yydebug).
4411
366eea36
AD
44122002-06-20 Akim Demaille <akim@epita.fr>
4413
4414 * src/symtab.h, src/symtab.c (symbol_t): printer and
4415 printer_location are new members.
4416 (symbol_printer_set): New.
4417 * src/parse-gram.y (PERCENT_PRINTER): New token.
4418 Handle its associated rule.
4419 * src/scan-gram.l: Adjust.
4420 (handle_destructor_at, handle_destructor_dollar): Rename as...
4421 (handle_symbol_code_at, handle_symbol_code_dollar): these.
4422 * src/output.c (symbol_printers_output): New.
4423 (output_skeleton): Call it.
4424 * data/bison.simple (yysymprint): New. Cannot be named yyprint
4425 since there are already many grammar files with a user `yyprint'.
4426 Replace the calls to YYPRINT to calls to yysymprint.
4427 * tests/calc.at: Adjust.
4428 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
4429 taking advantage of parser very internal details (stack size!).
4430
4f25ebb0
AD
44312002-06-20 Akim Demaille <akim@epita.fr>
4432
4433 * src/scan-gram.l: Complete the scanner with the missing patterns
4434 to pacify Flex.
4435 Use `quote' and `symbol_tag_get' where appropriate.
4436
93b68a0e
AD
44372002-06-19 Akim Demaille <akim@epita.fr>
4438
4439 * tests/actions.at (Destructors): Augment to test locations.
4440 * data/bison.simple (yydestructor): Pass it the current location
4441 if locations are enabled.
4442 Prototype only when __STDC__ or C++.
4443 Change the argument names to move into the yy name space: there is
4444 user code here.
4445
58612f1d
AD
44462002-06-19 Akim Demaille <akim@epita.fr>
4447
74310291
AD
4448 * data/bison.simple (b4_pure_if): New.
4449 Use it instead of #ifdef YYPURE.
4450
44512002-06-19 Akim Demaille <akim@epita.fr>
4452
4453 * data/bison.simple (b4_location_if): New.
58612f1d
AD
4454 Use it instead of #ifdef YYLSP_NEEDED.
4455
f25bfb75
AD
44562002-06-19 Akim Demaille <akim@epita.fr>
4457
4458 Prepare @$ in %destructor, but currently don't bind it in the
4459 skeleton, as %location use is not cleaned up yet.
4460
4461 * src/scan-gram.l (handle_dollar, handle_destructor_at)
4462 (handle_action_at): New.
4463 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
4464 a braced_code_t and a location as additional arguments.
4465 (handle_destructor_dollar): Instead of requiring `b4_eval', just
4466 unquote one when outputting `b4_dollar_dollar'.
4467 Adjust callers.
4468 * data/bison.simple (b4_eval): Remove.
4469 (b4_symbol_destructor): Adjust.
4470 * tests/input.at (Invalid @n): Adjust.
4471
c732d2c6
AD
44722002-06-19 Zack Weinberg <zack@codesourcery.com>
4473
4474 * doc/bison.texinfo: Document ability to have multiple
4475 prologue sections.
4476
8c165d89
AD
44772002-06-18 Akim Demaille <akim@epita.fr>
4478
4479 * src/files.c (compute_base_names): When computing the output file
4480 names from the input file name, strip the directory part.
4481
ca98bf57
AD
44822002-06-18 Akim Demaille <akim@epita.fr>
4483
4484 * data/bison.simple.new: Comment changes.
4485 Reported by Andreas Schwab.
4486
0bfb02ff
AD
44872002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
4488
4489 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
4490 there are no `label `yyoverflowlab' defined but not used' warnings
4491 when yyoverflow is defined.
4492
24c0aad7
AD
44932002-06-18 Akim Demaille <akim@epita.fr>
4494
4495 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
4496 new member.
4497 (symbol_destructor_set): Adjust.
4498 * src/output.c (symbol_destructors_output): Output the destructor
4499 locations.
4500 Output the symbol name.
4501 * data/bison.simple (b4_symbol_destructor): Adjust.
4502
5719c109
AD
45032002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
4504 and Akim Demaille <akim@epita.fr>
4505
4506 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
4507 what's left on the stack when the error recovery hits EOF.
4508 * tests/actions.at (Destructors): Complete to exercise this case.
4509
9280d3ef
AD
45102002-06-17 Akim Demaille <akim@epita.fr>
4511
4512 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
4513 arguments is really empty, not only equal to `[]'.
4514 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
4515 member.
4516 (symbol_destructor_set): New.
4517 * src/output.c (symbol_destructors_output): New.
4518 * src/reader.h (brace_code_t, current_braced_code): New.
4519 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
4520 (handle_dollar): Rename as...
4521 (handle_action_dollar): this.
4522 (handle_destructor_dollar): New.
4523 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
4524 (grammar_declaration): Use it.
4525 * data/bison.simple (yystos): Is always defined.
4526 (yydestructor): New.
4527 * tests/actions.at (Destructors): New.
4528 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
4529
dafdc66f
AD
45302002-06-17 Akim Demaille <akim@epita.fr>
4531
4532 * src/symlist.h, src/symlist.c (symbol_list_length): New.
4533 * src/scan-gram.l (handle_dollar, handle_at): Compute the
4534 rule_length only when needed.
4535 * src/output.c (actions_output, token_definitions_output): Output
4536 the full M4 block.
4537 * src/symtab.c: Don't access directly to the symbol tag, use
4538 symbol_tag_get.
4539 * src/parse-gram.y: Use symbol_list_free.
4540
56c47203
AD
45412002-06-17 Akim Demaille <akim@epita.fr>
4542
4543 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
4544 (symbol_list_prepend, get_type_name): Move to...
4545 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
4546 (symbol_list_prepend, symbol_list_n_type_name_get): here.
4547 Adjust all callers.
4548 (symbol_list_free): New.
4549 * src/scan-gram.l (handle_dollar): Takes a location.
4550 * tests/input.at (Invalid $n): Adjust.
4551
1e0bab92
AD
45522002-06-17 Akim Demaille <akim@epita.fr>
4553
4554 * src/reader.h, src/reader.c (symbol_list_new): Export it.
4555 (symbol_list_prepend): New.
4556 * src/parse-gram.y (%union): `list' is a new member.
4557 (symbols.1): New, replaces...
4558 (terms_to_prec.1, nterms_to_type.1): these.
4559 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
4560 Take a location as additional argument.
4561 Adjust all callers.
4562
04e60654
AD
45632002-06-15 Akim Demaille <akim@epita.fr>
4564
4565 * src/parse-gram.y: Move %token in the declaration section so that
4566 we don't depend upon CVS Bison.
4567
10e5b8bd
AD
45682002-06-15 Akim Demaille <akim@epita.fr>
4569
4570 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
4571 * src/print.c (print_core): Use it.
4572
9801d40c
AD
45732002-06-15 Akim Demaille <akim@epita.fr>
4574
4575 * src/conflicts.c (log_resolution): Accept the rule involved in
4576 the sr conflicts instead of the lookahead number that points to
4577 that rule.
4578 (flush_reduce): Accept the current lookahead vector as argument,
4579 instead of the index in LA.
4580 (resolve_sr_conflict): Accept the current number of lookahead
4581 bitset to consider for the STATE, instead of the index in LA.
4582 (set_conflicts): Adjust.
4583 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
4584
c0263492
AD
45852002-06-15 Akim Demaille <akim@epita.fr>
4586
4587 * src/state.h (state_t): Replace the `lookaheadsp' member, a
4588 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
4589 Adjust all dependencies.
4590 * src/lalr.c (initialize_lookaheads): Split into...
4591 (states_lookaheads_count, states_lookaheads_initialize): these.
4592 (lalr): Adjust.
4593
9757c359
AD
45942002-06-15 Akim Demaille <akim@epita.fr>
4595
4596 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
4597 out of...
4598 (grammar_rules_print): here.
4599 * src/reduce.c (reduce_output): Use it.
4600 * tests/reduce.at (Useless Rules, Reduced Automaton)
4601 (Underivable Rules): Adjust.
4602
6b98e4b5
AD
46032002-06-15 Akim Demaille <akim@epita.fr>
4604
4605 Copy BYacc's nice way to report the grammar.
4606
4607 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
4608 New.
4609 Don't print the rules' location, it is confusing and useless.
4610 (rule_print): Use grammar_rhs_print.
4611 * src/print.c (print_grammar): Use grammar_rules_print.
4612
6b98e4b5
AD
46132002-06-15 Akim Demaille <akim@epita.fr>
4614
4615 Complete and rationalize `useless thing' warnings.
4616
4617 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
4618 (symbol_tag_print): New.
4619 Use them everywhere in place of accessing directly the tag member.
4620 * src/gram.h, src/gram.c (rule_print): New.
4621 Use it where a rule used to be printed `by hand'.
4622 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
4623 (reduce_grammar_tables): Report the useless rules.
4624 (reduce_print): Useless things are a warning, not an error.
4625 Report it as such.
4626 * tests/reduce.at (Useless Nonterminals, Useless Rules):
4627 (Reduced Automaton, Underivable Rules): Adjust.
4628 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
4629 * tests/conflicts.at (Unresolved SR Conflicts)
4630 (Solved SR Conflicts): Adjust.
4631
ee000ba4
AD
46322002-06-15 Akim Demaille <akim@epita.fr>
4633
4634 Let symbols have a location.
4635
4636 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
4637 (getsym): Adjust.
4638 Adjust all callers.
4639 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
4640 Use location_t, not int.
4641 * src/symtab.c (symbol_check_defined): Take advantage of the
4642 location.
4643 * tests/regression.at (Invalid inputs): Adjust.
4644
8efe435c
AD
46452002-06-15 Akim Demaille <akim@epita.fr>
4646
4647 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
4648 (input): Don't try to initialize yylloc here, do it in the
4649 scanner.
4650 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
4651 * src/gram.h (rule_t): Change line and action_line into location
4652 and action_location, of location_t type.
4653 Adjust all dependencies.
4654 * src/location.h, src/location.c (empty_location): New.
4655 * src/reader.h, src/reader.c (grammar_start_symbol_set)
4656 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
4657 (grammar_current_rule_symbol_append)
4658 (grammar_current_rule_action_append): Expect a location as argument.
4659 * src/reader.c (grammar_midrule_action): Adjust to attach an
4660 action's location as dummy symbol location.
4661 * src/symtab.h, src/symtab.c (startsymbol_location): New.
4662 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
4663 the line numbers.
4664
1921f1d7
AD
46652002-06-14 Akim Demaille <akim@epita.fr>
4666
4667 Grammar declarations may be found in the grammar section.
4668
4669 * src/parse-gram.y (rules_or_grammar_declaration): New.
4670 (declarations): Each declaration may end with a semicolon, not
4671 just...
4672 (grammar_declaration): `"%union"'.
4673 (grammar): Branch to rules_or_grammar_declaration.
4674
4515534c
AD
46752002-06-14 Akim Demaille <akim@epita.fr>
4676
4677 * src/main.c (main): Invoke scanner_free.
4678
f958596b
AD
46792002-06-14 Akim Demaille <akim@epita.fr>
4680
4681 * src/output.c (m4_invoke): Extracted from...
4682 (output_skeleton): here.
4683 Free tempfile.
4684
2c569025
AD
46852002-06-14 Akim Demaille <akim@epita.fr>
4686
4687 * src/parse-gram.y (directives, directive, gram)
4688 (grammar_directives, precedence_directives, precedence_directive):
4689 Rename as...
4690 (declarations, declaration, grammar, grammar_declaration)
4691 (precedence_declaration, precedence_declarator): these.
4692 (symbol_declaration): New.
4693
592e8d4d
AD
46942002-06-14 Akim Demaille <akim@epita.fr>
4695
4696 * src/files.c (action_obstack): Remove, unused.
4697 (output_obstack): Remove it, and all its dependencies, as it is no
4698 longer needed.
4699 * src/reader.c (epilogue_set): Build the epilogue in the
4700 muscle_obstack.
4701 * src/output.h, src/output.c (muscle_obstack): Move to...
4702 * src/muscle_tab.h, src/muscle_tab.h: here.
4703 (muscle_init): Initialize muscle_obstack.
4704 (muscle_free): New.
4705 * src/main.c (main): Call it.
4706
0c15323d
AD
47072002-06-14 Akim Demaille <akim@epita.fr>
4708
4709 * src/location.h: New, extracted from...
4710 * src/reader.h: here.
4711 * src/Makefile.am (noinst_HEADERS): Merge into
4712 (bison_SOURCES): this.
4713 Add location.h.
4714 * src/parse-gram.y: Use location_t instead of Bison's.
4715 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
4716 Use location_t instead of ints.
4717
e96c9728
AD
47182002-06-14 Akim Demaille <akim@epita.fr>
4719
4720 * data/bison.simple, data/bison.c++: Be sure to restore the
4721 current #line when returning to the skeleton contents after having
4722 exposed the input file's #line.
4723
75d1fe16
AD
47242002-06-12 Akim Demaille <akim@epita.fr>
4725
4726 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
4727 eager.
4728 * tests/actions.at (Exotic Dollars): New.
4729
6c35d22c
AD
47302002-06-12 Akim Demaille <akim@epita.fr>
4731
4732 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
4733 ['"/] too eagerly.
4734 * tests/input.at (Torturing the Scanner): New.
4735
1d6412ad
AD
47362002-06-11 Akim Demaille <akim@epita.fr>
4737
4738 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
4739 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
4740 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
4741 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
4742 * src/reader.c (reader): Use it.
4743
4cdb01db
AD
47442002-06-11 Akim Demaille <akim@epita.fr>
4745
4746 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
4747 Adjust all callers.
4748 (scanner_last_string_free): New.
4749
44995b2e
AD
47502002-06-11 Akim Demaille <akim@epita.fr>
4751
4752 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
4753 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
4754 (last_string, YY_OBS_FREE): New.
4755 Use them when returning an ID.
4756
e9955c83
AD
47572002-06-11 Akim Demaille <akim@epita.fr>
4758
4759 Have Bison grammars parsed by a Bison grammar.
4760
4761 * src/reader.c, src/reader.h (prologue_augment): New.
4762 * src/reader.c (copy_definition): Remove.
4763
4764 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
4765 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
4766 (grammar_current_rule_prec_set, grammar_current_rule_check)
4767 (grammar_current_rule_symbol_append)
4768 (grammar_current_rule_action_append): Export.
4769 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
4770 (symbol_list_action_append): Remove.
4771 Hook the routines from reader.
4772 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
4773 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
4774
4775 * src/reader.c (read_declarations): Remove, unused.
4776
4777 * src/parse-gram.y: Handle the epilogue.
4778 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
4779 (grammar_start_symbol_set): this.
4780 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
4781 * src/reader.c (readgram): Remove, unused.
4782 (reader): Adjust to insert eoftoken and axiom where appropriate.
4783
4784 * src/reader.c (copy_dollar): Replace with...
4785 * src/scan-gram.h (handle_dollar): this.
4786 * src/parse-gram.y: Remove `%thong'.
4787
4788 * src/reader.c (copy_at): Replace with...
4789 * src/scan-gram.h (handle_at): this.
4790
4791 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
4792 New.
4793
4794 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
4795 time being.
4796
4797 * src/reader.h, src/reader.c (grammar_rule_end): New.
4798
4799 * src/parse.y (current_type, current_class): New.
4800 Implement `%nterm', `%token' support.
4801 Merge `%term' into `%token'.
4802 (string_as_id): New.
4803 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
4804 type name.
4805
4806 * src/parse-gram.y: Be sure to handle properly the beginning of
4807 rules.
4808
4809 * src/parse-gram.y: Handle %type.
4810 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
4811
4812 * src/parse-gram.y: More directives support.
4813 * src/options.c: No longer handle source directives.
4814
4815 * src/parse-gram.y: Fix %output.
4816
4817 * src/parse-gram.y: Handle %union.
4818 Use the prologue locations.
4819 * src/reader.c (parse_union_decl): Remove.
4820
4821 * src/reader.h, src/reader.c (epilogue_set): New.
4822 * src/parse-gram.y: Use it.
4823
4824 * data/bison.simple, data/bison.c++: b4_stype is now either not
4825 defined, then default to int, or to the contents of %union,
4826 without `union' itself.
4827 Adjust.
4828 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
4829
4830 * src/output.c (actions_output): Don't output braces, as they are
4831 already handled by the scanner.
4832
4833 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
4834 characters to themselves.
4835
4836 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
4837 that the epilogue has a proper #line.
4838
4839 * src/parse-gram.y: Handle precedence/associativity.
4840
4841 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
4842 a terminal.
4843 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
4844 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
4845 at all to define terminals that cannot be emitted.
4846
4847 * src/scan-gram.l: Escape M4 characters.
4848
4849 * src/scan-gram.l: Working properly with escapes in user
4850 strings/characters.
4851
4852 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
4853 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
4854 grammar.
4855 Use more modest sizes, as for the time being the parser does not
4856 release memory, and therefore the process swallows a huge amount
4857 of memory.
4858
4859 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
4860 stricter %token grammar.
4861
4862 * src/symtab.h (associativity): Add `undef_assoc'.
4863 (symbol_precedence_set): Do nothing when passed an undef_assoc.
4864 * src/symtab.c (symbol_check_alias_consistence): Adjust.
4865
4866 * tests/regression.at (Invalid %directive): Remove, as it is now
4867 meaningless.
4868 (Invalid inputs): Adjust to the new error messages.
4869 (Token definitions): The new grammar doesn't allow too many
4870 eccentricities.
4871
4872 * src/lex.h, src/lex.c: Remove.
4873 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
4874 (copy_character, copy_string2, copy_string, copy_identifier)
4875 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
4876 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
4877 (parse_action): Remove.
4878 * po/POTFILES.in: Adjust.
4879
2e047461
AD
48802002-06-11 Akim Demaille <akim@epita.fr>
4881
cd05d13c 4882 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
4883 rule's action member: return the action as a string.
4884 Don't require `rule_length' as an argument: compute it.
4885 (grammar_current_rule_symbol_append)
4886 (grammar_current_rule_action_append): New, eved out from
4887 (readgram): here.
4888 Remove `action_flag', `rulelength', unused now.
4889
9af3fbce
AD
48902002-06-11 Akim Demaille <akim@epita.fr>
4891
4892 * src/reader.c (grammar_current_rule_prec_set).
4893 (grammar_current_rule_check): New, eved out from...
4894 (readgram): here.
4895 Remove `xaction', `first_rhs': useless.
4896 * tests/input.at (Type clashes): New.
4897 * tests/existing.at (GNU Cim Grammar): Adjust.
4898
1485e106
AD
48992002-06-11 Akim Demaille <akim@epita.fr>
4900
4901 * src/reader.c (grammar_midrule_action): New, Eved out from
4902 (readgram): here.
4903
da4160c3
AD
49042002-06-11 Akim Demaille <akim@epita.fr>
4905
4906 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
4907 New.
4908 (readgram): Use them as replacement of inlined code, crule and
4909 crule1.
4910
f6d0f937
AD
49112002-06-11 Akim Demaille <akim@epita.fr>
4912
4913 * src/reader.c (grammar_end, grammar_symbol_append): New.
4914 (readgram): Use them.
4915 Make the use of `p' as local as possible.
4916
69078d4b
AD
49172002-06-10 Akim Demaille <akim@epita.fr>
4918
4919 GCJ's parser requires the tokens to be defined before the prologue.
4920
4921 * data/bison.simple: Output the token definition before the user's
4922 prologue.
4923 * tests/regression.at (Braces parsing, Duplicate string)
4924 (Mixing %token styles): Check the output from bison.
4925 (Early token definitions): New.
4926
5e424082
AD
49272002-06-10 Akim Demaille <akim@epita.fr>
4928
4929 * src/symtab.c (symbol_user_token_number_set): Don't complain when
4930 assigning twice the same user number to a token, so that we can
4931 use it in...
4932 * src/lex.c (lex): here.
4933 Also use `symbol_class_set' instead of hand written code.
4934 * src/reader.c (parse_assoc_decl): Likewise.
4935
44536b35
AD
49362002-06-10 Akim Demaille <akim@epita.fr>
4937
4938 * src/symtab.c, src/symtab.c (symbol_class_set)
4939 (symbol_user_token_number_set): New.
4940 * src/reader.c (parse_token_decl): Use them.
4941 Use a switch instead of ifs.
4942 Use a single argument.
4943
8b9f2372
AD
49442002-06-10 Akim Demaille <akim@epita.fr>
4945
4946 Remove `%thong' support as it is undocumented, unused, duplicates
4947 `%token's job, and creates useless e-mail traffic with people who
4948 want to know what it is, why it is undocumented, unused, and
4949 duplicates `%token's job.
4950
4951 * src/reader.c (parse_thong_decl): Remove.
4952 * src/options.c (option_table): Remove "thong".
4953 * src/lex.h (tok_thong): Remove.
4954
3ae2b51f
AD
49552002-06-10 Akim Demaille <akim@epita.fr>
4956
4957 * src/symtab.c, src/symtab.c (symbol_type_set)
4958 (symbol_precedence_set): New.
4959 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
4960 (value_components_used): Remove, unused.
4961
2f1afb73
AD
49622002-06-09 Akim Demaille <akim@epita.fr>
4963
4964 Move symbols handling code out of the reader.
4965
4966 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
4967 (axiom): Move to...
4968 * src/symtab.h, src/symtab.c: here.
4969
4970 * src/gram.c (start_symbol): Remove: use startsymbol->number.
4971 * src/reader.c (startval): Rename as...
4972 * src/symtab.h, src/symtab.c (startsymbol): this.
4973 * src/reader.c: Adjust.
4974
4975 * src/reader.c (symbol_check_defined, symbol_make_alias)
4976 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
4977 (token_translations_init)
4978 Move to...
4979 * src/symtab.c: here.
4980 * src/reader.c (packsymbols): Move to...
4981 * src/symtab.h, src/symtab.c (symbols_pack): here.
4982 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
4983 argument.
4984
e9bca3ad
AD
49852002-06-03 Akim Demaille <akim@epita.fr>
4986
4987 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
4988 then statements.
4989
86eff183
AD
49902002-06-03 Akim Demaille <akim@epita.fr>
4991
4992 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
4993 structs with non literals.
4994 * src/scan-skel.l: never-interactive.
4995 * src/conflicts.c (enum conflict_resolution_e): No trailing
4996 comma.
4997 * src/getargs.c (usage): Split long literal strings.
4998 Reported by Hans Aberg.
4999
717be197
AD
50002002-05-28 Akim Demaille <akim@epita.fr>
5001
5002 * data/bison.c++: Use C++ ostreams.
5003 (cdebug_): New member.
5004
670ddffd
AD
50052002-05-28 Akim Demaille <akim@epita.fr>
5006
5007 * src/output.c (output_skeleton): Be sure to allocate enough room
5008 for `/' _and_ for `\0' in full_skeleton.
5009
769b430f
AD
50102002-05-28 Akim Demaille <akim@epita.fr>
5011
5012 * data/bison.c++: Catch up with bison.simple:
5013 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5014 and Paul Eggert <eggert@twinsun.com>: `error' handing.
5015 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
5016 and popping traces.
5017
7067cb36
PH
50182002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5019
5020 * src/output.c (output_skeleton): Put an explicit path in front of
5021 the skeleton file name, rather than relying on the -I directory,
5022 to partially alleviate effects of having a skeleton file lying around
5023 in the current directory.
769b430f 5024
4a713ec2
PH
50252002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5026
769b430f 5027 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
5028 obstack_printf should be obstack_fgrow1.
5029
b408954b
AD
50302002-05-26 Akim Demaille <akim@epita.fr>
5031
5032 * src/state.h (state_t): `solved_conflicts' is a new member.
5033 * src/LR0.c (new_state): Set it to 0.
5034 * src/conflicts.h, src/conflicts.c (print_conflicts)
5035 (free_conflicts, solve_conflicts): Rename as...
5036 (conflicts_print, conflicts_free, conflicts_solve): these.
5037 Adjust callers.
5038 * src/conflicts.c (enum conflict_resolution_e)
5039 (solved_conflicts_obstack): New, used by...
5040 (log_resolution): this.
5041 Adjust to attach the conflict resolution to each state.
5042 Complete the description with the precedence/associativity
5043 information.
5044 (resolve_sr_conflict): Adjust.
5045 * src/print.c (print_state): Output its solved_conflicts.
5046 * tests/conflicts.at (Unresolved SR Conflicts)
5047 (Solved SR Conflicts): Exercise --report=all.
5048
a49aecd5
AD
50492002-05-26 Akim Demaille <akim@epita.fr>
5050
5051 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5052 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5053 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
5054 (token_number_t, item_number_as_token_number)
5055 (token_number_as_item_number, muscle_insert_token_number_table):
5056 Rename as...
5057 (symbol_number_t, item_number_as_symbol_number)
5058 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
5059 these, since it is more appropriate.
5060
5504898e
AD
50612002-05-26 Akim Demaille <akim@epita.fr>
5062
5063 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
5064 `Error:' lines.
5065 * data/bison.simple (yystos) [YYDEBUG]: New.
5066 (yyparse) [YYDEBUG]: Display the symbols which are popped during
5067 error recovery.
5068 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
5069
ec3bc396
AD
50702002-05-25 Akim Demaille <akim@epita.fr>
5071
5072 * doc/bison.texinfo (Debugging): Split into...
5073 (Tracing): this new section, its former contents, and...
5074 (Understanding): this new section.
5075 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
5076 by...
5077 (report_flag): this.
5078 Adjust all dependencies.
5079 (report_args, report_types, report_argmatch): New.
5080 (usage, getargs): Report/support -r, --report.
5081 * src/options.h
5082 (struct option_table_struct): Rename as..,
5083 (struct option_table_s): this.
5084 Rename the `set_flag' member to `flag' to match with getopt_long's
5085 struct.
5086 * src/options.c (option_table): Split verbose into an entry for
5087 %verbose, and another for --verbose.
5088 Support --report/-r, so remove -r from the obsolete --raw.
5089 * src/print.c: Attach full item sets and lookaheads reports to
5090 report_flag instead of trace_flag.
5091 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
5092
78df8250
PE
50932002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5094 and Paul Eggert <eggert@twinsun.com>
769b430f 5095
78df8250
PE
5096 * data/bison.simple (yyparse): Correct error handling to conform to
5097 POSIX and yacc. Specifically, after syntax error is discovered,
5098 do not reduce further before shifting the error token.
5099 Clean up the code a bit by removing the labels yyerrdefault,
5100 yyerrhandle, yyerrpop.
5101 * NEWS: Document the above.
5102
c0c9ea05
PH
51032002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5104
5105 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
5106 type; it isn't always big enough, since it doesn't necessarily
5107 include non-terminals.
769b430f 5108 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
5109 the latter can be removed.
5110 (yy_token_number_type): Remove, only one use.
5111 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
5112 don't use TokenNumberType as element type.
769b430f 5113
c0c9ea05
PH
5114 * tests/regression.at: Modify expected output to agree with change
5115 to yyr1 and yytranslate.
769b430f 5116
6390a83f
FK
51172002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
5118
5119 * src/reader.c (parse_action): Use copy_character instead of
5120 obstack_1grow.
5121
db7c8e9a
AD
51222002-05-13 Akim Demaille <akim@epita.fr>
5123
5124 * tests/regression.at (Token definitions): Prototype yylex and
5125 yyerror.
5126
fcc61800
PH
51272002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5128
158c687b 5129 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
5130 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
5131 32-bit arithmetic.
5132 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
5133
5683e9b2
AD
51342002-05-07 Akim Demaille <akim@epita.fr>
5135
5136 * tests/synclines.at: Be sure to prototype yylex and yyerror to
5137 avoid GCC warnings.
5138
0c2d3f4c
AD
51392002-05-07 Akim Demaille <akim@epita.fr>
5140
5141 Kill GCC warnings.
5142
5143 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
5144 over the RHS of each rule.
5145 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
5146 * src/state.h (state_t): Member `nitems' is unsigned short.
5147 * src/LR0.c (get_state): Adjust.
5148 * src/reader.c (packgram): Likewise.
5149 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
5150 `Type'.
5151 (muscle_insert_int_table): Remove, unused.
5152 (prepare_rules): Remove `max'.
5153
1565b720
AD
51542002-05-06 Akim Demaille <akim@epita.fr>
5155
5156 * src/closure.c (print_firsts): Display of the symbol tags.
5157 (bitmatrix_print): Move to...
5158 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
5159 here.
5160 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
5161
cfaee611
AD
51622002-05-06 Akim Demaille <akim@epita.fr>
5163
5164 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
5165 hash_do_for_each.
5166
458be8e0
AD
51672002-05-06 Akim Demaille <akim@epita.fr>
5168
5169 * src/LR0.c (new_state, get_state): Instead of using the global
5170 `kernel_size' and `kernel_base', have two new arguments:
5171 `core_size' and `core'.
5172 Adjust callers.
5173
a900a624
AD
51742002-05-06 Akim Demaille <akim@epita.fr>
5175
5176 * src/reader.c (packgram): No longer end `ritem' with a 0
5177 sentinel: it is not used.
5178
d4e7d3a1
AD
51792002-05-05 Akim Demaille <akim@epita.fr>
5180
5181 New experimental feature: display the lookaheads in the report and
5182 graph.
5183
5184 * src/print (print_core): When --trace-flag, display the rules
5185 lookaheads.
5186 * src/print_graph.c (print_core): Likewise.
5187 Swap the arguments.
5188 Adjust caller.
5189
39ceb25b
AD
51902002-05-05 Akim Demaille <akim@epita.fr>
5191
5192 * tests/torture.at (Many lookaheads): New test.
5193
5372019f
AD
51942002-05-05 Akim Demaille <akim@epita.fr>
5195
5196 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
5197 (GENERATE_MUSCLE_INSERT_TABLE): this.
5198 (output_int_table, output_unsigned_int_table, output_short_table)
5199 (output_token_number_table, output_item_number_table): Replace with...
5200 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
5201 (muscle_insert_short_table, muscle_insert_token_number_table)
5202 (muscle_insert_item_number_table): these.
5203 Adjust all callers.
5204 (prepare_tokens): Don't free `translations', since...
5205 * src/reader.h, src/reader.c (grammar_free): do it.
5206 Move to...
5207 * src/gram.h, src/gram.c (grammar_free): here.
5208 * data/bison.simple, data/bison.c++: b4_token_number_max is now
5209 b4_translate_max.
5210
5df5f6d5
AD
52112002-05-05 Akim Demaille <akim@epita.fr>
5212
5213 * src/output.c (output_unsigned_int_table): New.
5214 (prepare_rules): `i' is unsigned.
5215 `prhs', `rline', `r2' are unsigned int.
5216 Rename muscle `rhs_number_max' as `rhs_max'.
5217 Output muscles `prhs_max', `rline_max', and `r2_max'.
5218 Free rline and r1.
5219 * data/bison.simple, data/bison.c++: Adjust to use these muscles
5220 to compute types instead of constant types.
5221 * tests/regression.at (Web2c Actions): Adjust.
5222
b87f8b21
AD
52232002-05-04 Akim Demaille <akim@epita.fr>
5224
5225 * src/symtab.h (SALIAS, SUNDEF): Rename as...
5226 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
5227 Adjust dependencies.
5228 * src/output.c (token_definitions_output): Be sure not to output a
5229 `#define 'a'' when fed with `%token 'a' "a"'.
5230 * tests/regression.at (Token definitions): New.
5231
8bb936e4
PE
52322002-05-03 Paul Eggert <eggert@twinsun.com>
5233
5234 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
5235 for K&R C.
5236
52372002-05-03 gettextize <bug-gnu-gettext@gnu.org>
5238
5239 * Makefile.am (SUBDIRS): Remove intl.
5240 (EXTRA_DIST): Add config/config.rpath.
5241
53c71a12
AD
52422002-05-03 Akim Demaille <akim@epita.fr>
5243
5244 * data/bison.simple (m4_if): Don't output empty enums.
5245 And actually, output valid enum definitions :(.
5246
289dd0cf
AD
52472002-05-03 Akim Demaille <akim@epita.fr>
5248
5249 * configure.bat: Remove, completely obsolete.
5250 * Makefile.am (EXTRA_DIST): Adjust.
5251 Don't distribute config.rpath...
5252 * config/Makefile.am (EXTRA_DIST): Do it.
5253
db85e524
AD
52542002-05-03 Akim Demaille <akim@epita.fr>
5255
5256 * configure.in (GETTEXT_VERSION): New.
5257 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
5258
83ccf991
AD
52592002-05-03 Akim Demaille <akim@epita.fr>
5260
5261 * data/bison.simple (b4_token_enum): New.
5262 (b4_token_defines): Use it to output tokens both as #define and
5263 enums.
5264 Suggested by Paul Eggert.
5265 * src/output.c (token_definitions_output): Don't output spurious
5266 white spaces.
5267
1f418995
AD
52682002-05-03 Akim Demaille <akim@epita.fr>
5269
5270 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5271
45119f04
RA
52722002-05-02 Robert Anisko <robert@lrde.epita.fr>
5273
5274 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
5275 Update the stack class, give a try to deque as the default container.
5276
b2d52318
AD
52772002-05-02 Akim Demaille <akim@epita.fr>
5278
5279 * data/bison.simple (yyparse): Do not implement @$ = @1.
5280 (YYLLOC_DEFAULT): Adjust to do it.
5281 * doc/bison.texinfo (Location Default Action): Fix.
5282
3a8b4109
AD
52832002-05-02 Akim Demaille <akim@epita.fr>
5284
5285 * src/reader.c (parse_braces): Merge into...
5286 (parse_action): this.
5287
84614e13
AD
52882002-05-02 Akim Demaille <akim@epita.fr>
5289
5290 * configure.in (ALL_LINGUAS): Remove.
5291 * po/LINGUAS, hr.po: New.
5292
fdbcd8e2
AD
52932002-05-02 Akim Demaille <akim@epita.fr>
5294
5295 Remove the so called hairy (semantic) parsers.
5296
5297 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
5298 * src/gram.h, src/gram.c (semantic_parser): Remove.
5299 (rule_t): Remove the guard and guard_line members.
5300 * src/lex.h (token_t): remove tok_guard.
5301 * src/options.c (option_table): Remove %guard and %semantic_parser
5302 support.
5303 * src/output.c, src/output.h (guards_output): Remove.
5304 (prepare): Adjust.
5305 (token_definitions_output): Don't output the `T'
5306 tokens (???).
5307 (output_skeleton): Don't output the guards.
5308 * src/files.c, src/files.c (attrsfile): Remove.
5309 * src/reader.c (symbol_list): Remove the guard and guard_line
5310 members.
5311 Adjust dependencies.
5312 (parse_guard): Remove.
5313 * data/bison.hairy: Remove.
5314 * doc/bison.texinfo (Environment Variables): Remove occurrences of
5315 BISON_HAIRY.
5316
82b6cb3f
AD
53172002-05-02 Akim Demaille <akim@epita.fr>
5318
5319 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
5320 (parse_guard): Rename the formal argument `stack_offset' as
5321 `rule_length', which is more readable.
5322 Adjust callers.
5323 (copy_at, copy_dollar): Instead of outputting the hard coded
5324 values of $$, $n and so forth, output invocation to b4_lhs_value,
5325 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
5326 Note: this patch partially drops `semantic-parser' support: it
5327 always does `rule_length - n', where semantic parsers ought to
5328 always use `-n'.
82b6cb3f
AD
5329 * data/bison.simple, data/bison.c++ (b4_lhs_value)
5330 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
5331
6cbfbcc5
AD
53322002-05-02 Akim Demaille <akim@epita.fr>
5333
5334 * configure.in (AC_INIT): Bump to 1.49b.
5335 (AM_INIT_AUTOMAKE): Short invocation.
5336
b8548114
AD
53372002-05-02 Akim Demaille <akim@epita.fr>
5338
5339 Version 1.49a.
5340
c20cd1fa
AD
53412002-05-01 Akim Demaille <akim@epita.fr>
5342
5343 * src/skeleton.h: Remove.
5344
8a9566d4
AD
53452002-05-01 Akim Demaille <akim@epita.fr>
5346
5347 * src/skeleton.h: Fix the #endif.
5348 Reported by Magnus Fromreide.
5349
8c6d399a
PE
53502002-04-26 Paul Eggert <eggert@twinsun.com>
5351
5352 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
5353 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 5354 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 5355
2b7ed18a
RA
53562002-04-25 Robert Anisko <robert@lrde.epita.fr>
5357
5358 * src/scan-skel.l: Postprocess quadrigraphs.
5359
5360 * src/reader.c (copy_character): New function, used to output
5361 single characters while replacing `[' and `]' with quadrigraphs, to
5362 avoid troubles with M4 quotes.
5363 (copy_comment): Output characters with copy_character.
5364 (read_additionnal_code): Likewise.
5365 (copy_string2): Likewise.
5366 (copy_definition): Likewise.
5367
5368 * tests/calc.at: Exercise M4 quoting.
5369
34a89c50
AD
53702002-04-25 Akim Demaille <akim@epita.fr>
5371
5372 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
5373 between `!' and the command.
5374 Reported by Paul Eggert.
5375
0dd1580a
RA
53762002-04-24 Robert Anisko <robert@lrde.epita.fr>
5377
5378 * tests/calc.at: Exercise prologue splitting.
5379
5380 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
5381 `b4_post_prologue' instead of `b4_prologue'.
5382
5383 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
5384 muscles.
5385 (output): Free pre_prologue_obstack and post_prologue_obstack.
5386 * src/files.h, src/files.c (attrs_obstack): Remove.
5387 (pre_prologue_obstack, post_prologue_obstack): New.
5388 * src/reader.c (copy_definition): Add a parameter to specify the
5389 obstack to fill, instead of using attrs_obstack unconditionally.
5390 (read_declarations): Pass pre_prologue_obstack to copy_definition if
5391 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
5392
83c1796f
PE
53932002-04-23 Paul Eggert <eggert@twinsun.com>
5394
5395 * data/bison.simple: Remove unnecessary commentary and white
5396 space differences from 1_29-branch.
5397 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
5398
5399 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
5400 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
5401 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
5402 constructors or destructors.
5403
5404 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
5405
1207eeac
AD
54062002-04-23 Akim Demaille <akim@epita.fr>
5407
5408 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
5409 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
5410 location with columns.
5411 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
5412 All reported by Paul Eggert.
5413
78ab8f67
AD
54142002-04-22 Akim Demaille <akim@epita.fr>
5415
5416 * src/reduce.c (dump_grammar): Move to...
5417 * src/gram.h, src/gram.c (grammar_dump): here.
5418 Be sure to separate long item numbers.
5419 Don't read the members of a rule's prec if its nil.
5420
133c20e2
AD
54212002-04-22 Akim Demaille <akim@epita.fr>
5422
5423 * src/output.c (table_size, table_grow): New.
5424 (MAXTABLE): Remove, replace uses with table_size.
5425 (pack_vector): Instead of dying when the table is too big, grow it.
5426
9515e8a7
AD
54272002-04-22 Akim Demaille <akim@epita.fr>
5428
5429 * data/bison.simple (yyr1): Its type is that of a token number.
5430 * data/bison.c++ (r1_): Likewise.
5431 * tests/regression.at (Web2c Actions): Adjust.
5432
23c5a174
AD
54332002-04-22 Akim Demaille <akim@epita.fr>
5434
5435 * src/reader.c (token_translations_init): 256 is now the default
5436 value for the error token, i.e., it will be assigned another
5437 number if the user assigned 256 to one of her tokens.
5438 (reader): Don't force 256 to error.
5439 * doc/bison.texinfo (Symbols): Adjust.
5440 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
5441 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
5442 etc. instead of 10, 20, 30 (which was used to `jump' over error
5443 (256) and undefined (2)).
5444
5fbb0954
AD
54452002-04-22 Akim Demaille <akim@epita.fr>
5446
5447 Propagate more token_number_t.
5448
5449 * src/gram.h (token_number_as_item_number)
5450 (item_number_as_token_number): New.
5451 * src/output.c (GENERATE_OUTPUT_TABLE): New.
5452 Use it to create output_item_number_table and
5453 output_token_number_table.
5454 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5455 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
5456 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
5457 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
5458
4f940944
AD
54592002-04-22 Akim Demaille <akim@epita.fr>
5460
5461 * src/output.h, src/output.c (get_lines_number): Remove.
5462
3ded9a63
AD
54632002-04-19 Akim Demaille <akim@epita.fr>
5464
5465 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
5466 as Lex/Flex'.
5467 (Debugging): More details about enabling the debugging features.
5468 (Table of Symbols): Describe $$, $n, @$, and @n.
5469 Suggested by Tim Josling.
5470
e0c471a9
AD
54712002-04-19 Akim Demaille <akim@epita.fr>
5472
5473 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
5474
fecc10cd
AD
54752002-04-10 Akim Demaille <akim@epita.fr>
5476
5477 * src/system.h: Rely on HAVE_LIMITS_H.
5478 Suggested by Paul Eggert.
5479
51dec47b
AD
54802002-04-09 Akim Demaille <akim@epita.fr>
5481
5482 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
5483 full stderr, and strip it according to the bison options, instead
5484 of composing the error message from different bits.
5485 This makes it easier to check for several error messages.
5486 Adjust all the invocations.
5487 Add an invocation exercising the error token.
5488 Add an invocation demonstrating a stupid error message.
5489 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
5490 Adjust the tests.
5491 Error message are for stderr, not stdout.
5492
007a50a4
AD
54932002-04-09 Akim Demaille <akim@epita.fr>
5494
5495 * src/gram.h, src/gram.c (error_token_number): Remove, use
5496 errtoken->number.
5497 * src/reader.c (reader): Don't specify the user token number (2)
5498 for $undefined, as it uselessly prevents using it.
5499 * src/gram.h (token_number_t): Move to...
5500 * src/symtab.h: here.
5501 (state_t.number): Is a token_number_t.
5502 * src/print.c, src/reader.c: Use undeftoken->number instead of
5503 hard coded 2.
5504 (Even though this 2 is not the same as above: the number of the
5505 undeftoken remains being 2, it is its user token number which
5506 might not be 2).
5507 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
5508 `user_token_number_max'.
5509 Output `undef_token_number'.
5510 * data/bison.simple, data/bison.c++: Use them.
5511 Be sure to map invalid yylex return values to
5512 `undef_token_number'. This saves us from gratuitous SEGV.
5513
5514 * tests/conflicts.at (Solved SR Conflicts)
5515 (Unresolved SR Conflicts): Adjust.
5516 * tests/regression.at (Web2c Actions): Adjust.
5517
06446ccf
AD
55182002-04-08 Akim Demaille <akim@epita.fr>
5519
5520 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
5521 Adding #line.
5522 Remove the duplicate `typedefs'.
5523 (RhsNumberType): Fix the declaration and various other typos.
5524 Use __ofile__.
5525 * data/bison.simple: Use __ofile__.
5526 * src/scan-skel.l: Handle __ofile__.
5527
62a3e4f0
AD
55282002-04-08 Akim Demaille <akim@epita.fr>
5529
5530 * src/gram.h (item_number_t): New, the type of item numbers in
5531 RITEM. Note that it must be able to code symbol numbers as
5532 positive number, and the negation of rule numbers as negative
5533 numbers.
5534 Adjust all dependencies (pretty many).
5535 * src/reduce.c (rule): Remove this `short *' pointer: use
5536 item_number_t.
5537 * src/system.h (MINSHORT, MAXSHORT): Remove.
5538 Include `limits.h'.
5539 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
5540 (shortcpy): Remove.
5541 (MAXTABLE): Move to...
5542 * src/output.c (MAXTABLE): here.
5543 (prepare_rules): Use output_int_table to output rhs.
5544 * data/bison.simple, data/bison.c++: Adjust.
5545 * tests/torture.at (Big triangle): Move the limit from 254 to
5546 500.
5547 * tests/regression.at (Web2c Actions): Ajust.
5548
5549 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
5550 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
5551 passes, but produces negative #line number, once fixed, GCC is
5552 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
5553 C), it passes.
5554 * src/state.h (state_h): Code input lines on ints, not shorts.
5555
bb88b0fc
AD
55562002-04-08 Akim Demaille <akim@epita.fr>
5557
5558 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
5559 and then the grammar.
5560
9a636f47
AD
55612002-04-08 Akim Demaille <akim@epita.fr>
5562
5563 * src/system.h: No longer using strndup.
5564
680e8701
AD
55652002-04-07 Akim Demaille <akim@epita.fr>
5566
5567 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
5568 * src/output.c (output_table_data): Return the longest number.
5569 (prepare_tokens): Output `token_number_max').
5570 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
5571 New.
5572 Use them to define yy_token_number_type/TokenNumberType.
5573 Use this type for yytranslate.
5574 * tests/torture.at (Big triangle): Push the limit from 124 to
5575 253.
5576 * tests/regression.at (Web2c Actions): Adjust.
5577
817e9f41
AD
55782002-04-07 Akim Demaille <akim@epita.fr>
5579
5580 * tests/torture.at (Big triangle): New.
5581 (GNU AWK Grammar, GNU Cim Grammar): Move to...
5582 * tests/existing.at: here.
5583
5123689b
AD
55842002-04-07 Akim Demaille <akim@epita.fr>
5585
5586 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
5587 nritems.
5588 Adjust dependencies.
5589
f3849179
AD
55902002-04-07 Akim Demaille <akim@epita.fr>
5591
5592 * src/reader.c: Normalize increments to prefix form.
5593
bd02036a
AD
55942002-04-07 Akim Demaille <akim@epita.fr>
5595
5596 * src/reader.c, symtab.c: Remove debugging code.
5597
db8837cb
AD
55982002-04-07 Akim Demaille <akim@epita.fr>
5599
5600 Rename all the `bucket's as `symbol_t'.
5601
5602 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
5603 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
5604 * src/symtab.c, src/symtab.h (bucket): Rename as...
5605 (symbol_t): this.
5606 (symbol_list_new, bucket_check_defined, bucket_make_alias)
5607 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
5608 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
5609 (buckets_new, buckets_free, buckets_do): Rename as...
5610 (symbol_list_new, symbol_check_defined, symbol_make_alias)
5611 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5612 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
5613 (symbols_new, symbols_free, symbols_do): these.
5614
72a23c97
AD
56152002-04-07 Akim Demaille <akim@epita.fr>
5616
5617 Use lib/hash for the symbol table.
5618
5619 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
5620 EOF.
5621 * src/lex.c (lex): Set the `number' member of new terminals.
5622 * src/reader.c (bucket_check_defined, bucket_make_alias)
5623 (bucket_check_alias_consistence, bucket_translation): New.
5624 (reader, grammar_free, readgram, token_translations_init)
5625 (packsymbols): Adjust.
5626 (reader): Number the predefined tokens.
5627 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
5628 for predefined tokens.
5629 * src/symtab.h (bucket): Remove all the hash table related
5630 members.
5631 * src/symtab.c (symtab): Replace by...
5632 (bucket_table): this.
5633 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
5634 (buckets_new, buckets_do): New.
5635
280a38c3
AD
56362002-04-07 Akim Demaille <akim@epita.fr>
5637
5638 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
5639 (start_symbol, max_user_token_number, semantic_parser)
5640 (error_token_number): Initialize.
5641 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
5642 Initialize.
5643 (reader): Don't.
5644 (errtoken, eoftoken, undeftoken, axiom): Extern.
5645
03b31c0c
AD
56462002-04-07 Akim Demaille <akim@epita.fr>
5647
5648 * src/gram.h (rule_s): prec and precsym are now pointers
5649 to the bucket giving the priority/associativity.
5650 Member `associativity' removed: useless.
5651 * src/reduce.c, src/conflicts.c: Adjust.
5652
8b3df748
AD
56532002-04-07 Akim Demaille <akim@epita.fr>
5654
5655 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
5656 Properly escape the symbols' TAG when outputting them.
5657
e601aa1d
AD
56582002-04-07 Akim Demaille <akim@epita.fr>
5659
5660 * src/lalr.h (LA): Is a bitsetv, not bitset*.
5661
b0299a2e
AD
56622002-04-07 Akim Demaille <akim@epita.fr>
5663
5664 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
5665 (LArule): this, which is an array to rule_t*.
5666 * src/print.c, src/conflicts.c: Adjust.
5667
d7e1f00c
AD
56682002-04-07 Akim Demaille <akim@epita.fr>
5669
5670 * src/gram.h (rule_t): Rename `number' as `user_number'.
5671 `number' is a new member.
5672 Adjust dependencies.
5673 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
5674
cc9305dd
AD
56752002-04-07 Akim Demaille <akim@epita.fr>
5676
5677 As a result of the previous patch, it is no longer needed
5678 to reorder ritem itself.
5679
5680 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
5681
b0940840
AD
56822002-04-07 Akim Demaille <akim@epita.fr>
5683
5684 Be sure never to walk through RITEMS, but use only data related to
5685 the rules themselves. RITEMS should be banished.
5686
5687 * src/output.c (output_token_translations): Rename as...
5688 (prepare_tokens): this.
5689 In addition to `translate', prepare the muscles `tname' and
5690 `toknum', which were handled by...
5691 (output_rule_data): this.
5692 Remove, and move the remainder of its outputs into...
5693 (prepare_rules): this new routines, which also merges content from
5694 (output_gram): this.
5695 (prepare_rules): Be sure never to walk through RITEMS.
5696 (output_stos): Rename as...
5697 (prepare_stos): this.
5698 (output): Always invoke prepare_states, after all, just don't use it
5699 in the output if you don't need it.
5700
643a5994
AD
57012002-04-07 Akim Demaille <akim@epita.fr>
5702
5703 * src/LR0.c (new_state): Display `nstates' as the name of the
5704 newly created state.
5705 Adjust to initialize first_state and last_state if needed.
5706 Be sure to distinguish the initial from the final state.
5707 (new_states): Create the itemset of the initial state, and use
5708 new_state.
5709 * src/closure.c (closure): Now that the initial state has its
5710 items properly set, there is no need for a special case when
5711 creating `ruleset'.
5712
5713 As a result, now the rule 0, reducing to $axiom, is visible in the
5714 outputs. Adjust the test suite.
5715
5716 * tests/conflicts.at (Solved SR Conflicts)
5717 (Unresolved SR Conflicts): Adjust.
5718 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
5719 * tests/conflicts.at (S/R in initial): New.
5720
b4c4ccc2
AD
57212002-04-07 Akim Demaille <akim@epita.fr>
5722
5723 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
5724 the RHS of the rules.
5725 * src/output.c (output_gram): Likewise.
5726
bba97eb2
AD
57272002-04-07 Akim Demaille <akim@epita.fr>
5728
5729 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
5730 bucket.
5731 Adjust all dependencies.
5732 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
5733 `number' of the buckets too.
5734 * src/gram.h: Include `symtab.h'.
5735 (associativity): Move to...
5736 * src/symtab.h: here.
5737 No longer include `gram.h'.
5738
c3b407f4
AD
57392002-04-07 Akim Demaille <akim@epita.fr>
5740
5741 * src/gram.h, src/gram.c (rules_rhs_length): New.
5742 (ritem_longest_rhs): Use it.
5743 * src/gram.h (rule_t): `number' is a new member.
5744 * src/reader.c (packgram): Set it.
5745 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
5746 the end of `rules', and count them out of `nrules'.
5747 (reduce_output, dump_grammar): Adjust.
5748 * src/print.c (print_grammar): It is no longer needed to check for
5749 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
5750 * tests/reduce.at (Reduced Automaton): New test.
5751
11652ab3
AD
57522002-04-07 Akim Demaille <akim@epita.fr>
5753
5754 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
5755 lacking `+ 1' to nrules, Bison reported as useless a token if it
5756 was used solely to set the precedence of the last rule...
5757
26b23c1a
AD
57582002-04-07 Akim Demaille <akim@epita.fr>
5759
5760 * data/bison.c++, data/bison.simple: Don't output the current file
5761 name in #line, to avoid useless diffs between two identical
5762 outputs under different names.
5763
18bcecb0
AD
57642002-04-07 Akim Demaille <akim@epita.fr>
5765
5766 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
5767 Normalize loops to using `< nrules + 1', not `<= nrules'.
5768
fa770c86
AD
57692002-04-07 Akim Demaille <akim@epita.fr>
5770
5771 * TODO: Update.
5772
d9b739c3
AD
57732002-04-07 Akim Demaille <akim@epita.fr>
5774
5775 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
5776 bucket.value as bucket.number.
5777
99013900
AD
57782002-04-07 Akim Demaille <akim@epita.fr>
5779
5780 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
5781 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5782 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
5783 RHS, instead of being an index in RITEMS.
5784
e966383b
PE
57852002-04-04 Paul Eggert <eggert@twinsun.com>
5786
5787 * doc/bison.texinfo: Update copyright date.
5788 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
5789 (Symbols): Warn about running Bison in one character set,
5790 but compiling and/or running in an incompatible one.
5791 Warn about character code 256, too.
5792
57932002-04-03 Paul Eggert <eggert@twinsun.com>
5794
5795 * src/bison.data (YYSTACK_ALLOC): Depend on whether
5796 YYERROR_VERBOSE is nonzero, not whether it is defined.
5797
5798 Merge changes from bison-1_29-branch.
c307773e 5799
8d6c48b9
PE
58002002-03-20 Paul Eggert <eggert@twinsun.com>
5801
5802 Merge fixes from Debian bison_1.34-1.diff.
5803
5804 * configure.in (AC_PREREQ): 2.53.
5805
e53c6322
AD
58062002-03-20 Akim Demaille <akim@epita.fr>
5807
5808 * src/conflicts.c (log_resolution): Argument `resolution' is const.
5809
9ffbeca7
PE
58102002-03-19 Paul Eggert <eggert@twinsun.com>
5811
21db0b2a
PE
5812 * src/bison.simple (YYCOPY): New macro.
5813 (YYSTACK_RELOCATE): Use it.
5814 Remove Type arg; no longer needed. All callers changed.
5815 (yymemcpy): Remove; no longer needed.
5816
9ffbeca7
PE
5817 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
5818 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5819
642cb8f8
AD
58202002-03-19 Akim Demaille <akim@epita.fr>
5821
5822 Test and fix the #line outputs.
5823
5824 * tests/atlocal.at (GCC): New.
5825 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
5826 (Prologue synch line, ,%union synch line, Postprologue synch line)
5827 (Action synch line, Epilogue synch line): New tests.
5828 * src/reader.c (parse_union_decl): Define the muscle stype_line.
5829 * data/bison.simple, data/bison.c++: Use it.
5830
3c31a486
AD
58312002-03-19 Akim Demaille <akim@epita.fr>
5832
5833 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
5834 (Solved SR Conflicts, %expect not enough, %expect right)
5835 (%expect too much): Move to...
5836 * tests/conflicts.at: this new file.
5837
0d8bed56
AD
58382002-03-19 Akim Demaille <akim@epita.fr>
5839
5840 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5841 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
5842 that we can move to enums for instance.
5843 * src/output.c (token_definitions_output): Output a list of
5844 `token-name, token-number' instead of the #define.
5845 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
5846
9208d17f
AD
58472002-03-14 Akim Demaille <akim@epita.fr>
5848
5849 Use Gettext 0.11.1.
5850
af27eacb
RA
58512002-03-09 Robert Anisko <robert@lrde.epita.fr>
5852
5853 * data/bison.c++: Make the user able to add members to the generated
5854 parser by subclassing.
5855
9101a310
RA
58562002-03-05 Robert Anisko <robert@lrde.epita.fr>
5857
5858 * src/reader.c (read_additionnal_code): `c' should be an integer, not
5859 a character.
5860 Reported by Nicolas Tisserand and Nicolas Burrus.
5861
fff9bf0b
RA
58622002-03-04 Robert Anisko <robert@lrde.epita.fr>
5863
5864 * src/reader.c: Warn about lacking semi-colons, do not complain.
5865
64dba31e
RA
58662002-03-04 Robert Anisko <robert@lrde.epita.fr>
5867
5868 * data/bison.c++: Remove a debug line.
5869
374f5a14
RA
58702002-03-04 Robert Anisko <robert@lrde.epita.fr>
5871
5872 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
5873 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
5874 provide a default implementation.
5875
bfcf1f3a
AD
58762002-03-04 Akim Demaille <akim@epita.fr>
5877
5878 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
5879 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
5880 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
5881 * tests/semantic.at (Parsing Guards): Similarly.
5882 * src/reader.at (readgram): Complain if the last rule is not ended
5883 with a semi-colon.
5884
65ccf9fc
AD
58852002-03-04 Akim Demaille <akim@epita.fr>
5886
5887 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
5888 * src/closure.c: here.
5889 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
5890 RTC.
5891 * src/warshall.h, src/warshall.c: Remove.
5892 * tests/sets.at (Broken Closure): Adjust.
5893
d0039cbc
AD
58942002-03-04 Akim Demaille <akim@epita.fr>
5895
5896 * src/output.c (output_skeleton): tempdir is const.
5897 bytes_read is unused.
5898
345cea78
AD
58992002-03-04 Akim Demaille <akim@epita.fr>
5900
5901 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
5902 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
5903 Update.
5904 From Michael Hayes.
5905
564801f7
AD
59062002-03-04 Akim Demaille <akim@epita.fr>
5907
5908 * src/closure.c (closure): `r' is unused.
5909
e5352bc7
AD
59102002-03-04 Akim Demaille <akim@epita.fr>
5911
5912 * tests/sets.at (Broken Closure): Add the ending `;'.
5913 * src/reader.at (readgram): Complain if a rule is not ended with a
5914 semi-colon.
5915
914feea9
AD
59162002-03-04 Akim Demaille <akim@epita.fr>
5917
5918 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
5919 (count_sr_conflicts): Use bitset_count.
5920 * src/reduce.c (inaccessable_symbols): Ditto.
5921 (bits_size): Remove.
5922 * src/warshall.h, src/warshall.c: Convert to bitsetv.
5923
f0250de6
AD
59242002-03-04 Akim Demaille <akim@epita.fr>
5925
5926 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
5927 * src/reduce.c: Remove the `bitset_zero's following the
5928 `bitset_create's, as now it is performed by the latter.
5929
ef017502
AD
59302002-03-04 Akim Demaille <akim@epita.fr>
5931
5932 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
5933 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
5934 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
5935 latest sources from Michael.
5936
76514394
AD
59372002-03-04 Akim Demaille <akim@epita.fr>
5938
5939 * src/output.c (output): Don't free the grammar.
5940 * src/reader.c (grammar_free): New.
5941 * src/main.c (main): Call it and don't free symtab here.
5942
55024580
AD
59432002-03-04 Akim Demaille <akim@epita.fr>
5944
5945 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
5946 before returning.
5947 Reported by Benoit Perrot.
5948
f9abaa2c
AD
59492002-03-04 Akim Demaille <akim@epita.fr>
5950
5951 Use bitset operations when possible, not loops over bits.
5952
5953 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
5954 bitset_or.
5955 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
5956 * src/reduce.c (useless_nonterminals): Formatting changes.
5957 * src/warshall.c (TC): Use bitset_or.
5958
0e721e75
AD
59592002-03-04 Akim Demaille <akim@epita.fr>
5960
5961 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
5962 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
5963 Ditto.
5964
0fb1ffb1
AD
59652002-03-04 Akim Demaille <akim@epita.fr>
5966
5967 * src/lalr.c (F): Now a bitset*.
5968 Adjust all dependencies.
5969
b86796bf
AD
59702002-03-04 Akim Demaille <akim@epita.fr>
5971
5972 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
5973 Adjust all dependencies.
5974
602bbf31
AD
59752002-03-04 Akim Demaille <akim@epita.fr>
5976
5977 * src/L0.c, src/LR0.h (nstates): Be size_t.
5978 Adjust comparisons (signed vs unsigned).
5979 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
5980 bitset*.
5981 Adjust all dependencies.
5982
d8a0245c
AD
59832002-03-04 Akim Demaille <akim@epita.fr>
5984
5985 * src/closure.c (firsts): Now, also a bitset.
5986 Adjust all dependencies.
5987 (varsetsize): Remove, now unused.
5988 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
5989
34ba9743
AD
59902002-03-04 Akim Demaille <akim@epita.fr>
5991
5992 * src/print.c: Convert to use bitset.h, not hand coded iterations
5993 over ints.
5994
ed86e78c
AD
59952002-03-04 Akim Demaille <akim@epita.fr>
5996
5997 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
5998
dfdb1797
AD
59992002-03-04 Akim Demaille <akim@epita.fr>
6000
6001 * src/closure.c (ruleset): Be a bitset.
6002 (rulesetsize): Remove.
6003
7086e707
AD
60042002-03-04 Akim Demaille <akim@epita.fr>
6005
6006 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
6007 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
6008 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
6009 * src/closure.c (fderives): Be an array of bitsets.
6010
98254360
RA
60112002-02-28 Robert Anisko <robert@lrde.epita.fr>
6012
6013 * data/bison.c++: Merge the two generated headers. Insert a copyright
6014 notice in each output file.
6015
a75c057f
AD
60162002-02-28 Akim Demaille <akim@epita.fr>
6017
6018 * data/bison.c++: Copy the prologue of bison.simple to fetch
6019 useful M4 definitions, such as b4_header_guard.
6020
06b00abc
AD
60212002-02-25 Akim Demaille <akim@epita.fr>
6022
6023 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
6024 translator friendly scheme for the bgr
6025 copyright notice.
06b00abc 6026
70e7d534
AD
60272002-02-25 Akim Demaille <akim@epita.fr>
6028
6029 * src/output.c (header_output): Remove, now handled completely via
6030 M4.
6031
abe017f6
AD
60322002-02-25 Akim Demaille <akim@epita.fr>
6033
6034 * m4/m4.m4: New, from CVS Autoconf.
6035 * configure.in: Invoke it.
6036 * src/output.c (output_skeleton): Use its result instead of the
6037 hard coded name.
6038
381fb12e
AD
60392002-02-25 Akim Demaille <akim@epita.fr>
6040
6041 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
6042 Fileutils 4.1.5.
6043 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
6044 * src/output.c (output_skeleton): Use mkstemp to create a real
6045 temporary file.
6046 Move the filling of `skeleton' and its muscle to...
6047 (prepare): here.
6048 (output): Move the definition of the prologue muscle to...
6049 (prepare): here.
6050 * src/system.h (DEFAULT_TMPDIR): New.
6051
6f38107f
PE
60522002-02-14 Paul Eggert <eggert@twinsun.com>
6053
6054 Remove the support for C++ namespace cleanliness; it was
6055 causing more problems than it was curing, since it didn't work
6056 properly on some nonstandard C++ compilers. This can wait
6057 for a proper C++ parser.
6058
6059 * NEWS: Document this.
6060 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
6061 of C++, as it's treated like C now.
6062 * src/bison.simple (YYSTD): Remove.
6063 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
6064 Treat C++ just like Standard C instead of trying to support
6065 namespace cleanliness.
6066
80cce3da
AD
60672002-02-14 Akim Demaille <akim@epita.fr>
6068
6069 * tests/regression.at (else): Adjust to Andreas' change.
6070
842e8679
AD
60712002-02-14 Akim Demaille <akim@epita.fr>
6072
6073 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
6074
4bda3f10
AD
60752002-02-13 Andreas Schwab <schwab@suse.de>
6076
6077 * src/output.c (output_rule_data): Don't output NULL, it might
6078 not be defined yet.
6079
4162fa07 60802002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 6081
4162fa07
RA
6082 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
6083 (Copyright notice): Update.
b418ecd8 6084
bd16a5dc
AD
60852002-02-11 Akim Demaille <akim@epita.fr>
6086
6087 * tests/regression.at (%nonassoc and eof): Don't include
6088 nonportable headers.
6089
8d69a1a3
RA
60902002-02-08 Robert Anisko <robert@lrde.epita.fr>
6091
6092 * data/bison.c++: Correct error recovery. Make the user able to
6093 initialize the starting location.
6094
9b2d0677
AD
60952002-02-07 Akim Demaille <akim@epita.fr>
6096
6097 * tests/input.at: New.
6098
69e2658b
RA
60992002-02-07 Robert Anisko <robert@lrde.epita.fr>
6100
6101 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 6102 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
6103 directives around tables only needed for debugging.
6104
4aacc3a7
RA
61052002-02-07 Robert Anisko <robert@lrde.epita.fr>
6106
6107 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
6108 C++ parsers.
6109 (yy::b4_name::parse): Use print_.
6110
762a801e
RA
61112002-02-07 Robert Anisko <robert@lrde.epita.fr>
6112
6113 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
6114
4bb2bc3f
RA
61152002-02-07 Robert Anisko <robert@lrde.epita.fr>
6116
6117 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
6118 C++ parsers.
6119 (yy::b4_name::parse): Build verbose error messages, and use error_.
6120
6b45a3ca
RA
61212002-02-06 Robert Anisko <robert@lrde.epita.fr>
6122
6123 * data/bison.c++: Fix m4 quoting in comments.
6124
50997c6e
RA
61252002-02-06 Robert Anisko <robert@lrde.epita.fr>
6126
6127 * data/bison.c++: Adjust the parser code. Fix some muscles that were
6128 not expanded by m4.
6129
3f3eed27
AD
61302002-02-05 Akim Demaille <akim@epita.fr>
6131
6132 * data/bison.c++: Adjust to the M4 back end.
6133 More is certainly needed.
6134
be2a1a68
AD
61352002-02-05 Akim Demaille <akim@epita.fr>
6136
6137 Give a try to M4 as a back end.
6138
6139 * lib/readpipe.c: New, from wdiff.
6140 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
6141 BISON_HAIRY.
6142 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
6143 specific values. Now it is m4 that performs the lookup.
6144 * src/parse-skel.y: Remove.
6145 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
6146 * src/output.c (actions_output, guards_output)
6147 (token_definitions_output): No longer keeps track of the output
6148 line number, hence remove the second argument.
6149 (guards_output): Check against the guard member of a rule, not the
6150 action member.
6151 Adjust callers.
6152 (output_skeleton): Don't look for the skeleton location, let m4 do
6153 that.
6154 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
6155 file will be used.
6156 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
6157 (prepare): Given that for the time being changesyntax is not
6158 usable in M4, rename the muscles using `-' to `_'.
6159 Define `defines_flag', `output_parser_name' and `output_header_name'.
6160 * src/output.h (actions_output, guards_output)
6161 (token_definitions_output): Adjust prototypes.
6162 * src/scan-skel.l: Instead of scanning the skeletons, it now
6163 processes the output of m4: `__oline__' and `#output'.
6164 * data/bison.simple: Adjust to be used by M4(sugar).
6165 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
6166 to date.
6167 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
6168 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
6169 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
6170 shamelessly stolen from CVS Autoconf.
6171
beda758b
AD
61722002-02-05 Akim Demaille <akim@epita.fr>
6173
6174 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
6175 * configure.in: Check for the declarations of free and malloc.
6176 * src/muscle_tab.c: Adjust.
6177
5ece6d43
AD
61782002-02-05 Akim Demaille <akim@epita.fr>
6179
6180 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
6181 which have no values.
6182
5bb18f9a
AD
61832002-02-05 Akim Demaille <akim@epita.fr>
6184
6185 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
6186 * data/: here.
6187
894dd62e
PE
61882002-01-29 Paul Eggert <eggert@twinsun.com>
6189
6190 * src/bison.simple (YYSIZE_T): Do not define merely because
6191 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
6192 On some platforms, <alloca.h> does not declare YYSTD (size_t).
6193
82841af7
AD
61942002-01-27 Akim Demaille <akim@epita.fr>
6195
6196 Fix `%nonassoc and eof'.
6197
6198 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
6199 which were not properly copied! Replace
6200 memcpy (res->errs, src->errs, src->nerrs);
6201 with
6202 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
6203 !!!
6204 * tests/regression.at (%nonassoc and eof): Adjust to newest
6205 Autotest: `.' is not in the PATH.
6206
318b76e9
AD
62072002-01-27 Akim Demaille <akim@epita.fr>
6208
6209 * tests/sets.at (AT_EXTRACT_SETS): New.
6210 (Nullable): Use it.
6211 (Firsts): New.
6212
30d2f3d5
AD
62132002-01-26 Akim Demaille <akim@epita.fr>
6214
6215 * tests/actions.at, tests/calc.at, tests/headers.at,
6216 * tests/torture.at: Adjust to the newest Autotest which no longer
6217 forces `.' in the PATH.
6218
30f8c395
AD
62192002-01-25 Akim Demaille <akim@epita.fr>
6220
6221 * tests/regression.at (%nonassoc and eof): New.
6222 Suggested by Robert Anisko.
6223
29ae55f1
AD
62242002-01-24 Akim Demaille <akim@epita.fr>
6225
6226 Bison dumps core when trying to complain about broken input files.
6227 Reported by Cris van Pelt.
6228
6229 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
6230 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
6231 into...
6232 (Invalid inputs): Strengthen: exercise parse_percent_token.
6233
2b548aa6
RA
62342002-01-24 Robert Anisko <robert.anisko@epita.fr>
6235
6236 * src/Makefile.am: Add bison.c++.
6237 * src/bison.c++: New skeleton.
6238
bb0146c2
AD
62392002-01-21 Paolo Bonzini <bonzini@gnu.org>
6240
6241 * po/it.po: New.
6242
bec30531
AD
62432002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
6244
6245 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
6246
fc6edc45
MA
62472002-01-20 Marc Autret <marc@gnu.org>
6248
6249 * src/files.c (compute_output_file_names): Fix
6250
5e5d5415
MA
62512002-01-20 Marc Autret <marc@gnu.org>
6252
6253 * tests/output.at: New test.
6254 * src/files.c (compute_base_names): Don't map extensions when
6255 the YACC flag is set, use defaults.
6256 Reported by Evgeny Stambulchik.
6257
44ea3fbd
MA
62582002-01-20 Marc Autret <marc@gnu.org>
6259
bb0146c2 6260 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
6261 compilers as well (i.e. the vendor C compiler).
6262 Suggested by Albert Chin-A-Young.
6263
338963d1
TVH
62642002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
6265
6266 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
6267 canonical definition.
6268 * src/system.h: Use the canonical definition for PARAMS (avoids
6269 a conflict with the macro from lib/hash.h).
6270
c57b2479
AD
62712002-01-11 Akim Demaille <akim@epita.fr>
6272
6273 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 6274 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 6275
b85810ae
AD
62762002-01-09 Akim Demaille <akim@epita.fr>
6277
6278 * src/files.c, src/files.h (output_infix): New.
6279 (tab_extension): Remove.
6280 (compute_base_names): Compute the former, drop the latter.
6281 * src/output.c (prepare): Insert the muscles `output-infix', and
6282 `output-suffix'.
6283 * src/parse-skel.y (string, string.1): New.
6284 (section.header): Use it.
6285 (section.yacc): Remove.
6286 (prefix): Remove too.
6287 * src/scan-skel.l: Adjust.
6288 * src/bison.simple, src/bison.hairy: Adjust.
6289
cae60122
AD
62902002-01-09 Akim Demaille <akim@epita.fr>
6291
6292 * configure.in (WERROR_CFLAGS): Compute it.
6293 * src/Makefile.am (CFLAGS): Pass it.
6294 * tests/atlocal.in (CFLAGS): Idem.
6295 * src/files.c: Fix a few warnings.
6296 (get_extension_index): Remove, unused.
6297
ae404801
AD
62982002-01-08 Akim Demaille <akim@epita.fr>
6299
6300 * src/getargs.c (AS_FILE_NAME): New.
6301 (getargs): Use it to convert DOSish file names.
6302 * src/files.c (base_name): Rename as full_base_name to avoid
6303 clashes with `base_name ()'.
6304 (filename_split): New.
6305 (compute_base_names): N-th rewrite, using filename_split.
6306
22312b71
AD
63072002-01-08 Akim Demaille <akim@epita.fr>
6308
6309 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
6310 New, stolen from the Fileutils 4.1.
6311 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
6312 * configure.in: Check for the presence of memrchr, and of its
6313 prototype.
6314
a67cef01
TVH
63152002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
6316
6317 * lib/hash.h (__P): Added definition for this macro.
6318 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
6319 BUILT_SOURCES, to ensure they are generated first.
6320 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
6321 %error-verbose to allow bootstrapping with bison 1.30x.
6322
2b25d624
AD
63232002-01-06 Akim Demaille <akim@epita.fr>
6324
6325 * src/reader.c (parse_braces): Don't fetch the next char, the
6326 convention is to fetch on entry.
6327 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
6328 'switch' without a following semicolon.
6329 * tests/regression.at (braces parsing): New.
6330
3460813b
AD
63312002-01-06 Akim Demaille <akim@epita.fr>
6332
6333 Bison is dead wrong in its RR conflict reports.
6334
6335 * tests/torture.at (GNU Cim Grammar): New.
6336 * src/conflicts.c (count_rr_conflicts): Fix.
6337
73784c64
AD
63382002-01-06 Akim Demaille <akim@epita.fr>
6339
6340 Creating package.m4 from configure.ac causes too many problems.
6341
6342 * tests/Makefile.am (package.m4): Create it by hand,
6343 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
6344
25d81090
AD
63452002-01-06 Akim Demaille <akim@epita.fr>
6346
6347 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
6348 skeleton.h.
6349
a9b8959e
PE
63502002-01-04 Paul Eggert <eggert@twinsun.com>
6351
6352 * doc/bison.texinfo (Debugging):
6353 Remove YYSTDERR; it's no longer defined or used.
6354 Also, s/cstdio.h/cstdio/.
6355
25d81090
AD
63562002-01-03 Akim Demaille <akim@epita.fr>
6357
6358 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
6359
1109455c
AD
63602002-01-03 Akim Demaille <akim@epita.fr>
6361
6362 * src/parse-skel.y (process_skeleton): Don't bind the parser's
6363 tracing code to --trace, wait for a better --trace option, with
6364 args.
6365
7ea5e977
AD
63662002-01-03 Akim Demaille <akim@epita.fr>
6367
6368 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
6369 The ISO C++ standard is extremely clear about it: stderr is
6370 considered a macro, not a regular symbol (see table 94 `Header
6371 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
6372 Therefore std:: does not apply to it. It still does with fprintf.
6373 Also, s/cstdio.h/cstdio/.
6374
fab5b110
AD
63752002-01-03 Akim Demaille <akim@epita.fr>
6376
6377 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
6378 for non system headers.
6379
aed7fd9b
AD
63802002-01-02 Akim Demaille <akim@epita.fr>
6381
6382 Equip the skeleton chain with location tracking, runtime trace,
6383 pure parser and scanner.
6384
6385 * src/parse-skel.y: Request a pure parser, locations, and prefix
6386 renaming.
6387 (%union): Having several members with the same type does not help
6388 type mismatches, simplify.
6389 (YYPRINT, yyprint): New.
6390 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
6391 (skel_error): this.
6392 Handle locations.
6393 * src/scan-skel.l: Adjust to these changes.
6394 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
6395 (LOCATION_PRINT, skel_control_t): New.
6396
24fad99e
AD
63972001-12-30 Akim Demaille <akim@epita.fr>
6398
6399 * src/parse-skel.y: Get rid of the shift/reduce conflict:
6400 replace `gb' with BLANKS.
6401 * src/scan-skel.l: Adjust.
6402
a4b36db4
AD
64032001-12-30 Akim Demaille <akim@epita.fr>
6404
6405 * src/system.h: We don't need nor want bcopy.
6406 Throw away MS-DOS crap: we don't need getpid.
6407 * configure.in: We don't need strndup. It was even causing
6408 problems: because Flex includes the headers *before* us,
6409 _GNU_SOURCE is not defined by config.h, and therefore strndup was
6410 not visible.
6411 * lib/xstrndup.c: New.
6412 * src/scan-skel.l: Use it.
6413 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
6414 * src/parse-skel.y: Use %directives instead of #defines.
6415
1239777d
AD
64162001-12-30 Akim Demaille <akim@epita.fr>
6417
6418 * src/skeleton.h: New.
6419 * src/output.c (output_parser, output_master_parser): Remove, dead
6420 code.
6421 * src/output.h (get_lines_number, actions_output, guards_output)
6422 (token_definitions_output): Prototype them.
6423 * src/parse-skel.y: Add the license notice.
6424 Include output.h and skeleton.h.
6425 (process_skeleton): Returns void, and takes a single parameter.
6426 * src/scan-skel.l: Add the license notice.
6427 Include skeleton.h.
6428 Don't use %option yylineno: it seems that then Flex imagines
6429 REJECT has been used, and therefore it won't reallocate its
6430 buffers (which makes no other sense to me than a bug). It results
6431 in warnings for `unused: yy_flex_realloc'.
6432
9b3add5b
RA
64332001-12-30 Robert Anisko <robert.anisko@epita.fr>
6434
6435 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6436 (MUSCLE_INSERT_PREFIX): ...to there.
6437 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6438 (MUSCLE_INSERT_PREFIX): Move from here...
6439
6440 * src/bison.hairy: Add a section directive. Put braces around muscle
6441 names. This parser skeleton is still broken, but Bison should not
6442 choke on a bad muscle 'syntax'.
6443 * src/bison.simple: Add a section directive. Put braces around muscle
6444 names.
6445
6446 * src/files.h (strsuffix, stringappend): Add declarations.
6447 (tab_extension): Add declaration.
6448 (short_base_name): Add declaration.
6449
6450 * src/files.c (strsuffix, stringappend): No longer static. These
6451 functions are used in the skeleton parser.
6452 (tab_extension): New.
6453 (compute_base_names): Use the computations done in this function
fab5b110 6454 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
6455 names.
6456 (short_base_name): No longer static.
6457
6458 * src/output.c (output_skeleton): New.
6459 (output): Disable call to output_master_parser, and give a try to
6460 a new skeleton handling system.
6461 (guards_output, actions_output): No longer static.
6462 (token_definitions_output, get_lines_number): No longer static.
6463
6464 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
6465
fab5b110 6466 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
6467 parse-skel.y.
6468
6469 * src/parse-skel.y: New file.
6470 * src/scan-skel.l: New file.
6471
b5b61c61
AD
64722001-12-29 Akim Demaille <akim@epita.fr>
6473
6474 %name-prefix is broken.
6475
6476 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
6477 Adjust all dependencies.
6478 * tests/headers.at (export YYLTYPE): Strengthen this test: use
6479 %name-prefix.
6480
6481 Renaming yylval but not yylloc is not consistent. Now we do.
6482
6483 * src/bison.simple: Prefix yylloc if used.
6484 * doc/bison.texinfo (Decl Summary): Document that.
6485
8c9a50be
AD
64862001-12-29 Akim Demaille <akim@epita.fr>
6487
6488 * doc/bison.texinfo: Promote `%long-directive' over
6489 `%long_directive'.
6490 Remove all references to fixed-output-files, yacc is enough.
6491
d99361e6
AD
64922001-12-29 Akim Demaille <akim@epita.fr>
6493
6494 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
6495 user prologue. These are defaults.
6496 * tests/actions.at (Mid-rule actions): Make sure the user can
6497 define YYDEBUG and YYERROR_VERBOSE.
6498
b9cecb91
AD
64992001-12-29 Akim Demaille <akim@epita.fr>
6500
6501 * src/output.c (header_output): Don't forget to export YYLTYPE and
6502 yylloc.
6503 * tests/headers.at (export YYLTYPE): New, make sure it does.
6504 * tests/regression.at (%union and --defines, Invalid CPP headers):
6505 Move to...
6506 * tests/headers.at: here.
6507
aea13e97
AD
65082001-12-29 Akim Demaille <akim@epita.fr>
6509
6510 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
6511
931394cb
AD
65122001-12-29 Akim Demaille <akim@epita.fr>
6513
6514 * tests/actions.at (Mid-rule actions): Output on a single line
6515 instead of several.
6516
704a47c4
AD
65172001-12-29 Akim Demaille <akim@epita.fr>
6518
6519 * doc/bison.texinfo: Formatting changes.
6520
091e20bb
AD
65212001-12-29 Akim Demaille <akim@epita.fr>
6522
6523 Don't store the token defs in a muscle, just be ready to output it
6524 on command. Now possible via `symbols'. Fixes a memory leak.
6525
6526 * src/output.c (token_definitions_output): New.
6527 (output_parser, header_output): Use it.
6528 * src/reader.c (symbols_save): Remove.
6529
cce71710
AD
65302001-12-29 Akim Demaille <akim@epita.fr>
6531
6532 * src/bison.simple: Do not provide a default for YYSTYPE and
6533 YYLTYPE before the user's prologue. Otherwise it's hardly... a
6534 default.
6535
82c035a8
AD
65362001-12-29 Akim Demaille <akim@epita.fr>
6537
6538 Mid-rule actions are simply... ignored!
6539
6540 * src/reader.c (readgram): Be sure to attach mid-rule actions to
6541 the empty-rule associated to the dummy symbol, not to the host
6542 rule.
6543 * tests/actions.at (Mid-rule actions): New.
6544
8419d367
AD
65452001-12-29 Akim Demaille <akim@epita.fr>
6546
6547 Memory leak.
6548
6549 * src/reader.c (reader): Free grammar.
6550
375d5806
AD
65512001-12-29 Akim Demaille <akim@epita.fr>
6552
6553 Memory leak.
6554
6555 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
6556 since it allocates it for each state, although only one is needed.
6557 (allocate_storage): Do it here.
6558
f51cb8ff
AD
65592001-12-29 Akim Demaille <akim@epita.fr>
6560
6561 * src/options.h, src/options.c (create_long_option_table): Rename
6562 as...
6563 (long_option_table_new): this, with a clearer prototype.
6564 (percent_table): Remove, unused,
6565 * src/getargs.c (getargs): Adjust.
6566
29e88316
AD
65672001-12-29 Akim Demaille <akim@epita.fr>
6568
6569 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
6570 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
6571 as states.
6572
b9f71f19
AD
65732001-12-29 Akim Demaille <akim@epita.fr>
6574
6575 * src/lalr.c (build_relations): Rename `states' as `states1'.
6576 Sorry, I don't understand exactly what it is, no better name...
6577
1a2b5d37
AD
65782001-12-29 Akim Demaille <akim@epita.fr>
6579
6580 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
6581 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
6582 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
6583 as rules.
6584
1cca533e
AD
65852001-12-29 Akim Demaille <akim@epita.fr>
6586
6587 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
6588 ago.
6589
c03ae966
AD
65902001-12-29 Akim Demaille <akim@epita.fr>
6591
6592 * src/reader.c, src/reader.h (user_toknums): Remove.
6593 Adjust all users to use symbols[i]->user_token_number.
6594
5a670b1e
AD
65952001-12-29 Akim Demaille <akim@epita.fr>
6596
6597 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
6598 Adjust all users to use symbols[i]->prec or ->assoc.
6599
ad949da9
AD
66002001-12-29 Akim Demaille <akim@epita.fr>
6601
6602 * src/reader.c, src/reader.h (tags): Remove.
6603 Adjust all users to use symbols[i]->tag.
6604
0e78e603
AD
66052001-12-29 Akim Demaille <akim@epita.fr>
6606
6607 * src/gram.h, src/gram.c (symbols): New, similar to state_table
6608 and rule_table.
6609 * src/reader.c (packsymbols): Fill this table.
6610 Drop sprec.
6611 * src/conflicts.c (resolve_sr_conflict): Adjust.
6612 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
6613 single table.
6614 Use symbols[i]->tag instead of tags[i].
6615
213e640e
AD
66162001-12-29 Akim Demaille <akim@epita.fr>
6617
6618 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
6619 In addition, put a comment in there, to replace...
6620 * tests/regression.at (%union and C comments): Remove.
6621
e7b8bef1
AD
66222001-12-29 Akim Demaille <akim@epita.fr>
6623
6624 * tests/regression.at (Web2c Actions): Blindly move the actual
6625 output as expected output. The contents *seem* right to me, but I
6626 can't pretend reading perfectly parser tables... Nonetheless, all
6627 the other tests pass correctly, the table look OK, even though the
6628 presence of `$axiom' is to be noted: AFAICS it is useless (but
6629 harmless).
6630
b68e7744
AD
66312001-12-29 Akim Demaille <akim@epita.fr>
6632
6633 * src/reader.c (readgram): Don't add the rule 0 if there were no
6634 rules read. In other words, add it _after_ having performed
6635 grammar sanity checks.
6636 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
6637
78d5bae9
AD
66382001-12-29 Akim Demaille <akim@epita.fr>
6639
6640 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
6641 visible, and some states have now a different number.
6642
ff442794
AD
66432001-12-29 Akim Demaille <akim@epita.fr>
6644
6645 * src/reader.c (readgram): Bind the initial rule's lineno to that
6646 of the first rule.
6647 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
6648 (Solved SR Conflicts): Adjust rule 0's line number.
6649
610ab194
AD
66502001-12-29 Akim Demaille <akim@epita.fr>
6651
6652 Fix the `GAWK Grammar' failure.
6653
6654 * src/LR0.c (final_state): Initialize to -1 so that we do compute
6655 the reductions of the first state which was mistakenly confused
6656 with the final state because precisely final_state was initialized
6657 to 0.
6658 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
6659 now noticed by Bison.
6660 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
6661 have a reduction on $default.
6662
29d29c8f
AD
66632001-12-29 Akim Demaille <akim@epita.fr>
6664
6665 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
6666 rule line numbers.
6667 * src/closure.c (print_closure): Likewise.
6668 * src/derives.c (print_derives): Likewise.
6669 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
6670 now.
6671
7c6b64d0
AD
66722001-12-29 Akim Demaille <akim@epita.fr>
6673
6674 * src/lalr.c (lookaheads_print): New.
6675 (lalr): Call it when --trace-flag.
6676 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
6677 are dumped.
6678
3d4daee3
AD
66792001-12-29 Akim Demaille <akim@epita.fr>
6680
6681 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
6682 when walking through ritem, even via rule->rhs.
6683 * src/reduce.c (dump_grammar, useful_production, reduce_output)
6684 (useful_production, useless_nonterminals): Likewise.
6685 (reduce_grammar_tables): Likewise, plus update nritems.
6686 * src/nullable.c (set_nullable): Likewise.
6687 * src/lalr.c (build_relations): Likewise.
6688 * tests/sets.at (Nullable): Adjust.
6689 Fortunately, now, the $axiom is no longer nullable.
6690
9e7f6bbd
AD
66912001-12-29 Akim Demaille <akim@epita.fr>
6692
6693 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
6694 the 0-sentinel.
6695 * src/gram.c (ritem_longest_rhs): Likewise.
6696 * src/reduce.c (nonterminals_reduce): Likewise.
6697 * src/print_graph.c (print_graph): Likewise.
6698 * src/output.c (output_rule_data): Likewise.
6699 * src/nullable.c (set_nullable): Likewise.
6700
255ef638
AD
67012001-12-29 Akim Demaille <akim@epita.fr>
6702
6703 * src/output.c: Comment changes.
6704
0d8a7363
AD
67052001-12-27 Paul Eggert <eggert@twinsun.com>
6706
6707 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
6708 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
6709 Sparc, as they were causing more porting problems than the
6710 (minor) performance improvement was worth.
6711
6712 Also, catch up with 1.31's YYSTD.
6713
3db472b9
AD
67142001-12-27 Akim Demaille <akim@epita.fr>
6715
6716 * src/output.c (output_gram): Rely on nritems, not the
6717 0-sentinel. See below.
6718 Use -1 as separator, not 0.
6719 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
6720 Rely on -1 as separator in yyrhs, instead of 0.
6721 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
6722 twice `Now at end of input', therefore there are two lines less to
6723 expect.
6724
b365aa05
AD
67252001-12-27 Akim Demaille <akim@epita.fr>
6726
6727 * tests/regression.at (Unresolved SR Conflicts):
6728 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
6729 below.
6730
30171f79
AD
67312001-12-27 Akim Demaille <akim@epita.fr>
6732
6733 * src/LR0.c (new_state): Recognize the final state by the fact it
6734 is reached by eoftoken.
6735 (insert_start_shifting_state, insert_eof_shifting_state)
6736 (insert_accepting_state, augment_automaton): Remove, since now
6737 these states are automatically computed from the initial state.
6738 (generate_states): Adjust.
6739 * src/print.c: When reporting a rule number to the user, substract
6740 1, so that the axiom rule is rule 0, and the first user rule is 1.
6741 * src/reduce.c: Likewise.
6742 * src/print_graph.c (print_core): For the time being, just as for
6743 the report, depend upon --trace-flags to dump the full set of
6744 items.
6745 * src/reader.c (readgram): Once the grammar read, insert the rule
6746 0: `$axiom: START-SYMBOL $'.
6747 * tests/set.at: Adjust: rule 0 is now displayed, and since the
6748 number of the states has changed (the final state is no longer
6749 necessarily the last), catch up.
6750
75142d45
AD
67512001-12-27 Akim Demaille <akim@epita.fr>
6752
6753 Try to make the use of the eoftoken valid. Given that its value
6754 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
6755 is used instead of > 0 where appropriate, (ii), depend upon nritems
6756 instead of the 0-sentinel.
6757
6758 * src/gram.h, src/gram.c (nritems): New.
6759 Expected to be duplication of nitems, but for the time being...
6760 * src/reader.c (packgram): Assert nritems and nitems are equal.
6761 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
6762 * src/closure.c (print_closure, print_fderives): Likewise.
6763 * src/gram.c (ritem_print): Likewise.
6764 * src/print.c (print_core, print_grammar): Likewise.
6765 * src/print_graph.c: Likewise.
6766
b7c49edf
AD
67672001-12-27 Akim Demaille <akim@epita.fr>
6768
6769 * src/main.c (main): If there are complains after grammar
6770 reductions, then output the report anyway if requested, then die.
6771 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
6772 * src/reader.c (eoftoken): New.
6773 (parse_token_decl): If the token being defined has value `0', it
6774 is the eoftoken.
6775 (packsymbols): No longer hack `tags' to insert `$' by hand.
6776 Be sure to preserve the value of the eoftoken.
6777 (reader): Make sure eoftoken is defined.
6778 Initialize nsyms to 0: now eoftoken is created just like the others.
6779 * src/print.c (print_grammar): Don't special case the eof token.
6780 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
6781 lie anyway, albeit pleasant.
6782 * tests/calc.at: Exercise error messages with eoftoken.
6783 Change the grammar so that empty input is invalid.
6784 Adjust expectations.
6785 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
6786
ec2da99f
AD
67872001-12-27 Akim Demaille <akim@epita.fr>
6788
6789 * configure.in: Check the protos of strchr ans strspn.
6790 Replace strchr if needed.
6791 * src/system.h: Provide the protos of strchr, strspn and memchr if
6792 missing.
6793 * lib/strchr.c: New.
6794 * src/reader.c (symbols_save): Use strchr.
6795
8adfa272
AD
67962001-12-27 Akim Demaille <akim@epita.fr>
6797
6798 * src/print.c, src/print_graph.c (escape): New.
6799 Use it to quote the TAGS outputs.
6800 * src/print_graph.c (print_state): Now errors are in red, and
6801 reductions in green.
6802 Prefer high to wide: output the state number on a line of its own.
6803
80dac38c
AD
68042001-12-27 Akim Demaille <akim@epita.fr>
6805
6806 * src/state.h, src/state.c (reductions_new): New.
6807 * src/LR0.c (set_state_table): Let all the states have a
6808 `reductions', even if reduced to 0.
6809 (save_reductions): Adjust.
6810 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
6811 * src/print.c (print_reductions, print_actions): Adjust.
6812 * src/output.c (action_row): Adjust.
6813
2cec70b9
AD
68142001-12-27 Akim Demaille <akim@epita.fr>
6815
6816 * src/state.h, src/state.c (errs_new, errs_dup): New.
6817 * src/LR0.c (set_state_table): Let all the states have an errs,
6818 even if reduced to 0.
6819 * src/print.c (print_errs, print_reductions): Adjust.
6820 * src/output.c (output_actions, action_row): Adjust.
6821 * src/conflicts.c (resolve_sr_conflict): Adjust.
6822
13ca549a
AD
68232001-12-27 Akim Demaille <akim@epita.fr>
6824
6825 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
6826
5092aba5
AD
68272001-12-27 Akim Demaille <akim@epita.fr>
6828
6829 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
6830 * src/print.c: here.
6831 (lookaheadset, shiftset): New, used as additional storage by
6832 print_reductions.
6833 (print_results): Adjust.
6834 (print_shifts, print_gotos, print_errs): New, extracted from...
6835 (print_actions): here.
6836 * src/print_graph.c (print_actions): Remove dead code.
6837
11e2beca
AD
68382001-12-27 Akim Demaille <akim@epita.fr>
6839
6840 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
6841 `$n' and `@n'.
6842
dac3c910
AD
68432001-12-27 Akim Demaille <akim@epita.fr>
6844
6845 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
6846 (build_relations): Adjust.
6847
d0b0fefa
AD
68482001-12-27 Akim Demaille <akim@epita.fr>
6849
6850 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
6851 duplication.
6852
adc8c848
AD
68532001-12-27 Akim Demaille <akim@epita.fr>
6854
6855 * src/reader.c (packgram): Catch nitems overflows.
6856
14d293ac
AD
68572001-12-27 Akim Demaille <akim@epita.fr>
6858
6859 * src/files.c, src/files.h (guard_obstack): Remove.
6860 * src/output.c (output): Adjust.
6861 * src/reader.c (parse_braces): New, factoring...
6862 (copy_action, copy_guard): these two which are renamed as...
6863 (parse_action, parse_guard): these.
6864 As a voluntary consequence, using braces around guards is now
6865 mandatory.
6866
f499b062
AD
68672001-12-27 Akim Demaille <akim@epita.fr>
6868
6869 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
6870 * src/reader.c (symbol_list): `guard' and `guard_line' are new
6871 members.
6872 (symbol_list_new): Adjust.
6873 (copy_action): action_line is the first line, not the last.
6874 (copy_guard): Just as for actions, store the `action' only, not
6875 the switch/case/break flesh.
6876 Don't parse the user action that might follow the guard, let...
6877 (readgram): do it, i.e., now, there can be an action after a
6878 guard.
6879 In other words the guard is just explicitly optional.
6880 (packgram): Adjust.
6881 * src/output.c (guards_output): New.
6882 (output_parser): Call it when needed.
6883 (output): Also free the guard and attrs obstacks.
6884 * src/files.c, src/files.h (obstack_save): Remove.
6885 (output_files): Remove.
6886 As a result, if one needs the former `.act' file, using an
6887 appropriate skeleton which requires actions and guards is now
6888 required.
6889 * src/main.c (main): Adjust.
6890 * tests/semantic.at: New.
6891 * tests/regression.at: Use `input.y' as input file name.
6892 Avoid 8+3 problems by requiring input.c when the test needs the
6893 parser.
6894
d945f5cd
AD
68952001-12-27 Akim Demaille <akim@epita.fr>
6896
6897 * src/reader.c (symbol_list_new): Be sure to initialize all the
6898 fields.
6899
d200e455
AD
69002001-12-27 Akim Demaille <akim@epita.fr>
6901
6902 All the hacks using a final pseudo state are now useless.
6903
6904 * src/LR0.c (set_state_table): state_table holds exactly nstates.
6905 * src/lalr.c (nLA): New.
6906 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
6907 instead of lookaheadsp from the pseudo state (nstate + 1).
6908
f9507c28
AD
69092001-12-27 Akim Demaille <akim@epita.fr>
6910
6911 * src/output.c (action_row, token_actions): Use a state_t instead
6912 of a integer, and nlookaheads instead of the following state's
6913 lookaheadsp.
6914
065fbd27
AD
69152001-12-27 Akim Demaille <akim@epita.fr>
6916
6917 * src/conflicts.c (log_resolution, flush_shift)
6918 (resolve_sr_conflict, set_conflicts, solve_conflicts)
6919 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
6920 (conflicts_print, print_reductions): Use a state_t instead of an
6921 integer when referring to a state.
6922 As much as possible, depend upon nlookaheads, instead of the
6923 `lookaheadsp' member of the following state (since lookaheads of
6924 successive states are successive, the difference between state n + 1
6925 and n served as the number of lookaheads for state n).
6926 * src/lalr.c (add_lookback_edge): Likewise.
6927 * src/print.c (print_core, print_actions, print_state)
6928 (print_results): Likewise.
6929 * src/print_graph.c (print_core, print_actions, print_state)
6930 (print_graph): Likewise.
6931 * src/conflicts.h: Adjust.
6932
1b177bd7
AD
69332001-12-27 Akim Demaille <akim@epita.fr>
6934
6935 * src/bison.hairy: Formatting/comment changes.
6936 ANSIfy.
6937 Remove `register' indications.
6938 Add plenty of `static'.
6939
7742ddeb
AD
69402001-12-27 Akim Demaille <akim@epita.fr>
6941
6942 * src/output.c (prepare): Drop the muscle `ntbase' which
6943 duplicates ntokens.
6944 * src/bison.simple: Formatting/comment changes.
6945 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
6946 is an undocumented synonym.
6947
1fa14068
AD
69482001-12-22 Akim Demaille <akim@epita.fr>
6949
6950 * src/output.c (output_table_data): Change the prototype to use
6951 `int' for array ranges: some invocations do pass an int, not a
6952 short.
6953 Reported by Wayne Green.
6954
b9752825
AD
69552001-12-22 Akim Demaille <akim@epita.fr>
6956
6957 Some actions of web2c.y are improperly triggered.
6958 Reported by Mike Castle.
6959
6960 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
6961 * tests/regression.at (Web2c): Rename as...
6962 (Web2c Report): this.
6963 (Web2c Actions): New.
6964
776209d6
AD
69652001-12-22 Akim Demaille <akim@epita.fr>
6966
6967 Reductions in web2c.y are improperly reported.
6968 Reported by Mike Castle.
6969
6970 * src/conflicts.c (print_reductions): Fix.
6971 * tests/regression.at (Web2c): New.
6972
275fc3ad
AD
69732001-12-18 Akim Demaille <akim@epita.fr>
6974
6975 Some host fail on `assert (!"foo")', which expands to
6976 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
6977 Reported by Nelson Beebee.
6978
6979 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
6980 `#define it_succeeded 0' and `assert (it_succeeded)'.
6981
897668ee
MA
69822001-12-17 Marc Autret <autret_m@epita.fr>
6983
6984 * src/bison.simple: Don't hard code the skeleton line and filename.
6985 * src/output.c (output_parser): Rename 'line' as 'output_line'.
6986 New line counter 'skeleton_line' (skeleton-line muscle).
6987
ab3399e0
PE
69882001-12-17 Paul Eggert <eggert@twinsun.com>
6989
6990 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
6991 YYDEBUG must be defined to a nonzero value.
6992
6993 * src/bison.simple (yytname): Do not assume that the user defines
6994 YYDEBUG to a properly parenthesized expression.
6995
3877f72b
AD
69962001-12-17 Akim Demaille <akim@epita.fr>
6997
6998 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
6999 nlookaheads is a new member.
7000 Adjust all users.
7001 * src/lalr.h (nlookaheads): Remove this orphan declaration.
7002 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
7003 state.
776209d6 7004
331dbc1b
AD
70052001-12-17 Akim Demaille <akim@epita.fr>
7006
7007 * src/files.h, src/files.c (open_files, close_files): Remove.
7008 * src/main.c (main): Don't open/close files, nor invoke lex_free,
7009 let...
7010 * src/reader.c (reader): Do it.
776209d6 7011
be750e4c
AD
70122001-12-17 Akim Demaille <akim@epita.fr>
7013
7014 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 7015
709ae8c6
AD
70162001-12-17 Akim Demaille <akim@epita.fr>
7017
7018 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
7019 (flush_reduce): New.
7020 (resolve_sr_conflict): Adjust.
776209d6 7021
f87685c3
AD
70222001-12-17 Akim Demaille <akim@epita.fr>
7023
7024 * src/output.c (output_obstack): Be static and rename as...
7025 (format_obstack): this, to avoid any confusion with files.c's
7026 output_obstack.
7027 * src/reader.h (muscle_obstack): Move to...
7028 * src/output.h: here, since it's defined in output.c.
7029
837491d8
AD
70302001-12-17 Akim Demaille <akim@epita.fr>
7031
7032 * src/output.c (action_row, save_column, default_goto)
7033 (sort_actions, matching_state, pack_vector): Better variable
7034 locality.
7035
796d61fb
AD
70362001-12-17 Akim Demaille <akim@epita.fr>
7037
7038 * src/output.c: Various formatting changes.
776209d6 7039
64d15509
AD
70402001-12-17 Akim Demaille <akim@epita.fr>
7041
7042 * src/files.c (output_files): Free the output_obstack.
7043 * src/main.c (main): Call print and print_graph conditionally.
7044 * src/print.c (print): Work unconditionally.
7045 * src/print_graph.c (print_graph): Work unconditionally.
7046 * src/conflicts.c (log_resolution): Output only if verbose_flag.
7047
fbc8ecb7
MA
70482001-12-16 Marc Autret <autret_m@epita.fr>
7049
7050 * src/output.c (actions_output): Fix. When we use %no-lines,
7051 there is one less line per action.
7052
f0440388
MA
70532001-12-16 Marc Autret <autret_m@epita.fr>
7054
7055 * src/bison.simple: Remove a useless #line directive.
7056 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
7057 * src/output.c (get_lines_number): New.
776209d6 7058 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
7059 output muscles.
7060 Fix line numbering.
7061 (actions_output): Computes the number of lines taken by actions.
7062 (output_master_parser): Insert new skeleton which is the name of
7063 the output parser file name.
7064
a79986b8
MA
70652001-12-15 Marc Autret <autret_m@epita.fr>
7066
7067 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
7068
4ec8e00f
MA
70692001-12-15 Marc Autret <autret_m@epita.fr>
7070
7071 * src/output.c (output_gram): Keep track of the hairy one.
7072
1a4648ff
AD
70732001-12-15 Akim Demaille <akim@epita.fr>
7074
7075 Make `make distcheck' work.
7076
7077 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
7078 system.h which uses libgettext.h.
7079
9c2c67e6
AD
70802001-12-15 Akim Demaille <akim@epita.fr>
7081
7082 * src/nullable.c (set_nullable): Useless rules must be skipped,
7083 otherwise, since we range over their symbols, we might look at a
7084 nonterminal which no longer ``exists'', i.e., it is not counted in
7085 `nvars', hence we overflow our arrays.
7086
93ede233
AD
70872001-12-15 Akim Demaille <akim@epita.fr>
7088
7089 The header can also be produced directly, without any obstack!
7090 Yahoo!
7091
7092 * src/files.c, src/files.h (defines_obstack): Remove.
7093 (compute_header_macro): Global.
7094 (defines_obstack_save): Remove.
7095 * src/reader.c (parse_union_decl): No longer output to
7096 defines_obstack: its content can be found in the `stype' muscle
7097 anyway.
7098 (output_token_translations): Merge into...
7099 (symbols_output): this.
7100 Rename as...
7101 (symbols_save): this.
7102 (reader): Adjust.
7103 * src/output.c (header_output): New.
7104 (output): Call it.
7105
2666f928
AD
71062001-12-15 Akim Demaille <akim@epita.fr>
7107
7108 * src/reader.c (parse_union_decl): Instead of handling two obstack
7109 simultaneously, use one to define the `stype' muscle, and use the
7110 value of the latter to fill defines_obstack.
7111 (copy_comment): Remove.
7112 (copy_comment2): Work for a single obstack.
7113 Rename as...
7114 (copy_comment): this.
7115
428046f8
AD
71162001-12-15 Akim Demaille <akim@epita.fr>
7117
7118 * src/lex.c, src/lex.h (xgetc): No longer static.
7119 * src/reader.c (parse_union_decl): Revamp.
7120
ea52d706
AD
71212001-12-15 Akim Demaille <akim@epita.fr>
7122
7123 Still making progress in separating Bison into (i) input, (ii)
7124 process, (iii) output: now we can directly output the parser file
7125 without using table_obstack at all.
7126
7127 * src/files.c, src/files.h (table_obstack): Bye bye.
7128 (parser_file_name): New.
7129 * src/files.c (compute_output_file_names): Compute it.
7130 * src/output.c (actions_output, output_parser)
7131 (output_master_parser): To a file instead of an obstack.
7132
3f96f4dc
AD
71332001-12-15 Akim Demaille <akim@epita.fr>
7134
7135 Attach actions to rules, instead of pre-outputting them to
7136 actions_obstack.
7137
7138 * src/gram.h (rule_t): action and action_line are new members.
7139 * src/reader.c (symbol_list): Likewise.
7140 (copy_action): Save the actions within the rule.
7141 (packgram): Save them in rule_table.
7142 * src/output.c (actions_output): New.
7143 (output_parser): Use it on `%%actions'.
7144 (output_rule_data): Don't free rule_table.
7145 (output): Do it.
7146 (prepare): Don't save the `action' muscle.
7147 * src/bison.simple: s/%%action/%%actions/.
7148
51576fb3
AD
71492001-12-15 Akim Demaille <akim@epita.fr>
7150
7151 * src/reader.c (copy_action): When --yacc, don't append a `;'
7152 to the user action: let it fail if lacking.
dee049eb 7153 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 7154
2648a72d
AD
71552001-12-14 Akim Demaille <akim@epita.fr>
7156
7157 * src/lex.c (literalchar): Simply return the char you decoded, non
7158 longer mess around with obstacks and int pointers.
7159 Adjust all callers.
7160
92790e5b
AD
71612001-12-14 Akim Demaille <akim@epita.fr>
7162
7163 * src/lex.c (literalchar): Don't escape the special characters,
7164 just decode them, and keep them as char (before, eol was output as
7165 the 2 char string `\n' etc.).
7166 * src/output.c (output_rule_data): Use quotearg to output the
7167 token strings.
7168
927c1557
PE
71692001-12-13 Paul Eggert <eggert@twinsun.com>
7170
7171 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
7172 Do not infringe on the global user namespace when using C++.
7173 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
7174 All uses of `fprintf' and `stderr' changed.
7175
7176 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
7177
ed8e1f68
AD
71782001-12-13 Akim Demaille <akim@epita.fr>
7179
7180 The computation of nullable is broken: it doesn't handle empty
7181 RHS's properly.
7182
7183 * tests/torture.at (GNU AWK Grammar): New.
7184 * tests/sets.at (Nullable): New.
7185 * src/nullable.c (set_nullable): Instead of blindly looping over
7186 `ritems', loop over the rules, and then over their rhs's.
7187
7188 Work around Autotest bugs.
7189
7190 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
7191 frame, because Autotest understand lines starting with a `+' as
7192 traces from the shell. Then, they are not processed properly.
7193 Admittedly an Autotest bug, but we don't have time to wait for
7194 Autotest to catch up.
7195 * tests/regression.at (Broken Closure): Adjust to the new table
7196 frames.
7197 Move to...
7198 * tests/sets.at: here.
7199
cb581495
AD
72002001-12-13 Akim Demaille <akim@epita.fr>
7201
7202 * src/closure.c (closure): Use nrules instead of playing tricks
7203 with BITS_PER_WORD.
7204
2e729273
AD
72052001-12-13 Akim Demaille <akim@epita.fr>
7206
7207 * src/print.c (print_actions): Output the handling of `$' as the
7208 traces do: shifting the token EOF. Before EOF was treated as a
7209 nonterminal.
7210 * tests/regression.at: Adjust some tests.
7211 * src/print_graph.c (print_core): Complete the set of items via
7212 closure. The next-to-final and final states are still unsatisfying,
7213 but that's to be addressed elsewhere.
7214 No longer output the rule numbers, but do output the state number.
7215 A single loop for the shifts + gotos is enough, but picked a
7216 distinct color for each.
7217 (print_graph): Initialize and finalize closure.
7218
107f7dfb
AD
72192001-12-13 Akim Demaille <akim@epita.fr>
7220
7221 * src/reader.c (readgram): Remove dead code, an strip useless
7222 braces.
7223 (get_type): Remove, unused.
7224
9b53a24f
AD
72252001-12-12 Akim Demaille <akim@epita.fr>
7226
7227 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
7228 on that of lib/error.c.
7229
dbfb6dcd
AD
72302001-12-12 Akim Demaille <akim@epita.fr>
7231
7232 Some hosts don't like `/' in includes.
7233
7234 * src/system.h: Include libgettext.h without qualifying the path.
7235 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
7236 $(top_srcdir).
7237
c25fb648
MA
72382001-12-11 Marc Autret <autret_m@epita.fr>
7239
7240 * src/output.c (output_parser): Remove useless muscle.
7241
710ddc4f
MA
72422001-12-11 Marc Autret <autret_m@epita.fr>
7243
7244 * src/bison.simple: Remove #line just before %%epilogue. It
7245 is now handled in ...
7246 * src/reader.c (read_additionnal_code): Add the output of a
7247 #line for the epilogue.
7248
e83d80b8
MA
72492001-12-10 Marc Autret <autret_m@epita.fr>
7250
927c1557 7251 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
7252 replace precedent remove.
7253 * src/bison.simple: Remove #line before %%prologue because
7254 %%input-line is wrong at this time.
7255
971d5158
MA
72562001-12-10 Marc Autret <autret_m@epita.fr>
7257
7258 * src/reader.c (symbols_output): Clean up.
927c1557 7259 * src/output.c (output_gram, output): Clean up.
971d5158 7260
5edafffd
AD
72612001-12-10 Akim Demaille <akim@epita.fr>
7262
7263 * src/lalr.c (initialize_lookaheads): New. Extracted from...
7264 * src/LR0.c (set_state_table): here.
7265 * src/lalr.c (lalr): Call it.
7266
0279f8e9
AD
72672001-12-10 Akim Demaille <akim@epita.fr>
7268
7269 * src/state.h (shifts): Remove the `number' member: shifts are
7270 attached to state, hence no longer need to be labelled with a
7271 state number.
7272
190c4f5f
AD
72732001-12-10 Akim Demaille <akim@epita.fr>
7274
7275 Now that states have a complete set of members, the linked list of
7276 shifts is useless: just fill directly the state's shifts member.
7277
7278 * src/state.h (shifts): Remove the `next' member.
7279 * src/LR0.c (first_state, last_state): Remove.
7280 Adjust the callers.
7281 (augment_automaton): Don't look for the shifts that must be added
7282 a shift on EOF: it is those of the state we looked for! But now,
7283 since shifts are attached, it is no longer needed to looking
7284 merely by its id: its number.
7285
2a73b93d
AD
72862001-12-10 Akim Demaille <akim@epita.fr>
7287
7288 * src/LR0.c (augment_automaton): Better variable locality.
7289 Remove an impossible branch: if there is a state corresponding to
7290 the start symbol being shifted, then there is shift for the start
7291 symbol from the initial state.
7292
74392f6a
AD
72932001-12-10 Akim Demaille <akim@epita.fr>
7294
7295 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
7296 only when appropriate: when insert_start_shifting_state' is not
7297 invoked.
7298 * tests/regression.at (Rule Line Numbers): Adjust.
7299
37c82725
AD
73002001-12-10 Akim Demaille <akim@epita.fr>
7301
7302 * src/LR0.c (augment_automaton): Now that all states have shifts,
7303 merge the two cases addition shifts to the initial state.
7304
6a164e0c
AD
73052001-12-10 Akim Demaille <akim@epita.fr>
7306
7307 * src/lalr.c (set_state_table): Move to...
7308 * src/LR0.c: here.
7309 * src/lalr.c (lalr): Don't call it...
7310 * src/LR0.c (generate_states): do it.
7311 * src/LR0.h (first_state): Remove, only the table is used.
7312
7215de24
AD
73132001-12-10 Akim Demaille <akim@epita.fr>
7314
7315 * src/LR0.h (first_shift, first_reduction): Remove.
7316 * src/lalr.c: Don't use first_shift: find shifts through the
7317 states.
7318
80e25d4d
AD
73192001-12-10 Akim Demaille <akim@epita.fr>
7320
7321 * src/LR0.c: Attach shifts to states as soon as they are
7322 computed.
7323 * src/lalr.c (set_state_table): Instead of assigning shifts to
7324 state, just assert that the mapping was properly done.
7325
0ab3728b
AD
73262001-12-10 Akim Demaille <akim@epita.fr>
7327
7328 * src/LR0.c (insert_start_shift): Rename as...
7329 (insert_start_shifting_state): this.
7330 (insert_eof_shifting_state, insert_accepting_state): New.
7331 (augment_automaton): Adjust.
7332 Better locality of the variables.
7333 When looking if the start_symbol is shifted from the initial
7334 state, using `while (... symbol != start_symbol ...)' sounds
7335 better than `while (... symbol < start_symbol ...)': If fail
7336 to see how the order between symbols could be relevant!
7337
78af9bbc
AD
73382001-12-10 Akim Demaille <akim@epita.fr>
7339
7340 * src/getargs.h: Don't declare `spec_name_prefix' and
7341 `spec_file_prefix', declared by src/files.h.
7342 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
7343 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
7344 * src/output.c (prepare): Adjust.
7345 * src/reader.c (symbols_output): Likewise.
7346 * src/vmsgetargs.c: Vaguely adjust, but who cares?
7347
bdef2a41
AD
73482001-12-10 Akim Demaille <akim@epita.fr>
7349
7350 * src/muscle_tab.c (muscle_init): NULL is a better default than
7351 `"0"'.
7352
3735969c
AD
73532001-12-10 Akim Demaille <akim@epita.fr>
7354
7355 * src/reader.c (reader): Calling symbols_output once is enough.
7356
49701457
AD
73572001-12-10 Akim Demaille <akim@epita.fr>
7358
7359 Now that states have a complete set of members, the linked list of
7360 reductions is useless: just fill directly the state's reductions
7361 member.
7362
7363 * src/state.h (struct reductions): Remove member `number' and
7364 `next'.
7365 * src/LR0.c (first_reduction, last_reduction): Remove.
7366 (save_reductions): Don't link the new reductions, store them in
7367 this_state.
7368 * src/lalr.c (set_state_table): No need to attach reductions to
7369 states, it's already done.
7370 * src/output.c (output_actions): No longer free the shifts, then
7371 the reductions, then the states: free all the states and their
7372 members.
7373
0edad749
AD
73742001-12-10 Akim Demaille <akim@epita.fr>
7375
7376 * src/options.c (OPTN, DRTV, BOTH): New.
7377 (option_table): Use them.
7378
0edad749
AD
7379 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
7380 the job of system.h.
7381 * src/options.c: Don't include stdio.h and xalloc.h for the same
7382 reasons.
7383
5449dd0f
AD
73842001-12-10 Akim Demaille <akim@epita.fr>
7385
7386 * src/output.c (output, prepare): Make sure the values of the
7387 muscles `action' and `prologue' are 0-terminated.
7388
a870c567
AD
73892001-12-10 Akim Demaille <akim@epita.fr>
7390
7391 Clean up GCC warnings.
7392
7393 * src/reader.c (copy_action): `buf' is not used.
7394 (parse_skel_decl): Be static.
7395 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
7396 * src/options.h (create_long_option_table): Have a real prototype.
7397 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
7398 (hash_delete_at): Return const void *.
7399 Adjust casts to preserve the const.
7400
80df8768
AD
74012001-12-10 Akim Demaille <akim@epita.fr>
7402
7403 * configure.in: Require 2.52g.
7404 M4 is not needed, but AUTOM4TE is.
7405 * m4/m4.m4: Remove.
7406 * tests/Makefile.am: Adjust.
7407
f693ad14
AD
74082001-12-10 Akim Demaille <akim@epita.fr>
7409
7410 One structure for states is enough, even though theoretically
7411 there are LR(0) states and LALR(1) states.
7412
7413 * src/lalr.h (state_t): Remove.
7414 (state_table): Be state_t **, not state_t *.
7415 * src/state.h (core, CORE_ALLOC): Rename as...
7416 (state_t, STATE_ALLOC): this.
7417 Add the LALR(1) members: shifts, reductions, errs.
7418 * src/LR0.c (state_table): Rename as...
7419 (state_hash): this, to avoid name clashes with the global
7420 `state_table'.
7421 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
7422 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
7423
74ffbcb6
AD
74242001-12-10 Akim Demaille <akim@epita.fr>
7425
7426 Bison dumps core on bash.y.
7427 Reported by Pascal Bart.
7428
7429 * src/warshall.c (bitmatrix_print): New.
7430 (TC): Use it.
7431 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
7432 j must be the outer loop.
7433 * tests/regression.at (Broken Closure): New.
7434
07708e19
AD
74352001-12-05 Akim Demaille <akim@epita.fr>
7436
7437 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
7438 its argument.
ba1ecc07 7439 Reported by Peter Hamorsky.
07708e19 7440
92b16366
AD
74412001-12-05 Akim Demaille <akim@epita.fr>
7442
7443 * src/conflicts.c (err_table): Remove.
7444 (resolve_sr_conflict): Adjust.
7445 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
7446 Rename as...
7447 (state_t.reductions, state_t.shifts): this.
7448
076ab033
AD
74492001-12-05 Akim Demaille <akim@epita.fr>
7450
7451 * src/reduce.c (reduce_grammar_tables): No longer disable the
7452 removal of useless rules via CPP but via `if (0)', so that the
7453 compiler still check the code is valid.
7454 For instance, it should have noticed `rline' no longer exists: use
7455 the `line' member of rule_t.
7456 * src/gram.c (dummy, rline): Remove, unused.
7457
3843c413
AD
74582001-12-05 Akim Demaille <akim@epita.fr>
7459
7460 * src/output.c (pack_vector): Use assert, not berror.
7461 * src/main.c (berror): Remove, unused.
7462
43168960
AD
74632001-12-05 Akim Demaille <akim@epita.fr>
7464
7465 New experimental feature: if --verbose --trace output all the
7466 items of a state, not only its kernel.
7467
7468 * src/print.c (print_core): If `trace_flag', then invoke closure
7469 before outputting the items of the state (print_core is no longer
7470 a correct name them).
7471 (print_results): Invoke new_closure/free_closure if needed.
7472
b2872512
AD
74732001-12-05 Akim Demaille <akim@epita.fr>
7474
7475 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
7476 * src/closure.c, src/closure.h (itemsetsize): Rename as...
7477 (nitemset): for consistency with the rest of the project.
7478
23cbcc6c
AD
74792001-12-05 Akim Demaille <akim@epita.fr>
7480
7481 * src/closure.c (print_closure): Improve.
7482 (closure): Use it for printing input and output.
7483
03ec521c
AD
74842001-12-05 Akim Demaille <akim@epita.fr>
7485
7486 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
7487 indexed by nonterminals.
7488
3a7456dd
AD
74892001-12-05 Akim Demaille <akim@epita.fr>
7490
7491 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
7492 what it was!).
7493 * src/warshall.h: Remove accidental duplication of the content.
7494
1cbcf2e7
AD
74952001-12-05 Akim Demaille <akim@epita.fr>
7496
7497 * src/closure.c (set_fderives): De-obfuscate.
7498
84182270
AD
74992001-12-05 Akim Demaille <akim@epita.fr>
7500
7501 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
7502
3f6f053c
AD
75032001-12-05 Akim Demaille <akim@epita.fr>
7504
7505 * src/closure.c (set_firsts): De-obfuscate.
7506
7a5350ba
AD
75072001-12-05 Akim Demaille <akim@epita.fr>
7508
7509 * src/output.c (action_row): De-obfuscate
7510 using the good o' techniques: arrays not pointers, variable
7511 locality, BITISSET, RESETBIT etc.
7512
d954473d
AD
75132001-12-05 Akim Demaille <akim@epita.fr>
7514
7515 Pessimize the code to simplify it: from now on, all the states
7516 have a valid SHIFTS, which NSHIFTS is possibly 0.
7517
7518 * src/LR0.c (shifts_new): Be global and move to..
7519 * src/state.c, src/state.h: here.
7520 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
7521 * src/print_graph: Adjust.
7522
9839bbe5
AD
75232001-12-05 Akim Demaille <akim@epita.fr>
7524
7525 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
7526 * src/conflicts.c: Use it.
7527 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
7528 incorrectly ``simplified''.
7529
9f136c07
AD
75302001-12-05 Akim Demaille <akim@epita.fr>
7531
7532 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
7533 using the good o' techniques: arrays not pointers, variable
7534 locality, BITISSET, RESETBIT etc.
7535
b608206e
AD
75362001-12-05 Akim Demaille <akim@epita.fr>
7537
7538 * src/state.h (SHIFT_SYMBOL): New.
7539 * src/conflicts.c: Use it to deobfuscate.
7540
52afa962
AD
75412001-12-05 Akim Demaille <akim@epita.fr>
7542
7543 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
7544 (print_reductions): De-obfuscate using the good o' techniques:
7545 arrays not pointers, variable locality, BITISSET.
7546
e74dc321
AD
75472001-12-05 Akim Demaille <akim@epita.fr>
7548
7549 * src/conflicts.c (print_reductions): Arrays, not pointers.
7550 Use BITISSET.
7551
768fca83
AD
75522001-12-05 Akim Demaille <akim@epita.fr>
7553
7554 * src/conflicts.c (print_reductions): Pessimize, but clarify.
7555
a17e599f
AD
75562001-12-05 Akim Demaille <akim@epita.fr>
7557
7558 * src/conflicts.c (print_reductions): Improve variable locality.
7559
a04bc341
AD
75602001-12-05 Akim Demaille <akim@epita.fr>
7561
7562 * src/conflicts.c (print_reductions): Pessimize, but clarify.
7563
c8ea038e
AD
75642001-12-05 Akim Demaille <akim@epita.fr>
7565
7566 * src/conflicts.c (print_reductions): Improve variable locality.
7567
aa2aab3c
AD
75682001-12-05 Akim Demaille <akim@epita.fr>
7569
7570 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
7571 * src/lalr.c: Use them.
7572
b178c8cc
AD
75732001-12-05 Akim Demaille <akim@epita.fr>
7574
7575 * src/LR0.c (augment_automaton): Formatting changes.
7576 Better variable locality.
7577
f67d13aa
AD
75782001-12-05 Akim Demaille <akim@epita.fr>
7579
7580 * src/lalr.c (matrix_print): New.
7581 (transpose): Use it.
7582 Use arrays instead of pointers.
7583
c2713865
AD
75842001-12-05 Akim Demaille <akim@epita.fr>
7585
7586 * src/lalr.c (maxrhs): Move to...
7587 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
7588 * src/lalr.c (build_relations): Adjust.
7589
9887c18a
AD
75902001-12-05 Akim Demaille <akim@epita.fr>
7591
7592 * src/lalr.c (transpose): Free the memory allocated to the
7593 argument, as it is replaced by the results by the unique caller.
7594 (build_relations): Merely invoke transpose: it handles the memory
7595 deallocation.
7596 Improve variable locality.
7597 Avoid variables used as mere abbreviations.
7598 (compute_lookaheads): Use arrays instead of pointers.
7599
4d4f699c
AD
76002001-12-05 Akim Demaille <akim@epita.fr>
7601
7602 * src/lalr.c (initialize_F): Improve variable locality.
7603 Avoid variables used as mere abbreviations.
7604
80a69750
AD
76052001-12-05 Akim Demaille <akim@epita.fr>
7606
7607 * src/derives.c (print_derives): Display the ruleno.
7608 * src/lalr.c (initialize_F, transpose): Better variable locality
7609 to improve readability.
7610 Avoid variables used as mere abbreviations.
7611
fe961097
AD
76122001-12-05 Akim Demaille <akim@epita.fr>
7613
7614 * src/lalr.c (traverse): Use arrays instead of pointers.
7615
e3e4e814
AD
76162001-12-05 Akim Demaille <akim@epita.fr>
7617
7618 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
7619 the handling of squeue.
7620 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
7621
630e182b
AD
76222001-12-05 Akim Demaille <akim@epita.fr>
7623
7624 Because useless nonterminals are now kept alive (instead of being
7625 `destroyed'), we now sometimes examine them, and store information
7626 related to them. Hence we need to know their number, and adjust
7627 memory allocations.
7628
7629 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
7630 static.
7631 * src/LR0.c (allocate_itemsets): The memory allocated to
7632 `symbol_count' was used for two different purpose: once to count
7633 the number of occurrences of each symbol, and later reassigned to
7634 `shift_symbol', containing the symbol that can be shifted from a
7635 given state.
7636 Deobfuscate, i.e., allocate, use and free `symbol_count' here
7637 only, and...
7638 (new_itemsets): Allocate `shift_symbol' here.
7639 (allocate_itemsets): symbol_count includes useless nonterminals.
7640 Make room for them.
7641 (free_storage): Use `free', not `XFREE', for pointers that cannot
7642 be null.
7643
81b51460
AD
76442001-12-05 Akim Demaille <akim@epita.fr>
7645
7646 * src/nullable.c (set_nullable): Deobfuscate the handling of
7647 ritem.
7648 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
7649
3067fbef
AD
76502001-12-05 Akim Demaille <akim@epita.fr>
7651
7652 * src/gram.c, src/gram.h (ritem_print): New.
7653 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
7654 (This useless function was defined only to work around VMS linkers
7655 that can't handle compilation units with variables only).
7656 * src/reduce.c (dump_grammar): Use it to trace the construction of
7657 ritem.
7658
c2bea5f9
PE
76592001-12-04 Paul Eggert <eggert@twinsun.com>
7660
7d27c823
PE
7661 * src/bison.simple (union yyalloc): Change member names
7662 to be the same as the stack names.
7663 (yyparse): yyptr is now union yyalloc *, not char *.
7664 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
7665 and may generate better code on some machines.
c2bea5f9
PE
7666 (yystpcpy): Use prototype if __STDC__ is defined, not just
7667 if __cplusplus is defined.
35687a9d 7668
2c8a9dfa
AD
76692001-11-30 Akim Demaille <akim@epita.fr>
7670
7671 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
7672 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
7673 Gettext doesn't compile cleanly, and dies with -Werror.
7674 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
7675 Include WARNING_CFLAGS here.
7676 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
7677 before being defined.
7678
f4e421e6
AD
76792001-11-27 Paul Eggert <eggert@twinsun.com>
7680
7681 * lib/quotearg.h (quotearg_n, quotearg_n_style):
7682 First arg is int, not unsigned.
7683 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
7684 (SIZE_MAX, UINT_MAX): New macros.
7685 (quotearg_n_options): Abort if N is negative.
7686 Avoid overflow check on hosts where size_t is 64 bits and int
7687 is 32 bits, as overflow is impossible there.
7688 Fix off-by-one typo that caused unnecessary reallocation.
7689
7093d0f5
AD
76902001-11-29 Paul Eggert <eggert@twinsun.com>
7691
7692 Name space cleanup in generated parser.
7693
7694 * doc/bison.texinfo (Bison Parser): Discuss system headers
7695 and their effect on the user name space.
7696
7697 * src/bison.simple:
7698 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
7699 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
7700 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
7701
7702 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
7703 on user names when possible.
7704
7705 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
7706 Simplify test for whather <alloca.h> exists.
7707
7708 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
7709
7710 (<stdio.h>): Include if YYDEBUG.
7711
7712 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
7713 ! defined (yyoverflow) && ! defined (yymemcpy).
7714
7715 (yymemcpy, yyparse): Rename local variables as needed so that
7716 they all begin with 'yy'.
7717
7718 (yystrlen, yystpcpy): New functions.
7719
7720 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
7721 All uses changed.
7722
7723 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
7724 instead of relying on string.h functions. Use YYSTACK_ALLOC
7725 and YYSTACK_FREE instead of malloc and free.
7726
fd51e5ff
AD
77272001-11-30 Akim Demaille <akim@epita.fr>
7728
7729 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
7730 before their first uses.
7731 (YYBISON, YYPURE): Move to the top of the output.
7732
7d13ff5f
AD
77332001-11-30 Akim Demaille <akim@epita.fr>
7734
7735 * tests/reduce.at (Useless Nonterminals): Fix.
7736
892a3995
AD
77372001-11-30 Akim Demaille <akim@epita.fr>
7738
7739 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
7740 if body instead of `;' to pacify GCC's warnings.
7741
68f1e3ed
AD
77422001-11-30 Akim Demaille <akim@epita.fr>
7743
7744 Instead of mapping the LHS of unused rules to -1, keep the LHS
7745 valid, but flag the rules as invalid.
7746
7747 * src/gram.h (rule_t): `useful' is a new member.
7748 * src/print.c (print_grammar): Adjust.
7749 * src/derives.c (set_derives): Likewise.
7750 * src/reader.c (packgram, reduce_output): Likewise.
7751 * src/reduce.c (reduce_grammar_tables): Likewise.
7752 * tests/reduce.at (Underivable Rules, Useless Rules): New.
7753
d2d1b42b
AD
77542001-11-30 Akim Demaille <akim@epita.fr>
7755
7756 * src/reduce.c (reduce_output): Formatting changes.
7757 * src/print.c (print_results, print_grammar): Likewise.
7758 * tests/regression.at (Rule Line Numbers)
7759 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
7760
760b53a8
AD
77612001-11-30 Akim Demaille <akim@epita.fr>
7762
7763 * src/reduce.c (nonterminals_reduce): Instead of throwing away
7764 useless nonterminals, move them at the end of the symbol arrays.
7765 (reduce_output): Adjust.
7766 * tests/reduce.at (Useless Nonterminals): Adjust.
7767
00238958
AD
77682001-11-30 Akim Demaille <akim@epita.fr>
7769
7770 * src/reduce.c: Various comment/formatting changes.
7771 (nonterminals_reduce): New, extracted from...
7772 (reduce_grammar_tables): here.
7773 (reduce_grammar): Call nonterminals_reduce.
7774
396452de
PE
77752001-11-29 Paul Eggert <eggert@twinsun.com>
7776
7777 * src/bison.simple (YYSTACK_REALLOC): Remove.
7778 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
7779 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
7780 New macros.
7781 (union yyalloc): New type.
7782 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
7783 an arbitrary restriction on hosts where size_t is wider than int.
7784
7785 (yyparse): Don't dump core if alloca or malloc fails; instead, report
7786 a parser stack overflow. Allocate just one block of memory for all
7787 three stacks, instead of allocating three blocks; this typically is
7788 faster and reduces fragmentation.
7789
7790 Do not limit the number of items in the stack to a value that fits
7791 in 'int', as this is an arbitrary limit on hosts with 64-bit
7792 size_t and 32-bit int.
7793
147e184c
MA
77942001-11-29 Marc Autret <autret_m@epita.fr>
7795
7796 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
7797 of defining YYERROR_VERBOSE.
7798 [AT_DATA]: $4 is now out of C declarations in the prologue.
7799
426cf563
MA
78002001-11-28 Marc Autret <autret_m@epita.fr>
7801
7802 * src/reader.c (parse_dquoted_param): New.
7803 (parse_skel_decl): Use it.
7804 * src/lex.h: Add its prototype.
7805 * src/lex.c (literalchar): Become not static.
7806
c7925b99
MA
78072001-11-28 Marc Autret <autret_m@epita.fr>
7808
7809 * src/output.h: And put its extern declaration here.
7810 * src/output.c (error_verbose): Define here.
7811 (prepare): Echo name modification.
7812 * src/getargs.h: Clean its extern declaration.
7813 * src/getargs.c (error_verbose_flag): Remove.
7814 (getargs): Remove case 'e'.
7815 * src/options.c (option_table): 'error-verbose' is now seen as simple
7816 percent option.
7817 Include output.h.
7818
7819 * src/reader.c (read_declarations): Remove case tok_include.
7820 (parse_include_decl): Remove.
7821 * src/lex.h (token_t): Remove tok_include.
7822 * src/options.c (option_table): 'include' is now a simple command line
7823 option.
7824
5b5d1929
MA
78252001-11-28 Marc Autret <autret_m@epita.fr>
7826
7827 * src/bison.simple: Adjust muscle names.
7828 * src/muscle_tab.c (muscle_init): Also rename the muscles.
7829 * src/output.c (prepare): s/_/-/ for the muscles names.
7830 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
7831
8850be4b
MA
78322001-11-28 Marc Autret <autret_m@epita.fr>
7833
7834 * src/bison.simple: Fix debug.
7835 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
7836
4a38e613
AD
78372001-11-28 Akim Demaille <akim@epita.fr>
7838
7839 * src/LR0.c (shifts_new): New.
7840 (save_shifts, insert_start_shift, augment_automaton): Use it.
7841
4b35e1c1
AD
78422001-11-28 Akim Demaille <akim@epita.fr>
7843
7844 * src/closure.c (closure): `b' and `ruleno' denote the same value:
7845 keep ruleno only.
7846
d2b04478
AD
78472001-11-28 Akim Demaille <akim@epita.fr>
7848
7849 * src/closure.c (closure): Instead of looping over word in array
7850 then bits in words, loop over bits in array.
7851
2c4c30aa
AD
78522001-11-28 Akim Demaille <akim@epita.fr>
7853
7854 * src/closure.c (closure): No longer optimize the special case
7855 where all the bits of `ruleset[r]' are set to 0, to make the code
7856 clearer.
7857
576890b7
AD
78582001-11-28 Akim Demaille <akim@epita.fr>
7859
7860 * src/closure.c (closure): `r' and `c' are new variables, used to
7861 de-obfuscate accesses to RULESET and CORE.
7862
cb487d7d
AD
78632001-11-28 Akim Demaille <akim@epita.fr>
7864
7865 * src/reduce.c (reduce_print): Use ngettext.
7866 (dump_grammar): Improve the trace accuracy.
7867
6013d43f
AD
78682001-11-28 Akim Demaille <akim@epita.fr>
7869
7870 * src/reduce.c (dump_grammar): Don't translate trace messages.
7871
cb4956ee
AD
78722001-11-28 Akim Demaille <akim@epita.fr>
7873
7874 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
7875 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
7876 as all tags are free'ed afterwards.
7877 From Enrico Scholz.
7878
648185ab
PE
78792001-11-27 Paul Eggert <eggert@twinsun.com>
7880
7881 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
7882 use alloca when we didn't want to, and vice versa.
7883
68254a03
MA
78842001-11-27 Marc Autret <autret_m@epita.fr>
7885
9113b58f
AD
7886 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
7887 initialization.
68254a03
MA
7888 * src/output.c (prepare): Remove its update.
7889
04d843a2
MA
78902001-11-27 Marc Autret <autret_m@epita.fr>
7891
7892 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
7893 Use %error-verbose.
7894
d2079671 78952001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
7896
7897 * src/bison.simple: Remove YYERROR_VERBOSE using.
7898 Use %%error_verbose.
7899 (yyparse): Likewise.
7900 * src/output.c (prepare): Give its final value.
7901 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
7902 * src/getargs.h: Add its extern declaration.
7903 * src/getargs.c (error_verbose_flag): New int.
7904 (getargs): Update to catch new case.
7905 * src/options.c (option_table): 'error-verbose' is a new option.
7906 (shortopts): Update.
7907
e0327bc8
AD
79082001-11-27 Akim Demaille <akim@epita.fr>
7909
7910 * src/system.h: Use intl/libgettext.h.
7911 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
7912
000f1a3c
AD
79132001-11-27 Akim Demaille <akim@epita.fr>
7914
7915 * tests/torture.at (Exploding the Stack Size with Malloc):
7916 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
7917
26cfe0be
AD
79182001-11-27 Akim Demaille <akim@epita.fr>
7919
7920 * src/files.c: Include error.h.
7921 Reported by Hans Aberg.
7922
f6bd5427
MA
79232001-11-26 Marc Autret <autret_m@epita.fr>
7924
d2079671 7925 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
7926 (read_declarations): Add case tok_include.
7927 * src/getargs.h (include): Add its extern definition.
7928 * src/getargs.c (include): New const char *.
7929 (getargs): Add case '-I'.
7930 * src/options.c (option_table): Add include as command line and
7931 percent option.
7932 * src/lex.h (token_t): Add tok_include.
7933
2ca209c1
AD
79342001-11-26 Akim Demaille <akim@epita.fr>
7935
7936 * src/reader.c (readgram): Make sure rules for mid-rule actions
7937 have a lineno equal to that of their host rule.
7938 Reported by Hans Aberg.
7939 * tests/regression.at (Rule Line Numbers): New.
7940
0e41b407
AD
79412001-11-26 Akim Demaille <akim@epita.fr>
7942
7943 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
7944 size_ts.
7945
79462001-11-26 Akim Demaille <akim@epita.fr>
7947
7948 * src/complain.c, src/complain.h (error): Remove, provided by
7949 lib/error.[ch].
7950
e0c40012
AD
79512001-11-26 Akim Demaille <akim@epita.fr>
7952
7953 * src/reader.c (read_declarations): Don't abort on tok_illegal,
7954 issue an error message.
7955 * tests/regression.at (Invalid %directive): New.
7956 Reported by Hans Aberg.
7957
5e147124
AD
79582001-11-26 Akim Demaille <akim@epita.fr>
7959
7960 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
7961 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
7962
a034c8b8
AD
79632001-11-26 Akim Demaille <akim@epita.fr>
7964
7965 * src/conflicts.c (conflicts_print): Don't complain at all when
7966 there are no reduce/reduce conflicts, and as many shift/reduce
7967 conflicts as expected.
7968 * tests/regression.at (%expect right): Adjust.
7969
c64a20f3
AD
79702001-11-23 Akim Demaille <akim@epita.fr>
7971
7972 * lib/alloca.c: Update, from fileutils.
7973
5b0d29bb
AD
79742001-11-23 Akim Demaille <akim@epita.fr>
7975
7976 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
7977
722c4bfe
AD
79782001-11-23 Akim Demaille <akim@epita.fr>
7979
7980 * src/system.h: Include alloca.h.
7981 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
7982
6255b435
AD
79832001-11-23 Akim Demaille <akim@epita.fr>
7984
7985 * src/print_graph.c (print_actions): Remove `rule', unused.
7986 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
7987 pacify GCC's signed < unsigned warnings.
7988 * src/closure.c (itemsetsize): Likewise.
7989 * src/reader.c (symbol_list_new): Static.
7990
b29b2ed5
AD
79912001-11-23 Akim Demaille <akim@epita.fr>
7992
7993 Attaching lineno to buckets is stupid, since only one copy of each
7994 symbol is kept, only the line of the first occurrence is kept too.
7995
7996 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
7997 * src/reader.c (rline_allocated): Remove, unused.
7998 (symbol_list): Have a `line' member.
7999 (symbol_list_new): New.
8000 (readgram): Use it.
8001 * src/print.c (print_grammar): Output the rule line numbers.
8002 * tests/regression.at (Solved SR Conflicts)
8003 (Unresolved SR Conflicts): Adjust.
8004 Reported by Hans Aberg.
8005
a81b1d4a
MA
80062001-11-22 Marc Autret <autret_m@epita.fr>
8007
8008 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
8009
c1ecb3c1
MA
80102001-11-22 Marc Autret <autret_m@epita.fr>
8011
8012 * src/muscle_tab.c (muscle_init): Remove initialization of
8013 skeleton muscle.
8014 * src/output.c (output_master_parser): Do it here.
8015
fbe01355
AD
80162001-11-20 Akim Demaille <akim@epita.fr>
8017
8018 * po/sv.po: New.
8019 * configure.in (ALL_LINGUAS): Adjust.
8020 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
8021 longer contains strings to translate.
8022
81e895c0
AD
80232001-11-19 Akim Demaille <akim@epita.fr>
8024
8025 * src/conflicts.c (conflicts_print): Add a missing \n.
8026
6bb1878b
AD
80272001-11-19 Akim Demaille <akim@epita.fr>
8028
8029 * src/nullable.c (nullable_print): New.
8030 (set_nullable): Call it when tracing.
8031 Better locality of variables.
8032
d9ec2d07
AD
80332001-11-19 Akim Demaille <akim@epita.fr>
8034
8035 * src/print.c (print_actions): Better locality of variables.
8036
720e5c1b
AD
80372001-11-19 Akim Demaille <akim@epita.fr>
8038
8039 * src/derives.c (print_derives): Fix and enrich.
8040 * src/closure.c (print_fderives): Likewise.
8041
fb908786
AD
80422001-11-19 Akim Demaille <akim@epita.fr>
8043
8044 * src/closure.c (itemsetend): Remove, replaced with...
8045 (itemsetsize): new.
8046
125ecb56
AD
80472001-11-19 Akim Demaille <akim@epita.fr>
8048
8049 * src/LR0.c (kernel_end): Remove, replaced with...
8050 (kernel_size): new.
8051
d8cf039f
AD
80522001-11-19 Akim Demaille <akim@epita.fr>
8053
8054 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
8055 to clarify.
8056
7bec0760
AD
80572001-11-19 Akim Demaille <akim@epita.fr>
8058
8059 * src/closure.c (closure): Use arrays instead of pointers to clarify.
8060
c87d4863
AD
80612001-11-19 Akim Demaille <akim@epita.fr>
8062
8063 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
8064 trace messages.
8065 * src/LR0.c: Likewise.
8066 (allocate_itemsets): Use arrays instead of pointers to clarify.
8067
9bfe901c
AD
80682001-11-19 Akim Demaille <akim@epita.fr>
8069
8070 * src/getargs.c (statistics_flag): Replace with...
8071 (trace_flag): New.
8072 (longopts): Accept --trace instead of --statistics.
8073 * src/getargs.h, src/options.c: Adjust.
8074 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
8075 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
8076
97db7bd4
AD
80772001-11-19 Akim Demaille <akim@epita.fr>
8078
cc72668c 8079 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
8080 pointers to clarify the code.
8081 (save_reductions, save_shifts): Factor common parts of alternatives.
8082
2c5f66ed
AD
80832001-11-19 Akim Demaille <akim@epita.fr>
8084
8085 * src/LR0.c (new_state, get_state): Complete TRACE code.
8086 * src/closure.c: Include `reader.h' to get `tags', needed by the
8087 trace code.
8088 Rename the conditional DEBUG as TRACE.
8089 Output consistently TRACEs to stderr, not stdout.
8090 * src/derives.c: Likewise.
8091 * src/reduce.c: (inaccessable_symbols): Using if is better style
8092 than goto.
8093 Use `#if TRACE' instead of `#if 0' for tracing code.
8094
300f275f
AD
80952001-11-19 Akim Demaille <akim@epita.fr>
8096
8097 * src/system.h (LIST_FREE, shortcpy): New.
8098 * src/LR0.c: Use them.
8099 * src/output.c (free_itemsets, free_reductions, free_shifts):
8100 Remove, replaced by LIST_FREE.
8101
f59c437a
AD
81022001-11-19 Akim Demaille <akim@epita.fr>
8103
8104 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
8105 (REDUCTIONS_ALLOC): New.
8106 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
8107 allocation.
8108
6986fd9e
AD
81092001-11-19 Akim Demaille <akim@epita.fr>
8110
8111 * src/LR0.c (new_state): Complete trace code.
8112 * src/nullable.c (set_nullable): Don't translate traces.
8113
4bc30f78
AD
81142001-11-19 Akim Demaille <akim@epita.fr>
8115
8116 * src/print_graph.c (print_core): Better locality of variables.
8117 * src/print.c (print_core): Likewise.
8118
08a946e0
AD
81192001-11-19 Akim Demaille <akim@epita.fr>
8120
8121 * src/vcg.c: You do the output, so you are responsible of the
8122 handling of VCG syntax, in particular: use quotearg.
8123 * src/print_graph.c: Don't.
8124 (print_actions): Don't output the actions as part of the nodes,
8125 since that's the job of the edges.
8126 (print_state): Don't output by hand: fill the node description,
9bfe901c 8127 and ask for its output.
08a946e0 8128
f0473484
AD
81292001-11-19 Akim Demaille <akim@epita.fr>
8130
cc72668c
AD
8131 * src/bison.simple (yyparse): When verbosely reporting an error,
8132 no longer put additional quotes around token names.
f0473484
AD
8133 * tests/calc.at: Adjust.
8134
e41dc700
AD
81352001-11-19 Akim Demaille <akim@epita.fr>
8136
8137 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
8138 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
8139 * src/output.c: Adjust.
8140
652a871c
AD
81412001-11-19 Akim Demaille <akim@epita.fr>
8142
8143 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
8144 (rule_t): this.
8145 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
8146
b2ed6e58
AD
81472001-11-19 Akim Demaille <akim@epita.fr>
8148
8149 * src/gram.h (rule_t): New.
8150 (rule_table): New.
8151 (rrhs, rlhs): Remove, part of state_t.
8152 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
8153 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
8154 * src/reader.c, src/reduce.c: Adjust.
8155
edad7067
AD
81562001-11-19 Akim Demaille <akim@epita.fr>
8157
8158 * src/reader.c (symbols_output): New, extracted from...
8159 (packsymbols): Here.
8160 (reader): Call it.
8161
3feec034
AD
81622001-11-19 Akim Demaille <akim@epita.fr>
8163
8164 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
8165 (maxrhs): this new function.
8166
ddcd5fdf
AD
81672001-11-19 Akim Demaille <akim@epita.fr>
8168
cc72668c 8169 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
8170 Adjust.
8171
bb527fc2
AD
81722001-11-19 Akim Demaille <akim@epita.fr>
8173
cc72668c 8174 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
8175 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8176 * src/lalr.c: Adjust.
8177
a845a697
AD
81782001-11-19 Akim Demaille <akim@epita.fr>
8179
8180 * src/lalr.c (initialize_LA): Only initialize LA. Let...
8181 (set_state_table): handle the `lookaheads' members.
8182
f004bf6a
AD
81832001-11-19 Akim Demaille <akim@epita.fr>
8184
cc72668c
AD
8185 * src/lalr.h (lookaheads): Removed array, whose contents is now
8186 a member of...
f004bf6a
AD
8187 (state_t): this structure.
8188 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8189 Adjust.
8190
de326cc0
AD
81912001-11-19 Akim Demaille <akim@epita.fr>
8192
cc72668c
AD
8193 * src/lalr.h (consistent): Removed array, whose contents is now
8194 a member of...
de326cc0
AD
8195 (state_t): this structure.
8196 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8197 Adjust.
8198
90b4416b
AD
81992001-11-19 Akim Demaille <akim@epita.fr>
8200
cc72668c
AD
8201 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
8202 contents are now members of...
90b4416b
AD
8203 (state_t): this structure.
8204 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8205 Adjust.
8206
9703cc49
AD
82072001-11-19 Akim Demaille <akim@epita.fr>
8208
8209 * src/lalr.h (state_t): New.
8210 (state_table): Be a state_t * instead of a core **.
8211 (accessing_symbol): Remove, part of state_t.
8212 * src/lalr.c: Adjust.
8213 (set_accessing_symbol): Merge into...
8214 (set_state_table): this.
8215 * src/print_graph.c, src/conflicts.c: Adjust.
8216
d803322e
AD
82172001-11-14 Akim Demaille <akim@epita.fr>
8218
8219 * tests/calc.at, tests/output.at, tests/regression.at,
8220 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
8221 now the tests are run in private dirs, therefore AC_CLEANUP and
8222 family can be simplified to 0-ary.
8223 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
8224 use abs. path to find config.h.
8225 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
8226 stderr, there can be way too much random noise.
8227 Instead pass -Werror to GCC and rely on the exit status.
8228 Reported by Wolfram Wagner.
8229
3d76b07d
AD
82302001-11-14 Akim Demaille <akim@epita.fr>
8231
8232 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
8233 defined only if yyoverflow is defined, to avoid `warning: unused
8234 variable `yyvs1''.
8235 Reported by The Test Suite.
8236
09b503c8
AD
82372001-11-14 Akim Demaille <akim@epita.fr>
8238
8239 * src/print.c: Include reduce.h.
8240 Reported by Hans Aberg.
8241
82422001-11-14 Akim Demaille <akim@epita.fr>
8243
8244 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
8245 Revert a previous patch: these are really const.
8246 * src/conflicts.c (conflict_report): Additional useless pair of
8247 braces to pacify GCC's warnings for `if () if () {} else {}'.
8248 * src/lex.c (parse_percent_token): Replace equal_offset with
8249 arg_offset.
8250 arg is const.
8251 Be sure to strdup `arg' when used, since there is no reason for
8252 token_buffer not to change.
8253
0f37a994
AD
82542001-11-14 Akim Demaille <akim@epita.fr>
8255
8256 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
8257 definition.
8258 * src/main.c (main): Use them.
8259 Suggested by Hans Aberg.
8260
d39d93b8
AD
82612001-11-12 Akim Demaille <akim@epita.fr>
8262
8263 * src/system.h (ngettext): Now that we use ngettext, be sure to
8264 provide a default definition when NLS are not used.
8265
9edcd895
AD
82662001-11-12 Akim Demaille <akim@epita.fr>
8267
8268 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
8269 Use @kbd to denote user input.
8270 (Language and Grammar): ANSIfy the example.
8271 Adjust its layout for info/notinfo.
8272 (Location Tracking Calc): Output error messages to stderr.
8273 Output locations in a more GNUtically correct way.
8274 Fix a couple of Englishos.
8275 Adjust @group/@end group pairs.
8276
7da99ede
AD
82772001-11-12 Akim Demaille <akim@epita.fr>
8278
e3aa65c5 8279 %expect was not functioning at all.
7da99ede
AD
8280
8281 * src/conflicts.c (expected_conflicts): Set to -1.
8282 (conflict_report): Use ngettext.
8283 (conflicts_print): Check %expect and make its violation an error.
8284 * doc/bison.texinfo (Expect Decl): Adjust.
8285 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
8286 * tests/regression.at (%expect not enough, %expect right)
8287 (%expect too much): New.
8288
ba9dda1a
AD
82892001-11-12 Akim Demaille <akim@epita.fr>
8290
8291 * tests/regression.at (Conflicts): Rename as...
8292 (Unresolved SR Conflicts): this.
8293 (Solved SR Conflicts): New.
8294
337c5bd1
AD
82952001-11-12 Akim Demaille <akim@epita.fr>
8296
8297 * src/reduce.c (print_results): Rename as...
8298 (reduce_output): This.
8299 Output to OUT, passed as argument, instead of output_obstack.
8300 (dump_grammar): Likewise.
8301 (reduce_free): New.
8302 Also free V1.
8303 (reduce_grammar): No longer call reduce_output, since...
8304 * src/print.c (print_results): do it.
8305 * src/main.c (main): Call reduce_free;
8306
c73a41af
AD
83072001-11-12 Akim Demaille <akim@epita.fr>
8308
8309 * src/conflicts.c (print_reductions): Accept OUT as argument.
8310 Output to it, not to output_obstack.
8311 * src/print.c (print_actions): Adjust.
8312
0df87bb6
AD
83132001-11-12 Akim Demaille <akim@epita.fr>
8314
8315 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
8316 the result instead of using...
8317 (src_total, rrc_total, src_count, rrc_count): Remove.
8318 (any_conflicts): Remove.
8319 (print_conflicts): Split into...
8320 (conflicts_print, conflicts_output): New.
8321 * src/conflicts.h: Adjust.
8322 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 8323 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
8324 * tests/regression.at (Conflicts): New.
8325 Reported by Tom Lane.
8326
e4d3d4de
AD
83272001-11-12 Akim Demaille <akim@epita.fr>
8328
8329 * tests/regression.at (Invalid input): Remove, duplicate with
8330 ``Invalid input: 1''.
8331
6d7d248e
AD
83322001-11-12 Akim Demaille <akim@epita.fr>
8333
8334 * tests/torture.at (AT_DATA_STACK_TORTURE)
8335 (Exploding the Stack Size with Alloca)
8336 (Exploding the Stack Size with Malloc): New.
8337
e9e4c321
AD
83382001-11-12 Akim Demaille <akim@epita.fr>
8339
8340 * src/bison.simple (YYSTACK_REALLOC): New.
8341 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 8342 Reported by Per Allansson.
e9e4c321 8343
5f7e0832
AD
83442001-11-12 Pascal Bart <pascal.bart@epita.fr>
8345
8346 * src/bison.simple: Define type yystype instead of YYSTYPE, and
8347 define CPP macro, which substitute YYSTYPE by yystype.
8348 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
8349 with yyltype/YYLTYPE. This allows inclusion of the generated
8350 header within the parser if the compiler, such as GGC, accepts
8351 multiple equivalent #defines.
8352 From Akim.
8353
e3f1699f
AD
83542001-11-05 Akim Demaille <akim@epita.fr>
8355
8356 * src/reader.c (symbols_output): New, extracted from...
8357 (packsymbols): here.
8358 (reader): Adjust.
8359
65be0866
AD
83602001-11-05 Akim Demaille <akim@epita.fr>
8361
8362 * src/lex.c (parse_percent_token): s/quotearg/quote/.
8363
e4d910bf
AD
83642001-11-05 Akim Demaille <akim@epita.fr>
8365
8366 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
8367 pattern.
8368
951366c1
AD
83692001-11-05 Akim Demaille <akim@epita.fr>
8370
8371 * src/options.h (struct option_table_struct): set_flags is void*.
8372 * src/options.c (longopts): Support `--output' and `%output'.
8373 (usage): Adjust.
8374 * src/lex.h (tok_setopt): Remove, replaced with...
8375 (tok_intopt, tok_stropt): these new guys.
8376 * src/lex.c (getopt.h): Not needed.
8377 (token_buffer, unlexed_token_buffer): Not const.
8378 (percent_table): Promote `-' over `_' in directive names.
8379 Active `%name-prefix', `file-prefix', and `output'.
8380 (parse_percent_token): Accept possible arguments to directives.
8381 Promote `-' over `_' in directive names.
8382
d8988b2f
AD
83832001-11-04 Akim Demaille <akim@epita.fr>
8384
8385 * doc/bison.texinfo (Decl Summary): Split the list into
8386 `directives for grammars' and `directives for bison'.
8387 Sort'em.
8388 Add description of `%name-prefix', `file-prefix', and `output'.
8389 Promote `-' over `_' in directive names.
8390 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
8391 Simplify the description of `--name-prefix'.
8392 Promote `-' over `_' in directive names.
8393 Promote `--output' over `--output-file'.
8394 Fix the description of `--defines'.
8395 * tests/output.at: Exercise %file-prefix and %output.
8396
6468d18e
AD
83972001-11-02 Akim Demaille <akim@epita.fr>
8398
8399 * doc/refcard.tex: Update.
8400
6b7e85b9
AD
84012001-11-02 Akim Demaille <akim@epita.fr>
8402
8403 * src/symtab.h (SUNDEF): New.
8404 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
8405 stand for `uninitialized', instead of 0.
8406 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
8407 * src/lex.c (lex): Adjust.
8408
8409 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
8410 Number it 0.
8411 Let yylex return it instead of a plain 0.
8412 Reported by Dick Streefland.
8413
cd5aafcf
AD
84142001-11-02 Akim Demaille <akim@epita.fr>
8415
8416 * tests/regression.at (Mixing %token styles): New test.
8417
037ca2f1
AD
84182001-11-02 Akim Demaille <akim@epita.fr>
8419
8420 * src/reader.c (parse_thong_decl): Formatting changes.
8421 (token_translations_init): New, extracted from...
8422 (packsymbols): Here.
8423 Adjust.
8424
270a173c
AD
84252001-11-01 Akim Demaille <akim@epita.fr>
8426
8427 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
8428 Check that `9foo.y' produces correct cpp guards.
8429 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
8430 guards.
8431 Reported by Wwp.
8432
561f9a30
AD
84332001-11-01 Akim Demaille <akim@epita.fr>
8434
8435 * tests/regression.at (Invalid input: 2): New.
8436 * src/lex.c (unlexed_token_buffer): New.
8437 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
8438 too.
8439 Reported by Wwp.
8440
f987e9d2
AD
84412001-11-01 Akim Demaille <akim@epita.fr>
8442
8443 * tests/calc.at: Catch up with 1.30.
8444 * configure.in: Bump to 1.49a.
8445 Adjust to newer Autotest.
8446
0846f581
PB
84472001-10-19 Pascal Bart <pascal.bart@epita.fr>
8448
8449 * src/conflicts.c: Move global variables rrc_total and src_total ...
8450 (print_conflicts): here.
8451 * src/output.c (output): Free global variable user_toknums.
8452 * src/lex.c (token_obstack): Become static.
8453
3c1a79b3
AD
84542001-10-18 Akim Demaille <akim@epita.fr>
8455
8456 * tests/atlocal.in (GCC): Add.
8457 * tests/calc.at: s/m4_match/m4_bmatch/.
8458 s/m4_patsubst/m4_bpatsubst/.
8459 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
8460 * configure.in: AC_SUBST(GCC).
8461
5d52e7d0
MA
84622001-10-14 Marc Autret <autret_m@epita.fr>
8463
8464 * src/options.c (create_long_option_table): Fix.
8465
631aa1d3
AD
84662001-10-10 Akim Demaille <akim@epita.fr>
8467
8468 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
8469
f6ec6d13
AD
84702001-10-04 Akim Demaille <akim@epita.fr>
8471
8472 * src/reader.c (parse_union_decl): Push the caracters in
8473 union_obstack, not attrs_obstack.
8474
342b8b6e
AD
84752001-10-04 Akim Demaille <akim@epita.fr>
8476
8477 Merge in the branch 1.29.
8478
8479 * src/reader.c (packsymbols): Use a temporary obstack for
8480 `%%tokendef', since output_stack is already used elsewhere.
8481
8482 2001-10-02 Akim Demaille <akim@epita.fr>
8483
8484 Bump 1.29d.
8485
8486 2001-10-02 Akim Demaille <akim@epita.fr>
8487
8488 Version 1.29c.
8489
8490 2001-10-02 Akim Demaille <akim@epita.fr>
8491
8492 * tests/regression.at (Invalid CPP headers): New.
8493 From Alexander Belopolsky.
8494 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
8495
8496 2001-10-02 Akim Demaille <akim@epita.fr>
8497
8498 * tests/regression.at (Invalid input): New.
8499 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
8500 Reported by Shura.
8501
8502 2001-10-02 Akim Demaille <akim@epita.fr>
8503
8504 * tests/calc.at: Now that --debug works, the tests must be adjusted.
8505
8506 2001-10-02 Akim Demaille <akim@epita.fr>
8507
8508 * src/output.c (output_parser): Assert `skeleton'.
8509 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
8510 systems.
8511 From Shura.
8512
8513 2001-10-01 Marc Autret <autret_m@epita.fr>
8514
8515 * src/lex.h: Echo modifications.
8516 * src/lex.c (unlex): Parameter is now token_t.
8517 From Hans Aberg.
8518
8519 2001-10-01 Marc Autret <autret_m@epita.fr>
8520
8521 * src/main.c: Include lex.h.
8522 From Hans Aberg.
8523
8524 2001-09-29 Akim Demaille <akim@epita.fr>
8525
8526 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
8527
8528 2001-09-28 Akim Demaille <akim@epita.fr>
8529
8530 * tests/testsuite.at: Update to newer Autotest.
8531 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
8532
8533 2001-09-27 Akim Demaille <akim@epita.fr>
8534
8535 Position independent wrapper.
8536
8537 * tests/bison: Remove.
8538 * tests/bison.in: New.
8539 * configure.in: Adjust.
8540
8541 2001-09-27 Paul Eggert <eggert@twinsun.com>
8542
8543 Port quotearg fixes from tar 1.13.24.
8544
8545 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8546 tm to be declared.
8547 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8548 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8549
8550 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
8551 * m4/mbrtowc.m4: New file.
8552 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
8553 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
8554
8555 2001-09-27 Akim Demaille <akim@epita.fr>
8556
8557 Bump to 1.29c.
8558
8559 2001-09-27 Akim Demaille <akim@epita.fr>
8560
8561 Version 1.29b.
8562
8563 2001-09-25 Akim Demaille <akim@epita.fr>
8564
8565 * src/system.h: Include `xalloc.h'.
8566 Remove it from the C files.
8567 * src/files.c (output_files): Free the obstacks.
8568 * src/lex.c (init_lex): Rename as...
8569 (lex_init): this.
8570 (lex_free): New.
8571 * src/main.c (main): Use it.
8572
8573 2001-09-24 Marc Autret <autret_m@epita.fr>
8574
8575 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
8576 to output informations in fout (FILE*).
8577 (open_graph, close_graph): Likewise.
8578 (output_graph, output_edge, output_node): Likewise.
8579 * src/vcg.h: Update function prototypes.
8580 * src/print_graph.c (print_graph): Open output graph file.
8581 (print_actions): Adjust.
8582 * src/files.h: Remove extern declaration.
8583 * src/files.c: Remove graph_obstack declaration.
8584 (open_files): Remove graph_obstack initialization.
8585 (output_files): Remove graph_obstack saving.
8586
8587 2001-09-24 Marc Autret <autret_m@epita.fr>
8588
8589 * src/files.c (compute_output_file_names): Fix.
8590
8591 2001-09-24 Marc Autret <autret_m@epita.fr>,
8592 Akim Demaille <akim@epita.fr>
8593
8594 * src/reader.c (reader): Remove call to free_symtab ().
8595 * src/main.c (main): Call it here.
8596 Include symtab.h.
8597 * src/conflicts.c (initialize_conflicts): Rename as...
8598 (solve_conflicts): this.
8599 * src/print.c (print_core, print_actions, print_state)
8600 (print_grammar): Dump to a file instead a `output_obstack'.
8601 (print_results): Dump `output_obstack', and then proceed with the
8602 FILE *.
8603 * src/files.c (compute_output_file_names, close_files): New.
8604 (output_files): Adjust.
8605 * src/main.c (main): Adjust.
8606
8607 2001-09-23 Marc Autret <autret_m@epita.fr>
8608
8609 * src/files.c (compute_header_macro): Computes header macro name
8610 from spec_defines_file when given.
8611
8612 2001-09-23 Marc Autret <autret_m@epita.fr>
8613
8614 * src/files.c (output_files): Add default extensions.
8615
8616 2001-09-22 Akim Demaille <akim@epita.fr>
8617
8618 * src/conflicts.c (finalize_conflicts): Rename as...
8619 (free_conflicts): this.
8620
8621 2001-09-22 Akim Demaille <akim@epita.fr>
8622
8623 * src/gram.c (gram_free): Rename back as...
8624 (dummy): this.
8625 (output_token_translations): Free `token_translations'.
8626 * src/symtab.c (free_symtab): Free the tag field.
8627
8628 2001-09-22 Akim Demaille <akim@epita.fr>
8629
8630 Remove `translations' as it is always set to true.
8631
8632 * src/gram.h: Adjust.
8633 * src/reader.c (packsymbols, parse_token_decl): Adjust
8634 * src/print.c (print_grammar): Adjust.
8635 * src/output.c (output_token_translations): Adjust.
8636 * src/lex.c (lex): Adjust.
8637 * src/gram.c: Be sure the set pointers to NULL.
8638 (dummy): Rename as...
8639 (gram_free): this.
8640
8641 2001-09-22 Akim Demaille <akim@epita.fr>
8642
8643 * configure.in: Invoke AM_LIB_DMALLOC.
8644 * src/system.h: Use dmalloc.
8645 * src/LR0.c: Be sure to have pointers initialized to NULL.
8646 (allocate_itemsets): Allocate kernel_items only if needed.
8647
8648 2001-09-22 Akim Demaille <akim@epita.fr>
8649
8650 * configure.in: Bump to 1.29b.
8651 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
8652 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
8653 need xmalloc.c in calc.y.
8654 From Pascal Bart.
8655
8656 2001-09-21 Akim Demaille <akim@epita.fr>
8657
8658 Version 1.29a.
8659 * Makefile.maint, config/config.guess, config/config.sub,
8660 * config/missing: Update from masters.
8661 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
8662 upon package.m4.
8663 * configure.in (ALL_LINGUAS): Add `tr'.
8664
8665 2001-09-21 Akim Demaille <akim@epita.fr>
8666
8667 * tests/Makefile.am (package.m4): Move to...
8668 ($(srcdir)/$(TESTSUITE)): here.
8669
8670 2001-09-20 Akim Demaille <akim@epita.fr>
8671
8672 * src/complain.c: No longer try to be standalone: use system.h.
8673 Don't assume __STDC__ is defined to 1. Just test if it is defined.
8674 * src/complain.h: Likewise.
8675 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
8676 Remove the unused variable `n'.
8677 From Albert Chin-A-Young.
8678
8679 2001-09-18 Marc Autret <autret_m@epita.fr>
8680
8681 * doc/bison.1: Update.
8682 * doc/bison.texinfo (Bison Options): Update --defines and --graph
8683 descriptions.
8684 (Option Cross Key): Update.
8685 Add --graph.
8686
8687 2001-09-18 Marc Autret <autret_m@epita.fr>
8688
8689 * tests/regression.at: New test (comment in %union).
8690
8691 2001-09-18 Marc Autret <autret_m@epita.fr>
8692
8693 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
8694 do that.
8695 Reported by Keith Browne.
8696
8697 2001-09-18 Marc Autret <autret_m@epita.fr>
8698
8699 * tests/output.at: Add tests for --defines and --graph.
8700
8701 2001-09-18 Marc Autret <autret_m@epita.fr>
8702
8703 * tests/output.at: Removes tests of %{header,src}_extension features.
8704
8705 2001-09-18 Akim Demaille <akim@epita.fr>
8706
8707 * tests/Makefile.am (package.m4): New.
8708 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
8709 (_AT_CHECK_CALC_ERROR): Likewise.
8710 Factor the `, ' part of verbose error messages.
8711
8712 2001-09-18 Marc Autret <autret_m@epita.fr>
8713
8714 * src/getargs.c (longopts): Declare --defines and --graph as options
8715 with optional arguments.
8716 * src/files.h: Add extern declarations.
8717 * src/files.c (spec_graph_file, spec_defines_file): New.
8718 (output_files): Update.
8719 Remove CPP-outed code.
8720
8721 2001-09-18 Marc Autret <autret_m@epita.fr>
8722
8723 Turn off %{source,header}_extension feature.
8724
8725 * src/files.c (compute_exts_from_gf): Update.
8726 (compute_exts_from_src): Update.
8727 (output_files): CPP-out useless code.
8728 * src/files.h: Remove {header,source}_extension extern declarations.
8729 * src/reader.c (parse_dquoted_param): CPP-out.
8730 (parse_header_extension_decl): Remove.
8731 (parse_source_extension_decl): Remove.
8732 (read_declarations): Remove cases tok_{hdrext,srcext}.
8733 * src/lex.c (percent_table): Remove {header,source}_extension entries.
8734 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
8735
8736 2001-09-10 Akim Demaille <akim@epita.fr>
8737
8738 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
8739 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
8740 (AT_CHECK_OUTPUT): this.
8741 Merely check ls' exit status, its output is useless.
8742
8743 2001-09-10 Akim Demaille <akim@epita.fr>
8744
8745 * tests/calc.at: Use m4_match.
8746 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
8747
8748 2001-09-10 Marc Autret <autret_m@epita.fr>,
8749 Akim Demaille <akim@epita.fr>
8750
8751 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
8752 enum color_e.
8753 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
8754 to `normal'.
8755 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
8756 * src/lex.h: Adjust prototype.
8757 (token_t): Add `tok_undef'.
8758 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
8759 (parse_percent_token): Now returns token_t.
8760 Add default statement in switch.
8761 (lex): Separate `c' as an input variable, from the token_t result
8762 part.
8763 (unlexed): Is a token_t.
8764
8765 2001-09-10 Akim Demaille <akim@epita.fr>
8766
8767 * configure.in: Bump to 1.29a.
8768
8769 2001-09-07 Akim Demaille <akim@epita.fr>
8770
8771 Version 1.29.
8772
8773 2001-08-30 Akim Demaille <akim@epita.fr>
8774
8775 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
8776 * m4/atconfig.m4: Remove.
8777 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
8778 * tests/bison: New.
8779 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
8780 m4_if, m4_patsubst, and m4_regexp.
8781 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
8782 `input' file instead of echo.
8783
8784 2001-08-29 Akim Demaille <akim@epita.fr>
8785
8786 Bump to 1.28e.
8787
8788 2001-08-29 Akim Demaille <akim@epita.fr>
8789
8790 Version 1.28d.
8791
8792 2001-08-29 Paul Eggert <eggert@twinsun.com>
8793
8794 * src/bison.simple (yyparse): Don't take the address of an
8795 item before the start of an array, as that doesn't conform to
8796 the C Standard.
8797
8798 2001-08-29 Robert Anisko <anisko_r@epita.fr>
8799
8800 * doc/bison.texinfo (Location Tracking Calc): New node.
8801
8802 2001-08-29 Paul Eggert <eggert@twinsun.com>
8803
8804 * src/output.c (output): Do not define const, as this now
8805 causes more problems than it cures.
8806
8807 2001-08-29 Akim Demaille <akim@epita.fr>
8808
8809 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
8810 the nodes.
8811 Be sure to tag the `detailmenu'.
8812
8813 2001-08-29 Akim Demaille <akim@epita.fr>
8814
8815 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
8816 download in a tmp dir.
8817
8818 2001-08-28 Marc Autret <autret_m@epita.fr>
8819
8820 * config/depcomp: New file.
8821
8822 2001-08-28 Marc Autret <autret_m@epita.fr>
8823
8824 * doc/bison.1 (mandoc): Adjust.
8825 From Juan Manuel Guerrero.
8826
8827 2001-08-28 Marc Autret <autret_m@epita.fr>
8828
8829 * src/print_graph.c (print_state): Fix.
8830
8831 2001-08-27 Marc Autret <autret_m@epita.fr>
8832
8833 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
8834 char * members.
8835 Echo modifications to the functions prototypes.
8836 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
8837
8838 2001-08-27 Marc Autret <autret_m@epita.fr>
8839
8840 * src/vcg.c: Include `xalloc.h'.
8841 (add_colorentry): New.
8842 (add_classname): New.
8843 (add_infoname): New.
8844 * src/vcg.h: Add new prototypes.
8845
8846 2001-08-27 Akim Demaille <akim@epita.fr>
8847
8848 * Makefile.maint: Sync. again with CVS Autoconf.
8849
8850 2001-08-27 Akim Demaille <akim@epita.fr>
8851
8852 * Makefile.maint: Formatting changes.
8853 (po-update, cvs-update, update): New targets.
8854 (AMTAR): Remove.
8855
8856 2001-08-27 Akim Demaille <akim@epita.fr>
8857
8858 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8859 * Makefile.maint: Sync. with CVS Autoconf.
8860
8861 2001-08-27 Marc Autret <autret_m@epita.fr>
8862
8863 * src/vcg.h (struct infoname_s): New.
8864 (struct colorentry_s): New.
8865 (graph_s): New fields {vertical,horizontal}_order in structure.
8866 Add `infoname' field.
8867 Add `colorentry' field;
8868 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
8869 (G_HORIZONTAL_ORDER): New.
8870 (G_INFONAME): New.
8871 (G_COLORENTRY): New.
8872 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
8873 Add output of `infoname'.
8874 Add output of `colorentry'.
8875
8876 2001-08-27 Marc Autret <autret_m@epita.fr>
8877
8878 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
8879 This one shadowed a global parameter.
8880
8881 2001-08-24 Marc Autret <autret_m@epita.fr>
8882
8883 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
8884 instead of `unsigned'.
8885 (print_state): Do not call obstack_object_size () in obstack_grow ()
8886 to avoid macro variables shadowing.
8887
8888 2001-08-23 Marc Autret <autret_m@epita.fr>
8889
8890 * src/lex.c (percent_table): Typo: s/naem/name/.
8891 Add graph option.
8892 Normalize new options declarations.
8893
8894 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
8895
8896 * tests/suite.at: Exercise %header_extension and %source_extension.
8897
8898 2001-08-16 Marc Autret <autret_m@epita.fr>
8899
8900 * src/reader.c (parse_dquoted_param): New.
8901 (parse_header_extension_decl): Use it.
8902 (parse_source_extension_decl): Likewise.
8903
8904 2001-08-16 Marc Autret <autret_m@epita.fr>
8905
8906 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
8907 (get_xxxx_str): Use assert () instead of complain ().
8908 Remove return invokations in default cases.
8909 (get_decision_str): Modify default behaviour. Remove second argument.
8910 Echo modifications on calls.
8911 (output_graph): Fix.
8912
8913 2001-08-16 Marc Autret <autret_m@epita.fr>
8914
8915 * src/getargs.c (usage): Update with ``-g, --graph''.
8916
8917 2001-08-16 Marc Autret <autret_m@epita.fr>
8918
8919 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
8920 (Option Cross Key): Likewise.
8921 * doc/bison.1: Update.
8922
1c8c2190
PB
89232001-09-25 Pascal Bart <pascal.bart@epita.fr>
8924
8925 * src/output.c (output_master_parser): Don't finish action_obstack.
8926 (output_parser): Don't care about the muscle action, here.
8927 (prepare): Copy the action_obstack in the action muscle.
8928 (output): Free action_obstack.
8929
180d45ba
PB
89302001-09-23 Pascal Bart <pascal.bart@epita.fr>
8931
8932 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
8933 will contain `%union' declaration.
8934 (parse_union_decl): Delete #line directive output.
8935 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
8936 informations about %union.
8937 (parse_union_decl): Copy the union_obstack in the muscle stype.
8938 * src/bison.simple: Add new #line directive.
8939 Add typdef %%stype YYSTYPE.
8940
c51d1a19
PB
89412001-09-23 Pascal Bart <pascal.bart@epita.fr>
8942
8943 * src/bison.simple: Add new `#line' directive.
8944
6f9344da
PB
89452001-09-22 Pascal Bart <pascal.bart@epita.fr>
8946
8947 * src/bison.simple: New `#line' directive.
8948 * src/output.c (output_parser): Support new dynamic muscle input_line.
8949
652def80
MA
89502001-09-22 Marc Autret <autret_m@epita.fr>
8951
8952 * src/output.c (output_master_parser): New.
8953 (output_parser): Be more re-entrant.
8954
25b222fa
MA
89552001-09-21 Marc Autret <autret_m@epita.fr>
8956
8957 * src/reader.c (copy_definition, parse_union_decl): Update and use
8958 `linef' muscle.
8959 (copy_action): Likewise.
8960 Use obstack_1grow ().
8961 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
8962
6bc35ae5
MA
89632001-09-21 Marc Autret <autret_m@epita.fr>
8964
8965 * src/options.c (option_table): Adjust.
8966 * src/lex.c (parse_percent_token): Fix.
8967
c0629aa1
PB
89682001-09-20 Pascal Bart <pascal.bart@epita.fr>
8969
8970 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 8971
82b6d266
PB
89722001-09-20 Pascal Bart <pascal.bart@epita.fr>
8973
8974 * src/lex.c (parse_percent_token): Change type of variable `tx', which
8975 is now an option_table_struct*.
8976 (option_strcmp): New function option_strcmp.
8977 (parse_percent_token): Call option_strcmp.
8978 * src/getargs.c (xalloc.h, options.h): Include it.
8979 (getargs): Call create_long_option_table.
8980 (getargs): Free longopts at the end of the function.
8981 (shortopts): Move in options.c.
8982 * src/options.c (create_long_option_table): New function. Convert
8983 information from option_table to option structure.
8984 * src/reader.c (options.h): Include it.
8985
8986 * src/Makefile.am: Adjust.
8987 * src/options.c (option_table): Create from longopts and percent_table.
8988 * src/getargs.c (longopts): Delete.
8989 * src/lex.c (struct percent_table_struct): Delete.
8990 (percent_table): Delete.
8991 (options.h): Include it.
8992 * src/options.c: Create.
8993 * src/options.h: Create.
8994 Declare enum opt_access_e.
8995 Define struct option_table_struct.
8996
75f5aaea
MA
89972001-09-20 Marc Autret <autret_m@epita.fr>
8998
8999 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
9000 sections of Bison.
9001
f508cb0a
PB
90022001-09-19 Pascal Bart <pascal.bart@epita.fr>
9003
9004 * src/bison.simple: s/%%filename/%%skeleton.
9005 * src/muscle_tab.c (getargs.h): Include it.
9006 (muscle_init): Insert new muscle skeleton.
9007
13105fc1
PB
90082001-09-18 Pascal Bart <pascal.bart@epita.fr>
9009
9010 * src/output.c (output_parser): Delete unused variable actions_dumped.
9011
b0c4483e
PB
90122001-09-07 Pascal Bart <pascal.bart@epita.fr>
9013
9014 * src/output.c (output): Delete call to reader_output_yylsp.
9015 * src/reader.c (reader): Likewise.
9016 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 9017
11d82f03
MA
90182001-09-02 Marc Autret <autret_m@epita.fr>
9019
9020 * src/reader.c: Include muscle_tab.h.
9021 (parse_union_decl): Update.
9022 (parse_macro_decl): Rename parse_muscle_decl.
9023 Update to use renamed functions and variable.
9024 (read_declarations, copy_action, read_additionnal_code, : Updated
9025 with correct variables and functions names.
9026 (packsymbols, reader): Likewise.
342b8b6e 9027
11d82f03 9028 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 9029
11d82f03
MA
9030 * src/output.c: Include muscle_tab.h
9031 In all functions using macro_insert, change by using muscle_insert ().
9032 (macro_obstack): Rename muscle_obstack.
9033 Echo modifications in the whole file.
9034 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
9035 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
9036 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
9037
9038 * src/muscle_tab.h: Update double inclusion macros.
9039 (macro_entry_s): Rename muscle_entry_s.
9040 Update prototypes.
342b8b6e 9041
11d82f03
MA
9042 * src/muscle_tab.c: Include muscle_tab.h.
9043 Rename macro_tabble to muscle_table.
9044 (mhash1, mhash2, mcmp): Use muscle_entry.
9045 (macro_init): Rename muscle_init. Update.
9046 (macro_insert): Rename muscle_insert. Update.
9047 (macro_find): Rename muscle_find. Update.
9048
9049 * src/main.c: Include muscle_tab.h.
9050 (main): Call muscle_init ().
9051 * src/Makefile.am (bison_SOURCES): Echo modifications.
9052
93a37297
MA
90532001-09-02 Marc Autret <autret_m@epita.fr>
9054
f753cd62 9055 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 9056
f753cd62
MA
9057 * src/muscle_tab.c, src/muscle_tab.h: Add files.
9058
90592001-09-02 Marc Autret <autret_m@epita.fr>
9060
9061 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 9062
682d48cd
PB
90632001-09-01 Pascal Bart <pascal.bart@epita.fr>
9064
342b8b6e 9065 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
9066 filename.
9067
087c8fda
MA
90682001-09-01 Marc Autret <autret_m@epita.fr>
9069
9070 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
9071 to an explicit value to activate the feature. We do it here.
9072
dda680cb
PB
90732001-08-31 Pascal Bart <pascal.bart@epita.fr>
9074
9075 * src/output.c (prepare): Delete the `filename' muscule insertion.
9076 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
9077 (parse_union_decl): Likewise.
9078 * src/macrotab.c (macro_init): Initialize filename by infile.
9079
9e644e64
MA
90802001-08-31 Marc Autret <autret_m@epita.fr>
9081
9082 * src/bison.simple (YYLSP_NEEDED): New definition.
9083 * src/output.c (prepare): Add macro insertion of `locations_flag'
9084
17da6427
PB
90852001-08-31 Pascal Bart <pascal.bart@epita.fr>
9086
9087 * src/output.c (prepare): Delete insertion of previous muscles,
9088 and insert the `prefix' muscles.
9089 * src/macrotab.c (macro_init): Likewise.
9090 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 9091 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
9092 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
9093 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 9094 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
9095 name_prefix.
9096
e8cb70b9
PB
90972001-08-31 Pascal Bart <pascal.bart@epita.fr>
9098
9099 * src/main.c (main): Standardize.
9100 * src/output.c (output_table_data, output_parser): Likewise.
9101 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
9102
63c2d5de
MA
91032001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
9104
342b8b6e 9105 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
9106 %%epilogue.
9107 * src/output.c (output): Rename %%declarations to %%prologue.
9108 * src/bison.simple: Echo modifications.
342b8b6e 9109
d8cb5183
MA
91102001-08-31 Marc Autret <autret_m@epita.fr>
9111
9112 * src/reader.c (readgram): CleanUp.
9113 (output_token_defines): Likewise.
9114 (packsymbols): Likewise.
9115 (reader): Likewise.
9116 * src/output.c (output): CPP-out useless code.
9117
6c686258
PB
91182001-08-31 Pascal Bart <pascal.bart@epita.fr>
9119
342b8b6e 9120 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
9121 output_trailers and output_headers.
9122 * src/output.h: Remove obsolete functions prototypes of output_headers
9123 and output_trailers.
9124
8f451ef7
PB
91252001-08-30 Pascal Bart <pascal.bart@epita.fr>
9126
9127 * src/main.c: Include macrotab.h.
342b8b6e 9128 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
9129 Adjust functions prototypes.
9130 * src/macrotab.c (macro_insert): Constify key and value.
9131 (macro_find): Constify key.
9132 (macro_insert): Include 'xalloc.h'
9133 (macro_insert): Use XMALLOC.
9134 (macro_find): Constify return value.
9135 * src/output.c (output_table_data): Rename table to table_data.
9136 (output_parser): Constify macro_key, macro_value.
9137
997b6fd0 91382001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
9139
9140 * src/reader.c (parse_skel_decl): New.
342b8b6e 9141 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
9142 * src/lex.h (token_t): New token `tok_skel'.
9143 * src/lex.c (percent_table): Add skeleton option entry.
9144 Standardize.
9145
ff48177d
MA
91462001-08-29 Marc Autret <autret_m@epita.fr>
9147
9148 * src/bison.simple: Add %%user_code directive at the end.
9149 * src/reader.c (read_additionnal_code): New.
9150 (reader): Use it.
9151 * src/output.c (output_program): Remove.
9152 (output): Update.
9153
b33160bf
MA
91542001-08-28 Marc Autret <autret_m@epita.fr>
9155
9156 * src/output.c (output_actions): Clean up.
4e5caae2 9157 (output_gram): CPP-out useless code.
b33160bf
MA
9158 * src/reader.c (reader): Clean up, CPP-out useless code.
9159
d1a2daf7
PB
91602001-08-28 Pascal Bart <pascal.bart@epita.fr>
9161
342b8b6e 9162 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 9163 directive.
d1a2daf7
PB
9164 * src/bison.simple: Add `%%definitions'.
9165
2b763dfe
MA
91662001-08-28 Marc Autret <autret_m@epita.fr>
9167
9168 * config/depcomp: New file.
9169
f1a87ef6
PE
91702001-08-27 Paul Eggert <eggert@twinsun.com>
9171
9172 * src/bison.simple (yyparse): Don't take the address of an
9173 item before the start of an array, as that doesn't conform to
9174 the C Standard.
9175
82e236e2
RA
91762001-08-27 Robert Anisko <robert.anisko@epita.fr>
9177
f1a87ef6 9178 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
9179 obstack. It was done too late here.
9180
9181 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
9182 completely wrong.
9183 (reader): Initialize the macro obstack here, since we need it to grow
9184 '%define' directives.
9185
9186 * src/reader.h: Declare the macro obstack as extern.
9187
b0cfa28a
RA
91882001-08-27 Robert Anisko <robert.anisko@epita.fr>
9189
9190 * src/output.c (output_parser): Fix. Store single '%' characters in
9191 the output obstack instead of throwing them away.
9192
6fc74234
AD
91932001-08-27 Akim Demaille <akim@epita.fr>
9194
9195 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
9196
9c76d118
RA
91972001-08-25 Robert Anisko <robert.anisko@epita.fr>
9198
9199 * lib/Makefile.am: Adjust.
9200
a8289c62
RA
92012001-08-25 Robert Anisko <robert.anisko@epita.fr>
9202
9203 * src/bison.simple: Update and add '%%' directives.
9204
b6610515
RA
92052001-08-25 Robert Anisko <robert.anisko@epita.fr>
9206
9207 * src/reader.c (reader): Remove calls to 'output_headers' and
9208 'output_trailers'. Remove some C output.
9209 (readgram): Disable a piece of code that was writing a default
9210 definition for 'YYSTYPE'.
9211 (reader_output_yylsp): Remove.
9212 (packsymbols): Output token defintions to a macro.
9213 (copy_definition): Disable C output.
6fc74234 9214
b6610515
RA
9215 * src/reader.c (parse_macro_decl): New function used to parse macro
9216 declarations.
9217 (copy_string2): Put the body of copy_string into this new function.
9218 Add a parameter to let the caller choose whether he wants to copy the
9219 string delimiters or not.
9220 (copy_string): Be a simple call to copy_string2 with the last argument
9221 bound to true.
9222 (read_declarations): Add case for macro definition.
9223 (copy_identifier): New.
6fc74234 9224 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
9225 rather than lex.
9226
26f609ff
RA
92272001-08-25 Robert Anisko <robert.anisko@epita.fr>
9228
9229 * src/output.c (prepare): Add prefixed names.
9230 (output_parser): Output semantic actions.
9231 (output_parser): Fix bug on '%%line' directives.
6fc74234 9232
26f609ff
RA
9233 * src/output.c (output_headers): Remove. The C code printed by this
9234 function should now be in the skeletons.
9235 (output_trailers): Remove.
9236 (output): Disable call to 'reader_output_yylsp'.
9237 (output_rule_data): Do not output tables to the table obstack.
9238
9239 * src/output.c: Remove some C dedicated output.
9240 Improve the use of macro and output obstacks.
9241 (output_defines): Remove.
6fc74234 9242
26f609ff
RA
9243 * src/output.c (output_token_translations): Associate 'translate'
9244 table with a macro. No output to the table obstack.
9245 (output_gram): Same for 'rhs' and 'prhs'.
9246 (output_stos): Same for 'stos'.
9247 (output_rule_data): Same for 'r1' and 'r2'.
9248 (token_actions): Same for 'defact'.
9249 (goto_actions): Same for 'defgoto'.
9250 (output_base): Same for 'pact' and 'pgoto'.
9251 (output_table): Same for 'table'.
9252 (output_check): Same for 'check'.
6fc74234 9253
26f609ff
RA
9254 * src/output.c (output_table_data): New function.
9255 (output_short_table): Remove.
9256 (output_short_or_char_table): Remove.
6fc74234 9257
26f609ff
RA
9258 * src/output.c (output_parser): Replace most of the skeleton copy code
9259 with something new. Skeletons are now processed character by character
9260 rather than line by line, and Bison looks for '%%' macros. This is the
9261 first step in making Bison's output process (a lot) more flexible.
9262 (output_parser): Use the macro table.
9263
6f43b113
RA
92642001-08-25 Robert Anisko <robert.anisko@epita.fr>
9265
9266 * src/main.c (main): Initialize the macro table.
9267
dd3127cf
RA
92682001-08-25 Robert Anisko <robert.anisko@epita.fr>
9269
9270 * src/lex.c (percent_table): Add tok_define.
9271 * src/lex.h: Add tok_define.
9272
aa321494
RA
92732001-08-25 Robert Anisko <robert.anisko@epita.fr>
9274
9275 * src/macrotab.c: New file.
9276 * src/macrotab.h: New file.
9277 * src/Makefile.am: Update.
9278
68bd3b6b
RA
92792001-08-25 Robert Anisko <robert.anisko@epita.fr>
9280
9281 * lib/hash.c: New file.
9282 * lib/hash.h: New file.
9283 * lib/Makefile.am: Update.
9284
45f8dd1e
AD
92852001-08-15 Akim Demaille <akim@epita.fr>
9286
9287 Version 1.28c.
9288
40a64a7a 92892001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
9290
9291 * src/reader.c (readgram): Indent output macro YYSTYPE.
9292 (packsymbols): Likewise.
9293 (output_token_defines): Likewise.
9294 * src/files.c: Standardize.
9295 (compute_header_macro): New.
9296 (defines_obstack_save): New. Use compute_header_macro.
9297 (output_files): Update. Use defines_obstack_save.
9298
f9a8293a
AD
92992001-08-15 Akim Demaille <akim@epita.fr>
9300
9301 * doc/bison.texinfo (Table of Symbols): Document
9302 YYSTACK_USE_ALLOCA.
9303
150ca7a7
AD
93042001-08-15 Akim Demaille <akim@epita.fr>
9305
9306 * missing: Update from CVS Automake.
9307 * config/config.guess, config/config.sub, config/texinfo.tex:
9308 Update from gnu.org.
9309
69b5cec4
AD
93102001-08-15 Akim Demaille <akim@epita.fr>
9311
9312 * Makefile.maint: Sync with CVS Autoconf.
9313
f2b5126e
PB
93142001-08-14 Pascal Bart <pascal.bart@epita.fr>
9315
69b5cec4 9316 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
9317 `fdl.texi'.
9318 * doc/fdl.texi: Add to package.
9319
4ecbf796
MA
93202001-08-14 Marc Autret <autret_m@epita.fr>
9321
9322 Turn on %{source,header}_extension features.
9323
69b5cec4 9324 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
9325 source_extension.
9326 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 9327 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
9328 between options.
9329
95fb5662
MA
93302001-08-14 Marc Autret <autret_m@epita.fr>
9331
9332 * src/files.c (compute_base_names): Add extensions computing when
9333 `--file-prefix' used.
9334 Standardize function calls.
9335
78d09da9
MA
93362001-08-13 Marc Autret <autret_m@epita.fr>
9337
69b5cec4 9338 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
9339 defining it (defined but null disables alloca).
9340
5a009f2c
MA
93412001-08-13 Marc Autret <autret_m@epita.fr>
9342
9343 * src/bison.simple (_yy_memcpy): CPP reformat.
9344
1e41465a
PB
93452001-08-13 Pascal Bart <pascal.bart@epita.fr>
9346
9347 * tests/atconfig.in (CPPFLAGS): Fix.
9348
c67a198d
PB
93492001-08-10 Pascal Bart <pascal.bart@epita.fr>
9350
79282c6c 9351 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
9352 `gpl.texi'.
9353 * doc/gpl.texi: Add to package.
9354
09a6de7e
MA
93552001-08-10 Marc Autret <autret_m@epita.fr>
9356
9357 * src/print_graph.h: Fix.
9358 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
9359
b77b9ee0
AD
93602001-08-10 Akim Demaille <akim@epita.fr>
9361
9362 * src/system.h: Provide default declarations for stpcpy, strndup,
9363 and strnlen.
9364
3e259915
MA
93652001-08-10 Robert Anisko <anisko_r@epita.fr>
9366
9367 * doc/bison.texinfo (Locations): Update @$ stuff.
9368
ca96bc2d
MA
93692001-08-09 Robert Anisko <anisko_r@epita.fr>
9370
9371 * src/bison.simple (YYLLOC_DEFAULT): Update.
9372 (yyparse): Adjust.
9373
fdc6758b
MA
93742001-08-08 Marc Autret <autret_m@epita.fr>
9375
b77b9ee0 9376 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
9377 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
9378 Reported by Fabrice Bauzac.
957d4dbf 9379
600cad3b
MA
93802001-08-08 Marc Autret <autret_m@epita.fr>
9381
9382 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
9383 * src/vcg.c (output_node): Fix.
9384 * src/vcg.h: Cleanup.
9385 * src/print_graph.c: Add comments.
b77b9ee0 9386 (node_output_size): New global variable. Simplify the formatting of
600cad3b 9387 the VCG graph output.
b77b9ee0 9388 (print_actions): Unused code is now used. It notifies the final state
600cad3b 9389 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 9390 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
9391 blue.
9392 Get the current node name and node_obstack by argument.
9393 (node_obstack): New variable.
9394 (print_state): Manage node_obstack.
9395 (print_core): Use node_obstack given by argument.
9396 A node is not only computed here but in print_actions also.
9397 (print_graph): CPP out useless code instead of commenting it.
9398
976e528f
AD
93992001-08-07 Pascal Bart <pascal.bart@epita.fr>
9400
9401 * tests/atconfig.in (CPPFLAGS): Fix.
9402
20e8e5ca
AD
94032001-08-07 Akim Demaille <akim@epita.fr>
9404
9405 * src/print_graph.c (quote): New.
9406 (print_core): Use it.
9407
957d4dbf 94082001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 9409
3e3da797
AD
9410 * src/vcg.c (complain.h): Include it.
9411 Unepitaize `return' invocations.
c4b66126 9412 [NDEBUG] (main): Remove.
79282c6c 9413 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
9414 * src/files.c (open_files): Initialize graph_obstack.
9415 * src/print_graph.c (print_actions): CPP out useless code.
9416 (print_core): Don't output the last `\n' in labels.
9417 Use `quote'.
9418 * src/files.c (output_files): Output the VCG file.
9419 * src/main.c (main): Invoke print_graph ();
3e3da797 9420
957d4dbf 94212001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
9422
9423 Automaton VCG graph output.
9424 Using option ``-g'' or long option ``--graph'', you can generate
9425 a gram_filename.vcg file containing a VCG description of the LALR (1)
9426 automaton of your grammar.
9427
9428 * src/main.c: Call to print_graph() function.
9429 * src/getargs.h: Update.
9430 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
9431 (graph_flag): New flag.
9432 (longopts): Update.
9433 (getargs): Add case `g'.
9434 * src/files.c (graph_obstack): New obstack struct.
9435 (open_files): Initialize new obstack.
9436 (output_files): Saves graph_obstack if required.
9437 * src/files.h (graph_obstack): New extern declaration.
9438 * src/Makefile.am: Add new source files.
9439
927c1557 94402001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
9441
9442 * src/print_graph.c, src/print_graph.h (graph): New.
9443 * src/vcg.h: New file.
9444 * src/vcg.c: New file, VCG graph handling.
9445
7333d403
AD
94462001-08-06 Marc Autret <autret_m@epita.fr>
9447
9448 Add of %source_extension and %header_extension which specify
9449 the source or/and the header output file extension.
9450
9451 * src/files.c (compute_base_names): Remove initialisation of
9452 src_extension and header_extension.
9453 (compute_exts_from_gf): Update.
9454 (compute_exts_from_src): Update.
9455 (output_files): Update.
9456 * src/reader.c (parse_header_extension_decl): New.
9457 (parse_source_extension_decl): New.
9458 (read_declarations): New case statements for the new tokens.
9459 * src/lex.c (percent_table): Add entries for %source_extension
9460 and %header_extension.
9461 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
9462
84163231
AD
94632001-08-06 Marc Autret <autret_m@epita.fr>
9464
9465 * configure.in: Bump to 1.28c.
9466 * doc/bison.texinfo: Texinfo thingies.
9467
8303fc42
AD
94682001-08-04 Pascal Bart <pascal.bart@epita.fr>
9469
9470 * tests/atconfig.in (CPPFLAGS): Add.
9471 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
9472
70a84437
AD
94732001-08-03 Akim Demaille <akim@epita.fr>
9474
9475 Version 1.28b.
9476
2ce10144
AD
94772001-08-03 Akim Demaille <akim@epita.fr>
9478
9479 * tests/Makefile.am (check-local): Ship testsuite.
9480 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
9481 Include `string.h'.
9482
1e3e4bc1
AD
94832001-08-03 Akim Demaille <akim@epita.fr>
9484
9485 * configure.in: Try using -Wformat when compiling.
9486
42b45b7f
AD
94872001-08-03 Akim Demaille <akim@epita.fr>
9488
9489 * configure.in: Bump to 1.28b.
9490
8f13fe33
AD
94912001-08-03 Akim Demaille <akim@epita.fr>
9492
9493 * src/complain.c: Adjust strerror_r portability issues.
9494
b37ba92c
AD
94952001-08-03 Akim Demaille <akim@epita.fr>
9496
9497 Version 1.28a.
9498
b0ce6046
AD
94992001-08-03 Akim Demaille <akim@epita.fr>
9500
9501 * src/getargs.c, src/getarg.h (skeleton)): Constify.
9502 * src/lex.c (literalchar): Avoid name clashes on `buf'.
9503 * src/getargs.c: Include complain.h.
9504 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
9505 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
9506
d01c415b
AD
95072001-08-03 Akim Demaille <akim@epita.fr>
9508
9509 * src/reader.c (readgram): Display hidden chars in error messages.
9510
459dd1a6
AD
95112001-08-03 Akim Demaille <akim@epita.fr>
9512
9513 Update to gettext 0.10.39.
9514
53b74c0c
AD
95152001-08-03 Akim Demaille <akim@epita.fr>
9516
9517 * lib/strspn.c: New.
9518
234a3be3
AD
95192001-08-01 Marc Autret <autret_m@epita.fr>
9520
9521 * doc/bison.texinfo: Update.
9522 * doc/bison.1 (mandoc): Update.
9523 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
9524 * src/files.c: Support output files extensions computing.
9525 (src_extension): New static variable.
9526 (header_extension): New static variable.
9527 (tr): New function.
9528 (get_extension_index): New function, gets the index of an extension
9529 filename in a string.
9530 (compute_exts_from_gf): New function, computes extensions from the
9531 grammar file extension.
9532 (compute_exts_from_src): New functions, computes extensions from the
9533 C source file extension, file given by ``-o'' option.
9534 (compute_base_names): Update.
9535 (output_files): Update.
9536
847bf1f5
AD
95372001-08-01 Robert Anisko <anisko_r@epita.fr>
9538
d995fee7 9539 * doc/bison.texi: Document @$.
847bf1f5
AD
9540 (Locations): New section.
9541
d074a105
AD
95422001-07-18 Akim Demaille <akim@epita.fr>
9543
9544 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
9545 * config/prev-version.txt, config/move-if-change: New.
9546 * Makefile.am: Adjust.
9547
3419715d
AD
95482001-07-08 Pascal Bart <pascal.bart@epita.fr>
9549
9550 * src/bison.simple (yyparse): Suppress warning `comparaison
9551 between signed and unsigned'.
9552
62ab6972
AD
95532001-07-05 Pascal Bart <pascal.bart@epita.fr>
9554
9555 * src/getargs.h (raw_flag): Remove.
9556 * src/getargs.c: Die on `-r'/`--raw'.
9557 * src/lex.c (parse_percent_token): Die on `%raw'.
9558 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
9559 * tests/calc.at: Suppress test with option `--raw'.
9560
1e24cc5b
AD
95612001-07-14 Akim Demaille <akim@epita.fr>
9562
9563 * config/: New.
9564 * configure.in: Require Autoconf 2.50.
9565 Update to gettext 0.10.38.
9566
32dfccf8
AD
95672001-03-16 Akim Demaille <akim@epita.fr>
9568
9569 * doc/bison.texinfo: ANSIfy the examples.
9570
cd5bd6ac
AD
95712001-03-16 Akim Demaille <akim@epita.fr>
9572
9573 * getargs.c (skeleton): New variable.
9574 (longopts): --skeleton is a new option.
9575 (shortopts, getargs): -S is a new option.
9576 * getargs.h: Declare skeleton.
9577 * output.c (output_parser): Use it.
9578
5141b016
AD
95792001-03-16 Akim Demaille <akim@epita.fr>
9580
9581 * m4/strerror_r.m4: New.
9582 * m4/error.m4: Run AC_FUNC_STRERROR_R.
9583 * lib/error.h, lib/error.c: Update.
9584
447992b9
AD
95852001-03-16 Akim Demaille <akim@epita.fr>
9586
9587 * src/getargs.c (longopts): Clean up.
9588
274d42ce
AD
95892001-02-21 Akim Demaille <akim@epita.fr>
9590
9591 * src/reader.c (gensym): `gensym_count' is your own.
9592 Use a static buf to create the symbol name, as token_buffer is no
9593 longer a buffer.
9594
22c821f3
AD
95952001-02-08 Akim Demaille <akim@epita.fr>
9596
9597 * src/conflicts.c (conflict_report): Be sure not to append to res
9598 between two calls, which could happen if both first sprintf were
9599 skipped, but not the first cp += strlen.
9600
18569462
AD
96012001-02-08 Akim Demaille <akim@epita.fr>
9602
9603 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
9604 New, from fileutils 4.0.37.
9605 * configure.in: Require Autoconf 2.49c. I took some time before
9606 making this decision. This is the only way out for portability
9607 issues in Bison, it would mean way too much duplicate effort to
9608 import in Bison features implemented in 2.49c since 2.13.
9609 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
9610
0d8f3c8a
AD
96112001-02-02 Akim Demaille <akim@epita.fr>
9612
9613 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 9614 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 9615
f17bcd1f
AD
96162001-01-19 Akim Demaille <akim@epita.fr>
9617
9618 Get rid of the ad hoc handling of token_buffer in the scanner: use
9619 the obstacks.
9620
9621 * src/lex.c (token_obstack): New.
9622 (init_lex): Initialize it. No longer call...
9623 (grow_token_buffer): this. Remove it.
9624 Adjust all the places which used it to use the obstack.
9625
511e79b3
AD
96262001-01-19 Akim Demaille <akim@epita.fr>
9627
9628 * src/lex.h: Rename all the tokens:
9629 s/\bENDFILE\b/tok_eof/g;
9630 s/\bIDENTIFIER\b/tok_identifier/g;
9631 etc.
9632 Let them be enums, not #define, to ease debugging.
9633 Adjust all the code.
9634
0d6508ef
AD
96352001-01-18 Akim Demaille <akim@epita.fr>
9636
9637 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
9638 * src/lex.c (maxtoken, grow_token_buffer): Static.
9639
6deb4447
AD
96402001-01-18 Akim Demaille <akim@epita.fr>
9641
9642 Since we now use obstacks, more % directives can be enabled.
9643
9644 * src/lex.c (percent_table): Also accept `%yacc',
9645 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
9646 `%debug'.
9647 Handle the actions for `%semantic_parser' and `%pure_parser' here,
9648 instead of returning a token.
9649 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
9650 * src/reader.c (read_declarations): Adjust.
9651 * src/files.c (open_files): Don't call `compute_base_names', don't
9652 compute `attrsfile' since they depend upon data which might be
9653 *in* the input file now.
9654 (output_files): Do it here.
9655 * src/output.c (output_headers): Document the fact that this patch
9656 introduces a guaranteed SEGV for semantic parsers.
9657 * doc/bison.texinfo: Document them.
9658 * tests/suite.at: Exercise these %options.
9659
ff4423cc
AD
96602000-12-20 Akim Demaille <akim@epita.fr>
9661
9662 Also handle the output file (--verbose) with obstacks.
9663
9664 * files.c (foutput): Remove.
9665 (output_obstack): New.
9666 Adjust all dependencies.
9667 * src/conflicts.c: Return a string.
9668 * src/system.h (obstack_grow_string): Rename as...
9669 (obstack_sgrow): this. Be ready to work with non literals.
9670 (obstack_fgrow4): New.
9671
956dba3a
AD
96722000-12-20 Akim Demaille <akim@epita.fr>
9673
9674 * src/files.c (open_files): Fix the computation of short_base_name
9675 in the case of `-o foo.tab.c'.
9676
337bab46
AD
96772000-12-20 Akim Demaille <akim@epita.fr>
9678
9679 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
9680 (copy_dollar): Now that everything uses obstacks, get rid of the
9681 FILE * parameters.
9682
5d3214b8
AD
96832000-12-20 Akim Demaille <akim@epita.fr>
9684
9685 * src/files.c (open_files): Actually the `.output' file is based
9686 on the short_base_name, not base_name.
9687 * tests/suite.at (Checking output file names): Adjust.
9688
29092a57
AD
96892000-12-20 Akim Demaille <akim@epita.fr>
9690
9691 * src/bison.s1: Remove, we now use directly...
9692 * src/bison.simple: this.
9693 * src/Makefile.am: Use pkgdata instead of data.
9694
ea5607fd
AD
96952000-12-20 Akim Demaille <akim@epita.fr>
9696
9697 * src/files.c (guard_obstack): New.
9698 (open_files): Initialize it.
9699 (output_files): Dump it...
9700 * src/files.h: Export it.
9701 * src/reader.c (copy_guard): Use it.
9702
27110317
AD
97032000-12-19 Akim Demaille <akim@epita.fr>
9704
9705 * src/files.c (outfile, defsfile, actfile): Removed as global
9706 vars.
9707 (open_files): Don't compute them.
9708 (output_files): Adjust.
9709 (base_name, short_base_name): Be global.
9710 Adjust dependencies.
9711
19c50364
AD
97122000-12-19 Akim Demaille <akim@epita.fr>
9713
9714 * src/files.c (strsuffix): New.
9715 (stringappend): Be just like strcat but allocate.
9716 (base_names): Eve out from open_files.
9717 Try to simplify the rather hairy computation of base_name and
9718 short_base_name.
9719 (open_files): Use it.
9720 * tests/suite.at (Checking output file names): New test.
9721
573c1d9f
AD
97222000-12-19 Akim Demaille <akim@epita.fr>
9723
9724 * src/system.h (obstack_grow_literal_string): Rename as...
9725 (obstack_grow_string): this.
9726 * src/output.c (output_parser): Recognize `%% actions' instead of
9727 `$'.
9728 * src/bison.s1: s/$/%% actions/.
9729 * src/bison.hairy: Likewise.
9730
ef7ddedd
AD
97312000-12-19 Akim Demaille <akim@epita.fr>
9732
9733 * src/output.c (output_parser): Compute the `#line' lines when
9734 there are.
9735 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
9736 Suggested by Hans Aberg.
9737
ff61dabd
AD
97382000-12-19 Akim Demaille <akim@epita.fr>
9739
9740 Let the handling of the skeleton files be local to the procedures
9741 that use it.
9742
9743 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
9744 longer static.
9745 (fparser, open_extra_files): Remove.
9746 (open_files, output_files): Don't take care of fparser.
9747 * src/files.h: Adjust.
9748 * src/output.c (output_parser): Open and close the file to the
9749 skeleton.
9750 * src/reader.c (read_declarations): When %semantic_parser, open
9751 fguard.
9752
55b96341
AD
97532000-12-19 Akim Demaille <akim@epita.fr>
9754
9755 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
9756 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
9757
358c15b7
AD
97582000-12-19 Akim Demaille <akim@epita.fr>
9759
9760 * src/files.c (open_files): Yipee! We no longer need all the code
9761 looking for `/tmp' since we have no tmp file.
9762
7de3329e
AD
97632000-12-19 Akim Demaille <akim@epita.fr>
9764
9765 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
9766 New macros.
9767 * src/files.c (open_files): Less dependency on MSDOS etc.
9768
3abcd459
AD
97692000-12-14 Akim Demaille <akim@epita.fr>
9770
9771 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
9772 Provide a default definition.
9773 Use it when executing the default @ action.
9774 * src/reader.c (reader_output_yylsp): No longer include
9775 `timestamp' and `text' in the default YYLTYPE.
9776
2a91a95e
AD
97772000-12-12 Akim Demaille <akim@epita.fr>
9778
9779 * src/reader.c (copy_definition, parse_union_decl, copy_action)
9780 (copy_guard): Quote the file names.
9781 Reported by Laurent Mascherpa.
9782
14d3eb9b
AD
97832000-12-12 Akim Demaille <akim@epita.fr>
9784
9785 * src/output.c (output_headers, output_program, output): Be sure
9786 to escape special characters when outputting filenames.
9787 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
9788 (output_headers): Don't depend on them, Use ACTSTR.
9789
d7045ec6
AD
97902000-11-17 Akim Demaille <akim@epita.fr>
9791
9792 * lib/obstack.h: Formatting changes.
9793 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
9794 prevents type checking.
9795 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9796 cast the value to (void *): assigning a `foo *' to a `void *'
9797 variable is valid.
9798 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9799 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
9800 append characters.
9801
6fd54b73
AD
98022000-11-17 Akim Demaille <akim@epita.fr>
9803
9804 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
9805 as...
9806 (suite.m4, regression.m4, calc.m4): these.
9807 * tests/atgeneral.m4: Update from CVS Autoconf.
9808
4c50eae6
AD
98092000-11-17 Akim Demaille <akim@epita.fr>
9810
9811 * tests/regression.m4 (%union and --defines): New test,
9812 demonstrating a current bug in the obstack implementation.
9813
a35f64ea
AD
98142000-11-17 Akim Demaille <akim@epita.fr>
9815
9816 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
9817 macros.
9818 Use them to declare the variables which are global or local to
9819 `yyparse'.
9820
7de23534
AD
98212000-11-17 Akim Demaille <akim@epita.fr>
9822
9823 * acconfig.h: Remove, no longer used.
9824
aa7815f5
AD
98252000-11-07 Akim Demaille <akim@epita.fr>
9826
9827 * src: s/Copyright (C)/Copyright/g.
9828
5af1f549
AD
98292000-11-07 Akim Demaille <akim@epita.fr>
9830
9831 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
9832 defining.
9833 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
9834
553e2b22
AD
98352000-11-07 Akim Demaille <akim@epita.fr>
9836
9837 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
9838 Merge in a single CPP if/else.
9839
8a4f41d6
AD
98402000-11-07 Akim Demaille <akim@epita.fr>
9841
9842 * src/output.c (output): Remove useless variables.
9843 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
9844 argument `data' for consistency with the prototypes.
9845 Qualify it `const'.
9846 (obstack_copy, obstack_copy0): Rename the second argument as
9847 `address' for consistency. Qualify it `const'.
9848 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
9849 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
9850 `const' their input argument (`data' or `address').
9851 Adjust the corresponding macros to include `const' in casts.
9852
095a3fb5
AD
98532000-11-03 Akim Demaille <akim@epita.fr>
9854
9855 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
9856 s/PFILE1/BISON_HAIRY/.
9857 Adjust dependencies.
9858
d1cdce7c
AD
98592000-11-03 Akim Demaille <akim@epita.fr>
9860
090c5ebf 9861 For some reason, this was not applied.
d1cdce7c
AD
9862
9863 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
9864 `unlink': it's no longer used.
9865
9311529b
AD
98662000-11-03 Akim Demaille <akim@epita.fr>
9867
9868 * src/files.c (skeleton_find): New function, eved out of...
9869 (open_files, open_extra_files): here.
9870
d8880f69
AD
98712000-11-03 Akim Demaille <akim@epita.fr>
9872
9873 Don't use `atexit'.
9874
9875 * src/files.c (obstack_save): New function.
9876 (done): Rename as...
9877 (output_files): this.
9878 Use `obstack_save'.
9879 * src/main.c (main): Don't use `atexit' to register `done', since
9880 it no longer has to remove tmp files, just call `output_files'
9881 when there are no errors.
9882
0dbb648e
AD
98832000-11-02 Akim Demaille <akim@epita.fr>
9884
9885 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
9886 `unlink': it's no longer used.
9887 * src/files.h: Formatting changes.
9888
896fe5c1
AD
98892000-11-02 Akim Demaille <akim@epita.fr>
9890
9891 Remove the last uses of mktemp and unlink/delete.
9892
9893 * src/files.c (fdefines, ftable): Removed.
9894 (defines_ostack, table_obstack): New.
9895 Adjust dependencies of the former into uses of the latter.
9896 * src/output.c (output_short_or_char_table, output_short_table):
9897 Convert to using obstacks.
9898 * src/reader.c (copy_comment2): Accept one FILE * and two
9899 obstacks.
9900 (output_token_defines, reader_output_yylsp): Use obstacks.
9901 * src/system.h (obstack_fgrow3): New.
9902
dd60faec
AD
99032000-11-01 Akim Demaille <akim@epita.fr>
9904
9905 Change each use of `fattrs' into a use of `attrs_obstack'.
9906
9907 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
9908 * src/files.c (fattrs): Remove.
9909 (attrs_obstack): New.
9910 Adjust all dependencies.
9911 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
9912
8c7ebe49
AD
99132000-11-01 Akim Demaille <akim@epita.fr>
9914
9915 Introduce obstacks.
9916 Change each use of `faction' into a use of `action_obstack'.
9917
9918 * lib/obstack.h, lib/obstack.c: New files.
9919 * src/files.c (faction): Remove.
9920 (action_obstack): New.
9921 Adjust all dependencies.
9922
77aee789
AD
99232000-10-20 Akim Demaille <akim@epita.fr>
9924
9925 * lib/quote.h (PARAMS): New macro. Use it.
9926
43591cec
AD
99272000-10-16 Akim Demaille <akim@epita.fr>
9928
9929 * src/output.c (output_short_or_char_table): New function.
9930 (output_short_table, output_token_translations): Use it.
9931 (goto_actions): Use output_short_table.
9932
1e9798d5
AD
99332000-10-16 Akim Demaille <akim@epita.fr>
9934
9935 * src/symtab.c (bucket_new): New function.
9936 (getsym): Use it.
9937
9938 * src/output.c (output_short_table): New argument to display the
9939 comment associated with the table.
9940 Adjust dependencies.
9941 (output_gram): Use it.
9942 (output_rule_data): Nicer output layout for YYTNAME.
9943
f282676b
AD
99442000-10-16 Akim Demaille <akim@epita.fr>
9945
9946 * src/lex.c (read_typename): New function.
9947 (lex): Use it.
9948 * src/reader.c (copy_dollar): Likewise.
9949
550a72a3
AD
99502000-10-16 Akim Demaille <akim@epita.fr>
9951
9952 * src/reader.c (copy_comment2): Expect the input stream to be on
9953 the `/' which is suspected to open a comment, instead of being
9954 called after `//' or `/*' was read.
9955 (copy_comment, copy_definition, parse_union_decl, copy_action)
9956 (copy_guard): Adjust.
9957
131e2fef
AD
99582000-10-16 Akim Demaille <akim@epita.fr>
9959
9960 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
9961 `read_signed_integer'.
9962
79282c5a
AD
99632000-10-16 Akim Demaille <akim@epita.fr>
9964
9965 * src/reader.c (copy_dollar): New function.
9966 (copy_guard, copy_action): Use it.
9967
ff4a34be
AD
99682000-10-16 Akim Demaille <akim@epita.fr>
9969
9970 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
9971 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
9972 New files, from Fileutils 4.0.27.
9973 * src/main.c (printable_version): Remove.
9974 * src/lex.c, src/reader.c: Use `quote'.
9975
99762000-10-04 Akim Demaille <akim@epita.fr>
9977
9978 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
9979
14ded682
AD
99802000-10-04 Akim Demaille <akim@epita.fr>
9981
9982 * doc/bison.texinfo: Various typos spotted by Neil Booth.
9983
8e03724b
AD
99842000-10-04 Akim Demaille <akim@epita.fr>
9985
9986 When a literal string is used to define two different tokens,
9987 `bison -v' segfaults.
9988 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
9989
9990 * tests/regression.m4: New file.
9991 Include the core of the sample provided by Piotr Gackiewicz.
9992 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
9993 properly.
9994
a9e64249
AD
99952000-10-04 Akim Demaille <akim@epita.fr>
9996
9997 * src/reader.c (parse_expect_decl): Keep `count' within the size
9998 of `buffer'.
9999 From Neil Booth.
10000
da9abf43
AD
100012000-10-02 Paul Eggert <eggert@twinsun.com>
10002
10003 * bison.s1 (yyparse): Assign the default value
10004 unconditionally, to avoid a GCC warning and make the parser a
10005 tad smaller.
10006
c33638bb
AD
100072000-10-02 Akim Demaille <akim@epita.fr>
10008
10009 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
10010 options.
10011
444c570a
AD
100122000-10-02 Akim Demaille <akim@epita.fr>
10013
10014 * src/derives.c, src/print.c, src/reduce.c: To ease the
10015 translation, move some `\n' out of the translated strings.
10016
89cab50d
AD
100172000-10-02 Akim Demaille <akim@epita.fr>
10018
10019 The location tracking mechanism is precious for parse error
10020 messages. Nevertheless, it is enabled only when `@n' is used in
10021 the grammar, which is a different issue (you can use it in error
10022 message, but not in the grammar per se). Therefore, there should
10023 be another means to enable it.
10024
10025 * src/getargs.c (getargs): Support `--locations'.
10026 (usage): Report it.
10027 * src/getargs.h (locationsflag): Export it.
10028 * src/lex.c (percent_table): Support `%locations'.
10029 * src/reader.c (yylsp_needed): Remove this variable, now replaced
10030 with `locationsflag'.
10031 * doc/bison.texinfo: Document `--locations' and `%locations'.
10032 Sort the options.
10033 * tests/calc.m4: Test it.
10034
10035 For regularity of the names, replace each
10036 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
10037 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
10038 In addition replace each `flag' with `_flag'.
10039
d6c2cba0
AD
100402000-10-02 Akim Demaille <akim@epita.fr>
10041
10042 Also test parse error messages, including with YYERROR_VERBOSE.
10043
10044 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
10045 associative).
10046 Use it to check the computations.
10047 Use it to check `nonassoc' is honored.
10048 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
10049 `--yyerror-verbose'.
10050 (_AT_CHECK_CALC): Adjust to this option.
10051 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
10052
5a35a6cb
AD
100532000-10-02 Akim Demaille <akim@epita.fr>
10054
10055 Test also `--verbose', `--defines' and `--name-prefix'. Testing
10056 the latter demonstrates a flaw in the handling of non debugging
10057 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
10058 was used in order to simplify:
10059
10060 #if YYDEBUG
10061 if (yydebug)
10062 {
10063 ...
10064 }
10065 #endif
10066
10067 into
10068
10069 if (yydebug)
10070 {
10071 ...
10072 }
10073
10074 unfortunately this leads to a CPP conflict when
10075 `--name-prefix=foo' is used since it produces `#define yydebug
10076 foodebug'.
10077
10078 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
10079 (YYDPRINTF): New macro.
10080 Spread its use.
10081 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
10082 the bison options.
10083 Also test `--verbose', `--defines' and `--name-prefix'.
10084
71da9eea
AD
100852000-10-02 Akim Demaille <akim@epita.fr>
10086
10087 Improve the readability of the produced parsers.
10088
10089 * src/bison.s1: Formatting changes.
10090 Improve the comment related to the `$' mark.
10091 (yydefault): Don't fall through to `yyresume': `goto' there.
10092 * src/output.c (output_parser): When the `$' is met, skip the end
10093 of its line.
10094 New variable, `number_of_dollar_signs', to check there's exactly
10095 one `$' in the parser skeleton.
10096
95e36146
AD
100972000-10-02 Akim Demaille <akim@epita.fr>
10098
10099 * lib/xstrdup.c: New file, from the fileutils.
10100 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
10101 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
10102 instead of strlen + xmalloc + strcpy.
10103 * src/symtab.c (copys): Remove, use xstrdup instead.
10104
d7020c20
AD
101052000-10-02 Akim Demaille <akim@epita.fr>
10106
10107 * src/gram.h (associativity): New enum type which replaces the
10108 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
10109 `right_assoc', `left_assoc' and `non_assoc'.
10110 Adjust all dependencies.
10111 * src/reader.c: Formatting changes.
10112 (LTYPESTR): Don't define it, use it as a literal in
10113 `reader_output_yylsp'.
10114 * src/symtab.h (symbol_class): New enum type which replaces the
10115 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
10116 `sunknown', `stoken and `snterm'.
10117
1916f98e
AD
101182000-10-02 Akim Demaille <akim@epita.fr>
10119
10120 * src/getargs.c (fixed_outfiles): Rename as...
10121 (yaccflag): for consistency and accuracy.
10122 Adjust dependencies.
10123
d7913476
AD
101242000-10-02 Akim Demaille <akim@epita.fr>
10125
10126 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
10127 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
10128 difficult and introduced a lot of core dump. It turns out that
10129 Bison used an implementation of `xmalloc' based on `calloc', and
10130 at various places it does depend upon the initialization to 0. I
10131 have not tried to isolate the pertinent places, and all the former
10132 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
10133 someone should address this issue.
10134
10135 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
10136 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
10137 files.
10138 Adjust dependencies.
10139 * src/warshall.h: New file.
10140 Propagate.
10141
340ef489
AD
101422000-10-02 Akim Demaille <akim@epita.fr>
10143
10144 Various anti-`extern in *.c' changes.
10145
10146 * src/system.h: Include `assert.h'.
10147
b2ca4022
AD
101482000-10-02 Akim Demaille <akim@epita.fr>
10149
10150 * src/state.h (nstates, final_state, first_state, first_shift)
10151 (first_reduction): Move their exportation from here...
10152 * src/LR0.h: to here.
10153 Adjust dependencies.
10154 * src/getargs.c (statisticsflag): New variable.
10155 Add support for `--statistics'.
10156 Adjust dependencies.
10157
10158 Remove a lot of now useless `extern' statements in most files.
10159
403b315b
AD
101602000-10-02 Akim Demaille <akim@epita.fr>
10161
10162 * src/LR0.h: New file.
10163 Propagate its use.
10164
07a58c13
AD
101652000-10-02 Akim Demaille <akim@epita.fr>
10166
10167 * src/print.h: New file.
10168 Propagate its use.
10169 * src/print.c: Formatting and ordering changes.
10170 (verbose, terse): Replace with...
10171 (print_results): this new function.
10172 Adjust dependencies.
10173
0619caf0
AD
101742000-10-02 Akim Demaille <akim@epita.fr>
10175
10176 * src/conflicts.c (conflict_report): New function.
10177 (conflict_log, verbose_conflict_log): Replace with...
10178 (print_conflicts): this function.
10179 Adjust dependencies.
10180 * src/conflicts.h: New file.
10181 Propagate its inclusion.
10182
3519ec76
AD
101832000-10-02 Akim Demaille <akim@epita.fr>
10184
10185 * src/nullable.h: New file.
10186 Propagate its inclusion.
10187 * src/nullable.c: Formatting changes.
10188
015acc48
AD
101892000-10-02 Akim Demaille <akim@epita.fr>
10190
10191 * src/reduce.h: New file.
10192 Propagate its inclusion.
10193 * src/reduce.c: Topological sort and other formatting changes.
10194 (bool, TRUE, FALSE): Move their definition to...
10195 * src/system.h: here.
10196
8963a27b
AD
101972000-10-02 Akim Demaille <akim@epita.fr>
10198
10199 * src/files.c: Formatting changes.
10200 (tryopen, tryclose, openfiles): Rename as...
10201 (xfopen, xfclose, open_files): this.
10202 (stringappend): static.
10203 * src/files.h: Complete the list of exported symbols.
10204 Propagate its use.
10205
a70083a3
AD
102062000-10-02 Akim Demaille <akim@epita.fr>
10207
10208 * src/reader.h: New file.
10209 Propagate its use instead of tedious list of `extern' and
10210 prototypes.
10211 * src/reader.c: Formatting changes, topological sort,
10212 s/register//.
10213
abadc117
AD
102142000-10-02 Akim Demaille <akim@epita.fr>
10215
10216 * src/lex.h: Prototype `lex.c' exported functions.
10217 * src/reader.c: Adjust.
10218 * src/lex.c: Formatting changes.
10219 (safegetc): Rename as...
10220 (xgetc): this.
10221
720d742f
AD
102222000-10-02 Akim Demaille <akim@epita.fr>
10223
10224 * src/lalr.h: New file.
10225 Propagate its inclusion instead of prototypes and `extern'.
10226 * src/lalr.c: Formatting changes, topological sorting etc.
10227
f2acea59
AD
102282000-10-02 Akim Demaille <akim@epita.fr>
10229
10230 * src/output.c (token_actions): Introduce a temporary array,
10231 YYDEFACT, that makes it possible for this function to use
10232 output_short_table.
10233
d019d655
AD
102342000-10-02 Akim Demaille <akim@epita.fr>
10235
10236 `user_toknums' is output as a `short[]' in `output.c', while it is
10237 defined as a `int[]' in `reader.c'. For consistency with the
10238 other output tables, `user_toknums' is now defined as a table of
10239 shorts.
10240
10241 * src/reader.c (user_toknums): Be a short table instead of an int
10242 table.
10243 Adjust dependencies.
10244
10245 Factor the short table outputs.
10246
10247 * src/output.c (output_short_table): New function.
10248 * src/output.c (output_gram, output_stos, output_rule_data)
10249 (output_base, output_table, output_check): Use it.
10250
6c89f1c1
AD
102512000-10-02 Akim Demaille <akim@epita.fr>
10252
10253 * src/output.c (output): Topological sort of the functions, in
10254 order to get rid of the `static' prototypes.
10255 No longer use `register'.
10256 * src/output.h: New file.
10257 Propagate its inclusion in files explicitly prototyping functions
10258 from output.c.
10259
d9efd181
AD
102602000-09-21 Akim Demaille <akim@epita.fr>
10261
10262 * src/atgeneral.m4: Update from Autoconf.
10263
c29240e7 102642000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
10265
10266 * src/closure.h: New file.
10267 * src/closure.c: Formatting changes, topological sort over the
10268 functions, use of closure.h.
10269 (initialize_closure, finalize_closure): Rename as...
10270 (new_closure, free_closure): these. Adjust dependencies.
10271 * src/LR0.c: Formatting changes, topological sort, use of
10272 cloture.h.
10273 (initialize_states): Rename as...
10274 (new_states): this.
10275 * src/Makefile.am (noinst_HEADERS): Adjust.
10276
499daa50
AD
102772000-09-20 Akim Demaille <akim@epita.fr>
10278
10279 * src/acconfig.h: Don't protect config.h against multiple
10280 inclusion.
10281 Don't define PARAMS.
10282 * src/system.h: Define PARAMS.
10283 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
10284 purpose of config.h. system.h must not try to fix wrong
10285 definitions in config.h.
10286
cc84fd5d
AD
102872000-09-20 Akim Demaille <akim@epita.fr>
10288
10289 * src/derives.h: New file.
10290 * src/main.c, src/derives.h: Use it.
10291 Formatting changes.
10292 * src/Makefile.am (noinst_HEADERS): Adjust.
10293
db5b3a89
AD
102942000-09-20 Akim Demaille <akim@epita.fr>
10295
10296 * tests/atgeneral.m4: Update from Autoconf.
10297 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
10298 (AT_CHECK_CALC): New macros.
10299 Use these macros to test bison with options `', `--raw',
10300 `--debug', `--yacc', `--yacc --debug'.
10301
ceed8467
AD
103022000-09-19 Akim Demaille <akim@epita.fr>
10303
10304 * src/output.c: Formatting changes.
10305 * src/machine.h: Remove, leaving its contents in...
10306 * src/system.h: here.
10307 Include stdio.h.
10308 Adjust all dependencies on stdio.h and machine.h.
10309 * src/getargs.h: New file.
10310 Let all `extern' declarations about getargs.c be replaced with
10311 inclusion of `getargs.h'.
10312 * src/Makefile.am (noinst_HEADERS): Adjust.
10313
10314 * tests/calc.m4 (yyin): Be initialized in main, not on the global
10315 scope.
10316 (yyerror): Returns void, not int.
10317 * doc/bison.texinfo: Formatting changes.
10318
05a1d24b
AD
103192000-09-19 Akim Demaille <akim@epita.fr>
10320
10321 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
10322 portable.
10323
cbd25751
AD
103242000-09-18 Akim Demaille <akim@epita.fr>
10325
10326 * configure.in: Append WARNING_CFLAGS to CFLAGS.
10327 * src/Makefile.am (INCLUDES): Don't.
10328 Be ready to fetch headers in lib/.
10329
13863333
AD
103302000-09-18 Akim Demaille <akim@epita.fr>
10331
10332 * doc/bison.texinfo: Update the copyright.
10333 ANSIfy and GNUify the examples.
10334 Remove the old menu.
10335
0d533154
AD
103362000-09-18 Akim Demaille <akim@epita.fr>
10337
10338 First set of tests: use the `calc' example from the documentation.
10339
10340 * src/bison.s1 (yyparse): Condition the code using `yytname' which
10341 is defined only when YYDEBUG is.
10342 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
10343 * src/files.c (tryopen, tryclose): Formatting changes.
10344 Move to the top and be static.
10345 * src/reader.c (read_signed_integer): Likewise.
10346 * tests/calc.m4: New file.
10347 * Makefile.am, suite.m4: Adjust.
10348 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
10349
e79137ac
AD
103502000-09-18 Akim Demaille <akim@epita.fr>
10351
10352 Add support for an Autotest test suite for Bison.
10353
10354 * m4/m4.m4, m4/atconfig.m4: New files.
10355 * m4/Makefile.am (EXTRA_DIST): Adjust.
10356 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
10357 files.
10358 * src/getargs.c: Display a more standard --version message.
10359 * src/reader.c (reader): Formatting changes.
10360 No longer depend upon VERSION_STRING.
10361 * configure.in: No longer use `dnl'.
10362 Set up the test suite and the new directory `tests/.
10363 (VERSION_STRING): Remove.
10364
27821bff
AD
103652000-04-14 Akim Demaille <akim@epita.fr>
10366
10367 * src/reader.c (copy_comment2): New function, same as former
10368 `copy_comment', but outputs into two FILE *.
10369 (copy_comment): Use it.
10370 (parse_union_decl): Use it.
10371 (get_type, parse_start_decl): Use the same `invalid' message.
10372 (parse_start_decl, parse_union_decl): Use the same `multiple'
10373 message.
10374 (parse_union_decl, copy_guard, copy_action): Use the same
10375 `unmatched' message.
10376 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
10377
cfe5fbc0
AD
103782000-03-31 Akim Demaille <akim@epita.fr>
10379
10380 * src/files.c (tryopen, tryclose): Move to the top.
10381 Be static.
10382
cb7db13e
AD
103832000-03-31 Akim Demaille <akim@epita.fr>
10384
10385 * src/main.c (main): Don't call `done', exit does it.
10386
a0f6b076
AD
103872000-03-31 Akim Demaille <akim@epita.fr>
10388
36281465
AD
10389 * allocate.c: s/return (foo)/return foo/.
10390 * lalr.c: Likewise.
10391 * LR0.c: Likewise.
10392 * output.c: Likewise.
10393 * reader.c: Likewise.
10394 * symtab.c: Likewise.
10395 * vmsgetargs.c: Likewise.
10396
103972000-03-31 Akim Demaille <akim@epita.fr>
10398
10399 Clean up the error reporting functions.
a0f6b076
AD
10400
10401 * src/report.c: New file.
10402 * src/report.h: Likewise.
10403 * src/Makefile.am: Adjust.
10404 * m4/error.m4: New file.
10405 * m4/Makefile.am: Adjust.
10406 * configure.in (jm_PREREQ_ERROR): Call it.
10407 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
10408 Remove.
10409 (fatal, fatals): Remove. All callers use complain.c::fatal.
10410 (warn, warni, warns, warnss, warnss): Remove. All callers use
10411 complain.c::complain.
10412 (toomany): Remove, use fatal instead.
10413 * src/files.c (done): No argument, use complain_message_count.
10414 * src/main.c (main): Register `done' to `atexit'.
10415
10416 * src/getargs.c (usage): More `fputs', less `fprintf'.
10417
18539825
AD
104182000-03-28 Akim Demaille <akim@epita.fr>
10419
10420 * lib/: New directory.
10421 * Makefile.am (SUBDIRS): Adjust.
10422 * configure.in: Adjust.
10423 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
10424 useless.
10425 * src/alloca.c: Moved to lib/.
10426 * src/getopt.c: Likewise.
10427 * src/getopt1.c: Likewise.
10428 * src/getopt.h: Likewise.
10429 * src/ansi2knr.c: Likewise.
10430 * src/ansi2knr.1: Likewise.
10431 * src/Makefile.am: Adjust.
10432 * lib/Makefile.am: New file.
10433
9f306f2a
AD
104342000-03-28 Akim Demaille <akim@epita.fr>
10435
10436 * src/getargs.c (usage): Refresh the help message.
10437
0ba347b6
AD
104382000-03-17 Akim Demaille <akim@epita.fr>
10439
10440 * src/getopt1.c: Updated from textutils 2.0e
10441 * src/getopt.c: Likewise.
10442 * src/getopt.h: Likewise.
10443
dbe7f271
AD
104442000-03-17 Akim Demaille <akim@epita.fr>
10445
10446 * src/Makefile.am (bison.simple): Fix the awk program: quote only
10447 the file name, not the whole `#line LINE FILE'.
10448
75bbe78d
AD
104492000-03-17 Akim Demaille <akim@epita.fr>
10450
10451 On syntax errors, report the token on which we choked.
10452
aa5fd0ee
AD
10453 * src/bison.s1 (yyparse): In the label yyerrlab, when
10454 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 10455
7b306f52
AD
104562000-03-17 Akim Demaille <akim@epita.fr>
10457
aa5fd0ee 10458 * src/reader.c (copy_at): New function.
7b306f52
AD
10459 (copy_guard): Use it.
10460 (copy_action): Use it.
10461
e87b5700
AD
104622000-03-17 Akim Demaille <akim@epita.fr>
10463
10464 Be kind to translators, save some useless translations.
10465
aa5fd0ee 10466 * src/main.c (banner): New function.
e87b5700
AD
10467 (fatal_banner): Use it.
10468 (warn_banner): Use it.
10469
ae3c3164
AD
104702000-03-17 Akim Demaille <akim@epita.fr>
10471
aa5fd0ee
AD
10472 * src/reader.c (copy_definition): Use copy_string and
10473 copy_comment. Removed now unused `match', `ended',
10474 `cplus_comment'.
ae3c3164
AD
10475 (copy_comment, copy_string): Moved, to be visible from
10476 copy_definition.
10477
4dc58e7c
AD
104782000-03-17 Akim Demaille <akim@epita.fr>
10479
aa5fd0ee
AD
10480 * src/reader.c (copy_string): Declare `static inline'. No
10481 problems with inline, since it is checked by configure.
4dc58e7c
AD
10482 (copy_comment): Likewise.
10483
0a6384c4
AD
104842000-03-17 Akim Demaille <akim@epita.fr>
10485
aa5fd0ee 10486 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 10487
3cef001a
AD
104882000-03-17 Akim Demaille <akim@epita.fr>
10489
aa5fd0ee 10490 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
10491 (copy_action): Use it. Removed now unused `match', `ended',
10492 `cplus_comment'.
10493 (copy_guard): Likewise.
10494
ca36d2ef
AD
104952000-03-17 Akim Demaille <akim@epita.fr>
10496
aa5fd0ee 10497 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
10498 (copy_action): Use it.
10499 (copy_guard): Likewise.
10500
6666f98f
AD
105012000-03-17 Akim Demaille <akim@epita.fr>
10502
10503 Change the handling of @s so that they behave exactly like $s.
10504 There is now a pseudo variable @$ (readble and writable), location
10505 of the lhs of the rule (by default ranging from the location of
10506 the first symbol of the rhs, to the location of the last symbol,
10507 or, if the rhs is empty, YYLLOC).
10508
10509 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
10510 yyval.
10511 (yyparse): When providing a default semantic action, provide a
10512 default location action.
10513 (after the $): No longer change `*YYLSP', just stack YYLOC the
10514 same way you stack YYVAL.
10515 * src/reader.c (read_declarations): Use warns.
10516 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
10517 (copy_action, case '@'): Likewise.
10518 Use a standard error message, to save useless work from
10519 translators.
10520
41aca2e0
AD
105212000-03-17 Akim Demaille <akim@epita.fr>
10522
aa5fd0ee
AD
10523 * src/bison.s1: Formatting and cosmetics changes.
10524 * src/reader.c: Likewise.
41aca2e0
AD
10525 Update the Copyright notice.
10526
dc08c1d5
AD
105272000-03-17 Akim Demaille <akim@epita.fr>
10528
aa5fd0ee
AD
10529 * src/bison.s1 (#line): All set to `#line' only, since the
10530 Makefile now handles them.
dc08c1d5 10531
9ee3c97b
AD
105322000-03-16 Akim Demaille <akim@epita.fr>
10533
10534 * src/output.c (output_rule_data): Output the documentation of
10535 some of the tables.
10536 (Copyright notice): Update.
10537 Formatting changes.
10538
0de741ca
AD
105392000-03-16 Akim Demaille <akim@epita.fr>
10540
10541 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
10542 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
10543 One `#if YYDEBUG' remains, since it uses variables which are
10544 defined only if `YYDEBUG != 0'.
10545
bb10be54
AD
105462000-03-16 Akim Demaille <akim@epita.fr>
10547
10548 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
10549 and related variables so that the similarities are highlighted.
10550
b07b484a
AD
105512000-03-16 Akim Demaille <akim@epita.fr>
10552
10553 * src/bison.s1: Properly indent CPP directives.
10554
361f60b3
AD
105552000-03-16 Akim Demaille <akim@epita.fr>
10556
10557 * src/bison.s1: Properly indent the `alloca' CPP section.
10558
8c44d3ec
AD
105592000-03-16 Akim Demaille <akim@epita.fr>
10560
10561 Do not hard code values of directories in `configure.in'.
10562 Update the `configure' tool chain.
10563
10564 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
10565 src/makefile.am.
10566 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
10567 (AC_OUTPUT): Add m4/Makefile.
10568 Bump to bison 1.28a, 1.29 has never been released.
10569 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
10570 handled via src/Makefile.am.
10571 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
10572 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
10573 autoheader.
10574 * Makefile.am (SUBDIRS): Add m4.
10575 (ACLOCAL_AM_FLAGS): New variable.
10576 (AUTOMAKE_OPTIONS): Add check-news.
10577 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
10578 the proper line number and file name.
10579 (DEFS): Propagate the location of bison library files and of the
10580 locale files.
10581 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
10582 builddir.
10583 * acinclude.m4: Remove, replaced by the directory m4.
10584 * m4/Makefile.am (EXTRA_DIST): New variable.
10585 * m4/gettext.m4: New file, from the fileutils.
10586 * m4/lcmessage.m4: Likewise
10587 * m4/progtest.m4: Likewise.
10588 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
10589
f95997e7
AD
105902000-03-10 Akim Demaille <akim@epita.fr>
10591
10592 * src/closure.c:
10593 Formatting changes of various comments.
10594 Respect the GNU coding standards at various places.
10595 Don't use `_()' when no translation is needed.
10596
105971999-12-13 Jesse Thilo <jthilo@gnu.org>
10598
10599 * src/files.c:
10600 OS/2 honors TMPDIR environment variable.
10601
106021999-12-13 Jesse Thilo <jthilo@gnu.org>
10603
10604 * doc/bison.texinfo: Tweaked spelling and grammar.
10605 Updated ISBN.
10606 Removed reference to price of printed copy.
10607 Mention BISON_SIMPLE and BISON_HAIRY.
10608
106091999-12-13 Jesse Thilo <jthilo@gnu.org>
10610
10611 * configure.in, NEWS:
10612 Bison 1.29 released.
10613
106141999-10-27 Jesse Thilo <jthilo@gnu.org>
10615
10616 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
10617 Added reference card.
10618
106191999-07-26 Jesse Thilo <jthilo@gnu.org>
10620
10621 * po/ru.po: Added Russian translation.
10622
106231999-07-26 Jesse Thilo <jthilo@gnu.org>
10624
10625 * configure.in: Added Russian translation.
10626
106271999-07-06 Jesse Thilo <jthilo@gnu.org>
10628
10629 * configure.in, NEWS, README:
10630 Released version 1.28.
10631
106321999-06-14 Jesse Thilo <jthilo@gnu.org>
10633
10634 * src/system.h:
10635 Squashed redefinition warning on some systems.
10636
10637 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
10638 Have configure build version string instead of relying on ANSI string
10639 concatentation.
10640
106411999-06-14 Jesse Thilo <jthilo@gnu.org>
10642
10643 * po/POTFILES.in: Got rid of version.c.
10644
106451999-06-14 Jesse Thilo <jthilo@gnu.org>
10646
10647 * acconfig.h, configure.in:
10648 Have configure build version string instead of relying on ANSI string
10649 concatentation.
10650
106511999-06-08 Jesse Thilo <jthilo@gnu.org>
10652
10653 * doc/bison.1:
10654 Dropped mention of `+' for long-named options.
10655
106561999-05-30 Jesse Thilo <jthilo@gnu.org>
10657
10658 * src/files.c: Added <unistd.h> for unlink().
10659
10660 * src/Makefile.am, src/system.h:
10661 I18n fixes.
10662
106631999-05-30 Jesse Thilo <jthilo@gnu.org>
10664
10665 * README: Added a FAQ list.
10666
10667 * configure.in, acconfig.h:
10668 I18n fixes.
10669
106701999-05-30 Jesse Thilo <jthilo@gnu.org>
10671
10672 * doc/FAQ, doc/Makefile.am:
10673 Added a FAQ list.
10674
106751999-05-19 Jesse Thilo <jthilo@gnu.org>
10676
10677 * src/alloc.h, src/symtab.h, src/version.c:
10678 Protected inclusion of "config.h" with HAVE_CONFIG_H.
10679
106801999-04-18 Jesse Thilo <jthilo@gnu.org>
10681
10682 * src/.cvsignore, src/Makefile.am:
10683 Reorganized: sources in `src', documentation in `doc'.
10684
10685 * src/lex.c (literalchar):
10686 fixed the code for escaping double quotes (thanks
10687 Jonathan Czisny.)
10688
106891999-04-18 Jesse Thilo <jthilo@gnu.org>
10690
10691 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
10692 Adjusted paths to reflect directory reorganization.
10693
106941999-04-18 Jesse Thilo <jthilo@gnu.org>
10695
10696 * doc/.cvsignore, doc/Makefile.am:
10697 Reorganized: sources in `src', documentation in `doc'.
10698
106991999-04-18 Jesse Thilo <jthilo@gnu.org>
10700
10701 * configure.in:
10702 Updated AC_INIT file to reflect directory reorganization.
10703
10704 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
10705 Reorganized: sources in `src', documentation in `doc'.
10706
107071999-04-13 Jesse Thilo <jthilo@gnu.org>
10708
10709 * src/allocate.c:
10710 Don't declare calloc() and realloc() if not necessary.
10711
107121999-04-13 Jesse Thilo <jthilo@gnu.org>
10713
10714 * configure.in, acconfig.h, acinclude.m4:
10715 Don't declare calloc() and realloc() if not necessary.
10716
107171999-03-23 Jesse Thilo <jthilo@gnu.org>
10718
10719 * po/.cvsignore: Added i18n support.
10720
107211999-03-23 Jesse Thilo <jthilo@gnu.org>
10722
10723 * acconfig.h, configure.in, Makefile.am:
10724 Added i18n support.
10725
107261999-03-22 Jesse Thilo <jthilo@gnu.org>
10727
10728 * src/bison.s1: Fixed #line numbers.
10729
107301999-03-15 Jesse Thilo <jthilo@gnu.org>
10731
10732 * po/es.po, po/fr.po, po/nl.po, po/de.po:
10733 Added PO files from Translation Project.
10734
107351999-03-03 Jesse Thilo <jthilo@gnu.org>
10736
10737 * Makefile.am:
10738 Added support for non-ANSI compilers (ansi2knr).
10739
107401999-02-16 Jesse Thilo <jthilo@gnu.org>
10741
10742 * configure.in: Bumped version number to 1.27.
10743
10744 * Makefile.am:
10745 Added `bison.simple' to list of files removed by `make distclean'.
10746
107471999-02-12 Jesse Thilo <jthilo@gnu.org>
10748
10749 * src/files.c, src/files.h:
10750 Defined locations of parser files in config.h instead of Makefile.
10751
107521999-02-12 Jesse Thilo <jthilo@gnu.org>
10753
10754 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
10755 Defined locations of parser files in config.h instead of Makefile.
10756
107571999-02-09 Jesse Thilo <jthilo@gnu.org>
10758
10759 * Makefile.am:
10760 Removed inappropriate use of $< macro.
10761
107621999-02-05 Jesse Thilo <jthilo@gnu.org>
10763
10764 * po/Makefile.in.in, po/POTFILES.in:
10765 Add `po' directory skeleton.
10766
107671999-01-27 Jesse Thilo <jthilo@gnu.org>
10768
10769 * README: Document help-bison list.
10770
10771 * configure.in: Add check for mkstemp().
10772
107731999-01-20 Jesse Thilo <jthilo@gnu.org>
10774
10775 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
10776 Hush a few compiler warnings.
10777
10778 * src/files.c:
10779 Add tryclose(), which verifies that fclose was successful.
10780 Hush a couple of compiler warnings.
10781
107821999-01-20 Jesse Thilo <jthilo@gnu.org>
10783
10784 * Makefile.am, OChangeLog:
10785 ChangeLog is now automatically generated. Include the old version as
10786 OChangeLog.
10787
107881999-01-14 Jesse Thilo <jthilo@gnu.org>
10789
10790 * 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:
10791 Update FSF address.
10792
107931999-01-14 Jesse Thilo <jthilo@gnu.org>
10794
10795 * doc/bison.texinfo: Fix formatting glitch.
10796
10797 * doc/bison.texinfo: Update FSF address.
10798
107991999-01-14 Jesse Thilo <jthilo@gnu.org>
10800
10801 * acconfig.h: Update FSF address.
10802
108031999-01-08 Jesse Thilo <jthilo@gnu.org>
10804
10805 * src/system.h:
10806 Don't define PACKAGE here, since config.h defines it.
10807
108081998-12-30 Jesse Thilo <jthilo@gnu.org>
10809
10810 * src/reader.c: Update copyright date.
10811
10812 * src/main.c:
10813 Ditch sprintf to statically-sized buffers in fatal/warn functions in
10814 favor of output directly to stderr (avoids buffer overruns).
10815
10816 * src/reader.c: Some checks for premature EOF.
10817
10818 * 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:
10819 Use prototypes if the compiler understands them.
10820
10821 * src/files.c: Honor TMPDIR on Unix hosts.
10822 Use prototypes if the compiler understands them.
10823
10824 * src/reader.c:
10825 Fix a couple of buffer overrun bugs.
10826 Use prototypes if the compiler understands them.
10827
10828 * src/system.h: Include unistd.h and ctype.h.
10829 Use #ifdef instead of #if for NLS symbols.
10830
108311998-12-30 Jesse Thilo <jthilo@gnu.org>
10832
10833 * doc/bison.texinfo:
10834 Delete comment "consider using @set for edition number, etc..." since
10835 we now are doing so.
10836
108371998-12-30 Jesse Thilo <jthilo@gnu.org>
10838
10839 * configure.in:
10840 Use prototypes if the compiler understands them.
10841
10842 * NEWS: Document 1.26 highlights.
10843
10844 * Makefile.am: Require Automake 1.3 or later.
10845
10846 * acconfig.h:
10847 Use prototypes if the compiler understands them.
10848
108491998-12-29 Jesse Thilo <jthilo@gnu.org>
10850
10851 * src/version.c:
10852 Use VERSION symbol from automake for version number.
10853
108541998-12-29 Jesse Thilo <jthilo@gnu.org>
10855
10856 * acconfig.h, configure.in, version.cin:
10857 Use VERSION symbol from automake for version number.
10858
108591998-11-28 Jesse Thilo <jthilo@gnu.org>
10860
10861 * Makefile.am:
10862 Distribute original version of simple parser (bison.s1), not built
10863 version (bison.simple).
10864
108651998-11-28 Jesse Thilo <jthilo@gnu.org>
10866
10867 * doc/bison.texinfo: Add info dir entry.
10868
10869 * doc/bison.texinfo:
10870 Let automake put version number into documentation.
10871
108721998-11-26 Jesse Thilo <jthilo@gnu.org>
10873
10874 * src/bison.cld, src/build.com, src/vmshlp.mar:
10875 Add non-RCS files from /gd/gnu/bison.
10876
108771998-11-26 Jesse Thilo <jthilo@gnu.org>
10878
10879 * doc/bison.1:
10880 Document the BISON_HAIRY and BISON_SIMPLE variables.
10881
108821998-11-25 Jesse Thilo <jthilo@gnu.org>
10883
10884 * src/version.c: Build version.c automatically.
10885
10886 * src/reader.c:
10887 Fix token numbering (used to start at 258, not 257).
10888
10889 * src/system.h: Include config.h.
10890
10891 * src/getargs.c: Update bug report address.
10892
10893 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
10894 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
10895
108961998-11-25 Jesse Thilo <jthilo@gnu.org>
10897
10898 * Makefile.am:
10899 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
10900
10901 * configure.in, version.cin:
10902 Build version.c automatically.
10903
10904 * AUTHORS: Add AUTHORS file.
10905
10906 * README: Update bug report address.
10907
10908 * bison.simple:
10909 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
10910
10911 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
10912 Add automake stuff.
10913
109141998-11-25 Jesse Thilo <jthilo@gnu.org>
10915
10916 * doc/bison.texinfo: Clean up some formatting.
10917
109181998-05-05 Richard Stallman <rms@gnu.org>
10919
10920 * doc/bison.texinfo:
10921 Explain better why to make a pure parser.
10922
109231998-01-05 Richard Stallman <rms@gnu.org>
10924
10925 * src/files.c (openfiles):
10926 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
10927 find a temporary directory, if possible. Do not unlink files while
10928 they are open.
10929
109301997-08-25 Richard Stallman <rms@gnu.org>
10931
10932 * src/reader.c (stack_offset;):
10933 Change some warni to warns.
10934
10935 * src/lex.c (literalchar): Use warns, not warni.
10936
109371997-06-28 Richard Stallman <rms@gnu.org>
10938
10939 * src/bison.s1: Add a Bison version comment.
10940
10941 * src/main.c (fatal, warn, berror):
10942 Use program_name.
10943
109441997-06-28 Richard Stallman <rms@gnu.org>
10945
10946 * Makefile.in (bison_version): New variable.
10947 (dist): Use that variable.
10948 (bison.s1): Substitute the Bison version into bison.simple.
10949
10950 * bison.simple: Add a Bison version comment.
10951
109521997-06-18 Richard Stallman <rms@gnu.org>
10953
10954 * src/main.c (fatal, warn, berror):
10955 Make error messages standard.
10956 (toomany): Improve error message text.
10957
10958 * 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:
10959 new.h renamed to alloc.h.
10960
109611997-06-18 Richard Stallman <rms@gnu.org>
10962
10963 * Makefile.in: new.h renamed to alloc.h.
10964
109651997-05-24 Richard Stallman <rms@gnu.org>
10966
10967 * src/lex.c (literalchar):
10968 Fix the code for escaping \, " and '.
10969
10970 (lex): Avoid trouble when there are many chars
10971 to discard in a char literal with just several chars in it.
10972
109731997-05-17 Richard Stallman <rms@gnu.org>
10974
10975 * src/bison.s1:
10976 Use malloc, if using alloca is troublesome.
10977 (YYSTACK_USE_ALLOCA): New flag macro.
10978 Define it for some systems and compilers.
10979 (YYSTACK_ALLOC): New macro.
10980 (yyparse): Use YYSTACK_ALLOC to allocate stack.
10981 If it was malloc'd, free it.
10982
109831997-05-17 Richard Stallman <rms@gnu.org>
10984
10985 * bison.simple:
10986 Use malloc, if using alloca is troublesome.
10987 (YYSTACK_USE_ALLOCA): New flag macro.
10988 Define it for some systems and compilers.
10989 (YYSTACK_ALLOC): New macro.
10990 (yyparse): Use YYSTACK_ALLOC to allocate stack.
10991 If it was malloc'd, free it.
10992
109931997-04-23 Richard Stallman <rms@gnu.org>
10994
10995 * src/bison.s1:
10996 (alloca) [__hpux]: Always define as __builtin_alloca.
10997
109981997-04-23 Richard Stallman <rms@gnu.org>
10999
11000 * bison.simple:
11001 (alloca) [__hpux]: Always define as __builtin_alloca.
11002
110031997-04-22 Richard Stallman <rms@gnu.org>
11004
11005 * src/bison.s1:
11006 [__hpux]: Include alloca.h (right for HPUX 10)
11007 instead of declaring alloca (right for HPUX 9).
11008
11009 * src/bison.s1 (__yy_memcpy):
11010 Declare arg `count' as unsigned int.
11011 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11012
110131997-04-22 Richard Stallman <rms@gnu.org>
11014
11015 * bison.simple:
11016 [__hpux]: Include alloca.h (right for HPUX 10)
11017 instead of declaring alloca (right for HPUX 9).
11018
11019 * bison.simple (__yy_memcpy):
11020 Declare arg `count' as unsigned int.
11021 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11022
110231997-01-03 Richard Stallman <rms@gnu.org>
11024
11025 * src/allocate.c: [__STDC__ or _MSC_VER]:
11026 Declare calloc and realloc to return void *.
11027
110281997-01-02 Richard Stallman <rms@gnu.org>
11029
11030 * src/system.h:
11031 [_MSC_VER]: Include stdlib.h and process.h.
11032 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
11033
11034 * src/main.c (main): Return FAILURE as a value.
11035 (printable_version): Declare arg as int, not char.
11036
110371997-01-02 Richard Stallman <rms@gnu.org>
11038
11039 * Makefile.in (dist):
11040 Explicitly check for symlinks, and copy them.
11041
110421996-12-19 Richard Stallman <rms@gnu.org>
11043
11044 * src/files.c:
11045 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
11046
110471996-12-18 Paul Eggert <eggert@gnu.org>
11048
11049 * src/bison.s1 (yyparse):
11050 If __GNUC__ and YYPARSE_PARAM are both defined,
11051 declare yyparse to have a void * argument.
11052
110531996-12-18 Paul Eggert <eggert@gnu.org>
11054
11055 * bison.simple (yyparse):
11056 If __GNUC__ and YYPARSE_PARAM are both defined,
11057 declare yyparse to have a void * argument.
11058
110591996-12-17 Richard Stallman <rms@gnu.org>
11060
11061 * src/reduce.c (nbits): Add some casts.
11062
110631996-08-12 Richard Stallman <rms@gnu.org>
11064
11065 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
11066
110671996-08-12 Richard Stallman <rms@gnu.org>
11068
11069 * bison.simple: Test _MSDOS as well as _MSDOS_.
11070
110711996-07-31 Richard Stallman <rms@gnu.org>
11072
11073 * src/bison.s1:
11074 [__sun && __i386]: Include alloca.h.
11075
110761996-07-31 Richard Stallman <rms@gnu.org>
11077
11078 * bison.simple:
11079 [__sun && __i386]: Include alloca.h.
11080
110811996-07-30 Richard Stallman <rms@gnu.org>
11082
11083 * src/bison.s1: Comment change.
11084
11085 * src/bison.s1: Test _MSDOS_, not MSDOS.
11086
110871996-07-30 Richard Stallman <rms@gnu.org>
11088
11089 * bison.simple: Comment change.
11090
11091 * bison.simple: Test _MSDOS_, not MSDOS.
11092
110931996-06-01 Richard Stallman <rms@gnu.org>
11094
11095 * 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:
11096 Insert `_' macro around many string constants.
11097
11098 * src/main.c:
11099 Insert `_' macro around many string constants.
11100
11101 (main): Call setlocale, bindtextdomain and textdomain.
11102
11103 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
11104 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
11105 [ENABLE_NLS]: Include libintl.h.
11106 [ENABLE_NLS] (gettext): Define.
11107 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
11108 (N_, PACKAGE, LOCALEDIR): New macros.
11109
111101996-06-01 Richard Stallman <rms@gnu.org>
11111
11112 * POTFILES.in: New file.
11113
11114 * Makefile.in (allocate.o):
11115 Define target explicitly.
11116
11117 * Makefile.in (CFLAGS): Set to @CFLAGS@.
11118 (LDFLAGS): Set to @LDFLAGS@.
11119 (configure): Run autoconf only if preceding `cd' succeeds.
11120 (bison.s1): Redirect output to temporary file then move the
11121 temporary to the target, rather than redirecting directly to bison.s1.
11122 (clean): Remove config.status and config.log.
11123 (distclean): Don't remove config.status here.
11124
111251996-05-12 Richard Stallman <rms@gnu.org>
11126
11127 * src/bison.s1:
11128 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11129
111301996-05-12 Richard Stallman <rms@gnu.org>
11131
11132 * bison.simple:
11133 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11134
111351996-05-11 Richard Stallman <rms@gnu.org>
11136
11137 * src/bison.s1 (__yy_memcpy):
11138 Really reorder the args, as was supposedly done on Feb 14 1995.
11139 (yyparse): Calls changed accordingly.
11140
111411996-05-11 Richard Stallman <rms@gnu.org>
11142
11143 * Makefile.in (dist): Don't use $(srcdir).
11144
11145 * bison.simple (__yy_memcpy):
11146 Really reorder the args, as was supposedly done on Feb 14 1995.
11147 (yyparse): Calls changed accordingly.
11148
111491996-01-27 Richard Stallman <rms@gnu.org>
11150
11151 * src/output.c (output_rule_data):
11152 Test YYERROR_VERBOSE in the conditional
11153 around the definition of ttyname.
11154
111551995-12-29 Richard Stallman <rms@gnu.org>
11156
11157 * src/bison.s1:
11158 Fix line numbers in #line commands.
11159
111601995-12-29 Richard Stallman <rms@gnu.org>
11161
11162 * bison.simple:
11163 Fix line numbers in #line commands.
11164
111651995-12-27 Richard Stallman <rms@gnu.org>
11166
11167 * src/bison.s1 (YYPARSE_PARAM_DECL):
11168 In C++, make it always null.
11169 (YYPARSE_PARAM_ARG): New macro.
11170 (yyparse): Use YYPARSE_PARAM_ARG.
11171
111721995-12-27 Richard Stallman <rms@gnu.org>
11173
11174 * bison.simple (YYPARSE_PARAM_DECL):
11175 In C++, make it always null.
11176 (YYPARSE_PARAM_ARG): New macro.
11177 (yyparse): Use YYPARSE_PARAM_ARG.
11178
111791995-11-29 Richard Stallman <rms@gnu.org>
11180
11181 * doc/bison.texinfo:
11182 Describe literal string tokens, %raw, %no_lines, %token_table.
11183
111841995-11-29 Daniel Hagerty <hag@gnu.org>
11185
11186 * doc/bison.texinfo: Fixed update date
11187
111881995-10-16 Richard Stallman <rms@gnu.org>
11189
11190 * src/version.c: Version 1.25.
11191
111921995-10-16 Richard Stallman <rms@gnu.org>
11193
11194 * NEWS: *** empty log message ***
11195
111961995-10-16 Richard Stallman <rms@gnu.org>
11197
11198 * doc/bison.1, doc/bison.rnh:
11199 Add new options.
11200
112011995-10-15 Richard Stallman <rms@gnu.org>
11202
11203 * src/vmsgetargs.c, src/getargs.c:
11204 Added -n, -k, and -raw switches.
11205 (noparserflag, toknumflag, rawtoknumflag): New variables.
11206
11207 * src/symtab.h (SALIAS):
11208 New #define for adding aliases to %token.
11209 (struct bucket): Added `alias' field.
11210
11211 * src/reduce.c (reduce_grammar):
11212 Revise error message.
11213 (print_notices): Remove final `.' from error message.
11214
11215 * src/reader.c (reader_output_yylsp):
11216 New function.
11217 (readgram): Use `#if 0' around code that accepted %command
11218 inside grammar rules: The documentation doesn't allow it,
11219 and it will fail since the %command processors scan for the next %.
11220 (parse_token_decl): Extended the %token
11221 declaration to allow a multi-character symbol as an alias.
11222 (parse_thong_decl): New function.
11223 (read_declarations): Added %thong declarations.
11224 (read_declarations): Handle NOOP to deal with allowing
11225 % declarations as another means to specify the flags.
11226 (readgram): Allow %prec prior to semantics embedded in a rule.
11227 (skip_to_char, read_declarations, copy_definition)
11228 (parse_token_decl, parse_start_decl, parse_type_decl)
11229 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
11230 (get_type_name, copy_guard, copy_action, readgram)
11231 (get_type, packsymbols): Revised most error messages.
11232 Changed `fatal' to `warnxxx' to avoid aborting for error.
11233 Revised and use multiple warnxxx functions to avoid using VARARGS1.
11234 (read_declarations): Improve the error message for
11235 an invalid character. Do not abort.
11236 (read_declarations, copy_guard, copy_action): Use
11237 printable_version to avoid unprintable characters in printed output.
11238 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
11239 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
11240 Allow the type of a non-terminal can be given
11241 more than once, as long as all specifications give the same type.
11242
11243 * src/output.c:
11244 (output_headers, output_trailers, output, output_gram)
11245 (output_rule_data): Implement noparserflag variable.
11246 Implement toknumflag variable.
11247 (output): Call reader_output_yylsp to output LTYPESTR.
11248
11249 * src/main.c (main):
11250 If reader sees an error, don't process the grammar.
11251 (fatals): Updated to not use VARARGS1.
11252 (printable_version, int_to_string, warn, warni, warns, warnss)
11253 (warnsss): New error reporting functions. Avoid abort for error.
11254
11255 * src/lex.h:
11256 Added THONG and NOOP for alias processing.
11257 Added SETOPT for the new code that allows setting options with %flags.
11258
11259 * src/lex.c:
11260 Include getopt.h. Add some extern decls.
11261 (safegetc): New function to deal with EOF gracefully.
11262 (literalchar); new function to deal with reading \ escapes.
11263 (lex): Use literalchar.
11264 (lex): Implemented "..." tokens.
11265 (literalchar, lex, parse_percent_token): Made tokenbuffer
11266 always contain the token. This includes growing the token
11267 buffer while reading an integer.
11268 (parse_percent_token): Replaced if-else statement with percent_table.
11269 (parse_percent_token): Added % declarations as another
11270 way to specify the flags -n, -l, and -r. Also added hooks for
11271 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
11272 major changes to files.c.
11273 (lex) Retain in the incoming stream a character following
11274 an incorrect '/'.
11275 (skip_white_space, lex): Revised most error messages
11276 and changed fatal to warn to avoid aborting.
11277 (percent_table): Added %thong declarations.
11278
11279 * src/gram.h: Comment changes.
11280
11281 * src/files.c (openfiles, open_extra_files, done):
11282 Add faction flag
11283 and actfile file. Handle noparserflag. Both for -n switch.
11284
11285 * src/conflicts.c (resolve_sr_conflict):
11286 Remove use of alloca.
11287
112881995-06-01 Jim Meyering <meyering@gnu.org>
11289
11290 * doc/bison.texinfo: *** empty log message ***
11291
112921995-05-06 Richard Stallman <rms@gnu.org>
11293
11294 * src/bison.s1: Comment change.
11295
112961995-05-06 Richard Stallman <rms@gnu.org>
11297
11298 * bison.simple: Comment change.
11299
113001995-05-03 Richard Stallman <rms@gnu.org>
11301
11302 * src/version.c: Version now 1.24.
11303
11304 * src/bison.s1: Change distribution terms.
11305
11306 * src/version.c: Version now 1.23.
11307
113081995-05-03 Richard Stallman <rms@gnu.org>
11309
11310 * doc/bison.texinfo:
11311 Rewrite "Conditions for Using Bison".
11312 Update version to 1.24.
11313
113141995-05-03 Richard Stallman <rms@gnu.org>
11315
11316 * bison.simple: Change distribution terms.
11317
113181995-02-23 Richard Stallman <rms@gnu.org>
11319
11320 * src/files.c: Test __VMS_POSIX as well as VMS.
11321
113221995-02-14 Jim Meyering <meyering@gnu.org>
11323
11324 * src/bison.s1 (__yy_memcpy):
11325 Renamed from __yy_bcopy to avoid
11326 confusion. Reverse FROM and TO arguments to be consistent with
11327 those of memcpy.
11328
113291995-02-14 Jim Meyering <meyering@gnu.org>
11330
11331 * bison.simple (__yy_memcpy):
11332 Renamed from __yy_bcopy to avoid
11333 confusion. Reverse FROM and TO arguments to be consistent with
11334 those of memcpy.
11335
113361994-11-10 David J. MacKenzie <djm@gnu.org>
11337
11338 * NEWS: reformat
11339
11340 * NEWS: New file.
11341
11342 * Makefile.in (DISTFILES): Include NEWS.
11343
11344 * Makefile.in (DISTFILES):
11345 Include install-sh, not install.sh.
11346
11347 * configure.in: Update to Autoconf v2 macro names.
11348
113491994-10-05 David J. MacKenzie <djm@gnu.org>
11350
11351 * Makefile.in: fix typo
11352
11353 * Makefile.in (prefix, exec_prefix):
11354 Let configure set them.
11355
113561994-09-28 David J. MacKenzie <djm@gnu.org>
11357
11358 * Makefile.in: Set datadir to $(prefix)/share.
11359
113601994-09-15 Richard Stallman <rms@gnu.org>
11361
11362 * src/bison.s1:
11363 Update copyright notice and GPL version.
11364
113651994-09-15 Richard Stallman <rms@gnu.org>
11366
11367 * bison.simple:
11368 Update copyright notice and GPL version.
11369
113701994-07-12 Richard Stallman <rms@gnu.org>
11371
11372 * src/reduce.c, src/reader.c:
11373 entered into RCS
11374
113751994-05-05 David J. MacKenzie <djm@gnu.org>
11376
11377 * Makefile.in: entered into RCS
11378
113791994-03-26 Richard Stallman <rms@gnu.org>
11380
11381 * src/bison.s1: entered into RCS
11382
113831994-03-26 Richard Stallman <rms@gnu.org>
11384
11385 * bison.simple: entered into RCS
11386
113871994-03-25 Richard Stallman <rms@gnu.org>
11388
11389 * src/main.c: entered into RCS
11390
113911994-03-24 Richard Stallman <rms@gnu.org>
11392
11393 * src/conflicts.c: entered into RCS
11394
113951994-01-02 Richard Stallman <rms@gnu.org>
11396
11397 * Makefile.in: *** empty log message ***
11398
113991993-11-21 Richard Stallman <rms@gnu.org>
11400
11401 * src/bison.s1: *** empty log message ***
11402
114031993-11-21 Richard Stallman <rms@gnu.org>
11404
11405 * doc/bison.texinfo: entered into RCS
11406
11407 * doc/bison.texinfo: *** empty log message ***
11408
114091993-11-21 Richard Stallman <rms@gnu.org>
11410
11411 * bison.simple: *** empty log message ***
11412
114131993-10-25 David J. MacKenzie <djm@gnu.org>
11414
11415 * doc/bison.texinfo: *** empty log message ***
11416
114171993-10-19 Richard Stallman <rms@gnu.org>
11418
11419 * src/bison.s1: *** empty log message ***
11420
114211993-10-19 Richard Stallman <rms@gnu.org>
11422
11423 * bison.simple: *** empty log message ***
11424
114251993-10-14 Richard Stallman <rms@gnu.org>
11426
11427 * src/bison.s1: *** empty log message ***
11428
114291993-10-14 Richard Stallman <rms@gnu.org>
11430
11431 * bison.simple: *** empty log message ***
11432
114331993-09-14 David J. MacKenzie <djm@gnu.org>
11434
11435 * doc/bison.texinfo: *** empty log message ***
11436
114371993-09-13 Noah Friedman <friedman@gnu.org>
11438
11439 * Makefile.in: *** empty log message ***
11440
114411993-09-10 Richard Stallman <rms@gnu.org>
11442
11443 * src/conflicts.c: *** empty log message ***
11444
11445 * src/system.h: entered into RCS
11446
114471993-09-10 Richard Stallman <rms@gnu.org>
11448
11449 * doc/bison.1: entered into RCS
11450
114511993-09-06 Noah Friedman <friedman@gnu.org>
11452
11453 * src/version.c: entered into RCS
11454
114551993-09-06 Noah Friedman <friedman@gnu.org>
11456
11457 * Makefile.in: *** empty log message ***
11458
114591993-07-30 David J. MacKenzie <djm@gnu.org>
11460
11461 * Makefile.in: *** empty log message ***
11462
114631993-07-24 Richard Stallman <rms@gnu.org>
11464
11465 * src/bison.s1: *** empty log message ***
11466
114671993-07-24 Richard Stallman <rms@gnu.org>
11468
11469 * bison.simple: *** empty log message ***
11470
114711993-07-08 David J. MacKenzie <djm@gnu.org>
11472
11473 * Makefile.in: *** empty log message ***
11474
114751993-07-04 Richard Stallman <rms@gnu.org>
11476
11477 * src/bison.s1: *** empty log message ***
11478
114791993-07-04 Richard Stallman <rms@gnu.org>
11480
11481 * bison.simple: *** empty log message ***
11482
114831993-06-26 David J. MacKenzie <djm@gnu.org>
11484
11485 * src/getargs.c: entered into RCS
11486
114871993-06-26 David J. MacKenzie <djm@gnu.org>
11488
11489 * doc/bison.texinfo: *** empty log message ***
11490
11491 * doc/bison.1: New file.
11492
114931993-06-25 Richard Stallman <rms@gnu.org>
11494
11495 * src/getargs.c: New file.
11496
114971993-06-16 Richard Stallman <rms@gnu.org>
11498
11499 * src/bison.s1: *** empty log message ***
11500
115011993-06-16 Richard Stallman <rms@gnu.org>
11502
11503 * bison.simple: *** empty log message ***
11504
115051993-06-03 Richard Stallman <rms@gnu.org>
11506
11507 * src/bison.s1: New file.
11508
115091993-06-03 Richard Stallman <rms@gnu.org>
11510
11511 * doc/bison.texinfo: *** empty log message ***
11512
115131993-06-03 Richard Stallman <rms@gnu.org>
11514
11515 * bison.simple: New file.
11516
115171993-05-19 Richard Stallman <rms@gnu.org>
11518
11519 * doc/bison.texinfo: New file.
11520
115211993-05-07 Noah Friedman <friedman@gnu.org>
11522
11523 * Makefile.in: *** empty log message ***
11524
115251993-04-28 Noah Friedman <friedman@gnu.org>
11526
11527 * src/reader.c: *** empty log message ***
11528
115291993-04-23 Noah Friedman <friedman@gnu.org>
11530
11531 * src/alloc.h: entered into RCS
11532
115331993-04-20 David J. MacKenzie <djm@gnu.org>
11534
11535 * src/version.c: *** empty log message ***
11536
11537 * src/files.c, src/allocate.c:
11538 entered into RCS
11539
11540 * src/reader.c: *** empty log message ***
11541
11542 * src/lex.c: entered into RCS
11543
11544 * src/conflicts.c: New file.
11545
11546 * src/symtab.c: entered into RCS
11547
11548 * src/alloc.h: New file.
11549
11550 * src/LR0.c: entered into RCS
11551
115521993-04-18 Noah Friedman <friedman@gnu.org>
11553
11554 * src/reader.c: New file.
11555
11556 * src/version.c: *** empty log message ***
11557
115581993-04-18 Noah Friedman <friedman@gnu.org>
11559
11560 * Makefile.in: *** empty log message ***
11561
115621993-04-17 Noah Friedman <friedman@gnu.org>
11563
11564 * Makefile.in: *** empty log message ***
11565
115661993-04-15 Richard Stallman <rms@gnu.org>
11567
11568 * src/main.c, src/files.c:
11569 New file.
11570
115711993-04-15 Noah Friedman <friedman@gnu.org>
11572
11573 * configure.in: entered into RCS
11574
11575 * configure.in: *** empty log message ***
11576
11577 * configure.in: New file.
11578
115791993-04-14 Richard Stallman <rms@gnu.org>
11580
11581 * Makefile.in: New file.
11582
115831993-04-13 Richard Stallman <rms@gnu.org>
11584
11585 * src/version.c: New file.
11586
115871993-03-25 Richard Stallman <rms@gnu.org>
11588
11589 * src/output.c: entered into RCS
11590
115911992-09-25 Richard Stallman <rms@gnu.org>
11592
11593 * configure.bat: entered into RCS
11594
115951992-06-22 Richard Stallman <rms@gnu.org>
11596
11597 * src/vmsgetargs.c: entered into RCS
11598
115991992-06-22 Richard Stallman <rms@gnu.org>
11600
11601 * doc/bison.rnh: entered into RCS
11602
116031992-04-20 David J. MacKenzie <djm@gnu.org>
11604
11605 * README: entered into RCS
11606
116071992-01-22 Richard Stallman <rms@gnu.org>
11608
11609 * src/machine.h: entered into RCS
11610
116111991-12-21 Richard Stallman <rms@gnu.org>
11612
11613 * src/lalr.c, src/closure.c:
11614 entered into RCS
11615
116161991-12-20 Richard Stallman <rms@gnu.org>
11617
11618 * src/state.h: entered into RCS
11619
116201991-12-18 Richard Stallman <rms@gnu.org>
11621
11622 * src/print.c, src/nullable.c, src/derives.c:
11623 entered into RCS
11624
116251991-11-03 David J. MacKenzie <djm@gnu.org>
11626
11627 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
11628 entered into RCS
11629
116301988-09-09 Richard Stallman <rms@gnu.org>
11631
11632 * src/bison.hairy: entered into RCS
11633
116341987-12-16 Richard Stallman <rms@gnu.org>
11635
11636 * REFERENCES: entered into RCS
dc546b0f 11637
f294a2c2
AD
11638-----
11639
33167b8b 11640Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
dc546b0f 116411998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
f294a2c2 11642
33167b8b 11643This file is part of Bison, the GNU Compiler Compiler.
f294a2c2 11644
33167b8b 11645Bison is free software; you can redistribute it and/or modify
f294a2c2
AD
11646it under the terms of the GNU General Public License as published by
11647the Free Software Foundation; either version 2, or (at your option)
11648any later version.
11649
33167b8b 11650Bison is distributed in the hope that it will be useful,
f294a2c2
AD
11651but WITHOUT ANY WARRANTY; without even the implied warranty of
11652MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11653GNU General Public License for more details.
11654
11655You should have received a copy of the GNU General Public License
33167b8b 11656along with Bison; see the file COPYING. If not, write to
f294a2c2
AD
11657the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
11658Boston, MA 02111-1307, USA.