Regenerate.
[bison.git] / ChangeLog
CommitLineData
22fccf95
PE
12003-10-01 Paul Eggert <eggert@twinsun.com>
2
3 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
4 (grammar_declaration): Use it.
5 * src/scan-gram.l: New token %no-default-prec.
6 * tests/conflicts.at: Revamp tests to use %no-default-prec.
7 * NEWS, doc/bison.texinfo: Document the above.
8
fc8f2965
AD
92003-10-01 Akim Demaille <akim@epita.fr>
10
11 VCG no longer supports long_straight_phase.
12
13 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
14 * src/print_graph.c (print_graph): Adjust.
15
39a06c25
PE
162003-09-30 Frank Heckenbach <frank@g-n-u.de>
17 and Paul Eggert <eggert@twinsun.com>
18
19 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
20 Table of Symbols): Document %default-prec.
21 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
22 (grammar_declaration): Set default_prec on %default-prec.
23 * src/scan-gram.l (%default-prec): New token.
24 * src/reader.h (default_prec): New flag.
25 * src/reader.c: Likewise.
26 (packgram): Handle it.
27 * tests/conflicts.at (%default-prec without %prec,
28 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 29
39a06c25
PE
302003-09-30 Paul Eggert <eggert@twinsun.com>
31
32 * tests/testsuite.at: Include local.at, not input.at, fixing
33 a typo in the 2003-08-25 patch.
34
62b6aef9
AD
352003-08-27 Akim Demaille <akim@epita.fr>
36
37 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
38 GCC warnings.
39
89e1cc61
AD
402003-08-26 Akim Demaille <akim@epita.fr>
41
42 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
43 "<\#" to avoid magic from Gnus when posting parts of this script.
44
a08460b0
AD
452003-08-26 Akim Demaille <akim@epita.fr>
46
47 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
48 (Parser::parse): here.
49 Adjust: nerrs and errstatus is now replaced by...
50 (Parser::nerrs_, Parser::errstatus_): New.
51
603f1cfd
AD
522003-08-25 Akim Demaille <akim@epita.fr>
53
54 * config/announce-gen, Makefile.cfg: New.
55 * Makefile.am: Adjust.
56 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
57 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
58
cd3684cf
AD
592003-08-25 Akim Demaille <akim@epita.fr>
60
61 When reducing initial empty rules, Bison parser read an initial
62 location that is not defined. This results in garbage, and that
63 affects Bison's own parser. Therefore we need (i) to extend Bison
64 to support a means to initialize this location, and (ii) to use
65 this CVS Bison to fix CVS Bison's parser.
66
67 * src/reader.h, reader.c (epilogue_augment): Remove, replace
68 with...
69 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
70 * src/parse-gram.y: Adjust.
71 (%initial-action): New.
72 (%error-verbose): Since we require CVS Bison, there is no reason
73 not to use it.
74 * src/scan-gram.l: Adjust.
75 * src/Makefile.am (YACC): New, to make sure we use our own parser.
76 * data/yacc.c (yyparse): Use b4_initial_action.
77
4e03e201
AD
782003-08-25 Akim Demaille <akim@epita.fr>
79
80 * doc/bison.texinfo: Don't promote stdout for error messages.
81
8c182d05
AD
822003-08-25 Akim Demaille <akim@epita.fr>
83
84 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
85 From Alexandre Duret-Lutz.
86
25f66e1a
AD
872003-08-25 Akim Demaille <akim@epita.fr>
88
89 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
90 Use them.
91
5348bfbe
AD
922003-08-25 Akim Demaille <akim@epita.fr>
93
94 * data/lalr1.cc (Parser::reduce_print_): New.
95 Use it.
96
47301314
AD
972003-08-25 Akim Demaille <akim@epita.fr>
98
99 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
100 error recovery loops. This patch is based on
101 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
102 Also, augment the similarity between lalr1.cc and yacc.c.
103 Note: the locations of error recovery rules are not correct yet.
104
105 * data/lalr1.cc: Comment changes to augment the similarity between
106 lalr1.cc and yacc.c.
107 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
108 (yyerrlab1): Remove, but where it used to be (now the bottom part of
109 yyerrlab), when hitting EOF, pop the whole stack here instead of
110 merely falling thru the default error handling mechanism.
111 (yyerrorlab): New label, with the old contents of YYERROR,
112 plus the following change: pop the stack of rhs corresponding
113 to the production that invoked YYERROR. That is how Yacc
114 behaves (required by POSIX).
115 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
116 fail.
117
1f7a61ff
AD
1182003-08-25 Akim Demaille <akim@epita.fr>
119
120 Tune local.at so that people can "autom4te -l autotest calc.at -o
121 calc" for instance, to extract a sub test suite.
122
123 * tests/testsuite.at: Move the initialization, Autotest version
124 requirement, and AT_TESTED invocation into...
125 * tests/local.at: here.
126 * tests/testsuite.at: Include it for compatibility with Autoconf
127 2.57.
128 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
129 be ignore.
130
327b5b56
PE
1312003-08-04 Paul Eggert <eggert@twinsun.com>
132
133 Rework code slightly to avoid gcc -Wtraditional warnings.
134 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
135 The returned value is now stored in *YY0. All callers changed.
136 * src/output.c (merge_output): Adjust to the above change.
137
0051e3ed
PE
1382003-07-26 Paul Eggert <eggert@twinsun.com>
139
140 * data/glr.c (YYASSERT): New macro.
141 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
142 yyresolveStates, yyprocessOneStack):
143 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
144 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 145
137437c6
PE
1462003-07-25 Paul Eggert <eggert@twinsun.com>
147
5b620e06
PE
148 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
149 for portability to K&R C (after ansi2knr, presumably). See
150 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
151 by Frank Heckenbach, though I have omitted the structure-initialization
152 part of his glr-knr.diff patch since I recall that the Portable
153 C Compiler didn't require that change.
154
137437c6
PE
155 Let the user specify how to allocate and free memory.
156 Derived from a suggestion by Frank Heckenbach in
157 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
158 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
159 All uses of free, malloc, realloc changed to use these macros,
160 and unnecessary casts removed.
161 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
162
ddb85ca5
PE
1632003-07-06 Matthias Mann <MatthiasMann@gmx.de>
164
165 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
166 use s.empty() rather than s == "" to test for empty string; see
167 <http://mail.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
168 (trivial change)
169
39910e09
AD
1702003-06-25 Akim Demaille <akim@epita.fr>
171
172 * config/depcomp, config/install-sh: Update from masters.
173
0ae99356
PE
1742003-06-20 Paul Eggert <eggert@twinsun.com>
175
176 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
177 and return properly parenthesized result.
178 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
179 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
180 Remove unnecessary parentheses from uses.
181 * doc/bison.texinfo (Location Default Action): Describe the
182 conventions for parentheses.
183
cd05d13c
PE
1842003-06-19 Paul Eggert <eggert@twinsun.com>
185
81fd08ca
PE
186 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
187 yyreportTree): Do not assume that size_t is the same width as int,
188 when printing sizes. Print sizes using an unsigned format.
189 Problem reported by Frank Heckenbach in
190 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 191
cd05d13c
PE
192 Port to Forte Developer 7 C compiler.
193 * data/glr.c (struct YYLTYPE): If locations are not being used,
194 declare a single dummy member, as empty structs do not conform
195 to the C standard.
196 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
197 the Forte Developer 7 C compiler complains that end-of-loop
198 code is not reached.
199
4dcf140b
PE
2002003-06-17 Paul Eggert <eggert@twinsun.com>
201
202 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
203 avoid warnings from picky compilers about redefinition of PARAMS.
204
8dd76bee
PE
2052003-06-17 Paul Eggert <eggert@twinsun.com>
206
207 Version 1.875b.
208
209 * NEWS: Document 1.875b.
210
211 * lib/bbitset.h: Do not include config.h; that's the includer's job.
212 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
213 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
214 Don't use 'index' in comments, as it's a builtin fn on some hosts.
215 * lib/bitset_stats.c: Include gettext.h unconditionally, as
216 per recent gettext manual's suggestion.
217 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
218 Use prototypes, not old-style definitions.
219 * lib/lbitset.c (lbitset_unused_clear): Likewise.
220 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
221 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
222 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
223 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
224 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
225 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
226 vbitset_or_and_cmp, vbitset_copy): Likewise.
227
228 * lib/libiberty.h: Do not include config.h; that's the includer's job.
229 Do not include <stdlib.h>.
230 (PARAMS): Define unconditionally for C89.
231 (ATTRIBUTE_NORETURN): Remove.
232 (ATTRIBUTE_UNUSED): Define unconditionally.
233
234 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
235 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
236 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
237 * lib/vbitset.c, lib/vbitset.h: New files.
238 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
239 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
240 from libbitset.
241
242 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
243 `How Can I Reset @code{yyparse}', since texinfo does not allow
244 arbitrary @ in node names.
245
246 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
247 shouldn't be needed according to the gettext 0.12.1 documentation
248 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 249 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 250 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 251 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 252
8dd76bee
PE
253 * lib/.cvsignore: Add stdbool.h.
254 * m4/.cvsignore: Add nls.m4, po.m4.
255
256 Upgrade to CVS gnulib.
257 * stdbool_.h: File renamed from stdbool.h.in.
258 * configure.ac (AM_STDBOOL_H): Invoke this instead of
259 AC_HEADER_STDBOOL.
260 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
261 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
262 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
263 (MOSTLYCLEANFILES): New var.
264 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
265 (stdbool.h): New rule.
266 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
267 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
268 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
269 m4/quote.m4: Upgrade to today's gnulib.
270
271 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
272 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
273 the tests right now.
274 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
275 yyerror are declared before use; C99 requires this.
276
25005f6a
PH
2772003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
278
279 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
280 first.
281 (yyrecoverSyntaxError): Correct the logic for setting and testing
282 yyerrState.
283 Correct comment on handling EOF.
284 Allow states with only a default reduction, rather than failing
8dd76bee 285 (I can't quite reconstruct why these were not allowed before).
25005f6a 286
137437c6 287 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 288 buffer overruns, corrupting state.
8dd76bee
PE
289
290 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
291 definition.
292 * src/reader.h (max_left_semantic_context): New variable declaration.
293 * src/scan-gram.l (max_left_semantic_context): Define.
294 (handle_action_dollar): Update max_left_semantic_context.
295 * data/glr.c (YYMAXLEFT): New definition.
296 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
297 (yyresolveAction): Ditto.
298
299 Fixes to problems with location handling in GLR parsers reported by
300 Frank Heckenbach (2003/06/05).
301
302 * data/glr.c (YYLTYPE): Make trivial if locations not used.
303 (YYRHSLOC): Add parentheses, and define only if locations used.
304 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
305 locations not used.
306 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
307 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 308
25005f6a
PH
309 * tests/cxx-type.at: Exercise location information; update tests
310 to differentiate output with and without locations.
8dd76bee 311 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
312 because default YYLTYPE not yet defined.
313 Change semantic actions to compute strings, rather than printing
314 them directly (to test proper passing of semantics values). Change
315 output to prefix notation and update test data and expected results.
316 (yylex): Track locations.
317 (stmtMerge): Return value rather than printing, and include arguments
318 in value.
8dd76bee 319
711f40b7
PE
3202003-06-03 Paul Eggert <eggert@twinsun.com>
321
322 Avoid warnings generated by GCC 2.95.4 when Bison is
323 configured with --enable-gcc-warnings.
324 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
325 yy::]b4_parser_class_name[::translate_,
326 yy::Stack::operator[] (unsigned),
327 yy::Stack::operator[] (unsigned) const,
328 yy::Slice::operator[] (unsigned),
329 yy::Slice::operator[] (unsigned) const):
330 Rename local vars to avoid warnings.
331 * tests/glr-regression.at (Improper handling of embedded actions
332 and $-N in GLR parsers): Remove unused local variable from yylex.
333 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
334 (void) as arg when not pure, since we now assume C89 when building
335 Bison. Pacify GCC by using parameter.
336
ac695f7d
PE
3372003-06-02 Paul Eggert <eggert@twinsun.com>
338
339 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
340 yy::Location::lines, yy::Location::columns): Rename arguments
341 to avoid shadowing; this removes a warning generated by GCC 3.3.
342
26ec81e0
PE
3432003-06-01 Paul Eggert <eggert@twinsun.com>
344
345 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
346 to g++, as GCC 3.3 complains if you do it.
347 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
348 everything that WARNING_CFLAGS has, except omit warnings
349 not suitable for C++.
350 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
351 * tests/atlocal.in (CXXFLAGS): New var.
352 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
353
354 Fix a GLR parser bug I reported in February; see
355 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
356 The problem was that GLR parsers did not conform to the C standard,
357 because actions like { $1 = $2 + $3; } expanded to expressions
358 that invoked YYFILL in separate subexpressions, and YYFILL assigned
359 to a local variable. The C standard says that expressions
360 like (var = f ()) + (var = f ()) have undefined behavior.
361 Another problem was that GCC sometimes issues warnings that
362 yyfill and its parameters are unused.
363
364 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
365 as possibly unused.
366 (yyfill): New function.
367 (YYFILL): Use it.
368 (yyuserAction): Change type of yynormal to bool, so that it matches
369 the new yyfill signature. Mark it as possibly unused.
370
371
372 Follow up on a bug I reported in February, where a Bison-generated
373 parser can loop. Provide a test case and a fix for yacc.c. I
374 don't have a fix for lalr1.cc or for glr.c, unfortunately.
375 The original bug report is in:
376 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
377
378 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
379 macro's size was becoming unwieldy.
380 (yyerrlab): Do not discard an empty lookahead symbol, as this
381 might destroy garbage.
382 (yyerrorlab): New label, with the old contents of YYERROR,
383 plus the following change: pop the stack of rhs corresponding
384 to the production that invoked YYERROR. That is how Yacc
385 behaves, and POSIX requires this behavior.
386 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
387 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
388 Define 'alarm' to do nothing if unistd.h is not available.
389 Add a new rule "exp: '-' error;" to test the above change to
390 data/yacc.c. Use 'alarm' to abort any test taking longer than
391 10 seconds, as it's probably looping.
392 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
393 Also, the new yacc.c generates two fewer diagnostics for an
394 existing test.
395
d0829076
PE
3962003-05-24 Paul Eggert <eggert@twinsun.com>
397
c6ae27df
PE
398 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
399 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
400 This fixes a problem reported by John Bowman when the Compaq/HP
401 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
402 -ansi -Wall -gall).
403 * data/yacc.c (union yyalloc): Likewise.
404 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 405
d0829076
PE
406 Switch from 'int' to 'bool' where that makes sense.
407
408 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
409 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
410 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
411 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
412 Return or accept bool, not int. All callers changed.
413 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
414 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
415 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
416 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
417 bitset_or_and_cmp_): Likewise.
418 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
419 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
420 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
421 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
422 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
423 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
424 bitset_stats_or_and_cmp): Likewise.
425 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
426 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
427 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
428 ebitset_xor_cmp): Likewise.
429 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
430 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
431 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
432 lbitset_xor_cmp): Likewise.
433 * lib/bbitset.h: Include <stdbool.h>.
434 (struct bitset_vtable): The following members now return bool, not
435 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
436 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
437 or_and_cmp).
438 * src/conflicts.c (count_rr_conflicts): Likewise.
439 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
440 All uses changed.
441 * lib/ebitset.c (ebitset_obstack_init): Likewise.
442 * lib/lbitset.c (lbitset_obstack_init): Likewise.
443 * src/getargs.c (debug_flag, defines_flag, locations_flag,
444 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
445 graph_flag): Likewise.
446 * src/getargs.h (debug_flag, defines_flag, locations_flag,
447 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
448 graph_flag): Likewise.
449 * src/output.c (error_verbose): Likewise.
450 * src/output.h (error_verbose): Likewise.
451 * src/reader.c (start_flag, typed): Likewise.
452 * src/reader.h (typed): Likewise.
453 * src/getargs.c (LOCATIONS_OPTION): New constant.
454 (long_options, getargs): Use it.
455 * src/lalr.c (build_relations): Use bool, not int.
456 * src/nullable.c (nullable_compute): Likewise.
457 * src/print.c (print_reductions): Likewise.
458 * src/tables.c (action_row, pack_vector): Likewise.
459 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
460 * src/output.c (prepare): Use it.
461 * src/output.c (token_definitions_output,
462 symbol_destructors_output, symbol_destructors_output): Use string,
463 not boolean integer, to keep track of whether to output separator.
464 * src/print_graph.c (print_core): Likewise.
465 * src/state.c (state_rule_lookaheads_print): Likewise.
466
467 * config/install-sh: Sync from automake 1.7.5.
468
6b2584b7
PE
4692003-05-14 Paul Eggert <eggert@twinsun.com>
470
471 * src/parse-gram.y (rules_or_grammar_declaration): Require a
472 semicolon after a grammar declaration, in the interest of possible
473 future changes to the Bison input language.
474 Do not allow a stray semicolon at the start of the grammar.
475 (rhses.1): Allow one or more semicolons after any rule, including
476 just before "|" as required by POSIX.
477 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
478 grammar.
479
caf37a36
ADL
4802003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
481
482 %parse-param support for lalr1.cc.
483
484 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
485 b4_cc_constructor_calls, b4_cc_constructor_call,
486 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
487 definitions.
488 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
489 parse-param arguments.
490 (yy::b4_parser_class_name): Declare instance variables to
491 hold parse-param arguments.
492 * tests/calc.at: s/value/semantic_value/ because value clashes
493 with a member of yy::b4_parser_class_name. Adjust C++ code
494 to handle %parse-param. Enable %parse-param test in C++.
495
3ab37077
PE
4962003-05-12 Paul Eggert <eggert@twinsun.com>
497
498 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
499 English a bit. Fix fclose typo. Change "const char" to "char
500 const", and use ANSI C rather than K&R for "main". Suggest
501 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
502 and suggest yy_switch_to_buffer.
503
5042003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
505
506 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
507 C89. This avoids a diagnostic on compilers that define __STDC__
508 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
509 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
510
e743727f
PE
5112003-05-03 Paul Eggert <eggert@twinsun.com>
512
513 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
514 Do not overrun array bounds.
515 This should fix a bug reported today by Olatunji Oluwabukunmi in
516 <http://mail.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
517
916708d5
AD
5182003-04-29 Akim Demaille <akim@epita.fr>
519
520 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
521 * src/getargs.c, src/getargs.h: here, as bool, not int.
522 (nondeterministic_parser): New.
523 * src/parse-gram.y, src/scan-gram.l: Support
524 %nondeterministic-parser.
525 * src/output.c (prepare): Use nondeterministic_parser instead
526 of glr_parser where appropriate.
527 * src/tables.c (conflict_row, action_row, save_row)
528 (token_actions, token_actions, pack_vector): Ditto.
529
a06ea4aa
AD
5302003-04-29 Akim Demaille <akim@epita.fr>
531
532 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
533
211074ca
AD
5342003-04-29 Akim Demaille <akim@epita.fr>
535
536 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
537 with %pure-parser and %locations to exercise the patch from Yakov
538 Markovitch below.
539
6175ffe3
PE
5402003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
541
542 * data/yacc.c: (b4_lex_param): Corrected for the case where
543 %lex-param is provided and %pure-parser isn't.
544
b1e95857
PE
5452003-04-27 Paul Eggert <eggert@twinsun.com>
546
547 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
548 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
549 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
550 if it is not defined.
551 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
552
acda9df6
PE
5532003-04-26 Paul Eggert <eggert@twinsun.com>
554
3470c57b
PE
555 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
556 Declare to be of type suitable for the ninf value itself, not of
557 type suitable for the corresponding table, since the latter might
558 be unsigned but the ninf value might be negative. This fixes a
559 bug reported by Alexandre Duret-Lutz in
560 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
561
acda9df6
PE
562 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
563 invokes it. We shouldn't invoke it twice because it will attempt
564 to put error.o in the archive twice. This fixes a glitch reported
565 by Martin Mokrejs in
566 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
567
b5250f26
PE
5682003-04-21 Paul Eggert <eggert@twinsun.com>
569
570 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
571 to gnulib.
572
089ac0f1
PE
5732003-04-21 Yakov Markovitch <Markovitch@iso.ru>
574
575 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
576 Fix obvious typo that results in uncompilable GLR parsers
577 when both %pure-parser and %locations are used. (trivial change)
578
5ededac6
PE
5792003-04-17 Paul Eggert <eggert@twinsun.com>
580
1b8f2fff
PE
581 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
582 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
583 Do not insert the expected token via unput, as this runs afoul
584 of a POSIX-compatibility bug in flex 2.5.31.
585 All uses changed to BEGIN the parent state,
586 since we no longer insert the expected token via unput.
587 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
588 that is no longer emitted after the above change.
589
5ededac6
PE
590 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
591 the first one. This change is from Paul Hilfinger, and it fixes
592 regression reported by Werner Lemberg in
593 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
594
595 (resolve_sr_conflict): Don't invoke state_errs_set
596 unless one or more tokens have been explicitly made errors.
597 Otherwise, the above change causes Bison to abort.
598
599 * tests/existing.at (GNU pic Grammar): New test case, taken from
600 Lemberg's email.
601
b8be9132
AD
6022003-03-31 Akim Demaille <akim@epita.fr>
603
604 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
605
d423d460
AD
6062003-03-31 Akim Demaille <akim@epita.fr>
607
608 * src/output.c (prepare_symbols): Avoid trailing spaces in the
609 output.
610
c7e441b4
AD
6112003-03-31 Akim Demaille <akim@epita.fr>
612
613 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
614 From Paul Hilfinger.
615
231897ad
AD
6162003-03-29 Akim Demaille <akim@epita.fr>
617
618 * m4/error.m4: Do not put under dynamic conditions some code which
619 expansion is under static control.
620
5b066063
AD
6212003-03-29 Akim Demaille <akim@epita.fr>
622
623 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
624
22a74fec
AD
6252003-03-29 Akim Demaille <akim@epita.fr>
626
627 * doc/bison.texinfo (Strings are Destroyed): New.
628
0eee27e7
PE
6292003-03-13 Paul Eggert <eggert@twinsun.com>
630
631 * .cvsignore: Add configure.lineno.
632 * src/.cvsignore: Add yacc.
633 * tests/.cvsignore: Add testsuite.log.
634 * doc/fdl.texi: Sync with latest FSF version.
635
f61aad93
PE
6362003-03-12 Paul Eggert <eggert@twinsun.com>
637
537636c7
PE
638 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
639 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
640 cursor, instead of leaving it undefined. This fixes a bug
641 reported by Tim Van Holder in
642 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
643 * tests/input.at (Torturing the Scanner): Test the scanner on
644 an empty input file, which was Tim Van Holder's test case.
645
646 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
647 <sys/resource.h> can be included, include sys/time.h and
648 sys/times.h first, if available. This works around the SunOS
649 4.1.4 porting bug reported by Bruce Becker in
650 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
651
652 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
653 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
654 AC_HEADER_SYS_WAIT.
655
f61aad93
PE
656 Merge changes from gnulib. This was prompted because the CVS
657 snapshot didn't build on Solaris 7 due to strnlen problems.
658
659 These changes need to be merged back into gnulib:
660 * lib/hash.c: Include <stdbool.h> unconditionally.
661 * m4/onceonly.m4 (m4_quote): New macro.
662 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
663 Quote AC_FOREACH variable-expansions properly.
664 The 2003-01-03 obstack.h change also needs merging.
665 {end of changes requiring merging}
5b066063 666
f61aad93
PE
667 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
668 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
669 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
670 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
671 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
672 New files, imported from gnulib.
673 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
674 above.
675
676 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
677 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
678 gnulib sources.
679
680 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
681 Add.
682 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
683 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
684 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
685 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
686 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
687 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
688 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
689 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
690 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
691 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
692 (jm_PREREQ_ARGMATCH): Remove.
693 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
694 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
695
696 * src/system.h: Include <stdbool.h> unconditionally.
697
698 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
699 assuming at least C89 in the bitset code for some time now.
700
d2ffe116
AD
7012003-03-03 Akim Demaille <akim@epita.fr>
702
703 * ro.po: New.
704
052826fd
AD
7052003-03-02 Akim Demaille <akim@epita.fr>
706
707 * doc/bison.texinfo (Table of Symbols): Reactivate the
708 documentation for %lex-param, and %parse-param.
709
c4749565
AD
7102003-03-02 Akim Demaille <akim@epita.fr>
711
712 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
713 generate verbose error messages.
714 Use the number of tokens as an upper bound in yytname, as it
715 cannot be a non terminal.
716
d5286af1
AD
7172003-03-02 Akim Demaille <akim@epita.fr>
718
719 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
720 message.
721
22e304a6
AD
7222003-03-02 Akim Demaille <akim@epita.fr>
723
22e304a6
AD
724 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
725 Use them to exercise yycheck overrun.
726 Based on Andrew Suffield's grammar.
727
67a25fed
AD
7282003-03-02 Akim Demaille <akim@epita.fr>
729
730 Create tests/local.at for Bison generic testing macros.
731
732 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
733 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
734 This new file.
735 * tests/calc.at (AT_CHECK_CALC): Adjust.
736 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
737 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
738 * tests/local.at: here.
739 (AT_COMPILE_CXX): Tags the tests using it as c++.
740 Ignore the test if CXX is not functional.
741
9c2b381f
PE
7422003-03-01 Paul Eggert <eggert@twinsun.com>
743
744 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
745 not loc->end, since loc->end might contain garbage and this leads
746 to undefined behavior on some platforms.
747 (id_loc, token_start): Use (IF_LINTed) initial values that do not
748 depend on *loc, so that the reader doesn't give the the false
749 impression that *loc is initialized.
750 (<INITIAL>"%%"): Do not bother setting code_start, since its value
751 does not survive the return.
752
0433ba88
AD
7532003-03-01 Akim Demaille <akim@epita.fr>
754
755 * src/scan-gram.l (code_start): Always initialize it when entering
756 into yylex, as SC_EPILOGUE is activated *before* the corresponding
757 yylex invocation. An alternative would be making it static, but
758 then it starts with the second %%'s beginning, instead of its end.
759
b305ea69
PE
7602003-02-28 Paul Eggert <eggert@twinsun.com>
761
762 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
763 around a UnixWare 7.1.1 porting bug reported by John Hughes in
764 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
765
c3d25e01
PE
7662003-02-26 Paul Eggert <eggert@twinsun.com>
767
768 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
769 Remove Sequent/Pyramid discussion (nobody uses them any more).
770 Merge VMS and MS-DOS discussion; these ports may well be dead
771 but let's keep mentioning them for now. Put <> around email
772 addresses. Add copyright notice.
773
c267ffbc
PE
7742003-02-24 Paul Eggert <eggert@twinsun.com>
775
776 * data/glr.c (yy_reduce_print): yylineno -> yylno,
777 to avoid collision with flex use of yylineno.
778 Problem reported by Bruce Lilly in
779 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
780 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
781 * data/yacc.c (yy_reduce_print): Likewise.
782
783 * config/depcomp: Sync with Automake 1.7.3.
784
f939fc12
AD
7852003-02-21 Akim Demaille <akim@epita.fr>
786
787 * data/lalr1.cc: Use temporary variables instead of casts to
788 change integer types.
789 Suggested by Paul Eggert.
790
95923bd6
AD
7912003-02-21 Akim Demaille <akim@epita.fr>
792
793 * doc/bison.texinfo: Use "location" consistently to refer to @n,
794 to avoid confusions with lalr1.cc's notion of Position.
795 Suggested by Paul Eggert.
796
2cdc240e
AD
7972003-02-20 Akim Demaille <akim@epita.fr>
798
799 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
800 before initial_columns.
801 (location.hh): Use consistent variable names when defining the
802 operator<<.
803 Use "last" so that we subtract from Positions, not from unsigned.
804
5d003116
AD
8052003-02-20 Akim Demaille <akim@epita.fr>
806
807 * data/lalr1.cc (position.hh): New subfile, including the extended
808 and Doxygen'ed documentation of class Position.
809 (location.hh): Use it.
810 Document a` la Doxygen.
ba1ecc07 811 With the help of Benoit Perrot.
5d003116 812
d02b25f9
AD
8132003-02-20 Akim Demaille <akim@epita.fr>
814
815 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
816 AT_YACC_IF.
817 Redefine AT_YYERROR_SEES_LOC_IF using it.
818 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
819 not defined.
820 Don't use the location in yy::Parser::error_ and
821 yy::Parser::print_ when not %locations.
822 Activate more lalr1.cc tests.
823
0d1c3a04
AD
8242003-02-19 Akim Demaille <akim@epita.fr>
825
826 * data/lalr1.cc: When displaying a line number, be sure to make it
827 an int.
828
60a777aa
AD
8292003-02-19 Akim Demaille <akim@epita.fr>
830
831 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
832 Remove, useless.
833 (YYABORT, YYACCEPT, YYERROR): New.
834 * tests/calc.at: Renable the lalr1.cc test.
835
0b86fc41
AD
8362003-02-19 Akim Demaille <akim@epita.fr>
837
838 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
839 error recovery, mixing with/without pops and discarding of the
840 lookahead.
841 Exercise YYERROR.
842 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
843
da99a5dc
PE
8442003-02-17 Paul Eggert <eggert@twinsun.com>
845
846 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
847 * tests/testsuite.at (AT_COMPILE): Use them.
848 This fixes the testsuite problem reported by Robert Lentz in
849 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
850
93b8c255
PE
8512003-02-12 Paul Eggert <eggert@twinsun.com>
852
853 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
854 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
855 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
856 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
857 Check for malloc failure, for consistency with yacc.c.
858 (yytname_size): Remove, for consistency with yacc.c.
859
860 The bug still remains in data/lalr1.cc, as I didn't have time
861 to fix it there.
862
7548fed2
AD
8632003-02-06 Akim Demaille <akim@epita.fr>
864
865 * configure.ac (GXX): Rename as...
866 (CXX): this, to keep the original Autoconf semantics.
867 Require 2.57.
868 * data/lalr1.cc: Fix b4_copyright invocations.
869 If YYDEBUG is not defined, don't depend upon name_ being defined.
870 (location.hh): Include string and iostream.
871 (Position::filename): New member.
872 (Position::Position ()): New.
873 (operator<< (Position)): New.
874 (operator- (Position, int)): New.
875 (Location::first, Location::last): Rename as...
876 (Location::begin, Location::end): these, to mock the conventional
877 iterator names.
878 (operator<< (Location)): New.
879 * tests/atlocal.in (CXX): New.
880 * tests/testsuite.at (AT_COMPILE_CXX): New.
881 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
882 locations in a more synthetic way.
883 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
884 lalr1.cc is used.
885 Adjust the C locations to match those from Emacs: first column is
886 column 0.
887 Change all the expected results.
888 Conform to the GCS: simplify the locations when applicable.
889 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
890 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
891 these CPP macros with the m4 macros new defined by...
892 (AT_CHECK_PUSHDEFS): this, i.e.:
893 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 894 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
895 New macros.
896 (AT_CHECK_POPDEFS): Undefine them.
897 (AT_CHECK_CALC_LALR1_CC): New.
898 Use it for the first lalr1.cc test.
899
43a176ef
AD
9002003-02-04 Akim Demaille <akim@epita.fr>
901
902 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
903 Location as is defined.
904
fc049e9c
AD
9052003-02-04 Akim Demaille <akim@epita.fr>
906
907 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
908 name_ being defined.
909
a737b216
PE
9102003-02-03 Paul Eggert <eggert@twinsun.com>
911
912 * src/gram.h (start_symbol): Remove unused decl.
913
914 Use more-consistent naming conventions for local vars.
915
916 * src/derives.c (derives_compute): Change type of local var from
917 int to rule_number.
918 * src/gram.c (grammar_rules_partial_print): Likewise.
919 * src/print.c (print_core): Likewise.
920 * src/reduce.c (reduce_grammar_tables): Likewise.
921
922 * src/gram.c (grammar_dump): Change name of item_number *
923 local var from r to rp.
924 * src/nullable.c (nullable_compute): Likewise.
925
926 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
927
928 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
929 for symbol or symbol_number var.
930 * src/reader.c (grammar_start_symbol_set): Likewise.
931 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
932 Likewise.
933 * src/state.c (transitions_to): Likewise.
934 * src/state.h: Likewise.
935 * src/tables.c (symbol_number_to_vector_number): Likewise.
936
937 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
938 char * var.
939
940 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
941 var.
942
943 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
944 var.
945
946 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
947 Use str, not s, for char * var. Use ch, not c, for character var.
948 Use size for size var.
949
950 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
951 char * var.
952 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
953 uniqstr var.
954 * src/uniqstr.h: Likewise.
955
956 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
957 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
958 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
959 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
960 param to have same name as that of enum, so that we don't use
961 "s" to stand for a non-state.
962
68e93ad5
AD
9632003-02-02 Akim Demaille <akim@epita.fr>
964
965 * src/scan-skel.l: Scan more than one inert character per yylex
966 invocation.
967
92898986
PE
9682003-02-01 Paul Eggert <eggert@twinsun.com>
969
970 Version 1.875a.
971
1d9d5d71
PE
972 * po/LINGUAS: Add ms.
973
0435d061
AD
9742003-01-30 Akim Demaille <akim@epita.fr>
975
976 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
977
6029a57f
PH
9782003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
979
980 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
981 of $1.
0435d061
AD
982
983 Changes in response to error report by S. Eken: GLR mode does not
6029a57f
PH
984 handle negative $ indices or $ indices in embedded rules correctly.
985 See <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 986
6029a57f
PH
987 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
988 (b4_rhs_location): Ditto.
0435d061 989 (yyfill): New function to copy from stack tree into array
6029a57f 990 incrementally.
0435d061
AD
991 (yyuserAction): Modify to allow incremental move of semantic values
992 to rhs array when in GLR mode.
993 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
994 as needed.
995 Remove dummy use of yystack, as there is now a guaranteed use.
996 (yydoAction): Modify to allow incremental move of semantic values
997 to rhs array when in GLR mode.
998 (yyresolveAction): Ditto.
999 (yyglrShiftDefer): Update comment.
0435d061 1000 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
1001 (yyglrReduce): Ditto.
1002 (yydoAction): Ditto
0435d061 1003
6029a57f
PH
1004 * tests/glr-regr1.at: Rename to ...
1005 * tests/glr-regression.at: Add new regression test for the problems
1006 described above (adapted from S. Eken).
1007 Update copyright notice.
1008 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
1009 * tests/Makefile.am: Ditto.
1010
6cee6297
PE
10112003-01-28 Paul Eggert <eggert@twinsun.com>
1012
1013 * data/lalr1.cc: Do not use @output_header_name@ unless
1014 b4_defines_flag is set. This fixes two bugs reported by
1015 Tim Van Holder in
1016 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
1017 and <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
1018
b2a836b5
PE
10192003-01-21 Paul Eggert <eggert@twinsun.com>
1020
1021 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
1022 we don't need to worry about yyerrlab1 being reported as an
1023 "unused label" by non-GCC C compilers. The downside is that if
1024 locations are used then a couple of statements are duplicated each
1025 time YYERROR is invoked, but the upside is that the warnings
1026 should vanish.
1027 (yyerrlab1): Move code to YERROR.
1028 (yyerrlab2): Remove. Change uses back to yyerrlab1.
1029 This reverts some of the 2002-12-27 change.
1030
4196b931
PE
10312003-01-17 Paul Eggert <eggert@twinsun.com>
1032
1033 * src/output.c (symbol_printers_output): Fix typo that led
1034 to core dump. Problem reported by Antonio Rus in
1035 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
1036
3ae831b4
AD
10372003-01-13 Akim Demaille <akim@epita.fr>,
1038 Quoc Peyrot <chojin@lrde.epita.fr>,
1039 Robert Anisko <anisko_r@lrde.epita.fr>
1040
1041 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
1042 when the stacks contain one element, as the loop would otherwise
1043 free the last state, and then use the top state (the one we just
1044 popped). This means that the initial elements will not be freed
1045 explicitly, as is the case in yacc.c; it is not a problem, as
1046 these elements have fake values.
1047
e3aa65c5
PE
10482003-01-11 Paul Eggert <eggert@twinsun.com>
1049
1050 * NEWS: %expect-violations are now just warnings, reverting
1051 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
1052 bootstrapping problem reported by Matthias Klose; see
1053 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
1054 * src/conflicts.c (conflicts_print): Likewise.
1055 * tests/conflicts.at (%expect not enough, %expect too much,
1056 %expect with reduce conflicts): Likewise.
1057 * doc/bison.texinfo (Expect Decl): Document this. Also mention
1058 that the warning is enabled if the number of conflicts changes
1059 (not necessarily increases).
1060
1061 * src/getargs.c (version): Update copyright year.
1062
f0057011
AD
10632003-01-09 Akim Demaille <akim@epita.fr>
1064
1065 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
1066
1ee6d2a0
PE
10672003-01-08 Paul Eggert <eggert@twinsun.com>
1068
1069 * Makefile.maint (WGETFLAGS):
1070 New macro, containing "-C off" to disable proxy caches.
1071 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
1072 (rel-check): Use $(WGET) instead of wget.
1073
d4fd77c4
PE
10742003-01-06 Paul Eggert <eggert@twinsun.com>
1075
1076 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
1077 the GLR paper of Scott, Johnstone and Hussain.
1078
464c6927
PE
10792003-01-04 Paul Eggert <eggert@twinsun.com>
1080
d600ee67
PE
1081 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
1082 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
1083 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
1084 (EXTRA_LIBRARIES): New var, for liby.a.
1085 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
1086 (EXTRA_SCRIPTS): New var, for yacc.
1087
464c6927
PE
1088 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
1089 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
1090 Problem reported by Nelson H. F. Beebe.
1091
10922003-01-03 Paul Eggert <eggert@twinsun.com>
1093
1094 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
1095 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
1096 when compiling Bison 1.875's `bitset bset = obstack_alloc
1097 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
1098
1099 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
1100 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
1101 grow to a huge size with typical invocation.
d600ee67 1102
464c6927
PE
1103 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
1104 Use the pattern recommended by Autoconf 2.57, except also protect
1105 against double-definition.
1106 * src/system.h: Likewise.
1107 Portability issues reported by Nelson H. F. Beebe.
d600ee67 1108
464c6927
PE
1109 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
1110 All uses changed. Provide a definition in both C and C++.
1111 (yytrue, yyfalse): Define even if defined (__cplusplus).
1112
1113 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
1114 Reported by Nelson H. F. Beebe.
d600ee67 1115
464c6927
PE
1116 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
1117
0f42c7d5
PE
11182003-01-02 Paul Eggert <eggert@twinsun.com>
1119
1120 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
1121 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
1122 Bug reported by Nelson H. F. Beebe.
1123
dc546b0f
PE
11242003-01-01 Paul Eggert <eggert@twinsun.com>
1125
1126 * Version 1.875.
1127
2c09b6a7
PE
11282002-12-30 Paul Eggert <eggert@twinsun.com>
1129
1130 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
1131 Moved here from...
1132 (<INITIAL>","): Here. This causes stray "," to be treated
1133 more uniformly.
1134
dc546b0f 1135 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
1136 last brace in braced code when not in Yacc mode, for compatibility
1137 with Bison 1.35. This resurrects the 2001-12-15 patch to
1138 src/reader.c.
1139
1140 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
1141 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
1142
535c0f63
PE
11432002-12-28 Paul Eggert <eggert@twinsun.com>
1144
1145 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
1146 that of SYM's type. This fixes Debian bug 168069, reported by
1147 Thomas Olsson.
d600ee67 1148
963fcc17
PE
11492002-12-28 Paul Eggert <eggert@twinsun.com>
1150
1151 Version 1.75f.
1152
1153 Switch back to the Yacc style of conflict reports, undoing some
1154 of the 2002-07-30 change.
1155 * doc/bison.texinfo (Understanding): Use Yacc style for
1156 conflict reports. Also, use new way of locating rules.
1157 * src/conflicts.c (conflict_report):
1158 Renamed from conflict_report_yacc, removing the old
1159 'conflict_report'. Translate the entire conflict report at once,
1160 so that we don't assume that "," has the same interpretation in
1161 all languages.
1162 (conflicts_output): Use Yacc-style conflict report for each state,
1163 instead of our more-complicated style.
1164 (conflicts_print): Use Yacc-style conflict report, except print
1165 the input file name when not emulating Yacc.
1166 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
1167 Conflicted Reduction, %expect not enough, %expect too much,
1168 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
1169 * tests/existing.at (GNU Cim Grammar): Likewise.
1170 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
1171
1172 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
1173 fatal): Don't invoke fflush; it's not needed and it might even be
1174 harmful for stdout, as stdout might not be open.
1175 * src/reduce.c (reduce_print): Likewise.
1176
b1efe548
PE
11772002-12-27 Paul Eggert <eggert@twinsun.com>
1178
1179 Fix a bug where error locations were not being recorded correctly.
1180 This problem was originally reported by Paul Hilfinger in
e3aa65c5 1181 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
1182
1183 * data/yacc.c (yyparse): New local var yylerrsp, to record the
1184 top of the location stack's error locations.
1185 (yyerrlab): Set it. When discarding a token, push its location
1186 onto yylerrsp so that we don't lose track of the error's end.
1187 (yyerrlab1): Now is only the target of YYERROR, so that we can
1188 properly record the location of the action that failed. For GCC
1189 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
1190 GCC warning about yyerrlab1 being unused if YYERROR is unused.
1191 (yyerrlab2): New label, which yyerrlab now falls through to.
1192 Compute the error's location by applying YYLLOC_DEFAULT to
1193 the locations of all the symbols that went into the error.
1194 * doc/bison.texinfo (Location Default Action): Mention that
1195 YYLLOC_DEFAULT is also invoked for syntax errors.
1196 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
1197 Error locations include the locations of all the tokens that were
1198 discarded, not just the last token.
d600ee67 1199
983c5c2c
PE
12002002-12-26 Paul Eggert <eggert@twinsun.com>
1201
b1efe548
PE
1202 * src/files.c: Include quote.h.
1203 (compute_output_file_names): Warn if we detect conflicting
1204 outputs to the same file. This should catch the misunderstanding
1205 exemplified by Debian Bug 165349, reported by Bruce Stephens..
1206
1207 * src/conflicts.c (conflicts_print): If the user specifies
1208 "%expect N", report an error if there are any reduce/reduce
1209 conflicts. This is what the manual says should happen.
1210 This fixes Debian bug 130890, reported by Anthony DeRobertis.
1211 * tests/conflicts.at (%expect with reduce conflicts): New test.
1212
983c5c2c
PE
1213 Don't use m4_include on relative file names, as it doesn't work as
1214 desired if there happens to be a file with that name under ".".
d600ee67 1215
983c5c2c
PE
1216 * m4sugar/version.m4: Remove; it was included but it wasn't used.
1217 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
1218 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
1219 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
1220 * src/output.c (output_skeleton): Use full path names when
1221 specifying a file to include; don't rely on include path, as
1222 it's unreliable when the working file contains a file with
1223 that name.
d600ee67 1224
983c5c2c
PE
12252002-12-25 Paul Eggert <eggert@twinsun.com>
1226
1227 Remove obsolete references to bison.simple and bison.hairy.
1228 Problem mentioned by Aubin Mahe in
e3aa65c5 1229 <http://mail.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
1230 * data/glr.c: Comment fix.
1231 * doc/bison.1: Remove references. Also, mention "yacc".
1232
1233 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
1234 with -g option.
1235
1236 * src/parse-gram.y (declaration): Use enum "report_states" rather
1237 than its numeric value 1.
1238
1239 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
1240 opening a new one. This fixes Debian bug 165349, reported by
1241 Bruce Stephens.
1242
23f2d9dc
PE
12432002-12-24 Paul Eggert <eggert@twinsun.com>
1244
1245 Version 1.75e.
1246
1247 * Makefile.maint (cvs-update): Don't assume that the shell
1248 supports $(...), as Solaris sh doesn't.
1249
1250 * src/parse-gram.y (lloc_default): Remove test for empty
1251 nonterminals at the end, since it didn't change the result.
1252
12532002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
1254
1255 If the user does not define YYSTYPE as a macro, Bison now declares it
1256 using typedef instead of defining it as a macro. POSIX requires this.
1257 For consistency, YYLTYPE is also declared instead of defined.
1258
1259 %union directives can now have a tag before the `{', e.g., the
1260 directive `%union foo {...}' now generates the C code
1261 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
1262 The default union tag is `YYSTYPE', for compatibility with Solaris 9
1263 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
1264 instead of `yyltype'.
1265
1266 `yystype' and `yyltype' are now obsolescent macros instead of being
1267 typedefs or tags; they are no longer documented and will be
1268 withdrawn in a future release.
1269
1270 * data/glr.c (b4_location_type): Remove.
1271 (YYSTYPE): Renamed from yystype.
1272 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
1273 (struct YYLTYPE): Renamed from struct yyltype.
1274 (YYLTYPE): Renamed from yyltype.
1275 (yyltype, yystype): New (and obsolescent) macros,
1276 for backward compatibility.
1277 * data/yacc.c: Likewise.
1278
1279 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
1280 does not specify a union tag. This is for compatibility with
1281 Solaris 9 yacc.
1282
1283 * src/parse-gram.y (add_param): 2nd arg is now char * not char
1284 const *, since it is now modified by stripping surrounding { }.
1285 (current_braced_code): Remove.
1286 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
1287 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
1288 trailing " {...}". Now of type <chars>.
1289 (grammar_declaration): Adjust to bundled tokens.
1290 (code_content): Remove; stripping is now done by add_param.
1291 (print_token_value): Print contents of bundled tokens.
1292 (token_name): New function.
1293
1294 * src/reader.h (braced_code, current_braced_code): Remove.
1295 (token_name): New decl.
1296
1297 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
1298 token_type, not braced_code code_kind. All uses changed.
1299 (SC_PRE_CODE): New state, for scanning after a keyword that
1300 has (or usually has) an immediately-following braced code.
1301 (token_type): New local var, to keep track of which token type
1302 to return when scanning braced code.
1303 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 1304 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
1305 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
1306 instead of returning a token type immediately.
1307 (<INITIAL>"{"): Set token type.
1308 (<SC_BRACED_CODE>"}"): Use it.
1309 (handle_action_dollar, handle_action_at): Now returns bool
1310 indicating success. Fail if ! current_rule; this prevents a core dump.
1311 (handle_symbol_code_dollar, handle_symbol_code_at):
1312 Remove; merge body into caller.
1313 (handle_dollar, handle_at): Complain in invalid contexts.
1314
1315 * NEWS, doc/bison.texinfo: Document the above.
1316 * NEWS: Fix years and program names in copyright notice.
1317
879ca4f8
PE
13182002-12-17 Paul Eggert <eggert@twinsun.com>
1319
1320 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
1321 Reporting, Table of Symbols): Omit mentions of %lex-param and
1322 %parse-param from the documentation for now.
1323
1c5fe69d
PE
13242002-12-15 Paul Eggert <eggert@twinsun.com>
1325
1326 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
1327 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
1328 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
1329 disagreed with the Bison documentation. Bug
1330 reported by Andrew Walrond.
d600ee67 1331
1c5fe69d
PE
1332 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
1333 as the caller now does that.
1334 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
1335 (YYEMPTY): Parenthesize right hand side, since others use it.
1336 (yyparse): Don't assume that our generated code is the only code
1337 that sets yychar.
1338
d1de5372
PE
13392002-12-13 Paul Eggert <eggert@twinsun.com>
1340
1341 Version 1.75d.
1342
1343 POSIX requires a "yacc" command.
1344 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
1345 (MOSTLYCLEANFILES): Add yacc.
1346 (yacc): New rule.
1c5fe69d 1347 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
1348 as an alias for bison y.
1349
1350 * po/LINGUAS: Add da.
d600ee67 1351
d1de5372
PE
1352 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
1353 problem with latest <getopt.h>.
1354 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
1355
1356 * doc/fdl.texi: Upgrade to 1.2.
1357 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
1358 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
1359 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
1360 gnulib.
1361 * config/install-sh: Sync with autotools.
1362
1363 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
e3aa65c5 1364 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
1365 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
1366 locations are requested.
1367 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
1368 locations are requested.
1369
d0f3fe23
PE
13702002-12-12 Paul Eggert <eggert@twinsun.com>
1371
1372 Remove unportable casts and storage allocation tricks.
1373 While we're at it, remove almost all casts, since they
1374 usually aren't needed and are a sign of trouble.
1375
1376 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
1377
1378 * src/derives.c (derives_compute): Do not subtract NTOKENS from
1379 the pointer DSET returned by malloc; this isn't portable.
1380 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
1381 Similarly for DERIVES.
1382 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
1383 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
1384 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
1385
1386 * src/derives.c (derives_compute): Do not bother invoking
1387 int_of_rule_number, since rule numbers are integers.
1388
1389 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
1390 rather than XMALLOC (char, N).
1391
1392 * src/files.c (filename_split): Rewrite to avoid cast.
1393
1394 * src/gram.h (symbol_number_as_item_number,
1395 item_number_as_symbol_number, rule_number_as_item_number,
1396 item_number_as_rule_number):
1397 Now inline functions rather than macros, to avoid casts.
1398 * src/state.h (state_number_as_int): Likewise.
1399 * src/tables.c (state_number_to_vector_number,
1400 symbol_number_to_vector_number): Likewise.
1401
1402 * src/gram.h (int_of_rule_number): Remove; no longer used.
1403
1404 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
1405 since the resulting storage is always stored into.
1406
1407 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
1408 where it's needed.
1409
1410 * src/muscle_tab.c (muscle_m4_output):
1411 Now inline. Return bool, not int.
1412 * src/state.c (state_compare): Likewise.
1413 * src/symtab.c (symbol_check_defined,
1414 symbol_check_alias_consistency, symbol_pack, symbol_translation,
1415 hash_compare_symbol, hash_symbol):
1416 Likewise.
1417 * src/uniqstr.c (uniqstr_print): Likewise.
1418 * src/muscle_tab.c (muscle_m4_output_processor):
1419 New function, to avoid casts.
1420 * src/state.c (state_comparator, stage_hasher): Likewise.
1421 * src/symtab.c (symbol_check_defined_processor,
1422 symbol_check_alias_consistency_processor, symbol_pack_processor,
1423 symbol_translation_processor, hash_symbol_comparator,
1424 hash_symbol_hasher): Likewise.
1425 * src/uniqstr.c (uniqstr_print_processor): Likewise.
1426 * src/muscle_tab.c (muscles_m4_output):
1427 Use new functions instead of casting old functions unportably.
1428 * src/state.c (state_hash_new): Likewise.
1429 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
1430 symbols_token_translations_init):
1431 Likewise.
1432 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
1433
1434 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
1435 var instead of casting to long, to avoid casts.
1436 (prepare_states): Use MALLOC rather than alloca, so that we don't
1437 have to worry about alloca.
1438 * src/state.c (state_hash_lookup): Likewise.
1439
1440 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
1441 local var instead of casting to unsigned char, to avoid casts.
1442
1443 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
1444 STATE_ALLOC): Remove.
1445 (transitions_new, errs_new, reductions_new, state_new): Use malloc
1446 rather than calloc, and use offsetof to avoid allocating slightly
1447 too much storage.
1448 (state_new): Initialize all members.
1449
1450 * src/state.c (state_hash): Use unsigned accumulator, not signed.
1451
1452 * src/symtab.c (symbol_free): Remove; unused.
1453 (symbol_get): Remove cast in lhs of assignment.
1454 (symbols_do): Now static. Accept generic arguments, not
1455 hashing-related ones.
1456
1457 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
1458 (symbol_processor): Remove.
1459 (symbols_do): Remove decl; now static.
1460
1461 * src/system.h (alloca): Remove; decl no longer needed.
1462 (<stddef.h>): Include, for offsetof.
1463 (<inttypes.>, <stdint.h>): Include if available.
1464 (uintptr_t): New type, if system lacks it.
1465 (CALLOC, MALLOC, REALLOC): New macros.
1466 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
1467 new macros.
1468
1469 * src/tables.c (table_size): Now int, to pacify GCC.
1470 (table_grow, table_ninf_remap): Use signed table size.
1471 (save_row): Don't bother initializing locals when not needed.
1472 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
1473 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
1474
1475 * src/vcg.h: Correct misspellings.
1476
1477 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
1478
1479
1480 * src/getargs.c (getargs): Don't assume EOF == -1.
1481
26b4a969
PE
14822002-12-09 Paul Eggert <eggert@twinsun.com>
1483
1484 Change identifier spellings to avoid collisions with names
1485 that are reserved by POSIX.
1486
1487 Don't use names ending in _t, since POSIX reserves them.
1488 For consistency, remove _e and _s endings -- they're weren't
1489 needed to remove ambiguity. All uses changed.
1490 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
1491 turn was just renamed from struniq_t.
1492 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
1493 which in turn was just renamed from struniq_processor_t.
1494 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
1495 in turn was renamed from hash_compare_struniq_t.
1496 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
1497 (state_list): Renamed from state_list_t.
1498 * src/assoc.h (assoc): Renamed from assoc_t.
1499 * src/conflicts.c (enum conflict_resolution): Renamed from
1500 enum conflict_resolution_e.
1501 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
1502 (rule_list): Renamed from rule_list_t.
1503 * src/getargs.h (enum trace): Renamed from enum trace_e.
1504 (enum report): Renamed from enum report_e.
1505 * src/gram.h (item_number): Renamed from item_number_t.
1506 (rule_number): Renamed from rule_number_t.
1507 (struct rule_s): Remove the "rule_s" part; not used.
1508 (rule): Renamed from rule_t.
1509 (rule_filter): Renamed from rule_filter_t.
1510 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
1511 (goto_list): Renamed from goto_list_t.
1512 * src/lalr.h (goto_number): Renamed from goto_number_t.
1513 * src/location.h (location): Renamed from location_t.
1514 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
1515 and moved here from:
1516 * src/muscle_tab.h (muscle_entry_t): here.
1517 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
1518 (rule_list): Renamed from rule_list_t.
1519 * src/print_graph.c (static_graph): Renamed from graph.
1520 * src/reader.h (braced_code): Renamed from braced_code_t.
1521 Remove brace_code_e tag.
1522 * src/relation.h (relation_node): Renamed from relation_node_t.
1523 (relation_nodes): Renamed from relation_nodes_t.
1524 (relation): Renamed from relation_t.
1525 * src/state.h (state_number): Renamed from state_number_t.
1526 (struct state): Renamed from struct state_s.
1527 (state): Renamed from state_t.
1528 (transitions): Renamed from transitions_t. Unused (and
1529 misspelled) transtion_s tag removed.
1530 (errs): Renamed from errs_t. Unused errs_s tag removed.
1531 (reductions): Renamed from reductions_t. Unused tag
1532 reductions_s removed.
1533 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
1534 (struct symbol_list): Renamed from struct symbol_list_s.
1535 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
1536 (struct symbol): Renamed from struct symbol_s.
1537 (symbol): Renamed from symbol_t.
1538 * src/tables.c (vector_number): Renamed from vector_number_t.
1539 (action_number): Renamed from action_t.
1540 * src/tables.h (base_number): Renamed from base_t.
1541 * src/vcg.h (enum color): Renamed from enum color_e.
1542 (enum textmode): Renamed from enum textmode_e.
1543 (enum shape): Renamed from enum shape_e.
1544 (struct colorentry): Renamed from struct colorentry_s.
1545 (struct classname): Renamed from struct classname_s.
1546 (struct infoname): Renamed from struct infoname_s.
1547 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
1548 (enum decision): Renamed from enum decision_e.
1549 (enum orientation): Renamed from enum orientation_e.
1550 (enum alignment): Renamed from enum alignment_e.
1551 (enum arrow_mode): Renamed from enum arrow_mode_e.
1552 (enum crossing_type): Renamed from enum crossing_type_e.
1553 (enum view): Renamed from enum view_e.
1554 (struct node): Renamed from struct node_s.
1555 (node): Renamed from node_t.
1556 (enum linestyle): Renamed from enum linestyle_e.
1557 (enum arrowstyle): Renamed from enum arrowstyle_e.
1558 (struct edge): Renamed from struct edge.
1559 (edge): Renamed from edge_t.
1560 (struct graph): Renamed from struct graph_s.
1561 (graph): Renamed from graph_t.
1562 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
1563 Rename value_t -> value.
1564 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
1565 value_t_as_yystype -> value_as_yystype.
1566
1567 Don't include <errno.h> in the mainstream code, since it
1568 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
1569 * lib/get-errno.c, lib/get-errno.h: New files.
1570 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
1571 get-errno.c.
1572 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
1573 * src/output.c (output_skeleton): Likewise.
1574 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
1575 instead of errno.
1576 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
1577 Likewise.
1578 (handle_action_dollar, handle_action_at): Likewise.
1579 * src/system.h: Do not include <errno.h>.
1580 (TAB_EXT): Renamed from EXT_TAB.
1581 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
1582
1583 Avoid str[a-z]*, since <string.h> reserves that name space.
1584 Change all instances of "struniq" in names to "uniqstr", and
1585 likewise for "STRUNIQ" and "UNIQSTR".
1586 * src/uniqstr.c: Renamed from src/struniq.c.
1587 * src/uniqstr.h: Renamed from src/struniq.h.
1588 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
1589 * src/files.c (strsuffix): Remove; unused.
1590 (concat2): Renamed from stringappend. Now static.
1591 * src/files.h (strsuffix, stringappend): Remove; unused.
1592 * src/parse-gram.y (<chars>): Renamed from <string>.
1593 (<uniqstr>): Renamed from <struniq>.
1594 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
1595 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
1596 (struct graph_s.expand): Renamed from struct graph_s.stretch.
1597 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
1598 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
1599 (N_EXPAND): Renamed from N_STRETCH.
1600
1601 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
1602 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
1603 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
1604 Remove; unused.
1605 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
1606 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
1607 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
1608 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
1609 (BASE_MAXIMUM): Renamed from BASE_MAX.
1610 (BASE_MINIMUM): Renamed from BASE_MIN.
1611 (ACTION_MAX): Remove; unused.
1612 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
1613 Unnecessary casts removed from above defines.
1614
1615
1616 Fix misspelling in names.
1617 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
1618 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
1619 G_NODE_ALIGNEMENT.
1620
1621
1622 * lib/timevar.c (timevar_report): Renamed from time_report,
1623 for consistency with other names.
1624 * lib/timevar.h (timevar_report): New decl.
1625 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
1626
1627
1628 Sort include-file uses.
1629
1630 Reorder all include files under src to be in the order "system.h".
1631 then the ../lib include files in angle brackets (alphabetized),
1632 then the . include files in double-quotes (alphabetized). Fix
1633 dependency breakages encountered in this process, as follows:
1634 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
1635 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
1636 * src/state.h: Include "symtab.h".
1637
996b1c7e
PE
16382002-12-08 Paul Eggert <eggert@twinsun.com>
1639
1640 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
1641 since this causes problems when __file__ contains character
1642 sequences like "@" that are treated specially by src/scan-skel.l.
1643 Instead, just use the file's basename. This fixes the bug
1644 reported by Martin Mokrejs in
e3aa65c5 1645 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 1646
e19c4e5d
PE
16472002-12-06 Paul Eggert <eggert@twinsun.com>
1648
1649 Add support for rules that do not have trailing semicolons, as
1650 POSIX requires. Improve the quality of locations in Bison
1651 diagnostics.
26b4a969 1652
e19c4e5d
PE
1653 * src/location.c: Include <quotearg.h>.
1654 (empty_location): Now const.
1655 (location_print): New function. Follow the recommendation of the
1656 GNU Coding Standards for locations that span file boundaries.
1657 * src/location.h: Do not include <quotearg.h>; no longer needed.
1658 (boundary): New type.
1659 (location_t): Use it. This allows locations to span file boundaries.
1660 All member uses changed: file -> start.file or end.file (as needed),
1661 first_line -> start.line, first_column -> start.column,
1662 last_line -> end.line, last_column -> end.column.
1663 (equal_boundaries): New function.
1664 (LOCATION_RESET, LOCATION_STEP): Remove.
1665 (LOCATION_PRINT): Remove. All callers changed to use location_print.
1666 (empty_location): Now const.
1667 (location_print): New decl.
1668 * src/parse-gram.y (lloc_default): New function, which handles
1669 empty locations more accurately.
1670 (YYLLOC_DEFAULT): Use it.
1671 (%token COLON): Remove.
1672 (%token ID_COLON): New token.
26b4a969 1673 (rules): Use it.
e19c4e5d
PE
1674 (declarations, rules): Remove trailing semicolon.
1675 (declaration, rules_or_grammar_declaration):
1676 Allow empty (";") declaration.
1677 (symbol_def): Remove empty actions; no longer needed.
1678 (rules_or_grammar_declaration): Remove trailing semicolon.
1679 (semi_colon.opt): Remove.
1680 * src/reader.h: Include location.h.
1681 (scanner_cursor): New decl.
1682 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
1683 rolling our own.
1684 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
1685 of *loc.
1686 (STEP): Remove. No longer needed, now that adjust_location does
1687 the work. All uses removed.
1688 (scanner_cursor): New var.
1689 (adjust_location): Renamed from extend_location. It now sets
1690 *loc and adjusts the scanner cursor. All uses changed.
1691 Don't bother testing for CR.
1692 (handle_syncline): Remove location arg; now updates scanner cursor.
1693 All callers changed.
1694 (unexpected_end_of_file): Now accepts start boundary of token or
1695 comment, not location. All callers changed. Update scanner cursor,
1696 not the location.
1697 (SC_AFTER_IDENTIFIER): New state.
1698 (context_state): Renamed from c_context. All uses changed.
1699 (id_loc, code_start, token_start): New local vars.
1700 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
1701 processing of Yacc white space and equivalents here.
1702 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
1703 instead of returning ID immediately, since we need to search for
1704 a subsequent colon.
1705 (<INITIAL>"'", "\""): Save token_start.
1706 (<INITIAL>"%{", "{", "%%"): Save code_start.
1707 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
1708 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
1709 BEGIN context_state at end, not INITIAL.
1710 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
1711 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
1712 Return correct token start.
1713 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
1714 the start of a character, string or multiline comment is found.
1715 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
1716 Reduction): Adjust reported locations to match the more-precise
1717 results now expected.
1718 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
1719 * tests/reduce.at (Useless Rules, Reduced Automaton,
1720 Underivable Rules): Likewise.
1721 * tests/regression.at (Invalid inputs): No longer `expecting ";"
1722 or "|"' now that so many other tokens are allowed by the new grammar.
1723
1724 * src/complain.h (current_file): Remove duplicate decl;
1725 current_file is now owned by files.h.
1726 * src/complain.c, src/scan-gram.l: Include files.h.
1727
17282002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 1729
e19c4e5d
PE
1730 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
1731 promotes to int; it might be unsigned int.
1732 * data/yacc.c (yy_reduce_print): Likewise.
1733
1734 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
1735 be #defined in the prologue, not in the Bison declarations.
1736 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 1737
b64755e3
PE
17382002-12-02 Paul Eggert <eggert@twinsun.com>
1739
1740 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
1741 * lib/strtoul.c: New file, from gnulib.
1742 This fixes a porting bug reported by Peter Klein in
e3aa65c5 1743 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 1744
6e746484
PE
17452002-11-30 Paul Eggert <eggert@twinsun.com>
1746
b64755e3
PE
1747 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
1748 and put only a forward declaration in the prologue. This is for
1749 consistency with the other scanner helper functions.
1750
6ba55592
PE
1751 Type clashes now generate warnings, not errors, since it
1752 appears that POSIX may allow some grammars with type clashes.
1753 * src/reader.c (grammar_current_rule_check): Warn about
1754 type clashes instead of complaining.
1755 * tests/input.at (Type Clashes): Expect warnings, not complaints.
1756
6e746484
PE
1757 Add Yacc library, since POSIX requires it.
1758 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
1759 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
1760 * lib/main.c, lib/yyerror.c: New files.
1761
1762 gram_error can be static; it need not be extern.
1763 * src/reader.h (gram_error): Remove decl.
1764 * src/parse-gram.y (gram_error): Now static. Add static decl.
1765 (print_token_value): Omit parameter names from forward decl,
1766 for consistency.
1767
88510f9c
PE
17682002-11-29 Paul Eggert <eggert@twinsun.com>
1769
6e746484
PE
1770 * doc/bison.texinfo: Emphasize that yylex and yyerror must
1771 be declared before being used. E.g., one should typically
1772 declare them in the prologue. Use GNU coding style in examples.
1773 Put "const" consistently after the type it modifies. Mention
1774 that C99 supports "inline". Mention that yyerror traditionally
1775 returns "int".
1776
88510f9c
PE
1777 %parse-param and %lex-param now take just one argument, the
1778 declaration; the argument name is deduced from the declaration.
1779
1780 * doc/bison.texinfo (Parser Function, Pure Calling, Error
1781 Reporting, Table of Symbols): Document this.
1782 * src/parse-gram.y (add_param): New function.
1783 (COMMA): Remove.
1784 (declaration): Implement new rule for %parse-param and %lex-param.
1785 * src/scan-gram.l: "," now elicits a warning, rather than being
1786 a token; this is more compatible with byacc.
1787 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
1788
bb92250c
PE
17892002-11-27 Paul Eggert <eggert@twinsun.com>
1790
1791 Rename identifiers to avoid real and potential collisions.
1792
1793 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
1794 to avoid collision with lex macro described by Bruce Lilly in
e3aa65c5 1795 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
1796 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
1797 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
1798 * src/parse-gram.y (print_token_value): Renamed from yyprint.
1799 All uses changed.
1800 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
1801 The name "yycontrol" violates the name space rules, and this stuff
1802 wasn't being used anyway.
1803 (input): Remove action; this stuff wasn't being used.
1804 (gram_error): Rename local variable yylloc -> loc.
1805 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
1806 (YY_DECL): Don't use "yy" at start of local variables.
1807 All uses changed, e.g., yylloc -> loc.
1808 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
1809 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
1810 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
1811 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
1812
1813 * src/parse-gram.y (gram_error): loc is now const *.
1814 * src/reader.h (gram_error): Likewise.
1815
3af4feb2
PE
18162002-11-24 Paul Eggert <eggert@twinsun.com>
1817
1818 Version 1.75c.
1819
1820 * tests/actions.at (Actions after errors): Use an output format
1821 more similar to that of the Printers and Destructors test.
1822 Test the position of the ';' token too.
1823 (Printers and Destructors): Likewise.
1824 (Printers and Destructors: %glr-parser): Remove for now, to avoid
1825 unnecessarily alarming people when the test fails.
1826
1827 * data/yacc.c (yyerrlab1): Move this label down, so that the
1828 parser does not discard the lookahead token if the user code
1829 invokes YYERROR. This change is required for POSIX conformance.
1830
1831 * lib/error.c: Sync with gnulib.
1832
18332002-11-22 Paul Eggert <eggert@twinsun.com>
1834
1835 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
1836 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
1837 * lib/xmalloc.c: Likewise.
26b4a969 1838
58004308
PE
18392002-11-20 Paul Eggert <eggert@twinsun.com>
1840
1841 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
1842
18432002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 1844
58004308
PE
1845 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
1846 should use `if (! x) abort ();' rather than `assert (x);', and
1847 anyway it's one less thing to worry about configuring.
1848
1849 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
1850 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
1851 and replace all instances of assert with abort.
1852 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
1853 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
1854
1855 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
1856 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
1857 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
1858 hash_find_entry, hash_rehash, hash_insert): Likewise.
1859 * src/conflicts.c (resolve_sr_conflict): Likewise.
1860 * src/lalr.c (set_goto_map, map_goto): Likewise.
1861 * src/nullable.c (nullable_compute): Likewise.
1862 * src/output.c (prepare_rules, token_definitions_output): Likewise.
1863 * src/reader.c (packgram, reader): Likewise.
1864 * src/state.c (state_new, state_free, state_transitions_set,
1865 state_reduction_find): Likewise.
1866 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
1867 symbol_pack): Likewise.
1868 * src/tables.c (conflict_row, pack_vector): Likewise.
1869 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
1870 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
1871 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
1872 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
1873
1874 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
1875 (ARGMATCH_CONSTRAINT): New macro.
1876 (ARGMATCH_ASSERT): Use it.
1877
1878 * src/system.h (verify): New macro.
1879 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
1880 rather than assert.
1881 * src/tables.c (tables_generate): Likewise.
1882
1883 * src/struniq.c (struniq_assert): Now returns void, and aborts
1884 if the assertion is false.
1885 (struniq_assert_p): Remove.
1886 * src/struniq.h: Likewise.
1887
76ae8198
PE
18882002-11-18 Paul Eggert <eggert@twinsun.com>
1889
1890 * data/glr.c (yygetLRActions): Replace `yyindex' with
1891 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
1892 This fixes the regression with Sun ONE Studio 7 cc that I reported in
e3aa65c5 1893 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 1894
d3c4e709
AD
18952002-11-18 Akim Demaille <akim@epita.fr>
1896
1897 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
1898 space.
1899 From Tim Van Holder.
1900
8d8a7238
PE
19012002-11-17 Paul Eggert <eggert@twinsun.com>
1902
1903 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
1904 to "SyntaxError" for consistency with my 2002-11-15 change.
1905
1906 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
1907 not define to {}, since this breaks the common use of `YYDPRINTF
1908 ((...));' if a single statement is desired (e.g. before `else').
1909 Work around GCC warnings by surrounding corresponding calls with
1910 {} if needed.
1911 (yyhasResolvedValue): Remove unused function.
1912 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
1913 loop body.
1914 (yyreportSyntaxError): Renamed from yyreportParseError.
1915 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
1916 All uses changed.
1917 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
1918 extern when possible. Remove unused initializations.
1919
b0937b22
AD
19202002-11-16 Akim Demaille <akim@epita.fr>
1921
1922 Augment the similarity between GLR and LALR traces.
1923
1924 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
1925 (YY_REDUCE_PRINT): New.
1926 (yyparse): Use them.
1927 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
1928 YYDPRINT here.
1929 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
1930 state reached after the reduction/recovery, since...
1931 (yyparse, yyprocessOneStack): Report the state we are entering in.
1932
c5e3e510
AD
19332002-11-16 Akim Demaille <akim@epita.fr>
1934
1935 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
1936 Add support for --trace=skeleton.
1937 * src/scan-skel.l: %option debug.
1938 Scan strings of non-@ or \n instead of character by character.
1939 (scan_skel): Handle trace_skeleton.
1940 (QPUTS): New.
1941 (@output_parser_name@, @output_header_name@): ``Restore'' their
1942 support (used to be M4 macros).
1943 * data/yacc.c: Quote larger chunks, a la glr.c.
1944 * data/lalr1.cc: Likewise.
1945 The header guards are no longer available, so use some other
1946 string than `YYLSP_NEEDED'.
1947
4c6cc1db
AD
19482002-11-16 Akim Demaille <akim@epita.fr>
1949
1950 Make the ``Printers and Destructors'' test more verbose, taking
1951 `yacc.c''s behavior as (possibly wrong) reference.
1952
1953 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
1954 instead of fprint on stdout.
1955 Set and report the last_line of the symbols.
1956 Consistently display values and locations.
1957
6d9e8019
PE
19582002-11-16 Paul Eggert <eggert@twinsun.com>
1959
1960 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
1961
6e649e65
PE
19622002-11-15 Paul Eggert <eggert@twinsun.com>
1963
b25d88f6
PE
1964 * tests/actions.at (Actions after errors): New test case.
1965
6e649e65
PE
1966 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
1967 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
1968 tests/action.at, tests/calc.at, tests/conflicts.at,
1969 tests/cxx-type.at, tests/regression.at:
1970 "parse error" -> "syntax error" for POSIX compatibility.
1971 "parsing stack overflow..." -> "parser stack overflow" so
1972 that code matches Bison documentation.
1973
0f39aab9
AD
19742002-11-15 Akim Demaille <akim@epita.fr>
1975
1976 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
1977 take two BRACED_CODE, not two string_content.
1978 Free the scanner's obstack when we are done.
1979 (code_content): New.
1980 * tests/calc.at: Adjust.
1981 * doc/bison.texinfo: Adjust.
1982 Also, make sure to include the `,' for these declarations.
1983
761c1926
AD
19842002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
1985
1986 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
1987 definition; avoids potential autoreconf problems.
1988
b0f98b10
AD
19892002-11-15 Akim Demaille <akim@epita.fr>
1990
1991 Always check the value returned by yyparse.
1992
1993 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
1994 returned by yyparse.
1995 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
1996 Adjust calls.
1997 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
1998 returned by yyparse.
1999
970785f1
PH
20002002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2001
2002 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
2003 on input.at test.
2004
8fcc7db1
PE
20052002-11-14 Paul Eggert <eggert@twinsun.com>
2006
7ec1b48e
PE
2007 * src/output.c (output_skeleton): Call xfopen instead of
2008 duplicating xfopen's body.
2009
cfff7583 2010 Fix bugs reported by Nelson H. F. Beebe in
e3aa65c5 2011 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 2012
8fcc7db1
PE
2013 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
2014 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
2015 Group compiler. Instead, use "$CC -E bar.c". Include the .h
2016 file twice in the grammar, as an extra check.
2017
2018 * tests/input.at (Torturing the Scanner): Surround the
2019 backslash-newline tests with "#if 0", to make it less likely that
2020 we'll run into compiler bugs. Bring back solitary \ inside
2021 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 2022 test backslash-newline in C character constant.
8fcc7db1 2023
4e8d992c
AD
20242002-11-14 Akim Demaille <akim@epita.fr>
2025
2026 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
2027 status of the compiler.
f32b346d 2028 Calling `exit 1' is no longer needed.
4e8d992c
AD
2029 Reported by Nelson H. F. Beebe.
2030
9501dc6e
AD
20312002-11-14 Akim Demaille <akim@epita.fr>
2032
2033 * tests/atlocal.in (CPPFLAGS): We have config.h.
2034 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
2035 New.
2036 * tests/actions.at, tests/calc.at, tests/conflicts.at,
2037 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
2038 * tests/regression.at, tests/torture.at: Use them for all the
2039 grammars that are to be compiled.
2040 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
2041 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
2042 * doc/bison.texinfo (GLR Parsers): Document `inline'.
2043
18b519c0
AD
20442002-11-14 Akim Demaille <akim@epita.fr>
2045
2046 * doc/bison.texinfo: Various formatting changes (alignments in
2047 samples, additional @group/@end group, GCS in samples.
2048 Use @deffn instead of simple @table to define the directives,
2049 macros, variables etc.
2050
9a86cdb9
PE
20512002-11-13 Paul Eggert <eggert@twinsun.com>
2052
daa33def 2053 Fix some bugs reported by Albert Chin-A-Young in
e3aa65c5 2054 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 2055
daa33def 2056 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 2057 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
2058 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
2059 * tests/headers.at (export YYLTYPE): Likewise.
2060
2061 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 2062 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 2063
9a86cdb9
PE
2064 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
2065 comments, since they're not portable. Use GNU coding style.
2066
9c1e26bd
AD
20672002-11-13 Akim Demaille <akim@epita.fr>
2068
2069 * data/yacc.c: Leave bigger chunks of quoted text.
2070 (YYDSYMPRINTF): New.
2071 Use it to report symbol activities.
2072 * data/glr.c (YYDSYMPRINTF): New.
2073 Use it.
2074
87f721cc
PE
20752002-11-12 Paul Eggert <eggert@twinsun.com>
2076
2077 Version 1.75b.
2078
2079 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
2080 (yyglrReduce): Return yyok, not 0.
2081 This should avoid the enumerated-type warnings reported
464c6927 2082 by Nelson H. F. Beebe in
e3aa65c5 2083 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
2084
2085 * lib/bbitset.h (BITSET_INLINE): Remove.
2086 * lib/bitset.h [! BITSET_INLINE]: Remove.
2087 (bitset_set, bitset_reset, bitset_test): Rename local vars
2088 to avoid shadowing warnings by GCC.
2089
2090 * data/glr.c (inline): Remove #define. It's the user's
2091 responsibility to #define it away, just like 'const'.
464c6927 2092 This fixes one of the bugs reported by Nelson H. F. Beebe in
e3aa65c5 2093 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 2094
87f721cc
PE
2095 * Makefile.maint (po-check): Scan .l and .y files instead of the
2096 .c and the .h files that they generate. This fixes the bug
2097 reported by Tim Van Holder in:
e3aa65c5 2098 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
2099 Look for N_ as well as for _. Try to avoid matching #define for
2100 N_ and _.
2101 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
2102 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
2103 * src/scan-gram.l: Revamp regular expressions so that " and '
2104 do not confuse xgettext.
2105
2106 * src/struniq.h (struniq_new): Do not declare the return type
2107 to be 'const'; this violates the C standard.
2108 * src/struniq.c (struniq_new): Likewise.
2109
be14ade5
AD
21102002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
2111
2112 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
2113 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
2114 linker.
2115
05291fbc
AD
21162002-11-12 Akim Demaille <akim@epita.fr>
2117
2118 * Makefile.maint: Sync with Autoconf:
2119 (local_updates): New.
2120
1f5fd52e
AD
21212002-11-12 Akim Demaille <akim@epita.fr>
2122
2123 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
2124
283f1e64
AD
21252002-11-12 Akim Demaille <akim@epita.fr>
2126
2127 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
2128 locations.
2129
886b69d1
AD
21302002-11-12 Akim Demaille <akim@epita.fr>
2131
2132 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
2133 not yyvalue.
2134
3df37415
AD
21352002-11-12 Akim Demaille <akim@epita.fr>
2136
2137 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
2138 Use it to test the GLR parser.
2139
7bd6c77e
AD
21402002-11-12 Akim Demaille <akim@epita.fr>
2141
2142 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
2143 defines it.
2144 * data/glr.c (yystos): New.
2145 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
2146 (YYDSYMPRINT): New.
2147 (yyval): Don't define it, it is handled via M4.
2148 (yyrecoverParseError): Free verbosely the discarded symbols.
2149 * data/yacc.c (yysymprint): Remove, rather...
2150 (b4_yysymprint_generate): invoke.
2151 * data/c.m4 (b4_yysymprint_generate): New.
2152 Accept pointers as arguments, as opposed to the version from
2153 yacc.c.
2154 (b4_yydestruct_generate): Likewise.
2155 * tests/cations.at (Printers and Destructors): Use Bison directives
2156 instead of CPP macros.
2157 Don't rely on internal details.
2158
b0400cc6
AD
21592002-11-12 Akim Demaille <akim@epita.fr>
2160
2161 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
2162 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
2163 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
2164 it against YYEMPTY and so forth), work on yytoken (i.e., set
2165 it to YYEMPTY etc.).
2166 (yydestruct): Replace with a b4_yydestruct_generate invocation.
2167 (b4_symbol_actions): Remove.
2168 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
2169 for 0, end-of-input.
2170
72f889cc
AD
21712002-11-12 Akim Demaille <akim@epita.fr>
2172
2173 * doc/bison.texinfo (Destructor Decl): New.
2174
b1ae9233
AD
21752002-11-12 Akim Demaille <akim@epita.fr>
2176
2177 * src/tables.c (tables_generate): Use free for pointers that
2178 cannot be NULL, not XFREE.
2179 (pack_vector): Use assert, not fatal, for bound violations.
2180 * src/state.c (state_new): Likewise.
2181 * src/reader.c (reader): Likewise.
2182 * src/lalr.c (set_goto_map): Likewise.
72f889cc 2183 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
2184 the file name.
2185
7ec2d4cd
AD
21862002-11-12 Akim Demaille <akim@epita.fr>
2187
2188 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
2189 Restore.
2190 * src/scan-gram.l (last_string): Is global to the file, not to
2191 yylex.
2192 * src/parse-gram.y (input): Don't append the epilogue here,
2193 (epilogue.opt): do it here, and free the scanner's obstack.
2194 * src/reader.c (epilogue_set): Rename as...
2195 (epilogue_augment): this.
2196 * data/c.m4 (b4_epilogue): Defaults to empty.
2197
573a6cd3
AD
21982002-11-12 Akim Demaille <akim@epita.fr>
2199
2200 * src/getargs.c (long_options): Remove duplicates.
2201 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
2202 Remove.
2203 * doc/bison.rnh: Remove.
2204 * doc/bison.texinfo (VMS Invocation): Remove.
2205
95612cfa
AD
22062002-11-12 Akim Demaille <akim@epita.fr>
2207
2208 * src/struniq.h, src/struniq.c (struniq_t): Is const.
2209 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
2210
2211 Use struniq for symbols.
2212
2213 * src/symtab.h (symbol_t): The tag member is a struniq.
2214 (symbol_type_set): Adjust.
2215 * src/symtab.c (symbol_new): Takes a struniq.
2216 (symbol_free): Don't free the tag member.
2217 (hash_compare_symbol_t, hash_symbol_t): Rename as...
2218 (hash_compare_symbol, hash_symbol): these.
2219 Use the fact that tags as struniqs.
2220 (symbol_get): Use struniq_new.
2221 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
2222 Returns a strniq.
2223 * src/reader.h (merger_list, grammar_currentmerge_set): The name
2224 and type members are struniqs.
2225 * src/reader.c (get_merge_function)
2226 (grammar_current_rule_merge_set): Adjust.
2227 (TYPE, current_type): Are struniq.
2228
2229 Use struniq for file names.
2230
2231 * src/files.h, src/files.c (infile): Split into...
2232 (grammar_file, current_file): these.
2233 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
2234 * src/reduce.c (reduce_print): Likewise.
2235 * src/getargs.c (getargs): Likewise.
2236 * src/complain.h, src/complain.c: Likewise.
2237 * src/main.c (main): Call struniqs_new early enough to use it for
2238 file names.
2239 Don't free the input file name.
2240
3e6656f9
AD
22412002-11-12 Akim Demaille <akim@epita.fr>
2242
2243 * src/symtab.c (symbol_free): Remove dead deactivated code:
2244 type_name are properly removed.
2245 Don't use XFREE to free items that cannot be NULL.
2246 * src/struniq.h, src/struniq.c: New.
2247 * src/main.c (main): Initialize/free struniqs.
2248 * src/parse-gram.y (%union): Add astruniq member.
2249 (yyprint): Adjust.
2250 * src/scan-gram.l (<{tag}>): Return a struniq.
2251 Free the obstack bit that used to store it.
2252 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
2253
7672019c
PE
22542002-11-11 Paul Eggert <eggert@twinsun.com>
2255
2256 Revamp to fix many (but not all) of the C- and M4-related quoting
2257 problems. Among other things, this fixes the Bison bug reported
2258 by Jan Hubicka when processing the Bash grammar; see:
e3aa65c5 2259 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
2260
2261 Use new @ escapes consistently. Represent brackets with @{ and @}
2262 rather than @<:@ and @:>@, since this works a bit better with dumb
2263 editors like vi. Represent @ with @@, since @ is now consistently
2264 an escape. Use @oline@ and @ofile@ rather than __oline__ and
2265 __ofile__, to avoid unexpected expansions. Similarly, use @output
2266 rather than #output.
2267
2268 * data/c.m4 (b4_copyright): Omit file name from comment, since
2269 the file name could contain "*/".
2270 (b4_synclines_flag): Don't quote the 2nd argument; it should already
2271 be quoted. All uses changed.
2272
2273 * data/glr.c: Use new @ escapes consistently.
2274 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
2275 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
2276 Remove, since they couldn't handle arbitrary characters in file
2277 names.
2278 * data/lalr1.cc: Likewise.
2279 * data/yacc.c: Likewise.
2280
2281 * src/files.c (output_infix): Remove; all uses removed.
2282 * src/files.h: Likewise.
2283
2284 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
2285 mishandled funny characters in file names, and anyway it isn't
2286 needed any more.
2287 * data/yacc.c: Likewise.
2288 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
2289
2290 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
2291 * data/yacc.c: Likewise.
2292
2293 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
2294 strings now.
2295 (muscle_init): Quote filename as a C string.
2296 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
2297 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
2298 * src/output.c (escaped_file_name_output): New function.
2299 (prepare_symbols): Quote tokens for M4.
2300 (prepare): Don't insert output_infix, output_prefix,
2301 output_parser_name, output_header_name; this is now down by scan-skel.
2302 Insert skeleton as a C string.
2303
2304 * src/output.c (user_actions_output, symbol_destructors_output,
2305 symbol_printers_output): Quote filenames for C and M4.
2306 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2307
2308 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
2309 escapes other than \\ and \'; this simplifies the code.
2310 (<SC_STRING>): Likewise, for \\ and \".
2311 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
2312 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
2313 Use new escapes @{ and @} for [ and ].
2314
2315 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
2316 them with auto vars.
2317 Switch to new escape scheme, where @ is the escape character uniformly.
2318 Abort if a stray escape character is found. Avoid unbounded input
2319 buffer when parsing non-escaped text.
2320
2321 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
2322 __oline__, #output, $@, and @{ do not have unintended meanings.
2323
acea4f3b
PE
23242002-11-09 Paul Eggert <eggert@twinsun.com>
2325
2326 Fix the test failure due to GCC warnings described in
e3aa65c5 2327 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
2328 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
2329 evaluate to 0 if it's impossible for NINF to be in the respective
2330 table.
2331 (yygetLRActions, yyrecoverParseError): Use them.
2332
2333 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
2334 counted in the token inserted at end of file. Now takes
2335 location_t *, not location_t, so that the location can be
2336 adjusted. All uses changed.
2337
2338 * tests/regression.at (Invalid inputs): Adjust wording in
2339 diagnostic to match the new behavior.
2340
2341 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
2342 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
2343 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
2344 abort ();'. This reduces the runtime of the "Many lookaheads"
2345 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
2346 GCC 3.2.
2347
20ef1ad5
PE
23482002-11-07 Paul Eggert <eggert@twinsun.com>
2349
2350 * src/parse-gram.y (CHARACTER): Remove unused token.
2351 All uses removed.
2352
2353 * src/scan-gram.l: Remove stack option. We no longer use the
2354 stack, since the stack was never deeper than 1; instead, use the
2355 new auto var c_context to record the stacked value.
2356
2357 Remove nounput option. At an unexpected end of file, we now unput
2358 the minimal input necessary to end cleanly; this simplifies the
2359 code.
2360
2361 Avoid unbounded token sizes where this is easy.
2362
2363 (unexpected_end_of_file): New function.
2364 Use it to systematize the error message on unexpected EOF.
2365 (last-string): Now auto, not static.
2366 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
2367 (scanner_last_string_free): Remove; not used.
2368 (percent_percent_count): Move decl to just before use.
2369 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
2370 not the (never otherwised-used) CHARACTER.
2371
93724f13
AD
23722002-11-07 Akim Demaille <akim@epita.fr>
2373
2374 Let yyerror always receive the msg as last argument, so that
2375 yyerror can be variadic.
2376
2377 * data/yacc.c (b4_yyerror_args): New.
2378 Use it when calling yyerror.
2379 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
2380 Use it when calling yyerror.
2381 * doc/bison.texinfo (Error Reporting): Adjust.
2382 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
2383 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
2384
6e40b4eb
AD
23852002-11-06 Akim Demaille <akim@epita.fr>
2386
2387 #line should have quoted strings.
2388 Ideally, this should be done by m4_quotearg.
2389
2390 * src/scan-skel.l: Include quotearg.h.
2391 Quote __ofile__.
2392 * src/output.c (symbol_printers_output)
2393 (symbol_destructors_output): Quote the file name.
2394
2dfbfc12
AD
23952002-11-06 Akim Demaille <akim@epita.fr>
2396
2397 * tests/regression.at (Invalid inputs): Adjust to the recent
2398 messages.
2399
437c2d80
AD
24002002-11-06 Akim Demaille <akim@epita.fr>
2401
2402 Restore --no-lines.
2403 Reported by Jim Kent.
2404
2405 * data/c.m4 (b4_syncline): New.
2406 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
2407 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
2408 * src/output.c (user_actions_output): Likewise.
2409 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 2410 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 2411
900c5db5
AD
24122002-11-06 Akim Demaille <akim@epita.fr>
2413
2414 * src/main.c (main): Free `infile'.
2415 * src/scan-gram.l (handle_syncline): New.
2416 Recognize `#line'.
2417 * src/output.c (user_actions_output, symbol_destructors_output)
2418 (symbol_printers_output): Use the location's file name, not
2419 infile.
2420 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2421
e183b123 24222002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 2423
e183b123 2424 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 2425 either has GLR conflict entries.
e183b123 2426
193eb6b7
PE
24272002-11-05 Paul Eggert <eggert@twinsun.com>
2428
e183b123
PE
2429 * src/scan-gram.l: Use more accurate diagnostics, e.g.
2430 "integer out of range" rather than "invalid value".
2431 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
2432 accordingly.
2433
193eb6b7
PE
2434 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
2435 Also, remove one static variable in the scanner.
2436
2437 * src/scan-gram.l (braces_level): Now auto, not static.
2438 Initialize to zero if the compiler is being picky.
2439 (INITIAL): Clear braces_level instead of incrementing it.
2440 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
2441 as POSIX 1003.1-2001 requires.
2442 * src/system.h (IF_LINT): New macro, taken from coreutils.
2443 * configure.ac: Define "lint" if --enable-gcc-warnings.
2444
29c01725
AD
24452002-11-05 Akim Demaille <akim@epita.fr>
2446
2447 * src/scan-gram.l: When it starts with `%', complain about the
2448 whole directive, not just that `invalid character: %'.
2449
8aeac3ca
AD
24502002-11-04 Akim Demaille <akim@epita.fr>
2451
2452 * Makefile.maint: Update from Autoconf.
2453 (update, cvs-update, po-update, do-po-update): New.
2454
793a58bb
AD
24552002-11-04 Akim Demaille <akim@epita.fr>
2456
2457 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
2458 and yyerror.
2459 Have yyerror `use' its arguments.
2460 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
2461 returns true when location & yacc & pure & parse-param.
2462 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
2463
c4d720cd
AD
24642002-11-04 Akim Demaille <akim@epita.fr>
2465
2466 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
2467 clashes.
2468 * src/scan-gram.l: Use [\'] instead of ['] to pacify
2469 font-lock-mode.
2470 Use complain_at.
2471 Use quote, not quote_n since LOCATION_PRINT no longer uses the
2472 slot 0.
2473
613a0dc5
PE
24742002-11-03 Paul Eggert <eggert@twinsun.com>
2475
2476 * src/reader.c (get_merge_function, grammar_current_rule_check):
2477 Use consistent diagnostics for reporting type name clashes.
2478 Quote the types with <>, for consistency with Yacc.
2479 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
2480
2a8d363a
AD
24812002-11-03 Akim Demaille <akim@epita.fr>
2482
2483 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
2484 New.
2485 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
2486 (b4_parse_param): Remove.
2487 Use b4_identification.
2488 Propagate b4_pure_args where needed to pass them to yyerror.
2489 * data/glr.m4 (b4_parse_param): Remove.
2490 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
2491 (b4_lpure_formals): New.
2492 Use b4_identification.
2493 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
2494 b4_user_formals and b4_user_args.
2495 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
2496 (yyreportAmbiguity): When using a pure parser, also need
2497 the location, and the parse-params.
2498 Adjust callers.
2499 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
2500 When using a pure parser, also need the parse-params.
2501 Adjust callers.
2502 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
2503 (%pure-parser + %parse-param) LALR and GLR parsers.
2504 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
2505 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
2506 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
2507 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
2508 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
2509 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
2510 * doc/bison.texinfo: Untabify the whole file.
2511 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
2512 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
2513 (Error Reporting): Adjust to these new directives.
2514 Document %error-verbose, deprecate YYERROR_VERBOSE.
2515
9e32add8
AD
25162002-11-03 Akim Demaille <akim@epita.fr>
2517
2518 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
2519 AT_CHECK_CALC_GLR invocations to use % directives, instead of
2520 command line options.
2521 * tests/cxx-type.at: Formatting changes.
2522
b02d90a5
PE
25232002-11-03 Paul Eggert <eggert@twinsun.com>
2524
2525 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
2526 to count columns correctly, and to check for invalid inputs.
9e32add8 2527
b02d90a5
PE
2528 Use mbsnwidth to count columns correctly. Account for tabs, too.
2529 Include mbswidth.h.
2530 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
2531 (extend_location): New function.
2532 (YY_LINES): Remove.
2533
2534 Handle CRLF in C code rather than in Lex code.
2535 (YY_INPUT): New macro.
2536 (no_cr_read): New function.
2537
2538 Scan UCNs, even though we don't fully handle them yet.
2539 (convert_ucn_to_byte): New function.
2540
2541 Handle backslash-newline correctly in C code.
2542 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
2543 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
2544 all uses changed.
2545 (tag, splice): New EREs. Do not allow NUL or newline in tags.
2546 Use {splice} wherever C allows backslash-newline.
2547 YY_STEP after space, newline, vertical-tab.
2548 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 2549
b02d90a5
PE
2550 (letter, id): Don't assume ASCII; e.g., spell out a-z.
2551
2552 ({int}, handle_action_dollar, handle_action_at): Check for integer
2553 overflow.
9e32add8 2554
b02d90a5
PE
2555 (YY_STEP): Omit trailing semicolon, so that it's more like C.
2556
2557 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
2558 as well as \000. Check for UCHAR_MAX, not 255.
2559 Allow \x with an arbitrary positive number of digits, as in C.
2560 Check for overflow here.
2561 Allow \? and UCNs, for compatibility with C.
2562
2563 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
2564 with quote slot used by complain_at.
2565
2566 * tests/input.at: Add tests for backslash-newline, m4 quotes
2567 in symbols, long literals, and funny escapes in strings.
2568
2569 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
2570 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
2571 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
2572 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
2573 * m4/mbswidth.m4: New file, from GNU coreutils.
2574
2575 * doc/bison.texinfo (Grammar Outline): Document // comments.
2576 (Symbols): Document that trigraphs have no special meaning in Bison,
2577 nor is backslash-newline allowed.
2578 (Actions): Document that trigraphs have no special meaning.
2579
2580 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
2581 no longer used.
2582
25832002-11-02 Paul Eggert <eggert@twinsun.com>
2584
2585 * src/reader.c: Don't include quote.h; not needed.
2586 (get_merge_function): Reword warning to be consistent with
2587 type clash diagnostic in grammar_current_rule_check.
2588
2589 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
2590 bug in trigraph handling.
2591
2592 * src/output.c (prepare_symbols): When printing token names,
2593 escape "[" as "@<:@" and likewise for "]".
2594
2595 * src/system.h (errno): Remove declaration, as we are now
2596 assuming C89 or better, and C89 guarantees errno.
2597
762b212b
PE
25982002-10-30 Paul Eggert <eggert@twinsun.com>
2599
2600 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
2601 Check for close failures.
2602 * src/files.h (xfclose): Return void, not int, since it always
2603 returned zero.
2604 * src/files.c (xfclose): Likewise. Report I/O error if ferror
2605 indicates one.
2606 * src/output.c (output_skeleton): Use xfclose rather than fclose
2607 and ferror. xfclose now checks ferror.
2608
2609 * data/glr.c (YYLEFTMOST_STATE): Remove.
2610 (yyreportTree): Use a stack-based leftmost state. This avoids
2611 our continuing battles with bogus warnings about initializers.
2612
56100c60
AD
26132002-10-30 Akim Demaille <akim@epita.fr>
2614
2615 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
2616 #if.
2617
51b4a04c
PH
26182002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2619
2620 * tests/glr-regr1.at: New test for reported regressions.
2621 * tests/testsuite.at: Add glr-regr1.at test.
2622 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 2623
bf1ebda2
PE
26242002-10-24 Paul Eggert <eggert@twinsun.com>
2625
5c16c6b1
PE
2626 Version 1.75a.
2627
bf1ebda2
PE
2628 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
2629 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
2630 we use malloc. Don't assume 'A' through 'Z' are contiguous.
2631 Don't assume strdup exists; POSIX says its an XSI extension.
2632 Check for buffer overflow on input.
2633
b526ee61
AD
26342002-10-24 Akim Demaille <akim@epita.fr>
2635
2636 * src/output.c (output_skeleton): Don't disable M4sugar comments
2637 too soon: it results in comments being expanded.
2638 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
2639 first output.
2640
f1886bb2
AD
26412002-10-24 Akim Demaille <akim@epita.fr>
2642
2643 * data/yacc.c (m4_int_type): New.
2644 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
2645 char' as only yacc.c wants K&R portability.
2646 * data/glr.c (yysigned_char): Remove.
2647 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
2648 Reported by Quoc Peyrot.
2649
c5576256
PE
26502002-10-23 Paul Eggert <eggert@twinsun.com>
2651
2652 * src/main.c (main): With --trace=time, report times even if a
2653 non-fatal error occurs. Formerly, the times were reported in some
2654 such cases but not in others.
2655 * src/reader.c (reader): Just return if a complaint has been issued,
2656 instead of exiting, so that 'main' can report times.
2657
27b0ffea
AD
26582002-10-22 Akim Demaille <akim@epita.fr>
2659
2660 * src/system.h: Include sys/types.
2661 Reported by Bert Deknuydt.
2662
223a7883
PE
26632002-10-23 Paul Eggert <eggert@twinsun.com>
2664
2665 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
2666 Suggested by Art Haas.
2667
26682002-10-22 Paul Eggert <eggert@twinsun.com>
2669
2670 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
2671 decl; not needed any more.
2672 * src/main.c (main): Use return to exit, undoing yesterday's change.
2673 The last OS that we could find where this wouldn't work is
2674 SunOS 3.5, and that's too old to worry about now.
2675
2676 * data/glr.c (struct yyltype): Define members even when not
2677 doing locations. This is more consistent with yacc.c, and it
2678 works around the following bug reports:
e3aa65c5
PE
2679 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
2680 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 2681
223a7883
PE
2682 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
2683 @acronym consistently. Standardize on "Yacc" instead of "YACC",
2684 "Algol" instead of "ALGOL". Give a bit more history about BNF.
2685
8b76775a
AD
26862002-10-22 Akim Demaille <akim@epita.fr>
2687
2688 * data/README: New.
2689
6db10d14
PE
26902002-10-21 Paul Eggert <eggert@twinsun.com>
2691
2692 Be consistent about 'bool'; the old code used an enum in one
2693 module and an int in another, and this violates the C standard.
2694 * m4/stdbool.m4: New file, from coreutils 4.5.3.
2695 * configure.ac (AC_HEADER_STDBOOL): Add.
2696 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
2697 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
2698 * src/symtab.c (hash_compare_symbol_t): Likewise.
2699 * src/system.h (bool, false, true): Use a definition consistent
2700 with ../lib/hash.c. All uses changed.
2701
2702 * src/complain.c (warning_issued): Renamed from warn_message_count,
2703 so that we needn't worry about integer overflow (!).
2704 Now of type bool. All uses changed.
2705 (complaint_issued): Renamed from complain_message_count; likewise.
2706
2707 * src/main.c (main): Use exit to exit with failure.
27b0ffea 2708
6db10d14
PE
2709 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
2710 rather than 1 and 0.
2711 * src/main.c (main): Likewise.
2712 * src/getargs.c (getargs): Likewise.
2713 * src/reader.c (reader): Likewise.
2714
2715 * src/getarg.c (getargs): Remove duplicate code for
2716 "Try `bison --help'".
2717
2718 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
2719 What was that "2" for?
2720
2721 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
2722 * src/getargs.c (usage): Likewise.
2723
2724 * src/getargs.c (getargs): When there are too few operands, report
2725 the last one. When there are too many, report the first extra
2726 one. This is how diffutils does it.
2727
92a060fd
PE
27282002-10-20 Paul Eggert <eggert@twinsun.com>
2729
2730 Remove K&R vestiges.
2731 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
2732 * src/complain.c (VA_START): Remove. Assume prototypes.
2733 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
2734 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
2735 fatal): Assume prototypes.
2736 * src/complain.h: Assume prototypes.
2737 * src/system.h (PARAMS): Remove.
2738 Include <limits.h> unconditionally, since it's guaranteeed even
2739 for a freestanding C89 compiler.
2740 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
2741 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 2742
e7cb57c0
AD
27432002-10-20 Akim Demaille <akim@epita.fr>
2744
2745 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
2746 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
2747 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
2748 (yyresolveStates, yyresolveAction, yyresolveStack)
2749 (yyprocessOneStack): Use them.
2750 (yy_reduce_print): New.
2751 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
2752
0245f82d
AD
27532002-10-20 Akim Demaille <akim@epita.fr>
2754
2755 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
2756 arguments and output `void'.
2757 (b4_c_function): Rename as...
2758 (b4_c_function_def): this.
2759 (b4_c_function_decl, b4_c_ansi_function_def)
2760 (b4_c_ansi_function_decl): New.
2761 Change the interpretation of the arguments: before `int, foo', now
2762 `int foo, foo'.
2763 * data/yacc.c (yyparse): Prototype and define thanks to these.
2764 Adjust b4_c_function_def uses.
2765 * data/glr.c (yyparse): Likewise, but ANSI only.
2766
39912f52
AD
27672002-10-20 Akim Demaille <akim@epita.fr>
2768
2769 * src/output.c (prepare): Move the definition of `tokens_number',
2770 `nterms_number', `undef_token_number', `user_token_number_max'
2771 to...
2772 (prepare_tokens): Here.
2773 (prepare_tokens): Rename as...
2774 (prepare_symbols): this.
2775 (prepare): Move the definition of `rules_number' to...
2776 (prepare_rules): here.
2777 (prepare): Move the definition of `last', `final_state_number',
2778 `states_number' to...
2779 (prepare_states): here.
2780 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
2781
20c1e2ad
AD
27822002-10-20 Akim Demaille <akim@epita.fr>
2783
2784 * src/tables.h, src/tables.c, src/output.c: Comment changes.
2785
21964f43
AD
27862002-10-20 Akim Demaille <akim@epita.fr>
2787
2788 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
2789 * data/c.m4: here.
2790
66d30cd4
AD
27912002-10-20 Akim Demaille <akim@epita.fr>
2792
2793 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
2794 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
2795 `pair'.
2796 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
2797 `name' to...
2798 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
2799 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
2800 These.
2801
95f2c9fe
PE
28022002-10-19 Paul Eggert <eggert@twinsun.com>
2803
2804 Do not create a temporary file, as that involves security and
2805 cleanup headaches. Instead, use a pair of pipes.
2806 Derived from a suggestion by Florian Krohm.
2807 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
2808 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
2809 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
2810 (BISON_PREREQ_SUBPIPE): Add.
2811 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
2812 Add subpipe.h, subpipe.c.
2813 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
2814 * po/POTFILES.in: Add lib/subpipe.c.
2815 * src/output.c: Include "subpipe.h".
2816 (m4_invoke): Remove decl.
2817 (scan_skel): New decl.
2818 (output_skeleton): Use pipe rather than temporary file for m4 input.
2819 Check that m4sugar.m4 is readable, to avoid deadlock.
2820 Check for pipe I/O error.
2821 * src/scan-skel.l (readpipe): Remove decl.
2822 (scan_skel): New function, to be used in place of m4_invoke.
2823 Read from stream rather than file.
66d30cd4 2824
95f2c9fe
PE
2825 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
2826 float, as this generates a warning on Solaris 8 + GCC 3.2 with
2827 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
2828 this generates a more-accurate value anyway.
2829
2830 * lib/timevar.c (timervar_accumulate): Rename locals to
2831 avoid confusion with similarly-named more-global.
2832 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
2833
2834 * src/output.c (prepare): Use xstrdup to convert char const *
2835 to char *, to avoid GCC warning.
2836
c19988b7
AD
28372002-10-19 Akim Demaille <akim@epita.fr>
2838
2839 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
2840 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
2841 Use them to have `calc.y' ready for %pure-parser.
2842 * data/yacc.c (YYLEX): Pass a yylex return type to
2843 b4_c_function_call.
2844
ae7453f2
AD
28452002-10-19 Akim Demaille <akim@epita.fr>
2846
2847 Prototype support of %lex-param and %parse-param.
2848
2849 * src/parse-gram.y: Add the definition of the %lex-param and
2850 %parse-param tokens, plus their rules.
2851 Drop the `_' version of %glr-parser.
2852 Add the "," token.
2853 * src/scan-gram.l (INITIAL): Scan them.
2854 * src/muscle_tab.c: Comment changes.
2855 (muscle_insert, muscle_find): Rename `pair' as `probe'.
2856 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
2857 (muscle_entry_s): The `value' member is no longer const.
2858 Adjust all dependencies.
2859 * src/muscle_tab.c (muscle_init): Adjust: use
2860 MUSCLE_INSERT_STRING.
2861 Initialize the obstack earlier.
2862 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
2863 (muscle_pair_list_grow): New.
2864 * data/c.m4 (b4_c_function_call, b4_c_args): New.
2865 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
2866 * tests/calc.at: Use %locations, not --locations.
2867 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
2868
0e575721
AD
28692002-10-19 Akim Demaille <akim@epita.fr>
2870
2871 * src/getargs.c (usage): Take status as argument and exit
2872 accordingly.
2873 Report the traditional `Try ... --help' message when status != 0.
2874 (usage, version): Don't take a FILE * as arg, it is pointless.
2875 (getargs): When there is an incorrect number of arguments, make it
2876 an error, and report it GNUlically thanks to `usage ()'.
2877
724ce7f5
PE
28782002-10-18 Paul Eggert <eggert@twinsun.com>
2879
3a781eb2
PE
2880 * data/glr.c (yyreportParseError): Don't assume that sprintf
2881 yields the length of the printed string, as this is not true
2882 on SunOS 4.1.4. Reported by Peter Klein.
2883
724ce7f5
PE
2884 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
2885 * tests/conflicts.at (%nonassoc and eof): Likewise.
2886 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
2887
473d0a75
AD
28882002-10-17 Akim Demaille <akim@epita.fr>
2889
2890 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
2891 * src/getargs.c (trace_types, trace_args): Adjust.
2892 * src/reader.c (grammar_current_rule_prec_set)
2893 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
2894 Standardize error messages.
2895 And s/@prec/%prec/!
2896 (reader): Use trace_flag to enable scanner/parser debugging,
2897 instead of an adhoc scheme.
2898 * src/scan-gram.l: Remove trailing debugging code.
2899
e76d2469
PE
29002002-10-16 Paul Eggert <eggert@twinsun.com>
2901
93e2236a
PE
2902 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
2903 MUSCLE_TAB_H.
2904
e76d2469
PE
2905 * NEWS: Officially drop support for building Bison with K&R C,
2906 since it didn't work anyway and it's not worth worrying about.
2907 * Makefile.maint (wget_files): Remove ansi2knr.c.
2908 (ansi2knr.c-url_prefix): Remove.
2909 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
2910 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2911 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2912
5bd1c419
PE
29132002-10-15 Paul Eggert <eggert@twinsun.com>
2914
2915 Stop using the "enum_" trick for K&R-style function definitions;
2916 it confused me, and I was the author! Instead, assume that people
2917 who want to use K&R C compilers (when using these modules in GCC,
2918 perhaps?) will run ansi2knr.
2919
2920 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
2921 All uses of "enum_" changed to "enum ".
2922 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
2923 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 2924
5bd1c419
PE
2925 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
2926 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
2927 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
2928 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
2929 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
2930 abitset_not, abitset_ones, abitset_or, abitset_or_and,
2931 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
2932 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
2933 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
2934 Use function prototypes; this removes the need for declaring
2935 static functions simply to provide their prototypes.
2936 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
2937 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
2938 bitset_count_, bitset_create, bitset_dump, bitset_first,
2939 bitset_free, bitset_init, bitset_last, bitset_next,
2940 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
2941 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
2942 bitset_print, bitset_release_memory, bitset_toggle_,
2943 bitset_type_choose, bitset_type_get, bitset_type_name_get,
2944 debug_bitset): Likewise.
2945 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
2946 * lib/bitset_stats.c (bitset_log_histogram_print,
2947 bitset_percent_histogram_print, bitset_stats_and,
2948 bitset_stats_and_cmp, bitset_stats_and_or,
2949 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
2950 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
2951 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
2952 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
2953 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
2954 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
2955 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
2956 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
2957 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
2958 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
2959 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
2960 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
2961 bitset_stats_zero): Likewise.
2962 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
2963 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
2964 bitsetv_dump, debug_bitsetv): Likewise.
2965 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
2966 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
2967 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
2968 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
2969 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
2970 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
2971 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
2972 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
2973 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
2974 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
2975 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
2976 Likewise.
2977 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
2978 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
2979 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
2980 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
2981 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
2982 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
2983 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
2984 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
2985 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
2986 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
2987 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 2988
ae26e1f0
AD
29892002-10-14 Akim Demaille <akim@epita.fr>
2990
2991 Version 1.75.
2992
d43baf71
AD
29932002-10-14 Akim Demaille <akim@epita.fr>
2994
2995 * tests/Makefile.am (maintainer-check-posix): New.
2996
7ebc83e3
AD
29972002-10-14 Akim Demaille <akim@epita.fr>
2998
2999 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
3000 member.
3001
05846dae
AD
30022002-10-14 Akim Demaille <akim@epita.fr>
3003
3004 * src/tables.c (table_ninf_remap): base -> tab.
3005 Reported by Matt Rosing.
3006
1318e37d
PE
30072002-10-14 Paul Eggert <eggert@twinsun.com>
3008
447fbb17
PE
3009 * tests/action.at, tests/calc.at, tests/conflicts.at,
3010 tests/cxx-type.at, tests/headers.at, tests/input.at,
3011 tests/regression.at, tests/synclines.at, tests/torture.at:
3012 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
3013 so that the tests still work even if POSIXLY_CORRECT is set.
3014 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 3015
1318e37d
PE
3016 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
3017 for portability to K&R hosts. Fix typo: signed char is guaranteed
3018 only to 127, not to 128.
3019 * data/glr.c (yysigned_char): New type.
3020 * data/yacc.c (yysigned_char): Likewise.
3021 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
3022
cc0f0794
PE
30232002-10-13 Paul Eggert <eggert@twinsun.com>
3024
5038f418
PE
3025 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
3026 true due to limited range of data type" warning from GCC.
3027
cc0f0794
PE
3028 * data/c.m4 (b4_token_defines): Protect against double-inclusion
3029 by wrapping enum yytokentype's definition inside #ifndef
3030 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
3031
6fed0802
AD
30322002-10-13 Akim Demaille <akim@epita.fr>
3033
3034 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
3035 Un yy- yyrhs to avoid the name clash with the global YYRHS.
3036
32f0598d
AD
30372002-10-13 Akim Demaille <akim@epita.fr>
3038
3039 * Makefile.maint: Update from Autoconf 2.54.
3040 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
3041
7ea9a33f
AD
30422002-10-13 Akim Demaille <akim@epita.fr>
3043
3044 * src/print.c (print_state): Separate the list of solved conflicts
3045 from the other items.
3046 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
3047
ea99527d
AD
30482002-10-13 Akim Demaille <akim@epita.fr>
3049
3050 Let nondeterministic skeletons be usable with deterministic
3051 tables.
3052
3053 With the patch, GAWK compiled by GCC without -O2 passes its test
3054 suite using a GLR parser driven by LALR tables. It fails with -O2
3055 because `struct stat' gives two different answers on my machine:
3056 88 (definition of an auto var) and later 96 (memset on this var).
3057 Hence the stack is badly corrumpted. The headers inclusion is to
3058 blame: if I move the awk.h inclusion before GLR's system header
3059 inclusion, the two struct stat have the same size.
3060
3061 * src/tables.c (pack_table): Always create conflict_table.
3062 (token_actions): Always create conflict_list.
3063 * data/glr.c (YYFLAG): Remove, unused.
3064
f377f69f
AD
30652002-10-13 Akim Demaille <akim@epita.fr>
3066
3067 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
3068 (O0FLAGS): New.
3069 (VALGRIND, GXX): New.
3070 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
3071 * tests/bison.in: Run $PREBISON a pre-command.
3072 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
3073 (maintainer-check-g++): New.
3074 * Makefile.am (maintainer-check): New.
3075
2a1fe6ed
AD
30762002-10-13 Akim Demaille <akim@epita.fr>
3077
3078 * data/glr.c: Formatting changes.
3079 Tweak some trace messages to match yacc.c's.
3080
f50adbbd
AD
30812002-10-13 Akim Demaille <akim@epita.fr>
3082
3083 GLR parsers sometimes raise parse errors instead of performing the
3084 default reduction.
3085 Reported by Charles-Henry de Boysson.
3086
3087 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
3088 check the length of the traces when %glr.
3089 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
3090 GLR's traces.
3091 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
3092 Test GLR parsers.
3093 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
3094 (yyltype): Remove the yy prefix from the member names.
3095 (yytable): Complete its comment.
3096 (yygetLRActions): Map error action number from YYTABLE from
3097 YYTABLE_NINF to 0.
3098 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
3099 (which was a bug: it should have been YYTABEL_NINF, and yet it was
3100 not satisfying as we could compare an YYACTION computed from
3101 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
3102 only value for error actions.
3103 (yyreportParseError): In verbose parse error messages, don't issue
3104 `error' in the list of expected tokens.
3105 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
3106 next action to perform to match glr.c's decoding.
3107 (yytable): Complete its comment.
3108
bcbad5b9
PE
31092002-10-13 Paul Eggert <eggert@twinsun.com>
3110
3111 Fix problem reported by Henrik Grubbstroem in
e3aa65c5 3112 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
3113 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
3114 because the Bison parser reads the second action before reducing
3115 the first one.
3116 * src/scan-gram.l (rule_length): New static var.
3117 Use it to keep track of the rule length in the scanner, since
3118 we can't expect the parser to be in lock-step sync with the scanner.
3119 (handle_action_dollar, handle_action_at): Use this var.
3120 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 3121
14904b89
PE
31222002-10-12 Paul Eggert <eggert@twinsun.com>
3123
1fe611e5
PE
3124 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
3125 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
3126 Include <sys/time.h> when checking for clock_t and struct tms.
3127 Use same include order as source.
3128 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
e3aa65c5 3129 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 3130
1fe611e5
PE
3131 * lib/timevar.c: Update copyright date and clarify comments.
3132 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 3133
1fe611e5
PE
3134 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
3135 GCC version as of today, then merge Bison's changes.
3136 Change "GCC" to "Bison" in copyright notice. timevar.def's
3137 author is Akim, so change that too.
3138
98194095
PE
3139 * src/reader.c (grammar_current_rule_check):
3140 Don't worry about the default action if $$ is untyped.
3141 Prevents bogus warnings reported by Jim Gifford in
e3aa65c5 3142 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 3143
14904b89
PE
3144 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
3145 * data/glr.c, data/lalr1.cc, data/yacc.c:
3146 Output token definitions before the first part of user declarations.
3147 Fixes compatibility problem reported by Jim Gifford for kbd in
e3aa65c5 3148 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 3149
ff6dca18
PE
31502002-10-11 Paul Eggert <eggert@twinsun.com>
3151
3152 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
3153 (yyparse): here. This undoes some of the 2002-07-25 change.
3154 Compatibility problem reported by Ralf S. Engelschall with
3155 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
3156
eb714592
AD
31572002-10-11 Akim Demaille <akim@epita.fr>
3158
3159 * tests/regression.at Characters Escapes): New.
3160 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
3161 characters.
3162 Reported by Jan Nieuwenhuizen.
3163
b7195100
AD
31642002-10-11 Akim Demaille <akim@epita.fr>
3165
3166 * po/id.po: New.
3167
f28a0f2d
PE
31682002-10-10 Paul Eggert <eggert@twinsun.com>
3169
3170 Portability fixes for bitsets; this also avoids several GCC
3171 warnings.
3172
3173 * lib/abitset.c: Include <stddef.h>, for offsetof.
3174 * lib/lbitset.c: Likewise.
3175
3176 * lib/abitset.c (abitset_bytes): Return a size that is aligned
3177 properly for vectors of objects. Do not assume that adding a
3178 header size to a multiple of a word size yields a value that is
3179 properly aligned for the whole union.
3180 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3181
3182 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
3183 unique names for structures.
3184 * lib/ebitset.c (ebitset_bytes): Likewise.
3185 * lib/lbitset.c (lbitset_bytes): Likewise.
3186
3187 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
3188 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
3189 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
3190 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
3191 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
3192 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
3193 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
3194 to improve the type-checking that GCC can do.
3195 * lib/bitset.c (bitset_op4_cmp): Likewise.
3196 * lib/bitset_stats.c (bitset_stats_count,
3197 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
3198 bitset_stats_copy, bitset_stats_disjoint_p,
3199 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
3200 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
3201 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
3202 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
3203 bitset_stats_and_or_cmp, bitset_stats_andn_or,
3204 bitset_stats_andn_or_cmp, bitset_stats_or_and,
3205 bitset_stats_or_and_cmp): Likewise.
3206 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
3207 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
3208 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
3209 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
3210
3211 * lib/abitset.h: Include bitset.h, not bbitset.h.
3212 * lib/ebitset.h: Likewise.
3213 * lib/lbitset.h: Likewise.
3214
3215 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
3216 All instances of parameters of type enum bitset_opts are now of
3217 type enum_bitset_opts, to conform to the C Standard, and similarly
3218 for enum_bitset_type.
3219 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
3220 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
3221
3222 Do not use "struct bitset_struct" to mean different things in
3223 different modules. Not only is this confusing, it violates
3224 the C Standard, which requires that structure types in different
3225 modules must be compatible if one is to be passed to the other.
3226 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
3227 All instances of "struct bitset_struct *" replaced with "bitset".
3228 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
3229 (union bitset_union, struct abitset_struct, struct ebitset_struct,
3230 struct lbitset_struct, struct bitset_stats_struct): New types.
3231 All uses of struct bitset_struct changed to union bitset_union,
3232 etc.
3233 * lib/abitset.c (struct abitset_struct, abitset,
3234 struct bitset_struct): Remove.
3235 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
3236 struct bitset_struct): Remove.
3237 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
3238 bitset_struct): Remove.
3239 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
3240 Likewise.
3241
3242 Do not call a function of type T using a call that assumes the
3243 function is of a different type U. Standard C requires that a
3244 function must be called with a type that is compatible with its
3245 definition.
3246 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3247 New decls.
3248 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3249 New functions.
3250 * lib/ebitset.c (PFV): Remove.
3251 * lib/lbitset.c (PFV): Likewise.
3252 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
3253 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
3254 decls.
3255 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
3256 (ebitset_vtable): Use them.
3257 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
3258 lbitset_xor): New functions.
3259 (lbitset_vtable): Use them.
3260
3261 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
3262 Declare.
3263
3264 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
3265 GCC warning.
3266 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
3267 Use offsetof, for simplicity.
3268
6fbe4984
PE
32692002-10-06 Paul Eggert <eggert@twinsun.com>
3270
3271 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
3272 the same width as int. This reapplies a hunk of the 2002-08-12 patch
e3aa65c5 3273 <http://mail.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
3274 which was inadvertently undone by the 2002-09-30 patch.
3275 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
3276 the same width as int.
3277
420f93c8
PE
32782002-10-04 Paul Eggert <eggert@twinsun.com>
3279
3280 Version 1.50.
3281
3282 * configure.ac (AC_INIT), NEWS: Increment version number.
3283
3284 * doc/bison.texinfo: Minor spelling, grammar, and white space
3285 fixes.
3286 (Symbols): Mention that any negative value returned from yylex
3287 signifies end-of-input. Warn about negative chars. Mention
3288 the portable Standard C character set.
3289
3290 The GNU coding standard says CFLAGS and YFLAGS are reserved
3291 for the installer to set.
3292 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
3293 * src/Makefile.am (AM_CFLAGS): Likewise.
3294 (AM_YFLAGS): Renamed from YFLAGS.
3295
3296 Fix some MAX and MIN problems.
3297 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
3298 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
3299 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
3300 * src/reader.c (reader): Use it.
3301
3302 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
3303 POSIX 1003.1-2001 has removed fgrep.
3304
33052002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
3306
3307 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
3308 interpreted as signed.
3309 * lib/ebitset.c (ebitset_list): Fix bug.
3310
ff68026d
PE
33112002-10-01 Paul Eggert <eggert@twinsun.com>
3312
3313 More fixes for 64-bit hosts and large bitsets.
3314
3315 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
3316 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
3317 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
3318 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
3319 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
3320 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
3321 bitset_count_): Likewise.
3322 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
3323 bitset_first, bitset_last): Likewise.
3324 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
3325 bitset_stats_list_reverse, bitset_stats_size,
3326 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
3327 Likewise.
3328 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3329 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
3330 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
3331 bitsetv_reflexive_transitive_closure): Likewise.
3332 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
3333 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
3334 Likewise.
3335 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
3336 Likewise.
420f93c8 3337
ff68026d
PE
3338 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
3339 Use size_t, not unsigned int, to count bytes.
3340 * lib/abitset.h (abitset_bytes): Likewise.
3341 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
3342 Likewise.
3343 * lib/bitset.h (bitset_bytes): Likewise.
3344 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
3345 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
3346 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3347 * lib/ebitset.c (ebitset_bytes): Likewise.
3348 * lib/ebitset.h (ebitset_bytes): Likewise.
3349 * lib/lbitset.c (lbitset_bytes): Likewise.
3350 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 3351
ff68026d
PE
3352 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
3353 abitset_subset_p, abitset_disjoint_p, abitset_and,
3354 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
3355 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
3356 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
3357 abitset_or_and, abitset_or_and_cmp):
3358 Use bitset_windex instead of unsigned int.
3359 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3360 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
3361 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
3362 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
3363 Likewise.
3364 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 3365
ff68026d
PE
3366 * lib/bitset.c (bitset_print):
3367 Use proper printf formats for widths of integer types.
3368 * lib/bitset_stats.c (bitset_percent_histogram_print,
3369 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
3370 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3371 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3372 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 3373
ff68026d
PE
3374 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
3375 BITSET_SIZE_MAX): New macros.
3376 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
3377 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
3378 to BITSET_WINDEX_MAX.
3379
3380 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
3381 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
3382 since we now return the bitset_bindex type (not int).
3383
3384 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
3385 when computing sizes.
3386 * lib/ebitset.c (ebitset_elts_grow): Likewise.
3387
3388 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
3389 and avoid cast to unsigned.
3390
6aa452a6
AD
33912002-09-30 Akim Demaille <akim@epita.fr>
3392
3393 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
3394 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
3395 Updates from Michael Hayes.
3396
927f7817
AD
33972002-09-30 Art Haas <ahaas@neosoft.com>
3398
3399 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
3400 invocations.
3401 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
3402 defined.
3403
9738f41e
AD
34042002-09-27 Akim Demaille <akim@epita.fr>
3405
3406 Version 1.49c.
3407
a5c75d7f
AD
34082002-09-27 Akim Demaille <akim@epita.fr>
3409
3410 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
3411 (Because of AC_LIBSOURCE).
3412
8280e179
AD
34132002-09-27 Akim Demaille <akim@epita.fr>
3414
3415 Playing with Autoscan.
3416
3417 * configure.ac: Remove the old LIBOBJ tweaks.
3418 (AC_REPLACE_FUNCS): Add strrchr and strtol.
3419 * lib/strrchr.c: New.
3420 * lib/strtol.c: New, from the Coreutils 4.5.1.
3421
ae64af35
AD
34222002-09-27 Akim Demaille <akim@epita.fr>
3423
3424 Playing with Autoscan.
3425
3426 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
3427 * lib/Makefile.am (libbison_a_SOURCES): No longer include
3428 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
3429 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
3430 Coreutils 4.5.1.
3431
d1a1114f
AD
34322002-09-24 Akim Demaille <akim@epita.fr>
3433
3434 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
3435 (Frequently Asked Questions, Parser Stack Overflow): New.
3436
b906441c
AD
34372002-09-13 Akim Demaille <akim@epita.fr>
3438
3439 Playing with autoscan.
3440
3441 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
3442 * src/files.c (skeleton_find): Remove, unused.
3443 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
3444 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
3445
bd701811
AD
34462002-09-13 Akim Demaille <akim@epita.fr>
3447
3448 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
3449 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
3450
e0a13e7b
AD
34512002-09-13 Akim Demaille <akim@epita.fr>
3452
3453 * configure.ac: Require 2.54.
3454 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
3455 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
3456 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
3457 Remove, provided by Autoconf macros.
3458
c97011bf
AD
34592002-09-12 Akim Demaille <akim@epita.fr>
3460
3461 * m4/prereq.m4: Update, from Coreutils 4.5.1.
3462
d862b1be
AD
34632002-09-12 Akim Demaille <akim@epita.fr>
3464
3465 * m4/prereq.m4: Update, from Fileutils 4.1.5.
3466 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
3467 Reported by Martin Mokrejs.
3468
3d38c03a
AD
34692002-09-10 Akim Demaille <akim@epita.fr>
3470
3471 * src/parse-gram.y: Associate a human readable string to each
3472 token type.
3473 * tests/regression.at (Invalid inputs): Adjust.
3474
b6347355
AD
34752002-09-10 Gary V. Vaughan <gary@gnu.org>
3476
3477 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
3478 with an Autoconf-2.5x style configure.ac.
3479
09ba4ab2
PE
34802002-09-06 Paul Eggert <eggert@twinsun.com>
3481
3482 * doc/bison.texinfo (Conditions): Make explicit that the GPL
3483 exception applies only to yacc.c. This is a modification of a
3484 patch originally suggested by Akim Demaille.
3485
21846f69
AD
34862002-09-06 Akim Demaille <akim@epita.fr>
3487
09ba4ab2
PE
3488 * data/c.m4 (b4_copyright): Move the GPL exception comment from
3489 here to...
3490 * data/yacc.c: here.
3491
21846f69
AD
3492 * data/lalr1.cc (struct yyltype): Don't define it, since we use
3493 LocationType.
3494 (b4_ltype): Default to yy::Location from location.hh.
3495
c0ad8bf3
AD
34962002-09-04 Jim Meyering <jim@meyering.net>
3497
3498 * data/yacc.c: Guard the declaration of yytoknum also with
3499 `#ifdef YYPRINT', so it is declared only when used.
3500
3a93251e
AD
35012002-09-04 Akim Demaille <akim@epita.fr>
3502
3503 * configure.in: Rename as...
3504 * configure.ac: this.
3505 Bump to 1.49c.
3506
427c0dda
AD
35072002-09-04 Akim Demaille <akim@epita.fr>
3508
3509 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
3510 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
3511 translate maintainer only messages.
3512
6a254321
PE
35132002-08-12 Paul Eggert <eggert@twinsun.com>
3514
645e30d1
PE
3515 Version 1.49b.
3516
6a254321
PE
3517 * Makefile.am (SUBDIRS): Remove intl.
3518 (DISTCLEANFILES): Remove.
3519 * NEWS: Mention that GNU M4 is now required. Clarify what is
3520 meant by "larger grammars". Mention the pt_BR translation.
3521 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
3522 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
3523 Bump version from 0.11.2 to 0.11.5.
3524 (BISON_PREREQ_STAGE): Remove.
3525 (AM_GNU_GETTEXT): Use external gettext.
3526 (AC_OUTPUT): Remove intl/Makefile.
3527
3528 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
3529
3530 * data/glr.c: Include string.h, for strlen.
3531 (yyreportParseError): Use size_t for yysize.
3532 (yy_yypstack): No longer nested inside yypstates, as nested
3533 functions are not portable. Do not assume size_t is the
3534 same width as int.
3535 (yypstates): Do not assume that ptrdiff_t is the same width
3536 as int, and similarly for yyposn and YYINDEX.
3537
3538 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
3539
3540 * lib/Makefile.am (INCLUDES): Do not include from the intl
3541 directory, which has been removed.
3542 * src/Makefile.am (INCLUDES): Likewise.
3543
3544 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
3545 (bitsets_sources, additional_bitsets_sources, timevars_sources):
3546 New vars.
3547
3548 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
3549 * tests/Makefile.am (EXTRA_DIST): Likewise.
3550
3551 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
3552 Do not assume that bitset_windex is the same width as unsigned.
3553
3554 * lib/abitset.c (abitset_unused_clear): Do not assume that
3555 bitset_word is the same width as int.
3556 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
3557 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
3558 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
3559 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
3560 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
3561
3562 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
3563 portability to one's complement hosts!).
3564 * lib/ebitset.c (ebitset_op1): Likewise.
3565 * lib/lbitset.c (lbitset_op1): Likewise.
3566
3567 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
3568 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
3569 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
3570 Sync with fileutils.
3571 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
3572 lib/gettext.h: Sync with diffutils.
3573
3574 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
3575 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
3576
3577 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
3578 PROTOTYPES to check for prototypes, and "defined __STDC__" to
3579 check for void *.
3580
3581 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
3582 size_t; the old version tried to do this but casted improperly.
3583 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
3584 (bitset_test): Now returns int, not unsigned long.
3585
3586 * lib/bitset_stats.c: Include "gettext.h".
3587 (_): New macro.
3588 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
3589 name locals "index", as it generates unnecessary warnings on some
3590 hosts that have an "index" function.
3591
3592 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
3593 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
3594 they need translation.
3595 * src/LR0.c (state_list_append, new_itemsets, get_state,
3596 append_states, generate_states): Likewise.
3597 * src/assoc.c (assoc_to_string): Likewise.
3598 * src/closure.c (print_closure, set_firsts, closure): Likewise.
3599 * src/gram.c (grammar_dump): Likewise.
3600 * src/injections.c (injections_compute): Likewise.
3601 * src/lalr.c (lookaheads_print): Likewise.
3602 * src/relation.c (relation_transpose): Likewise.
3603 * src/scan-gram.l: Likewise.
3604 * src/tables.c (table_grow, pack_vector): Likewise.
3605
3606 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
3607 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
3608 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
3609 * m4/mbstate_t.m4: Sync with fileutils.
3610 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
3611
3612 * po/LINGUAS: Add pt_BR.
3613 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
3614 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
3615 lib/timevar.c.
3616 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
3617 manual recommends.
3618 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
3619
3620 * src/complain.c (strerror_r): Remove decl; not needed.
3621 (strerror): Use same pattern as ../lib/error.c.
3622
3623 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
3624
3625 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
3626
3627 * src/main.c (main): Cast result of bindtextdomain and textdomain
3628 to void, to avoid a GCC warning when --disable-nls is in effect.
3629
3630 * src/scan-gram.l: Use strings rather than escapes when possible,
3631 to minimize the number of warnings from xgettext.
3632 (handle_action_dollar, handle_action_at): Don't use isdigit,
3633 as it mishandles negative chars and it may not work as expected
3634 outside the C locale.
3635
3636 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
3637 this is a GCC extension and is not portable to other compilers.
3638
3639 * src/system.h (alloca): Use same pattern as ../lib/error.c.
3640 Do not include <ctype.h>; no longer needed.
3641 Do not include <malloc.h>; no longer needed (and generates
3642 warnings on OpenBSD 3.0).
3643
3644 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
3645 it's not portable.
3646
3647 * tests/regression.at: Do not use 'cc -c input.c -o input';
3648 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
3649
3650 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
3651 exit status as failure, not just exit status 1. Sun C exits
3652 with status 2 sometimes.
3653
3654 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
3655 Use it for the two large tests.
3656
c8f002c7
AD
36572002-08-02 Akim Demaille <akim@epita.fr>
3658
3659 * src/conflicts.c (conflicts_output): Don't output rules never
3660 reduced here, since anyway that computation doesn't work.
3661 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
3662 (rule_useless_p, rule_never_reduced_p): New.
3663 (grammar_rules_partial_print): Use a filter instead of a range.
3664 Display the title only if needed.
3665 (grammar_rules_print): Adjust.
3666 (grammar_rules_never_reduced_report): New.
3667 * src/tables.c (action_row): Move the computation of rules never
3668 reduced to...
3669 (token_actions): here.
3670 * src/main.c (main): Make the parser before making the report, so
3671 that rules never reduced are computed.
3672 Call grammar_rules_never_reduced_report.
3673 * src/print.c (print_results): Report rules never reduced.
3674 * tests/conflicts.at, tests/reduce.at: Adjust.
3675
cd08e51e
AD
36762002-08-01 Akim Demaille <akim@epita.fr>
3677
3678 Instead of attaching lookaheads and duplicating the rules being
3679 reduced by a state, attach the lookaheads to the reductions.
3680
3681 * src/state.h (state_t): Remove the `lookaheads',
3682 `lookaheads_rule' member.
3683 (reductions_t): Add a `lookaheads' member.
3684 Use a regular array for the `rules'.
3685 * src/state.c (reductions_new): Initialize the lookaheads member
3686 to 0.
3687 (state_rule_lookaheads_print): Adjust.
3688 * src/state.h, src/state.c (state_reductions_find): New.
3689 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
3690 (count_rr_conflicts): Adjust.
3691 * src/lalr.c (LArule): Remove.
3692 (add_lookback_edge): Adjust.
3693 (state_lookaheads_count): New.
3694 (states_lookaheads_initialize): Merge into...
3695 (initialize_LA): this.
3696 (lalr_free): Adjust.
3697 * src/main.c (main): Don't free nullable and derives too early: it
3698 is used by --verbose.
3699 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
3700
bb0027a9
AD
37012002-08-01 Akim Demaille <akim@epita.fr>
3702
3703 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
3704 `rule_number_t**'.
3705 (set_derives, free_derives): Rename as...
3706 (derives_compute, derives_free): this.
3707 Adjust all dependencies.
3708 * src/nullable.c (set_nullable, free_nullable): Rename as...
3709 (nullable_compute, nullable_free): these.
3710 (rule_list_t): Store rule_t *, not rule_number_t.
3711 * src/state.c (state_rule_lookaheads_print): Directly compare rule
3712 pointers, instead of their numbers.
3713 * src/main.c (main): Call nullable_free, and derives_free earlier,
3714 as they were lo longer used.
3715
3325ddc4
AD
37162002-08-01 Akim Demaille <akim@epita.fr>
3717
3718 * lib/timevar.c (get_time): Include children time.
3719 * src/lalr.h (LA, LArule): Don't export them: used with the
3720 state_t.
3721 * src/lalr.c (LA, LArule): Static.
3722 * src/lalr.h, src/lalr.c (lalr_free): New.
3723 * src/main.c (main): Call it.
3724 * src/tables.c (pack_vector): Check whether loc is >= to the
3725 table_size, not >.
3726 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
3727 (tables_generate): do it, since that's also it which allocates
3728 them.
3729 Don't free LA and LArule, main does.
3730
c6f1a33c
AD
37312002-07-31 Akim Demaille <akim@epita.fr>
3732
3733 Separate parser tables computation and output.
3734
3735 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
3736 (conflict_list, conflict_list_cnt, table, check, table_ninf)
3737 (yydefgoto, yydefact, high): Move to...
3738 * src/tables.h, src/tables.c: here.
3739 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
3740 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
3741 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
3742 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
3743 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
3744 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
3745 (action_row, save_row, token_actions, save_column, default_goto)
3746 (goto_actions, sort_actions, matching_state, pack_vector)
3747 (table_ninf_remap, pack_table, prepare_actions): Move to...
3748 * src/tables.c: here.
3749 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
3750 * src/output.c (token_actions, output_base, output_conflicts)
3751 (output_check): Merge into...
3752 (prepare_actions): this.
3753 (actions_output): Rename as...
3754 (user_actions_output): this.
3755 * src/main.c (main): Call tables_generate and tables_free.
3756
1509d42f
AD
37572002-07-31 Akim Demaille <akim@epita.fr>
3758
3759 Steal GCC's --time-report support.
3760
3761 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
3762 stolen/adjusted from GCC.
3763 * m4/stage.m4: Remove time related checks.
3764 * m4/timevar.m4: New.
3765 * configure.in: Adjust.
3766 * src/system.h: Adjust to using timevar.h.
3767 * src/getargs.h, src/getargs.c: Support trace_time for
3768 --trace=time.
3769 * src/main.c (stage): Remove.
3770 (main): Replace `stage' invocations with timevar calls.
3771 * src/output.c: Insert pertinent timevar calls.
3772
273a74fa
AD
37732002-07-31 Akim Demaille <akim@epita.fr>
3774
3775 Let --trace have arguments.
3776
3777 * src/getargs.h (enum trace_e): New.
3778 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
3779 (long_options, short_options): --trace/-T takes an optional
3780 argument.
3781 Change all the uses of trace_flag to reflect the new flags.
3782 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
3783
3784 Strengthen `stage' portability.
3785
3786 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
3787 * configure.in: Use it.
3788 Don't check for malloc.h and sys/times.h.
3789 * src/system.h: Include them when appropriate.
3790 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
3791 times and struct tms are available.
3792
217598da
AD
37932002-07-30 Akim Demaille <akim@epita.fr>
3794
3795 In verbose parse error message, don't report `error' as an
3796 expected token.
3797 * tests/actions.at (Printers and Destructors): Adjust.
3798 * tests/calc.at (Calculator $1): Adjust.
3799 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
3800 error message, do not report the parser accepts the error token in
3801 that state.
3802
52489d44
AD
38032002-07-30 Akim Demaille <akim@epita.fr>
3804
3805 Normalize conflict related messages.
3806
3807 * src/complain.h, src/complain.c (warn, complain): New.
3808 * src/conflicts.c (conflicts_print): Use them.
3809 (conflict_report_yacc): New, extracted from...
3810 (conflicts_print): here.
3811 * tests/conflicts.at, tests/existing.at: Adjust.
3812
e8832397
AD
38132002-07-30 Akim Demaille <akim@epita.fr>
3814
3815 Report rules which are never reduced by the parser: those hidden
3816 by conflicts.
3817
3818 * src/LR0.c (save_reductions): Don't make the final state too
3819 different: save its reduction (accept) instead of having a state
3820 without any action (no shift or goto, no reduce).
3821 Note: the final state is now a ``regular'' state, i.e., the
3822 parsers now contain `reduce 0' as default reduction.
3823 Nevertheless, since they decide to `accept' when yystate =
3824 final_state, they still will not reduce rule 0.
3825 * src/print.c (print_actions, print_reduction): Adjust.
3826 * src/output.c (action_row): Track reduced rules.
3827 (token_actions): Report rules never reduced.
3828 * tests/conflicts.at, tests/regression.at: Adjust.
3829
caf23d24
AD
38302002-07-30 Akim Demaille <akim@epita.fr>
3831
3832 `stage' was accidently included in a previous patch.
3833 Initiate its autoconfiscation.
3834
3835 * configure.in: Look for malloc.h and sys/times.h.
3836 * src/main.c (stage): Adjust.
3837 Report only when trace_flag.
3838
640748ee
AD
38392002-07-29 Akim Demaille <akim@epita.fr>
3840
3841 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
3842 state_number_t.
3843 (errs_t): symbol_t*, not symbol_number_t.
3844 (reductions_t): rule_t*, not rule_number_t.
3845 (FOR_EACH_SHIFT): New.
3846 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
3847 * src/print.c, src/print_graph.c: Adjust.
3848
88bce5a2
AD
38492002-07-29 Akim Demaille <akim@epita.fr>
3850
3851 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
3852
3853 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
3854 (endtoken, accept): these.
3855 * src/reader.c (reader): Set endtoken's default tag to "$end".
3856 Set undeftoken's tag to "$undefined" instead of "$undefined.".
3857 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
3858 Adjust.
3859
1bfb97db
AD
38602002-07-29 Akim Demaille <akim@epita.fr>
3861
3862 * src/reduce.c (reduce_grammar): When the language is empty,
3863 complain about the start symbol, not the axiom.
3864 Use its location.
3865 * tests/reduce.at (Empty Language): New.
3866
fc5734fe
AD
38672002-07-26 Akim Demaille <akim@epita.fr>
3868
3869 * src/reader.h, src/reader.c (gram_error): ... can't get
3870 yycontrol without making too strong assumptions on the parser
3871 itself.
3872 * src/output.c (prepare_tokens): Use the real 0th value of
3873 token_translations instead of `0'.
3874 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
3875 visible here.
3876 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
3877 for the time being: %locations ought to provide it to yyerror.
3878
3650b4b8
AD
38792002-07-25 Akim Demaille <akim@epita.fr>
3880
3881 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
3882 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
3883 * tests/regression.at (Web2c Actions): Adjust.
3884
4b3d3a8e
AD
38852002-07-25 Akim Demaille <akim@epita.fr>
3886
3887 Stop storing rules from 1 to nrules + 1.
3888
3889 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
3890 * src/nullable.c, src/output.c, src/print.c, src/reader.c
3891 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
3892 Iterate from 0 to nrules.
3893 Use rule_number_as_item_number and item_number_as_rule_number.
3894 Adjust to `derive' now containing possibly 0.
3895 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
3896 Handle the `- 1' part in rule numbers from/to item numbers.
3897 * src/conflicts.c (log_resolution): Fix the message which reversed
3898 shift and reduce.
3899 * src/output.c (action_row): Initialize default_rule to -1.
3900 (token_actions): Adjust.
3901 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
3902 expected output.
3903 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
3904
4a2a22f4
AD
39052002-07-25 Akim Demaille <akim@epita.fr>
3906
3907 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
3908 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
3909 (b4_c_knr_arg_decl): New.
3910 * data/yacc.c: Use it to define yysymprint, yydestruct, and
3911 yyreport_parse_error.
3912
b8df3223
AD
39132002-07-25 Akim Demaille <akim@epita.fr>
3914
3915 * data/yacc.c (yyreport_parse_error): New, extracted from...
3916 (yyparse): here.
3917 (yydestruct, yysymprint): Move above yyparse.
3918 Be K&R compliant.
3919
a762e609
AD
39202002-07-25 Akim Demaille <akim@epita.fr>
3921
3922 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
3923 replace...
3924 (b4_sint_type, b4_uint_type): these.
3925 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
3926 * tests/regression.at (Web2c Actions): Adjust.
3927
12b0043a
AD
39282002-07-25 Akim Demaille <akim@epita.fr>
3929
3930 * src/gram.h (TIEM_NUMBER_MAX): New.
3931 (item_number_of_rule_number, rule_number_of_item_number): Rename
3932 as...
3933 (rule_number_as_item_number, item_number_as_rule_number): these.
3934 Adjust dependencies.
3935 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
3936 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
3937 (symbol_number_to_vector_number): New.
3938 (order): Of vector_number_t* type.
3939 (base_t, BASE_MAX, BASE_MIN): New.
3940 (froms, tos, width, pos, check): Of base_t type.
3941 (action_number_t, ACTION_MIN, ACTION_MAX): New.
3942 (actrow): Of action_number_t type.
3943 (conflrow): Of unsigned int type.
3944 (table_ninf, base_ninf): New.
3945 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
3946 (muscle_insert_int_table, muscle_insert_base_table)
3947 (muscle_insert_rule_number_table): New.
3948 (prepare_tokens): Output `toknum' as int_table.
3949 (action_row): Returns a rule_number_t.
3950 Use ACTION_MIN, not SHRT_MIN.
3951 (token_actions): yydefact is rule_number_t*.
3952 (table_ninf_remap): New.
3953 (pack_table): Use it for `base' and `table'.
3954 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
3955 replaced with...
3956 (YYPACT_NINF, YYTABLE_NINF): these.
3957 (yypact, yytable): Compute their types instead of hard-coded
3958 `short'.
3959 * tests/regression.at (Web2c Actions): Adjust.
3960
5dde258a
AD
39612002-07-19 Akim Demaille <akim@epita.fr>
3962
3963 * src/scan-gram.l (id): Can start with an underscore.
3964
a945ec39
AD
39652002-07-16 Akim Demaille <akim@epita.fr>
3966
3967 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
3968 Adjust all former `associativity' dependencies.
3969 * src/symtab.c (symbol_new): Default associativity is `undef', not
3970 `right'.
3971 (symbol_check_alias_consistence): Adjust.
3972
fae437e8
AD
39732002-07-09 Akim Demaille <akim@epita.fr>
3974
3975 * doc/bison.texinfo: Properly set the ``header'' part.
3976 Use @dircategory ``GNU programming tools'' as per Texinfo's
3977 documentation.
3978 Use @copying.
3979
1a715ef2
AD
39802002-07-09 Akim Demaille <akim@epita.fr>
3981
3982 * lib/quotearg.h: Protect against multiple inclusions.
3983 * src/location.h (location_t): Add a `file' member.
3984 (LOCATION_RESET, LOCATION_PRINT): Adjust.
3985 * src/complain.c (warn_at, complain_at, fatal_at): Drop
3986 `error_one_per_line' support.
3987
a5d50994
AD
39882002-07-09 Akim Demaille <akim@epita.fr>
3989
3990 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
3991 * src/reader.c (lineno): Remove.
3992 Adjust all dependencies.
3993 (get_merge_function): Take a location and use complain_at.
3994 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
3995 * tests/regression.at (Invalid inputs, Mixing %token styles):
3996 Adjust.
3997
b275314e
AD
39982002-07-09 Akim Demaille <akim@epita.fr>
3999
4000 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
4001 recovery rule, and forbid extensions when --yacc.
4002 (gram_error): Use complain_at.
4003 * src/reader.c (reader): Exit if there were parse errors.
4004
865b9df1
AD
40052002-07-09 Akim Demaille <akim@epita.fr>
4006
4007 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
4008 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
4009 Reported by R Blake <blakers@mac.com>.
4010
c76e14da
AD
40112002-07-09 Akim Demaille <akim@epita.fr>
4012
4013 * data/yacc.c: Output the copyright notive in the header.
4014
7db2ed2d
AD
40152002-07-03 Akim Demaille <akim@epita.fr>
4016
4017 * src/output.c (froms, tos): Are state_number_t.
4018 (save_column): sp, sp1, and sp2 are state_number_t.
4019 (prepare): Rename `final' as `final_state_number', `nnts' as
4020 `nterms_number', `nrules' as `rules_number', `nstates' as
4021 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
4022 unused.
4023 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
4024 * data/lalr1.cc (nsym_): Remove, unused.
4025
e68e0410
AD
40262002-07-03 Akim Demaille <akim@epita.fr>
4027
4028 * src/lalr.h, src/lalr.c (goto_number_t): New.
4029 * src/lalr.c (goto_list_t): New.
4030 Propagate them.
4031 * src/nullable.c (rule_list_t): New.
4032 Propagate.
4033 * src/types.h: Remove.
4034
e1a4f3a4
AD
40352002-07-03 Akim Demaille <akim@epita.fr>
4036
4037 * src/closure.c (print_fderives): Use rule_rhs_print.
4038 * src/derives.c (print_derives): Use rule_rhs_print.
4039 (rule_list_t): New, replaces `shorts'.
4040 (set_derives): Add comments.
4041 * tests/sets.at (Nullable, Firsts): Adjust.
4042
536545f3
AD
40432002-07-03 Akim Demaille <akim@epita.fr>
4044
4045 * src/output.c (prepare_actions): Free `tally' and `width'.
4046 (prepare_actions): Allocate and free `order'.
4047 * src/symtab.c (symbols_free): Free `symbols'.
4048 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
4049 * src/output.c (m4_invoke): Move to...
4050 * src/scan-skel.l: here.
4051 (<<EOF>>): Close yyout, and free its name.
4052
8b752b00
AD
40532002-07-03 Akim Demaille <akim@epita.fr>
4054
4055 Fix some memory leaks, and fix a bug: state 0 was examined twice.
4056
4057 * src/LR0.c (new_state): Merge into...
4058 (state_list_append): this.
4059 (new_states): Merge into...
4060 (generate_states): here.
4061 (set_states): Don't ensure a proper `errs' state member here, do it...
4062 * src/conflicts.c (conflicts_solve): here.
4063 * src/state.h, src/state.c: Comment changes.
4064 (state_t): Rename member `shifts' as `transitions'.
4065 Adjust all dependencies.
4066 (errs_new): For consistency, also take the values as argument.
4067 (errs_dup): Remove.
4068 (state_errs_set): New.
4069 (state_reductions_set, state_transitions_set): Assert that no
4070 previous value was assigned.
4071 (state_free): New.
4072 (states_free): Use it.
4073 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
4074 temporary storage: use `errs' and `nerrs' as elsewhere.
4075 (set_conflicts): Allocate and free this `errs'.
4076
613f5e1a
AD
40772002-07-02 Akim Demaille <akim@epita.fr>
4078
4079 * lib/libiberty.h: New.
4080 * lib: Update the bitset implementation from upstream.
4081 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
4082 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
4083 * src/main.c: Adjust bitset stats calls.
4084
26e0cadc
PE
40852002-07-01 Paul Eggert <eggert@twinsun.com>
4086
4087 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
4088 char, so that negative chars don't collide with $.
4089
1154cced
AD
40902002-06-30 Akim Demaille <akim@epita.fr>
4091
4092 Have the GLR tests be `warning' checked, and fix the warnings.
4093
4094 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
4095 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
4096 (yyremoveDeletes): `yyi' and `yyj' are size_t.
4097 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
4098 (yyaddDeferredAction): static.
4099 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
4100 (yyreportParseError): yyprefix is const.
4101 yytokenp is used only when verbose.
4102 (yy__GNUC__): Replace with __GNUC__.
4103 (yypdumpstack): yyi is size_t.
4104 (yypreference): Un-yy local variables and arguments, to avoid
4105 clashes with `yyr1'. Anyway, we are not in the user name space.
4106 (yytname_size): be an int, as is compared with ints.
4107 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
4108 Use them.
4109 * tests/cxx-gram.at: Use quotation to protect $1.
4110 Use AT_COMPILE to enable warnings hunts.
4111 Prototype yylex and yyerror.
4112 `Use' argc.
4113 Include `string.h', not `strings.h'.
4114 Produce and prototype stmtMerge only when used.
4115 yylex takes a location.
4116
97650f4e
AD
41172002-06-30 Akim Demaille <akim@epita.fr>
4118
4119 We spend a lot of time in quotearg, in particular when --verbose.
4120
4121 * src/symtab.c (symbol_get): Store a quoted version of the key.
4122 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
4123 Adjust all callers.
4124
d2576365
AD
41252002-06-30 Akim Demaille <akim@epita.fr>
4126
4127 * src/state.h (reductions_t): Rename member `nreds' as num.
4128 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
4129 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
4130
ccaf65bc
AD
41312002-06-30 Akim Demaille <akim@epita.fr>
4132
4133 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
4134 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
4135 (shifts_to): Rename as...
4136 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
4137 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
4138 (TRANSITION_IS_DISABLED, transitions_to): these.
4139
87675353
AD
41402002-06-30 Akim Demaille <akim@epita.fr>
4141
4142 * src/print.c (print_shifts, print_gotos): Merge into...
4143 (print_transitions): this.
4144 (print_transitions, print_errs, print_reductions): Align the
4145 lookaheads columns.
4146 (print_core, print_transitions, print_errs, print_state,
4147 print_grammar): Output empty lines separator before, not after.
4148 (state_default_rule_compute): Rename as...
4149 (state_default_rule): this.
4150 * tests/conflicts.at (Defaulted Conflicted Reduction),
4151 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
4152 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
4153
ce4ccb4b
AD
41542002-06-30 Akim Demaille <akim@epita.fr>
4155
4156 Display items as we display rules.
4157
4158 * src/gram.h, src/gram.c (rule_lhs_print): New.
4159 * src/gram.c (grammar_rules_partial_print): Use it.
4160 * src/print.c (print_core): Likewise.
4161 * tests/conflicts.at (Defaulted Conflicted Reduction),
4162 (Unresolved SR Conflicts): Adjust.
4163 (Unresolved SR Conflicts): Adjust and rename as...
4164 (Resolved SR Conflicts): this, as was meant.
4165 * tests/regression.at (Web2c Report): Adjust.
4166
bc933ef1
AD
41672002-06-30 Akim Demaille <akim@epita.fr>
4168
4169 * src/print.c (state_default_rule_compute): New, extracted from...
4170 (print_reductions): here.
4171 Pessimize, but clarify the code.
4172 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
4173
53d4308d
AD
41742002-06-30 Akim Demaille <akim@epita.fr>
4175
4176 * src/output.c (action_row): Let default_rule be always a rule
4177 number.
4178
574fb2d5
AD
41792002-06-30 Akim Demaille <akim@epita.fr>
4180
4181 * src/closure.c (print_firsts, print_fderives, closure):
4182 Use BITSET_EXECUTE.
4183 * src/lalr.c (lookaheads_print): Likewise.
4184 * src/state.c (state_rule_lookaheads_print): Likewise.
4185 * src/print_graph.c (print_core): Likewise.
4186 * src/print.c (print_reductions): Likewise.
4187 * src/output.c (action_row): Likewise.
4188 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
4189
05811fd7
AD
41902002-06-30 Akim Demaille <akim@epita.fr>
4191
4192 * src/print_graph.c: Use report_flag.
4193
0e4d5753
AD
41942002-06-30 Akim Demaille <akim@epita.fr>
4195
4196 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
4197 to...
4198 * src/relation.h, src/relation.c (traverse, relation_digraph)
4199 (relation_print, relation_transpose): New.
4200
24c7d800
AD
42012002-06-30 Akim Demaille <akim@epita.fr>
4202
4203 * src/state.h, src/state.c (shifts_to): New.
4204 * src/lalr.c (build_relations): Use it.
4205
9222837b
AD
42062002-06-30 Akim Demaille <akim@epita.fr>
4207
4208 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
4209 (item_number_of_rule_number, rule_number_of_item_number): New.
4210 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
4211 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
4212 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
4213 Propagate their use.
4214 Much remains to be done, in particular wrt `shorts' from types.h.
4215
260008e5
AD
42162002-06-30 Akim Demaille <akim@epita.fr>
4217
4218 * src/symtab.c (symbol_new): Initialize the `printer' member.
4219
8a731ca8
AD
42202002-06-30 Akim Demaille <akim@epita.fr>
4221
4222 * src/LR0.c (save_reductions): Remove, replaced by...
4223 * src/state.h, src/state.c (state_reductions_set): New.
4224 (reductions, errs): Rename as...
4225 (reductions_t, errs_t): these.
4226 Adjust all dependencies.
4227
32e1e0a4
AD
42282002-06-30 Akim Demaille <akim@epita.fr>
4229
4230 * src/LR0.c (state_list_t, state_list_append): New.
4231 (first_state, last_state): Now symbol_list_t.
4232 (this_state): Remove.
4233 (new_itemsets, append_states, save_reductions): Take a state_t as
4234 argument.
4235 (set_states, generate_states): Adjust.
4236 (save_shifts): Remove, replaced by...
4237 * src/state.h, src/state.c (state_shifts_set): New.
4238 (shifts): Rename as...
4239 (shifts_t): this.
4240 Adjust all dependencies.
4241 * src/state.h (state_t): Remove the `next' member.
4242
e5fb6710
AD
42432002-06-30 Akim Demaille <akim@epita.fr>
4244
4245 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
4246 escaped in slot 0.
4247
c7ca99d4
AD
42482002-06-30 Akim Demaille <akim@epita.fr>
4249
4250 Use hash.h for the state hash table.
4251
4252 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
4253 (allocate_storage): Use state_hash_new.
4254 (free_storage): Use state_hash_free.
4255 (new_state, get_state): Adjust.
4256 * src/lalr.h, src/lalr.c (states): Move to...
4257 * src/states.h (state_t): Remove the `link' member, no longer
4258 used.
4259 * src/states.h, src/states.c: here.
4260 (state_hash_new, state_hash_free, state_hash_lookup)
4261 (state_hash_insert, states_free): New.
4262 * src/states.c (state_table, state_compare, state_hash): New.
4263 * src/output.c (output_actions): Do not free states now, since we
4264 still need to know the final_state number in `prepare', called
4265 afterwards. Do it...
4266 * src/main.c (main): here: call states_free after `output'.
4267
df0e7316
AD
42682002-06-30 Akim Demaille <akim@epita.fr>
4269
4270 * src/state.h, src/state.c (state_new): New, extracted from...
4271 * src/LR0.c (new_state): here.
4272 * src/state.h (STATE_ALLOC): Move to...
4273 * src/state.c: here.
4274 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
4275 * src/state.h, src/state.c: here.
4276
39f41916
AD
42772002-06-30 Akim Demaille <akim@epita.fr>
4278
4279 * src/reader.c (gensym): Rename as...
4280 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
4281 (getsym): Rename as...
4282 (symbol_get): this.
4283
d57650a5
AD
42842002-06-30 Akim Demaille <akim@epita.fr>
4285
4286 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
4287 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
4288 * src/output.c, src/print.c, src/print_graph.c: Propagate.
4289 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
4290
5a08f1ce
AD
42912002-06-30 Akim Demaille <akim@epita.fr>
4292
4293 Make the test suite pass with warnings checked.
4294
4295 * tests/actions.at (Printers and Destructors): Improve.
4296 Avoid unsigned vs. signed issues.
4297 * tests/calc.at: Don't exercise the scanner here, do it...
4298 * tests/input.at (Torturing the Scanner): here.
4299
720623af
PH
43002002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4301
88e7e941 4302 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
4303 reorganize first lines parallel to yacc.c.
4304
fb8135fa
AD
43052002-06-28 Akim Demaille <akim@epita.fr>
4306
4307 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
4308 (b4_token_enum, b4_token_defines): New, factored from...
4309 * data/lalr1.cc, data/yacc.c, glr.c: here.
4310
41442480
AD
43112002-06-28 Akim Demaille <akim@epita.fr>
4312
4313 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
4314 unused variables.
4315 * src/output.c (merger_output): static.
4316
e0e5bf84
AD
43172002-06-28 Akim Demaille <akim@epita.fr>
4318
4319 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
4320 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
4321 pacify GCC.
4322 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 4323
676385e2
PH
43242002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4325
4326 Accumulated changelog for new GLR parsing features.
4327
6a254321 4328 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
4329 conflicts_total_count.
4330 * src/conflicts.h: Ditto.
4331 * src/output.c (token_actions): Use the new name.
4332 (output_conflicts): Change conflp => conflict_list_heads, and
4333 confl => conflict_list for better readability.
4334 * data/glr.c: Use the new names.
4335 * NEWS: Add self to GLR announcement.
e0e5bf84 4336
676385e2
PH
4337 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
4338
4339 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
4340 Akim Demaille.
4341
4342 * data/bison.glr: Change name to glr.c
4343 * data/glr.c: Renamed from bison.glr.
4344 * data/Makefile.am: Add glr.c
e0e5bf84
AD
4345
4346 * src/getargs.c:
4347
676385e2
PH
4348 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
4349 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 4350
676385e2
PH
4351 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4352
4353 * data/bison.glr: Be sure to restore the
4354 current #line when returning to the skeleton contents after having
4355 exposed the input file's #line.
4356
4357 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4358
4359 * data/bison.glr: Bring up to date with changes to bison.simple.
4360
4361 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4362
4363 * data/bison.glr: Correct definitions that use b4_prefix.
4364 Various reformatting.
4365 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
4366 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
4367 yytokenp argument; now part of stack.
4368 (yychar): Define to behave as documented.
4369 (yyclearin): Ditto.
e0e5bf84 4370
676385e2
PH
4371 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4372
4373 * src/reader.h: Add declaration for free_merger_functions.
4374
4375 * src/reader.c (merge_functions): New variable.
4376 (get_merge_function): New function.
4377 (free_merger_functions): New function.
4378 (readgram): Check for %prec that is not followed by a symbol.
4379 Handle %dprec and %merge declarations.
4380 (packgram): Initialize dprec and merger fields in rules array.
4381
4382 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
4383 conflict_list_cnt, conflict_list_free): New variables.
4384 (table_grow): Also grow conflict_table.
e0e5bf84 4385 (prepare_rules): Output dprec and merger tables.
676385e2 4386 (conflict_row): New function.
e0e5bf84 4387 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
4388 default reduction in conflicted states for GLR parser so that there
4389 are spaces for the conflict lists.
4390 (save_row): Also save conflict information.
4391 (token_actions): Allocate conflict list.
4392 (merger_output): New function.
4393 (pack_vector): Pack conflict table, too.
4394 (output_conflicts): New function to output yyconflp and yyconfl.
4395 (output_check): Allocate conflict_tos.
4396 (output_actions): Output conflict tables, also.
4397 (output_skeleton): Output b4_mergers definition.
4398 (prepare): Output b4_max_rhs_length definition.
4399 Use 'bison.glr' as default skeleton for GLR parsers.
4400
4401 * src/gram.c (glr_parser): New flag.
4402 (grammar_free): Call free_merger_functions.
4403
4404 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
4405 all pairs of conflicting reductions, rather than just all tokens
4406 causing conflicts. Needed to size conflict tables.
e0e5bf84 4407 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
4408 interface.
4409 (conflicts_print): Ditto.
4410 (count_total_conflicts): New function.
4411
4412 * src/reader.h (merger_list): New type.
4413 (merge_functions): New variable.
4414
4415 * src/lex.h (tok_dprec, tok_merge): New token types.
4416
4417 * src/gram.h (rule_s): Add dprec and merger fields.
4418 (glr_parser): New flag.
4419
4420 * src/conflicts.h (count_total_conflicts): New function.
4421
4422 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
4423
4424 * doc/bison.texinfo (Generalized LR Parsing): New section.
4425 (GLR Parsers): New section.
4426 (Language and Grammar): Mention GLR parsing.
4427 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
4428 Correct typo ("tge" -> "the").
4429
4430 * data/bison.glr: New skeleton for GLR parsing.
4431
4432 * tests/cxx-gram.at: New tests for GLR parsing.
4433
4434 * tests/testsuite.at: Include cxx-gram.at.
4435
4436 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 4437
676385e2
PH
4438 * src/parse-gram.y:
4439
4440 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
4441
4442 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 4443
b5480d74 44442002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
4445
4446 * src/options.h, src/options.c: Remove.
4447 * src/getargs.c (short_options, long_options): New.
4448
60491a94
AD
44492002-06-27 Akim Demaille <akim@epita.fr>
4450
4451 * data/bison.simple, data/bison.c++: Rename as...
4452 * data/yacc.c, data/lalr1.cc: these.
4453 * doc/bison.texinfo (Environment Variables): Remove.
4454
9be0c25b
AD
44552002-06-25 Raja R Harinath <harinath@cs.umn.edu>
4456
4457 * src/getargs.c (report_argmatch): Initialize strtok().
4458
1ae72863
AD
44592002-06-20 Akim Demaille <akim@epita.fr>
4460
4461 * data/bison.simple (b4_symbol_actions): New, replaces...
4462 (b4_symbol_destructor, b4_symbol_printer): these.
4463 (yysymprint): Be sure to call YYPRINT only for tokens, and using
4464 user token numbers.
4465
87542d29
AD
44662002-06-20 Akim Demaille <akim@epita.fr>
4467
4468 * data/bison.simple (yydestructor): Rename as...
4469 (yydestruct): this.
4470
1a31ed21
AD
44712002-06-20 Akim Demaille <akim@epita.fr>
4472
4473 * src/symtab.h, src/symtab.c (symbol_type_set)
4474 (symbol_destructor_set, symbol_precedence_set): The location is
4475 the last argument.
4476 Adjust all callers.
4477
e776192e
AD
44782002-06-20 Akim Demaille <akim@epita.fr>
4479
4480 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
4481 internals.
4482 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
4483 Takes a location.
4484 * src/symtab.h, src/symtab.c (symbol_class_set)
4485 (symbol_user_token_number_set): Likewise.
4486 Adjust all callers.
4487 Promote complain_at.
4488 * tests/input.at (Type Clashes): Adjust.
4489
5c1180b3
AD
44902002-06-20 Akim Demaille <akim@epita.fr>
4491
4492 * data/bison.simple (YYLEX): Fix the declaration when
4493 %pure-parser.
4494
e3170060
AD
44952002-06-20 Akim Demaille <akim@epita.fr>
4496
4497 * data/bison.simple (yysymprint): Don't print the token number,
4498 just its name.
4499 * tests/actions.at (Destructors): Rename as...
4500 (Printers and Destructors): this.
4501 Also exercise %printer.
4502
253862fd
AD
45032002-06-20 Akim Demaille <akim@epita.fr>
4504
4505 * data/bison.simple (YYDSYMPRINT): New.
4506 Use it to remove many of the #if YYDEBUG/if (yydebug).
4507
366eea36
AD
45082002-06-20 Akim Demaille <akim@epita.fr>
4509
4510 * src/symtab.h, src/symtab.c (symbol_t): printer and
4511 printer_location are new members.
4512 (symbol_printer_set): New.
4513 * src/parse-gram.y (PERCENT_PRINTER): New token.
4514 Handle its associated rule.
4515 * src/scan-gram.l: Adjust.
4516 (handle_destructor_at, handle_destructor_dollar): Rename as...
4517 (handle_symbol_code_at, handle_symbol_code_dollar): these.
4518 * src/output.c (symbol_printers_output): New.
4519 (output_skeleton): Call it.
4520 * data/bison.simple (yysymprint): New. Cannot be named yyprint
4521 since there are already many grammar files with a user `yyprint'.
4522 Replace the calls to YYPRINT to calls to yysymprint.
4523 * tests/calc.at: Adjust.
4524 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
4525 taking advantage of parser very internal details (stack size!).
4526
4f25ebb0
AD
45272002-06-20 Akim Demaille <akim@epita.fr>
4528
4529 * src/scan-gram.l: Complete the scanner with the missing patterns
4530 to pacify Flex.
4531 Use `quote' and `symbol_tag_get' where appropriate.
4532
93b68a0e
AD
45332002-06-19 Akim Demaille <akim@epita.fr>
4534
4535 * tests/actions.at (Destructors): Augment to test locations.
4536 * data/bison.simple (yydestructor): Pass it the current location
4537 if locations are enabled.
4538 Prototype only when __STDC__ or C++.
4539 Change the argument names to move into the yy name space: there is
4540 user code here.
4541
58612f1d
AD
45422002-06-19 Akim Demaille <akim@epita.fr>
4543
74310291
AD
4544 * data/bison.simple (b4_pure_if): New.
4545 Use it instead of #ifdef YYPURE.
4546
45472002-06-19 Akim Demaille <akim@epita.fr>
4548
4549 * data/bison.simple (b4_location_if): New.
58612f1d
AD
4550 Use it instead of #ifdef YYLSP_NEEDED.
4551
f25bfb75
AD
45522002-06-19 Akim Demaille <akim@epita.fr>
4553
4554 Prepare @$ in %destructor, but currently don't bind it in the
4555 skeleton, as %location use is not cleaned up yet.
4556
4557 * src/scan-gram.l (handle_dollar, handle_destructor_at)
4558 (handle_action_at): New.
4559 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
4560 a braced_code_t and a location as additional arguments.
4561 (handle_destructor_dollar): Instead of requiring `b4_eval', just
4562 unquote one when outputting `b4_dollar_dollar'.
4563 Adjust callers.
4564 * data/bison.simple (b4_eval): Remove.
4565 (b4_symbol_destructor): Adjust.
4566 * tests/input.at (Invalid @n): Adjust.
4567
c732d2c6
AD
45682002-06-19 Zack Weinberg <zack@codesourcery.com>
4569
4570 * doc/bison.texinfo: Document ability to have multiple
4571 prologue sections.
4572
8c165d89
AD
45732002-06-18 Akim Demaille <akim@epita.fr>
4574
4575 * src/files.c (compute_base_names): When computing the output file
4576 names from the input file name, strip the directory part.
4577
ca98bf57
AD
45782002-06-18 Akim Demaille <akim@epita.fr>
4579
4580 * data/bison.simple.new: Comment changes.
4581 Reported by Andreas Schwab.
4582
0bfb02ff
AD
45832002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
4584
4585 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
4586 there are no `label `yyoverflowlab' defined but not used' warnings
4587 when yyoverflow is defined.
4588
24c0aad7
AD
45892002-06-18 Akim Demaille <akim@epita.fr>
4590
4591 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
4592 new member.
4593 (symbol_destructor_set): Adjust.
4594 * src/output.c (symbol_destructors_output): Output the destructor
4595 locations.
4596 Output the symbol name.
4597 * data/bison.simple (b4_symbol_destructor): Adjust.
4598
5719c109
AD
45992002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
4600 and Akim Demaille <akim@epita.fr>
4601
4602 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
4603 what's left on the stack when the error recovery hits EOF.
4604 * tests/actions.at (Destructors): Complete to exercise this case.
4605
9280d3ef
AD
46062002-06-17 Akim Demaille <akim@epita.fr>
4607
4608 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
4609 arguments is really empty, not only equal to `[]'.
4610 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
4611 member.
4612 (symbol_destructor_set): New.
4613 * src/output.c (symbol_destructors_output): New.
4614 * src/reader.h (brace_code_t, current_braced_code): New.
4615 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
4616 (handle_dollar): Rename as...
4617 (handle_action_dollar): this.
4618 (handle_destructor_dollar): New.
4619 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
4620 (grammar_declaration): Use it.
4621 * data/bison.simple (yystos): Is always defined.
4622 (yydestructor): New.
4623 * tests/actions.at (Destructors): New.
4624 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
4625
dafdc66f
AD
46262002-06-17 Akim Demaille <akim@epita.fr>
4627
4628 * src/symlist.h, src/symlist.c (symbol_list_length): New.
4629 * src/scan-gram.l (handle_dollar, handle_at): Compute the
4630 rule_length only when needed.
4631 * src/output.c (actions_output, token_definitions_output): Output
4632 the full M4 block.
4633 * src/symtab.c: Don't access directly to the symbol tag, use
4634 symbol_tag_get.
4635 * src/parse-gram.y: Use symbol_list_free.
4636
56c47203
AD
46372002-06-17 Akim Demaille <akim@epita.fr>
4638
4639 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
4640 (symbol_list_prepend, get_type_name): Move to...
4641 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
4642 (symbol_list_prepend, symbol_list_n_type_name_get): here.
4643 Adjust all callers.
4644 (symbol_list_free): New.
4645 * src/scan-gram.l (handle_dollar): Takes a location.
4646 * tests/input.at (Invalid $n): Adjust.
4647
1e0bab92
AD
46482002-06-17 Akim Demaille <akim@epita.fr>
4649
4650 * src/reader.h, src/reader.c (symbol_list_new): Export it.
4651 (symbol_list_prepend): New.
4652 * src/parse-gram.y (%union): `list' is a new member.
4653 (symbols.1): New, replaces...
4654 (terms_to_prec.1, nterms_to_type.1): these.
4655 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
4656 Take a location as additional argument.
4657 Adjust all callers.
4658
04e60654
AD
46592002-06-15 Akim Demaille <akim@epita.fr>
4660
4661 * src/parse-gram.y: Move %token in the declaration section so that
4662 we don't depend upon CVS Bison.
4663
10e5b8bd
AD
46642002-06-15 Akim Demaille <akim@epita.fr>
4665
4666 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
4667 * src/print.c (print_core): Use it.
4668
9801d40c
AD
46692002-06-15 Akim Demaille <akim@epita.fr>
4670
4671 * src/conflicts.c (log_resolution): Accept the rule involved in
4672 the sr conflicts instead of the lookahead number that points to
4673 that rule.
4674 (flush_reduce): Accept the current lookahead vector as argument,
4675 instead of the index in LA.
4676 (resolve_sr_conflict): Accept the current number of lookahead
4677 bitset to consider for the STATE, instead of the index in LA.
4678 (set_conflicts): Adjust.
4679 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
4680
c0263492
AD
46812002-06-15 Akim Demaille <akim@epita.fr>
4682
4683 * src/state.h (state_t): Replace the `lookaheadsp' member, a
4684 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
4685 Adjust all dependencies.
4686 * src/lalr.c (initialize_lookaheads): Split into...
4687 (states_lookaheads_count, states_lookaheads_initialize): these.
4688 (lalr): Adjust.
4689
9757c359
AD
46902002-06-15 Akim Demaille <akim@epita.fr>
4691
4692 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
4693 out of...
4694 (grammar_rules_print): here.
4695 * src/reduce.c (reduce_output): Use it.
4696 * tests/reduce.at (Useless Rules, Reduced Automaton)
4697 (Underivable Rules): Adjust.
4698
6b98e4b5
AD
46992002-06-15 Akim Demaille <akim@epita.fr>
4700
4701 Copy BYacc's nice way to report the grammar.
4702
4703 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
4704 New.
4705 Don't print the rules' location, it is confusing and useless.
4706 (rule_print): Use grammar_rhs_print.
4707 * src/print.c (print_grammar): Use grammar_rules_print.
4708
6b98e4b5
AD
47092002-06-15 Akim Demaille <akim@epita.fr>
4710
4711 Complete and rationalize `useless thing' warnings.
4712
4713 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
4714 (symbol_tag_print): New.
4715 Use them everywhere in place of accessing directly the tag member.
4716 * src/gram.h, src/gram.c (rule_print): New.
4717 Use it where a rule used to be printed `by hand'.
4718 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
4719 (reduce_grammar_tables): Report the useless rules.
4720 (reduce_print): Useless things are a warning, not an error.
4721 Report it as such.
4722 * tests/reduce.at (Useless Nonterminals, Useless Rules):
4723 (Reduced Automaton, Underivable Rules): Adjust.
4724 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
4725 * tests/conflicts.at (Unresolved SR Conflicts)
4726 (Solved SR Conflicts): Adjust.
4727
ee000ba4
AD
47282002-06-15 Akim Demaille <akim@epita.fr>
4729
4730 Let symbols have a location.
4731
4732 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
4733 (getsym): Adjust.
4734 Adjust all callers.
4735 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
4736 Use location_t, not int.
4737 * src/symtab.c (symbol_check_defined): Take advantage of the
4738 location.
4739 * tests/regression.at (Invalid inputs): Adjust.
4740
8efe435c
AD
47412002-06-15 Akim Demaille <akim@epita.fr>
4742
4743 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
4744 (input): Don't try to initialize yylloc here, do it in the
4745 scanner.
4746 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
4747 * src/gram.h (rule_t): Change line and action_line into location
4748 and action_location, of location_t type.
4749 Adjust all dependencies.
4750 * src/location.h, src/location.c (empty_location): New.
4751 * src/reader.h, src/reader.c (grammar_start_symbol_set)
4752 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
4753 (grammar_current_rule_symbol_append)
4754 (grammar_current_rule_action_append): Expect a location as argument.
4755 * src/reader.c (grammar_midrule_action): Adjust to attach an
4756 action's location as dummy symbol location.
4757 * src/symtab.h, src/symtab.c (startsymbol_location): New.
4758 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
4759 the line numbers.
4760
1921f1d7
AD
47612002-06-14 Akim Demaille <akim@epita.fr>
4762
4763 Grammar declarations may be found in the grammar section.
4764
4765 * src/parse-gram.y (rules_or_grammar_declaration): New.
4766 (declarations): Each declaration may end with a semicolon, not
4767 just...
4768 (grammar_declaration): `"%union"'.
4769 (grammar): Branch to rules_or_grammar_declaration.
4770
4515534c
AD
47712002-06-14 Akim Demaille <akim@epita.fr>
4772
4773 * src/main.c (main): Invoke scanner_free.
4774
f958596b
AD
47752002-06-14 Akim Demaille <akim@epita.fr>
4776
4777 * src/output.c (m4_invoke): Extracted from...
4778 (output_skeleton): here.
4779 Free tempfile.
4780
2c569025
AD
47812002-06-14 Akim Demaille <akim@epita.fr>
4782
4783 * src/parse-gram.y (directives, directive, gram)
4784 (grammar_directives, precedence_directives, precedence_directive):
4785 Rename as...
4786 (declarations, declaration, grammar, grammar_declaration)
4787 (precedence_declaration, precedence_declarator): these.
4788 (symbol_declaration): New.
4789
592e8d4d
AD
47902002-06-14 Akim Demaille <akim@epita.fr>
4791
4792 * src/files.c (action_obstack): Remove, unused.
4793 (output_obstack): Remove it, and all its dependencies, as it is no
4794 longer needed.
4795 * src/reader.c (epilogue_set): Build the epilogue in the
4796 muscle_obstack.
4797 * src/output.h, src/output.c (muscle_obstack): Move to...
4798 * src/muscle_tab.h, src/muscle_tab.h: here.
4799 (muscle_init): Initialize muscle_obstack.
4800 (muscle_free): New.
4801 * src/main.c (main): Call it.
4802
0c15323d
AD
48032002-06-14 Akim Demaille <akim@epita.fr>
4804
4805 * src/location.h: New, extracted from...
4806 * src/reader.h: here.
4807 * src/Makefile.am (noinst_HEADERS): Merge into
4808 (bison_SOURCES): this.
4809 Add location.h.
4810 * src/parse-gram.y: Use location_t instead of Bison's.
4811 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
4812 Use location_t instead of ints.
4813
e96c9728
AD
48142002-06-14 Akim Demaille <akim@epita.fr>
4815
4816 * data/bison.simple, data/bison.c++: Be sure to restore the
4817 current #line when returning to the skeleton contents after having
4818 exposed the input file's #line.
4819
75d1fe16
AD
48202002-06-12 Akim Demaille <akim@epita.fr>
4821
4822 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
4823 eager.
4824 * tests/actions.at (Exotic Dollars): New.
4825
6c35d22c
AD
48262002-06-12 Akim Demaille <akim@epita.fr>
4827
4828 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
4829 ['"/] too eagerly.
4830 * tests/input.at (Torturing the Scanner): New.
4831
1d6412ad
AD
48322002-06-11 Akim Demaille <akim@epita.fr>
4833
4834 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
4835 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
4836 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
4837 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
4838 * src/reader.c (reader): Use it.
4839
4cdb01db
AD
48402002-06-11 Akim Demaille <akim@epita.fr>
4841
4842 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
4843 Adjust all callers.
4844 (scanner_last_string_free): New.
4845
44995b2e
AD
48462002-06-11 Akim Demaille <akim@epita.fr>
4847
4848 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
4849 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
4850 (last_string, YY_OBS_FREE): New.
4851 Use them when returning an ID.
4852
e9955c83
AD
48532002-06-11 Akim Demaille <akim@epita.fr>
4854
4855 Have Bison grammars parsed by a Bison grammar.
4856
4857 * src/reader.c, src/reader.h (prologue_augment): New.
4858 * src/reader.c (copy_definition): Remove.
4859
4860 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
4861 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
4862 (grammar_current_rule_prec_set, grammar_current_rule_check)
4863 (grammar_current_rule_symbol_append)
4864 (grammar_current_rule_action_append): Export.
4865 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
4866 (symbol_list_action_append): Remove.
4867 Hook the routines from reader.
4868 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
4869 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
4870
4871 * src/reader.c (read_declarations): Remove, unused.
4872
4873 * src/parse-gram.y: Handle the epilogue.
4874 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
4875 (grammar_start_symbol_set): this.
4876 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
4877 * src/reader.c (readgram): Remove, unused.
4878 (reader): Adjust to insert eoftoken and axiom where appropriate.
4879
4880 * src/reader.c (copy_dollar): Replace with...
4881 * src/scan-gram.h (handle_dollar): this.
4882 * src/parse-gram.y: Remove `%thong'.
4883
4884 * src/reader.c (copy_at): Replace with...
4885 * src/scan-gram.h (handle_at): this.
4886
4887 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
4888 New.
4889
4890 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
4891 time being.
4892
4893 * src/reader.h, src/reader.c (grammar_rule_end): New.
4894
4895 * src/parse.y (current_type, current_class): New.
4896 Implement `%nterm', `%token' support.
4897 Merge `%term' into `%token'.
4898 (string_as_id): New.
4899 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
4900 type name.
4901
4902 * src/parse-gram.y: Be sure to handle properly the beginning of
4903 rules.
4904
4905 * src/parse-gram.y: Handle %type.
4906 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
4907
4908 * src/parse-gram.y: More directives support.
4909 * src/options.c: No longer handle source directives.
4910
4911 * src/parse-gram.y: Fix %output.
4912
4913 * src/parse-gram.y: Handle %union.
4914 Use the prologue locations.
4915 * src/reader.c (parse_union_decl): Remove.
4916
4917 * src/reader.h, src/reader.c (epilogue_set): New.
4918 * src/parse-gram.y: Use it.
4919
4920 * data/bison.simple, data/bison.c++: b4_stype is now either not
4921 defined, then default to int, or to the contents of %union,
4922 without `union' itself.
4923 Adjust.
4924 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
4925
4926 * src/output.c (actions_output): Don't output braces, as they are
4927 already handled by the scanner.
4928
4929 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
4930 characters to themselves.
4931
4932 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
4933 that the epilogue has a proper #line.
4934
4935 * src/parse-gram.y: Handle precedence/associativity.
4936
4937 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
4938 a terminal.
4939 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
4940 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
4941 at all to define terminals that cannot be emitted.
4942
4943 * src/scan-gram.l: Escape M4 characters.
4944
4945 * src/scan-gram.l: Working properly with escapes in user
4946 strings/characters.
4947
4948 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
4949 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
4950 grammar.
4951 Use more modest sizes, as for the time being the parser does not
4952 release memory, and therefore the process swallows a huge amount
4953 of memory.
4954
4955 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
4956 stricter %token grammar.
4957
4958 * src/symtab.h (associativity): Add `undef_assoc'.
4959 (symbol_precedence_set): Do nothing when passed an undef_assoc.
4960 * src/symtab.c (symbol_check_alias_consistence): Adjust.
4961
4962 * tests/regression.at (Invalid %directive): Remove, as it is now
4963 meaningless.
4964 (Invalid inputs): Adjust to the new error messages.
4965 (Token definitions): The new grammar doesn't allow too many
4966 eccentricities.
4967
4968 * src/lex.h, src/lex.c: Remove.
4969 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
4970 (copy_character, copy_string2, copy_string, copy_identifier)
4971 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
4972 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
4973 (parse_action): Remove.
4974 * po/POTFILES.in: Adjust.
4975
2e047461
AD
49762002-06-11 Akim Demaille <akim@epita.fr>
4977
cd05d13c 4978 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
4979 rule's action member: return the action as a string.
4980 Don't require `rule_length' as an argument: compute it.
4981 (grammar_current_rule_symbol_append)
4982 (grammar_current_rule_action_append): New, eved out from
4983 (readgram): here.
4984 Remove `action_flag', `rulelength', unused now.
4985
9af3fbce
AD
49862002-06-11 Akim Demaille <akim@epita.fr>
4987
4988 * src/reader.c (grammar_current_rule_prec_set).
4989 (grammar_current_rule_check): New, eved out from...
4990 (readgram): here.
4991 Remove `xaction', `first_rhs': useless.
4992 * tests/input.at (Type clashes): New.
4993 * tests/existing.at (GNU Cim Grammar): Adjust.
4994
1485e106
AD
49952002-06-11 Akim Demaille <akim@epita.fr>
4996
4997 * src/reader.c (grammar_midrule_action): New, Eved out from
4998 (readgram): here.
4999
da4160c3
AD
50002002-06-11 Akim Demaille <akim@epita.fr>
5001
5002 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
5003 New.
5004 (readgram): Use them as replacement of inlined code, crule and
5005 crule1.
5006
f6d0f937
AD
50072002-06-11 Akim Demaille <akim@epita.fr>
5008
5009 * src/reader.c (grammar_end, grammar_symbol_append): New.
5010 (readgram): Use them.
5011 Make the use of `p' as local as possible.
5012
69078d4b
AD
50132002-06-10 Akim Demaille <akim@epita.fr>
5014
5015 GCJ's parser requires the tokens to be defined before the prologue.
5016
5017 * data/bison.simple: Output the token definition before the user's
5018 prologue.
5019 * tests/regression.at (Braces parsing, Duplicate string)
5020 (Mixing %token styles): Check the output from bison.
5021 (Early token definitions): New.
5022
5e424082
AD
50232002-06-10 Akim Demaille <akim@epita.fr>
5024
5025 * src/symtab.c (symbol_user_token_number_set): Don't complain when
5026 assigning twice the same user number to a token, so that we can
5027 use it in...
5028 * src/lex.c (lex): here.
5029 Also use `symbol_class_set' instead of hand written code.
5030 * src/reader.c (parse_assoc_decl): Likewise.
5031
44536b35
AD
50322002-06-10 Akim Demaille <akim@epita.fr>
5033
5034 * src/symtab.c, src/symtab.c (symbol_class_set)
5035 (symbol_user_token_number_set): New.
5036 * src/reader.c (parse_token_decl): Use them.
5037 Use a switch instead of ifs.
5038 Use a single argument.
5039
8b9f2372
AD
50402002-06-10 Akim Demaille <akim@epita.fr>
5041
5042 Remove `%thong' support as it is undocumented, unused, duplicates
5043 `%token's job, and creates useless e-mail traffic with people who
5044 want to know what it is, why it is undocumented, unused, and
5045 duplicates `%token's job.
5046
5047 * src/reader.c (parse_thong_decl): Remove.
5048 * src/options.c (option_table): Remove "thong".
5049 * src/lex.h (tok_thong): Remove.
5050
3ae2b51f
AD
50512002-06-10 Akim Demaille <akim@epita.fr>
5052
5053 * src/symtab.c, src/symtab.c (symbol_type_set)
5054 (symbol_precedence_set): New.
5055 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
5056 (value_components_used): Remove, unused.
5057
2f1afb73
AD
50582002-06-09 Akim Demaille <akim@epita.fr>
5059
5060 Move symbols handling code out of the reader.
5061
5062 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
5063 (axiom): Move to...
5064 * src/symtab.h, src/symtab.c: here.
5065
5066 * src/gram.c (start_symbol): Remove: use startsymbol->number.
5067 * src/reader.c (startval): Rename as...
5068 * src/symtab.h, src/symtab.c (startsymbol): this.
5069 * src/reader.c: Adjust.
5070
5071 * src/reader.c (symbol_check_defined, symbol_make_alias)
5072 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5073 (token_translations_init)
5074 Move to...
5075 * src/symtab.c: here.
5076 * src/reader.c (packsymbols): Move to...
5077 * src/symtab.h, src/symtab.c (symbols_pack): here.
5078 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
5079 argument.
5080
e9bca3ad
AD
50812002-06-03 Akim Demaille <akim@epita.fr>
5082
5083 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
5084 then statements.
5085
86eff183
AD
50862002-06-03 Akim Demaille <akim@epita.fr>
5087
5088 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
5089 structs with non literals.
5090 * src/scan-skel.l: never-interactive.
5091 * src/conflicts.c (enum conflict_resolution_e): No trailing
5092 comma.
5093 * src/getargs.c (usage): Split long literal strings.
5094 Reported by Hans Aberg.
5095
717be197
AD
50962002-05-28 Akim Demaille <akim@epita.fr>
5097
5098 * data/bison.c++: Use C++ ostreams.
5099 (cdebug_): New member.
5100
670ddffd
AD
51012002-05-28 Akim Demaille <akim@epita.fr>
5102
5103 * src/output.c (output_skeleton): Be sure to allocate enough room
5104 for `/' _and_ for `\0' in full_skeleton.
5105
769b430f
AD
51062002-05-28 Akim Demaille <akim@epita.fr>
5107
5108 * data/bison.c++: Catch up with bison.simple:
5109 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5110 and Paul Eggert <eggert@twinsun.com>: `error' handing.
5111 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
5112 and popping traces.
5113
7067cb36
PH
51142002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5115
5116 * src/output.c (output_skeleton): Put an explicit path in front of
5117 the skeleton file name, rather than relying on the -I directory,
5118 to partially alleviate effects of having a skeleton file lying around
5119 in the current directory.
769b430f 5120
4a713ec2
PH
51212002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5122
769b430f 5123 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
5124 obstack_printf should be obstack_fgrow1.
5125
b408954b
AD
51262002-05-26 Akim Demaille <akim@epita.fr>
5127
5128 * src/state.h (state_t): `solved_conflicts' is a new member.
5129 * src/LR0.c (new_state): Set it to 0.
5130 * src/conflicts.h, src/conflicts.c (print_conflicts)
5131 (free_conflicts, solve_conflicts): Rename as...
5132 (conflicts_print, conflicts_free, conflicts_solve): these.
5133 Adjust callers.
5134 * src/conflicts.c (enum conflict_resolution_e)
5135 (solved_conflicts_obstack): New, used by...
5136 (log_resolution): this.
5137 Adjust to attach the conflict resolution to each state.
5138 Complete the description with the precedence/associativity
5139 information.
5140 (resolve_sr_conflict): Adjust.
5141 * src/print.c (print_state): Output its solved_conflicts.
5142 * tests/conflicts.at (Unresolved SR Conflicts)
5143 (Solved SR Conflicts): Exercise --report=all.
5144
a49aecd5
AD
51452002-05-26 Akim Demaille <akim@epita.fr>
5146
5147 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5148 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5149 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
5150 (token_number_t, item_number_as_token_number)
5151 (token_number_as_item_number, muscle_insert_token_number_table):
5152 Rename as...
5153 (symbol_number_t, item_number_as_symbol_number)
5154 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
5155 these, since it is more appropriate.
5156
5504898e
AD
51572002-05-26 Akim Demaille <akim@epita.fr>
5158
5159 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
5160 `Error:' lines.
5161 * data/bison.simple (yystos) [YYDEBUG]: New.
5162 (yyparse) [YYDEBUG]: Display the symbols which are popped during
5163 error recovery.
5164 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
5165
ec3bc396
AD
51662002-05-25 Akim Demaille <akim@epita.fr>
5167
5168 * doc/bison.texinfo (Debugging): Split into...
5169 (Tracing): this new section, its former contents, and...
5170 (Understanding): this new section.
5171 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
5172 by...
5173 (report_flag): this.
5174 Adjust all dependencies.
5175 (report_args, report_types, report_argmatch): New.
5176 (usage, getargs): Report/support -r, --report.
5177 * src/options.h
5178 (struct option_table_struct): Rename as..,
5179 (struct option_table_s): this.
5180 Rename the `set_flag' member to `flag' to match with getopt_long's
5181 struct.
5182 * src/options.c (option_table): Split verbose into an entry for
5183 %verbose, and another for --verbose.
5184 Support --report/-r, so remove -r from the obsolete --raw.
5185 * src/print.c: Attach full item sets and lookaheads reports to
5186 report_flag instead of trace_flag.
5187 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
5188
78df8250
PE
51892002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5190 and Paul Eggert <eggert@twinsun.com>
769b430f 5191
78df8250
PE
5192 * data/bison.simple (yyparse): Correct error handling to conform to
5193 POSIX and yacc. Specifically, after syntax error is discovered,
5194 do not reduce further before shifting the error token.
5195 Clean up the code a bit by removing the labels yyerrdefault,
5196 yyerrhandle, yyerrpop.
5197 * NEWS: Document the above.
5198
c0c9ea05
PH
51992002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5200
5201 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
5202 type; it isn't always big enough, since it doesn't necessarily
5203 include non-terminals.
769b430f 5204 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
5205 the latter can be removed.
5206 (yy_token_number_type): Remove, only one use.
5207 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
5208 don't use TokenNumberType as element type.
769b430f 5209
c0c9ea05
PH
5210 * tests/regression.at: Modify expected output to agree with change
5211 to yyr1 and yytranslate.
769b430f 5212
6390a83f
FK
52132002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
5214
5215 * src/reader.c (parse_action): Use copy_character instead of
5216 obstack_1grow.
5217
db7c8e9a
AD
52182002-05-13 Akim Demaille <akim@epita.fr>
5219
5220 * tests/regression.at (Token definitions): Prototype yylex and
5221 yyerror.
5222
fcc61800
PH
52232002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5224
158c687b 5225 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
5226 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
5227 32-bit arithmetic.
5228 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
5229
5683e9b2
AD
52302002-05-07 Akim Demaille <akim@epita.fr>
5231
5232 * tests/synclines.at: Be sure to prototype yylex and yyerror to
5233 avoid GCC warnings.
5234
0c2d3f4c
AD
52352002-05-07 Akim Demaille <akim@epita.fr>
5236
5237 Kill GCC warnings.
5238
5239 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
5240 over the RHS of each rule.
5241 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
5242 * src/state.h (state_t): Member `nitems' is unsigned short.
5243 * src/LR0.c (get_state): Adjust.
5244 * src/reader.c (packgram): Likewise.
5245 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
5246 `Type'.
5247 (muscle_insert_int_table): Remove, unused.
5248 (prepare_rules): Remove `max'.
5249
1565b720
AD
52502002-05-06 Akim Demaille <akim@epita.fr>
5251
5252 * src/closure.c (print_firsts): Display of the symbol tags.
5253 (bitmatrix_print): Move to...
5254 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
5255 here.
5256 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
5257
cfaee611
AD
52582002-05-06 Akim Demaille <akim@epita.fr>
5259
5260 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
5261 hash_do_for_each.
5262
458be8e0
AD
52632002-05-06 Akim Demaille <akim@epita.fr>
5264
5265 * src/LR0.c (new_state, get_state): Instead of using the global
5266 `kernel_size' and `kernel_base', have two new arguments:
5267 `core_size' and `core'.
5268 Adjust callers.
5269
a900a624
AD
52702002-05-06 Akim Demaille <akim@epita.fr>
5271
5272 * src/reader.c (packgram): No longer end `ritem' with a 0
5273 sentinel: it is not used.
5274
d4e7d3a1
AD
52752002-05-05 Akim Demaille <akim@epita.fr>
5276
5277 New experimental feature: display the lookaheads in the report and
5278 graph.
5279
5280 * src/print (print_core): When --trace-flag, display the rules
5281 lookaheads.
5282 * src/print_graph.c (print_core): Likewise.
5283 Swap the arguments.
5284 Adjust caller.
5285
39ceb25b
AD
52862002-05-05 Akim Demaille <akim@epita.fr>
5287
5288 * tests/torture.at (Many lookaheads): New test.
5289
5372019f
AD
52902002-05-05 Akim Demaille <akim@epita.fr>
5291
5292 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
5293 (GENERATE_MUSCLE_INSERT_TABLE): this.
5294 (output_int_table, output_unsigned_int_table, output_short_table)
5295 (output_token_number_table, output_item_number_table): Replace with...
5296 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
5297 (muscle_insert_short_table, muscle_insert_token_number_table)
5298 (muscle_insert_item_number_table): these.
5299 Adjust all callers.
5300 (prepare_tokens): Don't free `translations', since...
5301 * src/reader.h, src/reader.c (grammar_free): do it.
5302 Move to...
5303 * src/gram.h, src/gram.c (grammar_free): here.
5304 * data/bison.simple, data/bison.c++: b4_token_number_max is now
5305 b4_translate_max.
5306
5df5f6d5
AD
53072002-05-05 Akim Demaille <akim@epita.fr>
5308
5309 * src/output.c (output_unsigned_int_table): New.
5310 (prepare_rules): `i' is unsigned.
5311 `prhs', `rline', `r2' are unsigned int.
5312 Rename muscle `rhs_number_max' as `rhs_max'.
5313 Output muscles `prhs_max', `rline_max', and `r2_max'.
5314 Free rline and r1.
5315 * data/bison.simple, data/bison.c++: Adjust to use these muscles
5316 to compute types instead of constant types.
5317 * tests/regression.at (Web2c Actions): Adjust.
5318
b87f8b21
AD
53192002-05-04 Akim Demaille <akim@epita.fr>
5320
5321 * src/symtab.h (SALIAS, SUNDEF): Rename as...
5322 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
5323 Adjust dependencies.
5324 * src/output.c (token_definitions_output): Be sure not to output a
5325 `#define 'a'' when fed with `%token 'a' "a"'.
5326 * tests/regression.at (Token definitions): New.
5327
8bb936e4
PE
53282002-05-03 Paul Eggert <eggert@twinsun.com>
5329
5330 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
5331 for K&R C.
5332
53332002-05-03 gettextize <bug-gnu-gettext@gnu.org>
5334
5335 * Makefile.am (SUBDIRS): Remove intl.
5336 (EXTRA_DIST): Add config/config.rpath.
5337
53c71a12
AD
53382002-05-03 Akim Demaille <akim@epita.fr>
5339
5340 * data/bison.simple (m4_if): Don't output empty enums.
5341 And actually, output valid enum definitions :(.
5342
289dd0cf
AD
53432002-05-03 Akim Demaille <akim@epita.fr>
5344
5345 * configure.bat: Remove, completely obsolete.
5346 * Makefile.am (EXTRA_DIST): Adjust.
5347 Don't distribute config.rpath...
5348 * config/Makefile.am (EXTRA_DIST): Do it.
5349
db85e524
AD
53502002-05-03 Akim Demaille <akim@epita.fr>
5351
5352 * configure.in (GETTEXT_VERSION): New.
5353 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
5354
83ccf991
AD
53552002-05-03 Akim Demaille <akim@epita.fr>
5356
5357 * data/bison.simple (b4_token_enum): New.
5358 (b4_token_defines): Use it to output tokens both as #define and
5359 enums.
5360 Suggested by Paul Eggert.
5361 * src/output.c (token_definitions_output): Don't output spurious
5362 white spaces.
5363
1f418995
AD
53642002-05-03 Akim Demaille <akim@epita.fr>
5365
5366 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5367
45119f04
RA
53682002-05-02 Robert Anisko <robert@lrde.epita.fr>
5369
5370 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
5371 Update the stack class, give a try to deque as the default container.
5372
b2d52318
AD
53732002-05-02 Akim Demaille <akim@epita.fr>
5374
5375 * data/bison.simple (yyparse): Do not implement @$ = @1.
5376 (YYLLOC_DEFAULT): Adjust to do it.
5377 * doc/bison.texinfo (Location Default Action): Fix.
5378
3a8b4109
AD
53792002-05-02 Akim Demaille <akim@epita.fr>
5380
5381 * src/reader.c (parse_braces): Merge into...
5382 (parse_action): this.
5383
84614e13
AD
53842002-05-02 Akim Demaille <akim@epita.fr>
5385
5386 * configure.in (ALL_LINGUAS): Remove.
5387 * po/LINGUAS, hr.po: New.
5388
fdbcd8e2
AD
53892002-05-02 Akim Demaille <akim@epita.fr>
5390
5391 Remove the so called hairy (semantic) parsers.
5392
5393 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
5394 * src/gram.h, src/gram.c (semantic_parser): Remove.
5395 (rule_t): Remove the guard and guard_line members.
5396 * src/lex.h (token_t): remove tok_guard.
5397 * src/options.c (option_table): Remove %guard and %semantic_parser
5398 support.
5399 * src/output.c, src/output.h (guards_output): Remove.
5400 (prepare): Adjust.
5401 (token_definitions_output): Don't output the `T'
5402 tokens (???).
5403 (output_skeleton): Don't output the guards.
5404 * src/files.c, src/files.c (attrsfile): Remove.
5405 * src/reader.c (symbol_list): Remove the guard and guard_line
5406 members.
5407 Adjust dependencies.
5408 (parse_guard): Remove.
5409 * data/bison.hairy: Remove.
5410 * doc/bison.texinfo (Environment Variables): Remove occurrences of
5411 BISON_HAIRY.
5412
82b6cb3f
AD
54132002-05-02 Akim Demaille <akim@epita.fr>
5414
5415 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
5416 (parse_guard): Rename the formal argument `stack_offset' as
5417 `rule_length', which is more readable.
5418 Adjust callers.
5419 (copy_at, copy_dollar): Instead of outputting the hard coded
5420 values of $$, $n and so forth, output invocation to b4_lhs_value,
5421 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
5422 Note: this patch partially drops `semantic-parser' support: it
5423 always does `rule_length - n', where semantic parsers ought to
5424 always use `-n'.
82b6cb3f
AD
5425 * data/bison.simple, data/bison.c++ (b4_lhs_value)
5426 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
5427
6cbfbcc5
AD
54282002-05-02 Akim Demaille <akim@epita.fr>
5429
5430 * configure.in (AC_INIT): Bump to 1.49b.
5431 (AM_INIT_AUTOMAKE): Short invocation.
5432
b8548114
AD
54332002-05-02 Akim Demaille <akim@epita.fr>
5434
5435 Version 1.49a.
5436
c20cd1fa
AD
54372002-05-01 Akim Demaille <akim@epita.fr>
5438
5439 * src/skeleton.h: Remove.
5440
8a9566d4
AD
54412002-05-01 Akim Demaille <akim@epita.fr>
5442
5443 * src/skeleton.h: Fix the #endif.
5444 Reported by Magnus Fromreide.
5445
8c6d399a
PE
54462002-04-26 Paul Eggert <eggert@twinsun.com>
5447
5448 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
5449 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 5450 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 5451
2b7ed18a
RA
54522002-04-25 Robert Anisko <robert@lrde.epita.fr>
5453
5454 * src/scan-skel.l: Postprocess quadrigraphs.
5455
5456 * src/reader.c (copy_character): New function, used to output
5457 single characters while replacing `[' and `]' with quadrigraphs, to
5458 avoid troubles with M4 quotes.
5459 (copy_comment): Output characters with copy_character.
5460 (read_additionnal_code): Likewise.
5461 (copy_string2): Likewise.
5462 (copy_definition): Likewise.
5463
5464 * tests/calc.at: Exercise M4 quoting.
5465
34a89c50
AD
54662002-04-25 Akim Demaille <akim@epita.fr>
5467
5468 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
5469 between `!' and the command.
5470 Reported by Paul Eggert.
5471
0dd1580a
RA
54722002-04-24 Robert Anisko <robert@lrde.epita.fr>
5473
5474 * tests/calc.at: Exercise prologue splitting.
5475
5476 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
5477 `b4_post_prologue' instead of `b4_prologue'.
5478
5479 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
5480 muscles.
5481 (output): Free pre_prologue_obstack and post_prologue_obstack.
5482 * src/files.h, src/files.c (attrs_obstack): Remove.
5483 (pre_prologue_obstack, post_prologue_obstack): New.
5484 * src/reader.c (copy_definition): Add a parameter to specify the
5485 obstack to fill, instead of using attrs_obstack unconditionally.
5486 (read_declarations): Pass pre_prologue_obstack to copy_definition if
5487 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
5488
83c1796f
PE
54892002-04-23 Paul Eggert <eggert@twinsun.com>
5490
5491 * data/bison.simple: Remove unnecessary commentary and white
5492 space differences from 1_29-branch.
5493 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
5494
5495 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
5496 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
5497 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
5498 constructors or destructors.
5499
5500 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
5501
1207eeac
AD
55022002-04-23 Akim Demaille <akim@epita.fr>
5503
5504 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
5505 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
5506 location with columns.
5507 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
5508 All reported by Paul Eggert.
5509
78ab8f67
AD
55102002-04-22 Akim Demaille <akim@epita.fr>
5511
5512 * src/reduce.c (dump_grammar): Move to...
5513 * src/gram.h, src/gram.c (grammar_dump): here.
5514 Be sure to separate long item numbers.
5515 Don't read the members of a rule's prec if its nil.
5516
133c20e2
AD
55172002-04-22 Akim Demaille <akim@epita.fr>
5518
5519 * src/output.c (table_size, table_grow): New.
5520 (MAXTABLE): Remove, replace uses with table_size.
5521 (pack_vector): Instead of dying when the table is too big, grow it.
5522
9515e8a7
AD
55232002-04-22 Akim Demaille <akim@epita.fr>
5524
5525 * data/bison.simple (yyr1): Its type is that of a token number.
5526 * data/bison.c++ (r1_): Likewise.
5527 * tests/regression.at (Web2c Actions): Adjust.
5528
23c5a174
AD
55292002-04-22 Akim Demaille <akim@epita.fr>
5530
5531 * src/reader.c (token_translations_init): 256 is now the default
5532 value for the error token, i.e., it will be assigned another
5533 number if the user assigned 256 to one of her tokens.
5534 (reader): Don't force 256 to error.
5535 * doc/bison.texinfo (Symbols): Adjust.
5536 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
5537 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
5538 etc. instead of 10, 20, 30 (which was used to `jump' over error
5539 (256) and undefined (2)).
5540
5fbb0954
AD
55412002-04-22 Akim Demaille <akim@epita.fr>
5542
5543 Propagate more token_number_t.
5544
5545 * src/gram.h (token_number_as_item_number)
5546 (item_number_as_token_number): New.
5547 * src/output.c (GENERATE_OUTPUT_TABLE): New.
5548 Use it to create output_item_number_table and
5549 output_token_number_table.
5550 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5551 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
5552 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
5553 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
5554
4f940944
AD
55552002-04-22 Akim Demaille <akim@epita.fr>
5556
5557 * src/output.h, src/output.c (get_lines_number): Remove.
5558
3ded9a63
AD
55592002-04-19 Akim Demaille <akim@epita.fr>
5560
5561 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
5562 as Lex/Flex'.
5563 (Debugging): More details about enabling the debugging features.
5564 (Table of Symbols): Describe $$, $n, @$, and @n.
5565 Suggested by Tim Josling.
5566
e0c471a9
AD
55672002-04-19 Akim Demaille <akim@epita.fr>
5568
5569 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
5570
fecc10cd
AD
55712002-04-10 Akim Demaille <akim@epita.fr>
5572
5573 * src/system.h: Rely on HAVE_LIMITS_H.
5574 Suggested by Paul Eggert.
5575
51dec47b
AD
55762002-04-09 Akim Demaille <akim@epita.fr>
5577
5578 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
5579 full stderr, and strip it according to the bison options, instead
5580 of composing the error message from different bits.
5581 This makes it easier to check for several error messages.
5582 Adjust all the invocations.
5583 Add an invocation exercising the error token.
5584 Add an invocation demonstrating a stupid error message.
5585 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
5586 Adjust the tests.
5587 Error message are for stderr, not stdout.
5588
007a50a4
AD
55892002-04-09 Akim Demaille <akim@epita.fr>
5590
5591 * src/gram.h, src/gram.c (error_token_number): Remove, use
5592 errtoken->number.
5593 * src/reader.c (reader): Don't specify the user token number (2)
5594 for $undefined, as it uselessly prevents using it.
5595 * src/gram.h (token_number_t): Move to...
5596 * src/symtab.h: here.
5597 (state_t.number): Is a token_number_t.
5598 * src/print.c, src/reader.c: Use undeftoken->number instead of
5599 hard coded 2.
5600 (Even though this 2 is not the same as above: the number of the
5601 undeftoken remains being 2, it is its user token number which
5602 might not be 2).
5603 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
5604 `user_token_number_max'.
5605 Output `undef_token_number'.
5606 * data/bison.simple, data/bison.c++: Use them.
5607 Be sure to map invalid yylex return values to
5608 `undef_token_number'. This saves us from gratuitous SEGV.
5609
5610 * tests/conflicts.at (Solved SR Conflicts)
5611 (Unresolved SR Conflicts): Adjust.
5612 * tests/regression.at (Web2c Actions): Adjust.
5613
06446ccf
AD
56142002-04-08 Akim Demaille <akim@epita.fr>
5615
5616 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
5617 Adding #line.
5618 Remove the duplicate `typedefs'.
5619 (RhsNumberType): Fix the declaration and various other typos.
5620 Use __ofile__.
5621 * data/bison.simple: Use __ofile__.
5622 * src/scan-skel.l: Handle __ofile__.
5623
62a3e4f0
AD
56242002-04-08 Akim Demaille <akim@epita.fr>
5625
5626 * src/gram.h (item_number_t): New, the type of item numbers in
5627 RITEM. Note that it must be able to code symbol numbers as
5628 positive number, and the negation of rule numbers as negative
5629 numbers.
5630 Adjust all dependencies (pretty many).
5631 * src/reduce.c (rule): Remove this `short *' pointer: use
5632 item_number_t.
5633 * src/system.h (MINSHORT, MAXSHORT): Remove.
5634 Include `limits.h'.
5635 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
5636 (shortcpy): Remove.
5637 (MAXTABLE): Move to...
5638 * src/output.c (MAXTABLE): here.
5639 (prepare_rules): Use output_int_table to output rhs.
5640 * data/bison.simple, data/bison.c++: Adjust.
5641 * tests/torture.at (Big triangle): Move the limit from 254 to
5642 500.
5643 * tests/regression.at (Web2c Actions): Ajust.
5644
5645 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
5646 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
5647 passes, but produces negative #line number, once fixed, GCC is
5648 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
5649 C), it passes.
5650 * src/state.h (state_h): Code input lines on ints, not shorts.
5651
bb88b0fc
AD
56522002-04-08 Akim Demaille <akim@epita.fr>
5653
5654 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
5655 and then the grammar.
5656
9a636f47
AD
56572002-04-08 Akim Demaille <akim@epita.fr>
5658
5659 * src/system.h: No longer using strndup.
5660
680e8701
AD
56612002-04-07 Akim Demaille <akim@epita.fr>
5662
5663 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
5664 * src/output.c (output_table_data): Return the longest number.
5665 (prepare_tokens): Output `token_number_max').
5666 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
5667 New.
5668 Use them to define yy_token_number_type/TokenNumberType.
5669 Use this type for yytranslate.
5670 * tests/torture.at (Big triangle): Push the limit from 124 to
5671 253.
5672 * tests/regression.at (Web2c Actions): Adjust.
5673
817e9f41
AD
56742002-04-07 Akim Demaille <akim@epita.fr>
5675
5676 * tests/torture.at (Big triangle): New.
5677 (GNU AWK Grammar, GNU Cim Grammar): Move to...
5678 * tests/existing.at: here.
5679
5123689b
AD
56802002-04-07 Akim Demaille <akim@epita.fr>
5681
5682 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
5683 nritems.
5684 Adjust dependencies.
5685
f3849179
AD
56862002-04-07 Akim Demaille <akim@epita.fr>
5687
5688 * src/reader.c: Normalize increments to prefix form.
5689
bd02036a
AD
56902002-04-07 Akim Demaille <akim@epita.fr>
5691
5692 * src/reader.c, symtab.c: Remove debugging code.
5693
db8837cb
AD
56942002-04-07 Akim Demaille <akim@epita.fr>
5695
5696 Rename all the `bucket's as `symbol_t'.
5697
5698 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
5699 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
5700 * src/symtab.c, src/symtab.h (bucket): Rename as...
5701 (symbol_t): this.
5702 (symbol_list_new, bucket_check_defined, bucket_make_alias)
5703 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
5704 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
5705 (buckets_new, buckets_free, buckets_do): Rename as...
5706 (symbol_list_new, symbol_check_defined, symbol_make_alias)
5707 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5708 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
5709 (symbols_new, symbols_free, symbols_do): these.
5710
72a23c97
AD
57112002-04-07 Akim Demaille <akim@epita.fr>
5712
5713 Use lib/hash for the symbol table.
5714
5715 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
5716 EOF.
5717 * src/lex.c (lex): Set the `number' member of new terminals.
5718 * src/reader.c (bucket_check_defined, bucket_make_alias)
5719 (bucket_check_alias_consistence, bucket_translation): New.
5720 (reader, grammar_free, readgram, token_translations_init)
5721 (packsymbols): Adjust.
5722 (reader): Number the predefined tokens.
5723 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
5724 for predefined tokens.
5725 * src/symtab.h (bucket): Remove all the hash table related
5726 members.
5727 * src/symtab.c (symtab): Replace by...
5728 (bucket_table): this.
5729 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
5730 (buckets_new, buckets_do): New.
5731
280a38c3
AD
57322002-04-07 Akim Demaille <akim@epita.fr>
5733
5734 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
5735 (start_symbol, max_user_token_number, semantic_parser)
5736 (error_token_number): Initialize.
5737 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
5738 Initialize.
5739 (reader): Don't.
5740 (errtoken, eoftoken, undeftoken, axiom): Extern.
5741
03b31c0c
AD
57422002-04-07 Akim Demaille <akim@epita.fr>
5743
5744 * src/gram.h (rule_s): prec and precsym are now pointers
5745 to the bucket giving the priority/associativity.
5746 Member `associativity' removed: useless.
5747 * src/reduce.c, src/conflicts.c: Adjust.
5748
8b3df748
AD
57492002-04-07 Akim Demaille <akim@epita.fr>
5750
5751 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
5752 Properly escape the symbols' TAG when outputting them.
5753
e601aa1d
AD
57542002-04-07 Akim Demaille <akim@epita.fr>
5755
5756 * src/lalr.h (LA): Is a bitsetv, not bitset*.
5757
b0299a2e
AD
57582002-04-07 Akim Demaille <akim@epita.fr>
5759
5760 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
5761 (LArule): this, which is an array to rule_t*.
5762 * src/print.c, src/conflicts.c: Adjust.
5763
d7e1f00c
AD
57642002-04-07 Akim Demaille <akim@epita.fr>
5765
5766 * src/gram.h (rule_t): Rename `number' as `user_number'.
5767 `number' is a new member.
5768 Adjust dependencies.
5769 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
5770
cc9305dd
AD
57712002-04-07 Akim Demaille <akim@epita.fr>
5772
5773 As a result of the previous patch, it is no longer needed
5774 to reorder ritem itself.
5775
5776 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
5777
b0940840
AD
57782002-04-07 Akim Demaille <akim@epita.fr>
5779
5780 Be sure never to walk through RITEMS, but use only data related to
5781 the rules themselves. RITEMS should be banished.
5782
5783 * src/output.c (output_token_translations): Rename as...
5784 (prepare_tokens): this.
5785 In addition to `translate', prepare the muscles `tname' and
5786 `toknum', which were handled by...
5787 (output_rule_data): this.
5788 Remove, and move the remainder of its outputs into...
5789 (prepare_rules): this new routines, which also merges content from
5790 (output_gram): this.
5791 (prepare_rules): Be sure never to walk through RITEMS.
5792 (output_stos): Rename as...
5793 (prepare_stos): this.
5794 (output): Always invoke prepare_states, after all, just don't use it
5795 in the output if you don't need it.
5796
643a5994
AD
57972002-04-07 Akim Demaille <akim@epita.fr>
5798
5799 * src/LR0.c (new_state): Display `nstates' as the name of the
5800 newly created state.
5801 Adjust to initialize first_state and last_state if needed.
5802 Be sure to distinguish the initial from the final state.
5803 (new_states): Create the itemset of the initial state, and use
5804 new_state.
5805 * src/closure.c (closure): Now that the initial state has its
5806 items properly set, there is no need for a special case when
5807 creating `ruleset'.
5808
5809 As a result, now the rule 0, reducing to $axiom, is visible in the
5810 outputs. Adjust the test suite.
5811
5812 * tests/conflicts.at (Solved SR Conflicts)
5813 (Unresolved SR Conflicts): Adjust.
5814 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
5815 * tests/conflicts.at (S/R in initial): New.
5816
b4c4ccc2
AD
58172002-04-07 Akim Demaille <akim@epita.fr>
5818
5819 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
5820 the RHS of the rules.
5821 * src/output.c (output_gram): Likewise.
5822
bba97eb2
AD
58232002-04-07 Akim Demaille <akim@epita.fr>
5824
5825 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
5826 bucket.
5827 Adjust all dependencies.
5828 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
5829 `number' of the buckets too.
5830 * src/gram.h: Include `symtab.h'.
5831 (associativity): Move to...
5832 * src/symtab.h: here.
5833 No longer include `gram.h'.
5834
c3b407f4
AD
58352002-04-07 Akim Demaille <akim@epita.fr>
5836
5837 * src/gram.h, src/gram.c (rules_rhs_length): New.
5838 (ritem_longest_rhs): Use it.
5839 * src/gram.h (rule_t): `number' is a new member.
5840 * src/reader.c (packgram): Set it.
5841 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
5842 the end of `rules', and count them out of `nrules'.
5843 (reduce_output, dump_grammar): Adjust.
5844 * src/print.c (print_grammar): It is no longer needed to check for
5845 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
5846 * tests/reduce.at (Reduced Automaton): New test.
5847
11652ab3
AD
58482002-04-07 Akim Demaille <akim@epita.fr>
5849
5850 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
5851 lacking `+ 1' to nrules, Bison reported as useless a token if it
5852 was used solely to set the precedence of the last rule...
5853
26b23c1a
AD
58542002-04-07 Akim Demaille <akim@epita.fr>
5855
5856 * data/bison.c++, data/bison.simple: Don't output the current file
5857 name in #line, to avoid useless diffs between two identical
5858 outputs under different names.
5859
18bcecb0
AD
58602002-04-07 Akim Demaille <akim@epita.fr>
5861
5862 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
5863 Normalize loops to using `< nrules + 1', not `<= nrules'.
5864
fa770c86
AD
58652002-04-07 Akim Demaille <akim@epita.fr>
5866
5867 * TODO: Update.
5868
d9b739c3
AD
58692002-04-07 Akim Demaille <akim@epita.fr>
5870
5871 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
5872 bucket.value as bucket.number.
5873
99013900
AD
58742002-04-07 Akim Demaille <akim@epita.fr>
5875
5876 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
5877 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5878 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
5879 RHS, instead of being an index in RITEMS.
5880
e966383b
PE
58812002-04-04 Paul Eggert <eggert@twinsun.com>
5882
5883 * doc/bison.texinfo: Update copyright date.
5884 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
5885 (Symbols): Warn about running Bison in one character set,
5886 but compiling and/or running in an incompatible one.
5887 Warn about character code 256, too.
5888
58892002-04-03 Paul Eggert <eggert@twinsun.com>
5890
5891 * src/bison.data (YYSTACK_ALLOC): Depend on whether
5892 YYERROR_VERBOSE is nonzero, not whether it is defined.
5893
5894 Merge changes from bison-1_29-branch.
c307773e 5895
8d6c48b9
PE
58962002-03-20 Paul Eggert <eggert@twinsun.com>
5897
5898 Merge fixes from Debian bison_1.34-1.diff.
5899
5900 * configure.in (AC_PREREQ): 2.53.
5901
e53c6322
AD
59022002-03-20 Akim Demaille <akim@epita.fr>
5903
5904 * src/conflicts.c (log_resolution): Argument `resolution' is const.
5905
9ffbeca7
PE
59062002-03-19 Paul Eggert <eggert@twinsun.com>
5907
21db0b2a
PE
5908 * src/bison.simple (YYCOPY): New macro.
5909 (YYSTACK_RELOCATE): Use it.
5910 Remove Type arg; no longer needed. All callers changed.
5911 (yymemcpy): Remove; no longer needed.
5912
9ffbeca7
PE
5913 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
5914 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5915
642cb8f8
AD
59162002-03-19 Akim Demaille <akim@epita.fr>
5917
5918 Test and fix the #line outputs.
5919
5920 * tests/atlocal.at (GCC): New.
5921 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
5922 (Prologue synch line, ,%union synch line, Postprologue synch line)
5923 (Action synch line, Epilogue synch line): New tests.
5924 * src/reader.c (parse_union_decl): Define the muscle stype_line.
5925 * data/bison.simple, data/bison.c++: Use it.
5926
3c31a486
AD
59272002-03-19 Akim Demaille <akim@epita.fr>
5928
5929 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
5930 (Solved SR Conflicts, %expect not enough, %expect right)
5931 (%expect too much): Move to...
5932 * tests/conflicts.at: this new file.
5933
0d8bed56
AD
59342002-03-19 Akim Demaille <akim@epita.fr>
5935
5936 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5937 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
5938 that we can move to enums for instance.
5939 * src/output.c (token_definitions_output): Output a list of
5940 `token-name, token-number' instead of the #define.
5941 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
5942
9208d17f
AD
59432002-03-14 Akim Demaille <akim@epita.fr>
5944
5945 Use Gettext 0.11.1.
5946
af27eacb
RA
59472002-03-09 Robert Anisko <robert@lrde.epita.fr>
5948
5949 * data/bison.c++: Make the user able to add members to the generated
5950 parser by subclassing.
5951
9101a310
RA
59522002-03-05 Robert Anisko <robert@lrde.epita.fr>
5953
5954 * src/reader.c (read_additionnal_code): `c' should be an integer, not
5955 a character.
5956 Reported by Nicolas Tisserand and Nicolas Burrus.
5957
fff9bf0b
RA
59582002-03-04 Robert Anisko <robert@lrde.epita.fr>
5959
5960 * src/reader.c: Warn about lacking semi-colons, do not complain.
5961
64dba31e
RA
59622002-03-04 Robert Anisko <robert@lrde.epita.fr>
5963
5964 * data/bison.c++: Remove a debug line.
5965
374f5a14
RA
59662002-03-04 Robert Anisko <robert@lrde.epita.fr>
5967
5968 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
5969 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
5970 provide a default implementation.
5971
bfcf1f3a
AD
59722002-03-04 Akim Demaille <akim@epita.fr>
5973
5974 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
5975 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
5976 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
5977 * tests/semantic.at (Parsing Guards): Similarly.
5978 * src/reader.at (readgram): Complain if the last rule is not ended
5979 with a semi-colon.
5980
65ccf9fc
AD
59812002-03-04 Akim Demaille <akim@epita.fr>
5982
5983 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
5984 * src/closure.c: here.
5985 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
5986 RTC.
5987 * src/warshall.h, src/warshall.c: Remove.
5988 * tests/sets.at (Broken Closure): Adjust.
5989
d0039cbc
AD
59902002-03-04 Akim Demaille <akim@epita.fr>
5991
5992 * src/output.c (output_skeleton): tempdir is const.
5993 bytes_read is unused.
5994
345cea78
AD
59952002-03-04 Akim Demaille <akim@epita.fr>
5996
5997 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
5998 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
5999 Update.
6000 From Michael Hayes.
6001
564801f7
AD
60022002-03-04 Akim Demaille <akim@epita.fr>
6003
6004 * src/closure.c (closure): `r' is unused.
6005
e5352bc7
AD
60062002-03-04 Akim Demaille <akim@epita.fr>
6007
6008 * tests/sets.at (Broken Closure): Add the ending `;'.
6009 * src/reader.at (readgram): Complain if a rule is not ended with a
6010 semi-colon.
6011
914feea9
AD
60122002-03-04 Akim Demaille <akim@epita.fr>
6013
6014 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
6015 (count_sr_conflicts): Use bitset_count.
6016 * src/reduce.c (inaccessable_symbols): Ditto.
6017 (bits_size): Remove.
6018 * src/warshall.h, src/warshall.c: Convert to bitsetv.
6019
f0250de6
AD
60202002-03-04 Akim Demaille <akim@epita.fr>
6021
6022 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
6023 * src/reduce.c: Remove the `bitset_zero's following the
6024 `bitset_create's, as now it is performed by the latter.
6025
ef017502
AD
60262002-03-04 Akim Demaille <akim@epita.fr>
6027
6028 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
6029 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
6030 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
6031 latest sources from Michael.
6032
76514394
AD
60332002-03-04 Akim Demaille <akim@epita.fr>
6034
6035 * src/output.c (output): Don't free the grammar.
6036 * src/reader.c (grammar_free): New.
6037 * src/main.c (main): Call it and don't free symtab here.
6038
55024580
AD
60392002-03-04 Akim Demaille <akim@epita.fr>
6040
6041 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
6042 before returning.
6043 Reported by Benoit Perrot.
6044
f9abaa2c
AD
60452002-03-04 Akim Demaille <akim@epita.fr>
6046
6047 Use bitset operations when possible, not loops over bits.
6048
6049 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
6050 bitset_or.
6051 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
6052 * src/reduce.c (useless_nonterminals): Formatting changes.
6053 * src/warshall.c (TC): Use bitset_or.
6054
0e721e75
AD
60552002-03-04 Akim Demaille <akim@epita.fr>
6056
6057 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
6058 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
6059 Ditto.
6060
0fb1ffb1
AD
60612002-03-04 Akim Demaille <akim@epita.fr>
6062
6063 * src/lalr.c (F): Now a bitset*.
6064 Adjust all dependencies.
6065
b86796bf
AD
60662002-03-04 Akim Demaille <akim@epita.fr>
6067
6068 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
6069 Adjust all dependencies.
6070
602bbf31
AD
60712002-03-04 Akim Demaille <akim@epita.fr>
6072
6073 * src/L0.c, src/LR0.h (nstates): Be size_t.
6074 Adjust comparisons (signed vs unsigned).
6075 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
6076 bitset*.
6077 Adjust all dependencies.
6078
d8a0245c
AD
60792002-03-04 Akim Demaille <akim@epita.fr>
6080
6081 * src/closure.c (firsts): Now, also a bitset.
6082 Adjust all dependencies.
6083 (varsetsize): Remove, now unused.
6084 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
6085
34ba9743
AD
60862002-03-04 Akim Demaille <akim@epita.fr>
6087
6088 * src/print.c: Convert to use bitset.h, not hand coded iterations
6089 over ints.
6090
ed86e78c
AD
60912002-03-04 Akim Demaille <akim@epita.fr>
6092
6093 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
6094
dfdb1797
AD
60952002-03-04 Akim Demaille <akim@epita.fr>
6096
6097 * src/closure.c (ruleset): Be a bitset.
6098 (rulesetsize): Remove.
6099
7086e707
AD
61002002-03-04 Akim Demaille <akim@epita.fr>
6101
6102 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
6103 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
6104 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
6105 * src/closure.c (fderives): Be an array of bitsets.
6106
98254360
RA
61072002-02-28 Robert Anisko <robert@lrde.epita.fr>
6108
6109 * data/bison.c++: Merge the two generated headers. Insert a copyright
6110 notice in each output file.
6111
a75c057f
AD
61122002-02-28 Akim Demaille <akim@epita.fr>
6113
6114 * data/bison.c++: Copy the prologue of bison.simple to fetch
6115 useful M4 definitions, such as b4_header_guard.
6116
06b00abc
AD
61172002-02-25 Akim Demaille <akim@epita.fr>
6118
6119 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
6120 translator friendly scheme for the bgr
6121 copyright notice.
06b00abc 6122
70e7d534
AD
61232002-02-25 Akim Demaille <akim@epita.fr>
6124
6125 * src/output.c (header_output): Remove, now handled completely via
6126 M4.
6127
abe017f6
AD
61282002-02-25 Akim Demaille <akim@epita.fr>
6129
6130 * m4/m4.m4: New, from CVS Autoconf.
6131 * configure.in: Invoke it.
6132 * src/output.c (output_skeleton): Use its result instead of the
6133 hard coded name.
6134
381fb12e
AD
61352002-02-25 Akim Demaille <akim@epita.fr>
6136
6137 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
6138 Fileutils 4.1.5.
6139 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
6140 * src/output.c (output_skeleton): Use mkstemp to create a real
6141 temporary file.
6142 Move the filling of `skeleton' and its muscle to...
6143 (prepare): here.
6144 (output): Move the definition of the prologue muscle to...
6145 (prepare): here.
6146 * src/system.h (DEFAULT_TMPDIR): New.
6147
6f38107f
PE
61482002-02-14 Paul Eggert <eggert@twinsun.com>
6149
6150 Remove the support for C++ namespace cleanliness; it was
6151 causing more problems than it was curing, since it didn't work
6152 properly on some nonstandard C++ compilers. This can wait
6153 for a proper C++ parser.
6154
6155 * NEWS: Document this.
6156 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
6157 of C++, as it's treated like C now.
6158 * src/bison.simple (YYSTD): Remove.
6159 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
6160 Treat C++ just like Standard C instead of trying to support
6161 namespace cleanliness.
6162
80cce3da
AD
61632002-02-14 Akim Demaille <akim@epita.fr>
6164
6165 * tests/regression.at (else): Adjust to Andreas' change.
6166
842e8679
AD
61672002-02-14 Akim Demaille <akim@epita.fr>
6168
6169 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
6170
4bda3f10
AD
61712002-02-13 Andreas Schwab <schwab@suse.de>
6172
6173 * src/output.c (output_rule_data): Don't output NULL, it might
6174 not be defined yet.
6175
4162fa07 61762002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 6177
4162fa07
RA
6178 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
6179 (Copyright notice): Update.
b418ecd8 6180
bd16a5dc
AD
61812002-02-11 Akim Demaille <akim@epita.fr>
6182
6183 * tests/regression.at (%nonassoc and eof): Don't include
6184 nonportable headers.
6185
8d69a1a3
RA
61862002-02-08 Robert Anisko <robert@lrde.epita.fr>
6187
6188 * data/bison.c++: Correct error recovery. Make the user able to
6189 initialize the starting location.
6190
9b2d0677
AD
61912002-02-07 Akim Demaille <akim@epita.fr>
6192
6193 * tests/input.at: New.
6194
69e2658b
RA
61952002-02-07 Robert Anisko <robert@lrde.epita.fr>
6196
6197 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 6198 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
6199 directives around tables only needed for debugging.
6200
4aacc3a7
RA
62012002-02-07 Robert Anisko <robert@lrde.epita.fr>
6202
6203 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
6204 C++ parsers.
6205 (yy::b4_name::parse): Use print_.
6206
762a801e
RA
62072002-02-07 Robert Anisko <robert@lrde.epita.fr>
6208
6209 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
6210
4bb2bc3f
RA
62112002-02-07 Robert Anisko <robert@lrde.epita.fr>
6212
6213 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
6214 C++ parsers.
6215 (yy::b4_name::parse): Build verbose error messages, and use error_.
6216
6b45a3ca
RA
62172002-02-06 Robert Anisko <robert@lrde.epita.fr>
6218
6219 * data/bison.c++: Fix m4 quoting in comments.
6220
50997c6e
RA
62212002-02-06 Robert Anisko <robert@lrde.epita.fr>
6222
6223 * data/bison.c++: Adjust the parser code. Fix some muscles that were
6224 not expanded by m4.
6225
3f3eed27
AD
62262002-02-05 Akim Demaille <akim@epita.fr>
6227
6228 * data/bison.c++: Adjust to the M4 back end.
6229 More is certainly needed.
6230
be2a1a68
AD
62312002-02-05 Akim Demaille <akim@epita.fr>
6232
6233 Give a try to M4 as a back end.
6234
6235 * lib/readpipe.c: New, from wdiff.
6236 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
6237 BISON_HAIRY.
6238 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
6239 specific values. Now it is m4 that performs the lookup.
6240 * src/parse-skel.y: Remove.
6241 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
6242 * src/output.c (actions_output, guards_output)
6243 (token_definitions_output): No longer keeps track of the output
6244 line number, hence remove the second argument.
6245 (guards_output): Check against the guard member of a rule, not the
6246 action member.
6247 Adjust callers.
6248 (output_skeleton): Don't look for the skeleton location, let m4 do
6249 that.
6250 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
6251 file will be used.
6252 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
6253 (prepare): Given that for the time being changesyntax is not
6254 usable in M4, rename the muscles using `-' to `_'.
6255 Define `defines_flag', `output_parser_name' and `output_header_name'.
6256 * src/output.h (actions_output, guards_output)
6257 (token_definitions_output): Adjust prototypes.
6258 * src/scan-skel.l: Instead of scanning the skeletons, it now
6259 processes the output of m4: `__oline__' and `#output'.
6260 * data/bison.simple: Adjust to be used by M4(sugar).
6261 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
6262 to date.
6263 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
6264 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
6265 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
6266 shamelessly stolen from CVS Autoconf.
6267
beda758b
AD
62682002-02-05 Akim Demaille <akim@epita.fr>
6269
6270 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
6271 * configure.in: Check for the declarations of free and malloc.
6272 * src/muscle_tab.c: Adjust.
6273
5ece6d43
AD
62742002-02-05 Akim Demaille <akim@epita.fr>
6275
6276 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
6277 which have no values.
6278
5bb18f9a
AD
62792002-02-05 Akim Demaille <akim@epita.fr>
6280
6281 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
6282 * data/: here.
6283
894dd62e
PE
62842002-01-29 Paul Eggert <eggert@twinsun.com>
6285
6286 * src/bison.simple (YYSIZE_T): Do not define merely because
6287 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
6288 On some platforms, <alloca.h> does not declare YYSTD (size_t).
6289
82841af7
AD
62902002-01-27 Akim Demaille <akim@epita.fr>
6291
6292 Fix `%nonassoc and eof'.
6293
6294 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
6295 which were not properly copied! Replace
6296 memcpy (res->errs, src->errs, src->nerrs);
6297 with
6298 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
6299 !!!
6300 * tests/regression.at (%nonassoc and eof): Adjust to newest
6301 Autotest: `.' is not in the PATH.
6302
318b76e9
AD
63032002-01-27 Akim Demaille <akim@epita.fr>
6304
6305 * tests/sets.at (AT_EXTRACT_SETS): New.
6306 (Nullable): Use it.
6307 (Firsts): New.
6308
30d2f3d5
AD
63092002-01-26 Akim Demaille <akim@epita.fr>
6310
6311 * tests/actions.at, tests/calc.at, tests/headers.at,
6312 * tests/torture.at: Adjust to the newest Autotest which no longer
6313 forces `.' in the PATH.
6314
30f8c395
AD
63152002-01-25 Akim Demaille <akim@epita.fr>
6316
6317 * tests/regression.at (%nonassoc and eof): New.
6318 Suggested by Robert Anisko.
6319
29ae55f1
AD
63202002-01-24 Akim Demaille <akim@epita.fr>
6321
6322 Bison dumps core when trying to complain about broken input files.
6323 Reported by Cris van Pelt.
6324
6325 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
6326 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
6327 into...
6328 (Invalid inputs): Strengthen: exercise parse_percent_token.
6329
2b548aa6
RA
63302002-01-24 Robert Anisko <robert.anisko@epita.fr>
6331
6332 * src/Makefile.am: Add bison.c++.
6333 * src/bison.c++: New skeleton.
6334
bb0146c2
AD
63352002-01-21 Paolo Bonzini <bonzini@gnu.org>
6336
6337 * po/it.po: New.
6338
bec30531
AD
63392002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
6340
6341 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
6342
fc6edc45
MA
63432002-01-20 Marc Autret <marc@gnu.org>
6344
6345 * src/files.c (compute_output_file_names): Fix
6346
5e5d5415
MA
63472002-01-20 Marc Autret <marc@gnu.org>
6348
6349 * tests/output.at: New test.
6350 * src/files.c (compute_base_names): Don't map extensions when
6351 the YACC flag is set, use defaults.
6352 Reported by Evgeny Stambulchik.
6353
44ea3fbd
MA
63542002-01-20 Marc Autret <marc@gnu.org>
6355
bb0146c2 6356 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
6357 compilers as well (i.e. the vendor C compiler).
6358 Suggested by Albert Chin-A-Young.
6359
338963d1
TVH
63602002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
6361
6362 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
6363 canonical definition.
6364 * src/system.h: Use the canonical definition for PARAMS (avoids
6365 a conflict with the macro from lib/hash.h).
6366
c57b2479
AD
63672002-01-11 Akim Demaille <akim@epita.fr>
6368
6369 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 6370 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 6371
b85810ae
AD
63722002-01-09 Akim Demaille <akim@epita.fr>
6373
6374 * src/files.c, src/files.h (output_infix): New.
6375 (tab_extension): Remove.
6376 (compute_base_names): Compute the former, drop the latter.
6377 * src/output.c (prepare): Insert the muscles `output-infix', and
6378 `output-suffix'.
6379 * src/parse-skel.y (string, string.1): New.
6380 (section.header): Use it.
6381 (section.yacc): Remove.
6382 (prefix): Remove too.
6383 * src/scan-skel.l: Adjust.
6384 * src/bison.simple, src/bison.hairy: Adjust.
6385
cae60122
AD
63862002-01-09 Akim Demaille <akim@epita.fr>
6387
6388 * configure.in (WERROR_CFLAGS): Compute it.
6389 * src/Makefile.am (CFLAGS): Pass it.
6390 * tests/atlocal.in (CFLAGS): Idem.
6391 * src/files.c: Fix a few warnings.
6392 (get_extension_index): Remove, unused.
6393
ae404801
AD
63942002-01-08 Akim Demaille <akim@epita.fr>
6395
6396 * src/getargs.c (AS_FILE_NAME): New.
6397 (getargs): Use it to convert DOSish file names.
6398 * src/files.c (base_name): Rename as full_base_name to avoid
6399 clashes with `base_name ()'.
6400 (filename_split): New.
6401 (compute_base_names): N-th rewrite, using filename_split.
6402
22312b71
AD
64032002-01-08 Akim Demaille <akim@epita.fr>
6404
6405 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
6406 New, stolen from the Fileutils 4.1.
6407 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
6408 * configure.in: Check for the presence of memrchr, and of its
6409 prototype.
6410
a67cef01
TVH
64112002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
6412
6413 * lib/hash.h (__P): Added definition for this macro.
6414 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
6415 BUILT_SOURCES, to ensure they are generated first.
6416 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
6417 %error-verbose to allow bootstrapping with bison 1.30x.
6418
2b25d624
AD
64192002-01-06 Akim Demaille <akim@epita.fr>
6420
6421 * src/reader.c (parse_braces): Don't fetch the next char, the
6422 convention is to fetch on entry.
6423 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
6424 'switch' without a following semicolon.
6425 * tests/regression.at (braces parsing): New.
6426
3460813b
AD
64272002-01-06 Akim Demaille <akim@epita.fr>
6428
6429 Bison is dead wrong in its RR conflict reports.
6430
6431 * tests/torture.at (GNU Cim Grammar): New.
6432 * src/conflicts.c (count_rr_conflicts): Fix.
6433
73784c64
AD
64342002-01-06 Akim Demaille <akim@epita.fr>
6435
6436 Creating package.m4 from configure.ac causes too many problems.
6437
6438 * tests/Makefile.am (package.m4): Create it by hand,
6439 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
6440
25d81090
AD
64412002-01-06 Akim Demaille <akim@epita.fr>
6442
6443 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
6444 skeleton.h.
6445
a9b8959e
PE
64462002-01-04 Paul Eggert <eggert@twinsun.com>
6447
6448 * doc/bison.texinfo (Debugging):
6449 Remove YYSTDERR; it's no longer defined or used.
6450 Also, s/cstdio.h/cstdio/.
6451
25d81090
AD
64522002-01-03 Akim Demaille <akim@epita.fr>
6453
6454 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
6455
1109455c
AD
64562002-01-03 Akim Demaille <akim@epita.fr>
6457
6458 * src/parse-skel.y (process_skeleton): Don't bind the parser's
6459 tracing code to --trace, wait for a better --trace option, with
6460 args.
6461
7ea5e977
AD
64622002-01-03 Akim Demaille <akim@epita.fr>
6463
6464 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
6465 The ISO C++ standard is extremely clear about it: stderr is
6466 considered a macro, not a regular symbol (see table 94 `Header
6467 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
6468 Therefore std:: does not apply to it. It still does with fprintf.
6469 Also, s/cstdio.h/cstdio/.
6470
fab5b110
AD
64712002-01-03 Akim Demaille <akim@epita.fr>
6472
6473 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
6474 for non system headers.
6475
aed7fd9b
AD
64762002-01-02 Akim Demaille <akim@epita.fr>
6477
6478 Equip the skeleton chain with location tracking, runtime trace,
6479 pure parser and scanner.
6480
6481 * src/parse-skel.y: Request a pure parser, locations, and prefix
6482 renaming.
6483 (%union): Having several members with the same type does not help
6484 type mismatches, simplify.
6485 (YYPRINT, yyprint): New.
6486 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
6487 (skel_error): this.
6488 Handle locations.
6489 * src/scan-skel.l: Adjust to these changes.
6490 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
6491 (LOCATION_PRINT, skel_control_t): New.
6492
24fad99e
AD
64932001-12-30 Akim Demaille <akim@epita.fr>
6494
6495 * src/parse-skel.y: Get rid of the shift/reduce conflict:
6496 replace `gb' with BLANKS.
6497 * src/scan-skel.l: Adjust.
6498
a4b36db4
AD
64992001-12-30 Akim Demaille <akim@epita.fr>
6500
6501 * src/system.h: We don't need nor want bcopy.
6502 Throw away MS-DOS crap: we don't need getpid.
6503 * configure.in: We don't need strndup. It was even causing
6504 problems: because Flex includes the headers *before* us,
6505 _GNU_SOURCE is not defined by config.h, and therefore strndup was
6506 not visible.
6507 * lib/xstrndup.c: New.
6508 * src/scan-skel.l: Use it.
6509 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
6510 * src/parse-skel.y: Use %directives instead of #defines.
6511
1239777d
AD
65122001-12-30 Akim Demaille <akim@epita.fr>
6513
6514 * src/skeleton.h: New.
6515 * src/output.c (output_parser, output_master_parser): Remove, dead
6516 code.
6517 * src/output.h (get_lines_number, actions_output, guards_output)
6518 (token_definitions_output): Prototype them.
6519 * src/parse-skel.y: Add the license notice.
6520 Include output.h and skeleton.h.
6521 (process_skeleton): Returns void, and takes a single parameter.
6522 * src/scan-skel.l: Add the license notice.
6523 Include skeleton.h.
6524 Don't use %option yylineno: it seems that then Flex imagines
6525 REJECT has been used, and therefore it won't reallocate its
6526 buffers (which makes no other sense to me than a bug). It results
6527 in warnings for `unused: yy_flex_realloc'.
6528
9b3add5b
RA
65292001-12-30 Robert Anisko <robert.anisko@epita.fr>
6530
6531 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6532 (MUSCLE_INSERT_PREFIX): ...to there.
6533 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6534 (MUSCLE_INSERT_PREFIX): Move from here...
6535
6536 * src/bison.hairy: Add a section directive. Put braces around muscle
6537 names. This parser skeleton is still broken, but Bison should not
6538 choke on a bad muscle 'syntax'.
6539 * src/bison.simple: Add a section directive. Put braces around muscle
6540 names.
6541
6542 * src/files.h (strsuffix, stringappend): Add declarations.
6543 (tab_extension): Add declaration.
6544 (short_base_name): Add declaration.
6545
6546 * src/files.c (strsuffix, stringappend): No longer static. These
6547 functions are used in the skeleton parser.
6548 (tab_extension): New.
6549 (compute_base_names): Use the computations done in this function
fab5b110 6550 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
6551 names.
6552 (short_base_name): No longer static.
6553
6554 * src/output.c (output_skeleton): New.
6555 (output): Disable call to output_master_parser, and give a try to
6556 a new skeleton handling system.
6557 (guards_output, actions_output): No longer static.
6558 (token_definitions_output, get_lines_number): No longer static.
6559
6560 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
6561
fab5b110 6562 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
6563 parse-skel.y.
6564
6565 * src/parse-skel.y: New file.
6566 * src/scan-skel.l: New file.
6567
b5b61c61
AD
65682001-12-29 Akim Demaille <akim@epita.fr>
6569
6570 %name-prefix is broken.
6571
6572 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
6573 Adjust all dependencies.
6574 * tests/headers.at (export YYLTYPE): Strengthen this test: use
6575 %name-prefix.
6576
6577 Renaming yylval but not yylloc is not consistent. Now we do.
6578
6579 * src/bison.simple: Prefix yylloc if used.
6580 * doc/bison.texinfo (Decl Summary): Document that.
6581
8c9a50be
AD
65822001-12-29 Akim Demaille <akim@epita.fr>
6583
6584 * doc/bison.texinfo: Promote `%long-directive' over
6585 `%long_directive'.
6586 Remove all references to fixed-output-files, yacc is enough.
6587
d99361e6
AD
65882001-12-29 Akim Demaille <akim@epita.fr>
6589
6590 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
6591 user prologue. These are defaults.
6592 * tests/actions.at (Mid-rule actions): Make sure the user can
6593 define YYDEBUG and YYERROR_VERBOSE.
6594
b9cecb91
AD
65952001-12-29 Akim Demaille <akim@epita.fr>
6596
6597 * src/output.c (header_output): Don't forget to export YYLTYPE and
6598 yylloc.
6599 * tests/headers.at (export YYLTYPE): New, make sure it does.
6600 * tests/regression.at (%union and --defines, Invalid CPP headers):
6601 Move to...
6602 * tests/headers.at: here.
6603
aea13e97
AD
66042001-12-29 Akim Demaille <akim@epita.fr>
6605
6606 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
6607
931394cb
AD
66082001-12-29 Akim Demaille <akim@epita.fr>
6609
6610 * tests/actions.at (Mid-rule actions): Output on a single line
6611 instead of several.
6612
704a47c4
AD
66132001-12-29 Akim Demaille <akim@epita.fr>
6614
6615 * doc/bison.texinfo: Formatting changes.
6616
091e20bb
AD
66172001-12-29 Akim Demaille <akim@epita.fr>
6618
6619 Don't store the token defs in a muscle, just be ready to output it
6620 on command. Now possible via `symbols'. Fixes a memory leak.
6621
6622 * src/output.c (token_definitions_output): New.
6623 (output_parser, header_output): Use it.
6624 * src/reader.c (symbols_save): Remove.
6625
cce71710
AD
66262001-12-29 Akim Demaille <akim@epita.fr>
6627
6628 * src/bison.simple: Do not provide a default for YYSTYPE and
6629 YYLTYPE before the user's prologue. Otherwise it's hardly... a
6630 default.
6631
82c035a8
AD
66322001-12-29 Akim Demaille <akim@epita.fr>
6633
6634 Mid-rule actions are simply... ignored!
6635
6636 * src/reader.c (readgram): Be sure to attach mid-rule actions to
6637 the empty-rule associated to the dummy symbol, not to the host
6638 rule.
6639 * tests/actions.at (Mid-rule actions): New.
6640
8419d367
AD
66412001-12-29 Akim Demaille <akim@epita.fr>
6642
6643 Memory leak.
6644
6645 * src/reader.c (reader): Free grammar.
6646
375d5806
AD
66472001-12-29 Akim Demaille <akim@epita.fr>
6648
6649 Memory leak.
6650
6651 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
6652 since it allocates it for each state, although only one is needed.
6653 (allocate_storage): Do it here.
6654
f51cb8ff
AD
66552001-12-29 Akim Demaille <akim@epita.fr>
6656
6657 * src/options.h, src/options.c (create_long_option_table): Rename
6658 as...
6659 (long_option_table_new): this, with a clearer prototype.
6660 (percent_table): Remove, unused,
6661 * src/getargs.c (getargs): Adjust.
6662
29e88316
AD
66632001-12-29 Akim Demaille <akim@epita.fr>
6664
6665 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
6666 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
6667 as states.
6668
b9f71f19
AD
66692001-12-29 Akim Demaille <akim@epita.fr>
6670
6671 * src/lalr.c (build_relations): Rename `states' as `states1'.
6672 Sorry, I don't understand exactly what it is, no better name...
6673
1a2b5d37
AD
66742001-12-29 Akim Demaille <akim@epita.fr>
6675
6676 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
6677 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
6678 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
6679 as rules.
6680
1cca533e
AD
66812001-12-29 Akim Demaille <akim@epita.fr>
6682
6683 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
6684 ago.
6685
c03ae966
AD
66862001-12-29 Akim Demaille <akim@epita.fr>
6687
6688 * src/reader.c, src/reader.h (user_toknums): Remove.
6689 Adjust all users to use symbols[i]->user_token_number.
6690
5a670b1e
AD
66912001-12-29 Akim Demaille <akim@epita.fr>
6692
6693 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
6694 Adjust all users to use symbols[i]->prec or ->assoc.
6695
ad949da9
AD
66962001-12-29 Akim Demaille <akim@epita.fr>
6697
6698 * src/reader.c, src/reader.h (tags): Remove.
6699 Adjust all users to use symbols[i]->tag.
6700
0e78e603
AD
67012001-12-29 Akim Demaille <akim@epita.fr>
6702
6703 * src/gram.h, src/gram.c (symbols): New, similar to state_table
6704 and rule_table.
6705 * src/reader.c (packsymbols): Fill this table.
6706 Drop sprec.
6707 * src/conflicts.c (resolve_sr_conflict): Adjust.
6708 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
6709 single table.
6710 Use symbols[i]->tag instead of tags[i].
6711
213e640e
AD
67122001-12-29 Akim Demaille <akim@epita.fr>
6713
6714 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
6715 In addition, put a comment in there, to replace...
6716 * tests/regression.at (%union and C comments): Remove.
6717
e7b8bef1
AD
67182001-12-29 Akim Demaille <akim@epita.fr>
6719
6720 * tests/regression.at (Web2c Actions): Blindly move the actual
6721 output as expected output. The contents *seem* right to me, but I
6722 can't pretend reading perfectly parser tables... Nonetheless, all
6723 the other tests pass correctly, the table look OK, even though the
6724 presence of `$axiom' is to be noted: AFAICS it is useless (but
6725 harmless).
6726
b68e7744
AD
67272001-12-29 Akim Demaille <akim@epita.fr>
6728
6729 * src/reader.c (readgram): Don't add the rule 0 if there were no
6730 rules read. In other words, add it _after_ having performed
6731 grammar sanity checks.
6732 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
6733
78d5bae9
AD
67342001-12-29 Akim Demaille <akim@epita.fr>
6735
6736 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
6737 visible, and some states have now a different number.
6738
ff442794
AD
67392001-12-29 Akim Demaille <akim@epita.fr>
6740
6741 * src/reader.c (readgram): Bind the initial rule's lineno to that
6742 of the first rule.
6743 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
6744 (Solved SR Conflicts): Adjust rule 0's line number.
6745
610ab194
AD
67462001-12-29 Akim Demaille <akim@epita.fr>
6747
6748 Fix the `GAWK Grammar' failure.
6749
6750 * src/LR0.c (final_state): Initialize to -1 so that we do compute
6751 the reductions of the first state which was mistakenly confused
6752 with the final state because precisely final_state was initialized
6753 to 0.
6754 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
6755 now noticed by Bison.
6756 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
6757 have a reduction on $default.
6758
29d29c8f
AD
67592001-12-29 Akim Demaille <akim@epita.fr>
6760
6761 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
6762 rule line numbers.
6763 * src/closure.c (print_closure): Likewise.
6764 * src/derives.c (print_derives): Likewise.
6765 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
6766 now.
6767
7c6b64d0
AD
67682001-12-29 Akim Demaille <akim@epita.fr>
6769
6770 * src/lalr.c (lookaheads_print): New.
6771 (lalr): Call it when --trace-flag.
6772 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
6773 are dumped.
6774
3d4daee3
AD
67752001-12-29 Akim Demaille <akim@epita.fr>
6776
6777 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
6778 when walking through ritem, even via rule->rhs.
6779 * src/reduce.c (dump_grammar, useful_production, reduce_output)
6780 (useful_production, useless_nonterminals): Likewise.
6781 (reduce_grammar_tables): Likewise, plus update nritems.
6782 * src/nullable.c (set_nullable): Likewise.
6783 * src/lalr.c (build_relations): Likewise.
6784 * tests/sets.at (Nullable): Adjust.
6785 Fortunately, now, the $axiom is no longer nullable.
6786
9e7f6bbd
AD
67872001-12-29 Akim Demaille <akim@epita.fr>
6788
6789 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
6790 the 0-sentinel.
6791 * src/gram.c (ritem_longest_rhs): Likewise.
6792 * src/reduce.c (nonterminals_reduce): Likewise.
6793 * src/print_graph.c (print_graph): Likewise.
6794 * src/output.c (output_rule_data): Likewise.
6795 * src/nullable.c (set_nullable): Likewise.
6796
255ef638
AD
67972001-12-29 Akim Demaille <akim@epita.fr>
6798
6799 * src/output.c: Comment changes.
6800
0d8a7363
AD
68012001-12-27 Paul Eggert <eggert@twinsun.com>
6802
6803 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
6804 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
6805 Sparc, as they were causing more porting problems than the
6806 (minor) performance improvement was worth.
6807
6808 Also, catch up with 1.31's YYSTD.
6809
3db472b9
AD
68102001-12-27 Akim Demaille <akim@epita.fr>
6811
6812 * src/output.c (output_gram): Rely on nritems, not the
6813 0-sentinel. See below.
6814 Use -1 as separator, not 0.
6815 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
6816 Rely on -1 as separator in yyrhs, instead of 0.
6817 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
6818 twice `Now at end of input', therefore there are two lines less to
6819 expect.
6820
b365aa05
AD
68212001-12-27 Akim Demaille <akim@epita.fr>
6822
6823 * tests/regression.at (Unresolved SR Conflicts):
6824 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
6825 below.
6826
30171f79
AD
68272001-12-27 Akim Demaille <akim@epita.fr>
6828
6829 * src/LR0.c (new_state): Recognize the final state by the fact it
6830 is reached by eoftoken.
6831 (insert_start_shifting_state, insert_eof_shifting_state)
6832 (insert_accepting_state, augment_automaton): Remove, since now
6833 these states are automatically computed from the initial state.
6834 (generate_states): Adjust.
6835 * src/print.c: When reporting a rule number to the user, substract
6836 1, so that the axiom rule is rule 0, and the first user rule is 1.
6837 * src/reduce.c: Likewise.
6838 * src/print_graph.c (print_core): For the time being, just as for
6839 the report, depend upon --trace-flags to dump the full set of
6840 items.
6841 * src/reader.c (readgram): Once the grammar read, insert the rule
6842 0: `$axiom: START-SYMBOL $'.
6843 * tests/set.at: Adjust: rule 0 is now displayed, and since the
6844 number of the states has changed (the final state is no longer
6845 necessarily the last), catch up.
6846
75142d45
AD
68472001-12-27 Akim Demaille <akim@epita.fr>
6848
6849 Try to make the use of the eoftoken valid. Given that its value
6850 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
6851 is used instead of > 0 where appropriate, (ii), depend upon nritems
6852 instead of the 0-sentinel.
6853
6854 * src/gram.h, src/gram.c (nritems): New.
6855 Expected to be duplication of nitems, but for the time being...
6856 * src/reader.c (packgram): Assert nritems and nitems are equal.
6857 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
6858 * src/closure.c (print_closure, print_fderives): Likewise.
6859 * src/gram.c (ritem_print): Likewise.
6860 * src/print.c (print_core, print_grammar): Likewise.
6861 * src/print_graph.c: Likewise.
6862
b7c49edf
AD
68632001-12-27 Akim Demaille <akim@epita.fr>
6864
6865 * src/main.c (main): If there are complains after grammar
6866 reductions, then output the report anyway if requested, then die.
6867 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
6868 * src/reader.c (eoftoken): New.
6869 (parse_token_decl): If the token being defined has value `0', it
6870 is the eoftoken.
6871 (packsymbols): No longer hack `tags' to insert `$' by hand.
6872 Be sure to preserve the value of the eoftoken.
6873 (reader): Make sure eoftoken is defined.
6874 Initialize nsyms to 0: now eoftoken is created just like the others.
6875 * src/print.c (print_grammar): Don't special case the eof token.
6876 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
6877 lie anyway, albeit pleasant.
6878 * tests/calc.at: Exercise error messages with eoftoken.
6879 Change the grammar so that empty input is invalid.
6880 Adjust expectations.
6881 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
6882
ec2da99f
AD
68832001-12-27 Akim Demaille <akim@epita.fr>
6884
6885 * configure.in: Check the protos of strchr ans strspn.
6886 Replace strchr if needed.
6887 * src/system.h: Provide the protos of strchr, strspn and memchr if
6888 missing.
6889 * lib/strchr.c: New.
6890 * src/reader.c (symbols_save): Use strchr.
6891
8adfa272
AD
68922001-12-27 Akim Demaille <akim@epita.fr>
6893
6894 * src/print.c, src/print_graph.c (escape): New.
6895 Use it to quote the TAGS outputs.
6896 * src/print_graph.c (print_state): Now errors are in red, and
6897 reductions in green.
6898 Prefer high to wide: output the state number on a line of its own.
6899
80dac38c
AD
69002001-12-27 Akim Demaille <akim@epita.fr>
6901
6902 * src/state.h, src/state.c (reductions_new): New.
6903 * src/LR0.c (set_state_table): Let all the states have a
6904 `reductions', even if reduced to 0.
6905 (save_reductions): Adjust.
6906 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
6907 * src/print.c (print_reductions, print_actions): Adjust.
6908 * src/output.c (action_row): Adjust.
6909
2cec70b9
AD
69102001-12-27 Akim Demaille <akim@epita.fr>
6911
6912 * src/state.h, src/state.c (errs_new, errs_dup): New.
6913 * src/LR0.c (set_state_table): Let all the states have an errs,
6914 even if reduced to 0.
6915 * src/print.c (print_errs, print_reductions): Adjust.
6916 * src/output.c (output_actions, action_row): Adjust.
6917 * src/conflicts.c (resolve_sr_conflict): Adjust.
6918
13ca549a
AD
69192001-12-27 Akim Demaille <akim@epita.fr>
6920
6921 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
6922
5092aba5
AD
69232001-12-27 Akim Demaille <akim@epita.fr>
6924
6925 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
6926 * src/print.c: here.
6927 (lookaheadset, shiftset): New, used as additional storage by
6928 print_reductions.
6929 (print_results): Adjust.
6930 (print_shifts, print_gotos, print_errs): New, extracted from...
6931 (print_actions): here.
6932 * src/print_graph.c (print_actions): Remove dead code.
6933
11e2beca
AD
69342001-12-27 Akim Demaille <akim@epita.fr>
6935
6936 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
6937 `$n' and `@n'.
6938
dac3c910
AD
69392001-12-27 Akim Demaille <akim@epita.fr>
6940
6941 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
6942 (build_relations): Adjust.
6943
d0b0fefa
AD
69442001-12-27 Akim Demaille <akim@epita.fr>
6945
6946 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
6947 duplication.
6948
adc8c848
AD
69492001-12-27 Akim Demaille <akim@epita.fr>
6950
6951 * src/reader.c (packgram): Catch nitems overflows.
6952
14d293ac
AD
69532001-12-27 Akim Demaille <akim@epita.fr>
6954
6955 * src/files.c, src/files.h (guard_obstack): Remove.
6956 * src/output.c (output): Adjust.
6957 * src/reader.c (parse_braces): New, factoring...
6958 (copy_action, copy_guard): these two which are renamed as...
6959 (parse_action, parse_guard): these.
6960 As a voluntary consequence, using braces around guards is now
6961 mandatory.
6962
f499b062
AD
69632001-12-27 Akim Demaille <akim@epita.fr>
6964
6965 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
6966 * src/reader.c (symbol_list): `guard' and `guard_line' are new
6967 members.
6968 (symbol_list_new): Adjust.
6969 (copy_action): action_line is the first line, not the last.
6970 (copy_guard): Just as for actions, store the `action' only, not
6971 the switch/case/break flesh.
6972 Don't parse the user action that might follow the guard, let...
6973 (readgram): do it, i.e., now, there can be an action after a
6974 guard.
6975 In other words the guard is just explicitly optional.
6976 (packgram): Adjust.
6977 * src/output.c (guards_output): New.
6978 (output_parser): Call it when needed.
6979 (output): Also free the guard and attrs obstacks.
6980 * src/files.c, src/files.h (obstack_save): Remove.
6981 (output_files): Remove.
6982 As a result, if one needs the former `.act' file, using an
6983 appropriate skeleton which requires actions and guards is now
6984 required.
6985 * src/main.c (main): Adjust.
6986 * tests/semantic.at: New.
6987 * tests/regression.at: Use `input.y' as input file name.
6988 Avoid 8+3 problems by requiring input.c when the test needs the
6989 parser.
6990
d945f5cd
AD
69912001-12-27 Akim Demaille <akim@epita.fr>
6992
6993 * src/reader.c (symbol_list_new): Be sure to initialize all the
6994 fields.
6995
d200e455
AD
69962001-12-27 Akim Demaille <akim@epita.fr>
6997
6998 All the hacks using a final pseudo state are now useless.
6999
7000 * src/LR0.c (set_state_table): state_table holds exactly nstates.
7001 * src/lalr.c (nLA): New.
7002 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
7003 instead of lookaheadsp from the pseudo state (nstate + 1).
7004
f9507c28
AD
70052001-12-27 Akim Demaille <akim@epita.fr>
7006
7007 * src/output.c (action_row, token_actions): Use a state_t instead
7008 of a integer, and nlookaheads instead of the following state's
7009 lookaheadsp.
7010
065fbd27
AD
70112001-12-27 Akim Demaille <akim@epita.fr>
7012
7013 * src/conflicts.c (log_resolution, flush_shift)
7014 (resolve_sr_conflict, set_conflicts, solve_conflicts)
7015 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
7016 (conflicts_print, print_reductions): Use a state_t instead of an
7017 integer when referring to a state.
7018 As much as possible, depend upon nlookaheads, instead of the
7019 `lookaheadsp' member of the following state (since lookaheads of
7020 successive states are successive, the difference between state n + 1
7021 and n served as the number of lookaheads for state n).
7022 * src/lalr.c (add_lookback_edge): Likewise.
7023 * src/print.c (print_core, print_actions, print_state)
7024 (print_results): Likewise.
7025 * src/print_graph.c (print_core, print_actions, print_state)
7026 (print_graph): Likewise.
7027 * src/conflicts.h: Adjust.
7028
1b177bd7
AD
70292001-12-27 Akim Demaille <akim@epita.fr>
7030
7031 * src/bison.hairy: Formatting/comment changes.
7032 ANSIfy.
7033 Remove `register' indications.
7034 Add plenty of `static'.
7035
7742ddeb
AD
70362001-12-27 Akim Demaille <akim@epita.fr>
7037
7038 * src/output.c (prepare): Drop the muscle `ntbase' which
7039 duplicates ntokens.
7040 * src/bison.simple: Formatting/comment changes.
7041 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
7042 is an undocumented synonym.
7043
1fa14068
AD
70442001-12-22 Akim Demaille <akim@epita.fr>
7045
7046 * src/output.c (output_table_data): Change the prototype to use
7047 `int' for array ranges: some invocations do pass an int, not a
7048 short.
7049 Reported by Wayne Green.
7050
b9752825
AD
70512001-12-22 Akim Demaille <akim@epita.fr>
7052
7053 Some actions of web2c.y are improperly triggered.
7054 Reported by Mike Castle.
7055
7056 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
7057 * tests/regression.at (Web2c): Rename as...
7058 (Web2c Report): this.
7059 (Web2c Actions): New.
7060
776209d6
AD
70612001-12-22 Akim Demaille <akim@epita.fr>
7062
7063 Reductions in web2c.y are improperly reported.
7064 Reported by Mike Castle.
7065
7066 * src/conflicts.c (print_reductions): Fix.
7067 * tests/regression.at (Web2c): New.
7068
275fc3ad
AD
70692001-12-18 Akim Demaille <akim@epita.fr>
7070
7071 Some host fail on `assert (!"foo")', which expands to
7072 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
7073 Reported by Nelson Beebee.
7074
7075 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
7076 `#define it_succeeded 0' and `assert (it_succeeded)'.
7077
897668ee
MA
70782001-12-17 Marc Autret <autret_m@epita.fr>
7079
7080 * src/bison.simple: Don't hard code the skeleton line and filename.
7081 * src/output.c (output_parser): Rename 'line' as 'output_line'.
7082 New line counter 'skeleton_line' (skeleton-line muscle).
7083
ab3399e0
PE
70842001-12-17 Paul Eggert <eggert@twinsun.com>
7085
7086 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
7087 YYDEBUG must be defined to a nonzero value.
7088
7089 * src/bison.simple (yytname): Do not assume that the user defines
7090 YYDEBUG to a properly parenthesized expression.
7091
3877f72b
AD
70922001-12-17 Akim Demaille <akim@epita.fr>
7093
7094 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
7095 nlookaheads is a new member.
7096 Adjust all users.
7097 * src/lalr.h (nlookaheads): Remove this orphan declaration.
7098 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
7099 state.
776209d6 7100
331dbc1b
AD
71012001-12-17 Akim Demaille <akim@epita.fr>
7102
7103 * src/files.h, src/files.c (open_files, close_files): Remove.
7104 * src/main.c (main): Don't open/close files, nor invoke lex_free,
7105 let...
7106 * src/reader.c (reader): Do it.
776209d6 7107
be750e4c
AD
71082001-12-17 Akim Demaille <akim@epita.fr>
7109
7110 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 7111
709ae8c6
AD
71122001-12-17 Akim Demaille <akim@epita.fr>
7113
7114 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
7115 (flush_reduce): New.
7116 (resolve_sr_conflict): Adjust.
776209d6 7117
f87685c3
AD
71182001-12-17 Akim Demaille <akim@epita.fr>
7119
7120 * src/output.c (output_obstack): Be static and rename as...
7121 (format_obstack): this, to avoid any confusion with files.c's
7122 output_obstack.
7123 * src/reader.h (muscle_obstack): Move to...
7124 * src/output.h: here, since it's defined in output.c.
7125
837491d8
AD
71262001-12-17 Akim Demaille <akim@epita.fr>
7127
7128 * src/output.c (action_row, save_column, default_goto)
7129 (sort_actions, matching_state, pack_vector): Better variable
7130 locality.
7131
796d61fb
AD
71322001-12-17 Akim Demaille <akim@epita.fr>
7133
7134 * src/output.c: Various formatting changes.
776209d6 7135
64d15509
AD
71362001-12-17 Akim Demaille <akim@epita.fr>
7137
7138 * src/files.c (output_files): Free the output_obstack.
7139 * src/main.c (main): Call print and print_graph conditionally.
7140 * src/print.c (print): Work unconditionally.
7141 * src/print_graph.c (print_graph): Work unconditionally.
7142 * src/conflicts.c (log_resolution): Output only if verbose_flag.
7143
fbc8ecb7
MA
71442001-12-16 Marc Autret <autret_m@epita.fr>
7145
7146 * src/output.c (actions_output): Fix. When we use %no-lines,
7147 there is one less line per action.
7148
f0440388
MA
71492001-12-16 Marc Autret <autret_m@epita.fr>
7150
7151 * src/bison.simple: Remove a useless #line directive.
7152 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
7153 * src/output.c (get_lines_number): New.
776209d6 7154 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
7155 output muscles.
7156 Fix line numbering.
7157 (actions_output): Computes the number of lines taken by actions.
7158 (output_master_parser): Insert new skeleton which is the name of
7159 the output parser file name.
7160
a79986b8
MA
71612001-12-15 Marc Autret <autret_m@epita.fr>
7162
7163 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
7164
4ec8e00f
MA
71652001-12-15 Marc Autret <autret_m@epita.fr>
7166
7167 * src/output.c (output_gram): Keep track of the hairy one.
7168
1a4648ff
AD
71692001-12-15 Akim Demaille <akim@epita.fr>
7170
7171 Make `make distcheck' work.
7172
7173 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
7174 system.h which uses libgettext.h.
7175
9c2c67e6
AD
71762001-12-15 Akim Demaille <akim@epita.fr>
7177
7178 * src/nullable.c (set_nullable): Useless rules must be skipped,
7179 otherwise, since we range over their symbols, we might look at a
7180 nonterminal which no longer ``exists'', i.e., it is not counted in
7181 `nvars', hence we overflow our arrays.
7182
93ede233
AD
71832001-12-15 Akim Demaille <akim@epita.fr>
7184
7185 The header can also be produced directly, without any obstack!
7186 Yahoo!
7187
7188 * src/files.c, src/files.h (defines_obstack): Remove.
7189 (compute_header_macro): Global.
7190 (defines_obstack_save): Remove.
7191 * src/reader.c (parse_union_decl): No longer output to
7192 defines_obstack: its content can be found in the `stype' muscle
7193 anyway.
7194 (output_token_translations): Merge into...
7195 (symbols_output): this.
7196 Rename as...
7197 (symbols_save): this.
7198 (reader): Adjust.
7199 * src/output.c (header_output): New.
7200 (output): Call it.
7201
2666f928
AD
72022001-12-15 Akim Demaille <akim@epita.fr>
7203
7204 * src/reader.c (parse_union_decl): Instead of handling two obstack
7205 simultaneously, use one to define the `stype' muscle, and use the
7206 value of the latter to fill defines_obstack.
7207 (copy_comment): Remove.
7208 (copy_comment2): Work for a single obstack.
7209 Rename as...
7210 (copy_comment): this.
7211
428046f8
AD
72122001-12-15 Akim Demaille <akim@epita.fr>
7213
7214 * src/lex.c, src/lex.h (xgetc): No longer static.
7215 * src/reader.c (parse_union_decl): Revamp.
7216
ea52d706
AD
72172001-12-15 Akim Demaille <akim@epita.fr>
7218
7219 Still making progress in separating Bison into (i) input, (ii)
7220 process, (iii) output: now we can directly output the parser file
7221 without using table_obstack at all.
7222
7223 * src/files.c, src/files.h (table_obstack): Bye bye.
7224 (parser_file_name): New.
7225 * src/files.c (compute_output_file_names): Compute it.
7226 * src/output.c (actions_output, output_parser)
7227 (output_master_parser): To a file instead of an obstack.
7228
3f96f4dc
AD
72292001-12-15 Akim Demaille <akim@epita.fr>
7230
7231 Attach actions to rules, instead of pre-outputting them to
7232 actions_obstack.
7233
7234 * src/gram.h (rule_t): action and action_line are new members.
7235 * src/reader.c (symbol_list): Likewise.
7236 (copy_action): Save the actions within the rule.
7237 (packgram): Save them in rule_table.
7238 * src/output.c (actions_output): New.
7239 (output_parser): Use it on `%%actions'.
7240 (output_rule_data): Don't free rule_table.
7241 (output): Do it.
7242 (prepare): Don't save the `action' muscle.
7243 * src/bison.simple: s/%%action/%%actions/.
7244
51576fb3
AD
72452001-12-15 Akim Demaille <akim@epita.fr>
7246
7247 * src/reader.c (copy_action): When --yacc, don't append a `;'
7248 to the user action: let it fail if lacking.
dee049eb 7249 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 7250
2648a72d
AD
72512001-12-14 Akim Demaille <akim@epita.fr>
7252
7253 * src/lex.c (literalchar): Simply return the char you decoded, non
7254 longer mess around with obstacks and int pointers.
7255 Adjust all callers.
7256
92790e5b
AD
72572001-12-14 Akim Demaille <akim@epita.fr>
7258
7259 * src/lex.c (literalchar): Don't escape the special characters,
7260 just decode them, and keep them as char (before, eol was output as
7261 the 2 char string `\n' etc.).
7262 * src/output.c (output_rule_data): Use quotearg to output the
7263 token strings.
7264
927c1557
PE
72652001-12-13 Paul Eggert <eggert@twinsun.com>
7266
7267 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
7268 Do not infringe on the global user namespace when using C++.
7269 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
7270 All uses of `fprintf' and `stderr' changed.
7271
7272 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
7273
ed8e1f68
AD
72742001-12-13 Akim Demaille <akim@epita.fr>
7275
7276 The computation of nullable is broken: it doesn't handle empty
7277 RHS's properly.
7278
7279 * tests/torture.at (GNU AWK Grammar): New.
7280 * tests/sets.at (Nullable): New.
7281 * src/nullable.c (set_nullable): Instead of blindly looping over
7282 `ritems', loop over the rules, and then over their rhs's.
7283
7284 Work around Autotest bugs.
7285
7286 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
7287 frame, because Autotest understand lines starting with a `+' as
7288 traces from the shell. Then, they are not processed properly.
7289 Admittedly an Autotest bug, but we don't have time to wait for
7290 Autotest to catch up.
7291 * tests/regression.at (Broken Closure): Adjust to the new table
7292 frames.
7293 Move to...
7294 * tests/sets.at: here.
7295
cb581495
AD
72962001-12-13 Akim Demaille <akim@epita.fr>
7297
7298 * src/closure.c (closure): Use nrules instead of playing tricks
7299 with BITS_PER_WORD.
7300
2e729273
AD
73012001-12-13 Akim Demaille <akim@epita.fr>
7302
7303 * src/print.c (print_actions): Output the handling of `$' as the
7304 traces do: shifting the token EOF. Before EOF was treated as a
7305 nonterminal.
7306 * tests/regression.at: Adjust some tests.
7307 * src/print_graph.c (print_core): Complete the set of items via
7308 closure. The next-to-final and final states are still unsatisfying,
7309 but that's to be addressed elsewhere.
7310 No longer output the rule numbers, but do output the state number.
7311 A single loop for the shifts + gotos is enough, but picked a
7312 distinct color for each.
7313 (print_graph): Initialize and finalize closure.
7314
107f7dfb
AD
73152001-12-13 Akim Demaille <akim@epita.fr>
7316
7317 * src/reader.c (readgram): Remove dead code, an strip useless
7318 braces.
7319 (get_type): Remove, unused.
7320
9b53a24f
AD
73212001-12-12 Akim Demaille <akim@epita.fr>
7322
7323 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
7324 on that of lib/error.c.
7325
dbfb6dcd
AD
73262001-12-12 Akim Demaille <akim@epita.fr>
7327
7328 Some hosts don't like `/' in includes.
7329
7330 * src/system.h: Include libgettext.h without qualifying the path.
7331 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
7332 $(top_srcdir).
7333
c25fb648
MA
73342001-12-11 Marc Autret <autret_m@epita.fr>
7335
7336 * src/output.c (output_parser): Remove useless muscle.
7337
710ddc4f
MA
73382001-12-11 Marc Autret <autret_m@epita.fr>
7339
7340 * src/bison.simple: Remove #line just before %%epilogue. It
7341 is now handled in ...
7342 * src/reader.c (read_additionnal_code): Add the output of a
7343 #line for the epilogue.
7344
e83d80b8
MA
73452001-12-10 Marc Autret <autret_m@epita.fr>
7346
927c1557 7347 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
7348 replace precedent remove.
7349 * src/bison.simple: Remove #line before %%prologue because
7350 %%input-line is wrong at this time.
7351
971d5158
MA
73522001-12-10 Marc Autret <autret_m@epita.fr>
7353
7354 * src/reader.c (symbols_output): Clean up.
927c1557 7355 * src/output.c (output_gram, output): Clean up.
971d5158 7356
5edafffd
AD
73572001-12-10 Akim Demaille <akim@epita.fr>
7358
7359 * src/lalr.c (initialize_lookaheads): New. Extracted from...
7360 * src/LR0.c (set_state_table): here.
7361 * src/lalr.c (lalr): Call it.
7362
0279f8e9
AD
73632001-12-10 Akim Demaille <akim@epita.fr>
7364
7365 * src/state.h (shifts): Remove the `number' member: shifts are
7366 attached to state, hence no longer need to be labelled with a
7367 state number.
7368
190c4f5f
AD
73692001-12-10 Akim Demaille <akim@epita.fr>
7370
7371 Now that states have a complete set of members, the linked list of
7372 shifts is useless: just fill directly the state's shifts member.
7373
7374 * src/state.h (shifts): Remove the `next' member.
7375 * src/LR0.c (first_state, last_state): Remove.
7376 Adjust the callers.
7377 (augment_automaton): Don't look for the shifts that must be added
7378 a shift on EOF: it is those of the state we looked for! But now,
7379 since shifts are attached, it is no longer needed to looking
7380 merely by its id: its number.
7381
2a73b93d
AD
73822001-12-10 Akim Demaille <akim@epita.fr>
7383
7384 * src/LR0.c (augment_automaton): Better variable locality.
7385 Remove an impossible branch: if there is a state corresponding to
7386 the start symbol being shifted, then there is shift for the start
7387 symbol from the initial state.
7388
74392f6a
AD
73892001-12-10 Akim Demaille <akim@epita.fr>
7390
7391 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
7392 only when appropriate: when insert_start_shifting_state' is not
7393 invoked.
7394 * tests/regression.at (Rule Line Numbers): Adjust.
7395
37c82725
AD
73962001-12-10 Akim Demaille <akim@epita.fr>
7397
7398 * src/LR0.c (augment_automaton): Now that all states have shifts,
7399 merge the two cases addition shifts to the initial state.
7400
6a164e0c
AD
74012001-12-10 Akim Demaille <akim@epita.fr>
7402
7403 * src/lalr.c (set_state_table): Move to...
7404 * src/LR0.c: here.
7405 * src/lalr.c (lalr): Don't call it...
7406 * src/LR0.c (generate_states): do it.
7407 * src/LR0.h (first_state): Remove, only the table is used.
7408
7215de24
AD
74092001-12-10 Akim Demaille <akim@epita.fr>
7410
7411 * src/LR0.h (first_shift, first_reduction): Remove.
7412 * src/lalr.c: Don't use first_shift: find shifts through the
7413 states.
7414
80e25d4d
AD
74152001-12-10 Akim Demaille <akim@epita.fr>
7416
7417 * src/LR0.c: Attach shifts to states as soon as they are
7418 computed.
7419 * src/lalr.c (set_state_table): Instead of assigning shifts to
7420 state, just assert that the mapping was properly done.
7421
0ab3728b
AD
74222001-12-10 Akim Demaille <akim@epita.fr>
7423
7424 * src/LR0.c (insert_start_shift): Rename as...
7425 (insert_start_shifting_state): this.
7426 (insert_eof_shifting_state, insert_accepting_state): New.
7427 (augment_automaton): Adjust.
7428 Better locality of the variables.
7429 When looking if the start_symbol is shifted from the initial
7430 state, using `while (... symbol != start_symbol ...)' sounds
7431 better than `while (... symbol < start_symbol ...)': If fail
7432 to see how the order between symbols could be relevant!
7433
78af9bbc
AD
74342001-12-10 Akim Demaille <akim@epita.fr>
7435
7436 * src/getargs.h: Don't declare `spec_name_prefix' and
7437 `spec_file_prefix', declared by src/files.h.
7438 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
7439 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
7440 * src/output.c (prepare): Adjust.
7441 * src/reader.c (symbols_output): Likewise.
7442 * src/vmsgetargs.c: Vaguely adjust, but who cares?
7443
bdef2a41
AD
74442001-12-10 Akim Demaille <akim@epita.fr>
7445
7446 * src/muscle_tab.c (muscle_init): NULL is a better default than
7447 `"0"'.
7448
3735969c
AD
74492001-12-10 Akim Demaille <akim@epita.fr>
7450
7451 * src/reader.c (reader): Calling symbols_output once is enough.
7452
49701457
AD
74532001-12-10 Akim Demaille <akim@epita.fr>
7454
7455 Now that states have a complete set of members, the linked list of
7456 reductions is useless: just fill directly the state's reductions
7457 member.
7458
7459 * src/state.h (struct reductions): Remove member `number' and
7460 `next'.
7461 * src/LR0.c (first_reduction, last_reduction): Remove.
7462 (save_reductions): Don't link the new reductions, store them in
7463 this_state.
7464 * src/lalr.c (set_state_table): No need to attach reductions to
7465 states, it's already done.
7466 * src/output.c (output_actions): No longer free the shifts, then
7467 the reductions, then the states: free all the states and their
7468 members.
7469
0edad749
AD
74702001-12-10 Akim Demaille <akim@epita.fr>
7471
7472 * src/options.c (OPTN, DRTV, BOTH): New.
7473 (option_table): Use them.
7474
0edad749
AD
7475 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
7476 the job of system.h.
7477 * src/options.c: Don't include stdio.h and xalloc.h for the same
7478 reasons.
7479
5449dd0f
AD
74802001-12-10 Akim Demaille <akim@epita.fr>
7481
7482 * src/output.c (output, prepare): Make sure the values of the
7483 muscles `action' and `prologue' are 0-terminated.
7484
a870c567
AD
74852001-12-10 Akim Demaille <akim@epita.fr>
7486
7487 Clean up GCC warnings.
7488
7489 * src/reader.c (copy_action): `buf' is not used.
7490 (parse_skel_decl): Be static.
7491 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
7492 * src/options.h (create_long_option_table): Have a real prototype.
7493 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
7494 (hash_delete_at): Return const void *.
7495 Adjust casts to preserve the const.
7496
80df8768
AD
74972001-12-10 Akim Demaille <akim@epita.fr>
7498
7499 * configure.in: Require 2.52g.
7500 M4 is not needed, but AUTOM4TE is.
7501 * m4/m4.m4: Remove.
7502 * tests/Makefile.am: Adjust.
7503
f693ad14
AD
75042001-12-10 Akim Demaille <akim@epita.fr>
7505
7506 One structure for states is enough, even though theoretically
7507 there are LR(0) states and LALR(1) states.
7508
7509 * src/lalr.h (state_t): Remove.
7510 (state_table): Be state_t **, not state_t *.
7511 * src/state.h (core, CORE_ALLOC): Rename as...
7512 (state_t, STATE_ALLOC): this.
7513 Add the LALR(1) members: shifts, reductions, errs.
7514 * src/LR0.c (state_table): Rename as...
7515 (state_hash): this, to avoid name clashes with the global
7516 `state_table'.
7517 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
7518 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
7519
74ffbcb6
AD
75202001-12-10 Akim Demaille <akim@epita.fr>
7521
7522 Bison dumps core on bash.y.
7523 Reported by Pascal Bart.
7524
7525 * src/warshall.c (bitmatrix_print): New.
7526 (TC): Use it.
7527 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
7528 j must be the outer loop.
7529 * tests/regression.at (Broken Closure): New.
7530
07708e19
AD
75312001-12-05 Akim Demaille <akim@epita.fr>
7532
7533 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
7534 its argument.
ba1ecc07 7535 Reported by Peter Hamorsky.
07708e19 7536
92b16366
AD
75372001-12-05 Akim Demaille <akim@epita.fr>
7538
7539 * src/conflicts.c (err_table): Remove.
7540 (resolve_sr_conflict): Adjust.
7541 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
7542 Rename as...
7543 (state_t.reductions, state_t.shifts): this.
7544
076ab033
AD
75452001-12-05 Akim Demaille <akim@epita.fr>
7546
7547 * src/reduce.c (reduce_grammar_tables): No longer disable the
7548 removal of useless rules via CPP but via `if (0)', so that the
7549 compiler still check the code is valid.
7550 For instance, it should have noticed `rline' no longer exists: use
7551 the `line' member of rule_t.
7552 * src/gram.c (dummy, rline): Remove, unused.
7553
3843c413
AD
75542001-12-05 Akim Demaille <akim@epita.fr>
7555
7556 * src/output.c (pack_vector): Use assert, not berror.
7557 * src/main.c (berror): Remove, unused.
7558
43168960
AD
75592001-12-05 Akim Demaille <akim@epita.fr>
7560
7561 New experimental feature: if --verbose --trace output all the
7562 items of a state, not only its kernel.
7563
7564 * src/print.c (print_core): If `trace_flag', then invoke closure
7565 before outputting the items of the state (print_core is no longer
7566 a correct name them).
7567 (print_results): Invoke new_closure/free_closure if needed.
7568
b2872512
AD
75692001-12-05 Akim Demaille <akim@epita.fr>
7570
7571 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
7572 * src/closure.c, src/closure.h (itemsetsize): Rename as...
7573 (nitemset): for consistency with the rest of the project.
7574
23cbcc6c
AD
75752001-12-05 Akim Demaille <akim@epita.fr>
7576
7577 * src/closure.c (print_closure): Improve.
7578 (closure): Use it for printing input and output.
7579
03ec521c
AD
75802001-12-05 Akim Demaille <akim@epita.fr>
7581
7582 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
7583 indexed by nonterminals.
7584
3a7456dd
AD
75852001-12-05 Akim Demaille <akim@epita.fr>
7586
7587 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
7588 what it was!).
7589 * src/warshall.h: Remove accidental duplication of the content.
7590
1cbcf2e7
AD
75912001-12-05 Akim Demaille <akim@epita.fr>
7592
7593 * src/closure.c (set_fderives): De-obfuscate.
7594
84182270
AD
75952001-12-05 Akim Demaille <akim@epita.fr>
7596
7597 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
7598
3f6f053c
AD
75992001-12-05 Akim Demaille <akim@epita.fr>
7600
7601 * src/closure.c (set_firsts): De-obfuscate.
7602
7a5350ba
AD
76032001-12-05 Akim Demaille <akim@epita.fr>
7604
7605 * src/output.c (action_row): De-obfuscate
7606 using the good o' techniques: arrays not pointers, variable
7607 locality, BITISSET, RESETBIT etc.
7608
d954473d
AD
76092001-12-05 Akim Demaille <akim@epita.fr>
7610
7611 Pessimize the code to simplify it: from now on, all the states
7612 have a valid SHIFTS, which NSHIFTS is possibly 0.
7613
7614 * src/LR0.c (shifts_new): Be global and move to..
7615 * src/state.c, src/state.h: here.
7616 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
7617 * src/print_graph: Adjust.
7618
9839bbe5
AD
76192001-12-05 Akim Demaille <akim@epita.fr>
7620
7621 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
7622 * src/conflicts.c: Use it.
7623 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
7624 incorrectly ``simplified''.
7625
9f136c07
AD
76262001-12-05 Akim Demaille <akim@epita.fr>
7627
7628 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
7629 using the good o' techniques: arrays not pointers, variable
7630 locality, BITISSET, RESETBIT etc.
7631
b608206e
AD
76322001-12-05 Akim Demaille <akim@epita.fr>
7633
7634 * src/state.h (SHIFT_SYMBOL): New.
7635 * src/conflicts.c: Use it to deobfuscate.
7636
52afa962
AD
76372001-12-05 Akim Demaille <akim@epita.fr>
7638
7639 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
7640 (print_reductions): De-obfuscate using the good o' techniques:
7641 arrays not pointers, variable locality, BITISSET.
7642
e74dc321
AD
76432001-12-05 Akim Demaille <akim@epita.fr>
7644
7645 * src/conflicts.c (print_reductions): Arrays, not pointers.
7646 Use BITISSET.
7647
768fca83
AD
76482001-12-05 Akim Demaille <akim@epita.fr>
7649
7650 * src/conflicts.c (print_reductions): Pessimize, but clarify.
7651
a17e599f
AD
76522001-12-05 Akim Demaille <akim@epita.fr>
7653
7654 * src/conflicts.c (print_reductions): Improve variable locality.
7655
a04bc341
AD
76562001-12-05 Akim Demaille <akim@epita.fr>
7657
7658 * src/conflicts.c (print_reductions): Pessimize, but clarify.
7659
c8ea038e
AD
76602001-12-05 Akim Demaille <akim@epita.fr>
7661
7662 * src/conflicts.c (print_reductions): Improve variable locality.
7663
aa2aab3c
AD
76642001-12-05 Akim Demaille <akim@epita.fr>
7665
7666 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
7667 * src/lalr.c: Use them.
7668
b178c8cc
AD
76692001-12-05 Akim Demaille <akim@epita.fr>
7670
7671 * src/LR0.c (augment_automaton): Formatting changes.
7672 Better variable locality.
7673
f67d13aa
AD
76742001-12-05 Akim Demaille <akim@epita.fr>
7675
7676 * src/lalr.c (matrix_print): New.
7677 (transpose): Use it.
7678 Use arrays instead of pointers.
7679
c2713865
AD
76802001-12-05 Akim Demaille <akim@epita.fr>
7681
7682 * src/lalr.c (maxrhs): Move to...
7683 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
7684 * src/lalr.c (build_relations): Adjust.
7685
9887c18a
AD
76862001-12-05 Akim Demaille <akim@epita.fr>
7687
7688 * src/lalr.c (transpose): Free the memory allocated to the
7689 argument, as it is replaced by the results by the unique caller.
7690 (build_relations): Merely invoke transpose: it handles the memory
7691 deallocation.
7692 Improve variable locality.
7693 Avoid variables used as mere abbreviations.
7694 (compute_lookaheads): Use arrays instead of pointers.
7695
4d4f699c
AD
76962001-12-05 Akim Demaille <akim@epita.fr>
7697
7698 * src/lalr.c (initialize_F): Improve variable locality.
7699 Avoid variables used as mere abbreviations.
7700
80a69750
AD
77012001-12-05 Akim Demaille <akim@epita.fr>
7702
7703 * src/derives.c (print_derives): Display the ruleno.
7704 * src/lalr.c (initialize_F, transpose): Better variable locality
7705 to improve readability.
7706 Avoid variables used as mere abbreviations.
7707
fe961097
AD
77082001-12-05 Akim Demaille <akim@epita.fr>
7709
7710 * src/lalr.c (traverse): Use arrays instead of pointers.
7711
e3e4e814
AD
77122001-12-05 Akim Demaille <akim@epita.fr>
7713
7714 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
7715 the handling of squeue.
7716 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
7717
630e182b
AD
77182001-12-05 Akim Demaille <akim@epita.fr>
7719
7720 Because useless nonterminals are now kept alive (instead of being
7721 `destroyed'), we now sometimes examine them, and store information
7722 related to them. Hence we need to know their number, and adjust
7723 memory allocations.
7724
7725 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
7726 static.
7727 * src/LR0.c (allocate_itemsets): The memory allocated to
7728 `symbol_count' was used for two different purpose: once to count
7729 the number of occurrences of each symbol, and later reassigned to
7730 `shift_symbol', containing the symbol that can be shifted from a
7731 given state.
7732 Deobfuscate, i.e., allocate, use and free `symbol_count' here
7733 only, and...
7734 (new_itemsets): Allocate `shift_symbol' here.
7735 (allocate_itemsets): symbol_count includes useless nonterminals.
7736 Make room for them.
7737 (free_storage): Use `free', not `XFREE', for pointers that cannot
7738 be null.
7739
81b51460
AD
77402001-12-05 Akim Demaille <akim@epita.fr>
7741
7742 * src/nullable.c (set_nullable): Deobfuscate the handling of
7743 ritem.
7744 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
7745
3067fbef
AD
77462001-12-05 Akim Demaille <akim@epita.fr>
7747
7748 * src/gram.c, src/gram.h (ritem_print): New.
7749 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
7750 (This useless function was defined only to work around VMS linkers
7751 that can't handle compilation units with variables only).
7752 * src/reduce.c (dump_grammar): Use it to trace the construction of
7753 ritem.
7754
c2bea5f9
PE
77552001-12-04 Paul Eggert <eggert@twinsun.com>
7756
7d27c823
PE
7757 * src/bison.simple (union yyalloc): Change member names
7758 to be the same as the stack names.
7759 (yyparse): yyptr is now union yyalloc *, not char *.
7760 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
7761 and may generate better code on some machines.
c2bea5f9
PE
7762 (yystpcpy): Use prototype if __STDC__ is defined, not just
7763 if __cplusplus is defined.
35687a9d 7764
2c8a9dfa
AD
77652001-11-30 Akim Demaille <akim@epita.fr>
7766
7767 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
7768 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
7769 Gettext doesn't compile cleanly, and dies with -Werror.
7770 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
7771 Include WARNING_CFLAGS here.
7772 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
7773 before being defined.
7774
f4e421e6
AD
77752001-11-27 Paul Eggert <eggert@twinsun.com>
7776
7777 * lib/quotearg.h (quotearg_n, quotearg_n_style):
7778 First arg is int, not unsigned.
7779 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
7780 (SIZE_MAX, UINT_MAX): New macros.
7781 (quotearg_n_options): Abort if N is negative.
7782 Avoid overflow check on hosts where size_t is 64 bits and int
7783 is 32 bits, as overflow is impossible there.
7784 Fix off-by-one typo that caused unnecessary reallocation.
7785
7093d0f5
AD
77862001-11-29 Paul Eggert <eggert@twinsun.com>
7787
7788 Name space cleanup in generated parser.
7789
7790 * doc/bison.texinfo (Bison Parser): Discuss system headers
7791 and their effect on the user name space.
7792
7793 * src/bison.simple:
7794 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
7795 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
7796 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
7797
7798 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
7799 on user names when possible.
7800
7801 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
7802 Simplify test for whather <alloca.h> exists.
7803
7804 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
7805
7806 (<stdio.h>): Include if YYDEBUG.
7807
7808 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
7809 ! defined (yyoverflow) && ! defined (yymemcpy).
7810
7811 (yymemcpy, yyparse): Rename local variables as needed so that
7812 they all begin with 'yy'.
7813
7814 (yystrlen, yystpcpy): New functions.
7815
7816 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
7817 All uses changed.
7818
7819 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
7820 instead of relying on string.h functions. Use YYSTACK_ALLOC
7821 and YYSTACK_FREE instead of malloc and free.
7822
fd51e5ff
AD
78232001-11-30 Akim Demaille <akim@epita.fr>
7824
7825 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
7826 before their first uses.
7827 (YYBISON, YYPURE): Move to the top of the output.
7828
7d13ff5f
AD
78292001-11-30 Akim Demaille <akim@epita.fr>
7830
7831 * tests/reduce.at (Useless Nonterminals): Fix.
7832
892a3995
AD
78332001-11-30 Akim Demaille <akim@epita.fr>
7834
7835 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
7836 if body instead of `;' to pacify GCC's warnings.
7837
68f1e3ed
AD
78382001-11-30 Akim Demaille <akim@epita.fr>
7839
7840 Instead of mapping the LHS of unused rules to -1, keep the LHS
7841 valid, but flag the rules as invalid.
7842
7843 * src/gram.h (rule_t): `useful' is a new member.
7844 * src/print.c (print_grammar): Adjust.
7845 * src/derives.c (set_derives): Likewise.
7846 * src/reader.c (packgram, reduce_output): Likewise.
7847 * src/reduce.c (reduce_grammar_tables): Likewise.
7848 * tests/reduce.at (Underivable Rules, Useless Rules): New.
7849
d2d1b42b
AD
78502001-11-30 Akim Demaille <akim@epita.fr>
7851
7852 * src/reduce.c (reduce_output): Formatting changes.
7853 * src/print.c (print_results, print_grammar): Likewise.
7854 * tests/regression.at (Rule Line Numbers)
7855 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
7856
760b53a8
AD
78572001-11-30 Akim Demaille <akim@epita.fr>
7858
7859 * src/reduce.c (nonterminals_reduce): Instead of throwing away
7860 useless nonterminals, move them at the end of the symbol arrays.
7861 (reduce_output): Adjust.
7862 * tests/reduce.at (Useless Nonterminals): Adjust.
7863
00238958
AD
78642001-11-30 Akim Demaille <akim@epita.fr>
7865
7866 * src/reduce.c: Various comment/formatting changes.
7867 (nonterminals_reduce): New, extracted from...
7868 (reduce_grammar_tables): here.
7869 (reduce_grammar): Call nonterminals_reduce.
7870
396452de
PE
78712001-11-29 Paul Eggert <eggert@twinsun.com>
7872
7873 * src/bison.simple (YYSTACK_REALLOC): Remove.
7874 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
7875 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
7876 New macros.
7877 (union yyalloc): New type.
7878 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
7879 an arbitrary restriction on hosts where size_t is wider than int.
7880
7881 (yyparse): Don't dump core if alloca or malloc fails; instead, report
7882 a parser stack overflow. Allocate just one block of memory for all
7883 three stacks, instead of allocating three blocks; this typically is
7884 faster and reduces fragmentation.
7885
7886 Do not limit the number of items in the stack to a value that fits
7887 in 'int', as this is an arbitrary limit on hosts with 64-bit
7888 size_t and 32-bit int.
7889
147e184c
MA
78902001-11-29 Marc Autret <autret_m@epita.fr>
7891
7892 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
7893 of defining YYERROR_VERBOSE.
7894 [AT_DATA]: $4 is now out of C declarations in the prologue.
7895
426cf563
MA
78962001-11-28 Marc Autret <autret_m@epita.fr>
7897
7898 * src/reader.c (parse_dquoted_param): New.
7899 (parse_skel_decl): Use it.
7900 * src/lex.h: Add its prototype.
7901 * src/lex.c (literalchar): Become not static.
7902
c7925b99
MA
79032001-11-28 Marc Autret <autret_m@epita.fr>
7904
7905 * src/output.h: And put its extern declaration here.
7906 * src/output.c (error_verbose): Define here.
7907 (prepare): Echo name modification.
7908 * src/getargs.h: Clean its extern declaration.
7909 * src/getargs.c (error_verbose_flag): Remove.
7910 (getargs): Remove case 'e'.
7911 * src/options.c (option_table): 'error-verbose' is now seen as simple
7912 percent option.
7913 Include output.h.
7914
7915 * src/reader.c (read_declarations): Remove case tok_include.
7916 (parse_include_decl): Remove.
7917 * src/lex.h (token_t): Remove tok_include.
7918 * src/options.c (option_table): 'include' is now a simple command line
7919 option.
7920
5b5d1929
MA
79212001-11-28 Marc Autret <autret_m@epita.fr>
7922
7923 * src/bison.simple: Adjust muscle names.
7924 * src/muscle_tab.c (muscle_init): Also rename the muscles.
7925 * src/output.c (prepare): s/_/-/ for the muscles names.
7926 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
7927
8850be4b
MA
79282001-11-28 Marc Autret <autret_m@epita.fr>
7929
7930 * src/bison.simple: Fix debug.
7931 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
7932
4a38e613
AD
79332001-11-28 Akim Demaille <akim@epita.fr>
7934
7935 * src/LR0.c (shifts_new): New.
7936 (save_shifts, insert_start_shift, augment_automaton): Use it.
7937
4b35e1c1
AD
79382001-11-28 Akim Demaille <akim@epita.fr>
7939
7940 * src/closure.c (closure): `b' and `ruleno' denote the same value:
7941 keep ruleno only.
7942
d2b04478
AD
79432001-11-28 Akim Demaille <akim@epita.fr>
7944
7945 * src/closure.c (closure): Instead of looping over word in array
7946 then bits in words, loop over bits in array.
7947
2c4c30aa
AD
79482001-11-28 Akim Demaille <akim@epita.fr>
7949
7950 * src/closure.c (closure): No longer optimize the special case
7951 where all the bits of `ruleset[r]' are set to 0, to make the code
7952 clearer.
7953
576890b7
AD
79542001-11-28 Akim Demaille <akim@epita.fr>
7955
7956 * src/closure.c (closure): `r' and `c' are new variables, used to
7957 de-obfuscate accesses to RULESET and CORE.
7958
cb487d7d
AD
79592001-11-28 Akim Demaille <akim@epita.fr>
7960
7961 * src/reduce.c (reduce_print): Use ngettext.
7962 (dump_grammar): Improve the trace accuracy.
7963
6013d43f
AD
79642001-11-28 Akim Demaille <akim@epita.fr>
7965
7966 * src/reduce.c (dump_grammar): Don't translate trace messages.
7967
cb4956ee
AD
79682001-11-28 Akim Demaille <akim@epita.fr>
7969
7970 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
7971 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
7972 as all tags are free'ed afterwards.
7973 From Enrico Scholz.
7974
648185ab
PE
79752001-11-27 Paul Eggert <eggert@twinsun.com>
7976
7977 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
7978 use alloca when we didn't want to, and vice versa.
7979
68254a03
MA
79802001-11-27 Marc Autret <autret_m@epita.fr>
7981
9113b58f
AD
7982 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
7983 initialization.
68254a03
MA
7984 * src/output.c (prepare): Remove its update.
7985
04d843a2
MA
79862001-11-27 Marc Autret <autret_m@epita.fr>
7987
7988 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
7989 Use %error-verbose.
7990
d2079671 79912001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
7992
7993 * src/bison.simple: Remove YYERROR_VERBOSE using.
7994 Use %%error_verbose.
7995 (yyparse): Likewise.
7996 * src/output.c (prepare): Give its final value.
7997 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
7998 * src/getargs.h: Add its extern declaration.
7999 * src/getargs.c (error_verbose_flag): New int.
8000 (getargs): Update to catch new case.
8001 * src/options.c (option_table): 'error-verbose' is a new option.
8002 (shortopts): Update.
8003
e0327bc8
AD
80042001-11-27 Akim Demaille <akim@epita.fr>
8005
8006 * src/system.h: Use intl/libgettext.h.
8007 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
8008
000f1a3c
AD
80092001-11-27 Akim Demaille <akim@epita.fr>
8010
8011 * tests/torture.at (Exploding the Stack Size with Malloc):
8012 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
8013
26cfe0be
AD
80142001-11-27 Akim Demaille <akim@epita.fr>
8015
8016 * src/files.c: Include error.h.
8017 Reported by Hans Aberg.
8018
f6bd5427
MA
80192001-11-26 Marc Autret <autret_m@epita.fr>
8020
d2079671 8021 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
8022 (read_declarations): Add case tok_include.
8023 * src/getargs.h (include): Add its extern definition.
8024 * src/getargs.c (include): New const char *.
8025 (getargs): Add case '-I'.
8026 * src/options.c (option_table): Add include as command line and
8027 percent option.
8028 * src/lex.h (token_t): Add tok_include.
8029
2ca209c1
AD
80302001-11-26 Akim Demaille <akim@epita.fr>
8031
8032 * src/reader.c (readgram): Make sure rules for mid-rule actions
8033 have a lineno equal to that of their host rule.
8034 Reported by Hans Aberg.
8035 * tests/regression.at (Rule Line Numbers): New.
8036
0e41b407
AD
80372001-11-26 Akim Demaille <akim@epita.fr>
8038
8039 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
8040 size_ts.
8041
80422001-11-26 Akim Demaille <akim@epita.fr>
8043
8044 * src/complain.c, src/complain.h (error): Remove, provided by
8045 lib/error.[ch].
8046
e0c40012
AD
80472001-11-26 Akim Demaille <akim@epita.fr>
8048
8049 * src/reader.c (read_declarations): Don't abort on tok_illegal,
8050 issue an error message.
8051 * tests/regression.at (Invalid %directive): New.
8052 Reported by Hans Aberg.
8053
5e147124
AD
80542001-11-26 Akim Demaille <akim@epita.fr>
8055
8056 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
8057 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
8058
a034c8b8
AD
80592001-11-26 Akim Demaille <akim@epita.fr>
8060
8061 * src/conflicts.c (conflicts_print): Don't complain at all when
8062 there are no reduce/reduce conflicts, and as many shift/reduce
8063 conflicts as expected.
8064 * tests/regression.at (%expect right): Adjust.
8065
c64a20f3
AD
80662001-11-23 Akim Demaille <akim@epita.fr>
8067
8068 * lib/alloca.c: Update, from fileutils.
8069
5b0d29bb
AD
80702001-11-23 Akim Demaille <akim@epita.fr>
8071
8072 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
8073
722c4bfe
AD
80742001-11-23 Akim Demaille <akim@epita.fr>
8075
8076 * src/system.h: Include alloca.h.
8077 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
8078
6255b435
AD
80792001-11-23 Akim Demaille <akim@epita.fr>
8080
8081 * src/print_graph.c (print_actions): Remove `rule', unused.
8082 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
8083 pacify GCC's signed < unsigned warnings.
8084 * src/closure.c (itemsetsize): Likewise.
8085 * src/reader.c (symbol_list_new): Static.
8086
b29b2ed5
AD
80872001-11-23 Akim Demaille <akim@epita.fr>
8088
8089 Attaching lineno to buckets is stupid, since only one copy of each
8090 symbol is kept, only the line of the first occurrence is kept too.
8091
8092 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
8093 * src/reader.c (rline_allocated): Remove, unused.
8094 (symbol_list): Have a `line' member.
8095 (symbol_list_new): New.
8096 (readgram): Use it.
8097 * src/print.c (print_grammar): Output the rule line numbers.
8098 * tests/regression.at (Solved SR Conflicts)
8099 (Unresolved SR Conflicts): Adjust.
8100 Reported by Hans Aberg.
8101
a81b1d4a
MA
81022001-11-22 Marc Autret <autret_m@epita.fr>
8103
8104 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
8105
c1ecb3c1
MA
81062001-11-22 Marc Autret <autret_m@epita.fr>
8107
8108 * src/muscle_tab.c (muscle_init): Remove initialization of
8109 skeleton muscle.
8110 * src/output.c (output_master_parser): Do it here.
8111
fbe01355
AD
81122001-11-20 Akim Demaille <akim@epita.fr>
8113
8114 * po/sv.po: New.
8115 * configure.in (ALL_LINGUAS): Adjust.
8116 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
8117 longer contains strings to translate.
8118
81e895c0
AD
81192001-11-19 Akim Demaille <akim@epita.fr>
8120
8121 * src/conflicts.c (conflicts_print): Add a missing \n.
8122
6bb1878b
AD
81232001-11-19 Akim Demaille <akim@epita.fr>
8124
8125 * src/nullable.c (nullable_print): New.
8126 (set_nullable): Call it when tracing.
8127 Better locality of variables.
8128
d9ec2d07
AD
81292001-11-19 Akim Demaille <akim@epita.fr>
8130
8131 * src/print.c (print_actions): Better locality of variables.
8132
720e5c1b
AD
81332001-11-19 Akim Demaille <akim@epita.fr>
8134
8135 * src/derives.c (print_derives): Fix and enrich.
8136 * src/closure.c (print_fderives): Likewise.
8137
fb908786
AD
81382001-11-19 Akim Demaille <akim@epita.fr>
8139
8140 * src/closure.c (itemsetend): Remove, replaced with...
8141 (itemsetsize): new.
8142
125ecb56
AD
81432001-11-19 Akim Demaille <akim@epita.fr>
8144
8145 * src/LR0.c (kernel_end): Remove, replaced with...
8146 (kernel_size): new.
8147
d8cf039f
AD
81482001-11-19 Akim Demaille <akim@epita.fr>
8149
8150 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
8151 to clarify.
8152
7bec0760
AD
81532001-11-19 Akim Demaille <akim@epita.fr>
8154
8155 * src/closure.c (closure): Use arrays instead of pointers to clarify.
8156
c87d4863
AD
81572001-11-19 Akim Demaille <akim@epita.fr>
8158
8159 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
8160 trace messages.
8161 * src/LR0.c: Likewise.
8162 (allocate_itemsets): Use arrays instead of pointers to clarify.
8163
9bfe901c
AD
81642001-11-19 Akim Demaille <akim@epita.fr>
8165
8166 * src/getargs.c (statistics_flag): Replace with...
8167 (trace_flag): New.
8168 (longopts): Accept --trace instead of --statistics.
8169 * src/getargs.h, src/options.c: Adjust.
8170 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
8171 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
8172
97db7bd4
AD
81732001-11-19 Akim Demaille <akim@epita.fr>
8174
cc72668c 8175 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
8176 pointers to clarify the code.
8177 (save_reductions, save_shifts): Factor common parts of alternatives.
8178
2c5f66ed
AD
81792001-11-19 Akim Demaille <akim@epita.fr>
8180
8181 * src/LR0.c (new_state, get_state): Complete TRACE code.
8182 * src/closure.c: Include `reader.h' to get `tags', needed by the
8183 trace code.
8184 Rename the conditional DEBUG as TRACE.
8185 Output consistently TRACEs to stderr, not stdout.
8186 * src/derives.c: Likewise.
8187 * src/reduce.c: (inaccessable_symbols): Using if is better style
8188 than goto.
8189 Use `#if TRACE' instead of `#if 0' for tracing code.
8190
300f275f
AD
81912001-11-19 Akim Demaille <akim@epita.fr>
8192
8193 * src/system.h (LIST_FREE, shortcpy): New.
8194 * src/LR0.c: Use them.
8195 * src/output.c (free_itemsets, free_reductions, free_shifts):
8196 Remove, replaced by LIST_FREE.
8197
f59c437a
AD
81982001-11-19 Akim Demaille <akim@epita.fr>
8199
8200 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
8201 (REDUCTIONS_ALLOC): New.
8202 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
8203 allocation.
8204
6986fd9e
AD
82052001-11-19 Akim Demaille <akim@epita.fr>
8206
8207 * src/LR0.c (new_state): Complete trace code.
8208 * src/nullable.c (set_nullable): Don't translate traces.
8209
4bc30f78
AD
82102001-11-19 Akim Demaille <akim@epita.fr>
8211
8212 * src/print_graph.c (print_core): Better locality of variables.
8213 * src/print.c (print_core): Likewise.
8214
08a946e0
AD
82152001-11-19 Akim Demaille <akim@epita.fr>
8216
8217 * src/vcg.c: You do the output, so you are responsible of the
8218 handling of VCG syntax, in particular: use quotearg.
8219 * src/print_graph.c: Don't.
8220 (print_actions): Don't output the actions as part of the nodes,
8221 since that's the job of the edges.
8222 (print_state): Don't output by hand: fill the node description,
9bfe901c 8223 and ask for its output.
08a946e0 8224
f0473484
AD
82252001-11-19 Akim Demaille <akim@epita.fr>
8226
cc72668c
AD
8227 * src/bison.simple (yyparse): When verbosely reporting an error,
8228 no longer put additional quotes around token names.
f0473484
AD
8229 * tests/calc.at: Adjust.
8230
e41dc700
AD
82312001-11-19 Akim Demaille <akim@epita.fr>
8232
8233 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
8234 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
8235 * src/output.c: Adjust.
8236
652a871c
AD
82372001-11-19 Akim Demaille <akim@epita.fr>
8238
8239 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
8240 (rule_t): this.
8241 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
8242
b2ed6e58
AD
82432001-11-19 Akim Demaille <akim@epita.fr>
8244
8245 * src/gram.h (rule_t): New.
8246 (rule_table): New.
8247 (rrhs, rlhs): Remove, part of state_t.
8248 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
8249 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
8250 * src/reader.c, src/reduce.c: Adjust.
8251
edad7067
AD
82522001-11-19 Akim Demaille <akim@epita.fr>
8253
8254 * src/reader.c (symbols_output): New, extracted from...
8255 (packsymbols): Here.
8256 (reader): Call it.
8257
3feec034
AD
82582001-11-19 Akim Demaille <akim@epita.fr>
8259
8260 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
8261 (maxrhs): this new function.
8262
ddcd5fdf
AD
82632001-11-19 Akim Demaille <akim@epita.fr>
8264
cc72668c 8265 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
8266 Adjust.
8267
bb527fc2
AD
82682001-11-19 Akim Demaille <akim@epita.fr>
8269
cc72668c 8270 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
8271 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8272 * src/lalr.c: Adjust.
8273
a845a697
AD
82742001-11-19 Akim Demaille <akim@epita.fr>
8275
8276 * src/lalr.c (initialize_LA): Only initialize LA. Let...
8277 (set_state_table): handle the `lookaheads' members.
8278
f004bf6a
AD
82792001-11-19 Akim Demaille <akim@epita.fr>
8280
cc72668c
AD
8281 * src/lalr.h (lookaheads): Removed array, whose contents is now
8282 a member of...
f004bf6a
AD
8283 (state_t): this structure.
8284 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8285 Adjust.
8286
de326cc0
AD
82872001-11-19 Akim Demaille <akim@epita.fr>
8288
cc72668c
AD
8289 * src/lalr.h (consistent): Removed array, whose contents is now
8290 a member of...
de326cc0
AD
8291 (state_t): this structure.
8292 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8293 Adjust.
8294
90b4416b
AD
82952001-11-19 Akim Demaille <akim@epita.fr>
8296
cc72668c
AD
8297 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
8298 contents are now members of...
90b4416b
AD
8299 (state_t): this structure.
8300 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8301 Adjust.
8302
9703cc49
AD
83032001-11-19 Akim Demaille <akim@epita.fr>
8304
8305 * src/lalr.h (state_t): New.
8306 (state_table): Be a state_t * instead of a core **.
8307 (accessing_symbol): Remove, part of state_t.
8308 * src/lalr.c: Adjust.
8309 (set_accessing_symbol): Merge into...
8310 (set_state_table): this.
8311 * src/print_graph.c, src/conflicts.c: Adjust.
8312
d803322e
AD
83132001-11-14 Akim Demaille <akim@epita.fr>
8314
8315 * tests/calc.at, tests/output.at, tests/regression.at,
8316 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
8317 now the tests are run in private dirs, therefore AC_CLEANUP and
8318 family can be simplified to 0-ary.
8319 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
8320 use abs. path to find config.h.
8321 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
8322 stderr, there can be way too much random noise.
8323 Instead pass -Werror to GCC and rely on the exit status.
8324 Reported by Wolfram Wagner.
8325
3d76b07d
AD
83262001-11-14 Akim Demaille <akim@epita.fr>
8327
8328 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
8329 defined only if yyoverflow is defined, to avoid `warning: unused
8330 variable `yyvs1''.
8331 Reported by The Test Suite.
8332
09b503c8
AD
83332001-11-14 Akim Demaille <akim@epita.fr>
8334
8335 * src/print.c: Include reduce.h.
8336 Reported by Hans Aberg.
8337
83382001-11-14 Akim Demaille <akim@epita.fr>
8339
8340 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
8341 Revert a previous patch: these are really const.
8342 * src/conflicts.c (conflict_report): Additional useless pair of
8343 braces to pacify GCC's warnings for `if () if () {} else {}'.
8344 * src/lex.c (parse_percent_token): Replace equal_offset with
8345 arg_offset.
8346 arg is const.
8347 Be sure to strdup `arg' when used, since there is no reason for
8348 token_buffer not to change.
8349
0f37a994
AD
83502001-11-14 Akim Demaille <akim@epita.fr>
8351
8352 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
8353 definition.
8354 * src/main.c (main): Use them.
8355 Suggested by Hans Aberg.
8356
d39d93b8
AD
83572001-11-12 Akim Demaille <akim@epita.fr>
8358
8359 * src/system.h (ngettext): Now that we use ngettext, be sure to
8360 provide a default definition when NLS are not used.
8361
9edcd895
AD
83622001-11-12 Akim Demaille <akim@epita.fr>
8363
8364 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
8365 Use @kbd to denote user input.
8366 (Language and Grammar): ANSIfy the example.
8367 Adjust its layout for info/notinfo.
8368 (Location Tracking Calc): Output error messages to stderr.
8369 Output locations in a more GNUtically correct way.
8370 Fix a couple of Englishos.
8371 Adjust @group/@end group pairs.
8372
7da99ede
AD
83732001-11-12 Akim Demaille <akim@epita.fr>
8374
e3aa65c5 8375 %expect was not functioning at all.
7da99ede
AD
8376
8377 * src/conflicts.c (expected_conflicts): Set to -1.
8378 (conflict_report): Use ngettext.
8379 (conflicts_print): Check %expect and make its violation an error.
8380 * doc/bison.texinfo (Expect Decl): Adjust.
8381 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
8382 * tests/regression.at (%expect not enough, %expect right)
8383 (%expect too much): New.
8384
ba9dda1a
AD
83852001-11-12 Akim Demaille <akim@epita.fr>
8386
8387 * tests/regression.at (Conflicts): Rename as...
8388 (Unresolved SR Conflicts): this.
8389 (Solved SR Conflicts): New.
8390
337c5bd1
AD
83912001-11-12 Akim Demaille <akim@epita.fr>
8392
8393 * src/reduce.c (print_results): Rename as...
8394 (reduce_output): This.
8395 Output to OUT, passed as argument, instead of output_obstack.
8396 (dump_grammar): Likewise.
8397 (reduce_free): New.
8398 Also free V1.
8399 (reduce_grammar): No longer call reduce_output, since...
8400 * src/print.c (print_results): do it.
8401 * src/main.c (main): Call reduce_free;
8402
c73a41af
AD
84032001-11-12 Akim Demaille <akim@epita.fr>
8404
8405 * src/conflicts.c (print_reductions): Accept OUT as argument.
8406 Output to it, not to output_obstack.
8407 * src/print.c (print_actions): Adjust.
8408
0df87bb6
AD
84092001-11-12 Akim Demaille <akim@epita.fr>
8410
8411 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
8412 the result instead of using...
8413 (src_total, rrc_total, src_count, rrc_count): Remove.
8414 (any_conflicts): Remove.
8415 (print_conflicts): Split into...
8416 (conflicts_print, conflicts_output): New.
8417 * src/conflicts.h: Adjust.
8418 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 8419 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
8420 * tests/regression.at (Conflicts): New.
8421 Reported by Tom Lane.
8422
e4d3d4de
AD
84232001-11-12 Akim Demaille <akim@epita.fr>
8424
8425 * tests/regression.at (Invalid input): Remove, duplicate with
8426 ``Invalid input: 1''.
8427
6d7d248e
AD
84282001-11-12 Akim Demaille <akim@epita.fr>
8429
8430 * tests/torture.at (AT_DATA_STACK_TORTURE)
8431 (Exploding the Stack Size with Alloca)
8432 (Exploding the Stack Size with Malloc): New.
8433
e9e4c321
AD
84342001-11-12 Akim Demaille <akim@epita.fr>
8435
8436 * src/bison.simple (YYSTACK_REALLOC): New.
8437 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 8438 Reported by Per Allansson.
e9e4c321 8439
5f7e0832
AD
84402001-11-12 Pascal Bart <pascal.bart@epita.fr>
8441
8442 * src/bison.simple: Define type yystype instead of YYSTYPE, and
8443 define CPP macro, which substitute YYSTYPE by yystype.
8444 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
8445 with yyltype/YYLTYPE. This allows inclusion of the generated
8446 header within the parser if the compiler, such as GGC, accepts
8447 multiple equivalent #defines.
8448 From Akim.
8449
e3f1699f
AD
84502001-11-05 Akim Demaille <akim@epita.fr>
8451
8452 * src/reader.c (symbols_output): New, extracted from...
8453 (packsymbols): here.
8454 (reader): Adjust.
8455
65be0866
AD
84562001-11-05 Akim Demaille <akim@epita.fr>
8457
8458 * src/lex.c (parse_percent_token): s/quotearg/quote/.
8459
e4d910bf
AD
84602001-11-05 Akim Demaille <akim@epita.fr>
8461
8462 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
8463 pattern.
8464
951366c1
AD
84652001-11-05 Akim Demaille <akim@epita.fr>
8466
8467 * src/options.h (struct option_table_struct): set_flags is void*.
8468 * src/options.c (longopts): Support `--output' and `%output'.
8469 (usage): Adjust.
8470 * src/lex.h (tok_setopt): Remove, replaced with...
8471 (tok_intopt, tok_stropt): these new guys.
8472 * src/lex.c (getopt.h): Not needed.
8473 (token_buffer, unlexed_token_buffer): Not const.
8474 (percent_table): Promote `-' over `_' in directive names.
8475 Active `%name-prefix', `file-prefix', and `output'.
8476 (parse_percent_token): Accept possible arguments to directives.
8477 Promote `-' over `_' in directive names.
8478
d8988b2f
AD
84792001-11-04 Akim Demaille <akim@epita.fr>
8480
8481 * doc/bison.texinfo (Decl Summary): Split the list into
8482 `directives for grammars' and `directives for bison'.
8483 Sort'em.
8484 Add description of `%name-prefix', `file-prefix', and `output'.
8485 Promote `-' over `_' in directive names.
8486 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
8487 Simplify the description of `--name-prefix'.
8488 Promote `-' over `_' in directive names.
8489 Promote `--output' over `--output-file'.
8490 Fix the description of `--defines'.
8491 * tests/output.at: Exercise %file-prefix and %output.
8492
6468d18e
AD
84932001-11-02 Akim Demaille <akim@epita.fr>
8494
8495 * doc/refcard.tex: Update.
8496
6b7e85b9
AD
84972001-11-02 Akim Demaille <akim@epita.fr>
8498
8499 * src/symtab.h (SUNDEF): New.
8500 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
8501 stand for `uninitialized', instead of 0.
8502 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
8503 * src/lex.c (lex): Adjust.
8504
8505 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
8506 Number it 0.
8507 Let yylex return it instead of a plain 0.
8508 Reported by Dick Streefland.
8509
cd5aafcf
AD
85102001-11-02 Akim Demaille <akim@epita.fr>
8511
8512 * tests/regression.at (Mixing %token styles): New test.
8513
037ca2f1
AD
85142001-11-02 Akim Demaille <akim@epita.fr>
8515
8516 * src/reader.c (parse_thong_decl): Formatting changes.
8517 (token_translations_init): New, extracted from...
8518 (packsymbols): Here.
8519 Adjust.
8520
270a173c
AD
85212001-11-01 Akim Demaille <akim@epita.fr>
8522
8523 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
8524 Check that `9foo.y' produces correct cpp guards.
8525 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
8526 guards.
8527 Reported by Wwp.
8528
561f9a30
AD
85292001-11-01 Akim Demaille <akim@epita.fr>
8530
8531 * tests/regression.at (Invalid input: 2): New.
8532 * src/lex.c (unlexed_token_buffer): New.
8533 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
8534 too.
8535 Reported by Wwp.
8536
f987e9d2
AD
85372001-11-01 Akim Demaille <akim@epita.fr>
8538
8539 * tests/calc.at: Catch up with 1.30.
8540 * configure.in: Bump to 1.49a.
8541 Adjust to newer Autotest.
8542
0846f581
PB
85432001-10-19 Pascal Bart <pascal.bart@epita.fr>
8544
8545 * src/conflicts.c: Move global variables rrc_total and src_total ...
8546 (print_conflicts): here.
8547 * src/output.c (output): Free global variable user_toknums.
8548 * src/lex.c (token_obstack): Become static.
8549
3c1a79b3
AD
85502001-10-18 Akim Demaille <akim@epita.fr>
8551
8552 * tests/atlocal.in (GCC): Add.
8553 * tests/calc.at: s/m4_match/m4_bmatch/.
8554 s/m4_patsubst/m4_bpatsubst/.
8555 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
8556 * configure.in: AC_SUBST(GCC).
8557
5d52e7d0
MA
85582001-10-14 Marc Autret <autret_m@epita.fr>
8559
8560 * src/options.c (create_long_option_table): Fix.
8561
631aa1d3
AD
85622001-10-10 Akim Demaille <akim@epita.fr>
8563
8564 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
8565
f6ec6d13
AD
85662001-10-04 Akim Demaille <akim@epita.fr>
8567
8568 * src/reader.c (parse_union_decl): Push the caracters in
8569 union_obstack, not attrs_obstack.
8570
342b8b6e
AD
85712001-10-04 Akim Demaille <akim@epita.fr>
8572
8573 Merge in the branch 1.29.
8574
8575 * src/reader.c (packsymbols): Use a temporary obstack for
8576 `%%tokendef', since output_stack is already used elsewhere.
8577
8578 2001-10-02 Akim Demaille <akim@epita.fr>
8579
8580 Bump 1.29d.
8581
8582 2001-10-02 Akim Demaille <akim@epita.fr>
8583
8584 Version 1.29c.
8585
8586 2001-10-02 Akim Demaille <akim@epita.fr>
8587
8588 * tests/regression.at (Invalid CPP headers): New.
8589 From Alexander Belopolsky.
8590 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
8591
8592 2001-10-02 Akim Demaille <akim@epita.fr>
8593
8594 * tests/regression.at (Invalid input): New.
8595 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
8596 Reported by Shura.
8597
8598 2001-10-02 Akim Demaille <akim@epita.fr>
8599
8600 * tests/calc.at: Now that --debug works, the tests must be adjusted.
8601
8602 2001-10-02 Akim Demaille <akim@epita.fr>
8603
8604 * src/output.c (output_parser): Assert `skeleton'.
8605 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
8606 systems.
8607 From Shura.
8608
8609 2001-10-01 Marc Autret <autret_m@epita.fr>
8610
8611 * src/lex.h: Echo modifications.
8612 * src/lex.c (unlex): Parameter is now token_t.
8613 From Hans Aberg.
8614
8615 2001-10-01 Marc Autret <autret_m@epita.fr>
8616
8617 * src/main.c: Include lex.h.
8618 From Hans Aberg.
8619
8620 2001-09-29 Akim Demaille <akim@epita.fr>
8621
8622 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
8623
8624 2001-09-28 Akim Demaille <akim@epita.fr>
8625
8626 * tests/testsuite.at: Update to newer Autotest.
8627 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
8628
8629 2001-09-27 Akim Demaille <akim@epita.fr>
8630
8631 Position independent wrapper.
8632
8633 * tests/bison: Remove.
8634 * tests/bison.in: New.
8635 * configure.in: Adjust.
8636
8637 2001-09-27 Paul Eggert <eggert@twinsun.com>
8638
8639 Port quotearg fixes from tar 1.13.24.
8640
8641 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8642 tm to be declared.
8643 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8644 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8645
8646 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
8647 * m4/mbrtowc.m4: New file.
8648 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
8649 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
8650
8651 2001-09-27 Akim Demaille <akim@epita.fr>
8652
8653 Bump to 1.29c.
8654
8655 2001-09-27 Akim Demaille <akim@epita.fr>
8656
8657 Version 1.29b.
8658
8659 2001-09-25 Akim Demaille <akim@epita.fr>
8660
8661 * src/system.h: Include `xalloc.h'.
8662 Remove it from the C files.
8663 * src/files.c (output_files): Free the obstacks.
8664 * src/lex.c (init_lex): Rename as...
8665 (lex_init): this.
8666 (lex_free): New.
8667 * src/main.c (main): Use it.
8668
8669 2001-09-24 Marc Autret <autret_m@epita.fr>
8670
8671 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
8672 to output informations in fout (FILE*).
8673 (open_graph, close_graph): Likewise.
8674 (output_graph, output_edge, output_node): Likewise.
8675 * src/vcg.h: Update function prototypes.
8676 * src/print_graph.c (print_graph): Open output graph file.
8677 (print_actions): Adjust.
8678 * src/files.h: Remove extern declaration.
8679 * src/files.c: Remove graph_obstack declaration.
8680 (open_files): Remove graph_obstack initialization.
8681 (output_files): Remove graph_obstack saving.
8682
8683 2001-09-24 Marc Autret <autret_m@epita.fr>
8684
8685 * src/files.c (compute_output_file_names): Fix.
8686
8687 2001-09-24 Marc Autret <autret_m@epita.fr>,
8688 Akim Demaille <akim@epita.fr>
8689
8690 * src/reader.c (reader): Remove call to free_symtab ().
8691 * src/main.c (main): Call it here.
8692 Include symtab.h.
8693 * src/conflicts.c (initialize_conflicts): Rename as...
8694 (solve_conflicts): this.
8695 * src/print.c (print_core, print_actions, print_state)
8696 (print_grammar): Dump to a file instead a `output_obstack'.
8697 (print_results): Dump `output_obstack', and then proceed with the
8698 FILE *.
8699 * src/files.c (compute_output_file_names, close_files): New.
8700 (output_files): Adjust.
8701 * src/main.c (main): Adjust.
8702
8703 2001-09-23 Marc Autret <autret_m@epita.fr>
8704
8705 * src/files.c (compute_header_macro): Computes header macro name
8706 from spec_defines_file when given.
8707
8708 2001-09-23 Marc Autret <autret_m@epita.fr>
8709
8710 * src/files.c (output_files): Add default extensions.
8711
8712 2001-09-22 Akim Demaille <akim@epita.fr>
8713
8714 * src/conflicts.c (finalize_conflicts): Rename as...
8715 (free_conflicts): this.
8716
8717 2001-09-22 Akim Demaille <akim@epita.fr>
8718
8719 * src/gram.c (gram_free): Rename back as...
8720 (dummy): this.
8721 (output_token_translations): Free `token_translations'.
8722 * src/symtab.c (free_symtab): Free the tag field.
8723
8724 2001-09-22 Akim Demaille <akim@epita.fr>
8725
8726 Remove `translations' as it is always set to true.
8727
8728 * src/gram.h: Adjust.
8729 * src/reader.c (packsymbols, parse_token_decl): Adjust
8730 * src/print.c (print_grammar): Adjust.
8731 * src/output.c (output_token_translations): Adjust.
8732 * src/lex.c (lex): Adjust.
8733 * src/gram.c: Be sure the set pointers to NULL.
8734 (dummy): Rename as...
8735 (gram_free): this.
8736
8737 2001-09-22 Akim Demaille <akim@epita.fr>
8738
8739 * configure.in: Invoke AM_LIB_DMALLOC.
8740 * src/system.h: Use dmalloc.
8741 * src/LR0.c: Be sure to have pointers initialized to NULL.
8742 (allocate_itemsets): Allocate kernel_items only if needed.
8743
8744 2001-09-22 Akim Demaille <akim@epita.fr>
8745
8746 * configure.in: Bump to 1.29b.
8747 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
8748 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
8749 need xmalloc.c in calc.y.
8750 From Pascal Bart.
8751
8752 2001-09-21 Akim Demaille <akim@epita.fr>
8753
8754 Version 1.29a.
8755 * Makefile.maint, config/config.guess, config/config.sub,
8756 * config/missing: Update from masters.
8757 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
8758 upon package.m4.
8759 * configure.in (ALL_LINGUAS): Add `tr'.
8760
8761 2001-09-21 Akim Demaille <akim@epita.fr>
8762
8763 * tests/Makefile.am (package.m4): Move to...
8764 ($(srcdir)/$(TESTSUITE)): here.
8765
8766 2001-09-20 Akim Demaille <akim@epita.fr>
8767
8768 * src/complain.c: No longer try to be standalone: use system.h.
8769 Don't assume __STDC__ is defined to 1. Just test if it is defined.
8770 * src/complain.h: Likewise.
8771 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
8772 Remove the unused variable `n'.
8773 From Albert Chin-A-Young.
8774
8775 2001-09-18 Marc Autret <autret_m@epita.fr>
8776
8777 * doc/bison.1: Update.
8778 * doc/bison.texinfo (Bison Options): Update --defines and --graph
8779 descriptions.
8780 (Option Cross Key): Update.
8781 Add --graph.
8782
8783 2001-09-18 Marc Autret <autret_m@epita.fr>
8784
8785 * tests/regression.at: New test (comment in %union).
8786
8787 2001-09-18 Marc Autret <autret_m@epita.fr>
8788
8789 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
8790 do that.
8791 Reported by Keith Browne.
8792
8793 2001-09-18 Marc Autret <autret_m@epita.fr>
8794
8795 * tests/output.at: Add tests for --defines and --graph.
8796
8797 2001-09-18 Marc Autret <autret_m@epita.fr>
8798
8799 * tests/output.at: Removes tests of %{header,src}_extension features.
8800
8801 2001-09-18 Akim Demaille <akim@epita.fr>
8802
8803 * tests/Makefile.am (package.m4): New.
8804 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
8805 (_AT_CHECK_CALC_ERROR): Likewise.
8806 Factor the `, ' part of verbose error messages.
8807
8808 2001-09-18 Marc Autret <autret_m@epita.fr>
8809
8810 * src/getargs.c (longopts): Declare --defines and --graph as options
8811 with optional arguments.
8812 * src/files.h: Add extern declarations.
8813 * src/files.c (spec_graph_file, spec_defines_file): New.
8814 (output_files): Update.
8815 Remove CPP-outed code.
8816
8817 2001-09-18 Marc Autret <autret_m@epita.fr>
8818
8819 Turn off %{source,header}_extension feature.
8820
8821 * src/files.c (compute_exts_from_gf): Update.
8822 (compute_exts_from_src): Update.
8823 (output_files): CPP-out useless code.
8824 * src/files.h: Remove {header,source}_extension extern declarations.
8825 * src/reader.c (parse_dquoted_param): CPP-out.
8826 (parse_header_extension_decl): Remove.
8827 (parse_source_extension_decl): Remove.
8828 (read_declarations): Remove cases tok_{hdrext,srcext}.
8829 * src/lex.c (percent_table): Remove {header,source}_extension entries.
8830 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
8831
8832 2001-09-10 Akim Demaille <akim@epita.fr>
8833
8834 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
8835 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
8836 (AT_CHECK_OUTPUT): this.
8837 Merely check ls' exit status, its output is useless.
8838
8839 2001-09-10 Akim Demaille <akim@epita.fr>
8840
8841 * tests/calc.at: Use m4_match.
8842 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
8843
8844 2001-09-10 Marc Autret <autret_m@epita.fr>,
8845 Akim Demaille <akim@epita.fr>
8846
8847 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
8848 enum color_e.
8849 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
8850 to `normal'.
8851 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
8852 * src/lex.h: Adjust prototype.
8853 (token_t): Add `tok_undef'.
8854 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
8855 (parse_percent_token): Now returns token_t.
8856 Add default statement in switch.
8857 (lex): Separate `c' as an input variable, from the token_t result
8858 part.
8859 (unlexed): Is a token_t.
8860
8861 2001-09-10 Akim Demaille <akim@epita.fr>
8862
8863 * configure.in: Bump to 1.29a.
8864
8865 2001-09-07 Akim Demaille <akim@epita.fr>
8866
8867 Version 1.29.
8868
8869 2001-08-30 Akim Demaille <akim@epita.fr>
8870
8871 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
8872 * m4/atconfig.m4: Remove.
8873 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
8874 * tests/bison: New.
8875 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
8876 m4_if, m4_patsubst, and m4_regexp.
8877 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
8878 `input' file instead of echo.
8879
8880 2001-08-29 Akim Demaille <akim@epita.fr>
8881
8882 Bump to 1.28e.
8883
8884 2001-08-29 Akim Demaille <akim@epita.fr>
8885
8886 Version 1.28d.
8887
8888 2001-08-29 Paul Eggert <eggert@twinsun.com>
8889
8890 * src/bison.simple (yyparse): Don't take the address of an
8891 item before the start of an array, as that doesn't conform to
8892 the C Standard.
8893
8894 2001-08-29 Robert Anisko <anisko_r@epita.fr>
8895
8896 * doc/bison.texinfo (Location Tracking Calc): New node.
8897
8898 2001-08-29 Paul Eggert <eggert@twinsun.com>
8899
8900 * src/output.c (output): Do not define const, as this now
8901 causes more problems than it cures.
8902
8903 2001-08-29 Akim Demaille <akim@epita.fr>
8904
8905 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
8906 the nodes.
8907 Be sure to tag the `detailmenu'.
8908
8909 2001-08-29 Akim Demaille <akim@epita.fr>
8910
8911 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
8912 download in a tmp dir.
8913
8914 2001-08-28 Marc Autret <autret_m@epita.fr>
8915
8916 * config/depcomp: New file.
8917
8918 2001-08-28 Marc Autret <autret_m@epita.fr>
8919
8920 * doc/bison.1 (mandoc): Adjust.
8921 From Juan Manuel Guerrero.
8922
8923 2001-08-28 Marc Autret <autret_m@epita.fr>
8924
8925 * src/print_graph.c (print_state): Fix.
8926
8927 2001-08-27 Marc Autret <autret_m@epita.fr>
8928
8929 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
8930 char * members.
8931 Echo modifications to the functions prototypes.
8932 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
8933
8934 2001-08-27 Marc Autret <autret_m@epita.fr>
8935
8936 * src/vcg.c: Include `xalloc.h'.
8937 (add_colorentry): New.
8938 (add_classname): New.
8939 (add_infoname): New.
8940 * src/vcg.h: Add new prototypes.
8941
8942 2001-08-27 Akim Demaille <akim@epita.fr>
8943
8944 * Makefile.maint: Sync. again with CVS Autoconf.
8945
8946 2001-08-27 Akim Demaille <akim@epita.fr>
8947
8948 * Makefile.maint: Formatting changes.
8949 (po-update, cvs-update, update): New targets.
8950 (AMTAR): Remove.
8951
8952 2001-08-27 Akim Demaille <akim@epita.fr>
8953
8954 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8955 * Makefile.maint: Sync. with CVS Autoconf.
8956
8957 2001-08-27 Marc Autret <autret_m@epita.fr>
8958
8959 * src/vcg.h (struct infoname_s): New.
8960 (struct colorentry_s): New.
8961 (graph_s): New fields {vertical,horizontal}_order in structure.
8962 Add `infoname' field.
8963 Add `colorentry' field;
8964 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
8965 (G_HORIZONTAL_ORDER): New.
8966 (G_INFONAME): New.
8967 (G_COLORENTRY): New.
8968 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
8969 Add output of `infoname'.
8970 Add output of `colorentry'.
8971
8972 2001-08-27 Marc Autret <autret_m@epita.fr>
8973
8974 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
8975 This one shadowed a global parameter.
8976
8977 2001-08-24 Marc Autret <autret_m@epita.fr>
8978
8979 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
8980 instead of `unsigned'.
8981 (print_state): Do not call obstack_object_size () in obstack_grow ()
8982 to avoid macro variables shadowing.
8983
8984 2001-08-23 Marc Autret <autret_m@epita.fr>
8985
8986 * src/lex.c (percent_table): Typo: s/naem/name/.
8987 Add graph option.
8988 Normalize new options declarations.
8989
8990 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
8991
8992 * tests/suite.at: Exercise %header_extension and %source_extension.
8993
8994 2001-08-16 Marc Autret <autret_m@epita.fr>
8995
8996 * src/reader.c (parse_dquoted_param): New.
8997 (parse_header_extension_decl): Use it.
8998 (parse_source_extension_decl): Likewise.
8999
9000 2001-08-16 Marc Autret <autret_m@epita.fr>
9001
9002 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
9003 (get_xxxx_str): Use assert () instead of complain ().
9004 Remove return invokations in default cases.
9005 (get_decision_str): Modify default behaviour. Remove second argument.
9006 Echo modifications on calls.
9007 (output_graph): Fix.
9008
9009 2001-08-16 Marc Autret <autret_m@epita.fr>
9010
9011 * src/getargs.c (usage): Update with ``-g, --graph''.
9012
9013 2001-08-16 Marc Autret <autret_m@epita.fr>
9014
9015 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
9016 (Option Cross Key): Likewise.
9017 * doc/bison.1: Update.
9018
1c8c2190
PB
90192001-09-25 Pascal Bart <pascal.bart@epita.fr>
9020
9021 * src/output.c (output_master_parser): Don't finish action_obstack.
9022 (output_parser): Don't care about the muscle action, here.
9023 (prepare): Copy the action_obstack in the action muscle.
9024 (output): Free action_obstack.
9025
180d45ba
PB
90262001-09-23 Pascal Bart <pascal.bart@epita.fr>
9027
9028 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
9029 will contain `%union' declaration.
9030 (parse_union_decl): Delete #line directive output.
9031 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
9032 informations about %union.
9033 (parse_union_decl): Copy the union_obstack in the muscle stype.
9034 * src/bison.simple: Add new #line directive.
9035 Add typdef %%stype YYSTYPE.
9036
c51d1a19
PB
90372001-09-23 Pascal Bart <pascal.bart@epita.fr>
9038
9039 * src/bison.simple: Add new `#line' directive.
9040
6f9344da
PB
90412001-09-22 Pascal Bart <pascal.bart@epita.fr>
9042
9043 * src/bison.simple: New `#line' directive.
9044 * src/output.c (output_parser): Support new dynamic muscle input_line.
9045
652def80
MA
90462001-09-22 Marc Autret <autret_m@epita.fr>
9047
9048 * src/output.c (output_master_parser): New.
9049 (output_parser): Be more re-entrant.
9050
25b222fa
MA
90512001-09-21 Marc Autret <autret_m@epita.fr>
9052
9053 * src/reader.c (copy_definition, parse_union_decl): Update and use
9054 `linef' muscle.
9055 (copy_action): Likewise.
9056 Use obstack_1grow ().
9057 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
9058
6bc35ae5
MA
90592001-09-21 Marc Autret <autret_m@epita.fr>
9060
9061 * src/options.c (option_table): Adjust.
9062 * src/lex.c (parse_percent_token): Fix.
9063
c0629aa1
PB
90642001-09-20 Pascal Bart <pascal.bart@epita.fr>
9065
9066 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 9067
82b6d266
PB
90682001-09-20 Pascal Bart <pascal.bart@epita.fr>
9069
9070 * src/lex.c (parse_percent_token): Change type of variable `tx', which
9071 is now an option_table_struct*.
9072 (option_strcmp): New function option_strcmp.
9073 (parse_percent_token): Call option_strcmp.
9074 * src/getargs.c (xalloc.h, options.h): Include it.
9075 (getargs): Call create_long_option_table.
9076 (getargs): Free longopts at the end of the function.
9077 (shortopts): Move in options.c.
9078 * src/options.c (create_long_option_table): New function. Convert
9079 information from option_table to option structure.
9080 * src/reader.c (options.h): Include it.
9081
9082 * src/Makefile.am: Adjust.
9083 * src/options.c (option_table): Create from longopts and percent_table.
9084 * src/getargs.c (longopts): Delete.
9085 * src/lex.c (struct percent_table_struct): Delete.
9086 (percent_table): Delete.
9087 (options.h): Include it.
9088 * src/options.c: Create.
9089 * src/options.h: Create.
9090 Declare enum opt_access_e.
9091 Define struct option_table_struct.
9092
75f5aaea
MA
90932001-09-20 Marc Autret <autret_m@epita.fr>
9094
9095 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
9096 sections of Bison.
9097
f508cb0a
PB
90982001-09-19 Pascal Bart <pascal.bart@epita.fr>
9099
9100 * src/bison.simple: s/%%filename/%%skeleton.
9101 * src/muscle_tab.c (getargs.h): Include it.
9102 (muscle_init): Insert new muscle skeleton.
9103
13105fc1
PB
91042001-09-18 Pascal Bart <pascal.bart@epita.fr>
9105
9106 * src/output.c (output_parser): Delete unused variable actions_dumped.
9107
b0c4483e
PB
91082001-09-07 Pascal Bart <pascal.bart@epita.fr>
9109
9110 * src/output.c (output): Delete call to reader_output_yylsp.
9111 * src/reader.c (reader): Likewise.
9112 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 9113
11d82f03
MA
91142001-09-02 Marc Autret <autret_m@epita.fr>
9115
9116 * src/reader.c: Include muscle_tab.h.
9117 (parse_union_decl): Update.
9118 (parse_macro_decl): Rename parse_muscle_decl.
9119 Update to use renamed functions and variable.
9120 (read_declarations, copy_action, read_additionnal_code, : Updated
9121 with correct variables and functions names.
9122 (packsymbols, reader): Likewise.
342b8b6e 9123
11d82f03 9124 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 9125
11d82f03
MA
9126 * src/output.c: Include muscle_tab.h
9127 In all functions using macro_insert, change by using muscle_insert ().
9128 (macro_obstack): Rename muscle_obstack.
9129 Echo modifications in the whole file.
9130 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
9131 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
9132 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
9133
9134 * src/muscle_tab.h: Update double inclusion macros.
9135 (macro_entry_s): Rename muscle_entry_s.
9136 Update prototypes.
342b8b6e 9137
11d82f03
MA
9138 * src/muscle_tab.c: Include muscle_tab.h.
9139 Rename macro_tabble to muscle_table.
9140 (mhash1, mhash2, mcmp): Use muscle_entry.
9141 (macro_init): Rename muscle_init. Update.
9142 (macro_insert): Rename muscle_insert. Update.
9143 (macro_find): Rename muscle_find. Update.
9144
9145 * src/main.c: Include muscle_tab.h.
9146 (main): Call muscle_init ().
9147 * src/Makefile.am (bison_SOURCES): Echo modifications.
9148
93a37297
MA
91492001-09-02 Marc Autret <autret_m@epita.fr>
9150
f753cd62 9151 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 9152
f753cd62
MA
9153 * src/muscle_tab.c, src/muscle_tab.h: Add files.
9154
91552001-09-02 Marc Autret <autret_m@epita.fr>
9156
9157 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 9158
682d48cd
PB
91592001-09-01 Pascal Bart <pascal.bart@epita.fr>
9160
342b8b6e 9161 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
9162 filename.
9163
087c8fda
MA
91642001-09-01 Marc Autret <autret_m@epita.fr>
9165
9166 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
9167 to an explicit value to activate the feature. We do it here.
9168
dda680cb
PB
91692001-08-31 Pascal Bart <pascal.bart@epita.fr>
9170
9171 * src/output.c (prepare): Delete the `filename' muscule insertion.
9172 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
9173 (parse_union_decl): Likewise.
9174 * src/macrotab.c (macro_init): Initialize filename by infile.
9175
9e644e64
MA
91762001-08-31 Marc Autret <autret_m@epita.fr>
9177
9178 * src/bison.simple (YYLSP_NEEDED): New definition.
9179 * src/output.c (prepare): Add macro insertion of `locations_flag'
9180
17da6427
PB
91812001-08-31 Pascal Bart <pascal.bart@epita.fr>
9182
9183 * src/output.c (prepare): Delete insertion of previous muscles,
9184 and insert the `prefix' muscles.
9185 * src/macrotab.c (macro_init): Likewise.
9186 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 9187 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
9188 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
9189 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 9190 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
9191 name_prefix.
9192
e8cb70b9
PB
91932001-08-31 Pascal Bart <pascal.bart@epita.fr>
9194
9195 * src/main.c (main): Standardize.
9196 * src/output.c (output_table_data, output_parser): Likewise.
9197 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
9198
63c2d5de
MA
91992001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
9200
342b8b6e 9201 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
9202 %%epilogue.
9203 * src/output.c (output): Rename %%declarations to %%prologue.
9204 * src/bison.simple: Echo modifications.
342b8b6e 9205
d8cb5183
MA
92062001-08-31 Marc Autret <autret_m@epita.fr>
9207
9208 * src/reader.c (readgram): CleanUp.
9209 (output_token_defines): Likewise.
9210 (packsymbols): Likewise.
9211 (reader): Likewise.
9212 * src/output.c (output): CPP-out useless code.
9213
6c686258
PB
92142001-08-31 Pascal Bart <pascal.bart@epita.fr>
9215
342b8b6e 9216 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
9217 output_trailers and output_headers.
9218 * src/output.h: Remove obsolete functions prototypes of output_headers
9219 and output_trailers.
9220
8f451ef7
PB
92212001-08-30 Pascal Bart <pascal.bart@epita.fr>
9222
9223 * src/main.c: Include macrotab.h.
342b8b6e 9224 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
9225 Adjust functions prototypes.
9226 * src/macrotab.c (macro_insert): Constify key and value.
9227 (macro_find): Constify key.
9228 (macro_insert): Include 'xalloc.h'
9229 (macro_insert): Use XMALLOC.
9230 (macro_find): Constify return value.
9231 * src/output.c (output_table_data): Rename table to table_data.
9232 (output_parser): Constify macro_key, macro_value.
9233
997b6fd0 92342001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
9235
9236 * src/reader.c (parse_skel_decl): New.
342b8b6e 9237 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
9238 * src/lex.h (token_t): New token `tok_skel'.
9239 * src/lex.c (percent_table): Add skeleton option entry.
9240 Standardize.
9241
ff48177d
MA
92422001-08-29 Marc Autret <autret_m@epita.fr>
9243
9244 * src/bison.simple: Add %%user_code directive at the end.
9245 * src/reader.c (read_additionnal_code): New.
9246 (reader): Use it.
9247 * src/output.c (output_program): Remove.
9248 (output): Update.
9249
b33160bf
MA
92502001-08-28 Marc Autret <autret_m@epita.fr>
9251
9252 * src/output.c (output_actions): Clean up.
4e5caae2 9253 (output_gram): CPP-out useless code.
b33160bf
MA
9254 * src/reader.c (reader): Clean up, CPP-out useless code.
9255
d1a2daf7
PB
92562001-08-28 Pascal Bart <pascal.bart@epita.fr>
9257
342b8b6e 9258 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 9259 directive.
d1a2daf7
PB
9260 * src/bison.simple: Add `%%definitions'.
9261
2b763dfe
MA
92622001-08-28 Marc Autret <autret_m@epita.fr>
9263
9264 * config/depcomp: New file.
9265
f1a87ef6
PE
92662001-08-27 Paul Eggert <eggert@twinsun.com>
9267
9268 * src/bison.simple (yyparse): Don't take the address of an
9269 item before the start of an array, as that doesn't conform to
9270 the C Standard.
9271
82e236e2
RA
92722001-08-27 Robert Anisko <robert.anisko@epita.fr>
9273
f1a87ef6 9274 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
9275 obstack. It was done too late here.
9276
9277 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
9278 completely wrong.
9279 (reader): Initialize the macro obstack here, since we need it to grow
9280 '%define' directives.
9281
9282 * src/reader.h: Declare the macro obstack as extern.
9283
b0cfa28a
RA
92842001-08-27 Robert Anisko <robert.anisko@epita.fr>
9285
9286 * src/output.c (output_parser): Fix. Store single '%' characters in
9287 the output obstack instead of throwing them away.
9288
6fc74234
AD
92892001-08-27 Akim Demaille <akim@epita.fr>
9290
9291 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
9292
9c76d118
RA
92932001-08-25 Robert Anisko <robert.anisko@epita.fr>
9294
9295 * lib/Makefile.am: Adjust.
9296
a8289c62
RA
92972001-08-25 Robert Anisko <robert.anisko@epita.fr>
9298
9299 * src/bison.simple: Update and add '%%' directives.
9300
b6610515
RA
93012001-08-25 Robert Anisko <robert.anisko@epita.fr>
9302
9303 * src/reader.c (reader): Remove calls to 'output_headers' and
9304 'output_trailers'. Remove some C output.
9305 (readgram): Disable a piece of code that was writing a default
9306 definition for 'YYSTYPE'.
9307 (reader_output_yylsp): Remove.
9308 (packsymbols): Output token defintions to a macro.
9309 (copy_definition): Disable C output.
6fc74234 9310
b6610515
RA
9311 * src/reader.c (parse_macro_decl): New function used to parse macro
9312 declarations.
9313 (copy_string2): Put the body of copy_string into this new function.
9314 Add a parameter to let the caller choose whether he wants to copy the
9315 string delimiters or not.
9316 (copy_string): Be a simple call to copy_string2 with the last argument
9317 bound to true.
9318 (read_declarations): Add case for macro definition.
9319 (copy_identifier): New.
6fc74234 9320 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
9321 rather than lex.
9322
26f609ff
RA
93232001-08-25 Robert Anisko <robert.anisko@epita.fr>
9324
9325 * src/output.c (prepare): Add prefixed names.
9326 (output_parser): Output semantic actions.
9327 (output_parser): Fix bug on '%%line' directives.
6fc74234 9328
26f609ff
RA
9329 * src/output.c (output_headers): Remove. The C code printed by this
9330 function should now be in the skeletons.
9331 (output_trailers): Remove.
9332 (output): Disable call to 'reader_output_yylsp'.
9333 (output_rule_data): Do not output tables to the table obstack.
9334
9335 * src/output.c: Remove some C dedicated output.
9336 Improve the use of macro and output obstacks.
9337 (output_defines): Remove.
6fc74234 9338
26f609ff
RA
9339 * src/output.c (output_token_translations): Associate 'translate'
9340 table with a macro. No output to the table obstack.
9341 (output_gram): Same for 'rhs' and 'prhs'.
9342 (output_stos): Same for 'stos'.
9343 (output_rule_data): Same for 'r1' and 'r2'.
9344 (token_actions): Same for 'defact'.
9345 (goto_actions): Same for 'defgoto'.
9346 (output_base): Same for 'pact' and 'pgoto'.
9347 (output_table): Same for 'table'.
9348 (output_check): Same for 'check'.
6fc74234 9349
26f609ff
RA
9350 * src/output.c (output_table_data): New function.
9351 (output_short_table): Remove.
9352 (output_short_or_char_table): Remove.
6fc74234 9353
26f609ff
RA
9354 * src/output.c (output_parser): Replace most of the skeleton copy code
9355 with something new. Skeletons are now processed character by character
9356 rather than line by line, and Bison looks for '%%' macros. This is the
9357 first step in making Bison's output process (a lot) more flexible.
9358 (output_parser): Use the macro table.
9359
6f43b113
RA
93602001-08-25 Robert Anisko <robert.anisko@epita.fr>
9361
9362 * src/main.c (main): Initialize the macro table.
9363
dd3127cf
RA
93642001-08-25 Robert Anisko <robert.anisko@epita.fr>
9365
9366 * src/lex.c (percent_table): Add tok_define.
9367 * src/lex.h: Add tok_define.
9368
aa321494
RA
93692001-08-25 Robert Anisko <robert.anisko@epita.fr>
9370
9371 * src/macrotab.c: New file.
9372 * src/macrotab.h: New file.
9373 * src/Makefile.am: Update.
9374
68bd3b6b
RA
93752001-08-25 Robert Anisko <robert.anisko@epita.fr>
9376
9377 * lib/hash.c: New file.
9378 * lib/hash.h: New file.
9379 * lib/Makefile.am: Update.
9380
45f8dd1e
AD
93812001-08-15 Akim Demaille <akim@epita.fr>
9382
9383 Version 1.28c.
9384
40a64a7a 93852001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
9386
9387 * src/reader.c (readgram): Indent output macro YYSTYPE.
9388 (packsymbols): Likewise.
9389 (output_token_defines): Likewise.
9390 * src/files.c: Standardize.
9391 (compute_header_macro): New.
9392 (defines_obstack_save): New. Use compute_header_macro.
9393 (output_files): Update. Use defines_obstack_save.
9394
f9a8293a
AD
93952001-08-15 Akim Demaille <akim@epita.fr>
9396
9397 * doc/bison.texinfo (Table of Symbols): Document
9398 YYSTACK_USE_ALLOCA.
9399
150ca7a7
AD
94002001-08-15 Akim Demaille <akim@epita.fr>
9401
9402 * missing: Update from CVS Automake.
9403 * config/config.guess, config/config.sub, config/texinfo.tex:
9404 Update from gnu.org.
9405
69b5cec4
AD
94062001-08-15 Akim Demaille <akim@epita.fr>
9407
9408 * Makefile.maint: Sync with CVS Autoconf.
9409
f2b5126e
PB
94102001-08-14 Pascal Bart <pascal.bart@epita.fr>
9411
69b5cec4 9412 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
9413 `fdl.texi'.
9414 * doc/fdl.texi: Add to package.
9415
4ecbf796
MA
94162001-08-14 Marc Autret <autret_m@epita.fr>
9417
9418 Turn on %{source,header}_extension features.
9419
69b5cec4 9420 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
9421 source_extension.
9422 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 9423 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
9424 between options.
9425
95fb5662
MA
94262001-08-14 Marc Autret <autret_m@epita.fr>
9427
9428 * src/files.c (compute_base_names): Add extensions computing when
9429 `--file-prefix' used.
9430 Standardize function calls.
9431
78d09da9
MA
94322001-08-13 Marc Autret <autret_m@epita.fr>
9433
69b5cec4 9434 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
9435 defining it (defined but null disables alloca).
9436
5a009f2c
MA
94372001-08-13 Marc Autret <autret_m@epita.fr>
9438
9439 * src/bison.simple (_yy_memcpy): CPP reformat.
9440
1e41465a
PB
94412001-08-13 Pascal Bart <pascal.bart@epita.fr>
9442
9443 * tests/atconfig.in (CPPFLAGS): Fix.
9444
c67a198d
PB
94452001-08-10 Pascal Bart <pascal.bart@epita.fr>
9446
79282c6c 9447 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
9448 `gpl.texi'.
9449 * doc/gpl.texi: Add to package.
9450
09a6de7e
MA
94512001-08-10 Marc Autret <autret_m@epita.fr>
9452
9453 * src/print_graph.h: Fix.
9454 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
9455
b77b9ee0
AD
94562001-08-10 Akim Demaille <akim@epita.fr>
9457
9458 * src/system.h: Provide default declarations for stpcpy, strndup,
9459 and strnlen.
9460
3e259915
MA
94612001-08-10 Robert Anisko <anisko_r@epita.fr>
9462
9463 * doc/bison.texinfo (Locations): Update @$ stuff.
9464
ca96bc2d
MA
94652001-08-09 Robert Anisko <anisko_r@epita.fr>
9466
9467 * src/bison.simple (YYLLOC_DEFAULT): Update.
9468 (yyparse): Adjust.
9469
fdc6758b
MA
94702001-08-08 Marc Autret <autret_m@epita.fr>
9471
b77b9ee0 9472 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
9473 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
9474 Reported by Fabrice Bauzac.
957d4dbf 9475
600cad3b
MA
94762001-08-08 Marc Autret <autret_m@epita.fr>
9477
9478 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
9479 * src/vcg.c (output_node): Fix.
9480 * src/vcg.h: Cleanup.
9481 * src/print_graph.c: Add comments.
b77b9ee0 9482 (node_output_size): New global variable. Simplify the formatting of
600cad3b 9483 the VCG graph output.
b77b9ee0 9484 (print_actions): Unused code is now used. It notifies the final state
600cad3b 9485 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 9486 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
9487 blue.
9488 Get the current node name and node_obstack by argument.
9489 (node_obstack): New variable.
9490 (print_state): Manage node_obstack.
9491 (print_core): Use node_obstack given by argument.
9492 A node is not only computed here but in print_actions also.
9493 (print_graph): CPP out useless code instead of commenting it.
9494
976e528f
AD
94952001-08-07 Pascal Bart <pascal.bart@epita.fr>
9496
9497 * tests/atconfig.in (CPPFLAGS): Fix.
9498
20e8e5ca
AD
94992001-08-07 Akim Demaille <akim@epita.fr>
9500
9501 * src/print_graph.c (quote): New.
9502 (print_core): Use it.
9503
957d4dbf 95042001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 9505
3e3da797
AD
9506 * src/vcg.c (complain.h): Include it.
9507 Unepitaize `return' invocations.
c4b66126 9508 [NDEBUG] (main): Remove.
79282c6c 9509 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
9510 * src/files.c (open_files): Initialize graph_obstack.
9511 * src/print_graph.c (print_actions): CPP out useless code.
9512 (print_core): Don't output the last `\n' in labels.
9513 Use `quote'.
9514 * src/files.c (output_files): Output the VCG file.
9515 * src/main.c (main): Invoke print_graph ();
3e3da797 9516
957d4dbf 95172001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
9518
9519 Automaton VCG graph output.
9520 Using option ``-g'' or long option ``--graph'', you can generate
9521 a gram_filename.vcg file containing a VCG description of the LALR (1)
9522 automaton of your grammar.
9523
9524 * src/main.c: Call to print_graph() function.
9525 * src/getargs.h: Update.
9526 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
9527 (graph_flag): New flag.
9528 (longopts): Update.
9529 (getargs): Add case `g'.
9530 * src/files.c (graph_obstack): New obstack struct.
9531 (open_files): Initialize new obstack.
9532 (output_files): Saves graph_obstack if required.
9533 * src/files.h (graph_obstack): New extern declaration.
9534 * src/Makefile.am: Add new source files.
9535
927c1557 95362001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
9537
9538 * src/print_graph.c, src/print_graph.h (graph): New.
9539 * src/vcg.h: New file.
9540 * src/vcg.c: New file, VCG graph handling.
9541
7333d403
AD
95422001-08-06 Marc Autret <autret_m@epita.fr>
9543
9544 Add of %source_extension and %header_extension which specify
9545 the source or/and the header output file extension.
9546
9547 * src/files.c (compute_base_names): Remove initialisation of
9548 src_extension and header_extension.
9549 (compute_exts_from_gf): Update.
9550 (compute_exts_from_src): Update.
9551 (output_files): Update.
9552 * src/reader.c (parse_header_extension_decl): New.
9553 (parse_source_extension_decl): New.
9554 (read_declarations): New case statements for the new tokens.
9555 * src/lex.c (percent_table): Add entries for %source_extension
9556 and %header_extension.
9557 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
9558
84163231
AD
95592001-08-06 Marc Autret <autret_m@epita.fr>
9560
9561 * configure.in: Bump to 1.28c.
9562 * doc/bison.texinfo: Texinfo thingies.
9563
8303fc42
AD
95642001-08-04 Pascal Bart <pascal.bart@epita.fr>
9565
9566 * tests/atconfig.in (CPPFLAGS): Add.
9567 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
9568
70a84437
AD
95692001-08-03 Akim Demaille <akim@epita.fr>
9570
9571 Version 1.28b.
9572
2ce10144
AD
95732001-08-03 Akim Demaille <akim@epita.fr>
9574
9575 * tests/Makefile.am (check-local): Ship testsuite.
9576 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
9577 Include `string.h'.
9578
1e3e4bc1
AD
95792001-08-03 Akim Demaille <akim@epita.fr>
9580
9581 * configure.in: Try using -Wformat when compiling.
9582
42b45b7f
AD
95832001-08-03 Akim Demaille <akim@epita.fr>
9584
9585 * configure.in: Bump to 1.28b.
9586
8f13fe33
AD
95872001-08-03 Akim Demaille <akim@epita.fr>
9588
9589 * src/complain.c: Adjust strerror_r portability issues.
9590
b37ba92c
AD
95912001-08-03 Akim Demaille <akim@epita.fr>
9592
9593 Version 1.28a.
9594
b0ce6046
AD
95952001-08-03 Akim Demaille <akim@epita.fr>
9596
9597 * src/getargs.c, src/getarg.h (skeleton)): Constify.
9598 * src/lex.c (literalchar): Avoid name clashes on `buf'.
9599 * src/getargs.c: Include complain.h.
9600 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
9601 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
9602
d01c415b
AD
96032001-08-03 Akim Demaille <akim@epita.fr>
9604
9605 * src/reader.c (readgram): Display hidden chars in error messages.
9606
459dd1a6
AD
96072001-08-03 Akim Demaille <akim@epita.fr>
9608
9609 Update to gettext 0.10.39.
9610
53b74c0c
AD
96112001-08-03 Akim Demaille <akim@epita.fr>
9612
9613 * lib/strspn.c: New.
9614
234a3be3
AD
96152001-08-01 Marc Autret <autret_m@epita.fr>
9616
9617 * doc/bison.texinfo: Update.
9618 * doc/bison.1 (mandoc): Update.
9619 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
9620 * src/files.c: Support output files extensions computing.
9621 (src_extension): New static variable.
9622 (header_extension): New static variable.
9623 (tr): New function.
9624 (get_extension_index): New function, gets the index of an extension
9625 filename in a string.
9626 (compute_exts_from_gf): New function, computes extensions from the
9627 grammar file extension.
9628 (compute_exts_from_src): New functions, computes extensions from the
9629 C source file extension, file given by ``-o'' option.
9630 (compute_base_names): Update.
9631 (output_files): Update.
9632
847bf1f5
AD
96332001-08-01 Robert Anisko <anisko_r@epita.fr>
9634
d995fee7 9635 * doc/bison.texi: Document @$.
847bf1f5
AD
9636 (Locations): New section.
9637
d074a105
AD
96382001-07-18 Akim Demaille <akim@epita.fr>
9639
9640 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
9641 * config/prev-version.txt, config/move-if-change: New.
9642 * Makefile.am: Adjust.
9643
3419715d
AD
96442001-07-08 Pascal Bart <pascal.bart@epita.fr>
9645
9646 * src/bison.simple (yyparse): Suppress warning `comparaison
9647 between signed and unsigned'.
9648
62ab6972
AD
96492001-07-05 Pascal Bart <pascal.bart@epita.fr>
9650
9651 * src/getargs.h (raw_flag): Remove.
9652 * src/getargs.c: Die on `-r'/`--raw'.
9653 * src/lex.c (parse_percent_token): Die on `%raw'.
9654 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
9655 * tests/calc.at: Suppress test with option `--raw'.
9656
1e24cc5b
AD
96572001-07-14 Akim Demaille <akim@epita.fr>
9658
9659 * config/: New.
9660 * configure.in: Require Autoconf 2.50.
9661 Update to gettext 0.10.38.
9662
32dfccf8
AD
96632001-03-16 Akim Demaille <akim@epita.fr>
9664
9665 * doc/bison.texinfo: ANSIfy the examples.
9666
cd5bd6ac
AD
96672001-03-16 Akim Demaille <akim@epita.fr>
9668
9669 * getargs.c (skeleton): New variable.
9670 (longopts): --skeleton is a new option.
9671 (shortopts, getargs): -S is a new option.
9672 * getargs.h: Declare skeleton.
9673 * output.c (output_parser): Use it.
9674
5141b016
AD
96752001-03-16 Akim Demaille <akim@epita.fr>
9676
9677 * m4/strerror_r.m4: New.
9678 * m4/error.m4: Run AC_FUNC_STRERROR_R.
9679 * lib/error.h, lib/error.c: Update.
9680
447992b9
AD
96812001-03-16 Akim Demaille <akim@epita.fr>
9682
9683 * src/getargs.c (longopts): Clean up.
9684
274d42ce
AD
96852001-02-21 Akim Demaille <akim@epita.fr>
9686
9687 * src/reader.c (gensym): `gensym_count' is your own.
9688 Use a static buf to create the symbol name, as token_buffer is no
9689 longer a buffer.
9690
22c821f3
AD
96912001-02-08 Akim Demaille <akim@epita.fr>
9692
9693 * src/conflicts.c (conflict_report): Be sure not to append to res
9694 between two calls, which could happen if both first sprintf were
9695 skipped, but not the first cp += strlen.
9696
18569462
AD
96972001-02-08 Akim Demaille <akim@epita.fr>
9698
9699 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
9700 New, from fileutils 4.0.37.
9701 * configure.in: Require Autoconf 2.49c. I took some time before
9702 making this decision. This is the only way out for portability
9703 issues in Bison, it would mean way too much duplicate effort to
9704 import in Bison features implemented in 2.49c since 2.13.
9705 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
9706
0d8f3c8a
AD
97072001-02-02 Akim Demaille <akim@epita.fr>
9708
9709 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 9710 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 9711
f17bcd1f
AD
97122001-01-19 Akim Demaille <akim@epita.fr>
9713
9714 Get rid of the ad hoc handling of token_buffer in the scanner: use
9715 the obstacks.
9716
9717 * src/lex.c (token_obstack): New.
9718 (init_lex): Initialize it. No longer call...
9719 (grow_token_buffer): this. Remove it.
9720 Adjust all the places which used it to use the obstack.
9721
511e79b3
AD
97222001-01-19 Akim Demaille <akim@epita.fr>
9723
9724 * src/lex.h: Rename all the tokens:
9725 s/\bENDFILE\b/tok_eof/g;
9726 s/\bIDENTIFIER\b/tok_identifier/g;
9727 etc.
9728 Let them be enums, not #define, to ease debugging.
9729 Adjust all the code.
9730
0d6508ef
AD
97312001-01-18 Akim Demaille <akim@epita.fr>
9732
9733 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
9734 * src/lex.c (maxtoken, grow_token_buffer): Static.
9735
6deb4447
AD
97362001-01-18 Akim Demaille <akim@epita.fr>
9737
9738 Since we now use obstacks, more % directives can be enabled.
9739
9740 * src/lex.c (percent_table): Also accept `%yacc',
9741 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
9742 `%debug'.
9743 Handle the actions for `%semantic_parser' and `%pure_parser' here,
9744 instead of returning a token.
9745 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
9746 * src/reader.c (read_declarations): Adjust.
9747 * src/files.c (open_files): Don't call `compute_base_names', don't
9748 compute `attrsfile' since they depend upon data which might be
9749 *in* the input file now.
9750 (output_files): Do it here.
9751 * src/output.c (output_headers): Document the fact that this patch
9752 introduces a guaranteed SEGV for semantic parsers.
9753 * doc/bison.texinfo: Document them.
9754 * tests/suite.at: Exercise these %options.
9755
ff4423cc
AD
97562000-12-20 Akim Demaille <akim@epita.fr>
9757
9758 Also handle the output file (--verbose) with obstacks.
9759
9760 * files.c (foutput): Remove.
9761 (output_obstack): New.
9762 Adjust all dependencies.
9763 * src/conflicts.c: Return a string.
9764 * src/system.h (obstack_grow_string): Rename as...
9765 (obstack_sgrow): this. Be ready to work with non literals.
9766 (obstack_fgrow4): New.
9767
956dba3a
AD
97682000-12-20 Akim Demaille <akim@epita.fr>
9769
9770 * src/files.c (open_files): Fix the computation of short_base_name
9771 in the case of `-o foo.tab.c'.
9772
337bab46
AD
97732000-12-20 Akim Demaille <akim@epita.fr>
9774
9775 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
9776 (copy_dollar): Now that everything uses obstacks, get rid of the
9777 FILE * parameters.
9778
5d3214b8
AD
97792000-12-20 Akim Demaille <akim@epita.fr>
9780
9781 * src/files.c (open_files): Actually the `.output' file is based
9782 on the short_base_name, not base_name.
9783 * tests/suite.at (Checking output file names): Adjust.
9784
29092a57
AD
97852000-12-20 Akim Demaille <akim@epita.fr>
9786
9787 * src/bison.s1: Remove, we now use directly...
9788 * src/bison.simple: this.
9789 * src/Makefile.am: Use pkgdata instead of data.
9790
ea5607fd
AD
97912000-12-20 Akim Demaille <akim@epita.fr>
9792
9793 * src/files.c (guard_obstack): New.
9794 (open_files): Initialize it.
9795 (output_files): Dump it...
9796 * src/files.h: Export it.
9797 * src/reader.c (copy_guard): Use it.
9798
27110317
AD
97992000-12-19 Akim Demaille <akim@epita.fr>
9800
9801 * src/files.c (outfile, defsfile, actfile): Removed as global
9802 vars.
9803 (open_files): Don't compute them.
9804 (output_files): Adjust.
9805 (base_name, short_base_name): Be global.
9806 Adjust dependencies.
9807
19c50364
AD
98082000-12-19 Akim Demaille <akim@epita.fr>
9809
9810 * src/files.c (strsuffix): New.
9811 (stringappend): Be just like strcat but allocate.
9812 (base_names): Eve out from open_files.
9813 Try to simplify the rather hairy computation of base_name and
9814 short_base_name.
9815 (open_files): Use it.
9816 * tests/suite.at (Checking output file names): New test.
9817
573c1d9f
AD
98182000-12-19 Akim Demaille <akim@epita.fr>
9819
9820 * src/system.h (obstack_grow_literal_string): Rename as...
9821 (obstack_grow_string): this.
9822 * src/output.c (output_parser): Recognize `%% actions' instead of
9823 `$'.
9824 * src/bison.s1: s/$/%% actions/.
9825 * src/bison.hairy: Likewise.
9826
ef7ddedd
AD
98272000-12-19 Akim Demaille <akim@epita.fr>
9828
9829 * src/output.c (output_parser): Compute the `#line' lines when
9830 there are.
9831 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
9832 Suggested by Hans Aberg.
9833
ff61dabd
AD
98342000-12-19 Akim Demaille <akim@epita.fr>
9835
9836 Let the handling of the skeleton files be local to the procedures
9837 that use it.
9838
9839 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
9840 longer static.
9841 (fparser, open_extra_files): Remove.
9842 (open_files, output_files): Don't take care of fparser.
9843 * src/files.h: Adjust.
9844 * src/output.c (output_parser): Open and close the file to the
9845 skeleton.
9846 * src/reader.c (read_declarations): When %semantic_parser, open
9847 fguard.
9848
55b96341
AD
98492000-12-19 Akim Demaille <akim@epita.fr>
9850
9851 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
9852 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
9853
358c15b7
AD
98542000-12-19 Akim Demaille <akim@epita.fr>
9855
9856 * src/files.c (open_files): Yipee! We no longer need all the code
9857 looking for `/tmp' since we have no tmp file.
9858
7de3329e
AD
98592000-12-19 Akim Demaille <akim@epita.fr>
9860
9861 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
9862 New macros.
9863 * src/files.c (open_files): Less dependency on MSDOS etc.
9864
3abcd459
AD
98652000-12-14 Akim Demaille <akim@epita.fr>
9866
9867 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
9868 Provide a default definition.
9869 Use it when executing the default @ action.
9870 * src/reader.c (reader_output_yylsp): No longer include
9871 `timestamp' and `text' in the default YYLTYPE.
9872
2a91a95e
AD
98732000-12-12 Akim Demaille <akim@epita.fr>
9874
9875 * src/reader.c (copy_definition, parse_union_decl, copy_action)
9876 (copy_guard): Quote the file names.
9877 Reported by Laurent Mascherpa.
9878
14d3eb9b
AD
98792000-12-12 Akim Demaille <akim@epita.fr>
9880
9881 * src/output.c (output_headers, output_program, output): Be sure
9882 to escape special characters when outputting filenames.
9883 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
9884 (output_headers): Don't depend on them, Use ACTSTR.
9885
d7045ec6
AD
98862000-11-17 Akim Demaille <akim@epita.fr>
9887
9888 * lib/obstack.h: Formatting changes.
9889 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
9890 prevents type checking.
9891 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9892 cast the value to (void *): assigning a `foo *' to a `void *'
9893 variable is valid.
9894 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9895 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
9896 append characters.
9897
6fd54b73
AD
98982000-11-17 Akim Demaille <akim@epita.fr>
9899
9900 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
9901 as...
9902 (suite.m4, regression.m4, calc.m4): these.
9903 * tests/atgeneral.m4: Update from CVS Autoconf.
9904
4c50eae6
AD
99052000-11-17 Akim Demaille <akim@epita.fr>
9906
9907 * tests/regression.m4 (%union and --defines): New test,
9908 demonstrating a current bug in the obstack implementation.
9909
a35f64ea
AD
99102000-11-17 Akim Demaille <akim@epita.fr>
9911
9912 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
9913 macros.
9914 Use them to declare the variables which are global or local to
9915 `yyparse'.
9916
7de23534
AD
99172000-11-17 Akim Demaille <akim@epita.fr>
9918
9919 * acconfig.h: Remove, no longer used.
9920
aa7815f5
AD
99212000-11-07 Akim Demaille <akim@epita.fr>
9922
9923 * src: s/Copyright (C)/Copyright/g.
9924
5af1f549
AD
99252000-11-07 Akim Demaille <akim@epita.fr>
9926
9927 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
9928 defining.
9929 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
9930
553e2b22
AD
99312000-11-07 Akim Demaille <akim@epita.fr>
9932
9933 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
9934 Merge in a single CPP if/else.
9935
8a4f41d6
AD
99362000-11-07 Akim Demaille <akim@epita.fr>
9937
9938 * src/output.c (output): Remove useless variables.
9939 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
9940 argument `data' for consistency with the prototypes.
9941 Qualify it `const'.
9942 (obstack_copy, obstack_copy0): Rename the second argument as
9943 `address' for consistency. Qualify it `const'.
9944 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
9945 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
9946 `const' their input argument (`data' or `address').
9947 Adjust the corresponding macros to include `const' in casts.
9948
095a3fb5
AD
99492000-11-03 Akim Demaille <akim@epita.fr>
9950
9951 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
9952 s/PFILE1/BISON_HAIRY/.
9953 Adjust dependencies.
9954
d1cdce7c
AD
99552000-11-03 Akim Demaille <akim@epita.fr>
9956
090c5ebf 9957 For some reason, this was not applied.
d1cdce7c
AD
9958
9959 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
9960 `unlink': it's no longer used.
9961
9311529b
AD
99622000-11-03 Akim Demaille <akim@epita.fr>
9963
9964 * src/files.c (skeleton_find): New function, eved out of...
9965 (open_files, open_extra_files): here.
9966
d8880f69
AD
99672000-11-03 Akim Demaille <akim@epita.fr>
9968
9969 Don't use `atexit'.
9970
9971 * src/files.c (obstack_save): New function.
9972 (done): Rename as...
9973 (output_files): this.
9974 Use `obstack_save'.
9975 * src/main.c (main): Don't use `atexit' to register `done', since
9976 it no longer has to remove tmp files, just call `output_files'
9977 when there are no errors.
9978
0dbb648e
AD
99792000-11-02 Akim Demaille <akim@epita.fr>
9980
9981 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
9982 `unlink': it's no longer used.
9983 * src/files.h: Formatting changes.
9984
896fe5c1
AD
99852000-11-02 Akim Demaille <akim@epita.fr>
9986
9987 Remove the last uses of mktemp and unlink/delete.
9988
9989 * src/files.c (fdefines, ftable): Removed.
9990 (defines_ostack, table_obstack): New.
9991 Adjust dependencies of the former into uses of the latter.
9992 * src/output.c (output_short_or_char_table, output_short_table):
9993 Convert to using obstacks.
9994 * src/reader.c (copy_comment2): Accept one FILE * and two
9995 obstacks.
9996 (output_token_defines, reader_output_yylsp): Use obstacks.
9997 * src/system.h (obstack_fgrow3): New.
9998
dd60faec
AD
99992000-11-01 Akim Demaille <akim@epita.fr>
10000
10001 Change each use of `fattrs' into a use of `attrs_obstack'.
10002
10003 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
10004 * src/files.c (fattrs): Remove.
10005 (attrs_obstack): New.
10006 Adjust all dependencies.
10007 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
10008
8c7ebe49
AD
100092000-11-01 Akim Demaille <akim@epita.fr>
10010
10011 Introduce obstacks.
10012 Change each use of `faction' into a use of `action_obstack'.
10013
10014 * lib/obstack.h, lib/obstack.c: New files.
10015 * src/files.c (faction): Remove.
10016 (action_obstack): New.
10017 Adjust all dependencies.
10018
77aee789
AD
100192000-10-20 Akim Demaille <akim@epita.fr>
10020
10021 * lib/quote.h (PARAMS): New macro. Use it.
10022
43591cec
AD
100232000-10-16 Akim Demaille <akim@epita.fr>
10024
10025 * src/output.c (output_short_or_char_table): New function.
10026 (output_short_table, output_token_translations): Use it.
10027 (goto_actions): Use output_short_table.
10028
1e9798d5
AD
100292000-10-16 Akim Demaille <akim@epita.fr>
10030
10031 * src/symtab.c (bucket_new): New function.
10032 (getsym): Use it.
10033
10034 * src/output.c (output_short_table): New argument to display the
10035 comment associated with the table.
10036 Adjust dependencies.
10037 (output_gram): Use it.
10038 (output_rule_data): Nicer output layout for YYTNAME.
10039
f282676b
AD
100402000-10-16 Akim Demaille <akim@epita.fr>
10041
10042 * src/lex.c (read_typename): New function.
10043 (lex): Use it.
10044 * src/reader.c (copy_dollar): Likewise.
10045
550a72a3
AD
100462000-10-16 Akim Demaille <akim@epita.fr>
10047
10048 * src/reader.c (copy_comment2): Expect the input stream to be on
10049 the `/' which is suspected to open a comment, instead of being
10050 called after `//' or `/*' was read.
10051 (copy_comment, copy_definition, parse_union_decl, copy_action)
10052 (copy_guard): Adjust.
10053
131e2fef
AD
100542000-10-16 Akim Demaille <akim@epita.fr>
10055
10056 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
10057 `read_signed_integer'.
10058
79282c5a
AD
100592000-10-16 Akim Demaille <akim@epita.fr>
10060
10061 * src/reader.c (copy_dollar): New function.
10062 (copy_guard, copy_action): Use it.
10063
ff4a34be
AD
100642000-10-16 Akim Demaille <akim@epita.fr>
10065
10066 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
10067 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
10068 New files, from Fileutils 4.0.27.
10069 * src/main.c (printable_version): Remove.
10070 * src/lex.c, src/reader.c: Use `quote'.
10071
100722000-10-04 Akim Demaille <akim@epita.fr>
10073
10074 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
10075
14ded682
AD
100762000-10-04 Akim Demaille <akim@epita.fr>
10077
10078 * doc/bison.texinfo: Various typos spotted by Neil Booth.
10079
8e03724b
AD
100802000-10-04 Akim Demaille <akim@epita.fr>
10081
10082 When a literal string is used to define two different tokens,
10083 `bison -v' segfaults.
10084 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
10085
10086 * tests/regression.m4: New file.
10087 Include the core of the sample provided by Piotr Gackiewicz.
10088 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
10089 properly.
10090
a9e64249
AD
100912000-10-04 Akim Demaille <akim@epita.fr>
10092
10093 * src/reader.c (parse_expect_decl): Keep `count' within the size
10094 of `buffer'.
10095 From Neil Booth.
10096
da9abf43
AD
100972000-10-02 Paul Eggert <eggert@twinsun.com>
10098
10099 * bison.s1 (yyparse): Assign the default value
10100 unconditionally, to avoid a GCC warning and make the parser a
10101 tad smaller.
10102
c33638bb
AD
101032000-10-02 Akim Demaille <akim@epita.fr>
10104
10105 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
10106 options.
10107
444c570a
AD
101082000-10-02 Akim Demaille <akim@epita.fr>
10109
10110 * src/derives.c, src/print.c, src/reduce.c: To ease the
10111 translation, move some `\n' out of the translated strings.
10112
89cab50d
AD
101132000-10-02 Akim Demaille <akim@epita.fr>
10114
10115 The location tracking mechanism is precious for parse error
10116 messages. Nevertheless, it is enabled only when `@n' is used in
10117 the grammar, which is a different issue (you can use it in error
10118 message, but not in the grammar per se). Therefore, there should
10119 be another means to enable it.
10120
10121 * src/getargs.c (getargs): Support `--locations'.
10122 (usage): Report it.
10123 * src/getargs.h (locationsflag): Export it.
10124 * src/lex.c (percent_table): Support `%locations'.
10125 * src/reader.c (yylsp_needed): Remove this variable, now replaced
10126 with `locationsflag'.
10127 * doc/bison.texinfo: Document `--locations' and `%locations'.
10128 Sort the options.
10129 * tests/calc.m4: Test it.
10130
10131 For regularity of the names, replace each
10132 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
10133 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
10134 In addition replace each `flag' with `_flag'.
10135
d6c2cba0
AD
101362000-10-02 Akim Demaille <akim@epita.fr>
10137
10138 Also test parse error messages, including with YYERROR_VERBOSE.
10139
10140 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
10141 associative).
10142 Use it to check the computations.
10143 Use it to check `nonassoc' is honored.
10144 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
10145 `--yyerror-verbose'.
10146 (_AT_CHECK_CALC): Adjust to this option.
10147 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
10148
5a35a6cb
AD
101492000-10-02 Akim Demaille <akim@epita.fr>
10150
10151 Test also `--verbose', `--defines' and `--name-prefix'. Testing
10152 the latter demonstrates a flaw in the handling of non debugging
10153 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
10154 was used in order to simplify:
10155
10156 #if YYDEBUG
10157 if (yydebug)
10158 {
10159 ...
10160 }
10161 #endif
10162
10163 into
10164
10165 if (yydebug)
10166 {
10167 ...
10168 }
10169
10170 unfortunately this leads to a CPP conflict when
10171 `--name-prefix=foo' is used since it produces `#define yydebug
10172 foodebug'.
10173
10174 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
10175 (YYDPRINTF): New macro.
10176 Spread its use.
10177 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
10178 the bison options.
10179 Also test `--verbose', `--defines' and `--name-prefix'.
10180
71da9eea
AD
101812000-10-02 Akim Demaille <akim@epita.fr>
10182
10183 Improve the readability of the produced parsers.
10184
10185 * src/bison.s1: Formatting changes.
10186 Improve the comment related to the `$' mark.
10187 (yydefault): Don't fall through to `yyresume': `goto' there.
10188 * src/output.c (output_parser): When the `$' is met, skip the end
10189 of its line.
10190 New variable, `number_of_dollar_signs', to check there's exactly
10191 one `$' in the parser skeleton.
10192
95e36146
AD
101932000-10-02 Akim Demaille <akim@epita.fr>
10194
10195 * lib/xstrdup.c: New file, from the fileutils.
10196 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
10197 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
10198 instead of strlen + xmalloc + strcpy.
10199 * src/symtab.c (copys): Remove, use xstrdup instead.
10200
d7020c20
AD
102012000-10-02 Akim Demaille <akim@epita.fr>
10202
10203 * src/gram.h (associativity): New enum type which replaces the
10204 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
10205 `right_assoc', `left_assoc' and `non_assoc'.
10206 Adjust all dependencies.
10207 * src/reader.c: Formatting changes.
10208 (LTYPESTR): Don't define it, use it as a literal in
10209 `reader_output_yylsp'.
10210 * src/symtab.h (symbol_class): New enum type which replaces the
10211 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
10212 `sunknown', `stoken and `snterm'.
10213
1916f98e
AD
102142000-10-02 Akim Demaille <akim@epita.fr>
10215
10216 * src/getargs.c (fixed_outfiles): Rename as...
10217 (yaccflag): for consistency and accuracy.
10218 Adjust dependencies.
10219
d7913476
AD
102202000-10-02 Akim Demaille <akim@epita.fr>
10221
10222 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
10223 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
10224 difficult and introduced a lot of core dump. It turns out that
10225 Bison used an implementation of `xmalloc' based on `calloc', and
10226 at various places it does depend upon the initialization to 0. I
10227 have not tried to isolate the pertinent places, and all the former
10228 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
10229 someone should address this issue.
10230
10231 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
10232 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
10233 files.
10234 Adjust dependencies.
10235 * src/warshall.h: New file.
10236 Propagate.
10237
340ef489
AD
102382000-10-02 Akim Demaille <akim@epita.fr>
10239
10240 Various anti-`extern in *.c' changes.
10241
10242 * src/system.h: Include `assert.h'.
10243
b2ca4022
AD
102442000-10-02 Akim Demaille <akim@epita.fr>
10245
10246 * src/state.h (nstates, final_state, first_state, first_shift)
10247 (first_reduction): Move their exportation from here...
10248 * src/LR0.h: to here.
10249 Adjust dependencies.
10250 * src/getargs.c (statisticsflag): New variable.
10251 Add support for `--statistics'.
10252 Adjust dependencies.
10253
10254 Remove a lot of now useless `extern' statements in most files.
10255
403b315b
AD
102562000-10-02 Akim Demaille <akim@epita.fr>
10257
10258 * src/LR0.h: New file.
10259 Propagate its use.
10260
07a58c13
AD
102612000-10-02 Akim Demaille <akim@epita.fr>
10262
10263 * src/print.h: New file.
10264 Propagate its use.
10265 * src/print.c: Formatting and ordering changes.
10266 (verbose, terse): Replace with...
10267 (print_results): this new function.
10268 Adjust dependencies.
10269
0619caf0
AD
102702000-10-02 Akim Demaille <akim@epita.fr>
10271
10272 * src/conflicts.c (conflict_report): New function.
10273 (conflict_log, verbose_conflict_log): Replace with...
10274 (print_conflicts): this function.
10275 Adjust dependencies.
10276 * src/conflicts.h: New file.
10277 Propagate its inclusion.
10278
3519ec76
AD
102792000-10-02 Akim Demaille <akim@epita.fr>
10280
10281 * src/nullable.h: New file.
10282 Propagate its inclusion.
10283 * src/nullable.c: Formatting changes.
10284
015acc48
AD
102852000-10-02 Akim Demaille <akim@epita.fr>
10286
10287 * src/reduce.h: New file.
10288 Propagate its inclusion.
10289 * src/reduce.c: Topological sort and other formatting changes.
10290 (bool, TRUE, FALSE): Move their definition to...
10291 * src/system.h: here.
10292
8963a27b
AD
102932000-10-02 Akim Demaille <akim@epita.fr>
10294
10295 * src/files.c: Formatting changes.
10296 (tryopen, tryclose, openfiles): Rename as...
10297 (xfopen, xfclose, open_files): this.
10298 (stringappend): static.
10299 * src/files.h: Complete the list of exported symbols.
10300 Propagate its use.
10301
a70083a3
AD
103022000-10-02 Akim Demaille <akim@epita.fr>
10303
10304 * src/reader.h: New file.
10305 Propagate its use instead of tedious list of `extern' and
10306 prototypes.
10307 * src/reader.c: Formatting changes, topological sort,
10308 s/register//.
10309
abadc117
AD
103102000-10-02 Akim Demaille <akim@epita.fr>
10311
10312 * src/lex.h: Prototype `lex.c' exported functions.
10313 * src/reader.c: Adjust.
10314 * src/lex.c: Formatting changes.
10315 (safegetc): Rename as...
10316 (xgetc): this.
10317
720d742f
AD
103182000-10-02 Akim Demaille <akim@epita.fr>
10319
10320 * src/lalr.h: New file.
10321 Propagate its inclusion instead of prototypes and `extern'.
10322 * src/lalr.c: Formatting changes, topological sorting etc.
10323
f2acea59
AD
103242000-10-02 Akim Demaille <akim@epita.fr>
10325
10326 * src/output.c (token_actions): Introduce a temporary array,
10327 YYDEFACT, that makes it possible for this function to use
10328 output_short_table.
10329
d019d655
AD
103302000-10-02 Akim Demaille <akim@epita.fr>
10331
10332 `user_toknums' is output as a `short[]' in `output.c', while it is
10333 defined as a `int[]' in `reader.c'. For consistency with the
10334 other output tables, `user_toknums' is now defined as a table of
10335 shorts.
10336
10337 * src/reader.c (user_toknums): Be a short table instead of an int
10338 table.
10339 Adjust dependencies.
10340
10341 Factor the short table outputs.
10342
10343 * src/output.c (output_short_table): New function.
10344 * src/output.c (output_gram, output_stos, output_rule_data)
10345 (output_base, output_table, output_check): Use it.
10346
6c89f1c1
AD
103472000-10-02 Akim Demaille <akim@epita.fr>
10348
10349 * src/output.c (output): Topological sort of the functions, in
10350 order to get rid of the `static' prototypes.
10351 No longer use `register'.
10352 * src/output.h: New file.
10353 Propagate its inclusion in files explicitly prototyping functions
10354 from output.c.
10355
d9efd181
AD
103562000-09-21 Akim Demaille <akim@epita.fr>
10357
10358 * src/atgeneral.m4: Update from Autoconf.
10359
c29240e7 103602000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
10361
10362 * src/closure.h: New file.
10363 * src/closure.c: Formatting changes, topological sort over the
10364 functions, use of closure.h.
10365 (initialize_closure, finalize_closure): Rename as...
10366 (new_closure, free_closure): these. Adjust dependencies.
10367 * src/LR0.c: Formatting changes, topological sort, use of
10368 cloture.h.
10369 (initialize_states): Rename as...
10370 (new_states): this.
10371 * src/Makefile.am (noinst_HEADERS): Adjust.
10372
499daa50
AD
103732000-09-20 Akim Demaille <akim@epita.fr>
10374
10375 * src/acconfig.h: Don't protect config.h against multiple
10376 inclusion.
10377 Don't define PARAMS.
10378 * src/system.h: Define PARAMS.
10379 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
10380 purpose of config.h. system.h must not try to fix wrong
10381 definitions in config.h.
10382
cc84fd5d
AD
103832000-09-20 Akim Demaille <akim@epita.fr>
10384
10385 * src/derives.h: New file.
10386 * src/main.c, src/derives.h: Use it.
10387 Formatting changes.
10388 * src/Makefile.am (noinst_HEADERS): Adjust.
10389
db5b3a89
AD
103902000-09-20 Akim Demaille <akim@epita.fr>
10391
10392 * tests/atgeneral.m4: Update from Autoconf.
10393 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
10394 (AT_CHECK_CALC): New macros.
10395 Use these macros to test bison with options `', `--raw',
10396 `--debug', `--yacc', `--yacc --debug'.
10397
ceed8467
AD
103982000-09-19 Akim Demaille <akim@epita.fr>
10399
10400 * src/output.c: Formatting changes.
10401 * src/machine.h: Remove, leaving its contents in...
10402 * src/system.h: here.
10403 Include stdio.h.
10404 Adjust all dependencies on stdio.h and machine.h.
10405 * src/getargs.h: New file.
10406 Let all `extern' declarations about getargs.c be replaced with
10407 inclusion of `getargs.h'.
10408 * src/Makefile.am (noinst_HEADERS): Adjust.
10409
10410 * tests/calc.m4 (yyin): Be initialized in main, not on the global
10411 scope.
10412 (yyerror): Returns void, not int.
10413 * doc/bison.texinfo: Formatting changes.
10414
05a1d24b
AD
104152000-09-19 Akim Demaille <akim@epita.fr>
10416
10417 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
10418 portable.
10419
cbd25751
AD
104202000-09-18 Akim Demaille <akim@epita.fr>
10421
10422 * configure.in: Append WARNING_CFLAGS to CFLAGS.
10423 * src/Makefile.am (INCLUDES): Don't.
10424 Be ready to fetch headers in lib/.
10425
13863333
AD
104262000-09-18 Akim Demaille <akim@epita.fr>
10427
10428 * doc/bison.texinfo: Update the copyright.
10429 ANSIfy and GNUify the examples.
10430 Remove the old menu.
10431
0d533154
AD
104322000-09-18 Akim Demaille <akim@epita.fr>
10433
10434 First set of tests: use the `calc' example from the documentation.
10435
10436 * src/bison.s1 (yyparse): Condition the code using `yytname' which
10437 is defined only when YYDEBUG is.
10438 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
10439 * src/files.c (tryopen, tryclose): Formatting changes.
10440 Move to the top and be static.
10441 * src/reader.c (read_signed_integer): Likewise.
10442 * tests/calc.m4: New file.
10443 * Makefile.am, suite.m4: Adjust.
10444 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
10445
e79137ac
AD
104462000-09-18 Akim Demaille <akim@epita.fr>
10447
10448 Add support for an Autotest test suite for Bison.
10449
10450 * m4/m4.m4, m4/atconfig.m4: New files.
10451 * m4/Makefile.am (EXTRA_DIST): Adjust.
10452 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
10453 files.
10454 * src/getargs.c: Display a more standard --version message.
10455 * src/reader.c (reader): Formatting changes.
10456 No longer depend upon VERSION_STRING.
10457 * configure.in: No longer use `dnl'.
10458 Set up the test suite and the new directory `tests/.
10459 (VERSION_STRING): Remove.
10460
27821bff
AD
104612000-04-14 Akim Demaille <akim@epita.fr>
10462
10463 * src/reader.c (copy_comment2): New function, same as former
10464 `copy_comment', but outputs into two FILE *.
10465 (copy_comment): Use it.
10466 (parse_union_decl): Use it.
10467 (get_type, parse_start_decl): Use the same `invalid' message.
10468 (parse_start_decl, parse_union_decl): Use the same `multiple'
10469 message.
10470 (parse_union_decl, copy_guard, copy_action): Use the same
10471 `unmatched' message.
10472 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
10473
cfe5fbc0
AD
104742000-03-31 Akim Demaille <akim@epita.fr>
10475
10476 * src/files.c (tryopen, tryclose): Move to the top.
10477 Be static.
10478
cb7db13e
AD
104792000-03-31 Akim Demaille <akim@epita.fr>
10480
10481 * src/main.c (main): Don't call `done', exit does it.
10482
a0f6b076
AD
104832000-03-31 Akim Demaille <akim@epita.fr>
10484
36281465
AD
10485 * allocate.c: s/return (foo)/return foo/.
10486 * lalr.c: Likewise.
10487 * LR0.c: Likewise.
10488 * output.c: Likewise.
10489 * reader.c: Likewise.
10490 * symtab.c: Likewise.
10491 * vmsgetargs.c: Likewise.
10492
104932000-03-31 Akim Demaille <akim@epita.fr>
10494
10495 Clean up the error reporting functions.
a0f6b076
AD
10496
10497 * src/report.c: New file.
10498 * src/report.h: Likewise.
10499 * src/Makefile.am: Adjust.
10500 * m4/error.m4: New file.
10501 * m4/Makefile.am: Adjust.
10502 * configure.in (jm_PREREQ_ERROR): Call it.
10503 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
10504 Remove.
10505 (fatal, fatals): Remove. All callers use complain.c::fatal.
10506 (warn, warni, warns, warnss, warnss): Remove. All callers use
10507 complain.c::complain.
10508 (toomany): Remove, use fatal instead.
10509 * src/files.c (done): No argument, use complain_message_count.
10510 * src/main.c (main): Register `done' to `atexit'.
10511
10512 * src/getargs.c (usage): More `fputs', less `fprintf'.
10513
18539825
AD
105142000-03-28 Akim Demaille <akim@epita.fr>
10515
10516 * lib/: New directory.
10517 * Makefile.am (SUBDIRS): Adjust.
10518 * configure.in: Adjust.
10519 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
10520 useless.
10521 * src/alloca.c: Moved to lib/.
10522 * src/getopt.c: Likewise.
10523 * src/getopt1.c: Likewise.
10524 * src/getopt.h: Likewise.
10525 * src/ansi2knr.c: Likewise.
10526 * src/ansi2knr.1: Likewise.
10527 * src/Makefile.am: Adjust.
10528 * lib/Makefile.am: New file.
10529
9f306f2a
AD
105302000-03-28 Akim Demaille <akim@epita.fr>
10531
10532 * src/getargs.c (usage): Refresh the help message.
10533
0ba347b6
AD
105342000-03-17 Akim Demaille <akim@epita.fr>
10535
10536 * src/getopt1.c: Updated from textutils 2.0e
10537 * src/getopt.c: Likewise.
10538 * src/getopt.h: Likewise.
10539
dbe7f271
AD
105402000-03-17 Akim Demaille <akim@epita.fr>
10541
10542 * src/Makefile.am (bison.simple): Fix the awk program: quote only
10543 the file name, not the whole `#line LINE FILE'.
10544
75bbe78d
AD
105452000-03-17 Akim Demaille <akim@epita.fr>
10546
10547 On syntax errors, report the token on which we choked.
10548
aa5fd0ee
AD
10549 * src/bison.s1 (yyparse): In the label yyerrlab, when
10550 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 10551
7b306f52
AD
105522000-03-17 Akim Demaille <akim@epita.fr>
10553
aa5fd0ee 10554 * src/reader.c (copy_at): New function.
7b306f52
AD
10555 (copy_guard): Use it.
10556 (copy_action): Use it.
10557
e87b5700
AD
105582000-03-17 Akim Demaille <akim@epita.fr>
10559
10560 Be kind to translators, save some useless translations.
10561
aa5fd0ee 10562 * src/main.c (banner): New function.
e87b5700
AD
10563 (fatal_banner): Use it.
10564 (warn_banner): Use it.
10565
ae3c3164
AD
105662000-03-17 Akim Demaille <akim@epita.fr>
10567
aa5fd0ee
AD
10568 * src/reader.c (copy_definition): Use copy_string and
10569 copy_comment. Removed now unused `match', `ended',
10570 `cplus_comment'.
ae3c3164
AD
10571 (copy_comment, copy_string): Moved, to be visible from
10572 copy_definition.
10573
4dc58e7c
AD
105742000-03-17 Akim Demaille <akim@epita.fr>
10575
aa5fd0ee
AD
10576 * src/reader.c (copy_string): Declare `static inline'. No
10577 problems with inline, since it is checked by configure.
4dc58e7c
AD
10578 (copy_comment): Likewise.
10579
0a6384c4
AD
105802000-03-17 Akim Demaille <akim@epita.fr>
10581
aa5fd0ee 10582 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 10583
3cef001a
AD
105842000-03-17 Akim Demaille <akim@epita.fr>
10585
aa5fd0ee 10586 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
10587 (copy_action): Use it. Removed now unused `match', `ended',
10588 `cplus_comment'.
10589 (copy_guard): Likewise.
10590
ca36d2ef
AD
105912000-03-17 Akim Demaille <akim@epita.fr>
10592
aa5fd0ee 10593 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
10594 (copy_action): Use it.
10595 (copy_guard): Likewise.
10596
6666f98f
AD
105972000-03-17 Akim Demaille <akim@epita.fr>
10598
10599 Change the handling of @s so that they behave exactly like $s.
10600 There is now a pseudo variable @$ (readble and writable), location
10601 of the lhs of the rule (by default ranging from the location of
10602 the first symbol of the rhs, to the location of the last symbol,
10603 or, if the rhs is empty, YYLLOC).
10604
10605 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
10606 yyval.
10607 (yyparse): When providing a default semantic action, provide a
10608 default location action.
10609 (after the $): No longer change `*YYLSP', just stack YYLOC the
10610 same way you stack YYVAL.
10611 * src/reader.c (read_declarations): Use warns.
10612 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
10613 (copy_action, case '@'): Likewise.
10614 Use a standard error message, to save useless work from
10615 translators.
10616
41aca2e0
AD
106172000-03-17 Akim Demaille <akim@epita.fr>
10618
aa5fd0ee
AD
10619 * src/bison.s1: Formatting and cosmetics changes.
10620 * src/reader.c: Likewise.
41aca2e0
AD
10621 Update the Copyright notice.
10622
dc08c1d5
AD
106232000-03-17 Akim Demaille <akim@epita.fr>
10624
aa5fd0ee
AD
10625 * src/bison.s1 (#line): All set to `#line' only, since the
10626 Makefile now handles them.
dc08c1d5 10627
9ee3c97b
AD
106282000-03-16 Akim Demaille <akim@epita.fr>
10629
10630 * src/output.c (output_rule_data): Output the documentation of
10631 some of the tables.
10632 (Copyright notice): Update.
10633 Formatting changes.
10634
0de741ca
AD
106352000-03-16 Akim Demaille <akim@epita.fr>
10636
10637 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
10638 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
10639 One `#if YYDEBUG' remains, since it uses variables which are
10640 defined only if `YYDEBUG != 0'.
10641
bb10be54
AD
106422000-03-16 Akim Demaille <akim@epita.fr>
10643
10644 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
10645 and related variables so that the similarities are highlighted.
10646
b07b484a
AD
106472000-03-16 Akim Demaille <akim@epita.fr>
10648
10649 * src/bison.s1: Properly indent CPP directives.
10650
361f60b3
AD
106512000-03-16 Akim Demaille <akim@epita.fr>
10652
10653 * src/bison.s1: Properly indent the `alloca' CPP section.
10654
8c44d3ec
AD
106552000-03-16 Akim Demaille <akim@epita.fr>
10656
10657 Do not hard code values of directories in `configure.in'.
10658 Update the `configure' tool chain.
10659
10660 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
10661 src/makefile.am.
10662 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
10663 (AC_OUTPUT): Add m4/Makefile.
10664 Bump to bison 1.28a, 1.29 has never been released.
10665 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
10666 handled via src/Makefile.am.
10667 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
10668 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
10669 autoheader.
10670 * Makefile.am (SUBDIRS): Add m4.
10671 (ACLOCAL_AM_FLAGS): New variable.
10672 (AUTOMAKE_OPTIONS): Add check-news.
10673 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
10674 the proper line number and file name.
10675 (DEFS): Propagate the location of bison library files and of the
10676 locale files.
10677 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
10678 builddir.
10679 * acinclude.m4: Remove, replaced by the directory m4.
10680 * m4/Makefile.am (EXTRA_DIST): New variable.
10681 * m4/gettext.m4: New file, from the fileutils.
10682 * m4/lcmessage.m4: Likewise
10683 * m4/progtest.m4: Likewise.
10684 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
10685
f95997e7
AD
106862000-03-10 Akim Demaille <akim@epita.fr>
10687
10688 * src/closure.c:
10689 Formatting changes of various comments.
10690 Respect the GNU coding standards at various places.
10691 Don't use `_()' when no translation is needed.
10692
106931999-12-13 Jesse Thilo <jthilo@gnu.org>
10694
10695 * src/files.c:
10696 OS/2 honors TMPDIR environment variable.
10697
106981999-12-13 Jesse Thilo <jthilo@gnu.org>
10699
10700 * doc/bison.texinfo: Tweaked spelling and grammar.
10701 Updated ISBN.
10702 Removed reference to price of printed copy.
10703 Mention BISON_SIMPLE and BISON_HAIRY.
10704
107051999-12-13 Jesse Thilo <jthilo@gnu.org>
10706
10707 * configure.in, NEWS:
10708 Bison 1.29 released.
10709
107101999-10-27 Jesse Thilo <jthilo@gnu.org>
10711
10712 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
10713 Added reference card.
10714
107151999-07-26 Jesse Thilo <jthilo@gnu.org>
10716
10717 * po/ru.po: Added Russian translation.
10718
107191999-07-26 Jesse Thilo <jthilo@gnu.org>
10720
10721 * configure.in: Added Russian translation.
10722
107231999-07-06 Jesse Thilo <jthilo@gnu.org>
10724
10725 * configure.in, NEWS, README:
10726 Released version 1.28.
10727
107281999-06-14 Jesse Thilo <jthilo@gnu.org>
10729
10730 * src/system.h:
10731 Squashed redefinition warning on some systems.
10732
10733 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
10734 Have configure build version string instead of relying on ANSI string
10735 concatentation.
10736
107371999-06-14 Jesse Thilo <jthilo@gnu.org>
10738
10739 * po/POTFILES.in: Got rid of version.c.
10740
107411999-06-14 Jesse Thilo <jthilo@gnu.org>
10742
10743 * acconfig.h, configure.in:
10744 Have configure build version string instead of relying on ANSI string
10745 concatentation.
10746
107471999-06-08 Jesse Thilo <jthilo@gnu.org>
10748
10749 * doc/bison.1:
10750 Dropped mention of `+' for long-named options.
10751
107521999-05-30 Jesse Thilo <jthilo@gnu.org>
10753
10754 * src/files.c: Added <unistd.h> for unlink().
10755
10756 * src/Makefile.am, src/system.h:
10757 I18n fixes.
10758
107591999-05-30 Jesse Thilo <jthilo@gnu.org>
10760
10761 * README: Added a FAQ list.
10762
10763 * configure.in, acconfig.h:
10764 I18n fixes.
10765
107661999-05-30 Jesse Thilo <jthilo@gnu.org>
10767
10768 * doc/FAQ, doc/Makefile.am:
10769 Added a FAQ list.
10770
107711999-05-19 Jesse Thilo <jthilo@gnu.org>
10772
10773 * src/alloc.h, src/symtab.h, src/version.c:
10774 Protected inclusion of "config.h" with HAVE_CONFIG_H.
10775
107761999-04-18 Jesse Thilo <jthilo@gnu.org>
10777
10778 * src/.cvsignore, src/Makefile.am:
10779 Reorganized: sources in `src', documentation in `doc'.
10780
10781 * src/lex.c (literalchar):
10782 fixed the code for escaping double quotes (thanks
10783 Jonathan Czisny.)
10784
107851999-04-18 Jesse Thilo <jthilo@gnu.org>
10786
10787 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
10788 Adjusted paths to reflect directory reorganization.
10789
107901999-04-18 Jesse Thilo <jthilo@gnu.org>
10791
10792 * doc/.cvsignore, doc/Makefile.am:
10793 Reorganized: sources in `src', documentation in `doc'.
10794
107951999-04-18 Jesse Thilo <jthilo@gnu.org>
10796
10797 * configure.in:
10798 Updated AC_INIT file to reflect directory reorganization.
10799
10800 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
10801 Reorganized: sources in `src', documentation in `doc'.
10802
108031999-04-13 Jesse Thilo <jthilo@gnu.org>
10804
10805 * src/allocate.c:
10806 Don't declare calloc() and realloc() if not necessary.
10807
108081999-04-13 Jesse Thilo <jthilo@gnu.org>
10809
10810 * configure.in, acconfig.h, acinclude.m4:
10811 Don't declare calloc() and realloc() if not necessary.
10812
108131999-03-23 Jesse Thilo <jthilo@gnu.org>
10814
10815 * po/.cvsignore: Added i18n support.
10816
108171999-03-23 Jesse Thilo <jthilo@gnu.org>
10818
10819 * acconfig.h, configure.in, Makefile.am:
10820 Added i18n support.
10821
108221999-03-22 Jesse Thilo <jthilo@gnu.org>
10823
10824 * src/bison.s1: Fixed #line numbers.
10825
108261999-03-15 Jesse Thilo <jthilo@gnu.org>
10827
10828 * po/es.po, po/fr.po, po/nl.po, po/de.po:
10829 Added PO files from Translation Project.
10830
108311999-03-03 Jesse Thilo <jthilo@gnu.org>
10832
10833 * Makefile.am:
10834 Added support for non-ANSI compilers (ansi2knr).
10835
108361999-02-16 Jesse Thilo <jthilo@gnu.org>
10837
10838 * configure.in: Bumped version number to 1.27.
10839
10840 * Makefile.am:
10841 Added `bison.simple' to list of files removed by `make distclean'.
10842
108431999-02-12 Jesse Thilo <jthilo@gnu.org>
10844
10845 * src/files.c, src/files.h:
10846 Defined locations of parser files in config.h instead of Makefile.
10847
108481999-02-12 Jesse Thilo <jthilo@gnu.org>
10849
10850 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
10851 Defined locations of parser files in config.h instead of Makefile.
10852
108531999-02-09 Jesse Thilo <jthilo@gnu.org>
10854
10855 * Makefile.am:
10856 Removed inappropriate use of $< macro.
10857
108581999-02-05 Jesse Thilo <jthilo@gnu.org>
10859
10860 * po/Makefile.in.in, po/POTFILES.in:
10861 Add `po' directory skeleton.
10862
108631999-01-27 Jesse Thilo <jthilo@gnu.org>
10864
10865 * README: Document help-bison list.
10866
10867 * configure.in: Add check for mkstemp().
10868
108691999-01-20 Jesse Thilo <jthilo@gnu.org>
10870
10871 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
10872 Hush a few compiler warnings.
10873
10874 * src/files.c:
10875 Add tryclose(), which verifies that fclose was successful.
10876 Hush a couple of compiler warnings.
10877
108781999-01-20 Jesse Thilo <jthilo@gnu.org>
10879
10880 * Makefile.am, OChangeLog:
10881 ChangeLog is now automatically generated. Include the old version as
10882 OChangeLog.
10883
108841999-01-14 Jesse Thilo <jthilo@gnu.org>
10885
10886 * 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:
10887 Update FSF address.
10888
108891999-01-14 Jesse Thilo <jthilo@gnu.org>
10890
10891 * doc/bison.texinfo: Fix formatting glitch.
10892
10893 * doc/bison.texinfo: Update FSF address.
10894
108951999-01-14 Jesse Thilo <jthilo@gnu.org>
10896
10897 * acconfig.h: Update FSF address.
10898
108991999-01-08 Jesse Thilo <jthilo@gnu.org>
10900
10901 * src/system.h:
10902 Don't define PACKAGE here, since config.h defines it.
10903
109041998-12-30 Jesse Thilo <jthilo@gnu.org>
10905
10906 * src/reader.c: Update copyright date.
10907
10908 * src/main.c:
10909 Ditch sprintf to statically-sized buffers in fatal/warn functions in
10910 favor of output directly to stderr (avoids buffer overruns).
10911
10912 * src/reader.c: Some checks for premature EOF.
10913
10914 * 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:
10915 Use prototypes if the compiler understands them.
10916
10917 * src/files.c: Honor TMPDIR on Unix hosts.
10918 Use prototypes if the compiler understands them.
10919
10920 * src/reader.c:
10921 Fix a couple of buffer overrun bugs.
10922 Use prototypes if the compiler understands them.
10923
10924 * src/system.h: Include unistd.h and ctype.h.
10925 Use #ifdef instead of #if for NLS symbols.
10926
109271998-12-30 Jesse Thilo <jthilo@gnu.org>
10928
10929 * doc/bison.texinfo:
10930 Delete comment "consider using @set for edition number, etc..." since
10931 we now are doing so.
10932
109331998-12-30 Jesse Thilo <jthilo@gnu.org>
10934
10935 * configure.in:
10936 Use prototypes if the compiler understands them.
10937
10938 * NEWS: Document 1.26 highlights.
10939
10940 * Makefile.am: Require Automake 1.3 or later.
10941
10942 * acconfig.h:
10943 Use prototypes if the compiler understands them.
10944
109451998-12-29 Jesse Thilo <jthilo@gnu.org>
10946
10947 * src/version.c:
10948 Use VERSION symbol from automake for version number.
10949
109501998-12-29 Jesse Thilo <jthilo@gnu.org>
10951
10952 * acconfig.h, configure.in, version.cin:
10953 Use VERSION symbol from automake for version number.
10954
109551998-11-28 Jesse Thilo <jthilo@gnu.org>
10956
10957 * Makefile.am:
10958 Distribute original version of simple parser (bison.s1), not built
10959 version (bison.simple).
10960
109611998-11-28 Jesse Thilo <jthilo@gnu.org>
10962
10963 * doc/bison.texinfo: Add info dir entry.
10964
10965 * doc/bison.texinfo:
10966 Let automake put version number into documentation.
10967
109681998-11-26 Jesse Thilo <jthilo@gnu.org>
10969
10970 * src/bison.cld, src/build.com, src/vmshlp.mar:
10971 Add non-RCS files from /gd/gnu/bison.
10972
109731998-11-26 Jesse Thilo <jthilo@gnu.org>
10974
10975 * doc/bison.1:
10976 Document the BISON_HAIRY and BISON_SIMPLE variables.
10977
109781998-11-25 Jesse Thilo <jthilo@gnu.org>
10979
10980 * src/version.c: Build version.c automatically.
10981
10982 * src/reader.c:
10983 Fix token numbering (used to start at 258, not 257).
10984
10985 * src/system.h: Include config.h.
10986
10987 * src/getargs.c: Update bug report address.
10988
10989 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
10990 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
10991
109921998-11-25 Jesse Thilo <jthilo@gnu.org>
10993
10994 * Makefile.am:
10995 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
10996
10997 * configure.in, version.cin:
10998 Build version.c automatically.
10999
11000 * AUTHORS: Add AUTHORS file.
11001
11002 * README: Update bug report address.
11003
11004 * bison.simple:
11005 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
11006
11007 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
11008 Add automake stuff.
11009
110101998-11-25 Jesse Thilo <jthilo@gnu.org>
11011
11012 * doc/bison.texinfo: Clean up some formatting.
11013
110141998-05-05 Richard Stallman <rms@gnu.org>
11015
11016 * doc/bison.texinfo:
11017 Explain better why to make a pure parser.
11018
110191998-01-05 Richard Stallman <rms@gnu.org>
11020
11021 * src/files.c (openfiles):
11022 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
11023 find a temporary directory, if possible. Do not unlink files while
11024 they are open.
11025
110261997-08-25 Richard Stallman <rms@gnu.org>
11027
11028 * src/reader.c (stack_offset;):
11029 Change some warni to warns.
11030
11031 * src/lex.c (literalchar): Use warns, not warni.
11032
110331997-06-28 Richard Stallman <rms@gnu.org>
11034
11035 * src/bison.s1: Add a Bison version comment.
11036
11037 * src/main.c (fatal, warn, berror):
11038 Use program_name.
11039
110401997-06-28 Richard Stallman <rms@gnu.org>
11041
11042 * Makefile.in (bison_version): New variable.
11043 (dist): Use that variable.
11044 (bison.s1): Substitute the Bison version into bison.simple.
11045
11046 * bison.simple: Add a Bison version comment.
11047
110481997-06-18 Richard Stallman <rms@gnu.org>
11049
11050 * src/main.c (fatal, warn, berror):
11051 Make error messages standard.
11052 (toomany): Improve error message text.
11053
11054 * 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:
11055 new.h renamed to alloc.h.
11056
110571997-06-18 Richard Stallman <rms@gnu.org>
11058
11059 * Makefile.in: new.h renamed to alloc.h.
11060
110611997-05-24 Richard Stallman <rms@gnu.org>
11062
11063 * src/lex.c (literalchar):
11064 Fix the code for escaping \, " and '.
11065
11066 (lex): Avoid trouble when there are many chars
11067 to discard in a char literal with just several chars in it.
11068
110691997-05-17 Richard Stallman <rms@gnu.org>
11070
11071 * src/bison.s1:
11072 Use malloc, if using alloca is troublesome.
11073 (YYSTACK_USE_ALLOCA): New flag macro.
11074 Define it for some systems and compilers.
11075 (YYSTACK_ALLOC): New macro.
11076 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11077 If it was malloc'd, free it.
11078
110791997-05-17 Richard Stallman <rms@gnu.org>
11080
11081 * bison.simple:
11082 Use malloc, if using alloca is troublesome.
11083 (YYSTACK_USE_ALLOCA): New flag macro.
11084 Define it for some systems and compilers.
11085 (YYSTACK_ALLOC): New macro.
11086 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11087 If it was malloc'd, free it.
11088
110891997-04-23 Richard Stallman <rms@gnu.org>
11090
11091 * src/bison.s1:
11092 (alloca) [__hpux]: Always define as __builtin_alloca.
11093
110941997-04-23 Richard Stallman <rms@gnu.org>
11095
11096 * bison.simple:
11097 (alloca) [__hpux]: Always define as __builtin_alloca.
11098
110991997-04-22 Richard Stallman <rms@gnu.org>
11100
11101 * src/bison.s1:
11102 [__hpux]: Include alloca.h (right for HPUX 10)
11103 instead of declaring alloca (right for HPUX 9).
11104
11105 * src/bison.s1 (__yy_memcpy):
11106 Declare arg `count' as unsigned int.
11107 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11108
111091997-04-22 Richard Stallman <rms@gnu.org>
11110
11111 * bison.simple:
11112 [__hpux]: Include alloca.h (right for HPUX 10)
11113 instead of declaring alloca (right for HPUX 9).
11114
11115 * bison.simple (__yy_memcpy):
11116 Declare arg `count' as unsigned int.
11117 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11118
111191997-01-03 Richard Stallman <rms@gnu.org>
11120
11121 * src/allocate.c: [__STDC__ or _MSC_VER]:
11122 Declare calloc and realloc to return void *.
11123
111241997-01-02 Richard Stallman <rms@gnu.org>
11125
11126 * src/system.h:
11127 [_MSC_VER]: Include stdlib.h and process.h.
11128 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
11129
11130 * src/main.c (main): Return FAILURE as a value.
11131 (printable_version): Declare arg as int, not char.
11132
111331997-01-02 Richard Stallman <rms@gnu.org>
11134
11135 * Makefile.in (dist):
11136 Explicitly check for symlinks, and copy them.
11137
111381996-12-19 Richard Stallman <rms@gnu.org>
11139
11140 * src/files.c:
11141 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
11142
111431996-12-18 Paul Eggert <eggert@gnu.org>
11144
11145 * src/bison.s1 (yyparse):
11146 If __GNUC__ and YYPARSE_PARAM are both defined,
11147 declare yyparse to have a void * argument.
11148
111491996-12-18 Paul Eggert <eggert@gnu.org>
11150
11151 * bison.simple (yyparse):
11152 If __GNUC__ and YYPARSE_PARAM are both defined,
11153 declare yyparse to have a void * argument.
11154
111551996-12-17 Richard Stallman <rms@gnu.org>
11156
11157 * src/reduce.c (nbits): Add some casts.
11158
111591996-08-12 Richard Stallman <rms@gnu.org>
11160
11161 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
11162
111631996-08-12 Richard Stallman <rms@gnu.org>
11164
11165 * bison.simple: Test _MSDOS as well as _MSDOS_.
11166
111671996-07-31 Richard Stallman <rms@gnu.org>
11168
11169 * src/bison.s1:
11170 [__sun && __i386]: Include alloca.h.
11171
111721996-07-31 Richard Stallman <rms@gnu.org>
11173
11174 * bison.simple:
11175 [__sun && __i386]: Include alloca.h.
11176
111771996-07-30 Richard Stallman <rms@gnu.org>
11178
11179 * src/bison.s1: Comment change.
11180
11181 * src/bison.s1: Test _MSDOS_, not MSDOS.
11182
111831996-07-30 Richard Stallman <rms@gnu.org>
11184
11185 * bison.simple: Comment change.
11186
11187 * bison.simple: Test _MSDOS_, not MSDOS.
11188
111891996-06-01 Richard Stallman <rms@gnu.org>
11190
11191 * 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:
11192 Insert `_' macro around many string constants.
11193
11194 * src/main.c:
11195 Insert `_' macro around many string constants.
11196
11197 (main): Call setlocale, bindtextdomain and textdomain.
11198
11199 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
11200 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
11201 [ENABLE_NLS]: Include libintl.h.
11202 [ENABLE_NLS] (gettext): Define.
11203 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
11204 (N_, PACKAGE, LOCALEDIR): New macros.
11205
112061996-06-01 Richard Stallman <rms@gnu.org>
11207
11208 * POTFILES.in: New file.
11209
11210 * Makefile.in (allocate.o):
11211 Define target explicitly.
11212
11213 * Makefile.in (CFLAGS): Set to @CFLAGS@.
11214 (LDFLAGS): Set to @LDFLAGS@.
11215 (configure): Run autoconf only if preceding `cd' succeeds.
11216 (bison.s1): Redirect output to temporary file then move the
11217 temporary to the target, rather than redirecting directly to bison.s1.
11218 (clean): Remove config.status and config.log.
11219 (distclean): Don't remove config.status here.
11220
112211996-05-12 Richard Stallman <rms@gnu.org>
11222
11223 * src/bison.s1:
11224 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11225
112261996-05-12 Richard Stallman <rms@gnu.org>
11227
11228 * bison.simple:
11229 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11230
112311996-05-11 Richard Stallman <rms@gnu.org>
11232
11233 * src/bison.s1 (__yy_memcpy):
11234 Really reorder the args, as was supposedly done on Feb 14 1995.
11235 (yyparse): Calls changed accordingly.
11236
112371996-05-11 Richard Stallman <rms@gnu.org>
11238
11239 * Makefile.in (dist): Don't use $(srcdir).
11240
11241 * bison.simple (__yy_memcpy):
11242 Really reorder the args, as was supposedly done on Feb 14 1995.
11243 (yyparse): Calls changed accordingly.
11244
112451996-01-27 Richard Stallman <rms@gnu.org>
11246
11247 * src/output.c (output_rule_data):
11248 Test YYERROR_VERBOSE in the conditional
11249 around the definition of ttyname.
11250
112511995-12-29 Richard Stallman <rms@gnu.org>
11252
11253 * src/bison.s1:
11254 Fix line numbers in #line commands.
11255
112561995-12-29 Richard Stallman <rms@gnu.org>
11257
11258 * bison.simple:
11259 Fix line numbers in #line commands.
11260
112611995-12-27 Richard Stallman <rms@gnu.org>
11262
11263 * src/bison.s1 (YYPARSE_PARAM_DECL):
11264 In C++, make it always null.
11265 (YYPARSE_PARAM_ARG): New macro.
11266 (yyparse): Use YYPARSE_PARAM_ARG.
11267
112681995-12-27 Richard Stallman <rms@gnu.org>
11269
11270 * bison.simple (YYPARSE_PARAM_DECL):
11271 In C++, make it always null.
11272 (YYPARSE_PARAM_ARG): New macro.
11273 (yyparse): Use YYPARSE_PARAM_ARG.
11274
112751995-11-29 Richard Stallman <rms@gnu.org>
11276
11277 * doc/bison.texinfo:
11278 Describe literal string tokens, %raw, %no_lines, %token_table.
11279
112801995-11-29 Daniel Hagerty <hag@gnu.org>
11281
11282 * doc/bison.texinfo: Fixed update date
11283
112841995-10-16 Richard Stallman <rms@gnu.org>
11285
11286 * src/version.c: Version 1.25.
11287
112881995-10-16 Richard Stallman <rms@gnu.org>
11289
11290 * NEWS: *** empty log message ***
11291
112921995-10-16 Richard Stallman <rms@gnu.org>
11293
11294 * doc/bison.1, doc/bison.rnh:
11295 Add new options.
11296
112971995-10-15 Richard Stallman <rms@gnu.org>
11298
11299 * src/vmsgetargs.c, src/getargs.c:
11300 Added -n, -k, and -raw switches.
11301 (noparserflag, toknumflag, rawtoknumflag): New variables.
11302
11303 * src/symtab.h (SALIAS):
11304 New #define for adding aliases to %token.
11305 (struct bucket): Added `alias' field.
11306
11307 * src/reduce.c (reduce_grammar):
11308 Revise error message.
11309 (print_notices): Remove final `.' from error message.
11310
11311 * src/reader.c (reader_output_yylsp):
11312 New function.
11313 (readgram): Use `#if 0' around code that accepted %command
11314 inside grammar rules: The documentation doesn't allow it,
11315 and it will fail since the %command processors scan for the next %.
11316 (parse_token_decl): Extended the %token
11317 declaration to allow a multi-character symbol as an alias.
11318 (parse_thong_decl): New function.
11319 (read_declarations): Added %thong declarations.
11320 (read_declarations): Handle NOOP to deal with allowing
11321 % declarations as another means to specify the flags.
11322 (readgram): Allow %prec prior to semantics embedded in a rule.
11323 (skip_to_char, read_declarations, copy_definition)
11324 (parse_token_decl, parse_start_decl, parse_type_decl)
11325 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
11326 (get_type_name, copy_guard, copy_action, readgram)
11327 (get_type, packsymbols): Revised most error messages.
11328 Changed `fatal' to `warnxxx' to avoid aborting for error.
11329 Revised and use multiple warnxxx functions to avoid using VARARGS1.
11330 (read_declarations): Improve the error message for
11331 an invalid character. Do not abort.
11332 (read_declarations, copy_guard, copy_action): Use
11333 printable_version to avoid unprintable characters in printed output.
11334 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
11335 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
11336 Allow the type of a non-terminal can be given
11337 more than once, as long as all specifications give the same type.
11338
11339 * src/output.c:
11340 (output_headers, output_trailers, output, output_gram)
11341 (output_rule_data): Implement noparserflag variable.
11342 Implement toknumflag variable.
11343 (output): Call reader_output_yylsp to output LTYPESTR.
11344
11345 * src/main.c (main):
11346 If reader sees an error, don't process the grammar.
11347 (fatals): Updated to not use VARARGS1.
11348 (printable_version, int_to_string, warn, warni, warns, warnss)
11349 (warnsss): New error reporting functions. Avoid abort for error.
11350
11351 * src/lex.h:
11352 Added THONG and NOOP for alias processing.
11353 Added SETOPT for the new code that allows setting options with %flags.
11354
11355 * src/lex.c:
11356 Include getopt.h. Add some extern decls.
11357 (safegetc): New function to deal with EOF gracefully.
11358 (literalchar); new function to deal with reading \ escapes.
11359 (lex): Use literalchar.
11360 (lex): Implemented "..." tokens.
11361 (literalchar, lex, parse_percent_token): Made tokenbuffer
11362 always contain the token. This includes growing the token
11363 buffer while reading an integer.
11364 (parse_percent_token): Replaced if-else statement with percent_table.
11365 (parse_percent_token): Added % declarations as another
11366 way to specify the flags -n, -l, and -r. Also added hooks for
11367 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
11368 major changes to files.c.
11369 (lex) Retain in the incoming stream a character following
11370 an incorrect '/'.
11371 (skip_white_space, lex): Revised most error messages
11372 and changed fatal to warn to avoid aborting.
11373 (percent_table): Added %thong declarations.
11374
11375 * src/gram.h: Comment changes.
11376
11377 * src/files.c (openfiles, open_extra_files, done):
11378 Add faction flag
11379 and actfile file. Handle noparserflag. Both for -n switch.
11380
11381 * src/conflicts.c (resolve_sr_conflict):
11382 Remove use of alloca.
11383
113841995-06-01 Jim Meyering <meyering@gnu.org>
11385
11386 * doc/bison.texinfo: *** empty log message ***
11387
113881995-05-06 Richard Stallman <rms@gnu.org>
11389
11390 * src/bison.s1: Comment change.
11391
113921995-05-06 Richard Stallman <rms@gnu.org>
11393
11394 * bison.simple: Comment change.
11395
113961995-05-03 Richard Stallman <rms@gnu.org>
11397
11398 * src/version.c: Version now 1.24.
11399
11400 * src/bison.s1: Change distribution terms.
11401
11402 * src/version.c: Version now 1.23.
11403
114041995-05-03 Richard Stallman <rms@gnu.org>
11405
11406 * doc/bison.texinfo:
11407 Rewrite "Conditions for Using Bison".
11408 Update version to 1.24.
11409
114101995-05-03 Richard Stallman <rms@gnu.org>
11411
11412 * bison.simple: Change distribution terms.
11413
114141995-02-23 Richard Stallman <rms@gnu.org>
11415
11416 * src/files.c: Test __VMS_POSIX as well as VMS.
11417
114181995-02-14 Jim Meyering <meyering@gnu.org>
11419
11420 * src/bison.s1 (__yy_memcpy):
11421 Renamed from __yy_bcopy to avoid
11422 confusion. Reverse FROM and TO arguments to be consistent with
11423 those of memcpy.
11424
114251995-02-14 Jim Meyering <meyering@gnu.org>
11426
11427 * bison.simple (__yy_memcpy):
11428 Renamed from __yy_bcopy to avoid
11429 confusion. Reverse FROM and TO arguments to be consistent with
11430 those of memcpy.
11431
114321994-11-10 David J. MacKenzie <djm@gnu.org>
11433
11434 * NEWS: reformat
11435
11436 * NEWS: New file.
11437
11438 * Makefile.in (DISTFILES): Include NEWS.
11439
11440 * Makefile.in (DISTFILES):
11441 Include install-sh, not install.sh.
11442
11443 * configure.in: Update to Autoconf v2 macro names.
11444
114451994-10-05 David J. MacKenzie <djm@gnu.org>
11446
11447 * Makefile.in: fix typo
11448
11449 * Makefile.in (prefix, exec_prefix):
11450 Let configure set them.
11451
114521994-09-28 David J. MacKenzie <djm@gnu.org>
11453
11454 * Makefile.in: Set datadir to $(prefix)/share.
11455
114561994-09-15 Richard Stallman <rms@gnu.org>
11457
11458 * src/bison.s1:
11459 Update copyright notice and GPL version.
11460
114611994-09-15 Richard Stallman <rms@gnu.org>
11462
11463 * bison.simple:
11464 Update copyright notice and GPL version.
11465
114661994-07-12 Richard Stallman <rms@gnu.org>
11467
11468 * src/reduce.c, src/reader.c:
11469 entered into RCS
11470
114711994-05-05 David J. MacKenzie <djm@gnu.org>
11472
11473 * Makefile.in: entered into RCS
11474
114751994-03-26 Richard Stallman <rms@gnu.org>
11476
11477 * src/bison.s1: entered into RCS
11478
114791994-03-26 Richard Stallman <rms@gnu.org>
11480
11481 * bison.simple: entered into RCS
11482
114831994-03-25 Richard Stallman <rms@gnu.org>
11484
11485 * src/main.c: entered into RCS
11486
114871994-03-24 Richard Stallman <rms@gnu.org>
11488
11489 * src/conflicts.c: entered into RCS
11490
114911994-01-02 Richard Stallman <rms@gnu.org>
11492
11493 * Makefile.in: *** empty log message ***
11494
114951993-11-21 Richard Stallman <rms@gnu.org>
11496
11497 * src/bison.s1: *** empty log message ***
11498
114991993-11-21 Richard Stallman <rms@gnu.org>
11500
11501 * doc/bison.texinfo: entered into RCS
11502
11503 * doc/bison.texinfo: *** empty log message ***
11504
115051993-11-21 Richard Stallman <rms@gnu.org>
11506
11507 * bison.simple: *** empty log message ***
11508
115091993-10-25 David J. MacKenzie <djm@gnu.org>
11510
11511 * doc/bison.texinfo: *** empty log message ***
11512
115131993-10-19 Richard Stallman <rms@gnu.org>
11514
11515 * src/bison.s1: *** empty log message ***
11516
115171993-10-19 Richard Stallman <rms@gnu.org>
11518
11519 * bison.simple: *** empty log message ***
11520
115211993-10-14 Richard Stallman <rms@gnu.org>
11522
11523 * src/bison.s1: *** empty log message ***
11524
115251993-10-14 Richard Stallman <rms@gnu.org>
11526
11527 * bison.simple: *** empty log message ***
11528
115291993-09-14 David J. MacKenzie <djm@gnu.org>
11530
11531 * doc/bison.texinfo: *** empty log message ***
11532
115331993-09-13 Noah Friedman <friedman@gnu.org>
11534
11535 * Makefile.in: *** empty log message ***
11536
115371993-09-10 Richard Stallman <rms@gnu.org>
11538
11539 * src/conflicts.c: *** empty log message ***
11540
11541 * src/system.h: entered into RCS
11542
115431993-09-10 Richard Stallman <rms@gnu.org>
11544
11545 * doc/bison.1: entered into RCS
11546
115471993-09-06 Noah Friedman <friedman@gnu.org>
11548
11549 * src/version.c: entered into RCS
11550
115511993-09-06 Noah Friedman <friedman@gnu.org>
11552
11553 * Makefile.in: *** empty log message ***
11554
115551993-07-30 David J. MacKenzie <djm@gnu.org>
11556
11557 * Makefile.in: *** empty log message ***
11558
115591993-07-24 Richard Stallman <rms@gnu.org>
11560
11561 * src/bison.s1: *** empty log message ***
11562
115631993-07-24 Richard Stallman <rms@gnu.org>
11564
11565 * bison.simple: *** empty log message ***
11566
115671993-07-08 David J. MacKenzie <djm@gnu.org>
11568
11569 * Makefile.in: *** empty log message ***
11570
115711993-07-04 Richard Stallman <rms@gnu.org>
11572
11573 * src/bison.s1: *** empty log message ***
11574
115751993-07-04 Richard Stallman <rms@gnu.org>
11576
11577 * bison.simple: *** empty log message ***
11578
115791993-06-26 David J. MacKenzie <djm@gnu.org>
11580
11581 * src/getargs.c: entered into RCS
11582
115831993-06-26 David J. MacKenzie <djm@gnu.org>
11584
11585 * doc/bison.texinfo: *** empty log message ***
11586
11587 * doc/bison.1: New file.
11588
115891993-06-25 Richard Stallman <rms@gnu.org>
11590
11591 * src/getargs.c: New file.
11592
115931993-06-16 Richard Stallman <rms@gnu.org>
11594
11595 * src/bison.s1: *** empty log message ***
11596
115971993-06-16 Richard Stallman <rms@gnu.org>
11598
11599 * bison.simple: *** empty log message ***
11600
116011993-06-03 Richard Stallman <rms@gnu.org>
11602
11603 * src/bison.s1: New file.
11604
116051993-06-03 Richard Stallman <rms@gnu.org>
11606
11607 * doc/bison.texinfo: *** empty log message ***
11608
116091993-06-03 Richard Stallman <rms@gnu.org>
11610
11611 * bison.simple: New file.
11612
116131993-05-19 Richard Stallman <rms@gnu.org>
11614
11615 * doc/bison.texinfo: New file.
11616
116171993-05-07 Noah Friedman <friedman@gnu.org>
11618
11619 * Makefile.in: *** empty log message ***
11620
116211993-04-28 Noah Friedman <friedman@gnu.org>
11622
11623 * src/reader.c: *** empty log message ***
11624
116251993-04-23 Noah Friedman <friedman@gnu.org>
11626
11627 * src/alloc.h: entered into RCS
11628
116291993-04-20 David J. MacKenzie <djm@gnu.org>
11630
11631 * src/version.c: *** empty log message ***
11632
11633 * src/files.c, src/allocate.c:
11634 entered into RCS
11635
11636 * src/reader.c: *** empty log message ***
11637
11638 * src/lex.c: entered into RCS
11639
11640 * src/conflicts.c: New file.
11641
11642 * src/symtab.c: entered into RCS
11643
11644 * src/alloc.h: New file.
11645
11646 * src/LR0.c: entered into RCS
11647
116481993-04-18 Noah Friedman <friedman@gnu.org>
11649
11650 * src/reader.c: New file.
11651
11652 * src/version.c: *** empty log message ***
11653
116541993-04-18 Noah Friedman <friedman@gnu.org>
11655
11656 * Makefile.in: *** empty log message ***
11657
116581993-04-17 Noah Friedman <friedman@gnu.org>
11659
11660 * Makefile.in: *** empty log message ***
11661
116621993-04-15 Richard Stallman <rms@gnu.org>
11663
11664 * src/main.c, src/files.c:
11665 New file.
11666
116671993-04-15 Noah Friedman <friedman@gnu.org>
11668
11669 * configure.in: entered into RCS
11670
11671 * configure.in: *** empty log message ***
11672
11673 * configure.in: New file.
11674
116751993-04-14 Richard Stallman <rms@gnu.org>
11676
11677 * Makefile.in: New file.
11678
116791993-04-13 Richard Stallman <rms@gnu.org>
11680
11681 * src/version.c: New file.
11682
116831993-03-25 Richard Stallman <rms@gnu.org>
11684
11685 * src/output.c: entered into RCS
11686
116871992-09-25 Richard Stallman <rms@gnu.org>
11688
11689 * configure.bat: entered into RCS
11690
116911992-06-22 Richard Stallman <rms@gnu.org>
11692
11693 * src/vmsgetargs.c: entered into RCS
11694
116951992-06-22 Richard Stallman <rms@gnu.org>
11696
11697 * doc/bison.rnh: entered into RCS
11698
116991992-04-20 David J. MacKenzie <djm@gnu.org>
11700
11701 * README: entered into RCS
11702
117031992-01-22 Richard Stallman <rms@gnu.org>
11704
11705 * src/machine.h: entered into RCS
11706
117071991-12-21 Richard Stallman <rms@gnu.org>
11708
11709 * src/lalr.c, src/closure.c:
11710 entered into RCS
11711
117121991-12-20 Richard Stallman <rms@gnu.org>
11713
11714 * src/state.h: entered into RCS
11715
117161991-12-18 Richard Stallman <rms@gnu.org>
11717
11718 * src/print.c, src/nullable.c, src/derives.c:
11719 entered into RCS
11720
117211991-11-03 David J. MacKenzie <djm@gnu.org>
11722
11723 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
11724 entered into RCS
11725
117261988-09-09 Richard Stallman <rms@gnu.org>
11727
11728 * src/bison.hairy: entered into RCS
11729
117301987-12-16 Richard Stallman <rms@gnu.org>
11731
11732 * REFERENCES: entered into RCS
dc546b0f 11733
f294a2c2
AD
11734-----
11735
33167b8b 11736Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
dc546b0f 117371998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
f294a2c2 11738
33167b8b 11739This file is part of Bison, the GNU Compiler Compiler.
f294a2c2 11740
33167b8b 11741Bison is free software; you can redistribute it and/or modify
f294a2c2
AD
11742it under the terms of the GNU General Public License as published by
11743the Free Software Foundation; either version 2, or (at your option)
11744any later version.
11745
33167b8b 11746Bison is distributed in the hope that it will be useful,
f294a2c2
AD
11747but WITHOUT ANY WARRANTY; without even the implied warranty of
11748MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11749GNU General Public License for more details.
11750
11751You should have received a copy of the GNU General Public License
33167b8b 11752along with Bison; see the file COPYING. If not, write to
f294a2c2
AD
11753the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
11754Boston, MA 02111-1307, USA.