]> git.saurik.com Git - bison.git/blob - ChangeLog
Don't use locations in variant.yy.
[bison.git] / ChangeLog
1 2008-11-15 Akim Demaille <demaille@gostai.com>
2
3 Don't use locations in variant.yy.
4 * examples/variant.yy: Adjust to not using locations.
5
6 2008-11-15 Akim Demaille <demaille@gostai.com>
7
8 Comment changes.
9 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
10 comments for the license.
11
12 2008-11-15 Akim Demaille <demaille@gostai.com>
13
14 Remove tests/Makefile.am.
15 * tests/Makefile.am: Rename as...
16 * tests/local.mk: this.
17 * Makefile.am, configure.ac: Adjust.
18 * Makefile.am (DISTCLEANFILES): Define.
19 (maintainer-check, maintainer-xml-check, maintainer-push-check):
20 Remove, we no longer need to bounce to the real targets.
21
22 2008-11-15 Akim Demaille <demaille@gostai.com>
23
24 Comment changes.
25
26 2008-11-15 Akim Demaille <demaille@gostai.com>
27
28 djgpp/local.mk.
29 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
30 * djgpp/local.mk: this new file.
31
32 2008-11-15 Akim Demaille <demaille@gostai.com>
33
34 Remove doc/Makefile.am.
35 * doc/Makefile.am: Rename as...
36 * doc/local.mk: this.
37 Adjust paths
38 * Makefile.am, configure.ac: Adjust.
39 * Makefile.am (MOSTLYCLEANFILES): New.
40 * src/local.mk: Adjust.
41
42 2008-11-15 Akim Demaille <demaille@gostai.com>
43
44 Move sc_tight_scope into maint.mk.
45 It does not work, and I don't know how it was supposed to work: it seems
46 to be looking for sources in the build tree. I just moved it at a better
47 place, fixing it is still required.
48
49 * src/local.mk (echo): Remove.
50 (sc_tight_scope): Move to...
51 * maint.mk: here.
52
53 2008-11-15 Akim Demaille <demaille@gostai.com>
54
55 Regen.
56 * src/parse-gram.h, src/parse-gram.h: Regen.
57
58 2008-11-15 Akim Demaille <demaille@gostai.com>
59
60 Remove src/Makefile.am.
61 * src/Makefile.am: Rename as...
62 * src/local.mk: this.
63 Prefix all the paths with src/.
64 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
65 (AM_CPPFLAGS): Find find in builddir/src.
66 (YACC): Move the flags into...
67 (AM_YFLAGS): here.
68 * maint.mk (sc_tight_scope): Disable.
69 It used to bounce to the version in src/Makefile.am which is now
70 part of this very Makefile.
71 * Makefile.am, configure.ac: Adjust.
72 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
73 include "..." to find files "here": we are no longer in src/, so
74 qualify the includes with src/.
75 * doc/Makefile.am (PREPATH): No longer include the top_builddir
76 prefix.
77 (.x.1): Adjust to be able to create src/foo from the top level
78 Makefile, instead of going bounce to src/Makefile the creation of
79 foo.
80
81 2008-11-15 Akim Demaille <demaille@gostai.com>
82
83 Remove useless variable.
84 * doc/Makefile.am (srcsrcdir): Remove.
85
86 2008-11-15 Akim Demaille <demaille@gostai.com>
87
88 Remove data/Makefile.am.
89 * data/Makefile.am: Rename as...
90 * data/local.mk: this.
91 Adjust paths.
92 * Makefile.am, configure.ac: Adjust.
93
94 2008-11-15 Akim Demaille <demaille@gostai.com>
95
96 Remove etc/Makefile.am.
97 * etc/Makefile.am: Rename as...
98 * etc/local.mk: this.
99 Adjust.
100 * Makefile.am, configure.ac: Adjust.
101
102 2008-11-15 Akim Demaille <demaille@gostai.com>
103
104 Remove examples/local.mk.
105 examples/calc++/Makefile.am might be interesting to keep as is, since
106 it is an example in itself.
107
108 * examples/Makefile.am: Rename as...
109 * examples/local.mk: this.
110 Adjust.
111 * Makefile.am, configure.ac: Adjust.
112
113 2008-11-15 Akim Demaille <demaille@gostai.com>
114
115 Remove build-aux/Makefile.am.
116 Recursive Makefiles are really way too slow, let's get rid of some of
117 them.
118
119 * build-aux/Makefile.am: Rename as...
120 * build-aux/local.mk: this.
121 Adjust paths.
122 * Makefile.am, configure.ac: Adjust.
123
124 2008-11-15 Akim Demaille <demaille@gostai.com>
125
126 Provide convenience constructors for locations and positions.
127 * data/location.cc (position::position): Accept file, line and
128 column as arguments with default values.
129 Always qualify initial line and column literals as unsigned.
130 (location::location): Provide convenience constructors.
131
132 2008-11-15 Akim Demaille <demaille@gostai.com>
133
134 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each token type.
135 Using template buys us nothing, and makes it uselessly complex to
136 construct a symbol. Besides, it could not be generalized to other
137 languages, while make_FOO would work in C/Java etc.
138
139 * data/lalr1.cc (b4_symbol_): New.
140 (b4_symbol): Use it.
141 (b4_symbol_constructor_declaration_)
142 (b4_symbol_constructor_definition_): Instead of generating
143 specializations of an overloaded template function, just generate
144 several functions whose names are forged from the token names
145 without the token.prefix.
146 (b4_symbol_constructor_declarations): Generate them for all the
147 symbols, not just by class of symbol type, now that instead of
148 specializing a function template by the token, we generate a
149 function named after the token.
150 (b4_symbol_constructor_specialization_)
151 (b4_symbol_constructor_specializations): Remove.
152 * etc/bench.pl.in: Adjust to this new API.
153
154 2008-11-13 Akim Demaille <demaille@gostai.com>
155
156 %define token.prefix.
157 Provide a means to add a prefix to the name of the tokens as output in the
158 generated files. Because of name clashes, it is good to have such a
159 prefix such as TOK_ that protects from names such as EOF, FILE etc.
160 But it clutters the grammar itself.
161
162 * data/bison.m4 (token.prefix): Empty by default.
163 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
164 * data/lalr1.cc (b4_symbol): Ditto.
165
166 2008-11-13 Akim Demaille <demaille@gostai.com>
167
168 Compute at M4 time some of the subtractions.
169 * data/lalr1.cc (b4_substract): New.
170 (b4_rhs_data): Use it.
171
172 2008-11-13 Akim Demaille <demaille@gostai.com>
173
174 symbol::token.
175 This is allows the user to get the type of a token return by
176 yylex.
177
178 * data/lalr1.cc (symbol::token): New.
179 (yytoknum_): Define when %define lex_symbol, independently of
180 %debug.
181 (yytoken_number_): Move into...
182 (symbol::token): here, since that's the only use.
183 The other one is YYPRINT which was not officially supported
184 by lalr1.cc, and anyway it did not work since YYPRINT uses this
185 array under a different name (yytoknum).
186
187 2008-11-13 Akim Demaille <demaille@gostai.com>
188
189 YYERRCODE.
190 * TODO (YYERRCODE): Mention the case of $undef.
191
192 2008-11-13 Akim Demaille <demaille@gostai.com>
193
194 TODO: YYPRINT.
195 * TODO (YYPRINT): New.
196
197 2008-11-13 Akim Demaille <demaille@gostai.com>
198
199 Comment changes.
200 * data/lalr1.cc, data/yacc.c: Fix the description of the
201 yytranslate and yytoknum tables.
202
203 2008-11-13 Akim Demaille <demaille@gostai.com>
204
205 Define make_symbol in the header.
206 To reach good performances these functions should be inlined (yet this is
207 to measure precisely). To this end they must be available to the caller.
208
209 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
210 location_type with the class name.
211 Since will now be output in the header, declare "inline".
212 No longer use b4_symbol_constructor_specializations, but
213 b4_symbol_constructor_definitions in the header.
214 Don't call it in the *.cc file.
215
216 2008-11-13 Akim Demaille <demaille@gostai.com>
217
218 Define yytranslate in the header for lex_symbol.
219 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
220 into the header file when using %define lex_symbol.
221 (yytranslate_): Declare inline.
222
223 2008-11-13 Akim Demaille <demaille@gostai.com>
224
225 Define the constructors of symbol_type in b4_symbol_constructor_definitions.
226 The constructors are called by the make_symbol functions, which a
227 forthcoming patch will move elsewhere. Hence the interest of putting them
228 together.
229
230 The stack_symbol_type does not need to be moved, it is used only by the
231 parser.
232
233 * data/lalr1.cc: Move symbol_type and symbol_base_type
234 constructors into...
235 (b4_symbol_constructor_definitions): here.
236 Adjust.
237
238 2008-11-13 Akim Demaille <demaille@gostai.com>
239
240 Make it easier to move the definition of yytranslate_.
241 Forthcoming changes will make it possible to use yytranslate_
242 from outside the parser implementation file.
243
244 * data/lalr1.cc (b4_yytranslate_definition): New.
245 Use it.
246
247 2008-11-13 Akim Demaille <demaille@gostai.com>
248
249 Remove useless class specification.
250 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
251 to refer to the class name to use a type defined by the class for
252 arguments of member functions.
253
254 2008-11-13 Akim Demaille <demaille@gostai.com>
255
256 Finer input type for yytranslate.
257 This patch is debatable: the tradition expects yylex to return an int
258 which happens to correspond to token_number (which is an enum). This
259 allows for instance to return characters (such as '*' etc.). But this
260 goes against the stronger typing I am trying to have with the new
261 lex interface which return a symbol_type. So in this case, feed
262 yytranslate_ with a token_type.
263
264 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
265 expect a token_type.
266
267 2008-11-13 Akim Demaille <demaille@gostai.com>
268
269 Honor lex-params in %define lex_symbol mode.
270 * data/lalr1.cc: Use b4_lex_param.
271
272 2008-11-13 Akim Demaille <demaille@gostai.com>
273
274 Simplify names.
275 * src/output.c (symbol_definitions_output): Rename symbol
276 attributes type_name and has_type_name as type and has_type.
277 * data/lalr1.cc: Adjust uses.
278
279 2008-11-13 Akim Demaille <demaille@gostai.com>
280
281 Use b4_type_names for the union type.
282 The union used to compute the size of the variant used to iterate over the
283 type of all the symbols, with a lot of redundancy. Now iterate over the
284 lists of symbols having the same type-name.
285
286 * data/lalr1.cc (b4_char_sizeof_): New.
287 (b4_char_sizeof): Use it.
288 Adjust to be called with a list of numbers instead of a single
289 number.
290 Adjust its caller for new-line issues.
291
292 2008-11-13 Akim Demaille <demaille@gostai.com>
293
294 Define the "identifier" of a symbol.
295 Symbols may have several string representations, for instance if they
296 have an alias. What I call its "id" is a string that can be used as
297 an identifier. May not exist.
298
299 Currently the symbols which have the "tag_is_id" flag set are those that
300 don't have an alias. Look harder for the id.
301
302 * src/output.c (is_identifier): Move to...
303 * src/symtab.c (is_identifier): here.
304 * src/symtab.h, src/symtab.c (symbol_id_get): New.
305 * src/output.c (symbol_definitions_output): Use it to define "id"
306 and "has_id".
307 Remove the definition of "tag_is_id".
308 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
309 "tag_is_id" were used to produce code.
310 We still use "tag" for documentation.
311
312 2008-11-11 Akim Demaille <demaille@gostai.com>
313
314 Locations are no longer required by lalr1.cc.
315 * data/lalr1.cc (_b4_args, b4_args): New.
316 Adjust all uses of locations to make them optional.
317 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
318 (AT_CHECK_NAMESPACE): Check the use of locations.
319 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
320 without locations with lalr1.cc.
321 Test these cases.
322 * tests/output.at: Check lalr1.cc with and without location
323 support.
324 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
325 Don't use locations.
326
327 2008-11-11 Akim Demaille <demaille@gostai.com>
328
329 AT_FULL_COMPILE.
330 * tests/local.at (AT_FULL_COMPILE): New.
331 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
332
333 2008-11-11 Akim Demaille <demaille@gostai.com>
334
335 Support parens in calc++.
336 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
337 * examples/calc++/test (run): Check the expected output.
338 Adjust callers.
339 Check parens too.
340
341 2008-11-11 Akim Demaille <demaille@gostai.com>
342
343 Simplify lalr1.cc since %defines is mandatory.
344 * data/lalr1.cc: Remove useless calls to b4_defines_if.
345
346 2008-11-11 Akim Demaille <demaille@gostai.com>
347
348 TODO: yyfmt.
349 * TODO (yysyntax_error): New item.
350
351 2008-11-11 Akim Demaille <demaille@gostai.com>
352
353 Prefer M4 to CPP.
354 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
355 YYERROR_VERBOSE.
356
357 2008-11-11 Akim Demaille <demaille@gostai.com>
358
359 Support i18n of the parse error messages.
360 * TODO (lalr1.cc/I18n): Remove.
361 * data/lalr1.cc (yysyntax_error_): Support the translation of the
362 error messages, as done in yacc.c.
363 Stay within the yy* pseudo namespace.
364
365 2008-11-11 Akim Demaille <demaille@gostai.com>
366
367 More TODO.
368 * TODO (single stack, yysyntax_error): New.
369
370 2008-11-11 Akim Demaille <demaille@gostai.com>
371
372 Make it possible to return a symbol_type from yylex.
373 * data/lalr1.cc (b4_lex_symbol_if): New.
374 (parse): When lex_symbol is defined, expected yylex to return the
375 complete lookahead.
376 * etc/bench.pl.in (generate_grammar_list): Extend to support this
377 yylex interface.
378 (bench_variant_parser): Exercise it.
379
380 2008-11-11 Akim Demaille <demaille@gostai.com>
381
382 Remove useless bench case.
383 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
384 no longer used.
385
386 2008-11-11 Akim Demaille <demaille@gostai.com>
387
388 Improve display of directives.
389 * etc/bench.pl.in (parse_term): Don't add useless eol.
390
391 2008-11-11 Akim Demaille <demaille@gostai.com>
392
393 Use string_cast in the bench.
394 * etc/bench.pl.in (generate_grammar_list): Define and use
395 string_cast.
396
397 2008-11-11 Akim Demaille <demaille@gostai.com>
398
399 Replace yychar with a Boolean.
400 * data/lalr1.cc (parse::yychar): Replace by...
401 (parse::yyempty): this.
402
403 2008-11-11 Akim Demaille <demaille@gostai.com>
404
405 Factor the tables.
406 * TODO: New item.
407
408 2008-11-11 Akim Demaille <demaille@gostai.com>
409
410 Let yytranslate handle the eof case.
411 * data/lalr1.cc (yytranslate_): Handle the EOF case.
412 Adjust callers.
413 No longer expect yychar to be equal to yyeof_, rather, test the
414 lookahead's (translated) kind.
415
416 2008-11-11 Akim Demaille <demaille@gostai.com>
417
418 yychar cannot be empty in yyerrlab.
419 * TODO (yychar == yyempty_): New.
420 * data/lalr1.cc: Remove the handling of this case.
421 This eases forthcoming changes related to yychar and yytranslate.
422
423 2008-11-11 Akim Demaille <demaille@gostai.com>
424
425 Bench: syntactic sugar for %define/#define.
426 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
427 (&bench_push_parser, bench_variant_parser): Use this feature.
428 (&eat): New.
429 Use it.
430
431 2008-11-11 Akim Demaille <demaille@gostai.com>
432
433 Less memory pressure on the "list" bench.
434 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
435 the values, to limit memory pressure.
436
437 2008-11-11 Akim Demaille <demaille@gostai.com>
438
439 Introduce make_symbol.
440 make_symbol provides a means to construct a full symbol (kind, value,
441 location) in a single shot. It is meant to be a Symbol constructor,
442 parameterized by the symbol kind so that overloading would prevent
443 incorrect kind/value pairs. Unfortunately parameterized constructors do
444 not work well in C++ (unless the parameter also appears as an argument,
445 which is not acceptable), hence the use of a function instead of a
446 constructor.
447
448 * data/lalr1.cc (b4_symbol_constructor_declaration_)
449 (b4_symbol_constructor_declarations)
450 (b4_symbol_constructor_specialization_)
451 (b4_symbol_constructor_specializations)
452 (b4_symbol_constructor_definition_)
453 (b4_symbol_constructor_definitions): New.
454 Use them where appropriate to generate declaration, declaration of
455 the specializations, and implementations of the templated
456 overloaded function "make_symbol".
457 (variant::variant): Always define a default ctor.
458 Also provide a copy ctor.
459 (symbol_base_type, symbol_type): New ctor overloads for value-less
460 symbols.
461 (symbol_type): Now public, so that functions such as yylex can use
462 it.
463
464 2008-11-11 Akim Demaille <demaille@gostai.com>
465
466 Inform m4 whether a tag is a valid id.
467 * src/output.c (is_identifier): New.
468 (symbol_definitions_output): Use it to define tag_is_id.
469 But maybe this should be done at m4 level?
470
471 2008-11-11 Akim Demaille <demaille@gostai.com>
472
473 Test 214 was failing: it greps with a pattern containing [ ]*
474 which obviously meant to catch spaces and tabs, but contained only
475 spaces. Tabulations in sources are a nuisance, so to simplify the
476 matter, get rid of all the tabulations in the Java sources. The
477 other skeletons will be treated equally later.
478
479 * data/java.m4, data/lalr1.java: Untabify.
480 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
481 tabulations are no longer generated.
482
483 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
484
485 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
486 * configure.ac: Adjust usage.
487 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
488 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
489 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
490
491 2008-11-10 Di-an Jan <dianj@freeshell.org>
492
493 Workaround Java's ``code too large'' problem for parser tables
494 in most cases, by using one function per initialization.
495 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
496 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
497 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
498 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
499 (yytname_): Use b4_typed_parser_table.
500 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
501 ``code too large'' error.
502
503 2008-11-10 Di-an Jan <dianj@freeshell.org>
504
505 * NEWS: Document them.
506
507 General Java skeleton improvements.
508 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
509 using gcj < 4.3 in the testsuite, according to comments in
510 gnulib/m4/javacomp.m4.
511 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
512 location_type, position_type): Remove extraneous brackets from
513 b4_percent_define_default.
514 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
515 m4_define and m4_define_default.
516 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
517 which marks the end of user code with appropriate syncline, like all
518 the other skeletons.
519 (b4_user_post_prologue): Add. Don't silently drop.
520 (yylex): Remove.
521 (parse): Inline yylex.
522 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
523 (%{...%}): Fix typo of %code imports.
524 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
525
526 Support annotations on parser class with %define annotations.
527 * data/lalr1.java (annotations): Add to parser class modifier.
528 * doc/bison.texinfo (Java Parser Interface): Document
529 %define annotations.
530 (Java Declarations Summary): Document %define annotations.
531 * tests/java.at (Java parser class modifiers): Test annotations.
532
533 Do not generate code for %error-verbose unless requested.
534 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
535 Make private. Make conditional on %error-verbose.
536 (getErrorVerbose, setErrorVerbose): New.
537 (yytnamerr_): Make conditional on %error-verbose.
538 (yysyntax_error): Make some code conditional on %error-verbose.
539 * doc/bison.texinfo (Java Bison Interface): Remove the parts
540 about %error-verbose having no effect.
541 (getErrorVerbose, setErrorVerbose): Document.
542
543 Move constants for token names to Lexer interface.
544 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
545 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
546 (parse): Qualify EOF to Lexer.EOF.
547 * doc/bison.texinfo (Java Parser Interface): Move documentation of
548 EOF and token names to Java Lexer Interface.
549 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
550
551 Make yyerror public.
552 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
553 (yyerror): Change to public. Add Javadoc comments. Use longer
554 parameter names. Make the body rather than the declarator
555 conditional on %locations.
556 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
557
558 Allow user to add code to the constructor with %code init.
559 * data/java.m4 (b4_init_throws): New, for %define init_throws.
560 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
561 Add %code init to the front of the constructor body.
562 * doc/bison.texinfo (YYParser.YYParser): Document %code init
563 and %define init_throws.
564 (Java Declarations Summary): Document %code init and
565 %define init_throws.
566 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
567 (Java constructor init and init_throws): Add tests.
568
569 2008-11-10 Akim Demaille <demaille@gostai.com>
570
571 Update TODO.
572 * TODO (-D): is implemented.
573 (associativity): Same precedence must have the same associativity.
574 For instance, how can a * b / c be parsed if * is %left and / is
575 %right?
576 (YYERRORCODE, YYFAIL, YYBACKUP): New.
577
578 2008-11-10 Akim Demaille <demaille@gostai.com>
579
580 Formatting changes.
581
582 2008-11-10 Akim Demaille <demaille@gostai.com>
583
584 More information about the symbols.
585 * src/output.c (type_names_output): Document all the symbols,
586 including those that don't have a type-name.
587 (symbol_definitions_output): Define "is_token" and
588 "has_type_name".
589 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
590 type-name, now that they are defined too in b4_type_names.
591
592 2008-11-10 Akim Demaille <demaille@gostai.com>
593
594 Regen.
595
596 2008-11-10 Akim Demaille <demaille@gostai.com>
597
598 Make parser::yytranslate static.
599 Small speedup (1%) on the list grammar. And makes yytranslate_ available
600 in non member functions.
601
602 * data/lalr1.cc (yytranslate_): Does not need to be a instance
603 function.
604
605 2008-11-10 Akim Demaille <demaille@gostai.com>
606
607 Avoid trailing spaces.
608 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
609 * data/lalr1.cc: Don't indent before rule and symbol actions, as
610 they can be empty, and anyway this incorrectly indents the first
611 action.
612
613 2008-11-10 Akim Demaille <demaille@gostai.com>
614
615 Comment changes.
616
617 2008-11-10 Akim Demaille <demaille@gostai.com>
618
619 Use "enum" for integral constants.
620 This is just nicer to read, I observed no speedup.
621
622 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
623 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
624 (yyuser_token_number_max_, yyundef_token_): Move into...
625 (yytranslate_): here.
626
627 2008-11-10 Akim Demaille <demaille@gostai.com>
628
629 Shortcuts in bench directives.
630 * etc/bench.pl.in (parse_dirs): New.
631 Use it.
632 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
633 Create the benches in "benches/".
634
635 2008-11-10 Akim Demaille <demaille@gostai.com>
636
637 Formatting changes.
638 * data/lalr1.cc: here.
639
640 2008-11-10 Akim Demaille <demaille@gostai.com>
641
642 Adjust verbose message to using emacs.
643 * etc/bench.pl.in: Inform compilation-mode when we change the
644 directory.
645 (generate_grammar_list): Recognize %define "variant" in addition
646 to %define variant.
647
648 2008-11-10 Akim Demaille <demaille@gostai.com>
649
650 Classify symbols by type-name.
651 * src/uniqstr.h (UNIQSTR_CMP): New.
652 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
653 (type_names_output): New.
654 (muscles_output): Use it.
655 * data/lalr1.cc (b4_symbol_action_): Remove.
656 (b4_symbol_case_, b4_type_action_): New.
657 Adjust uses of b4_symbol_action_ to use b4_type_action_.
658
659 2008-11-10 Akim Demaille <demaille@gostai.com>
660
661 Change the handling of the symbols in the skeletons.
662 Before we were using tables which lines were the symbols and which
663 columns were things like number, tag, type-name etc. It is was
664 difficult to extend: each time a column was added, all the numbers had
665 to be updated (you asked for colon $2, not for "tag"). Also, it was
666 hard to filter these tables when only a subset of the symbols (say the
667 tokens, or the nterms, or the tokens that have and external number
668 *and* a type-name) was of interest.
669
670 Now instead of monolithic tables, we define one macro per cell. For
671 instance "b4_symbol(0, tag)" is a macro name which contents is
672 self-decriptive. The macro "b4_symbol" provides easier access to
673 these cells.
674
675 * src/output.c (type_names_output): Remove.
676 (symbol_numbers_output, symbol_definitions_output): New.
677 (muscles_output): Call them.
678 (prepare_symbols): Define b4_symbols_number.
679
680 2008-11-10 Akim Demaille <demaille@gostai.com>
681
682 --trace=muscles
683 * src/getargs.h, src/getargs.c (trace_muscle): New.
684 (trace_types, trace_args): Support it.
685 * src/output.c (output_skeleton): Use it.
686
687 2008-11-10 Akim Demaille <demaille@gostai.com>
688
689 muscles_output.
690 * src/output.c (muscles_output): New, extracted from...
691 (output_skeleton): here.
692 Adjust.
693
694 2008-11-10 Akim Demaille <demaille@gostai.com>
695
696 Formatting changes.
697
698 2008-11-10 Akim Demaille <demaille@gostai.com>
699
700 Update the variant example.
701 * examples/variant.yy: Formatting changes.
702 One stage build.
703
704 2008-11-10 Akim Demaille <demaille@gostai.com>
705
706 Support constructor with an argument.
707 This improves the "list" bench by 2%.
708
709 * data/lalr1.cc (variant::build): Add an overloaded version with
710 an argument.
711 * tests/c++.at (AT_CHECK_VARIANT): Check it.
712
713 2008-11-10 Akim Demaille <demaille@gostai.com>
714
715 Test variants.
716 * tests/c++.at (AT_CHECK_VARIANTS): New.
717 Use it with and without %define assert.
718
719 2008-11-10 Akim Demaille <demaille@gostai.com>
720
721 Add %precedence support.
722 Unfortunately it is not possible to reuse the %prec directive. This
723 is because to please POSIX, we do not require to end the rules with a
724 semicolon. As a result,
725
726 foo: bar %prec baz
727
728 is ambiguous: either a rule which precedence is that of baz, or a rule,
729 and then a declaration of the precedence of the token baz.
730
731 * doc/bison.texinfo: Document %precedence.
732 (Precedence Only): New.
733 * src/assoc.h, src/assoc.c (precedence_assoc): New.
734 * src/conflicts.c (resolve_sr_conflict): Support it.
735 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
736 Parse it.
737 * tests/calc.at: Use %precedence for NEG.
738 * tests/conflicts.at (%precedence does not suffice)
739 (%precedence suffices): New tests.
740
741 2008-11-09 Akim Demaille <demaille@gostai.com>
742
743 Make benches in a sub dirs.
744 * etc/bench.pl.in ($dir): New.
745 Use it.
746 Check the use of constructors with an argument.
747 (bench_variant_parser): Fix.
748
749 2008-11-09 Akim Demaille <demaille@gostai.com>
750
751 fix eof condition
752
753 2008-11-09 Akim Demaille <demaille@gostai.com>
754
755 Fix --help.
756
757 2008-11-09 Akim Demaille <demaille@gostai.com>
758
759 Require the generation of parse-gram.output.
760 * src/Makefile.am (YACC): Pass --report=all.
761
762 2008-11-09 Akim Demaille <demaille@gostai.com>
763
764 Formatting changes.
765
766 2008-11-09 Akim Demaille <demaille@gostai.com>
767
768 Update TODO.
769 * TODO: Remove obsolete items.
770 Update others.
771
772 2008-11-09 Akim Demaille <demaille@gostai.com>
773
774 Enhance bench.pl.
775 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
776 (@token, $grammar, $bench): New.
777 (generate_grammar_variant): Rename as...
778 (generate_grammar_list): this.
779 (generate_grammar): Adjust.
780 (bench_grammar): Rename as...
781 (bench): this.
782 Use it in the various bench-marking routines.
783 (-b, -g): New options.
784
785 2008-11-09 Akim Demaille <demaille@gostai.com>
786
787 Use a static hierarchy for symbols in the C++ parser.
788 * data/lalr1.cc (symbol_base_type, symbol_type)
789 (stack_symbol_type): Make it a static hierarchy.
790 Adjust dependencies.
791
792 2008-11-09 Akim Demaille <demaille@gostai.com>
793
794 bench.pl -d, --directive.
795 * etc/bench.pl.in (@directive): New.
796 (&bench_grammar): Use it.
797 (&bench_list_grammar): New, to provide access to the "variant"
798 grammar.
799 Use it.
800 (getopts): Support -d, --directive.
801
802 2008-11-09 Akim Demaille <demaille@gostai.com>
803
804 Use inline for small operations.
805 * data/lalr1.cc (symbol_base_type, symbol_type)
806 (stack_symbol_type): Declare constructor and other operations as
807 inline.
808 (yy_destroy_): Inline.
809
810 2008-11-09 Akim Demaille <demaille@gostai.com>
811
812 Introduce a hierarchy for symbols.
813 * data/lalr1.cc (symbol_base_type, symbol_type): New.
814 (data_type): Rename as...
815 (stack_symbol_type): this.
816 Derive from symbol_base_type.
817 (yy_symbol_value_print_): Merge into...
818 (yy_symbol_print_): this.
819 Rename as...
820 (yy_print_): this.
821 (yydestruct_): Rename as...
822 (yy_destroy_): this.
823 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
824 (parser::parse): yyla is now of symbol_type.
825 Use its type member instead of yytoken.
826
827 2008-11-09 Akim Demaille <demaille@gostai.com>
828
829 Rename data_type and stack_symbol_type.
830 * data/lalr1.cc (data_type): Rename as...
831 (stack_symbol_type): this.
832
833 2008-11-09 Akim Demaille <demaille@gostai.com>
834
835 Handle semantic value and location together.
836 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
837 yydata.value and yydata.location.
838 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
839 (YY_SYMBOL_PRINT): Now take semantic value and location as a
840 single arg.
841 Adjust all callers.
842 (yydestruct_): New overload for a stack symbol.
843
844 2008-11-09 Akim Demaille <demaille@gostai.com>
845
846 Push a complete symbol, not connected parts.
847 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
848 state, value and location.
849 Adjust callers.
850
851 2008-11-09 Akim Demaille <demaille@gostai.com>
852
853 Agregate yylval and yylloc.
854 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
855 (parser::yyla): this.
856
857 2008-11-09 Akim Demaille <demaille@gostai.com>
858
859 Rely on the state stack to display reduction traces.
860 To display rhs symbols before a reduction, we used information about the rule
861 reduced, which required the tables yyrhs and yyprhs. Now use rely only on the
862 state stack to get the same information.
863
864 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
865 Use them.
866 (parser::yyrhs_, parser::yyprhs_): Remove.
867 (parser::yy_reduce_print_): Use the state stack.
868
869 2008-11-09 Akim Demaille <demaille@gostai.com>
870
871 Fuse yyval and yyloc into yylhs.
872 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
873 yylhs.
874 (parse): Replace yyval and yyloc with yylhs.value and
875 yylhs.location.
876 After a user action, compute yylhs.state earlier.
877 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
878 fresh error_token.
879
880 2008-11-09 Di-an Jan <dianj@freeshell.org>
881
882 Remove unused variable.
883 * src/output.c (type_names_output): Remove unused variable sep.
884
885 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
886
887 Change tests/output.at quoting.
888 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
889 expanding arguments.
890
891 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
892
893 Don't add a semicolon to actions for %skeleton or %language.
894 It breaks Java test cases as reported by Akim Demaille.
895 * src/scan-code.l: Implement.
896
897 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
898
899 Clean up %skeleton and %language priority implementation.
900 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
901 remove static qualifier because others will soon need to see it.
902 (language_prio): Likewise.
903 (getargs): Use command_line_prio rather than 0.
904 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
905 enum fields.
906 (skeleton_prio): Extern it.
907 (language_prio): Extern it.
908 * src/parse-gram.y: Use grammar_prio rather than 1.
909
910 2008-11-07 Akim Demaille <demaille@gostai.com>
911
912 Moving push traces into yypush_.
913 * data/lalr1.cc (yypush_): Now takes a optional trace message.
914 Adjust all uses.
915
916 2008-11-07 Akim Demaille <demaille@gostai.com>
917
918 The single-stack C++ parser is now the standard one.
919 * data/lalr1.cc: Rename as...
920 * data/lalr1-split.cc: this.
921 * data/lalr1-fusion.cc: Rename as...
922 * data/lalr1.cc: this.
923 * etc/bench.pl.in: Adjust.
924
925 2008-11-07 Akim Demaille <demaille@gostai.com>
926
927 Avoid empty-if warnings.
928 Reported by Quentin Hocquet.
929
930 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
931 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
932
933 2008-11-07 Akim Demaille <demaille@gostai.com>
934
935 Pass command line location to skeleton_arg and language_argmatch.
936 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
937 The location argument is now mandatory.
938 Adjust all dependencies.
939 (getargs): Use command_line_location.
940
941 2008-11-07 Akim Demaille <demaille@gostai.com>
942
943 -D, --define.
944 * src/getargs.c (usage): Document -D.
945 Fix help string for --locations.
946 (command_line_location): New.
947 (short_options, long_options, getargs): Support -D, --define.
948 (getargs): Move -d support at the right place.
949 * doc/bison.texinfo (Bison Options): Update.
950 * tests/input.at (%define, --define): New.
951
952 2008-11-07 Akim Demaille <demaille@gostai.com>
953
954 Initialize the muscle table before parsing the command line.
955 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
956 (getargs): Define file_name.
957 * src/main.c (main): Initialize muscle_tab before calling
958 getargs.
959 * src/muscle_tab.c (muscle_init): No longer define file_name, as
960 its value is not available yet.
961
962 2008-11-07 Akim Demaille <demaille@gostai.com>
963
964 Locations without columns for command line arguments.
965 * src/location.c (location_print): Don't display negative columns.
966 * src/location.h: Document this.
967
968 2008-11-07 Akim Demaille <demaille@gostai.com>
969
970 Fix --help.
971 * src/getargs.c (usage): Fix help string for -W.
972
973 2008-11-07 Akim Demaille <demaille@gostai.com>
974
975 Handle more general types of option arguments.
976 * build-aux/cross-options.pl: The argument ends at the first
977 space, not the first non-symbol character.
978 Use @var for each word appearing the argument description.
979
980 2008-11-07 Akim Demaille <demaille@gostai.com>
981
982 Destroy the variants that remain on the stack in case of error.
983 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
984 destructor.
985 Display the value only if yymsg is nonnull.
986 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
987
988 2008-11-07 Akim Demaille <demaille@gostai.com>
989
990 Add "%define assert" to variants.
991 This is used to help the user catch cases where some value gets
992 ovewritten by a new one. This should not happen, as this will
993 probably leak.
994
995 Unfortunately this uncovered a bug in the C++ parser itself: the
996 lookahead value was not destroyed between two calls to yylex. For
997 instance if the previous lookahead was a std::string, and then an int,
998 then the value of the std::string was correctly taken (i.e., the
999 lookahead was now an empty string), but std::string structure itself
1000 was not reclaimed.
1001
1002 This is now done in variant::build(other&) (which is used to take the
1003 value of the lookahead): other is not only stolen from its value, it
1004 is also destroyed. This incurs a new performance penalty of a few
1005 percent, and union becomes faster again.
1006
1007 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
1008 (b4_variant_if): New.
1009 (variant::built): New.
1010 Use it whereever the status of the variant changes.
1011 * etc/bench.pl.in: Check the penalty of %define assert.
1012
1013 2008-11-07 Akim Demaille <demaille@gostai.com>
1014
1015 Use "%define variant" in bench.pl.
1016 * etc/bench.pl.in: No longer use the pseudo directive %variants,
1017 just use %define variants.
1018
1019 2008-11-07 Akim Demaille <demaille@gostai.com>
1020
1021 Regen.
1022 * src/parse-gram.h, src/parse-gram.c: Regen.
1023
1024 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1025
1026 Fix user actions without a trailing semicolon.
1027 Reported by Sergei Steshenko at
1028 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1029 * THANKS (Sergei Steshenko): Add.
1030 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1031 * tests/regression.at (Fix user actions without a trailing semicolon):
1032 New test case.
1033
1034 2008-11-04 Akim Demaille <demaille@gostai.com>
1035
1036 Use b4_copyright_years.
1037 * data/yacc.c (b4_copyright_years): New.
1038 Fix its value according to the comments in the file.
1039 Use it and undefine it.
1040
1041 2008-11-04 Akim Demaille <demaille@gostai.com>
1042
1043 Formatting changes.
1044 * data/lalr1-fusion.cc, src/parse-gram.y: here.
1045
1046 2008-11-04 Akim Demaille <demaille@gostai.com>
1047
1048 Formatting changes.
1049 * data/lalr1-fusion.cc: here.
1050
1051 2008-11-04 Akim Demaille <demaille@gostai.com>
1052
1053 Use strict on bench.pl.
1054 * etc/bench.pl.in (&run, &generate_grammar): New.
1055 Rename the grammar generating functions for consistency.
1056 Change the interface so that the list of benches to run is passed
1057 as (optionless) arguments.
1058 (&compile): Use &run.
1059
1060 2008-11-04 Akim Demaille <demaille@gostai.com>
1061
1062 Remove spurious initial empty lines.
1063 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1064 * data/yacc.c: End the @output lines with an @.
1065
1066 2008-11-04 Akim Demaille <demaille@gostai.com>
1067
1068 Improve the display of sizes.
1069 * etc/bench.p.in: Higher precision.
1070 Sort by decreasing size.
1071
1072 2008-11-04 Akim Demaille <demaille@gostai.com>
1073
1074 Don't memcpy C++ structures.
1075 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
1076 arguments.
1077 (variant::build): New overload for
1078 copy-construction-that-destroys.
1079 (variant::swap): New.
1080 (parser::yypush_): Use it in variant mode.
1081
1082 2008-11-04 Akim Demaille <demaille@gostai.com>
1083
1084 Better defaults for bench.pl.
1085 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
1086 default values.
1087 Adjust &verbose uses.
1088 (-q, --quiet): New.
1089
1090 2008-11-04 Akim Demaille <demaille@gostai.com>
1091
1092 Make variant.yy more complex.
1093 std::list cannot be copied via memcpy, they are more demanding than
1094 std::string. Use one std::list to strengthen the test.
1095
1096 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
1097 Adjust.
1098 Create a list of strings, instead of a single large string.
1099
1100 2008-11-04 Akim Demaille <demaille@gostai.com>
1101
1102 bench.pl --bench.
1103 * etc/bench.pl.in (--bench, $bench): New.
1104
1105 2008-11-04 Akim Demaille <demaille@gostai.com>
1106
1107 Sort methods.
1108 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
1109 Define it after as().
1110
1111 2008-11-04 Akim Demaille <demaille@gostai.com>
1112
1113 Useless parens.
1114 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
1115
1116 2008-11-04 Akim Demaille <demaille@gostai.com>
1117
1118 Issue missing synclines after user actions.
1119 * data/c.m4 (b4_case): Issue synclines on the output file.
1120
1121 2008-11-04 Akim Demaille <demaille@gostai.com>
1122
1123 Remove trailing empty line.
1124 * data/lalr1-fusion.cc: Don't add an empty line after the user's
1125 epilogue.
1126
1127 2008-11-04 Akim Demaille <demaille@gostai.com>
1128
1129 Fix output of copyright years.
1130 * data/bison.m4 (b4_copyright): Fix the indentation of the
1131 copyright year paragraph.
1132 Use b4_copyright_years when no years are given.
1133 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
1134 (b4_copyright_years): New.
1135 Use it.
1136
1137 2008-11-04 Akim Demaille <demaille@gostai.com>
1138
1139 Avoid the spurious initial empty line.
1140 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
1141 the end of @output request to suppress the empty line that
1142 results.
1143
1144 2008-11-04 Akim Demaille <demaille@gostai.com>
1145
1146 Remove parser::rhs_number_type.
1147 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
1148 (yyrhs_): Use b4_table_define.
1149
1150 2008-11-04 Akim Demaille <demaille@gostai.com>
1151
1152 Fix iteration type.
1153 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
1154
1155 2008-11-04 Akim Demaille <demaille@gostai.com>
1156
1157 Factor the declaration of the integer tables.
1158 * data/lalr1-fusion.cc (b4_table_define): New.
1159 Use it.
1160
1161 2008-11-03 Akim Demaille <demaille@gostai.com>
1162
1163 Fix indentation of tables in lalr1.cc
1164 * data/lalr1-fusion.cc: Fix the indentation.
1165
1166 2008-11-03 Akim Demaille <demaille@gostai.com>
1167
1168 Destroy the lhs symbols after reduction.
1169 * data/lalr1-fusion.cc (parse): After the user action, when in
1170 variant mode, destroy the lhs symbols.
1171
1172 2008-11-03 Akim Demaille <demaille@gostai.com>
1173
1174 Simplify yysyntax_error_ use.
1175 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
1176 type, but make it unnamed in the declaration when it is not used.
1177
1178 2008-11-03 Akim Demaille <demaille@gostai.com>
1179
1180 Let yy::variant::build return an lvalue.
1181 * data/lalr1-fusion.cc (variant::build): Return a reference to the
1182 object.
1183
1184 2008-11-03 Akim Demaille <demaille@gostai.com>
1185
1186 Define yy::variant only when needed.
1187 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
1188 used.
1189
1190 2008-11-03 Akim Demaille <demaille@gostai.com>
1191
1192 Bench the three-stack lalr1.cc.
1193 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
1194 one-stack one.
1195
1196 2008-11-03 Akim Demaille <demaille@gostai.com>
1197
1198 Fail on parse error in calc++.
1199 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
1200 status.
1201 * examples/calc++/test ($me, $number, $exit, run): New.
1202 Use them to propagate errors to the exit status.
1203
1204 2008-11-03 Akim Demaille <demaille@gostai.com>
1205
1206 Don't specify the skeleton twice in the example.
1207 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
1208 file does what is needed.
1209
1210 2008-11-03 Akim Demaille <demaille@gostai.com>
1211
1212 bench: Improve output.
1213 * etc/bench.pl.in (bench_grammar): Tune the printf format.
1214
1215 2008-11-03 Akim Demaille <demaille@gostai.com>
1216
1217 bench: check impact of %debug on variants.
1218 * etc/bench.pl.in (variant_grammar): Fix the computation of
1219 $variant.
1220 Generate a grammar file that can work with or without %debug.
1221 Do use the @directive.
1222 (bench_variant_parser): Check impact of %debug.
1223 (@directives): Rename all the occurrences to...
1224 (@directive): this, for consistency.
1225
1226 2008-11-03 Akim Demaille <demaille@gostai.com>
1227
1228 bench: report the size too.
1229 * etc/bench.pl.in ($iterations): Defaults to -3.
1230 (&bench_grammar): Require hireswallclock.
1231 Compute and display the size of the result.
1232 More comments.
1233
1234 2008-11-03 Akim Demaille <demaille@gostai.com>
1235
1236 bench: More use of the verbosity level.
1237 * etc/bench.pl.in ($verbose, &verbose): New.
1238 Use them.
1239 More POD documentation.
1240
1241 2008-11-03 Akim Demaille <demaille@gostai.com>
1242
1243 bench.pl: a command line interface
1244 * etc/bench.pl.in: More doc.
1245 Some fixes in the documentation.
1246 ($cflags, $iterations, &help, &getopt): New.
1247 Use them.
1248 (&variant_grammar): Let the number of stages be 10 times what is
1249 specified.
1250
1251 2008-11-03 Akim Demaille <demaille@gostai.com>
1252
1253 Bench the use of Boost.Variants.
1254 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
1255 New.
1256 (&compile): Be ready to compile C++ parsers.
1257 (&bench_push_parser): Move debug information to the outermost
1258 level.
1259 * THANKS: Add Michiel De Wilde.
1260
1261 2008-11-03 Akim Demaille <demaille@gostai.com>
1262
1263 bench.pl: Pass directives as a list instead of as a string.
1264 * etc/bench.pl.in (&directives): New.
1265 (&triangular_grammar, &calc_grammar): Use it to format the Bison
1266 directives.
1267 (&triangular_grammar): Do use the directives (were ignored).
1268 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
1269 directives.
1270
1271 2008-11-03 Akim Demaille <demaille@gostai.com>
1272
1273 Improve genericity of bench.pl.
1274 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
1275 argument.
1276 (&bench_push_parser): New.
1277 Call it.
1278
1279 2008-11-03 Akim Demaille <demaille@gostai.com>
1280
1281 Add documentation to bench.pl.
1282 * etc/bench.pl.in: Comment changes.
1283
1284 2008-11-03 Akim Demaille <demaille@gostai.com>
1285
1286 Fuse the three stacks into a single one.
1287 In order to make it easy to perform benchmarks to ensure that there are no
1288 performance loss, lalr1.cc is forked into lalr1-fusion.cc. Eventually,
1289 lalr1-fusion.cc will replace lalr1.cc.
1290
1291 Meanwhile, to make sure that lalr1-fusion.cc is correctly exercized by the
1292 test suite, the user must install a symbolic link from lalr1.cc to it.
1293
1294 Instead of having three stacks (state, value, location), use a stack
1295 of triples. This considerably simplifies the code (and it will be
1296 easier not to require locations as currently does the C++ parser),
1297 and also gives a 10% speedup according to etc/bench (probably mainly since
1298 memory allocation is done once instead of three times).
1299
1300 Another motivation is to make it easier to destruct properly
1301 semantic values: now that they are bound to their state (hence
1302 symbol type) it will be easier to call the appropriate destructor.
1303
1304 These changes should probably benefit the C parser too.
1305
1306 * data/lalr1.cc: Copy as... * data/lalr1-fusion.cc: this new
1307 file.
1308 (b4_rhs_value, b4_rhs_location): New definitions overriding those
1309 from c++.m4.
1310 (state_stack_type, semantic_stack_type, location_stack_type)
1311 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
1312 (data_type, stack_type, yystack_): New.
1313 (YYLLOC_DEFAULT, yypush_): Adjust.
1314 (yyerror_range): Now based on data_type, not location_type.
1315
1316 2008-11-03 Akim Demaille <demaille@gostai.com>
1317
1318 Push the state, value, and location at the same time.
1319 This is needed to prepare a forthcoming patch that fuses the three
1320 stacks into one.
1321
1322 * data/lalr1.cc (parser::yypush_): New.
1323 (parser::yynewstate): Change the semantics: instead of arriving to
1324 this label when value and location have been pushed, but yystate
1325 is to be pushed on the state stack, now the three of them must
1326 have been pushed before. yystate still must be the new state.
1327 This allows to use yypush_ everywhere instead of individual
1328 handling of the stacks.
1329
1330 2008-11-03 Akim Demaille <demaille@gostai.com>
1331
1332 Prefer references to pointers.
1333 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
1334 definition to use references instead of pointers.
1335 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
1336 Take the value and location as references.
1337 Adjust callers.
1338
1339 2008-11-03 Akim Demaille <demaille@gostai.com>
1340
1341 stack::size instead of stack::height.
1342 * data/lalr1.cc (stack::height): Rename as...
1343 (stack::size): this.
1344 Fix the output type.
1345 Comment changes.
1346
1347 2008-11-03 Akim Demaille <demaille@gostai.com>
1348
1349 Use variants to support objects as semantic values.
1350 This patch was inspired by work by Michiel De Wilde. But he used Boost
1351 variants which (i) requires Boost on the user side, (ii) is slow, and
1352 (iii) has useless overhead (the parser knows the type of the semantic value
1353 there is no reason to duplicate this information as Boost.Variants do).
1354
1355 This implementation reserves a buffer large enough to store the largest
1356 objects. yy::variant implements this buffer. It was implemented with
1357 Quentin Hocquet.
1358
1359 * src/output.c (type_names_output): New.
1360 (output_skeleton): Invoke it.
1361 * data/c++.m4 (b4_variant_if): New.
1362 (b4_symbol_value): If needed, provide a definition for variants.
1363 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
1364 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
1365 (b4_char_sizeof, yy::variant): New.
1366 (parser::parse): If variants are requested, define
1367 parser::union_type, parser::variant, change the definition of
1368 semantic_type, construct $$ before running the user action instead
1369 of performing a default $$ = $1.
1370 * examples/variant.yy: New.
1371 Based on an example by Michiel De Wilde.
1372
1373 2008-11-03 Akim Demaille <demaille@gostai.com>
1374
1375 Parameterize the extraction of semantic values.
1376 To make future changes easier, no longer rely on ".TYPE" being the
1377 way to get a semantic value.
1378
1379 * data/c.m4 (b4_symbol_value): New.
1380 Use it.
1381 * data/c++.m4, data/yacc.c: Use it.
1382 * data/glr.c: Use b4_symbol_value.
1383 (b4_rhs_data): New.
1384 Use it.
1385
1386 2008-11-03 Akim Demaille <demaille@gostai.com>
1387
1388 Prepare easier M4 changes.
1389 * data/lalr1.cc: Use escaped [] instead of literals to prepare
1390 future changes.
1391
1392 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1393
1394 Initiate further development.
1395 * NEWS: Create an empty section for new entries.
1396 * gnulib: Update submodule to HEAD.
1397
1398 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1399
1400 * NEWS: Version 2.4.
1401
1402 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1403
1404 Prepare for next release.
1405 * NEWS: Briefly mention changes since 2.3b.
1406 * README: Say GNU m4 1.4.6, which we've been requiring in release
1407 announcements already, not 1.4.3, which breaks the build.
1408
1409 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1410
1411 Say %language is experimental.
1412 We're thinking of extending it's effect on output file naming. See the
1413 thread at
1414 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1415 * NEWS: Say it's experimental.
1416 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1417 recommend it over %skeleton for now.
1418 (Bison Options): Likewise.
1419 (C++ Bison Interface): Use %skeleton not %language.
1420 (Calc++ Parser): Use %skeleton not %language.
1421 * src/getargs.c (usage): Say it's experimental.
1422
1423 2008-11-01 Di-an Jan <dianj@freeshell.org>
1424 Paolo Bonzini <bonzini@gnu.org>
1425
1426 Support all Java parser class modifiers.
1427 * data/java.m4 (b4_percent_define_get3): New.
1428 (b4_final_if, b4_strictfp_if): New.
1429 * data/lalr1.java (final, strictfp, extends, implements): Support.
1430 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1431 documentation.
1432 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1433 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1434 (AT_CHECK_JAVA_GREP): New.
1435 (Java parser class modifiers): New test.
1436 (Java parser class extends and implements): New test.
1437
1438 Model exception propagation better with throws and lex_throws.
1439 * data/java.m4 (b4_list2): New.
1440 (throws): Change default.
1441 * data/lalr1.java (yyaction): Add throws.
1442 (parse): Add lex_throws in addition to throws.
1443 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1444 * tests/java.at (Java throws specifications): New test.
1445
1446 Improve documentation for Java parsers.
1447 * doc/bison.texinfo (Java Parsers): Add subsections.
1448 Don't quote first argument of %define.
1449 (Java Bison Interface): Document output files. Move documentation
1450 of parser class and merge into Java Parser Interface. Document
1451 features that error out. Document directives with no effect.
1452 Move note about Javadoc higher.
1453 (Java Semantic Values): Explicitly mention stype.
1454 Document that generic types cannot be used.
1455 (Java Location Values): Use @deftypeivar. Document constructors.
1456 Correct return value for toString.
1457 (Java Parser Interface): List undocumented constants/fields.
1458 Move documentation of fields added by %parse-param closer to list
1459 of members. Document that token names are added as fields.
1460 Document constructors accurately. Remove error method.
1461 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1462 Interface. Describe %code lexer and yylex accutately.
1463 Remove documentation that does not match the code.
1464 (Java Action Features): New.
1465 (Java Differences): Add reference. Add item on semantic values.
1466 Add note about @{ ... @}. Clarify %% epilogue placement.
1467 (Java Declarations Summary): New.
1468
1469 Fix Java skeleton.
1470 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1471 (b4_remove_comma): Quote test argument.
1472 (b4_identification): Remove "bison" field.
1473 * tests/java.at (Java parser class and package names): New test.
1474 (Java %parse-param and %lex-param): New test.
1475 (Java stype, position_class and location_class): New test.
1476
1477 2008-10-31 Di-an Jan <dianj@freeshell.org>
1478
1479 * data/lalr1.jave: Update copyright years.
1480 (YYParser): Correct name of "generated from" file in Javadoc:
1481 use b4_file_name instead of @ofile@.
1482 (Location constructor): Correct Javadoc parameter name.
1483 (yylloc): Add missing opening m4 quote after b4_location_if.
1484 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1485 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1486 (YYParser constructor): Correct Javadoc parameter name.
1487
1488 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1489
1490 Always put auxiliary code files in the same dir as other output files.
1491 * src/files.c (compute_file_name_parts): When the user specifies
1492 --output but not --file-prefix, extract the directory prefix from the
1493 file prefix not from the grammar file name. This affects the location
1494 of files like location.hh generated by the C++ skeleton. The includes
1495 in the other output files require this fix.
1496 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1497 for expected output files.
1498 (Output files): Add a test for the above.
1499
1500 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1501
1502 * gnulib: Update submodule to HEAD.
1503
1504 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1505
1506 Update copyright year.
1507 * src/files.c: Here.
1508
1509 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1510
1511 Don't overwrite the input file.
1512 * src/files.c (output_file_name_check): Fatal error if using input file
1513 for output.
1514 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1515 argument.
1516 (Conflicting output files): Add test.
1517
1518 2008-10-28 Akim Demaille <demaille@gostai.com>
1519
1520 Space changes.
1521 * data/lalr1.cc: Formatting changes.
1522
1523 2008-10-28 Akim Demaille <demaille@gostai.com>
1524
1525 Don't define debugging functions when !YYDEBUG.
1526 * data/lalr1.cc (debug_stream, set_debug_stream)
1527 (debug_level_type, debug_level, set_debug_level): Don't
1528 declare them when YYDEBUG is not defined.
1529 The implementation are already YYDEBUG-aware.
1530
1531 2008-10-28 Akim Demaille <demaille@gostai.com>
1532
1533 Prefer "continue" for empty loop bodies.
1534 * etc/bench.pl.in: Use "continue" instead of {}.
1535
1536 2008-10-28 Akim Demaille <demaille@gostai.com>
1537
1538 Space and comments changes.
1539 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1540 * data/c.m4, data/lalr1.cc: Space changes.
1541
1542 2008-10-28 Akim Demaille <demaille@gostai.com>
1543
1544 Make gnulib a submodule.
1545 * gnulib: New.
1546 * .gitmodules (gnulib): New.
1547
1548 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1549
1550 Fix yyerror_range for user-defined location type in C++. Reported by
1551 Georg Sauthoff at
1552 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1553 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1554 * THANKS (Georg Sauthoff): Add.
1555
1556 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1557
1558 Update several administrative files mainly to facilitate releasing.
1559 * HACKING (Administrivia): Make the git-merge-changelog notes more
1560 helpful.
1561 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1562 (Release Procedure): Update for git and add numerous details that were
1563 previously missing.
1564 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1565 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1566 that announcements don't claim we bootstrapped with whatever bison
1567 happened to be in PATH. Add flex as a bootstrap tool.
1568 * Makefile.maint: Remove, previously replaced by maint.mk.
1569 * Makefile.cfg: Remove, and migrate settings to...
1570 * cfg.mk: ... here for the sake of `make announcement'.
1571 * bootstrap.conf (gnulib_modules): Add announce-gen.
1572 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1573 Berry.
1574
1575 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1576
1577 Small but important bugfixes for the Java skeleton.
1578 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1579 (yy_symbol_print): Call toString on yyvaluep.
1580
1581 2008-08-29 Akim Demaille <demaille@gostai.com>
1582
1583 Clarify UPDATED use.
1584 * doc/bison.texinfo: It refers to the last edition of this file,
1585 not to the release date of Bison.
1586 Reported by Joel E. Denny.
1587
1588 2008-08-29 Akim Demaille <demaille@gostai.com>
1589
1590 * README: Update FAQ pointer.
1591 Reported by Joel E. Denny.
1592
1593 2008-08-27 Eric Blake <ebb9@byu.net>
1594
1595 Resync m4sugar from autoconf.
1596 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1597 (m4_init): Adjust to latest m4.git changes.
1598 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1599 effects.
1600 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1601 (_m4_list_cmp): Reduce side effects.
1602
1603 2008-08-27 Akim Demaille <demaille@gostai.com>
1604
1605 Check yyerrok in calc.at.
1606 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1607 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1608 expected.
1609
1610 2008-08-27 Akim Demaille <demaille@gostai.com>
1611
1612 Support yyerrok in lalr1.cc.
1613 YYBACKUP is still to import back into lalr1.cc.
1614 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
1615
1616 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1617
1618 For maintainer-check*, don't recompile for a $(VERSION) update.
1619 * cfg.mk: New file.
1620 (_is-dist-target): Override the one in GNUmakefile.
1621 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1622
1623 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1624
1625 Update for recent change to gnulib.
1626 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1627 string.h now.
1628
1629 2008-08-15 Eric Blake <ebb9@byu.net>
1630
1631 Remaining m4sugar merge from autoconf.
1632 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1633 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1634 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1635 * src/output.c (output_skeleton): Tell m4 how to find it.
1636
1637 Partial m4sugar merge from autoconf: m4_map.
1638 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1639 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1640 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1641 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1642 for empty list.
1643 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1644 Likewise.
1645 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1646 declares it.
1647
1648 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1649
1650 Keep .version and PACKAGE_VERSION in sync.
1651 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1652 dependency, and add comments justifying this in more detail. Discussed
1653 starting at
1654 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1655
1656 2008-08-06 Eric Blake <ebb9@byu.net>
1657
1658 Partial m4sugar merge from autoconf: m4_shiftn.
1659 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1660 (m4_shift2, m4_shift3): New macros.
1661 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1662 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1663 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1664 * data/java.m4 (b4_remove_comma): Likewise.
1665
1666 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1667 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1668 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1669 (m4_init): Consolidate wrapped text into single m4_wrap.
1670 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1671 in wrapped text.
1672
1673 2008-08-05 Eric Blake <ebb9@byu.net>
1674
1675 Partial m4sugar merge from autoconf: builtins, version.m4.
1676 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1677 (m4_prepend): Remove, as it is unused and inherently quadratic,
1678 whereas m4_append is linear in newer m4.
1679 (m4_mkstemp): New builtin.
1680 (m4_symbols): Make rename conditional.
1681 (m4_version_prereq): Ensure fatal error if used in bison, which
1682 intentionally lacks version.m4.
1683
1684 Fix comments in m4sugar.
1685 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1686
1687 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1688
1689 Update for recent .gitignore fix in Gnulib.
1690 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1691 anchored .gitignore entries.
1692
1693 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1694
1695 Set gnu or gnits strictness.
1696 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1697 development and gnits strictness for releases. Based on Eric Blake's
1698 suggestion at
1699 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1700
1701 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
1702
1703 * NEWS: Clarify documentation of %language.
1704
1705 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
1706
1707 Support usage of git-merge-changelog.
1708 * .gitattributes: New.
1709 * HACKING: Document usage of git-merge-changelog.
1710 * bootstrap: Install git-merge-changelog entries in .git/config
1711 if appropriate.
1712
1713 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1714
1715 Remove remaining dependence on CVS Id keyword.
1716 * ChangeLog: For the sake of people still using CVS, don't use dollars
1717 when mentioning Id.
1718 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1719 unusual anyway.
1720 * data/xslt/xml2dot.xsl: Likewise.
1721 * data/xslt/xml2text.xsl: Likewise.
1722 * data/xslt/xml2xhtml.xsl: Likewise.
1723 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1724 * doc/Makefile.am (neutralize): Remove, no longer needed.
1725 (.x.1): Don't use neutralize.
1726 (edit): Don't substitute for ID.
1727 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1728
1729 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1730
1731 Fix dependence on computed configure variables.
1732 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1733 $(top_srcdir)/configure.ac so that changes to computed variables, such
1734 as PACKAGE_VERSION, are seen.
1735 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1736
1737 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1738
1739 Update copyright dates for recent changes.
1740 * Makefile.am: Here.
1741 * src/Makefile.am: Here.
1742 * src/reduce.c: Here.
1743 * tests/reduce.at: Here.
1744
1745 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1746
1747 Use git-version-gen for version names between releases.
1748 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1749 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1750 * .prev-version: New.
1751 * .version.in: Remove.
1752 * ChangeLog: Remove the Id previously used for capturing the CVS
1753 revision.
1754 * GNUmakefile: Remove, now copied from Gnulib.
1755 * Makefile.am: Add code suggested by comments in
1756 build-aux/git-version-gen.
1757 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1758 .prev-version, and .version.
1759 * NEWS (2.3b+): Rename to...
1760 (?.?): ... this because we're dropping the "+" version naming scheme,
1761 but, in general, we still can't be sure of our next release name.
1762 * bootstrap: Add a quick hack to remove from .gitignore the
1763 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1764 entry. This should really be fixed in gnulib instead.
1765 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1766 * configure.ac (AC_INIT): Set version name by invoking
1767 build-aux/git-version-gen.
1768 (AC_CONFIG_FILES): Remove .version, now generated by
1769 build-aux/git-version-gen.
1770 * maint.mk: New, copied from coreutils.
1771 * doc/.cvsignore (bison.1): Add.
1772 * doc/.gitignore (/bison.1): Add.
1773 * doc/bison.1: Remove, generated.
1774 * src/.cvsignore (revision.c): Remove.
1775 * src/.gitignore (/revision.c): Remove.
1776 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1777 (BUILT_SOURCES): Remove revision.c.
1778 (revision.c): Remove.
1779 * src/getargs.c (version): Don't print revision after the VERSION.
1780 * src/revision.h: Remove.
1781
1782 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1783
1784 Fix untranslatable composition of sentences. Reported by Goran
1785 Uddeborg at
1786 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1787 * THANKS (Goran Uddeborg): Add.
1788 * src/reduce.c (reduce_print): Report the number of nonterminals and
1789 rules useless in the grammar in separate sentences.
1790 * tests/reduce.at (Useless Rules): Update output.
1791 (Reduced Automaton): Likewise.
1792 (Underivable Rules): Likewise.
1793 (Empty Language): Likewise.
1794
1795 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1796
1797 Fix some .gitignore and .cvsignore problems.
1798 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1799 (insert_vc_ignore): ... this new function, which prepends `/' to all
1800 .gitignore entries before passing them to insert_sorted_if_absent.
1801 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1802 .cvsignore files are maintained even though Bison developers run
1803 bootstrap while using Git.
1804 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1805 unneeded by Bison.
1806 (gnulib): Add.
1807 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1808 unneeded. Reported by Eric Blake.
1809 * lib/.gitignore (/*~): Add.
1810 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1811 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1812 Blake.
1813 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1814
1815 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1816
1817 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1818 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1819 * bootstrap.conf (gnulib_modules): Add unsetenv.
1820 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1821 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1822 (/setenv.m4): Add.
1823 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1824 the first argument because it may become position-dependent, and unset
1825 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1826 Add comments explaining these issues in more detail.
1827
1828 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1829
1830 Add .gitignore everywhere based on .cvsignore.
1831 * .gitignore: New.
1832 * build-aux/.gitignore: New.
1833 * data/.gitignore: New.
1834 * doc/.gitignore: New.
1835 * etc/.gitignore: New.
1836 * examples/.gitignore: New.
1837 * examples/calc++/.gitignore: New.
1838 * lib/.gitignore: New.
1839 * m4/.gitignore: New.
1840 * po/.gitignore: New.
1841 * runtime-po/.gitignore: New.
1842 * src/.gitignore: New.
1843 * tests/.gitignore: New.
1844
1845 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1846
1847 * NEWS (2.3b+): New section, empty for now.
1848 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1849
1850 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1851
1852 * NEWS (2.3b): Update release date since there has been a delay in
1853 getting the announcements and tarballs out.
1854
1855 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1856
1857 * NEWS: Version 2.3b.
1858 * configure.ac (AC_INIT): Likewise.
1859 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1860
1861 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1862
1863 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1864 been doing it for years.
1865 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1866 (Release Procedure): Add FIXME about make alpha being unmaintained.
1867
1868 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1869
1870 * data/yacc.c: Reformat m4 a little for readability.
1871 * src/lalr.c (build_relations): Correct comment.
1872
1873 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1874
1875 DJGPP specific issue.
1876 * djgpp/config.sed: Fixes required to run configure scripts generated
1877 by autoconf 2.62.
1878
1879 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1880
1881 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1882 coordinator@translationproject.org.
1883
1884 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1885
1886 * THANKS: Add Eric Blake.
1887
1888 2008-04-23 Eric Blake <ebb9@byu.net>
1889
1890 Revert prior patch, by working around autoconf regression.
1891 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1892 ("Output file name: ("): Uncomment test.
1893 ("Output file name: )"): Likewise.
1894 Based on an idea from Noah Misch.
1895
1896 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1897
1898 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1899 2.61. Reported by Juan Manuel Guerrero at
1900 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1901 * tests/output.at ("Output file name: ("): Comment out test case for
1902 now.
1903 ("Output file name: )"): Likewise.
1904
1905 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1906
1907 * GNUmakefile: Update git-version-gen invocation so make dist
1908 succeeds.
1909
1910 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1911
1912 Update to the current gnulib CVS repository, and fix trigraph handling
1913 in Bison.
1914 * bootstrap: Update gnulib CVS repository URL.
1915 (symlink_to_dir): Encapsulate the code that guarantees the destination
1916 directory exists into...
1917 (check_dst_dir): ... this new function, and...
1918 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1919 fail when copying files into lib/uniwidth/.
1920 * src/output.c (prepare_symbols): When writing yytname muscles, where
1921 symbol names will be encoded in C-string literals, tell quotearg to
1922 escape trigraphs. This used to be the default in gnulib.
1923 * tests/regression.at (Token definitions): Because of the change in
1924 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1925 escapes trigraphs in symbol names. Thus, yytname no longer has
1926 trigraphs unnecessarily doubly escaped. Update test case output.
1927 Extend test case to be sure Bison's own error messages will no longer
1928 have trigraphs in symbol names unnecessarily escaped once.
1929
1930 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1931
1932 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1933 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1934 * .cvsignore: Add .version.
1935 * .version.in: New.
1936 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1937 * configure.ac (AC_CONFIG_FILES): Add .version.
1938 * build-aux/.cvsignore: Add git-version-gen.
1939
1940 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1941
1942 * NEWS (2.3a+): Mention that -g now takes an argument.
1943 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1944 consistency. Update the -g and -x entries now that they take
1945 arguments. Use brackets to indicate optional arguments.
1946 * src/getargs.c (usage): Explain the relationship between arguments of
1947 long and short options more completely. Document --defines and -d
1948 separately since the former takes an argument but, for POSIX Yacc, the
1949 latter does not.
1950 (short_options): Let -W take an optional argument like --warnings.
1951 (getargs): Sort cases.
1952
1953 2008-02-28 Akim Demaille <demaille@gostai.com>
1954
1955 * doc/bison.texinfo: Fix a few typos.
1956
1957 2008-02-28 Akim Demaille <akim@epita.fr>
1958
1959 * doc/bison.texinfo (Bison Options): Document -W.
1960 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1961
1962 2008-02-28 Akim Demaille <akim@epita.fr>
1963
1964 * src/getargs.c (short_options): Split and sort for readability.
1965 -g and -x take optional arguments, just like their long options.
1966 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1967 understand.
1968 Fix the handling of $opt which resulted in all the argument to be
1969 considered as optional.
1970
1971 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1972
1973 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1974 say its interface is experimental.
1975 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1976 Java.
1977 (Bison Options): In the -L and --language entry, mention Java.
1978 (Java Bison Interface): Say the interface is experimental.
1979 * src/getargs.c (usage): Mention -L and --language.
1980
1981 * NEWS (2.3a+): Say the push parsing interface is experimental.
1982 * doc/bison.texinfo (Push Decl): Likewise.
1983 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1984 (Push Parser Function): Likewise.
1985 (Pull Parser Function): Likewise.
1986 (Parser Create Function): Likewise.
1987 (Parser Delete Function): Likewise.
1988 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1989 yypull_parse, and yypush_parse entries.
1990
1991 * NEWS (2.3a+): Mention XML support, and say the schema is
1992 experimental.
1993 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1994 * src/getargs.c (usage): Say the XML schema is experimental.
1995
1996 * NEWS (2.3a+): Say option instead of flag.
1997
1998 2008-02-21 Wojciech Polak <polak@gnu.org>
1999
2000 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
2001 text.
2002
2003 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
2004
2005 Fix impure push parser compile error reported by Bob Rossi at
2006 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
2007 * data/yacc.c: Clean up whitespace in the output a little.
2008 (yypstate_allocated): Define for impure push parsers regardless of
2009 whether the pull interface is also requested.
2010 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
2011 check impure push parsers without the pull interface.
2012
2013 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
2014 yyerror takes arguments specified by %parse-param while yypstate_new
2015 does not.
2016 * doc/bison.texinfo (Parser Create Function): Document that
2017 yypstate_new returns 0 for multiple impure parser instances.
2018 * tests/push.at (Push Parsing: Multiple impure instances): Update
2019 expected stderr output.
2020
2021 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2022
2023 * runtime-po/POTFILES.in (push.c): Remove.
2024
2025 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2026
2027 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
2028 * data/push.c: Rename to...
2029 * data/yacc.c: ... this, overwriting it.
2030 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
2031 `%push-pull-parser' -> `%define api.push_pull "both"'.
2032 Remove old yacc.c tests, and update push.c tests to yacc.c.
2033
2034 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2035
2036 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
2037 `"%code top" blocks' instead of `%code "top" blocks'.
2038 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
2039 Clean up whitespace in the output a little.
2040
2041 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2042
2043 Fix documentation problems reported by Tim Josling at
2044 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
2045 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
2046 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
2047 integers. Explain the effect of literal string aliases on error
2048 messages. Copy token 0 documentation from the C++ skeleton
2049 documentation.
2050
2051 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2052
2053 Accept a token number in a %left, %right, or %nonassoc for POSIX
2054 conformance. Reported by Tim Josling at
2055 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
2056 * NEWS (2.3a+): Mention.
2057 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
2058 and code numbers are treated by precedence declarations.
2059 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
2060 of symbols.1.
2061 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
2062 of symbol.
2063 (symbol.prec): New, just like symbol but allows INT.
2064 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
2065 longer holds.
2066 * tests/regression.at (Token number in precedence declaration): New
2067 test case.
2068
2069 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2070
2071 DJGPP specific issues.
2072 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
2073 be changed. Copyright timestamp adjusted.
2074 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
2075 be changed. Copyright timestamp adjusted.
2076 * djgpp/config.site: Copyright timestamp adjusted.
2077 * djgpp/config_h.sed: Copyright timestamp adjusted.
2078 * djgpp/djunpack.bat: Copyright timestamp adjusted.
2079 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
2080 filename translation list.
2081 * djgpp/subpipe.c (init_subpipe): Check the environment variables
2082 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
2083 files shall be created. Before trying to use the temp dir where the
2084 environment variable points to check that the dir really exists. If
2085 not default to the cwd as temp dir. Copyright timestamp adjusted.
2086 * djgpp/subpipe.h: Copyright timestamp adjusted.
2087 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2088
2089 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2090
2091 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2092
2093 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2094
2095 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2096 Problem reported by Claudio Saavedra in
2097 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2098
2099 2008-01-05 Wojciech Polak <polak@gnu.org>
2100
2101 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2102 document's title with the input grammar file name.
2103
2104 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2105
2106 Automate regression testing of the XML/XSLT implementation. Discussed
2107 starting at
2108 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2109 * configure.ac (XSLTPROC): New substitution.
2110 * Makefile.am (maintainer-xml-check): New phony target invoking...
2111 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2112 invoking make maintainer-check with BISON_TEST_XML=1.
2113 * tests/atlocal.in (XSLTPROC): New.
2114 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2115 not to report reachable memory when Bison is expected to have a
2116 non-zero exit status and (2) to compare XML/XSLT output with --graph
2117 and --report=all output for every working grammar when
2118 BISON_TEST_XML=1.
2119 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2120 (AT_BISON_CHECK_XML): New.
2121 (AT_QUELL_VALGRIND): New.
2122 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2123 (AT_CHECK): ... don't redefine this since this was the old way to
2124 quell Valgrind.
2125 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2126 AT_BISON_CHECK invocations.
2127 * tests/c++.at: Likewise.
2128 * tests/calc.at: Likewise.
2129 * tests/conflicts.at: Likewise.
2130 * tests/cxx-type.at: Likewise.
2131 * tests/existing.at: Likewise.
2132 * tests/glr-regression.at: Likewise.
2133 * tests/headers.at: Likewise.
2134 * tests/input.at: Likewise.
2135 * tests/java.at: Likewise.
2136 * tests/output.at: Likewise.
2137 * tests/push.at: Likewise.
2138 * tests/reduce.at: Likewise.
2139 * tests/regression.at: Likewise.
2140 * tests/sets.at: Likewise.
2141 * tests/skeletons.at: Likewise.
2142 * tests/synclines.at: Likewise.
2143 * tests/torture.at: Likewise.
2144 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2145 tends to hang xsltproc.
2146 (Big horizontal): Likewise.
2147
2148 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2149
2150 In XML output, remove redundant class attribute on symbol element.
2151 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2152 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2153 look up a symbol to determine whether it's a nonterminal or terminal.
2154 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2155 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2156
2157 Add prec/assoc information to XML output.
2158 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2159 %prec, add a percent_prec attribute.
2160 * src/print-xml.c (print_grammar): For each terminal that has a
2161 precedence or associativity, add a prec or assoc attribute.
2162 (xml_indent): New.
2163 (xml_puts): Use xml_indent.
2164 (xml_printf): Use xml_indent.
2165 * src/print-xml.h (xml_indent): Prototype.
2166
2167 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2168 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2169
2170 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2171
2172 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2173 (bison:ruleByNumber): ... this for clarity.
2174 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2175 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2176 (xsl:template match="reduction"): Update.
2177 (xsl:template match="item"): Update.
2178 (xsl:template match="reduction"): Update.
2179
2180 In the XML output, don't print the list of rules where symbols appear.
2181 Compute it in XSLT instead. Discussed at
2182 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2183 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2184 (bison:ruleByRhs): New.
2185 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2186 bison:ruleByRhs.
2187 (xsl:template match="terminal/rule"): Remove.
2188 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2189 bison:ruleByRhs.
2190 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2191 Remove.
2192 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2193 bison:ruleByRhs and mode="number-link" for rule template.
2194 (xsl:template match="terminal/rule"): Remove.
2195 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2196 bison:ruleByRhs and mode="number-link" for rule template.
2197 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2198 Rewrite as...
2199 (xsl:template match="rule" mode="number-link"): ... this.
2200 * src/print-xml.c (print_grammar): Don't print the list of rules.
2201
2202 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2203
2204 Don't let --report affect XML output; always print all information.
2205 Discussed at
2206 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2207 * src/conflicts.c (log_resolution): Implement.
2208 * src/print-xml.c (print_core): Implement.
2209 (print_state): Implement.
2210 (print_xml): Implement.
2211
2212 * NEWS (2.3a+): Fix quotes.
2213 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2214 don't let %verbose clear the list specified by --report.
2215
2216 2007-11-26 Akim Demaille <akim@epita.fr>
2217
2218 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2219
2220 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2221
2222 In the XML output, list useless and unused symbols and rules with the
2223 useful ones and add a "usefulness" attribute. Discussed starting at
2224 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2225 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2226 (grammar_rules_print_xml): Print all rules instead of just those
2227 useful in the grammar, and add a "usefulness" attribute.
2228 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2229 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2230 (print_grammar): Print all nonterminals instead of just useful ones,
2231 and add a "usefulness" attribute to nonterminals and terminals.
2232 (print_xml): Don't print a separate "reductions" or
2233 "rules-useless-in-parser" element.
2234 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2235 (reduce_xml): Remove.
2236 (reduce_token_unused_in_grammar): New.
2237 (reduce_nonterminal_useless_in_grammar): New.
2238 * src/reduce.h (reduce_xml): Remove prototype.
2239 (reduce_token_unused_in_grammar): Add prototype.
2240 (reduce_nonterminal_useless_in_grammar): Add prototype.
2241 * data/xslt/xml2text.xsl: Update for XML changes.
2242 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2243 * tests/reduce.at (Useless Terminals): Update output.
2244 (Useless Rules): Update output.
2245 (Reduced Automaton): Update output.
2246
2247 Say "Terminals unused in grammar" instead of "Unused terminals".
2248 * NEWS (2.3a+): Update.
2249 * doc/bison.texinfo (Understanding): Update example output.
2250 * src/reduce.c (reduce_output): Implement.
2251 * data/xslt/xml2text.xsl: Implement.
2252 * data/xslt/xml2xhtml.xsl: Implement.
2253
2254 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2255
2256 Accept --report-file=FILE to override the default `.output' filename.
2257 * NEWS (2.3a+): Mention.
2258 * doc/bison.texinfo (Bison Options): Add an entry.
2259 * src/files.c (compute_output_file_names): Don't override
2260 spec_verbose_file if already set.
2261 * src/getargs.c (usage): Document --report-file.
2262 (REPORT_FILE_OPTION): New anonymous enum member.
2263 (long_options): Add entry for it.
2264 (getargs): Add case for it setting spec_verbose_file.
2265
2266 * build-aux/cross-options.pl: Don't record a short option just because
2267 there's an arg.
2268 * doc/.cvsignore: Add yacc.1.
2269
2270 2007-11-14 Akim Demaille <akim@epita.fr>
2271
2272 * doc/yacc.1.in: New.
2273 * configure.ac, doc/Makefile.am: Adjust.
2274 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2275 config.h symbol.
2276 Use AC_SUBST for assignments too.
2277 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2278
2279 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2280
2281 * src/gram.c: Remove comments that duplicate comments in gram.h.
2282
2283 When reporting useless rules and nonterminals, say "useless in grammar"
2284 instead of "useless", and say "useless in parser" instead of "never
2285 reduced". Discussed starting at
2286 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2287 * NEWS (2.3a+): Mention this change.
2288 * data/xslt/xml2text.xsl: Update output text and expected input XML
2289 element names to match changes below.
2290 * data/xslt/xml2xhtml.xsl: Likewise.
2291 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2292 Contents: "Rules useless in parser due to conflicts".
2293 * doc/bison.texinfo (Decl Summary): Reword a little.
2294 (Understanding): Update example output for changes below.
2295 * src/gram.c: (rule_useful_p): Rename to...
2296 (rule_useful_in_grammar_p): ... this.
2297 (rule_useless_p): Rename to...
2298 (rule_useless_in_grammar_p): ... this.
2299 (rule_never_reduced_p): Rename to...
2300 (rule_useless_in_parser_p): ... this.
2301 (grammar_rules_print): Update for renames.
2302 (grammar_rules_print_xml): Update for renames.
2303 (grammar_rules_never_reduced_report): Rename to...
2304 (grammar_rules_useless_report): ... this since it is used for either
2305 kind of useless rule.
2306 * src/gram.h: Reword comments and update function names in prototypes.
2307 * src/main.c (main): Say "rule useless in parser due to conflicts".
2308 * src/print-xml.c (print_rules_never_reduced): Rename to...
2309 (print_rules_useless_in_parser): ... this, and rename output XML
2310 element "rules-never-reduced" to "rules-useless-in-parser".
2311 (print_xml): Update for rename.
2312 * src/print.c (print_results): Say "Rules useless in parser due to
2313 conflicts".
2314 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2315 (nonterminals_reduce): Say "nonterminal useless in grammar".
2316 (reduce_output): Say "Nonterminals useless in grammar".
2317 Say "Rules useless in grammar".
2318 (reduce_xml): Rename output XML element "useless" to
2319 "useless-in-grammar".
2320 (reduce_print): Don't report the count of grammatically useless rules
2321 as "rules never reduced" just because %yacc is specified.
2322 In the correct report of this count, say nonterminal(s) and rule(s)
2323 "useless in grammar".
2324 * tests/conflicts.at (S/R in initial): Update expected output.
2325 (Defaulted Conflicted Reduction): Likewise.
2326 (Unreachable States After Conflict Resolution): Likewise.
2327 * tests/existing.at (GNU pic Grammar): Likewise.
2328 * tests/reduce.at (Useless Nonterminals): Likewise.
2329 (Useless Rules): Likewise.
2330 (Reduced Automaton): Likewise.
2331 (Underivable Rules): Likewise.
2332 (Empty Language): Likewise.
2333
2334 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2335
2336 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2337 here document and before the EOF so that BSD's implementation of Bourne
2338 shell doesn't parse the delimiter as part of the here document.
2339 * doc/.cvsignore: Add cross-options.texi.
2340 * src/getargs.c (usage): Add a blank line after the warning categories.
2341
2342 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
2343
2344 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2345
2346 2007-11-05 Akim Demaille <akim@epita.fr>
2347
2348 Remove Id: from bison.1.
2349 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2350 (perl -0777 -pi -e 's/\.PP\nId): New.
2351 (.x.1): Use it to ignore the version control revision.
2352
2353 2007-11-05 Akim Demaille <demaille@gostai.com>
2354
2355 * build-aux/Makefile.am: Ship cross-options.pl.
2356 * doc/Makefile.am: Always refer to cross-options.texi with
2357 $(srcdir).
2358 (MAINTAINERCLEANFILES): Add it.
2359
2360 2007-11-04 Akim Demaille <demaille@gostai.com>
2361
2362 Generate the long/short option cross-table.
2363 * build-aux/cross-options.pl: New.
2364 * doc/Makefile.am (cross-options.texi): New.
2365 * doc/bison.texinfo: Use it.
2366
2367 2007-11-04 Akim Demaille <demaille@gostai.com>
2368
2369 Generate bison.1 using help2man.
2370 * doc/common.x, doc/bison.x: New.
2371 * doc/Makefile.am (bison.1, .x.1): New.
2372 The code is taken from autoconf-2.61/man/Makefile.am.
2373 * configure.ac: Look for help2man.
2374
2375 2007-11-04 Akim Demaille <demaille@gostai.com>
2376
2377 Complete --help.
2378 * src/getargs.c (usage): Document -W, make it clear that -d,
2379 -g and -x have optional arguments.
2380
2381 2007-11-04 Akim Demaille <demaille@gostai.com>
2382
2383 Find sha1sum when named gsha1sum.
2384 * bootstrap (find_tool): New.
2385 ($SHA1SUM): New.
2386
2387 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2388
2389 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2390 at
2391 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2392 * NEWS (2.3a+): Mention.
2393 * data/bison.m4 (b4_pure_if): Don't define it here.
2394 * data/c.m4 (b4_identification): Depend on individual skeletons to
2395 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2396 values of the %define variables api.pure or api.push_pull. Define
2397 YYPURE, YYPUSH, and YYPULL accordingly.
2398 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2399 glr.cc has already defined b4_pure_flag.
2400 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2401 Remove YYPUSH and YYPULL since they're back in b4_identification again.
2402 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
2403 * doc/bison.texinfo (Pure Decl): Update.
2404 (Push Decl): Update.
2405 (Decl Summary): Add api.pure to %define entry.
2406 In %pure-parser entry, say it's deprecated and reference %define.
2407 (Pure Calling): Update.
2408 (Error Reporting): Update.
2409 (C++ Scanner Interface): Update.
2410 (How Can I Reset the Parser): Update.
2411 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2412 reference %define.
2413 * src/getargs.c (pure_parser): Remove global variable.
2414 * src/getargs.h (pure_parser): Remove extern.
2415 * src/output.c (prepare): Don't define pure_flag muscle.
2416 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2417 wrapper around `%define api.pure'.
2418 * tests/calc.at (Simple LALR Calculator): Update.
2419 (Simple GLR Calculator): Update.
2420 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2421 Update.
2422 (GLR: Resolve ambiguity, pure, locations): Update.
2423 (GLR: Merge conflicting parses, pure, no locations): Update.
2424 (GLR: Merge conflicting parses, pure, locations): Update.
2425 * tests/glr-regression.at (Uninitialized location when reporting
2426 ambiguity): Update
2427 * tests/input.at (Unused %define api.pure): New test case.
2428 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2429 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2430 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2431
2432 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2433
2434 %define push_pull -> %define api.push_pull. Discussed starting at
2435 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2436 * data/push.c: Expect the new name.
2437 * data/yacc.c: Likewise.
2438 * doc/bison.texinfo (Push Decl): Update.
2439 (Decl Summary): Update %define entry.
2440 (Push Parser Function): Update.
2441 (Pull Parser Function): Update.
2442 (Parser Create Function): Update.
2443 (Parser Delete Function): Update.
2444 * tests/calc.at (Simple LALR Calculator): Update.
2445 * tests/input.at (%define enum variables): Update.
2446 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2447 (Push Parsing: Multiple impure instances): Update.
2448 (Push Parsing: Unsupported Skeletons): Update.
2449 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2450 (Exploding the Stack Size with Malloc): Update.
2451
2452 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2453 other entries some.
2454
2455 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2456
2457 For the XML output's terminal element, rename @number to @token-number,
2458 and add @symbol-number. In the nonterminal element, rename @number to
2459 @symbol-number. Discussed starting at
2460 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2461 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2462 renames.
2463 (xsl:template match="nonterminal"): Likewise.
2464 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2465 (xsl:template match="nonterminal"): Likewise.
2466 * src/print-xml.c (print_grammar): Implement.
2467
2468 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2469
2470 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2471 2007-10-11 change, the child elements here are items not rules.
2472 (xsl:template match="item"): New.
2473 (xsl:template match="rule"): Update for new reduced itemset.
2474 (xsl:template match="point"): Remove.
2475 (xsl:template match="empty"): For consistency with --graph, don't
2476 output "/* empty */".
2477 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2478 line-wrap, don't pass a negative value as first-line-length since this
2479 won't work with the following changes.
2480 (xsl:template name="line-wrap"): Simplify slightly.
2481 (xsl:template name="ws-search"): Eliminate recursion.
2482 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2483 set next to an item whose dot is not at the end of the RHS even if it
2484 happens to be associated with the same rule.
2485
2486 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2487
2488 Add %define lr.keep_unreachable_states.
2489 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2490 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2491 * src/main.c (main): Implement it.
2492 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2493 Extend to test it, and fix a typo.
2494
2495 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2496
2497 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
2498 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2499 the example .output text.
2500 * tests/regression.at (Extra lookahead sets in report): Improve wording
2501 of comments.
2502
2503 2007-10-17 Wojciech Polak <polak@gnu.org>
2504
2505 * src/print-xml.c (print_grammar): Renamed
2506 <terminal> and <nonterminal> attributes:
2507 "type" to "number" and "symbol" to "name".
2508 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2509 Use new attribute names.
2510 (xsl:template match="nonterminal"): Likewise.
2511 * data/xslt/xml2xhtml.xsl: Likewise.
2512
2513 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2514
2515 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2516 (Option Cross Key): Likewise.
2517
2518 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2519 next to an item whose dot is not at the end of the RHS even if it
2520 happens to be associated with the same rule.
2521 * src/print.c (print_core): Likewise.
2522 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2523 (Resolved SR Conflicts): Update output.
2524 * tests/regression.at (Extra lookahead sets in report): New test case.
2525
2526 2007-10-11 Wojciech Polak <polak@gnu.org>
2527
2528 * src/print-xml.c (print_core): Remove item set
2529 redundancy.
2530 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2531 Improve processing time. Suggested by Joel E. Denny.
2532 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2533 Write xsl:param "required" attribute as comment.
2534 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2535 (xsl:template match="rule"): Support new reduced itemset.
2536 (xsl:template match="point"): Remove.
2537 * data/xslt/xml2xhtml.xsl: Likewise.
2538
2539 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2540
2541 * src/getargs.c (version): Update copyright year.
2542
2543 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2544
2545 Make xml2dot.xsl and --graph produce the same output.
2546 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2547 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2548 escaped later.
2549 (xsl:template name="output-node"): Use the new escape template instead
2550 of the string-replace template directly.
2551 (xsl:template name="output-edge"): Likewise.
2552 (xsl:template name="escape"): New, escapes backslashes and newlines in
2553 addition to quotation marks.
2554 * src/graphviz.c (start_graph, output_node, output_edge): Add
2555 whitespace to output for legibility.
2556
2557 Make xml2text.xsl and --report produce the same output, and remove the
2558 XML "conflicts" element since a conflict summary is easily extracted
2559 from the automaton.
2560 * data/xslt/bison.xsl: New.
2561 (xsl:template match="state" mode="bison:count-conflicts): New.
2562 * data/xslt/xml2text.xsl: Import bison.xsl.
2563 (xsl:template match="bison-xml-report"): Instead of styling the
2564 "conflicts" element, style the "automaton" element with mode
2565 "conflicts". Unlike the former, the latter lists S/R and R/R
2566 conflicts for a state on the same line.
2567 (xsl:template match="conflicts"): Remove.
2568 (xsl:template match="conflict"): Remove.
2569 (xsl:template match="terminal"): Line-wrap the list of rules in which
2570 the terminal is used.
2571 (xsl:template match="nonterminal"): Likewise for nonterminals.
2572 (xsl:template match="automaton" mode="conflicts"): New.
2573 (xsl:template match="state" mode="conflicts"): New.
2574 (xsl:template name="line-wrap"): New.
2575 (xsl:template name="ws-search"): New.
2576 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2577 (xsl:template match="bison-xml-report"): Instead of styling the
2578 "conflicts" element, style the "automaton" element with mode
2579 "conflicts."
2580 (xsl:template match="conflicts"): Remove.
2581 (xsl:template match="conflict"): Remove.
2582 (xsl:template match="automaton" mode="conflicts"): New.
2583 (xsl:template match="state" mode="conflicts): New.
2584 * src/conflicts.c (conflicts_output_xml): Remove.
2585 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2586 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2587 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2588 the corresponding XSLT is easier. Also, never wrap between a word and
2589 the comma that follows it.
2590
2591 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2592
2593 Improve C++ namespace support. Discussed starting at
2594 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2595 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2596 b4_namespace_close): New macros that interpret the %define variable
2597 "namespace" so its value can contain "::" to indicate nested
2598 namespaces.
2599 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2600 the above macros.
2601 * data/lalr1.cc (b4_namespace): Likewise.
2602 * data/location.cc (b4_namespace): Likewise.
2603 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2604 inside a new table in the general %define entry. Document `%define
2605 namespace' there as well. Point the %name-prefix entry to it since it
2606 explains it more completely in the case of C++.
2607 (C++ Bison Interface): Mention `%define namespace' instead of
2608 %name-prefix.
2609 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2610 entry suffices.
2611 * tests/c++.at (Relative namespace references): New test case.
2612 (Absolute namespace references): New test case.
2613 (Syntactically invalid namespace references): New test case.
2614 * tests/input.at (C++ namespace reference errors): New test case.
2615
2616 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2617
2618 Add syncline support and location accessor to internal %define
2619 interfaces.
2620 * data/bison.m4 (b4_percent_define_get_loc): New.
2621 (b4_percent_define_get_syncline): New.
2622 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2623 (b4_percent_define_default): Record defining location as line 1 rather
2624 than 0 for the sake of synchronizing #line's, and define
2625 b4_percent_define_syncline(VARIABLE).
2626 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2627 * src/muscle_tab.c (muscle_syncline_grow): New.
2628 (muscle_code_grow): Use muscle_syncline_grow.
2629 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2630 define b4_percent_define_syncline(VARIABLE).
2631 (muscle_percent_define_get_loc): New.
2632 (muscle_percent_define_get_syncline): New.
2633 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2634 remove some unused variables.
2635 (muscle_percent_define_default): Record defining location as line 1
2636 rather than 0 for the sake of synchronizing #line's, and define
2637 b4_percent_define_syncline(VARIABLE).
2638 (muscle_percent_define_check_values): Use
2639 muscle_percent_define_get_loc.
2640 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2641 (muscle_percent_define_get_syncline): Prototype.
2642 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2643 defaults): Update output for location change.
2644 (Complaining during macro argument expansion): Extend to test
2645 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2646
2647 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2648
2649 Fix some error-reporting macro bugs.
2650 * data/bison.m4 (b4_cat): New.
2651 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2652 to stdout so they don't become arguments to other macros. Update
2653 comments and add examples.
2654 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2655 add examples.
2656 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2657 after printing the error directive so that M4 doesn't report subsequent
2658 problems that are induced by this problem.
2659 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2660 instead of just in them. Recognize @\n in both places. Both expand to
2661 the empty string. Needed by b4_cat.
2662 * tests/skeletons.at (Complaining during macro argument expansion):
2663 New test case.
2664 (Fatal errors make M4 exit immediately): New test case.
2665
2666 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2667
2668 Implement --print-datadir.
2669 * src/getargs.c (usage): Mention.
2670 (PRINT_DATADIR_OPTION): New anonymous enum member.
2671 (long_options): Add entry for it.
2672 (getargs): Add case for it calling compute_pkgdatadir.
2673 * src/output.c (output_skeleton): Encapsulate data directory
2674 computation from here...
2675 (prepare): ... and from here...
2676 (compute_pkgdatadir): ... into this new function.
2677 * src/output.h (compute_pkgdatadir): Prototype.
2678
2679 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2680
2681 * src/print-xml.c (escape_bufs): New static global variable
2682 replacing...
2683 (xml_escape_n): ... the static local variable buf here.
2684 (print_xml): Free memory for escape_bufs.
2685 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2686
2687 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2688
2689 Replace `%push-parser' and `%push-pull-parser' with
2690 `%define push_pull "push"' and `%define push_pull "both"'.
2691 `%define push_pull "pull"' is the default.
2692 * doc/bison.texinfo (Push Decl, Push Parser Function,
2693 Pull Parser Function, Parser Create Function, Parser Delete Function):
2694 Update declarations.
2695 (Decl Summary, Table of Symbols): Replace %push-parser and
2696 %push-pull-parser entries with a %define push_pull entry.
2697 * data/bison.m4 (b4_percent_define_check_values): New macro.
2698 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2699 definitions...
2700 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2701 definitions...
2702 * data/push.c: ... to here and compute them from the value of the
2703 %define variable push_pull.
2704 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2705 parsing requests here...
2706 * data/yacc.c: ... hack this to switch to push.c any time
2707 b4_use_push_pull_flag or the %define variable push_pull is set. This
2708 will go away when we mv push.c yacc.c.
2709 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2710 push parsing is not supported since unused %define variables are
2711 reported anyway.
2712 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2713 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2714 comments for consistency with b4_percent_define_check_values.
2715 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2716 muscles.
2717 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2718 Remove.
2719 (prologue_declaration): Remove %push-parser and %push-pull-parser
2720 rules.
2721 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2722 * tests/calc.at: Update declarations.
2723 * tests/input.at (%define enum variables): New test case.
2724 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2725 declaration.
2726 (Push Parsing: Multiple impure instances): Update declaration.
2727 (Push Parsing: Unsupported Skeletons): New test case.
2728 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2729 declaration.
2730 (Exploding the Stack Size with Malloc): Update declaration.
2731
2732 2007-09-24 Wojciech Polak <polak@gnu.org>
2733
2734 Add XSLT transformations.
2735
2736 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2737 * data/xslt/xml2text.xsl: Transform XML into plain text.
2738 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2739 * data/Makefile.am (xsltdir): New variable.
2740 (dist_xslt_DATA): Add xslt/*.xsl files.
2741
2742 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2743
2744 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2745 Problem reported by Wojciech Polak.
2746 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2747 (xml_printf): Undo change I made on 21 September; that is,
2748 indent 2 spaces, not 1.
2749
2750 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2751
2752 Pacify ./configure --enable-gcc-warnings.
2753 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2754 `char const *' instead of `char *'.
2755 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2756 local variable `sep'.
2757
2758 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2759
2760 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2761 elsewhere.
2762 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2763 (xml_printf): Indent just 1 space for level.
2764 (e_char, xlate_char): Remove.
2765 (xml_escape_string): Rewrite to avoid undefined behavior (used
2766 storage that was freed from the stack).
2767 (xml_escape_n): Don't bother checking for subscript error.
2768
2769 2007-09-21 Wojciech Polak <polak@gnu.org>
2770
2771 Add Bison XML Automaton Report.
2772
2773 Add support for an -x option to generate an XML report.
2774 It is not documented yet.
2775 * src/print-xml.c: New file.
2776 * src/print-xml.h: Likewise.
2777 * lib/timevar.def (TV_XML): New var.
2778 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2779 * src/conflicts.c: Include print-xml.h.
2780 (solved_conflicts_xml_obstack): New var.
2781 (log_resolution, conflicts_solve, conflicts_free):
2782 Add support for XML report.
2783 (conflicts_output_val): New function.
2784 * src/conflicts.h (conflicts_output_val): New decl.
2785 * src/files.c (spec_xml_file): New var.
2786 (compute_output_file_names, output_file_names_free): Add XML support.
2787 * src/files.h (spec_xml_file): New decl.
2788 * src/getargs.c (xml_flag): New var.
2789 (usage, short_options, long_options, getargs): Add XML support.
2790 * src/getargs.h (xml_flag): New decl.
2791 * src/gram.c: Include print-xml.h.
2792 (rule_lhs_print_xml, rule_rhs_print_xml):
2793 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2794 New functions.
2795 * src/gram.h: Declare external ones.
2796 * src/main.c: Include print-xml.h.
2797 (main): Add XML support.
2798 * src/reduce.c: Include print-xml.h.
2799 (reduce_xml): New function.
2800 * src/reduce.h: Declare it.
2801 * src/state.c: Include print-xml.h.
2802 (state_new): Add XML support.
2803 (state_rule_lookahead_tokens_print_xml): New function.
2804 * src/state.h: Declare it.
2805 (struct state): New member solved_conflicts_xml.
2806 * src/symtab.c (symbol_class_get_string): New function.
2807 * src/symtab.h: Declare it.
2808
2809 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2810
2811 * GNUmakefile: Switch to coreutils's version.
2812 * bootstrap: Likewise.
2813 * Makefile.cfg: Adjust to new GNUmakefile.
2814 * README-hacking: Likewise.
2815
2816 Import from gnulib:
2817
2818 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2819 Bruno Haible <bruno@clisp.org>
2820
2821 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2822 and is a script that invokes bison. Tighten the code. Add comments.
2823
2824 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2825
2826 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2827 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2828 * doc/bison.texinfo (Decl Summary): Fix.
2829 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2830 * tests/input.at (Boolean %define variables): Update output.
2831 * tests/skeletons.at (%define boolean variables: invalid skeleton
2832 defaults): Rename to...
2833 (%define Boolean variables: invalid skeleton defaults): ... this and
2834 update output.
2835
2836 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2837
2838 In impure push mode, don't allow more than one yypstate to be allocated
2839 since multiple impure parsers would corrupt yynerrs.
2840 * data/push.c (yypstate_allocated): New static global variable
2841 initialized to 0.
2842 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2843 exhaustion if yypstate_allocated is 1, but still return 2.
2844 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2845 already 1. Otherwise, set it to 1.
2846 (yypstate_delete): Set it to 0.
2847 * tests/push.at (Push Parsing: Multiple impure instances): New test
2848 case.
2849
2850 2007-08-17 Bob Rossi <bob@brasko.net>
2851
2852 * doc/bison.texinfo (Push Decl): Document the push parser.
2853 (Table of Symbols): Ditto.
2854 (Pure Decl): Ditto.
2855 (Decl Summary): Ditto.
2856 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2857 Parser Create Function, Parser Delete Function):
2858 Add new push parser symbols.
2859 (Table of Symbols): Document push-parser, push-pull-parser,
2860 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2861
2862 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2863
2864 Update to GPLv3.
2865 * doc/gpl-3.0.texi: New file.
2866 * doc/gpl.texi: Remove.
2867 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2868 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2869 * README-hacking, TODO, bootstrap, bootstrap.conf:
2870 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2871 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2872 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2873 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2874 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2875 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2876 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2877 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2878 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2879 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2880 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2881 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2882 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2883 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2884 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2885 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2886 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2887 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2888 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2889 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2890 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2891 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2892 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2893 * src/complain.c, src/complain.h, src/conflicts.c:
2894 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2895 * src/files.h, src/flex-scanner.h, src/getargs.c:
2896 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2897 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2898 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2899 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2900 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2901 * src/print.c, src/print.h, src/print_graph.c:
2902 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2903 * src/reduce.h, src/relation.c, src/relation.h:
2904 * src/revision.h, src/scan-code.h, src/scan-code.l:
2905 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2906 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2907 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2908 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2909 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2910 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2911 * tests/existing.at, tests/glr-regression.at:
2912 * tests/headers.at, tests/input.at, tests/java.at:
2913 * tests/local.at, tests/output.at, tests/push.at:
2914 * tests/reduce.at, tests/regression.at, tests/sets.at:
2915 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2916 * tests/torture.at:
2917 Update to GPLv3.
2918
2919 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2920
2921 Get rid of broken %no-parser, -n, and --no-parser implementation and
2922 documentation.
2923 * TODO: Don't mention them.
2924 * doc/bison.1: Likewise.
2925 * doc/bison.texinfo (Decl Summary): Likewise.
2926 (Bison Options): Likewise.
2927 (Option Cross Key): Likewise.
2928 * src/getargs.c (no_parser_flag): Remove global variable.
2929 (usage): Don't print description of -n and --no-parser.
2930 (long_options): Remove --no-parser entry here.
2931 (getargs): Remove -n case in the switch here.
2932 * src/getargs.h (no_parser_flag): Remove extern.
2933 * tests/regression.at (Web2c Actions): Remove comment that mentions
2934 --no-parser.
2935
2936 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2937
2938 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2939 name user variables starting with `yy'. Just pass NULL instead of a
2940 dummy local &yylval to yypush_parse.
2941 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2942 starting with `yy'.
2943
2944 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2945
2946 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2947 true since it's then always used regardless of whether yyoverflow is
2948 defined. Reported by Christian Burger at
2949 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2950 * THANKS: Add Christian Burger.
2951
2952 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2953 node names: say "Decl Summary" not "Bison Declaration Summary".
2954
2955 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2956
2957 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2958 determine whether this function has already complained about an invalid
2959 value for a %define boolean variable, don't check whether Bison has
2960 ever examined the value. As written, the check was a tautology.
2961 Instead, record and check for this complaint using a separate muscle.
2962
2963 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2964
2965 Fix push parsing memory leak reported by Brandon Lucia at
2966 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2967 * THANKS: Add Brandon Lucia.
2968 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2969 but the parse never completed and thus freed it.
2970 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2971 * tests/testsuite.at: Include push.at.
2972 * test/push.at: New.
2973 (Push Parsing: Memory Leak for Early Deletion): New test case.
2974
2975 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2976
2977 Improve handling of multiple S/R conflicts in the same state and of S/R
2978 conflicts involving multiple reductions.
2979 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2980 set for a state here or Bison will abort if it is reassigned on a
2981 later conflicted reduction in the same state.
2982 Similarly, don't finalize and assign the solved conflicts report here
2983 or it will be lost if it is reassigned on a later conflicted reduction
2984 in the same state.
2985 (set_conflicts): Instead, assign them both here after all S/R conflicts
2986 in the state have been fully examined.
2987 * src/print.c (shift_set): Rename to...
2988 (no_reduce_set): ... this.
2989 (print_reductions): Update for rename, and add %nonassoc error action
2990 tokens to no_reduce_set so that, when printing the first remaining
2991 reduction on an error action token, the reduction is enclosed in
2992 brackets.
2993 (print_results): Update for rename.
2994 * tests/conflicts.at (Solved conflicts report for multiple reductions
2995 in a state): New test case.
2996 (%nonassoc error actions for multiple reductions in a state): New test
2997 case.
2998
2999 * src/main.c (main): Don't depend on C99 features.
3000
3001 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3002
3003 * build-aux/.cvsignore: Add compile.
3004 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
3005 uniwidth.
3006
3007 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
3008
3009 * bootstrap (slurp): Create target directories that don't exist.
3010 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
3011
3012 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3013
3014 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
3015 than item number.
3016 * closure.c (closure): Likewise.
3017 * state.h (reductions): Comment sorting of rules.
3018 (state): Comment sorting of items.
3019
3020 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
3021
3022 Fix C++ test cases after recent Gnulib changes. Discussed starting at
3023 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
3024 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
3025 definition in order to avoid Gnulib headers since we don't use config.h
3026 here.
3027 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
3028 rather than AT_DATA so that config.h is included.
3029
3030 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
3031
3032 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
3033 instead of fprintf. Guard these functions with #if YYDEBUG instead of
3034 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
3035 and so that YYFPRINTF is guaranteed to be defined here.
3036
3037 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3038
3039 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
3040 with...
3041 (muscle_percent_define_check_values): ... this more helpful function.
3042 Again, it's not used yet, but it will be.
3043 * src/muscle_tab.h: Likewise.
3044
3045 Improve some comments in parser table construction.
3046 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
3047 (generate_states): Don't mention ruleset, which is internal to closure.
3048 * src/closure.c (closure): Explain sorting of core and itemset, which
3049 is required for this function to behave correctly.
3050 * src/closure.h (closure): Mention sorting.
3051
3052 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
3053
3054 * src/lalr.c (state_lookahead_tokens_count): For code readability,
3055 move the check for disabled transitions to an aver since conflict
3056 resolution hasn't happened yet.
3057
3058 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
3059 labels a state as inconsistent just because it has error transitions.
3060 The original form of this check appeared in revision 1.1 of lalr.c,
3061 which was committed on 1991-12-21. Now (at least), changing the
3062 consistency label on such a state appears to have no useful effect in
3063 any of the places it is examined, which I enumerate below. The key
3064 point to understanding each item in this enumeration is that a state
3065 with an error transition is labelled consistent in the first place only
3066 if it has no rules, so the check cannot matter for states that have
3067 rules. (1) Labelling a state as inconsistent will cause set_conflicts
3068 to try to identify its conflicts, and a state must have *rules* to have
3069 conflicts. (2) Labelling a state as inconsistent will affect how
3070 action_row sets the default *rule* for the state. (3) Labelling a
3071 state as inconsistent will cause build_relations to add lookback edges
3072 to *rules* in that state.
3073 * src/state.h (struct state): Word the comment for member consistent
3074 more carefully.
3075
3076 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3077
3078 Don't depend on C99 features.
3079 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
3080 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
3081 * src/reader.c (check_and_convert_grammar): Fix for-loop.
3082 * src/state.c (state_mark_reachable_states): Fix for-loop.
3083 (state_remove_unreachable_states): Fix for-loop.
3084
3085 Don't widen struct state with member reachable just to temporarily
3086 record reachability. Instead, use a local bitset.
3087 * src/state.h (struct state): Remove member.
3088 * src/state.c (state_new): Don't initialize it.
3089 (state_mark_reachable_states): Rename to...
3090 (state_record_reachable_states): ... this, and use bitset.
3091 (state_remove_unreachable_states): Use bitset.
3092
3093 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3094
3095 * src/Makefile.am (yacc): Quote target action commands properly so
3096 that the yacc script isn't corrupt. Reported by Hans Aberg at
3097 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3098
3099 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3100 the case of pure parsers. Reported by Frans Englich at
3101 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3102 * THANKS: Add Frans Englich.
3103
3104 * NEWS (2.3a+): In the %code entry, reference section `Bison
3105 Declaration Summary' from the manual now since the %code summary has
3106 moved there.
3107 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3108 in the rules section must be terminated by semicolons.
3109
3110 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3111
3112 Extend the front-end API for %define variables to more completely
3113 mirror the back-end. This will be useful in the future.
3114 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3115 Update comments to mention the new front-end counterparts of these
3116 macros.
3117 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3118 for muscle_string_decode and muscle_location_decode.
3119 (muscle_string_decode): New static function.
3120 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3121 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3122 functions.
3123 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3124 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3125 implementation more closely.
3126 (muscle_percent_define_invalid_value): New function.
3127 * src/muscle_tab.h (muscle_percent_define_get,
3128 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3129 Prototype.
3130
3131 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3132
3133 * NEWS (2.3a+): Mention yesterday's state-removal change.
3134 (2.3a): Remove the %language entry, which was added after 2.3a.
3135 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3136 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3137 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3138 tests/existing.at: Update copyright date.
3139
3140 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3141
3142 If conflict resolution makes states unreachable, remove those states,
3143 report rules that are then unused, and don't report conflicts in those
3144 states.
3145 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3146 New global function.
3147 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3148 function.
3149 * src/main.c (main): After conflict resolution, remove the unreachable
3150 states and update all data structures that reference states by number.
3151 * src/state.c (state_new): Initialize each state's reachable member to
3152 false.
3153 (state_mark_reachable_states): New static function.
3154 (state_remove_unreachable_states): New global function.
3155 * src/state.h (struct state): Add member bool reachable.
3156 (state_remove_unreachable_states): Prototype.
3157 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3158 New test case.
3159 * tests/existing.at (GNU pic Grammar): Update test case output now that
3160 an unused rule is discovered.
3161
3162 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3163
3164 Minor code cleanup in parser table construction.
3165 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3166 (new_itemsets, save_reductions): Update for rename to nitemset.
3167 * src/closure.c (nritemset): Rename to...
3168 (nitemset): ... this since the "r" appears to meaningless and isn't
3169 used in the comments.
3170 (closure): Update for rename.
3171 * src/closure.h (nritemset): Update extern to...
3172 (nitemset): ... this.
3173 * src/lalr.c (LA): Fix a typo in comments.
3174 * src/print.c (print_core): Update for rename to nitemset.
3175 * src/print_graph.c (print_graph): Likewise.
3176 * src/state.h: Fix some typos in header comments.
3177
3178 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3179
3180 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3181 still sticks to ASCII. Sorry!
3182
3183 * README-hacking: New file, taken mostly from coreutils, with changes
3184 for Bison. Contains much of the contents of:
3185 * README-cvs: Remove.
3186 * bootstrap: Sync from gnulib.
3187 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3188 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3189
3190 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3191
3192 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3193 Setzer.
3194 (Java Differences): Fix some typos.
3195 * THANKS: Add Sebastian Setzer.
3196
3197 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
3198
3199 * data/java.m4 (b4_single_class_if): Remove.
3200 (b4_abstract_if): Look at "%define abstract".
3201 (b4_lexer_if): New.
3202 (b4_union_name): Rename...
3203 (b4_yystype): ... to this. Map to "%define stype".
3204 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3205 b4_maybe_throws): Fix quoting.
3206 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3207 * data/lalr1.java (Lexer interface): Always define.
3208 (Lexer interface within parser class): Remove.
3209 (YYLexer class): New, used when "%code lexer" is present.
3210 (constructor): When "%code lexer" is used, pass %lex-param
3211 to the lexer constructor.
3212 (yylex, yyparse): Remove %lex-param from method invocations
3213 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3214
3215 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3216 abstract". Rename "%define union_name" to "%define stype".
3217 Rename method names according to previous patch.
3218 (Java Scanner Interface): Describe "%code lexer" instead of
3219 "%pure-parser" and "%define single_class".
3220 (Java Differences): Mention "%code lexer".
3221
3222 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3223 Include scanner here, using macros from tests/local.at.
3224 (AT_DATA_CALC_Y): Remove final argument.
3225 (_AT_CHECK_JAVA_CALC): Likewise.
3226 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3227 of %locations and %error-verbose.
3228 (main): Test with and without %lex-param.
3229 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3230 (AT_BISON_OPTION_POPDEFS): Pop it.
3231
3232 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3233
3234 DJGPP spefic issue. Inhibit the use of disallowed characters for
3235 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3236 and concern testsuite case 46.
3237 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3238 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3239 * djgpp/config.bat: Inhibit the use of disallowed characters.
3240
3241 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3242
3243 Miscellaneous %define and %code cleanup.
3244 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3245 values are interpreted.
3246 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3247 documentation a little more.
3248 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3249 muscle_percent_define_insert, muscle_percent_code_grow): New
3250 functions/macros.
3251 * src/muscle_tab.h (muscle_percent_define_insert,
3252 muscle_percent_code_grow): Prototype.
3253 * src/parse-gram.y (prologue_declaration): Use
3254 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3255 %define and %code directives.
3256
3257 Make it easy to share %define boolean variables between the front-end
3258 and back-end. Though not used yet, this will be useful in the future.
3259 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3260 Bison uses of names rather than just skeleton uses of names.
3261 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3262 b4_percent_define_skeleton_variables(VARIABLE) to
3263 b4_percent_define_bison_variables(VARIABLE).
3264 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3265 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3266 b4_percent_code_bison_qualifiers(QUALIFIER).
3267 (b4_check_user_names_wrap): Update for renames.
3268 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3269 muscle_percent_define_default): New functions mimicking
3270 b4_percent_define_flag_if and b4_percent_define_default.
3271
3272 For %define variables, report locations for invalid values and
3273 redefinitions.
3274 * data/bison.m4 (b4_percent_define_flag_if): Read
3275 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3276 value for VARIABLE.
3277 (b4_percent_define_default): Save a special location in
3278 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3279 must later be reported as invalid.
3280 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3281 functions.
3282 (muscle_percent_define_insert): Record the location of VARIABLE in
3283 muscle percent_define_loc(VARIABLE), and use it to report the previous
3284 location for a redefinition.
3285 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3286 (muscle_percent_define_default): Update like b4_percent_define_default.
3287 (muscle_grow_user_name_list): Rename to...
3288 (muscle_user_name_list_grow): ... this for consistency and use
3289 muscle_location_grow.
3290 * src/muscle_tab.h (muscle_location_grow): Prototype.
3291 * tests/input.at (%define errors): Update expected output.
3292 * tests/skeletons.at (%define boolean variables: invalid skeleton
3293 defaults): New test case.
3294
3295 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3296
3297 * src/print.c (lookahead_set, state_default_rule): Remove.
3298 (print_reductions): Replace state_default_rule invocation with
3299 equivalent use of yydefact, which was computed in token_actions in
3300 tables.c.
3301 (print_results): Don't allocate lookahead_set.
3302
3303 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
3304
3305 * data/lalr1.java: Prefix all private members with yy.
3306
3307 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3308
3309 Use YYFPRINTF instead of fprintf where appropriate. Reported by
3310 Sebastien Fricker at
3311 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
3312 * THANKS: Add Sebastien Fricker.
3313 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3314 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3315 accept a variable number of arguments.
3316
3317 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3318
3319 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3320
3321 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3322
3323 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3324 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3325 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3326
3327 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3328
3329 Undo my 2007-02-07 change, switching back to the c-strcase module
3330 introduced in the 2007-02-03 change. Bruno Haible reported that
3331 the 2007-02-07 change would be dangerous in Turkish if we add a
3332 language whose name contains "i", since "i" is not lowercase "I"
3333 in Turkish.
3334 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3335 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3336 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3337 * m4/.cvsignore: Remove strcase.m4.
3338 * src/getargs.c: Revert 2007-02-07 change, as follows.
3339 Include c-strcase.h.
3340 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3341
3342 2007-02-11 Bruno Haible <bruno@clisp.org>
3343
3344 Enable the Java related testsuite tests when the only Java compiler
3345 found is a gcj < 4.3. Discussed at
3346 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3347 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3348
3349 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3350
3351 * data/Makefile.am: Update copyright date.
3352 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3353 yypstate_new returns NULL.
3354 (yypstate_new): Return NULL if malloc does.
3355 * src/reader.c (packgram): Move translation of rule actions from the
3356 beginning of packgram to...
3357 (check_and_convert_grammar): ... here right before packgram is invoked
3358 so it's easier to write more complete comments, and remove redundant
3359 code.
3360
3361 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3362
3363 As in semantic actions, make @$ in %initial-action, %destructor, and
3364 %printer imply %locations.
3365 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3366 scanning @$.
3367 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3368 (@$ in %initial-action implies %locations,
3369 @$ in %destructor implies %locations,
3370 @$ in %printer implies %locations): ... these new test cases.
3371
3372 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3373
3374 Undo most of the 2007-02-03 change, switching to the strcase module
3375 now that gnulib strcase has been fixed.
3376 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3377 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3378 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3379 * m4/.cvsignore: Add strcase.m4.
3380 * src/getargs.c: Revert 2007-02-03 change, as follows.
3381 Don't include c-strcase.h.
3382 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3383 strcasecmp has "unspecified behavior" outside the POSIX locale,
3384 but it works fine in practice if at least one argument is ASCII,
3385 as is the case in Bison.
3386
3387 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
3388
3389 * tests/java.at: Skip tests if only one of javac/java is present.
3390 Reported by Joel E. Denny.
3391 * tests/atlocal.in: Adjust copyright years.
3392
3393 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
3394
3395 * data/lalr1.java (Stack): Work around old verifiers that disallow
3396 access to the private fields of an inner class, from the outer class.
3397 We can make Stack's fields public because user code doesn't have access
3398 to the instance of Stack used by parse(). Reported by Paul Eggert.
3399
3400 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3401
3402 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3403 the right spot for these files?
3404 * bootstrap.conf (gnulib_modules): Add c-strcase.
3405 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3406 c-strncasecmp.c.
3407 * src/getargs.c: Include c-strcase.h.
3408 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3409 to avoid unspecified behavior.
3410
3411 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3412
3413 * doc/bison.texinfo (Decl Summary): Correct typo.
3414
3415 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
3416
3417 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3418 Complain if the value does not match empty, "true" or "false".
3419 * data/c++.m4: Adjust default definitions of %define variables.
3420 * data/java.m4: Adjust default definitions of %define variables.
3421 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3422 to above behavior.
3423 * tests/input.at (Boolean %define variables): Test new behavior.
3424
3425 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
3426
3427 * NEWS: Mention java.
3428 * TODO: Remove things that are done.
3429 * bootstrap.conf: Add javacomp-script and javaexec-script.
3430 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3431
3432 * data/Makefile.am: Add new files.
3433 * data/java-skel.m4: New.
3434 * data/java.m4: New.
3435 * data/lalr1.java: New.
3436
3437 * doc/bison.texinfo: Put "A Complete C++ Example" under
3438 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3439 under Other Languages.
3440
3441 * src/getargs.c (valid_languages): Add Java.
3442 * src/getargs.h (struct bison_language): Update size of string fields.
3443
3444 * tests/Makefile.am: Add java.at.
3445 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3446 * tests/java.at: New.
3447 * tests/testsuite.at: Include it.
3448
3449 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3450
3451 Clean up.
3452 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3453 at_directive_argv arguments so these no longer have to be global
3454 variables. Also, update the implementation for the following changes.
3455 (fail_for_at_directive_too_many_args,
3456 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3457 (at_directive_name): Remove as at_directive_argv[0] will be used for
3458 this now.
3459 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3460 for the directive name.
3461 (at_directive_argc, at_directive_argv): Make these local within
3462 skel_lex instead of global.
3463 (INITIAL): Update directive start action for above changes.
3464 (SC_AT_DIRECTIVE_ARG): Rename to...
3465 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3466 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3467 (scan_skel): Move yylex_destroy to...
3468 (skel_scanner_free): ... here.
3469 * tests/skeletons.at (installed skeleton file name): Rename to...
3470 (installed skeleton file names): ... this.
3471
3472 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3473
3474 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3475 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3476 Summary" not "Directives".
3477 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3478 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3479 since the former is now the more complete one.
3480 (Prologue Alternatives): Likewise and do the same for %defines.
3481 (Table of Symbols): Add summary of %code, add summary of %define, and
3482 move full %code documentation to...
3483 (Decl Summary): ... here for consistency with other entries in these
3484 sections.
3485 Move %define entry in order to keep this list alphabetized.
3486 Reword %define entry a little to put less emphasis on the skeleton
3487 concept, which most users shouldn't have to think about.
3488
3489 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3490
3491 Adjust to recent gnulib changes.
3492 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3493 Add string.h, string_.h, unistd_.h, wchar_.h.
3494 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3495 * src/system.h: Don't include <stpcpy.h>; this is now done by
3496 <string.h>.
3497
3498 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
3499
3500 Simplify implementation of unqualified %code, implement macros for
3501 uniform treatment of boolean %define flags. Document %define.
3502 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3503 b4_percent_code_ifdef): New.
3504 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3505 * data/c++.m4: Define default value for global_tokens_and_yystype.
3506 * data/glr.cc: Likewise.
3507 * data/location.cc: Use b4_percent_define_flag_if.
3508
3509 * doc/bison.texinfo (Decl Summary): Document %define.
3510
3511 * src/parse-gram.y (Unqualified %code): Change muscle name to
3512 b4_percent_code().
3513 (content.opt): Default to empty.
3514
3515 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3516
3517 Implement support for relative and absolute skeleton file names.
3518 Discussed starting at
3519 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3520 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3521 (Bison Options): Document in --skeleton entry.
3522 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3523 full_skeleton can't necessarily hold all of pkgdatadir.
3524 If the specified skeleton file name contains a `/', don't prepend
3525 pkgdatadir.
3526 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3527 file name contains a `/', prepend the grammar file directory.
3528 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3529 * skeletons.at: New file.
3530 (relative skeleton file names): New test case.
3531 (installed skeleton file names): New test case.
3532 * tests/testsuite.at: Include skeletons.at.
3533
3534 * bootstrap: Update copyright to 2007.
3535
3536 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
3537
3538 * bootstrap: Remove occurrences of .#bootmp from the files.
3539
3540 2007-01-17 Akim Demaille <akim@epita.fr>
3541
3542 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3543 nonterminals.
3544 Use per-type %printer.
3545
3546 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3547
3548 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3549 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3550 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3551 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3552 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3553 tests/glr-regression.at, tests/input.at, tests/local.at,
3554 tests/output.at, tests/torture.at: Update copyright to 2007.
3555
3556 2007-01-16 Akim Demaille <akim@epita.fr>
3557
3558 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3559 error code.
3560 (Calc++ Scanner): Exit with failure if we can't open the input
3561 file.
3562 Accept "-" standing for stdin.
3563 (Calc++ Top Level): Print the result only if the parsing was
3564 successful.
3565
3566 2007-01-16 Akim Demaille <akim@epita.fr>
3567
3568 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3569
3570 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
3571 and Joel E. Denny <jdenny@ces.clemson.edu>
3572
3573 Clean up %define and %code implementation in M4 some. Most
3574 importantly, rename all related macros to be in the b4_percent_define
3575 and b4_percent_code namespaces. Also, complete support for `.' in
3576 %define variable names and %code qualifiers.
3577 * data/bison.m4 (b4_check_user_names): Check for special
3578 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3579 m4_foreach loops.
3580 (b4_get_percent_define, b4_get_percent_code): Rename to...
3581 (b4_percent_define_get, b4_percent_code_get): ... these.
3582 Extend documentation with examples.
3583 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3584 b4_percent_define_skeleton_variables and
3585 b4_percent_code_skeleton_qualifiers.
3586 Expect any value for the %define variable `foo' to be stored in the
3587 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3588 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3589 expect any unqualified %code blocks to be stored in a macro named
3590 `b4_percent_code_unqualified'.
3591 Use m4_indir so that %define variable names and %code qualifiers can
3592 contain `.', which is allowed by the grammar parser.
3593 (b4_percent_define_default): New macro to set a default value for a
3594 %define variable.
3595 (m4_wrap): Update wrapped code, and fix some underquoting.
3596 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3597 Expect grammar uses of %define variables and %code qualifiers to be
3598 defined in b4_percent_define_user_variables and
3599 b4_percent_code_user_qualifiers.
3600 * data/c++.m4: Use b4_percent_define_default rather than
3601 m4_define_default. Fix some underquoting. Skeleton usage of %define
3602 variable define_location_comparison now implies skeleton usage of
3603 %define variable filename_type.
3604 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3605 data/push.c, data/yacc.c: Update macro names.
3606 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3607 muscle names.
3608
3609 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3610
3611 DJGPP specific issues.
3612
3613 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3614 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3615
3616 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3617
3618 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3619 run parsers in all tests so that Valgrind is invoked during
3620 maintainer-check-valgrind.
3621 (Duplicate representation of merged trees): Free all semantic values.
3622 (Duplicated user destructor for lookahead): Likewise.
3623
3624 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3625
3626 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3627 command-line prefix.
3628 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3629 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3630 miss Valgrind messages.
3631 (Exploding the Stack Size with Malloc): Likewise.
3632
3633 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3634
3635 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3636 locals. Reported by Juan Manuel Guerrero at
3637 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3638 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3639 Fix some indentation also.
3640 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3641 explaining this issue.
3642
3643 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
3644 and Joel E. Denny <jdenny@ces.clemson.edu>
3645
3646 Simplify union and prologue handling, and escape union and lex/parse
3647 params with digraphs.
3648 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3649 values to the empty string since these are no longer guaranteed
3650 initialized by the front-end.
3651 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3652 braces around b4_user_stype since this is no longer done by the
3653 front-end.
3654 * src/files.c, src/files.h (pre_prologue_obstack,
3655 post_prologue_obstack): Remove.
3656 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3657 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3658 with digraphs. This fixes lex params and parse params.
3659 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3660 * src/output.c (prepare): Remove muscle insertion of the prologues.
3661 (output): Remove freeing of pre_prologue_obstack and
3662 post_prologue_obstack.
3663 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3664 than prologue_augment for prologue parsing so you don't need prologue
3665 obstacks.
3666 (grammar_declaration): For %union RHS, use `braceless' instead of
3667 "{...}" so that braces are already stripped and code is escaped with
3668 digraphs.
3669 * src/reader.c (prologue_augment): Remove.
3670 (reader): Remove initialization of pre_prologue_obstack and
3671 post_prologue_obstack.
3672 * src/reader.h (prologue_augment): Remove.
3673
3674 * data/c.m4: Remove stray parenthesis.
3675
3676 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3677
3678 Remove quotes from variables names in %define directives and from
3679 qualifiers in %code directives, and restrict the characters that are
3680 allowed in them to M4-friendly ones. For %define, continue to support
3681 the quoted form as a deprecated feature. Discussed starting at
3682 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3683 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3684 %code.
3685 * doc/bison.texinfo (Prologue Alternatives): Update.
3686 (Decl Summary): In %defines entry, update mention of `%code requires'
3687 and `%code provides'.
3688 (C++ Location Values): Update %define uses.
3689 (Calc++ Parser Interface): Likewise.
3690 (Calc++ Parser): Likewise, and update `%code requires' uses.
3691 (Table of Symbols): Update %code documentation.
3692 * src/parse-gram.y (prologue_declaration): For %define variables, use
3693 `variable' instead of `STRING'.
3694 (grammar_declaration): For %code qualifiers, use `ID' instead of
3695 `STRING'.
3696 (variable): New nonterminal that takes an `ID' or a `STRING'.
3697 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3698 and %define uses.
3699 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3700 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3701 (%define errors): Update %define uses.
3702
3703 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3704
3705 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3706 instead of muscle_insert for %define values so that M4-special
3707 characters are replaced with digraphs.
3708 * tests/input.at (%define errors): Extend to check weird values.
3709
3710 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3711
3712 Instead of having skeletons declare all valid %define variables and
3713 %code qualifiers, provide macros that retrieve the associated values
3714 and build these lists automatically. Thus Bison will now warn when a
3715 variable or qualifier is not used by the skeleton in the current
3716 invocation regardless of whether it might sometimes be used by that
3717 skeleton in other invocations. Also, move all %define value macros to
3718 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3719 form, which is replaced by %code.
3720 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3721 (b4_check_user_names): ... this, and change the series of valid name
3722 arguments to a single list argument for names used in the skeleton
3723 similar to the existing list argument for names used in the grammar.
3724 Warn instead of complaining.
3725 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3726 values and %code code, to format %code code properly, and to build
3727 lists of all %define variables and %code qualifiers used in the
3728 skeleton: b4_skeleton_percent_define_variables and
3729 b4_skeleton_percent_code_qualifiers.
3730 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3731 Remove, and...
3732 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3733 the skeleton names lists can finish building first. In place of
3734 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3735 expect the lists b4_user_percent_define_variables and
3736 b4_user_percent_code_qualifiers.
3737 * data/c++.m4: Where setting default values for b4_parser_class_name,
3738 b4_location_type, b4_filename_type, b4_namespace, and
3739 b4_define_location_comparison, update their names to the
3740 b4_percent_define_ namespace.
3741 * data/glr.c: Don't use b4_check_percent_define_variables and
3742 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3743 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3744 (b4_parser_class_name, b4_namespace): Define these using
3745 b4_get_percent_define for parser_class_name and namespace.
3746 * data/location.cc: Use b4_get_percent_define.
3747 * data/push.c: Don't use b4_check_percent_define_variables and
3748 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3749 * data/yacc.c: Likewise, and don't call m4_exit in
3750 b4_use_push_for_pull_if or m4_wrap code will never execute.
3751 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3752 Rename to...
3753 (muscle_grow_user_name_list): ... this for consistency with the
3754 terminology used in bison.m4.
3755 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3756 %define variable names, and rename muscle used_percent_define_variables
3757 to user_percent_define_variables.
3758 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3759 user_percent_code_qualifiers.
3760 (content): Remove.
3761 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3762 {CODE} form is no longer accepted.
3763 * tests/input.at (Reject bad %code qualifiers): Rename to...
3764 (Reject unused %code qualifiers): ... this, and update test output.
3765 (%define error): Update test output.
3766
3767 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3768
3769 Check for unrecognized %define variables similar to checking for
3770 unrecognized %code qualifiers. Check for redefined %define variables.
3771 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3772 generalizes...
3773 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3774 (b4_check_percent_define_variables): New, also wraps it.
3775 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3776 variables using b4_check_percent_define_variables.
3777 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3778 all those exercised in the test suite and all those listed in the
3779 `Default values' section of c++.m4. Are there others?
3780 * data/push.c, data/yacc.c: Declare no valid %define variables.
3781 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3782 similar to muscle_find, but it works even when the muscle stores a
3783 const value.
3784 (muscle_grow_used_name_list): New function for constructing the used
3785 name list muscles that b4_check_for_unrecognized_names requires.
3786 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3787 %define'd more than once. Define the b4_used_percent_define_variables
3788 muscle with muscle_grow_used_name_list.
3789 (grammar_declaration): Abbreviate %code code with
3790 muscle_grow_used_name_list.
3791 * tests/input.at (%define errors): New.
3792
3793 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3794
3795 Provide warn_at, complain_at, and fatal_at function callbacks to the
3796 skeletons, and use this for %code qualifier complaints.
3797 * data/bison.m4 (b4_error_at): New, invoked by...
3798 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3799 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3800 @fatal_at(...@) directives.
3801 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3802 qualifiers in b4_used_percent_code_qualifiers and to use
3803 b4_complain_at.
3804 * src/location.c, src/location.h (boundary_set_from_string): New global
3805 function.
3806 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3807 function.
3808 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3809 to b4_used_percent_code_qualifiers.
3810 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3811 function.
3812 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3813 (lineno): Rename to...
3814 (out_lineno): ... this so I don't misunderstand it again.
3815 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3816 here; these newlines are in the input but not the output file.
3817 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3818 (at_directive_perform): ... this new static function, and add handling
3819 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3820 directives.
3821 * tests/input.at (Reject bad %code qualifiers): Update test output with
3822 locations and extend.
3823
3824 * tests/output.at (Output file name: [, Output file name: ]): Remove
3825 bogus comment about these tests failing.
3826
3827 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3828
3829 Clean up b4_check_percent_code_qualifiers a little.
3830 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3831 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3832 documentation and add examples.
3833 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3834 qualifiers here.
3835
3836 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3837
3838 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3839 unreliable -- especially when they're hidden inside another macro.
3840 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3841 data/c.m4: Remove m4_divert(-1).
3842 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3843 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3844 m4_divert_push(0) and m4_divert_pop(0).
3845 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
3846 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3847 pushed and popped by m4sugar, should be first on the stack.
3848
3849 Provide warn, complain, and fatal function callbacks to the skeletons.
3850 This provides more flexibility than m4_fatal, improves the error
3851 message format, and captures messages for translation. Discussed
3852 starting at
3853 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3854 * data/bison.m4 (b4_error): New, invoked by...
3855 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3856 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3857 directives. Because these M4 macros might be called when the current
3858 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3859 the previous removal of uses of m4_divert, which caused trouble.
3860 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3861 m4_fatal to report unrecognized %code qualifiers.
3862 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3863 push parser requests.
3864 * data/glr.c: Use b4_complain instead of m4_fatal to report
3865 non-deterministic push parser requests.
3866 Update @output usage to @output(...@) form.
3867 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3868 report missing %defines. Update @output usage to @output(...@) form.
3869 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3870 @output(...@) form.
3871 * src/main.c (main): Invoke skel_scanner_free.
3872 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3873 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3874 obstack_for_string from flex-scanner.h.
3875 (YY_DECL): Use to declare skel_lex static.
3876 (decode_at_digraphs): Remove; now handled in the new
3877 SC_AT_DIRECTIVE_ARG start condition.
3878 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3879 functions.
3880 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3881 at_directive_argv): New static globals.
3882 (INITIAL): Use fail_for_invalid_at.
3883 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3884 recognize the start of a generalized `@directive(...@)' form and
3885 start...
3886 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3887 directive args (using the new obstack_for_string), to decode the
3888 contained @ diagraphs, and to perform the directive. It recognizes
3889 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3890 @output(...@).
3891 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3892 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3893 `@,'.
3894 (scan_skel): Initialize obstack_for_string on the first call.
3895 (skel_scanner_free): New function to free obstack_for_string.
3896 * tests/input.at (Reject bad %code qualifiers): Update test output.
3897
3898 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3899
3900 Consolidate the 4 prologue alternative directives (%code, %requires,
3901 %provides, and %code-top) into a single %code directive with an
3902 optional qualifier field. Discussed at
3903 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3904 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3905 alternatives.
3906 * doc/bison.texinfo (Prologue Alternatives): Update.
3907 (Decl Summary): Update to %code "requires" and %code "provides".
3908 (Calc++ Parser): Update to %code "requires".
3909 (Table of Symbols): Remove entries for %requires, %provides, and
3910 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3911 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3912 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3913 which are skeleton-specific.
3914 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3915 declare what %code qualifiers it supports and to complain if any other
3916 qualifiers were used in the grammar.
3917 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3918 and b4_user_code([b4_percent_code_provides]) in place of
3919 b4_user_requires and b4_user_provides.
3920 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3921 Add b4_user_code([b4_percent_code_top]) and
3922 b4_user_code([b4_percent_code]).
3923 Invoke b4_check_percent_code_qualifiers.
3924 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3925 PERCENT_REQUIRES): Remove.
3926 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3927 %requires. Rewrite the %code RHS as the unqualified form defining the
3928 muscle b4_percent_code. Add another RHS for the qualified %code form,
3929 which defines muscles of the form b4_percent_code_QUALIFIER and the
3930 b4_used_percent_code_qualifiers muscle.
3931 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3932 PERCENT_REQUIRES): Remove.
3933 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3934 %code "requires" and %code "provides".
3935 * tests/input.at (Reject bad %code qualifiers): New.
3936
3937 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3938
3939 Use the new code_props interface for destructors and printers.
3940 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3941 printer_location members, and change the type of the destructor and
3942 printer members to code_props.
3943 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3944 symbol_printer_get, semantic_type_destructor_set,
3945 semantic_type_printer_set, default_tagged_destructor_set,
3946 default_tagless_destructor_set, default_tagged_printer_set,
3947 default_tagless_printer_set): Use code_props in arguments and return
3948 types in place of char const * and location.
3949 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3950 since the locations are now contained in the return of
3951 symbol_destructor_get and symbol_printer_get.
3952 * src/output.c (symbol_destructors_output, symbol_printers_output):
3953 Replace with...
3954 (symbol_code_props_output): ... this to eliminate duplicate code.
3955 (output_skeleton): Update to use symbol_code_props_output.
3956 * src/reader.c (symbol_should_be_used): Update use of
3957 symbol_destructor_get.
3958 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3959 Update uses of the various _destructor_set and _printer_set functions.
3960 * src/symtab.c: (default_tagged_destructor_location,
3961 default_tagless_destructor_location, default_tagged_printer_location,
3962 default_tagless_printer_location): Remove since we...
3963 (default_tagged_destructor, default_tagless_destructor,
3964 default_tagged_printer, default_tagless_printer): ... change the type
3965 of these to code_props.
3966 (symbol_new, semantic_type_new, symbol_destructor_set,
3967 semantic_type_destructor_set, symbol_destructor_get,
3968 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3969 symbol_check_alias_consistency, default_tagged_destructor_set,
3970 default_tagless_destructor_set, default_tagged_printer_set,
3971 default_tagless_printer_set): Update.
3972 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3973 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3974 code_props members.
3975 (symbol_print): Use SYMBOL_CODE_PRINT.
3976
3977 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3978
3979 Use the new code_props interface for rule actions.
3980 * src/symlist.h (symbol_list): Replace action, action_location, and
3981 used members with a code_props action_props member.
3982 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3983 grammar_midrule_action, grammar_current_rule_merge_set,
3984 grammar_current_rule_symbol_append, packgram): Update.
3985 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3986 * src/scan-code.l (handle_action_dollar): Update.
3987 (translate_rule_action): Remove, no longer used.
3988 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3989
3990 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3991
3992 Use the new code_props interface in parse-gram.y.
3993 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3994 Update all uses of translate_* functions to use the new code_props
3995 interface and to use gram_scanner_last_string_free and
3996 code_scanner_last_string_free where possible.
3997 (grammar_declaration): symbol_list_destructor_set and
3998 symbol_list_printer_set now perform the translation, so don't do it
3999 here. Use gram_scanner_last_string_free where possible.
4000 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
4001 translate_code): Remove, no longer used.
4002 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
4003 symbol_list_printer_set): Perform code translation here rather than
4004 depending on the caller to do so.
4005
4006 * src/symlist.h (struct symbol_list): Correct some documentation typos.
4007 * src/scan-gram.h (gram_last_string): Remove declaration.
4008 * src/scan-gram.l (last_string): Declare it static.
4009
4010 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4011
4012 Encapsulate code properties and related functionality for the various
4013 destructors, printers, and actions into a code_props structure and
4014 interface. This patch merely implements code_props in scan-code.h and
4015 scan-code.l. Future patches will rewrite other modules to use it.
4016 Discussed starting at
4017 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
4018 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
4019 consistently initialize const structs that have an empty location
4020 field.
4021 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
4022 to ensure consistency.
4023 * src/scan-code.h (code_props): New structure.
4024 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
4025 function, macro, and const global variable for initializing a
4026 code_props with no code.
4027 (code_props_plain_init, code_props_symbol_action_init,
4028 code_props_rule_action_init, code_props_translate_code): The rest of
4029 the new code_props functional interface. Among other things, the init
4030 functions set the code_props kind field so that
4031 code_props_translate_code will know whether to behave like
4032 translate_symbol_action, translate_rule_action, or translate_code.
4033 These old translate functions must remain until all other modules are
4034 updated to use the new code_props interface.
4035 (code_scanner_last_string_free): New function similar to
4036 gram_scanner_last_string_free.
4037 (code_scanner_free): Add documentation.
4038 * src/scan-code.l: Implement the new interface.
4039 (code_lex): Make it static, add a code_props* argument, and remove the
4040 rule argument.
4041 (last_string): New static global similar to the one in scan-gram.l.
4042 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
4043 instead of rule.
4044 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
4045 code_props since Bison may one day use this information for destructors
4046 and printers.
4047 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
4048 (handle_action_dollar): Use symbol_list_n_get and set used flag
4049 directly since symbol_list_n_used_set is removed.
4050 (translate_action): Add a code_props* argument and remove the rule,
4051 action, and location arguments. Pass the code_props* on to code_lex.
4052 (translate_rule_action, translate_symbol_action, translate_code):
4053 Rewrite as wrappers around the new code_props interface.
4054 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
4055 it would eventually need to break the encapsulation of code_props.
4056
4057 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4058
4059 * etc/.cvsignore: New.
4060
4061 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4062
4063 Add maintainer-push-check to run maintainer-check using push parsing in
4064 place of pull parsing where available.
4065 * Makefile.am (maintainer-push-check): New.
4066 * data/bison.m4 (b4_use_push_for_pull_if): New.
4067 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
4068 appropriately based on their existing values.
4069 (yypush_parse): Don't print push-parser-specific diagnostics if push
4070 parsing is being used in place of pull parsing.
4071 * data/yacc.c: If push parsing should replace pull parsing, redirect to
4072 push.c.
4073 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
4074 variable, and insert b4_use_push_for_pull_flag into muscles.
4075 * tests/Makefile.am (maintainer-push-check): New.
4076
4077 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4078
4079 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
4080 (whether successful or failed) so that yypush_parse can be invoked
4081 again to start a new parse using the same yypstate.
4082 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
4083 check multiple yypull_parse invocations on the same yypstate. For pull
4084 mode, extend to check multiple yyparse invocations.
4085 (Exploding the Stack Size with Alloca): Extend to try with
4086 %push-pull-parser.
4087 (Exploding the Stack Size with Malloc): Likewise.
4088
4089 * tests/calc.at (Simple LALR Calculator): Don't specify
4090 %skeleton "push.c" since %push-pull-parser implies that now.
4091 * tests/headers.at (export YYLTYPE): Don't check for the push
4092 declarations. Otherwise, this test case can't be used to see if push
4093 mode can truly emulate pull mode.
4094 * tests/input.at (Torturing the Scanner): Likewise.
4095 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4096 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4097 AT_YACC_IF, which now includes the case of push mode since %skeleton
4098 need not be used for push mode. This will be more intuitive once
4099 push.c is renamed to yacc.c.
4100
4101 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4102
4103 For push mode, convert yyparse from a macro to a function, invoke yylex
4104 instead of passing a yylexp argument to yypull_parse, and don't
4105 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4106 Discussed starting at
4107 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4108 * data/bison.m4 (b4_pull_if): New.
4109 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4110 * data/push.c: Improve M4 quoting a little.
4111 (b4_generate_macro_args, b4_parenthesize): Remove.
4112 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4113 any time a pull parser is requested.
4114 Don't #define this as a wrapper around yypull_parse. Instead, when
4115 both push and pull are requested, make it a function that does that
4116 same thing.
4117 (yypull_parse): If there's a b4_prefix, #define this to
4118 b4_prefix[pull_parse] when both push and pull are requested.
4119 Don't define this as a function unless both push and pull are
4120 requested.
4121 Remove the yylexp argument and hard-code yylex invocation instead.
4122 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4123 %push-parser.
4124 * src/getargs.c (pull_parser): New global initialized to true.
4125 * getargs.h (pull_parser): extern it.
4126 * src/output.c (prepare): Insert pull_flag muscle.
4127 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4128 (prologue_declaration): Set both push_parser and pull_parser = true for
4129 %push-pull-parser. Set push_parser = true and pull_parser = false for
4130 %push-parser.
4131 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4132 %push-parser since there's no backward-compatibility concern here.
4133 Scan %push-pull-parser.
4134 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4135 instead of %push-parser.
4136 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4137 prototype it in the module that calls yyparse.
4138 * tests/input.at (Torturing the Scanner): Likewise.
4139 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4140
4141 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4142
4143 Update etc/bench.pl. Optimize push mode a little (the yyn change
4144 deserves most of the credit).
4145 * Makefile.am (SUBDIRS): Add etc subdirectory.
4146 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4147 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4148 yytoken, yyval, and yyloc declarations to...
4149 (yyparse or yypush_parse): ... here to improve performance. For
4150 yypush_parse invocations after the first, be sure to assign yyn its old
4151 value again.
4152 (yypstate_new): Don't bother initializing the yyresult field since the
4153 initial value isn't used.
4154 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4155 remove the #define that, in push mode, set it to yyps->NAME.
4156 * etc/Makefile.am: New.
4157 * etc/bench.pl: Remove and build it instead from...
4158 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4159 "tests/bison" from the build directory by default rather than just
4160 invoking "bison" from $PATH.
4161 (calc_grammar): Update push parser code: don't declare yylval globally,
4162 don't define yyparse_wrapper, and don't #define yyparse.
4163 (bench_grammar): Update to check all working combinations of yacc.c,
4164 push.c, impure, pure, pull, and push.
4165
4166 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4167
4168 For push mode, add pull wrappers around yypush_parse.
4169 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4170 (yypull_parse): New function wrapping yypush_parse.
4171 (yyparse): New #define wrapping yypull_parse.
4172 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4173 is declared.
4174 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4175 prototype yylex in the module that calls yyparse, and don't prototype
4176 yyparse there. Otherwise, the yyparse expansion won't compile.
4177 * tests/input.at (Torturing the Scanner): Likewise.
4178
4179 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4180
4181 Enable push parsers to operate in impure mode. Thus, %push-parser no
4182 longer implies %pure-parser. The point of this change is to move
4183 towards being able to test the push parser code by running the entire
4184 test suite as if %push-parser had been declared.
4185 * data/push.c (yypush_parse): For impure mode, remove the
4186 yypushed_char, yypushed_val, and yypushed_loc arguments.
4187 Instead, declare these as local variables initialized to the global
4188 yychar, yylval, and yylloc.
4189 For the first yypush_parse invocation only, restore the initial values
4190 of these global variables when it's time to read a token since they
4191 have been overwritten.
4192 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4193 %push-parser.
4194 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4195 %pure-parser along with %push-parser since this test case was designed
4196 for pure push parsers.
4197 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4198 (AT_YACC_OR_PUSH_IF): New.
4199 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4200 add a note that it's still wrong for some cases (as it has been for a
4201 while).
4202 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4203 %push-parser no longer implies %pure-parser.
4204
4205 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4206
4207 Remove some unnecessary differences between the pull parser code and
4208 the push parser code. This patch enables yynerrs in push mode.
4209 * data/push.c: Reformat M4 a little.
4210 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4211 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4212 because push mode is on. Instead, if pure mode is on, move yynerrs
4213 to...
4214 (b4_declare_parser_state_variables): ... here.
4215 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4216 to yyps->NAME so it can be used in yypush_parse.
4217 (yypush_parse): Don't omit uses of yynerrs in push mode.
4218
4219 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4220
4221 Fix bug such that the first pushed token's value and location are
4222 sometimes overwritten (sometimes by %initial-action) before being used.
4223 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4224 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4225 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4226 more closely mimic the pull parser logic.
4227 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4228 time to read a token, which is after any initialization of yylval and
4229 yylloc.
4230 (gottoken): Rename label to...
4231 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4232 user namespace.
4233
4234 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4235
4236 Rearrange initialization of the parser state variables so that the
4237 skeleton doesn't have to have a copy for pull mode and another for push
4238 mode. This patch also fixes at least a bug such that yylloc was not
4239 initialized (with b4_location_initial_line and
4240 b4_location_initial_column) upon calling yypush_parse. However, that
4241 initialization now overwrites the first token's location;
4242 %initial-action assigning @$ already did the same thing, and both bugs
4243 will be fixed in a later patch.
4244 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4245 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4246 yyss, yyvs, yyls, and yystacksize.
4247 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4248 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4249 yylsp.
4250 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4251 yyps->NAME so it can be used in yypush_parse.
4252 (yyparse or yypush_parse): For yypush_parse, don't print the
4253 "Starting parse" diagnostic for invocations after the first.
4254 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4255 yypush_parse, only do it for the first invocation.
4256 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4257 initialization to occur in yypush_parse but only on the first
4258 invocation.
4259
4260 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4261
4262 * data/push.c: Add CPP guards around push parser declarations in both
4263 the header and the code file.
4264 In the code file, move the push parser declarations to the same place
4265 they appear in the header file.
4266 Clean up the M4 some, especially the inconsistent underquoting in
4267 some b4_c_function_def and b4_c_function_decl uses.
4268
4269 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4270
4271 Encapsulate the push parser state variables into an M4 macro so the
4272 push skeleton doesn't have to list them again for pull mode's yyparse.
4273 For push mode, remove yypush_parse's local equivalents of these
4274 variables to eliminate unnecessary copying between the two sets at
4275 run-time. This patch also fixes at least a bug related to multiple
4276 %initial-action invocations in push mode.
4277 * data/push.c (b4_declare_parser_variables): Rename to...
4278 (b4_declare_scanner_communication_variables): ... this for clarity and
4279 update both uses.
4280 (b4_declare_yyparse_variables): Remove and move its contents to the one
4281 spot where it was invoked.
4282 (b4_declare_parser_state_variables): New macro containing the parser
4283 state variables required by push mode.
4284 (struct yypstate): Replace all fields but yynew with
4285 b4_declare_parser_state_variables.
4286 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4287 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4288 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4289 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4290 parser state variable declarations with
4291 b4_declare_parser_state_variables.
4292 Don't initialize parser state variables when calling yypush_parse since
4293 yypstate_new already does that.
4294 Invoke the user's initial action only upon the first yypush_parse
4295 invocation.
4296 Remove all code that copies between the local parser state variables
4297 and the yypstate.
4298
4299 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4300
4301 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4302 prevent a name collision in a future patch where these names will
4303 sometimes be #define'd.
4304 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4305 since it no longer has the same name as the existing argument.
4306 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4307
4308 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
4309 and Joel E. Denny <jdenny@ces.clemson.edu>
4310
4311 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4312 that the argument is case-insensitive, and there's no `=' here.
4313 For the %skeleton entry, mention that %language is better.
4314 (Bison Options): Likewise for --language and --skeleton. Move the
4315 --skeleton entry so that the `Tuning the parser' section is sorted
4316 alphabetically on long options.
4317 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4318 %language directive in detail here; cross-reference the %language
4319 documentation instead.
4320 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4321 `%require "2.3b"' so that the example is always up-to-date.
4322 (Table of Symbols): Add entries for %language and %skeleton.
4323 * examples/extexi (normalize): Instead of replacing every %require
4324 argument with the current Bison version, just substitute for
4325 `@value{VERSION}'. This guarantees that we're testing what actually
4326 appears in the documentation.
4327 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4328 rather than `@VERSION@'.
4329
4330 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4331
4332 * NEWS: Reword the %language news a bit, and put it earlier.
4333
4334 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4335 Rewrite to simplify the logic.
4336 (language_argmatch): Likewise.
4337 (program_name): We now own this var.
4338 * src/getargs.h (struct bison_language): Use char[] rather than
4339 const char *.
4340
4341 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4342 Java is supported.
4343 * src/complain.c (program_name): Remove decl; no longer needed.
4344 * src/main.c (program_name): Remove; now belongs to getargs.
4345
4346 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
4347
4348 * NEWS: Document %language.
4349
4350 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4351
4352 * data/c-skel.m4, data/c++-skel.m4: New files.
4353 * data/glr.c: Complain on push parsers.
4354
4355 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4356 over %skeleton.
4357 (Decl Summary): Document %language and %skeleton.
4358 (Command line): Document -L.
4359
4360 * examples/extexi: Rewrite %require directive.
4361 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4362
4363 * src/files.c (compute_exts_from_gc): Look in language structure
4364 for .y extension.
4365 (compute_file_name_parts): Check whether .tab should be added.
4366 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4367 (language, skeleton_arg, language_argmatch): New.
4368 (long_options): Add --language.
4369 (getargs): Use skeleton_arg, add -L/--language.
4370 * src/getargs.h: Include location.h.
4371 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4372 * src/output.c (prepare): Pick default skeleton from struct language.
4373 Don't dispatch C skeletons here.
4374 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4375 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4376 * src/scan-gram.l ("%language"): New rule.
4377
4378 * tests/calc.at: Test %skeleton and %language.
4379 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4380 (AT_GLR_IF): Look for %skeleton "glr.cc".
4381 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4382 (AT_YACC_IF): Reject %language.
4383
4384 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4385
4386 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4387 since it wasn't used; only the typedef name 'semantic_type' is needed.
4388 Also, omit trailing white space.
4389
4390 * bootstrap: Sync from coreutils.
4391 (gnulib_extra_files): Add build-aux/announce.gen.
4392 (slurp): Adjust .gitignore files like .cvsignore files.
4393 * build-aux/announce-gen: Remove from CVS, since bootstrap
4394 now creates this.
4395
4396 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4397
4398 Make %push-parser imply %pure-parser. This fixes several bugs; see
4399 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4400 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4401 pure_parser = true.
4402 * data/push.c: Don't bother testing b4_push_if when deciding whether
4403 to expand b4_declare_parser_variables globally.
4404 (yypush_parse): Likewise in here.
4405
4406 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4407 (yy_reduce_print): Reformat M4 for readability.
4408
4409 2006-12-15 Bob Rossi <bob@brasko.net>
4410 and Joel Denny <jdenny@ces.clemson.edu>
4411
4412 * data/push.c (yypstate): Add typedef, and update all uses of
4413 struct yypstate to just yypstate.
4414 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4415
4416 2006-12-14 Bob Rossi <bob@brasko.net>
4417
4418 * data/push.c (yypush_parse): Declare prototype regardless of
4419 %locations option.
4420
4421 2006-12-14 Bob Rossi <bob@brasko.net>
4422
4423 * data/push.c (yyparse): Remove the prototype and the #define when in
4424 push-parser mode.
4425
4426 2006-12-13 Bob Rossi <bob@brasko.net>
4427
4428 * data/push.c (yypstate_init): Rename to...
4429 (yypstate_new): ... this and use b4_c_function_def.
4430 (yypstate_delete): New.
4431 (yypush_parse): Change parameters yynval and yynlloc to be const.
4432 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4433 yypstate_delete functions.
4434
4435 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4436
4437 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4438 strange test case titles. Reported by Bob Rossi.
4439
4440 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4441
4442 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4443 of potential ambiguities in GLR grammers.
4444
4445 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4446
4447 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4448 `bison ', use m4_index instead of m4_substr since chopping up a string
4449 containing M4-special characters causes problems here.
4450
4451 Fix a couple of bugs related to special characters in user-specified
4452 file names, and make it easier for skeletons to compute output file
4453 names with the same file name prefix as Bison-computed output file
4454 names.
4455 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4456 b4_parser_file_name and b4_spec_defines_file instead of
4457 @output_parser_name@ and @output_header_name@, which are now redundant.
4458 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4459 b4_parser_file_name, b4_spec_defines_file, and the new
4460 @basename(FILENAME@) instead of @output_parser_name@ and
4461 @output_header_name@, which inappropriately escaped the file names as
4462 C string literals.
4463 * src/files.c (all_but_ext): Remove static qualifier.
4464 (compute_output_file_names): Move `free (all_but_ext)' to...
4465 (output_file_names_free): ... here since all_but_ext is needed later.
4466 * src/files.h (all_but_ext): Extern.
4467 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4468 exactly what MUSCLE_INSERT_STRING used to do.
4469 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4470 characters are escaped properly.
4471 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4472 all_but_ext.
4473 For pkgdatadir muscle, maintain previous functionality by using
4474 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4475 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4476 digraphs would never be expanded. Hopefully no one has M4-special
4477 characters in his Bison installation path.
4478 * src/scan-skel.l: Don't parse @output_header_name@ and
4479 @output_parser_name@ anymore since they're now redundant.
4480 In @output, use decode_at_digraphs.
4481 Parse a new @basename command that invokes last_component.
4482 (decode_at_digraphs): New.
4483 (BASE_QPUTS): Remove unused.
4484 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4485 (Output file name): New tests.
4486
4487 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4488
4489 Warn about output files that are generated by the skeletons and that
4490 conflict with other output files.
4491 * data/glr.c: Don't generate the header file here when glr.cc does.
4492 * src/files.c (file_names, file_names_count): New static globals.
4493 (compute_output_file_names): Invoke output_file_name_check for files
4494 not generated by the skeletons and remove existing checks.
4495 (output_file_name_check): New function that warns about conflicting
4496 output file names.
4497 (output_file_names_free): Free file_names.
4498 * src/files.h (output_file_name_check): Declare.
4499 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4500 the skeletons.
4501 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4502 (Conflicting output files): New tests.
4503
4504 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4505
4506 * doc/bison.texinfo: Fix a couple of typos.
4507
4508 2006-12-08 Bob Rossi <bob@brasko.net>
4509
4510 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4511 Rename to...
4512 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4513 update all uses.
4514 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4515 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4516 local pv.
4517 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4518 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4519
4520 2006-12-07 Bob Rossi <bob@brasko.net>
4521 and Joel Denny <jdenny@ces.clemson.edu>
4522
4523 * data/push.c (yypvarsinit): Change return type from void* to struct
4524 yypvars*. No longer cast to void* on return.
4525 (struct yypvars): Remove yylen since it need not be remembered between
4526 yypushparse invocations.
4527 (yypushparse): Don't copy between yylen and pv->yylen.
4528
4529 2006-12-05 Bob Rossi <bob@brasko.net>
4530
4531 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4532 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4533 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4534 (struct yypvars): Remove b4_declare_parser_variables.
4535 (yypvarsinit): Remove init code for removed variables.
4536 (global scope): Do not declare b4_declare_parser_variables if
4537 push or pure mode.
4538 (yypushparse): Add b4_declare_parser_variables.
4539 Init new local variables, and remove init code for removed
4540 yypvars variables.
4541 (yyparse): Delete.
4542 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4543 and yyparse for other modes.
4544 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4545 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4546 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4547 (AT_PURE_LEX_IF): True if pure or push parser.
4548
4549 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4550
4551 Document Yacc prologue alternatives and default %destructor's and
4552 %printer's as experimental. Don't mention Java yet. Discussed at
4553 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4554 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4555 (2.3a): Annotate this entry to say the old forms of these features were
4556 also experimental.
4557 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
4558 Table of Symbols): Say they're experimental. Comment out any mention
4559 of Java (we'll want this back eventually).
4560
4561 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4562
4563 Support a file name argument to %defines. Deprecate `=' in
4564 %file-prefix, %name-prefix, and %output. Discussed at
4565 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4566 * NEWS (2.3a+): Mention.
4567 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
4568 form of %defines, and remove `=' from entries for %file-prefix,
4569 %name-prefix, and %output.
4570 * src/parse-gram.y (prologue_declaration): Implement.
4571 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4572 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4573 all but one occurrence of %name-prefix.
4574 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4575 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4576 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4577 occurrence of each of %file-prefix and %output. Add check for %defines
4578 with argument.
4579 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4580 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4581 Remove the `=' from %output.
4582
4583 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4584
4585 Don't escape $ in test case titles since Autoconf 2.61 now does that
4586 correctly.
4587 * tests/actions.at (Default %printer and %destructor are not for error
4588 or $undefined): Here.
4589 (Default %printer and %destructor are not for $accept): Here.
4590 * tests/input.at (Invalid $n and @n): Here.
4591
4592 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4593
4594 Rename <!> to <>. Discussed starting at
4595 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4596 * NEWS (2.3a+): Update.
4597 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
4598 Update.
4599 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4600 * src/scan-gram.l (INITIAL): Implement.
4601 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4602 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4603 comment.
4604 * tests/actions.at (Default tagless %printer and %destructor,
4605 Default tagged and per-type %printer and %destructor,
4606 Default %printer and %destructor are not for error or $undefined,
4607 Default %printer and %destructor are not for $accept,
4608 Default %printer and %destructor for mid-rule values): Update.
4609 * tests/input.at (Default %printer and %destructor redeclared,
4610 Unused values with default %destructor): Update.
4611
4612 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4613
4614 Don't let %prec take a nonterminal.
4615 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4616 token.
4617 * tests/input.at (%prec takes a token): New test checking that %prec
4618 won't take a nonterminal.
4619
4620 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4621
4622 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4623 it was double-quoted.
4624 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4625 grammar is maintained with Bison's highest standards.
4626 * src/getargs.c: Fix some typos in Doxygen comments.
4627
4628 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4629
4630 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4631 later. Reported by Paul Eggert in
4632 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4633 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4634 * src/scan-code.l (translate_action): Don't bother invoking
4635 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4636 (code_scanner_free): Instead of invoking
4637 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4638 which frees more.
4639 * src/scan-gram.l (gram_scanner_free): Likewise.
4640 * src/scan-skel.l (scan_skel): Likewise.
4641
4642 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4643
4644 * src/files.c (tr): Change return type to void.
4645 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4646 has been called previously for the same key.
4647 (muscle_find): Return storage instead of value so that
4648 --enable-gcc-warnings doesn't produce warnings that the return discards
4649 const. aver that the value and storage are the same since storage
4650 could potentially be NULL when value is not.
4651 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4652 same as 0.
4653
4654 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4655
4656 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4657 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4658 us a slightly cleaner distribution, and also works.
4659 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4660 gnulib changes.
4661
4662 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4663 and Paul Eggert <eggert@cs.ucla.edu>
4664
4665 Don't let Bison leak memory except when it complains.
4666 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4667 (spec_defines_file, dir_prefix): Now char *, not const char *,
4668 since they are freed.
4669 * src/files.c: Likewise.
4670 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4671 Likewise.
4672 (tr): Now operates in-place. All uses changed.
4673 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4674 values.
4675 (compute_file_name_parts, compute_output_file_names): Don't store
4676 read-only data in variables that will be freed.
4677 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4678 src_extension, and header_extension.
4679 (output_file_names_free): New public function to free
4680 spec_verbose_file, spec_graph_file, spec_defines_file,
4681 parser_file_name, and dir_prefix.
4682 * src/getargs.c (getargs): Don't store read-only data in variables that
4683 will be freed.
4684 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4685 (which previously existed but was unused), and quotearg_free.
4686 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4687 * src/muscle_tab.c: Likewise.
4688 (muscle_entry): Make the value char const *,
4689 and add a new storage member that is char * and can be freed.
4690 (muscle_entry_free): New private function.
4691 (muscle_init): Use it instead of free.
4692 (muscle_insert, muscle_grow): Update and use new storage member.
4693 (muscle_code_grow): Free the string passed to muscle_grow
4694 since it's not needed anymore.
4695 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4696 add a new `char *code' member.
4697 ("{...}"): Declare semantic type as code.
4698 * src/scan-code.h (translate_rule_action):
4699 (translate_symbol_action, translate_code, translate_action): Return
4700 `char const *' rather than `char *' since external code should not free
4701 these strings.
4702 * src/scan-code.l: Likewise.
4703 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4704 which is "{...}" in the parser.
4705 * tests/Makefile.am (maintainer-check-valgrind): Set
4706 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4707 Valgrind.
4708 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4709 complain.
4710 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4711 expecting a non-zero exit status sets --leak-check=summary and
4712 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4713 this case, and we don't want to hear about it.
4714
4715 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4716
4717 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4718 instead of from the template, to simplify configuration a bit.
4719 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4720 and m4/wint_t.m4, as they are needed with the latest gnulib.
4721
4722 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4723
4724 Disable unset/unused mid-rule value warnings by default, and recognize
4725 --warnings=midrule-values to enable them. Discussed starting at
4726 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4727 * NEWS (2.3a+): Mention.
4728 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4729 warnings): Add entry for midrule-values subargument.
4730 * src/reader.c (symbol_should_be_used): Don't return true just because
4731 the value is a set/used mid-rule value unless
4732 --warnings=midrule-values was specified.
4733 * tests/input.at (Unused values, Unused values before symbol
4734 declarations): Run tests with and without --warnings=midrule-values.
4735
4736 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4737 than LIST_FREE directly.
4738
4739 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4740
4741 Finish implementing --warnings=error, which should not be implied by
4742 --warnings=all (or by its synonyms -W and --warnings without
4743 subarguments).
4744 * src/complain.c (set_warning_issued): New function to report that
4745 warnings are being treated as errors and to record an error if so.
4746 Invoke...
4747 (warn_at, warn): ... here.
4748 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4749 "error - warnings are errors" does not appear above "all - all of the
4750 above".
4751 (getargs): For -W and --warnings without subarguments, don't let
4752 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4753 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4754
4755 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4756
4757 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4758 empty subargument list. For example: `bison --warnings= parser.y'.
4759
4760 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4761
4762 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4763 the parser header file so that gcc doesn't warn.
4764
4765 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4766
4767 Split the default %destructor/%printer into two kinds: <*> and <!>.
4768 Discussed starting at
4769 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4770 * NEWS (2.3a+): Mention.
4771 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4772 previous change today related to mid-rules.
4773 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
4774 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
4775 (TYPE_TAG_ANY): Add as <*>.
4776 (TYPE_TAG_NONE): Add as <!>.
4777 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4778 for <*> and <!>.
4779 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4780 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4781 * src/symlist.c (symbol_list_default_new): Split into tagged and
4782 tagless versions.
4783 (symbol_list_destructor_set, symbol_list_printer_set): Split
4784 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4785 SYMLIST_DEFAULT_TAGLESS.
4786 * src/symlist.h: Update symbol_list_default*_new prototypes.
4787 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4788 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4789 * src/symtab.c (default_destructor, default_destructor_location,
4790 default_printer, default_printer_location): Split each into tagged and
4791 tagless versions.
4792 (symbol_destructor_get, symbol_destructor_location_get,
4793 symbol_printer_get, symbol_printer_location_get): Implement tagged
4794 default and tagless default cases.
4795 (default_destructor_set, default_printer_set): Split each into tagged
4796 and tagless versions.
4797 * src/symtab.h: Update prototypes.
4798 * tests/actions.at (Default %printer and %destructor): Rename to...
4799 (Default tagless %printer and %destructor): ... this, and extend.
4800 (Per-type %printer and %destructor): Rename to...
4801 (Default tagged and per-type %printer and %destructor): ... this, and
4802 extend.
4803 (Default %printer and %destructor for user-defined end token): Extend.
4804 (Default %printer and %destructor are not for error or $undefined):
4805 Update.
4806 (Default %printer and %destructor are not for $accept): Update.
4807 (Default %printer and %destructor for mid-rule values): Extend.
4808 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4809 (Unused values with default %destructor): Extend.
4810
4811 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4812
4813 Don't apply the default %destructor/%printer to an unreferenced midrule
4814 value. Mentioned at
4815 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4816 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4817 like $@n instead of just @n so that the default %destructor/%printer
4818 logic doesn't see them as user-defined symbols.
4819 (symbol_is_dummy): Check for both forms of the name.
4820 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4821 name for which the midrule value is referenced in any action.
4822 * tests/actions.at (Default %printer and %destructor for mid-rule
4823 values): New test.
4824 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4825 for change to dummy symbol names.
4826
4827 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4828
4829 Warn about unset midrule $$ if the corresponding $n is used.
4830 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4831 $n usage.
4832 (packgram): Before invoking grammar_rule_check on any rule, make sure
4833 all actions have already been scanned in order to set `used' flags.
4834 Otherwise, checking that a midrule's $$ is set will not always work
4835 properly because the midrule check must forward-reference the midrule's
4836 parent rule.
4837 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4838 warning.
4839
4840 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4841
4842 More improvements to the documentation of the prologue alternatives:
4843 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4844 Bison manual.
4845 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4846 some text to clarify the relative importance of the new directives and
4847 to show how these directives may be viewed as code labels.
4848
4849 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4850
4851 Similar to the recently removed %before-header, add %code-top as the
4852 alternative to the pre-prologue. Mentioned at
4853 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4854 Also, let the prologue alternatives appear in the grammar section.
4855 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4856 (prologue_declaration): Move the existing prologue alternatives to...
4857 (grammar_declaration): ... here and add %code-top.
4858 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4859
4860 Clean up and extend documentation for the prologue alternatives.
4861 * NEWS (2.3a+): Describe prologue alternatives.
4862 * doc/bison.texinfo (Prologue): Move discussion of prologue
4863 alternatives to...
4864 (Prologue Alternatives): ... this new section, and extend it to discuss
4865 all 4 directives in detail.
4866 (Table of Symbols): Clean up discussion of prologue alternatives and
4867 add %code-top.
4868
4869 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4870
4871 DJGPP specific issues.
4872
4873 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4874 config.bat accordingly.
4875 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4876 * djgpp/config.site: Likewise.
4877
4878 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
4879
4880 Replace %*-header with %provides, %requires, %code. See discussion at
4881 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4882
4883 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4884 (b4_user_start_header): Remove.
4885 * data/glr.c: Use new macros instead of b4_*start_header
4886 and b4_*end_header.
4887 * data/glr.cc: Likewise.
4888 * data/lalr1.cc: Likewise.
4889 * data/push.c: Likewise.
4890 * data/yacc.c: Likewise.
4891
4892 * doc/bison.texinfo: Remove %before-header, rename
4893 %{start,end,after}-header to %requires, %provides, %code.
4894
4895 * src/parse-gram.y: Likewise (also rename token names accordingly).
4896 * src/scan-gram.l: Likewise.
4897 * tests/actions.at: Likewise.
4898
4899 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4900
4901 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4902 Problem reported by Joel E. Denny.
4903
4904 2006-10-14 Jim Meyering <jim@meyering.net>
4905
4906 (Sync from coreutils.)
4907 Work also when the working directory (with e.g. coreutils sources)
4908 is version controlled with git, rather than CVS.
4909 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4910 rather than CVS.
4911 In messages and comments, say e.g., "checked-out sources",
4912 rather than "CVS sources".
4913 (version_controlled_file): New function. Work for git as well as
4914 for CVS. Don't use grep's -q option.
4915 (slurp): Call it here, in place of CVS-specific code.
4916
4917 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4918
4919 Fix testsuite for ./configure --enable-gcc-warnings:
4920 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4921 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4922 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4923 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4924 * test/regression.at (Diagnostic that expects two alternatives):
4925 Likewise.
4926
4927 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4928
4929 * bootstrap.conf (gnulib_modules): Add config-h.
4930 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4931 worry about HAVE_CONFIG_H.
4932 * lib/abitset.c: Likewise.
4933 * lib/bitset.c: Likewise.
4934 * lib/bitset_stats.c: Likewise.
4935 * lib/bitsetv-print.c: Likewise.
4936 * lib/bitsetv.c: Likewise.
4937 * lib/ebitset.c: Likewise.
4938 * lib/get-errno.c: Likewise.
4939 * lib/lbitset.c: Likewise.
4940 * lib/subpipe.c: Likewise.
4941 * lib/timevar.c: Likewise.
4942 * lib/vbitset.c: Likewise.
4943 * lib/bitset.c: Include "bitset.h" first, to test interface.
4944 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4945 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4946 * lib/bitsetv.c: Include "bitsetv.h" first.
4947 * lib/get-errno.c: Include "get-errno.h" first.
4948 * m4/.cvsignore: Add config-h.m4.
4949 * tests/actions.at (Default %printer and %destructor for ...):
4950 Adjust expected line numbers in output to reflect removal of #if
4951 HAVE_CONFIG_H lines.
4952 * tests/glr-regression.at (Missed %merge type warnings when ...):
4953 Likewise.
4954 * tests/regression.at (Braced code in declaration in rules section):
4955 Likewise.
4956 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4957 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4958 Include <config.h> unconditionally.
4959
4960 * bootstrap: Sync from coreutils, as follows:
4961
4962 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4963
4964 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4965 variable was sometimes used without being initialized. This
4966 messed up the installation of the INSTALL file in some cases.
4967
4968 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4969
4970 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4971 --copy. Inspired by a suggestion from Bruno Haible.
4972
4973 2006-10-03 Jim Meyering <jim@meyering.net>
4974
4975 * bootstrap: Undo last change to this file, since now gnulib-tool
4976 sticks with the automake default in generating dependencies.
4977
4978 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4979
4980 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4981 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4982
4983 * doc/bison.1: Add copyright notice.
4984
4985 * data/glr.c: Don't include <stdarg.h>; not used.
4986
4987 * NEWS: The -g and --graph options now output graphs in Graphviz
4988 DOT format, not VCG format.
4989 * doc/bison.1: Likewise.
4990 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
4991 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4992 of this change in
4993 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
4994 * TODO: Remove Graphviz entry.
4995 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4996 remove vcg.c, vcg.h, vcg_defaults.h.
4997 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4998 * src/graphviz.c, src/graphviz.h: New files.
4999 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
5000 * src/files.h: Make comment more generic.
5001 * src/main.c (main): Likewise.
5002 * src/print_graph.h: Likewise.
5003 * src/getargs.c (usage): Make usage description more generic.
5004 * src/print_graph.c: Include graphviz.h rather than vcg.h.
5005 (static_graph, fgraph): Remove. All uses changed to pass
5006 arguments instead of sharing a static var.
5007 (print_core, print_actions, print_state, print_graph):
5008 Output graphviz format rather than VCG format.
5009 * tests/.cvsignore: Remove *.vcg; add *.dot.
5010 * tests/output.at: Expect *.dot files, not *.vcg files.
5011
5012 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
5013 accommodates the 2006-10-08 change.
5014
5015 2006-10-11 Bob Rossi <bob@brasko.net>
5016
5017 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
5018 (b4_yyssa, b4_yyerror_range): New macros.
5019 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
5020 (yypvarsinit): Remove init of removed fields.
5021 (yypushparse): Remove use of removed fields; use new macros instead.
5022
5023 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5024
5025 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
5026 in a push parser. Reindent slightly to match yacc.c better.
5027
5028 2006-10-11 Bob Rossi <bob@brasko.net>
5029
5030 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
5031 yymsg_alloc fields.
5032 (yypvarsinit, yypushparse): Remove init of removed fields.
5033 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
5034
5035 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5036
5037 * THANKS: Add Paolo Bonzini and Bob Rossi.
5038
5039 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
5040
5041 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
5042 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
5043 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
5044 b4_define_user_cde and uses): Remove.
5045 (b4_comment, b4_prefix, b4_sync_start): New.
5046 * data/bison.m4: New file, with most of the content removed from c.m4.
5047 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
5048 * src/output.c (output_skeleton): Pass bison.m4.
5049 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
5050 only if specified.
5051
5052 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
5053
5054 Fix test failure reported by Tom Lane in
5055 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
5056 and try to make such failures easier to catch in the future.
5057 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
5058 that's now the caller's responsibility.
5059 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
5060 Set yychar = YYEOF if it's negative.
5061 * tests/actions.at (yylex): Abort if asked to read past EOF.
5062 * tests/conflicts.at (yylex): Likewise.
5063 * tests/cxx-type.at (yylex): Likewise.
5064 * tests/glr-regression.at (yylex): Likewise.
5065 * tests/input.at (yylex): Likewise.
5066 * tests/regression.at (yylex): Likewise.
5067 * tests/torture.at (yylex): Likewise.
5068
5069 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
5070
5071 Fix problems with translating English-language diagnostics.
5072 * bootstrap: Fix bug introduced in recent bootstrap changes, with
5073 respect to bison-runtime pot generation. The YY_ stuff
5074 wasn't being captured.
5075 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
5076 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
5077 * runtime-po/POTFILES.in: Add data/push.c.
5078
5079 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
5080
5081 Merge bootstrap changes from coreutils.
5082
5083 2006-09-28 Jim Meyering <jim@meyering.net>
5084
5085 Automatically generated dependencies are important even
5086 when all of the sources in a directory come from gnulib.
5087 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5088 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5089
5090 2006-09-23 Jim Meyering <jim@meyering.net>
5091
5092 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5093
5094 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5095
5096 * bootstrap: Add support for --force.
5097 (usage): New function. Describe usage less tersely.
5098 (CVS_only_file): New var.
5099
5100 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5101
5102 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5103 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5104 Adjust white space and comments to match GNU style better.
5105
5106 2006-09-20 Bob Rossi <bob@brasko.net>
5107
5108 * data/push.c (yyresult_get): Remove function.
5109 (YYPUSH_MORE): Add #define.
5110 (yypushparse): Modify return value.
5111
5112 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5113
5114 * stamp-h.in: Remove; no longer needed.
5115 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5116 Remove config.h, config.hin, intl (no longer created).
5117 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5118 stamp-h1.
5119
5120 Sync bootstrap from coreutils, as follows:
5121
5122 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5123
5124 * bootstrap (symlink_to_gnulib): New function.
5125 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5126 to copies-of-gnulib.
5127 (cp_mark_as_generated, slurp, gnulib_files):
5128 Avoid making a copy if it's the same as the old version.
5129 (gnulib_files): Add support for this variable (used by Bison).
5130
5131 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5132
5133 * src/getargs.c (usage): Rework to use conventions similar to
5134 coreutils, to make translation a bit easier and the code a bit
5135 smaller. Problem reported by Tim Van Holder.
5136
5137 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5138
5139 Use some of gnulib's new modules, taken from coreutils.
5140
5141 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5142 * bootstrap.conf: New file.
5143 (gnulib_modules): Add configmake, inttypes, unistd.
5144 (XGETTEXT_OPTIONS): Add complain, complain_at,
5145 fatal, fatal_at, warn, warn_at, unexpected_end.
5146 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5147 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5148 (gl_EARLY): Add.
5149 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5150 (gl_INIT): Add
5151 (GNULIB_AUTOCONF_SNIPPET): Remove.
5152 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5153 the pickiest.
5154 * lib/.cvsignore: Add inttypes_.h.
5155 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5156 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5157 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5158 no-longer-necessary initializations.
5159 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5160 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5161 use the unistd module.
5162 * src/system.h: Likewise.
5163 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5164 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5165 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5166 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5167 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5168 * src/system.h: Include inttypes.h unconditionally, now that we
5169 use the inttypes module. Don't bother to include stdint.h, since
5170 inttypes.h now does that for us.
5171 (LOCALEDIR): Remove, now that we use the configmake module.
5172 * src/getargs.c: Include configmake.h.
5173 * src/main.c: Likewise.
5174 * src/output.c: Likewise.
5175 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5176 not from $abs_top_builddir, since config.h moved.
5177
5178
5179 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5180 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5181
5182 * src/parse-gram.y (symbol_declaration): Don't put statements
5183 before declarations; it's not portable to C89.
5184 * src/scan-code.l (handle_action_at): Likewise.
5185
5186 * src/scan-code.l: Always initialize braces_level; the old code
5187 left it uninitialized and therefore had undefined behavior.
5188
5189 Don't attempt to redefine 'assert', since it runs afoul of
5190 systems where standard headers (mistakenly) include <assert.h>.
5191 Instead, define and use our own alternative, called 'aver'.
5192 * src/reader.c: Don't include assert.h, since we no longer
5193 use assert.
5194 * src/scan-code.l: Likewise.
5195 * src/system.h (assert): Remove, replacing with....
5196 (aver): New function, taking a bool arg. All uses changed.
5197 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5198 not merely an integer.
5199
5200 2006-09-15 Bob Rossi <bob@brasko.net>
5201
5202 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5203 * data/c.m4 (YYPUSH): New.
5204 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5205 * src/getargs.c (push_parser): New var.
5206 * src/getargs.h (push_parser): New declaration.
5207 * src/output.c (prepare): Add macro insertion of `push_flag'.
5208 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5209 (prologue_declaration): Parse %push-parser.
5210 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5211 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5212 list of removed lines from the traces observed.
5213 (AT_CHECK_CALC_LALR): Added push parser tests.
5214
5215 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5216
5217 * NEWS: Version 2.3a.
5218 * configure.ac (AC_INIT): Likewise.
5219
5220 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5221 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5222 due to header ordering dependencies. I don't know why the #define
5223 was there.
5224
5225 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5226 runtime cost when YYDEBUG is not defined, and so that some tests
5227 that used to fail now work. Problem and initial suggestion by
5228 Paolo Bonzini.
5229 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5230 * data/glr.cc (b4_parser_class_name):
5231 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5232 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5233 (yydebug_) [YYDEBUG]: New member.
5234 (yycdebug_): Now defined only if YYDEBUG.
5235 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5236 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5237 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5238 if YYYDEBUG.
5239 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5240 Define only if YYDEBUG.
5241 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5242 set_debug_level.
5243 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5244 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5245 AT_CHECK_CALC_GLR_CC that are working now.
5246
5247 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5248
5249 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5250 We don't need them in glr.cc, and glr.c defines them.
5251 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5252 assumes that defining it to anything is the same as defining
5253 it to 1. Problem reported by Paolo Bonzini.
5254
5255 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5256
5257 * data/c.m4 (b4_null, b4_case): Define.
5258 * src/output.c (prepare_symbols): Use b4_null.
5259 (user_actions_output): Use b4_case.
5260
5261 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5262
5263 * data/glr.c (b4_shared_declarations): Put start-header first,
5264 before any #includes that we generate, so that feature-test
5265 macros work. Problem reported by Michael Deutschmann in
5266 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5267 * data/lalr1.cc: Likewise.
5268 * doc/bison.texinfo (Prologue): Document that feature-test macros
5269 should be defined before any Bison declarations.
5270 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5271 that depend on location.hh after, not before, Bison decls, since
5272 we now include location.hh after the first user prologue.
5273
5274 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5275 Sander Brandenburg in
5276 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5277 Also, fix minor white space and comment issues.
5278 (Prologue): Mention that it's better to define feature-test macros
5279 before Bison declarations. Problem reported by Michael Deutschmann.
5280
5281 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5282 by Jim Meyering.
5283 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5284 This adjusts to recent gnulib changes.
5285
5286 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5287
5288 Finish implementation of per-type %destructor/%printer. Discussed
5289 starting at
5290 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5291 and
5292 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5293 * NEWS (2.3+): Add a description of this feature to the default
5294 %destructor/%printer description.
5295 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5296 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5297 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5298 list node contains a semantic type.
5299 * src/symtab.c, src/symtab.h: Extend with a table that associates
5300 semantic types with their %destructor's and %printer's.
5301 (semantic_type_from_uniqstr, semantic_type_get,
5302 semantic_type_destructor_set, semantic_type_printer_set): New functions
5303 composing the public interface of that table.
5304 (symbol_destructor_get, symbol_destructor_location_get,
5305 symbol_printer_get, symbol_printer_location_get): If there's no
5306 per-symbol %destructor/%printer, look up the per-type before trying
5307 the default.
5308 * tests/actions.at (Per-type %printer and %destructor): New test case.
5309 * tests/input.at (Default %printer and %destructor redeclared):
5310 Extend to check that multiple occurrences of %symbol-default in a
5311 single %destructor/%printer declaration is an error.
5312 (Per-type %printer and %destructor redeclared, Unused values with
5313 per-type %destructor): New test cases.
5314
5315 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5316
5317 Require default %destructor/%printer to be declared using
5318 %symbol-default instead of an empty symbol list, and start working on
5319 new per-type %destructor/%printer. Discussed at
5320 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5321 * NEWS (2.3+): Add %symbol-default to example.
5322 * bison.texinfo (Freeing Discarded Symbols): Likewise.
5323 (Table of Symbols): Add entry for %symbol-default.
5324 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5325 (generic_symlist, generic_symlist_item): New nonterminals for creating
5326 a list in which each item is a symbol, semantic type, or
5327 %symbol-default.
5328 (grammar_declaration): Use generic_symlist in %destructor and %printer
5329 declarations instead of symbols.1 or an empty list.
5330 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5331 for changes to symbol_list.
5332 * src/reader.c: Update for changes to symbol_list.
5333 * src/scan-code.l: Likewise.
5334 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5335 * src/symlist.c, src/symlist.h: Extend such that a list node may
5336 represent a semantic type or a %symbol-default in addition to just an
5337 ordinary symbol. Add switched functions for setting %destructor's and
5338 %printer's.
5339 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5340 %destructor/%printer declarations.
5341
5342 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5343
5344 Whether the default %destructor/%printer applies to a particular symbol
5345 isn't a question of whether the user *declares* that symbol (in %token,
5346 for example). It's a question of whether the user by any means
5347 *defines* the symbol at all (by simply using a char token, for
5348 example). $end is defined by Bison whereas any other token with token
5349 number 0 is defined by the user. The error token is always defined by
5350 Bison regardless of whether the user declares it with %token, but we
5351 may one day let the user define error as a nonterminal instead.
5352 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5353 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5354 the meaning of "user-defined".
5355 * tests/actions.at (Default %printer and %destructor for user-declared
5356 end token): Rename to...
5357 (Default %printer and %destructor for user-defined end token): ...
5358 this.
5359
5360 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5361 computation of whether to apply the default, don't maintain a list of
5362 every Bison-defined symbol. Instead, just check for a first character
5363 of '$', which a user symbol cannot have, and check for the error token.
5364
5365 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5366
5367 Don't apply the default %destructor or %printer to the error token,
5368 $undefined, or $accept. This change fits the general rule that the
5369 default %destructor and %printer are only for user-declared symbols,
5370 and it solves several difficulties that are described in the new test
5371 cases listed below.
5372 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5373 * tests/actions.at (Default %printer and %destructor are not for error
5374 or $undefined, Default %printer and %destructor are not for $accept):
5375 New test cases.
5376
5377 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5378
5379 Allow %start after the first rule.
5380 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5381 when parsing the first rule.
5382 (check_and_convert_grammar): Search for it here after all grammar
5383 declarations have been parsed. Skip midrules, which have dummy LHS
5384 nonterminals.
5385 * src/symtab.c (symbol_is_dummy): New function.
5386 * src/symtab.h (symbol_is_dummy): Declare it.
5387 * tests/input.at (%start after first rule): New test.
5388
5389 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5390
5391 Redo some of the previous commit: add back the ability to use
5392 non-aliased/undeclared string literals since it might be useful to
5393 those declaring %token-table.
5394 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5395 commit: don't worry about complaints from symbols_pack.
5396 * src/symtab.c (symbol_new, symbol_class_set,
5397 symbol_check_alias_consistency): Undo changes in previous commit: count
5398 each string literal as a new symbol and token, assign it a symbol
5399 number, and don't complain about non-aliased string literals.
5400 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5401 and token counts but does still set aliased tokens to the same number,
5402 symbol_pack_processor now leaves empty slots in the symbols array.
5403 Remove those slots.
5404 * tests/regression.at (Undeclared string literal): Remove test case
5405 added in previous commit since non-aliased string literals are allowed
5406 again.
5407 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5408 remove unnecessary string literal declarations.
5409 * tests/sets.at (Firsts): Likewise.
5410
5411 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5412
5413 Don't allow an undeclared string literal, but allow a string literal to
5414 be used before its declaration.
5415 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5416 symbols_pack complained.
5417 * src/symtab.c (symbol_new): Don't count a string literal as a new
5418 symbol.
5419 (symbol_class_set): Don't count a string literal as a new token, and
5420 don't assign it a symbol number since symbol_make_alias does that.
5421 (symbol_make_alias): It's not necessary to decrement the symbol and
5422 token counts anymore. Don't assume that an alias declaration occurs
5423 before any uses of the identifier or string, and thus don't assert that
5424 one of them has the highest symbol number so far.
5425 (symbol_check_alias_consistency): Complain if there's a string literal
5426 that wasn't declared as an alias.
5427 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5428 symbol_pack asserts that every token has been assigned a symbol number
5429 although undeclared string literals have not.
5430 * tests/regression.at (String alias declared after use, Undeclared
5431 string literal): New test cases.
5432 (Characters Escapes, Web2c Actions): Declare string literals as
5433 aliases.
5434 * tests/sets.at (Firsts): Likewise.
5435
5436 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5437
5438 In the grammar scanner, STRING_FINISH unclosed constructs and return
5439 them to the parser in order to improve error messages.
5440 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5441 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5442 * tests/input.at (Unclosed constructs): New test case.
5443 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5444 seen.
5445
5446 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5447 unused global.
5448
5449 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5450
5451 Handle string aliases for character tokens correctly.
5452 * src/symtab.c (symbol_user_token_number_set): If the token has an
5453 alias, check and set its alias's user token number instead of its own,
5454 which is set to indicate the alias. Previously, every occurrence of
5455 the character token in the grammar overwrote that alias indicator with
5456 the character code.
5457 * tests/input.at (String aliases for character tokens): New test.
5458
5459 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5460
5461 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5462
5463 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5464
5465 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5466 to prevent failures when building on older platforms.
5467 Check for autopoint failure.
5468 Set XGETTEXT_OPTIONS to values that check for C format strings,
5469 so that translators are warned about them (this also helps
5470 prevent core dumps).
5471
5472 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5473 function, since it simplifies our code a bit.
5474
5475 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5476 rather than -W, so we don't get bogus warnings about sign comparisons.
5477 Add -Wpointer-arith, since that warning is useful (it reports code
5478 that does not conform to C89 and that some compilers reject).
5479 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5480 since it's no longer needed.
5481
5482 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5483
5484 Clean up scanners a bit.
5485 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5486 definitions so gcc won't warn when obstack_for_string is unused.
5487 * src/scan-code.l: config.h and system.h are already #include'd by
5488 scan-code-c.c, so get rid of them here.
5489 * src/scan-gram.l: Likewise.
5490 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5491 definitions rather than duplicating the rest of it.
5492 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5493
5494 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5495
5496 Suppress signed/unsigned comparison warnings for yycheck.
5497 * data/c.m4 (b4_safest_int_type): New macro.
5498 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5499 a signed int type, cast it to b4_safest_int_type first.
5500 * data/yacc.c: Likewise.
5501 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5502 also overwritten.
5503
5504 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5505
5506 * doc/bison.texinfo: Fix some typos.
5507
5508 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5509
5510 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5511 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5512
5513 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5514 the latest gnulib does this a different way.
5515 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5516 translation was patched, so stop omitting it.
5517
5518 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5519
5520 Enable declaration of default %printer/%destructor. Make the parser
5521 use these for all user-declared grammar symbols for which the user does
5522 not declare a specific %printer/%destructor. Thus, the parser uses it
5523 for token 0 if the user declares it but not if Bison generates it as
5524 $end. Discussed starting at
5525 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5526 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5527 and
5528 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5529 * NEWS (2.3+): Mention.
5530 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5531 declare a %destructor for a mid-rule's semantic value. It's just
5532 impossible to declare one specific to it.
5533 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5534 code. Describe default %destructor form.
5535 * src/parse-gram.y (grammar_declaration): Parse default
5536 %printer/%destructor declarations.
5537 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5538 and symbol_destructor_location_get rather than accessing the destructor
5539 and destructor_location members of struct symbol.
5540 (symbol_printers_output): Likewise but for %printer's.
5541 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5542 again.
5543 * src/symtab.c (default_destructor, default_destructor_location,
5544 default_printer, default_printer_location): New static global
5545 variables to record the default %destructor and %printer.
5546 (symbol_destructor_get, symbol_destructor_location_get,
5547 symbol_printer_get, symbol_printer_location_get): New functions to
5548 compute the appropriate %destructor and %printer for a symbol.
5549 (default_destructor_set, default_printer_set): New functions to set the
5550 default %destructor and %printer.
5551 * src/symtab.h: Prototype all those new functions.
5552 * tests/actions.at (Default %printer and %destructor): New test to
5553 check that the right %printer and %destructor are called, that they're
5554 not called for $end, and that $$ and @$ work correctly.
5555 (Default %printer and %destructor for user-declared end token): New
5556 test to check that the default %printer and %destructor are called for
5557 a user-declared end token.
5558 * tests/input.at (Default %printer and %destructor redeclared, Unused
5559 values with default %destructor): New tests to check related grammar
5560 warnings and errors.
5561
5562 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5563
5564 Clean up handling of %destructor for the end token (token 0).
5565 Discussed starting at
5566 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5567 and
5568 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5569
5570 Make the skeletons consistent in how they pop the end token and invoke
5571 its %destructor.
5572 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5573 state, which has token number 0, since this would invoke the
5574 %destructor for the end token.
5575 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5576 until after shifting the end token, or else it won't be popped.
5577 * data/yacc.c (yyparse): Likewise.
5578
5579 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5580 it's the end token. Upon termination, destroy an unshifted lookahead
5581 even when it's the end token.
5582 * data/lalr1.cc (yy::parser::parse): Likewise.
5583 * data/yacc.c (yyparse): Likewise.
5584
5585 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5586 value warnings for the end token when the user gives the end token a
5587 %destructor.
5588
5589 * tests/actions.at (Printers and Destructors): Test all the above.
5590
5591 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5592
5593 Update to latest gnulib and gettext versions.
5594 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5595 Add fopen-safer.
5596 (gnulib_files): Add m4/warning.m4. Don't worry about files
5597 overwritten by autopoint.
5598 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5599 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5600 rejects them.
5601 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5602 so that we can remove the intl files at a better time.
5603 (intl_files_to_remove): Remove aclocal.m4, since it gets
5604 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5605 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5606 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5607 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5608 Remove datarootdir hack; no longer needed.
5609 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5610 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5611 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5612 strdup.h.
5613 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5614 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5615
5616 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5617
5618 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5619 it with --assume-autoconf='latest-stable'.
5620
5621 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5622
5623 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5624 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5625 YYSTYPE' and `{'.
5626 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5627 those from muscle_tab.c since the old ones are misleading.
5628
5629 2006-07-13 Akim Demaille <akim@epita.fr>
5630
5631 Support %define "KEY" {VALUE}.
5632 * src/scan-code.h, src/scan-code.l (translate_action)
5633 (translate_rule_action, translate_symbol_action, translate_code):
5634 Return char *, not const char *.
5635 * src/parse-gram.y (declaration): Rename as...
5636 (prologue_declaration): this.
5637 (string_content): Remove this nonterminal, use STRING.
5638 (braceless, content, content.opt): New nonterminal.
5639 Use them.
5640 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5641 as value.
5642 * src/scan-gram.l (getargs.h): Don't include it.
5643
5644 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5645
5646 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5647 rather than a for-loop that declares a local bool variable. This
5648 should work around a compatibility problem with a Cray x1e C++
5649 compiler reported by Hung Nguyen in
5650 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5651 The for-loop was introduced in the 2004-11-17 change but I don't
5652 know why it was needed.
5653
5654 2006-07-12 Akim Demaille <akim@epita.fr>
5655
5656 * data/c.m4: Comment changes.
5657
5658 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
5659
5660 * src/complain.c (error_message, ERROR_MESSAGE): New.
5661 To factor...
5662 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5663 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5664
5665 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5666
5667 * NEWS: Instead of %union, you can define and use your own union type
5668 YYSTYPE if your grammar contains at least one <type> tag.
5669 Your YYSTYPE need not be a macro; it can be a typedef.
5670 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5671 (Union Decl, Decl Summary): Document this.
5672 * data/glr.c (YYSTYPE): Implement this.
5673 * data/glr.cc (YYSTYPE): Likewise.
5674 * data/lalr1.cc (YYSTYPE): Likewise.
5675 * data/yacc.c (YYSTYPE): Likewise.
5676 * src/output.c (prepare): Output tag_seen_flag.
5677 * src/parse-gram.y (declaration, grammar_declaration):
5678 Use 'union_seen' rather than 'typed' to determine whether
5679 %union has been seen, since grammars can now be typed without
5680 %union.
5681 (symbol_declaration, type.opt, symbol_def):
5682 Keep track of whether a tag has been seen.
5683 * src/reader.c (union_seen, tag_seen): New vars.
5684 (typed): remove.
5685 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5686 * src/scan-code.l (untyped_var_seen): New variable.
5687 (handle_action_dollar): Adjust to above changes.
5688 (handle_action_dollar, handle_action_at):
5689 Improve overflow checking for outlandish numbers.
5690 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5691 avoid new diagnostics generated by above changes.
5692 * tests/regression.at (YYSTYPE typedef): Add test to check
5693 for type tags without %union.
5694
5695 * src/symlist.c (symbol_list_length): Return int, not unsigned
5696 int, since callers expect int. This may need to get revisited
5697 once we have proper integer overflow checking.
5698
5699 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5700 object is now static.
5701
5702 * src/getargs.c (flags_argmatch): Return void, not int,
5703 to pacify ./configure --enable-gcc-warnings.
5704
5705 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5706 since last_string is already defined to FLEX_PREFIX (last_string).
5707
5708 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
5709
5710 Implement --warnings/-W.
5711 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5712 replaced by...
5713 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5714 Adjust callers.
5715 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5716 (warnings_args, warnings_types): New.
5717 (getargs, short_options, long_options): Accept -W/--warnings.
5718 Sort the options by alphabetical order, upper case letter right
5719 before its lower case.
5720
5721 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5722
5723 Change %merge result type clash warnings to errors. Discussed at
5724 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5725 * src/reader.c (record_merge_function_type): Use complain_at.
5726 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5727 declared later): Update test case results.
5728
5729 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
5730
5731 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5732 to be in alphabetical order.
5733 (trace_args): Spelling fixes.
5734
5735 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5736
5737 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5738 so they don't collide with user-defined macros.
5739 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5740 this was never guaranteed, and now that we're using gnulib stdint,
5741 which defines int_fast16_t to long int, the problem is exposed.
5742
5743 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5744
5745 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5746 need the full POSIX semantics (and weren't implementing them
5747 anyway).
5748
5749 Adjust to Autoconf 2.60 and today's gnulib.
5750 * bootstrap (gnulib_modules): Add stdint.
5751 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5752 no longer copies it.
5753 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5754 since stdint needs the former and wcwidth (which is now required
5755 by mbswidth) needs the latter.
5756 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5757 work around a compatibility glitch between gettext 0.14.6 and
5758 Autoconf 2.60.
5759 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5760 Do not check for uintptr_t, since new stdint module does the right
5761 thing.
5762 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5763 Add stdint.h, stdint_.h, wcwidth.h.
5764 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5765 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5766 stdint.m4, wchar_t.m4, wcwidth.m4.
5767 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5768 usual order for ../lib/*.h files.
5769 (file_name_split): Use last_component, not base_name, to adjust
5770 to gnulib changes.
5771 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5772 for ../lib/*.h files.
5773 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5774 Define unconditionally, since we now assume the stdint module.
5775 * src/scan-skel.l: Include <dirname.h>.
5776 (BASE_QPUTS): Use last_component, not base_name.
5777 * src/system.h: Include <unlocked-io.h> in the usual order
5778 for ../lib/*.h files. Include <stdint.h> unconditionally,
5779 since we now use the stdint module.
5780 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5781 HAVE_UINTPTR_T, since we now use the stdint module.
5782 (base_name): Remove decl, since files now include <dirname.h>
5783 to get the decl.
5784
5785 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
5786
5787 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5788 New, default to 1.
5789 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5790 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5791 default.
5792 * tests/calc.at: Adjust.
5793
5794 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
5795
5796 * data/c.m4 (b4_basename): New.
5797 (b4_syncline): Also output the location of its invocation (from
5798 the skeleton).
5799 (b4_user_action, b4_define_user_action, b4_user_actions)
5800 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5801 (b4_user_stype): New.
5802 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5803
5804 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5805
5806 In the grammar file, the first column is 1 not 0 on the first line as
5807 on every other line.
5808 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5809 * tests/input.at (Torturing the Scanner): Update output.
5810
5811 * src/scan-gram.l (scanner_cursor): Declare it static.
5812
5813 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5814
5815 In warnings, say "previous declaration" rather than "first
5816 declaration".
5817 * src/symtab.c (redeclaration): Do that here.
5818 * src/reader.c (record_merge_function_type): In the case of a result
5819 type clash, report the previous declaration rather than the very first
5820 one in the grammar file.
5821 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5822 declared later): Add a third declaration to check this behavior.
5823 * tests/input.at (Incompatible Aliases): Update output.
5824
5825 2006-06-27 Akim Demaille <akim@epita.fr>
5826
5827 * doc/Doxyfile.in: New.
5828 * doc/Makefile.am: Use it.
5829 * src/lalr.h, src/symtab.h: Initial doxygenation.
5830
5831 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5832
5833 Don't miss %merge result type warnings just because the LHS types are
5834 declared after the %merge. This continues the effort of the previous
5835 patch.
5836 * src/reader.c (get_merge_function): Don't set the merger type yet.
5837 (record_merge_function_type): New function for setting the merger type
5838 and checking for clashes.
5839 (grammar_current_rule_merge_set): Set the location of the %merge for
5840 the current rule.
5841 (packgram): Invoke record_merge_function_type for each rule now that
5842 all symbol type declarations have been parsed.
5843 * src/reader.h (merger_list.type_declaration_location): New member
5844 storing the location of the first %merge from which the type for this
5845 merging function was derived.
5846 * src/symlist.h (symbol_list.merger_declaration_location): New member
5847 storing the location of a rule's %merge, if any.
5848 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5849 declared later): New test to catch the error fixed by the above patch.
5850
5851 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5852
5853 Get action warnings (grammar_rule_check) right even when symbol
5854 declarations appear after the rules. Discussed at
5855 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5856 and
5857 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5858 Don't mistake the type of $$ in a midrule to be that of its parent
5859 rule's $$.
5860 * src/reader.c (grammar_current_rule_end): Don't invoke
5861 grammar_rule_check yet since not all symbol declarations may have been
5862 parsed yet.
5863 (grammar_midrule_action): Likewise.
5864 Don't record whether the midrule's $$ has been used yet since actions
5865 haven't been translated yet.
5866 Record the midrule's parent rule and its RHS index within the parent
5867 rule.
5868 (grammar_current_rule_action_append): Don't translate the action yet
5869 since not all symbol declarations may have been parsed yet and, thus,
5870 warnings about types for $$, $n, @$, and @n can't be reported yet.
5871 (packgram): Translate the action and invoke grammar_rule_check now that
5872 all symbol declarations have been parsed.
5873 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5874 after parsing the entire grammar file, the symbol list here in the case
5875 of a midrule is actually the midrule's empty RHS, so reference its
5876 parent rule's RHS where necessary.
5877 On the other hand, now that you can already know it's a midrule, you
5878 aren't forced to think $$ has the same type as its parent rule's $$.
5879 (handle_action_at): In the case of a midrule, reference the parent rule
5880 where necessary.
5881 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5882 members.
5883 (symbol_list_length): Now that this is invoked after all rules have
5884 been parsed, a NULL symbol (rather than a NULL symbol list node)
5885 terminates a rule. symbol_list_print already does this correctly.
5886 * src/symlist.h (symbol_list.midrule_parent_rule,
5887 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5888 remember their relationships with their parents.
5889 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5890 fixed by the above patch.
5891 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5892 implementing...
5893 (Unused values): ... this old test case and...
5894 (Unused values before symbol declarations): ... this new test case.
5895 This one is the same as `Unused values' except that all symbol
5896 declarations appear after the rules in order to catch the rest of the
5897 errors fixed by the above patch.
5898
5899 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5900
5901 More cleanup.
5902 * src/reader.c (current_rule): Declare it static since it's no longer
5903 used outside this file.
5904 (grammar_current_rule_action_append): Remove redundant arguments from
5905 translate_rule_action invocation.
5906 * src/reader.h (current_rule): Remove this unused extern.
5907 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5908 * src/scan-code.l (translate_rule_action): Likewise.
5909
5910 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5911
5912 Clean up yesterday's patch.
5913 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5914 to...
5915 * src/reader.c (grammar_current_rule_action_append): ... here for
5916 consistency with grammar_current_rule_symbol_append.
5917 * tests/regression.at (Braced code in declaration in rules section):
5918 Make yyerror and yylex static as usual.
5919
5920 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5921
5922 Fix bug that mistakes braced code in a declaration in the rules section
5923 to be a rule action. Mentioned at
5924 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5925 * src/scan-gram.l: Move midrule action detection from the start of the
5926 scanning of any braced code to...
5927 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5928 action. For readability, use $2 and @2 rather than the equivalent
5929 global variables.
5930 * tests/regression.at (Braced code in declaration in rules section):
5931 New test to catch the error fixed by the above patch.
5932
5933 Work on code readability some.
5934 * src/scan-code.l (current_rule): Get rid of this misleading and
5935 redundant declaration: it's actually extern'ed in reader.h.
5936 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5937 translate_action): Add a rule argument and use it instead of the global
5938 current_rule.
5939 (translate_rule_action): This already receives current_rule through an
5940 argument, so pass it on to translate_action instead of assigning
5941 current_rule to current_rule.
5942 (translate_symbol_action, translate_code): Pass rule = NULL to
5943 translate_action.
5944
5945 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5946
5947 Rename %before-definitions to %start-header and %after-definitions to
5948 %end-header. Don't use these declarations to separate pre-prologue
5949 blocks from post-prologue blocks. Add new order-independent
5950 declarations %before-header and %after-header as alternatives to the
5951 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5952 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5953 * NEWS (2.3+): Update for these changes.
5954 * data/glr.c (b4_before_definitions): Update to...
5955 (b4_start_header): ... this.
5956 (b4_after_definitions): Update to...
5957 (b4_end_header): ... this.
5958 * data/glr.cc: Likewise.
5959 * data/lalr1.cc: Likewise.
5960 * data/yacc.c: Likewise.
5961 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5962 prologue blocks with %*-header declarations.
5963 (Calc++ Parser): Likewise.
5964 (Decl Summary): Update names.
5965 (Table of Symbols): Update description.
5966 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5967 (PERCENT_END_HEADER): ... this.
5968 (PERCENT_BEFORE_DEFINITIONS): Update to...
5969 (PERCENT_START_HEADER): ... this.
5970 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5971 (declaration): Update token names and m4 macro names.
5972 When parsing %end-header and %start-header, invoke translate_code
5973 before muscle_code_grow, and no longer set global booleans to remember
5974 whether these declarations have been seen.
5975 Parse new %after-header and %before-header.
5976 * src/reader.c (before_definitions, after_definitions): Remove.
5977 (prologue_augment): Accept a new bool argument to specify whether to
5978 augment the pre-prologue or post-prologue.
5979 * src/reader.h (before_definitions, after_definitions): Remove these
5980 extern's.
5981 (prologue_augment): Add new bool argument.
5982 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5983 (PERCENT_END_HEADER): ... this.
5984 (PERCENT_BEFORE_DEFINITIONS): Update to...
5985 (PERCENT_START_HEADER): ... this.
5986 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5987 * tests/actions.at (Printers and Destructors): Update names.
5988
5989 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5990
5991 Add comparison operators for C++ location classes. Discussed at
5992 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5993 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5994 declaration indicating whether filename_type has an operator==. If
5995 filename_type is `std::string', it defaults to `1', `0' otherwise.
5996 * data/location.cc: Iff b4_define_location_comparison is `1', add
5997 operator== and operator!= for class position and for class location.
5998
5999 Some minor fixes.
6000 * src/scan-action.l: Remove unused file.
6001 * src/symtab.c (symbol_printer_set): Use printer_location not
6002 destructor_location.
6003 * src/symtab.h (struct symbol): Replace incorrect source comment for
6004 printer members.
6005 * tests/input.at (Incompatible Aliases): Update output with correct
6006 printer location.
6007
6008 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
6009
6010 Don't put the pre-prologue in the header file. For the yacc.c code
6011 file and the glr.c header and code files, move the pre-prologue before
6012 the token definitions. Add new %before-definitions and
6013 %after-definitions to declare code that will go in both the header file
6014 and code file. Discussed at
6015 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
6016 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
6017 and
6018 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
6019 * NEWS (2.3+): Describe these changes.
6020 * data/glr.c (b4_pre_prologue): Move from within to before...
6021 (b4_shared_declarations): ... this.
6022 Add new b4_before_definitions before b4_token_enums.
6023 Add new b4_after_definitions at the end.
6024 * data/glr.cc (b4_pre_prologue): Replace with...
6025 (b4_before_definitions): ... this in the header file.
6026 (b4_after_definitions): New near the end of the header file.
6027 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
6028 code file right before including the header file.
6029 (b4_before_definitions): New in the previous position of
6030 b4_pre_prologue in the header file.
6031 (b4_after_definitions): New near the end of the header file.
6032 * data/yacc.c: Clean up some m4 quoting especially in the header file.
6033 (b4_token_enums_defines): In the code file, move to right before
6034 YYSTYPE for consistency with the header file.
6035 (b4_before_definitions): New right before b4_token_enums_defines in
6036 both the header and code file.
6037 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
6038 header and code file.
6039 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
6040 of prologues for %union dependencies.
6041 (Decl Summary): In %defines description, mention the effect of
6042 %before-definitions and %after-definitions on the header file.
6043 (Calc++ Parser): Forward declare driver in a %before-definitions rather
6044 than in the pre-prologue so that make check succeeds.
6045 (Table of Symbols): Add entries for %before-definitions and
6046 %after-definitions.
6047 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
6048 %before-definitions.
6049 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
6050 (declaration): Parse those declarations and append to
6051 b4_before_definitions and b4_after_definitions, respectively.
6052 * src/reader.c (before_definitions, after_definitions): New bools to
6053 track whether those declarations have been seen.
6054 (prologue_augment): Add to the post-prologue if %union,
6055 %before-definitions, or %after-definitions has been seen.
6056 * src/reader.h (before_definitions, after_definitions): New extern's.
6057 * src/scan-gram.l: Scan the new declarations.
6058 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
6059 prologue block in a %before-definitions or a %after-definitions based
6060 on whether the %union is declared.
6061 * tests/regression.at (Early token definitions with --yacc, Early token
6062 definitions without --yacc): Move tests for token definitions into the
6063 post-prologue since token names are no longer defined in the
6064 pre-prologue.
6065
6066 2006-06-20 Akim Demaille <akim@epita.fr>
6067
6068 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
6069 (symbol_get): Use it.
6070 * src/parse-gram.y: Use it.
6071
6072 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
6073
6074 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
6075 build succeeds when configured with --enable-gcc-warnings.
6076
6077 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
6078
6079 * src/parse-gram.y (char_name): New function.
6080 (CHAR, STRING, string_content): For %printer, properly escape.
6081 (ID): Prefer fputs to fprintf.
6082 (id): Reindent to be consistent with other rules.
6083 Properly quote char.
6084
6085 The Translation Project changed its way of publishing translations
6086 to maintainers. I haven't received any responses to my request
6087 for supporting the old way, or for documenting the new way. I
6088 have modified 'bootstrap' to use screen scraping
6089 (in this case, HTML scraping). This is unreliable and inelegant,
6090 but I don't see any better way. Yuck.
6091 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6092 (get_translations): New function, which uses HTML scraping to
6093 deduce locations of latest translations.
6094 Use this function to grab both bison and bison-runtime .po files.
6095 Don't bother priming the pump for the runtime-po domain any more,
6096 as it's now translated better than bison is.
6097
6098 2006-06-19 Akim Demaille <akim@epita.fr>
6099
6100 * src/scan-gram.l: No longer "parse" things after `%union' until
6101 `{'. Rather, return a single "%union" token.
6102 No longer make symbols: return strings, and leave the conversion
6103 to symbols to the parser.
6104 (SC_PRE_CODE, token_type): Remove.
6105 * src/parse-gram.y (%union): New field `character'.
6106 Sort tokens.
6107 (CHAR): New token.
6108 (ID, ID_COLON): Now that the scanner no longer makes them
6109 identifiers, adjust all uses to invoke symbol_get.
6110 (id_colon): New, wraps the conversion from string to symbol.
6111 (%union): Accept a possible union_name.
6112 (symbol): Now can be a char.
6113 * data/c.m4 (b4_union_name): Leave a default value.
6114 * data/glr.c, data/yacc.c: Use it.
6115
6116 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6117
6118 For associating token numbers with token names for "yacc.c", don't use
6119 #define statements unless `--yacc' is specified; always use enum
6120 yytokentype. Most important discussions start at:
6121 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6122 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6123 and
6124 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6125 * NEWS (2.3+): Mention.
6126 * data/c.m4 (b4_yacc_if): New.
6127 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6128 token #define's.
6129 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6130 on token name definitions.
6131 * src/getargs.c (usage): Capitalize `Yacc' in English.
6132 * src/output.c (prepare): Define b4_yacc_flag.
6133 * tests/regression.at (Early token definitions): Test that tokens names
6134 are defined before the pre-prologue not just before the post-prologue.
6135 Remove this test case and copy to...
6136 (Early token definitions with --yacc): ... this to test #define's.
6137 (Early token definitions without --yacc): ... and this to test enums.
6138
6139 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6140
6141 * NEWS: Reword the post-2.3 change to not be so optimistic about
6142 removing the old "look-ahead" spelling.
6143 Update previous look-ahead/lookahead change reports.
6144 * REFERENCES: look-ahead -> lookahead (since that's
6145 what he actually wrote).
6146 * doc/refcard.tex: look ahead -> lookahead,
6147 look-ahead -> lookahead
6148
6149 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6150
6151 For consistency, use `lookahead' instead of `look-ahead' or
6152 `look_ahead'. Discussed starting at
6153 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6154 and then at
6155 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6156 * NEWS: For the next release, note the change to `--report'.
6157 * TODO, doc/bison.1: Update English.
6158 * doc/bison.texinfo: Update English.
6159 (Understanding Your Parser, Bison Options): Document as
6160 `--report=lookahead' rather than `--report=look-ahead'.
6161 * src/conflicts.c: Update English in comments.
6162 (lookahead_set): Rename from look_ahead_set.
6163 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6164 (resolve_sr_conflict): Rename local look_ahead_tokens to
6165 lookahead_tokens, and update other uses.
6166 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6167 count_rr_conflicts, conflicts_free): Update uses.
6168 * src/getargs.c (report_args): Move "lookahead" before alternate
6169 spellings.
6170 (report_types): Update uses.
6171 (usage): For `--report' usage description, state `lookahead' spelling
6172 rather than `look-ahead'.
6173 * src/getargs.h (report.report_lookahead_tokens): Rename from
6174 report_look_ahead_tokens.
6175 * src/lalr.c: Update English in comments.
6176 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6177 (state_lookahead_tokens_count): Rename from
6178 state_look_ahead_tokens_count.
6179 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6180 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6181 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6182 Update other uses.
6183 Update English in output.
6184 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6185 * src/print.c: Update English in comments.
6186 (lookahead_set): Rename from look_ahead_set.
6187 (print_reduction): Rename argument lookahead_token from
6188 look_ahead_token.
6189 (print_core, state_default_rule, print_reductions, print_results):
6190 Update uses.
6191 * src/print_graph.c: Update English in comments.
6192 (print_core): Update uses.
6193 * src/state.c: Update English in comments.
6194 (reductions_new): Update uses.
6195 (state_rule_lookahead_tokens_print): Rename from
6196 state_rule_look_ahead_tokens_print, and update other uses.
6197 * src/state.h: Update English in comments.
6198 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6199 (state_rule_lookahead_tokens_print): Rename from
6200 state_rule_look_ahead_tokens_print.
6201 * src/tables.c: Update English in comments.
6202 (conflict_row, action_row): Update uses.
6203 * tests/glr-regression.at
6204 (Incorrect lookahead during deterministic GLR,
6205 Incorrect lookahead during nondeterministic GLR): Rename
6206 print_look_ahead to print_lookahead.
6207 * tests/torture.at: Update English in comments.
6208 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6209 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6210 (Many lookahead tokens): Update uses.
6211 * data/glr.c: Update English in comments.
6212 * lalr1.cc: Likewise.
6213 * yacc.c: Likewise.
6214 * src/conflicts.h: Likewise.
6215 * src/lalr.h: Likewise.
6216 * src/main.c: Likewise.
6217 * src/output.c: Likewise.
6218 * src/parse-gram.c: Likewise.
6219 * src/tables.h: Likewise.
6220 * tests/calc.at: Likewise.
6221
6222 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6223
6224 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6225
6226 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6227
6228 * TODO: Add request from Nelson H. F. Beebe to be able to install
6229 Bison without installing the yacc script.
6230
6231 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6232
6233 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6234 and yytext if they're already #define'd.
6235 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6236 * src/scan-code-c.c: ... here.
6237 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6238 <config.h>.
6239
6240 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6241
6242 Get Bison to build again when configured with --enable-gcc-warnings.
6243 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6244 missing #include's.
6245 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6246 loc argument as it shadows a global.
6247 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6248 invocation.
6249
6250 * src/.cvsignore: Add scan-code.c.
6251
6252 2006-06-07 Akim Demaille <akim@epita.fr>
6253
6254 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6255 to...
6256 * src/scan-code.l: here.
6257 * tests/input.at (Torturing the Scanner): Fix another location
6258 error.
6259
6260 2006-06-07 Akim Demaille <akim@epita.fr>
6261
6262 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6263
6264 2006-06-06 Akim Demaille <akim@epita.fr>
6265
6266 Extract the parsing of user actions from the grammar scanner.
6267 As a consequence, the relation between the grammar scanner and
6268 parser is much simpler. We can also split "composite tokens" back
6269 into simple tokens.
6270 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6271 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6272 rename as...
6273 * src/location.h, src/location.c (add_column_width)
6274 (location_compute): these.
6275 Fix the column count: the initial column is 0.
6276 (location_print): Be robust to ending column being 0.
6277 * src/location.h (boundary_set): New.
6278 * src/main.c: Adjust to scanner_free being renamed as
6279 gram_scanner_free.
6280 * src/output.c: Include scan-code.h.
6281 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6282 Use boundary_set.
6283 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6284 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6285 which is now, again, a separate token.
6286 Adjust all dependencies.
6287 Whereever actions with $ and @ are used, use translate_code.
6288 (action): Remove this nonterminal which is now useless.
6289 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6290 (grammar_current_rule_action_append): Use translate_code.
6291 (packgram): Bound check ruleno, itemno, and rule_length.
6292 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6293 (last_string, last_braced_code_loc, max_left_semantic_context)
6294 (scanner_initialize, scanner_free, scanner_last_string_free)
6295 (gram_out, gram_lineno, YY_DECL_): Move to...
6296 * src/scan-gram.h: this new file.
6297 (YY_DECL): Rename as...
6298 (GRAM_DECL): this.
6299 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6300 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6301 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6302 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6303 Move these declarations, and...
6304 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6305 these to...
6306 * src/flex-scanner.h: this new file.
6307 * src/scan-gram.l (rule_length, rule_length_overflow)
6308 (increment_rule_length): Remove.
6309 (last_braced_code_loc): Rename as...
6310 (gram_last_braced_code_loc): this.
6311 Adjust to the changes of the parser.
6312 Move all the handling of $ and @ into...
6313 * src/scan-code.l: here.
6314 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6315 (handle_action_dollar, handle_action_at): Move to...
6316 * src/scan-code.l: here.
6317 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6318 scan-code.h, scan-code-c.c, scan-gram.h.
6319 (EXTRA_bison_SOURCES): Add scan-code.l.
6320 (BUILT_SOURCES): Add scan-code.c.
6321 (yacc): Be robust to white spaces.
6322
6323 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6324 * tests/regression.at: Adjust the column numbers.
6325 * tests/regression.at: Adjust the error message.
6326
6327 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6328
6329 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6330 Use Akim's wording from
6331 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6332
6333 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6334
6335 Between Bison releases, manually append `+' to the previous Bison
6336 release number, and use that as a signal to automatically print the
6337 ChangeLog's CVS Id keyword from --version. Discussed starting at
6338 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6339 * ChangeLog: Add Id header.
6340 * configure.ac (AC_INIT): Append `+' to `2.3'.
6341 * src/.cvsignore: Add revision.c.
6342 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6343 (BUILT_SOURCES): Add revision.c.
6344 (revision.c): New target rule. This file defines a new global variable
6345 named revision. It initializes it with either the Id from ChangeLog
6346 or, if VERSION doesn't contain `+', with the empty string.
6347 * src/getargs.c (version): Print the value of revision.
6348 * src/revision.h: Extern revision.
6349
6350 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6351
6352 * NEWS: Version 2.3.
6353 * configure.ac (AC_INIT): Likewise.
6354
6355 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6356
6357 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6358 with no arguments, not as an object-like macro. This is for
6359 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6360 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6361 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6362 Document this.
6363
6364 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6365
6366 * src/getargs.c (usage): Back out yesterday's modification of the
6367 --help output so that we don't have to wait for translation before
6368 releasing 2.3.
6369
6370 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6371
6372 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6373 Problem reported by Akim Demaille.
6374
6375 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6376
6377 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6378
6379 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6380
6381 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6382 generated source code. Problem reported by Frans Englich in
6383 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6384
6385 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6386
6387 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6388 shell, not within 'make', so that 'make' by an ordinary builder
6389 (using GNU make) does not worry about configuring gzip. This also
6390 works around a bug reported independently by Keith Thompson and by
6391 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6392 stderr rather than stdout, messing up the build logs.
6393
6394 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6395
6396 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6397 to make sure that YYID will never be unused. This fixes a 'make
6398 maintainer-check' failure caused by the recent changes to the 'Trivial
6399 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6400 not used.
6401 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6402
6403 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6404
6405 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6406 state before an empty RHS is always resolved here. Only the location
6407 of that state is guaranteed to be resolved, and that's enough. This
6408 fixes the remaining bug reported by Derek M. Jones in
6409 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6410 * tests/glr-regression.at (Uninitialized location when reporting
6411 ambiguity): Test the above case.
6412 Also, the embedded comments in this test case claim it checks the case
6413 of an empty RHS that has inherited the initial location. However, the
6414 corresponding LHS was already resolved, so yyresolveLocations didn't
6415 actually have reason to modify it. Fix this by forcing
6416 nondeterministic operation at the beginning of the parse.
6417
6418 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6419
6420 * data/c.m4 (b4_yy_symbol_print_generate):
6421 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6422 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6423 of the bugs reported today by Derek M Jones in
6424 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6425 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6426 defined to be a type name without parens or brackets.
6427 (Location Type): Similarly for YYLTYPE.
6428 * tests/regression.at (Trivial grammars): Put in a test for this
6429 bug that will be caught by 'make maintainer-check' (though not,
6430 alas, by 'make check' unless your compiler is picky).
6431
6432 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6433
6434 * NEWS: Version 2.2.
6435 * configure.ac (AC_INIT): Likewise.
6436
6437 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6438
6439 * data/glr.c (yyreportTree): Make room in yystates for the state
6440 preceding the RHS. This fixes the segmentation fault reported by Derek
6441 M. Jones in
6442 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6443 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6444 to the user. Reported for yyreportTree by Derek M. Jones later in the
6445 same thread.
6446 * THANKS: Add Derek M. Jones.
6447 Update my email address.
6448 Fix typo in Steve Murphy's name.
6449
6450 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6451
6452 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6453 checking against YYLAST that caused the parser to miss a potential
6454 alternative in its diagnostic.
6455 Problem reported by Maria Jose Moron Fernandez in
6456 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6457 * data/lalr1.cc (yysyntax_error_): Likewise.
6458 * data/yacc.c (yysyntax_error): Likewise.
6459 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6460 tokens, in case we run into an older C compiler.
6461 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6462 Use them to check for the off-by-one error fixed above.
6463
6464 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6465 YYSIZE_T, not size_t.
6466 * tests/regression.at (Trivial grammars): New test, to catch
6467 the error fixed by the above patch.
6468
6469 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6470
6471 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6472 scheme.
6473 Reported by Steve Murphy.
6474
6475 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6476
6477 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6478 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6479
6480 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6481
6482 Implement --trace=m4.
6483 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6484 * src/output.c (output_skeleton): When set, pass -dV to m4.
6485
6486 Factor the handling of flags in m4.
6487 * src/output.c (prepare): Rename the muscle names debug, defines,
6488 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6489 * data/c.m4: Adjust.
6490 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6491 Use b4_define_flag_if to define other b4_FLAG_if macros.
6492 (b4_location_if): As a consequence, rename as...
6493 (b4_locations_if): this, for consistency.
6494 Adjust all the skeletons.
6495
6496 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6497
6498 * etc/bench.pm: Shorten bench names.
6499
6500 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6501
6502 * src/output.h, src/output.c (error_verbose): Move to...
6503 * src/getargs.h, src/getargs.c: here.
6504 Sort the flags.
6505 Adjust dependencies.
6506
6507 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6508
6509 * data/c.m4 (b4_copyright): Put the special exception for Bison
6510 skeletons here, so we don't have to put it in each skeleton. All
6511 uses changed. Suggested by Akim Demaille. Also, wrap the
6512 copyright notice, in case it is longer than 80 columns. Replace
6513 comma by newline after title.
6514
6515 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6516
6517 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6518 incompatibility, not a bug. Mention that it wasn't fixed as of
6519 flex 2.5.33.
6520
6521 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6522
6523 * examples/extexi: Enforce the precedence of concatenation over
6524 >>.
6525 Reported by Tommy Nordgren.
6526
6527 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6528
6529 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6530 with the member "token".
6531 Reported by Martin Nylin.
6532
6533 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6534
6535 * data/glr.c: Switch to Bison 2.2 special-exception language in
6536 the copyright notice. Use more-regular format for titles and
6537 copyright notices.
6538 * data/glr.cc: Likewise.
6539 * data/location.cc: Likewise.
6540 * data/yacc.cc: Likewise.
6541 * doc/bison.texinfo (Conditions): Document this.
6542 * NEWS: likewise. Upgrade version to 2.2.
6543
6544 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
6545
6546 * data/glr.cc: Remove dead code.
6547
6548 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6549
6550 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6551 that variable and the line breaks the bootstrap. Problem reported
6552 by Juan M. Guerrero.
6553
6554 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6555
6556 * doc/bison.texinfo (Multiple start-symbols): New.
6557
6558 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6559
6560 * etc/README, etc/bench.pl: New.
6561
6562 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
6563
6564 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6565 rule.
6566 Reported by Mickael Labau.
6567 * tests/input.at (Torturing the Scanner): Test it.
6568
6569 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6570
6571 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6572 Problem reported by Bob Rossi.
6573
6574 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6575
6576 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6577 and didn't really work.
6578 For the index, use @ifnotinfo, not @iftex.
6579 Minor cleanups of spacing and terminology.
6580
6581 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6582
6583 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6584 of AT_NAME_PREFIX when %name-prefix is not used.
6585
6586 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6587
6588 Apply --prefix to C++ skeletons too: they change the namespace.
6589 The test suite already exercize these cases.
6590 * data/c++.m4 (b4_namespace): New.
6591 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6592 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6593 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6594 * doc/bison.texinfo: Document it.
6595 (Option Cross Key): Use @multitable in all formats. It looks
6596 nicer, even in TeX outputs.
6597 (Rules): Use the same code whatever the output type is.
6598 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6599 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6600 * tests/calc.at: Use it, instead of hard coding `yy'.
6601
6602 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6603
6604 * TODO: Remove dead items.
6605
6606 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6607
6608 * doc/FAQ: Remove, merged into...
6609 * doc/bison.texinfo (FAQ): this.
6610 * doc/Makefile.am (EXTRA_DIST): Adjust.
6611
6612 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6613
6614 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6615 even if empty.
6616 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6617 * doc/bison.texinfo (Calc++ Scanner): Use it.
6618
6619 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6620
6621 Fix two nits reported by twlevo, plus one more that I discovered.
6622
6623 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6624 this is the usual Bison style.
6625 * src/location.h (location_print): Likewise.
6626
6627 * src/reader.h (token_name): Likewise.
6628
6629 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6630
6631 Fix some nits reported by twlevo.
6632 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6633 and "POSIX". Use more-modern syntax for URLs. Mention C++
6634 and ask for Java. Don't hardwire OS version numbers. Add
6635 copyright notice.
6636 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6637 * src/conflicts.c (solved_conflicts_obstack): Now static.
6638
6639 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6640
6641 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6642 page. Say "you can use it" not "you may use it" as on the web page;
6643 we're describing capabilities not granting permission.
6644
6645 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6646
6647 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6648 shadowing warnings. Use usual patter for iterating through RHS.
6649 * tests/glr-regression.at
6650 (Uninitialized location when reporting ambiguity):
6651 Modify yylex so that it uses its argument, rather than trying
6652 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6653 const char -> char const.
6654
6655 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6656 Don't use tabs inside commands; it messes up 'ps'.
6657 Problem reported by twlevo.
6658
6659 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6660
6661 * tests/glr-regression.at (Uninitialized location when reporting
6662 ambiguity): New test case.
6663 * data/glr.c (yyresolveLocations): New function, which uses
6664 YYLLOC_DEFAULT.
6665 (yyresolveValue): Invoke yyresolveLocations before reporting an
6666 ambiguity.
6667 * doc/bison.texinfo (Default Action for Locations): Note
6668 YYLLOC_DEFAULT's usage for ambiguity locations.
6669 (GLR Semantic Actions): Cross-reference those notes.
6670
6671 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6672
6673 * tests/glr-regression.at (Leaked semantic values when reporting
6674 ambiguity): Remove unnecessary union and type declarations.
6675 (Leaked lookahead after nondeterministic parse syntax error): New test
6676 case.
6677 * data/glr.c (yyparse): Check for zero stacks remaining before
6678 attempting to shift the lookahead so that you don't lose it.
6679
6680 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6681
6682 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6683 * tests/glr-regression.at (Leaked semantic values when reporting
6684 ambiguity): New test case.
6685 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6686 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6687 now unnecessary yystackp parameter.
6688 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6689 destructors can be called.
6690
6691 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6692 in existing testcases.
6693
6694 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6695
6696 Don't leak semantic values for parent RHS when a user action cuts the
6697 parser, and clean up related code a bit.
6698 * tests/glr-regression.at (Leaked merged semantic value if user action
6699 cuts parse): Rename to...
6700 (Leaked semantic values if user action cuts parse): ... this. Add check
6701 for leaked parent RHS values.
6702 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6703 between an unresolved state (non-empty chain of semantic options) and
6704 an incomplete one (signaled by an empty chain).
6705 (yyresolveStates): Document the interface. Move all manipulation of a
6706 successfully or unsuccessfully resolved yyGLRState to...
6707 (yyresolveValue): ... here so that yyresolveValue always leaves a
6708 yyGLRState with consistent data and thus is easier to understand.
6709 Remove the yyvalp and yylocp parameters since they are always just
6710 taken from the yys parameter. When reporting a discarded merged value
6711 in debugging output, note that it is incompletely merged. Document the
6712 interface.
6713 (yyresolveAction): If resolving any of the RHS states fails, destroy
6714 them all rather than leaking them. Thus, as long as user actions are
6715 written to clean up the RHS correctly, yyresolveAction always cleans up
6716 the RHS of a semantic option. Document the interface.
6717
6718 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6719
6720 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6721 led to a segmentation fault in GNU Pascal. Problem reported
6722 by Waldek Hebisch.
6723
6724 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6725
6726 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6727 mid-rule action inside a nonterminal symbol in order to declare a
6728 destructor for its semantic value.
6729
6730 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6731
6732 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6733 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6734 __cplusplus && ! defined _STDLIB_H && !
6735 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6736 defined free))]: Include <stdlib.h> rather than rolling our own
6737 declarations of malloc and free, to avoid problems with
6738 incompatible declarations (using 'throw') C++'s stdlib.h. This
6739 should fix Debian bug 340012
6740 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6741 reported by Guillaume Melquiond.
6742
6743 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6744
6745 * NEWS: Clarify symbols versus types in unused-value warnings.
6746
6747 * configure.ac (AC_INIT): Bump version number.
6748
6749 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6750
6751 * NEWS: Version 2.1a.
6752 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6753 since C99 requires this.
6754
6755 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6756
6757 * m4/c-working.m4: New file.
6758 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6759
6760 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6761
6762 * Makefile.maint: Merge from coreutils.
6763
6764 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6765
6766 More portability fixes for problems summarized by Nelson H. F. Beebe.
6767
6768 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6769 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6770 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6771 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6772 messes up because C++ code is compiled in 32-bit mode but linked
6773 in 64-bit mode.
6774
6775 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6776
6777 More portability fixes for problems summarized by Nelson H. F. Beebe.
6778
6779 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6780 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6781
6782 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6783 nodist_PROGRAMS, since we don't need to actually compile the
6784 example if we're just doing a plain 'make'. This avoids bothering
6785 the installer unnecessarily about problems due to weird C++
6786 compilers.
6787
6788 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6789
6790 More portability fixes for problems summarized by Nelson H. F. Beebe.
6791
6792 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6793 than #include "...", and compile with -I'.'. The old method was
6794 not portable, according to Posix and the C standard, and it does
6795 not work with Sun C 5.7, where previous #line directives affect
6796 the working directory used in later #include "..." directives.
6797
6798 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6799
6800 Various DJGGP specific issues in /djgpp
6801
6802 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6803
6804 More portability fixes for problems summarized by Nelson H. F. Beebe.
6805
6806 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6807 '#include <map>' works and that you can apply ++ to iterators.
6808
6809 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6810
6811 Work around portability problems summarized by Nelson H. F. Beebe in
6812 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6813
6814 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6815 that '#include <string>' works.
6816
6817 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6818 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6819 "warning: sorry: semantics of inline function static data `const
6820 unsigned char translate_table[262]' are wrong (you'll wind up with
6821 multiple copies)".
6822
6823 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6824 or, xor to not_, and_, or_, and xor_, respectively. This works
6825 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6826 random system header somewhere that includes the equivalent of
6827 <iso646.h>.
6828
6829 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6830 -E" works; it apparently doesn't work with PathScale EKO Compiler
6831 Suite Version 2.0.
6832
6833 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6834
6835 During deterministic GLR operation, user actions should be able to
6836 influence the parse by changing yychar. To make this easier to fix and
6837 to make glr.c easier to evolve in general, don't maintain yytoken in
6838 parallel with yychar; just compute yytoken when needed.
6839 * tests/glr-regression.at (Incorrect lookahead during deterministic
6840 GLR): Check that setting yychar in a user action has the intended
6841 effect.
6842 * data/glr.c (yyGLRStack): Remove yytokenp member.
6843 (yyclearin): Don't set *yytokenp.
6844 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6845 yychar rather than *yytokenp to determine the current lookahead.
6846 Compute yytoken locally when needed.
6847 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6848 point to.
6849
6850 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6851 after `--report' documentation.
6852
6853 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6854
6855 * src/parse-gram.y (grammar_declaration): Location of printer
6856 symbol is @1, not list->location. Bug reported by twlevo.
6857 * tests/input.at (Incompatible Aliases): Adjust to above change.
6858
6859 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6860
6861 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6862 all the test at once. This makes the output easier to read in the
6863 normal case.
6864
6865 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6866 got from <http://bro-ids.org/download.html>. The bug is that
6867 when two actions appeared in succession, the second one was
6868 scanned before the first one was added to the grammar rule
6869 as a midrule action. Bison then output the incorrect warning
6870 "parse.y:905.17-906.36: warning: unused value: $3".
6871 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6872 associated with a value.
6873 (rhs): Don't invoke grammar_current_rule_action_append.
6874 (action): Invoke it here instead.
6875 * src/reader.c (grammar_midrule_action): Now extern.
6876 (grammar_current_rule_action_append): Don't invoke
6877 grammar_midrule_action; that is now the scanner's job.
6878 * src/reader.h (last_string, last_braced_code_loc):
6879 (grammar_midrule_action): New decls.
6880 * src/scan-gram.l (last_string): Now extern, sigh.
6881 (last_braced_code_loc): New extern variable.
6882 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6883 rule already has an action.
6884 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6885 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6886 Add some tests to check that the above changes fixed the bug.
6887
6888 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6889
6890 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6891 All used changed. Check whether the symbol has a destructor,
6892 not whether it is typed.
6893 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6894 that the values are still reported as unused. All line numbers
6895 adjusted.
6896
6897 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6898
6899 Work around a bug in bro 0.8, which underparenthesizes its
6900 definition of YYLLOC_DEFAULT.
6901 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6902 their arguments.
6903 * data/lalr1.cc: Likewise.
6904 * data/yacc.cc: Likewise.
6905
6906 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6907
6908 Work around a bug in Pike 7.0, and give the Pike folks a
6909 better way to override the usual int widths.
6910 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6911 user can override the types.
6912 (short): #undef, to work around a bug in Pike 7.0.
6913 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6914 (union yyalloc.yyss): Use yytype_int16 rather than short.
6915 All uses changed.
6916 (yysigned_char): Remove.
6917 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6918 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6919 * tests/regression.at (Web2c Actions): Adjust to above changes.
6920
6921 * src/reader.c (check_and_convert_grammar): New function.
6922 (reader): Close the input file even if something went wrong during
6923 parsing. Minor file descriptor leak reported by twlevo.
6924
6925 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6926 to pacify gcc -Wswitch-default.
6927 * src/scan-gram.l (adjust_location): Use a default: break; case
6928 to pacify gcc -Wswitch-default.
6929 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6930 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6931 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6932 Move these decls to scan-skel.l, since they don't need to be
6933 visible elsewhere.
6934 * src/scan-skel.l: Accept the above decls.
6935 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6936 is used.
6937
6938 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6939
6940 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6941 since we don't want to insist on a version number at the start
6942 of the changelog every time.
6943 * Makefile.maint: Sync from coreutils a bit better.
6944 (sc_trailing_blank): Renamed from sc_trailing_space.
6945 All uses changed.
6946 (sc_no_if_have_config_h, sc_require_config_h):
6947 (sc_prohibit_assert_without_use): New rules.
6948 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6949 (sc_dd_max_sym_length): Fix leading spaces in rule.
6950 (sc_system_h_headers): Prefix with @.
6951 (sc_useless_cpp_parens, m4-check): Output line numbers.
6952 (changelog-check): Allow version only in head.
6953 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6954 satisfy new Makefile.maint rule.
6955 * data/glr.c: Likewise.
6956 * data/glr.cc: Likewise.
6957 * data/lalr1.cc: Likewise.
6958 * data/yacc.c: Likewise.
6959 * lib/ebitsetv.c: Likewise.
6960 * lib/lbitset.c: Likewise.
6961 * lib/subpipe.c: Likewise.
6962 * lib/timevar.c: Likewise.
6963 * src/system.h: Likewise.
6964 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6965 * djgpp/Makefile.maint: Add copyright notice.
6966 * djgpp/README.in: Likewise.
6967 * djgpp/config.bat: Likewise.
6968 * djgpp/config.site: Likewise.
6969 * djgpp/config_h.sed: Likewise.
6970 * djgpp/djunpack.bat: Likewise.
6971 * djgpp/config.sed: Fix copyright notice to match standard format.
6972 * djgpp/subpipe.h: Likewise.
6973 * lib/bitsetv-print.c: Likewise.
6974 * lib/bitsetv.c: Likewise.
6975 * lib/subpipe.h: Likewise.
6976 * lib/timevar.c: Likewise.
6977 * lib/timevar.h: Likewise.
6978 * djgpp/subpipe.c: Use standard recipe for config.h.
6979 * lib/abitset.c: Likewise.
6980 * lib/bitset.c: Likewise.
6981 * lib/bitset_stats.c: Likewise.
6982 * lib/bitsetv-print.c: Likewise.
6983 * lib/bitsetv.c: Likewise.
6984 * lib/ebitsetv.c: Likewise.
6985 * lib/get-errno.c: Likewise.
6986 * lib/lbitset.c: Likewise.
6987 * lib/subpipe.c: Likewise.
6988 * lib/timevar.c: Likewise.
6989 * lib/vbitset.c: Likewise.
6990 * tests/local.at: Likewise.
6991 * src/scan-gram.l: Don't include verify.h, since system.h does
6992 that for us.
6993 * .x-sc_require_config_h: New file.
6994 * .x-sc_unmarked_diagnostics: New file.
6995
6996 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6997
6998 Be a bit more systematic about using 'abort'.
6999 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
7000 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
7001 Put 'default: abort ();' before some other case, to satisfy older
7002 pedantic compilers.
7003 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7004 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
7005 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
7006 * src/conflicts.c (resolve_sr_conflict): Likewise.
7007 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
7008 (get_decision_str, get_orientation_str, get_node_alignment_str):
7009 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
7010 (get_linestyle_str, get_arrowstyle_str): Likewise.
7011 * src/conflicts.c (resolve_sr_conflict):
7012 Use a default case rather than one for the one remaining enum
7013 value, to catch invalid enum values as well.
7014 * src/lalr.c (set_goto_map, map_goto):
7015 Prefer "assert (FOO);" to "if (!FOO) abort ();".
7016 * src/nullable.c (nullable_compute, token_definitions_output):
7017 Likewise.
7018 * src/reader.c (packgram, reader): Likewise.
7019 * src/state.c (transitions_to, state_new, state_reduction_find):
7020 Likewise.
7021 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
7022 (symbol_pack): Likewise.
7023 * src/tables.c (conflict_row, pack_vector): Likewise.
7024 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
7025 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
7026 * src/system.h: Don't include <assert.h>.
7027 (assert): New macro.
7028
7029 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
7030 (Destructor Decl, Parser Function, Pure Calling):
7031 Describe rules for braces inside C code more carefully.
7032
7033 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
7034
7035 Fix some porting glitches found by Nelson H. F. Beebe.
7036 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
7037 compilers that don't understand that abort () does not return.
7038 * src/state.c (transitions_to): Likewise.
7039 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7040 that '#include <cstdlib>' works.
7041 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
7042 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
7043 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
7044 for the benefit of some pre-C99 compilers.
7045
7046 * bootstrap: Undo changes to gnulib files that autoreconf made.
7047
7048 Minor fixups to get 'make maintainer-check' to work.
7049 * configure.ac: Don't use -Wnested-externs, as it's incompatible
7050 with the new verify.h implementation.
7051 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
7052 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
7053 * data/yacc.c (YYUSE): Likewise.
7054 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
7055 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
7056 * src/parse-gram.y (declaration): Don't pass a string constant
7057 to a function that expects char *, since GCC might complain
7058 about the constant value.
7059 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
7060 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
7061 before #defining them.
7062 * tests/glr-regression.at
7063 (Incorrectly initialized location for empty right-hand side in GLR):
7064 In yyerror, use the msg arg.
7065 (Corrupted semantic options if user action cuts parse):
7066 (Incorrect lookahead during deterministic GLR):
7067 (Incorrect lookahead during nondeterministic GLR):
7068 Don't name a local var 'index'; it shadows string.h's 'index'.
7069
7070 2006-01-19 Akim Demaille <akim@epita.fr>
7071
7072 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
7073 location, not just parts of it.
7074
7075 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
7076
7077 * NEWS: Document the fact that multiple %unions are now allowed.
7078 * doc/bison.texinfo (Union Decl): Likewise.
7079 * TODO: This feature is now implemented, so remove it from
7080 the wishlist.
7081
7082 * Makefile.maint: Merge with coreutils Makefile.maint.
7083 (CVS_LIST): Use build-aux version if available.
7084 (VERSION_REGEXP): New macro.
7085 (syntax-check-rules): Add sc_no_if_have_config_h,
7086 sc_prohibit_assert_without_use, sc_require_config_h,
7087 sc_useless_cpp_parens.
7088 (sc_obsolete_symbols): Check for O_NDELAY.
7089 (sc_dd_max_sym_length): Track coreutils.
7090 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7091 (sc_useless_cpp_parens): New rule.
7092 (news-date-check): Look for version or today's date.
7093 (changelog-check): Don't require version number near head.
7094 (copyright-check): Use current year instead of hardwiring 2005.
7095 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7096 (announcement): Add --gpg-key-ID.
7097
7098 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7099 with "file system".
7100
7101 Avoid undefined behavior that addressed just before the start of an
7102 array. Problem reported by twlevo.
7103 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7104 * src/lalr.c (build_relations): Rely on new sentinel.
7105 * src/gram.c (gram_free): Adjust to new sentinel.
7106
7107 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7108
7109 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7110 yylookaheadNeeds. All uses updated.
7111 (yysplitStack): Rename local yynewLookaheadStatuses to
7112 yynewLookaheadNeeds.
7113 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7114 GLR): In comments, change `lookahead status' to `lookahead need'.
7115
7116 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7117
7118 * data/glr.c (yysplitStack): A little stylistic rewrite.
7119
7120 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7121
7122 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7123
7124 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7125
7126 * doc/bison.texinfo: Fix some typos.
7127 (GLR Semantic Actions): New subsection discussing special
7128 considerations because GLR semantic actions might be deferred.
7129 (Actions): Mention look-ahead usage of yylval.
7130 (Actions and Locations): Mention look-ahead usage of yylloc.
7131 (Special Features for Use in Actions): Add YYEOF entry and mention it
7132 in the yychar entry.
7133 In the yychar entry, remove mention of the local yychar case (pure
7134 parser) since this is irrelevant information when writing semantic
7135 actions and since it's already discussed in `Table of Symbols' where
7136 yychar is otherwise described as an external variable.
7137 In the yychar entry, don't call it the `current' look-ahead since it
7138 isn't when semantic actions are deferred.
7139 In the yychar and yyclearin entries, add note about deferred semantic
7140 actions.
7141 Add yylloc and yylval entries discussing look-ahead usage.
7142 (Look-Ahead Tokens): When discussing yychar, don't call it the
7143 `current' look-ahead, and do mention yylval and yylloc.
7144 (Error Recovery): Cross-reference `Action Features' when mentioning
7145 yyclearin.
7146 (Table of Symbols): In the yychar entry, don't call it the `current'
7147 look-ahead.
7148 In the yylloc and yylval entries, mention look-ahead usage.
7149
7150 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7151
7152 * tests/glr-regression.at: Update copyright year to 2006.
7153
7154 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7155
7156 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7157 use during nondeterministic operation to track which stacks have
7158 actually needed the current lookahead.
7159 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7160 Allocate, deallocate, resize, and otherwise shuffle space for
7161 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7162 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7163 appropriately during nondeterministic operation.
7164 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7165 members to store the current lookahead to be used by the deferred
7166 user action.
7167 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7168 from which the RHS is taken. Set the lookahead members of the new
7169 yySemanticOption according to the lookahead status for stack yyk.
7170 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7171 yyaddDeferredAction.
7172 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7173 members of yySemanticOption before invoking yyuserAction, and then set
7174 them back to their current values afterward.
7175 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7176 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7177 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7178 titles for consistency.
7179 (Leaked merged semantic value if user action cuts parse): In order to
7180 suppress lint warnings, use arguments in merge function, and assign
7181 char value < 128 in main.
7182 (Incorrect lookahead during deterministic GLR): New test case.
7183 (Incorrect lookahead during nondeterministic GLR): New test case.
7184
7185 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7186
7187 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
7188 !yyvaluep as signal that no semantic value is available to print.
7189 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7190 to print a semantic value.
7191
7192 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7193
7194 * tests/glr-regression.at: For consistency with my newer test cases,
7195 don't thank myself.
7196
7197 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7198
7199 * data/glr.c (yyresolveValue): When merging semantic options, if at
7200 least one user action succeeds but a later one cuts the parse, then
7201 destroy the semantic value before returning rather than leaking it.
7202 (yyresolveStates): If a user action cuts the parse and thus
7203 yyresolveValue fails, ignore the (unset) semantic value rather than
7204 corrupting the yyGLRState, and empty the semantic options list since
7205 the user actions should have called all necessary destructors.
7206 Simplify code with YYCHK.
7207 * tests/glr-regression.at (Corrupted semantic options if user action
7208 cuts parse): New test case.
7209 (Undesirable destructors if user action cuts parse): New test case.
7210 Before applying any of this patch, this test case never actually failed
7211 for me... but only because the corrupted semantic options usually
7212 masked this bug.
7213 (Leaked merged semantic value if user action cuts parse): New test
7214 case.
7215
7216 2006-01-05 Akim Demaille <akim@epita.fr>
7217
7218 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7219
7220 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7221
7222 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7223 _MSC_VER. Problem reported by Cenzato Marco.
7224 (b4_c_function_def): Use it.
7225 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7226 b4_c_modern.
7227 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7228 than rolling our own.
7229
7230 2006-01-04 Akim Demaille <akim@epita.fr>
7231
7232 Also warn about non-used mid-rule values.
7233 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7234 member.
7235 (symbol_list_new): Adjust.
7236 * src/reader.c (symbol_typed_p): New.
7237 (grammar_rule_check): Use it.
7238 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7239 Check its rule.
7240 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7241 Use it.
7242 * tests/actions.at (Exotic Dollars): Adjust.
7243
7244 2006-01-04 Akim Demaille <akim@epita.fr>
7245
7246 * src/reader.c (grammar_midrule_action): If $$ is set in a
7247 mid-rule, move the `used' bit to its lhs.
7248 * tests/input.at (Unused values): New.
7249 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7250
7251 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7252
7253 * doc/bison.texinfo (Bison Options): Say more accurately what
7254 --yacc does.
7255 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7256 about declarations in the grammar when in Yacc mode, as POSIX does
7257 not require a diagnostic when the grammar uses extensions.
7258
7259 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7260
7261 Warn about dubious constructions like "%token T T".
7262 Reported by twlevo.
7263 * src/symtab.h (struct symbol.declared): New member.
7264 * src/symtab.c (symbol_new): Initialize it to false.
7265 (symbol_class_set): New arg DECLARING, specifying whether
7266 this is a declaration that we want to warn about, if there
7267 is more than one of them. All uses changed.
7268
7269 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7270 Allow multiple %union directives, whose contents concatenate.
7271 * src/parse-gram.y (grammar_declaration): Likewise.
7272 Use muscle_code_grow, so that we don't need stype_line any more.
7273 All uses changed.
7274
7275 * src/muscle_tab.c (muscle_grow): Fix comment.
7276
7277 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7278 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7279 Update copyright year to 2006.
7280
7281 2006-01-03 Akim Demaille <akim@epita.fr>
7282
7283 Have glr.cc pass (some of) the calc.at tests.
7284 * data/glr.cc (b4_parse_param_orig): New.
7285 (b4_parse_param): Improve its definition, and bound it more
7286 clearly in the skeleton.
7287 (b4_epilogue): Append, instead of prepending, in order to keep
7288 #line consistency.
7289 Simplify the generation of auxiliary functions: locations and
7290 purity are mandated.
7291 (b4_global_tokens_and_yystype): Honor it.
7292 * data/location.cc (c++.m4): Don't include it.
7293 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7294 and AT_SKEL_CC_IF.
7295 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7296 AT_LALR1_CC_IF.
7297 Be sure to initialize the first position's filename.
7298 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7299 mandated anyway.
7300 (AT_CHECK_CALC_GLR_CC): New.
7301 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7302
7303 2006-01-02 Akim Demaille <akim@epita.fr>
7304
7305 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7306 c.m4.
7307 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
7308 * data/glr.cc: Do not include stack.hh.
7309
7310 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7311
7312 * data/glr.c: Reformat whitespace with tabs.
7313 (b4_lpure_formals): Remove this unused m4 macro.
7314 * tests/cxx-type.at: Reformat whitespace with tabs.
7315 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7316 since it's a member. Rename type to isNterm for clarity.
7317
7318 2005-12-29 Akim <akim@sulaco.local>
7319
7320 Let glr.cc catch up with symbol_value_print.
7321 * data/glr.cc (b4_yysymprint_generate): Replace by...
7322 (b4_yy_symbol_print_generate): this.
7323 (yy_symbol_print, yy_symbol_value_print): Declare them.
7324
7325 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7326
7327 * src/location.h (boundary): Note that a line or column equal
7328 to INT_MAX indicates an overflow.
7329 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7330 (rule_length_overflow, increment_rule_length, add_column_width):
7331 New functions.
7332 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7333 (<SC_BRACED_CODE>"}"):
7334 Use increment_rule_length rather than incrementing it by hand.
7335 (adjust_location, handle_syncline): Diagnose overflow.
7336 (handle_action_dollar, handle_action_at):
7337 Fix bug with monstrosities like $-2147483648.
7338 Remove now-unnecessary checks.
7339 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7340 (convert_ucn_to_byte): Verify assumptions.
7341 (handle_syncline): New arg LOC. All callers changed.
7342 Don't store through a value derived from char const * pointer.
7343
7344 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7345 GCC warnings.
7346
7347 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7348
7349 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7350 Remove unnecessary forward static decls.
7351
7352 2005-12-27 Akim Demaille <akim@epita.fr>
7353
7354 * src/reader.c (grammar_current_rule_check): Also check that $$
7355 is used.
7356 Take the rule to check as argument, hence rename as...
7357 (grammar_rule_check): this.
7358 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7359 Rename as...
7360 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7361 (grammar_midrule_action, grammar_symbol_append): Now static.
7362 * tests/torture.at (input): Don't rely on the default action
7363 being always performed.
7364 * tests/calc.at: "Set" $$ even when the action is "cut" with
7365 YYERROR or other.
7366 * tests/actions.at (Exotic Dollars): Instead of using unused
7367 values, check that the warning is issued.
7368
7369 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7370
7371 * NEWS: Improve wording for unused-value warnings.
7372
7373 2005-12-22 Akim Demaille <akim@epita.fr>
7374
7375 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7376 (b4_yysymprint_generate): Rename as...
7377 (b4_yy_symbol_print_generate): this.
7378 Generate yy_symbol_print instead of yysymprint.
7379 Generate also yy_symbol_value_print, and use it.
7380
7381 2005-12-22 Akim Demaille <akim@epita.fr>
7382
7383 * NEWS: Warn about unused values.
7384 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7385 a `used' member.
7386 (symbol_list_n_get, symbol_list_n_used_set): New.
7387 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7388 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7389 * src/reader.c (grammar_current_rule_check): Check that values are
7390 used.
7391 * src/symtab.c (symbol_print): Accept 0.
7392 * tests/existing.at: Remove the type information.
7393 Empty the actions.
7394 Remove useless actions (beware of mid-rule actions: perl -000
7395 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7396 * tests/actions.at (Exotic Dollars): Use unused values.
7397 * tests/calc.at: Likewise.
7398 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7399 Likewise.
7400
7401 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7402 rule_useful_p.
7403
7404 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7405
7406 Undo 2005-12-01 tentative license wording change. The wording is
7407 still being reviewed by the lawyers, and we don't want to wait for
7408 them before publishing a test release. For now, revert to the
7409 previous wording.
7410 * NEWS: Undo 2005-12-01 change.
7411 * data/glr.c: Revert to previous license wording.
7412 * data/glr.cc: Likewise.
7413 * data/lalr1.cc: Likewise.
7414 * data/location.cc: Likewise.
7415 * data/yacc.c: Likewise.
7416
7417 * NEWS: Reword %destructor vs YYABORT etc.
7418 * data/glr.c: Use American spacing, for consistency.
7419 * data/glr.cc: Likewise.
7420 * data/lalr1.cc: Likewise.
7421 * data/yacc.c: Likewise.
7422 * data/yacc.c: Reformat comments slightly.
7423 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7424 for consistency. Fix some spelling errors and reword recently-included
7425 text slightly.
7426 * tests/cxx-type.at: Cast results of malloc, for C++.
7427
7428 2005-12-21 Joel E. Denny <address@hidden>
7429
7430 * tests/cxx-type.at: Construct a tree, count the parents of shared
7431 nodes, and free each node once and only once. Previously, the memory
7432 for semantic values was leaked instead.
7433
7434 2005-12-21 Joel E. Denny <address@hidden>
7435
7436 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7437 (yylval, yylloc): If pure, #define to yystackp->yyval and
7438 yystackp->yyloc similar to yychar and yynerrs.
7439 (yyparse): If pure, remove local yylval and yylloc. Add local
7440 yystackp to accommodate pure definitions of yylval and yylloc.
7441 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7442 yylvalp and yyllocp to &yylval and &yylloc.
7443 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7444 namespace. Previously, nerrs and char were missing, but lval and lloc
7445 weren't necessary.
7446 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7447 yylvalp and yyllocp parameters since, if pure, these are now always
7448 accessible through yystackp. If not pure, they are still accessible
7449 globally.
7450 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7451 `if (YYID (N))' to pacify lint.
7452
7453 2005-12-21 Akim Demaille <akim@epita.fr>
7454
7455 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7456 destroy the RHS symbols of a rule.
7457 * data/yacc.c (yylen): Initialize to 0.
7458 Keep its value to the number of items to possibly shift.
7459 In particular, a regular successful parse that ends on YYFINAL by
7460 a (internal) YYACCEPT must not have yylen != 0.
7461 (yyerrorlab, yyreturn): Pop the RHS.
7462 Reorder a bit to emphasize the `shifting' bits of code.
7463 (YYPOPSTACK): Now accept a number of items to pop.
7464 * data/lalr1.cc: Likewise.
7465 * data/glr.c: Formatting changes.
7466 Use goto instead of fall through.
7467 * doc/bison.texinfo (Destructor Decl): Complete.
7468
7469 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7470
7471 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7472 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7473 * djgpp/config.bat: Replace every occurence of the file name
7474 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7475 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7476 * djgpp/config.sed: Replace every occurence of the file name
7477 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7478 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7479 * djgpp/djunpack.bat: DJGPP specific file.
7480 * djgpp/fnchange.lst: DJGPP specific file.
7481 * djgpp/README.in: Add new information about how to unpack the bison
7482 source on MSDOS and other systems which have 8.3 file name restrictions
7483 using djunpack.bat and fnchange.lst.
7484
7485 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7486
7487 * bootstrap (build_cvs_prefix): Remove; unused.
7488 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7489 when getting gnulib.
7490
7491 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7492
7493 * data/glr.c: Reorder typedef declarations for structs to match order
7494 of struct declarations.
7495 Rename yystack everywhere to yystackp except in yyparse where it's not
7496 a pointer.
7497 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7498 consistency.
7499 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7500 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7501 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7502 lint.
7503
7504 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7505
7506 * tests/sets.at (Accept): Fix typos in regular expression used to
7507 sed out the final state number.
7508
7509 Work around portability problem on Solaris 10: flex-generated
7510 files include <stdio.h> before <config.h>, which messes up
7511 because the latter defines __EXTENSIONS__. Address the problem
7512 by creating two new little files that include <config.h> first,
7513 then include the flex-generated files. Rewrite everyone else
7514 to include <config.h> first, as well.
7515 * lib/timevar.c: Always include "config.h".
7516 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7517 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7518 (EXTRA_bison_SOURCES): New macro.
7519 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7520 * src/system.h: Don't include config.h.
7521 * src/LR0.c: Include <config.h> first.
7522 * src/assoc.c: Likewise.
7523 * src/closure.c: Likewise.
7524 * src/complain.c: Likewise.
7525 * src/conflicts.c: Likewise.
7526 * src/derives.c: Likewise.
7527 * src/files.c: Likewise.
7528 * src/getargs.c: Likewise.
7529 * src/gram.c: Likewise.
7530 * src/lalr.c: Likewise.
7531 * src/location.c: Likewise.
7532 * src/main.c: Likewise.
7533 * src/muscle_tab.c: Likewise.
7534 * src/nullable.c: Likewise.
7535 * src/output.c: Likewise.
7536 * src/parse-gram.y: Likewise.
7537 * src/print.c: Likewise.
7538 * src/print_graph.c: Likewise.
7539 * src/reader.c: Likewise.
7540 * src/reduce.c: Likewise.
7541 * src/relation.c: Likewise.
7542 * src/state.c: Likewise.
7543 * src/symlist.c: Likewise.
7544 * src/symtab.c: Likewise.
7545 * src/tables.c: Likewise.
7546 * src/uniqstr.c: Likewise.
7547 * src/vcg.c: Likewise.
7548
7549 * src/parse-gram.y: Fix minor problems uncovered by lint.
7550 (current_lhs, current_lhs_location): Now static.
7551 (current_assoc): Remove unused variable.
7552
7553 Cleanups so that Bison-generated parsers have less lint.
7554 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7555 Prepend /*ARGSUSED*/, for lint's sake.
7556 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7557 definition if 'lint' is defined.
7558 (YYID): New macro (or function, if lint).
7559 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7560 * data/yacc.c: Likewise.
7561 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7562 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7563 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7564 is C++ only.
7565 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7566 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7567 Use YYID(0) rather than 0, for lint.
7568 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7569 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7570
7571 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7572
7573 * tests/glr-regression.at
7574 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7575 Close memory leak reported by twlevo.
7576
7577 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7578
7579 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7580 all stacks.
7581 (yyparse): Iterate another stack in order to call user destructors.
7582 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7583 New test case.
7584 (Duplicated user destructor for lookahead): This test now is expected
7585 to succeed.
7586
7587 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7588
7589 * NEWS: Document the following change.
7590 * data/yacc.c: Say "parser skeleton" rather than "file", since
7591 it's no longer just a file.
7592 * data/glr.c: Grant a special exception for C GLR parsers, that
7593 reads like the already-existing exception for C LALR(1) parsers.
7594 * data/glr.cc: Likewise.
7595 * data/lalr1.cc: Likewise.
7596 * data/location.cc: Likewise.
7597 * data/yacc.c: Reword the "written by" statement to clarify that
7598 it was the parser skeleton, not the entire output file.
7599 * data/glr.c: Written by Paul Hilfinger.
7600 * data/glr.cc: Written by Akim Demaille.
7601 * data/lalr1.cc: Likewise.
7602
7603 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7604
7605 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7606 Fix typos in previous change that broke 'make check'.
7607 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7608 supported in C.
7609 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7610 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7611 We can revert this once things settle down.
7612
7613 * src/conflicts.c (conflicts_print): Don't print file name twice
7614 when %expect fails because there were no conflicts.
7615 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7616 change.
7617 * tests/conflicts.at (%expect not enough, %expect too much):
7618 (%expect with reduce conflicts): Adjust to new behavior.
7619
7620 2005-11-18 Akim Demaille <akim@epita.fr>
7621
7622 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7623 errors.
7624 * NEWS: Document this.
7625 * doc/bison.texinfo (Expect Decl): Likewise.
7626
7627 2005-11-16 Akim Demaille <akim@epita.fr>
7628
7629 Generalize the display of semantic values and locations in traces.
7630 * data/glr.c (yy_reduce_print): Fix indices (again).
7631 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7632 literal integers.
7633 * data/lalr1.cc (yyreduce_print): Rename as...
7634 (yy_reduce_print): this.
7635 Display values and locations.
7636 * data/yacc.c (yy_reduce_print): Likewise.
7637 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7638 (yysymprint): Move higher to be visible from yy_reduce_print).
7639 (yyparse): Adjust.
7640 * tests/calc.at: Adjust the expected length of the traces.
7641
7642 2005-11-14 Akim Demaille <akim@epita.fr>
7643
7644 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7645 from 1 to N, while values and location start at 0.
7646 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7647
7648 2005-11-14 Akim Demaille <akim@epita.fr>
7649
7650 * data/glr.c (yy_reduce_print): Fix the $ number.
7651
7652 2005-11-14 Akim Demaille <akim@epita.fr>
7653
7654 "Use" parse parameters.
7655 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7656 * data/glr.c, data/glr.cc: Use them.
7657 * data/glr.c (YYUSE): Have a C++ definition that supports
7658 non-pointer types.
7659
7660 2005-11-14 Akim Demaille <akim@epita.fr>
7661
7662 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7663
7664 2005-11-14 Akim Demaille <akim@epita.fr>
7665
7666 * data/glr.cc: New.
7667 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
7668
7669 2005-11-12 Akim Demaille <akim@epita.fr>
7670
7671 Let position and location be PODs.
7672 * data/location.cc (position::initialize, location::initialize): New.
7673 (position::position, location::location): Define only if
7674 b4_location_constructors is defined.
7675 * data/lalr1.cc (b4_location_constructors): Define it for backward
7676 compatibility.
7677 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7678
7679 2005-11-12 Akim Demaille <akim@epita.fr>
7680
7681 * data/lalr1.cc: Move the body of the ctor and dtor into the
7682 parser file (instead of the header).
7683 Wrap the implementations in a "namespace yy".
7684
7685 2005-11-12 Akim Demaille <akim@epita.fr>
7686
7687 Have glr.c include its header file when created.
7688 * data/glr.c (b4_shared_declarations): New.
7689 Output them verbatim in the parser if !%defines, otherwise
7690 output then in the header file, and include it instead.
7691
7692 2005-11-11 Akim Demaille <akim@epita.fr>
7693
7694 * data/glr.c: Comment changes.
7695
7696 2005-11-11 Akim Demaille <akim@epita.fr>
7697
7698 When yydebug, report semantic and location values for reductions.
7699 * data/glr.c (yy_reduce_print): Report the semantic values and the
7700 locations.
7701 (YY_REDUCE_PRINT): Adjust.
7702 (yyglrReduce): Use them.
7703 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7704 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7705 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7706 traces.
7707
7708 2005-11-10 Akim Demaille <akim@epita.fr>
7709
7710 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7711 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7712 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7713
7714 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7715
7716 * m4/cxx.m4, examples/Makefile.am: Don't build
7717 examples/calc++ if no C++ compiler is available. (trivial change)
7718
7719 2005-11-09 Akim Demaille <akim@epita.fr>
7720
7721 * src/scan-skel.l: Use a couple of asserts.
7722
7723 2005-11-03 Akim Demaille <akim@epita.fr>
7724
7725 In some (weird) cases, the final state number is incorrect.
7726 Reported by Alexandre Duret-Lutz.
7727 * src/LR0.c (state_list_append): Remove the computation of
7728 final_state.
7729 (save_reductions): Do it here.
7730 (get_state): Alpha conversion.
7731 (generate_states): Use a for loop.
7732 * src/gram.h (item_number_is_rule_number)
7733 (item_number_is_symbol_number): New.
7734 * src/state.c: Use assert.
7735 * src/system.h: Include assert.h.
7736 * tests/sets.at (Accept): New.
7737
7738 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7739
7740 * data/glr.c (yyfill): Adjust comment.
7741 (yyresolveAction): Initialize default location properly
7742 for empty right-hand sides.
7743 (yydoAction): Ditto.
7744 Add comment explaining apparently dead code.
7745 * tests/glr-regression.at
7746 (Incorrectly initialized location for empty right-hand side in GLR):
7747 New test.
7748
7749 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7750
7751 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7752 gnulib when interrupted. This fixes some race conditions and
7753 works around some portability problems (one noted by Paul
7754 Hilfinger).
7755
7756 2005-10-22 Akim <akim@epita.fr>
7757
7758 * Makefile.cfg: Adjust to config -> build-aux.
7759 Reported by twledo.
7760
7761 2005-10-21 Akim Demaille <akim@epita.fr>
7762
7763 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7764 the %parse-params.
7765 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7766 * data/yacc.c (b4_Pure_if): Rename as...
7767 (b4_yacc_pure_if): this.
7768 (YY_SYMBOL_PRINT, yyparse): Adjust.
7769 * doc/bison.texinfo: Formatting changes.
7770
7771 2005-10-21 Akim Demaille <akim@epita.fr>
7772
7773 Finish the transition config -> build-aux.
7774 * configure.ac, Makefile.am: Use build-aux.
7775 * config/prev-version, config/announce-gen, config/Makefile.am:
7776 Move to...
7777 * build-aux/prev-version, build-aux/announce-gen,
7778 * build-aux/Makefile.am: here.
7779
7780 2005-10-14 Akim Demaille <akim@epita.fr>
7781
7782 * examples/calc++/test: Use set -x only when VERBOSE.
7783
7784 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7785
7786 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7787 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7788
7789 2005-10-13 Akim Demaille <akim@epita.fr>
7790
7791 * src/scan-skel.l: Output the base name parts of the parser and
7792 header file names.
7793 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7794 additional checks.
7795 Use this to exercise C++ outputs in subdirs.
7796 Reported by Oleg Smolsky.
7797
7798 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7799
7800 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7801 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7802 Problem reported by John P. Hartmann.
7803 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7804 already defined it.
7805
7806 2005-10-12 Akim Demaille <akim@epita.fr>
7807
7808 * src/parse-gram.y (version_check): Exit 63 to please missing
7809 (stands for "version mismatch).
7810 * tests/input.at, doc/bison.texinfo: Adjust.
7811
7812 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7813
7814 Work around portability problems with Visual Age C compiler
7815 (xlc and xlC_r) reported by John P. Hartmann.
7816 * data/location.cc (initial_column, initial_line): Remove.
7817 All uses replaced by 0 and 1.
7818 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7819 that xlc complains about.
7820 * src/scan-skel.l (skel_wrap): Likewise.
7821 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
7822 as __STDC__.
7823 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7824 __STDC_VERSION__. Use it everywhere instead of looking at
7825 __STDC__ and __cplusplus.
7826
7827 2005-10-10 Akim Demaille <akim@epita.fr>
7828
7829 * examples/calc++/test: Be quiet unless VERBOSE.
7830
7831 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7832
7833 * data/c.m4 (yydestruct, yysymprint):
7834 Use YYUSE instead of casting to void.
7835 * data/glr.c (YYUSE): New macro.
7836 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7837 Use it instead of rolling our own.
7838 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7839 (YYCHK1):
7840 Use /*CONSTCOND*/ to suppress lint warnings.
7841 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7842 (YY_STACK_PRINT): Use 'false' not '0'.
7843 (YYUSE): New macro.
7844 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7845 * data/yacc.c (YYUSE): New macro.
7846 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7847 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7848 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7849
7850
7851 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7852 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7853
7854 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7855
7856 Undo the parts of the unlocked-I/O change that substituted
7857 putc or puts for printf. This might hurt performance a bit,
7858 but some people prefer the printf style.
7859 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7860 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7861 All uses replaced by YYFPRINTF and YYDPRINTF.
7862 * data/yacc.c: Likewise.
7863 * lib/bitset.c (bitset_print): Likewise.
7864 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7865 putc and puts.
7866 * lib/lbitset.c (debug_lbitset): Likewise.
7867 * src/closure.c (print_firsts, print_fderives): Likewise.
7868 * src/gram.c (grammar_dump): Likewise.
7869 * src/lalr.c (look_ahead_tokens_print): Likewise.
7870 * src/output.c (escaped_output): Likewise.
7871 (user_actions_output): Break apart two printfs.
7872 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7873 * src/reduce.c (reduce_print): Likewise.
7874 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7875 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7876
7877 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7878 Use assignments rather than casts-to-void to suppress
7879 unused-variable warnings. This pacifies 'lint'.
7880 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7881 unused-variable warnings.
7882
7883 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7884
7885 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7886
7887 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7888
7889 Use unlocked I/O for a minor performance improvement on hosts like
7890 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7891 is to use the gnlib unlocked-io module, and to prefer putc and
7892 puts to printf when either will work (since the latter doesn't
7893 come in an unlocked flavor).
7894 * bootstrap (gnulib_modules): Add unlocked-io.
7895 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7896 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7897 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7898 and similarly for puts and putc and printf.
7899 * data/yacc.c: Likewise.
7900 * lib/bitset.c (bitset_print): Likewise.
7901 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7902 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7903 to printf.
7904 * lib/lbitset.c (debug_lbitset): Likewise.
7905 * src/closure.c (print_firsts, print_fderives): Likewise.
7906 * src/gram.c (grammar_dump): Likewise.
7907 * src/lalr.c (look_ahead_tokens_print): Likewise.
7908 * src/output.c (escaped_output): Likewise.
7909 (user_actions_output): Coalesce two printfs.
7910 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
7911 * src/reduce.c (reduce_print): Likewise.
7912 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7913 * src/system.h: Include unlocked-io.h rather than stdio.h.
7914
7915 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7916 this confuses xgettext.
7917
7918 2005-10-02 Akim Demaille <akim@epita.fr>
7919
7920 * bootstrap (gnulib_modules): Add strverscmp.
7921 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7922 * m4/.cvsignore: Add strverscmp.m4.
7923 * src/parse-gram.y (%require): New token, new rule.
7924 (version_check): New.
7925 * src/scan-gram.l (%require): Adjust.
7926 * tests/input.at (AT_REQUIRE): New.
7927 Use it.
7928 * doc/bison.texinfo (Require Decl): New.
7929 (Calc++ Parser): Use %require.
7930
7931 2005-10-02 Akim Demaille <akim@epita.fr>
7932
7933 * data/location.cc: New.
7934
7935 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7936 Akim Demaille <akim@epita.fr>
7937
7938 Make sure -odir/foo.cc creates dir/location.hh etc.
7939 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7940 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7941 (spec_defines_file): Now const.
7942 (dir_prefix): New.
7943 (short_base_name): Remove.
7944 * src/files.c: Adjust.
7945 (dirname.h): Include.
7946 (base_name): Don't prototype it.
7947 (finput): Remove, duplicates gram_in.
7948 (full_base_name, short_base_name): Replace by...
7949 (all_but_ext, all_but_tab_ext): these.
7950 (compute_base_names): Rename as...
7951 (compute_file_name_parts): this.
7952 Update to compute the new variables, including dir_prefix.
7953 Adjust dependencies.
7954 * src/output.c (prepare): Output them.
7955 * src/reader.c: Adjust to use gram_in, not finput.
7956 * src/scan-skel.l (@dir_prefix@): New.
7957
7958 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7959
7960 * lib/subpipe.c: New function end_of_output_subpipe() added
7961 to allow support for non-posix systems. This is a no-op function
7962 for posix systems.
7963
7964 * lib/subpipe.h: New function end_of_output_subpipe() added
7965 to allow support for non-posix systems. This is a no-op function
7966 for posix systems.
7967
7968 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7969 handle the lack of pipe/fork functionality on non-posix systems.
7970
7971 * djgpp/Makefile.maint: DJGPP specific file.
7972
7973 * djgpp/README.in: DJGPP specific file.
7974
7975 * djgpp/config.bat: DJGPP specific configuration file.
7976
7977 * djgpp/config.sed: DJGPP specific configuration file.
7978
7979 * djgpp/config.site: DJGPP specific configuration file.
7980
7981 * djgpp/config_h.sed: DJGPP specific configuration file.
7982
7983 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7984
7985 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7986
7987 2005-10-02 Akim Demaille <akim@epita.fr>
7988
7989 * data/location.cc: New, extract from...
7990 * data/lalr1.cc: here.
7991 (location.hh): Include it after the user prologue, in case the
7992 filename type is defined by the user.
7993 Forward declation location and position before the pre-prologue.
7994 (yyresult_): Rename as...
7995 (yyresult): this, it's a local variable, not an attribute.
7996 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7997
7998 2005-10-01 Akim Demaille <akim@epita.fr>
7999
8000 * examples/extexi: Restore the #line generation.
8001
8002 2005-09-30 Akim Demaille <akim@epita.fr>,
8003 Alexandre Duret-Lutz <adl@gnu.org>
8004
8005 Move the token type and YYSTYPE in the parser class.
8006 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
8007 (parser::token): New, from the moved free definition of tokens.
8008 (parser::semantic_value): Now a full definition instead of an
8009 indirection to YYSTYPE.
8010 (b4_post_prologue): No longer included in the header file, but
8011 in the implementation file.
8012 * doc/bison.texi (C+ Language Interface): Update.
8013 * src/parse-gram.y: Support unary %define.
8014 * tests/actions.at: Define global_tokens_and_yystype for backward
8015 compatibility until we update the tests.
8016 * tests/calc.at: Idem.
8017 (first_line, first_column, last_line, last_column): Define for lalr1.cc
8018 to simplify the code.
8019
8020 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
8021
8022 Port to SunOS 4.1.4, which lacks strtoul and strerror.
8023 Ah, the good old days! Problem reported by Peter Klein.
8024 * bootstrap (gnulib_modules): Add strerror, strtoul.
8025 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
8026 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
8027
8028 2005-09-29 Akim Demaille <akim@epita.fr>
8029
8030 * data/c.m4 (b4_error_verbose_if): New.
8031 * data/lalr1.cc: Use it.
8032 (YYERROR_VERBOSE_IF): Remove.
8033 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
8034 parser members, replaced by...
8035 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
8036 local variables.
8037 (yysyntax_error_): Takes the state number as argument.
8038 (yyreduce_print_): Use the argument yyrule, not the former
8039 attribute yyn_.
8040
8041 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
8042
8043 * bootstrap (gnulib_modules): Add verify.
8044 * lib/.cvsignore: Add verify.h.
8045 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
8046 * src/system.h (verify): Remove.
8047 Include verify.h instead.
8048 * src/tables.c (tables_generate): Use new API for 'verify'.
8049
8050 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
8051
8052 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
8053 local variables whose names begin with 'yy'.
8054 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8055 Trivial changes from Joel E. Denny.
8056
8057 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
8058 it itself.
8059 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
8060 don't use alloca any more.
8061
8062 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
8063 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
8064 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
8065 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
8066 to match yacc.c, to test more hosts.
8067
8068 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
8069
8070 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
8071 doesn't affect behavior.
8072 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
8073 Solaris, AIX, MSC.
8074 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
8075 This works a bit better with glibc, if user code has already included
8076 stdlib.h.
8077 * doc/bison.texinfo (Bison Parser): Document that users can't
8078 arbitrarily use malloc and free for other purposes. Document
8079 that <alloca.h> and <malloc.h> might be included.
8080 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
8081 user must declare alloca.
8082
8083 * HACKING (release): Forwarn the Translation Project about
8084 stable releses.
8085
8086 2005-09-20 Akim Demaille <akim@epita.fr>
8087
8088 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8089
8090 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8091
8092 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8093 (YYSTACK_ALLOC_MAXIMUM): Use it.
8094 (yysyntax_error): New function.
8095 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8096 multiple syntax errors are reported, and alloca is being used.
8097 Instead, reallocate buffers twice as big each time, so that
8098 we waste at most half the allocated memory. Start with a small
8099 (128-byte) buffer that will suffice in most cases anyway.
8100 Use yysyntax_error to do most of the work.
8101
8102 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8103 yynerrs is the number of errors reported, not the number of
8104 errors encountered.
8105
8106 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8107 Mark it as expected to fail.
8108 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8109 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8110 Don't start user-code symbols with "yy", to avoid name space problems.
8111
8112 2005-09-19 Akim Demaille <akim@epita.fr>
8113
8114 Remove the traits, failed experiment.
8115 It never proved useful, and anyway because of the current
8116 definition, it was not possible to have several specialization of
8117 this traits, making it useless.
8118 * data/lalr1.cc (yy:traits): Remove.
8119 Inline its definitions in the parser class.
8120
8121 2005-09-19 Akim Demaille <akim@epita.fr>
8122
8123 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8124 least Mac OSX with a /usr/local install of gettext.
8125
8126 2005-09-19 Akim Demaille <akim@epita.fr>
8127
8128 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8129 and yytoken for similarity with the other skeletons.
8130
8131 2005-09-19 Akim Demaille <akim@epita.fr>
8132
8133 * NEWS, configure.ac: update version number to 2.1a.
8134
8135 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8136
8137 * NEWS: Version 2.1.
8138
8139 * NEWS: Remove notice of yytname change, since it was never in an
8140 official release.
8141 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8142 diagnostic.
8143 * src/output.c (prepare): Likewise.
8144 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8145 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8146 is not defined. This is an awful hack, but it's enough for now.
8147 All callers changed.
8148 * tests/glr-regression-at (make_value): Args are const pointers now,
8149 to avoid GCC warning.
8150 (Duplicated user destructor for lookahead): New test. Currently
8151 skipped. It fails on my host but I'm not sure it'll always fail.
8152
8153 2005-09-16 Akim Demaille <akim@epita.fr>
8154
8155 * src/symtab.h (struct symbol): Declare the printer and destructor
8156 as const, to avoid accidental calls to free.
8157 (symbol_destructor_set, symbol_printer_set): Adjust.
8158 * src/symtab.c: Adjust.
8159
8160 2005-09-16 Akim Demaille <akim@epita.fr>
8161
8162 * data/c.m4 (b4_token_enums): New.
8163 (b4_token_defines): Rename as...
8164 (b4_token_enums_defines): this.
8165 (b4_token_defines): New, output only the #defines.
8166 * data/yacc.c, data/glr.c: Adjust.
8167 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8168 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8169 as default values.
8170
8171 2005-09-16 Akim Demaille <akim@epita.fr>
8172
8173 * data/lalr1.cc (yylex_): Remove, inline its code.
8174 (yyreport_syntax_error_): Remove, replaced by...
8175 (yysyntax_error_): this which returns a string and leaves to the
8176 caller the call to the users' error function.
8177 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8178 Move from members of the parser object...
8179 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8180 to local variables of the parse function.
8181
8182 2005-09-16 Akim Demaille <akim@epita.fr>
8183
8184 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8185 since it's in Bison's name space.
8186
8187 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8188
8189 * data/glr.c (yyresolveValue): Add default case to pacify
8190 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8191
8192 * NEWS: Document when yyparse started to return 2.
8193 * doc/bison.texinfo (Parser Function): Document when yyparse
8194 returns 2.
8195
8196 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8197 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8198 changed.
8199 (class position): file_name -> filename (reverting). All uses changed.
8200
8201 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8202
8203 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8204 do anything if $@ exists. This reverts part of the 2005-07-07
8205 patch.
8206
8207 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8208
8209 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8210 contains obsolete information and isn't worth distributing as a
8211 separate file anyway.
8212 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8213 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8214 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8215 (yyparse): Abort if user code uses longjmp to throw an unexpected
8216 value.
8217
8218 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8219
8220 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8221 Suggested by twlevo@xs4all.nl.
8222
8223 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8224 This avoids a diagnostic from gcc -Wswitch-enum.
8225 Problem reported by twlevo@xs4all.nl.
8226
8227 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8228 standards. Use "file name" or "file" or "name", depending on
8229 the context.
8230 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8231 not to hack/foo.tab.c.
8232 (Calc++ Top Level): 2nd arg of main is not const.
8233 * data/glr.c: b4_filename -> b4_file_name.
8234 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8235 All uses changed.
8236 (class position): filename -> file_name. All uses changed.
8237 * data/yacc.c: b4_filename -> b4_file_name.
8238 * lib/bitset.h: filename -> file_name in local vars.
8239 * lib/bitset_stats.c: Likewise.
8240 * src/files.c: Likewise.
8241 * src/scan-skel.l ("@output ".*\n): Likewise.
8242 * src/files.c (file_name_split): Renamed from filename_split.
8243 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
8244
8245 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8246
8247 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8248 to accommodate latest gnulib.
8249
8250 * tests/glr-regression.at (Duplicate representation of merged trees):
8251 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8252
8253 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8254 needed.
8255
8256 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8257
8258 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8259 All uses changed. Invoke user destructor after an error during a
8260 split parse (trivial change from Joel E. Denny).
8261
8262 * tests/glr-regression.at
8263 (User destructor after an error during a split parse): New test case.
8264 Problem reported by Joel E. Denny in:
8265 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8266
8267 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8268
8269 * README-cvs: Give URLs for recommended tools.
8270 Mention Gzip version problem, and bootstrapping issues.
8271 Remove troubleshooting section, as it's somewhat obsolete.
8272
8273 * bootstrap (no_cache): New var, to accommodate different wget
8274 variants. Use it instead of '-C off'. Problem reported by
8275 twlevo@xs4all.nl.
8276
8277 * data/glr.c (yydestroyStackItem): New function.
8278 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8279 debugging information. Problem reported by Joel E. Denny.
8280
8281 2005-08-25 Akim Demaille <akim@epita.fr>
8282
8283 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8284
8285 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8286
8287 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8288 Don't invoke destructor on unresolved entries.
8289 * tests/glr-regression.at
8290 (User destructor for unresolved GLR semantic value): New test case.
8291 Problem reported by Joel E. Denny in:
8292 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8293
8294 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8295
8296 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8297 Add strnlen.c.
8298 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8299 lib-prefix.m4, po.m4.
8300
8301 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8302 in yydestruct diagnostic, since it might not be an error.
8303 Problem reported by Joel Denny near end of
8304 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8305 * data/lalr1.cc (yyerturn): Likewise.
8306 * data/yacc.c (yyreturn): Likewise.
8307 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8308
8309 * src/files.c: Remove obsolete FIXME comment.
8310
8311 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8312 with the other templates, and to fix bogus run-on messages such
8313 as the one reported at the end of
8314 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8315 All callers changed to avoid the newline.
8316 (yyprocessOneStack): Output two lines rather than one, to accommodate
8317 the above change. This changes the debug output format slightly.
8318
8319 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8320 reported by Joel E. Denny in
8321 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8322 (trivial change).
8323 * tests/glr-regression.at (Duplicate representation of merged trees):
8324 New test, from Joel E. Denny in:
8325 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8326 * THANKS: Add Joel E. Denny.
8327
8328 * configure.ac (AC_INIT): Bump to 2.0c.
8329
8330 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8331
8332 * NEWS: Version 2.0b.
8333
8334 * Makefile.am (SUBDIRS): Put examples before tests, so that
8335 "make check" doesn't finish with "All 1 tests passed".
8336
8337 * tests/regression.at (Token definitions): Don't rely on
8338 AT_PARSER_CHECK for data that contains backslashes. It currently
8339 uses 'echo', and 'echo' isn't portable if its argument contains
8340 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8341 that the byte '\0xff' is not printable in the C locale; it is,
8342 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8343 not printable, so use '\0x81' to test.
8344
8345 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8346 version of GCC, since the macro is used with non-GCC compilers.
8347
8348 Fix core dump reported by Pablo De Napoli in
8349 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8350 * tests/regression.at (Invalid inputs with {}): New test.
8351 * src/parse-gram.y (token_name): Translate type before using
8352 it as an index.
8353
8354 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8355 the user's name space. All uses changed to __attribute__
8356 ((__unused__)).
8357 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8358 Add __attribute__ ((__noreturn__)).
8359
8360 * etc/clcommit: Remove. We weren't using it, and it failed
8361 "make maintainer-distcheck".
8362 * Makefile.maint: Merge from coreutils.
8363 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8364 (syntax-check-rules): Change list of rules as described below.
8365 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8366 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8367 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8368 (sc_trailing_space): New rules.
8369 (sc_xalloc_h_in_src): Remove.
8370 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8371 (sc_space_tab, sc_error_exit_success, sc_changelog):
8372 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8373 (makefile-check, po-check, author_mark_check):
8374 (makefile_path_separator_check, copyright-check):
8375 Use grep -n, to make it easier to find violations.
8376 Use CVS_LIST and CVS_LIST_EXCEPT.
8377 (header_regexp, h_re): Remove.
8378 (dd_c): New macro.
8379 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8380 (my-distcheck): Use more-modern GCC flags.
8381 (signatures, %.asc): Remove.
8382 (rel-files, announcement): Remove signatures.
8383 Restore old updating code, even though we don't use it, so
8384 that we're the same as coreutils.
8385 (alpha, beta, major): Depend on news-date-check.
8386 Make the upload commands.
8387
8388 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8389 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8390 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8391 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8392 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8393 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8394 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8395 * tests/sets.at: Likewise.
8396
8397 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8398 we comment out the Autoconf version number.
8399 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8400 it's error-prone and "make maintainer-distcheck" rejects it.
8401
8402 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8403 Indent calls to "error" to pacify "make maintainer-distcheck",
8404 when the calls are not intended to be translated.
8405 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8406
8407 * src/Makefile.am (DEFS): Use +=, to pacify
8408 "make maintainer-distcheck".
8409 (bison_SOURCES): Add scan-skel.h.
8410 (sc_tight_scope): New rule, from coreutils.
8411
8412 * src/files.c (src_extension, header_extension):
8413 Now static, not extern.
8414 * src/getargs.c (short_options): Likewise.
8415 * src/muscle_tab.c (muscle_table): Likewise.
8416 * src/parse-gram.y (current_class, current_type, current_prec):
8417 Likewise.
8418 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8419 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8420 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8421 void, to avoid warning when NLS is disabled.
8422 * src/output.c: Include scan-skel.h.
8423 (scan_skel): Remove decl, since scan-skel.h does this.
8424 (output_skeleton):
8425 Indent calls to "error" to pacify "make maintainer-distcheck".
8426 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8427 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8428 "make maintainer-distcheck".
8429 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8430 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8431 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8432 (skel_lex_destroy, scan_skel): Move these decls to...
8433 * src/scan-skel.h: New file.
8434 * src/uniqstr.c (uniqstr_assert):
8435 Indent calls to "error" to pacify "make maintainer-distcheck".
8436
8437 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8438 not @VAR@.
8439
8440 * tests/torture.at: Revamp to avoid misuse of atoi that
8441 "make maintainer-distcheck" complained about.
8442
8443 * examples/extexi (message): Don't print a message more than once,
8444 and omit line-number decoration that makes Emacs compile think
8445 that informative messages are worth worrying about.
8446
8447 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8448
8449 * configure.ac: Update version number.
8450
8451 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8452 accidentally.
8453 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8454 autogenerated by the maintainer.
8455 * examples/calc++/.cvsignore: Add *.yy.
8456
8457 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8458 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8459 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8460
8461 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8462
8463 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8464 from maintainer-distcheck about casting the argument of 'free'.
8465
8466 * NEWS: Mention recent yytname changes.
8467 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8468
8469 * bootstrap: For translations that have not yet been upgraded to
8470 the new runtime-po domain, prime the pump by extracting the
8471 relevant strings from the obsolete translations. This code can be
8472 removed once the bison-runtime domain has been translated by each
8473 team.
8474
8475 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8476 now that token names are already quoted.
8477
8478 Fix problem reported by Anthony Heading.
8479 * data/glr.c (YYTOKEN_TABLE): New macro.
8480 (yytname): Define if YYTOKEN_TABLE.
8481 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8482 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8483 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8484 * src/output.c (prepare_symbols): Output token_table_flag.
8485
8486 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8487
8488 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8489 again if the first call fails.
8490
8491 * data/glr.c (yytnamerr): New function.
8492 (yyreportSyntaxError): Use it to dequote most string literals.
8493 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8494 with other skeletons. All uses changed.
8495 (yytnameerr_): New function.
8496 (yyreport_syntax_error): Use it to dequote most string literals.
8497 * data/yacc.c (yytnamerr): New function.
8498 (yyerrlab): Use it to decode most string literals.
8499 * doc/bison.texinfo (Decl Summary, Calling Convention):
8500 Clarify quoting convention of yytname.
8501 * src/output.c (prepare_symbols): Quote all names. This undoes
8502 the 2005-04-17 change, which is now accomplished (mostly) via
8503 changes in the parsers as described above.
8504 * tests/regression.at (Token definitions, Web2c Actions):
8505 Undo most 2005-04-17 change here, too.
8506
8507 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8508
8509 Fix more problems reported by twlevo@xs4all.nl.
8510 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8511 remove trailing spaces. This loses the exit status of ./types,
8512 and isn't needed since ./types shouldn't be emitting trailing
8513 spaces.
8514 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8515 as the stack isn't valid in that case.
8516
8517 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8518 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8519 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8520 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8521 is used.
8522 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8523 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8524 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8525 Likewise.
8526
8527 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8528 overly-picky compilers that reject 'char *foo = "bar";'.
8529
8530 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8531 to FILE * parameter, not to stderr. This fixes a typo introduced
8532 in the 2005-07-12 change.
8533
8534 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8535 warnings from GCC 4.
8536
8537 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8538 (yyglrShiftDefer, yysplitStack):
8539 Remove unused parameters b4_pure_formals. All uses changed.
8540 (yyglrShift): Remove unused parameters b4_user_formals.
8541 All uses changed.
8542 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8543
8544 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8545
8546 Destructor cleanups and regularization among the three skeletons.
8547 * NEWS: Document the behavior changes.
8548 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8549 stack before failing, as the cleanup code will do it for us now.
8550 * data/lalr1.cc (yyerrlab): Likewise.
8551 * data/glr.c (yyparse): Pop everything off the stack before
8552 freeing it, so that destructors get called properly.
8553 * data/lalr1.cc (yyreturn): Likewise.
8554 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8555 This is more consistent.
8556 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8557 why destructors might be called. 1.875 -> 2.1.
8558 (Destructor Decl, Decl Summary, Table of Symbols):
8559 Some English-language cleanups for %destructor.
8560 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8561 Add output line for destructor of start symbol.
8562 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8563 because of that same extra output line.
8564
8565 * NEWS: Document minor wording changes in diagnostics of
8566 Bison-generated parsers.
8567 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8568 Remove unused formals. All uses changed.
8569 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8570 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8571 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8572 Rename yyoverflowab to yyexhaustedlab.
8573 When memory exhaustion occurs during syntax-error reporting,
8574 report it separately rather than in a single diagnostic; this
8575 eases translation.
8576 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8577 (Memory Exhausted): Renamed from Parser Stack Overflow.
8578 Revamp wording slightly to prefer "memory exhaustion".
8579 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8580
8581 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8582
8583 Add i18n support to the GLR skeleton. Partially fix the C++
8584 skeleton; a C++ expert needs to finish this. Remove debugging
8585 msgids; there's little point to having them translated, since they
8586 can be understood only by someone who can read the
8587 (English-language) source code.
8588
8589 Generate runtime-po/bison-runtime.pot automatically, so that we
8590 don't have to worry about garbage getting in that file. We'll
8591 make sure after the next official release that old msgids don't
8592 get lost. See
8593 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8594
8595 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8596 Now auto-generated.
8597 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8598 Fix typos in explanations of the runtime file.
8599 * bootstrap: Change gettext keyword from YYI18N to YY_.
8600 Use standard Makefile.in.in in runtime-po, since we'll arrange
8601 for backward-compatible bison-runtime.po files in a different way.
8602 * data/glr.c (YY_): New macro, from yacc.c.
8603 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8604 Translate messages intended for users.
8605 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8606 the wording in the other skeletons. We don't know that the memory
8607 is virtual.
8608 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8609 Use same method that yacc.c uses.
8610 Don't translate debugging messages.
8611 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8612 it doesn't work (yet), and requires C++ expertise to fix.
8613 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8614 Move defn to a more logical place, to be consistent with other
8615 skeletons.
8616 Don't translate debugging messages.
8617 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8618 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8619 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8620 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8621
8622 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8623 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8624 void, not int.
8625 * tests/glr-regression.at (Badly Collapsed GLR States):
8626 Likewise.
8627 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8628 yylex should return 0 at EOF rather than aborting.
8629
8630 Improve tests for stack overflow in GLR parser.
8631 Problem reported by twlevo@xs4all.nl.
8632 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8633 All uses removed.
8634 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8635 can handle the problem.
8636 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8637 (yyparse): New local variable yyresult to record the result.
8638 Use result of setjmp to set it, rather than storing itinto
8639 struct.
8640 (yyDone): Remove label.
8641 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8642 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8643 if YYABORT is used).
8644 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8645 yyparse status; put status > 1 into diagnostic.
8646 Check that status==2 works.
8647 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8648 Use exit status 3 for failure to open (which shouldn't happen).
8649
8650 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8651
8652 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8653 1 on syntax error; just let yyparse do its thing.
8654 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8655 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8656 (Exploding the Stack Size with Alloca):
8657 (Exploding the Stack Size with Malloc):
8658 Expect exit status 2, not 1, since the parser is supposed to blow
8659 its stack. Problem reported by twlevo@xs4all.nl.
8660
8661 * data/glr.c (yyparse): Don't assume that the initial calls
8662 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8663 Print a stack-overflow message and fail instead.
8664 Initialize the line-number information before creating the stack,
8665 so that the stack-overflow message can report line zero safely.
8666
8667 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8668
8669 Fix problems reported by twlevo@xs4all.nl.
8670 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8671 (yyuserMerge): Provide a default case if b4_mergers is empty.
8672 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8673 * tests/glr-regression.at
8674 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8675 Add casts to pacify C++ compilers.
8676 * tests/glr-regression.at (Improper merging of GLR delayed action
8677 sets): Declare yylex before using it.
8678 * tests/Makefile.am (maintainer-check-g++): Fix a stray
8679 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8680 test for valgrind; valgrind is independent of g++.
8681 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8682 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8683 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8684 Use a destructor, so that we can expand the stack. Change
8685 YYSTYPE to char * so that we can free it. Cast result of malloc.
8686
8687 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8688
8689 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8690 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8691
8692 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8693
8694 * PACKAGING: New file, suggested by Bruno Haible and taken from
8695 similar wording in gettext's PACKAGING file.
8696 * NEWS: Mention PACKAGING.
8697 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8698
8699 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8700
8701 * NEWS: Document recent i18n improvements.
8702 * bootstrap: Get runtime translations into runtime-po.
8703 Create runtime-po files automatically, if possible.
8704 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8705 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8706 does not infringe on the user's name space.
8707 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8708 * doc/bison.texinfo (Internationalization): Revamp the English
8709 and Texinfo syntax a bit, to try to make it clearer.
8710 (Bison Options, Option Cross Key): Mention --print-localedir.
8711 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8712 YYENABLE_NLS. Quote a bit more.
8713 * runtime-po/.cvsignore: New file.
8714 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8715 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8716 * runtime-po/quot.sed: Likewise.
8717 * runtime-po/boldquot.sed: Likewise.
8718 * runtime-po/en@quot.header: Likewise.
8719 * runtime-po/en@boldquot.header: Likewise.
8720 * runtime-po/insert-header.sin: Likewise.
8721 * runtime-po/remove-potcdate.sin: Likewise.
8722 * runtime-po/Makevars: Likewise.
8723 * runtime-po/LINGUAS: Likewise.
8724 * runtime-po/de.po: Likewise; we will rely on the translation project
8725 to maintain this, so "bootstrap" should get it.
8726 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
8727 its value.
8728 * src/main.c (main): Bind the bison-runtime domain, too.
8729
8730 2005-07-12 Bruno Haible <bruno@clisp.org>
8731
8732 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8733 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8734 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8735 * runtime-po: New directory.
8736 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8737 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8738 * runtime-po/Rules-quot: New file, copied from po/.
8739 * runtime-po/quot.sed: Likewise.
8740 * runtime-po/boldquot.sed: Likewise.
8741 * runtime-po/en@quot.header: Likewise.
8742 * runtime-po/en@boldquot.header: Likewise.
8743 * runtime-po/insert-header.sin: Likewise.
8744 * runtime-po/remove-potcdate.sin: Likewise.
8745 * runtime-po/Makevars: New file.
8746 * runtime-po/POTFILES.in: New file.
8747 * runtime-po/LINGUAS: New file.
8748 * runtime-po/bison-runtime.pot: New file.
8749 * runtime-po/de.po: New file.
8750 * m4/bison.m4: New file.
8751 * Makefile.am (SUBDIRS): Add runtime-po.
8752 (aclocaldir, aclocal_DATA): New variables.
8753 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8754 Define aclocaldir.
8755 * src/getargs.c (usage): Document --print-localedir option.
8756 (PRINT_LOCALEDIR_OPTION): New enum item.
8757 (long_options): Add --print-localedir option.
8758 (getargs): Handle --print-localedir option.
8759 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8760 (Internationalization): New section.
8761
8762 2005-07-12 Akim Demaille <akim@epita.fr>
8763
8764 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8765 for consistency with the rest of the code.
8766 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8767 Add separators.
8768
8769 2005-07-12 Akim Demaille <akim@epita.fr>
8770
8771 * src/parse-gram.y: Use %printer instead of YYPRINT.
8772
8773 2005-07-12 Akim Demaille <akim@epita.fr>
8774
8775 * src/symtab.h, src/symtab.c (symbol_print): New.
8776 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8777 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8778
8779 2005-07-12 Akim Demaille <akim@epita.fr>
8780
8781 * data/glr.c (b4_syncline): Fix (swap) the definitions of
8782 b4_at_dollar and b4_dollar_dollar.
8783
8784 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8785
8786 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8787 and Pennello's paper.
8788
8789 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8790
8791 * data/yacc.c (yyparse): Undo previous patch. Instead,
8792 set yylsp[0] and yyvsp[0] only if the initial action
8793 sets yylloc and yylval, respectively.
8794
8795 * data/yacc.c (yyparse): In the initial action, set
8796 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8797 This avoids the use of undefined variables if the initial
8798 action does not set yylloc and/or yylval.
8799
8800 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8801
8802 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8803 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8804 Remove from CVS. These files are automatically generated.
8805 * examples/extexi: Clarify that this file is now part of Bison,
8806 not GNU M4, and that it works with any POSIX-compatible Awk.
8807 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8808 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8809 so that we also get calc++-parser.yy. Geneate it.
8810 Use $(AWK), not gawk, since any conforming Awk will do.
8811 Put comment before action, since older 'make' can't handle comment
8812 in action.
8813 $(BUILT_SOURCES): List all built sources, not just some of them.
8814 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8815 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8816 $($(calc_sources_generated)): Remove unnecessary test for existence
8817 of target. (This had a shell syntax error anyway; a stray "x".)
8818 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8819 calc++-parser.yy.
8820 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8821
8822 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8823 implied by the other modules.
8824
8825 2005-07-06 Akim Demaille <akim@epita.fr>
8826
8827 Bind examples/calc++ to the package.
8828 * examples/calc++/Makefile: Remove, replaced by...
8829 * examples/calc++/Makefile.am: ... this new file.
8830 * examples/calc++/test: Remove input.
8831 * examples/calc++/compile: Remove.
8832 * examples/Makefile.am: New.
8833 * configure.ac, Makefile.am: Adjust.
8834 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8835
8836 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8837
8838 * data/glr.c (yyFail): Drastically simplify; since the format argument
8839 never had any % directives, we can simply pass it to yyerror.
8840 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8841 be modified later, as that is the usual style in glr.c.
8842 Problems reported by Paul Hilfinger.
8843
8844 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8845 and size overflow errors.
8846 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8847 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8848 (YYSIZEMAX): New macro.
8849 (yystpcpy): New function, taken from yacc.c.
8850 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8851 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8852 so that we don't have to maintain their signatures.
8853 (yyFail): Check for buffer overflow, by using vsnprintf rather
8854 than vsprintf. Allocate a bigger buffer if possible.
8855 Report an error if buffer allocation fails.
8856 (yyStackOverflow): New function.
8857 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8858 the initialization was successful. It might fail if storage was
8859 exhausted.
8860 (yyexpandGLRStack): Add more checks for storage allocation failure.
8861 Use yyStackOverflow to report failures.
8862 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8863 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8864 Don't assume stack number fits in int.
8865 (yysplitStack): Check for storage allocation failure.
8866 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8867 can print diagnostics on storage allocation failure. All callers
8868 changed.
8869 (yyresolveValue): Use yybool for boolean.
8870 (yyreportSyntaxError): Check for size-calculation overflow.
8871 This code is taken from yacc.c.
8872 (yyparse): Check for storage allocation errors when allocating
8873 the initial stack.
8874
8875 2005-07-05 Akim Demaille <akim@epita.fr>
8876
8877 Extract calc++ from the documentation.
8878 * doc/bison.texinfo (Calc++): Add the extraction marks.
8879 * examples/extexi: New, from the aborted GNU Programming 2E.
8880 Separate the different paragraph of a file with empty lines.
8881 * examples/Makefile: Use it to extract the whole calc++ example.
8882
8883 2005-06-24 Akim Demaille <akim@epita.fr>
8884
8885 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8886 class typedefs.
8887
8888 2005-06-22 Akim Demaille <akim@epita.fr>
8889
8890 * doc/bison.texinfo (C++ Language Interface): First stab.
8891 (C++ Parsers): Remove.
8892
8893 2005-06-22 Akim Demaille <akim@epita.fr>
8894
8895 * data/lalr1.cc (yylex_): Honor %lex-param.
8896
8897 2005-06-22 Akim Demaille <akim@epita.fr>
8898
8899 Start a set of simple examples.
8900 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8901 * examples/calc++/calc++-driver.hh,
8902 * examples/calc++/calc++-parser.yy,
8903 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8904 * examples/calc++/compile, examples/calc++/test: New.
8905
8906 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8907
8908 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8909 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8910 which stems from the 2005-05-27 patch.
8911
8912 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8913
8914 * data/glr.c: Modify treatment of unused parameters to permit use
8915 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8916
8917 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8918
8919 Fix infringement on user name space reported by Janos Zoltan Szabo.
8920 * data/yacc.c (yyparse): strlen -> yystrlen.
8921
8922 2005-05-30 Akim Demaille <akim@epita.fr>
8923
8924 * data/lalr1.cc (_): New.
8925 Translate the various messages.
8926
8927 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8928
8929 Fix infringement on user name space reported by Bruno Haible.
8930 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8931 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8932 the user's name space.
8933 (alloca): Include <stdlib.h> to get it, if it's not built in.
8934 (YYMALLOC, YYFREE): Define only if needed.
8935 (malloc, free): Declare, but only if needed, as this infringes on
8936 the user name space.
8937
8938 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8939
8940 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8941 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8942 with %d format.
8943 * lib/ebitset.c (min, max): Undef before defining.
8944 * lib/vbitset.c (min, max): Likewise.
8945 * lib/subpipe.c (create_subpipe): Save local variables in case
8946 vfork clobbers them.
8947
8948 2005-05-24 Bruno Haible <bruno@clisp.org>
8949
8950 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8951 error message syntax used by gcc-4.0.
8952
8953 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8954
8955 * README: Mention m4 1.4.3. Remove obsolete advice about
8956 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8957
8958 * bootstrap: Remove workaround for problem I encountered with
8959 gettext 0.14.1; it seems to be fixed now.
8960
8961 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8962
8963 * NEWS: Version 2.0a.
8964
8965 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8966 the previous change.
8967
8968 Various maintainer cleanups.
8969 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8970 conftest*, for benefit of CVS commands run at the same time as
8971 "configure". Add build-aux, since "bootstrap" now creates it and
8972 its subfiles.
8973 * Makefile.cfg (move_if_change): Remove.
8974 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8975 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8976 (po_repo, do-po-update, po-update, wget_files, get-targets):
8977 (config.guess-url_prefix, config.sub-url_prefix):
8978 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8979 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8980 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8981 Remove.
8982 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8983 this is now the recommended name.
8984 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8985 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8986 ylwrap. These files now go into build-aux.
8987 * config/move-if-change: Remove.
8988 * config/prev-version.txt: Bump from 1.75 to 2.0.
8989
8990 * bootstrap: Add stdio-safer, unistd-safer modules.
8991 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8992 we don't need it).
8993 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8994 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8995 * lib/subpipe.c: Include "unistd-safer.h".
8996 (create_subpipe): Make sure all the newly-created
8997 file descriptors are > 2, so that diagnostics don't
8998 get sent down them (which might cause Bison to hang, in theory).
8999 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
9000 * src/files.c (xfopen): Use fopen_safer, not fopen.
9001
9002 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
9003 yesterday's yacc.c fix.
9004
9005 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
9006
9007 * data/glr.c, data/lalr1.cc: Update copyright date.
9008
9009 Fix a destructor bug reported by Wolfgang Spraul in
9010 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
9011 * data/yacc.c (yyabortlab): Don't call destructor, and
9012 don't set yychar to EMPTY.
9013 (yyoverflowlab): Don't call destructor.
9014 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
9015 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
9016 since we no longer output the message "discarding lookahead token
9017 end of input ()".
9018
9019 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9020
9021 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
9022 fix a small glitch in debugging output.
9023 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
9024 after YY_SYMBOL_PRINT where needed.
9025
9026 (struct yyGLRState): Add some comments.
9027 (struct yySemanticOption): Add some comments.
9028 (union yyGLRStackItem): Add comment.
9029
9030 (yymergeOptionSets): Correct this to properly perform the union,
9031 avoiding infinite reported by Michael Rosien.
9032 Update comment.
9033
9034 * tests/glr-regression.at: Add test for GLR merging error reported
9035 by M. Rosien.
9036
9037 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
9038
9039 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
9040 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
9041 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
9042 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
9043 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
9044 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
9045 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
9046 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
9047 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
9048 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
9049 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
9050 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
9051 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
9052 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
9053 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
9054 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
9055 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
9056 src/derives.h, src/files.c, src/files.h, src/getargs.c,
9057 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
9058 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
9059 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
9060 src/output.h, src/parse-gram.c, src/parse-gram.h,
9061 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
9062 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
9063 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
9064 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
9065 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
9066 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
9067 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
9068 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
9069 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
9070 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
9071 tests/reduce.at, tests/regression.at, tests/sets.at,
9072 tests/synclines.at, tests/testsuite.at, tests/torture.at:
9073 Update FSF postal mail address.
9074
9075 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
9076
9077 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
9078 Problem reported by Ralf Menzel.
9079
9080 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 * tests/actions.at: Test that stack overflow invokes destructors.
9083 From Marcus Holland-Moritz.
9084 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9085 from here....
9086 (yyreturn): to here. That way, destructors are called properly
9087 even if the stack overflows, or the user calls YYACCEPT or
9088 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9089 (yyoverflowlab): Destroy the lookahead.
9090
9091 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9092
9093 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9094
9095 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9096
9097 * NEWS: Bison-generated C parsers no longer quote literal strings
9098 associated with tokens.
9099 * src/output.c (prepare_symbols): Don't escape strings,
9100 since users don't want to see C escapes.
9101 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9102 in diagnostics.
9103 * tests/input.at (Torturing the Scanner): Likewise.
9104 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9105
9106 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9107
9108 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9109 the data size is known to be too small and we can't increase it.
9110 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9111
9112 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9113
9114 * src/parse-gram.y: Include quotearg.h.
9115 (string_as_id): Quote $1 before using it as a key, since the
9116 lexer no longer quotes it for us.
9117 (string_content): Don't strip quotes, since lexer no longer
9118 quotes it for us.
9119 * src/scan-gram.l: Include quotearg.h.
9120 ("\""): Omit quote.
9121 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9122 a key, since the rest of the lexer doesn't quote it.
9123 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9124 * tests/regression.at (Token definitions): Check for backslashes
9125 in token strings.
9126
9127 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9128 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9129 (yyparse): Revamp code to generate long syntax error message, to
9130 make it easier to translate, and to avoid problems with arithmetic
9131 overflow. Change "virtual memory" to "memory" in diagnostic, since
9132 we don't know whether the memory is virtual.
9133
9134 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9135
9136 * NEWS: Bison-generated C parsers now use the _ macro to
9137 translate strings.
9138 * data/yacc.c (_) [!defined _]: New macro.
9139 All English strings wrapped inside this macro.
9140 * doc/bison.texinfo (Bison Parser): Document _.
9141 * po/POTFILES.in: Include src/parse-gram.c, since it now
9142 includes translateable strings that parse-gram.y doesn't.
9143
9144 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9145
9146 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9147 reverting the 2004-10-11 change to this function.
9148 (symbol_check_alias_consistency): Don't call symbol_type_set
9149 if the type name is already correct.
9150 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9151
9152 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9153
9154 * tests/regression.at (Token definitions): Don't use a token named
9155 c, as that generates a "#define c ..." that runs afoul of buggy
9156 stdlib.h that uses the identifier c as a member of struct
9157 drand48_data. Problem reported by Horst Wente.
9158
9159 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9160
9161 * bootstrap: Change translation URL from
9162 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9163 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9164 redirection glitches. Problem reported by twlevo@xs4all.nl.
9165
9166 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9167
9168 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9169 after operands; POSIX says this isn't portable for the c99 command.
9170
9171 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9172
9173 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9174 immediately if a data overrun has occurred; this may help us track
9175 down what may be a spurious failure on MacOS.
9176
9177 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9178
9179 Respond to problems reported by twlevo@xs4all.nl.
9180
9181 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9182
9183 * src/vcg.h: Comment fix.
9184 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9185 (G_CMAX): Change to -1 instead of INT_MAX.
9186
9187 * data/yacc.c (yyparse): Omit spaces before #line.
9188
9189 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9190
9191 * src/tables.c (state_number_to_vector_number): Put it inside an
9192 "#if 0", since it's not currently used. Problem reported by
9193 Roland McGrath.
9194
9195 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9196
9197 * src/output.c (escaped_output): Renamed from
9198 escaped_file_name_output, since we now use it for symbol tags as
9199 well. All uses changed.
9200 (symbol_destructors_output, symbol_printers_output):
9201 Escape symbol tags too.
9202 Problem reported by Matyas Forstner in
9203 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9204
9205 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9206 not needed.
9207 * src/output.c (user_actions_output, token_definitions_output,
9208 symbol_destructors_output, symbol_printers_output): Likewise.
9209 * src/reader.c (prologue_augment): Likewise.
9210 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9211
9212 * src/vcg.c (output_edge): Don't quote linestyle arg.
9213 Problem reported by twlevo@xs4all.nl.
9214
9215 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9216
9217 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9218 example, reported by Derek M Jones. Also, make the example even
9219 more outrageous, to better illustrate how bad the problem is.
9220
9221 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9222
9223 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9224 putsym. Typo reported by Sebastian Piping.
9225
9226 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9227
9228 * doc/bison.texinfo (Language and Grammar): some -> same
9229 (Epilogue): int he -> in the
9230 Typos reported by Sebastian Piping via Justin Pence.
9231
9232 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9233
9234 * tests/glr-regression.at (Improper handling of embedded actions
9235 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9236 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9237 with dollar signs in test names.
9238 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9239 for a similar reason.
9240
9241 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9242
9243 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9244 wants to redefine G_VIEW.
9245
9246 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9247
9248 * src/vcg.c (get_view_str): Remove case for normal_view.
9249 Problem reported by twlevo@xs4all.nl.
9250
9251 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9252
9253 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9254 Problem reported by twlevo@xs4all.nl.
9255
9256 * doc/bison.texinfo: Change @dircategory from "GNU programming
9257 tools" to "Software development". Requested by Richard Stallman
9258 via Karl Berry.
9259
9260 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9261
9262 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9263 Problem reported by twlevo@xs4all.nl.
9264
9265 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9266
9267 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9268 keyword; it's not needed with modern compilers, and it doesn't
9269 affect correctness with older compilers. Suggested by
9270 twlevo@xs4all.nl.
9271
9272 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9273
9274 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9275 gcc -Wswitch-default.
9276 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9277 * data/yacc.c (yyparse): Likewise.
9278
9279 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9280
9281 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9282 already. Let config.h define any nonstandard values.
9283
9284 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9285
9286 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9287 for the benefit of slower hosts. Problem reported by
9288 Nelson H. F. Beebe.
9289
9290 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9291
9292 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9293 being defined and not used.
9294 * data/lalr1.cc (yyparse): Likewise.
9295 Use "if (false)" rather than "if (0)".
9296
9297 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9298
9299 * TODO: Mention that we should allow NUL bytes in tokens.
9300
9301 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9302
9303 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9304 Problem reported by Hans Aberg.
9305
9306 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9307
9308 * src/getargs.c (version): Happy new year; update overall
9309 program copyright date from 2004 to 2005.
9310
9311 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9312 Problem reported by Hans Aberg.
9313 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9314 (Output file names.): Add a test for the case when standard output
9315 is closed.
9316
9317 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9318
9319 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9320 to fix an oversight in the Bison 2.0 manual.
9321
9322 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9323
9324 * NEWS: Version 2.0. Reformat the existing news items since
9325 1.875, so that related items are grouped together.
9326 * configure.ac (AC_INIT): Bump version to 2.0.
9327 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9328
9329 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9330 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9331 otherwise, we're not testing alloca. Unfortunately there's no
9332 simple way to consult HAVE_ALLOCA here.
9333
9334 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9335 for yymsg, too.
9336
9337 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9338 hand. This avoids a warning about comparing int to size_t when
9339 GCC warnings are enabled.
9340
9341 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9342
9343 * NEWS: Bison-generated parsers no longer default to using the
9344 alloca function (when available) to extend the parser stack, due
9345 to widespread problems in unchecked stack-overflow detection.
9346 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9347 responsibility to set it to a positive value. This lets the user
9348 specify a value that is not a preprocessor constant.
9349 * data/yacc.c (YYMAXDEPTH): Likewise.
9350 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9351 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9352 to be a compile-time constant. However, explain the constraints on it.
9353 Also, explain the constraints on YYINITDEPTH.
9354 (Table of Symbols): Explain that alloca is no longer the default.
9355 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9356 to 1.
9357
9358 * doc/bison.texinfo (Location Default Action): Mention that n must
9359 be zero when k is zero. Suggested by Frank Heckenbach.
9360
9361 2004-12-22 Akim Demaille <akim@epita.fr>
9362
9363 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9364 (parser::state_type, parser::semantic_type, parser::location_type):
9365 Private, not public.
9366 (parser::parse): Return ints, not bool.
9367 Returning a bool introduces a problem: 0 corresponds to false, and
9368 it seems weird to return false on success. Returning true changes
9369 the conventions for yyparse.
9370 Alternatively we could return void and send an exception.
9371 There is no clear consensus (yet?).
9372 (state_stack, semantic_stack, location_stack): Rename as...
9373 (state_stack_type, semantic_stack_type, location_stack_type): these.
9374 Private, not public.
9375 * tests/c++.at: New.
9376 * tests/testsuite.at, tests/Makefile.am: Adjust.
9377
9378 2004-12-21 Akim Demaille <akim@epita.fr>
9379
9380 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9381
9382 2004-12-21 Akim Demaille <akim@epita.fr>
9383
9384 Don't impose std::string for filenames.
9385
9386 * data/lalr1.cc (b4_filename_type): New.
9387 (position::filename): Use it.
9388 (parser.hh): Move the inclusion of stack.hh and location.hh below
9389 the user code, so that needed headers for the filename type can be
9390 included first.
9391 Forward declare them before the user code.
9392 * tests/Makefile.am (check-local, installcheck-local): Pass
9393 TESTSUITEFLAGS to the TESTSUITE.
9394
9395 2004-12-20 Akim Demaille <akim@epita.fr>
9396
9397 Use more STL like names: my_class instead of MyClass.
9398
9399 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9400 (SemanticStack, SemanticType, StateStack, StateType)
9401 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9402 (Parser::value): Rename as...
9403 (location_stack, location_type, rhs_number_type, semantic_stack)
9404 (semantic_type, state_stack, state_type, token_number_type, stack)
9405 (slice, traits, parser::yylloc, parser::yylval): these.
9406
9407 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9408
9409 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9410
9411 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9412 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9413
9414 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9415
9416 Remove uses of 'short int' and 'unsigned short int'. This raises
9417 some arbitrary limits. It uses more memory but nowadays that's
9418 not much of an issue.
9419
9420 This change does not affect the generated parsers; that's a different
9421 task, as some users will want to conserve memory there.
9422
9423 Ideally we should use size_t to represent all object counts, and
9424 something like ptrdiff_t to represent signed differences of object
9425 counts; but that will require more code-cleanup than I have the
9426 time to do right now.
9427
9428 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9429 Use size_t, not int or short int, to count objects.
9430 * src/closure.c (nritemset, closure): Likewise.
9431 * src/closure.h (nritemset, closure): Likewise.
9432 * src/nullable.c (nullable_compute): Likewise.
9433 * src/print.c (print_core): Likewise.
9434 * src/print_graph.c (print_core): Likewise.
9435 * src/state.c (state_compare, state_hash): Likewise.
9436 * src/state.h (struct state): Likewise.
9437 * src/tables.c (default_goto, goto_actions): Likewise.
9438
9439 * src/gram.h (rule_number, rule): Use int, not short int.
9440 * src/output.c (prepare_rules): Likewise.
9441 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9442 errs, reductions): Likewise.
9443 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9444 Likewise.
9445 * src/tables.c (vector_number, tally, action_number,
9446 ACTION_NUMBER_MINIMUM): Likewise.
9447 * src/output.c (muscle_insert_short_int_table): Remove.
9448
9449 2004-12-17 Akim Demaille <akim@epita.fr>
9450
9451 * data/lalr1.cc: Extensive Doxygenation.
9452 (error_): Rename as...
9453 (error): this, since it is visible to the user.
9454 Adjust callers.
9455 (Parser::message): Now an automatic variable from...
9456 (Parser::yyreport_syntax_error_): here.
9457 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9458 Parser::error.
9459 * tests/input.at: Escape $.
9460
9461 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9462
9463 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9464 Parenthesize rhs to avoid obscure problems with mistakes like
9465 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9466 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9467 b4_rhs_location): Likewise.
9468 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9469 b4_rhs_location): Likewise.
9470
9471 2004-12-16 Akim Demaille <akim@epita.fr>
9472
9473 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9474 yacc.c: be sure to stay within yycheck_.
9475 * tests/actions.at: Re-enable C++ tests.
9476
9477 2004-12-16 Akim Demaille <akim@epita.fr>
9478
9479 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9480 real.
9481
9482 2004-12-16 Akim Demaille <akim@epita.fr>
9483
9484 Use #define to handle the %name-prefix.
9485
9486 * data/glr.c, data/yacc.c: Comment changes.
9487 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9488 so that one can refer to yylex in the parser file, and have it
9489 renamed, as is the case with other skeletons.
9490
9491 2004-12-16 Akim Demaille <akim@epita.fr>
9492
9493 Move lalr1.cc internals into yy*.
9494
9495 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9496 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9497 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9498 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9499 (empty_, final_, terror_, errcode_, ntokens_)
9500 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9501 (looka_, ilooka_, error_range_, nerrs_):
9502 Rename as...
9503 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9504 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9505 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9506 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9507 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9508 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9509 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9510 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9511 these.
9512
9513 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9514
9515 Fix some problems reported by twlevo at xs4all.
9516 * src/symtab.c (symbol_new): Report an error if the input grammar
9517 contains too many symbols. This is better than calling abort() later.
9518 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9519 (struct node, struct graph):
9520 Rename member expand to stretch. All uses changed.
9521 (struct graph): Remove member layoutalgorithm. All uses removed.
9522 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9523 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9524 All uses changed.
9525 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9526
9527 2004-12-15 Akim Demaille <akim@epita.fr>
9528
9529 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9530 Add more Doxygen comments.
9531 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9532 (report_syntax_error_, translate_): Rename as...
9533 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9534 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9535
9536 2004-12-15 Akim Demaille <akim@epita.fr>
9537
9538 * data/lalr1.cc (lex_): Rename as...
9539 (yylex_): this.
9540 Move the trace here.
9541 Take the %name-prefix into account.
9542 Reported by Alexandre Duret-Lutz.
9543
9544 2004-12-15 Akim Demaille <akim@epita.fr>
9545
9546 Simplify the C++ parser constructor.
9547
9548 * data/lalr1.cc (debug_): Rename as...
9549 (yydebug_): so that the parser's internals are always in the yy*
9550 pseudo namespace.
9551 Adjust uses.
9552 (b4_parse_param_decl): Remove the leading comma as it is now only
9553 called as unique argument list.
9554 (Parser::Parser): Remove the constructor accepting a location and
9555 an initial debugging level.
9556 Remove from the other ctor the argument for the debugging level.
9557 (debug_level_type, debug_level, set_debug_level): New.
9558
9559 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9560 constructor calls.
9561
9562 2004-12-15 Akim Demaille <akim@epita.fr>
9563
9564 Remove b4_root related material: failure experiment
9565 (which goal was to allow to derive from a class).
9566
9567 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9568 definitions and uses.
9569
9570 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9571
9572 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9573 not 2, since it's not portable to subtract 1 from the start of an
9574 array. The new item 0 is never set or used. All uses changed.
9575
9576 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9577 the default definition of YYLLOC_DEFAULT. Problem reported
9578 by Frank Heckenbach.
9579
9580 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9581
9582 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9583 the normal case and one for the error case. Just use the
9584 first one uniformly. Problem reported by Frank Heckenbach.
9585 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9586 use exactly the same macro in both places.
9587 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9588 so that the normal-case YYRHSLOC works for the error case too.
9589 All uses changed.
9590 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9591 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9592 * doc/bison.texinfo (Location Default Action): Don't claim that
9593 we have an array of locations. Use the same macro for both glr
9594 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9595 the index is 0.
9596
9597 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9598
9599 * HACKING: Update email addresses to send announcements to.
9600
9601 * configure.ac (AC_INIT): Bump version to 1.875f.
9602
9603 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9604
9605 * NEWS: Version 1.875e.
9606 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9607
9608 * src/scan-skel.l: Include "complain.h", for "fatal".
9609
9610 * src/relation.h (relation_print, relation_digraph):
9611 Relation sizes are of type relation_node, not size_t (this is
9612 merely a doc fix, since the two types are equivalent).
9613 (relation_transpose): Relation sizes are of type relation_node,
9614 not int.
9615 * src/relation.c: Likewise.
9616 (top, infinity): Now of type relation_node, not int.
9617 (traverse, relation_transpose): Use relation_node, not int.
9618
9619 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9620 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9621 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9622
9623 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
9624 specifying whether the test should be skipped. Use it tp
9625 specify that the [%defines %skeleton "lalr1.cc"] tests currently
9626 fail on some hosts, and should be skipped.
9627
9628 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9629
9630 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9631 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9632 unless otherwise specified below.
9633
9634 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9635 to allocate kernel_base, kernel_items, kernel_size, since
9636 they needn't be initialized to 0.
9637 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9638 * src/closure.c (new_closure): Likewise, for itemset.
9639 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9640 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9641 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9642 (build_relations): Likewise for edge, states1, includes.
9643 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9644 * src/reader.c (packgram): Likewise, for ritem, rules.
9645 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9646 * src/relation.c (relation_digraph): Likewise for VERTICES.
9647 (relation_transpose): Likewise for new_R, end_R.
9648 * src/symtab.c (symbols_token_translations_init): Likewise for
9649 token_translations.
9650 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9651 (token_actions): Likewise for yydefact, actrow, conflrow,
9652 conflict_list.
9653 (save_column): Likewise for froms[symno], tos[symno].
9654 (goto_actions): Likewise for state_count.
9655 (pack_table): Likewise for base, pos, check.
9656 (tables_generate): Likewise for width.
9657
9658 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9659 for initial core. Just have a separate core, so we needn't worry
9660 about whether kernel_size and kernel_base are initialized.
9661
9662 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9663 kernel_size, kernel_items): Remove unnecessary initialization.
9664 * src/conflicts.c (conflicts): Likewise.
9665 * src/derives.c (derives): Likewise.
9666 * src/muscle_tablc (muscle_insert): Likewise.
9667 * src/relation.c (relation_digraph): Likewise.
9668 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9669 conflrow, conflict_table, conflict_list, table, check):
9670 Likewise.
9671
9672 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9673 This is because all callers pass unsigned int.
9674 * src/closure.h (new_closure): Likewise.
9675
9676 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9677 (build_relations): Initialize includes[i] in all cases.
9678 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9679 and rules[ruleno].precsym. Initialize members in order.
9680 * src/relation.c (relation_transpose): Always initialize new_R[i]
9681 and end_R[i].
9682 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9683
9684 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9685 conflict_list[0] was always 0, but now it isn't initialized.
9686
9687 * src/table.c (table_grow): When conflict_table grew, the grown
9688 area wasn't cleared. Fix this.
9689
9690 * lib/.cvsignore: Add strdup.c, strdup.h.
9691 * m4/.cvsignore: Add strdup.m4.
9692
9693 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9694
9695 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9696 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9697 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9698 ngotos + 1 without checking for overflow.
9699 (build_relations): Use END_NODE, not -1, to denote end of edges.
9700 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9701 build_relations): Use goto_number, not int, for goto numbers.
9702 * src/tables.c (save_column, default_goto): Likewise.
9703
9704 2004-11-23 Akim Demaille <akim@epita.fr>
9705
9706 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9707 of #defining from yystype.
9708 Don't typedef yystype, C++ does not need it.
9709 This lets it possible to forward declare it as union.
9710
9711 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9712
9713 * bootstrap (gnulib_modules): Add extensions.
9714 Problem reported by Jim Meyering.
9715
9716 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9717
9718 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9719 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9720 src/system.h, src/tables.c: XFREE -> free, to accommodate
9721 recent change to gnulib xalloc.h.
9722 Problem reported by Jim Meyering.
9723
9724 2004-11-17 Akim Demaille <akim@epita.fr>
9725
9726 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9727
9728 2004-11-17 Akim Demaille <akim@epita.fr>,
9729 Alexandre Duret-Lutz <adl@gnu.org>
9730
9731 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9732 changes.
9733 (YYCDEBUG): Adjust.
9734 Use it instead of cdebug_.
9735 (Parser::debug_stream, Parser::set_debug_stream): New.
9736 (Parser::symprint_): Define cdebug_ for temporary backward
9737 compatibility.
9738 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9739 debug_stream ().
9740
9741 2004-11-17 Akim Demaille <akim@epita.fr>
9742
9743 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9744 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9745 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9746 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9747
9748 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9749
9750 * data/glr.c (yyloc_default): Remove; not used.
9751 Problem reported by Frank Heckenbach.
9752
9753 2004-10-25 Akim Demaille <akim@epita.fr>
9754
9755 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9756 Introduce another definition to address simple location arrays.
9757 (yyGLRStack): New member: yyerror_range.
9758 (yyrecoverSyntaxError, yyparse): Update it.
9759 (yyrecoverSyntaxError): Use it when shifting the error token to
9760 have an accurate range, equivalent to the one computed by both
9761 yacc.c and lalr1.cc.
9762 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9763 that column numbers start at column 0, as per GNU Coding
9764 Standards, the others tests, and the doc.
9765 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9766 Adjust to the above change (first column is 0).
9767 And adjust the location of the "<error>", now covering the whole
9768 line.
9769
9770 2004-10-22 Akim Demaille <akim@epita.fr>
9771 and Paul Eggert <eggert@cs.ucla.edu>
9772
9773 Remove some arbitrary limits on goto numbers and relations.
9774 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9775 initial values, since they're never used.
9776 (set_goto_map): ngotos is now unsigned, so test for overflow
9777 by seeing whether it wraps around to zero.
9778 * src/lalr.h (goto_number): Now size_t, not short int.
9779 (GOTO_NUMBER_MAXIMUM): Remove.
9780 * src/relation.c (relation_print, traverse, relation_transpose):
9781 Check for END_NODE rather than looking at sign.
9782 * src/relation.h (END_NODE): New macro.
9783 (relation_node): Now size_t, not short int.
9784
9785 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9786
9787 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9788 keyword, not an identifier. Problem reported by Baron Schwartz in
9789 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9790
9791 2004-10-11 Akim Demaille <akim@epita.fr>
9792
9793 * src/symtab.c (symbol_check_alias_consistency): Also check
9794 type names, destructors, and printers.
9795 Reported by Alexandre Duret-Lutz.
9796 Recode the handling of associativity and precedence in terms
9797 of symbol_precedence_set.
9798 Accept no redeclaration at all, not even equal to the previous
9799 value.
9800 (redeclaration): New.
9801 Use it to factor redeclaration complaints.
9802 (symbol_make_alias): Don't set the type of the alias, let
9803 symbol_check_alias_consistency do it as for other features.
9804 * src/symtab.h (symbol): Add new member prec_location, and
9805 type_location.
9806 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9807 * tests/input.at (Incompatible Aliases): New.
9808
9809 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9810
9811 .cvsignore fixes to accommodate gnulib changes,
9812 and the practice of naming build directories "_build".
9813 * .cvsignore: Add "_*". Sort.
9814 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9815 * m4/.cvsignore: Add "*_gl.m4".
9816
9817 2004-10-06 Akim Demaille <akim@epita.fr>
9818
9819 * src/parse-gram.y (add_param): Fix the truncation of trailing
9820 spaces.
9821
9822 2004-10-05 Akim Demaille <akim@epita.fr>
9823
9824 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9825 whether the reducion was empty or not. This leaves room to
9826 improve the use of YYLLOC_DEFAULT in such a case.
9827 lalr1.cc is still experimental, so changing this is acceptable.
9828 And finally, there are probably not many users who changed the
9829 handling of locations in GLR, so changing is admissible too.
9830
9831 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9832 empty reduction, set @$ to an empty location ending the previously
9833 stacked symbol.
9834 Adjust uses to make sure the code is triggered on empty
9835 reductions.
9836 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9837 expected output: empty reductions have empty locations.
9838
9839 2004-09-29 Akim Demaille <akim@epita.fr>
9840
9841 * data/lalr1.cc: Move towards a more standard C++ coding style
9842 for templates: Class < T > -> Class<T>.
9843
9844 2004-09-29 Akim Demaille <akim@epita.fr>
9845
9846 * data/lalr1.cc: Reinstall the former ctor, for sake of
9847 compatibility, but warn it will be removed.
9848 Move towards a more standard C++ coding style (i.e., type *var ->
9849 type* var).
9850
9851 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9852
9853 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9854 since it's less likely to work if NULs are involved in the future.
9855
9856 2004-09-27 Akim Demaille <akim@epita.fr>
9857
9858 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9859
9860 2004-09-27 Akim Demaille <akim@epita.fr>
9861
9862 * data/lalr1.cc (b4_parse_param_decl_1): New.
9863 (b4_parse_param_decl): Use it to have different names between attribute
9864 and argument names.
9865 (b4_cc_constructor_call): Likewise.
9866
9867 2004-09-24 Akim Demaille <akim@epita.fr>
9868
9869 * src/parse-gram.y (add_param): Strip the leading and trailing
9870 blanks from a formal argument declaration.
9871 (YY_LOCATION_PRINT): New.
9872
9873 2004-09-24 Akim Demaille <akim@epita.fr>
9874
9875 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9876 after the location.
9877
9878 2004-09-24 Akim Demaille <akim@epita.fr>
9879
9880 * doc/bison.texinfo (Table of Symbols): Sort.
9881
9882 2004-09-21 Akim Demaille <akim@epita.fr>
9883
9884 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9885 the useless parentheses.
9886 Suggested by Paul Eggert.
9887
9888 2004-09-20 Akim Demaille <akim@epita.fr>
9889
9890 Let the initial-action act on the look-ahead, and use it for the
9891 "initial push" (corresponding to an hypothetical beginning-of-file).
9892 And let lalr1.cc honor %initial-action.
9893
9894 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9895 example.
9896 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9897 (Parser::Parser): Remove the ctor that used to initialize it.
9898 (Parser::parse): Like in the other skeletons, issue the "starting
9899 parse" message before any action.
9900 Honor %initial-action.
9901 Initialize the stacks with the lookahead.
9902 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9903 look-ahead.
9904 Push them in the stacks.
9905 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9906
9907 2004-09-20 Akim Demaille <akim@epita.fr>
9908
9909 * doc/bison.texinfo (Initial Action Decl): New.
9910
9911 2004-09-20 Akim Demaille <akim@epita.fr>
9912
9913 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9914 clearer criterion to define it.
9915 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9916 When reducing on an empty RHS, use the latest stacked location as
9917 location.
9918 yylloc is not always available.
9919 * data/glr.c: Likewise.
9920 Also, honor initial-actions.
9921
9922 2004-09-20 Akim Demaille <akim@epita.fr>
9923
9924 * data/yacc.c (YY_LOCATION_PRINT): New.
9925 Define when we know YYLTYPE's structure, i.e., when the default
9926 YYLLOC_DEFAULT is used.
9927 * data/c.m4 (b4_yysymprint_generate): Use it.
9928 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9929 value of the result.
9930 (error_start_): Replace with...
9931 (error_range_): this location array.
9932 This allows to replace code relying on the implementation of
9933 locations by portable code.
9934 * data/yacc.c (yylerrsp): Replace with...
9935 (yyerror_range): this.
9936 Every time a token is popped, update yyerror_range[0], to have an
9937 accurate location for the error token.
9938 * data/glr.c (YY_LOCATION_PRINT): New.
9939 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9940 deference a pointer.
9941 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9942 report the location in %printers.
9943
9944 * src/scan-skel.l: Instead of abort, report error messages to ease
9945 understanding skeleton scanning failures.
9946
9947 2004-09-16 Akim Demaille <akim@epita.fr>
9948
9949 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9950 (iterator, const_iterator): these, to be more in the C++ spirit.
9951 Also, return reverse iterators so that when displaying the stack
9952 we display its bottom first.
9953 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9954 from yacc.c.
9955 We should probably use vector here though.
9956
9957 2004-09-16 Akim Demaille <akim@epita.fr>
9958
9959 Have more complete shift traces.
9960
9961 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9962 to report Shifts instead of ad hoc YYDPRINTF invocations,
9963 including for the error token.
9964 * data/lalr1.cc (symprint_): Output the location.
9965 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9966 output the location within the %printer.
9967 Activate GLR tests, at least to make sure they compile properly.
9968 They still don't pass though.
9969 * tests/calc.at: Adjust expect verbose output, since now "Entering
9970 state..." is on a different line than the "Shifting" message.
9971
9972 2004-09-08 Akim Demaille <akim@epita.fr>
9973
9974 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9975 Bison directive from the Bison file to the invocation of this
9976 macro, so that these directives are passed to
9977 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9978 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9979 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9980 the extra Bison directives instead of the whole series.
9981 Change the grammar so that there are recoverable errors, and
9982 unrecoverable errors. Now we can have the parser give up before
9983 consuming the whole input. As a result we now can observe that
9984 the lookahead is freed when needed.
9985 Change the parser source to parse argv[1] instead of a hard coded
9986 string.
9987 Simplify yylex, and give a value and location to EOF.
9988 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9989 passed directives already coded in the file.
9990 Add some tests to check the location of "error".
9991 For some tests, the C++ parser is correct, and not yacc.c.
9992 For other tests, they provide different, but unsatisfying, values,
9993 so keep the C++ value so that at least one parser is "correct"
9994 according to the test suite.
9995 (Actions after errors): Remove, this is subsumed by the
9996 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9997
9998 2004-09-06 Akim Demaille <akim@epita.fr>
9999
10000 * data/lalr1.cc: Adjust the indentation of the labels.
10001 (Parser::pop): New.
10002 Use it.
10003
10004 2004-09-06 Akim Demaille <akim@epita.fr>
10005
10006 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
10007 argument, an informative message.
10008 Call YY_SYMBOL_PRINT.
10009 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
10010 * data/lalr1.cc (destruct_): Likewise.
10011 In addition, no longer depend on b4_yysymprint_generate and
10012 b4_yydestruct_generate to generate these functions, do it "by
10013 hand".
10014
10015 2004-09-03 Akim Demaille <akim@epita.fr>
10016
10017 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
10018 invoked, yydestruct the lookahead.
10019 * tests/calc.at (Calculator $1): Update the expected lengths of
10020 traces: there is an added line for the discarded lookahead.
10021 * doc/bison.texinfo (Destructor Decl): Some rewording.
10022 Define "discarded" symbols.
10023
10024 2004-09-02 Akim Demaille <akim@epita.fr>
10025
10026 * data/lalr1.cc (translate_, destruct_): No reason to be static.
10027
10028 2004-09-02 Akim Demaille <akim@epita.fr>
10029
10030 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
10031 (YYDSYMPRINTF): Rename as...
10032 (YY_SYMBOL_PRINT): this.
10033 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
10034 two.
10035 Use it instead of direct symprint_ calls.
10036 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
10037 one.
10038
10039 2004-09-02 Akim Demaille <akim@epita.fr>
10040
10041 * data/lalr1.cc (b4_yysymprint_generate): New.
10042 (symprint_): New member function, defined when YYDEBUG.
10043 Use it consistently instead of token/nterm debugging output by
10044 hand.
10045 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
10046 %printer calls to use cdebug_ when using lalr1.cc.
10047
10048 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
10049
10050 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
10051 with #ifdef YYDEBUG.
10052
10053 2004-08-26 Akim Demaille <akim@epita.fr>
10054
10055 * doc/bison.texinfo (Implementing Loops): Rename as...
10056 (Implementing Gotos/Loops): this.
10057
10058 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
10059
10060 Adjust to latest gnulib.
10061 * bootstrap (gnulib_modules): Add xalloc-die.
10062 Set LC_ALL=C so that file names sort consistently.
10063 Prefer the gnulib copies of gettext.m4, glibc21.m4,
10064 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
10065 uintmax_t.m4, ulonglong.m4.
10066 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
10067 po.m4 since we are now using _gl.m4 instead.
10068
10069 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
10070
10071 * src/scan-action.l: Remove. Scanning of semantic actions is
10072 handled in scan-gram.l.
10073
10074 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
10075
10076 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
10077
10078 * src/location.h (struct): The file member is a uniqstr.
10079 (equal_boundaries): Use UNIQSTR_EQ for comparison.
10080
10081 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
10082
10083 Fix bug with non-%union parsers that have printers or destructors,
10084 which led to a Bison core dump. Reported by Peter Fales in
10085 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
10086
10087 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10088 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10089 not to our own type.
10090 * src/output.c (symbol_destructors_output, symbol_printers_output):
10091 Don't assume %union.
10092 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10093 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10094 UNION-FLAG. All callers changed.
10095 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10096 Use type char, not unsigned int, when declaring an array of char;
10097 this lets us remove a cast.
10098 (Printers and Destructors): Add non-%union test cases.
10099
10100 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10101
10102 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10103 GLR writeups. E.g., avoid frenchspacing and the future tense,
10104 change "lookahead" to "look-ahead", and change "wrt" to "with
10105 respect to".
10106
10107 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10108
10109 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10110 New sections, split off from the GLR Parsers section. Put the new
10111 Simple GLR Parser near the start of the GLR section, for clarity.
10112 Rewrite connective text.
10113
10114 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
10115
10116 * doc/bison.texinfo (Simple GLR Parsers): New section.
10117
10118 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10119
10120 * NEWS, TODO, doc/bison.texinfo:
10121 Use "look-ahead" instead of "lookahead", to be consistent.
10122 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10123 while we're fixing "look-ahead".
10124 * src/conflicts.c (shift_set): Renamed from shiftset.
10125 (look_ahead_set): Renamed from lookaheadset.
10126 * src/print.c: Likewise.
10127 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10128 name for "lookahead".
10129 (report_types, usage): Likewise.
10130 * src/getargs.h (report_look_ahead_tokens): Renamed from
10131 report_lookaheads.
10132 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10133 compute_lookaheads.
10134 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10135 (look_ahead_tokens_print): Renamed from lookaheads_print.
10136 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10137 state_rule_lookaheads_print.
10138 * src/state.h: Likewise.
10139 (reductions.look_ahead_tokens): Renamed from lookaheads.
10140 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10141 AT_DATA_LOOKAHEADS_GRAMMAR.
10142
10143 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10144
10145 * README: Update location of patched M4 distribution.
10146
10147 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10148
10149 Don't assume the C++ compiler takes the same arguments as the C compiler
10150 (trivial change).
10151 * configure.ac (O0CXXFLAGS): New var.
10152 * tests/atlocal.in (CXXFLAGS): Use it.
10153
10154 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10155
10156 Fix some "make check" problems with C++ reported by
10157 Albert Chin-A-Young for Tru64 C++ in this thread:
10158 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10159
10160 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10161 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10162 Output to a .cc file for C++, not to a .c file.
10163 * tests/calc.at (AT_CHECK_CALC): Likewise.
10164 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10165 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10166
10167 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10168
10169 * tests/calc.at, tests/actions.at: Workaround for SGI
10170 C++ compiler. (trivial change)
10171
10172 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10173
10174 Spent a few hours checking out which prerequisite versions the
10175 current sources actually require. I went all the way back to
10176 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10177 a seemingly endless set of combinations of versions more recent
10178 than that. The bottom line is that the current sources require
10179 fairly recent versions of the build tools, and it'll be some work
10180 to change this.
10181 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10182 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10183 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10184 Add comments explaining why those particular versions are
10185 currently needed.
10186
10187 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10188 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
10189 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
10190
10191 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10192 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10193
10194 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10195
10196 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10197 0.11.5. Suggested by Bruno Haible.
10198 * bootstrap: Remove gettext version checking.
10199
10200 * doc/bison.texinfo (Decl Summary): Also mention that %union
10201 can depend on prerequisite types. Problem reported by Tim
10202 Van Holder.
10203
10204 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10205
10206 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10207 * README-alpha: Don't tell people not to package this.
10208
10209 * bootstrap: Don't assume $(...) works; use `...` instead.
10210 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10211 gettext better.
10212
10213 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10214 put into the -d output file, and mention what to do if YYSTYPE is
10215 defined as a macro.
10216
10217 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10218
10219 Undo change made earlier today: it caused autopoint to not bring
10220 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10221 autopoint's.
10222
10223 * bootstrap: Check that gettext version matches what's in
10224 configure.ac. Warn users to ignore robots.txt ERROR 404.
10225 * bootstrap: Undo today's earlier change (logged below).
10226 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
10227
10228 The gettext version checking is causing more trouble than it's
10229 curing; remove it. Problem reported by Paul Hilfinger.
10230
10231 * bootstrap: Issue a warning that one can expect a message
10232 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10233 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10234
10235 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10236
10237 Ensure that the C++ compiler used for testing actually works on a
10238 simple test program; if not, skip the C++-related tests. Problem
10239 reported by Vin Shelton in:
10240 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
10241
10242 * m4/cxx.m4: New file.
10243 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10244 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10245 * tests/local.at (AT_COMPILE_CXX): Use it.
10246
10247 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10248
10249 * data/glr.c (yylloc): Output this macro even if locations are not
10250 being generated, as the GLR parser needs it even in that case.
10251 Problem reported by Troy A. Johnson
10252 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10253
10254 * configure.ac (AC_INIT): Update to 1.875e.
10255
10256 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10257
10258 * NEWS: Version 1.875d.
10259 * configure.ac (AC_INIT): Likewise.
10260 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10261
10262 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10263 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10264 lalr1.cc runs afoul of the first, and the last two are no longer
10265 supported by GCC 3.4.0.
10266 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10267 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10268
10269 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10270
10271 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10272 unsigned int, for compatibility with latest gnulib hash module.
10273 * src/state.c (state_hash, state_hasher): Likewise.
10274 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10275 * src/uniqstr.c (hash_uniqstr): Likewise.
10276
10277 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10278
10279 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10280
10281 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10282 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10283 character and string literals.
10284 (unexpected_end): New function.
10285 (unexpected_eof): Use it.
10286 (unexpected_newline): New function.
10287 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10288 actions.
10289
10290 * NEWS: Document %expect-rr.
10291
10292 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10293 Fix typo by replacing $1 with $option.
10294 Remove more 'intl'-related files.
10295 Don't DEFUN AM_INTL_SUBDIR twice.
10296
10297 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10298 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10299 strtoul.c.
10300 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10301 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10302 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10303 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10304 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10305 * src/.cvsignore: Add *.output.
10306
10307 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10308 gets copied to the output file.
10309
10310 2004-04-28 Paul Eggert <eggert@twinsun.com>
10311
10312 Get files from the gnulib and po repositories, instead of relying
10313 on them being in our CVS. Upgrade to latest versions of gnulib
10314 and Automake.
10315
10316 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10317 * bootstrap: Bootstrap from gnulib and po repositories.
10318 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10319 * README-cvs: Document these changes. Remove version numbers from
10320 mentions of build tools, since they change so often. Mention Flex.
10321
10322 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10323 (gl_USE_SYSTEM_EXTENSIONS): Add.
10324 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10325 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
10326 does this for us.
10327 (AC_ISC_POSIX): Remove; we no longer support this
10328 ancient OS, as it gets in the way of latest Autoconf & gnulib.
10329 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10330 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10331 Do not check for C89 headers, except for locale.h which is used
10332 by the Yacc library and must port to K&R hosts.
10333 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10334 Do not check for C89 functions, except for setlocale which is
10335 used by the Yacc library.
10336 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10337 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10338 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10339 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10340 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10341 AM_GNU_GETTEXT): Remove; now done by:
10342 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10343 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10344 for us.
10345
10346 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10347 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10348 Define to empty, as gnulib.mk will do the rest for us.
10349 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10350 for us.
10351 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10352 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10353
10354 * src/files.c: Include gnulib's xstrndup.h.
10355
10356 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10357 (REALLOC): Use xnrealloc, for likewise.
10358 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10359 (strnlen, memrchr): Remove decls; functions no longer used.
10360 Include <stpcpy.h>.
10361
10362 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10363 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10364 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10365 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10366 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10367 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10368 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10369 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10370 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10371 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10372 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10373 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10374 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10375 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10376 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10377 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10378 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10379 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10380 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10381 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10382 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10383 Remove, as these files are now generated automatically
10384 by bootstrap or automake.
10385
10386 * po/ChangeLog: Remove: all but one entry was a duplicate
10387 of this file, and I moved that 2000-11-02 entry here.
10388
10389 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10390 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10391 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10392 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10393 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10394 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10395 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10396 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10397 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10398 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10399 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10400 xstrndup.h.
10401 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10402 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10403 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10404 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10405 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10406 * src/.cvsignore: Remove *_.c.
10407
10408
10409 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10410 support it. (The latest stable gzip doesn't.)
10411
10412 2004-04-27 Paul Eggert <eggert@twinsun.com>
10413
10414 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10415 case, as stos_ is now used by destructors due to the 2004-02-09
10416 change.
10417
10418 Remove more K&R C support.
10419 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10420 * lib/subpipe.c (errno): Remove decl.
10421 Include <stdlib.h> unconditionally.
10422 (EXIT_FAILURE): Remove macro.
10423 * src/complain.c (vfprintf, strerror): Remove.
10424 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10425 unconditionally.
10426 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10427 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10428 (strchr, strspn, memchr): Remove decls.
10429 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10430 unconditionally. Do not declare perror.
10431 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10432 unconditionally.
10433
10434 * src/complain.c (_): Remove useless defn, as system.h defines this.
10435
10436 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10437 with latest obstack.h.
10438 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10439 to procedure types, as obstack.h now does that for us.
10440 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10441
10442 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10443 so that this include file can stand alone.
10444 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10445 does this now. Include subpipe.h first after config.h, to
10446 test whether it can stand alone.
10447
10448 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10449 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10450 unused declaration.
10451
10452 * tests/synclines.at (%union synch line): Put a dummy member in
10453 the union, because empty unions aren't allowed in C. Caught
10454 by GCC 3.4.0.
10455
10456 2004-04-13 Jim Meyering <jim@meyering.net>
10457
10458 * src/conflicts.c (conflicts_print): Correct format string typo:
10459 use `%%' to produce literal `%'. (trivial change)
10460
10461 2004-03-30 Paul Eggert <eggert@twinsun.com>
10462
10463 * src/getargs.c (version): Update copyright year to 2004.
10464
10465 * data/c.m4 (b4_int_type): Use 'short int' rather than
10466 'short', and similarly for 'long', 'unsigned', etc.
10467 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10468 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10469 yy_yypstack, yydumpstack): Likewise.
10470 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10471 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10472 Likewise.
10473 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10474 yy_stack_print, yyparse): Likewise.
10475 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10476 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10477 * lib/bitset.c (bitset_print): Likewise.
10478 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10479 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10480 * lib/bitsetv.c (bitsetv_dump): Likewise.
10481 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10482 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10483 Likewise.
10484 * src/LR0.c (allocate_itemsets): Likewise.
10485 * src/gram.h (rule_number, rule): Likewise.
10486 * src/lalr.h (goto_number): Likewise.
10487 * src/nullable.c (nullable_compute): Likewise.
10488 * src/output.c (prepare_rules): Likewise.
10489 * src/relation.c (relation_print, relation_digraph): Likewise.
10490 * src/relation.h (relation_node): Likewise.
10491 * src/state.h (state_number, transitions, errs, reductions,
10492 struct state): Likewise.
10493 * src/symtab.h (symbol_number, struct symbol): Likewise.
10494 * src/tables.c (vector_number, tally, action_number,
10495 default_goto, goto_actions): Likewise.
10496 * tests/existing.at (GNU Cim Grammar): Likewise.
10497 * tests/regression.at (Web2c Actions): Likewise.
10498
10499 * src/output.c (muscle_insert_short_int_table): Renamed from
10500 muscle_insert_short_table. All uses changed.
10501
10502 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10503
10504 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10505 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10506 Add %expect-rr rule.
10507
10508 * src/scan-gram.l: Recognize %expect-rr.
10509
10510 * src/conflicts.h (expected_sr_conflicts): Rename from
10511 expected_conflicts.
10512 (expected_rr_conflicts): Declare.
10513
10514 * src/conflicts.c (expected_sr_conflicts): Rename from
10515 expected_conflicts.
10516 (expected_rr_conflicts): Define.
10517 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10518 for GLR parsers.
10519 Use expected_sr_conflicts in place of expected_conflicts.
10520 Warn if expected_rr_conflicts used in non-GLR parser.
10521
10522 * doc/bison.texinfo: Add documentation for %expect-rr.
10523
10524 2004-03-08 Paul Eggert <eggert@gnu.org>
10525
10526 Add support for hex token numbers. Suggested by Odd Arild Olsen in
10527 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
10528
10529 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10530 in lalr1.cc.
10531 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10532 * src/scan-gram.l (scan_integer): New function.
10533 ({int}): Use it.
10534 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10535 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10536 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10537 Say "long int", not "long", for uniformity with GNU style.
10538
10539 2004-02-25 Paul Eggert <eggert@twinsun.com>
10540
10541 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10542 compilers. This fixes a problem with Intel's C++ compiler being
10543 chatty, reported by Guido Trentalancia in
10544 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
10545
10546 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10547
10548 Support %destructor and merge error locations in lalr1.cc.
10549
10550 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10551 (Parser::stos_): Define unconditionally.
10552 (Parser::destruct_): New method. Generate its body with
10553 b4_yydestruct_generate.
10554 (Parser::error_start_): New attribute.
10555 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10556 token which are discarded.
10557 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10558 error_start_ when erroneous token are discarded.
10559 (Parser::parse) <yyerrlab1>: Compute the location of the error
10560 token so that it covers all the discarded tokens.
10561 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10562 it can be called with `%skeleton "lalr1.cc"', and do that.
10563
10564 2004-02-02 Paul Eggert <eggert@twinsun.com>
10565
10566 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10567 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10568 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10569 There's no need to mention top_builddir since Automake does that
10570 for us.
10571 (INCLUDES): Remove, as Automake says it's obsolescent.
10572 Contents migrated into AM_CPPFLAGS as described above.
10573 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10574
10575 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10576
10577 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10578 (yyreportSyntaxError): Handle case where lookahead token is
10579 YYEMPTY.
10580
10581 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10582
10583 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10584 resulting parsers are compilable with C++.
10585
10586 2003-12-23 Paul Eggert <eggert@twinsun.com>
10587
10588 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10589 * src/output.c (output_skeleton): Rename local var.
10590 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10591 Bison tokens, as this runs afoul of the 2003-10-07 change that
10592 disallowed NUL bytes in character constants or string literals.
10593
10594 * tests/local.at: Require Autoconf 2.59's Autotest.
10595 * tests/testsuite.at: Don't include local.at, since we now assume
10596 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10597 including it.
10598 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10599 multiple inclusion warnings.
10600
10601 2003-12-02 Akim Demaille <akim@epita.fr>
10602
10603 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10604 conditions.
10605 From Bruno Haible.
10606
10607 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10608
10609 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10610
10611 2003-10-07 Paul Eggert <eggert@twinsun.com>
10612
10613 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10614 if testsuite doesn't exist.
10615
10616 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10617 literals, unfortunately.
10618 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10619 Complain about NUL bytes in character constants or string literals.
10620
10621 2003-10-05 Paul Eggert <eggert@twinsun.com>
10622
10623 * NEWS: Don't document %no-default-prec, as it's still
10624 too experimental.
10625 * doc/bison.texinfo: Document %no-default-prec only if
10626 the defaultprec flag is set. Normally it's not.
10627
10628 2003-10-04 Paul Eggert <eggert@twinsun.com>
10629
10630 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10631 non-modifiable lvalue, instead of a modifiable one.
10632 * doc/bison.texinfo (Actions): Document that $$ can
10633 be assigned to. Do not claim that $$ and $N are
10634 array element references: user code should not rely on this.
10635
10636 2003-10-01 Paul Eggert <eggert@twinsun.com>
10637
10638 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10639 (grammar_declaration): Use it.
10640 * src/scan-gram.l: New token %no-default-prec.
10641 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10642 * NEWS, doc/bison.texinfo: Document the above.
10643
10644 2003-10-01 Akim Demaille <akim@epita.fr>
10645
10646 VCG no longer supports long_straight_phase.
10647
10648 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10649 * src/print_graph.c (print_graph): Adjust.
10650
10651 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
10652 and Paul Eggert <eggert@twinsun.com>
10653
10654 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10655 Table of Symbols): Document %default-prec.
10656 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10657 (grammar_declaration): Set default_prec on %default-prec.
10658 * src/scan-gram.l (%default-prec): New token.
10659 * src/reader.h (default_prec): New flag.
10660 * src/reader.c: Likewise.
10661 (packgram): Handle it.
10662 * tests/conflicts.at (%default-prec without %prec,
10663 %default-prec with %prec, %default-prec 1): New tests.
10664
10665 2003-09-30 Paul Eggert <eggert@twinsun.com>
10666
10667 * tests/testsuite.at: Include local.at, not input.at, fixing
10668 a typo in the 2003-08-25 patch.
10669
10670 2003-08-27 Akim Demaille <akim@epita.fr>
10671
10672 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10673 GCC warnings.
10674
10675 2003-08-26 Akim Demaille <akim@epita.fr>
10676
10677 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10678 "<\#" to avoid magic from Gnus when posting parts of this script.
10679
10680 2003-08-26 Akim Demaille <akim@epita.fr>
10681
10682 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10683 (Parser::parse): here.
10684 Adjust: nerrs and errstatus is now replaced by...
10685 (Parser::nerrs_, Parser::errstatus_): New.
10686
10687 2003-08-25 Akim Demaille <akim@epita.fr>
10688
10689 * config/announce-gen, Makefile.cfg: New.
10690 * Makefile.am: Adjust.
10691 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10692 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10693
10694 2003-08-25 Akim Demaille <akim@epita.fr>
10695
10696 When reducing initial empty rules, Bison parser read an initial
10697 location that is not defined. This results in garbage, and that
10698 affects Bison's own parser. Therefore we need (i) to extend Bison
10699 to support a means to initialize this location, and (ii) to use
10700 this CVS Bison to fix CVS Bison's parser.
10701
10702 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10703 with...
10704 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10705 * src/parse-gram.y: Adjust.
10706 (%initial-action): New.
10707 (%error-verbose): Since we require CVS Bison, there is no reason
10708 not to use it.
10709 * src/scan-gram.l: Adjust.
10710 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10711 * data/yacc.c (yyparse): Use b4_initial_action.
10712
10713 2003-08-25 Akim Demaille <akim@epita.fr>
10714
10715 * doc/bison.texinfo: Don't promote stdout for error messages.
10716
10717 2003-08-25 Akim Demaille <akim@epita.fr>
10718
10719 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10720 From Alexandre Duret-Lutz.
10721
10722 2003-08-25 Akim Demaille <akim@epita.fr>
10723
10724 Version 1.875c.
10725
10726 2003-08-25 Akim Demaille <akim@epita.fr>
10727
10728 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10729 Use them.
10730
10731 2003-08-25 Akim Demaille <akim@epita.fr>
10732
10733 * data/lalr1.cc (Parser::reduce_print_): New.
10734 Use it.
10735
10736 2003-08-25 Akim Demaille <akim@epita.fr>
10737
10738 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10739 error recovery loops. This patch is based on
10740 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
10741 Also, augment the similarity between lalr1.cc and yacc.c.
10742 Note: the locations of error recovery rules are not correct yet.
10743
10744 * data/lalr1.cc: Comment changes to augment the similarity between
10745 lalr1.cc and yacc.c.
10746 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10747 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10748 yyerrlab), when hitting EOF, pop the whole stack here instead of
10749 merely falling thru the default error handling mechanism.
10750 (yyerrorlab): New label, with the old contents of YYERROR,
10751 plus the following change: pop the stack of rhs corresponding
10752 to the production that invoked YYERROR. That is how Yacc
10753 behaves (required by POSIX).
10754 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10755 fail.
10756
10757 2003-08-25 Akim Demaille <akim@epita.fr>
10758
10759 Tune local.at so that people can "autom4te -l autotest calc.at -o
10760 calc" for instance, to extract a sub test suite.
10761
10762 * tests/testsuite.at: Move the initialization, Autotest version
10763 requirement, and AT_TESTED invocation into...
10764 * tests/local.at: here.
10765 * tests/testsuite.at: Include it for compatibility with Autoconf
10766 2.57.
10767 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10768 be ignore.
10769
10770 2003-08-04 Paul Eggert <eggert@twinsun.com>
10771
10772 Rework code slightly to avoid gcc -Wtraditional warnings.
10773 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10774 The returned value is now stored in *YY0. All callers changed.
10775 * src/output.c (merge_output): Adjust to the above change.
10776
10777 2003-07-26 Paul Eggert <eggert@twinsun.com>
10778
10779 * data/glr.c (YYASSERT): New macro.
10780 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10781 yyresolveStates, yyprocessOneStack):
10782 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10783 Derived from a suggestion by Frank Heckenbach.
10784
10785 2003-07-25 Paul Eggert <eggert@twinsun.com>
10786
10787 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10788 for portability to K&R C (after ansi2knr, presumably). See
10789 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
10790 by Frank Heckenbach, though I have omitted the structure-initialization
10791 part of his glr-knr.diff patch since I recall that the Portable
10792 C Compiler didn't require that change.
10793
10794 Let the user specify how to allocate and free memory.
10795 Derived from a suggestion by Frank Heckenbach in
10796 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
10797 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10798 All uses of free, malloc, realloc changed to use these macros,
10799 and unnecessary casts removed.
10800 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10801
10802 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10803
10804 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10805 use s.empty() rather than s == "" to test for empty string; see
10806 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
10807 (trivial change)
10808
10809 2003-06-25 Akim Demaille <akim@epita.fr>
10810
10811 * config/depcomp, config/install-sh: Update from masters.
10812
10813 2003-06-20 Paul Eggert <eggert@twinsun.com>
10814
10815 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10816 and return properly parenthesized result.
10817 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10818 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10819 Remove unnecessary parentheses from uses.
10820 * doc/bison.texinfo (Location Default Action): Describe the
10821 conventions for parentheses.
10822
10823 2003-06-19 Paul Eggert <eggert@twinsun.com>
10824
10825 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10826 yyreportTree): Do not assume that size_t is the same width as int,
10827 when printing sizes. Print sizes using an unsigned format.
10828 Problem reported by Frank Heckenbach in
10829 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
10830
10831 Port to Forte Developer 7 C compiler.
10832 * data/glr.c (struct YYLTYPE): If locations are not being used,
10833 declare a single dummy member, as empty structs do not conform
10834 to the C standard.
10835 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10836 the Forte Developer 7 C compiler complains that end-of-loop
10837 code is not reached.
10838
10839 2003-06-17 Paul Eggert <eggert@twinsun.com>
10840
10841 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10842 avoid warnings from picky compilers about redefinition of PARAMS.
10843
10844 2003-06-17 Paul Eggert <eggert@twinsun.com>
10845
10846 Version 1.875b.
10847
10848 * NEWS: Document 1.875b.
10849
10850 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10851 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10852 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10853 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10854 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10855 per recent gettext manual's suggestion.
10856 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10857 Use prototypes, not old-style definitions.
10858 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10859 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10860 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10861 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10862 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10863 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10864 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10865 vbitset_or_and_cmp, vbitset_copy): Likewise.
10866
10867 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10868 Do not include <stdlib.h>.
10869 (PARAMS): Define unconditionally for C89.
10870 (ATTRIBUTE_NORETURN): Remove.
10871 (ATTRIBUTE_UNUSED): Define unconditionally.
10872
10873 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
10874 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
10875 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10876 * lib/vbitset.c, lib/vbitset.h: New files.
10877 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10878 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10879 from libbitset.
10880
10881 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10882 `How Can I Reset @code{yyparse}', since texinfo does not allow
10883 arbitrary @ in node names.
10884
10885 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10886 shouldn't be needed according to the gettext 0.12.1 documentation
10887 but which seem to be needed anyway: codeset.m4 glibc21.m4
10888 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
10889 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
10890 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
10891
10892 * lib/.cvsignore: Add stdbool.h.
10893 * m4/.cvsignore: Add nls.m4, po.m4.
10894
10895 Upgrade to CVS gnulib.
10896 * stdbool_.h: File renamed from stdbool.h.in.
10897 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10898 AC_HEADER_STDBOOL.
10899 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10900 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10901 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10902 (MOSTLYCLEANFILES): New var.
10903 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10904 (stdbool.h): New rule.
10905 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10906 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10907 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10908 m4/quote.m4: Upgrade to today's gnulib.
10909
10910 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10911 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10912 the tests right now.
10913 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10914 yyerror are declared before use; C99 requires this.
10915
10916 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10917
10918 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10919 first.
10920 (yyrecoverSyntaxError): Correct the logic for setting and testing
10921 yyerrState.
10922 Correct comment on handling EOF.
10923 Allow states with only a default reduction, rather than failing
10924 (I can't quite reconstruct why these were not allowed before).
10925
10926 Fixes to avoid problem that $-N rules in GLR parsers can cause
10927 buffer overruns, corrupting state.
10928
10929 * src/output.c (prepare_rules): Output max_left_semantic_context
10930 definition.
10931 * src/reader.h (max_left_semantic_context): New variable declaration.
10932 * src/scan-gram.l (max_left_semantic_context): Define.
10933 (handle_action_dollar): Update max_left_semantic_context.
10934 * data/glr.c (YYMAXLEFT): New definition.
10935 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10936 (yyresolveAction): Ditto.
10937
10938 Fixes to problems with location handling in GLR parsers reported by
10939 Frank Heckenbach (2003/06/05).
10940
10941 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10942 (YYRHSLOC): Add parentheses, and define only if locations used.
10943 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10944 locations not used.
10945 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10946 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
10947
10948 * tests/cxx-type.at: Exercise location information; update tests
10949 to differentiate output with and without locations.
10950 Remove forward declarations of yylex and yyerror---caused errors
10951 because default YYLTYPE not yet defined.
10952 Change semantic actions to compute strings, rather than printing
10953 them directly (to test proper passing of semantics values). Change
10954 output to prefix notation and update test data and expected results.
10955 (yylex): Track locations.
10956 (stmtMerge): Return value rather than printing, and include arguments
10957 in value.
10958
10959 2003-06-03 Paul Eggert <eggert@twinsun.com>
10960
10961 Avoid warnings generated by GCC 2.95.4 when Bison is
10962 configured with --enable-gcc-warnings.
10963 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10964 yy::]b4_parser_class_name[::translate_,
10965 yy::Stack::operator[] (unsigned),
10966 yy::Stack::operator[] (unsigned) const,
10967 yy::Slice::operator[] (unsigned),
10968 yy::Slice::operator[] (unsigned) const):
10969 Rename local vars to avoid warnings.
10970 * tests/glr-regression.at (Improper handling of embedded actions
10971 and $-N in GLR parsers): Remove unused local variable from yylex.
10972 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10973 (void) as arg when not pure, since we now assume C89 when building
10974 Bison. Pacify GCC by using parameter.
10975
10976 2003-06-02 Paul Eggert <eggert@twinsun.com>
10977
10978 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10979 yy::Location::lines, yy::Location::columns): Rename arguments
10980 to avoid shadowing; this removes a warning generated by GCC 3.3.
10981
10982 2003-06-01 Paul Eggert <eggert@twinsun.com>
10983
10984 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10985 to g++, as GCC 3.3 complains if you do it.
10986 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10987 everything that WARNING_CFLAGS has, except omit warnings
10988 not suitable for C++.
10989 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10990 * tests/atlocal.in (CXXFLAGS): New var.
10991 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10992
10993 Fix a GLR parser bug I reported in February; see
10994 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
10995 The problem was that GLR parsers did not conform to the C standard,
10996 because actions like { $1 = $2 + $3; } expanded to expressions
10997 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10998 to a local variable. The C standard says that expressions
10999 like (var = f ()) + (var = f ()) have undefined behavior.
11000 Another problem was that GCC sometimes issues warnings that
11001 yyfill and its parameters are unused.
11002
11003 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
11004 as possibly unused.
11005 (yyfill): New function.
11006 (YYFILL): Use it.
11007 (yyuserAction): Change type of yynormal to bool, so that it matches
11008 the new yyfill signature. Mark it as possibly unused.
11009
11010
11011 Follow up on a bug I reported in February, where a Bison-generated
11012 parser can loop. Provide a test case and a fix for yacc.c. I
11013 don't have a fix for lalr1.cc or for glr.c, unfortunately.
11014 The original bug report is in:
11015 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
11016
11017 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
11018 macro's size was becoming unwieldy.
11019 (yyerrlab): Do not discard an empty lookahead symbol, as this
11020 might destroy garbage.
11021 (yyerrorlab): New label, with the old contents of YYERROR,
11022 plus the following change: pop the stack of rhs corresponding
11023 to the production that invoked YYERROR. That is how Yacc
11024 behaves, and POSIX requires this behavior.
11025 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
11026 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
11027 Define 'alarm' to do nothing if unistd.h is not available.
11028 Add a new rule "exp: '-' error;" to test the above change to
11029 data/yacc.c. Use 'alarm' to abort any test taking longer than
11030 10 seconds, as it's probably looping.
11031 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
11032 Also, the new yacc.c generates two fewer diagnostics for an
11033 existing test.
11034
11035 2003-05-24 Paul Eggert <eggert@twinsun.com>
11036
11037 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
11038 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
11039 This fixes a problem reported by John Bowman when the Compaq/HP
11040 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
11041 -ansi -Wall -gall).
11042 * data/yacc.c (union yyalloc): Likewise.
11043 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
11044
11045 Switch from 'int' to 'bool' where that makes sense.
11046
11047 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
11048 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
11049 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
11050 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
11051 Return or accept bool, not int. All callers changed.
11052 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
11053 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
11054 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
11055 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
11056 bitset_or_and_cmp_): Likewise.
11057 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
11058 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
11059 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
11060 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
11061 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
11062 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
11063 bitset_stats_or_and_cmp): Likewise.
11064 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
11065 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
11066 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
11067 ebitset_xor_cmp): Likewise.
11068 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
11069 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
11070 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
11071 lbitset_xor_cmp): Likewise.
11072 * lib/bbitset.h: Include <stdbool.h>.
11073 (struct bitset_vtable): The following members now return bool, not
11074 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
11075 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
11076 or_and_cmp).
11077 * src/conflicts.c (count_rr_conflicts): Likewise.
11078 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
11079 All uses changed.
11080 * lib/ebitset.c (ebitset_obstack_init): Likewise.
11081 * lib/lbitset.c (lbitset_obstack_init): Likewise.
11082 * src/getargs.c (debug_flag, defines_flag, locations_flag,
11083 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11084 graph_flag): Likewise.
11085 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11086 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11087 graph_flag): Likewise.
11088 * src/output.c (error_verbose): Likewise.
11089 * src/output.h (error_verbose): Likewise.
11090 * src/reader.c (start_flag, typed): Likewise.
11091 * src/reader.h (typed): Likewise.
11092 * src/getargs.c (LOCATIONS_OPTION): New constant.
11093 (long_options, getargs): Use it.
11094 * src/lalr.c (build_relations): Use bool, not int.
11095 * src/nullable.c (nullable_compute): Likewise.
11096 * src/print.c (print_reductions): Likewise.
11097 * src/tables.c (action_row, pack_vector): Likewise.
11098 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11099 * src/output.c (prepare): Use it.
11100 * src/output.c (token_definitions_output,
11101 symbol_destructors_output, symbol_destructors_output): Use string,
11102 not boolean integer, to keep track of whether to output separator.
11103 * src/print_graph.c (print_core): Likewise.
11104 * src/state.c (state_rule_lookaheads_print): Likewise.
11105
11106 * config/install-sh: Sync from automake 1.7.5.
11107
11108 2003-05-14 Paul Eggert <eggert@twinsun.com>
11109
11110 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11111 semicolon after a grammar declaration, in the interest of possible
11112 future changes to the Bison input language.
11113 Do not allow a stray semicolon at the start of the grammar.
11114 (rhses.1): Allow one or more semicolons after any rule, including
11115 just before "|" as required by POSIX.
11116 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11117 grammar.
11118
11119 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11120
11121 %parse-param support for lalr1.cc.
11122
11123 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11124 b4_cc_constructor_calls, b4_cc_constructor_call,
11125 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11126 definitions.
11127 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11128 parse-param arguments.
11129 (yy::b4_parser_class_name): Declare instance variables to
11130 hold parse-param arguments.
11131 * tests/calc.at: s/value/semantic_value/ because value clashes
11132 with a member of yy::b4_parser_class_name. Adjust C++ code
11133 to handle %parse-param. Enable %parse-param test in C++.
11134
11135 2003-05-12 Paul Eggert <eggert@twinsun.com>
11136
11137 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11138 English a bit. Fix fclose typo. Change "const char" to "char
11139 const", and use ANSI C rather than K&R for "main". Suggest
11140 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11141 and suggest yy_switch_to_buffer.
11142
11143 2003-05-05 Paul Eggert <eggert@twinsun.com>
11144
11145 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11146 C89. This avoids a diagnostic on compilers that define __STDC__
11147 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
11148 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11149
11150 2003-05-03 Paul Eggert <eggert@twinsun.com>
11151
11152 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11153 Do not overrun array bounds.
11154 This should fix a bug reported today by Olatunji Oluwabukunmi in
11155 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
11156
11157 2003-04-29 Akim Demaille <akim@epita.fr>
11158
11159 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11160 * src/getargs.c, src/getargs.h: here, as bool, not int.
11161 (nondeterministic_parser): New.
11162 * src/parse-gram.y, src/scan-gram.l: Support
11163 %nondeterministic-parser.
11164 * src/output.c (prepare): Use nondeterministic_parser instead
11165 of glr_parser where appropriate.
11166 * src/tables.c (conflict_row, action_row, save_row)
11167 (token_actions, token_actions, pack_vector): Ditto.
11168
11169 2003-04-29 Akim Demaille <akim@epita.fr>
11170
11171 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11172
11173 2003-04-29 Akim Demaille <akim@epita.fr>
11174
11175 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11176 with %pure-parser and %locations to exercise the patch from Yakov
11177 Markovitch below.
11178
11179 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11180
11181 * data/yacc.c: (b4_lex_param): Corrected for the case where
11182 %lex-param is provided and %pure-parser isn't.
11183
11184 2003-04-27 Paul Eggert <eggert@twinsun.com>
11185
11186 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
11187 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
11188 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11189 if it is not defined.
11190 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11191
11192 2003-04-26 Paul Eggert <eggert@twinsun.com>
11193
11194 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11195 Declare to be of type suitable for the ninf value itself, not of
11196 type suitable for the corresponding table, since the latter might
11197 be unsigned but the ninf value might be negative. This fixes a
11198 bug reported by Alexandre Duret-Lutz in
11199 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
11200
11201 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11202 invokes it. We shouldn't invoke it twice because it will attempt
11203 to put error.o in the archive twice. This fixes a glitch reported
11204 by Martin Mokrejs in
11205 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11206
11207 2003-04-21 Paul Eggert <eggert@twinsun.com>
11208
11209 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11210 to gnulib.
11211
11212 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11213
11214 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11215 Fix obvious typo that results in uncompilable GLR parsers
11216 when both %pure-parser and %locations are used. (trivial change)
11217
11218 2003-04-17 Paul Eggert <eggert@twinsun.com>
11219
11220 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11221 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11222 Do not insert the expected token via unput, as this runs afoul
11223 of a POSIX-compatibility bug in flex 2.5.31.
11224 All uses changed to BEGIN the parent state,
11225 since we no longer insert the expected token via unput.
11226 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11227 that is no longer emitted after the above change.
11228
11229 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11230 the first one. This change is from Paul Hilfinger, and it fixes
11231 regression reported by Werner Lemberg in
11232 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
11233
11234 (resolve_sr_conflict): Don't invoke state_errs_set
11235 unless one or more tokens have been explicitly made errors.
11236 Otherwise, the above change causes Bison to abort.
11237
11238 * tests/existing.at (GNU pic Grammar): New test case, taken from
11239 Lemberg's email.
11240
11241 2003-03-31 Akim Demaille <akim@epita.fr>
11242
11243 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11244
11245 2003-03-31 Akim Demaille <akim@epita.fr>
11246
11247 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11248 output.
11249
11250 2003-03-31 Akim Demaille <akim@epita.fr>
11251
11252 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11253 From Paul Hilfinger.
11254
11255 2003-03-29 Akim Demaille <akim@epita.fr>
11256
11257 * m4/error.m4: Do not put under dynamic conditions some code which
11258 expansion is under static control.
11259
11260 2003-03-29 Akim Demaille <akim@epita.fr>
11261
11262 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11263
11264 2003-03-29 Akim Demaille <akim@epita.fr>
11265
11266 * doc/bison.texinfo (Strings are Destroyed): New.
11267
11268 2003-03-13 Paul Eggert <eggert@twinsun.com>
11269
11270 * .cvsignore: Add configure.lineno.
11271 * src/.cvsignore: Add yacc.
11272 * tests/.cvsignore: Add testsuite.log.
11273 * doc/fdl.texi: Sync with latest FSF version.
11274
11275 2003-03-12 Paul Eggert <eggert@twinsun.com>
11276
11277 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11278 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11279 cursor, instead of leaving it undefined. This fixes a bug
11280 reported by Tim Van Holder in
11281 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
11282 * tests/input.at (Torturing the Scanner): Test the scanner on
11283 an empty input file, which was Tim Van Holder's test case.
11284
11285 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11286 <sys/resource.h> can be included, include sys/time.h and
11287 sys/times.h first, if available. This works around the SunOS
11288 4.1.4 porting bug reported by Bruce Becker in
11289 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
11290
11291 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11292 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11293 AC_HEADER_SYS_WAIT.
11294
11295 Merge changes from gnulib. This was prompted because the CVS
11296 snapshot didn't build on Solaris 7 due to strnlen problems.
11297
11298 These changes need to be merged back into gnulib:
11299 * lib/hash.c: Include <stdbool.h> unconditionally.
11300 * m4/onceonly.m4 (m4_quote): New macro.
11301 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11302 Quote AC_FOREACH variable-expansions properly.
11303 The 2003-01-03 obstack.h change also needs merging.
11304 {end of changes requiring merging}
11305
11306 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11307 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11308 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11309 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11310 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11311 New files, imported from gnulib.
11312 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11313 above.
11314
11315 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11316 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11317 gnulib sources.
11318
11319 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11320 Add.
11321 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11322 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11323 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11324 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11325 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11326 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11327 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11328 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11329 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11330 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11331 (jm_PREREQ_ARGMATCH): Remove.
11332 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11333 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11334
11335 * src/system.h: Include <stdbool.h> unconditionally.
11336
11337 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11338 assuming at least C89 in the bitset code for some time now.
11339
11340 2003-03-03 Akim Demaille <akim@epita.fr>
11341
11342 * ro.po: New.
11343
11344 2003-03-02 Akim Demaille <akim@epita.fr>
11345
11346 * doc/bison.texinfo (Table of Symbols): Reactivate the
11347 documentation for %lex-param, and %parse-param.
11348
11349 2003-03-02 Akim Demaille <akim@epita.fr>
11350
11351 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11352 generate verbose error messages.
11353 Use the number of tokens as an upper bound in yytname, as it
11354 cannot be a non terminal.
11355
11356 2003-03-02 Akim Demaille <akim@epita.fr>
11357
11358 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11359 message.
11360
11361 2003-03-02 Akim Demaille <akim@epita.fr>
11362
11363 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11364 Use them to exercise yycheck overrun.
11365 Based on Andrew Suffield's grammar.
11366
11367 2003-03-02 Akim Demaille <akim@epita.fr>
11368
11369 Create tests/local.at for Bison generic testing macros.
11370
11371 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11372 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11373 This new file.
11374 * tests/calc.at (AT_CHECK_CALC): Adjust.
11375 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11376 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11377 * tests/local.at: here.
11378 (AT_COMPILE_CXX): Tags the tests using it as c++.
11379 Ignore the test if CXX is not functional.
11380
11381 2003-03-01 Paul Eggert <eggert@twinsun.com>
11382
11383 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11384 not loc->end, since loc->end might contain garbage and this leads
11385 to undefined behavior on some platforms.
11386 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11387 depend on *loc, so that the reader doesn't give the the false
11388 impression that *loc is initialized.
11389 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11390 does not survive the return.
11391
11392 2003-03-01 Akim Demaille <akim@epita.fr>
11393
11394 * src/scan-gram.l (code_start): Always initialize it when entering
11395 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11396 yylex invocation. An alternative would be making it static, but
11397 then it starts with the second %%'s beginning, instead of its end.
11398
11399 2003-02-28 Paul Eggert <eggert@twinsun.com>
11400
11401 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11402 around a UnixWare 7.1.1 porting bug reported by John Hughes in
11403 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
11404
11405 2003-02-26 Paul Eggert <eggert@twinsun.com>
11406
11407 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11408 Remove Sequent/Pyramid discussion (nobody uses them any more).
11409 Merge VMS and MS-DOS discussion; these ports may well be dead
11410 but let's keep mentioning them for now. Put <> around email
11411 addresses. Add copyright notice.
11412
11413 2003-02-24 Paul Eggert <eggert@twinsun.com>
11414
11415 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11416 to avoid collision with flex use of yylineno.
11417 Problem reported by Bruce Lilly in
11418 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
11419 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11420 * data/yacc.c (yy_reduce_print): Likewise.
11421
11422 * config/depcomp: Sync with Automake 1.7.3.
11423
11424 2003-02-21 Akim Demaille <akim@epita.fr>
11425
11426 * data/lalr1.cc: Use temporary variables instead of casts to
11427 change integer types.
11428 Suggested by Paul Eggert.
11429
11430 2003-02-21 Akim Demaille <akim@epita.fr>
11431
11432 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11433 to avoid confusions with lalr1.cc's notion of Position.
11434 Suggested by Paul Eggert.
11435
11436 2003-02-20 Akim Demaille <akim@epita.fr>
11437
11438 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11439 before initial_columns.
11440 (location.hh): Use consistent variable names when defining the
11441 operator<<.
11442 Use "last" so that we subtract from Positions, not from unsigned.
11443
11444 2003-02-20 Akim Demaille <akim@epita.fr>
11445
11446 * data/lalr1.cc (position.hh): New subfile, including the extended
11447 and Doxygen'ed documentation of class Position.
11448 (location.hh): Use it.
11449 Document a` la Doxygen.
11450 With the help of Benoit Perrot.
11451
11452 2003-02-20 Akim Demaille <akim@epita.fr>
11453
11454 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11455 AT_YACC_IF.
11456 Redefine AT_YYERROR_SEES_LOC_IF using it.
11457 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11458 not defined.
11459 Don't use the location in yy::Parser::error_ and
11460 yy::Parser::print_ when not %locations.
11461 Activate more lalr1.cc tests.
11462
11463 2003-02-19 Akim Demaille <akim@epita.fr>
11464
11465 * data/lalr1.cc: When displaying a line number, be sure to make it
11466 an int.
11467
11468 2003-02-19 Akim Demaille <akim@epita.fr>
11469
11470 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11471 Remove, useless.
11472 (YYABORT, YYACCEPT, YYERROR): New.
11473 * tests/calc.at: Renable the lalr1.cc test.
11474
11475 2003-02-19 Akim Demaille <akim@epita.fr>
11476
11477 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11478 error recovery, mixing with/without pops and discarding of the
11479 lookahead.
11480 Exercise YYERROR.
11481 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11482
11483 2003-02-17 Paul Eggert <eggert@twinsun.com>
11484
11485 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11486 * tests/testsuite.at (AT_COMPILE): Use them.
11487 This fixes the testsuite problem reported by Robert Lentz in
11488 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
11489
11490 2003-02-12 Paul Eggert <eggert@twinsun.com>
11491
11492 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11493 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
11494 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
11495 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11496 Check for malloc failure, for consistency with yacc.c.
11497 (yytname_size): Remove, for consistency with yacc.c.
11498
11499 The bug still remains in data/lalr1.cc, as I didn't have time
11500 to fix it there.
11501
11502 2003-02-06 Akim Demaille <akim@epita.fr>
11503
11504 * configure.ac (GXX): Rename as...
11505 (CXX): this, to keep the original Autoconf semantics.
11506 Require 2.57.
11507 * data/lalr1.cc: Fix b4_copyright invocations.
11508 If YYDEBUG is not defined, don't depend upon name_ being defined.
11509 (location.hh): Include string and iostream.
11510 (Position::filename): New member.
11511 (Position::Position ()): New.
11512 (operator<< (Position)): New.
11513 (operator- (Position, int)): New.
11514 (Location::first, Location::last): Rename as...
11515 (Location::begin, Location::end): these, to mock the conventional
11516 iterator names.
11517 (operator<< (Location)): New.
11518 * tests/atlocal.in (CXX): New.
11519 * tests/testsuite.at (AT_COMPILE_CXX): New.
11520 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11521 locations in a more synthetic way.
11522 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11523 lalr1.cc is used.
11524 Adjust the C locations to match those from Emacs: first column is
11525 column 0.
11526 Change all the expected results.
11527 Conform to the GCS: simplify the locations when applicable.
11528 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11529 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11530 these CPP macros with the m4 macros new defined by...
11531 (AT_CHECK_PUSHDEFS): this, i.e.:
11532 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
11533 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
11534 New macros.
11535 (AT_CHECK_POPDEFS): Undefine them.
11536 (AT_CHECK_CALC_LALR1_CC): New.
11537 Use it for the first lalr1.cc test.
11538
11539 2003-02-04 Akim Demaille <akim@epita.fr>
11540
11541 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11542 Location as is defined.
11543
11544 2003-02-04 Akim Demaille <akim@epita.fr>
11545
11546 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11547 name_ being defined.
11548
11549 2003-02-03 Paul Eggert <eggert@twinsun.com>
11550
11551 * src/gram.h (start_symbol): Remove unused decl.
11552
11553 Use more-consistent naming conventions for local vars.
11554
11555 * src/derives.c (derives_compute): Change type of local var from
11556 int to rule_number.
11557 * src/gram.c (grammar_rules_partial_print): Likewise.
11558 * src/print.c (print_core): Likewise.
11559 * src/reduce.c (reduce_grammar_tables): Likewise.
11560
11561 * src/gram.c (grammar_dump): Change name of item_number *
11562 local var from r to rp.
11563 * src/nullable.c (nullable_compute): Likewise.
11564
11565 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11566
11567 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11568 for symbol or symbol_number var.
11569 * src/reader.c (grammar_start_symbol_set): Likewise.
11570 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11571 Likewise.
11572 * src/state.c (transitions_to): Likewise.
11573 * src/state.h: Likewise.
11574 * src/tables.c (symbol_number_to_vector_number): Likewise.
11575
11576 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11577 char * var.
11578
11579 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11580 var.
11581
11582 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11583 var.
11584
11585 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11586 Use str, not s, for char * var. Use ch, not c, for character var.
11587 Use size for size var.
11588
11589 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11590 char * var.
11591 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11592 uniqstr var.
11593 * src/uniqstr.h: Likewise.
11594
11595 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11596 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11597 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11598 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11599 param to have same name as that of enum, so that we don't use
11600 "s" to stand for a non-state.
11601
11602 2003-02-02 Akim Demaille <akim@epita.fr>
11603
11604 * src/scan-skel.l: Scan more than one inert character per yylex
11605 invocation.
11606
11607 2003-02-01 Paul Eggert <eggert@twinsun.com>
11608
11609 Version 1.875a.
11610
11611 * po/LINGUAS: Add ms.
11612
11613 2003-01-30 Akim Demaille <akim@epita.fr>
11614
11615 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11616
11617 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11618
11619 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11620 of $1.
11621
11622 Changes in response to error report by S. Eken: GLR mode does not
11623 handle negative $ indices or $ indices in embedded rules correctly.
11624 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
11625
11626 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11627 (b4_rhs_location): Ditto.
11628 (yyfill): New function to copy from stack tree into array
11629 incrementally.
11630 (yyuserAction): Modify to allow incremental move of semantic values
11631 to rhs array when in GLR mode.
11632 Define YYFILL to use in user-defined actions to fill semantic array
11633 as needed.
11634 Remove dummy use of yystack, as there is now a guaranteed use.
11635 (yydoAction): Modify to allow incremental move of semantic values
11636 to rhs array when in GLR mode.
11637 (yyresolveAction): Ditto.
11638 (yyglrShiftDefer): Update comment.
11639 (yyresolveStates): Use X == NULL for pointers, not !X.
11640 (yyglrReduce): Ditto.
11641 (yydoAction): Ditto
11642
11643 * tests/glr-regr1.at: Rename to ...
11644 * tests/glr-regression.at: Add new regression test for the problems
11645 described above (adapted from S. Eken).
11646 Update copyright notice.
11647 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11648 * tests/Makefile.am: Ditto.
11649
11650 2003-01-28 Paul Eggert <eggert@twinsun.com>
11651
11652 * data/lalr1.cc: Do not use @output_header_name@ unless
11653 b4_defines_flag is set. This fixes two bugs reported by
11654 Tim Van Holder in
11655 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11656 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
11657
11658 2003-01-21 Paul Eggert <eggert@twinsun.com>
11659
11660 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11661 we don't need to worry about yyerrlab1 being reported as an
11662 "unused label" by non-GCC C compilers. The downside is that if
11663 locations are used then a couple of statements are duplicated each
11664 time YYERROR is invoked, but the upside is that the warnings
11665 should vanish.
11666 (yyerrlab1): Move code to YERROR.
11667 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11668 This reverts some of the 2002-12-27 change.
11669
11670 2003-01-17 Paul Eggert <eggert@twinsun.com>
11671
11672 * src/output.c (symbol_printers_output): Fix typo that led
11673 to core dump. Problem reported by Antonio Rus in
11674 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
11675
11676 2003-01-13 Akim Demaille <akim@epita.fr>,
11677 Quoc Peyrot <chojin@lrde.epita.fr>,
11678 Robert Anisko <anisko_r@lrde.epita.fr>
11679
11680 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11681 when the stacks contain one element, as the loop would otherwise
11682 free the last state, and then use the top state (the one we just
11683 popped). This means that the initial elements will not be freed
11684 explicitly, as is the case in yacc.c; it is not a problem, as
11685 these elements have fake values.
11686
11687 2003-01-11 Paul Eggert <eggert@twinsun.com>
11688
11689 * NEWS: %expect-violations are now just warnings, reverting
11690 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11691 bootstrapping problem reported by Matthias Klose; see
11692 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
11693 * src/conflicts.c (conflicts_print): Likewise.
11694 * tests/conflicts.at (%expect not enough, %expect too much,
11695 %expect with reduce conflicts): Likewise.
11696 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11697 that the warning is enabled if the number of conflicts changes
11698 (not necessarily increases).
11699
11700 * src/getargs.c (version): Update copyright year.
11701
11702 2003-01-09 Akim Demaille <akim@epita.fr>
11703
11704 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11705
11706 2003-01-08 Paul Eggert <eggert@twinsun.com>
11707
11708 * Makefile.maint (WGETFLAGS):
11709 New macro, containing "-C off" to disable proxy caches.
11710 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11711 (rel-check): Use $(WGET) instead of wget.
11712
11713 2003-01-06 Paul Eggert <eggert@twinsun.com>
11714
11715 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11716 the GLR paper of Scott, Johnstone and Hussain.
11717
11718 2003-01-04 Paul Eggert <eggert@twinsun.com>
11719
11720 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11721 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11722 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11723 (EXTRA_LIBRARIES): New var, for liby.a.
11724 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11725 (EXTRA_SCRIPTS): New var, for yacc.
11726
11727 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11728 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11729 Problem reported by Nelson H. F. Beebe.
11730
11731 2003-01-03 Paul Eggert <eggert@twinsun.com>
11732
11733 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11734 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11735 when compiling Bison 1.875's `bitset bset = obstack_alloc
11736 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11737
11738 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11739 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11740 grow to a huge size with typical invocation.
11741
11742 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11743 Use the pattern recommended by Autoconf 2.57, except also protect
11744 against double-definition.
11745 * src/system.h: Likewise.
11746 Portability issues reported by Nelson H. F. Beebe.
11747
11748 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11749 All uses changed. Provide a definition in both C and C++.
11750 (yytrue, yyfalse): Define even if defined (__cplusplus).
11751
11752 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11753 Reported by Nelson H. F. Beebe.
11754
11755 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11756
11757 2003-01-02 Paul Eggert <eggert@twinsun.com>
11758
11759 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11760 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11761 Bug reported by Nelson H. F. Beebe.
11762
11763 2003-01-01 Paul Eggert <eggert@twinsun.com>
11764
11765 * Version 1.875.
11766
11767 2002-12-30 Paul Eggert <eggert@twinsun.com>
11768
11769 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11770 Moved here from...
11771 (<INITIAL>","): Here. This causes stray "," to be treated
11772 more uniformly.
11773
11774 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
11775 last brace in braced code when not in Yacc mode, for compatibility
11776 with Bison 1.35. This resurrects the 2001-12-15 patch to
11777 src/reader.c.
11778
11779 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11780 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11781
11782 2002-12-28 Paul Eggert <eggert@twinsun.com>
11783
11784 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11785 that of SYM's type. This fixes Debian bug 168069, reported by
11786 Thomas Olsson.
11787
11788 2002-12-28 Paul Eggert <eggert@twinsun.com>
11789
11790 Version 1.75f.
11791
11792 Switch back to the Yacc style of conflict reports, undoing some
11793 of the 2002-07-30 change.
11794 * doc/bison.texinfo (Understanding): Use Yacc style for
11795 conflict reports. Also, use new way of locating rules.
11796 * src/conflicts.c (conflict_report):
11797 Renamed from conflict_report_yacc, removing the old
11798 'conflict_report'. Translate the entire conflict report at once,
11799 so that we don't assume that "," has the same interpretation in
11800 all languages.
11801 (conflicts_output): Use Yacc-style conflict report for each state,
11802 instead of our more-complicated style.
11803 (conflicts_print): Use Yacc-style conflict report, except print
11804 the input file name when not emulating Yacc.
11805 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11806 Conflicted Reduction, %expect not enough, %expect too much,
11807 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11808 * tests/existing.at (GNU Cim Grammar): Likewise.
11809 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11810
11811 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11812 fatal): Don't invoke fflush; it's not needed and it might even be
11813 harmful for stdout, as stdout might not be open.
11814 * src/reduce.c (reduce_print): Likewise.
11815
11816 2002-12-27 Paul Eggert <eggert@twinsun.com>
11817
11818 Fix a bug where error locations were not being recorded correctly.
11819 This problem was originally reported by Paul Hilfinger in
11820 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
11821
11822 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11823 top of the location stack's error locations.
11824 (yyerrlab): Set it. When discarding a token, push its location
11825 onto yylerrsp so that we don't lose track of the error's end.
11826 (yyerrlab1): Now is only the target of YYERROR, so that we can
11827 properly record the location of the action that failed. For GCC
11828 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11829 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11830 (yyerrlab2): New label, which yyerrlab now falls through to.
11831 Compute the error's location by applying YYLLOC_DEFAULT to
11832 the locations of all the symbols that went into the error.
11833 * doc/bison.texinfo (Location Default Action): Mention that
11834 YYLLOC_DEFAULT is also invoked for syntax errors.
11835 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11836 Error locations include the locations of all the tokens that were
11837 discarded, not just the last token.
11838
11839 2002-12-26 Paul Eggert <eggert@twinsun.com>
11840
11841 * src/files.c: Include quote.h.
11842 (compute_output_file_names): Warn if we detect conflicting
11843 outputs to the same file. This should catch the misunderstanding
11844 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11845
11846 * src/conflicts.c (conflicts_print): If the user specifies
11847 "%expect N", report an error if there are any reduce/reduce
11848 conflicts. This is what the manual says should happen.
11849 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11850 * tests/conflicts.at (%expect with reduce conflicts): New test.
11851
11852 Don't use m4_include on relative file names, as it doesn't work as
11853 desired if there happens to be a file with that name under ".".
11854
11855 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11856 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11857 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11858 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11859 * src/output.c (output_skeleton): Use full path names when
11860 specifying a file to include; don't rely on include path, as
11861 it's unreliable when the working file contains a file with
11862 that name.
11863
11864 2002-12-25 Paul Eggert <eggert@twinsun.com>
11865
11866 Remove obsolete references to bison.simple and bison.hairy.
11867 Problem mentioned by Aubin Mahe in
11868 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
11869 * data/glr.c: Comment fix.
11870 * doc/bison.1: Remove references. Also, mention "yacc".
11871
11872 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11873 with -g option.
11874
11875 * src/parse-gram.y (declaration): Use enum "report_states" rather
11876 than its numeric value 1.
11877
11878 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11879 opening a new one. This fixes Debian bug 165349, reported by
11880 Bruce Stephens.
11881
11882 2002-12-24 Paul Eggert <eggert@twinsun.com>
11883
11884 Version 1.75e.
11885
11886 * Makefile.maint (cvs-update): Don't assume that the shell
11887 supports $(...), as Solaris sh doesn't.
11888
11889 * src/parse-gram.y (lloc_default): Remove test for empty
11890 nonterminals at the end, since it didn't change the result.
11891
11892 2002-12-24 Paul Eggert <eggert@twinsun.com>
11893
11894 If the user does not define YYSTYPE as a macro, Bison now declares it
11895 using typedef instead of defining it as a macro. POSIX requires this.
11896 For consistency, YYLTYPE is also declared instead of defined.
11897
11898 %union directives can now have a tag before the `{', e.g., the
11899 directive `%union foo {...}' now generates the C code
11900 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11901 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11902 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11903 instead of `yyltype'.
11904
11905 `yystype' and `yyltype' are now obsolescent macros instead of being
11906 typedefs or tags; they are no longer documented and will be
11907 withdrawn in a future release.
11908
11909 * data/glr.c (b4_location_type): Remove.
11910 (YYSTYPE): Renamed from yystype.
11911 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11912 (struct YYLTYPE): Renamed from struct yyltype.
11913 (YYLTYPE): Renamed from yyltype.
11914 (yyltype, yystype): New (and obsolescent) macros,
11915 for backward compatibility.
11916 * data/yacc.c: Likewise.
11917
11918 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11919 does not specify a union tag. This is for compatibility with
11920 Solaris 9 yacc.
11921
11922 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11923 const *, since it is now modified by stripping surrounding { }.
11924 (current_braced_code): Remove.
11925 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11926 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11927 trailing " {...}". Now of type <chars>.
11928 (grammar_declaration): Adjust to bundled tokens.
11929 (code_content): Remove; stripping is now done by add_param.
11930 (print_token_value): Print contents of bundled tokens.
11931 (token_name): New function.
11932
11933 * src/reader.h (braced_code, current_braced_code): Remove.
11934 (token_name): New decl.
11935
11936 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11937 token_type, not braced_code code_kind. All uses changed.
11938 (SC_PRE_CODE): New state, for scanning after a keyword that
11939 has (or usually has) an immediately-following braced code.
11940 (token_type): New local var, to keep track of which token type
11941 to return when scanning braced code.
11942 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
11943 <INITIAL>"%parse-param", <INITIAL>"%printer",
11944 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11945 instead of returning a token type immediately.
11946 (<INITIAL>"{"): Set token type.
11947 (<SC_BRACED_CODE>"}"): Use it.
11948 (handle_action_dollar, handle_action_at): Now returns bool
11949 indicating success. Fail if ! current_rule; this prevents a core dump.
11950 (handle_symbol_code_dollar, handle_symbol_code_at):
11951 Remove; merge body into caller.
11952 (handle_dollar, handle_at): Complain in invalid contexts.
11953
11954 * NEWS, doc/bison.texinfo: Document the above.
11955 * NEWS: Fix years and program names in copyright notice.
11956
11957 2002-12-17 Paul Eggert <eggert@twinsun.com>
11958
11959 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11960 Reporting, Table of Symbols): Omit mentions of %lex-param and
11961 %parse-param from the documentation for now.
11962
11963 2002-12-15 Paul Eggert <eggert@twinsun.com>
11964
11965 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11966 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11967 lookahead symbol, and which sets yychar in parser actions) and it
11968 disagreed with the Bison documentation. Bug
11969 reported by Andrew Walrond.
11970
11971 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11972 as the caller now does that.
11973 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11974 (YYEMPTY): Parenthesize right hand side, since others use it.
11975 (yyparse): Don't assume that our generated code is the only code
11976 that sets yychar.
11977
11978 2002-12-13 Paul Eggert <eggert@twinsun.com>
11979
11980 Version 1.75d.
11981
11982 POSIX requires a "yacc" command.
11983 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11984 (MOSTLYCLEANFILES): Add yacc.
11985 (yacc): New rule.
11986 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
11987 as an alias for bison y.
11988
11989 * po/LINGUAS: Add da.
11990
11991 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11992 problem with latest <getopt.h>.
11993 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11994
11995 * doc/fdl.texi: Upgrade to 1.2.
11996 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11997 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11998 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11999 gnulib.
12000 * config/install-sh: Sync with autotools.
12001
12002 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
12003 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12004 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
12005 locations are requested.
12006 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
12007 locations are requested.
12008
12009 2002-12-12 Paul Eggert <eggert@twinsun.com>
12010
12011 Remove unportable casts and storage allocation tricks.
12012 While we're at it, remove almost all casts, since they
12013 usually aren't needed and are a sign of trouble.
12014
12015 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
12016
12017 * src/derives.c (derives_compute): Do not subtract NTOKENS from
12018 the pointer DSET returned by malloc; this isn't portable.
12019 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
12020 Similarly for DERIVES.
12021 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
12022 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
12023 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
12024
12025 * src/derives.c (derives_compute): Do not bother invoking
12026 int_of_rule_number, since rule numbers are integers.
12027
12028 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
12029 rather than XMALLOC (char, N).
12030
12031 * src/files.c (filename_split): Rewrite to avoid cast.
12032
12033 * src/gram.h (symbol_number_as_item_number,
12034 item_number_as_symbol_number, rule_number_as_item_number,
12035 item_number_as_rule_number):
12036 Now inline functions rather than macros, to avoid casts.
12037 * src/state.h (state_number_as_int): Likewise.
12038 * src/tables.c (state_number_to_vector_number,
12039 symbol_number_to_vector_number): Likewise.
12040
12041 * src/gram.h (int_of_rule_number): Remove; no longer used.
12042
12043 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
12044 since the resulting storage is always stored into.
12045
12046 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
12047 where it's needed.
12048
12049 * src/muscle_tab.c (muscle_m4_output):
12050 Now inline. Return bool, not int.
12051 * src/state.c (state_compare): Likewise.
12052 * src/symtab.c (symbol_check_defined,
12053 symbol_check_alias_consistency, symbol_pack, symbol_translation,
12054 hash_compare_symbol, hash_symbol):
12055 Likewise.
12056 * src/uniqstr.c (uniqstr_print): Likewise.
12057 * src/muscle_tab.c (muscle_m4_output_processor):
12058 New function, to avoid casts.
12059 * src/state.c (state_comparator, stage_hasher): Likewise.
12060 * src/symtab.c (symbol_check_defined_processor,
12061 symbol_check_alias_consistency_processor, symbol_pack_processor,
12062 symbol_translation_processor, hash_symbol_comparator,
12063 hash_symbol_hasher): Likewise.
12064 * src/uniqstr.c (uniqstr_print_processor): Likewise.
12065 * src/muscle_tab.c (muscles_m4_output):
12066 Use new functions instead of casting old functions unportably.
12067 * src/state.c (state_hash_new): Likewise.
12068 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
12069 symbols_token_translations_init):
12070 Likewise.
12071 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
12072
12073 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
12074 var instead of casting to long, to avoid casts.
12075 (prepare_states): Use MALLOC rather than alloca, so that we don't
12076 have to worry about alloca.
12077 * src/state.c (state_hash_lookup): Likewise.
12078
12079 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
12080 local var instead of casting to unsigned char, to avoid casts.
12081
12082 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
12083 STATE_ALLOC): Remove.
12084 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12085 rather than calloc, and use offsetof to avoid allocating slightly
12086 too much storage.
12087 (state_new): Initialize all members.
12088
12089 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12090
12091 * src/symtab.c (symbol_free): Remove; unused.
12092 (symbol_get): Remove cast in lhs of assignment.
12093 (symbols_do): Now static. Accept generic arguments, not
12094 hashing-related ones.
12095
12096 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12097 (symbol_processor): Remove.
12098 (symbols_do): Remove decl; now static.
12099
12100 * src/system.h (alloca): Remove; decl no longer needed.
12101 (<stddef.h>): Include, for offsetof.
12102 (<inttypes.>, <stdint.h>): Include if available.
12103 (uintptr_t): New type, if system lacks it.
12104 (CALLOC, MALLOC, REALLOC): New macros.
12105 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12106 new macros.
12107
12108 * src/tables.c (table_size): Now int, to pacify GCC.
12109 (table_grow, table_ninf_remap): Use signed table size.
12110 (save_row): Don't bother initializing locals when not needed.
12111 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12112 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12113
12114 * src/vcg.h: Correct misspellings.
12115
12116 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12117
12118
12119 * src/getargs.c (getargs): Don't assume EOF == -1.
12120
12121 2002-12-09 Paul Eggert <eggert@twinsun.com>
12122
12123 Change identifier spellings to avoid collisions with names
12124 that are reserved by POSIX.
12125
12126 Don't use names ending in _t, since POSIX reserves them.
12127 For consistency, remove _e and _s endings -- they're weren't
12128 needed to remove ambiguity. All uses changed.
12129 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12130 turn was just renamed from struniq_t.
12131 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12132 which in turn was just renamed from struniq_processor_t.
12133 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12134 in turn was renamed from hash_compare_struniq_t.
12135 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12136 (state_list): Renamed from state_list_t.
12137 * src/assoc.h (assoc): Renamed from assoc_t.
12138 * src/conflicts.c (enum conflict_resolution): Renamed from
12139 enum conflict_resolution_e.
12140 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12141 (rule_list): Renamed from rule_list_t.
12142 * src/getargs.h (enum trace): Renamed from enum trace_e.
12143 (enum report): Renamed from enum report_e.
12144 * src/gram.h (item_number): Renamed from item_number_t.
12145 (rule_number): Renamed from rule_number_t.
12146 (struct rule_s): Remove the "rule_s" part; not used.
12147 (rule): Renamed from rule_t.
12148 (rule_filter): Renamed from rule_filter_t.
12149 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12150 (goto_list): Renamed from goto_list_t.
12151 * src/lalr.h (goto_number): Renamed from goto_number_t.
12152 * src/location.h (location): Renamed from location_t.
12153 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12154 and moved here from:
12155 * src/muscle_tab.h (muscle_entry_t): here.
12156 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12157 (rule_list): Renamed from rule_list_t.
12158 * src/print_graph.c (static_graph): Renamed from graph.
12159 * src/reader.h (braced_code): Renamed from braced_code_t.
12160 Remove brace_code_e tag.
12161 * src/relation.h (relation_node): Renamed from relation_node_t.
12162 (relation_nodes): Renamed from relation_nodes_t.
12163 (relation): Renamed from relation_t.
12164 * src/state.h (state_number): Renamed from state_number_t.
12165 (struct state): Renamed from struct state_s.
12166 (state): Renamed from state_t.
12167 (transitions): Renamed from transitions_t. Unused (and
12168 misspelled) transtion_s tag removed.
12169 (errs): Renamed from errs_t. Unused errs_s tag removed.
12170 (reductions): Renamed from reductions_t. Unused tag
12171 reductions_s removed.
12172 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12173 (struct symbol_list): Renamed from struct symbol_list_s.
12174 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12175 (struct symbol): Renamed from struct symbol_s.
12176 (symbol): Renamed from symbol_t.
12177 * src/tables.c (vector_number): Renamed from vector_number_t.
12178 (action_number): Renamed from action_t.
12179 * src/tables.h (base_number): Renamed from base_t.
12180 * src/vcg.h (enum color): Renamed from enum color_e.
12181 (enum textmode): Renamed from enum textmode_e.
12182 (enum shape): Renamed from enum shape_e.
12183 (struct colorentry): Renamed from struct colorentry_s.
12184 (struct classname): Renamed from struct classname_s.
12185 (struct infoname): Renamed from struct infoname_s.
12186 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12187 (enum decision): Renamed from enum decision_e.
12188 (enum orientation): Renamed from enum orientation_e.
12189 (enum alignment): Renamed from enum alignment_e.
12190 (enum arrow_mode): Renamed from enum arrow_mode_e.
12191 (enum crossing_type): Renamed from enum crossing_type_e.
12192 (enum view): Renamed from enum view_e.
12193 (struct node): Renamed from struct node_s.
12194 (node): Renamed from node_t.
12195 (enum linestyle): Renamed from enum linestyle_e.
12196 (enum arrowstyle): Renamed from enum arrowstyle_e.
12197 (struct edge): Renamed from struct edge.
12198 (edge): Renamed from edge_t.
12199 (struct graph): Renamed from struct graph_s.
12200 (graph): Renamed from graph_t.
12201 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12202 Rename value_t -> value.
12203 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12204 value_t_as_yystype -> value_as_yystype.
12205
12206 Don't include <errno.h> in the mainstream code, since it
12207 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12208 * lib/get-errno.c, lib/get-errno.h: New files.
12209 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12210 get-errno.c.
12211 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12212 * src/output.c (output_skeleton): Likewise.
12213 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12214 instead of errno.
12215 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12216 Likewise.
12217 (handle_action_dollar, handle_action_at): Likewise.
12218 * src/system.h: Do not include <errno.h>.
12219 (TAB_EXT): Renamed from EXT_TAB.
12220 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12221
12222 Avoid str[a-z]*, since <string.h> reserves that name space.
12223 Change all instances of "struniq" in names to "uniqstr", and
12224 likewise for "STRUNIQ" and "UNIQSTR".
12225 * src/uniqstr.c: Renamed from src/struniq.c.
12226 * src/uniqstr.h: Renamed from src/struniq.h.
12227 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12228 * src/files.c (strsuffix): Remove; unused.
12229 (concat2): Renamed from stringappend. Now static.
12230 * src/files.h (strsuffix, stringappend): Remove; unused.
12231 * src/parse-gram.y (<chars>): Renamed from <string>.
12232 (<uniqstr>): Renamed from <struniq>.
12233 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12234 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12235 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12236 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12237 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12238 (N_EXPAND): Renamed from N_STRETCH.
12239
12240 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12241 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12242 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12243 Remove; unused.
12244 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12245 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12246 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12247 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12248 (BASE_MAXIMUM): Renamed from BASE_MAX.
12249 (BASE_MINIMUM): Renamed from BASE_MIN.
12250 (ACTION_MAX): Remove; unused.
12251 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12252 Unnecessary casts removed from above defines.
12253
12254
12255 Fix misspelling in names.
12256 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12257 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12258 G_NODE_ALIGNEMENT.
12259
12260
12261 * lib/timevar.c (timevar_report): Renamed from time_report,
12262 for consistency with other names.
12263 * lib/timevar.h (timevar_report): New decl.
12264 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12265
12266
12267 Sort include-file uses.
12268
12269 Reorder all include files under src to be in the order "system.h".
12270 then the ../lib include files in angle brackets (alphabetized),
12271 then the . include files in double-quotes (alphabetized). Fix
12272 dependency breakages encountered in this process, as follows:
12273 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12274 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12275 * src/state.h: Include "symtab.h".
12276
12277 2002-12-08 Paul Eggert <eggert@twinsun.com>
12278
12279 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12280 since this causes problems when __file__ contains character
12281 sequences like "@" that are treated specially by src/scan-skel.l.
12282 Instead, just use the file's basename. This fixes the bug
12283 reported by Martin Mokrejs in
12284 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
12285
12286 2002-12-06 Paul Eggert <eggert@twinsun.com>
12287
12288 Add support for rules that do not have trailing semicolons, as
12289 POSIX requires. Improve the quality of locations in Bison
12290 diagnostics.
12291
12292 * src/location.c: Include <quotearg.h>.
12293 (empty_location): Now const.
12294 (location_print): New function. Follow the recommendation of the
12295 GNU Coding Standards for locations that span file boundaries.
12296 * src/location.h: Do not include <quotearg.h>; no longer needed.
12297 (boundary): New type.
12298 (location_t): Use it. This allows locations to span file boundaries.
12299 All member uses changed: file -> start.file or end.file (as needed),
12300 first_line -> start.line, first_column -> start.column,
12301 last_line -> end.line, last_column -> end.column.
12302 (equal_boundaries): New function.
12303 (LOCATION_RESET, LOCATION_STEP): Remove.
12304 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12305 (empty_location): Now const.
12306 (location_print): New decl.
12307 * src/parse-gram.y (lloc_default): New function, which handles
12308 empty locations more accurately.
12309 (YYLLOC_DEFAULT): Use it.
12310 (%token COLON): Remove.
12311 (%token ID_COLON): New token.
12312 (rules): Use it.
12313 (declarations, rules): Remove trailing semicolon.
12314 (declaration, rules_or_grammar_declaration):
12315 Allow empty (";") declaration.
12316 (symbol_def): Remove empty actions; no longer needed.
12317 (rules_or_grammar_declaration): Remove trailing semicolon.
12318 (semi_colon.opt): Remove.
12319 * src/reader.h: Include location.h.
12320 (scanner_cursor): New decl.
12321 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12322 rolling our own.
12323 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12324 of *loc.
12325 (STEP): Remove. No longer needed, now that adjust_location does
12326 the work. All uses removed.
12327 (scanner_cursor): New var.
12328 (adjust_location): Renamed from extend_location. It now sets
12329 *loc and adjusts the scanner cursor. All uses changed.
12330 Don't bother testing for CR.
12331 (handle_syncline): Remove location arg; now updates scanner cursor.
12332 All callers changed.
12333 (unexpected_end_of_file): Now accepts start boundary of token or
12334 comment, not location. All callers changed. Update scanner cursor,
12335 not the location.
12336 (SC_AFTER_IDENTIFIER): New state.
12337 (context_state): Renamed from c_context. All uses changed.
12338 (id_loc, code_start, token_start): New local vars.
12339 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12340 processing of Yacc white space and equivalents here.
12341 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12342 instead of returning ID immediately, since we need to search for
12343 a subsequent colon.
12344 (<INITIAL>"'", "\""): Save token_start.
12345 (<INITIAL>"%{", "{", "%%"): Save code_start.
12346 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12347 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12348 BEGIN context_state at end, not INITIAL.
12349 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12350 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12351 Return correct token start.
12352 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12353 the start of a character, string or multiline comment is found.
12354 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12355 Reduction): Adjust reported locations to match the more-precise
12356 results now expected.
12357 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12358 * tests/reduce.at (Useless Rules, Reduced Automaton,
12359 Underivable Rules): Likewise.
12360 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12361 or "|"' now that so many other tokens are allowed by the new grammar.
12362
12363 * src/complain.h (current_file): Remove duplicate decl;
12364 current_file is now owned by files.h.
12365 * src/complain.c, src/scan-gram.l: Include files.h.
12366
12367 2002-12-06 Paul Eggert <eggert@twinsun.com>
12368
12369 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12370 promotes to int; it might be unsigned int.
12371 * data/yacc.c (yy_reduce_print): Likewise.
12372
12373 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12374 be #defined in the prologue, not in the Bison declarations.
12375 This fixes Debian Bug 102878, reported by Shaul Karl.
12376
12377 2002-12-02 Paul Eggert <eggert@twinsun.com>
12378
12379 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12380 * lib/strtoul.c: New file, from gnulib.
12381 This fixes a porting bug reported by Peter Klein in
12382 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
12383
12384 2002-11-30 Paul Eggert <eggert@twinsun.com>
12385
12386 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12387 and put only a forward declaration in the prologue. This is for
12388 consistency with the other scanner helper functions.
12389
12390 Type clashes now generate warnings, not errors, since it
12391 appears that POSIX may allow some grammars with type clashes.
12392 * src/reader.c (grammar_current_rule_check): Warn about
12393 type clashes instead of complaining.
12394 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12395
12396 Add Yacc library, since POSIX requires it.
12397 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12398 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12399 * lib/main.c, lib/yyerror.c: New files.
12400
12401 gram_error can be static; it need not be extern.
12402 * src/reader.h (gram_error): Remove decl.
12403 * src/parse-gram.y (gram_error): Now static. Add static decl.
12404 (print_token_value): Omit parameter names from forward decl,
12405 for consistency.
12406
12407 2002-11-29 Paul Eggert <eggert@twinsun.com>
12408
12409 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12410 be declared before being used. E.g., one should typically
12411 declare them in the prologue. Use GNU coding style in examples.
12412 Put "const" consistently after the type it modifies. Mention
12413 that C99 supports "inline". Mention that yyerror traditionally
12414 returns "int".
12415
12416 %parse-param and %lex-param now take just one argument, the
12417 declaration; the argument name is deduced from the declaration.
12418
12419 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12420 Reporting, Table of Symbols): Document this.
12421 * src/parse-gram.y (add_param): New function.
12422 (COMMA): Remove.
12423 (declaration): Implement new rule for %parse-param and %lex-param.
12424 * src/scan-gram.l: "," now elicits a warning, rather than being
12425 a token; this is more compatible with byacc.
12426 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12427
12428 2002-11-27 Paul Eggert <eggert@twinsun.com>
12429
12430 Rename identifiers to avoid real and potential collisions.
12431
12432 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12433 to avoid collision with lex macro described by Bruce Lilly in
12434 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12435 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12436 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12437 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12438 All uses changed.
12439 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12440 The name "yycontrol" violates the name space rules, and this stuff
12441 wasn't being used anyway.
12442 (input): Remove action; this stuff wasn't being used.
12443 (gram_error): Rename local variable yylloc -> loc.
12444 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12445 (YY_DECL): Don't use "yy" at start of local variables.
12446 All uses changed, e.g., yylloc -> loc.
12447 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12448 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12449 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12450 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12451
12452 * src/parse-gram.y (gram_error): loc is now const *.
12453 * src/reader.h (gram_error): Likewise.
12454
12455 2002-11-24 Paul Eggert <eggert@twinsun.com>
12456
12457 Version 1.75c.
12458
12459 * tests/actions.at (Actions after errors): Use an output format
12460 more similar to that of the Printers and Destructors test.
12461 Test the position of the ';' token too.
12462 (Printers and Destructors): Likewise.
12463 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12464 unnecessarily alarming people when the test fails.
12465
12466 * data/yacc.c (yyerrlab1): Move this label down, so that the
12467 parser does not discard the lookahead token if the user code
12468 invokes YYERROR. This change is required for POSIX conformance.
12469
12470 * lib/error.c: Sync with gnulib.
12471
12472 2002-11-22 Paul Eggert <eggert@twinsun.com>
12473
12474 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12475 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12476 * lib/xmalloc.c: Likewise.
12477
12478 2002-11-20 Paul Eggert <eggert@twinsun.com>
12479
12480 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12481
12482 2002-11-20 Paul Eggert <eggert@twinsun.com>
12483
12484 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12485 should use `if (! x) abort ();' rather than `assert (x);', and
12486 anyway it's one less thing to worry about configuring.
12487
12488 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12489 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12490 and replace all instances of assert with abort.
12491 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12492 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12493
12494 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12495 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12496 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12497 hash_find_entry, hash_rehash, hash_insert): Likewise.
12498 * src/conflicts.c (resolve_sr_conflict): Likewise.
12499 * src/lalr.c (set_goto_map, map_goto): Likewise.
12500 * src/nullable.c (nullable_compute): Likewise.
12501 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12502 * src/reader.c (packgram, reader): Likewise.
12503 * src/state.c (state_new, state_free, state_transitions_set,
12504 state_reduction_find): Likewise.
12505 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12506 symbol_pack): Likewise.
12507 * src/tables.c (conflict_row, pack_vector): Likewise.
12508 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12509 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12510 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12511 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12512
12513 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12514 (ARGMATCH_CONSTRAINT): New macro.
12515 (ARGMATCH_ASSERT): Use it.
12516
12517 * src/system.h (verify): New macro.
12518 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12519 rather than assert.
12520 * src/tables.c (tables_generate): Likewise.
12521
12522 * src/struniq.c (struniq_assert): Now returns void, and aborts
12523 if the assertion is false.
12524 (struniq_assert_p): Remove.
12525 * src/struniq.h: Likewise.
12526
12527 2002-11-18 Paul Eggert <eggert@twinsun.com>
12528
12529 * data/glr.c (yygetLRActions): Replace `yyindex' with
12530 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12531 This fixes the regression with Sun ONE Studio 7 cc that I reported in
12532 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
12533
12534 2002-11-18 Akim Demaille <akim@epita.fr>
12535
12536 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12537 space.
12538 From Tim Van Holder.
12539
12540 2002-11-17 Paul Eggert <eggert@twinsun.com>
12541
12542 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12543 to "SyntaxError" for consistency with my 2002-11-15 change.
12544
12545 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12546 not define to {}, since this breaks the common use of `YYDPRINTF
12547 ((...));' if a single statement is desired (e.g. before `else').
12548 Work around GCC warnings by surrounding corresponding calls with
12549 {} if needed.
12550 (yyhasResolvedValue): Remove unused function.
12551 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12552 loop body.
12553 (yyreportSyntaxError): Renamed from yyreportParseError.
12554 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12555 All uses changed.
12556 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12557 extern when possible. Remove unused initializations.
12558
12559 2002-11-16 Akim Demaille <akim@epita.fr>
12560
12561 Augment the similarity between GLR and LALR traces.
12562
12563 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12564 (YY_REDUCE_PRINT): New.
12565 (yyparse): Use them.
12566 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12567 YYDPRINT here.
12568 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12569 state reached after the reduction/recovery, since...
12570 (yyparse, yyprocessOneStack): Report the state we are entering in.
12571
12572 2002-11-16 Akim Demaille <akim@epita.fr>
12573
12574 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12575 Add support for --trace=skeleton.
12576 * src/scan-skel.l: %option debug.
12577 Scan strings of non-@ or \n instead of character by character.
12578 (scan_skel): Handle trace_skeleton.
12579 (QPUTS): New.
12580 (@output_parser_name@, @output_header_name@): ``Restore'' their
12581 support (used to be M4 macros).
12582 * data/yacc.c: Quote larger chunks, a la glr.c.
12583 * data/lalr1.cc: Likewise.
12584 The header guards are no longer available, so use some other
12585 string than `YYLSP_NEEDED'.
12586
12587 2002-11-16 Akim Demaille <akim@epita.fr>
12588
12589 Make the ``Printers and Destructors'' test more verbose, taking
12590 `yacc.c''s behavior as (possibly wrong) reference.
12591
12592 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12593 instead of fprint on stdout.
12594 Set and report the last_line of the symbols.
12595 Consistently display values and locations.
12596
12597 2002-11-16 Paul Eggert <eggert@twinsun.com>
12598
12599 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12600
12601 2002-11-15 Paul Eggert <eggert@twinsun.com>
12602
12603 * tests/actions.at (Actions after errors): New test case.
12604
12605 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12606 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12607 tests/action.at, tests/calc.at, tests/conflicts.at,
12608 tests/cxx-type.at, tests/regression.at:
12609 "parse error" -> "syntax error" for POSIX compatibility.
12610 "parsing stack overflow..." -> "parser stack overflow" so
12611 that code matches Bison documentation.
12612
12613 2002-11-15 Akim Demaille <akim@epita.fr>
12614
12615 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12616 take two BRACED_CODE, not two string_content.
12617 Free the scanner's obstack when we are done.
12618 (code_content): New.
12619 * tests/calc.at: Adjust.
12620 * doc/bison.texinfo: Adjust.
12621 Also, make sure to include the `,' for these declarations.
12622
12623 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12624
12625 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12626 definition; avoids potential autoreconf problems.
12627
12628 2002-11-15 Akim Demaille <akim@epita.fr>
12629
12630 Always check the value returned by yyparse.
12631
12632 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12633 returned by yyparse.
12634 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12635 Adjust calls.
12636 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12637 returned by yyparse.
12638
12639 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12640
12641 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12642 on input.at test.
12643
12644 2002-11-14 Paul Eggert <eggert@twinsun.com>
12645
12646 * src/output.c (output_skeleton): Call xfopen instead of
12647 duplicating xfopen's body.
12648
12649 Fix bugs reported by Nelson H. F. Beebe in
12650 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
12651
12652 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12653 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12654 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12655 file twice in the grammar, as an extra check.
12656
12657 * tests/input.at (Torturing the Scanner): Surround the
12658 backslash-newline tests with "#if 0", to make it less likely that
12659 we'll run into compiler bugs. Bring back solitary \ inside
12660 comment, but add a closing comment to work around HP C bug. Don't
12661 test backslash-newline in C character constant.
12662
12663 2002-11-14 Akim Demaille <akim@epita.fr>
12664
12665 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12666 status of the compiler.
12667 Calling `exit 1' is no longer needed.
12668 Reported by Nelson H. F. Beebe.
12669
12670 2002-11-14 Akim Demaille <akim@epita.fr>
12671
12672 * tests/atlocal.in (CPPFLAGS): We have config.h.
12673 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12674 New.
12675 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12676 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12677 * tests/regression.at, tests/torture.at: Use them for all the
12678 grammars that are to be compiled.
12679 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12680 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12681 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12682
12683 2002-11-14 Akim Demaille <akim@epita.fr>
12684
12685 * doc/bison.texinfo: Various formatting changes (alignments in
12686 samples, additional @group/@end group, GCS in samples.
12687 Use @deffn instead of simple @table to define the directives,
12688 macros, variables etc.
12689
12690 2002-11-13 Paul Eggert <eggert@twinsun.com>
12691
12692 Fix some bugs reported by Albert Chin-A-Young in
12693 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
12694
12695 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
12696 -o c"; the HP C compiler chatters during compilation.
12697 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12698 * tests/headers.at (export YYLTYPE): Likewise.
12699
12700 * tests/input.at (Torturing the Scanner): Remove lines containing
12701 solitary backslashes, as they tickle a bug in the HP C compiler.
12702
12703 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12704 comments, since they're not portable. Use GNU coding style.
12705
12706 2002-11-13 Akim Demaille <akim@epita.fr>
12707
12708 * data/yacc.c: Leave bigger chunks of quoted text.
12709 (YYDSYMPRINTF): New.
12710 Use it to report symbol activities.
12711 * data/glr.c (YYDSYMPRINTF): New.
12712 Use it.
12713
12714 2002-11-12 Paul Eggert <eggert@twinsun.com>
12715
12716 Version 1.75b.
12717
12718 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12719 (yyglrReduce): Return yyok, not 0.
12720 This should avoid the enumerated-type warnings reported
12721 by Nelson H. F. Beebe in
12722 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
12723
12724 * lib/bbitset.h (BITSET_INLINE): Remove.
12725 * lib/bitset.h [! BITSET_INLINE]: Remove.
12726 (bitset_set, bitset_reset, bitset_test): Rename local vars
12727 to avoid shadowing warnings by GCC.
12728
12729 * data/glr.c (inline): Remove #define. It's the user's
12730 responsibility to #define it away, just like 'const'.
12731 This fixes one of the bugs reported by Nelson H. F. Beebe in
12732 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
12733
12734 * Makefile.maint (po-check): Scan .l and .y files instead of the
12735 .c and the .h files that they generate. This fixes the bug
12736 reported by Tim Van Holder in:
12737 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
12738 Look for N_ as well as for _. Try to avoid matching #define for
12739 N_ and _.
12740 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12741 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12742 * src/scan-gram.l: Revamp regular expressions so that " and '
12743 do not confuse xgettext.
12744
12745 * src/struniq.h (struniq_new): Do not declare the return type
12746 to be 'const'; this violates the C standard.
12747 * src/struniq.c (struniq_new): Likewise.
12748
12749 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12750
12751 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12752 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12753 linker.
12754
12755 2002-11-12 Akim Demaille <akim@epita.fr>
12756
12757 * Makefile.maint: Sync with Autoconf:
12758 (local_updates): New.
12759
12760 2002-11-12 Akim Demaille <akim@epita.fr>
12761
12762 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12763
12764 2002-11-12 Akim Demaille <akim@epita.fr>
12765
12766 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12767 locations.
12768
12769 2002-11-12 Akim Demaille <akim@epita.fr>
12770
12771 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12772 not yyvalue.
12773
12774 2002-11-12 Akim Demaille <akim@epita.fr>
12775
12776 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12777 Use it to test the GLR parser.
12778
12779 2002-11-12 Akim Demaille <akim@epita.fr>
12780
12781 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12782 defines it.
12783 * data/glr.c (yystos): New.
12784 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12785 (YYDSYMPRINT): New.
12786 (yyval): Don't define it, it is handled via M4.
12787 (yyrecoverParseError): Free verbosely the discarded symbols.
12788 * data/yacc.c (yysymprint): Remove, rather...
12789 (b4_yysymprint_generate): invoke.
12790 * data/c.m4 (b4_yysymprint_generate): New.
12791 Accept pointers as arguments, as opposed to the version from
12792 yacc.c.
12793 (b4_yydestruct_generate): Likewise.
12794 * tests/cations.at (Printers and Destructors): Use Bison directives
12795 instead of CPP macros.
12796 Don't rely on internal details.
12797
12798 2002-11-12 Akim Demaille <akim@epita.fr>
12799
12800 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12801 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12802 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12803 it against YYEMPTY and so forth), work on yytoken (i.e., set
12804 it to YYEMPTY etc.).
12805 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12806 (b4_symbol_actions): Remove.
12807 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12808 for 0, end-of-input.
12809
12810 2002-11-12 Akim Demaille <akim@epita.fr>
12811
12812 * doc/bison.texinfo (Destructor Decl): New.
12813
12814 2002-11-12 Akim Demaille <akim@epita.fr>
12815
12816 * src/tables.c (tables_generate): Use free for pointers that
12817 cannot be NULL, not XFREE.
12818 (pack_vector): Use assert, not fatal, for bound violations.
12819 * src/state.c (state_new): Likewise.
12820 * src/reader.c (reader): Likewise.
12821 * src/lalr.c (set_goto_map): Likewise.
12822 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
12823 the file name.
12824
12825 2002-11-12 Akim Demaille <akim@epita.fr>
12826
12827 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12828 Restore.
12829 * src/scan-gram.l (last_string): Is global to the file, not to
12830 yylex.
12831 * src/parse-gram.y (input): Don't append the epilogue here,
12832 (epilogue.opt): do it here, and free the scanner's obstack.
12833 * src/reader.c (epilogue_set): Rename as...
12834 (epilogue_augment): this.
12835 * data/c.m4 (b4_epilogue): Defaults to empty.
12836
12837 2002-11-12 Akim Demaille <akim@epita.fr>
12838
12839 * src/getargs.c (long_options): Remove duplicates.
12840 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12841 Remove.
12842 * doc/bison.rnh: Remove.
12843 * doc/bison.texinfo (VMS Invocation): Remove.
12844
12845 2002-11-12 Akim Demaille <akim@epita.fr>
12846
12847 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12848 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12849
12850 Use struniq for symbols.
12851
12852 * src/symtab.h (symbol_t): The tag member is a struniq.
12853 (symbol_type_set): Adjust.
12854 * src/symtab.c (symbol_new): Takes a struniq.
12855 (symbol_free): Don't free the tag member.
12856 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12857 (hash_compare_symbol, hash_symbol): these.
12858 Use the fact that tags as struniqs.
12859 (symbol_get): Use struniq_new.
12860 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12861 Returns a strniq.
12862 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12863 and type members are struniqs.
12864 * src/reader.c (get_merge_function)
12865 (grammar_current_rule_merge_set): Adjust.
12866 (TYPE, current_type): Are struniq.
12867
12868 Use struniq for file names.
12869
12870 * src/files.h, src/files.c (infile): Split into...
12871 (grammar_file, current_file): these.
12872 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12873 * src/reduce.c (reduce_print): Likewise.
12874 * src/getargs.c (getargs): Likewise.
12875 * src/complain.h, src/complain.c: Likewise.
12876 * src/main.c (main): Call struniqs_new early enough to use it for
12877 file names.
12878 Don't free the input file name.
12879
12880 2002-11-12 Akim Demaille <akim@epita.fr>
12881
12882 * src/symtab.c (symbol_free): Remove dead deactivated code:
12883 type_name are properly removed.
12884 Don't use XFREE to free items that cannot be NULL.
12885 * src/struniq.h, src/struniq.c: New.
12886 * src/main.c (main): Initialize/free struniqs.
12887 * src/parse-gram.y (%union): Add astruniq member.
12888 (yyprint): Adjust.
12889 * src/scan-gram.l (<{tag}>): Return a struniq.
12890 Free the obstack bit that used to store it.
12891 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12892
12893 2002-11-11 Paul Eggert <eggert@twinsun.com>
12894
12895 Revamp to fix many (but not all) of the C- and M4-related quoting
12896 problems. Among other things, this fixes the Bison bug reported
12897 by Jan Hubicka when processing the Bash grammar; see:
12898 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
12899
12900 Use new @ escapes consistently. Represent brackets with @{ and @}
12901 rather than @<:@ and @:>@, since this works a bit better with dumb
12902 editors like vi. Represent @ with @@, since @ is now consistently
12903 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12904 __ofile__, to avoid unexpected expansions. Similarly, use @output
12905 rather than #output.
12906
12907 * data/c.m4 (b4_copyright): Omit file name from comment, since
12908 the file name could contain "*/".
12909 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12910 be quoted. All uses changed.
12911
12912 * data/glr.c: Use new @ escapes consistently.
12913 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12914 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12915 Remove, since they couldn't handle arbitrary characters in file
12916 names.
12917 * data/lalr1.cc: Likewise.
12918 * data/yacc.c: Likewise.
12919
12920 * src/files.c (output_infix): Remove; all uses removed.
12921 * src/files.h: Likewise.
12922
12923 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12924 mishandled funny characters in file names, and anyway it isn't
12925 needed any more.
12926 * data/yacc.c: Likewise.
12927 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12928
12929 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12930 * data/yacc.c: Likewise.
12931
12932 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12933 strings now.
12934 (muscle_init): Quote filename as a C string.
12935 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12936 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12937 * src/output.c (escaped_file_name_output): New function.
12938 (prepare_symbols): Quote tokens for M4.
12939 (prepare): Don't insert output_infix, output_prefix,
12940 output_parser_name, output_header_name; this is now down by scan-skel.
12941 Insert skeleton as a C string.
12942
12943 * src/output.c (user_actions_output, symbol_destructors_output,
12944 symbol_printers_output): Quote filenames for C and M4.
12945 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12946
12947 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12948 escapes other than \\ and \'; this simplifies the code.
12949 (<SC_STRING>): Likewise, for \\ and \".
12950 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12951 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12952 Use new escapes @{ and @} for [ and ].
12953
12954 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12955 them with auto vars.
12956 Switch to new escape scheme, where @ is the escape character uniformly.
12957 Abort if a stray escape character is found. Avoid unbounded input
12958 buffer when parsing non-escaped text.
12959
12960 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12961 __oline__, #output, $@, and @{ do not have unintended meanings.
12962
12963 2002-11-09 Paul Eggert <eggert@twinsun.com>
12964
12965 Fix the test failure due to GCC warnings described in
12966 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
12967 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12968 evaluate to 0 if it's impossible for NINF to be in the respective
12969 table.
12970 (yygetLRActions, yyrecoverParseError): Use them.
12971
12972 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12973 counted in the token inserted at end of file. Now takes
12974 location_t *, not location_t, so that the location can be
12975 adjusted. All uses changed.
12976
12977 * tests/regression.at (Invalid inputs): Adjust wording in
12978 diagnostic to match the new behavior.
12979
12980 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12981 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12982 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12983 abort ();'. This reduces the runtime of the "Many lookaheads"
12984 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12985 GCC 3.2.
12986
12987 2002-11-07 Paul Eggert <eggert@twinsun.com>
12988
12989 * src/parse-gram.y (CHARACTER): Remove unused token.
12990 All uses removed.
12991
12992 * src/scan-gram.l: Remove stack option. We no longer use the
12993 stack, since the stack was never deeper than 1; instead, use the
12994 new auto var c_context to record the stacked value.
12995
12996 Remove nounput option. At an unexpected end of file, we now unput
12997 the minimal input necessary to end cleanly; this simplifies the
12998 code.
12999
13000 Avoid unbounded token sizes where this is easy.
13001
13002 (unexpected_end_of_file): New function.
13003 Use it to systematize the error message on unexpected EOF.
13004 (last-string): Now auto, not static.
13005 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
13006 (scanner_last_string_free): Remove; not used.
13007 (percent_percent_count): Move decl to just before use.
13008 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
13009 not the (never otherwised-used) CHARACTER.
13010
13011 2002-11-07 Akim Demaille <akim@epita.fr>
13012
13013 Let yyerror always receive the msg as last argument, so that
13014 yyerror can be variadic.
13015
13016 * data/yacc.c (b4_yyerror_args): New.
13017 Use it when calling yyerror.
13018 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
13019 Use it when calling yyerror.
13020 * doc/bison.texinfo (Error Reporting): Adjust.
13021 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
13022 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
13023
13024 2002-11-06 Akim Demaille <akim@epita.fr>
13025
13026 #line should have quoted strings.
13027 Ideally, this should be done by m4_quotearg.
13028
13029 * src/scan-skel.l: Include quotearg.h.
13030 Quote __ofile__.
13031 * src/output.c (symbol_printers_output)
13032 (symbol_destructors_output): Quote the file name.
13033
13034 2002-11-06 Akim Demaille <akim@epita.fr>
13035
13036 * tests/regression.at (Invalid inputs): Adjust to the recent
13037 messages.
13038
13039 2002-11-06 Akim Demaille <akim@epita.fr>
13040
13041 Restore --no-lines.
13042 Reported by Jim Kent.
13043
13044 * data/c.m4 (b4_syncline): New.
13045 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
13046 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
13047 * src/output.c (user_actions_output): Likewise.
13048 (prepare): Define 'b4_synclines_flag'.
13049 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
13050
13051 2002-11-06 Akim Demaille <akim@epita.fr>
13052
13053 * src/main.c (main): Free `infile'.
13054 * src/scan-gram.l (handle_syncline): New.
13055 Recognize `#line'.
13056 * src/output.c (user_actions_output, symbol_destructors_output)
13057 (symbol_printers_output): Use the location's file name, not
13058 infile.
13059 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13060
13061 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13062
13063 * src/tables.c (matching_state): Don't allow states to match if
13064 either has GLR conflict entries.
13065
13066 2002-11-05 Paul Eggert <eggert@twinsun.com>
13067
13068 * src/scan-gram.l: Use more accurate diagnostics, e.g.
13069 "integer out of range" rather than "invalid value".
13070 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
13071 accordingly.
13072
13073 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
13074 Also, remove one static variable in the scanner.
13075
13076 * src/scan-gram.l (braces_level): Now auto, not static.
13077 Initialize to zero if the compiler is being picky.
13078 (INITIAL): Clear braces_level instead of incrementing it.
13079 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
13080 as POSIX 1003.1-2001 requires.
13081 * src/system.h (IF_LINT): New macro, taken from coreutils.
13082 * configure.ac: Define "lint" if --enable-gcc-warnings.
13083
13084 2002-11-05 Akim Demaille <akim@epita.fr>
13085
13086 * src/scan-gram.l: When it starts with `%', complain about the
13087 whole directive, not just that `invalid character: %'.
13088
13089 2002-11-04 Akim Demaille <akim@epita.fr>
13090
13091 * Makefile.maint: Update from Autoconf.
13092 (update, cvs-update, po-update, do-po-update): New.
13093
13094 2002-11-04 Akim Demaille <akim@epita.fr>
13095
13096 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13097 and yyerror.
13098 Have yyerror `use' its arguments.
13099 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13100 returns true when location & yacc & pure & parse-param.
13101 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13102
13103 2002-11-04 Akim Demaille <akim@epita.fr>
13104
13105 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13106 clashes.
13107 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13108 font-lock-mode.
13109 Use complain_at.
13110 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13111 slot 0.
13112
13113 2002-11-03 Paul Eggert <eggert@twinsun.com>
13114
13115 * src/reader.c (get_merge_function, grammar_current_rule_check):
13116 Use consistent diagnostics for reporting type name clashes.
13117 Quote the types with <>, for consistency with Yacc.
13118 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13119
13120 2002-11-03 Akim Demaille <akim@epita.fr>
13121
13122 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13123 New.
13124 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13125 (b4_parse_param): Remove.
13126 Use b4_identification.
13127 Propagate b4_pure_args where needed to pass them to yyerror.
13128 * data/glr.m4 (b4_parse_param): Remove.
13129 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13130 (b4_lpure_formals): New.
13131 Use b4_identification.
13132 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13133 b4_user_formals and b4_user_args.
13134 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13135 (yyreportAmbiguity): When using a pure parser, also need
13136 the location, and the parse-params.
13137 Adjust callers.
13138 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13139 When using a pure parser, also need the parse-params.
13140 Adjust callers.
13141 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13142 (%pure-parser + %parse-param) LALR and GLR parsers.
13143 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13144 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13145 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13146 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13147 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13148 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13149 * doc/bison.texinfo: Untabify the whole file.
13150 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13151 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13152 (Error Reporting): Adjust to these new directives.
13153 Document %error-verbose, deprecate YYERROR_VERBOSE.
13154
13155 2002-11-03 Akim Demaille <akim@epita.fr>
13156
13157 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13158 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13159 command line options.
13160 * tests/cxx-type.at: Formatting changes.
13161
13162 2002-11-03 Paul Eggert <eggert@twinsun.com>
13163
13164 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13165 to count columns correctly, and to check for invalid inputs.
13166
13167 Use mbsnwidth to count columns correctly. Account for tabs, too.
13168 Include mbswidth.h.
13169 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13170 (extend_location): New function.
13171 (YY_LINES): Remove.
13172
13173 Handle CRLF in C code rather than in Lex code.
13174 (YY_INPUT): New macro.
13175 (no_cr_read): New function.
13176
13177 Scan UCNs, even though we don't fully handle them yet.
13178 (convert_ucn_to_byte): New function.
13179
13180 Handle backslash-newline correctly in C code.
13181 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13182 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13183 all uses changed.
13184 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13185 Use {splice} wherever C allows backslash-newline.
13186 YY_STEP after space, newline, vertical-tab.
13187 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
13188
13189 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13190
13191 ({int}, handle_action_dollar, handle_action_at): Check for integer
13192 overflow.
13193
13194 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13195
13196 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13197 as well as \000. Check for UCHAR_MAX, not 255.
13198 Allow \x with an arbitrary positive number of digits, as in C.
13199 Check for overflow here.
13200 Allow \? and UCNs, for compatibility with C.
13201
13202 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13203 with quote slot used by complain_at.
13204
13205 * tests/input.at: Add tests for backslash-newline, m4 quotes
13206 in symbols, long literals, and funny escapes in strings.
13207
13208 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13209 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13210 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13211 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13212 * m4/mbswidth.m4: New file, from GNU coreutils.
13213
13214 * doc/bison.texinfo (Grammar Outline): Document // comments.
13215 (Symbols): Document that trigraphs have no special meaning in Bison,
13216 nor is backslash-newline allowed.
13217 (Actions): Document that trigraphs have no special meaning.
13218
13219 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13220 no longer used.
13221
13222 2002-11-02 Paul Eggert <eggert@twinsun.com>
13223
13224 * src/reader.c: Don't include quote.h; not needed.
13225 (get_merge_function): Reword warning to be consistent with
13226 type clash diagnostic in grammar_current_rule_check.
13227
13228 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13229 bug in trigraph handling.
13230
13231 * src/output.c (prepare_symbols): When printing token names,
13232 escape "[" as "@<:@" and likewise for "]".
13233
13234 * src/system.h (errno): Remove declaration, as we are now
13235 assuming C89 or better, and C89 guarantees errno.
13236
13237 2002-10-30 Paul Eggert <eggert@twinsun.com>
13238
13239 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13240 Check for close failures.
13241 * src/files.h (xfclose): Return void, not int, since it always
13242 returned zero.
13243 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13244 indicates one.
13245 * src/output.c (output_skeleton): Use xfclose rather than fclose
13246 and ferror. xfclose now checks ferror.
13247
13248 * data/glr.c (YYLEFTMOST_STATE): Remove.
13249 (yyreportTree): Use a stack-based leftmost state. This avoids
13250 our continuing battles with bogus warnings about initializers.
13251
13252 2002-10-30 Akim Demaille <akim@epita.fr>
13253
13254 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13255 #if.
13256
13257 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13258
13259 * tests/glr-regr1.at: New test for reported regressions.
13260 * tests/testsuite.at: Add glr-regr1.at test.
13261 * tests/Makefile.am: Add glr-regr1.at test.
13262
13263 2002-10-24 Paul Eggert <eggert@twinsun.com>
13264
13265 Version 1.75a.
13266
13267 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13268 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13269 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13270 Don't assume strdup exists; POSIX says its an XSI extension.
13271 Check for buffer overflow on input.
13272
13273 2002-10-24 Akim Demaille <akim@epita.fr>
13274
13275 * src/output.c (output_skeleton): Don't disable M4sugar comments
13276 too soon: it results in comments being expanded.
13277 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13278 first output.
13279
13280 2002-10-24 Akim Demaille <akim@epita.fr>
13281
13282 * data/yacc.c (m4_int_type): New.
13283 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13284 char' as only yacc.c wants K&R portability.
13285 * data/glr.c (yysigned_char): Remove.
13286 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13287 Reported by Quoc Peyrot.
13288
13289 2002-10-23 Paul Eggert <eggert@twinsun.com>
13290
13291 * src/main.c (main): With --trace=time, report times even if a
13292 non-fatal error occurs. Formerly, the times were reported in some
13293 such cases but not in others.
13294 * src/reader.c (reader): Just return if a complaint has been issued,
13295 instead of exiting, so that 'main' can report times.
13296
13297 2002-10-22 Akim Demaille <akim@epita.fr>
13298
13299 * src/system.h: Include sys/types.
13300 Reported by Bert Deknuydt.
13301
13302 2002-10-23 Paul Eggert <eggert@twinsun.com>
13303
13304 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13305 Suggested by Art Haas.
13306
13307 2002-10-22 Paul Eggert <eggert@twinsun.com>
13308
13309 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13310 decl; not needed any more.
13311 * src/main.c (main): Use return to exit, undoing yesterday's change.
13312 The last OS that we could find where this wouldn't work is
13313 SunOS 3.5, and that's too old to worry about now.
13314
13315 * data/glr.c (struct yyltype): Define members even when not
13316 doing locations. This is more consistent with yacc.c, and it
13317 works around the following bug reports:
13318 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13319 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
13320
13321 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13322 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13323 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13324
13325 2002-10-22 Akim Demaille <akim@epita.fr>
13326
13327 * data/README: New.
13328
13329 2002-10-21 Paul Eggert <eggert@twinsun.com>
13330
13331 Be consistent about 'bool'; the old code used an enum in one
13332 module and an int in another, and this violates the C standard.
13333 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13334 * configure.ac (AC_HEADER_STDBOOL): Add.
13335 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13336 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13337 * src/symtab.c (hash_compare_symbol_t): Likewise.
13338 * src/system.h (bool, false, true): Use a definition consistent
13339 with ../lib/hash.c. All uses changed.
13340
13341 * src/complain.c (warning_issued): Renamed from warn_message_count,
13342 so that we needn't worry about integer overflow (!).
13343 Now of type bool. All uses changed.
13344 (complaint_issued): Renamed from complain_message_count; likewise.
13345
13346 * src/main.c (main): Use exit to exit with failure.
13347
13348 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13349 rather than 1 and 0.
13350 * src/main.c (main): Likewise.
13351 * src/getargs.c (getargs): Likewise.
13352 * src/reader.c (reader): Likewise.
13353
13354 * src/getarg.c (getargs): Remove duplicate code for
13355 "Try `bison --help'".
13356
13357 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13358 What was that "2" for?
13359
13360 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13361 * src/getargs.c (usage): Likewise.
13362
13363 * src/getargs.c (getargs): When there are too few operands, report
13364 the last one. When there are too many, report the first extra
13365 one. This is how diffutils does it.
13366
13367 2002-10-20 Paul Eggert <eggert@twinsun.com>
13368
13369 Remove K&R vestiges.
13370 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13371 * src/complain.c (VA_START): Remove. Assume prototypes.
13372 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13373 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13374 fatal): Assume prototypes.
13375 * src/complain.h: Assume prototypes.
13376 * src/system.h (PARAMS): Remove.
13377 Include <limits.h> unconditionally, since it's guaranteeed even
13378 for a freestanding C89 compiler.
13379 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13380 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
13381
13382 2002-10-20 Akim Demaille <akim@epita.fr>
13383
13384 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13385 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13386 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13387 (yyresolveStates, yyresolveAction, yyresolveStack)
13388 (yyprocessOneStack): Use them.
13389 (yy_reduce_print): New.
13390 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13391
13392 2002-10-20 Akim Demaille <akim@epita.fr>
13393
13394 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13395 arguments and output `void'.
13396 (b4_c_function): Rename as...
13397 (b4_c_function_def): this.
13398 (b4_c_function_decl, b4_c_ansi_function_def)
13399 (b4_c_ansi_function_decl): New.
13400 Change the interpretation of the arguments: before `int, foo', now
13401 `int foo, foo'.
13402 * data/yacc.c (yyparse): Prototype and define thanks to these.
13403 Adjust b4_c_function_def uses.
13404 * data/glr.c (yyparse): Likewise, but ANSI only.
13405
13406 2002-10-20 Akim Demaille <akim@epita.fr>
13407
13408 * src/output.c (prepare): Move the definition of `tokens_number',
13409 `nterms_number', `undef_token_number', `user_token_number_max'
13410 to...
13411 (prepare_tokens): Here.
13412 (prepare_tokens): Rename as...
13413 (prepare_symbols): this.
13414 (prepare): Move the definition of `rules_number' to...
13415 (prepare_rules): here.
13416 (prepare): Move the definition of `last', `final_state_number',
13417 `states_number' to...
13418 (prepare_states): here.
13419 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13420
13421 2002-10-20 Akim Demaille <akim@epita.fr>
13422
13423 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13424
13425 2002-10-20 Akim Demaille <akim@epita.fr>
13426
13427 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13428 * data/c.m4: here.
13429
13430 2002-10-20 Akim Demaille <akim@epita.fr>
13431
13432 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13433 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13434 `pair'.
13435 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13436 `name' to...
13437 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13438 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13439 These.
13440
13441 2002-10-19 Paul Eggert <eggert@twinsun.com>
13442
13443 Do not create a temporary file, as that involves security and
13444 cleanup headaches. Instead, use a pair of pipes.
13445 Derived from a suggestion by Florian Krohm.
13446 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13447 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13448 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13449 (BISON_PREREQ_SUBPIPE): Add.
13450 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13451 Add subpipe.h, subpipe.c.
13452 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13453 * po/POTFILES.in: Add lib/subpipe.c.
13454 * src/output.c: Include "subpipe.h".
13455 (m4_invoke): Remove decl.
13456 (scan_skel): New decl.
13457 (output_skeleton): Use pipe rather than temporary file for m4 input.
13458 Check that m4sugar.m4 is readable, to avoid deadlock.
13459 Check for pipe I/O error.
13460 * src/scan-skel.l (readpipe): Remove decl.
13461 (scan_skel): New function, to be used in place of m4_invoke.
13462 Read from stream rather than file.
13463
13464 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13465 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13466 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13467 this generates a more-accurate value anyway.
13468
13469 * lib/timevar.c (timervar_accumulate): Rename locals to
13470 avoid confusion with similarly-named more-global.
13471 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13472
13473 * src/output.c (prepare): Use xstrdup to convert char const *
13474 to char *, to avoid GCC warning.
13475
13476 2002-10-19 Akim Demaille <akim@epita.fr>
13477
13478 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13479 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13480 Use them to have `calc.y' ready for %pure-parser.
13481 * data/yacc.c (YYLEX): Pass a yylex return type to
13482 b4_c_function_call.
13483
13484 2002-10-19 Akim Demaille <akim@epita.fr>
13485
13486 Prototype support of %lex-param and %parse-param.
13487
13488 * src/parse-gram.y: Add the definition of the %lex-param and
13489 %parse-param tokens, plus their rules.
13490 Drop the `_' version of %glr-parser.
13491 Add the "," token.
13492 * src/scan-gram.l (INITIAL): Scan them.
13493 * src/muscle_tab.c: Comment changes.
13494 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13495 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13496 (muscle_entry_s): The `value' member is no longer const.
13497 Adjust all dependencies.
13498 * src/muscle_tab.c (muscle_init): Adjust: use
13499 MUSCLE_INSERT_STRING.
13500 Initialize the obstack earlier.
13501 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13502 (muscle_pair_list_grow): New.
13503 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13504 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13505 * tests/calc.at: Use %locations, not --locations.
13506 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13507
13508 2002-10-19 Akim Demaille <akim@epita.fr>
13509
13510 * src/getargs.c (usage): Take status as argument and exit
13511 accordingly.
13512 Report the traditional `Try ... --help' message when status != 0.
13513 (usage, version): Don't take a FILE * as arg, it is pointless.
13514 (getargs): When there is an incorrect number of arguments, make it
13515 an error, and report it GNUlically thanks to `usage ()'.
13516
13517 2002-10-18 Paul Eggert <eggert@twinsun.com>
13518
13519 * data/glr.c (yyreportParseError): Don't assume that sprintf
13520 yields the length of the printed string, as this is not true
13521 on SunOS 4.1.4. Reported by Peter Klein.
13522
13523 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13524 * tests/conflicts.at (%nonassoc and eof): Likewise.
13525 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13526
13527 2002-10-17 Akim Demaille <akim@epita.fr>
13528
13529 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13530 * src/getargs.c (trace_types, trace_args): Adjust.
13531 * src/reader.c (grammar_current_rule_prec_set)
13532 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13533 Standardize error messages.
13534 And s/@prec/%prec/!
13535 (reader): Use trace_flag to enable scanner/parser debugging,
13536 instead of an adhoc scheme.
13537 * src/scan-gram.l: Remove trailing debugging code.
13538
13539 2002-10-16 Paul Eggert <eggert@twinsun.com>
13540
13541 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13542 MUSCLE_TAB_H.
13543
13544 * NEWS: Officially drop support for building Bison with K&R C,
13545 since it didn't work anyway and it's not worth worrying about.
13546 * Makefile.maint (wget_files): Remove ansi2knr.c.
13547 (ansi2knr.c-url_prefix): Remove.
13548 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13549 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13550 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13551
13552 2002-10-15 Paul Eggert <eggert@twinsun.com>
13553
13554 Stop using the "enum_" trick for K&R-style function definitions;
13555 it confused me, and I was the author! Instead, assume that people
13556 who want to use K&R C compilers (when using these modules in GCC,
13557 perhaps?) will run ansi2knr.
13558
13559 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13560 All uses of "enum_" changed to "enum ".
13561 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13562 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13563
13564 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13565 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13566 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13567 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13568 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13569 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13570 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13571 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13572 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13573 Use function prototypes; this removes the need for declaring
13574 static functions simply to provide their prototypes.
13575 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13576 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13577 bitset_count_, bitset_create, bitset_dump, bitset_first,
13578 bitset_free, bitset_init, bitset_last, bitset_next,
13579 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13580 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13581 bitset_print, bitset_release_memory, bitset_toggle_,
13582 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13583 debug_bitset): Likewise.
13584 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13585 * lib/bitset_stats.c (bitset_log_histogram_print,
13586 bitset_percent_histogram_print, bitset_stats_and,
13587 bitset_stats_and_cmp, bitset_stats_and_or,
13588 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13589 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13590 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13591 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13592 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13593 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13594 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13595 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13596 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13597 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13598 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13599 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13600 bitset_stats_zero): Likewise.
13601 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13602 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13603 bitsetv_dump, debug_bitsetv): Likewise.
13604 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13605 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13606 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13607 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13608 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13609 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13610 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13611 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13612 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13613 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13614 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13615 Likewise.
13616 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13617 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13618 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13619 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13620 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13621 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13622 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13623 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13624 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13625 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13626 lbitset_xor_cmp, lbitset_zero): Likewise.
13627
13628 2002-10-14 Akim Demaille <akim@epita.fr>
13629
13630 Version 1.75.
13631
13632 2002-10-14 Akim Demaille <akim@epita.fr>
13633
13634 * tests/Makefile.am (maintainer-check-posix): New.
13635
13636 2002-10-14 Akim Demaille <akim@epita.fr>
13637
13638 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13639 member.
13640
13641 2002-10-14 Akim Demaille <akim@epita.fr>
13642
13643 * src/tables.c (table_ninf_remap): base -> tab.
13644 Reported by Matt Rosing.
13645
13646 2002-10-14 Paul Eggert <eggert@twinsun.com>
13647
13648 * tests/action.at, tests/calc.at, tests/conflicts.at,
13649 tests/cxx-type.at, tests/headers.at, tests/input.at,
13650 tests/regression.at, tests/synclines.at, tests/torture.at:
13651 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13652 so that the tests still work even if POSIXLY_CORRECT is set.
13653 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
13654
13655 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13656 for portability to K&R hosts. Fix typo: signed char is guaranteed
13657 only to 127, not to 128.
13658 * data/glr.c (yysigned_char): New type.
13659 * data/yacc.c (yysigned_char): Likewise.
13660 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13661
13662 2002-10-13 Paul Eggert <eggert@twinsun.com>
13663
13664 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13665 true due to limited range of data type" warning from GCC.
13666
13667 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13668 by wrapping enum yytokentype's definition inside #ifndef
13669 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13670
13671 2002-10-13 Akim Demaille <akim@epita.fr>
13672
13673 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13674 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13675
13676 2002-10-13 Akim Demaille <akim@epita.fr>
13677
13678 * Makefile.maint: Update from Autoconf 2.54.
13679 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13680
13681 2002-10-13 Akim Demaille <akim@epita.fr>
13682
13683 * src/print.c (print_state): Separate the list of solved conflicts
13684 from the other items.
13685 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13686
13687 2002-10-13 Akim Demaille <akim@epita.fr>
13688
13689 Let nondeterministic skeletons be usable with deterministic
13690 tables.
13691
13692 With the patch, GAWK compiled by GCC without -O2 passes its test
13693 suite using a GLR parser driven by LALR tables. It fails with -O2
13694 because `struct stat' gives two different answers on my machine:
13695 88 (definition of an auto var) and later 96 (memset on this var).
13696 Hence the stack is badly corrumpted. The headers inclusion is to
13697 blame: if I move the awk.h inclusion before GLR's system header
13698 inclusion, the two struct stat have the same size.
13699
13700 * src/tables.c (pack_table): Always create conflict_table.
13701 (token_actions): Always create conflict_list.
13702 * data/glr.c (YYFLAG): Remove, unused.
13703
13704 2002-10-13 Akim Demaille <akim@epita.fr>
13705
13706 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13707 (O0FLAGS): New.
13708 (VALGRIND, GXX): New.
13709 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13710 * tests/bison.in: Run $PREBISON a pre-command.
13711 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13712 (maintainer-check-g++): New.
13713 * Makefile.am (maintainer-check): New.
13714
13715 2002-10-13 Akim Demaille <akim@epita.fr>
13716
13717 * data/glr.c: Formatting changes.
13718 Tweak some trace messages to match yacc.c's.
13719
13720 2002-10-13 Akim Demaille <akim@epita.fr>
13721
13722 GLR parsers sometimes raise parse errors instead of performing the
13723 default reduction.
13724 Reported by Charles-Henry de Boysson.
13725
13726 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
13727 check the length of the traces when %glr.
13728 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13729 GLR's traces.
13730 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13731 Test GLR parsers.
13732 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13733 (yyltype): Remove the yy prefix from the member names.
13734 (yytable): Complete its comment.
13735 (yygetLRActions): Map error action number from YYTABLE from
13736 YYTABLE_NINF to 0.
13737 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13738 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13739 not satisfying as we could compare an YYACTION computed from
13740 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13741 only value for error actions.
13742 (yyreportParseError): In verbose parse error messages, don't issue
13743 `error' in the list of expected tokens.
13744 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13745 next action to perform to match glr.c's decoding.
13746 (yytable): Complete its comment.
13747
13748 2002-10-13 Paul Eggert <eggert@twinsun.com>
13749
13750 Fix problem reported by Henrik Grubbstroem in
13751 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
13752 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13753 because the Bison parser reads the second action before reducing
13754 the first one.
13755 * src/scan-gram.l (rule_length): New static var.
13756 Use it to keep track of the rule length in the scanner, since
13757 we can't expect the parser to be in lock-step sync with the scanner.
13758 (handle_action_dollar, handle_action_at): Use this var.
13759 * tests/actions.at (Exotic Dollars): Test for the problem.
13760
13761 2002-10-12 Paul Eggert <eggert@twinsun.com>
13762
13763 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13764 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13765 Include <sys/time.h> when checking for clock_t and struct tms.
13766 Use same include order as source.
13767 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
13768 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
13769
13770 * lib/timevar.c: Update copyright date and clarify comments.
13771 (get_time) [IN_GCC]: Keep the GCC version for reference.
13772
13773 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13774 GCC version as of today, then merge Bison's changes.
13775 Change "GCC" to "Bison" in copyright notice. timevar.def's
13776 author is Akim, so change that too.
13777
13778 * src/reader.c (grammar_current_rule_check):
13779 Don't worry about the default action if $$ is untyped.
13780 Prevents bogus warnings reported by Jim Gifford in
13781 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
13782
13783 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13784 * data/glr.c, data/lalr1.cc, data/yacc.c:
13785 Output token definitions before the first part of user declarations.
13786 Fixes compatibility problem reported by Jim Gifford for kbd in
13787 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
13788
13789 2002-10-11 Paul Eggert <eggert@twinsun.com>
13790
13791 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13792 (yyparse): here. This undoes some of the 2002-07-25 change.
13793 Compatibility problem reported by Ralf S. Engelschall with
13794 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13795
13796 2002-10-11 Akim Demaille <akim@epita.fr>
13797
13798 * tests/regression.at Characters Escapes): New.
13799 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13800 characters.
13801 Reported by Jan Nieuwenhuizen.
13802
13803 2002-10-11 Akim Demaille <akim@epita.fr>
13804
13805 * po/id.po: New.
13806
13807 2002-10-10 Paul Eggert <eggert@twinsun.com>
13808
13809 Portability fixes for bitsets; this also avoids several GCC
13810 warnings.
13811
13812 * lib/abitset.c: Include <stddef.h>, for offsetof.
13813 * lib/lbitset.c: Likewise.
13814
13815 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13816 properly for vectors of objects. Do not assume that adding a
13817 header size to a multiple of a word size yields a value that is
13818 properly aligned for the whole union.
13819 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13820
13821 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13822 unique names for structures.
13823 * lib/ebitset.c (ebitset_bytes): Likewise.
13824 * lib/lbitset.c (lbitset_bytes): Likewise.
13825
13826 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13827 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13828 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13829 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13830 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13831 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13832 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13833 to improve the type-checking that GCC can do.
13834 * lib/bitset.c (bitset_op4_cmp): Likewise.
13835 * lib/bitset_stats.c (bitset_stats_count,
13836 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13837 bitset_stats_copy, bitset_stats_disjoint_p,
13838 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13839 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13840 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13841 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13842 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13843 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13844 bitset_stats_or_and_cmp): Likewise.
13845 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13846 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13847 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13848 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13849
13850 * lib/abitset.h: Include bitset.h, not bbitset.h.
13851 * lib/ebitset.h: Likewise.
13852 * lib/lbitset.h: Likewise.
13853
13854 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13855 All instances of parameters of type enum bitset_opts are now of
13856 type enum_bitset_opts, to conform to the C Standard, and similarly
13857 for enum_bitset_type.
13858 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13859 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13860
13861 Do not use "struct bitset_struct" to mean different things in
13862 different modules. Not only is this confusing, it violates
13863 the C Standard, which requires that structure types in different
13864 modules must be compatible if one is to be passed to the other.
13865 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13866 All instances of "struct bitset_struct *" replaced with "bitset".
13867 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13868 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13869 struct lbitset_struct, struct bitset_stats_struct): New types.
13870 All uses of struct bitset_struct changed to union bitset_union,
13871 etc.
13872 * lib/abitset.c (struct abitset_struct, abitset,
13873 struct bitset_struct): Remove.
13874 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13875 struct bitset_struct): Remove.
13876 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13877 bitset_struct): Remove.
13878 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13879 Likewise.
13880
13881 Do not call a function of type T using a call that assumes the
13882 function is of a different type U. Standard C requires that a
13883 function must be called with a type that is compatible with its
13884 definition.
13885 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13886 New decls.
13887 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13888 New functions.
13889 * lib/ebitset.c (PFV): Remove.
13890 * lib/lbitset.c (PFV): Likewise.
13891 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13892 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13893 decls.
13894 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13895 (ebitset_vtable): Use them.
13896 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13897 lbitset_xor): New functions.
13898 (lbitset_vtable): Use them.
13899
13900 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13901 Declare.
13902
13903 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13904 GCC warning.
13905 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13906 Use offsetof, for simplicity.
13907
13908 2002-10-06 Paul Eggert <eggert@twinsun.com>
13909
13910 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13911 the same width as int. This reapplies a hunk of the 2002-08-12 patch
13912 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
13913 which was inadvertently undone by the 2002-09-30 patch.
13914 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13915 the same width as int.
13916
13917 2002-10-04 Paul Eggert <eggert@twinsun.com>
13918
13919 Version 1.50.
13920
13921 * configure.ac (AC_INIT), NEWS: Increment version number.
13922
13923 * doc/bison.texinfo: Minor spelling, grammar, and white space
13924 fixes.
13925 (Symbols): Mention that any negative value returned from yylex
13926 signifies end-of-input. Warn about negative chars. Mention
13927 the portable Standard C character set.
13928
13929 The GNU coding standard says CFLAGS and YFLAGS are reserved
13930 for the installer to set.
13931 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13932 * src/Makefile.am (AM_CFLAGS): Likewise.
13933 (AM_YFLAGS): Renamed from YFLAGS.
13934
13935 Fix some MAX and MIN problems.
13936 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13937 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13938 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13939 * src/reader.c (reader): Use it.
13940
13941 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13942 POSIX 1003.1-2001 has removed fgrep.
13943
13944 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13945
13946 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13947 interpreted as signed.
13948 * lib/ebitset.c (ebitset_list): Fix bug.
13949
13950 2002-10-01 Paul Eggert <eggert@twinsun.com>
13951
13952 More fixes for 64-bit hosts and large bitsets.
13953
13954 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13955 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13956 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13957 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13958 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13959 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13960 bitset_count_): Likewise.
13961 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13962 bitset_first, bitset_last): Likewise.
13963 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13964 bitset_stats_list_reverse, bitset_stats_size,
13965 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13966 Likewise.
13967 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13968 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13969 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13970 bitsetv_reflexive_transitive_closure): Likewise.
13971 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13972 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13973 Likewise.
13974 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13975 Likewise.
13976
13977 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13978 Use size_t, not unsigned int, to count bytes.
13979 * lib/abitset.h (abitset_bytes): Likewise.
13980 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13981 Likewise.
13982 * lib/bitset.h (bitset_bytes): Likewise.
13983 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13984 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13985 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13986 * lib/ebitset.c (ebitset_bytes): Likewise.
13987 * lib/ebitset.h (ebitset_bytes): Likewise.
13988 * lib/lbitset.c (lbitset_bytes): Likewise.
13989 * lib/lbitset.h (lbitset_bytes): Likewise.
13990
13991 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13992 abitset_subset_p, abitset_disjoint_p, abitset_and,
13993 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13994 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13995 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13996 abitset_or_and, abitset_or_and_cmp):
13997 Use bitset_windex instead of unsigned int.
13998 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13999 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
14000 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
14001 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
14002 Likewise.
14003 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
14004
14005 * lib/bitset.c (bitset_print):
14006 Use proper printf formats for widths of integer types.
14007 * lib/bitset_stats.c (bitset_percent_histogram_print,
14008 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
14009 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14010 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14011 * lib/lbitset.c (lbitset_bytes): Likewise.
14012
14013 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
14014 BITSET_SIZE_MAX): New macros.
14015 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
14016 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
14017 to BITSET_WINDEX_MAX.
14018
14019 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
14020 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
14021 since we now return the bitset_bindex type (not int).
14022
14023 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
14024 when computing sizes.
14025 * lib/ebitset.c (ebitset_elts_grow): Likewise.
14026
14027 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
14028 and avoid cast to unsigned.
14029
14030 2002-09-30 Akim Demaille <akim@epita.fr>
14031
14032 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14033 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
14034 Updates from Michael Hayes.
14035
14036 2002-09-30 Art Haas <ahaas@neosoft.com>
14037
14038 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
14039 invocations.
14040 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
14041 defined.
14042
14043 2002-09-27 Akim Demaille <akim@epita.fr>
14044
14045 Version 1.49c.
14046
14047 2002-09-27 Akim Demaille <akim@epita.fr>
14048
14049 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
14050 (Because of AC_LIBSOURCE).
14051
14052 2002-09-27 Akim Demaille <akim@epita.fr>
14053
14054 Playing with Autoscan.
14055
14056 * configure.ac: Remove the old LIBOBJ tweaks.
14057 (AC_REPLACE_FUNCS): Add strrchr and strtol.
14058 * lib/strrchr.c: New.
14059 * lib/strtol.c: New, from the Coreutils 4.5.1.
14060
14061 2002-09-27 Akim Demaille <akim@epita.fr>
14062
14063 Playing with Autoscan.
14064
14065 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
14066 * lib/Makefile.am (libbison_a_SOURCES): No longer include
14067 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
14068 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
14069 Coreutils 4.5.1.
14070
14071 2002-09-24 Akim Demaille <akim@epita.fr>
14072
14073 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
14074 (Frequently Asked Questions, Parser Stack Overflow): New.
14075
14076 2002-09-13 Akim Demaille <akim@epita.fr>
14077
14078 Playing with autoscan.
14079
14080 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
14081 * src/files.c (skeleton_find): Remove, unused.
14082 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
14083 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14084
14085 2002-09-13 Akim Demaille <akim@epita.fr>
14086
14087 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14088 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14089
14090 2002-09-13 Akim Demaille <akim@epita.fr>
14091
14092 * configure.ac: Require 2.54.
14093 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14094 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14095 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14096 Remove, provided by Autoconf macros.
14097
14098 2002-09-12 Akim Demaille <akim@epita.fr>
14099
14100 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14101
14102 2002-09-12 Akim Demaille <akim@epita.fr>
14103
14104 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14105 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14106 Reported by Martin Mokrejs.
14107
14108 2002-09-10 Akim Demaille <akim@epita.fr>
14109
14110 * src/parse-gram.y: Associate a human readable string to each
14111 token type.
14112 * tests/regression.at (Invalid inputs): Adjust.
14113
14114 2002-09-10 Gary V. Vaughan <gary@gnu.org>
14115
14116 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14117 with an Autoconf-2.5x style configure.ac.
14118
14119 2002-09-06 Paul Eggert <eggert@twinsun.com>
14120
14121 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14122 exception applies only to yacc.c. This is a modification of a
14123 patch originally suggested by Akim Demaille.
14124
14125 2002-09-06 Akim Demaille <akim@epita.fr>
14126
14127 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14128 here to...
14129 * data/yacc.c: here.
14130
14131 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14132 LocationType.
14133 (b4_ltype): Default to yy::Location from location.hh.
14134
14135 2002-09-04 Jim Meyering <jim@meyering.net>
14136
14137 * data/yacc.c: Guard the declaration of yytoknum also with
14138 `#ifdef YYPRINT', so it is declared only when used.
14139
14140 2002-09-04 Akim Demaille <akim@epita.fr>
14141
14142 * configure.in: Rename as...
14143 * configure.ac: this.
14144 Bump to 1.49c.
14145
14146 2002-09-04 Akim Demaille <akim@epita.fr>
14147
14148 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14149 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14150 translate maintainer only messages.
14151
14152 2002-08-12 Paul Eggert <eggert@twinsun.com>
14153
14154 Version 1.49b.
14155
14156 * Makefile.am (SUBDIRS): Remove intl.
14157 (DISTCLEANFILES): Remove.
14158 * NEWS: Mention that GNU M4 is now required. Clarify what is
14159 meant by "larger grammars". Mention the pt_BR translation.
14160 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14161 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14162 Bump version from 0.11.2 to 0.11.5.
14163 (BISON_PREREQ_STAGE): Remove.
14164 (AM_GNU_GETTEXT): Use external gettext.
14165 (AC_OUTPUT): Remove intl/Makefile.
14166
14167 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14168
14169 * data/glr.c: Include string.h, for strlen.
14170 (yyreportParseError): Use size_t for yysize.
14171 (yy_yypstack): No longer nested inside yypstates, as nested
14172 functions are not portable. Do not assume size_t is the
14173 same width as int.
14174 (yypstates): Do not assume that ptrdiff_t is the same width
14175 as int, and similarly for yyposn and YYINDEX.
14176
14177 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14178
14179 * lib/Makefile.am (INCLUDES): Do not include from the intl
14180 directory, which has been removed.
14181 * src/Makefile.am (INCLUDES): Likewise.
14182
14183 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14184 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14185 New vars.
14186
14187 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14188 * tests/Makefile.am (EXTRA_DIST): Likewise.
14189
14190 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14191 Do not assume that bitset_windex is the same width as unsigned.
14192
14193 * lib/abitset.c (abitset_unused_clear): Do not assume that
14194 bitset_word is the same width as int.
14195 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14196 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14197 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14198 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14199 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14200
14201 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14202 portability to one's complement hosts!).
14203 * lib/ebitset.c (ebitset_op1): Likewise.
14204 * lib/lbitset.c (lbitset_op1): Likewise.
14205
14206 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14207 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14208 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14209 Sync with fileutils.
14210 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14211 lib/gettext.h: Sync with diffutils.
14212
14213 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14214 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14215
14216 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14217 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14218 check for void *.
14219
14220 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14221 size_t; the old version tried to do this but casted improperly.
14222 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14223 (bitset_test): Now returns int, not unsigned long.
14224
14225 * lib/bitset_stats.c: Include "gettext.h".
14226 (_): New macro.
14227 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14228 name locals "index", as it generates unnecessary warnings on some
14229 hosts that have an "index" function.
14230
14231 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14232 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14233 they need translation.
14234 * src/LR0.c (state_list_append, new_itemsets, get_state,
14235 append_states, generate_states): Likewise.
14236 * src/assoc.c (assoc_to_string): Likewise.
14237 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14238 * src/gram.c (grammar_dump): Likewise.
14239 * src/injections.c (injections_compute): Likewise.
14240 * src/lalr.c (lookaheads_print): Likewise.
14241 * src/relation.c (relation_transpose): Likewise.
14242 * src/scan-gram.l: Likewise.
14243 * src/tables.c (table_grow, pack_vector): Likewise.
14244
14245 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14246 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14247 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14248 * m4/mbstate_t.m4: Sync with fileutils.
14249 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14250
14251 * po/LINGUAS: Add pt_BR.
14252 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14253 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14254 lib/timevar.c.
14255 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14256 manual recommends.
14257 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14258
14259 * src/complain.c (strerror_r): Remove decl; not needed.
14260 (strerror): Use same pattern as ../lib/error.c.
14261
14262 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14263
14264 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14265
14266 * src/main.c (main): Cast result of bindtextdomain and textdomain
14267 to void, to avoid a GCC warning when --disable-nls is in effect.
14268
14269 * src/scan-gram.l: Use strings rather than escapes when possible,
14270 to minimize the number of warnings from xgettext.
14271 (handle_action_dollar, handle_action_at): Don't use isdigit,
14272 as it mishandles negative chars and it may not work as expected
14273 outside the C locale.
14274
14275 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14276 this is a GCC extension and is not portable to other compilers.
14277
14278 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14279 Do not include <ctype.h>; no longer needed.
14280 Do not include <malloc.h>; no longer needed (and generates
14281 warnings on OpenBSD 3.0).
14282
14283 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14284 it's not portable.
14285
14286 * tests/regression.at: Do not use 'cc -c input.c -o input';
14287 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14288
14289 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14290 exit status as failure, not just exit status 1. Sun C exits
14291 with status 2 sometimes.
14292
14293 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14294 Use it for the two large tests.
14295
14296 2002-08-02 Akim Demaille <akim@epita.fr>
14297
14298 * src/conflicts.c (conflicts_output): Don't output rules never
14299 reduced here, since anyway that computation doesn't work.
14300 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14301 (rule_useless_p, rule_never_reduced_p): New.
14302 (grammar_rules_partial_print): Use a filter instead of a range.
14303 Display the title only if needed.
14304 (grammar_rules_print): Adjust.
14305 (grammar_rules_never_reduced_report): New.
14306 * src/tables.c (action_row): Move the computation of rules never
14307 reduced to...
14308 (token_actions): here.
14309 * src/main.c (main): Make the parser before making the report, so
14310 that rules never reduced are computed.
14311 Call grammar_rules_never_reduced_report.
14312 * src/print.c (print_results): Report rules never reduced.
14313 * tests/conflicts.at, tests/reduce.at: Adjust.
14314
14315 2002-08-01 Akim Demaille <akim@epita.fr>
14316
14317 Instead of attaching lookaheads and duplicating the rules being
14318 reduced by a state, attach the lookaheads to the reductions.
14319
14320 * src/state.h (state_t): Remove the `lookaheads',
14321 `lookaheads_rule' member.
14322 (reductions_t): Add a `lookaheads' member.
14323 Use a regular array for the `rules'.
14324 * src/state.c (reductions_new): Initialize the lookaheads member
14325 to 0.
14326 (state_rule_lookaheads_print): Adjust.
14327 * src/state.h, src/state.c (state_reductions_find): New.
14328 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14329 (count_rr_conflicts): Adjust.
14330 * src/lalr.c (LArule): Remove.
14331 (add_lookback_edge): Adjust.
14332 (state_lookaheads_count): New.
14333 (states_lookaheads_initialize): Merge into...
14334 (initialize_LA): this.
14335 (lalr_free): Adjust.
14336 * src/main.c (main): Don't free nullable and derives too early: it
14337 is used by --verbose.
14338 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14339
14340 2002-08-01 Akim Demaille <akim@epita.fr>
14341
14342 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14343 `rule_number_t**'.
14344 (set_derives, free_derives): Rename as...
14345 (derives_compute, derives_free): this.
14346 Adjust all dependencies.
14347 * src/nullable.c (set_nullable, free_nullable): Rename as...
14348 (nullable_compute, nullable_free): these.
14349 (rule_list_t): Store rule_t *, not rule_number_t.
14350 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14351 pointers, instead of their numbers.
14352 * src/main.c (main): Call nullable_free, and derives_free earlier,
14353 as they were lo longer used.
14354
14355 2002-08-01 Akim Demaille <akim@epita.fr>
14356
14357 * lib/timevar.c (get_time): Include children time.
14358 * src/lalr.h (LA, LArule): Don't export them: used with the
14359 state_t.
14360 * src/lalr.c (LA, LArule): Static.
14361 * src/lalr.h, src/lalr.c (lalr_free): New.
14362 * src/main.c (main): Call it.
14363 * src/tables.c (pack_vector): Check whether loc is >= to the
14364 table_size, not >.
14365 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14366 (tables_generate): do it, since that's also it which allocates
14367 them.
14368 Don't free LA and LArule, main does.
14369
14370 2002-07-31 Akim Demaille <akim@epita.fr>
14371
14372 Separate parser tables computation and output.
14373
14374 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14375 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14376 (yydefgoto, yydefact, high): Move to...
14377 * src/tables.h, src/tables.c: here.
14378 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14379 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14380 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14381 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14382 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14383 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14384 (action_row, save_row, token_actions, save_column, default_goto)
14385 (goto_actions, sort_actions, matching_state, pack_vector)
14386 (table_ninf_remap, pack_table, prepare_actions): Move to...
14387 * src/tables.c: here.
14388 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14389 * src/output.c (token_actions, output_base, output_conflicts)
14390 (output_check): Merge into...
14391 (prepare_actions): this.
14392 (actions_output): Rename as...
14393 (user_actions_output): this.
14394 * src/main.c (main): Call tables_generate and tables_free.
14395
14396 2002-07-31 Akim Demaille <akim@epita.fr>
14397
14398 Steal GCC's --time-report support.
14399
14400 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14401 stolen/adjusted from GCC.
14402 * m4/stage.m4: Remove time related checks.
14403 * m4/timevar.m4: New.
14404 * configure.in: Adjust.
14405 * src/system.h: Adjust to using timevar.h.
14406 * src/getargs.h, src/getargs.c: Support trace_time for
14407 --trace=time.
14408 * src/main.c (stage): Remove.
14409 (main): Replace `stage' invocations with timevar calls.
14410 * src/output.c: Insert pertinent timevar calls.
14411
14412 2002-07-31 Akim Demaille <akim@epita.fr>
14413
14414 Let --trace have arguments.
14415
14416 * src/getargs.h (enum trace_e): New.
14417 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14418 (long_options, short_options): --trace/-T takes an optional
14419 argument.
14420 Change all the uses of trace_flag to reflect the new flags.
14421 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14422
14423 Strengthen `stage' portability.
14424
14425 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14426 * configure.in: Use it.
14427 Don't check for malloc.h and sys/times.h.
14428 * src/system.h: Include them when appropriate.
14429 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14430 times and struct tms are available.
14431
14432 2002-07-30 Akim Demaille <akim@epita.fr>
14433
14434 In verbose parse error message, don't report `error' as an
14435 expected token.
14436 * tests/actions.at (Printers and Destructors): Adjust.
14437 * tests/calc.at (Calculator $1): Adjust.
14438 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14439 error message, do not report the parser accepts the error token in
14440 that state.
14441
14442 2002-07-30 Akim Demaille <akim@epita.fr>
14443
14444 Normalize conflict related messages.
14445
14446 * src/complain.h, src/complain.c (warn, complain): New.
14447 * src/conflicts.c (conflicts_print): Use them.
14448 (conflict_report_yacc): New, extracted from...
14449 (conflicts_print): here.
14450 * tests/conflicts.at, tests/existing.at: Adjust.
14451
14452 2002-07-30 Akim Demaille <akim@epita.fr>
14453
14454 Report rules which are never reduced by the parser: those hidden
14455 by conflicts.
14456
14457 * src/LR0.c (save_reductions): Don't make the final state too
14458 different: save its reduction (accept) instead of having a state
14459 without any action (no shift or goto, no reduce).
14460 Note: the final state is now a ``regular'' state, i.e., the
14461 parsers now contain `reduce 0' as default reduction.
14462 Nevertheless, since they decide to `accept' when yystate =
14463 final_state, they still will not reduce rule 0.
14464 * src/print.c (print_actions, print_reduction): Adjust.
14465 * src/output.c (action_row): Track reduced rules.
14466 (token_actions): Report rules never reduced.
14467 * tests/conflicts.at, tests/regression.at: Adjust.
14468
14469 2002-07-30 Akim Demaille <akim@epita.fr>
14470
14471 `stage' was accidently included in a previous patch.
14472 Initiate its autoconfiscation.
14473
14474 * configure.in: Look for malloc.h and sys/times.h.
14475 * src/main.c (stage): Adjust.
14476 Report only when trace_flag.
14477
14478 2002-07-29 Akim Demaille <akim@epita.fr>
14479
14480 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14481 state_number_t.
14482 (errs_t): symbol_t*, not symbol_number_t.
14483 (reductions_t): rule_t*, not rule_number_t.
14484 (FOR_EACH_SHIFT): New.
14485 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14486 * src/print.c, src/print_graph.c: Adjust.
14487
14488 2002-07-29 Akim Demaille <akim@epita.fr>
14489
14490 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14491
14492 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14493 (endtoken, accept): these.
14494 * src/reader.c (reader): Set endtoken's default tag to "$end".
14495 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14496 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14497 Adjust.
14498
14499 2002-07-29 Akim Demaille <akim@epita.fr>
14500
14501 * src/reduce.c (reduce_grammar): When the language is empty,
14502 complain about the start symbol, not the axiom.
14503 Use its location.
14504 * tests/reduce.at (Empty Language): New.
14505
14506 2002-07-26 Akim Demaille <akim@epita.fr>
14507
14508 * src/reader.h, src/reader.c (gram_error): ... can't get
14509 yycontrol without making too strong assumptions on the parser
14510 itself.
14511 * src/output.c (prepare_tokens): Use the real 0th value of
14512 token_translations instead of `0'.
14513 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14514 visible here.
14515 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14516 for the time being: %locations ought to provide it to yyerror.
14517
14518 2002-07-25 Akim Demaille <akim@epita.fr>
14519
14520 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14521 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14522 * tests/regression.at (Web2c Actions): Adjust.
14523
14524 2002-07-25 Akim Demaille <akim@epita.fr>
14525
14526 Stop storing rules from 1 to nrules + 1.
14527
14528 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14529 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14530 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14531 Iterate from 0 to nrules.
14532 Use rule_number_as_item_number and item_number_as_rule_number.
14533 Adjust to `derive' now containing possibly 0.
14534 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14535 Handle the `- 1' part in rule numbers from/to item numbers.
14536 * src/conflicts.c (log_resolution): Fix the message which reversed
14537 shift and reduce.
14538 * src/output.c (action_row): Initialize default_rule to -1.
14539 (token_actions): Adjust.
14540 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14541 expected output.
14542 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14543
14544 2002-07-25 Akim Demaille <akim@epita.fr>
14545
14546 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14547 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14548 (b4_c_knr_arg_decl): New.
14549 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14550 yyreport_parse_error.
14551
14552 2002-07-25 Akim Demaille <akim@epita.fr>
14553
14554 * data/yacc.c (yyreport_parse_error): New, extracted from...
14555 (yyparse): here.
14556 (yydestruct, yysymprint): Move above yyparse.
14557 Be K&R compliant.
14558
14559 2002-07-25 Akim Demaille <akim@epita.fr>
14560
14561 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14562 replace...
14563 (b4_sint_type, b4_uint_type): these.
14564 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14565 * tests/regression.at (Web2c Actions): Adjust.
14566
14567 2002-07-25 Akim Demaille <akim@epita.fr>
14568
14569 * src/gram.h (TIEM_NUMBER_MAX): New.
14570 (item_number_of_rule_number, rule_number_of_item_number): Rename
14571 as...
14572 (rule_number_as_item_number, item_number_as_rule_number): these.
14573 Adjust dependencies.
14574 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14575 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14576 (symbol_number_to_vector_number): New.
14577 (order): Of vector_number_t* type.
14578 (base_t, BASE_MAX, BASE_MIN): New.
14579 (froms, tos, width, pos, check): Of base_t type.
14580 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14581 (actrow): Of action_number_t type.
14582 (conflrow): Of unsigned int type.
14583 (table_ninf, base_ninf): New.
14584 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14585 (muscle_insert_int_table, muscle_insert_base_table)
14586 (muscle_insert_rule_number_table): New.
14587 (prepare_tokens): Output `toknum' as int_table.
14588 (action_row): Returns a rule_number_t.
14589 Use ACTION_MIN, not SHRT_MIN.
14590 (token_actions): yydefact is rule_number_t*.
14591 (table_ninf_remap): New.
14592 (pack_table): Use it for `base' and `table'.
14593 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14594 replaced with...
14595 (YYPACT_NINF, YYTABLE_NINF): these.
14596 (yypact, yytable): Compute their types instead of hard-coded
14597 `short'.
14598 * tests/regression.at (Web2c Actions): Adjust.
14599
14600 2002-07-19 Akim Demaille <akim@epita.fr>
14601
14602 * src/scan-gram.l (id): Can start with an underscore.
14603
14604 2002-07-16 Akim Demaille <akim@epita.fr>
14605
14606 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14607 Adjust all former `associativity' dependencies.
14608 * src/symtab.c (symbol_new): Default associativity is `undef', not
14609 `right'.
14610 (symbol_check_alias_consistence): Adjust.
14611
14612 2002-07-09 Akim Demaille <akim@epita.fr>
14613
14614 * doc/bison.texinfo: Properly set the ``header'' part.
14615 Use @dircategory ``GNU programming tools'' as per Texinfo's
14616 documentation.
14617 Use @copying.
14618
14619 2002-07-09 Akim Demaille <akim@epita.fr>
14620
14621 * lib/quotearg.h: Protect against multiple inclusions.
14622 * src/location.h (location_t): Add a `file' member.
14623 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14624 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14625 `error_one_per_line' support.
14626
14627 2002-07-09 Akim Demaille <akim@epita.fr>
14628
14629 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14630 * src/reader.c (lineno): Remove.
14631 Adjust all dependencies.
14632 (get_merge_function): Take a location and use complain_at.
14633 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14634 * tests/regression.at (Invalid inputs, Mixing %token styles):
14635 Adjust.
14636
14637 2002-07-09 Akim Demaille <akim@epita.fr>
14638
14639 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14640 recovery rule, and forbid extensions when --yacc.
14641 (gram_error): Use complain_at.
14642 * src/reader.c (reader): Exit if there were parse errors.
14643
14644 2002-07-09 Akim Demaille <akim@epita.fr>
14645
14646 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14647 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14648 Reported by R Blake <blakers@mac.com>.
14649
14650 2002-07-09 Akim Demaille <akim@epita.fr>
14651
14652 * data/yacc.c: Output the copyright notive in the header.
14653
14654 2002-07-03 Akim Demaille <akim@epita.fr>
14655
14656 * src/output.c (froms, tos): Are state_number_t.
14657 (save_column): sp, sp1, and sp2 are state_number_t.
14658 (prepare): Rename `final' as `final_state_number', `nnts' as
14659 `nterms_number', `nrules' as `rules_number', `nstates' as
14660 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14661 unused.
14662 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14663 * data/lalr1.cc (nsym_): Remove, unused.
14664
14665 2002-07-03 Akim Demaille <akim@epita.fr>
14666
14667 * src/lalr.h, src/lalr.c (goto_number_t): New.
14668 * src/lalr.c (goto_list_t): New.
14669 Propagate them.
14670 * src/nullable.c (rule_list_t): New.
14671 Propagate.
14672 * src/types.h: Remove.
14673
14674 2002-07-03 Akim Demaille <akim@epita.fr>
14675
14676 * src/closure.c (print_fderives): Use rule_rhs_print.
14677 * src/derives.c (print_derives): Use rule_rhs_print.
14678 (rule_list_t): New, replaces `shorts'.
14679 (set_derives): Add comments.
14680 * tests/sets.at (Nullable, Firsts): Adjust.
14681
14682 2002-07-03 Akim Demaille <akim@epita.fr>
14683
14684 * src/output.c (prepare_actions): Free `tally' and `width'.
14685 (prepare_actions): Allocate and free `order'.
14686 * src/symtab.c (symbols_free): Free `symbols'.
14687 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14688 * src/output.c (m4_invoke): Move to...
14689 * src/scan-skel.l: here.
14690 (<<EOF>>): Close yyout, and free its name.
14691
14692 2002-07-03 Akim Demaille <akim@epita.fr>
14693
14694 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14695
14696 * src/LR0.c (new_state): Merge into...
14697 (state_list_append): this.
14698 (new_states): Merge into...
14699 (generate_states): here.
14700 (set_states): Don't ensure a proper `errs' state member here, do it...
14701 * src/conflicts.c (conflicts_solve): here.
14702 * src/state.h, src/state.c: Comment changes.
14703 (state_t): Rename member `shifts' as `transitions'.
14704 Adjust all dependencies.
14705 (errs_new): For consistency, also take the values as argument.
14706 (errs_dup): Remove.
14707 (state_errs_set): New.
14708 (state_reductions_set, state_transitions_set): Assert that no
14709 previous value was assigned.
14710 (state_free): New.
14711 (states_free): Use it.
14712 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14713 temporary storage: use `errs' and `nerrs' as elsewhere.
14714 (set_conflicts): Allocate and free this `errs'.
14715
14716 2002-07-02 Akim Demaille <akim@epita.fr>
14717
14718 * lib/libiberty.h: New.
14719 * lib: Update the bitset implementation from upstream.
14720 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14721 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14722 * src/main.c: Adjust bitset stats calls.
14723
14724 2002-07-01 Paul Eggert <eggert@twinsun.com>
14725
14726 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14727 char, so that negative chars don't collide with $.
14728
14729 2002-06-30 Akim Demaille <akim@epita.fr>
14730
14731 Have the GLR tests be `warning' checked, and fix the warnings.
14732
14733 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14734 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14735 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14736 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14737 (yyaddDeferredAction): static.
14738 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14739 (yyreportParseError): yyprefix is const.
14740 yytokenp is used only when verbose.
14741 (yy__GNUC__): Replace with __GNUC__.
14742 (yypdumpstack): yyi is size_t.
14743 (yypreference): Un-yy local variables and arguments, to avoid
14744 clashes with `yyr1'. Anyway, we are not in the user name space.
14745 (yytname_size): be an int, as is compared with ints.
14746 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14747 Use them.
14748 * tests/cxx-gram.at: Use quotation to protect $1.
14749 Use AT_COMPILE to enable warnings hunts.
14750 Prototype yylex and yyerror.
14751 `Use' argc.
14752 Include `string.h', not `strings.h'.
14753 Produce and prototype stmtMerge only when used.
14754 yylex takes a location.
14755
14756 2002-06-30 Akim Demaille <akim@epita.fr>
14757
14758 We spend a lot of time in quotearg, in particular when --verbose.
14759
14760 * src/symtab.c (symbol_get): Store a quoted version of the key.
14761 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14762 Adjust all callers.
14763
14764 2002-06-30 Akim Demaille <akim@epita.fr>
14765
14766 * src/state.h (reductions_t): Rename member `nreds' as num.
14767 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14768 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14769
14770 2002-06-30 Akim Demaille <akim@epita.fr>
14771
14772 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14773 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14774 (shifts_to): Rename as...
14775 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14776 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14777 (TRANSITION_IS_DISABLED, transitions_to): these.
14778
14779 2002-06-30 Akim Demaille <akim@epita.fr>
14780
14781 * src/print.c (print_shifts, print_gotos): Merge into...
14782 (print_transitions): this.
14783 (print_transitions, print_errs, print_reductions): Align the
14784 lookaheads columns.
14785 (print_core, print_transitions, print_errs, print_state,
14786 print_grammar): Output empty lines separator before, not after.
14787 (state_default_rule_compute): Rename as...
14788 (state_default_rule): this.
14789 * tests/conflicts.at (Defaulted Conflicted Reduction),
14790 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14791 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14792
14793 2002-06-30 Akim Demaille <akim@epita.fr>
14794
14795 Display items as we display rules.
14796
14797 * src/gram.h, src/gram.c (rule_lhs_print): New.
14798 * src/gram.c (grammar_rules_partial_print): Use it.
14799 * src/print.c (print_core): Likewise.
14800 * tests/conflicts.at (Defaulted Conflicted Reduction),
14801 (Unresolved SR Conflicts): Adjust.
14802 (Unresolved SR Conflicts): Adjust and rename as...
14803 (Resolved SR Conflicts): this, as was meant.
14804 * tests/regression.at (Web2c Report): Adjust.
14805
14806 2002-06-30 Akim Demaille <akim@epita.fr>
14807
14808 * src/print.c (state_default_rule_compute): New, extracted from...
14809 (print_reductions): here.
14810 Pessimize, but clarify the code.
14811 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14812
14813 2002-06-30 Akim Demaille <akim@epita.fr>
14814
14815 * src/output.c (action_row): Let default_rule be always a rule
14816 number.
14817
14818 2002-06-30 Akim Demaille <akim@epita.fr>
14819
14820 * src/closure.c (print_firsts, print_fderives, closure):
14821 Use BITSET_EXECUTE.
14822 * src/lalr.c (lookaheads_print): Likewise.
14823 * src/state.c (state_rule_lookaheads_print): Likewise.
14824 * src/print_graph.c (print_core): Likewise.
14825 * src/print.c (print_reductions): Likewise.
14826 * src/output.c (action_row): Likewise.
14827 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14828
14829 2002-06-30 Akim Demaille <akim@epita.fr>
14830
14831 * src/print_graph.c: Use report_flag.
14832
14833 2002-06-30 Akim Demaille <akim@epita.fr>
14834
14835 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14836 to...
14837 * src/relation.h, src/relation.c (traverse, relation_digraph)
14838 (relation_print, relation_transpose): New.
14839
14840 2002-06-30 Akim Demaille <akim@epita.fr>
14841
14842 * src/state.h, src/state.c (shifts_to): New.
14843 * src/lalr.c (build_relations): Use it.
14844
14845 2002-06-30 Akim Demaille <akim@epita.fr>
14846
14847 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14848 (item_number_of_rule_number, rule_number_of_item_number): New.
14849 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14850 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14851 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14852 Propagate their use.
14853 Much remains to be done, in particular wrt `shorts' from types.h.
14854
14855 2002-06-30 Akim Demaille <akim@epita.fr>
14856
14857 * src/symtab.c (symbol_new): Initialize the `printer' member.
14858
14859 2002-06-30 Akim Demaille <akim@epita.fr>
14860
14861 * src/LR0.c (save_reductions): Remove, replaced by...
14862 * src/state.h, src/state.c (state_reductions_set): New.
14863 (reductions, errs): Rename as...
14864 (reductions_t, errs_t): these.
14865 Adjust all dependencies.
14866
14867 2002-06-30 Akim Demaille <akim@epita.fr>
14868
14869 * src/LR0.c (state_list_t, state_list_append): New.
14870 (first_state, last_state): Now symbol_list_t.
14871 (this_state): Remove.
14872 (new_itemsets, append_states, save_reductions): Take a state_t as
14873 argument.
14874 (set_states, generate_states): Adjust.
14875 (save_shifts): Remove, replaced by...
14876 * src/state.h, src/state.c (state_shifts_set): New.
14877 (shifts): Rename as...
14878 (shifts_t): this.
14879 Adjust all dependencies.
14880 * src/state.h (state_t): Remove the `next' member.
14881
14882 2002-06-30 Akim Demaille <akim@epita.fr>
14883
14884 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14885 escaped in slot 0.
14886
14887 2002-06-30 Akim Demaille <akim@epita.fr>
14888
14889 Use hash.h for the state hash table.
14890
14891 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14892 (allocate_storage): Use state_hash_new.
14893 (free_storage): Use state_hash_free.
14894 (new_state, get_state): Adjust.
14895 * src/lalr.h, src/lalr.c (states): Move to...
14896 * src/states.h (state_t): Remove the `link' member, no longer
14897 used.
14898 * src/states.h, src/states.c: here.
14899 (state_hash_new, state_hash_free, state_hash_lookup)
14900 (state_hash_insert, states_free): New.
14901 * src/states.c (state_table, state_compare, state_hash): New.
14902 * src/output.c (output_actions): Do not free states now, since we
14903 still need to know the final_state number in `prepare', called
14904 afterwards. Do it...
14905 * src/main.c (main): here: call states_free after `output'.
14906
14907 2002-06-30 Akim Demaille <akim@epita.fr>
14908
14909 * src/state.h, src/state.c (state_new): New, extracted from...
14910 * src/LR0.c (new_state): here.
14911 * src/state.h (STATE_ALLOC): Move to...
14912 * src/state.c: here.
14913 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14914 * src/state.h, src/state.c: here.
14915
14916 2002-06-30 Akim Demaille <akim@epita.fr>
14917
14918 * src/reader.c (gensym): Rename as...
14919 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14920 (getsym): Rename as...
14921 (symbol_get): this.
14922
14923 2002-06-30 Akim Demaille <akim@epita.fr>
14924
14925 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14926 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14927 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14928 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14929
14930 2002-06-30 Akim Demaille <akim@epita.fr>
14931
14932 Make the test suite pass with warnings checked.
14933
14934 * tests/actions.at (Printers and Destructors): Improve.
14935 Avoid unsigned vs. signed issues.
14936 * tests/calc.at: Don't exercise the scanner here, do it...
14937 * tests/input.at (Torturing the Scanner): here.
14938
14939 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14940
14941 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
14942 reorganize first lines parallel to yacc.c.
14943
14944 2002-06-28 Akim Demaille <akim@epita.fr>
14945
14946 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14947 (b4_token_enum, b4_token_defines): New, factored from...
14948 * data/lalr1.cc, data/yacc.c, glr.c: here.
14949
14950 2002-06-28 Akim Demaille <akim@epita.fr>
14951
14952 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14953 unused variables.
14954 * src/output.c (merger_output): static.
14955
14956 2002-06-28 Akim Demaille <akim@epita.fr>
14957
14958 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
14959 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14960 pacify GCC.
14961 * src/output.c (save_row): Initialize all the variables to pacify GCC.
14962
14963 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14964
14965 Accumulated changelog for new GLR parsing features.
14966
14967 * src/conflicts.c (count_total_conflicts): Change name to
14968 conflicts_total_count.
14969 * src/conflicts.h: Ditto.
14970 * src/output.c (token_actions): Use the new name.
14971 (output_conflicts): Change conflp => conflict_list_heads, and
14972 confl => conflict_list for better readability.
14973 * data/glr.c: Use the new names.
14974 * NEWS: Add self to GLR announcement.
14975
14976 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14977
14978 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14979 Akim Demaille.
14980
14981 * data/bison.glr: Change name to glr.c
14982 * data/glr.c: Renamed from bison.glr.
14983 * data/Makefile.am: Add glr.c
14984
14985 * src/getargs.c:
14986
14987 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
14988 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
14989
14990 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14991
14992 * data/bison.glr: Be sure to restore the
14993 current #line when returning to the skeleton contents after having
14994 exposed the input file's #line.
14995
14996 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14997
14998 * data/bison.glr: Bring up to date with changes to bison.simple.
14999
15000 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15001
15002 * data/bison.glr: Correct definitions that use b4_prefix.
15003 Various reformatting.
15004 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
15005 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
15006 yytokenp argument; now part of stack.
15007 (yychar): Define to behave as documented.
15008 (yyclearin): Ditto.
15009
15010 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15011
15012 * src/reader.h: Add declaration for free_merger_functions.
15013
15014 * src/reader.c (merge_functions): New variable.
15015 (get_merge_function): New function.
15016 (free_merger_functions): New function.
15017 (readgram): Check for %prec that is not followed by a symbol.
15018 Handle %dprec and %merge declarations.
15019 (packgram): Initialize dprec and merger fields in rules array.
15020
15021 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
15022 conflict_list_cnt, conflict_list_free): New variables.
15023 (table_grow): Also grow conflict_table.
15024 (prepare_rules): Output dprec and merger tables.
15025 (conflict_row): New function.
15026 (action_row): Output conflict lists for GLR parser. Don't use
15027 default reduction in conflicted states for GLR parser so that there
15028 are spaces for the conflict lists.
15029 (save_row): Also save conflict information.
15030 (token_actions): Allocate conflict list.
15031 (merger_output): New function.
15032 (pack_vector): Pack conflict table, too.
15033 (output_conflicts): New function to output yyconflp and yyconfl.
15034 (output_check): Allocate conflict_tos.
15035 (output_actions): Output conflict tables, also.
15036 (output_skeleton): Output b4_mergers definition.
15037 (prepare): Output b4_max_rhs_length definition.
15038 Use 'bison.glr' as default skeleton for GLR parsers.
15039
15040 * src/gram.c (glr_parser): New flag.
15041 (grammar_free): Call free_merger_functions.
15042
15043 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
15044 all pairs of conflicting reductions, rather than just all tokens
15045 causing conflicts. Needed to size conflict tables.
15046 (conflicts_output): Modify call to count_rr_conflicts for new
15047 interface.
15048 (conflicts_print): Ditto.
15049 (count_total_conflicts): New function.
15050
15051 * src/reader.h (merger_list): New type.
15052 (merge_functions): New variable.
15053
15054 * src/lex.h (tok_dprec, tok_merge): New token types.
15055
15056 * src/gram.h (rule_s): Add dprec and merger fields.
15057 (glr_parser): New flag.
15058
15059 * src/conflicts.h (count_total_conflicts): New function.
15060
15061 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
15062
15063 * doc/bison.texinfo (Generalized LR Parsing): New section.
15064 (GLR Parsers): New section.
15065 (Language and Grammar): Mention GLR parsing.
15066 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
15067 Correct typo ("tge" -> "the").
15068
15069 * data/bison.glr: New skeleton for GLR parsing.
15070
15071 * tests/cxx-gram.at: New tests for GLR parsing.
15072
15073 * tests/testsuite.at: Include cxx-gram.at.
15074
15075 * tests/Makefile.am: Add cxx-gram.at.
15076
15077 * src/parse-gram.y:
15078
15079 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
15080
15081 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
15082
15083 2002-06-27 Akim Demaille <akim@epita.fr>
15084
15085 * src/options.h, src/options.c: Remove.
15086 * src/getargs.c (short_options, long_options): New.
15087
15088 2002-06-27 Akim Demaille <akim@epita.fr>
15089
15090 * data/bison.simple, data/bison.c++: Rename as...
15091 * data/yacc.c, data/lalr1.cc: these.
15092 * doc/bison.texinfo (Environment Variables): Remove.
15093
15094 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15095
15096 * src/getargs.c (report_argmatch): Initialize strtok().
15097
15098 2002-06-20 Akim Demaille <akim@epita.fr>
15099
15100 * data/bison.simple (b4_symbol_actions): New, replaces...
15101 (b4_symbol_destructor, b4_symbol_printer): these.
15102 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15103 user token numbers.
15104
15105 2002-06-20 Akim Demaille <akim@epita.fr>
15106
15107 * data/bison.simple (yydestructor): Rename as...
15108 (yydestruct): this.
15109
15110 2002-06-20 Akim Demaille <akim@epita.fr>
15111
15112 * src/symtab.h, src/symtab.c (symbol_type_set)
15113 (symbol_destructor_set, symbol_precedence_set): The location is
15114 the last argument.
15115 Adjust all callers.
15116
15117 2002-06-20 Akim Demaille <akim@epita.fr>
15118
15119 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15120 internals.
15121 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15122 Takes a location.
15123 * src/symtab.h, src/symtab.c (symbol_class_set)
15124 (symbol_user_token_number_set): Likewise.
15125 Adjust all callers.
15126 Promote complain_at.
15127 * tests/input.at (Type Clashes): Adjust.
15128
15129 2002-06-20 Akim Demaille <akim@epita.fr>
15130
15131 * data/bison.simple (YYLEX): Fix the declaration when
15132 %pure-parser.
15133
15134 2002-06-20 Akim Demaille <akim@epita.fr>
15135
15136 * data/bison.simple (yysymprint): Don't print the token number,
15137 just its name.
15138 * tests/actions.at (Destructors): Rename as...
15139 (Printers and Destructors): this.
15140 Also exercise %printer.
15141
15142 2002-06-20 Akim Demaille <akim@epita.fr>
15143
15144 * data/bison.simple (YYDSYMPRINT): New.
15145 Use it to remove many of the #if YYDEBUG/if (yydebug).
15146
15147 2002-06-20 Akim Demaille <akim@epita.fr>
15148
15149 * src/symtab.h, src/symtab.c (symbol_t): printer and
15150 printer_location are new members.
15151 (symbol_printer_set): New.
15152 * src/parse-gram.y (PERCENT_PRINTER): New token.
15153 Handle its associated rule.
15154 * src/scan-gram.l: Adjust.
15155 (handle_destructor_at, handle_destructor_dollar): Rename as...
15156 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15157 * src/output.c (symbol_printers_output): New.
15158 (output_skeleton): Call it.
15159 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15160 since there are already many grammar files with a user `yyprint'.
15161 Replace the calls to YYPRINT to calls to yysymprint.
15162 * tests/calc.at: Adjust.
15163 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15164 taking advantage of parser very internal details (stack size!).
15165
15166 2002-06-20 Akim Demaille <akim@epita.fr>
15167
15168 * src/scan-gram.l: Complete the scanner with the missing patterns
15169 to pacify Flex.
15170 Use `quote' and `symbol_tag_get' where appropriate.
15171
15172 2002-06-19 Akim Demaille <akim@epita.fr>
15173
15174 * tests/actions.at (Destructors): Augment to test locations.
15175 * data/bison.simple (yydestructor): Pass it the current location
15176 if locations are enabled.
15177 Prototype only when __STDC__ or C++.
15178 Change the argument names to move into the yy name space: there is
15179 user code here.
15180
15181 2002-06-19 Akim Demaille <akim@epita.fr>
15182
15183 * data/bison.simple (b4_pure_if): New.
15184 Use it instead of #ifdef YYPURE.
15185
15186 2002-06-19 Akim Demaille <akim@epita.fr>
15187
15188 * data/bison.simple (b4_location_if): New.
15189 Use it instead of #ifdef YYLSP_NEEDED.
15190
15191 2002-06-19 Akim Demaille <akim@epita.fr>
15192
15193 Prepare @$ in %destructor, but currently don't bind it in the
15194 skeleton, as %location use is not cleaned up yet.
15195
15196 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15197 (handle_action_at): New.
15198 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15199 a braced_code_t and a location as additional arguments.
15200 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15201 unquote one when outputting `b4_dollar_dollar'.
15202 Adjust callers.
15203 * data/bison.simple (b4_eval): Remove.
15204 (b4_symbol_destructor): Adjust.
15205 * tests/input.at (Invalid @n): Adjust.
15206
15207 2002-06-19 Zack Weinberg <zack@codesourcery.com>
15208
15209 * doc/bison.texinfo: Document ability to have multiple
15210 prologue sections.
15211
15212 2002-06-18 Akim Demaille <akim@epita.fr>
15213
15214 * src/files.c (compute_base_names): When computing the output file
15215 names from the input file name, strip the directory part.
15216
15217 2002-06-18 Akim Demaille <akim@epita.fr>
15218
15219 * data/bison.simple.new: Comment changes.
15220 Reported by Andreas Schwab.
15221
15222 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15223
15224 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15225 there are no `label `yyoverflowlab' defined but not used' warnings
15226 when yyoverflow is defined.
15227
15228 2002-06-18 Akim Demaille <akim@epita.fr>
15229
15230 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15231 new member.
15232 (symbol_destructor_set): Adjust.
15233 * src/output.c (symbol_destructors_output): Output the destructor
15234 locations.
15235 Output the symbol name.
15236 * data/bison.simple (b4_symbol_destructor): Adjust.
15237
15238 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15239 and Akim Demaille <akim@epita.fr>
15240
15241 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15242 what's left on the stack when the error recovery hits EOF.
15243 * tests/actions.at (Destructors): Complete to exercise this case.
15244
15245 2002-06-17 Akim Demaille <akim@epita.fr>
15246
15247 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15248 arguments is really empty, not only equal to `[]'.
15249 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15250 member.
15251 (symbol_destructor_set): New.
15252 * src/output.c (symbol_destructors_output): New.
15253 * src/reader.h (brace_code_t, current_braced_code): New.
15254 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15255 (handle_dollar): Rename as...
15256 (handle_action_dollar): this.
15257 (handle_destructor_dollar): New.
15258 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15259 (grammar_declaration): Use it.
15260 * data/bison.simple (yystos): Is always defined.
15261 (yydestructor): New.
15262 * tests/actions.at (Destructors): New.
15263 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15264
15265 2002-06-17 Akim Demaille <akim@epita.fr>
15266
15267 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15268 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15269 rule_length only when needed.
15270 * src/output.c (actions_output, token_definitions_output): Output
15271 the full M4 block.
15272 * src/symtab.c: Don't access directly to the symbol tag, use
15273 symbol_tag_get.
15274 * src/parse-gram.y: Use symbol_list_free.
15275
15276 2002-06-17 Akim Demaille <akim@epita.fr>
15277
15278 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15279 (symbol_list_prepend, get_type_name): Move to...
15280 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15281 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15282 Adjust all callers.
15283 (symbol_list_free): New.
15284 * src/scan-gram.l (handle_dollar): Takes a location.
15285 * tests/input.at (Invalid $n): Adjust.
15286
15287 2002-06-17 Akim Demaille <akim@epita.fr>
15288
15289 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15290 (symbol_list_prepend): New.
15291 * src/parse-gram.y (%union): `list' is a new member.
15292 (symbols.1): New, replaces...
15293 (terms_to_prec.1, nterms_to_type.1): these.
15294 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15295 Take a location as additional argument.
15296 Adjust all callers.
15297
15298 2002-06-15 Akim Demaille <akim@epita.fr>
15299
15300 * src/parse-gram.y: Move %token in the declaration section so that
15301 we don't depend upon CVS Bison.
15302
15303 2002-06-15 Akim Demaille <akim@epita.fr>
15304
15305 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15306 * src/print.c (print_core): Use it.
15307
15308 2002-06-15 Akim Demaille <akim@epita.fr>
15309
15310 * src/conflicts.c (log_resolution): Accept the rule involved in
15311 the sr conflicts instead of the lookahead number that points to
15312 that rule.
15313 (flush_reduce): Accept the current lookahead vector as argument,
15314 instead of the index in LA.
15315 (resolve_sr_conflict): Accept the current number of lookahead
15316 bitset to consider for the STATE, instead of the index in LA.
15317 (set_conflicts): Adjust.
15318 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15319
15320 2002-06-15 Akim Demaille <akim@epita.fr>
15321
15322 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15323 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15324 Adjust all dependencies.
15325 * src/lalr.c (initialize_lookaheads): Split into...
15326 (states_lookaheads_count, states_lookaheads_initialize): these.
15327 (lalr): Adjust.
15328
15329 2002-06-15 Akim Demaille <akim@epita.fr>
15330
15331 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15332 out of...
15333 (grammar_rules_print): here.
15334 * src/reduce.c (reduce_output): Use it.
15335 * tests/reduce.at (Useless Rules, Reduced Automaton)
15336 (Underivable Rules): Adjust.
15337
15338 2002-06-15 Akim Demaille <akim@epita.fr>
15339
15340 Copy BYacc's nice way to report the grammar.
15341
15342 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15343 New.
15344 Don't print the rules' location, it is confusing and useless.
15345 (rule_print): Use grammar_rhs_print.
15346 * src/print.c (print_grammar): Use grammar_rules_print.
15347
15348 2002-06-15 Akim Demaille <akim@epita.fr>
15349
15350 Complete and rationalize `useless thing' warnings.
15351
15352 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15353 (symbol_tag_print): New.
15354 Use them everywhere in place of accessing directly the tag member.
15355 * src/gram.h, src/gram.c (rule_print): New.
15356 Use it where a rule used to be printed `by hand'.
15357 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15358 (reduce_grammar_tables): Report the useless rules.
15359 (reduce_print): Useless things are a warning, not an error.
15360 Report it as such.
15361 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15362 (Reduced Automaton, Underivable Rules): Adjust.
15363 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15364 * tests/conflicts.at (Unresolved SR Conflicts)
15365 (Solved SR Conflicts): Adjust.
15366
15367 2002-06-15 Akim Demaille <akim@epita.fr>
15368
15369 Let symbols have a location.
15370
15371 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15372 (getsym): Adjust.
15373 Adjust all callers.
15374 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15375 Use location_t, not int.
15376 * src/symtab.c (symbol_check_defined): Take advantage of the
15377 location.
15378 * tests/regression.at (Invalid inputs): Adjust.
15379
15380 2002-06-15 Akim Demaille <akim@epita.fr>
15381
15382 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15383 (input): Don't try to initialize yylloc here, do it in the
15384 scanner.
15385 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15386 * src/gram.h (rule_t): Change line and action_line into location
15387 and action_location, of location_t type.
15388 Adjust all dependencies.
15389 * src/location.h, src/location.c (empty_location): New.
15390 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15391 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15392 (grammar_current_rule_symbol_append)
15393 (grammar_current_rule_action_append): Expect a location as argument.
15394 * src/reader.c (grammar_midrule_action): Adjust to attach an
15395 action's location as dummy symbol location.
15396 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15397 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15398 the line numbers.
15399
15400 2002-06-14 Akim Demaille <akim@epita.fr>
15401
15402 Grammar declarations may be found in the grammar section.
15403
15404 * src/parse-gram.y (rules_or_grammar_declaration): New.
15405 (declarations): Each declaration may end with a semicolon, not
15406 just...
15407 (grammar_declaration): `"%union"'.
15408 (grammar): Branch to rules_or_grammar_declaration.
15409
15410 2002-06-14 Akim Demaille <akim@epita.fr>
15411
15412 * src/main.c (main): Invoke scanner_free.
15413
15414 2002-06-14 Akim Demaille <akim@epita.fr>
15415
15416 * src/output.c (m4_invoke): Extracted from...
15417 (output_skeleton): here.
15418 Free tempfile.
15419
15420 2002-06-14 Akim Demaille <akim@epita.fr>
15421
15422 * src/parse-gram.y (directives, directive, gram)
15423 (grammar_directives, precedence_directives, precedence_directive):
15424 Rename as...
15425 (declarations, declaration, grammar, grammar_declaration)
15426 (precedence_declaration, precedence_declarator): these.
15427 (symbol_declaration): New.
15428
15429 2002-06-14 Akim Demaille <akim@epita.fr>
15430
15431 * src/files.c (action_obstack): Remove, unused.
15432 (output_obstack): Remove it, and all its dependencies, as it is no
15433 longer needed.
15434 * src/reader.c (epilogue_set): Build the epilogue in the
15435 muscle_obstack.
15436 * src/output.h, src/output.c (muscle_obstack): Move to...
15437 * src/muscle_tab.h, src/muscle_tab.h: here.
15438 (muscle_init): Initialize muscle_obstack.
15439 (muscle_free): New.
15440 * src/main.c (main): Call it.
15441
15442 2002-06-14 Akim Demaille <akim@epita.fr>
15443
15444 * src/location.h: New, extracted from...
15445 * src/reader.h: here.
15446 * src/Makefile.am (noinst_HEADERS): Merge into
15447 (bison_SOURCES): this.
15448 Add location.h.
15449 * src/parse-gram.y: Use location_t instead of Bison's.
15450 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15451 Use location_t instead of ints.
15452
15453 2002-06-14 Akim Demaille <akim@epita.fr>
15454
15455 * data/bison.simple, data/bison.c++: Be sure to restore the
15456 current #line when returning to the skeleton contents after having
15457 exposed the input file's #line.
15458
15459 2002-06-12 Akim Demaille <akim@epita.fr>
15460
15461 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15462 eager.
15463 * tests/actions.at (Exotic Dollars): New.
15464
15465 2002-06-12 Akim Demaille <akim@epita.fr>
15466
15467 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15468 ['"/] too eagerly.
15469 * tests/input.at (Torturing the Scanner): New.
15470
15471 2002-06-11 Akim Demaille <akim@epita.fr>
15472
15473 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15474 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15475 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15476 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15477 * src/reader.c (reader): Use it.
15478
15479 2002-06-11 Akim Demaille <akim@epita.fr>
15480
15481 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15482 Adjust all callers.
15483 (scanner_last_string_free): New.
15484
15485 2002-06-11 Akim Demaille <akim@epita.fr>
15486
15487 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15488 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15489 (last_string, YY_OBS_FREE): New.
15490 Use them when returning an ID.
15491
15492 2002-06-11 Akim Demaille <akim@epita.fr>
15493
15494 Have Bison grammars parsed by a Bison grammar.
15495
15496 * src/reader.c, src/reader.h (prologue_augment): New.
15497 * src/reader.c (copy_definition): Remove.
15498
15499 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15500 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15501 (grammar_current_rule_prec_set, grammar_current_rule_check)
15502 (grammar_current_rule_symbol_append)
15503 (grammar_current_rule_action_append): Export.
15504 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15505 (symbol_list_action_append): Remove.
15506 Hook the routines from reader.
15507 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15508 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15509
15510 * src/reader.c (read_declarations): Remove, unused.
15511
15512 * src/parse-gram.y: Handle the epilogue.
15513 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15514 (grammar_start_symbol_set): this.
15515 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15516 * src/reader.c (readgram): Remove, unused.
15517 (reader): Adjust to insert eoftoken and axiom where appropriate.
15518
15519 * src/reader.c (copy_dollar): Replace with...
15520 * src/scan-gram.h (handle_dollar): this.
15521 * src/parse-gram.y: Remove `%thong'.
15522
15523 * src/reader.c (copy_at): Replace with...
15524 * src/scan-gram.h (handle_at): this.
15525
15526 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15527 New.
15528
15529 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15530 time being.
15531
15532 * src/reader.h, src/reader.c (grammar_rule_end): New.
15533
15534 * src/parse.y (current_type, current_class): New.
15535 Implement `%nterm', `%token' support.
15536 Merge `%term' into `%token'.
15537 (string_as_id): New.
15538 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15539 type name.
15540
15541 * src/parse-gram.y: Be sure to handle properly the beginning of
15542 rules.
15543
15544 * src/parse-gram.y: Handle %type.
15545 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15546
15547 * src/parse-gram.y: More directives support.
15548 * src/options.c: No longer handle source directives.
15549
15550 * src/parse-gram.y: Fix %output.
15551
15552 * src/parse-gram.y: Handle %union.
15553 Use the prologue locations.
15554 * src/reader.c (parse_union_decl): Remove.
15555
15556 * src/reader.h, src/reader.c (epilogue_set): New.
15557 * src/parse-gram.y: Use it.
15558
15559 * data/bison.simple, data/bison.c++: b4_stype is now either not
15560 defined, then default to int, or to the contents of %union,
15561 without `union' itself.
15562 Adjust.
15563 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15564
15565 * src/output.c (actions_output): Don't output braces, as they are
15566 already handled by the scanner.
15567
15568 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15569 characters to themselves.
15570
15571 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15572 that the epilogue has a proper #line.
15573
15574 * src/parse-gram.y: Handle precedence/associativity.
15575
15576 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15577 a terminal.
15578 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15579 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15580 at all to define terminals that cannot be emitted.
15581
15582 * src/scan-gram.l: Escape M4 characters.
15583
15584 * src/scan-gram.l: Working properly with escapes in user
15585 strings/characters.
15586
15587 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15588 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15589 grammar.
15590 Use more modest sizes, as for the time being the parser does not
15591 release memory, and therefore the process swallows a huge amount
15592 of memory.
15593
15594 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15595 stricter %token grammar.
15596
15597 * src/symtab.h (associativity): Add `undef_assoc'.
15598 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15599 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15600
15601 * tests/regression.at (Invalid %directive): Remove, as it is now
15602 meaningless.
15603 (Invalid inputs): Adjust to the new error messages.
15604 (Token definitions): The new grammar doesn't allow too many
15605 eccentricities.
15606
15607 * src/lex.h, src/lex.c: Remove.
15608 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15609 (copy_character, copy_string2, copy_string, copy_identifier)
15610 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15611 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15612 (parse_action): Remove.
15613 * po/POTFILES.in: Adjust.
15614
15615 2002-06-11 Akim Demaille <akim@epita.fr>
15616
15617 * src/reader.c (parse_action): Don't store directly into the
15618 rule's action member: return the action as a string.
15619 Don't require `rule_length' as an argument: compute it.
15620 (grammar_current_rule_symbol_append)
15621 (grammar_current_rule_action_append): New, eved out from
15622 (readgram): here.
15623 Remove `action_flag', `rulelength', unused now.
15624
15625 2002-06-11 Akim Demaille <akim@epita.fr>
15626
15627 * src/reader.c (grammar_current_rule_prec_set).
15628 (grammar_current_rule_check): New, eved out from...
15629 (readgram): here.
15630 Remove `xaction', `first_rhs': useless.
15631 * tests/input.at (Type clashes): New.
15632 * tests/existing.at (GNU Cim Grammar): Adjust.
15633
15634 2002-06-11 Akim Demaille <akim@epita.fr>
15635
15636 * src/reader.c (grammar_midrule_action): New, Eved out from
15637 (readgram): here.
15638
15639 2002-06-11 Akim Demaille <akim@epita.fr>
15640
15641 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15642 New.
15643 (readgram): Use them as replacement of inlined code, crule and
15644 crule1.
15645
15646 2002-06-11 Akim Demaille <akim@epita.fr>
15647
15648 * src/reader.c (grammar_end, grammar_symbol_append): New.
15649 (readgram): Use them.
15650 Make the use of `p' as local as possible.
15651
15652 2002-06-10 Akim Demaille <akim@epita.fr>
15653
15654 GCJ's parser requires the tokens to be defined before the prologue.
15655
15656 * data/bison.simple: Output the token definition before the user's
15657 prologue.
15658 * tests/regression.at (Braces parsing, Duplicate string)
15659 (Mixing %token styles): Check the output from bison.
15660 (Early token definitions): New.
15661
15662 2002-06-10 Akim Demaille <akim@epita.fr>
15663
15664 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15665 assigning twice the same user number to a token, so that we can
15666 use it in...
15667 * src/lex.c (lex): here.
15668 Also use `symbol_class_set' instead of hand written code.
15669 * src/reader.c (parse_assoc_decl): Likewise.
15670
15671 2002-06-10 Akim Demaille <akim@epita.fr>
15672
15673 * src/symtab.c, src/symtab.c (symbol_class_set)
15674 (symbol_user_token_number_set): New.
15675 * src/reader.c (parse_token_decl): Use them.
15676 Use a switch instead of ifs.
15677 Use a single argument.
15678
15679 2002-06-10 Akim Demaille <akim@epita.fr>
15680
15681 Remove `%thong' support as it is undocumented, unused, duplicates
15682 `%token's job, and creates useless e-mail traffic with people who
15683 want to know what it is, why it is undocumented, unused, and
15684 duplicates `%token's job.
15685
15686 * src/reader.c (parse_thong_decl): Remove.
15687 * src/options.c (option_table): Remove "thong".
15688 * src/lex.h (tok_thong): Remove.
15689
15690 2002-06-10 Akim Demaille <akim@epita.fr>
15691
15692 * src/symtab.c, src/symtab.c (symbol_type_set)
15693 (symbol_precedence_set): New.
15694 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15695 (value_components_used): Remove, unused.
15696
15697 2002-06-09 Akim Demaille <akim@epita.fr>
15698
15699 Move symbols handling code out of the reader.
15700
15701 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15702 (axiom): Move to...
15703 * src/symtab.h, src/symtab.c: here.
15704
15705 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15706 * src/reader.c (startval): Rename as...
15707 * src/symtab.h, src/symtab.c (startsymbol): this.
15708 * src/reader.c: Adjust.
15709
15710 * src/reader.c (symbol_check_defined, symbol_make_alias)
15711 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15712 (token_translations_init)
15713 Move to...
15714 * src/symtab.c: here.
15715 * src/reader.c (packsymbols): Move to...
15716 * src/symtab.h, src/symtab.c (symbols_pack): here.
15717 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15718 argument.
15719
15720 2002-06-03 Akim Demaille <akim@epita.fr>
15721
15722 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15723 then statements.
15724
15725 2002-06-03 Akim Demaille <akim@epita.fr>
15726
15727 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15728 structs with non literals.
15729 * src/scan-skel.l: never-interactive.
15730 * src/conflicts.c (enum conflict_resolution_e): No trailing
15731 comma.
15732 * src/getargs.c (usage): Split long literal strings.
15733 Reported by Hans Aberg.
15734
15735 2002-05-28 Akim Demaille <akim@epita.fr>
15736
15737 * data/bison.c++: Use C++ ostreams.
15738 (cdebug_): New member.
15739
15740 2002-05-28 Akim Demaille <akim@epita.fr>
15741
15742 * src/output.c (output_skeleton): Be sure to allocate enough room
15743 for `/' _and_ for `\0' in full_skeleton.
15744
15745 2002-05-28 Akim Demaille <akim@epita.fr>
15746
15747 * data/bison.c++: Catch up with bison.simple:
15748 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15749 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15750 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15751 and popping traces.
15752
15753 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15754
15755 * src/output.c (output_skeleton): Put an explicit path in front of
15756 the skeleton file name, rather than relying on the -I directory,
15757 to partially alleviate effects of having a skeleton file lying around
15758 in the current directory.
15759
15760 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15761
15762 * src/conflicts.c (log_resolution): Correct typo:
15763 obstack_printf should be obstack_fgrow1.
15764
15765 2002-05-26 Akim Demaille <akim@epita.fr>
15766
15767 * src/state.h (state_t): `solved_conflicts' is a new member.
15768 * src/LR0.c (new_state): Set it to 0.
15769 * src/conflicts.h, src/conflicts.c (print_conflicts)
15770 (free_conflicts, solve_conflicts): Rename as...
15771 (conflicts_print, conflicts_free, conflicts_solve): these.
15772 Adjust callers.
15773 * src/conflicts.c (enum conflict_resolution_e)
15774 (solved_conflicts_obstack): New, used by...
15775 (log_resolution): this.
15776 Adjust to attach the conflict resolution to each state.
15777 Complete the description with the precedence/associativity
15778 information.
15779 (resolve_sr_conflict): Adjust.
15780 * src/print.c (print_state): Output its solved_conflicts.
15781 * tests/conflicts.at (Unresolved SR Conflicts)
15782 (Solved SR Conflicts): Exercise --report=all.
15783
15784 2002-05-26 Akim Demaille <akim@epita.fr>
15785
15786 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15787 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15788 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15789 (token_number_t, item_number_as_token_number)
15790 (token_number_as_item_number, muscle_insert_token_number_table):
15791 Rename as...
15792 (symbol_number_t, item_number_as_symbol_number)
15793 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15794 these, since it is more appropriate.
15795
15796 2002-05-26 Akim Demaille <akim@epita.fr>
15797
15798 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15799 `Error:' lines.
15800 * data/bison.simple (yystos) [YYDEBUG]: New.
15801 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15802 error recovery.
15803 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15804
15805 2002-05-25 Akim Demaille <akim@epita.fr>
15806
15807 * doc/bison.texinfo (Debugging): Split into...
15808 (Tracing): this new section, its former contents, and...
15809 (Understanding): this new section.
15810 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15811 by...
15812 (report_flag): this.
15813 Adjust all dependencies.
15814 (report_args, report_types, report_argmatch): New.
15815 (usage, getargs): Report/support -r, --report.
15816 * src/options.h
15817 (struct option_table_struct): Rename as..,
15818 (struct option_table_s): this.
15819 Rename the `set_flag' member to `flag' to match with getopt_long's
15820 struct.
15821 * src/options.c (option_table): Split verbose into an entry for
15822 %verbose, and another for --verbose.
15823 Support --report/-r, so remove -r from the obsolete --raw.
15824 * src/print.c: Attach full item sets and lookaheads reports to
15825 report_flag instead of trace_flag.
15826 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15827
15828 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15829 and Paul Eggert <eggert@twinsun.com>
15830
15831 * data/bison.simple (yyparse): Correct error handling to conform to
15832 POSIX and yacc. Specifically, after syntax error is discovered,
15833 do not reduce further before shifting the error token.
15834 Clean up the code a bit by removing the labels yyerrdefault,
15835 yyerrhandle, yyerrpop.
15836 * NEWS: Document the above.
15837
15838 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15839
15840 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15841 type; it isn't always big enough, since it doesn't necessarily
15842 include non-terminals.
15843 (yytranslate): Expand definition of yy_token_number_type, so that
15844 the latter can be removed.
15845 (yy_token_number_type): Remove, only one use.
15846 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15847 don't use TokenNumberType as element type.
15848
15849 * tests/regression.at: Modify expected output to agree with change
15850 to yyr1 and yytranslate.
15851
15852 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15853
15854 * src/reader.c (parse_action): Use copy_character instead of
15855 obstack_1grow.
15856
15857 2002-05-13 Akim Demaille <akim@epita.fr>
15858
15859 * tests/regression.at (Token definitions): Prototype yylex and
15860 yyerror.
15861
15862 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15863
15864 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
15865 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15866 32-bit arithmetic.
15867 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15868
15869 2002-05-07 Akim Demaille <akim@epita.fr>
15870
15871 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15872 avoid GCC warnings.
15873
15874 2002-05-07 Akim Demaille <akim@epita.fr>
15875
15876 Kill GCC warnings.
15877
15878 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15879 over the RHS of each rule.
15880 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15881 * src/state.h (state_t): Member `nitems' is unsigned short.
15882 * src/LR0.c (get_state): Adjust.
15883 * src/reader.c (packgram): Likewise.
15884 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15885 `Type'.
15886 (muscle_insert_int_table): Remove, unused.
15887 (prepare_rules): Remove `max'.
15888
15889 2002-05-06 Akim Demaille <akim@epita.fr>
15890
15891 * src/closure.c (print_firsts): Display of the symbol tags.
15892 (bitmatrix_print): Move to...
15893 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15894 here.
15895 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15896
15897 2002-05-06 Akim Demaille <akim@epita.fr>
15898
15899 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15900 hash_do_for_each.
15901
15902 2002-05-06 Akim Demaille <akim@epita.fr>
15903
15904 * src/LR0.c (new_state, get_state): Instead of using the global
15905 `kernel_size' and `kernel_base', have two new arguments:
15906 `core_size' and `core'.
15907 Adjust callers.
15908
15909 2002-05-06 Akim Demaille <akim@epita.fr>
15910
15911 * src/reader.c (packgram): No longer end `ritem' with a 0
15912 sentinel: it is not used.
15913
15914 2002-05-05 Akim Demaille <akim@epita.fr>
15915
15916 New experimental feature: display the lookaheads in the report and
15917 graph.
15918
15919 * src/print (print_core): When --trace-flag, display the rules
15920 lookaheads.
15921 * src/print_graph.c (print_core): Likewise.
15922 Swap the arguments.
15923 Adjust caller.
15924
15925 2002-05-05 Akim Demaille <akim@epita.fr>
15926
15927 * tests/torture.at (Many lookaheads): New test.
15928
15929 2002-05-05 Akim Demaille <akim@epita.fr>
15930
15931 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15932 (GENERATE_MUSCLE_INSERT_TABLE): this.
15933 (output_int_table, output_unsigned_int_table, output_short_table)
15934 (output_token_number_table, output_item_number_table): Replace with...
15935 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15936 (muscle_insert_short_table, muscle_insert_token_number_table)
15937 (muscle_insert_item_number_table): these.
15938 Adjust all callers.
15939 (prepare_tokens): Don't free `translations', since...
15940 * src/reader.h, src/reader.c (grammar_free): do it.
15941 Move to...
15942 * src/gram.h, src/gram.c (grammar_free): here.
15943 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15944 b4_translate_max.
15945
15946 2002-05-05 Akim Demaille <akim@epita.fr>
15947
15948 * src/output.c (output_unsigned_int_table): New.
15949 (prepare_rules): `i' is unsigned.
15950 `prhs', `rline', `r2' are unsigned int.
15951 Rename muscle `rhs_number_max' as `rhs_max'.
15952 Output muscles `prhs_max', `rline_max', and `r2_max'.
15953 Free rline and r1.
15954 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15955 to compute types instead of constant types.
15956 * tests/regression.at (Web2c Actions): Adjust.
15957
15958 2002-05-04 Akim Demaille <akim@epita.fr>
15959
15960 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15961 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15962 Adjust dependencies.
15963 * src/output.c (token_definitions_output): Be sure not to output a
15964 `#define 'a'' when fed with `%token 'a' "a"'.
15965 * tests/regression.at (Token definitions): New.
15966
15967 2002-05-03 Paul Eggert <eggert@twinsun.com>
15968
15969 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15970 for K&R C.
15971
15972 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15973
15974 * Makefile.am (SUBDIRS): Remove intl.
15975 (EXTRA_DIST): Add config/config.rpath.
15976
15977 2002-05-03 Akim Demaille <akim@epita.fr>
15978
15979 * data/bison.simple (m4_if): Don't output empty enums.
15980 And actually, output valid enum definitions :(.
15981
15982 2002-05-03 Akim Demaille <akim@epita.fr>
15983
15984 * configure.bat: Remove, completely obsolete.
15985 * Makefile.am (EXTRA_DIST): Adjust.
15986 Don't distribute config.rpath...
15987 * config/Makefile.am (EXTRA_DIST): Do it.
15988
15989 2002-05-03 Akim Demaille <akim@epita.fr>
15990
15991 * configure.in (GETTEXT_VERSION): New.
15992 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15993
15994 2002-05-03 Akim Demaille <akim@epita.fr>
15995
15996 * data/bison.simple (b4_token_enum): New.
15997 (b4_token_defines): Use it to output tokens both as #define and
15998 enums.
15999 Suggested by Paul Eggert.
16000 * src/output.c (token_definitions_output): Don't output spurious
16001 white spaces.
16002
16003 2002-05-03 Akim Demaille <akim@epita.fr>
16004
16005 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16006
16007 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
16008
16009 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
16010 Update the stack class, give a try to deque as the default container.
16011
16012 2002-05-02 Akim Demaille <akim@epita.fr>
16013
16014 * data/bison.simple (yyparse): Do not implement @$ = @1.
16015 (YYLLOC_DEFAULT): Adjust to do it.
16016 * doc/bison.texinfo (Location Default Action): Fix.
16017
16018 2002-05-02 Akim Demaille <akim@epita.fr>
16019
16020 * src/reader.c (parse_braces): Merge into...
16021 (parse_action): this.
16022
16023 2002-05-02 Akim Demaille <akim@epita.fr>
16024
16025 * configure.in (ALL_LINGUAS): Remove.
16026 * po/LINGUAS, hr.po: New.
16027
16028 2002-05-02 Akim Demaille <akim@epita.fr>
16029
16030 Remove the so called hairy (semantic) parsers.
16031
16032 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
16033 * src/gram.h, src/gram.c (semantic_parser): Remove.
16034 (rule_t): Remove the guard and guard_line members.
16035 * src/lex.h (token_t): remove tok_guard.
16036 * src/options.c (option_table): Remove %guard and %semantic_parser
16037 support.
16038 * src/output.c, src/output.h (guards_output): Remove.
16039 (prepare): Adjust.
16040 (token_definitions_output): Don't output the `T'
16041 tokens (???).
16042 (output_skeleton): Don't output the guards.
16043 * src/files.c, src/files.c (attrsfile): Remove.
16044 * src/reader.c (symbol_list): Remove the guard and guard_line
16045 members.
16046 Adjust dependencies.
16047 (parse_guard): Remove.
16048 * data/bison.hairy: Remove.
16049 * doc/bison.texinfo (Environment Variables): Remove occurrences of
16050 BISON_HAIRY.
16051
16052 2002-05-02 Akim Demaille <akim@epita.fr>
16053
16054 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
16055 (parse_guard): Rename the formal argument `stack_offset' as
16056 `rule_length', which is more readable.
16057 Adjust callers.
16058 (copy_at, copy_dollar): Instead of outputting the hard coded
16059 values of $$, $n and so forth, output invocation to b4_lhs_value,
16060 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
16061 Note: this patch partially drops `semantic-parser' support: it
16062 always does `rule_length - n', where semantic parsers ought to
16063 always use `-n'.
16064 * data/bison.simple, data/bison.c++ (b4_lhs_value)
16065 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
16066
16067 2002-05-02 Akim Demaille <akim@epita.fr>
16068
16069 * configure.in (AC_INIT): Bump to 1.49b.
16070 (AM_INIT_AUTOMAKE): Short invocation.
16071
16072 2002-05-02 Akim Demaille <akim@epita.fr>
16073
16074 Version 1.49a.
16075
16076 2002-05-01 Akim Demaille <akim@epita.fr>
16077
16078 * src/skeleton.h: Remove.
16079
16080 2002-05-01 Akim Demaille <akim@epita.fr>
16081
16082 * src/skeleton.h: Fix the #endif.
16083 Reported by Magnus Fromreide.
16084
16085 2002-04-26 Paul Eggert <eggert@twinsun.com>
16086
16087 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16088 Define if we define YYSTYPE and YYLTYPE, respectively.
16089 (YYCOPY): Fix [] quoting problem in the non-GCC case.
16090
16091 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
16092
16093 * src/scan-skel.l: Postprocess quadrigraphs.
16094
16095 * src/reader.c (copy_character): New function, used to output
16096 single characters while replacing `[' and `]' with quadrigraphs, to
16097 avoid troubles with M4 quotes.
16098 (copy_comment): Output characters with copy_character.
16099 (read_additionnal_code): Likewise.
16100 (copy_string2): Likewise.
16101 (copy_definition): Likewise.
16102
16103 * tests/calc.at: Exercise M4 quoting.
16104
16105 2002-04-25 Akim Demaille <akim@epita.fr>
16106
16107 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16108 between `!' and the command.
16109 Reported by Paul Eggert.
16110
16111 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
16112
16113 * tests/calc.at: Exercise prologue splitting.
16114
16115 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16116 `b4_post_prologue' instead of `b4_prologue'.
16117
16118 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16119 muscles.
16120 (output): Free pre_prologue_obstack and post_prologue_obstack.
16121 * src/files.h, src/files.c (attrs_obstack): Remove.
16122 (pre_prologue_obstack, post_prologue_obstack): New.
16123 * src/reader.c (copy_definition): Add a parameter to specify the
16124 obstack to fill, instead of using attrs_obstack unconditionally.
16125 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16126 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16127
16128 2002-04-23 Paul Eggert <eggert@twinsun.com>
16129
16130 * data/bison.simple: Remove unnecessary commentary and white
16131 space differences from 1_29-branch.
16132 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16133
16134 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16135 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16136 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16137 constructors or destructors.
16138
16139 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16140
16141 2002-04-23 Akim Demaille <akim@epita.fr>
16142
16143 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16144 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16145 location with columns.
16146 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16147 All reported by Paul Eggert.
16148
16149 2002-04-22 Akim Demaille <akim@epita.fr>
16150
16151 * src/reduce.c (dump_grammar): Move to...
16152 * src/gram.h, src/gram.c (grammar_dump): here.
16153 Be sure to separate long item numbers.
16154 Don't read the members of a rule's prec if its nil.
16155
16156 2002-04-22 Akim Demaille <akim@epita.fr>
16157
16158 * src/output.c (table_size, table_grow): New.
16159 (MAXTABLE): Remove, replace uses with table_size.
16160 (pack_vector): Instead of dying when the table is too big, grow it.
16161
16162 2002-04-22 Akim Demaille <akim@epita.fr>
16163
16164 * data/bison.simple (yyr1): Its type is that of a token number.
16165 * data/bison.c++ (r1_): Likewise.
16166 * tests/regression.at (Web2c Actions): Adjust.
16167
16168 2002-04-22 Akim Demaille <akim@epita.fr>
16169
16170 * src/reader.c (token_translations_init): 256 is now the default
16171 value for the error token, i.e., it will be assigned another
16172 number if the user assigned 256 to one of her tokens.
16173 (reader): Don't force 256 to error.
16174 * doc/bison.texinfo (Symbols): Adjust.
16175 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16176 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16177 etc. instead of 10, 20, 30 (which was used to `jump' over error
16178 (256) and undefined (2)).
16179
16180 2002-04-22 Akim Demaille <akim@epita.fr>
16181
16182 Propagate more token_number_t.
16183
16184 * src/gram.h (token_number_as_item_number)
16185 (item_number_as_token_number): New.
16186 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16187 Use it to create output_item_number_table and
16188 output_token_number_table.
16189 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16190 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16191 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16192 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16193
16194 2002-04-22 Akim Demaille <akim@epita.fr>
16195
16196 * src/output.h, src/output.c (get_lines_number): Remove.
16197
16198 2002-04-19 Akim Demaille <akim@epita.fr>
16199
16200 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16201 as Lex/Flex'.
16202 (Debugging): More details about enabling the debugging features.
16203 (Table of Symbols): Describe $$, $n, @$, and @n.
16204 Suggested by Tim Josling.
16205
16206 2002-04-19 Akim Demaille <akim@epita.fr>
16207
16208 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16209
16210 2002-04-10 Akim Demaille <akim@epita.fr>
16211
16212 * src/system.h: Rely on HAVE_LIMITS_H.
16213 Suggested by Paul Eggert.
16214
16215 2002-04-09 Akim Demaille <akim@epita.fr>
16216
16217 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16218 full stderr, and strip it according to the bison options, instead
16219 of composing the error message from different bits.
16220 This makes it easier to check for several error messages.
16221 Adjust all the invocations.
16222 Add an invocation exercising the error token.
16223 Add an invocation demonstrating a stupid error message.
16224 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16225 Adjust the tests.
16226 Error message are for stderr, not stdout.
16227
16228 2002-04-09 Akim Demaille <akim@epita.fr>
16229
16230 * src/gram.h, src/gram.c (error_token_number): Remove, use
16231 errtoken->number.
16232 * src/reader.c (reader): Don't specify the user token number (2)
16233 for $undefined, as it uselessly prevents using it.
16234 * src/gram.h (token_number_t): Move to...
16235 * src/symtab.h: here.
16236 (state_t.number): Is a token_number_t.
16237 * src/print.c, src/reader.c: Use undeftoken->number instead of
16238 hard coded 2.
16239 (Even though this 2 is not the same as above: the number of the
16240 undeftoken remains being 2, it is its user token number which
16241 might not be 2).
16242 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16243 `user_token_number_max'.
16244 Output `undef_token_number'.
16245 * data/bison.simple, data/bison.c++: Use them.
16246 Be sure to map invalid yylex return values to
16247 `undef_token_number'. This saves us from gratuitous SEGV.
16248
16249 * tests/conflicts.at (Solved SR Conflicts)
16250 (Unresolved SR Conflicts): Adjust.
16251 * tests/regression.at (Web2c Actions): Adjust.
16252
16253 2002-04-08 Akim Demaille <akim@epita.fr>
16254
16255 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16256 Adding #line.
16257 Remove the duplicate `typedefs'.
16258 (RhsNumberType): Fix the declaration and various other typos.
16259 Use __ofile__.
16260 * data/bison.simple: Use __ofile__.
16261 * src/scan-skel.l: Handle __ofile__.
16262
16263 2002-04-08 Akim Demaille <akim@epita.fr>
16264
16265 * src/gram.h (item_number_t): New, the type of item numbers in
16266 RITEM. Note that it must be able to code symbol numbers as
16267 positive number, and the negation of rule numbers as negative
16268 numbers.
16269 Adjust all dependencies (pretty many).
16270 * src/reduce.c (rule): Remove this `short *' pointer: use
16271 item_number_t.
16272 * src/system.h (MINSHORT, MAXSHORT): Remove.
16273 Include `limits.h'.
16274 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16275 (shortcpy): Remove.
16276 (MAXTABLE): Move to...
16277 * src/output.c (MAXTABLE): here.
16278 (prepare_rules): Use output_int_table to output rhs.
16279 * data/bison.simple, data/bison.c++: Adjust.
16280 * tests/torture.at (Big triangle): Move the limit from 254 to
16281 500.
16282 * tests/regression.at (Web2c Actions): Ajust.
16283
16284 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16285 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16286 passes, but produces negative #line number, once fixed, GCC is
16287 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16288 C), it passes.
16289 * src/state.h (state_h): Code input lines on ints, not shorts.
16290
16291 2002-04-08 Akim Demaille <akim@epita.fr>
16292
16293 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16294 and then the grammar.
16295
16296 2002-04-08 Akim Demaille <akim@epita.fr>
16297
16298 * src/system.h: No longer using strndup.
16299
16300 2002-04-07 Akim Demaille <akim@epita.fr>
16301
16302 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16303 * src/output.c (output_table_data): Return the longest number.
16304 (prepare_tokens): Output `token_number_max').
16305 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16306 New.
16307 Use them to define yy_token_number_type/TokenNumberType.
16308 Use this type for yytranslate.
16309 * tests/torture.at (Big triangle): Push the limit from 124 to
16310 253.
16311 * tests/regression.at (Web2c Actions): Adjust.
16312
16313 2002-04-07 Akim Demaille <akim@epita.fr>
16314
16315 * tests/torture.at (Big triangle): New.
16316 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16317 * tests/existing.at: here.
16318
16319 2002-04-07 Akim Demaille <akim@epita.fr>
16320
16321 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16322 nritems.
16323 Adjust dependencies.
16324
16325 2002-04-07 Akim Demaille <akim@epita.fr>
16326
16327 * src/reader.c: Normalize increments to prefix form.
16328
16329 2002-04-07 Akim Demaille <akim@epita.fr>
16330
16331 * src/reader.c, symtab.c: Remove debugging code.
16332
16333 2002-04-07 Akim Demaille <akim@epita.fr>
16334
16335 Rename all the `bucket's as `symbol_t'.
16336
16337 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16338 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16339 * src/symtab.c, src/symtab.h (bucket): Rename as...
16340 (symbol_t): this.
16341 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16342 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16343 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16344 (buckets_new, buckets_free, buckets_do): Rename as...
16345 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16346 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16347 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16348 (symbols_new, symbols_free, symbols_do): these.
16349
16350 2002-04-07 Akim Demaille <akim@epita.fr>
16351
16352 Use lib/hash for the symbol table.
16353
16354 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16355 EOF.
16356 * src/lex.c (lex): Set the `number' member of new terminals.
16357 * src/reader.c (bucket_check_defined, bucket_make_alias)
16358 (bucket_check_alias_consistence, bucket_translation): New.
16359 (reader, grammar_free, readgram, token_translations_init)
16360 (packsymbols): Adjust.
16361 (reader): Number the predefined tokens.
16362 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16363 for predefined tokens.
16364 * src/symtab.h (bucket): Remove all the hash table related
16365 members.
16366 * src/symtab.c (symtab): Replace by...
16367 (bucket_table): this.
16368 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16369 (buckets_new, buckets_do): New.
16370
16371 2002-04-07 Akim Demaille <akim@epita.fr>
16372
16373 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16374 (start_symbol, max_user_token_number, semantic_parser)
16375 (error_token_number): Initialize.
16376 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16377 Initialize.
16378 (reader): Don't.
16379 (errtoken, eoftoken, undeftoken, axiom): Extern.
16380
16381 2002-04-07 Akim Demaille <akim@epita.fr>
16382
16383 * src/gram.h (rule_s): prec and precsym are now pointers
16384 to the bucket giving the priority/associativity.
16385 Member `associativity' removed: useless.
16386 * src/reduce.c, src/conflicts.c: Adjust.
16387
16388 2002-04-07 Akim Demaille <akim@epita.fr>
16389
16390 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16391 Properly escape the symbols' TAG when outputting them.
16392
16393 2002-04-07 Akim Demaille <akim@epita.fr>
16394
16395 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16396
16397 2002-04-07 Akim Demaille <akim@epita.fr>
16398
16399 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16400 (LArule): this, which is an array to rule_t*.
16401 * src/print.c, src/conflicts.c: Adjust.
16402
16403 2002-04-07 Akim Demaille <akim@epita.fr>
16404
16405 * src/gram.h (rule_t): Rename `number' as `user_number'.
16406 `number' is a new member.
16407 Adjust dependencies.
16408 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16409
16410 2002-04-07 Akim Demaille <akim@epita.fr>
16411
16412 As a result of the previous patch, it is no longer needed
16413 to reorder ritem itself.
16414
16415 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16416
16417 2002-04-07 Akim Demaille <akim@epita.fr>
16418
16419 Be sure never to walk through RITEMS, but use only data related to
16420 the rules themselves. RITEMS should be banished.
16421
16422 * src/output.c (output_token_translations): Rename as...
16423 (prepare_tokens): this.
16424 In addition to `translate', prepare the muscles `tname' and
16425 `toknum', which were handled by...
16426 (output_rule_data): this.
16427 Remove, and move the remainder of its outputs into...
16428 (prepare_rules): this new routines, which also merges content from
16429 (output_gram): this.
16430 (prepare_rules): Be sure never to walk through RITEMS.
16431 (output_stos): Rename as...
16432 (prepare_stos): this.
16433 (output): Always invoke prepare_states, after all, just don't use it
16434 in the output if you don't need it.
16435
16436 2002-04-07 Akim Demaille <akim@epita.fr>
16437
16438 * src/LR0.c (new_state): Display `nstates' as the name of the
16439 newly created state.
16440 Adjust to initialize first_state and last_state if needed.
16441 Be sure to distinguish the initial from the final state.
16442 (new_states): Create the itemset of the initial state, and use
16443 new_state.
16444 * src/closure.c (closure): Now that the initial state has its
16445 items properly set, there is no need for a special case when
16446 creating `ruleset'.
16447
16448 As a result, now the rule 0, reducing to $axiom, is visible in the
16449 outputs. Adjust the test suite.
16450
16451 * tests/conflicts.at (Solved SR Conflicts)
16452 (Unresolved SR Conflicts): Adjust.
16453 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16454 * tests/conflicts.at (S/R in initial): New.
16455
16456 2002-04-07 Akim Demaille <akim@epita.fr>
16457
16458 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16459 the RHS of the rules.
16460 * src/output.c (output_gram): Likewise.
16461
16462 2002-04-07 Akim Demaille <akim@epita.fr>
16463
16464 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16465 bucket.
16466 Adjust all dependencies.
16467 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16468 `number' of the buckets too.
16469 * src/gram.h: Include `symtab.h'.
16470 (associativity): Move to...
16471 * src/symtab.h: here.
16472 No longer include `gram.h'.
16473
16474 2002-04-07 Akim Demaille <akim@epita.fr>
16475
16476 * src/gram.h, src/gram.c (rules_rhs_length): New.
16477 (ritem_longest_rhs): Use it.
16478 * src/gram.h (rule_t): `number' is a new member.
16479 * src/reader.c (packgram): Set it.
16480 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16481 the end of `rules', and count them out of `nrules'.
16482 (reduce_output, dump_grammar): Adjust.
16483 * src/print.c (print_grammar): It is no longer needed to check for
16484 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16485 * tests/reduce.at (Reduced Automaton): New test.
16486
16487 2002-04-07 Akim Demaille <akim@epita.fr>
16488
16489 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16490 lacking `+ 1' to nrules, Bison reported as useless a token if it
16491 was used solely to set the precedence of the last rule...
16492
16493 2002-04-07 Akim Demaille <akim@epita.fr>
16494
16495 * data/bison.c++, data/bison.simple: Don't output the current file
16496 name in #line, to avoid useless diffs between two identical
16497 outputs under different names.
16498
16499 2002-04-07 Akim Demaille <akim@epita.fr>
16500
16501 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16502 Normalize loops to using `< nrules + 1', not `<= nrules'.
16503
16504 2002-04-07 Akim Demaille <akim@epita.fr>
16505
16506 * TODO: Update.
16507
16508 2002-04-07 Akim Demaille <akim@epita.fr>
16509
16510 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16511 bucket.value as bucket.number.
16512
16513 2002-04-07 Akim Demaille <akim@epita.fr>
16514
16515 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16516 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16517 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16518 RHS, instead of being an index in RITEMS.
16519
16520 2002-04-04 Paul Eggert <eggert@twinsun.com>
16521
16522 * doc/bison.texinfo: Update copyright date.
16523 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16524 (Symbols): Warn about running Bison in one character set,
16525 but compiling and/or running in an incompatible one.
16526 Warn about character code 256, too.
16527
16528 2002-04-03 Paul Eggert <eggert@twinsun.com>
16529
16530 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16531 YYERROR_VERBOSE is nonzero, not whether it is defined.
16532
16533 Merge changes from bison-1_29-branch.
16534
16535 2002-03-20 Paul Eggert <eggert@twinsun.com>
16536
16537 Merge fixes from Debian bison_1.34-1.diff.
16538
16539 * configure.in (AC_PREREQ): 2.53.
16540
16541 2002-03-20 Akim Demaille <akim@epita.fr>
16542
16543 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16544
16545 2002-03-19 Paul Eggert <eggert@twinsun.com>
16546
16547 * src/bison.simple (YYCOPY): New macro.
16548 (YYSTACK_RELOCATE): Use it.
16549 Remove Type arg; no longer needed. All callers changed.
16550 (yymemcpy): Remove; no longer needed.
16551
16552 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16553 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16554
16555 2002-03-19 Akim Demaille <akim@epita.fr>
16556
16557 Test and fix the #line outputs.
16558
16559 * tests/atlocal.at (GCC): New.
16560 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
16561 (Prologue synch line, %union synch line, Postprologue synch line)
16562 (Action synch line, Epilogue synch line): New tests.
16563 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16564 * data/bison.simple, data/bison.c++: Use it.
16565
16566 2002-03-19 Akim Demaille <akim@epita.fr>
16567
16568 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16569 (Solved SR Conflicts, %expect not enough, %expect right)
16570 (%expect too much): Move to...
16571 * tests/conflicts.at: this new file.
16572
16573 2002-03-19 Akim Demaille <akim@epita.fr>
16574
16575 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16576 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16577 that we can move to enums for instance.
16578 * src/output.c (token_definitions_output): Output a list of
16579 `token-name, token-number' instead of the #define.
16580 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16581
16582 2002-03-14 Akim Demaille <akim@epita.fr>
16583
16584 Use Gettext 0.11.1.
16585
16586 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
16587
16588 * data/bison.c++: Make the user able to add members to the generated
16589 parser by subclassing.
16590
16591 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
16592
16593 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16594 a character.
16595 Reported by Nicolas Tisserand and Nicolas Burrus.
16596
16597 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16598
16599 * src/reader.c: Warn about lacking semi-colons, do not complain.
16600
16601 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16602
16603 * data/bison.c++: Remove a debug line.
16604
16605 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16606
16607 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16608 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16609 provide a default implementation.
16610
16611 2002-03-04 Akim Demaille <akim@epita.fr>
16612
16613 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16614 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16615 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16616 * tests/semantic.at (Parsing Guards): Similarly.
16617 * src/reader.at (readgram): Complain if the last rule is not ended
16618 with a semi-colon.
16619
16620 2002-03-04 Akim Demaille <akim@epita.fr>
16621
16622 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16623 * src/closure.c: here.
16624 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16625 RTC.
16626 * src/warshall.h, src/warshall.c: Remove.
16627 * tests/sets.at (Broken Closure): Adjust.
16628
16629 2002-03-04 Akim Demaille <akim@epita.fr>
16630
16631 * src/output.c (output_skeleton): tempdir is const.
16632 bytes_read is unused.
16633
16634 2002-03-04 Akim Demaille <akim@epita.fr>
16635
16636 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16637 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16638 Update.
16639 From Michael Hayes.
16640
16641 2002-03-04 Akim Demaille <akim@epita.fr>
16642
16643 * src/closure.c (closure): `r' is unused.
16644
16645 2002-03-04 Akim Demaille <akim@epita.fr>
16646
16647 * tests/sets.at (Broken Closure): Add the ending `;'.
16648 * src/reader.at (readgram): Complain if a rule is not ended with a
16649 semi-colon.
16650
16651 2002-03-04 Akim Demaille <akim@epita.fr>
16652
16653 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16654 (count_sr_conflicts): Use bitset_count.
16655 * src/reduce.c (inaccessable_symbols): Ditto.
16656 (bits_size): Remove.
16657 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16658
16659 2002-03-04 Akim Demaille <akim@epita.fr>
16660
16661 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16662 * src/reduce.c: Remove the `bitset_zero's following the
16663 `bitset_create's, as now it is performed by the latter.
16664
16665 2002-03-04 Akim Demaille <akim@epita.fr>
16666
16667 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16668 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16669 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16670 latest sources from Michael.
16671
16672 2002-03-04 Akim Demaille <akim@epita.fr>
16673
16674 * src/output.c (output): Don't free the grammar.
16675 * src/reader.c (grammar_free): New.
16676 * src/main.c (main): Call it and don't free symtab here.
16677
16678 2002-03-04 Akim Demaille <akim@epita.fr>
16679
16680 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16681 before returning.
16682 Reported by Benoit Perrot.
16683
16684 2002-03-04 Akim Demaille <akim@epita.fr>
16685
16686 Use bitset operations when possible, not loops over bits.
16687
16688 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16689 bitset_or.
16690 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16691 * src/reduce.c (useless_nonterminals): Formatting changes.
16692 * src/warshall.c (TC): Use bitset_or.
16693
16694 2002-03-04 Akim Demaille <akim@epita.fr>
16695
16696 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16697 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16698 Ditto.
16699
16700 2002-03-04 Akim Demaille <akim@epita.fr>
16701
16702 * src/lalr.c (F): Now a bitset*.
16703 Adjust all dependencies.
16704
16705 2002-03-04 Akim Demaille <akim@epita.fr>
16706
16707 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16708 Adjust all dependencies.
16709
16710 2002-03-04 Akim Demaille <akim@epita.fr>
16711
16712 * src/L0.c, src/LR0.h (nstates): Be size_t.
16713 Adjust comparisons (signed vs unsigned).
16714 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16715 bitset*.
16716 Adjust all dependencies.
16717
16718 2002-03-04 Akim Demaille <akim@epita.fr>
16719
16720 * src/closure.c (firsts): Now, also a bitset.
16721 Adjust all dependencies.
16722 (varsetsize): Remove, now unused.
16723 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16724
16725 2002-03-04 Akim Demaille <akim@epita.fr>
16726
16727 * src/print.c: Convert to use bitset.h, not hand coded iterations
16728 over ints.
16729
16730 2002-03-04 Akim Demaille <akim@epita.fr>
16731
16732 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16733
16734 2002-03-04 Akim Demaille <akim@epita.fr>
16735
16736 * src/closure.c (ruleset): Be a bitset.
16737 (rulesetsize): Remove.
16738
16739 2002-03-04 Akim Demaille <akim@epita.fr>
16740
16741 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16742 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16743 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16744 * src/closure.c (fderives): Be an array of bitsets.
16745
16746 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
16747
16748 * data/bison.c++: Merge the two generated headers. Insert a copyright
16749 notice in each output file.
16750
16751 2002-02-28 Akim Demaille <akim@epita.fr>
16752
16753 * data/bison.c++: Copy the prologue of bison.simple to fetch
16754 useful M4 definitions, such as b4_header_guard.
16755
16756 2002-02-25 Akim Demaille <akim@epita.fr>
16757
16758 * src/getargs.c (version): Give the name of the authors, and use a
16759 translator friendly scheme for the bgr
16760 copyright notice.
16761
16762 2002-02-25 Akim Demaille <akim@epita.fr>
16763
16764 * src/output.c (header_output): Remove, now handled completely via
16765 M4.
16766
16767 2002-02-25 Akim Demaille <akim@epita.fr>
16768
16769 * m4/m4.m4: New, from CVS Autoconf.
16770 * configure.in: Invoke it.
16771 * src/output.c (output_skeleton): Use its result instead of the
16772 hard coded name.
16773
16774 2002-02-25 Akim Demaille <akim@epita.fr>
16775
16776 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16777 Fileutils 4.1.5.
16778 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16779 * src/output.c (output_skeleton): Use mkstemp to create a real
16780 temporary file.
16781 Move the filling of `skeleton' and its muscle to...
16782 (prepare): here.
16783 (output): Move the definition of the prologue muscle to...
16784 (prepare): here.
16785 * src/system.h (DEFAULT_TMPDIR): New.
16786
16787 2002-02-14 Paul Eggert <eggert@twinsun.com>
16788
16789 Remove the support for C++ namespace cleanliness; it was
16790 causing more problems than it was curing, since it didn't work
16791 properly on some nonstandard C++ compilers. This can wait
16792 for a proper C++ parser.
16793
16794 * NEWS: Document this.
16795 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16796 of C++, as it's treated like C now.
16797 * src/bison.simple (YYSTD): Remove.
16798 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16799 Treat C++ just like Standard C instead of trying to support
16800 namespace cleanliness.
16801
16802 2002-02-14 Akim Demaille <akim@epita.fr>
16803
16804 * tests/regression.at (else): Adjust to Andreas' change.
16805
16806 2002-02-14 Akim Demaille <akim@epita.fr>
16807
16808 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16809
16810 2002-02-13 Andreas Schwab <schwab@suse.de>
16811
16812 * src/output.c (output_rule_data): Don't output NULL, it might
16813 not be defined yet.
16814
16815 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
16816
16817 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16818 (Copyright notice): Update.
16819
16820 2002-02-11 Akim Demaille <akim@epita.fr>
16821
16822 * tests/regression.at (%nonassoc and eof): Don't include
16823 nonportable headers.
16824
16825 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
16826
16827 * data/bison.c++: Correct error recovery. Make the user able to
16828 initialize the starting location.
16829
16830 2002-02-07 Akim Demaille <akim@epita.fr>
16831
16832 * tests/input.at: New.
16833
16834 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16835
16836 * data/bison.c++: Replace some direct m4 expansions by constants. Be
16837 more consistent when naming methods and variables. Put preprocessor
16838 directives around tables only needed for debugging.
16839
16840 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16841
16842 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16843 C++ parsers.
16844 (yy::b4_name::parse): Use print_.
16845
16846 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16847
16848 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16849
16850 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16851
16852 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16853 C++ parsers.
16854 (yy::b4_name::parse): Build verbose error messages, and use error_.
16855
16856 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
16857
16858 * data/bison.c++: Fix m4 quoting in comments.
16859
16860 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
16861
16862 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16863 not expanded by m4.
16864
16865 2002-02-05 Akim Demaille <akim@epita.fr>
16866
16867 * data/bison.c++: Adjust to the M4 back end.
16868 More is certainly needed.
16869
16870 2002-02-05 Akim Demaille <akim@epita.fr>
16871
16872 Give a try to M4 as a back end.
16873
16874 * lib/readpipe.c: New, from wdiff.
16875 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16876 BISON_HAIRY.
16877 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16878 specific values. Now it is m4 that performs the lookup.
16879 * src/parse-skel.y: Remove.
16880 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16881 * src/output.c (actions_output, guards_output)
16882 (token_definitions_output): No longer keeps track of the output
16883 line number, hence remove the second argument.
16884 (guards_output): Check against the guard member of a rule, not the
16885 action member.
16886 Adjust callers.
16887 (output_skeleton): Don't look for the skeleton location, let m4 do
16888 that.
16889 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16890 file will be used.
16891 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16892 (prepare): Given that for the time being changesyntax is not
16893 usable in M4, rename the muscles using `-' to `_'.
16894 Define `defines_flag', `output_parser_name' and `output_header_name'.
16895 * src/output.h (actions_output, guards_output)
16896 (token_definitions_output): Adjust prototypes.
16897 * src/scan-skel.l: Instead of scanning the skeletons, it now
16898 processes the output of m4: `__oline__' and `#output'.
16899 * data/bison.simple: Adjust to be used by M4(sugar).
16900 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16901 to date.
16902 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16903 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16904 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16905 shamelessly stolen from CVS Autoconf.
16906
16907 2002-02-05 Akim Demaille <akim@epita.fr>
16908
16909 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16910 * configure.in: Check for the declarations of free and malloc.
16911 * src/muscle_tab.c: Adjust.
16912
16913 2002-02-05 Akim Demaille <akim@epita.fr>
16914
16915 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16916 which have no values.
16917
16918 2002-02-05 Akim Demaille <akim@epita.fr>
16919
16920 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16921 * data/: here.
16922
16923 2002-01-29 Paul Eggert <eggert@twinsun.com>
16924
16925 * src/bison.simple (YYSIZE_T): Do not define merely because
16926 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16927 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16928
16929 2002-01-27 Akim Demaille <akim@epita.fr>
16930
16931 Fix `%nonassoc and eof'.
16932
16933 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16934 which were not properly copied! Replace
16935 memcpy (res->errs, src->errs, src->nerrs);
16936 with
16937 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16938 !!!
16939 * tests/regression.at (%nonassoc and eof): Adjust to newest
16940 Autotest: `.' is not in the PATH.
16941
16942 2002-01-27 Akim Demaille <akim@epita.fr>
16943
16944 * tests/sets.at (AT_EXTRACT_SETS): New.
16945 (Nullable): Use it.
16946 (Firsts): New.
16947
16948 2002-01-26 Akim Demaille <akim@epita.fr>
16949
16950 * tests/actions.at, tests/calc.at, tests/headers.at,
16951 * tests/torture.at: Adjust to the newest Autotest which no longer
16952 forces `.' in the PATH.
16953
16954 2002-01-25 Akim Demaille <akim@epita.fr>
16955
16956 * tests/regression.at (%nonassoc and eof): New.
16957 Suggested by Robert Anisko.
16958
16959 2002-01-24 Akim Demaille <akim@epita.fr>
16960
16961 Bison dumps core when trying to complain about broken input files.
16962 Reported by Cris van Pelt.
16963
16964 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16965 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16966 into...
16967 (Invalid inputs): Strengthen: exercise parse_percent_token.
16968
16969 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
16970
16971 * src/Makefile.am: Add bison.c++.
16972 * src/bison.c++: New skeleton.
16973
16974 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
16975
16976 * po/it.po: New.
16977
16978 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16979
16980 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16981
16982 2002-01-20 Marc Autret <marc@gnu.org>
16983
16984 * src/files.c (compute_output_file_names): Fix
16985
16986 2002-01-20 Marc Autret <marc@gnu.org>
16987
16988 * tests/output.at: New test.
16989 * src/files.c (compute_base_names): Don't map extensions when
16990 the YACC flag is set, use defaults.
16991 Reported by Evgeny Stambulchik.
16992
16993 2002-01-20 Marc Autret <marc@gnu.org>
16994
16995 * src/system.h: Need to define __attribute__ away for non-GCC
16996 compilers as well (i.e., the vendor C compiler).
16997 Suggested by Albert Chin-A-Young.
16998
16999 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
17000
17001 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17002 canonical definition.
17003 * src/system.h: Use the canonical definition for PARAMS (avoids
17004 a conflict with the macro from lib/hash.h).
17005
17006 2002-01-11 Akim Demaille <akim@epita.fr>
17007
17008 * configure.in: Use AC_FUNC_STRNLEN.
17009 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
17010
17011 2002-01-09 Akim Demaille <akim@epita.fr>
17012
17013 * src/files.c, src/files.h (output_infix): New.
17014 (tab_extension): Remove.
17015 (compute_base_names): Compute the former, drop the latter.
17016 * src/output.c (prepare): Insert the muscles `output-infix', and
17017 `output-suffix'.
17018 * src/parse-skel.y (string, string.1): New.
17019 (section.header): Use it.
17020 (section.yacc): Remove.
17021 (prefix): Remove too.
17022 * src/scan-skel.l: Adjust.
17023 * src/bison.simple, src/bison.hairy: Adjust.
17024
17025 2002-01-09 Akim Demaille <akim@epita.fr>
17026
17027 * configure.in (WERROR_CFLAGS): Compute it.
17028 * src/Makefile.am (CFLAGS): Pass it.
17029 * tests/atlocal.in (CFLAGS): Idem.
17030 * src/files.c: Fix a few warnings.
17031 (get_extension_index): Remove, unused.
17032
17033 2002-01-08 Akim Demaille <akim@epita.fr>
17034
17035 * src/getargs.c (AS_FILE_NAME): New.
17036 (getargs): Use it to convert DOSish file names.
17037 * src/files.c (base_name): Rename as full_base_name to avoid
17038 clashes with `base_name ()'.
17039 (filename_split): New.
17040 (compute_base_names): N-th rewrite, using filename_split.
17041
17042 2002-01-08 Akim Demaille <akim@epita.fr>
17043
17044 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
17045 New, stolen from the Fileutils 4.1.
17046 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17047 * configure.in: Check for the presence of memrchr, and of its
17048 prototype.
17049
17050 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
17051
17052 * lib/hash.h (__P): Added definition for this macro.
17053 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
17054 BUILT_SOURCES, to ensure they are generated first.
17055 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
17056 %error-verbose to allow bootstrapping with bison 1.30x.
17057
17058 2002-01-06 Akim Demaille <akim@epita.fr>
17059
17060 * src/reader.c (parse_braces): Don't fetch the next char, the
17061 convention is to fetch on entry.
17062 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
17063 'switch' without a following semicolon.
17064 * tests/regression.at (braces parsing): New.
17065
17066 2002-01-06 Akim Demaille <akim@epita.fr>
17067
17068 Bison is dead wrong in its RR conflict reports.
17069
17070 * tests/torture.at (GNU Cim Grammar): New.
17071 * src/conflicts.c (count_rr_conflicts): Fix.
17072
17073 2002-01-06 Akim Demaille <akim@epita.fr>
17074
17075 Creating package.m4 from configure.ac causes too many problems.
17076
17077 * tests/Makefile.am (package.m4): Create it by hand,
17078 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
17079
17080 2002-01-06 Akim Demaille <akim@epita.fr>
17081
17082 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
17083 skeleton.h.
17084
17085 2002-01-04 Paul Eggert <eggert@twinsun.com>
17086
17087 * doc/bison.texinfo (Debugging):
17088 Remove YYSTDERR; it's no longer defined or used.
17089 Also, s/cstdio.h/cstdio/.
17090
17091 2002-01-03 Akim Demaille <akim@epita.fr>
17092
17093 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17094
17095 2002-01-03 Akim Demaille <akim@epita.fr>
17096
17097 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17098 tracing code to --trace, wait for a better --trace option, with
17099 args.
17100
17101 2002-01-03 Akim Demaille <akim@epita.fr>
17102
17103 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17104 The ISO C++ standard is extremely clear about it: stderr is
17105 considered a macro, not a regular symbol (see table 94 `Header
17106 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17107 Therefore std:: does not apply to it. It still does with fprintf.
17108 Also, s/cstdio.h/cstdio/.
17109
17110 2002-01-03 Akim Demaille <akim@epita.fr>
17111
17112 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17113 for non system headers.
17114
17115 2002-01-02 Akim Demaille <akim@epita.fr>
17116
17117 Equip the skeleton chain with location tracking, runtime trace,
17118 pure parser and scanner.
17119
17120 * src/parse-skel.y: Request a pure parser, locations, and prefix
17121 renaming.
17122 (%union): Having several members with the same type does not help
17123 type mismatches, simplify.
17124 (YYPRINT, yyprint): New.
17125 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17126 (skel_error): this.
17127 Handle locations.
17128 * src/scan-skel.l: Adjust to these changes.
17129 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17130 (LOCATION_PRINT, skel_control_t): New.
17131
17132 2001-12-30 Akim Demaille <akim@epita.fr>
17133
17134 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17135 replace `gb' with BLANKS.
17136 * src/scan-skel.l: Adjust.
17137
17138 2001-12-30 Akim Demaille <akim@epita.fr>
17139
17140 * src/system.h: We don't need nor want bcopy.
17141 Throw away MS-DOS crap: we don't need getpid.
17142 * configure.in: We don't need strndup. It was even causing
17143 problems: because Flex includes the headers *before* us,
17144 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17145 not visible.
17146 * lib/xstrndup.c: New.
17147 * src/scan-skel.l: Use it.
17148 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17149 * src/parse-skel.y: Use %directives instead of #defines.
17150
17151 2001-12-30 Akim Demaille <akim@epita.fr>
17152
17153 * src/skeleton.h: New.
17154 * src/output.c (output_parser, output_master_parser): Remove, dead
17155 code.
17156 * src/output.h (get_lines_number, actions_output, guards_output)
17157 (token_definitions_output): Prototype them.
17158 * src/parse-skel.y: Add the license notice.
17159 Include output.h and skeleton.h.
17160 (process_skeleton): Returns void, and takes a single parameter.
17161 * src/scan-skel.l: Add the license notice.
17162 Include skeleton.h.
17163 Don't use %option yylineno: it seems that then Flex imagines
17164 REJECT has been used, and therefore it won't reallocate its
17165 buffers (which makes no other sense to me than a bug). It results
17166 in warnings for `unused: yy_flex_realloc'.
17167
17168 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
17169
17170 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17171 (MUSCLE_INSERT_PREFIX): ...to there.
17172 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17173 (MUSCLE_INSERT_PREFIX): Move from here...
17174
17175 * src/bison.hairy: Add a section directive. Put braces around muscle
17176 names. This parser skeleton is still broken, but Bison should not
17177 choke on a bad muscle 'syntax'.
17178 * src/bison.simple: Add a section directive. Put braces around muscle
17179 names.
17180
17181 * src/files.h (strsuffix, stringappend): Add declarations.
17182 (tab_extension): Add declaration.
17183 (short_base_name): Add declaration.
17184
17185 * src/files.c (strsuffix, stringappend): No longer static. These
17186 functions are used in the skeleton parser.
17187 (tab_extension): New.
17188 (compute_base_names): Use the computations done in this function
17189 to guess if the generated parsers should have '.tab' in their
17190 names.
17191 (short_base_name): No longer static.
17192
17193 * src/output.c (output_skeleton): New.
17194 (output): Disable call to output_master_parser, and give a try to
17195 a new skeleton handling system.
17196 (guards_output, actions_output): No longer static.
17197 (token_definitions_output, get_lines_number): No longer static.
17198
17199 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17200
17201 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
17202 parse-skel.y.
17203
17204 * src/parse-skel.y: New file.
17205 * src/scan-skel.l: New file.
17206
17207 2001-12-29 Akim Demaille <akim@epita.fr>
17208
17209 %name-prefix is broken.
17210
17211 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17212 Adjust all dependencies.
17213 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17214 %name-prefix.
17215
17216 Renaming yylval but not yylloc is not consistent. Now we do.
17217
17218 * src/bison.simple: Prefix yylloc if used.
17219 * doc/bison.texinfo (Decl Summary): Document that.
17220
17221 2001-12-29 Akim Demaille <akim@epita.fr>
17222
17223 * doc/bison.texinfo: Promote `%long-directive' over
17224 `%long_directive'.
17225 Remove all references to fixed-output-files, yacc is enough.
17226
17227 2001-12-29 Akim Demaille <akim@epita.fr>
17228
17229 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17230 user prologue. These are defaults.
17231 * tests/actions.at (Mid-rule actions): Make sure the user can
17232 define YYDEBUG and YYERROR_VERBOSE.
17233
17234 2001-12-29 Akim Demaille <akim@epita.fr>
17235
17236 * src/output.c (header_output): Don't forget to export YYLTYPE and
17237 yylloc.
17238 * tests/headers.at (export YYLTYPE): New, make sure it does.
17239 * tests/regression.at (%union and --defines, Invalid CPP headers):
17240 Move to...
17241 * tests/headers.at: here.
17242
17243 2001-12-29 Akim Demaille <akim@epita.fr>
17244
17245 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17246
17247 2001-12-29 Akim Demaille <akim@epita.fr>
17248
17249 * tests/actions.at (Mid-rule actions): Output on a single line
17250 instead of several.
17251
17252 2001-12-29 Akim Demaille <akim@epita.fr>
17253
17254 * doc/bison.texinfo: Formatting changes.
17255
17256 2001-12-29 Akim Demaille <akim@epita.fr>
17257
17258 Don't store the token defs in a muscle, just be ready to output it
17259 on command. Now possible via `symbols'. Fixes a memory leak.
17260
17261 * src/output.c (token_definitions_output): New.
17262 (output_parser, header_output): Use it.
17263 * src/reader.c (symbols_save): Remove.
17264
17265 2001-12-29 Akim Demaille <akim@epita.fr>
17266
17267 * src/bison.simple: Do not provide a default for YYSTYPE and
17268 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17269 default.
17270
17271 2001-12-29 Akim Demaille <akim@epita.fr>
17272
17273 Mid-rule actions are simply... ignored!
17274
17275 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17276 the empty-rule associated to the dummy symbol, not to the host
17277 rule.
17278 * tests/actions.at (Mid-rule actions): New.
17279
17280 2001-12-29 Akim Demaille <akim@epita.fr>
17281
17282 Memory leak.
17283
17284 * src/reader.c (reader): Free grammar.
17285
17286 2001-12-29 Akim Demaille <akim@epita.fr>
17287
17288 Memory leak.
17289
17290 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17291 since it allocates it for each state, although only one is needed.
17292 (allocate_storage): Do it here.
17293
17294 2001-12-29 Akim Demaille <akim@epita.fr>
17295
17296 * src/options.h, src/options.c (create_long_option_table): Rename
17297 as...
17298 (long_option_table_new): this, with a clearer prototype.
17299 (percent_table): Remove, unused,
17300 * src/getargs.c (getargs): Adjust.
17301
17302 2001-12-29 Akim Demaille <akim@epita.fr>
17303
17304 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17305 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17306 as states.
17307
17308 2001-12-29 Akim Demaille <akim@epita.fr>
17309
17310 * src/lalr.c (build_relations): Rename `states' as `states1'.
17311 Sorry, I don't understand exactly what it is, no better name...
17312
17313 2001-12-29 Akim Demaille <akim@epita.fr>
17314
17315 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17316 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17317 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17318 as rules.
17319
17320 2001-12-29 Akim Demaille <akim@epita.fr>
17321
17322 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17323 ago.
17324
17325 2001-12-29 Akim Demaille <akim@epita.fr>
17326
17327 * src/reader.c, src/reader.h (user_toknums): Remove.
17328 Adjust all users to use symbols[i]->user_token_number.
17329
17330 2001-12-29 Akim Demaille <akim@epita.fr>
17331
17332 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17333 Adjust all users to use symbols[i]->prec or ->assoc.
17334
17335 2001-12-29 Akim Demaille <akim@epita.fr>
17336
17337 * src/reader.c, src/reader.h (tags): Remove.
17338 Adjust all users to use symbols[i]->tag.
17339
17340 2001-12-29 Akim Demaille <akim@epita.fr>
17341
17342 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17343 and rule_table.
17344 * src/reader.c (packsymbols): Fill this table.
17345 Drop sprec.
17346 * src/conflicts.c (resolve_sr_conflict): Adjust.
17347 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17348 single table.
17349 Use symbols[i]->tag instead of tags[i].
17350
17351 2001-12-29 Akim Demaille <akim@epita.fr>
17352
17353 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17354 In addition, put a comment in there, to replace...
17355 * tests/regression.at (%union and C comments): Remove.
17356
17357 2001-12-29 Akim Demaille <akim@epita.fr>
17358
17359 * tests/regression.at (Web2c Actions): Blindly move the actual
17360 output as expected output. The contents *seem* right to me, but I
17361 can't pretend reading perfectly parser tables... Nonetheless, all
17362 the other tests pass correctly, the table look OK, even though the
17363 presence of `$axiom' is to be noted: AFAICS it is useless (but
17364 harmless).
17365
17366 2001-12-29 Akim Demaille <akim@epita.fr>
17367
17368 * src/reader.c (readgram): Don't add the rule 0 if there were no
17369 rules read. In other words, add it _after_ having performed
17370 grammar sanity checks.
17371 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17372
17373 2001-12-29 Akim Demaille <akim@epita.fr>
17374
17375 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17376 visible, and some states have now a different number.
17377
17378 2001-12-29 Akim Demaille <akim@epita.fr>
17379
17380 * src/reader.c (readgram): Bind the initial rule's lineno to that
17381 of the first rule.
17382 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17383 (Solved SR Conflicts): Adjust rule 0's line number.
17384
17385 2001-12-29 Akim Demaille <akim@epita.fr>
17386
17387 Fix the `GAWK Grammar' failure.
17388
17389 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17390 the reductions of the first state which was mistakenly confused
17391 with the final state because precisely final_state was initialized
17392 to 0.
17393 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17394 now noticed by Bison.
17395 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17396 have a reduction on $default.
17397
17398 2001-12-29 Akim Demaille <akim@epita.fr>
17399
17400 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17401 rule line numbers.
17402 * src/closure.c (print_closure): Likewise.
17403 * src/derives.c (print_derives): Likewise.
17404 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17405 now.
17406
17407 2001-12-29 Akim Demaille <akim@epita.fr>
17408
17409 * src/lalr.c (lookaheads_print): New.
17410 (lalr): Call it when --trace-flag.
17411 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17412 are dumped.
17413
17414 2001-12-29 Akim Demaille <akim@epita.fr>
17415
17416 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17417 when walking through ritem, even via rule->rhs.
17418 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17419 (useful_production, useless_nonterminals): Likewise.
17420 (reduce_grammar_tables): Likewise, plus update nritems.
17421 * src/nullable.c (set_nullable): Likewise.
17422 * src/lalr.c (build_relations): Likewise.
17423 * tests/sets.at (Nullable): Adjust.
17424 Fortunately, now, the $axiom is no longer nullable.
17425
17426 2001-12-29 Akim Demaille <akim@epita.fr>
17427
17428 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17429 the 0-sentinel.
17430 * src/gram.c (ritem_longest_rhs): Likewise.
17431 * src/reduce.c (nonterminals_reduce): Likewise.
17432 * src/print_graph.c (print_graph): Likewise.
17433 * src/output.c (output_rule_data): Likewise.
17434 * src/nullable.c (set_nullable): Likewise.
17435
17436 2001-12-29 Akim Demaille <akim@epita.fr>
17437
17438 * src/output.c: Comment changes.
17439
17440 2001-12-27 Paul Eggert <eggert@twinsun.com>
17441
17442 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17443 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17444 Sparc, as they were causing more porting problems than the
17445 (minor) performance improvement was worth.
17446
17447 Also, catch up with 1.31's YYSTD.
17448
17449 2001-12-27 Akim Demaille <akim@epita.fr>
17450
17451 * src/output.c (output_gram): Rely on nritems, not the
17452 0-sentinel. See below.
17453 Use -1 as separator, not 0.
17454 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17455 Rely on -1 as separator in yyrhs, instead of 0.
17456 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17457 twice `Now at end of input', therefore there are two lines less to
17458 expect.
17459
17460 2001-12-27 Akim Demaille <akim@epita.fr>
17461
17462 * tests/regression.at (Unresolved SR Conflicts):
17463 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17464 below.
17465
17466 2001-12-27 Akim Demaille <akim@epita.fr>
17467
17468 * src/LR0.c (new_state): Recognize the final state by the fact it
17469 is reached by eoftoken.
17470 (insert_start_shifting_state, insert_eof_shifting_state)
17471 (insert_accepting_state, augment_automaton): Remove, since now
17472 these states are automatically computed from the initial state.
17473 (generate_states): Adjust.
17474 * src/print.c: When reporting a rule number to the user, substract
17475 1, so that the axiom rule is rule 0, and the first user rule is 1.
17476 * src/reduce.c: Likewise.
17477 * src/print_graph.c (print_core): For the time being, just as for
17478 the report, depend upon --trace-flags to dump the full set of
17479 items.
17480 * src/reader.c (readgram): Once the grammar read, insert the rule
17481 0: `$axiom: START-SYMBOL $'.
17482 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17483 number of the states has changed (the final state is no longer
17484 necessarily the last), catch up.
17485
17486 2001-12-27 Akim Demaille <akim@epita.fr>
17487
17488 Try to make the use of the eoftoken valid. Given that its value
17489 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17490 is used instead of > 0 where appropriate, (ii), depend upon nritems
17491 instead of the 0-sentinel.
17492
17493 * src/gram.h, src/gram.c (nritems): New.
17494 Expected to be duplication of nitems, but for the time being...
17495 * src/reader.c (packgram): Assert nritems and nitems are equal.
17496 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17497 * src/closure.c (print_closure, print_fderives): Likewise.
17498 * src/gram.c (ritem_print): Likewise.
17499 * src/print.c (print_core, print_grammar): Likewise.
17500 * src/print_graph.c: Likewise.
17501
17502 2001-12-27 Akim Demaille <akim@epita.fr>
17503
17504 * src/main.c (main): If there are complains after grammar
17505 reductions, then output the report anyway if requested, then die.
17506 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17507 * src/reader.c (eoftoken): New.
17508 (parse_token_decl): If the token being defined has value `0', it
17509 is the eoftoken.
17510 (packsymbols): No longer hack `tags' to insert `$' by hand.
17511 Be sure to preserve the value of the eoftoken.
17512 (reader): Make sure eoftoken is defined.
17513 Initialize nsyms to 0: now eoftoken is created just like the others.
17514 * src/print.c (print_grammar): Don't special case the eof token.
17515 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17516 lie anyway, albeit pleasant.
17517 * tests/calc.at: Exercise error messages with eoftoken.
17518 Change the grammar so that empty input is invalid.
17519 Adjust expectations.
17520 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17521
17522 2001-12-27 Akim Demaille <akim@epita.fr>
17523
17524 * configure.in: Check the protos of strchr ans strspn.
17525 Replace strchr if needed.
17526 * src/system.h: Provide the protos of strchr, strspn and memchr if
17527 missing.
17528 * lib/strchr.c: New.
17529 * src/reader.c (symbols_save): Use strchr.
17530
17531 2001-12-27 Akim Demaille <akim@epita.fr>
17532
17533 * src/print.c, src/print_graph.c (escape): New.
17534 Use it to quote the TAGS outputs.
17535 * src/print_graph.c (print_state): Now errors are in red, and
17536 reductions in green.
17537 Prefer high to wide: output the state number on a line of its own.
17538
17539 2001-12-27 Akim Demaille <akim@epita.fr>
17540
17541 * src/state.h, src/state.c (reductions_new): New.
17542 * src/LR0.c (set_state_table): Let all the states have a
17543 `reductions', even if reduced to 0.
17544 (save_reductions): Adjust.
17545 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17546 * src/print.c (print_reductions, print_actions): Adjust.
17547 * src/output.c (action_row): Adjust.
17548
17549 2001-12-27 Akim Demaille <akim@epita.fr>
17550
17551 * src/state.h, src/state.c (errs_new, errs_dup): New.
17552 * src/LR0.c (set_state_table): Let all the states have an errs,
17553 even if reduced to 0.
17554 * src/print.c (print_errs, print_reductions): Adjust.
17555 * src/output.c (output_actions, action_row): Adjust.
17556 * src/conflicts.c (resolve_sr_conflict): Adjust.
17557
17558 2001-12-27 Akim Demaille <akim@epita.fr>
17559
17560 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17561
17562 2001-12-27 Akim Demaille <akim@epita.fr>
17563
17564 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17565 * src/print.c: here.
17566 (lookaheadset, shiftset): New, used as additional storage by
17567 print_reductions.
17568 (print_results): Adjust.
17569 (print_shifts, print_gotos, print_errs): New, extracted from...
17570 (print_actions): here.
17571 * src/print_graph.c (print_actions): Remove dead code.
17572
17573 2001-12-27 Akim Demaille <akim@epita.fr>
17574
17575 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17576 `$n' and `@n'.
17577
17578 2001-12-27 Akim Demaille <akim@epita.fr>
17579
17580 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17581 (build_relations): Adjust.
17582
17583 2001-12-27 Akim Demaille <akim@epita.fr>
17584
17585 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17586 duplication.
17587
17588 2001-12-27 Akim Demaille <akim@epita.fr>
17589
17590 * src/reader.c (packgram): Catch nitems overflows.
17591
17592 2001-12-27 Akim Demaille <akim@epita.fr>
17593
17594 * src/files.c, src/files.h (guard_obstack): Remove.
17595 * src/output.c (output): Adjust.
17596 * src/reader.c (parse_braces): New, factoring...
17597 (copy_action, copy_guard): these two which are renamed as...
17598 (parse_action, parse_guard): these.
17599 As a voluntary consequence, using braces around guards is now
17600 mandatory.
17601
17602 2001-12-27 Akim Demaille <akim@epita.fr>
17603
17604 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17605 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17606 members.
17607 (symbol_list_new): Adjust.
17608 (copy_action): action_line is the first line, not the last.
17609 (copy_guard): Just as for actions, store the `action' only, not
17610 the switch/case/break flesh.
17611 Don't parse the user action that might follow the guard, let...
17612 (readgram): do it, i.e., now, there can be an action after a
17613 guard.
17614 In other words the guard is just explicitly optional.
17615 (packgram): Adjust.
17616 * src/output.c (guards_output): New.
17617 (output_parser): Call it when needed.
17618 (output): Also free the guard and attrs obstacks.
17619 * src/files.c, src/files.h (obstack_save): Remove.
17620 (output_files): Remove.
17621 As a result, if one needs the former `.act' file, using an
17622 appropriate skeleton which requires actions and guards is now
17623 required.
17624 * src/main.c (main): Adjust.
17625 * tests/semantic.at: New.
17626 * tests/regression.at: Use `input.y' as input file name.
17627 Avoid 8+3 problems by requiring input.c when the test needs the
17628 parser.
17629
17630 2001-12-27 Akim Demaille <akim@epita.fr>
17631
17632 * src/reader.c (symbol_list_new): Be sure to initialize all the
17633 fields.
17634
17635 2001-12-27 Akim Demaille <akim@epita.fr>
17636
17637 All the hacks using a final pseudo state are now useless.
17638
17639 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17640 * src/lalr.c (nLA): New.
17641 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17642 instead of lookaheadsp from the pseudo state (nstate + 1).
17643
17644 2001-12-27 Akim Demaille <akim@epita.fr>
17645
17646 * src/output.c (action_row, token_actions): Use a state_t instead
17647 of a integer, and nlookaheads instead of the following state's
17648 lookaheadsp.
17649
17650 2001-12-27 Akim Demaille <akim@epita.fr>
17651
17652 * src/conflicts.c (log_resolution, flush_shift)
17653 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17654 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17655 (conflicts_print, print_reductions): Use a state_t instead of an
17656 integer when referring to a state.
17657 As much as possible, depend upon nlookaheads, instead of the
17658 `lookaheadsp' member of the following state (since lookaheads of
17659 successive states are successive, the difference between state n + 1
17660 and n served as the number of lookaheads for state n).
17661 * src/lalr.c (add_lookback_edge): Likewise.
17662 * src/print.c (print_core, print_actions, print_state)
17663 (print_results): Likewise.
17664 * src/print_graph.c (print_core, print_actions, print_state)
17665 (print_graph): Likewise.
17666 * src/conflicts.h: Adjust.
17667
17668 2001-12-27 Akim Demaille <akim@epita.fr>
17669
17670 * src/bison.hairy: Formatting/comment changes.
17671 ANSIfy.
17672 Remove `register' indications.
17673 Add plenty of `static'.
17674
17675 2001-12-27 Akim Demaille <akim@epita.fr>
17676
17677 * src/output.c (prepare): Drop the muscle `ntbase' which
17678 duplicates ntokens.
17679 * src/bison.simple: Formatting/comment changes.
17680 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17681 is an undocumented synonym.
17682
17683 2001-12-22 Akim Demaille <akim@epita.fr>
17684
17685 * src/output.c (output_table_data): Change the prototype to use
17686 `int' for array ranges: some invocations do pass an int, not a
17687 short.
17688 Reported by Wayne Green.
17689
17690 2001-12-22 Akim Demaille <akim@epita.fr>
17691
17692 Some actions of web2c.y are improperly triggered.
17693 Reported by Mike Castle.
17694
17695 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17696 * tests/regression.at (Web2c): Rename as...
17697 (Web2c Report): this.
17698 (Web2c Actions): New.
17699
17700 2001-12-22 Akim Demaille <akim@epita.fr>
17701
17702 Reductions in web2c.y are improperly reported.
17703 Reported by Mike Castle.
17704
17705 * src/conflicts.c (print_reductions): Fix.
17706 * tests/regression.at (Web2c): New.
17707
17708 2001-12-18 Akim Demaille <akim@epita.fr>
17709
17710 Some host fail on `assert (!"foo")', which expands to
17711 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17712 Reported by Nelson Beebee.
17713
17714 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17715 `#define it_succeeded 0' and `assert (it_succeeded)'.
17716
17717 2001-12-17 Marc Autret <autret_m@epita.fr>
17718
17719 * src/bison.simple: Don't hard code the skeleton line and filename.
17720 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17721 New line counter 'skeleton_line' (skeleton-line muscle).
17722
17723 2001-12-17 Paul Eggert <eggert@twinsun.com>
17724
17725 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17726 YYDEBUG must be defined to a nonzero value.
17727
17728 * src/bison.simple (yytname): Do not assume that the user defines
17729 YYDEBUG to a properly parenthesized expression.
17730
17731 2001-12-17 Akim Demaille <akim@epita.fr>
17732
17733 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17734 nlookaheads is a new member.
17735 Adjust all users.
17736 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17737 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17738 state.
17739
17740 2001-12-17 Akim Demaille <akim@epita.fr>
17741
17742 * src/files.h, src/files.c (open_files, close_files): Remove.
17743 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17744 let...
17745 * src/reader.c (reader): Do it.
17746
17747 2001-12-17 Akim Demaille <akim@epita.fr>
17748
17749 * src/conflicts.c (print_reductions): Formatting changes.
17750
17751 2001-12-17 Akim Demaille <akim@epita.fr>
17752
17753 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17754 (flush_reduce): New.
17755 (resolve_sr_conflict): Adjust.
17756
17757 2001-12-17 Akim Demaille <akim@epita.fr>
17758
17759 * src/output.c (output_obstack): Be static and rename as...
17760 (format_obstack): this, to avoid any confusion with files.c's
17761 output_obstack.
17762 * src/reader.h (muscle_obstack): Move to...
17763 * src/output.h: here, since it's defined in output.c.
17764
17765 2001-12-17 Akim Demaille <akim@epita.fr>
17766
17767 * src/output.c (action_row, save_column, default_goto)
17768 (sort_actions, matching_state, pack_vector): Better variable
17769 locality.
17770
17771 2001-12-17 Akim Demaille <akim@epita.fr>
17772
17773 * src/output.c: Various formatting changes.
17774
17775 2001-12-17 Akim Demaille <akim@epita.fr>
17776
17777 * src/files.c (output_files): Free the output_obstack.
17778 * src/main.c (main): Call print and print_graph conditionally.
17779 * src/print.c (print): Work unconditionally.
17780 * src/print_graph.c (print_graph): Work unconditionally.
17781 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17782
17783 2001-12-16 Marc Autret <autret_m@epita.fr>
17784
17785 * src/output.c (actions_output): Fix. When we use %no-lines,
17786 there is one less line per action.
17787
17788 2001-12-16 Marc Autret <autret_m@epita.fr>
17789
17790 * src/bison.simple: Remove a useless #line directive.
17791 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17792 * src/output.c (get_lines_number): New.
17793 (output_parser): Adjust, now takes care about the lines of a
17794 output muscles.
17795 Fix line numbering.
17796 (actions_output): Computes the number of lines taken by actions.
17797 (output_master_parser): Insert new skeleton which is the name of
17798 the output parser file name.
17799
17800 2001-12-15 Marc Autret <autret_m@epita.fr>
17801
17802 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17803
17804 2001-12-15 Marc Autret <autret_m@epita.fr>
17805
17806 * src/output.c (output_gram): Keep track of the hairy one.
17807
17808 2001-12-15 Akim Demaille <akim@epita.fr>
17809
17810 Make `make distcheck' work.
17811
17812 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17813 system.h which uses libgettext.h.
17814
17815 2001-12-15 Akim Demaille <akim@epita.fr>
17816
17817 * src/nullable.c (set_nullable): Useless rules must be skipped,
17818 otherwise, since we range over their symbols, we might look at a
17819 nonterminal which no longer ``exists'', i.e., it is not counted in
17820 `nvars', hence we overflow our arrays.
17821
17822 2001-12-15 Akim Demaille <akim@epita.fr>
17823
17824 The header can also be produced directly, without any obstack!
17825 Yahoo!
17826
17827 * src/files.c, src/files.h (defines_obstack): Remove.
17828 (compute_header_macro): Global.
17829 (defines_obstack_save): Remove.
17830 * src/reader.c (parse_union_decl): No longer output to
17831 defines_obstack: its content can be found in the `stype' muscle
17832 anyway.
17833 (output_token_translations): Merge into...
17834 (symbols_output): this.
17835 Rename as...
17836 (symbols_save): this.
17837 (reader): Adjust.
17838 * src/output.c (header_output): New.
17839 (output): Call it.
17840
17841 2001-12-15 Akim Demaille <akim@epita.fr>
17842
17843 * src/reader.c (parse_union_decl): Instead of handling two obstack
17844 simultaneously, use one to define the `stype' muscle, and use the
17845 value of the latter to fill defines_obstack.
17846 (copy_comment): Remove.
17847 (copy_comment2): Work for a single obstack.
17848 Rename as...
17849 (copy_comment): this.
17850
17851 2001-12-15 Akim Demaille <akim@epita.fr>
17852
17853 * src/lex.c, src/lex.h (xgetc): No longer static.
17854 * src/reader.c (parse_union_decl): Revamp.
17855
17856 2001-12-15 Akim Demaille <akim@epita.fr>
17857
17858 Still making progress in separating Bison into (i) input, (ii)
17859 process, (iii) output: now we can directly output the parser file
17860 without using table_obstack at all.
17861
17862 * src/files.c, src/files.h (table_obstack): Bye bye.
17863 (parser_file_name): New.
17864 * src/files.c (compute_output_file_names): Compute it.
17865 * src/output.c (actions_output, output_parser)
17866 (output_master_parser): To a file instead of an obstack.
17867
17868 2001-12-15 Akim Demaille <akim@epita.fr>
17869
17870 Attach actions to rules, instead of pre-outputting them to
17871 actions_obstack.
17872
17873 * src/gram.h (rule_t): action and action_line are new members.
17874 * src/reader.c (symbol_list): Likewise.
17875 (copy_action): Save the actions within the rule.
17876 (packgram): Save them in rule_table.
17877 * src/output.c (actions_output): New.
17878 (output_parser): Use it on `%%actions'.
17879 (output_rule_data): Don't free rule_table.
17880 (output): Do it.
17881 (prepare): Don't save the `action' muscle.
17882 * src/bison.simple: s/%%action/%%actions/.
17883
17884 2001-12-15 Akim Demaille <akim@epita.fr>
17885
17886 * src/reader.c (copy_action): When --yacc, don't append a `;'
17887 to the user action: let it fail if lacking.
17888 Suggested by Arnold Robbins and Tom Tromey.
17889
17890 2001-12-14 Akim Demaille <akim@epita.fr>
17891
17892 * src/lex.c (literalchar): Simply return the char you decoded, non
17893 longer mess around with obstacks and int pointers.
17894 Adjust all callers.
17895
17896 2001-12-14 Akim Demaille <akim@epita.fr>
17897
17898 * src/lex.c (literalchar): Don't escape the special characters,
17899 just decode them, and keep them as char (before, eol was output as
17900 the 2 char string `\n' etc.).
17901 * src/output.c (output_rule_data): Use quotearg to output the
17902 token strings.
17903
17904 2001-12-13 Paul Eggert <eggert@twinsun.com>
17905
17906 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17907 Do not infringe on the global user namespace when using C++.
17908 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17909 All uses of `fprintf' and `stderr' changed.
17910
17911 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17912
17913 2001-12-13 Akim Demaille <akim@epita.fr>
17914
17915 The computation of nullable is broken: it doesn't handle empty
17916 RHS's properly.
17917
17918 * tests/torture.at (GNU AWK Grammar): New.
17919 * tests/sets.at (Nullable): New.
17920 * src/nullable.c (set_nullable): Instead of blindly looping over
17921 `ritems', loop over the rules, and then over their rhs's.
17922
17923 Work around Autotest bugs.
17924
17925 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17926 frame, because Autotest understand lines starting with a `+' as
17927 traces from the shell. Then, they are not processed properly.
17928 Admittedly an Autotest bug, but we don't have time to wait for
17929 Autotest to catch up.
17930 * tests/regression.at (Broken Closure): Adjust to the new table
17931 frames.
17932 Move to...
17933 * tests/sets.at: here.
17934
17935 2001-12-13 Akim Demaille <akim@epita.fr>
17936
17937 * src/closure.c (closure): Use nrules instead of playing tricks
17938 with BITS_PER_WORD.
17939
17940 2001-12-13 Akim Demaille <akim@epita.fr>
17941
17942 * src/print.c (print_actions): Output the handling of `$' as the
17943 traces do: shifting the token EOF. Before EOF was treated as a
17944 nonterminal.
17945 * tests/regression.at: Adjust some tests.
17946 * src/print_graph.c (print_core): Complete the set of items via
17947 closure. The next-to-final and final states are still unsatisfying,
17948 but that's to be addressed elsewhere.
17949 No longer output the rule numbers, but do output the state number.
17950 A single loop for the shifts + gotos is enough, but picked a
17951 distinct color for each.
17952 (print_graph): Initialize and finalize closure.
17953
17954 2001-12-13 Akim Demaille <akim@epita.fr>
17955
17956 * src/reader.c (readgram): Remove dead code, an strip useless
17957 braces.
17958 (get_type): Remove, unused.
17959
17960 2001-12-12 Akim Demaille <akim@epita.fr>
17961
17962 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17963 on that of lib/error.c.
17964
17965 2001-12-12 Akim Demaille <akim@epita.fr>
17966
17967 Some hosts don't like `/' in includes.
17968
17969 * src/system.h: Include libgettext.h without qualifying the path.
17970 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17971 $(top_srcdir).
17972
17973 2001-12-11 Marc Autret <autret_m@epita.fr>
17974
17975 * src/output.c (output_parser): Remove useless muscle.
17976
17977 2001-12-11 Marc Autret <autret_m@epita.fr>
17978
17979 * src/bison.simple: Remove #line just before %%epilogue. It
17980 is now handled in ...
17981 * src/reader.c (read_additionnal_code): Add the output of a
17982 #line for the epilogue.
17983
17984 2001-12-10 Marc Autret <autret_m@epita.fr>
17985
17986 * src/reader.c (copy_definition): Re-use CPP-outed code which
17987 replace precedent remove.
17988 * src/bison.simple: Remove #line before %%prologue because
17989 %%input-line is wrong at this time.
17990
17991 2001-12-10 Marc Autret <autret_m@epita.fr>
17992
17993 * src/reader.c (symbols_output): Clean up.
17994 * src/output.c (output_gram, output): Clean up.
17995
17996 2001-12-10 Akim Demaille <akim@epita.fr>
17997
17998 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17999 * src/LR0.c (set_state_table): here.
18000 * src/lalr.c (lalr): Call it.
18001
18002 2001-12-10 Akim Demaille <akim@epita.fr>
18003
18004 * src/state.h (shifts): Remove the `number' member: shifts are
18005 attached to state, hence no longer need to be labelled with a
18006 state number.
18007
18008 2001-12-10 Akim Demaille <akim@epita.fr>
18009
18010 Now that states have a complete set of members, the linked list of
18011 shifts is useless: just fill directly the state's shifts member.
18012
18013 * src/state.h (shifts): Remove the `next' member.
18014 * src/LR0.c (first_state, last_state): Remove.
18015 Adjust the callers.
18016 (augment_automaton): Don't look for the shifts that must be added
18017 a shift on EOF: it is those of the state we looked for! But now,
18018 since shifts are attached, it is no longer needed to looking
18019 merely by its id: its number.
18020
18021 2001-12-10 Akim Demaille <akim@epita.fr>
18022
18023 * src/LR0.c (augment_automaton): Better variable locality.
18024 Remove an impossible branch: if there is a state corresponding to
18025 the start symbol being shifted, then there is shift for the start
18026 symbol from the initial state.
18027
18028 2001-12-10 Akim Demaille <akim@epita.fr>
18029
18030 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
18031 only when appropriate: when insert_start_shifting_state' is not
18032 invoked.
18033 * tests/regression.at (Rule Line Numbers): Adjust.
18034
18035 2001-12-10 Akim Demaille <akim@epita.fr>
18036
18037 * src/LR0.c (augment_automaton): Now that all states have shifts,
18038 merge the two cases addition shifts to the initial state.
18039
18040 2001-12-10 Akim Demaille <akim@epita.fr>
18041
18042 * src/lalr.c (set_state_table): Move to...
18043 * src/LR0.c: here.
18044 * src/lalr.c (lalr): Don't call it...
18045 * src/LR0.c (generate_states): do it.
18046 * src/LR0.h (first_state): Remove, only the table is used.
18047
18048 2001-12-10 Akim Demaille <akim@epita.fr>
18049
18050 * src/LR0.h (first_shift, first_reduction): Remove.
18051 * src/lalr.c: Don't use first_shift: find shifts through the
18052 states.
18053
18054 2001-12-10 Akim Demaille <akim@epita.fr>
18055
18056 * src/LR0.c: Attach shifts to states as soon as they are
18057 computed.
18058 * src/lalr.c (set_state_table): Instead of assigning shifts to
18059 state, just assert that the mapping was properly done.
18060
18061 2001-12-10 Akim Demaille <akim@epita.fr>
18062
18063 * src/LR0.c (insert_start_shift): Rename as...
18064 (insert_start_shifting_state): this.
18065 (insert_eof_shifting_state, insert_accepting_state): New.
18066 (augment_automaton): Adjust.
18067 Better locality of the variables.
18068 When looking if the start_symbol is shifted from the initial
18069 state, using `while (... symbol != start_symbol ...)' sounds
18070 better than `while (... symbol < start_symbol ...)': If fail
18071 to see how the order between symbols could be relevant!
18072
18073 2001-12-10 Akim Demaille <akim@epita.fr>
18074
18075 * src/getargs.h: Don't declare `spec_name_prefix' and
18076 `spec_file_prefix', declared by src/files.h.
18077 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
18078 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
18079 * src/output.c (prepare): Adjust.
18080 * src/reader.c (symbols_output): Likewise.
18081 * src/vmsgetargs.c: Vaguely adjust, but who cares?
18082
18083 2001-12-10 Akim Demaille <akim@epita.fr>
18084
18085 * src/muscle_tab.c (muscle_init): NULL is a better default than
18086 `"0"'.
18087
18088 2001-12-10 Akim Demaille <akim@epita.fr>
18089
18090 * src/reader.c (reader): Calling symbols_output once is enough.
18091
18092 2001-12-10 Akim Demaille <akim@epita.fr>
18093
18094 Now that states have a complete set of members, the linked list of
18095 reductions is useless: just fill directly the state's reductions
18096 member.
18097
18098 * src/state.h (struct reductions): Remove member `number' and
18099 `next'.
18100 * src/LR0.c (first_reduction, last_reduction): Remove.
18101 (save_reductions): Don't link the new reductions, store them in
18102 this_state.
18103 * src/lalr.c (set_state_table): No need to attach reductions to
18104 states, it's already done.
18105 * src/output.c (output_actions): No longer free the shifts, then
18106 the reductions, then the states: free all the states and their
18107 members.
18108
18109 2001-12-10 Akim Demaille <akim@epita.fr>
18110
18111 * src/options.c (OPTN, DRTV, BOTH): New.
18112 (option_table): Use them.
18113
18114 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18115 the job of system.h.
18116 * src/options.c: Don't include stdio.h and xalloc.h for the same
18117 reasons.
18118
18119 2001-12-10 Akim Demaille <akim@epita.fr>
18120
18121 * src/output.c (output, prepare): Make sure the values of the
18122 muscles `action' and `prologue' are 0-terminated.
18123
18124 2001-12-10 Akim Demaille <akim@epita.fr>
18125
18126 Clean up GCC warnings.
18127
18128 * src/reader.c (copy_action): `buf' is not used.
18129 (parse_skel_decl): Be static.
18130 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18131 * src/options.h (create_long_option_table): Have a real prototype.
18132 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18133 (hash_delete_at): Return const void *.
18134 Adjust casts to preserve the const.
18135
18136 2001-12-10 Akim Demaille <akim@epita.fr>
18137
18138 * configure.in: Require 2.52g.
18139 M4 is not needed, but AUTOM4TE is.
18140 * m4/m4.m4: Remove.
18141 * tests/Makefile.am: Adjust.
18142
18143 2001-12-10 Akim Demaille <akim@epita.fr>
18144
18145 One structure for states is enough, even though theoretically
18146 there are LR(0) states and LALR(1) states.
18147
18148 * src/lalr.h (state_t): Remove.
18149 (state_table): Be state_t **, not state_t *.
18150 * src/state.h (core, CORE_ALLOC): Rename as...
18151 (state_t, STATE_ALLOC): this.
18152 Add the LALR(1) members: shifts, reductions, errs.
18153 * src/LR0.c (state_table): Rename as...
18154 (state_hash): this, to avoid name clashes with the global
18155 `state_table'.
18156 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18157 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18158
18159 2001-12-10 Akim Demaille <akim@epita.fr>
18160
18161 Bison dumps core on bash.y.
18162 Reported by Pascal Bart.
18163
18164 * src/warshall.c (bitmatrix_print): New.
18165 (TC): Use it.
18166 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
18167 j must be the outer loop.
18168 * tests/regression.at (Broken Closure): New.
18169
18170 2001-12-05 Akim Demaille <akim@epita.fr>
18171
18172 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18173 its argument.
18174 Reported by Peter Hamorsky.
18175
18176 2001-12-05 Akim Demaille <akim@epita.fr>
18177
18178 * src/conflicts.c (err_table): Remove.
18179 (resolve_sr_conflict): Adjust.
18180 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18181 Rename as...
18182 (state_t.reductions, state_t.shifts): this.
18183
18184 2001-12-05 Akim Demaille <akim@epita.fr>
18185
18186 * src/reduce.c (reduce_grammar_tables): No longer disable the
18187 removal of useless rules via CPP but via `if (0)', so that the
18188 compiler still check the code is valid.
18189 For instance, it should have noticed `rline' no longer exists: use
18190 the `line' member of rule_t.
18191 * src/gram.c (dummy, rline): Remove, unused.
18192
18193 2001-12-05 Akim Demaille <akim@epita.fr>
18194
18195 * src/output.c (pack_vector): Use assert, not berror.
18196 * src/main.c (berror): Remove, unused.
18197
18198 2001-12-05 Akim Demaille <akim@epita.fr>
18199
18200 New experimental feature: if --verbose --trace output all the
18201 items of a state, not only its kernel.
18202
18203 * src/print.c (print_core): If `trace_flag', then invoke closure
18204 before outputting the items of the state (print_core is no longer
18205 a correct name them).
18206 (print_results): Invoke new_closure/free_closure if needed.
18207
18208 2001-12-05 Akim Demaille <akim@epita.fr>
18209
18210 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18211 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18212 (nitemset): for consistency with the rest of the project.
18213
18214 2001-12-05 Akim Demaille <akim@epita.fr>
18215
18216 * src/closure.c (print_closure): Improve.
18217 (closure): Use it for printing input and output.
18218
18219 2001-12-05 Akim Demaille <akim@epita.fr>
18220
18221 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18222 indexed by nonterminals.
18223
18224 2001-12-05 Akim Demaille <akim@epita.fr>
18225
18226 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18227 what it was!).
18228 * src/warshall.h: Remove accidental duplication of the content.
18229
18230 2001-12-05 Akim Demaille <akim@epita.fr>
18231
18232 * src/closure.c (set_fderives): De-obfuscate.
18233
18234 2001-12-05 Akim Demaille <akim@epita.fr>
18235
18236 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18237
18238 2001-12-05 Akim Demaille <akim@epita.fr>
18239
18240 * src/closure.c (set_firsts): De-obfuscate.
18241
18242 2001-12-05 Akim Demaille <akim@epita.fr>
18243
18244 * src/output.c (action_row): De-obfuscate
18245 using the good o' techniques: arrays not pointers, variable
18246 locality, BITISSET, RESETBIT etc.
18247
18248 2001-12-05 Akim Demaille <akim@epita.fr>
18249
18250 Pessimize the code to simplify it: from now on, all the states
18251 have a valid SHIFTS, which NSHIFTS is possibly 0.
18252
18253 * src/LR0.c (shifts_new): Be global and move to..
18254 * src/state.c, src/state.h: here.
18255 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18256 * src/print_graph: Adjust.
18257
18258 2001-12-05 Akim Demaille <akim@epita.fr>
18259
18260 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18261 * src/conflicts.c: Use it.
18262 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18263 incorrectly ``simplified''.
18264
18265 2001-12-05 Akim Demaille <akim@epita.fr>
18266
18267 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18268 using the good o' techniques: arrays not pointers, variable
18269 locality, BITISSET, RESETBIT etc.
18270
18271 2001-12-05 Akim Demaille <akim@epita.fr>
18272
18273 * src/state.h (SHIFT_SYMBOL): New.
18274 * src/conflicts.c: Use it to deobfuscate.
18275
18276 2001-12-05 Akim Demaille <akim@epita.fr>
18277
18278 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18279 (print_reductions): De-obfuscate using the good o' techniques:
18280 arrays not pointers, variable locality, BITISSET.
18281
18282 2001-12-05 Akim Demaille <akim@epita.fr>
18283
18284 * src/conflicts.c (print_reductions): Arrays, not pointers.
18285 Use BITISSET.
18286
18287 2001-12-05 Akim Demaille <akim@epita.fr>
18288
18289 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18290
18291 2001-12-05 Akim Demaille <akim@epita.fr>
18292
18293 * src/conflicts.c (print_reductions): Improve variable locality.
18294
18295 2001-12-05 Akim Demaille <akim@epita.fr>
18296
18297 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18298
18299 2001-12-05 Akim Demaille <akim@epita.fr>
18300
18301 * src/conflicts.c (print_reductions): Improve variable locality.
18302
18303 2001-12-05 Akim Demaille <akim@epita.fr>
18304
18305 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18306 * src/lalr.c: Use them.
18307
18308 2001-12-05 Akim Demaille <akim@epita.fr>
18309
18310 * src/LR0.c (augment_automaton): Formatting changes.
18311 Better variable locality.
18312
18313 2001-12-05 Akim Demaille <akim@epita.fr>
18314
18315 * src/lalr.c (matrix_print): New.
18316 (transpose): Use it.
18317 Use arrays instead of pointers.
18318
18319 2001-12-05 Akim Demaille <akim@epita.fr>
18320
18321 * src/lalr.c (maxrhs): Move to...
18322 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18323 * src/lalr.c (build_relations): Adjust.
18324
18325 2001-12-05 Akim Demaille <akim@epita.fr>
18326
18327 * src/lalr.c (transpose): Free the memory allocated to the
18328 argument, as it is replaced by the results by the unique caller.
18329 (build_relations): Merely invoke transpose: it handles the memory
18330 deallocation.
18331 Improve variable locality.
18332 Avoid variables used as mere abbreviations.
18333 (compute_lookaheads): Use arrays instead of pointers.
18334
18335 2001-12-05 Akim Demaille <akim@epita.fr>
18336
18337 * src/lalr.c (initialize_F): Improve variable locality.
18338 Avoid variables used as mere abbreviations.
18339
18340 2001-12-05 Akim Demaille <akim@epita.fr>
18341
18342 * src/derives.c (print_derives): Display the ruleno.
18343 * src/lalr.c (initialize_F, transpose): Better variable locality
18344 to improve readability.
18345 Avoid variables used as mere abbreviations.
18346
18347 2001-12-05 Akim Demaille <akim@epita.fr>
18348
18349 * src/lalr.c (traverse): Use arrays instead of pointers.
18350
18351 2001-12-05 Akim Demaille <akim@epita.fr>
18352
18353 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18354 the handling of squeue.
18355 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18356
18357 2001-12-05 Akim Demaille <akim@epita.fr>
18358
18359 Because useless nonterminals are now kept alive (instead of being
18360 `destroyed'), we now sometimes examine them, and store information
18361 related to them. Hence we need to know their number, and adjust
18362 memory allocations.
18363
18364 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18365 static.
18366 * src/LR0.c (allocate_itemsets): The memory allocated to
18367 `symbol_count' was used for two different purpose: once to count
18368 the number of occurrences of each symbol, and later reassigned to
18369 `shift_symbol', containing the symbol that can be shifted from a
18370 given state.
18371 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18372 only, and...
18373 (new_itemsets): Allocate `shift_symbol' here.
18374 (allocate_itemsets): symbol_count includes useless nonterminals.
18375 Make room for them.
18376 (free_storage): Use `free', not `XFREE', for pointers that cannot
18377 be null.
18378
18379 2001-12-05 Akim Demaille <akim@epita.fr>
18380
18381 * src/nullable.c (set_nullable): Deobfuscate the handling of
18382 ritem.
18383 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18384
18385 2001-12-05 Akim Demaille <akim@epita.fr>
18386
18387 * src/gram.c, src/gram.h (ritem_print): New.
18388 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18389 (This useless function was defined only to work around VMS linkers
18390 that can't handle compilation units with variables only).
18391 * src/reduce.c (dump_grammar): Use it to trace the construction of
18392 ritem.
18393
18394 2001-12-04 Paul Eggert <eggert@twinsun.com>
18395
18396 * src/bison.simple (union yyalloc): Change member names
18397 to be the same as the stack names.
18398 (yyparse): yyptr is now union yyalloc *, not char *.
18399 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18400 and may generate better code on some machines.
18401 (yystpcpy): Use prototype if __STDC__ is defined, not just
18402 if __cplusplus is defined.
18403
18404 2001-11-30 Akim Demaille <akim@epita.fr>
18405
18406 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18407 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18408 Gettext doesn't compile cleanly, and dies with -Werror.
18409 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18410 Include WARNING_CFLAGS here.
18411 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18412 before being defined.
18413
18414 2001-11-27 Paul Eggert <eggert@twinsun.com>
18415
18416 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18417 First arg is int, not unsigned.
18418 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18419 (SIZE_MAX, UINT_MAX): New macros.
18420 (quotearg_n_options): Abort if N is negative.
18421 Avoid overflow check on hosts where size_t is 64 bits and int
18422 is 32 bits, as overflow is impossible there.
18423 Fix off-by-one typo that caused unnecessary reallocation.
18424
18425 2001-11-29 Paul Eggert <eggert@twinsun.com>
18426
18427 Name space cleanup in generated parser.
18428
18429 * doc/bison.texinfo (Bison Parser): Discuss system headers
18430 and their effect on the user name space.
18431
18432 * src/bison.simple:
18433 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18434 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18435 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18436
18437 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18438 on user names when possible.
18439
18440 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18441 Simplify test for whather <alloca.h> exists.
18442
18443 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18444
18445 (<stdio.h>): Include if YYDEBUG.
18446
18447 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18448 ! defined (yyoverflow) && ! defined (yymemcpy).
18449
18450 (yymemcpy, yyparse): Rename local variables as needed so that
18451 they all begin with 'yy'.
18452
18453 (yystrlen, yystpcpy): New functions.
18454
18455 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18456 All uses changed.
18457
18458 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18459 instead of relying on string.h functions. Use YYSTACK_ALLOC
18460 and YYSTACK_FREE instead of malloc and free.
18461
18462 2001-11-30 Akim Demaille <akim@epita.fr>
18463
18464 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18465 before their first uses.
18466 (YYBISON, YYPURE): Move to the top of the output.
18467
18468 2001-11-30 Akim Demaille <akim@epita.fr>
18469
18470 * tests/reduce.at (Useless Nonterminals): Fix.
18471
18472 2001-11-30 Akim Demaille <akim@epita.fr>
18473
18474 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18475 if body instead of `;' to pacify GCC's warnings.
18476
18477 2001-11-30 Akim Demaille <akim@epita.fr>
18478
18479 Instead of mapping the LHS of unused rules to -1, keep the LHS
18480 valid, but flag the rules as invalid.
18481
18482 * src/gram.h (rule_t): `useful' is a new member.
18483 * src/print.c (print_grammar): Adjust.
18484 * src/derives.c (set_derives): Likewise.
18485 * src/reader.c (packgram, reduce_output): Likewise.
18486 * src/reduce.c (reduce_grammar_tables): Likewise.
18487 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18488
18489 2001-11-30 Akim Demaille <akim@epita.fr>
18490
18491 * src/reduce.c (reduce_output): Formatting changes.
18492 * src/print.c (print_results, print_grammar): Likewise.
18493 * tests/regression.at (Rule Line Numbers)
18494 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18495
18496 2001-11-30 Akim Demaille <akim@epita.fr>
18497
18498 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18499 useless nonterminals, move them at the end of the symbol arrays.
18500 (reduce_output): Adjust.
18501 * tests/reduce.at (Useless Nonterminals): Adjust.
18502
18503 2001-11-30 Akim Demaille <akim@epita.fr>
18504
18505 * src/reduce.c: Various comment/formatting changes.
18506 (nonterminals_reduce): New, extracted from...
18507 (reduce_grammar_tables): here.
18508 (reduce_grammar): Call nonterminals_reduce.
18509
18510 2001-11-29 Paul Eggert <eggert@twinsun.com>
18511
18512 * src/bison.simple (YYSTACK_REALLOC): Remove.
18513 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18514 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18515 New macros.
18516 (union yyalloc): New type.
18517 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18518 an arbitrary restriction on hosts where size_t is wider than int.
18519
18520 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18521 a parser stack overflow. Allocate just one block of memory for all
18522 three stacks, instead of allocating three blocks; this typically is
18523 faster and reduces fragmentation.
18524
18525 Do not limit the number of items in the stack to a value that fits
18526 in 'int', as this is an arbitrary limit on hosts with 64-bit
18527 size_t and 32-bit int.
18528
18529 2001-11-29 Marc Autret <autret_m@epita.fr>
18530
18531 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18532 of defining YYERROR_VERBOSE.
18533 [AT_DATA]: $4 is now out of C declarations in the prologue.
18534
18535 2001-11-28 Marc Autret <autret_m@epita.fr>
18536
18537 * src/reader.c (parse_dquoted_param): New.
18538 (parse_skel_decl): Use it.
18539 * src/lex.h: Add its prototype.
18540 * src/lex.c (literalchar): Become not static.
18541
18542 2001-11-28 Marc Autret <autret_m@epita.fr>
18543
18544 * src/output.h: And put its extern declaration here.
18545 * src/output.c (error_verbose): Define here.
18546 (prepare): Echo name modification.
18547 * src/getargs.h: Clean its extern declaration.
18548 * src/getargs.c (error_verbose_flag): Remove.
18549 (getargs): Remove case 'e'.
18550 * src/options.c (option_table): 'error-verbose' is now seen as simple
18551 percent option.
18552 Include output.h.
18553
18554 * src/reader.c (read_declarations): Remove case tok_include.
18555 (parse_include_decl): Remove.
18556 * src/lex.h (token_t): Remove tok_include.
18557 * src/options.c (option_table): 'include' is now a simple command line
18558 option.
18559
18560 2001-11-28 Marc Autret <autret_m@epita.fr>
18561
18562 * src/bison.simple: Adjust muscle names.
18563 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18564 * src/output.c (prepare): s/_/-/ for the muscles names.
18565 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18566
18567 2001-11-28 Marc Autret <autret_m@epita.fr>
18568
18569 * src/bison.simple: Fix debug.
18570 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18571
18572 2001-11-28 Akim Demaille <akim@epita.fr>
18573
18574 * src/LR0.c (shifts_new): New.
18575 (save_shifts, insert_start_shift, augment_automaton): Use it.
18576
18577 2001-11-28 Akim Demaille <akim@epita.fr>
18578
18579 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18580 keep ruleno only.
18581
18582 2001-11-28 Akim Demaille <akim@epita.fr>
18583
18584 * src/closure.c (closure): Instead of looping over word in array
18585 then bits in words, loop over bits in array.
18586
18587 2001-11-28 Akim Demaille <akim@epita.fr>
18588
18589 * src/closure.c (closure): No longer optimize the special case
18590 where all the bits of `ruleset[r]' are set to 0, to make the code
18591 clearer.
18592
18593 2001-11-28 Akim Demaille <akim@epita.fr>
18594
18595 * src/closure.c (closure): `r' and `c' are new variables, used to
18596 de-obfuscate accesses to RULESET and CORE.
18597
18598 2001-11-28 Akim Demaille <akim@epita.fr>
18599
18600 * src/reduce.c (reduce_print): Use ngettext.
18601 (dump_grammar): Improve the trace accuracy.
18602
18603 2001-11-28 Akim Demaille <akim@epita.fr>
18604
18605 * src/reduce.c (dump_grammar): Don't translate trace messages.
18606
18607 2001-11-28 Akim Demaille <akim@epita.fr>
18608
18609 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18610 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18611 as all tags are free'ed afterwards.
18612 From Enrico Scholz.
18613
18614 2001-11-27 Paul Eggert <eggert@twinsun.com>
18615
18616 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18617 use alloca when we didn't want to, and vice versa.
18618
18619 2001-11-27 Marc Autret <autret_m@epita.fr>
18620
18621 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18622 initialization.
18623 * src/output.c (prepare): Remove its update.
18624
18625 2001-11-27 Marc Autret <autret_m@epita.fr>
18626
18627 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18628 Use %error-verbose.
18629
18630 2001-11-27 Marc Autret <autret_m@epita.fr>
18631
18632 * src/bison.simple: Remove YYERROR_VERBOSE using.
18633 Use %%error_verbose.
18634 (yyparse): Likewise.
18635 * src/output.c (prepare): Give its final value.
18636 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18637 * src/getargs.h: Add its extern declaration.
18638 * src/getargs.c (error_verbose_flag): New int.
18639 (getargs): Update to catch new case.
18640 * src/options.c (option_table): 'error-verbose' is a new option.
18641 (shortopts): Update.
18642
18643 2001-11-27 Akim Demaille <akim@epita.fr>
18644
18645 * src/system.h: Use intl/libgettext.h.
18646 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18647
18648 2001-11-27 Akim Demaille <akim@epita.fr>
18649
18650 * tests/torture.at (Exploding the Stack Size with Malloc):
18651 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18652
18653 2001-11-27 Akim Demaille <akim@epita.fr>
18654
18655 * src/files.c: Include error.h.
18656 Reported by Hans Aberg.
18657
18658 2001-11-26 Marc Autret <autret_m@epita.fr>
18659
18660 * src/reader.c (parse_include_decl): New, not yet implemented.
18661 (read_declarations): Add case tok_include.
18662 * src/getargs.h (include): Add its extern definition.
18663 * src/getargs.c (include): New const char *.
18664 (getargs): Add case '-I'.
18665 * src/options.c (option_table): Add include as command line and
18666 percent option.
18667 * src/lex.h (token_t): Add tok_include.
18668
18669 2001-11-26 Akim Demaille <akim@epita.fr>
18670
18671 * src/reader.c (readgram): Make sure rules for mid-rule actions
18672 have a lineno equal to that of their host rule.
18673 Reported by Hans Aberg.
18674 * tests/regression.at (Rule Line Numbers): New.
18675
18676 2001-11-26 Akim Demaille <akim@epita.fr>
18677
18678 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18679 size_ts.
18680
18681 2001-11-26 Akim Demaille <akim@epita.fr>
18682
18683 * src/complain.c, src/complain.h (error): Remove, provided by
18684 lib/error.[ch].
18685
18686 2001-11-26 Akim Demaille <akim@epita.fr>
18687
18688 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18689 issue an error message.
18690 * tests/regression.at (Invalid %directive): New.
18691 Reported by Hans Aberg.
18692
18693 2001-11-26 Akim Demaille <akim@epita.fr>
18694
18695 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18696 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18697
18698 2001-11-26 Akim Demaille <akim@epita.fr>
18699
18700 * src/conflicts.c (conflicts_print): Don't complain at all when
18701 there are no reduce/reduce conflicts, and as many shift/reduce
18702 conflicts as expected.
18703 * tests/regression.at (%expect right): Adjust.
18704
18705 2001-11-23 Akim Demaille <akim@epita.fr>
18706
18707 * lib/alloca.c: Update, from fileutils.
18708
18709 2001-11-23 Akim Demaille <akim@epita.fr>
18710
18711 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18712
18713 2001-11-23 Akim Demaille <akim@epita.fr>
18714
18715 * src/system.h: Include alloca.h.
18716 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18717
18718 2001-11-23 Akim Demaille <akim@epita.fr>
18719
18720 * src/print_graph.c (print_actions): Remove `rule', unused.
18721 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18722 pacify GCC's signed < unsigned warnings.
18723 * src/closure.c (itemsetsize): Likewise.
18724 * src/reader.c (symbol_list_new): Static.
18725
18726 2001-11-23 Akim Demaille <akim@epita.fr>
18727
18728 Attaching lineno to buckets is stupid, since only one copy of each
18729 symbol is kept, only the line of the first occurrence is kept too.
18730
18731 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18732 * src/reader.c (rline_allocated): Remove, unused.
18733 (symbol_list): Have a `line' member.
18734 (symbol_list_new): New.
18735 (readgram): Use it.
18736 * src/print.c (print_grammar): Output the rule line numbers.
18737 * tests/regression.at (Solved SR Conflicts)
18738 (Unresolved SR Conflicts): Adjust.
18739 Reported by Hans Aberg.
18740
18741 2001-11-22 Marc Autret <autret_m@epita.fr>
18742
18743 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18744
18745 2001-11-22 Marc Autret <autret_m@epita.fr>
18746
18747 * src/muscle_tab.c (muscle_init): Remove initialization of
18748 skeleton muscle.
18749 * src/output.c (output_master_parser): Do it here.
18750
18751 2001-11-20 Akim Demaille <akim@epita.fr>
18752
18753 * po/sv.po: New.
18754 * configure.in (ALL_LINGUAS): Adjust.
18755 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18756 longer contains strings to translate.
18757
18758 2001-11-19 Akim Demaille <akim@epita.fr>
18759
18760 * src/conflicts.c (conflicts_print): Add a missing \n.
18761
18762 2001-11-19 Akim Demaille <akim@epita.fr>
18763
18764 * src/nullable.c (nullable_print): New.
18765 (set_nullable): Call it when tracing.
18766 Better locality of variables.
18767
18768 2001-11-19 Akim Demaille <akim@epita.fr>
18769
18770 * src/print.c (print_actions): Better locality of variables.
18771
18772 2001-11-19 Akim Demaille <akim@epita.fr>
18773
18774 * src/derives.c (print_derives): Fix and enrich.
18775 * src/closure.c (print_fderives): Likewise.
18776
18777 2001-11-19 Akim Demaille <akim@epita.fr>
18778
18779 * src/closure.c (itemsetend): Remove, replaced with...
18780 (itemsetsize): new.
18781
18782 2001-11-19 Akim Demaille <akim@epita.fr>
18783
18784 * src/LR0.c (kernel_end): Remove, replaced with...
18785 (kernel_size): new.
18786
18787 2001-11-19 Akim Demaille <akim@epita.fr>
18788
18789 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18790 to clarify.
18791
18792 2001-11-19 Akim Demaille <akim@epita.fr>
18793
18794 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18795
18796 2001-11-19 Akim Demaille <akim@epita.fr>
18797
18798 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18799 trace messages.
18800 * src/LR0.c: Likewise.
18801 (allocate_itemsets): Use arrays instead of pointers to clarify.
18802
18803 2001-11-19 Akim Demaille <akim@epita.fr>
18804
18805 * src/getargs.c (statistics_flag): Replace with...
18806 (trace_flag): New.
18807 (longopts): Accept --trace instead of --statistics.
18808 * src/getargs.h, src/options.c: Adjust.
18809 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18810 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18811
18812 2001-11-19 Akim Demaille <akim@epita.fr>
18813
18814 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
18815 pointers to clarify the code.
18816 (save_reductions, save_shifts): Factor common parts of alternatives.
18817
18818 2001-11-19 Akim Demaille <akim@epita.fr>
18819
18820 * src/LR0.c (new_state, get_state): Complete TRACE code.
18821 * src/closure.c: Include `reader.h' to get `tags', needed by the
18822 trace code.
18823 Rename the conditional DEBUG as TRACE.
18824 Output consistently TRACEs to stderr, not stdout.
18825 * src/derives.c: Likewise.
18826 * src/reduce.c: (inaccessable_symbols): Using if is better style
18827 than goto.
18828 Use `#if TRACE' instead of `#if 0' for tracing code.
18829
18830 2001-11-19 Akim Demaille <akim@epita.fr>
18831
18832 * src/system.h (LIST_FREE, shortcpy): New.
18833 * src/LR0.c: Use them.
18834 * src/output.c (free_itemsets, free_reductions, free_shifts):
18835 Remove, replaced by LIST_FREE.
18836
18837 2001-11-19 Akim Demaille <akim@epita.fr>
18838
18839 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18840 (REDUCTIONS_ALLOC): New.
18841 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18842 allocation.
18843
18844 2001-11-19 Akim Demaille <akim@epita.fr>
18845
18846 * src/LR0.c (new_state): Complete trace code.
18847 * src/nullable.c (set_nullable): Don't translate traces.
18848
18849 2001-11-19 Akim Demaille <akim@epita.fr>
18850
18851 * src/print_graph.c (print_core): Better locality of variables.
18852 * src/print.c (print_core): Likewise.
18853
18854 2001-11-19 Akim Demaille <akim@epita.fr>
18855
18856 * src/vcg.c: You do the output, so you are responsible of the
18857 handling of VCG syntax, in particular: use quotearg.
18858 * src/print_graph.c: Don't.
18859 (print_actions): Don't output the actions as part of the nodes,
18860 since that's the job of the edges.
18861 (print_state): Don't output by hand: fill the node description,
18862 and ask for its output.
18863
18864 2001-11-19 Akim Demaille <akim@epita.fr>
18865
18866 * src/bison.simple (yyparse): When verbosely reporting an error,
18867 no longer put additional quotes around token names.
18868 * tests/calc.at: Adjust.
18869
18870 2001-11-19 Akim Demaille <akim@epita.fr>
18871
18872 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18873 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18874 * src/output.c: Adjust.
18875
18876 2001-11-19 Akim Demaille <akim@epita.fr>
18877
18878 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18879 (rule_t): this.
18880 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18881
18882 2001-11-19 Akim Demaille <akim@epita.fr>
18883
18884 * src/gram.h (rule_t): New.
18885 (rule_table): New.
18886 (rrhs, rlhs): Remove, part of state_t.
18887 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18888 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18889 * src/reader.c, src/reduce.c: Adjust.
18890
18891 2001-11-19 Akim Demaille <akim@epita.fr>
18892
18893 * src/reader.c (symbols_output): New, extracted from...
18894 (packsymbols): Here.
18895 (reader): Call it.
18896
18897 2001-11-19 Akim Demaille <akim@epita.fr>
18898
18899 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18900 (maxrhs): this new function.
18901
18902 2001-11-19 Akim Demaille <akim@epita.fr>
18903
18904 * src/lalr.c (F): New macro to access the variable F.
18905 Adjust.
18906
18907 2001-11-19 Akim Demaille <akim@epita.fr>
18908
18909 * src/lalr.h (LA): New macro to access the variable LA.
18910 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18911 * src/lalr.c: Adjust.
18912
18913 2001-11-19 Akim Demaille <akim@epita.fr>
18914
18915 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18916 (set_state_table): handle the `lookaheads' members.
18917
18918 2001-11-19 Akim Demaille <akim@epita.fr>
18919
18920 * src/lalr.h (lookaheads): Removed array, whose contents is now
18921 a member of...
18922 (state_t): this structure.
18923 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18924 Adjust.
18925
18926 2001-11-19 Akim Demaille <akim@epita.fr>
18927
18928 * src/lalr.h (consistent): Removed array, whose contents is now
18929 a member of...
18930 (state_t): this structure.
18931 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18932 Adjust.
18933
18934 2001-11-19 Akim Demaille <akim@epita.fr>
18935
18936 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18937 contents are now members of...
18938 (state_t): this structure.
18939 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18940 Adjust.
18941
18942 2001-11-19 Akim Demaille <akim@epita.fr>
18943
18944 * src/lalr.h (state_t): New.
18945 (state_table): Be a state_t * instead of a core **.
18946 (accessing_symbol): Remove, part of state_t.
18947 * src/lalr.c: Adjust.
18948 (set_accessing_symbol): Merge into...
18949 (set_state_table): this.
18950 * src/print_graph.c, src/conflicts.c: Adjust.
18951
18952 2001-11-14 Akim Demaille <akim@epita.fr>
18953
18954 * tests/calc.at, tests/output.at, tests/regression.at,
18955 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18956 now the tests are run in private dirs, therefore AC_CLEANUP and
18957 family can be simplified to 0-ary.
18958 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18959 use abs. path to find config.h.
18960 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18961 stderr, there can be way too much random noise.
18962 Instead pass -Werror to GCC and rely on the exit status.
18963 Reported by Wolfram Wagner.
18964
18965 2001-11-14 Akim Demaille <akim@epita.fr>
18966
18967 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18968 defined only if yyoverflow is defined, to avoid `warning: unused
18969 variable `yyvs1''.
18970 Reported by The Test Suite.
18971
18972 2001-11-14 Akim Demaille <akim@epita.fr>
18973
18974 * src/print.c: Include reduce.h.
18975 Reported by Hans Aberg.
18976
18977 2001-11-14 Akim Demaille <akim@epita.fr>
18978
18979 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18980 Revert a previous patch: these are really const.
18981 * src/conflicts.c (conflict_report): Additional useless pair of
18982 braces to pacify GCC's warnings for `if () if () {} else {}'.
18983 * src/lex.c (parse_percent_token): Replace equal_offset with
18984 arg_offset.
18985 arg is const.
18986 Be sure to strdup `arg' when used, since there is no reason for
18987 token_buffer not to change.
18988
18989 2001-11-14 Akim Demaille <akim@epita.fr>
18990
18991 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18992 definition.
18993 * src/main.c (main): Use them.
18994 Suggested by Hans Aberg.
18995
18996 2001-11-12 Akim Demaille <akim@epita.fr>
18997
18998 * src/system.h (ngettext): Now that we use ngettext, be sure to
18999 provide a default definition when NLS are not used.
19000
19001 2001-11-12 Akim Demaille <akim@epita.fr>
19002
19003 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
19004 Use @kbd to denote user input.
19005 (Language and Grammar): ANSIfy the example.
19006 Adjust its layout for info/notinfo.
19007 (Location Tracking Calc): Output error messages to stderr.
19008 Output locations in a more GNUtically correct way.
19009 Fix a couple of Englishos.
19010 Adjust @group/@end group pairs.
19011
19012 2001-11-12 Akim Demaille <akim@epita.fr>
19013
19014 %expect was not functioning at all.
19015
19016 * src/conflicts.c (expected_conflicts): Set to -1.
19017 (conflict_report): Use ngettext.
19018 (conflicts_print): Check %expect and make its violation an error.
19019 * doc/bison.texinfo (Expect Decl): Adjust.
19020 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
19021 * tests/regression.at (%expect not enough, %expect right)
19022 (%expect too much): New.
19023
19024 2001-11-12 Akim Demaille <akim@epita.fr>
19025
19026 * tests/regression.at (Conflicts): Rename as...
19027 (Unresolved SR Conflicts): this.
19028 (Solved SR Conflicts): New.
19029
19030 2001-11-12 Akim Demaille <akim@epita.fr>
19031
19032 * src/reduce.c (print_results): Rename as...
19033 (reduce_output): This.
19034 Output to OUT, passed as argument, instead of output_obstack.
19035 (dump_grammar): Likewise.
19036 (reduce_free): New.
19037 Also free V1.
19038 (reduce_grammar): No longer call reduce_output, since...
19039 * src/print.c (print_results): do it.
19040 * src/main.c (main): Call reduce_free;
19041
19042 2001-11-12 Akim Demaille <akim@epita.fr>
19043
19044 * src/conflicts.c (print_reductions): Accept OUT as argument.
19045 Output to it, not to output_obstack.
19046 * src/print.c (print_actions): Adjust.
19047
19048 2001-11-12 Akim Demaille <akim@epita.fr>
19049
19050 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
19051 the result instead of using...
19052 (src_total, rrc_total, src_count, rrc_count): Remove.
19053 (any_conflicts): Remove.
19054 (print_conflicts): Split into...
19055 (conflicts_print, conflicts_output): New.
19056 * src/conflicts.h: Adjust.
19057 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
19058 * src/print.c (print_grammar): Issue `\n' between two rules.
19059 * tests/regression.at (Conflicts): New.
19060 Reported by Tom Lane.
19061
19062 2001-11-12 Akim Demaille <akim@epita.fr>
19063
19064 * tests/regression.at (Invalid input): Remove, duplicate with
19065 ``Invalid input: 1''.
19066
19067 2001-11-12 Akim Demaille <akim@epita.fr>
19068
19069 * tests/torture.at (AT_DATA_STACK_TORTURE)
19070 (Exploding the Stack Size with Alloca)
19071 (Exploding the Stack Size with Malloc): New.
19072
19073 2001-11-12 Akim Demaille <akim@epita.fr>
19074
19075 * src/bison.simple (YYSTACK_REALLOC): New.
19076 (yyparse) [!yyoverflow]: Use it and free the old stack.
19077 Reported by Per Allansson.
19078
19079 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
19080
19081 * src/bison.simple: Define type yystype instead of YYSTYPE, and
19082 define CPP macro, which substitute YYSTYPE by yystype.
19083 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
19084 with yyltype/YYLTYPE. This allows inclusion of the generated
19085 header within the parser if the compiler, such as GGC, accepts
19086 multiple equivalent #defines.
19087 From Akim.
19088
19089 2001-11-05 Akim Demaille <akim@epita.fr>
19090
19091 * src/reader.c (symbols_output): New, extracted from...
19092 (packsymbols): here.
19093 (reader): Adjust.
19094
19095 2001-11-05 Akim Demaille <akim@epita.fr>
19096
19097 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19098
19099 2001-11-05 Akim Demaille <akim@epita.fr>
19100
19101 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19102 pattern.
19103
19104 2001-11-05 Akim Demaille <akim@epita.fr>
19105
19106 * src/options.h (struct option_table_struct): set_flags is void*.
19107 * src/options.c (longopts): Support `--output' and `%output'.
19108 (usage): Adjust.
19109 * src/lex.h (tok_setopt): Remove, replaced with...
19110 (tok_intopt, tok_stropt): these new guys.
19111 * src/lex.c (getopt.h): Not needed.
19112 (token_buffer, unlexed_token_buffer): Not const.
19113 (percent_table): Promote `-' over `_' in directive names.
19114 Active `%name-prefix', `file-prefix', and `output'.
19115 (parse_percent_token): Accept possible arguments to directives.
19116 Promote `-' over `_' in directive names.
19117
19118 2001-11-04 Akim Demaille <akim@epita.fr>
19119
19120 * doc/bison.texinfo (Decl Summary): Split the list into
19121 `directives for grammars' and `directives for bison'.
19122 Sort'em.
19123 Add description of `%name-prefix', `file-prefix', and `output'.
19124 Promote `-' over `_' in directive names.
19125 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19126 Simplify the description of `--name-prefix'.
19127 Promote `-' over `_' in directive names.
19128 Promote `--output' over `--output-file'.
19129 Fix the description of `--defines'.
19130 * tests/output.at: Exercise %file-prefix and %output.
19131
19132 2001-11-02 Akim Demaille <akim@epita.fr>
19133
19134 * doc/refcard.tex: Update.
19135
19136 2001-11-02 Akim Demaille <akim@epita.fr>
19137
19138 * src/symtab.h (SUNDEF): New.
19139 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19140 stand for `uninitialized', instead of 0.
19141 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19142 * src/lex.c (lex): Adjust.
19143
19144 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19145 Number it 0.
19146 Let yylex return it instead of a plain 0.
19147 Reported by Dick Streefland.
19148
19149 2001-11-02 Akim Demaille <akim@epita.fr>
19150
19151 * tests/regression.at (Mixing %token styles): New test.
19152
19153 2001-11-02 Akim Demaille <akim@epita.fr>
19154
19155 * src/reader.c (parse_thong_decl): Formatting changes.
19156 (token_translations_init): New, extracted from...
19157 (packsymbols): Here.
19158 Adjust.
19159
19160 2001-11-01 Akim Demaille <akim@epita.fr>
19161
19162 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19163 Check that `9foo.y' produces correct cpp guards.
19164 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19165 guards.
19166 Reported by Wwp.
19167
19168 2001-11-01 Akim Demaille <akim@epita.fr>
19169
19170 * tests/regression.at (Invalid input: 2): New.
19171 * src/lex.c (unlexed_token_buffer): New.
19172 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19173 too.
19174 Reported by Wwp.
19175
19176 2001-11-01 Akim Demaille <akim@epita.fr>
19177
19178 * tests/calc.at: Catch up with 1.30.
19179 * configure.in: Bump to 1.49a.
19180 Adjust to newer Autotest.
19181
19182 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
19183
19184 * src/conflicts.c: Move global variables rrc_total and src_total ...
19185 (print_conflicts): here.
19186 * src/output.c (output): Free global variable user_toknums.
19187 * src/lex.c (token_obstack): Become static.
19188
19189 2001-10-18 Akim Demaille <akim@epita.fr>
19190
19191 * tests/atlocal.in (GCC): Add.
19192 * tests/calc.at: s/m4_match/m4_bmatch/.
19193 s/m4_patsubst/m4_bpatsubst/.
19194 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19195 * configure.in: AC_SUBST(GCC).
19196
19197 2001-10-14 Marc Autret <autret_m@epita.fr>
19198
19199 * src/options.c (create_long_option_table): Fix.
19200
19201 2001-10-10 Akim Demaille <akim@epita.fr>
19202
19203 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19204
19205 2001-10-04 Akim Demaille <akim@epita.fr>
19206
19207 * src/reader.c (parse_union_decl): Push the caracters in
19208 union_obstack, not attrs_obstack.
19209
19210 2001-10-04 Akim Demaille <akim@epita.fr>
19211
19212 Merge in the branch 1.29.
19213
19214 * src/reader.c (packsymbols): Use a temporary obstack for
19215 `%%tokendef', since output_stack is already used elsewhere.
19216
19217 2001-10-02 Akim Demaille <akim@epita.fr>
19218
19219 Bump 1.29d.
19220
19221 2001-10-02 Akim Demaille <akim@epita.fr>
19222
19223 Version 1.29c.
19224
19225 2001-10-02 Akim Demaille <akim@epita.fr>
19226
19227 * tests/regression.at (Invalid CPP headers): New.
19228 From Alexander Belopolsky.
19229 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19230
19231 2001-10-02 Akim Demaille <akim@epita.fr>
19232
19233 * tests/regression.at (Invalid input): New.
19234 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19235 Reported by Shura.
19236
19237 2001-10-02 Akim Demaille <akim@epita.fr>
19238
19239 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19240
19241 2001-10-02 Akim Demaille <akim@epita.fr>
19242
19243 * src/output.c (output_parser): Assert `skeleton'.
19244 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19245 systems.
19246 From Shura.
19247
19248 2001-10-01 Marc Autret <autret_m@epita.fr>
19249
19250 * src/lex.h: Echo modifications.
19251 * src/lex.c (unlex): Parameter is now token_t.
19252 From Hans Aberg.
19253
19254 2001-10-01 Marc Autret <autret_m@epita.fr>
19255
19256 * src/main.c: Include lex.h.
19257 From Hans Aberg.
19258
19259 2001-09-29 Akim Demaille <akim@epita.fr>
19260
19261 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19262
19263 2001-09-28 Akim Demaille <akim@epita.fr>
19264
19265 * tests/testsuite.at: Update to newer Autotest.
19266 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19267
19268 2001-09-27 Akim Demaille <akim@epita.fr>
19269
19270 Position independent wrapper.
19271
19272 * tests/bison: Remove.
19273 * tests/bison.in: New.
19274 * configure.in: Adjust.
19275
19276 2001-09-27 Paul Eggert <eggert@twinsun.com>
19277
19278 Port quotearg fixes from tar 1.13.24.
19279
19280 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19281 tm to be declared.
19282 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19283 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19284
19285 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19286 * m4/mbrtowc.m4: New file.
19287 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19288 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19289
19290 2001-09-27 Akim Demaille <akim@epita.fr>
19291
19292 Bump to 1.29c.
19293
19294 2001-09-27 Akim Demaille <akim@epita.fr>
19295
19296 Version 1.29b.
19297
19298 2001-09-25 Akim Demaille <akim@epita.fr>
19299
19300 * src/system.h: Include `xalloc.h'.
19301 Remove it from the C files.
19302 * src/files.c (output_files): Free the obstacks.
19303 * src/lex.c (init_lex): Rename as...
19304 (lex_init): this.
19305 (lex_free): New.
19306 * src/main.c (main): Use it.
19307
19308 2001-09-24 Marc Autret <autret_m@epita.fr>
19309
19310 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19311 to output informations in fout (FILE*).
19312 (open_graph, close_graph): Likewise.
19313 (output_graph, output_edge, output_node): Likewise.
19314 * src/vcg.h: Update function prototypes.
19315 * src/print_graph.c (print_graph): Open output graph file.
19316 (print_actions): Adjust.
19317 * src/files.h: Remove extern declaration.
19318 * src/files.c: Remove graph_obstack declaration.
19319 (open_files): Remove graph_obstack initialization.
19320 (output_files): Remove graph_obstack saving.
19321
19322 2001-09-24 Marc Autret <autret_m@epita.fr>
19323
19324 * src/files.c (compute_output_file_names): Fix.
19325
19326 2001-09-24 Marc Autret <autret_m@epita.fr>,
19327 Akim Demaille <akim@epita.fr>
19328
19329 * src/reader.c (reader): Remove call to free_symtab ().
19330 * src/main.c (main): Call it here.
19331 Include symtab.h.
19332 * src/conflicts.c (initialize_conflicts): Rename as...
19333 (solve_conflicts): this.
19334 * src/print.c (print_core, print_actions, print_state)
19335 (print_grammar): Dump to a file instead a `output_obstack'.
19336 (print_results): Dump `output_obstack', and then proceed with the
19337 FILE *.
19338 * src/files.c (compute_output_file_names, close_files): New.
19339 (output_files): Adjust.
19340 * src/main.c (main): Adjust.
19341
19342 2001-09-23 Marc Autret <autret_m@epita.fr>
19343
19344 * src/files.c (compute_header_macro): Computes header macro name
19345 from spec_defines_file when given.
19346
19347 2001-09-23 Marc Autret <autret_m@epita.fr>
19348
19349 * src/files.c (output_files): Add default extensions.
19350
19351 2001-09-22 Akim Demaille <akim@epita.fr>
19352
19353 * src/conflicts.c (finalize_conflicts): Rename as...
19354 (free_conflicts): this.
19355
19356 2001-09-22 Akim Demaille <akim@epita.fr>
19357
19358 * src/gram.c (gram_free): Rename back as...
19359 (dummy): this.
19360 (output_token_translations): Free `token_translations'.
19361 * src/symtab.c (free_symtab): Free the tag field.
19362
19363 2001-09-22 Akim Demaille <akim@epita.fr>
19364
19365 Remove `translations' as it is always set to true.
19366
19367 * src/gram.h: Adjust.
19368 * src/reader.c (packsymbols, parse_token_decl): Adjust
19369 * src/print.c (print_grammar): Adjust.
19370 * src/output.c (output_token_translations): Adjust.
19371 * src/lex.c (lex): Adjust.
19372 * src/gram.c: Be sure the set pointers to NULL.
19373 (dummy): Rename as...
19374 (gram_free): this.
19375
19376 2001-09-22 Akim Demaille <akim@epita.fr>
19377
19378 * configure.in: Invoke AM_LIB_DMALLOC.
19379 * src/system.h: Use dmalloc.
19380 * src/LR0.c: Be sure to have pointers initialized to NULL.
19381 (allocate_itemsets): Allocate kernel_items only if needed.
19382
19383 2001-09-22 Akim Demaille <akim@epita.fr>
19384
19385 * configure.in: Bump to 1.29b.
19386 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19387 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19388 need xmalloc.c in calc.y.
19389 From Pascal Bart.
19390
19391 2001-09-21 Akim Demaille <akim@epita.fr>
19392
19393 Version 1.29a.
19394 * Makefile.maint, config/config.guess, config/config.sub,
19395 * config/missing: Update from masters.
19396 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19397 upon package.m4.
19398 * configure.in (ALL_LINGUAS): Add `tr'.
19399
19400 2001-09-21 Akim Demaille <akim@epita.fr>
19401
19402 * tests/Makefile.am (package.m4): Move to...
19403 ($(srcdir)/$(TESTSUITE)): here.
19404
19405 2001-09-20 Akim Demaille <akim@epita.fr>
19406
19407 * src/complain.c: No longer try to be standalone: use system.h.
19408 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19409 * src/complain.h: Likewise.
19410 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19411 Remove the unused variable `n'.
19412 From Albert Chin-A-Young.
19413
19414 2001-09-18 Marc Autret <autret_m@epita.fr>
19415
19416 * doc/bison.1: Update.
19417 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19418 descriptions.
19419 (Option Cross Key): Update.
19420 Add --graph.
19421
19422 2001-09-18 Marc Autret <autret_m@epita.fr>
19423
19424 * tests/regression.at: New test (comment in %union).
19425
19426 2001-09-18 Marc Autret <autret_m@epita.fr>
19427
19428 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19429 do that.
19430 Reported by Keith Browne.
19431
19432 2001-09-18 Marc Autret <autret_m@epita.fr>
19433
19434 * tests/output.at: Add tests for --defines and --graph.
19435
19436 2001-09-18 Marc Autret <autret_m@epita.fr>
19437
19438 * tests/output.at: Removes tests of %{header,src}_extension features.
19439
19440 2001-09-18 Akim Demaille <akim@epita.fr>
19441
19442 * tests/Makefile.am (package.m4): New.
19443 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19444 (_AT_CHECK_CALC_ERROR): Likewise.
19445 Factor the `, ' part of verbose error messages.
19446
19447 2001-09-18 Marc Autret <autret_m@epita.fr>
19448
19449 * src/getargs.c (longopts): Declare --defines and --graph as options
19450 with optional arguments.
19451 * src/files.h: Add extern declarations.
19452 * src/files.c (spec_graph_file, spec_defines_file): New.
19453 (output_files): Update.
19454 Remove CPP-outed code.
19455
19456 2001-09-18 Marc Autret <autret_m@epita.fr>
19457
19458 Turn off %{source,header}_extension feature.
19459
19460 * src/files.c (compute_exts_from_gf): Update.
19461 (compute_exts_from_src): Update.
19462 (output_files): CPP-out useless code.
19463 * src/files.h: Remove {header,source}_extension extern declarations.
19464 * src/reader.c (parse_dquoted_param): CPP-out.
19465 (parse_header_extension_decl): Remove.
19466 (parse_source_extension_decl): Remove.
19467 (read_declarations): Remove cases tok_{hdrext,srcext}.
19468 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19469 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19470
19471 2001-09-10 Akim Demaille <akim@epita.fr>
19472
19473 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19474 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19475 (AT_CHECK_OUTPUT): this.
19476 Merely check ls' exit status, its output is useless.
19477
19478 2001-09-10 Akim Demaille <akim@epita.fr>
19479
19480 * tests/calc.at: Use m4_match.
19481 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19482
19483 2001-09-10 Marc Autret <autret_m@epita.fr>,
19484 Akim Demaille <akim@epita.fr>
19485
19486 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19487 enum color_e.
19488 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19489 to `normal'.
19490 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19491 * src/lex.h: Adjust prototype.
19492 (token_t): Add `tok_undef'.
19493 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19494 (parse_percent_token): Now returns token_t.
19495 Add default statement in switch.
19496 (lex): Separate `c' as an input variable, from the token_t result
19497 part.
19498 (unlexed): Is a token_t.
19499
19500 2001-09-10 Akim Demaille <akim@epita.fr>
19501
19502 * configure.in: Bump to 1.29a.
19503
19504 2001-09-07 Akim Demaille <akim@epita.fr>
19505
19506 Version 1.29.
19507
19508 2001-08-30 Akim Demaille <akim@epita.fr>
19509
19510 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19511 * m4/atconfig.m4: Remove.
19512 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19513 * tests/bison: New.
19514 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19515 m4_if, m4_patsubst, and m4_regexp.
19516 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19517 `input' file instead of echo.
19518
19519 2001-08-29 Akim Demaille <akim@epita.fr>
19520
19521 Bump to 1.28e.
19522
19523 2001-08-29 Akim Demaille <akim@epita.fr>
19524
19525 Version 1.28d.
19526
19527 2001-08-29 Paul Eggert <eggert@twinsun.com>
19528
19529 * src/bison.simple (yyparse): Don't take the address of an
19530 item before the start of an array, as that doesn't conform to
19531 the C Standard.
19532
19533 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19534
19535 * doc/bison.texinfo (Location Tracking Calc): New node.
19536
19537 2001-08-29 Paul Eggert <eggert@twinsun.com>
19538
19539 * src/output.c (output): Do not define const, as this now
19540 causes more problems than it cures.
19541
19542 2001-08-29 Akim Demaille <akim@epita.fr>
19543
19544 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19545 the nodes.
19546 Be sure to tag the `detailmenu'.
19547
19548 2001-08-29 Akim Demaille <akim@epita.fr>
19549
19550 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19551 download in a tmp dir.
19552
19553 2001-08-28 Marc Autret <autret_m@epita.fr>
19554
19555 * config/depcomp: New file.
19556
19557 2001-08-28 Marc Autret <autret_m@epita.fr>
19558
19559 * doc/bison.1 (mandoc): Adjust.
19560 From Juan Manuel Guerrero.
19561
19562 2001-08-28 Marc Autret <autret_m@epita.fr>
19563
19564 * src/print_graph.c (print_state): Fix.
19565
19566 2001-08-27 Marc Autret <autret_m@epita.fr>
19567
19568 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19569 char * members.
19570 Echo modifications to the functions prototypes.
19571 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19572
19573 2001-08-27 Marc Autret <autret_m@epita.fr>
19574
19575 * src/vcg.c: Include `xalloc.h'.
19576 (add_colorentry): New.
19577 (add_classname): New.
19578 (add_infoname): New.
19579 * src/vcg.h: Add new prototypes.
19580
19581 2001-08-27 Akim Demaille <akim@epita.fr>
19582
19583 * Makefile.maint: Sync. again with CVS Autoconf.
19584
19585 2001-08-27 Akim Demaille <akim@epita.fr>
19586
19587 * Makefile.maint: Formatting changes.
19588 (po-update, cvs-update, update): New targets.
19589 (AMTAR): Remove.
19590
19591 2001-08-27 Akim Demaille <akim@epita.fr>
19592
19593 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19594 * Makefile.maint: Sync. with CVS Autoconf.
19595
19596 2001-08-27 Marc Autret <autret_m@epita.fr>
19597
19598 * src/vcg.h (struct infoname_s): New.
19599 (struct colorentry_s): New.
19600 (graph_s): New fields {vertical,horizontal}_order in structure.
19601 Add `infoname' field.
19602 Add `colorentry' field;
19603 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19604 (G_HORIZONTAL_ORDER): New.
19605 (G_INFONAME): New.
19606 (G_COLORENTRY): New.
19607 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19608 Add output of `infoname'.
19609 Add output of `colorentry'.
19610
19611 2001-08-27 Marc Autret <autret_m@epita.fr>
19612
19613 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19614 This one shadowed a global parameter.
19615
19616 2001-08-24 Marc Autret <autret_m@epita.fr>
19617
19618 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19619 instead of `unsigned'.
19620 (print_state): Do not call obstack_object_size () in obstack_grow ()
19621 to avoid macro variables shadowing.
19622
19623 2001-08-23 Marc Autret <autret_m@epita.fr>
19624
19625 * src/lex.c (percent_table): Typo: s/naem/name/.
19626 Add graph option.
19627 Normalize new options declarations.
19628
19629 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19630
19631 * tests/suite.at: Exercise %header_extension and %source_extension.
19632
19633 2001-08-16 Marc Autret <autret_m@epita.fr>
19634
19635 * src/reader.c (parse_dquoted_param): New.
19636 (parse_header_extension_decl): Use it.
19637 (parse_source_extension_decl): Likewise.
19638
19639 2001-08-16 Marc Autret <autret_m@epita.fr>
19640
19641 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19642 (get_xxxx_str): Use assert () instead of complain ().
19643 Remove return invokations in default cases.
19644 (get_decision_str): Modify default behaviour. Remove second argument.
19645 Echo modifications on calls.
19646 (output_graph): Fix.
19647
19648 2001-08-16 Marc Autret <autret_m@epita.fr>
19649
19650 * src/getargs.c (usage): Update with ``-g, --graph''.
19651
19652 2001-08-16 Marc Autret <autret_m@epita.fr>
19653
19654 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19655 (Option Cross Key): Likewise.
19656 * doc/bison.1: Update.
19657
19658 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
19659
19660 * src/output.c (output_master_parser): Don't finish action_obstack.
19661 (output_parser): Don't care about the muscle action, here.
19662 (prepare): Copy the action_obstack in the action muscle.
19663 (output): Free action_obstack.
19664
19665 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
19666
19667 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19668 will contain `%union' declaration.
19669 (parse_union_decl): Delete #line directive output.
19670 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19671 informations about %union.
19672 (parse_union_decl): Copy the union_obstack in the muscle stype.
19673 * src/bison.simple: Add new #line directive.
19674 Add typdef %%stype YYSTYPE.
19675
19676 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
19677
19678 * src/bison.simple: Add new `#line' directive.
19679
19680 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
19681
19682 * src/bison.simple: New `#line' directive.
19683 * src/output.c (output_parser): Support new dynamic muscle input_line.
19684
19685 2001-09-22 Marc Autret <autret_m@epita.fr>
19686
19687 * src/output.c (output_master_parser): New.
19688 (output_parser): Be more re-entrant.
19689
19690 2001-09-21 Marc Autret <autret_m@epita.fr>
19691
19692 * src/reader.c (copy_definition, parse_union_decl): Update and use
19693 `linef' muscle.
19694 (copy_action): Likewise.
19695 Use obstack_1grow ().
19696 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19697
19698 2001-09-21 Marc Autret <autret_m@epita.fr>
19699
19700 * src/options.c (option_table): Adjust.
19701 * src/lex.c (parse_percent_token): Fix.
19702
19703 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
19704
19705 * src/options.c (symtab.h): Include it, need by lex.h.
19706
19707 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
19708
19709 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19710 is now an option_table_struct*.
19711 (option_strcmp): New function option_strcmp.
19712 (parse_percent_token): Call option_strcmp.
19713 * src/getargs.c (xalloc.h, options.h): Include it.
19714 (getargs): Call create_long_option_table.
19715 (getargs): Free longopts at the end of the function.
19716 (shortopts): Move in options.c.
19717 * src/options.c (create_long_option_table): New function. Convert
19718 information from option_table to option structure.
19719 * src/reader.c (options.h): Include it.
19720
19721 * src/Makefile.am: Adjust.
19722 * src/options.c (option_table): Create from longopts and percent_table.
19723 * src/getargs.c (longopts): Delete.
19724 * src/lex.c (struct percent_table_struct): Delete.
19725 (percent_table): Delete.
19726 (options.h): Include it.
19727 * src/options.c: Create.
19728 * src/options.h: Create.
19729 Declare enum opt_access_e.
19730 Define struct option_table_struct.
19731
19732 2001-09-20 Marc Autret <autret_m@epita.fr>
19733
19734 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19735 sections of Bison.
19736
19737 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
19738
19739 * src/bison.simple: s/%%filename/%%skeleton.
19740 * src/muscle_tab.c (getargs.h): Include it.
19741 (muscle_init): Insert new muscle skeleton.
19742
19743 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
19744
19745 * src/output.c (output_parser): Delete unused variable actions_dumped.
19746
19747 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
19748
19749 * src/output.c (output): Delete call to reader_output_yylsp.
19750 * src/reader.c (reader): Likewise.
19751 * src/reader.h: Delete declaration of reader_output_yylsp.
19752
19753 2001-09-02 Marc Autret <autret_m@epita.fr>
19754
19755 * src/reader.c: Include muscle_tab.h.
19756 (parse_union_decl): Update.
19757 (parse_macro_decl): Rename parse_muscle_decl.
19758 Update to use renamed functions and variable.
19759 (read_declarations, copy_action, read_additionnal_code, : Updated
19760 with correct variables and functions names.
19761 (packsymbols, reader): Likewise.
19762
19763 * src/reader.h (muscle_obstack): Extern declaration update.
19764
19765 * src/output.c: Include muscle_tab.h
19766 In all functions using macro_insert, change by using muscle_insert ().
19767 (macro_obstack): Rename muscle_obstack.
19768 Echo modifications in the whole file.
19769 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19770 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19771 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19772
19773 * src/muscle_tab.h: Update double inclusion macros.
19774 (macro_entry_s): Rename muscle_entry_s.
19775 Update prototypes.
19776
19777 * src/muscle_tab.c: Include muscle_tab.h.
19778 Rename macro_tabble to muscle_table.
19779 (mhash1, mhash2, mcmp): Use muscle_entry.
19780 (macro_init): Rename muscle_init. Update.
19781 (macro_insert): Rename muscle_insert. Update.
19782 (macro_find): Rename muscle_find. Update.
19783
19784 * src/main.c: Include muscle_tab.h.
19785 (main): Call muscle_init ().
19786 * src/Makefile.am (bison_SOURCES): Echo modifications.
19787
19788 2001-09-02 Marc Autret <autret_m@epita.fr>
19789
19790 Now the files macro_tab.[ch] are named muscle_tab.[ch].
19791
19792 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19793
19794 2001-09-02 Marc Autret <autret_m@epita.fr>
19795
19796 * src/macrotab.c, src/macrotab.h: Remove.
19797
19798 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
19799
19800 * src/reader.c (copy_guard): Use muscle to specify the `#line'
19801 filename.
19802
19803 2001-09-01 Marc Autret <autret_m@epita.fr>
19804
19805 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19806 to an explicit value to activate the feature. We do it here.
19807
19808 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19809
19810 * src/output.c (prepare): Delete the `filename' muscule insertion.
19811 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19812 (parse_union_decl): Likewise.
19813 * src/macrotab.c (macro_init): Initialize filename by infile.
19814
19815 2001-08-31 Marc Autret <autret_m@epita.fr>
19816
19817 * src/bison.simple (YYLSP_NEEDED): New definition.
19818 * src/output.c (prepare): Add macro insertion of `locations_flag'
19819
19820 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19821
19822 * src/output.c (prepare): Delete insertion of previous muscles,
19823 and insert the `prefix' muscles.
19824 * src/macrotab.c (macro_init): Likewise.
19825 (macro_init): Initialization prefix directive by `yy'.
19826 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
19827 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19828 yylval, yydebug, yyerror, yynerrs and yyparse.
19829 New directive `#define' to substitute yydebug, ... with option
19830 name_prefix.
19831
19832 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19833
19834 * src/main.c (main): Standardize.
19835 * src/output.c (output_table_data, output_parser): Likewise.
19836 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19837
19838 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19839
19840 * src/reader.c (read_additionnal_code): Rename %%user_code to
19841 %%epilogue.
19842 * src/output.c (output): Rename %%declarations to %%prologue.
19843 * src/bison.simple: Echo modifications.
19844
19845 2001-08-31 Marc Autret <autret_m@epita.fr>
19846
19847 * src/reader.c (readgram): CleanUp.
19848 (output_token_defines): Likewise.
19849 (packsymbols): Likewise.
19850 (reader): Likewise.
19851 * src/output.c (output): CPP-out useless code.
19852
19853 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19854
19855 * src/reader.c (reader): Delete obsolete call to function
19856 output_trailers and output_headers.
19857 * src/output.h: Remove obsolete functions prototypes of output_headers
19858 and output_trailers.
19859
19860 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
19861
19862 * src/main.c: Include macrotab.h.
19863 * src/macrotab.h (macro_entry_s): Constify fields.
19864 Adjust functions prototypes.
19865 * src/macrotab.c (macro_insert): Constify key and value.
19866 (macro_find): Constify key.
19867 (macro_insert): Include 'xalloc.h'
19868 (macro_insert): Use XMALLOC.
19869 (macro_find): Constify return value.
19870 * src/output.c (output_table_data): Rename table to table_data.
19871 (output_parser): Constify macro_key, macro_value.
19872
19873 2001-08-30 Marc Autret <autret_m@epita.fr>
19874
19875 * src/reader.c (parse_skel_decl): New.
19876 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
19877 * src/lex.h (token_t): New token `tok_skel'.
19878 * src/lex.c (percent_table): Add skeleton option entry.
19879 Standardize.
19880
19881 2001-08-29 Marc Autret <autret_m@epita.fr>
19882
19883 * src/bison.simple: Add %%user_code directive at the end.
19884 * src/reader.c (read_additionnal_code): New.
19885 (reader): Use it.
19886 * src/output.c (output_program): Remove.
19887 (output): Update.
19888
19889 2001-08-28 Marc Autret <autret_m@epita.fr>
19890
19891 * src/output.c (output_actions): Clean up.
19892 (output_gram): CPP-out useless code.
19893 * src/reader.c (reader): Clean up, CPP-out useless code.
19894
19895 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
19896
19897 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
19898 directive.
19899 * src/bison.simple: Add `%%definitions'.
19900
19901 2001-08-28 Marc Autret <autret_m@epita.fr>
19902
19903 * config/depcomp: New file.
19904
19905 2001-08-27 Paul Eggert <eggert@twinsun.com>
19906
19907 * src/bison.simple (yyparse): Don't take the address of an
19908 item before the start of an array, as that doesn't conform to
19909 the C Standard.
19910
19911 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
19912
19913 * src/output.c (output): Remove the initialization of the macro
19914 obstack. It was done too late here.
19915
19916 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19917 completely wrong.
19918 (reader): Initialize the macro obstack here, since we need it to grow
19919 '%define' directives.
19920
19921 * src/reader.h: Declare the macro obstack as extern.
19922
19923 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
19924
19925 * src/output.c (output_parser): Fix. Store single '%' characters in
19926 the output obstack instead of throwing them away.
19927
19928 2001-08-27 Akim Demaille <akim@epita.fr>
19929
19930 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19931
19932 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19933
19934 * lib/Makefile.am: Adjust.
19935
19936 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19937
19938 * src/bison.simple: Update and add '%%' directives.
19939
19940 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19941
19942 * src/reader.c (reader): Remove calls to 'output_headers' and
19943 'output_trailers'. Remove some C output.
19944 (readgram): Disable a piece of code that was writing a default
19945 definition for 'YYSTYPE'.
19946 (reader_output_yylsp): Remove.
19947 (packsymbols): Output token defintions to a macro.
19948 (copy_definition): Disable C output.
19949
19950 * src/reader.c (parse_macro_decl): New function used to parse macro
19951 declarations.
19952 (copy_string2): Put the body of copy_string into this new function.
19953 Add a parameter to let the caller choose whether he wants to copy the
19954 string delimiters or not.
19955 (copy_string): Be a simple call to copy_string2 with the last argument
19956 bound to true.
19957 (read_declarations): Add case for macro definition.
19958 (copy_identifier): New.
19959 (parse_macro_decl): Read macro identifiers using copy_identifier
19960 rather than lex.
19961
19962 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19963
19964 * src/output.c (prepare): Add prefixed names.
19965 (output_parser): Output semantic actions.
19966 (output_parser): Fix bug on '%%line' directives.
19967
19968 * src/output.c (output_headers): Remove. The C code printed by this
19969 function should now be in the skeletons.
19970 (output_trailers): Remove.
19971 (output): Disable call to 'reader_output_yylsp'.
19972 (output_rule_data): Do not output tables to the table obstack.
19973
19974 * src/output.c: Remove some C dedicated output.
19975 Improve the use of macro and output obstacks.
19976 (output_defines): Remove.
19977
19978 * src/output.c (output_token_translations): Associate 'translate'
19979 table with a macro. No output to the table obstack.
19980 (output_gram): Same for 'rhs' and 'prhs'.
19981 (output_stos): Same for 'stos'.
19982 (output_rule_data): Same for 'r1' and 'r2'.
19983 (token_actions): Same for 'defact'.
19984 (goto_actions): Same for 'defgoto'.
19985 (output_base): Same for 'pact' and 'pgoto'.
19986 (output_table): Same for 'table'.
19987 (output_check): Same for 'check'.
19988
19989 * src/output.c (output_table_data): New function.
19990 (output_short_table): Remove.
19991 (output_short_or_char_table): Remove.
19992
19993 * src/output.c (output_parser): Replace most of the skeleton copy code
19994 with something new. Skeletons are now processed character by character
19995 rather than line by line, and Bison looks for '%%' macros. This is the
19996 first step in making Bison's output process (a lot) more flexible.
19997 (output_parser): Use the macro table.
19998
19999 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20000
20001 * src/main.c (main): Initialize the macro table.
20002
20003 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20004
20005 * src/lex.c (percent_table): Add tok_define.
20006 * src/lex.h: Add tok_define.
20007
20008 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20009
20010 * src/macrotab.c: New file.
20011 * src/macrotab.h: New file.
20012 * src/Makefile.am: Update.
20013
20014 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20015
20016 * lib/hash.c: New file.
20017 * lib/hash.h: New file.
20018 * lib/Makefile.am: Update.
20019
20020 2001-08-15 Akim Demaille <akim@epita.fr>
20021
20022 Version 1.28c.
20023
20024 2001-08-15 Marc Autret <autret_m@epita.fr>
20025
20026 * src/reader.c (readgram): Indent output macro YYSTYPE.
20027 (packsymbols): Likewise.
20028 (output_token_defines): Likewise.
20029 * src/files.c: Standardize.
20030 (compute_header_macro): New.
20031 (defines_obstack_save): New. Use compute_header_macro.
20032 (output_files): Update. Use defines_obstack_save.
20033
20034 2001-08-15 Akim Demaille <akim@epita.fr>
20035
20036 * doc/bison.texinfo (Table of Symbols): Document
20037 YYSTACK_USE_ALLOCA.
20038
20039 2001-08-15 Akim Demaille <akim@epita.fr>
20040
20041 * missing: Update from CVS Automake.
20042 * config/config.guess, config/config.sub, config/texinfo.tex:
20043 Update from gnu.org.
20044
20045 2001-08-15 Akim Demaille <akim@epita.fr>
20046
20047 * Makefile.maint: Sync with CVS Autoconf.
20048
20049 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
20050
20051 * doc/bison.texinfo: Include GNU Free Documentation License from
20052 `fdl.texi'.
20053 * doc/fdl.texi: Add to package.
20054
20055 2001-08-14 Marc Autret <autret_m@epita.fr>
20056
20057 Turn on %{source,header}_extension features.
20058
20059 * src/lex.c (percent_table): Un-CPP out header_extension and
20060 source_extension.
20061 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
20062 (compute_exts_from_src): Remove conditions. It restores priorities
20063 between options.
20064
20065 2001-08-14 Marc Autret <autret_m@epita.fr>
20066
20067 * src/files.c (compute_base_names): Add extensions computing when
20068 `--file-prefix' used.
20069 Standardize function calls.
20070
20071 2001-08-13 Marc Autret <autret_m@epita.fr>
20072
20073 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
20074 defining it (defined but null disables alloca).
20075
20076 2001-08-13 Marc Autret <autret_m@epita.fr>
20077
20078 * src/bison.simple (_yy_memcpy): CPP reformat.
20079
20080 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
20081
20082 * tests/atconfig.in (CPPFLAGS): Fix.
20083
20084 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
20085
20086 * doc/bison.texinfo: Include GNU General Public License from
20087 `gpl.texi'.
20088 * doc/gpl.texi: Add to package.
20089
20090 2001-08-10 Marc Autret <autret_m@epita.fr>
20091
20092 * src/print_graph.h: Fix.
20093 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20094
20095 2001-08-10 Akim Demaille <akim@epita.fr>
20096
20097 * src/system.h: Provide default declarations for stpcpy, strndup,
20098 and strnlen.
20099
20100 2001-08-10 Robert Anisko <anisko_r@epita.fr>
20101
20102 * doc/bison.texinfo (Locations): Update @$ stuff.
20103
20104 2001-08-09 Robert Anisko <anisko_r@epita.fr>
20105
20106 * src/bison.simple (YYLLOC_DEFAULT): Update.
20107 (yyparse): Adjust.
20108
20109 2001-08-08 Marc Autret <autret_m@epita.fr>
20110
20111 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
20112 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20113 Reported by Fabrice Bauzac.
20114
20115 2001-08-08 Marc Autret <autret_m@epita.fr>
20116
20117 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20118 * src/vcg.c (output_node): Fix.
20119 * src/vcg.h: Cleanup.
20120 * src/print_graph.c: Add comments.
20121 (node_output_size): New global variable. Simplify the formatting of
20122 the VCG graph output.
20123 (print_actions): Unused code is now used. It notifies the final state
20124 and no action states in the VCG graph. It also give the reduce actions.
20125 The `shift and goto' edges are red and the `go to state' edges are
20126 blue.
20127 Get the current node name and node_obstack by argument.
20128 (node_obstack): New variable.
20129 (print_state): Manage node_obstack.
20130 (print_core): Use node_obstack given by argument.
20131 A node is not only computed here but in print_actions also.
20132 (print_graph): CPP out useless code instead of commenting it.
20133
20134 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
20135
20136 * tests/atconfig.in (CPPFLAGS): Fix.
20137
20138 2001-08-07 Akim Demaille <akim@epita.fr>
20139
20140 * src/print_graph.c (quote): New.
20141 (print_core): Use it.
20142
20143 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
20144
20145 * src/vcg.c (complain.h): Include it.
20146 Unepitaize `return' invocations.
20147 [NDEBUG] (main): Remove.
20148 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
20149 * src/files.c (open_files): Initialize graph_obstack.
20150 * src/print_graph.c (print_actions): CPP out useless code.
20151 (print_core): Don't output the last `\n' in labels.
20152 Use `quote'.
20153 * src/files.c (output_files): Output the VCG file.
20154 * src/main.c (main): Invoke print_graph ();
20155
20156 2001-08-06 Marc Autret <autret_m@epita.fr>
20157
20158 Automaton VCG graph output.
20159 Using option ``-g'' or long option ``--graph'', you can generate
20160 a gram_filename.vcg file containing a VCG description of the LALR (1)
20161 automaton of your grammar.
20162
20163 * src/main.c: Call to print_graph() function.
20164 * src/getargs.h: Update.
20165 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20166 (graph_flag): New flag.
20167 (longopts): Update.
20168 (getargs): Add case `g'.
20169 * src/files.c (graph_obstack): New obstack struct.
20170 (open_files): Initialize new obstack.
20171 (output_files): Saves graph_obstack if required.
20172 * src/files.h (graph_obstack): New extern declaration.
20173 * src/Makefile.am: Add new source files.
20174
20175 2001-08-06 Marc Autret <autret_m@epita.fr>
20176
20177 * src/print_graph.c, src/print_graph.h (graph): New.
20178 * src/vcg.h: New file.
20179 * src/vcg.c: New file, VCG graph handling.
20180
20181 2001-08-06 Marc Autret <autret_m@epita.fr>
20182
20183 Add of %source_extension and %header_extension which specify
20184 the source or/and the header output file extension.
20185
20186 * src/files.c (compute_base_names): Remove initialisation of
20187 src_extension and header_extension.
20188 (compute_exts_from_gf): Update.
20189 (compute_exts_from_src): Update.
20190 (output_files): Update.
20191 * src/reader.c (parse_header_extension_decl): New.
20192 (parse_source_extension_decl): New.
20193 (read_declarations): New case statements for the new tokens.
20194 * src/lex.c (percent_table): Add entries for %source_extension
20195 and %header_extension.
20196 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20197
20198 2001-08-06 Marc Autret <autret_m@epita.fr>
20199
20200 * configure.in: Bump to 1.28c.
20201 * doc/bison.texinfo: Texinfo thingies.
20202
20203 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
20204
20205 * tests/atconfig.in (CPPFLAGS): Add.
20206 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20207
20208 2001-08-03 Akim Demaille <akim@epita.fr>
20209
20210 Version 1.28b.
20211
20212 2001-08-03 Akim Demaille <akim@epita.fr>
20213
20214 * tests/Makefile.am (check-local): Ship testsuite.
20215 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20216 Include `string.h'.
20217
20218 2001-08-03 Akim Demaille <akim@epita.fr>
20219
20220 * configure.in: Try using -Wformat when compiling.
20221
20222 2001-08-03 Akim Demaille <akim@epita.fr>
20223
20224 * configure.in: Bump to 1.28b.
20225
20226 2001-08-03 Akim Demaille <akim@epita.fr>
20227
20228 * src/complain.c: Adjust strerror_r portability issues.
20229
20230 2001-08-03 Akim Demaille <akim@epita.fr>
20231
20232 Version 1.28a.
20233
20234 2001-08-03 Akim Demaille <akim@epita.fr>
20235
20236 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20237 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20238 * src/getargs.c: Include complain.h.
20239 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20240 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20241
20242 2001-08-03 Akim Demaille <akim@epita.fr>
20243
20244 * src/reader.c (readgram): Display hidden chars in error messages.
20245
20246 2001-08-03 Akim Demaille <akim@epita.fr>
20247
20248 Update to gettext 0.10.39.
20249
20250 2001-08-03 Akim Demaille <akim@epita.fr>
20251
20252 * lib/strspn.c: New.
20253
20254 2001-08-01 Marc Autret <autret_m@epita.fr>
20255
20256 * doc/bison.texinfo: Update.
20257 * doc/bison.1 (mandoc): Update.
20258 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20259 * src/files.c: Support output files extensions computing.
20260 (src_extension): New static variable.
20261 (header_extension): New static variable.
20262 (tr): New function.
20263 (get_extension_index): New function, gets the index of an extension
20264 filename in a string.
20265 (compute_exts_from_gf): New function, computes extensions from the
20266 grammar file extension.
20267 (compute_exts_from_src): New functions, computes extensions from the
20268 C source file extension, file given by ``-o'' option.
20269 (compute_base_names): Update.
20270 (output_files): Update.
20271
20272 2001-08-01 Robert Anisko <anisko_r@epita.fr>
20273
20274 * doc/bison.texi: Document @$.
20275 (Locations): New section.
20276
20277 2001-07-18 Akim Demaille <akim@epita.fr>
20278
20279 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20280 * config/prev-version.txt, config/move-if-change: New.
20281 * Makefile.am: Adjust.
20282
20283 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
20284
20285 * src/bison.simple (yyparse): Suppress warning `comparaison
20286 between signed and unsigned'.
20287
20288 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
20289
20290 * src/getargs.h (raw_flag): Remove.
20291 * src/getargs.c: Die on `-r'/`--raw'.
20292 * src/lex.c (parse_percent_token): Die on `%raw'.
20293 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20294 * tests/calc.at: Suppress test with option `--raw'.
20295
20296 2001-07-14 Akim Demaille <akim@epita.fr>
20297
20298 * config/: New.
20299 * configure.in: Require Autoconf 2.50.
20300 Update to gettext 0.10.38.
20301
20302 2001-03-16 Akim Demaille <akim@epita.fr>
20303
20304 * doc/bison.texinfo: ANSIfy the examples.
20305
20306 2001-03-16 Akim Demaille <akim@epita.fr>
20307
20308 * getargs.c (skeleton): New variable.
20309 (longopts): --skeleton is a new option.
20310 (shortopts, getargs): -S is a new option.
20311 * getargs.h: Declare skeleton.
20312 * output.c (output_parser): Use it.
20313
20314 2001-03-16 Akim Demaille <akim@epita.fr>
20315
20316 * m4/strerror_r.m4: New.
20317 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20318 * lib/error.h, lib/error.c: Update.
20319
20320 2001-03-16 Akim Demaille <akim@epita.fr>
20321
20322 * src/getargs.c (longopts): Clean up.
20323
20324 2001-02-21 Akim Demaille <akim@epita.fr>
20325
20326 * src/reader.c (gensym): `gensym_count' is your own.
20327 Use a static buf to create the symbol name, as token_buffer is no
20328 longer a buffer.
20329
20330 2001-02-08 Akim Demaille <akim@epita.fr>
20331
20332 * src/conflicts.c (conflict_report): Be sure not to append to res
20333 between two calls, which could happen if both first sprintf were
20334 skipped, but not the first cp += strlen.
20335
20336 2001-02-08 Akim Demaille <akim@epita.fr>
20337
20338 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20339 New, from fileutils 4.0.37.
20340 * configure.in: Require Autoconf 2.49c. I took some time before
20341 making this decision. This is the only way out for portability
20342 issues in Bison, it would mean way too much duplicate effort to
20343 import in Bison features implemented in 2.49c since 2.13.
20344 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20345
20346 2001-02-02 Akim Demaille <akim@epita.fr>
20347
20348 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
20349 * lib/xalloc.h, lib/xmalloc.c: Update.
20350
20351 2001-01-19 Akim Demaille <akim@epita.fr>
20352
20353 Get rid of the ad hoc handling of token_buffer in the scanner: use
20354 the obstacks.
20355
20356 * src/lex.c (token_obstack): New.
20357 (init_lex): Initialize it. No longer call...
20358 (grow_token_buffer): this. Remove it.
20359 Adjust all the places which used it to use the obstack.
20360
20361 2001-01-19 Akim Demaille <akim@epita.fr>
20362
20363 * src/lex.h: Rename all the tokens:
20364 s/\bENDFILE\b/tok_eof/g;
20365 s/\bIDENTIFIER\b/tok_identifier/g;
20366 etc.
20367 Let them be enums, not #define, to ease debugging.
20368 Adjust all the code.
20369
20370 2001-01-18 Akim Demaille <akim@epita.fr>
20371
20372 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20373 * src/lex.c (maxtoken, grow_token_buffer): Static.
20374
20375 2001-01-18 Akim Demaille <akim@epita.fr>
20376
20377 Since we now use obstacks, more % directives can be enabled.
20378
20379 * src/lex.c (percent_table): Also accept `%yacc',
20380 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20381 `%debug'.
20382 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20383 instead of returning a token.
20384 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20385 * src/reader.c (read_declarations): Adjust.
20386 * src/files.c (open_files): Don't call `compute_base_names', don't
20387 compute `attrsfile' since they depend upon data which might be
20388 *in* the input file now.
20389 (output_files): Do it here.
20390 * src/output.c (output_headers): Document the fact that this patch
20391 introduces a guaranteed SEGV for semantic parsers.
20392 * doc/bison.texinfo: Document them.
20393 * tests/suite.at: Exercise these %options.
20394
20395 2000-12-20 Akim Demaille <akim@epita.fr>
20396
20397 Also handle the output file (--verbose) with obstacks.
20398
20399 * files.c (foutput): Remove.
20400 (output_obstack): New.
20401 Adjust all dependencies.
20402 * src/conflicts.c: Return a string.
20403 * src/system.h (obstack_grow_string): Rename as...
20404 (obstack_sgrow): this. Be ready to work with non literals.
20405 (obstack_fgrow4): New.
20406
20407 2000-12-20 Akim Demaille <akim@epita.fr>
20408
20409 * src/files.c (open_files): Fix the computation of short_base_name
20410 in the case of `-o foo.tab.c'.
20411
20412 2000-12-20 Akim Demaille <akim@epita.fr>
20413
20414 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20415 (copy_dollar): Now that everything uses obstacks, get rid of the
20416 FILE * parameters.
20417
20418 2000-12-20 Akim Demaille <akim@epita.fr>
20419
20420 * src/files.c (open_files): Actually the `.output' file is based
20421 on the short_base_name, not base_name.
20422 * tests/suite.at (Checking output file names): Adjust.
20423
20424 2000-12-20 Akim Demaille <akim@epita.fr>
20425
20426 * src/bison.s1: Remove, we now use directly...
20427 * src/bison.simple: this.
20428 * src/Makefile.am: Use pkgdata instead of data.
20429
20430 2000-12-20 Akim Demaille <akim@epita.fr>
20431
20432 * src/files.c (guard_obstack): New.
20433 (open_files): Initialize it.
20434 (output_files): Dump it...
20435 * src/files.h: Export it.
20436 * src/reader.c (copy_guard): Use it.
20437
20438 2000-12-19 Akim Demaille <akim@epita.fr>
20439
20440 * src/files.c (outfile, defsfile, actfile): Removed as global
20441 vars.
20442 (open_files): Don't compute them.
20443 (output_files): Adjust.
20444 (base_name, short_base_name): Be global.
20445 Adjust dependencies.
20446
20447 2000-12-19 Akim Demaille <akim@epita.fr>
20448
20449 * src/files.c (strsuffix): New.
20450 (stringappend): Be just like strcat but allocate.
20451 (base_names): Eve out from open_files.
20452 Try to simplify the rather hairy computation of base_name and
20453 short_base_name.
20454 (open_files): Use it.
20455 * tests/suite.at (Checking output file names): New test.
20456
20457 2000-12-19 Akim Demaille <akim@epita.fr>
20458
20459 * src/system.h (obstack_grow_literal_string): Rename as...
20460 (obstack_grow_string): this.
20461 * src/output.c (output_parser): Recognize `%% actions' instead of
20462 `$'.
20463 * src/bison.s1: s/$/%% actions/.
20464 * src/bison.hairy: Likewise.
20465
20466 2000-12-19 Akim Demaille <akim@epita.fr>
20467
20468 * src/output.c (output_parser): Compute the `#line' lines when
20469 there are.
20470 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20471 Suggested by Hans Aberg.
20472
20473 2000-12-19 Akim Demaille <akim@epita.fr>
20474
20475 Let the handling of the skeleton files be local to the procedures
20476 that use it.
20477
20478 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20479 longer static.
20480 (fparser, open_extra_files): Remove.
20481 (open_files, output_files): Don't take care of fparser.
20482 * src/files.h: Adjust.
20483 * src/output.c (output_parser): Open and close the file to the
20484 skeleton.
20485 * src/reader.c (read_declarations): When %semantic_parser, open
20486 fguard.
20487
20488 2000-12-19 Akim Demaille <akim@epita.fr>
20489
20490 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20491 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20492
20493 2000-12-19 Akim Demaille <akim@epita.fr>
20494
20495 * src/files.c (open_files): Yipee! We no longer need all the code
20496 looking for `/tmp' since we have no tmp file.
20497
20498 2000-12-19 Akim Demaille <akim@epita.fr>
20499
20500 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20501 New macros.
20502 * src/files.c (open_files): Less dependency on MSDOS etc.
20503
20504 2000-12-14 Akim Demaille <akim@epita.fr>
20505
20506 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20507 Provide a default definition.
20508 Use it when executing the default @ action.
20509 * src/reader.c (reader_output_yylsp): No longer include
20510 `timestamp' and `text' in the default YYLTYPE.
20511
20512 2000-12-12 Akim Demaille <akim@epita.fr>
20513
20514 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20515 (copy_guard): Quote the file names.
20516 Reported by Laurent Mascherpa.
20517
20518 2000-12-12 Akim Demaille <akim@epita.fr>
20519
20520 * src/output.c (output_headers, output_program, output): Be sure
20521 to escape special characters when outputting filenames.
20522 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20523 (output_headers): Don't depend on them, Use ACTSTR.
20524
20525 2000-11-17 Akim Demaille <akim@epita.fr>
20526
20527 * lib/obstack.h: Formatting changes.
20528 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20529 prevents type checking.
20530 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20531 cast the value to (void *): assigning a `foo *' to a `void *'
20532 variable is valid.
20533 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20534 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20535 append characters.
20536
20537 2000-11-17 Akim Demaille <akim@epita.fr>
20538
20539 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20540 as...
20541 (suite.m4, regression.m4, calc.m4): these.
20542 * tests/atgeneral.m4: Update from CVS Autoconf.
20543
20544 2000-11-17 Akim Demaille <akim@epita.fr>
20545
20546 * tests/regression.m4 (%union and --defines): New test,
20547 demonstrating a current bug in the obstack implementation.
20548
20549 2000-11-17 Akim Demaille <akim@epita.fr>
20550
20551 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20552 macros.
20553 Use them to declare the variables which are global or local to
20554 `yyparse'.
20555
20556 2000-11-17 Akim Demaille <akim@epita.fr>
20557
20558 * acconfig.h: Remove, no longer used.
20559
20560 2000-11-07 Akim Demaille <akim@epita.fr>
20561
20562 * src: s/Copyright (C)/Copyright/g.
20563
20564 2000-11-07 Akim Demaille <akim@epita.fr>
20565
20566 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20567 defining.
20568 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20569
20570 2000-11-07 Akim Demaille <akim@epita.fr>
20571
20572 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20573 Merge in a single CPP if/else.
20574
20575 2000-11-07 Akim Demaille <akim@epita.fr>
20576
20577 * src/output.c (output): Remove useless variables.
20578 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20579 argument `data' for consistency with the prototypes.
20580 Qualify it `const'.
20581 (obstack_copy, obstack_copy0): Rename the second argument as
20582 `address' for consistency. Qualify it `const'.
20583 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20584 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20585 `const' their input argument (`data' or `address').
20586 Adjust the corresponding macros to include `const' in casts.
20587
20588 2000-11-03 Akim Demaille <akim@epita.fr>
20589
20590 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20591 s/PFILE1/BISON_HAIRY/.
20592 Adjust dependencies.
20593
20594 2000-11-03 Akim Demaille <akim@epita.fr>
20595
20596 For some reason, this was not applied.
20597
20598 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20599 `unlink': it's no longer used.
20600
20601 2000-11-03 Akim Demaille <akim@epita.fr>
20602
20603 * src/files.c (skeleton_find): New function, eved out of...
20604 (open_files, open_extra_files): here.
20605
20606 2000-11-03 Akim Demaille <akim@epita.fr>
20607
20608 Don't use `atexit'.
20609
20610 * src/files.c (obstack_save): New function.
20611 (done): Rename as...
20612 (output_files): this.
20613 Use `obstack_save'.
20614 * src/main.c (main): Don't use `atexit' to register `done', since
20615 it no longer has to remove tmp files, just call `output_files'
20616 when there are no errors.
20617
20618 2000-11-02 Akim Demaille <akim@epita.fr>
20619
20620 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20621 `unlink': it's no longer used.
20622 * src/files.h: Formatting changes.
20623
20624 2000-11-02 Akim Demaille <akim@epita.fr>
20625
20626 Remove the last uses of mktemp and unlink/delete.
20627
20628 * src/files.c (fdefines, ftable): Removed.
20629 (defines_ostack, table_obstack): New.
20630 Adjust dependencies of the former into uses of the latter.
20631 * src/output.c (output_short_or_char_table, output_short_table):
20632 Convert to using obstacks.
20633 * src/reader.c (copy_comment2): Accept one FILE * and two
20634 obstacks.
20635 (output_token_defines, reader_output_yylsp): Use obstacks.
20636 * src/system.h (obstack_fgrow3): New.
20637 * po/POTFILES.in: Adjust.
20638
20639 2000-11-01 Akim Demaille <akim@epita.fr>
20640
20641 Change each use of `fattrs' into a use of `attrs_obstack'.
20642
20643 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20644 * src/files.c (fattrs): Remove.
20645 (attrs_obstack): New.
20646 Adjust all dependencies.
20647 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20648
20649 2000-11-01 Akim Demaille <akim@epita.fr>
20650
20651 Introduce obstacks.
20652 Change each use of `faction' into a use of `action_obstack'.
20653
20654 * lib/obstack.h, lib/obstack.c: New files.
20655 * src/files.c (faction): Remove.
20656 (action_obstack): New.
20657 Adjust all dependencies.
20658
20659 2000-10-20 Akim Demaille <akim@epita.fr>
20660
20661 * lib/quote.h (PARAMS): New macro. Use it.
20662
20663 2000-10-16 Akim Demaille <akim@epita.fr>
20664
20665 * src/output.c (output_short_or_char_table): New function.
20666 (output_short_table, output_token_translations): Use it.
20667 (goto_actions): Use output_short_table.
20668
20669 2000-10-16 Akim Demaille <akim@epita.fr>
20670
20671 * src/symtab.c (bucket_new): New function.
20672 (getsym): Use it.
20673
20674 * src/output.c (output_short_table): New argument to display the
20675 comment associated with the table.
20676 Adjust dependencies.
20677 (output_gram): Use it.
20678 (output_rule_data): Nicer output layout for YYTNAME.
20679
20680 2000-10-16 Akim Demaille <akim@epita.fr>
20681
20682 * src/lex.c (read_typename): New function.
20683 (lex): Use it.
20684 * src/reader.c (copy_dollar): Likewise.
20685
20686 2000-10-16 Akim Demaille <akim@epita.fr>
20687
20688 * src/reader.c (copy_comment2): Expect the input stream to be on
20689 the `/' which is suspected to open a comment, instead of being
20690 called after `//' or `/*' was read.
20691 (copy_comment, copy_definition, parse_union_decl, copy_action)
20692 (copy_guard): Adjust.
20693
20694 2000-10-16 Akim Demaille <akim@epita.fr>
20695
20696 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20697 `read_signed_integer'.
20698
20699 2000-10-16 Akim Demaille <akim@epita.fr>
20700
20701 * src/reader.c (copy_dollar): New function.
20702 (copy_guard, copy_action): Use it.
20703
20704 2000-10-16 Akim Demaille <akim@epita.fr>
20705
20706 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20707 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20708 New files, from Fileutils 4.0.27.
20709 * src/main.c (printable_version): Remove.
20710 * src/lex.c, src/reader.c: Use `quote'.
20711
20712 2000-10-04 Akim Demaille <akim@epita.fr>
20713
20714 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20715
20716 2000-10-04 Akim Demaille <akim@epita.fr>
20717
20718 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20719
20720 2000-10-04 Akim Demaille <akim@epita.fr>
20721
20722 When a literal string is used to define two different tokens,
20723 `bison -v' segfaults.
20724 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20725
20726 * tests/regression.m4: New file.
20727 Include the core of the sample provided by Piotr Gackiewicz.
20728 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20729 properly.
20730
20731 2000-10-04 Akim Demaille <akim@epita.fr>
20732
20733 * src/reader.c (parse_expect_decl): Keep `count' within the size
20734 of `buffer'.
20735 From Neil Booth.
20736
20737 2000-10-02 Paul Eggert <eggert@twinsun.com>
20738
20739 * bison.s1 (yyparse): Assign the default value
20740 unconditionally, to avoid a GCC warning and make the parser a
20741 tad smaller.
20742
20743 2000-10-02 Akim Demaille <akim@epita.fr>
20744
20745 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20746 options.
20747
20748 2000-10-02 Akim Demaille <akim@epita.fr>
20749
20750 * src/derives.c, src/print.c, src/reduce.c: To ease the
20751 translation, move some `\n' out of the translated strings.
20752
20753 2000-10-02 Akim Demaille <akim@epita.fr>
20754
20755 The location tracking mechanism is precious for parse error
20756 messages. Nevertheless, it is enabled only when `@n' is used in
20757 the grammar, which is a different issue (you can use it in error
20758 message, but not in the grammar per se). Therefore, there should
20759 be another means to enable it.
20760
20761 * src/getargs.c (getargs): Support `--locations'.
20762 (usage): Report it.
20763 * src/getargs.h (locationsflag): Export it.
20764 * src/lex.c (percent_table): Support `%locations'.
20765 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20766 with `locationsflag'.
20767 * doc/bison.texinfo: Document `--locations' and `%locations'.
20768 Sort the options.
20769 * tests/calc.m4: Test it.
20770
20771 For regularity of the names, replace each
20772 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20773 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20774 In addition replace each `flag' with `_flag'.
20775
20776 2000-10-02 Akim Demaille <akim@epita.fr>
20777
20778 Also test parse error messages, including with YYERROR_VERBOSE.
20779
20780 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20781 associative).
20782 Use it to check the computations.
20783 Use it to check `nonassoc' is honored.
20784 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20785 `--yyerror-verbose'.
20786 (_AT_CHECK_CALC): Adjust to this option.
20787 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20788
20789 2000-10-02 Akim Demaille <akim@epita.fr>
20790
20791 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20792 the latter demonstrates a flaw in the handling of non debugging
20793 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20794 was used in order to simplify:
20795
20796 #if YYDEBUG
20797 if (yydebug)
20798 {
20799 ...
20800 }
20801 #endif
20802
20803 into
20804
20805 if (yydebug)
20806 {
20807 ...
20808 }
20809
20810 unfortunately this leads to a CPP conflict when
20811 `--name-prefix=foo' is used since it produces `#define yydebug
20812 foodebug'.
20813
20814 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20815 (YYDPRINTF): New macro.
20816 Spread its use.
20817 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20818 the bison options.
20819 Also test `--verbose', `--defines' and `--name-prefix'.
20820
20821 2000-10-02 Akim Demaille <akim@epita.fr>
20822
20823 Improve the readability of the produced parsers.
20824
20825 * src/bison.s1: Formatting changes.
20826 Improve the comment related to the `$' mark.
20827 (yydefault): Don't fall through to `yyresume': `goto' there.
20828 * src/output.c (output_parser): When the `$' is met, skip the end
20829 of its line.
20830 New variable, `number_of_dollar_signs', to check there's exactly
20831 one `$' in the parser skeleton.
20832
20833 2000-10-02 Akim Demaille <akim@epita.fr>
20834
20835 * lib/xstrdup.c: New file, from the fileutils.
20836 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20837 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20838 instead of strlen + xmalloc + strcpy.
20839 * src/symtab.c (copys): Remove, use xstrdup instead.
20840
20841 2000-10-02 Akim Demaille <akim@epita.fr>
20842
20843 * src/gram.h (associativity): New enum type which replaces the
20844 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20845 `right_assoc', `left_assoc' and `non_assoc'.
20846 Adjust all dependencies.
20847 * src/reader.c: Formatting changes.
20848 (LTYPESTR): Don't define it, use it as a literal in
20849 `reader_output_yylsp'.
20850 * src/symtab.h (symbol_class): New enum type which replaces the
20851 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20852 `sunknown', `stoken and `snterm'.
20853
20854 2000-10-02 Akim Demaille <akim@epita.fr>
20855
20856 * src/getargs.c (fixed_outfiles): Rename as...
20857 (yaccflag): for consistency and accuracy.
20858 Adjust dependencies.
20859
20860 2000-10-02 Akim Demaille <akim@epita.fr>
20861
20862 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20863 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20864 difficult and introduced a lot of core dump. It turns out that
20865 Bison used an implementation of `xmalloc' based on `calloc', and
20866 at various places it does depend upon the initialization to 0. I
20867 have not tried to isolate the pertinent places, and all the former
20868 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20869 someone should address this issue.
20870
20871 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20872 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20873 files.
20874 Adjust dependencies.
20875 * src/warshall.h: New file.
20876 Propagate.
20877
20878 2000-10-02 Akim Demaille <akim@epita.fr>
20879
20880 Various anti-`extern in *.c' changes.
20881
20882 * src/system.h: Include `assert.h'.
20883
20884 2000-10-02 Akim Demaille <akim@epita.fr>
20885
20886 * src/state.h (nstates, final_state, first_state, first_shift)
20887 (first_reduction): Move their exportation from here...
20888 * src/LR0.h: to here.
20889 Adjust dependencies.
20890 * src/getargs.c (statisticsflag): New variable.
20891 Add support for `--statistics'.
20892 Adjust dependencies.
20893
20894 Remove a lot of now useless `extern' statements in most files.
20895
20896 2000-10-02 Akim Demaille <akim@epita.fr>
20897
20898 * src/LR0.h: New file.
20899 Propagate its use.
20900
20901 2000-10-02 Akim Demaille <akim@epita.fr>
20902
20903 * src/print.h: New file.
20904 Propagate its use.
20905 * src/print.c: Formatting and ordering changes.
20906 (verbose, terse): Replace with...
20907 (print_results): this new function.
20908 Adjust dependencies.
20909
20910 2000-10-02 Akim Demaille <akim@epita.fr>
20911
20912 * src/conflicts.c (conflict_report): New function.
20913 (conflict_log, verbose_conflict_log): Replace with...
20914 (print_conflicts): this function.
20915 Adjust dependencies.
20916 * src/conflicts.h: New file.
20917 Propagate its inclusion.
20918
20919 2000-10-02 Akim Demaille <akim@epita.fr>
20920
20921 * src/nullable.h: New file.
20922 Propagate its inclusion.
20923 * src/nullable.c: Formatting changes.
20924
20925 2000-10-02 Akim Demaille <akim@epita.fr>
20926
20927 * src/reduce.h: New file.
20928 Propagate its inclusion.
20929 * src/reduce.c: Topological sort and other formatting changes.
20930 (bool, TRUE, FALSE): Move their definition to...
20931 * src/system.h: here.
20932
20933 2000-10-02 Akim Demaille <akim@epita.fr>
20934
20935 * src/files.c: Formatting changes.
20936 (tryopen, tryclose, openfiles): Rename as...
20937 (xfopen, xfclose, open_files): this.
20938 (stringappend): static.
20939 * src/files.h: Complete the list of exported symbols.
20940 Propagate its use.
20941
20942 2000-10-02 Akim Demaille <akim@epita.fr>
20943
20944 * src/reader.h: New file.
20945 Propagate its use instead of tedious list of `extern' and
20946 prototypes.
20947 * src/reader.c: Formatting changes, topological sort,
20948 s/register//.
20949
20950 2000-10-02 Akim Demaille <akim@epita.fr>
20951
20952 * src/lex.h: Prototype `lex.c' exported functions.
20953 * src/reader.c: Adjust.
20954 * src/lex.c: Formatting changes.
20955 (safegetc): Rename as...
20956 (xgetc): this.
20957
20958 2000-10-02 Akim Demaille <akim@epita.fr>
20959
20960 * src/lalr.h: New file.
20961 Propagate its inclusion instead of prototypes and `extern'.
20962 * src/lalr.c: Formatting changes, topological sorting etc.
20963
20964 2000-10-02 Akim Demaille <akim@epita.fr>
20965
20966 * src/output.c (token_actions): Introduce a temporary array,
20967 YYDEFACT, that makes it possible for this function to use
20968 output_short_table.
20969
20970 2000-10-02 Akim Demaille <akim@epita.fr>
20971
20972 `user_toknums' is output as a `short[]' in `output.c', while it is
20973 defined as a `int[]' in `reader.c'. For consistency with the
20974 other output tables, `user_toknums' is now defined as a table of
20975 shorts.
20976
20977 * src/reader.c (user_toknums): Be a short table instead of an int
20978 table.
20979 Adjust dependencies.
20980
20981 Factor the short table outputs.
20982
20983 * src/output.c (output_short_table): New function.
20984 * src/output.c (output_gram, output_stos, output_rule_data)
20985 (output_base, output_table, output_check): Use it.
20986
20987 2000-10-02 Akim Demaille <akim@epita.fr>
20988
20989 * src/output.c (output): Topological sort of the functions, in
20990 order to get rid of the `static' prototypes.
20991 No longer use `register'.
20992 * src/output.h: New file.
20993 Propagate its inclusion in files explicitly prototyping functions
20994 from output.c.
20995
20996 2000-09-21 Akim Demaille <akim@epita.fr>
20997
20998 * src/atgeneral.m4: Update from Autoconf.
20999
21000 2000-09-21 Akim Demaille <akim@epita.fr>
21001
21002 * src/closure.h: New file.
21003 * src/closure.c: Formatting changes, topological sort over the
21004 functions, use of closure.h.
21005 (initialize_closure, finalize_closure): Rename as...
21006 (new_closure, free_closure): these. Adjust dependencies.
21007 * src/LR0.c: Formatting changes, topological sort, use of
21008 cloture.h.
21009 (initialize_states): Rename as...
21010 (new_states): this.
21011 * src/Makefile.am (noinst_HEADERS): Adjust.
21012
21013 2000-09-20 Akim Demaille <akim@epita.fr>
21014
21015 * src/acconfig.h: Don't protect config.h against multiple
21016 inclusion.
21017 Don't define PARAMS.
21018 * src/system.h: Define PARAMS.
21019 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
21020 purpose of config.h. system.h must not try to fix wrong
21021 definitions in config.h.
21022
21023 2000-09-20 Akim Demaille <akim@epita.fr>
21024
21025 * src/derives.h: New file.
21026 * src/main.c, src/derives.h: Use it.
21027 Formatting changes.
21028 * src/Makefile.am (noinst_HEADERS): Adjust.
21029
21030 2000-09-20 Akim Demaille <akim@epita.fr>
21031
21032 * tests/atgeneral.m4: Update from Autoconf.
21033 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
21034 (AT_CHECK_CALC): New macros.
21035 Use these macros to test bison with options `', `--raw',
21036 `--debug', `--yacc', `--yacc --debug'.
21037
21038 2000-09-19 Akim Demaille <akim@epita.fr>
21039
21040 * src/output.c: Formatting changes.
21041 * src/machine.h: Remove, leaving its contents in...
21042 * src/system.h: here.
21043 Include stdio.h.
21044 Adjust all dependencies on stdio.h and machine.h.
21045 * src/getargs.h: New file.
21046 Let all `extern' declarations about getargs.c be replaced with
21047 inclusion of `getargs.h'.
21048 * src/Makefile.am (noinst_HEADERS): Adjust.
21049
21050 * tests/calc.m4 (yyin): Be initialized in main, not on the global
21051 scope.
21052 (yyerror): Returns void, not int.
21053 * doc/bison.texinfo: Formatting changes.
21054
21055 2000-09-19 Akim Demaille <akim@epita.fr>
21056
21057 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
21058 portable.
21059
21060 2000-09-18 Akim Demaille <akim@epita.fr>
21061
21062 * configure.in: Append WARNING_CFLAGS to CFLAGS.
21063 * src/Makefile.am (INCLUDES): Don't.
21064 Be ready to fetch headers in lib/.
21065
21066 2000-09-18 Akim Demaille <akim@epita.fr>
21067
21068 * doc/bison.texinfo: Update the copyright.
21069 ANSIfy and GNUify the examples.
21070 Remove the old menu.
21071
21072 2000-09-18 Akim Demaille <akim@epita.fr>
21073
21074 First set of tests: use the `calc' example from the documentation.
21075
21076 * src/bison.s1 (yyparse): Condition the code using `yytname' which
21077 is defined only when YYDEBUG is.
21078 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
21079 * src/files.c (tryopen, tryclose): Formatting changes.
21080 Move to the top and be static.
21081 * src/reader.c (read_signed_integer): Likewise.
21082 * tests/calc.m4: New file.
21083 * Makefile.am, suite.m4: Adjust.
21084 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21085
21086 2000-09-18 Akim Demaille <akim@epita.fr>
21087
21088 Add support for an Autotest test suite for Bison.
21089
21090 * m4/m4.m4, m4/atconfig.m4: New files.
21091 * m4/Makefile.am (EXTRA_DIST): Adjust.
21092 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21093 files.
21094 * src/getargs.c: Display a more standard --version message.
21095 * src/reader.c (reader): Formatting changes.
21096 No longer depend upon VERSION_STRING.
21097 * configure.in: No longer use `dnl'.
21098 Set up the test suite and the new directory `tests/.
21099 (VERSION_STRING): Remove.
21100
21101 2000-04-14 Akim Demaille <akim@epita.fr>
21102
21103 * src/reader.c (copy_comment2): New function, same as former
21104 `copy_comment', but outputs into two FILE *.
21105 (copy_comment): Use it.
21106 (parse_union_decl): Use it.
21107 (get_type, parse_start_decl): Use the same `invalid' message.
21108 (parse_start_decl, parse_union_decl): Use the same `multiple'
21109 message.
21110 (parse_union_decl, copy_guard, copy_action): Use the same
21111 `unmatched' message.
21112 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21113
21114 2000-03-31 Akim Demaille <akim@epita.fr>
21115
21116 * src/files.c (tryopen, tryclose): Move to the top.
21117 Be static.
21118
21119 2000-03-31 Akim Demaille <akim@epita.fr>
21120
21121 * src/main.c (main): Don't call `done', exit does it.
21122
21123 2000-03-31 Akim Demaille <akim@epita.fr>
21124
21125 * allocate.c: s/return (foo)/return foo/.
21126 * lalr.c: Likewise.
21127 * LR0.c: Likewise.
21128 * output.c: Likewise.
21129 * reader.c: Likewise.
21130 * symtab.c: Likewise.
21131 * vmsgetargs.c: Likewise.
21132
21133 2000-03-31 Akim Demaille <akim@epita.fr>
21134
21135 Clean up the error reporting functions.
21136
21137 * src/report.c: New file.
21138 * src/report.h: Likewise.
21139 * src/Makefile.am: Adjust.
21140 * m4/error.m4: New file.
21141 * m4/Makefile.am: Adjust.
21142 * configure.in (jm_PREREQ_ERROR): Call it.
21143 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21144 Remove.
21145 (fatal, fatals): Remove. All callers use complain.c::fatal.
21146 (warn, warni, warns, warnss, warnss): Remove. All callers use
21147 complain.c::complain.
21148 (toomany): Remove, use fatal instead.
21149 * src/files.c (done): No argument, use complain_message_count.
21150 * src/main.c (main): Register `done' to `atexit'.
21151
21152 * src/getargs.c (usage): More `fputs', less `fprintf'.
21153
21154 2000-03-28 Akim Demaille <akim@epita.fr>
21155
21156 * lib/: New directory.
21157 * Makefile.am (SUBDIRS): Adjust.
21158 * configure.in: Adjust.
21159 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21160 useless.
21161 * src/alloca.c: Moved to lib/.
21162 * src/getopt.c: Likewise.
21163 * src/getopt1.c: Likewise.
21164 * src/getopt.h: Likewise.
21165 * src/ansi2knr.c: Likewise.
21166 * src/ansi2knr.1: Likewise.
21167 * src/Makefile.am: Adjust.
21168 * lib/Makefile.am: New file.
21169
21170 2000-03-28 Akim Demaille <akim@epita.fr>
21171
21172 * src/getargs.c (usage): Refresh the help message.
21173
21174 2000-03-17 Akim Demaille <akim@epita.fr>
21175
21176 * src/getopt1.c: Updated from textutils 2.0e
21177 * src/getopt.c: Likewise.
21178 * src/getopt.h: Likewise.
21179
21180 2000-03-17 Akim Demaille <akim@epita.fr>
21181
21182 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21183 the file name, not the whole `#line LINE FILE'.
21184
21185 2000-03-17 Akim Demaille <akim@epita.fr>
21186
21187 On syntax errors, report the token on which we choked.
21188
21189 * src/bison.s1 (yyparse): In the label yyerrlab, when
21190 YYERROR_VERBOSE, add yychar in msg.
21191
21192 2000-03-17 Akim Demaille <akim@epita.fr>
21193
21194 * src/reader.c (copy_at): New function.
21195 (copy_guard): Use it.
21196 (copy_action): Use it.
21197
21198 2000-03-17 Akim Demaille <akim@epita.fr>
21199
21200 Be kind to translators, save some useless translations.
21201
21202 * src/main.c (banner): New function.
21203 (fatal_banner): Use it.
21204 (warn_banner): Use it.
21205
21206 2000-03-17 Akim Demaille <akim@epita.fr>
21207
21208 * src/reader.c (copy_definition): Use copy_string and
21209 copy_comment. Removed now unused `match', `ended',
21210 `cplus_comment'.
21211 (copy_comment, copy_string): Moved, to be visible from
21212 copy_definition.
21213
21214 2000-03-17 Akim Demaille <akim@epita.fr>
21215
21216 * src/reader.c (copy_string): Declare `static inline'. No
21217 problems with inline, since it is checked by configure.
21218 (copy_comment): Likewise.
21219
21220 2000-03-17 Akim Demaille <akim@epita.fr>
21221
21222 * src/reader.c (packsymbols): Formatting changes.
21223
21224 2000-03-17 Akim Demaille <akim@epita.fr>
21225
21226 * src/reader.c (copy_comment): New function, factored out from:
21227 (copy_action): Use it. Removed now unused `match', `ended',
21228 `cplus_comment'.
21229 (copy_guard): Likewise.
21230
21231 2000-03-17 Akim Demaille <akim@epita.fr>
21232
21233 * src/reader.c (copy_string): New function, factored out from:
21234 (copy_action): Use it.
21235 (copy_guard): Likewise.
21236
21237 2000-03-17 Akim Demaille <akim@epita.fr>
21238
21239 Change the handling of @s so that they behave exactly like $s.
21240 There is now a pseudo variable @$ (readble and writable), location
21241 of the lhs of the rule (by default ranging from the location of
21242 the first symbol of the rhs, to the location of the last symbol,
21243 or, if the rhs is empty, YYLLOC).
21244
21245 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21246 yyval.
21247 (yyparse): When providing a default semantic action, provide a
21248 default location action.
21249 (after the $): No longer change `*YYLSP', just stack YYLOC the
21250 same way you stack YYVAL.
21251 * src/reader.c (read_declarations): Use warns.
21252 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21253 (copy_action, case '@'): Likewise.
21254 Use a standard error message, to save useless work from
21255 translators.
21256
21257 2000-03-17 Akim Demaille <akim@epita.fr>
21258
21259 * src/bison.s1: Formatting and cosmetics changes.
21260 * src/reader.c: Likewise.
21261 Update the Copyright notice.
21262
21263 2000-03-17 Akim Demaille <akim@epita.fr>
21264
21265 * src/bison.s1 (#line): All set to `#line' only, since the
21266 Makefile now handles them.
21267
21268 2000-03-16 Akim Demaille <akim@epita.fr>
21269
21270 * src/output.c (output_rule_data): Output the documentation of
21271 some of the tables.
21272 (Copyright notice): Update.
21273 Formatting changes.
21274
21275 2000-03-16 Akim Demaille <akim@epita.fr>
21276
21277 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21278 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21279 One `#if YYDEBUG' remains, since it uses variables which are
21280 defined only if `YYDEBUG != 0'.
21281
21282 2000-03-16 Akim Demaille <akim@epita.fr>
21283
21284 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21285 and related variables so that the similarities are highlighted.
21286
21287 2000-03-16 Akim Demaille <akim@epita.fr>
21288
21289 * src/bison.s1: Properly indent CPP directives.
21290
21291 2000-03-16 Akim Demaille <akim@epita.fr>
21292
21293 * src/bison.s1: Properly indent the `alloca' CPP section.
21294
21295 2000-03-16 Akim Demaille <akim@epita.fr>
21296
21297 Do not hard code values of directories in `configure.in'.
21298 Update the `configure' tool chain.
21299
21300 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21301 src/makefile.am.
21302 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21303 (AC_OUTPUT): Add m4/Makefile.
21304 Bump to bison 1.28a, 1.29 has never been released.
21305 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21306 handled via src/Makefile.am.
21307 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21308 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21309 autoheader.
21310 * Makefile.am (SUBDIRS): Add m4.
21311 (ACLOCAL_AM_FLAGS): New variable.
21312 (AUTOMAKE_OPTIONS): Add check-news.
21313 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21314 the proper line number and file name.
21315 (DEFS): Propagate the location of bison library files and of the
21316 locale files.
21317 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21318 builddir.
21319 * acinclude.m4: Remove, replaced by the directory m4.
21320 * m4/Makefile.am (EXTRA_DIST): New variable.
21321 * m4/gettext.m4: New file, from the fileutils.
21322 * m4/lcmessage.m4: Likewise
21323 * m4/progtest.m4: Likewise.
21324 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21325
21326 2000-03-10 Akim Demaille <akim@epita.fr>
21327
21328 * src/closure.c:
21329 Formatting changes of various comments.
21330 Respect the GNU coding standards at various places.
21331 Don't use `_()' when no translation is needed.
21332
21333 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21334
21335 * src/files.c:
21336 OS/2 honors TMPDIR environment variable.
21337
21338 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21339
21340 * doc/bison.texinfo: Tweaked spelling and grammar.
21341 Updated ISBN.
21342 Removed reference to price of printed copy.
21343 Mention BISON_SIMPLE and BISON_HAIRY.
21344
21345 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21346
21347 * configure.in, NEWS:
21348 Bison 1.29 released.
21349
21350 1999-10-27 Jesse Thilo <jthilo@gnu.org>
21351
21352 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21353 Added reference card.
21354
21355 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21356
21357 * po/ru.po: Added Russian translation.
21358
21359 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21360
21361 * configure.in: Added Russian translation.
21362
21363 1999-07-06 Jesse Thilo <jthilo@gnu.org>
21364
21365 * configure.in, NEWS, README:
21366 Released version 1.28.
21367
21368 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21369
21370 * src/system.h:
21371 Squashed redefinition warning on some systems.
21372
21373 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21374 Have configure build version string instead of relying on ANSI string
21375 concatentation.
21376
21377 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21378
21379 * po/POTFILES.in: Got rid of version.c.
21380
21381 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21382
21383 * acconfig.h, configure.in:
21384 Have configure build version string instead of relying on ANSI string
21385 concatentation.
21386
21387 1999-06-08 Jesse Thilo <jthilo@gnu.org>
21388
21389 * doc/bison.1:
21390 Dropped mention of `+' for long-named options.
21391
21392 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21393
21394 * src/files.c: Added <unistd.h> for unlink().
21395
21396 * src/Makefile.am, src/system.h:
21397 I18n fixes.
21398
21399 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21400
21401 * README: Added a FAQ list.
21402
21403 * configure.in, acconfig.h:
21404 I18n fixes.
21405
21406 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21407
21408 * doc/FAQ, doc/Makefile.am:
21409 Added a FAQ list.
21410
21411 1999-05-19 Jesse Thilo <jthilo@gnu.org>
21412
21413 * src/alloc.h, src/symtab.h, src/version.c:
21414 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21415
21416 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21417
21418 * src/.cvsignore, src/Makefile.am:
21419 Reorganized: sources in `src', documentation in `doc'.
21420
21421 * src/lex.c (literalchar):
21422 fixed the code for escaping double quotes (thanks
21423 Jonathan Czisny.)
21424
21425 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21426
21427 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21428 Adjusted paths to reflect directory reorganization.
21429
21430 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21431
21432 * doc/.cvsignore, doc/Makefile.am:
21433 Reorganized: sources in `src', documentation in `doc'.
21434
21435 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21436
21437 * configure.in:
21438 Updated AC_INIT file to reflect directory reorganization.
21439
21440 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21441 Reorganized: sources in `src', documentation in `doc'.
21442
21443 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21444
21445 * src/allocate.c:
21446 Don't declare calloc() and realloc() if not necessary.
21447
21448 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21449
21450 * configure.in, acconfig.h, acinclude.m4:
21451 Don't declare calloc() and realloc() if not necessary.
21452
21453 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21454
21455 * po/.cvsignore: Added i18n support.
21456
21457 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21458
21459 * acconfig.h, configure.in, Makefile.am:
21460 Added i18n support.
21461
21462 1999-03-22 Jesse Thilo <jthilo@gnu.org>
21463
21464 * src/bison.s1: Fixed #line numbers.
21465
21466 1999-03-15 Jesse Thilo <jthilo@gnu.org>
21467
21468 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21469 Added PO files from Translation Project.
21470
21471 1999-03-03 Jesse Thilo <jthilo@gnu.org>
21472
21473 * Makefile.am:
21474 Added support for non-ANSI compilers (ansi2knr).
21475
21476 1999-02-16 Jesse Thilo <jthilo@gnu.org>
21477
21478 * configure.in: Bumped version number to 1.27.
21479
21480 * Makefile.am:
21481 Added `bison.simple' to list of files removed by `make distclean'.
21482
21483 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21484
21485 * src/files.c, src/files.h:
21486 Defined locations of parser files in config.h instead of Makefile.
21487
21488 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21489
21490 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21491 Defined locations of parser files in config.h instead of Makefile.
21492
21493 1999-02-09 Jesse Thilo <jthilo@gnu.org>
21494
21495 * Makefile.am:
21496 Removed inappropriate use of $< macro.
21497
21498 1999-02-05 Jesse Thilo <jthilo@gnu.org>
21499
21500 * po/Makefile.in.in, po/POTFILES.in:
21501 Add `po' directory skeleton.
21502
21503 1999-01-27 Jesse Thilo <jthilo@gnu.org>
21504
21505 * README: Document help-bison list.
21506
21507 * configure.in: Add check for mkstemp().
21508
21509 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21510
21511 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21512 Hush a few compiler warnings.
21513
21514 * src/files.c:
21515 Add tryclose(), which verifies that fclose was successful.
21516 Hush a couple of compiler warnings.
21517
21518 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21519
21520 * Makefile.am, OChangeLog:
21521 ChangeLog is now automatically generated. Include the old version as
21522 OChangeLog.
21523
21524 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21525
21526 * 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:
21527 Update FSF address.
21528
21529 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21530
21531 * doc/bison.texinfo: Fix formatting glitch.
21532
21533 * doc/bison.texinfo: Update FSF address.
21534
21535 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21536
21537 * acconfig.h: Update FSF address.
21538
21539 1999-01-08 Jesse Thilo <jthilo@gnu.org>
21540
21541 * src/system.h:
21542 Don't define PACKAGE here, since config.h defines it.
21543
21544 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21545
21546 * src/reader.c: Update copyright date.
21547
21548 * src/main.c:
21549 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21550 favor of output directly to stderr (avoids buffer overruns).
21551
21552 * src/reader.c: Some checks for premature EOF.
21553
21554 * 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:
21555 Use prototypes if the compiler understands them.
21556
21557 * src/files.c: Honor TMPDIR on Unix hosts.
21558 Use prototypes if the compiler understands them.
21559
21560 * src/reader.c:
21561 Fix a couple of buffer overrun bugs.
21562 Use prototypes if the compiler understands them.
21563
21564 * src/system.h: Include unistd.h and ctype.h.
21565 Use #ifdef instead of #if for NLS symbols.
21566
21567 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21568
21569 * doc/bison.texinfo:
21570 Delete comment "consider using @set for edition number, etc..." since
21571 we now are doing so.
21572
21573 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21574
21575 * configure.in:
21576 Use prototypes if the compiler understands them.
21577
21578 * NEWS: Document 1.26 highlights.
21579
21580 * Makefile.am: Require Automake 1.3 or later.
21581
21582 * acconfig.h:
21583 Use prototypes if the compiler understands them.
21584
21585 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21586
21587 * src/version.c:
21588 Use VERSION symbol from automake for version number.
21589
21590 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21591
21592 * acconfig.h, configure.in, version.cin:
21593 Use VERSION symbol from automake for version number.
21594
21595 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21596
21597 * Makefile.am:
21598 Distribute original version of simple parser (bison.s1), not built
21599 version (bison.simple).
21600
21601 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21602
21603 * doc/bison.texinfo: Add info dir entry.
21604
21605 * doc/bison.texinfo:
21606 Let automake put version number into documentation.
21607
21608 1998-11-26 Jesse Thilo <jthilo@gnu.org>
21609
21610 * src/bison.cld, src/build.com, src/vmshlp.mar:
21611 Add non-RCS files from /gd/gnu/bison.
21612
21613 1998-11-26 Jesse Thilo <jthilo@gnu.org>
21614
21615 * doc/bison.1:
21616 Document the BISON_HAIRY and BISON_SIMPLE variables.
21617
21618 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21619
21620 * src/version.c: Build version.c automatically.
21621
21622 * src/reader.c:
21623 Fix token numbering (used to start at 258, not 257).
21624
21625 * src/system.h: Include config.h.
21626
21627 * src/getargs.c: Update bug report address.
21628
21629 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21630 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21631
21632 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21633
21634 * Makefile.am:
21635 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21636
21637 * configure.in, version.cin:
21638 Build version.c automatically.
21639
21640 * AUTHORS: Add AUTHORS file.
21641
21642 * README: Update bug report address.
21643
21644 * bison.simple:
21645 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21646
21647 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21648 Add automake stuff.
21649
21650 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21651
21652 * doc/bison.texinfo: Clean up some formatting.
21653
21654 1998-05-05 Richard Stallman <rms@gnu.org>
21655
21656 * doc/bison.texinfo:
21657 Explain better why to make a pure parser.
21658
21659 1998-01-05 Richard Stallman <rms@gnu.org>
21660
21661 * src/files.c (openfiles):
21662 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21663 find a temporary directory, if possible. Do not unlink files while
21664 they are open.
21665
21666 1997-08-25 Richard Stallman <rms@gnu.org>
21667
21668 * src/reader.c (stack_offset;):
21669 Change some warni to warns.
21670
21671 * src/lex.c (literalchar): Use warns, not warni.
21672
21673 1997-06-28 Richard Stallman <rms@gnu.org>
21674
21675 * src/bison.s1: Add a Bison version comment.
21676
21677 * src/main.c (fatal, warn, berror):
21678 Use program_name.
21679
21680 1997-06-28 Richard Stallman <rms@gnu.org>
21681
21682 * Makefile.in (bison_version): New variable.
21683 (dist): Use that variable.
21684 (bison.s1): Substitute the Bison version into bison.simple.
21685
21686 * bison.simple: Add a Bison version comment.
21687
21688 1997-06-18 Richard Stallman <rms@gnu.org>
21689
21690 * src/main.c (fatal, warn, berror):
21691 Make error messages standard.
21692 (toomany): Improve error message text.
21693
21694 * 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:
21695 new.h renamed to alloc.h.
21696
21697 1997-06-18 Richard Stallman <rms@gnu.org>
21698
21699 * Makefile.in: new.h renamed to alloc.h.
21700
21701 1997-05-24 Richard Stallman <rms@gnu.org>
21702
21703 * src/lex.c (literalchar):
21704 Fix the code for escaping \, " and '.
21705
21706 (lex): Avoid trouble when there are many chars
21707 to discard in a char literal with just several chars in it.
21708
21709 1997-05-17 Richard Stallman <rms@gnu.org>
21710
21711 * src/bison.s1:
21712 Use malloc, if using alloca is troublesome.
21713 (YYSTACK_USE_ALLOCA): New flag macro.
21714 Define it for some systems and compilers.
21715 (YYSTACK_ALLOC): New macro.
21716 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21717 If it was malloc'd, free it.
21718
21719 1997-05-17 Richard Stallman <rms@gnu.org>
21720
21721 * bison.simple:
21722 Use malloc, if using alloca is troublesome.
21723 (YYSTACK_USE_ALLOCA): New flag macro.
21724 Define it for some systems and compilers.
21725 (YYSTACK_ALLOC): New macro.
21726 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21727 If it was malloc'd, free it.
21728
21729 1997-04-23 Richard Stallman <rms@gnu.org>
21730
21731 * src/bison.s1:
21732 (alloca) [__hpux]: Always define as __builtin_alloca.
21733
21734 1997-04-23 Richard Stallman <rms@gnu.org>
21735
21736 * bison.simple:
21737 (alloca) [__hpux]: Always define as __builtin_alloca.
21738
21739 1997-04-22 Richard Stallman <rms@gnu.org>
21740
21741 * src/bison.s1:
21742 [__hpux]: Include alloca.h (right for HPUX 10)
21743 instead of declaring alloca (right for HPUX 9).
21744
21745 * src/bison.s1 (__yy_memcpy):
21746 Declare arg `count' as unsigned int.
21747 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21748
21749 1997-04-22 Richard Stallman <rms@gnu.org>
21750
21751 * bison.simple:
21752 [__hpux]: Include alloca.h (right for HPUX 10)
21753 instead of declaring alloca (right for HPUX 9).
21754
21755 * bison.simple (__yy_memcpy):
21756 Declare arg `count' as unsigned int.
21757 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21758
21759 1997-01-03 Richard Stallman <rms@gnu.org>
21760
21761 * src/allocate.c: [__STDC__ or _MSC_VER]:
21762 Declare calloc and realloc to return void *.
21763
21764 1997-01-02 Richard Stallman <rms@gnu.org>
21765
21766 * src/system.h:
21767 [_MSC_VER]: Include stdlib.h and process.h.
21768 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21769
21770 * src/main.c (main): Return FAILURE as a value.
21771 (printable_version): Declare arg as int, not char.
21772
21773 1997-01-02 Richard Stallman <rms@gnu.org>
21774
21775 * Makefile.in (dist):
21776 Explicitly check for symlinks, and copy them.
21777
21778 1996-12-19 Richard Stallman <rms@gnu.org>
21779
21780 * src/files.c:
21781 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21782
21783 1996-12-18 Paul Eggert <eggert@gnu.org>
21784
21785 * src/bison.s1 (yyparse):
21786 If __GNUC__ and YYPARSE_PARAM are both defined,
21787 declare yyparse to have a void * argument.
21788
21789 1996-12-18 Paul Eggert <eggert@gnu.org>
21790
21791 * bison.simple (yyparse):
21792 If __GNUC__ and YYPARSE_PARAM are both defined,
21793 declare yyparse to have a void * argument.
21794
21795 1996-12-17 Richard Stallman <rms@gnu.org>
21796
21797 * src/reduce.c (nbits): Add some casts.
21798
21799 1996-08-12 Richard Stallman <rms@gnu.org>
21800
21801 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21802
21803 1996-08-12 Richard Stallman <rms@gnu.org>
21804
21805 * bison.simple: Test _MSDOS as well as _MSDOS_.
21806
21807 1996-07-31 Richard Stallman <rms@gnu.org>
21808
21809 * src/bison.s1:
21810 [__sun && __i386]: Include alloca.h.
21811
21812 1996-07-31 Richard Stallman <rms@gnu.org>
21813
21814 * bison.simple:
21815 [__sun && __i386]: Include alloca.h.
21816
21817 1996-07-30 Richard Stallman <rms@gnu.org>
21818
21819 * src/bison.s1: Comment change.
21820
21821 * src/bison.s1: Test _MSDOS_, not MSDOS.
21822
21823 1996-07-30 Richard Stallman <rms@gnu.org>
21824
21825 * bison.simple: Comment change.
21826
21827 * bison.simple: Test _MSDOS_, not MSDOS.
21828
21829 1996-06-01 Richard Stallman <rms@gnu.org>
21830
21831 * 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:
21832 Insert `_' macro around many string constants.
21833
21834 * src/main.c:
21835 Insert `_' macro around many string constants.
21836
21837 (main): Call setlocale, bindtextdomain and textdomain.
21838
21839 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21840 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21841 [ENABLE_NLS]: Include libintl.h.
21842 [ENABLE_NLS] (gettext): Define.
21843 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21844 (N_, PACKAGE, LOCALEDIR): New macros.
21845
21846 1996-06-01 Richard Stallman <rms@gnu.org>
21847
21848 * POTFILES.in: New file.
21849
21850 * Makefile.in (allocate.o):
21851 Define target explicitly.
21852
21853 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21854 (LDFLAGS): Set to @LDFLAGS@.
21855 (configure): Run autoconf only if preceding `cd' succeeds.
21856 (bison.s1): Redirect output to temporary file then move the
21857 temporary to the target, rather than redirecting directly to bison.s1.
21858 (clean): Remove config.status and config.log.
21859 (distclean): Don't remove config.status here.
21860
21861 1996-05-12 Richard Stallman <rms@gnu.org>
21862
21863 * src/bison.s1:
21864 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21865
21866 1996-05-12 Richard Stallman <rms@gnu.org>
21867
21868 * bison.simple:
21869 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21870
21871 1996-05-11 Richard Stallman <rms@gnu.org>
21872
21873 * src/bison.s1 (__yy_memcpy):
21874 Really reorder the args, as was supposedly done on Feb 14 1995.
21875 (yyparse): Calls changed accordingly.
21876
21877 1996-05-11 Richard Stallman <rms@gnu.org>
21878
21879 * Makefile.in (dist): Don't use $(srcdir).
21880
21881 * bison.simple (__yy_memcpy):
21882 Really reorder the args, as was supposedly done on Feb 14 1995.
21883 (yyparse): Calls changed accordingly.
21884
21885 1996-01-27 Richard Stallman <rms@gnu.org>
21886
21887 * src/output.c (output_rule_data):
21888 Test YYERROR_VERBOSE in the conditional
21889 around the definition of ttyname.
21890
21891 1995-12-29 Richard Stallman <rms@gnu.org>
21892
21893 * src/bison.s1:
21894 Fix line numbers in #line commands.
21895
21896 1995-12-29 Richard Stallman <rms@gnu.org>
21897
21898 * bison.simple:
21899 Fix line numbers in #line commands.
21900
21901 1995-12-27 Richard Stallman <rms@gnu.org>
21902
21903 * src/bison.s1 (YYPARSE_PARAM_DECL):
21904 In C++, make it always null.
21905 (YYPARSE_PARAM_ARG): New macro.
21906 (yyparse): Use YYPARSE_PARAM_ARG.
21907
21908 1995-12-27 Richard Stallman <rms@gnu.org>
21909
21910 * bison.simple (YYPARSE_PARAM_DECL):
21911 In C++, make it always null.
21912 (YYPARSE_PARAM_ARG): New macro.
21913 (yyparse): Use YYPARSE_PARAM_ARG.
21914
21915 1995-11-29 Richard Stallman <rms@gnu.org>
21916
21917 * doc/bison.texinfo:
21918 Describe literal string tokens, %raw, %no_lines, %token_table.
21919
21920 1995-11-29 Daniel Hagerty <hag@gnu.org>
21921
21922 * doc/bison.texinfo: Fixed update date
21923
21924 1995-10-16 Richard Stallman <rms@gnu.org>
21925
21926 * src/version.c: Version 1.25.
21927
21928 1995-10-16 Richard Stallman <rms@gnu.org>
21929
21930 * NEWS: *** empty log message ***
21931
21932 1995-10-16 Richard Stallman <rms@gnu.org>
21933
21934 * doc/bison.1, doc/bison.rnh:
21935 Add new options.
21936
21937 1995-10-15 Richard Stallman <rms@gnu.org>
21938
21939 * src/vmsgetargs.c, src/getargs.c:
21940 Added -n, -k, and -raw switches.
21941 (noparserflag, toknumflag, rawtoknumflag): New variables.
21942
21943 * src/symtab.h (SALIAS):
21944 New #define for adding aliases to %token.
21945 (struct bucket): Added `alias' field.
21946
21947 * src/reduce.c (reduce_grammar):
21948 Revise error message.
21949 (print_notices): Remove final `.' from error message.
21950
21951 * src/reader.c (reader_output_yylsp):
21952 New function.
21953 (readgram): Use `#if 0' around code that accepted %command
21954 inside grammar rules: The documentation doesn't allow it,
21955 and it will fail since the %command processors scan for the next %.
21956 (parse_token_decl): Extended the %token
21957 declaration to allow a multi-character symbol as an alias.
21958 (parse_thong_decl): New function.
21959 (read_declarations): Added %thong declarations.
21960 (read_declarations): Handle NOOP to deal with allowing
21961 % declarations as another means to specify the flags.
21962 (readgram): Allow %prec prior to semantics embedded in a rule.
21963 (skip_to_char, read_declarations, copy_definition)
21964 (parse_token_decl, parse_start_decl, parse_type_decl)
21965 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21966 (get_type_name, copy_guard, copy_action, readgram)
21967 (get_type, packsymbols): Revised most error messages.
21968 Changed `fatal' to `warnxxx' to avoid aborting for error.
21969 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21970 (read_declarations): Improve the error message for
21971 an invalid character. Do not abort.
21972 (read_declarations, copy_guard, copy_action): Use
21973 printable_version to avoid unprintable characters in printed output.
21974 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21975 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21976 Allow the type of a non-terminal can be given
21977 more than once, as long as all specifications give the same type.
21978
21979 * src/output.c:
21980 (output_headers, output_trailers, output, output_gram)
21981 (output_rule_data): Implement noparserflag variable.
21982 Implement toknumflag variable.
21983 (output): Call reader_output_yylsp to output LTYPESTR.
21984
21985 * src/main.c (main):
21986 If reader sees an error, don't process the grammar.
21987 (fatals): Updated to not use VARARGS1.
21988 (printable_version, int_to_string, warn, warni, warns, warnss)
21989 (warnsss): New error reporting functions. Avoid abort for error.
21990
21991 * src/lex.h:
21992 Added THONG and NOOP for alias processing.
21993 Added SETOPT for the new code that allows setting options with %flags.
21994
21995 * src/lex.c:
21996 Include getopt.h. Add some extern decls.
21997 (safegetc): New function to deal with EOF gracefully.
21998 (literalchar); new function to deal with reading \ escapes.
21999 (lex): Use literalchar.
22000 (lex): Implemented "..." tokens.
22001 (literalchar, lex, parse_percent_token): Made tokenbuffer
22002 always contain the token. This includes growing the token
22003 buffer while reading an integer.
22004 (parse_percent_token): Replaced if-else statement with percent_table.
22005 (parse_percent_token): Added % declarations as another
22006 way to specify the flags -n, -l, and -r. Also added hooks for
22007 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
22008 major changes to files.c.
22009 (lex) Retain in the incoming stream a character following
22010 an incorrect '/'.
22011 (skip_white_space, lex): Revised most error messages
22012 and changed fatal to warn to avoid aborting.
22013 (percent_table): Added %thong declarations.
22014
22015 * src/gram.h: Comment changes.
22016
22017 * src/files.c (openfiles, open_extra_files, done):
22018 Add faction flag
22019 and actfile file. Handle noparserflag. Both for -n switch.
22020
22021 * src/conflicts.c (resolve_sr_conflict):
22022 Remove use of alloca.
22023
22024 1995-06-01 Jim Meyering <meyering@gnu.org>
22025
22026 * doc/bison.texinfo: *** empty log message ***
22027
22028 1995-05-06 Richard Stallman <rms@gnu.org>
22029
22030 * src/bison.s1: Comment change.
22031
22032 1995-05-06 Richard Stallman <rms@gnu.org>
22033
22034 * bison.simple: Comment change.
22035
22036 1995-05-03 Richard Stallman <rms@gnu.org>
22037
22038 * src/version.c: Version now 1.24.
22039
22040 * src/bison.s1: Change distribution terms.
22041
22042 * src/version.c: Version now 1.23.
22043
22044 1995-05-03 Richard Stallman <rms@gnu.org>
22045
22046 * doc/bison.texinfo:
22047 Rewrite "Conditions for Using Bison".
22048 Update version to 1.24.
22049
22050 1995-05-03 Richard Stallman <rms@gnu.org>
22051
22052 * bison.simple: Change distribution terms.
22053
22054 1995-02-23 Richard Stallman <rms@gnu.org>
22055
22056 * src/files.c: Test __VMS_POSIX as well as VMS.
22057
22058 1995-02-14 Jim Meyering <meyering@gnu.org>
22059
22060 * src/bison.s1 (__yy_memcpy):
22061 Renamed from __yy_bcopy to avoid
22062 confusion. Reverse FROM and TO arguments to be consistent with
22063 those of memcpy.
22064
22065 1995-02-14 Jim Meyering <meyering@gnu.org>
22066
22067 * bison.simple (__yy_memcpy):
22068 Renamed from __yy_bcopy to avoid
22069 confusion. Reverse FROM and TO arguments to be consistent with
22070 those of memcpy.
22071
22072 1994-11-10 David J. MacKenzie <djm@gnu.org>
22073
22074 * NEWS: reformat
22075
22076 * NEWS: New file.
22077
22078 * Makefile.in (DISTFILES): Include NEWS.
22079
22080 * Makefile.in (DISTFILES):
22081 Include install-sh, not install.sh.
22082
22083 * configure.in: Update to Autoconf v2 macro names.
22084
22085 1994-10-05 David J. MacKenzie <djm@gnu.org>
22086
22087 * Makefile.in: fix typo
22088
22089 * Makefile.in (prefix, exec_prefix):
22090 Let configure set them.
22091
22092 1994-09-28 David J. MacKenzie <djm@gnu.org>
22093
22094 * Makefile.in: Set datadir to $(prefix)/share.
22095
22096 1994-09-15 Richard Stallman <rms@gnu.org>
22097
22098 * src/bison.s1:
22099 Update copyright notice and GPL version.
22100
22101 1994-09-15 Richard Stallman <rms@gnu.org>
22102
22103 * bison.simple:
22104 Update copyright notice and GPL version.
22105
22106 1994-07-12 Richard Stallman <rms@gnu.org>
22107
22108 * src/reduce.c, src/reader.c:
22109 entered into RCS
22110
22111 1994-05-05 David J. MacKenzie <djm@gnu.org>
22112
22113 * Makefile.in: entered into RCS
22114
22115 1994-03-26 Richard Stallman <rms@gnu.org>
22116
22117 * src/bison.s1: entered into RCS
22118
22119 1994-03-26 Richard Stallman <rms@gnu.org>
22120
22121 * bison.simple: entered into RCS
22122
22123 1994-03-25 Richard Stallman <rms@gnu.org>
22124
22125 * src/main.c: entered into RCS
22126
22127 1994-03-24 Richard Stallman <rms@gnu.org>
22128
22129 * src/conflicts.c: entered into RCS
22130
22131 1994-01-02 Richard Stallman <rms@gnu.org>
22132
22133 * Makefile.in: *** empty log message ***
22134
22135 1993-11-21 Richard Stallman <rms@gnu.org>
22136
22137 * src/bison.s1: *** empty log message ***
22138
22139 1993-11-21 Richard Stallman <rms@gnu.org>
22140
22141 * doc/bison.texinfo: entered into RCS
22142
22143 * doc/bison.texinfo: *** empty log message ***
22144
22145 1993-11-21 Richard Stallman <rms@gnu.org>
22146
22147 * bison.simple: *** empty log message ***
22148
22149 1993-10-25 David J. MacKenzie <djm@gnu.org>
22150
22151 * doc/bison.texinfo: *** empty log message ***
22152
22153 1993-10-19 Richard Stallman <rms@gnu.org>
22154
22155 * src/bison.s1: *** empty log message ***
22156
22157 1993-10-19 Richard Stallman <rms@gnu.org>
22158
22159 * bison.simple: *** empty log message ***
22160
22161 1993-10-14 Richard Stallman <rms@gnu.org>
22162
22163 * src/bison.s1: *** empty log message ***
22164
22165 1993-10-14 Richard Stallman <rms@gnu.org>
22166
22167 * bison.simple: *** empty log message ***
22168
22169 1993-09-14 David J. MacKenzie <djm@gnu.org>
22170
22171 * doc/bison.texinfo: *** empty log message ***
22172
22173 1993-09-13 Noah Friedman <friedman@gnu.org>
22174
22175 * Makefile.in: *** empty log message ***
22176
22177 1993-09-10 Richard Stallman <rms@gnu.org>
22178
22179 * src/conflicts.c: *** empty log message ***
22180
22181 * src/system.h: entered into RCS
22182
22183 1993-09-10 Richard Stallman <rms@gnu.org>
22184
22185 * doc/bison.1: entered into RCS
22186
22187 1993-09-06 Noah Friedman <friedman@gnu.org>
22188
22189 * src/version.c: entered into RCS
22190
22191 1993-09-06 Noah Friedman <friedman@gnu.org>
22192
22193 * Makefile.in: *** empty log message ***
22194
22195 1993-07-30 David J. MacKenzie <djm@gnu.org>
22196
22197 * Makefile.in: *** empty log message ***
22198
22199 1993-07-24 Richard Stallman <rms@gnu.org>
22200
22201 * src/bison.s1: *** empty log message ***
22202
22203 1993-07-24 Richard Stallman <rms@gnu.org>
22204
22205 * bison.simple: *** empty log message ***
22206
22207 1993-07-08 David J. MacKenzie <djm@gnu.org>
22208
22209 * Makefile.in: *** empty log message ***
22210
22211 1993-07-04 Richard Stallman <rms@gnu.org>
22212
22213 * src/bison.s1: *** empty log message ***
22214
22215 1993-07-04 Richard Stallman <rms@gnu.org>
22216
22217 * bison.simple: *** empty log message ***
22218
22219 1993-06-26 David J. MacKenzie <djm@gnu.org>
22220
22221 * src/getargs.c: entered into RCS
22222
22223 1993-06-26 David J. MacKenzie <djm@gnu.org>
22224
22225 * doc/bison.texinfo: *** empty log message ***
22226
22227 * doc/bison.1: New file.
22228
22229 1993-06-25 Richard Stallman <rms@gnu.org>
22230
22231 * src/getargs.c: New file.
22232
22233 1993-06-16 Richard Stallman <rms@gnu.org>
22234
22235 * src/bison.s1: *** empty log message ***
22236
22237 1993-06-16 Richard Stallman <rms@gnu.org>
22238
22239 * bison.simple: *** empty log message ***
22240
22241 1993-06-03 Richard Stallman <rms@gnu.org>
22242
22243 * src/bison.s1: New file.
22244
22245 1993-06-03 Richard Stallman <rms@gnu.org>
22246
22247 * doc/bison.texinfo: *** empty log message ***
22248
22249 1993-06-03 Richard Stallman <rms@gnu.org>
22250
22251 * bison.simple: New file.
22252
22253 1993-05-19 Richard Stallman <rms@gnu.org>
22254
22255 * doc/bison.texinfo: New file.
22256
22257 1993-05-07 Noah Friedman <friedman@gnu.org>
22258
22259 * Makefile.in: *** empty log message ***
22260
22261 1993-04-28 Noah Friedman <friedman@gnu.org>
22262
22263 * src/reader.c: *** empty log message ***
22264
22265 1993-04-23 Noah Friedman <friedman@gnu.org>
22266
22267 * src/alloc.h: entered into RCS
22268
22269 1993-04-20 David J. MacKenzie <djm@gnu.org>
22270
22271 * src/version.c: *** empty log message ***
22272
22273 * src/files.c, src/allocate.c:
22274 entered into RCS
22275
22276 * src/reader.c: *** empty log message ***
22277
22278 * src/lex.c: entered into RCS
22279
22280 * src/conflicts.c: New file.
22281
22282 * src/symtab.c: entered into RCS
22283
22284 * src/alloc.h: New file.
22285
22286 * src/LR0.c: entered into RCS
22287
22288 1993-04-18 Noah Friedman <friedman@gnu.org>
22289
22290 * src/reader.c: New file.
22291
22292 * src/version.c: *** empty log message ***
22293
22294 1993-04-18 Noah Friedman <friedman@gnu.org>
22295
22296 * Makefile.in: *** empty log message ***
22297
22298 1993-04-17 Noah Friedman <friedman@gnu.org>
22299
22300 * Makefile.in: *** empty log message ***
22301
22302 1993-04-15 Richard Stallman <rms@gnu.org>
22303
22304 * src/main.c, src/files.c:
22305 New file.
22306
22307 1993-04-15 Noah Friedman <friedman@gnu.org>
22308
22309 * configure.in: entered into RCS
22310
22311 * configure.in: *** empty log message ***
22312
22313 * configure.in: New file.
22314
22315 1993-04-14 Richard Stallman <rms@gnu.org>
22316
22317 * Makefile.in: New file.
22318
22319 1993-04-13 Richard Stallman <rms@gnu.org>
22320
22321 * src/version.c: New file.
22322
22323 1993-03-25 Richard Stallman <rms@gnu.org>
22324
22325 * src/output.c: entered into RCS
22326
22327 1992-09-25 Richard Stallman <rms@gnu.org>
22328
22329 * configure.bat: entered into RCS
22330
22331 1992-06-22 Richard Stallman <rms@gnu.org>
22332
22333 * src/vmsgetargs.c: entered into RCS
22334
22335 1992-06-22 Richard Stallman <rms@gnu.org>
22336
22337 * doc/bison.rnh: entered into RCS
22338
22339 1992-04-20 David J. MacKenzie <djm@gnu.org>
22340
22341 * README: entered into RCS
22342
22343 1992-01-22 Richard Stallman <rms@gnu.org>
22344
22345 * src/machine.h: entered into RCS
22346
22347 1991-12-21 Richard Stallman <rms@gnu.org>
22348
22349 * src/lalr.c, src/closure.c:
22350 entered into RCS
22351
22352 1991-12-20 Richard Stallman <rms@gnu.org>
22353
22354 * src/state.h: entered into RCS
22355
22356 1991-12-18 Richard Stallman <rms@gnu.org>
22357
22358 * src/print.c, src/nullable.c, src/derives.c:
22359 entered into RCS
22360
22361 1991-11-03 David J. MacKenzie <djm@gnu.org>
22362
22363 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22364 entered into RCS
22365
22366 1988-09-09 Richard Stallman <rms@gnu.org>
22367
22368 * src/bison.hairy: entered into RCS
22369
22370 1987-12-16 Richard Stallman <rms@gnu.org>
22371
22372 * REFERENCES: entered into RCS
22373
22374
22375 -----
22376
22377 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
22378 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
22379 Free Software Foundation, Inc.
22380
22381 Copying and distribution of this file, with or without
22382 modification, are permitted provided the copyright notice and this
22383 notice are preserved.