]> git.saurik.com Git - bison.git/blame - ChangeLog
Remove data/Makefile.am.
[bison.git] / ChangeLog
CommitLineData
6a5aa0cd
AD
12008-11-15 Akim Demaille <demaille@gostai.com>
2
3 Remove data/Makefile.am.
4 * data/Makefile.am: Rename as...
5 * data/local.mk: this.
6 Adjust paths.
7 * Makefile.am, configure.ac: Adjust.
8
7cb794dc
AD
92008-11-15 Akim Demaille <demaille@gostai.com>
10
11 Remove etc/Makefile.am.
12 * etc/Makefile.am: Rename as...
13 * etc/local.mk: this.
14 Adjust.
15 * Makefile.am, configure.ac: Adjust.
16
cd409e3b
AD
172008-11-15 Akim Demaille <demaille@gostai.com>
18
19 Remove examples/local.mk.
20 examples/calc++/Makefile.am might be interesting to keep as is, since
21 it is an example in itself.
22
23 * examples/Makefile.am: Rename as...
24 * examples/local.mk: this.
25 Adjust.
26 * Makefile.am, configure.ac: Adjust.
27
9a1e4214
AD
282008-11-15 Akim Demaille <demaille@gostai.com>
29
30 Remove build-aux/Makefile.am.
31 Recursive Makefiles are really way too slow, let's get rid of some of
32 them.
33
34 * build-aux/Makefile.am: Rename as...
35 * build-aux/local.mk: this.
36 Adjust paths.
37 * Makefile.am, configure.ac: Adjust.
38
0634493c
AD
392008-11-15 Akim Demaille <demaille@gostai.com>
40
41 Provide convenience constructors for locations and positions.
42 * data/location.cc (position::position): Accept file, line and
43 column as arguments with default values.
44 Always qualify initial line and column literals as unsigned.
45 (location::location): Provide convenience constructors.
46
fe1b448a
AD
472008-11-15 Akim Demaille <demaille@gostai.com>
48
49 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each token type.
50 Using template buys us nothing, and makes it uselessly complex to
51 construct a symbol. Besides, it could not be generalized to other
52 languages, while make_FOO would work in C/Java etc.
53
54 * data/lalr1.cc (b4_symbol_): New.
55 (b4_symbol): Use it.
56 (b4_symbol_constructor_declaration_)
57 (b4_symbol_constructor_definition_): Instead of generating
58 specializations of an overloaded template function, just generate
59 several functions whose names are forged from the token names
60 without the token.prefix.
61 (b4_symbol_constructor_declarations): Generate them for all the
62 symbols, not just by class of symbol type, now that instead of
63 specializing a function template by the token, we generate a
64 function named after the token.
65 (b4_symbol_constructor_specialization_)
66 (b4_symbol_constructor_specializations): Remove.
67 * etc/bench.pl.in: Adjust to this new API.
68
5679f311
AD
692008-11-13 Akim Demaille <demaille@gostai.com>
70
71 %define token.prefix.
72 Provide a means to add a prefix to the name of the tokens as output in the
73 generated files. Because of name clashes, it is good to have such a
74 prefix such as TOK_ that protects from names such as EOF, FILE etc.
75 But it clutters the grammar itself.
76
77 * data/bison.m4 (token.prefix): Empty by default.
78 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
79 * data/lalr1.cc (b4_symbol): Ditto.
80
3204049e
AD
812008-11-13 Akim Demaille <demaille@gostai.com>
82
83 Compute at M4 time some of the subtractions.
84 * data/lalr1.cc (b4_substract): New.
85 (b4_rhs_data): Use it.
86
202598d3
AD
872008-11-13 Akim Demaille <demaille@gostai.com>
88
89 symbol::token.
90 This is allows the user to get the type of a token return by
91 yylex.
92
93 * data/lalr1.cc (symbol::token): New.
94 (yytoknum_): Define when %define lex_symbol, independently of
95 %debug.
96 (yytoken_number_): Move into...
97 (symbol::token): here, since that's the only use.
98 The other one is YYPRINT which was not officially supported
99 by lalr1.cc, and anyway it did not work since YYPRINT uses this
100 array under a different name (yytoknum).
101
fc2476c7
AD
1022008-11-13 Akim Demaille <demaille@gostai.com>
103
104 YYERRCODE.
105 * TODO (YYERRCODE): Mention the case of $undef.
106
865f1e9f
AD
1072008-11-13 Akim Demaille <demaille@gostai.com>
108
109 TODO: YYPRINT.
110 * TODO (YYPRINT): New.
111
cb0b136a
AD
1122008-11-13 Akim Demaille <demaille@gostai.com>
113
114 Comment changes.
115 * data/lalr1.cc, data/yacc.c: Fix the description of the
116 yytranslate and yytoknum tables.
117
2c086d29
AD
1182008-11-13 Akim Demaille <demaille@gostai.com>
119
120 Define make_symbol in the header.
121 To reach good performances these functions should be inlined (yet this is
122 to measure precisely). To this end they must be available to the caller.
123
124 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
125 location_type with the class name.
126 Since will now be output in the header, declare "inline".
127 No longer use b4_symbol_constructor_specializations, but
128 b4_symbol_constructor_definitions in the header.
129 Don't call it in the *.cc file.
130
1c4af381
AD
1312008-11-13 Akim Demaille <demaille@gostai.com>
132
133 Define yytranslate in the header for lex_symbol.
134 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
135 into the header file when using %define lex_symbol.
136 (yytranslate_): Declare inline.
137
e51b0a82
AD
1382008-11-13 Akim Demaille <demaille@gostai.com>
139
140 Define the constructors of symbol_type in b4_symbol_constructor_definitions.
141 The constructors are called by the make_symbol functions, which a
142 forthcoming patch will move elsewhere. Hence the interest of putting them
143 together.
144
145 The stack_symbol_type does not need to be moved, it is used only by the
146 parser.
147
148 * data/lalr1.cc: Move symbol_type and symbol_base_type
149 constructors into...
150 (b4_symbol_constructor_definitions): here.
151 Adjust.
152
78835571
AD
1532008-11-13 Akim Demaille <demaille@gostai.com>
154
155 Make it easier to move the definition of yytranslate_.
156 Forthcoming changes will make it possible to use yytranslate_
157 from outside the parser implementation file.
158
159 * data/lalr1.cc (b4_yytranslate_definition): New.
160 Use it.
161
c1e6c88c
AD
1622008-11-13 Akim Demaille <demaille@gostai.com>
163
164 Remove useless class specification.
165 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
166 to refer to the class name to use a type defined by the class for
167 arguments of member functions.
168
4654b0c0
AD
1692008-11-13 Akim Demaille <demaille@gostai.com>
170
171 Finer input type for yytranslate.
172 This patch is debatable: the tradition expects yylex to return an int
173 which happens to correspond to token_number (which is an enum). This
174 allows for instance to return characters (such as '*' etc.). But this
175 goes against the stronger typing I am trying to have with the new
176 lex interface which return a symbol_type. So in this case, feed
177 yytranslate_ with a token_type.
178
179 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
180 expect a token_type.
181
dd735e4e
AD
1822008-11-13 Akim Demaille <demaille@gostai.com>
183
184 Honor lex-params in %define lex_symbol mode.
185 * data/lalr1.cc: Use b4_lex_param.
186
6659366c
AD
1872008-11-13 Akim Demaille <demaille@gostai.com>
188
189 Simplify names.
190 * src/output.c (symbol_definitions_output): Rename symbol
191 attributes type_name and has_type_name as type and has_type.
192 * data/lalr1.cc: Adjust uses.
193
e9805e57
AD
1942008-11-13 Akim Demaille <demaille@gostai.com>
195
196 Use b4_type_names for the union type.
197 The union used to compute the size of the variant used to iterate over the
198 type of all the symbols, with a lot of redundancy. Now iterate over the
199 lists of symbols having the same type-name.
200
201 * data/lalr1.cc (b4_char_sizeof_): New.
202 (b4_char_sizeof): Use it.
203 Adjust to be called with a list of numbers instead of a single
204 number.
205 Adjust its caller for new-line issues.
206
aea10ef4
AD
2072008-11-13 Akim Demaille <demaille@gostai.com>
208
209 Define the "identifier" of a symbol.
210 Symbols may have several string representations, for instance if they
211 have an alias. What I call its "id" is a string that can be used as
212 an identifier. May not exist.
213
214 Currently the symbols which have the "tag_is_id" flag set are those that
215 don't have an alias. Look harder for the id.
216
217 * src/output.c (is_identifier): Move to...
218 * src/symtab.c (is_identifier): here.
219 * src/symtab.h, src/symtab.c (symbol_id_get): New.
220 * src/output.c (symbol_definitions_output): Use it to define "id"
221 and "has_id".
222 Remove the definition of "tag_is_id".
223 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
224 "tag_is_id" were used to produce code.
225 We still use "tag" for documentation.
226
2ea7730c
AD
2272008-11-11 Akim Demaille <demaille@gostai.com>
228
229 Locations are no longer required by lalr1.cc.
230 * data/lalr1.cc (_b4_args, b4_args): New.
231 Adjust all uses of locations to make them optional.
232 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
233 (AT_CHECK_NAMESPACE): Check the use of locations.
234 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
235 without locations with lalr1.cc.
236 Test these cases.
237 * tests/output.at: Check lalr1.cc with and without location
238 support.
239 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
240 Don't use locations.
241
7ca2266a
AD
2422008-11-11 Akim Demaille <demaille@gostai.com>
243
244 AT_FULL_COMPILE.
245 * tests/local.at (AT_FULL_COMPILE): New.
246 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
247
1a7a65f9
AD
2482008-11-11 Akim Demaille <demaille@gostai.com>
249
250 Support parens in calc++.
251 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
252 * examples/calc++/test (run): Check the expected output.
253 Adjust callers.
254 Check parens too.
255
c944f7f2
AD
2562008-11-11 Akim Demaille <demaille@gostai.com>
257
258 Simplify lalr1.cc since %defines is mandatory.
259 * data/lalr1.cc: Remove useless calls to b4_defines_if.
260
dada3cd1
AD
2612008-11-11 Akim Demaille <demaille@gostai.com>
262
263 TODO: yyfmt.
264 * TODO (yysyntax_error): New item.
265
422c18f4
AD
2662008-11-11 Akim Demaille <demaille@gostai.com>
267
268 Prefer M4 to CPP.
269 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
270 YYERROR_VERBOSE.
271
a0ffc175
AD
2722008-11-11 Akim Demaille <demaille@gostai.com>
273
274 Support i18n of the parse error messages.
275 * TODO (lalr1.cc/I18n): Remove.
276 * data/lalr1.cc (yysyntax_error_): Support the translation of the
277 error messages, as done in yacc.c.
278 Stay within the yy* pseudo namespace.
279
00a8a083
AD
2802008-11-11 Akim Demaille <demaille@gostai.com>
281
282 More TODO.
283 * TODO (single stack, yysyntax_error): New.
284
09277875
AD
2852008-11-11 Akim Demaille <demaille@gostai.com>
286
287 Make it possible to return a symbol_type from yylex.
288 * data/lalr1.cc (b4_lex_symbol_if): New.
289 (parse): When lex_symbol is defined, expected yylex to return the
290 complete lookahead.
291 * etc/bench.pl.in (generate_grammar_list): Extend to support this
292 yylex interface.
293 (bench_variant_parser): Exercise it.
294
64c1b92a
AD
2952008-11-11 Akim Demaille <demaille@gostai.com>
296
297 Remove useless bench case.
298 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
299 no longer used.
300
2722aa42
AD
3012008-11-11 Akim Demaille <demaille@gostai.com>
302
303 Improve display of directives.
304 * etc/bench.pl.in (parse_term): Don't add useless eol.
305
918eb7c5
AD
3062008-11-11 Akim Demaille <demaille@gostai.com>
307
308 Use string_cast in the bench.
309 * etc/bench.pl.in (generate_grammar_list): Define and use
310 string_cast.
311
39be9022
AD
3122008-11-11 Akim Demaille <demaille@gostai.com>
313
314 Replace yychar with a Boolean.
315 * data/lalr1.cc (parse::yychar): Replace by...
316 (parse::yyempty): this.
317
a2e3fa77
AD
3182008-11-11 Akim Demaille <demaille@gostai.com>
319
320 Factor the tables.
321 * TODO: New item.
322
aba12ad1
AD
3232008-11-11 Akim Demaille <demaille@gostai.com>
324
325 Let yytranslate handle the eof case.
326 * data/lalr1.cc (yytranslate_): Handle the EOF case.
327 Adjust callers.
328 No longer expect yychar to be equal to yyeof_, rather, test the
329 lookahead's (translated) kind.
330
27cb5b59
AD
3312008-11-11 Akim Demaille <demaille@gostai.com>
332
333 yychar cannot be empty in yyerrlab.
334 * TODO (yychar == yyempty_): New.
335 * data/lalr1.cc: Remove the handling of this case.
336 This eases forthcoming changes related to yychar and yytranslate.
337
fce629c0
AD
3382008-11-11 Akim Demaille <demaille@gostai.com>
339
340 Bench: syntactic sugar for %define/#define.
341 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
342 (&bench_push_parser, bench_variant_parser): Use this feature.
343 (&eat): New.
344 Use it.
345
ce671960
AD
3462008-11-11 Akim Demaille <demaille@gostai.com>
347
348 Less memory pressure on the "list" bench.
349 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
350 the values, to limit memory pressure.
351
2873fdf8
AD
3522008-11-11 Akim Demaille <demaille@gostai.com>
353
354 Introduce make_symbol.
355 make_symbol provides a means to construct a full symbol (kind, value,
356 location) in a single shot. It is meant to be a Symbol constructor,
357 parameterized by the symbol kind so that overloading would prevent
358 incorrect kind/value pairs. Unfortunately parameterized constructors do
359 not work well in C++ (unless the parameter also appears as an argument,
360 which is not acceptable), hence the use of a function instead of a
361 constructor.
362
363 * data/lalr1.cc (b4_symbol_constructor_declaration_)
364 (b4_symbol_constructor_declarations)
365 (b4_symbol_constructor_specialization_)
366 (b4_symbol_constructor_specializations)
367 (b4_symbol_constructor_definition_)
368 (b4_symbol_constructor_definitions): New.
369 Use them where appropriate to generate declaration, declaration of
370 the specializations, and implementations of the templated
371 overloaded function "make_symbol".
372 (variant::variant): Always define a default ctor.
373 Also provide a copy ctor.
374 (symbol_base_type, symbol_type): New ctor overloads for value-less
375 symbols.
376 (symbol_type): Now public, so that functions such as yylex can use
377 it.
378
8be046d7
AD
3792008-11-11 Akim Demaille <demaille@gostai.com>
380
381 Inform m4 whether a tag is a valid id.
382 * src/output.c (is_identifier): New.
383 (symbol_definitions_output): Use it to define tag_is_id.
384 But maybe this should be done at m4 level?
385
de62edee
AD
3862008-11-11 Akim Demaille <demaille@gostai.com>
387
388 Test 214 was failing: it greps with a pattern containing [ ]*
389 which obviously meant to catch spaces and tabs, but contained only
390 spaces. Tabulations in sources are a nuisance, so to simplify the
391 matter, get rid of all the tabulations in the Java sources. The
392 other skeletons will be treated equally later.
393
394 * data/java.m4, data/lalr1.java: Untabify.
395 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
396 tabulations are no longer generated.
397
905f0697
PB
3982008-11-11 Paolo Bonzini <bonzini@gnu.org>
399
400 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
401 * configure.ac: Adjust usage.
402 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
403 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
404 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
405
09ccae9b
DJ
4062008-11-10 Di-an Jan <dianj@freeshell.org>
407
408 Workaround Java's ``code too large'' problem for parser tables
409 in most cases, by using one function per initialization.
410 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
411 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
412 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
413 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
414 (yytname_): Use b4_typed_parser_table.
415 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
416 ``code too large'' error.
417
1979121c
DJ
4182008-11-10 Di-an Jan <dianj@freeshell.org>
419
420 * NEWS: Document them.
de62edee 421
1979121c
DJ
422 General Java skeleton improvements.
423 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
424 using gcj < 4.3 in the testsuite, according to comments in
425 gnulib/m4/javacomp.m4.
426 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
427 location_type, position_type): Remove extraneous brackets from
428 b4_percent_define_default.
429 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
430 m4_define and m4_define_default.
431 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
432 which marks the end of user code with appropriate syncline, like all
433 the other skeletons.
434 (b4_user_post_prologue): Add. Don't silently drop.
435 (yylex): Remove.
436 (parse): Inline yylex.
437 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
438 (%{...%}): Fix typo of %code imports.
439 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
440
441 Support annotations on parser class with %define annotations.
442 * data/lalr1.java (annotations): Add to parser class modifier.
443 * doc/bison.texinfo (Java Parser Interface): Document
444 %define annotations.
445 (Java Declarations Summary): Document %define annotations.
446 * tests/java.at (Java parser class modifiers): Test annotations.
447
448 Do not generate code for %error-verbose unless requested.
449 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
450 Make private. Make conditional on %error-verbose.
451 (getErrorVerbose, setErrorVerbose): New.
452 (yytnamerr_): Make conditional on %error-verbose.
453 (yysyntax_error): Make some code conditional on %error-verbose.
454 * doc/bison.texinfo (Java Bison Interface): Remove the parts
455 about %error-verbose having no effect.
456 (getErrorVerbose, setErrorVerbose): Document.
457
458 Move constants for token names to Lexer interface.
459 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
460 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
461 (parse): Qualify EOF to Lexer.EOF.
462 * doc/bison.texinfo (Java Parser Interface): Move documentation of
463 EOF and token names to Java Lexer Interface.
464 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
465
466 Make yyerror public.
467 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
468 (yyerror): Change to public. Add Javadoc comments. Use longer
469 parameter names. Make the body rather than the declarator
470 conditional on %locations.
471 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
472
473 Allow user to add code to the constructor with %code init.
474 * data/java.m4 (b4_init_throws): New, for %define init_throws.
475 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
476 Add %code init to the front of the constructor body.
477 * doc/bison.texinfo (YYParser.YYParser): Document %code init
478 and %define init_throws.
479 (Java Declarations Summary): Document %code init and
480 %define init_throws.
481 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
482 (Java constructor init and init_throws): Add tests.
de62edee 483
42f832d6
AD
4842008-11-10 Akim Demaille <demaille@gostai.com>
485
486 Update TODO.
487 * TODO (-D): is implemented.
488 (associativity): Same precedence must have the same associativity.
489 For instance, how can a * b / c be parsed if * is %left and / is
490 %right?
491 (YYERRORCODE, YYFAIL, YYBACKUP): New.
492
247efe34
AD
4932008-11-10 Akim Demaille <demaille@gostai.com>
494
495 Formatting changes.
496
5d731440
AD
4972008-11-10 Akim Demaille <demaille@gostai.com>
498
499 More information about the symbols.
500 * src/output.c (type_names_output): Document all the symbols,
501 including those that don't have a type-name.
502 (symbol_definitions_output): Define "is_token" and
503 "has_type_name".
504 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
505 type-name, now that they are defined too in b4_type_names.
506
21db118b
AD
5072008-11-10 Akim Demaille <demaille@gostai.com>
508
509 Regen.
510
6ed15cde
AD
5112008-11-10 Akim Demaille <demaille@gostai.com>
512
513 Make parser::yytranslate static.
514 Small speedup (1%) on the list grammar. And makes yytranslate_ available
515 in non member functions.
de62edee 516
6ed15cde
AD
517 * data/lalr1.cc (yytranslate_): Does not need to be a instance
518 function.
519
30bb2edc
AD
5202008-11-10 Akim Demaille <demaille@gostai.com>
521
522 Avoid trailing spaces.
523 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
524 * data/lalr1.cc: Don't indent before rule and symbol actions, as
525 they can be empty, and anyway this incorrectly indents the first
526 action.
527
b3a28fd4
AD
5282008-11-10 Akim Demaille <demaille@gostai.com>
529
530 Comment changes.
531
914202bd
AD
5322008-11-10 Akim Demaille <demaille@gostai.com>
533
534 Use "enum" for integral constants.
535 This is just nicer to read, I observed no speedup.
de62edee 536
914202bd
AD
537 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
538 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
539 (yyuser_token_number_max_, yyundef_token_): Move into...
540 (yytranslate_): here.
541
c17f9a4a
AD
5422008-11-10 Akim Demaille <demaille@gostai.com>
543
544 Shortcuts in bench directives.
545 * etc/bench.pl.in (parse_dirs): New.
546 Use it.
547 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
548 Create the benches in "benches/".
549
b9855ea5
AD
5502008-11-10 Akim Demaille <demaille@gostai.com>
551
552 Formatting changes.
553 * data/lalr1.cc: here.
554
6e097787
AD
5552008-11-10 Akim Demaille <demaille@gostai.com>
556
557 Adjust verbose message to using emacs.
558 * etc/bench.pl.in: Inform compilation-mode when we change the
559 directory.
560 (generate_grammar_list): Recognize %define "variant" in addition
561 to %define variant.
562
4c3cc7da
AD
5632008-11-10 Akim Demaille <demaille@gostai.com>
564
565 Classify symbols by type-name.
566 * src/uniqstr.h (UNIQSTR_CMP): New.
567 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
568 (type_names_output): New.
569 (muscles_output): Use it.
570 * data/lalr1.cc (b4_symbol_action_): Remove.
571 (b4_symbol_case_, b4_type_action_): New.
572 Adjust uses of b4_symbol_action_ to use b4_type_action_.
573
d69c9694
AD
5742008-11-10 Akim Demaille <demaille@gostai.com>
575
576 Change the handling of the symbols in the skeletons.
577 Before we were using tables which lines were the symbols and which
578 columns were things like number, tag, type-name etc. It is was
579 difficult to extend: each time a column was added, all the numbers had
580 to be updated (you asked for colon $2, not for "tag"). Also, it was
581 hard to filter these tables when only a subset of the symbols (say the
582 tokens, or the nterms, or the tokens that have and external number
583 *and* a type-name) was of interest.
de62edee 584
d69c9694
AD
585 Now instead of monolithic tables, we define one macro per cell. For
586 instance "b4_symbol(0, tag)" is a macro name which contents is
587 self-decriptive. The macro "b4_symbol" provides easier access to
588 these cells.
de62edee 589
d69c9694
AD
590 * src/output.c (type_names_output): Remove.
591 (symbol_numbers_output, symbol_definitions_output): New.
592 (muscles_output): Call them.
593 (prepare_symbols): Define b4_symbols_number.
594
5263bea9
AD
5952008-11-10 Akim Demaille <demaille@gostai.com>
596
597 --trace=muscles
598 * src/getargs.h, src/getargs.c (trace_muscle): New.
599 (trace_types, trace_args): Support it.
600 * src/output.c (output_skeleton): Use it.
601
4175f6bb
AD
6022008-11-10 Akim Demaille <demaille@gostai.com>
603
604 muscles_output.
605 * src/output.c (muscles_output): New, extracted from...
606 (output_skeleton): here.
607 Adjust.
608
1de69d6a
AD
6092008-11-10 Akim Demaille <demaille@gostai.com>
610
611 Formatting changes.
612
36db78a7
AD
6132008-11-10 Akim Demaille <demaille@gostai.com>
614
615 Update the variant example.
616 * examples/variant.yy: Formatting changes.
617 One stage build.
618
e5eb92e7
AD
6192008-11-10 Akim Demaille <demaille@gostai.com>
620
621 Support constructor with an argument.
622 This improves the "list" bench by 2%.
de62edee 623
e5eb92e7
AD
624 * data/lalr1.cc (variant::build): Add an overloaded version with
625 an argument.
626 * tests/c++.at (AT_CHECK_VARIANT): Check it.
627
76307410
AD
6282008-11-10 Akim Demaille <demaille@gostai.com>
629
630 Test variants.
631 * tests/c++.at (AT_CHECK_VARIANTS): New.
632 Use it with and without %define assert.
633
d78f0ac9
AD
6342008-11-10 Akim Demaille <demaille@gostai.com>
635
636 Add %precedence support.
637 Unfortunately it is not possible to reuse the %prec directive. This
638 is because to please POSIX, we do not require to end the rules with a
639 semicolon. As a result,
de62edee 640
d78f0ac9 641 foo: bar %prec baz
de62edee 642
d78f0ac9
AD
643 is ambiguous: either a rule which precedence is that of baz, or a rule,
644 and then a declaration of the precedence of the token baz.
de62edee 645
d78f0ac9
AD
646 * doc/bison.texinfo: Document %precedence.
647 (Precedence Only): New.
648 * src/assoc.h, src/assoc.c (precedence_assoc): New.
649 * src/conflicts.c (resolve_sr_conflict): Support it.
650 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
651 Parse it.
652 * tests/calc.at: Use %precedence for NEG.
653 * tests/conflicts.at (%precedence does not suffice)
654 (%precedence suffices): New tests.
655
c85be41a
AD
6562008-11-09 Akim Demaille <demaille@gostai.com>
657
658 Make benches in a sub dirs.
659 * etc/bench.pl.in ($dir): New.
660 Use it.
661 Check the use of constructors with an argument.
662 (bench_variant_parser): Fix.
663
db65ca1f
AD
6642008-11-09 Akim Demaille <demaille@gostai.com>
665
666 fix eof condition
667
9b0efa5b
AD
6682008-11-09 Akim Demaille <demaille@gostai.com>
669
670 Fix --help.
671
432ac57a
AD
6722008-11-09 Akim Demaille <demaille@gostai.com>
673
674 Require the generation of parse-gram.output.
675 * src/Makefile.am (YACC): Pass --report=all.
676
deef2a0a
AD
6772008-11-09 Akim Demaille <demaille@gostai.com>
678
679 Formatting changes.
680
df72984a
AD
6812008-11-09 Akim Demaille <demaille@gostai.com>
682
683 Update TODO.
684 * TODO: Remove obsolete items.
685 Update others.
686
f10e19fd
AD
6872008-11-09 Akim Demaille <demaille@gostai.com>
688
689 Enhance bench.pl.
690 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
691 (@token, $grammar, $bench): New.
692 (generate_grammar_variant): Rename as...
693 (generate_grammar_list): this.
694 (generate_grammar): Adjust.
695 (bench_grammar): Rename as...
696 (bench): this.
697 Use it in the various bench-marking routines.
698 (-b, -g): New options.
699
5de9c593
AD
7002008-11-09 Akim Demaille <demaille@gostai.com>
701
702 Use a static hierarchy for symbols in the C++ parser.
703 * data/lalr1.cc (symbol_base_type, symbol_type)
704 (stack_symbol_type): Make it a static hierarchy.
705 Adjust dependencies.
706
757f8f98
AD
7072008-11-09 Akim Demaille <demaille@gostai.com>
708
709 bench.pl -d, --directive.
710 * etc/bench.pl.in (@directive): New.
711 (&bench_grammar): Use it.
712 (&bench_list_grammar): New, to provide access to the "variant"
713 grammar.
714 Use it.
715 (getopts): Support -d, --directive.
716
d3be4f6d
AD
7172008-11-09 Akim Demaille <demaille@gostai.com>
718
719 Use inline for small operations.
720 * data/lalr1.cc (symbol_base_type, symbol_type)
721 (stack_symbol_type): Declare constructor and other operations as
722 inline.
723 (yy_destroy_): Inline.
724
1f7d007b
AD
7252008-11-09 Akim Demaille <demaille@gostai.com>
726
727 Introduce a hierarchy for symbols.
728 * data/lalr1.cc (symbol_base_type, symbol_type): New.
729 (data_type): Rename as...
730 (stack_symbol_type): this.
731 Derive from symbol_base_type.
732 (yy_symbol_value_print_): Merge into...
733 (yy_symbol_print_): this.
734 Rename as...
735 (yy_print_): this.
736 (yydestruct_): Rename as...
737 (yy_destroy_): this.
738 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
739 (parser::parse): yyla is now of symbol_type.
740 Use its type member instead of yytoken.
741
bc0b0477
AD
7422008-11-09 Akim Demaille <demaille@gostai.com>
743
744 Rename data_type and stack_symbol_type.
745 * data/lalr1.cc (data_type): Rename as...
746 (stack_symbol_type): this.
747
57295d14
AD
7482008-11-09 Akim Demaille <demaille@gostai.com>
749
750 Handle semantic value and location together.
751 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
752 yydata.value and yydata.location.
753 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
754 (YY_SYMBOL_PRINT): Now take semantic value and location as a
755 single arg.
756 Adjust all callers.
757 (yydestruct_): New overload for a stack symbol.
758
e9b0834e
AD
7592008-11-09 Akim Demaille <demaille@gostai.com>
760
761 Push a complete symbol, not connected parts.
762 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
763 state, value and location.
764 Adjust callers.
765
6082531a
AD
7662008-11-09 Akim Demaille <demaille@gostai.com>
767
768 Agregate yylval and yylloc.
769 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
770 (parser::yyla): this.
771
33c195cc
AD
7722008-11-09 Akim Demaille <demaille@gostai.com>
773
774 Rely on the state stack to display reduction traces.
775 To display rhs symbols before a reduction, we used information about the rule
776 reduced, which required the tables yyrhs and yyprhs. Now use rely only on the
777 state stack to get the same information.
de62edee 778
33c195cc
AD
779 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
780 Use them.
781 (parser::yyrhs_, parser::yyprhs_): Remove.
782 (parser::yy_reduce_print_): Use the state stack.
783
e1f93869
AD
7842008-11-09 Akim Demaille <demaille@gostai.com>
785
786 Fuse yyval and yyloc into yylhs.
787 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
788 yylhs.
789 (parse): Replace yyval and yyloc with yylhs.value and
790 yylhs.location.
791 After a user action, compute yylhs.state earlier.
792 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
793 fresh error_token.
794
2935744b
DJ
7952008-11-09 Di-an Jan <dianj@freeshell.org>
796
797 Remove unused variable.
798 * src/output.c (type_names_output): Remove unused variable sep.
799
bbf9ca37
PB
8002008-11-09 Paolo Bonzini <bonzini@gnu.org>
801
802 Change tests/output.at quoting.
803 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
804 expanding arguments.
805
d9a9b96b
JD
8062008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
807
808 Don't add a semicolon to actions for %skeleton or %language.
809 It breaks Java test cases as reported by Akim Demaille.
810 * src/scan-code.l: Implement.
811
51365192
JD
8122008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
813
814 Clean up %skeleton and %language priority implementation.
815 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
816 remove static qualifier because others will soon need to see it.
817 (language_prio): Likewise.
818 (getargs): Use command_line_prio rather than 0.
819 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
820 enum fields.
821 (skeleton_prio): Extern it.
822 (language_prio): Extern it.
823 * src/parse-gram.y: Use grammar_prio rather than 1.
824
9380cfd0
AD
8252008-11-07 Akim Demaille <demaille@gostai.com>
826
827 Moving push traces into yypush_.
828 * data/lalr1.cc (yypush_): Now takes a optional trace message.
829 Adjust all uses.
830
8901f32e
AD
8312008-11-07 Akim Demaille <demaille@gostai.com>
832
833 The single-stack C++ parser is now the standard one.
834 * data/lalr1.cc: Rename as...
835 * data/lalr1-split.cc: this.
836 * data/lalr1-fusion.cc: Rename as...
837 * data/lalr1.cc: this.
838 * etc/bench.pl.in: Adjust.
839
8cdabf02
AD
8402008-11-07 Akim Demaille <demaille@gostai.com>
841
842 Avoid empty-if warnings.
843 Reported by Quentin Hocquet.
de62edee 844
8cdabf02
AD
845 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
846 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
847
5a893c2b
AD
8482008-11-07 Akim Demaille <demaille@gostai.com>
849
850 Pass command line location to skeleton_arg and language_argmatch.
851 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
852 The location argument is now mandatory.
853 Adjust all dependencies.
854 (getargs): Use command_line_location.
855
58697c6d
AD
8562008-11-07 Akim Demaille <demaille@gostai.com>
857
858 -D, --define.
859 * src/getargs.c (usage): Document -D.
860 Fix help string for --locations.
861 (command_line_location): New.
862 (short_options, long_options, getargs): Support -D, --define.
863 (getargs): Move -d support at the right place.
864 * doc/bison.texinfo (Bison Options): Update.
865 * tests/input.at (%define, --define): New.
866
9fe5a457
AD
8672008-11-07 Akim Demaille <demaille@gostai.com>
868
869 Initialize the muscle table before parsing the command line.
870 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
871 (getargs): Define file_name.
872 * src/main.c (main): Initialize muscle_tab before calling
873 getargs.
874 * src/muscle_tab.c (muscle_init): No longer define file_name, as
875 its value is not available yet.
876
56c5eca9
AD
8772008-11-07 Akim Demaille <demaille@gostai.com>
878
879 Locations without columns for command line arguments.
880 * src/location.c (location_print): Don't display negative columns.
881 * src/location.h: Document this.
882
9b9e0a7d
AD
8832008-11-07 Akim Demaille <demaille@gostai.com>
884
885 Fix --help.
886 * src/getargs.c (usage): Fix help string for -W.
887
74eae918
AD
8882008-11-07 Akim Demaille <demaille@gostai.com>
889
890 Handle more general types of option arguments.
891 * build-aux/cross-options.pl: The argument ends at the first
892 space, not the first non-symbol character.
893 Use @var for each word appearing the argument description.
894
a3d4c6fb
AD
8952008-11-07 Akim Demaille <demaille@gostai.com>
896
897 Destroy the variants that remain on the stack in case of error.
898 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
899 destructor.
900 Display the value only if yymsg is nonnull.
901 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
902
2d32fc9f
AD
9032008-11-07 Akim Demaille <demaille@gostai.com>
904
905 Add "%define assert" to variants.
906 This is used to help the user catch cases where some value gets
907 ovewritten by a new one. This should not happen, as this will
908 probably leak.
de62edee 909
2d32fc9f
AD
910 Unfortunately this uncovered a bug in the C++ parser itself: the
911 lookahead value was not destroyed between two calls to yylex. For
912 instance if the previous lookahead was a std::string, and then an int,
913 then the value of the std::string was correctly taken (i.e., the
914 lookahead was now an empty string), but std::string structure itself
915 was not reclaimed.
de62edee 916
2d32fc9f
AD
917 This is now done in variant::build(other&) (which is used to take the
918 value of the lookahead): other is not only stolen from its value, it
919 is also destroyed. This incurs a new performance penalty of a few
920 percent, and union becomes faster again.
de62edee 921
2d32fc9f
AD
922 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
923 (b4_variant_if): New.
924 (variant::built): New.
925 Use it whereever the status of the variant changes.
926 * etc/bench.pl.in: Check the penalty of %define assert.
927
f6038cb8
AD
9282008-11-07 Akim Demaille <demaille@gostai.com>
929
930 Use "%define variant" in bench.pl.
931 * etc/bench.pl.in: No longer use the pseudo directive %variants,
932 just use %define variants.
933
ccde1f98
AD
9342008-11-07 Akim Demaille <demaille@gostai.com>
935
936 Regen.
937 * src/parse-gram.h, src/parse-gram.c: Regen.
938
58bd33b7
JD
9392008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
940
941 Fix user actions without a trailing semicolon.
942 Reported by Sergei Steshenko at
943 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
944 * THANKS (Sergei Steshenko): Add.
945 * src/scan-code.l (SC_RULE_ACTION): Fix it.
946 * tests/regression.at (Fix user actions without a trailing semicolon):
947 New test case.
948
639867b5
AD
9492008-11-04 Akim Demaille <demaille@gostai.com>
950
951 Use b4_copyright_years.
952 * data/yacc.c (b4_copyright_years): New.
953 Fix its value according to the comments in the file.
954 Use it and undefine it.
955
3c262606
AD
9562008-11-04 Akim Demaille <demaille@gostai.com>
957
958 Formatting changes.
959 * data/lalr1-fusion.cc, src/parse-gram.y: here.
960
a2b93d52
AD
9612008-11-04 Akim Demaille <demaille@gostai.com>
962
963 Formatting changes.
964 * data/lalr1-fusion.cc: here.
965
3a2803df
AD
9662008-11-04 Akim Demaille <demaille@gostai.com>
967
968 Use strict on bench.pl.
969 * etc/bench.pl.in (&run, &generate_grammar): New.
970 Rename the grammar generating functions for consistency.
971 Change the interface so that the list of benches to run is passed
972 as (optionless) arguments.
973 (&compile): Use &run.
974
a0d4650a
AD
9752008-11-04 Akim Demaille <demaille@gostai.com>
976
977 Remove spurious initial empty lines.
978 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
979 * data/yacc.c: End the @output lines with an @.
980
cac9e09b
AD
9812008-11-04 Akim Demaille <demaille@gostai.com>
982
983 Improve the display of sizes.
984 * etc/bench.p.in: Higher precision.
985 Sort by decreasing size.
986
4af4348a
AD
9872008-11-04 Akim Demaille <demaille@gostai.com>
988
989 Don't memcpy C++ structures.
990 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
991 arguments.
992 (variant::build): New overload for
993 copy-construction-that-destroys.
994 (variant::swap): New.
995 (parser::yypush_): Use it in variant mode.
996
ef05c4d6
AD
9972008-11-04 Akim Demaille <demaille@gostai.com>
998
999 Better defaults for bench.pl.
1000 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
1001 default values.
1002 Adjust &verbose uses.
1003 (-q, --quiet): New.
1004
9718cfa9
AD
10052008-11-04 Akim Demaille <demaille@gostai.com>
1006
1007 Make variant.yy more complex.
1008 std::list cannot be copied via memcpy, they are more demanding than
1009 std::string. Use one std::list to strengthen the test.
de62edee 1010
9718cfa9
AD
1011 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
1012 Adjust.
1013 Create a list of strings, instead of a single large string.
1014
a6df593d
AD
10152008-11-04 Akim Demaille <demaille@gostai.com>
1016
1017 bench.pl --bench.
1018 * etc/bench.pl.in (--bench, $bench): New.
1019
006a0303
AD
10202008-11-04 Akim Demaille <demaille@gostai.com>
1021
1022 Sort methods.
1023 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
1024 Define it after as().
1025
faef3466
AD
10262008-11-04 Akim Demaille <demaille@gostai.com>
1027
1028 Useless parens.
1029 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
1030
2141aded
AD
10312008-11-04 Akim Demaille <demaille@gostai.com>
1032
1033 Issue missing synclines after user actions.
1034 * data/c.m4 (b4_case): Issue synclines on the output file.
1035
e426d17b
AD
10362008-11-04 Akim Demaille <demaille@gostai.com>
1037
1038 Remove trailing empty line.
1039 * data/lalr1-fusion.cc: Don't add an empty line after the user's
1040 epilogue.
1041
a9ce3f54
AD
10422008-11-04 Akim Demaille <demaille@gostai.com>
1043
1044 Fix output of copyright years.
1045 * data/bison.m4 (b4_copyright): Fix the indentation of the
1046 copyright year paragraph.
1047 Use b4_copyright_years when no years are given.
1048 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
1049 (b4_copyright_years): New.
1050 Use it.
1051
59c544c2
AD
10522008-11-04 Akim Demaille <demaille@gostai.com>
1053
1054 Avoid the spurious initial empty line.
1055 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
1056 the end of @output request to suppress the empty line that
1057 results.
1058
96b15448
AD
10592008-11-04 Akim Demaille <demaille@gostai.com>
1060
1061 Remove parser::rhs_number_type.
1062 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
1063 (yyrhs_): Use b4_table_define.
1064
f0633174
AD
10652008-11-04 Akim Demaille <demaille@gostai.com>
1066
1067 Fix iteration type.
1068 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
1069
417b8004
AD
10702008-11-04 Akim Demaille <demaille@gostai.com>
1071
1072 Factor the declaration of the integer tables.
1073 * data/lalr1-fusion.cc (b4_table_define): New.
1074 Use it.
1075
1a5246c6
AD
10762008-11-03 Akim Demaille <demaille@gostai.com>
1077
1078 Fix indentation of tables in lalr1.cc
1079 * data/lalr1-fusion.cc: Fix the indentation.
1080
f8a95c9c
AD
10812008-11-03 Akim Demaille <demaille@gostai.com>
1082
1083 Destroy the lhs symbols after reduction.
1084 * data/lalr1-fusion.cc (parse): After the user action, when in
1085 variant mode, destroy the lhs symbols.
1086
d7f4d823
AD
10872008-11-03 Akim Demaille <demaille@gostai.com>
1088
1089 Simplify yysyntax_error_ use.
1090 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
1091 type, but make it unnamed in the declaration when it is not used.
1092
8b9c89fb
AD
10932008-11-03 Akim Demaille <demaille@gostai.com>
1094
1095 Let yy::variant::build return an lvalue.
1096 * data/lalr1-fusion.cc (variant::build): Return a reference to the
1097 object.
1098
83243c24
AD
10992008-11-03 Akim Demaille <demaille@gostai.com>
1100
1101 Define yy::variant only when needed.
1102 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
1103 used.
1104
429b4848
AD
11052008-11-03 Akim Demaille <demaille@gostai.com>
1106
1107 Bench the three-stack lalr1.cc.
1108 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
1109 one-stack one.
1110
414c76a4
AD
11112008-11-03 Akim Demaille <demaille@gostai.com>
1112
1113 Fail on parse error in calc++.
1114 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
1115 status.
1116 * examples/calc++/test ($me, $number, $exit, run): New.
1117 Use them to propagate errors to the exit status.
1118
8a5783fd
AD
11192008-11-03 Akim Demaille <demaille@gostai.com>
1120
1121 Don't specify the skeleton twice in the example.
1122 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
1123 file does what is needed.
1124
0cc5bead
AD
11252008-11-03 Akim Demaille <demaille@gostai.com>
1126
1127 bench: Improve output.
1128 * etc/bench.pl.in (bench_grammar): Tune the printf format.
1129
5b421a4e
AD
11302008-11-03 Akim Demaille <demaille@gostai.com>
1131
1132 bench: check impact of %debug on variants.
1133 * etc/bench.pl.in (variant_grammar): Fix the computation of
1134 $variant.
1135 Generate a grammar file that can work with or without %debug.
1136 Do use the @directive.
1137 (bench_variant_parser): Check impact of %debug.
1138 (@directives): Rename all the occurrences to...
1139 (@directive): this, for consistency.
1140
d11ee647
AD
11412008-11-03 Akim Demaille <demaille@gostai.com>
1142
1143 bench: report the size too.
1144 * etc/bench.pl.in ($iterations): Defaults to -3.
1145 (&bench_grammar): Require hireswallclock.
1146 Compute and display the size of the result.
1147 More comments.
1148
e1b74b92
AD
11492008-11-03 Akim Demaille <demaille@gostai.com>
1150
1151 bench: More use of the verbosity level.
1152 * etc/bench.pl.in ($verbose, &verbose): New.
1153 Use them.
1154 More POD documentation.
1155
7e5f9c54
AD
11562008-11-03 Akim Demaille <demaille@gostai.com>
1157
1158 bench.pl: a command line interface
1159 * etc/bench.pl.in: More doc.
1160 Some fixes in the documentation.
1161 ($cflags, $iterations, &help, &getopt): New.
1162 Use them.
1163 (&variant_grammar): Let the number of stages be 10 times what is
1164 specified.
1165
7109a18d
AD
11662008-11-03 Akim Demaille <demaille@gostai.com>
1167
1168 Bench the use of Boost.Variants.
1169 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
1170 New.
1171 (&compile): Be ready to compile C++ parsers.
1172 (&bench_push_parser): Move debug information to the outermost
1173 level.
1174 * THANKS: Add Michiel De Wilde.
1175
922730fe
AD
11762008-11-03 Akim Demaille <demaille@gostai.com>
1177
1178 bench.pl: Pass directives as a list instead of as a string.
1179 * etc/bench.pl.in (&directives): New.
1180 (&triangular_grammar, &calc_grammar): Use it to format the Bison
1181 directives.
1182 (&triangular_grammar): Do use the directives (were ignored).
1183 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
1184 directives.
1185
7484f1d4
AD
11862008-11-03 Akim Demaille <demaille@gostai.com>
1187
1188 Improve genericity of bench.pl.
1189 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
1190 argument.
1191 (&bench_push_parser): New.
1192 Call it.
1193
15129f25
AD
11942008-11-03 Akim Demaille <demaille@gostai.com>
1195
1196 Add documentation to bench.pl.
1197 * etc/bench.pl.in: Comment changes.
1198
0e0ed236
AD
11992008-11-03 Akim Demaille <demaille@gostai.com>
1200
1201 Fuse the three stacks into a single one.
1202 In order to make it easy to perform benchmarks to ensure that there are no
1203 performance loss, lalr1.cc is forked into lalr1-fusion.cc. Eventually,
1204 lalr1-fusion.cc will replace lalr1.cc.
de62edee 1205
0e0ed236
AD
1206 Meanwhile, to make sure that lalr1-fusion.cc is correctly exercized by the
1207 test suite, the user must install a symbolic link from lalr1.cc to it.
de62edee 1208
0e0ed236
AD
1209 Instead of having three stacks (state, value, location), use a stack
1210 of triples. This considerably simplifies the code (and it will be
1211 easier not to require locations as currently does the C++ parser),
1212 and also gives a 10% speedup according to etc/bench (probably mainly since
1213 memory allocation is done once instead of three times).
de62edee 1214
0e0ed236
AD
1215 Another motivation is to make it easier to destruct properly
1216 semantic values: now that they are bound to their state (hence
1217 symbol type) it will be easier to call the appropriate destructor.
de62edee 1218
0e0ed236 1219 These changes should probably benefit the C parser too.
de62edee 1220
0e0ed236
AD
1221 * data/lalr1.cc: Copy as... * data/lalr1-fusion.cc: this new
1222 file.
1223 (b4_rhs_value, b4_rhs_location): New definitions overriding those
1224 from c++.m4.
1225 (state_stack_type, semantic_stack_type, location_stack_type)
1226 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
1227 (data_type, stack_type, yystack_): New.
1228 (YYLLOC_DEFAULT, yypush_): Adjust.
1229 (yyerror_range): Now based on data_type, not location_type.
1230
7dedf26e
AD
12312008-11-03 Akim Demaille <demaille@gostai.com>
1232
1233 Push the state, value, and location at the same time.
1234 This is needed to prepare a forthcoming patch that fuses the three
1235 stacks into one.
de62edee 1236
7dedf26e
AD
1237 * data/lalr1.cc (parser::yypush_): New.
1238 (parser::yynewstate): Change the semantics: instead of arriving to
1239 this label when value and location have been pushed, but yystate
1240 is to be pushed on the state stack, now the three of them must
1241 have been pushed before. yystate still must be the new state.
1242 This allows to use yypush_ everywhere instead of individual
1243 handling of the stacks.
1244
c4585f1e
AD
12452008-11-03 Akim Demaille <demaille@gostai.com>
1246
1247 Prefer references to pointers.
1248 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
1249 definition to use references instead of pointers.
1250 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
1251 Take the value and location as references.
1252 Adjust callers.
1253
56017c17
AD
12542008-11-03 Akim Demaille <demaille@gostai.com>
1255
1256 stack::size instead of stack::height.
1257 * data/lalr1.cc (stack::height): Rename as...
1258 (stack::size): this.
1259 Fix the output type.
1260 Comment changes.
1261
5ab8c47b
AD
12622008-11-03 Akim Demaille <demaille@gostai.com>
1263
1264 Use variants to support objects as semantic values.
1265 This patch was inspired by work by Michiel De Wilde. But he used Boost
1266 variants which (i) requires Boost on the user side, (ii) is slow, and
1267 (iii) has useless overhead (the parser knows the type of the semantic value
1268 there is no reason to duplicate this information as Boost.Variants do).
de62edee 1269
5ab8c47b
AD
1270 This implementation reserves a buffer large enough to store the largest
1271 objects. yy::variant implements this buffer. It was implemented with
1272 Quentin Hocquet.
de62edee 1273
5ab8c47b
AD
1274 * src/output.c (type_names_output): New.
1275 (output_skeleton): Invoke it.
1276 * data/c++.m4 (b4_variant_if): New.
1277 (b4_symbol_value): If needed, provide a definition for variants.
1278 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
1279 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
1280 (b4_char_sizeof, yy::variant): New.
1281 (parser::parse): If variants are requested, define
1282 parser::union_type, parser::variant, change the definition of
1283 semantic_type, construct $$ before running the user action instead
1284 of performing a default $$ = $1.
1285 * examples/variant.yy: New.
1286 Based on an example by Michiel De Wilde.
1287
1fa5d8bb
AD
12882008-11-03 Akim Demaille <demaille@gostai.com>
1289
1290 Parameterize the extraction of semantic values.
1291 To make future changes easier, no longer rely on ".TYPE" being the
1292 way to get a semantic value.
de62edee 1293
1fa5d8bb
AD
1294 * data/c.m4 (b4_symbol_value): New.
1295 Use it.
1296 * data/c++.m4, data/yacc.c: Use it.
1297 * data/glr.c: Use b4_symbol_value.
1298 (b4_rhs_data): New.
1299 Use it.
1300
91ba8a55
AD
13012008-11-03 Akim Demaille <demaille@gostai.com>
1302
1303 Prepare easier M4 changes.
1304 * data/lalr1.cc: Use escaped [] instead of literals to prepare
1305 future changes.
1306
c9ba9e59
JD
13072008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1308
1309 Initiate further development.
1310 * NEWS: Create an empty section for new entries.
1311 * gnulib: Update submodule to HEAD.
1312
bfb40910
JD
13132008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1314
1315 * NEWS: Version 2.4.
1316
241fda7a
JD
13172008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1318
1319 Prepare for next release.
1320 * NEWS: Briefly mention changes since 2.3b.
1321 * README: Say GNU m4 1.4.6, which we've been requiring in release
1322 announcements already, not 1.4.3, which breaks the build.
1323
ed4d67dc
JD
13242008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1325
1326 Say %language is experimental.
1327 We're thinking of extending it's effect on output file naming. See the
1328 thread at
1329 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1330 * NEWS: Say it's experimental.
1331 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1332 recommend it over %skeleton for now.
1333 (Bison Options): Likewise.
1334 (C++ Bison Interface): Use %skeleton not %language.
1335 (Calc++ Parser): Use %skeleton not %language.
1336 * src/getargs.c (usage): Say it's experimental.
1337
e254a580
DJ
13382008-11-01 Di-an Jan <dianj@freeshell.org>
1339 Paolo Bonzini <bonzini@gnu.org>
1340
1341 Support all Java parser class modifiers.
1342 * data/java.m4 (b4_percent_define_get3): New.
1343 (b4_final_if, b4_strictfp_if): New.
1344 * data/lalr1.java (final, strictfp, extends, implements): Support.
1345 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1346 documentation.
1347 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1348 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1349 (AT_CHECK_JAVA_GREP): New.
1350 (Java parser class modifiers): New test.
1351 (Java parser class extends and implements): New test.
1352
1353 Model exception propagation better with throws and lex_throws.
1354 * data/java.m4 (b4_list2): New.
1355 (throws): Change default.
1356 * data/lalr1.java (yyaction): Add throws.
1357 (parse): Add lex_throws in addition to throws.
1358 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1359 * tests/java.at (Java throws specifications): New test.
1360
1361 Improve documentation for Java parsers.
1362 * doc/bison.texinfo (Java Parsers): Add subsections.
1363 Don't quote first argument of %define.
1364 (Java Bison Interface): Document output files. Move documentation
1365 of parser class and merge into Java Parser Interface. Document
1366 features that error out. Document directives with no effect.
1367 Move note about Javadoc higher.
1368 (Java Semantic Values): Explicitly mention stype.
1369 Document that generic types cannot be used.
1370 (Java Location Values): Use @deftypeivar. Document constructors.
1371 Correct return value for toString.
1372 (Java Parser Interface): List undocumented constants/fields.
1373 Move documentation of fields added by %parse-param closer to list
1374 of members. Document that token names are added as fields.
1375 Document constructors accurately. Remove error method.
1376 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1377 Interface. Describe %code lexer and yylex accutately.
1378 Remove documentation that does not match the code.
1379 (Java Action Features): New.
1380 (Java Differences): Add reference. Add item on semantic values.
1381 Add note about @{ ... @}. Clarify %% epilogue placement.
1382 (Java Declarations Summary): New.
1383
1384 Fix Java skeleton.
1385 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1386 (b4_remove_comma): Quote test argument.
1387 (b4_identification): Remove "bison" field.
1388 * tests/java.at (Java parser class and package names): New test.
1389 (Java %parse-param and %lex-param): New test.
1390 (Java stype, position_class and location_class): New test.
1391
f259e4e6
PB
13922008-10-31 Di-an Jan <dianj@freeshell.org>
1393
1394 * data/lalr1.jave: Update copyright years.
1395 (YYParser): Correct name of "generated from" file in Javadoc:
1396 use b4_file_name instead of @ofile@.
1397 (Location constructor): Correct Javadoc parameter name.
1398 (yylloc): Add missing opening m4 quote after b4_location_if.
1399 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1400 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1401 (YYParser constructor): Correct Javadoc parameter name.
1402
cae5057f
JD
14032008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1404
1405 Always put auxiliary code files in the same dir as other output files.
1406 * src/files.c (compute_file_name_parts): When the user specifies
1407 --output but not --file-prefix, extract the directory prefix from the
1408 file prefix not from the grammar file name. This affects the location
1409 of files like location.hh generated by the C++ skeleton. The includes
1410 in the other output files require this fix.
1411 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1412 for expected output files.
1413 (Output files): Add a test for the above.
1414
4af432ba
JD
14152008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1416
1417 * gnulib: Update submodule to HEAD.
1418
e26d4e43
JD
14192008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1420
1421 Update copyright year.
1422 * src/files.c: Here.
1423
c0ee9e21
DJ
14242008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1425
1426 Don't overwrite the input file.
1427 * src/files.c (output_file_name_check): Fatal error if using input file
1428 for output.
1429 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1430 argument.
1431 (Conflicting output files): Add test.
1432
482dc52f
AD
14332008-10-28 Akim Demaille <demaille@gostai.com>
1434
1435 Space changes.
1436 * data/lalr1.cc: Formatting changes.
1437
52cbbe84
AD
14382008-10-28 Akim Demaille <demaille@gostai.com>
1439
1440 Don't define debugging functions when !YYDEBUG.
1441 * data/lalr1.cc (debug_stream, set_debug_stream)
1442 (debug_level_type, debug_level, set_debug_level): Don't
1443 declare them when YYDEBUG is not defined.
1444 The implementation are already YYDEBUG-aware.
1445
0925d5bf
AD
14462008-10-28 Akim Demaille <demaille@gostai.com>
1447
1448 Prefer "continue" for empty loop bodies.
1449 * etc/bench.pl.in: Use "continue" instead of {}.
1450
cf98343c
AD
14512008-10-28 Akim Demaille <demaille@gostai.com>
1452
1453 Space and comments changes.
1454 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1455 * data/c.m4, data/lalr1.cc: Space changes.
1456
9f467b7d
AD
14572008-10-28 Akim Demaille <demaille@gostai.com>
1458
1459 Make gnulib a submodule.
1460 * gnulib: New.
1461 * .gitmodules (gnulib): New.
1462
0f0e1ace
JD
14632008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1464
1465 Fix yyerror_range for user-defined location type in C++. Reported by
1466 Georg Sauthoff at
1467 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1468 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1469 * THANKS (Georg Sauthoff): Add.
1470
548e2104
JD
14712008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1472
1473 Update several administrative files mainly to facilitate releasing.
1474 * HACKING (Administrivia): Make the git-merge-changelog notes more
1475 helpful.
1476 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1477 (Release Procedure): Update for git and add numerous details that were
1478 previously missing.
1479 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1480 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1481 that announcements don't claim we bootstrapped with whatever bison
1482 happened to be in PATH. Add flex as a bootstrap tool.
1483 * Makefile.maint: Remove, previously replaced by maint.mk.
1484 * Makefile.cfg: Remove, and migrate settings to...
1485 * cfg.mk: ... here for the sake of `make announcement'.
1486 * bootstrap.conf (gnulib_modules): Add announce-gen.
1487 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1488 Berry.
1489
ddf17a6e
PB
14902008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1491
1492 Small but important bugfixes for the Java skeleton.
1493 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1494 (yy_symbol_print): Call toString on yyvaluep.
1495
e1145ad8
AD
14962008-08-29 Akim Demaille <demaille@gostai.com>
1497
1498 Clarify UPDATED use.
1499 * doc/bison.texinfo: It refers to the last edition of this file,
1500 not to the release date of Bison.
1501 Reported by Joel E. Denny.
1502
0df72d78
AD
15032008-08-29 Akim Demaille <demaille@gostai.com>
1504
1505 * README: Update FAQ pointer.
1506 Reported by Joel E. Denny.
1507
9a90b6bb
EB
15082008-08-27 Eric Blake <ebb9@byu.net>
1509
1510 Resync m4sugar from autoconf.
1511 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1512 (m4_init): Adjust to latest m4.git changes.
1513 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1514 effects.
1515 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1516 (_m4_list_cmp): Reduce side effects.
1517
65015668
AD
15182008-08-27 Akim Demaille <demaille@gostai.com>
1519
1520 Check yyerrok in calc.at.
1521 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1522 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1523 expected.
1524
98e26a92
AD
15252008-08-27 Akim Demaille <demaille@gostai.com>
1526
1527 Support yyerrok in lalr1.cc.
1528 YYBACKUP is still to import back into lalr1.cc.
1529 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
1530
86c0e784
JD
15312008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1532
1533 For maintainer-check*, don't recompile for a $(VERSION) update.
1534 * cfg.mk: New file.
1535 (_is-dist-target): Override the one in GNUmakefile.
1536 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1537
88511166
JD
15382008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1539
1540 Update for recent change to gnulib.
1541 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1542 string.h now.
1543
6bbb2ed5
EB
15442008-08-15 Eric Blake <ebb9@byu.net>
1545
d67c52e8
EB
1546 Remaining m4sugar merge from autoconf.
1547 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1548 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1549 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1550 * src/output.c (output_skeleton): Tell m4 how to find it.
1551
6bbb2ed5
EB
1552 Partial m4sugar merge from autoconf: m4_map.
1553 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1554 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1555 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1556 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1557 for empty list.
1558 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1559 Likewise.
1560 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1561 declares it.
1562
8dce3875
JD
15632008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1564
1565 Keep .version and PACKAGE_VERSION in sync.
1566 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1567 dependency, and add comments justifying this in more detail. Discussed
1568 starting at
1569 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1570
882a1fbf
EB
15712008-08-06 Eric Blake <ebb9@byu.net>
1572
a3764451
EB
1573 Partial m4sugar merge from autoconf: m4_shiftn.
1574 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1575 (m4_shift2, m4_shift3): New macros.
1576 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1577 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1578 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1579 * data/java.m4 (b4_remove_comma): Likewise.
1580
882a1fbf
EB
1581 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1582 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1583 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1584 (m4_init): Consolidate wrapped text into single m4_wrap.
1585 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1586 in wrapped text.
1587
a30e920d
EB
15882008-08-05 Eric Blake <ebb9@byu.net>
1589
dfcc5959
EB
1590 Partial m4sugar merge from autoconf: builtins, version.m4.
1591 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1592 (m4_prepend): Remove, as it is unused and inherently quadratic,
1593 whereas m4_append is linear in newer m4.
1594 (m4_mkstemp): New builtin.
1595 (m4_symbols): Make rename conditional.
1596 (m4_version_prereq): Ensure fatal error if used in bison, which
1597 intentionally lacks version.m4.
1598
a30e920d
EB
1599 Fix comments in m4sugar.
1600 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1601
445b7470
JD
16022008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1603
1604 Update for recent .gitignore fix in Gnulib.
1605 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1606 anchored .gitignore entries.
1607
a1e50014
JD
16082008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1609
1610 Set gnu or gnits strictness.
1611 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1612 development and gnits strictness for releases. Based on Eric Blake's
1613 suggestion at
1614 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1615
d43f77e7
PB
16162008-07-31 Paolo Bonzini <bonzini@gnu.org>
1617
1618 * NEWS: Clarify documentation of %language.
1619
fee2ed87
PB
16202008-07-31 Paolo Bonzini <bonzini@gnu.org>
1621
1622 Support usage of git-merge-changelog.
1623 * .gitattributes: New.
1624 * HACKING: Document usage of git-merge-changelog.
1625 * bootstrap: Install git-merge-changelog entries in .git/config
1626 if appropriate.
1627
78029cd5
JD
16282008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1629
1630 Remove remaining dependence on CVS Id keyword.
1631 * ChangeLog: For the sake of people still using CVS, don't use dollars
1632 when mentioning Id.
1633 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1634 unusual anyway.
1635 * data/xslt/xml2dot.xsl: Likewise.
1636 * data/xslt/xml2text.xsl: Likewise.
1637 * data/xslt/xml2xhtml.xsl: Likewise.
1638 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1639 * doc/Makefile.am (neutralize): Remove, no longer needed.
1640 (.x.1): Don't use neutralize.
1641 (edit): Don't substitute for ID.
1642 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1643
c53d18b1
JD
16442008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1645
1646 Fix dependence on computed configure variables.
1647 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1648 $(top_srcdir)/configure.ac so that changes to computed variables, such
1649 as PACKAGE_VERSION, are seen.
1650 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1651
5523ac79
JD
16522008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1653
1654 Update copyright dates for recent changes.
1655 * Makefile.am: Here.
1656 * src/Makefile.am: Here.
1657 * src/reduce.c: Here.
1658 * tests/reduce.at: Here.
1659
8fa36911
JD
16602008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1661
1662 Use git-version-gen for version names between releases.
1663 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1664 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1665 * .prev-version: New.
1666 * .version.in: Remove.
78029cd5 1667 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
1668 revision.
1669 * GNUmakefile: Remove, now copied from Gnulib.
1670 * Makefile.am: Add code suggested by comments in
1671 build-aux/git-version-gen.
1672 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1673 .prev-version, and .version.
1674 * NEWS (2.3b+): Rename to...
1675 (?.?): ... this because we're dropping the "+" version naming scheme,
1676 but, in general, we still can't be sure of our next release name.
1677 * bootstrap: Add a quick hack to remove from .gitignore the
1678 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1679 entry. This should really be fixed in gnulib instead.
1680 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1681 * configure.ac (AC_INIT): Set version name by invoking
1682 build-aux/git-version-gen.
1683 (AC_CONFIG_FILES): Remove .version, now generated by
1684 build-aux/git-version-gen.
1685 * maint.mk: New, copied from coreutils.
1686 * doc/.cvsignore (bison.1): Add.
1687 * doc/.gitignore (/bison.1): Add.
1688 * doc/bison.1: Remove, generated.
1689 * src/.cvsignore (revision.c): Remove.
1690 * src/.gitignore (/revision.c): Remove.
1691 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1692 (BUILT_SOURCES): Remove revision.c.
1693 (revision.c): Remove.
1694 * src/getargs.c (version): Don't print revision after the VERSION.
1695 * src/revision.h: Remove.
1696
bcf07cb7
JD
16972008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1698
1699 Fix untranslatable composition of sentences. Reported by Goran
1700 Uddeborg at
1701 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1702 * THANKS (Goran Uddeborg): Add.
1703 * src/reduce.c (reduce_print): Report the number of nonterminals and
1704 rules useless in the grammar in separate sentences.
1705 * tests/reduce.at (Useless Rules): Update output.
1706 (Reduced Automaton): Likewise.
1707 (Underivable Rules): Likewise.
1708 (Empty Language): Likewise.
1709
9aacab9a
JD
17102008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1711
1712 Fix some .gitignore and .cvsignore problems.
1713 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1714 (insert_vc_ignore): ... this new function, which prepends `/' to all
1715 .gitignore entries before passing them to insert_sorted_if_absent.
1716 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1717 .cvsignore files are maintained even though Bison developers run
1718 bootstrap while using Git.
1719 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1720 unneeded by Bison.
1721 (gnulib): Add.
1722 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1723 unneeded. Reported by Eric Blake.
1724 * lib/.gitignore (/*~): Add.
1725 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1726 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1727 Blake.
1728 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1729
a9fc7990
JD
17302008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1731
1732 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1733 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1734 * bootstrap.conf (gnulib_modules): Add unsetenv.
1735 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1736 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1737 (/setenv.m4): Add.
1738 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1739 the first argument because it may become position-dependent, and unset
1740 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1741 Add comments explaining these issues in more detail.
1742
0f1d6f10
JD
17432008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1744
1745 Add .gitignore everywhere based on .cvsignore.
1746 * .gitignore: New.
1747 * build-aux/.gitignore: New.
1748 * data/.gitignore: New.
1749 * doc/.gitignore: New.
1750 * etc/.gitignore: New.
1751 * examples/.gitignore: New.
1752 * examples/calc++/.gitignore: New.
1753 * lib/.gitignore: New.
1754 * m4/.gitignore: New.
1755 * po/.gitignore: New.
1756 * runtime-po/.gitignore: New.
1757 * src/.gitignore: New.
1758 * tests/.gitignore: New.
1759
7bd1665a
JD
17602008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1761
1762 * NEWS (2.3b+): New section, empty for now.
1763 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1764
72c5b982
JD
17652008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1766
1767 * NEWS (2.3b): Update release date since there has been a delay in
1768 getting the announcements and tarballs out.
1769
bd02cd5d
JD
17702008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1771
1772 * NEWS: Version 2.3b.
1773 * configure.ac (AC_INIT): Likewise.
1774 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1775
9126263e
JD
17762008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1777
1778 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1779 been doing it for years.
1780 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1781 (Release Procedure): Add FIXME about make alpha being unmaintained.
1782
fa6aa7b3
JD
17832008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1784
1785 * data/yacc.c: Reformat m4 a little for readability.
1786 * src/lalr.c (build_relations): Correct comment.
1787
d30b312d
JMG
17882008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1789
1790 DJGPP specific issue.
1791 * djgpp/config.sed: Fixes required to run configure scripts generated
1792 by autoconf 2.62.
1793
138d4cd9
JD
17942008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1795
1796 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1797 coordinator@translationproject.org.
1798
8f7e2e1f
JD
17992008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1800
1801 * THANKS: Add Eric Blake.
1802
f55efa38
JD
18032008-04-23 Eric Blake <ebb9@byu.net>
1804
1805 Revert prior patch, by working around autoconf regression.
1806 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1807 ("Output file name: ("): Uncomment test.
1808 ("Output file name: )"): Likewise.
1809 Based on an idea from Noah Misch.
1810
096c9f9d
JD
18112008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1812
1813 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1814 2.61. Reported by Juan Manuel Guerrero at
1815 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1816 * tests/output.at ("Output file name: ("): Comment out test case for
1817 now.
1818 ("Output file name: )"): Likewise.
1819
0f664b89
JD
18202008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1821
1822 * GNUmakefile: Update git-version-gen invocation so make dist
1823 succeeds.
1824
1cfe6375
JD
18252008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1826
1827 Update to the current gnulib CVS repository, and fix trigraph handling
1828 in Bison.
1829 * bootstrap: Update gnulib CVS repository URL.
1830 (symlink_to_dir): Encapsulate the code that guarantees the destination
1831 directory exists into...
1832 (check_dst_dir): ... this new function, and...
1833 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1834 fail when copying files into lib/uniwidth/.
1835 * src/output.c (prepare_symbols): When writing yytname muscles, where
1836 symbol names will be encoded in C-string literals, tell quotearg to
1837 escape trigraphs. This used to be the default in gnulib.
1838 * tests/regression.at (Token definitions): Because of the change in
1839 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1840 escapes trigraphs in symbol names. Thus, yytname no longer has
1841 trigraphs unnecessarily doubly escaped. Update test case output.
1842 Extend test case to be sure Bison's own error messages will no longer
1843 have trigraphs in symbol names unnecessarily escaped once.
1844
74c52fc8
JD
18452008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1846
1847 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1848 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1849 * .cvsignore: Add .version.
1850 * .version.in: New.
1851 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1852 * configure.ac (AC_CONFIG_FILES): Add .version.
1853 * build-aux/.cvsignore: Add git-version-gen.
1854
8e55b3aa
JD
18552008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1856
1857 * NEWS (2.3a+): Mention that -g now takes an argument.
1858 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1859 consistency. Update the -g and -x entries now that they take
1860 arguments. Use brackets to indicate optional arguments.
1861 * src/getargs.c (usage): Explain the relationship between arguments of
1862 long and short options more completely. Document --defines and -d
1863 separately since the former takes an argument but, for POSIX Yacc, the
1864 latter does not.
1865 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 1866 (getargs): Sort cases.
8e55b3aa 1867
59c5ac72
AD
18682008-02-28 Akim Demaille <demaille@gostai.com>
1869
1870 * doc/bison.texinfo: Fix a few typos.
1871
118d4978
AD
18722008-02-28 Akim Demaille <akim@epita.fr>
1873
1874 * doc/bison.texinfo (Bison Options): Document -W.
1875 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1876
7020f1e9
AD
18772008-02-28 Akim Demaille <akim@epita.fr>
1878
1879 * src/getargs.c (short_options): Split and sort for readability.
1880 -g and -x take optional arguments, just like their long options.
1881 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1882 understand.
1883 Fix the handling of $opt which resulted in all the argument to be
1884 considered as optional.
1885
59da312b
JD
18862008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1887
1888 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1889 say its interface is experimental.
1890 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1891 Java.
1892 (Bison Options): In the -L and --language entry, mention Java.
1893 (Java Bison Interface): Say the interface is experimental.
1894 * src/getargs.c (usage): Mention -L and --language.
1895
1896 * NEWS (2.3a+): Say the push parsing interface is experimental.
1897 * doc/bison.texinfo (Push Decl): Likewise.
1898 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1899 (Push Parser Function): Likewise.
1900 (Pull Parser Function): Likewise.
1901 (Parser Create Function): Likewise.
1902 (Parser Delete Function): Likewise.
1903 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1904 yypull_parse, and yypush_parse entries.
1905
1906 * NEWS (2.3a+): Mention XML support, and say the schema is
1907 experimental.
1908 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1909 * src/getargs.c (usage): Say the XML schema is experimental.
1910
1911 * NEWS (2.3a+): Say option instead of flag.
1912
2bb3ebec
WP
19132008-02-21 Wojciech Polak <polak@gnu.org>
1914
1915 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1916 text.
1917
333e670c
JD
19182008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1919
1920 Fix impure push parser compile error reported by Bob Rossi at
1921 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1922 * data/yacc.c: Clean up whitespace in the output a little.
1923 (yypstate_allocated): Define for impure push parsers regardless of
1924 whether the pull interface is also requested.
1925 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1926 check impure push parsers without the pull interface.
1927
1928 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1929 yyerror takes arguments specified by %parse-param while yypstate_new
1930 does not.
1931 * doc/bison.texinfo (Parser Create Function): Document that
1932 yypstate_new returns 0 for multiple impure parser instances.
1933 * tests/push.at (Push Parsing: Multiple impure instances): Update
1934 expected stderr output.
1935
798096e1
JD
19362008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1937
1938 * runtime-po/POTFILES.in (push.c): Remove.
1939
9ca7f077
JD
19402008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1941
1942 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1943 * data/push.c: Rename to...
1944 * data/yacc.c: ... this, overwriting it.
1945 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1946 `%push-pull-parser' -> `%define api.push_pull "both"'.
1947 Remove old yacc.c tests, and update push.c tests to yacc.c.
1948
42ee26bb
JD
19492008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1950
1951 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1952 `"%code top" blocks' instead of `%code "top" blocks'.
1953 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1954 Clean up whitespace in the output a little.
1955
b1cc23c4
JD
19562008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1957
1958 Fix documentation problems reported by Tim Josling at
1959 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1960 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1961 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1962 integers. Explain the effect of literal string aliases on error
1963 messages. Copy token 0 documentation from the C++ skeleton
1964 documentation.
1965
ab7f29f8
JD
19662008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1967
1968 Accept a token number in a %left, %right, or %nonassoc for POSIX
1969 conformance. Reported by Tim Josling at
1970 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1971 * NEWS (2.3a+): Mention.
1972 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1973 and code numbers are treated by precedence declarations.
1974 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1975 of symbols.1.
1976 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1977 of symbol.
1978 (symbol.prec): New, just like symbol but allows INT.
1979 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1980 longer holds.
1981 * tests/regression.at (Token number in precedence declaration): New
1982 test case.
1983
a924ef36
JMG
19842008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1985
1986 DJGPP specific issues.
1987 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1988 be changed. Copyright timestamp adjusted.
1989 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1990 be changed. Copyright timestamp adjusted.
1991 * djgpp/config.site: Copyright timestamp adjusted.
1992 * djgpp/config_h.sed: Copyright timestamp adjusted.
1993 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1994 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1995 filename translation list.
1996 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1997 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1998 files shall be created. Before trying to use the temp dir where the
1999 environment variable points to check that the dir really exists. If
2000 not default to the cwd as temp dir. Copyright timestamp adjusted.
2001 * djgpp/subpipe.h: Copyright timestamp adjusted.
2002 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2003
389c8cfd
PE
20042008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2005
2006 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2007
5d1cfef4
PE
20082008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2009
2010 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2011 Problem reported by Claudio Saavedra in
2012 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2013
e2dcf996
WP
20142008-01-05 Wojciech Polak <polak@gnu.org>
2015
2016 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2017 document's title with the input grammar file name.
2018
da730230
JD
20192007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2020
2021 Automate regression testing of the XML/XSLT implementation. Discussed
2022 starting at
2023 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2024 * configure.ac (XSLTPROC): New substitution.
2025 * Makefile.am (maintainer-xml-check): New phony target invoking...
2026 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2027 invoking make maintainer-check with BISON_TEST_XML=1.
2028 * tests/atlocal.in (XSLTPROC): New.
2029 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2030 not to report reachable memory when Bison is expected to have a
2031 non-zero exit status and (2) to compare XML/XSLT output with --graph
2032 and --report=all output for every working grammar when
2033 BISON_TEST_XML=1.
2034 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2035 (AT_BISON_CHECK_XML): New.
2036 (AT_QUELL_VALGRIND): New.
2037 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2038 (AT_CHECK): ... don't redefine this since this was the old way to
2039 quell Valgrind.
2040 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2041 AT_BISON_CHECK invocations.
2042 * tests/c++.at: Likewise.
2043 * tests/calc.at: Likewise.
2044 * tests/conflicts.at: Likewise.
2045 * tests/cxx-type.at: Likewise.
2046 * tests/existing.at: Likewise.
2047 * tests/glr-regression.at: Likewise.
2048 * tests/headers.at: Likewise.
2049 * tests/input.at: Likewise.
2050 * tests/java.at: Likewise.
2051 * tests/output.at: Likewise.
2052 * tests/push.at: Likewise.
2053 * tests/reduce.at: Likewise.
2054 * tests/regression.at: Likewise.
2055 * tests/sets.at: Likewise.
2056 * tests/skeletons.at: Likewise.
2057 * tests/synclines.at: Likewise.
2058 * tests/torture.at: Likewise.
2059 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2060 tends to hang xsltproc.
2061 (Big horizontal): Likewise.
2062
408476bc
JD
20632007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2064
2065 In XML output, remove redundant class attribute on symbol element.
2066 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2067 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2068 look up a symbol to determine whether it's a nonterminal or terminal.
2069 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2070 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2071
2072 Add prec/assoc information to XML output.
2073 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2074 %prec, add a percent_prec attribute.
2075 * src/print-xml.c (print_grammar): For each terminal that has a
2076 precedence or associativity, add a prec or assoc attribute.
2077 (xml_indent): New.
2078 (xml_puts): Use xml_indent.
2079 (xml_printf): Use xml_indent.
2080 * src/print-xml.h (xml_indent): Prototype.
2081
2082 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2083 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2084
d4a26c48
JD
20852007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2086
2087 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2088 (bison:ruleByNumber): ... this for clarity.
2089 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2090 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2091 (xsl:template match="reduction"): Update.
2092 (xsl:template match="item"): Update.
2093 (xsl:template match="reduction"): Update.
2094
2095 In the XML output, don't print the list of rules where symbols appear.
2096 Compute it in XSLT instead. Discussed at
2097 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2098 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2099 (bison:ruleByRhs): New.
2100 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2101 bison:ruleByRhs.
2102 (xsl:template match="terminal/rule"): Remove.
2103 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2104 bison:ruleByRhs.
2105 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2106 Remove.
2107 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2108 bison:ruleByRhs and mode="number-link" for rule template.
2109 (xsl:template match="terminal/rule"): Remove.
2110 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2111 bison:ruleByRhs and mode="number-link" for rule template.
2112 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2113 Rewrite as...
2114 (xsl:template match="rule" mode="number-link"): ... this.
2115 * src/print-xml.c (print_grammar): Don't print the list of rules.
2116
ef1b4273
JD
21172007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2118
2119 Don't let --report affect XML output; always print all information.
2120 Discussed at
2121 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2122 * src/conflicts.c (log_resolution): Implement.
2123 * src/print-xml.c (print_core): Implement.
2124 (print_state): Implement.
2125 (print_xml): Implement.
2126
2127 * NEWS (2.3a+): Fix quotes.
2128 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2129 don't let %verbose clear the list specified by --report.
2130
0f6cd9e3
AD
21312007-11-26 Akim Demaille <akim@epita.fr>
2132
2133 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2134
d80fb37a
JD
21352007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2136
2137 In the XML output, list useless and unused symbols and rules with the
2138 useful ones and add a "usefulness" attribute. Discussed starting at
2139 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2140 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2141 (grammar_rules_print_xml): Print all rules instead of just those
2142 useful in the grammar, and add a "usefulness" attribute.
2143 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2144 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2145 (print_grammar): Print all nonterminals instead of just useful ones,
2146 and add a "usefulness" attribute to nonterminals and terminals.
2147 (print_xml): Don't print a separate "reductions" or
2148 "rules-useless-in-parser" element.
2149 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2150 (reduce_xml): Remove.
2151 (reduce_token_unused_in_grammar): New.
2152 (reduce_nonterminal_useless_in_grammar): New.
2153 * src/reduce.h (reduce_xml): Remove prototype.
2154 (reduce_token_unused_in_grammar): Add prototype.
2155 (reduce_nonterminal_useless_in_grammar): Add prototype.
2156 * data/xslt/xml2text.xsl: Update for XML changes.
2157 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2158 * tests/reduce.at (Useless Terminals): Update output.
2159 (Useless Rules): Update output.
2160 (Reduced Automaton): Update output.
2161
2162 Say "Terminals unused in grammar" instead of "Unused terminals".
2163 * NEWS (2.3a+): Update.
2164 * doc/bison.texinfo (Understanding): Update example output.
2165 * src/reduce.c (reduce_output): Implement.
2166 * data/xslt/xml2text.xsl: Implement.
2167 * data/xslt/xml2xhtml.xsl: Implement.
2168
1bb2bd75
JD
21692007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2170
2171 Accept --report-file=FILE to override the default `.output' filename.
2172 * NEWS (2.3a+): Mention.
2173 * doc/bison.texinfo (Bison Options): Add an entry.
2174 * src/files.c (compute_output_file_names): Don't override
2175 spec_verbose_file if already set.
2176 * src/getargs.c (usage): Document --report-file.
2177 (REPORT_FILE_OPTION): New anonymous enum member.
2178 (long_options): Add entry for it.
2179 (getargs): Add case for it setting spec_verbose_file.
2180
2181 * build-aux/cross-options.pl: Don't record a short option just because
2182 there's an arg.
2183 * doc/.cvsignore: Add yacc.1.
2184
a005a9c4
AD
21852007-11-14 Akim Demaille <akim@epita.fr>
2186
2187 * doc/yacc.1.in: New.
2188 * configure.ac, doc/Makefile.am: Adjust.
2189 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2190 config.h symbol.
2191 Use AC_SUBST for assignments too.
2192 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2193
cff03fb2
JD
21942007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2195
2196 * src/gram.c: Remove comments that duplicate comments in gram.h.
2197
2198 When reporting useless rules and nonterminals, say "useless in grammar"
2199 instead of "useless", and say "useless in parser" instead of "never
2200 reduced". Discussed starting at
2201 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2202 * NEWS (2.3a+): Mention this change.
2203 * data/xslt/xml2text.xsl: Update output text and expected input XML
2204 element names to match changes below.
2205 * data/xslt/xml2xhtml.xsl: Likewise.
2206 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2207 Contents: "Rules useless in parser due to conflicts".
2208 * doc/bison.texinfo (Decl Summary): Reword a little.
2209 (Understanding): Update example output for changes below.
2210 * src/gram.c: (rule_useful_p): Rename to...
2211 (rule_useful_in_grammar_p): ... this.
2212 (rule_useless_p): Rename to...
2213 (rule_useless_in_grammar_p): ... this.
2214 (rule_never_reduced_p): Rename to...
2215 (rule_useless_in_parser_p): ... this.
2216 (grammar_rules_print): Update for renames.
2217 (grammar_rules_print_xml): Update for renames.
2218 (grammar_rules_never_reduced_report): Rename to...
2219 (grammar_rules_useless_report): ... this since it is used for either
2220 kind of useless rule.
2221 * src/gram.h: Reword comments and update function names in prototypes.
2222 * src/main.c (main): Say "rule useless in parser due to conflicts".
2223 * src/print-xml.c (print_rules_never_reduced): Rename to...
2224 (print_rules_useless_in_parser): ... this, and rename output XML
2225 element "rules-never-reduced" to "rules-useless-in-parser".
2226 (print_xml): Update for rename.
2227 * src/print.c (print_results): Say "Rules useless in parser due to
2228 conflicts".
2229 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2230 (nonterminals_reduce): Say "nonterminal useless in grammar".
2231 (reduce_output): Say "Nonterminals useless in grammar".
2232 Say "Rules useless in grammar".
2233 (reduce_xml): Rename output XML element "useless" to
2234 "useless-in-grammar".
2235 (reduce_print): Don't report the count of grammatically useless rules
2236 as "rules never reduced" just because %yacc is specified.
2237 In the correct report of this count, say nonterminal(s) and rule(s)
2238 "useless in grammar".
2239 * tests/conflicts.at (S/R in initial): Update expected output.
2240 (Defaulted Conflicted Reduction): Likewise.
2241 (Unreachable States After Conflict Resolution): Likewise.
2242 * tests/existing.at (GNU pic Grammar): Likewise.
2243 * tests/reduce.at (Useless Nonterminals): Likewise.
2244 (Useless Rules): Likewise.
2245 (Reduced Automaton): Likewise.
2246 (Underivable Rules): Likewise.
2247 (Empty Language): Likewise.
2248
66f0441d
JD
22492007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2250
2251 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2252 here document and before the EOF so that BSD's implementation of Bourne
2253 shell doesn't parse the delimiter as part of the here document.
2254 * doc/.cvsignore: Add cross-options.texi.
2255 * src/getargs.c (usage): Add a blank line after the warning categories.
2256
d0ee4105
PB
22572007-11-08 Paolo Bonzini <bonzini@gnu.org>
2258
2259 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2260
e8b1fb9b
AD
22612007-11-05 Akim Demaille <akim@epita.fr>
2262
2263 Remove Id: from bison.1.
2264 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2265 (perl -0777 -pi -e 's/\.PP\nId): New.
2266 (.x.1): Use it to ignore the version control revision.
2267
2f7a96b5
AD
22682007-11-05 Akim Demaille <demaille@gostai.com>
2269
2270 * build-aux/Makefile.am: Ship cross-options.pl.
2271 * doc/Makefile.am: Always refer to cross-options.texi with
2272 $(srcdir).
2273 (MAINTAINERCLEANFILES): Add it.
2274
f4101aa6
AD
22752007-11-04 Akim Demaille <demaille@gostai.com>
2276
2277 Generate the long/short option cross-table.
2278 * build-aux/cross-options.pl: New.
2279 * doc/Makefile.am (cross-options.texi): New.
2280 * doc/bison.texinfo: Use it.
2281
727a1401
AD
22822007-11-04 Akim Demaille <demaille@gostai.com>
2283
2284 Generate bison.1 using help2man.
2285 * doc/common.x, doc/bison.x: New.
2286 * doc/Makefile.am (bison.1, .x.1): New.
2287 The code is taken from autoconf-2.61/man/Makefile.am.
2288 * configure.ac: Look for help2man.
2289
6aeb9c57
AD
22902007-11-04 Akim Demaille <demaille@gostai.com>
2291
2292 Complete --help.
2293 * src/getargs.c (usage): Document -W, make it clear that -d,
2294 -g and -x have optional arguments.
2295
d7be4085
AD
22962007-11-04 Akim Demaille <demaille@gostai.com>
2297
2298 Find sha1sum when named gsha1sum.
2299 * bootstrap (find_tool): New.
2300 ($SHA1SUM): New.
2301
d9df47b6
JD
23022007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2303
2304 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2305 at
2306 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2307 * NEWS (2.3a+): Mention.
2308 * data/bison.m4 (b4_pure_if): Don't define it here.
2309 * data/c.m4 (b4_identification): Depend on individual skeletons to
2310 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2311 values of the %define variables api.pure or api.push_pull. Define
2312 YYPURE, YYPUSH, and YYPULL accordingly.
2313 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2314 glr.cc has already defined b4_pure_flag.
2315 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2316 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 2317 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
2318 * doc/bison.texinfo (Pure Decl): Update.
2319 (Push Decl): Update.
2320 (Decl Summary): Add api.pure to %define entry.
2321 In %pure-parser entry, say it's deprecated and reference %define.
2322 (Pure Calling): Update.
2323 (Error Reporting): Update.
2324 (C++ Scanner Interface): Update.
2325 (How Can I Reset the Parser): Update.
2326 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2327 reference %define.
2328 * src/getargs.c (pure_parser): Remove global variable.
2329 * src/getargs.h (pure_parser): Remove extern.
2330 * src/output.c (prepare): Don't define pure_flag muscle.
2331 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2332 wrapper around `%define api.pure'.
2333 * tests/calc.at (Simple LALR Calculator): Update.
2334 (Simple GLR Calculator): Update.
2335 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2336 Update.
2337 (GLR: Resolve ambiguity, pure, locations): Update.
2338 (GLR: Merge conflicting parses, pure, no locations): Update.
2339 (GLR: Merge conflicting parses, pure, locations): Update.
2340 * tests/glr-regression.at (Uninitialized location when reporting
2341 ambiguity): Update
2342 * tests/input.at (Unused %define api.pure): New test case.
2343 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2344 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2345 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2346
c373bf8b
JD
23472007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2348
2349 %define push_pull -> %define api.push_pull. Discussed starting at
2350 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2351 * data/push.c: Expect the new name.
2352 * data/yacc.c: Likewise.
2353 * doc/bison.texinfo (Push Decl): Update.
2354 (Decl Summary): Update %define entry.
2355 (Push Parser Function): Update.
2356 (Pull Parser Function): Update.
2357 (Parser Create Function): Update.
2358 (Parser Delete Function): Update.
2359 * tests/calc.at (Simple LALR Calculator): Update.
2360 * tests/input.at (%define enum variables): Update.
2361 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2362 (Push Parsing: Multiple impure instances): Update.
2363 (Push Parsing: Unsupported Skeletons): Update.
2364 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2365 (Exploding the Stack Size with Malloc): Update.
2366
2367 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2368 other entries some.
2369
32f19b6b
JD
23702007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2371
2372 For the XML output's terminal element, rename @number to @token-number,
2373 and add @symbol-number. In the nonterminal element, rename @number to
2374 @symbol-number. Discussed starting at
2375 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2376 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2377 renames.
2378 (xsl:template match="nonterminal"): Likewise.
2379 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2380 (xsl:template match="nonterminal"): Likewise.
2381 * src/print-xml.c (print_grammar): Implement.
2382
255a6b90
JD
23832007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2384
2385 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2386 2007-10-11 change, the child elements here are items not rules.
408476bc 2387 (xsl:template match="item"): New.
255a6b90
JD
2388 (xsl:template match="rule"): Update for new reduced itemset.
2389 (xsl:template match="point"): Remove.
2390 (xsl:template match="empty"): For consistency with --graph, don't
2391 output "/* empty */".
2392 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2393 line-wrap, don't pass a negative value as first-line-length since this
2394 won't work with the following changes.
2395 (xsl:template name="line-wrap"): Simplify slightly.
2396 (xsl:template name="ws-search"): Eliminate recursion.
2397 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2398 set next to an item whose dot is not at the end of the RHS even if it
2399 happens to be associated with the same rule.
2400
88c78747
JD
24012007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2402
31984206
JD
2403 Add %define lr.keep_unreachable_states.
2404 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2405 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2406 * src/main.c (main): Implement it.
2407 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2408 Extend to test it, and fix a typo.
2409
24102007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2411
2412 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
2413 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2414 the example .output text.
2415 * tests/regression.at (Extra lookahead sets in report): Improve wording
2416 of comments.
2417
b7a70162
WP
24182007-10-17 Wojciech Polak <polak@gnu.org>
2419
2420 * src/print-xml.c (print_grammar): Renamed
2421 <terminal> and <nonterminal> attributes:
2422 "type" to "number" and "symbol" to "name".
2423 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2424 Use new attribute names.
2425 (xsl:template match="nonterminal"): Likewise.
2426 * data/xslt/xml2xhtml.xsl: Likewise.
2427
a0de5091
JD
24282007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2429
2430 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2431 (Option Cross Key): Likewise.
2432
2433 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2434 next to an item whose dot is not at the end of the RHS even if it
2435 happens to be associated with the same rule.
2436 * src/print.c (print_core): Likewise.
2437 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2438 (Resolved SR Conflicts): Update output.
2439 * tests/regression.at (Extra lookahead sets in report): New test case.
2440
4c20d18d
WP
24412007-10-11 Wojciech Polak <polak@gnu.org>
2442
2443 * src/print-xml.c (print_core): Remove item set
2444 redundancy.
2445 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2446 Improve processing time. Suggested by Joel E. Denny.
2447 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2448 Write xsl:param "required" attribute as comment.
2449 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2450 (xsl:template match="rule"): Support new reduced itemset.
2451 (xsl:template match="point"): Remove.
2452 * data/xslt/xml2xhtml.xsl: Likewise.
2453
f506ad1c
JD
24542007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2455
2456 * src/getargs.c (version): Update copyright year.
2457
21f1b063
JD
24582007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2459
2460 Make xml2dot.xsl and --graph produce the same output.
2461 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2462 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2463 escaped later.
2464 (xsl:template name="output-node"): Use the new escape template instead
2465 of the string-replace template directly.
2466 (xsl:template name="output-edge"): Likewise.
2467 (xsl:template name="escape"): New, escapes backslashes and newlines in
2468 addition to quotation marks.
2469 * src/graphviz.c (start_graph, output_node, output_edge): Add
2470 whitespace to output for legibility.
2471
2472 Make xml2text.xsl and --report produce the same output, and remove the
2473 XML "conflicts" element since a conflict summary is easily extracted
2474 from the automaton.
2475 * data/xslt/bison.xsl: New.
2476 (xsl:template match="state" mode="bison:count-conflicts): New.
2477 * data/xslt/xml2text.xsl: Import bison.xsl.
2478 (xsl:template match="bison-xml-report"): Instead of styling the
2479 "conflicts" element, style the "automaton" element with mode
2480 "conflicts". Unlike the former, the latter lists S/R and R/R
2481 conflicts for a state on the same line.
2482 (xsl:template match="conflicts"): Remove.
2483 (xsl:template match="conflict"): Remove.
2484 (xsl:template match="terminal"): Line-wrap the list of rules in which
2485 the terminal is used.
2486 (xsl:template match="nonterminal"): Likewise for nonterminals.
2487 (xsl:template match="automaton" mode="conflicts"): New.
2488 (xsl:template match="state" mode="conflicts"): New.
2489 (xsl:template name="line-wrap"): New.
2490 (xsl:template name="ws-search"): New.
2491 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2492 (xsl:template match="bison-xml-report"): Instead of styling the
2493 "conflicts" element, style the "automaton" element with mode
2494 "conflicts."
2495 (xsl:template match="conflicts"): Remove.
2496 (xsl:template match="conflict"): Remove.
2497 (xsl:template match="automaton" mode="conflicts"): New.
2498 (xsl:template match="state" mode="conflicts): New.
2499 * src/conflicts.c (conflicts_output_xml): Remove.
2500 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2501 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2502 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2503 the corresponding XSLT is easier. Also, never wrap between a word and
2504 the comma that follows it.
2505
793fbca5
JD
25062007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2507
2508 Improve C++ namespace support. Discussed starting at
2509 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2510 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2511 b4_namespace_close): New macros that interpret the %define variable
2512 "namespace" so its value can contain "::" to indicate nested
2513 namespaces.
2514 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2515 the above macros.
2516 * data/lalr1.cc (b4_namespace): Likewise.
2517 * data/location.cc (b4_namespace): Likewise.
2518 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2519 inside a new table in the general %define entry. Document `%define
2520 namespace' there as well. Point the %name-prefix entry to it since it
2521 explains it more completely in the case of C++.
2522 (C++ Bison Interface): Mention `%define namespace' instead of
2523 %name-prefix.
2524 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2525 entry suffices.
2526 * tests/c++.at (Relative namespace references): New test case.
2527 (Absolute namespace references): New test case.
2528 (Syntactically invalid namespace references): New test case.
2529 * tests/input.at (C++ namespace reference errors): New test case.
2530
35b8730d
JD
25312007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2532
2533 Add syncline support and location accessor to internal %define
2534 interfaces.
2535 * data/bison.m4 (b4_percent_define_get_loc): New.
2536 (b4_percent_define_get_syncline): New.
2537 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2538 (b4_percent_define_default): Record defining location as line 1 rather
2539 than 0 for the sake of synchronizing #line's, and define
2540 b4_percent_define_syncline(VARIABLE).
2541 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2542 * src/muscle_tab.c (muscle_syncline_grow): New.
2543 (muscle_code_grow): Use muscle_syncline_grow.
2544 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2545 define b4_percent_define_syncline(VARIABLE).
2546 (muscle_percent_define_get_loc): New.
2547 (muscle_percent_define_get_syncline): New.
2548 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2549 remove some unused variables.
2550 (muscle_percent_define_default): Record defining location as line 1
2551 rather than 0 for the sake of synchronizing #line's, and define
2552 b4_percent_define_syncline(VARIABLE).
2553 (muscle_percent_define_check_values): Use
2554 muscle_percent_define_get_loc.
2555 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2556 (muscle_percent_define_get_syncline): Prototype.
2557 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2558 defaults): Update output for location change.
2559 (Complaining during macro argument expansion): Extend to test
2560 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2561
7dc4a694
JD
25622007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2563
2564 Fix some error-reporting macro bugs.
2565 * data/bison.m4 (b4_cat): New.
2566 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2567 to stdout so they don't become arguments to other macros. Update
2568 comments and add examples.
2569 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2570 add examples.
2571 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2572 after printing the error directive so that M4 doesn't report subsequent
2573 problems that are induced by this problem.
2574 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2575 instead of just in them. Recognize @\n in both places. Both expand to
2576 the empty string. Needed by b4_cat.
2577 * tests/skeletons.at (Complaining during macro argument expansion):
2578 New test case.
2579 (Fatal errors make M4 exit immediately): New test case.
2580
d4bd2295
JD
25812007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2582
2583 Implement --print-datadir.
2584 * src/getargs.c (usage): Mention.
2585 (PRINT_DATADIR_OPTION): New anonymous enum member.
2586 (long_options): Add entry for it.
2587 (getargs): Add case for it calling compute_pkgdatadir.
2588 * src/output.c (output_skeleton): Encapsulate data directory
2589 computation from here...
2590 (prepare): ... and from here...
2591 (compute_pkgdatadir): ... into this new function.
2592 * src/output.h (compute_pkgdatadir): Prototype.
2593
34cdeddf
JD
25942007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2595
2596 * src/print-xml.c (escape_bufs): New static global variable
2597 replacing...
2598 (xml_escape_n): ... the static local variable buf here.
2599 (print_xml): Free memory for escape_bufs.
2600 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2601
d782395d
JD
26022007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2603
2604 Replace `%push-parser' and `%push-pull-parser' with
2605 `%define push_pull "push"' and `%define push_pull "both"'.
2606 `%define push_pull "pull"' is the default.
2607 * doc/bison.texinfo (Push Decl, Push Parser Function,
2608 Pull Parser Function, Parser Create Function, Parser Delete Function):
2609 Update declarations.
2610 (Decl Summary, Table of Symbols): Replace %push-parser and
2611 %push-pull-parser entries with a %define push_pull entry.
2612 * data/bison.m4 (b4_percent_define_check_values): New macro.
2613 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2614 definitions...
2615 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2616 definitions...
2617 * data/push.c: ... to here and compute them from the value of the
2618 %define variable push_pull.
2619 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2620 parsing requests here...
2621 * data/yacc.c: ... hack this to switch to push.c any time
2622 b4_use_push_pull_flag or the %define variable push_pull is set. This
2623 will go away when we mv push.c yacc.c.
2624 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2625 push parsing is not supported since unused %define variables are
2626 reported anyway.
2627 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2628 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2629 comments for consistency with b4_percent_define_check_values.
2630 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2631 muscles.
2632 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2633 Remove.
2634 (prologue_declaration): Remove %push-parser and %push-pull-parser
2635 rules.
2636 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2637 * tests/calc.at: Update declarations.
2638 * tests/input.at (%define enum variables): New test case.
2639 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2640 declaration.
2641 (Push Parsing: Multiple impure instances): Update declaration.
2642 (Push Parsing: Unsupported Skeletons): New test case.
2643 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2644 declaration.
2645 (Exploding the Stack Size with Malloc): Update declaration.
2646
3f999f78
WP
26472007-09-24 Wojciech Polak <polak@gnu.org>
2648
2649 Add XSLT transformations.
2650
2651 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2652 * data/xslt/xml2text.xsl: Transform XML into plain text.
2653 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2654 * data/Makefile.am (xsltdir): New variable.
2655 (dist_xslt_DATA): Add xslt/*.xsl files.
2656
a4f75309
PE
26572007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2658
2659 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2660 Problem reported by Wojciech Polak.
2661 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2662 (xml_printf): Undo change I made on 21 September; that is,
2663 indent 2 spaces, not 1.
2664
ad5feac4
JD
26652007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2666
2667 Pacify ./configure --enable-gcc-warnings.
2668 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2669 `char const *' instead of `char *'.
2670 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2671 local variable `sep'.
2672
41d7a5f2
PE
26732007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2674
2675 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2676 elsewhere.
2677 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2678 (xml_printf): Indent just 1 space for level.
2679 (e_char, xlate_char): Remove.
2680 (xml_escape_string): Rewrite to avoid undefined behavior (used
2681 storage that was freed from the stack).
2682 (xml_escape_n): Don't bother checking for subscript error.
2683
3f999f78
WP
26842007-09-21 Wojciech Polak <polak@gnu.org>
2685
2686 Add Bison XML Automaton Report.
41d7a5f2
PE
2687
2688 Add support for an -x option to generate an XML report.
2689 It is not documented yet.
2690 * src/print-xml.c: New file.
2691 * src/print-xml.h: Likewise.
2692 * lib/timevar.def (TV_XML): New var.
2693 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2694 * src/conflicts.c: Include print-xml.h.
2695 (solved_conflicts_xml_obstack): New var.
2696 (log_resolution, conflicts_solve, conflicts_free):
2697 Add support for XML report.
2698 (conflicts_output_val): New function.
2699 * src/conflicts.h (conflicts_output_val): New decl.
2700 * src/files.c (spec_xml_file): New var.
2701 (compute_output_file_names, output_file_names_free): Add XML support.
2702 * src/files.h (spec_xml_file): New decl.
2703 * src/getargs.c (xml_flag): New var.
2704 (usage, short_options, long_options, getargs): Add XML support.
2705 * src/getargs.h (xml_flag): New decl.
2706 * src/gram.c: Include print-xml.h.
2707 (rule_lhs_print_xml, rule_rhs_print_xml):
2708 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2709 New functions.
2710 * src/gram.h: Declare external ones.
2711 * src/main.c: Include print-xml.h.
2712 (main): Add XML support.
2713 * src/reduce.c: Include print-xml.h.
2714 (reduce_xml): New function.
2715 * src/reduce.h: Declare it.
2716 * src/state.c: Include print-xml.h.
2717 (state_new): Add XML support.
2718 (state_rule_lookahead_tokens_print_xml): New function.
2719 * src/state.h: Declare it.
2720 (struct state): New member solved_conflicts_xml.
2721 * src/symtab.c (symbol_class_get_string): New function.
2722 * src/symtab.h: Declare it.
2723
6d8e724d
PE
27242007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2725
2726 * GNUmakefile: Switch to coreutils's version.
2727 * bootstrap: Likewise.
2728 * Makefile.cfg: Adjust to new GNUmakefile.
2729 * README-hacking: Likewise.
2730
2731 Import from gnulib:
2732
2733 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2734 Bruno Haible <bruno@clisp.org>
2735
2736 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2737 and is a script that invokes bison. Tighten the code. Add comments.
2738
922bdd7f
JD
27392007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2740
2741 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2742 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2743 * doc/bison.texinfo (Decl Summary): Fix.
2744 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2745 * tests/input.at (Boolean %define variables): Update output.
2746 * tests/skeletons.at (%define boolean variables: invalid skeleton
2747 defaults): Rename to...
2748 (%define Boolean variables: invalid skeleton defaults): ... this and
2749 update output.
2750
1b17b01d
JD
27512007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2752
2753 In impure push mode, don't allow more than one yypstate to be allocated
2754 since multiple impure parsers would corrupt yynerrs.
2755 * data/push.c (yypstate_allocated): New static global variable
2756 initialized to 0.
2757 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2758 exhaustion if yypstate_allocated is 1, but still return 2.
2759 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2760 already 1. Otherwise, set it to 1.
2761 (yypstate_delete): Set it to 0.
2762 * tests/push.at (Push Parsing: Multiple impure instances): New test
2763 case.
2764
9987d1b3
JD
27652007-08-17 Bob Rossi <bob@brasko.net>
2766
2767 * doc/bison.texinfo (Push Decl): Document the push parser.
2768 (Table of Symbols): Ditto.
2769 (Pure Decl): Ditto.
2770 (Decl Summary): Ditto.
2771 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2772 Parser Create Function, Parser Delete Function):
2773 Add new push parser symbols.
2774 (Table of Symbols): Document push-parser, push-pull-parser,
2775 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2776
f16b0819
PE
27772007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2778
2779 Update to GPLv3.
2780 * doc/gpl-3.0.texi: New file.
2781 * doc/gpl.texi: Remove.
2782 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2783 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2784 * README-hacking, TODO, bootstrap, bootstrap.conf:
2785 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2786 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2787 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2788 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2789 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2790 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2791 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2792 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2793 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2794 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2795 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2796 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2797 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2798 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2799 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2800 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2801 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2802 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2803 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2804 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2805 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2806 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2807 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2808 * src/complain.c, src/complain.h, src/conflicts.c:
2809 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2810 * src/files.h, src/flex-scanner.h, src/getargs.c:
2811 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2812 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2813 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2814 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2815 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2816 * src/print.c, src/print.h, src/print_graph.c:
2817 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2818 * src/reduce.h, src/relation.c, src/relation.h:
2819 * src/revision.h, src/scan-code.h, src/scan-code.l:
2820 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2821 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2822 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2823 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2824 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2825 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2826 * tests/existing.at, tests/glr-regression.at:
2827 * tests/headers.at, tests/input.at, tests/java.at:
2828 * tests/local.at, tests/output.at, tests/push.at:
2829 * tests/reduce.at, tests/regression.at, tests/sets.at:
2830 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2831 * tests/torture.at:
2832 Update to GPLv3.
2833
728c4be2
JD
28342007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2835
2836 Get rid of broken %no-parser, -n, and --no-parser implementation and
2837 documentation.
2838 * TODO: Don't mention them.
2839 * doc/bison.1: Likewise.
2840 * doc/bison.texinfo (Decl Summary): Likewise.
2841 (Bison Options): Likewise.
2842 (Option Cross Key): Likewise.
2843 * src/getargs.c (no_parser_flag): Remove global variable.
2844 (usage): Don't print description of -n and --no-parser.
2845 (long_options): Remove --no-parser entry here.
2846 (getargs): Remove -n case in the switch here.
2847 * src/getargs.h (no_parser_flag): Remove extern.
2848 * tests/regression.at (Web2c Actions): Remove comment that mentions
2849 --no-parser.
2850
5d31a216
JD
28512007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2852
2853 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2854 name user variables starting with `yy'. Just pass NULL instead of a
2855 dummy local &yylval to yypush_parse.
2856 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2857 starting with `yy'.
2858
a2ea208d
JD
28592007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2860
2861 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2862 true since it's then always used regardless of whether yyoverflow is
2863 defined. Reported by Christian Burger at
2864 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2865 * THANKS: Add Christian Burger.
2866
91661ebb
JD
2867 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2868 node names: say "Decl Summary" not "Bison Declaration Summary".
2869
cbd50549
JD
28702007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2871
2872 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2873 determine whether this function has already complained about an invalid
2874 value for a %define boolean variable, don't check whether Bison has
2875 ever examined the value. As written, the check was a tautology.
2876 Instead, record and check for this complaint using a separate muscle.
2877
eb1b0740
JD
28782007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2879
2880 Fix push parsing memory leak reported by Brandon Lucia at
2881 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2882 * THANKS: Add Brandon Lucia.
2883 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2884 but the parse never completed and thus freed it.
2885 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2886 * tests/testsuite.at: Include push.at.
2887 * test/push.at: New.
2888 (Push Parsing: Memory Leak for Early Deletion): New test case.
2889
9d774aff
JD
28902007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2891
2892 Improve handling of multiple S/R conflicts in the same state and of S/R
2893 conflicts involving multiple reductions.
2894 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2895 set for a state here or Bison will abort if it is reassigned on a
2896 later conflicted reduction in the same state.
2897 Similarly, don't finalize and assign the solved conflicts report here
2898 or it will be lost if it is reassigned on a later conflicted reduction
2899 in the same state.
2900 (set_conflicts): Instead, assign them both here after all S/R conflicts
2901 in the state have been fully examined.
2902 * src/print.c (shift_set): Rename to...
2903 (no_reduce_set): ... this.
2904 (print_reductions): Update for rename, and add %nonassoc error action
2905 tokens to no_reduce_set so that, when printing the first remaining
2906 reduction on an error action token, the reduction is enclosed in
2907 brackets.
2908 (print_results): Update for rename.
2909 * tests/conflicts.at (Solved conflicts report for multiple reductions
2910 in a state): New test case.
2911 (%nonassoc error actions for multiple reductions in a state): New test
2912 case.
2913
2914 * src/main.c (main): Don't depend on C99 features.
2915
10159d2a
JD
29162007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2917
2918 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
2919 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2920 uniwidth.
10159d2a 2921
953b3935
JD
29222007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2923
2924 * bootstrap (slurp): Create target directories that don't exist.
2925 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2926
6ce2d93a
JD
29272007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2928
2929 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2930 than item number.
2931 * closure.c (closure): Likewise.
2932 * state.h (reductions): Comment sorting of rules.
2933 (state): Comment sorting of items.
2934
ce3448d5
JD
29352007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2936
2937 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2938 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2939 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2940 definition in order to avoid Gnulib headers since we don't use config.h
2941 here.
2942 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2943 rather than AT_DATA so that config.h is included.
2944
8a86eef0
JD
29452007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2946
2947 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2948 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2949 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2950 and so that YYFPRINTF is guaranteed to be defined here.
2951
b1a81613
JD
29522007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2953
2954 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2955 with...
2956 (muscle_percent_define_check_values): ... this more helpful function.
2957 Again, it's not used yet, but it will be.
2958 * src/muscle_tab.h: Likewise.
2959
71b61d4d
JD
2960 Improve some comments in parser table construction.
2961 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2962 (generate_states): Don't mention ruleset, which is internal to closure.
2963 * src/closure.c (closure): Explain sorting of core and itemset, which
2964 is required for this function to behave correctly.
2965 * src/closure.h (closure): Mention sorting.
2966
2a6b783d
JD
29672007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2968
2969 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2970 move the check for disabled transitions to an aver since conflict
2971 resolution hasn't happened yet.
2972
2973 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2974 labels a state as inconsistent just because it has error transitions.
2975 The original form of this check appeared in revision 1.1 of lalr.c,
2976 which was committed on 1991-12-21. Now (at least), changing the
2977 consistency label on such a state appears to have no useful effect in
2978 any of the places it is examined, which I enumerate below. The key
2979 point to understanding each item in this enumeration is that a state
2980 with an error transition is labelled consistent in the first place only
2981 if it has no rules, so the check cannot matter for states that have
2982 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2983 to try to identify its conflicts, and a state must have *rules* to have
2984 conflicts. (2) Labelling a state as inconsistent will affect how
2985 action_row sets the default *rule* for the state. (3) Labelling a
2986 state as inconsistent will cause build_relations to add lookback edges
2987 to *rules* in that state.
2988 * src/state.h (struct state): Word the comment for member consistent
2989 more carefully.
2990
14462c2b
JD
29912007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2992
2993 Don't depend on C99 features.
2994 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2995 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2996 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2997 * src/state.c (state_mark_reachable_states): Fix for-loop.
2998 (state_remove_unreachable_states): Fix for-loop.
2999
3000 Don't widen struct state with member reachable just to temporarily
3001 record reachability. Instead, use a local bitset.
3002 * src/state.h (struct state): Remove member.
3003 * src/state.c (state_new): Don't initialize it.
3004 (state_mark_reachable_states): Rename to...
3005 (state_record_reachable_states): ... this, and use bitset.
3006 (state_remove_unreachable_states): Use bitset.
3007
5a43d418
JD
30082007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3009
3010 * src/Makefile.am (yacc): Quote target action commands properly so
3011 that the yacc script isn't corrupt. Reported by Hans Aberg at
3012 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3013
0c650a20
JD
3014 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3015 the case of pure parsers. Reported by Frans Englich at
3016 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3017 * THANKS: Add Frans Englich.
3018
61fee93e
JD
3019 * NEWS (2.3a+): In the %code entry, reference section `Bison
3020 Declaration Summary' from the manual now since the %code summary has
3021 moved there.
3022 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3023 in the rules section must be terminated by semicolons.
3024
f124d423
JD
30252007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3026
3027 Extend the front-end API for %define variables to more completely
3028 mirror the back-end. This will be useful in the future.
3029 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3030 Update comments to mention the new front-end counterparts of these
3031 macros.
3032 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3033 for muscle_string_decode and muscle_location_decode.
3034 (muscle_string_decode): New static function.
3035 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3036 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3037 functions.
3038 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3039 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3040 implementation more closely.
3041 (muscle_percent_define_invalid_value): New function.
3042 * src/muscle_tab.h (muscle_percent_define_get,
3043 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3044 Prototype.
3045
75ad86ee
JD
30462007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3047
3048 * NEWS (2.3a+): Mention yesterday's state-removal change.
3049 (2.3a): Remove the %language entry, which was added after 2.3a.
3050 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3051 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3052 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3053 tests/existing.at: Update copyright date.
3054
5967f0cf
JD
30552007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3056
3057 If conflict resolution makes states unreachable, remove those states,
3058 report rules that are then unused, and don't report conflicts in those
3059 states.
3060 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3061 New global function.
3062 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3063 function.
3064 * src/main.c (main): After conflict resolution, remove the unreachable
3065 states and update all data structures that reference states by number.
3066 * src/state.c (state_new): Initialize each state's reachable member to
3067 false.
3068 (state_mark_reachable_states): New static function.
3069 (state_remove_unreachable_states): New global function.
3070 * src/state.h (struct state): Add member bool reachable.
3071 (state_remove_unreachable_states): Prototype.
3072 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3073 New test case.
3074 * tests/existing.at (GNU pic Grammar): Update test case output now that
3075 an unused rule is discovered.
3076
b09f4f48
JD
30772007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3078
3079 Minor code cleanup in parser table construction.
3080 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3081 (new_itemsets, save_reductions): Update for rename to nitemset.
3082 * src/closure.c (nritemset): Rename to...
3083 (nitemset): ... this since the "r" appears to meaningless and isn't
3084 used in the comments.
3085 (closure): Update for rename.
3086 * src/closure.h (nritemset): Update extern to...
3087 (nitemset): ... this.
3088 * src/lalr.c (LA): Fix a typo in comments.
3089 * src/print.c (print_core): Update for rename to nitemset.
3090 * src/print_graph.c (print_graph): Likewise.
3091 * src/state.h: Fix some typos in header comments.
3092
bbb44d83
PE
30932007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3094
9b33de72
PE
3095 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3096 still sticks to ASCII. Sorry!
3097
bbb44d83
PE
3098 * README-hacking: New file, taken mostly from coreutils, with changes
3099 for Bison. Contains much of the contents of:
3100 * README-cvs: Remove.
3101 * bootstrap: Sync from gnulib.
3102 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3103 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3104
29553547
JD
31052007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3106
3107 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3108 Setzer.
3109 (Java Differences): Fix some typos.
3110 * THANKS: Add Sebastian Setzer.
3111
01b477c6
PB
31122007-03-07 Paolo Bonzini <bonzini@gnu.org>
3113
730739e4
AD
3114 * data/java.m4 (b4_single_class_if): Remove.
3115 (b4_abstract_if): Look at "%define abstract".
3116 (b4_lexer_if): New.
3117 (b4_union_name): Rename...
3118 (b4_yystype): ... to this. Map to "%define stype".
3119 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3120 b4_maybe_throws): Fix quoting.
3121 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3122 * data/lalr1.java (Lexer interface): Always define.
3123 (Lexer interface within parser class): Remove.
3124 (YYLexer class): New, used when "%code lexer" is present.
3125 (constructor): When "%code lexer" is used, pass %lex-param
3126 to the lexer constructor.
3127 (yylex, yyparse): Remove %lex-param from method invocations
3128 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3129
3130 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3131 abstract". Rename "%define union_name" to "%define stype".
3132 Rename method names according to previous patch.
3133 (Java Scanner Interface): Describe "%code lexer" instead of
3134 "%pure-parser" and "%define single_class".
3135 (Java Differences): Mention "%code lexer".
3136
3137 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3138 Include scanner here, using macros from tests/local.at.
3139 (AT_DATA_CALC_Y): Remove final argument.
3140 (_AT_CHECK_JAVA_CALC): Likewise.
3141 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3142 of %locations and %error-verbose.
3143 (main): Test with and without %lex-param.
3144 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3145 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 3146
122bea3a
JMG
31472007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3148
3149 DJGPP spefic issue. Inhibit the use of disallowed characters for
3150 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3151 and concern testsuite case 46.
3152 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3153 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3154 * djgpp/config.bat: Inhibit the use of disallowed characters.
3155
9611cfa2
JD
31562007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3157
3158 Miscellaneous %define and %code cleanup.
3159 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3160 values are interpreted.
3161 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3162 documentation a little more.
3163 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3164 muscle_percent_define_insert, muscle_percent_code_grow): New
3165 functions/macros.
3166 * src/muscle_tab.h (muscle_percent_define_insert,
3167 muscle_percent_code_grow): Prototype.
3168 * src/parse-gram.y (prologue_declaration): Use
3169 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3170 %define and %code directives.
3171
3172 Make it easy to share %define boolean variables between the front-end
3173 and back-end. Though not used yet, this will be useful in the future.
3174 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3175 Bison uses of names rather than just skeleton uses of names.
3176 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3177 b4_percent_define_skeleton_variables(VARIABLE) to
3178 b4_percent_define_bison_variables(VARIABLE).
3179 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3180 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3181 b4_percent_code_bison_qualifiers(QUALIFIER).
3182 (b4_check_user_names_wrap): Update for renames.
3183 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3184 muscle_percent_define_default): New functions mimicking
3185 b4_percent_define_flag_if and b4_percent_define_default.
3186
3187 For %define variables, report locations for invalid values and
bbb44d83 3188 redefinitions.
9611cfa2
JD
3189 * data/bison.m4 (b4_percent_define_flag_if): Read
3190 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3191 value for VARIABLE.
3192 (b4_percent_define_default): Save a special location in
3193 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3194 must later be reported as invalid.
3195 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3196 functions.
3197 (muscle_percent_define_insert): Record the location of VARIABLE in
3198 muscle percent_define_loc(VARIABLE), and use it to report the previous
3199 location for a redefinition.
3200 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3201 (muscle_percent_define_default): Update like b4_percent_define_default.
3202 (muscle_grow_user_name_list): Rename to...
3203 (muscle_user_name_list_grow): ... this for consistency and use
3204 muscle_location_grow.
3205 * src/muscle_tab.h (muscle_location_grow): Prototype.
3206 * tests/input.at (%define errors): Update expected output.
3207 * tests/skeletons.at (%define boolean variables: invalid skeleton
3208 defaults): New test case.
3209
0bf92491
JD
32102007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3211
3212 * src/print.c (lookahead_set, state_default_rule): Remove.
3213 (print_reductions): Replace state_default_rule invocation with
3214 equivalent use of yydefact, which was computed in token_actions in
3215 tables.c.
3216 (print_results): Don't allocate lookahead_set.
3217
d3b12988
PB
32182007-02-27 Paolo Bonzini <bonzini@gnu.org>
3219
3220 * data/lalr1.java: Prefix all private members with yy.
3221
f57a7536
JD
32222007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3223
3224 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 3225 Sebastien Fricker at
f57a7536 3226 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 3227 * THANKS: Add Sebastien Fricker.
f57a7536
JD
3228 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3229 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3230 accept a variable number of arguments.
3231
6404a5bf
JD
32322007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3233
3234 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3235
e4e09639
JMG
32362007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3237
3238 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3239 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3240 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3241
d7e0a1a7
PE
32422007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3243
3244 Undo my 2007-02-07 change, switching back to the c-strcase module
3245 introduced in the 2007-02-03 change. Bruno Haible reported that
3246 the 2007-02-07 change would be dangerous in Turkish if we add a
3247 language whose name contains "i", since "i" is not lowercase "I"
3248 in Turkish.
3249 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3250 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3251 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3252 * m4/.cvsignore: Remove strcase.m4.
3253 * src/getargs.c: Revert 2007-02-07 change, as follows.
3254 Include c-strcase.h.
3255 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3256
deee93a1
JD
32572007-02-11 Bruno Haible <bruno@clisp.org>
3258
3259 Enable the Java related testsuite tests when the only Java compiler
3260 found is a gcj < 4.3. Discussed at
3261 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3262 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3263
574add85
JD
32642007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3265
3266 * data/Makefile.am: Update copyright date.
3267 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3268 yypstate_new returns NULL.
3269 (yypstate_new): Return NULL if malloc does.
3270 * src/reader.c (packgram): Move translation of rule actions from the
3271 beginning of packgram to...
3272 (check_and_convert_grammar): ... here right before packgram is invoked
3273 so it's easier to write more complete comments, and remove redundant
3274 code.
3275
e785ccf7
JD
32762007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3277
3278 As in semantic actions, make @$ in %initial-action, %destructor, and
3279 %printer imply %locations.
3280 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3281 scanning @$.
3282 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3283 (@$ in %initial-action implies %locations,
3284 @$ in %destructor implies %locations,
3285 @$ in %printer implies %locations): ... these new test cases.
3286
1cfe1ed7
PE
32872007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3288
3289 Undo most of the 2007-02-03 change, switching to the strcase module
3290 now that gnulib strcase has been fixed.
3291 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3292 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3293 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3294 * m4/.cvsignore: Add strcase.m4.
3295 * src/getargs.c: Revert 2007-02-03 change, as follows.
3296 Don't include c-strcase.h.
3297 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3298 strcasecmp has "unspecified behavior" outside the POSIX locale,
3299 but it works fine in practice if at least one argument is ASCII,
3300 as is the case in Bison.
3301
0049ec86
PB
33022007-02-07 Paolo Bonzini <bonzini@gnu.org>
3303
3304 * tests/java.at: Skip tests if only one of javac/java is present.
3305 Reported by Joel E. Denny.
3306 * tests/atlocal.in: Adjust copyright years.
3307
33082007-02-05 Paolo Bonzini <bonzini@gnu.org>
3309
3310 * data/lalr1.java (Stack): Work around old verifiers that disallow
3311 access to the private fields of an inner class, from the outer class.
3312 We can make Stack's fields public because user code doesn't have access
3313 to the instance of Stack used by parse(). Reported by Paul Eggert.
3314
2c2b7220
PE
33152007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3316
3317 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3318 the right spot for these files?
3319 * bootstrap.conf (gnulib_modules): Add c-strcase.
3320 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3321 c-strncasecmp.c.
3322 * src/getargs.c: Include c-strcase.h.
3323 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3324 to avoid unspecified behavior.
3325
b2b81dae
JD
33262007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3327
3328 * doc/bison.texinfo (Decl Summary): Correct typo.
3329
c1d19e10
PB
33302007-01-30 Paolo Bonzini <bonzini@gnu.org>
3331
3332 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3333 Complain if the value does not match empty, "true" or "false".
3334 * data/c++.m4: Adjust default definitions of %define variables.
3335 * data/java.m4: Adjust default definitions of %define variables.
3336 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3337 to above behavior.
3338 * tests/input.at (Boolean %define variables): Test new behavior.
3339
8405b70c
PB
33402007-01-29 Paolo Bonzini <bonzini@gnu.org>
3341
3342 * NEWS: Mention java.
3343 * TODO: Remove things that are done.
3344 * bootstrap.conf: Add javacomp-script and javaexec-script.
3345 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3346
3347 * data/Makefile.am: Add new files.
3348 * data/java-skel.m4: New.
3349 * data/java.m4: New.
3350 * data/lalr1.java: New.
3351
3352 * doc/bison.texinfo: Put "A Complete C++ Example" under
3353 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3354 under Other Languages.
3355
3356 * src/getargs.c (valid_languages): Add Java.
3357 * src/getargs.h (struct bison_language): Update size of string fields.
3358
3359 * tests/Makefile.am: Add java.at.
3360 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3361 * tests/java.at: New.
3362 * tests/testsuite.at: Include it.
3363
3eb82471
JD
33642007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3365
3366 Clean up.
3367 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3368 at_directive_argv arguments so these no longer have to be global
3369 variables. Also, update the implementation for the following changes.
3370 (fail_for_at_directive_too_many_args,
3371 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3372 (at_directive_name): Remove as at_directive_argv[0] will be used for
3373 this now.
3374 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3375 for the directive name.
3376 (at_directive_argc, at_directive_argv): Make these local within
3377 skel_lex instead of global.
3378 (INITIAL): Update directive start action for above changes.
3379 (SC_AT_DIRECTIVE_ARG): Rename to...
3380 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3381 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3382 (scan_skel): Move yylex_destroy to...
3383 (skel_scanner_free): ... here.
3384 * tests/skeletons.at (installed skeleton file name): Rename to...
3385 (installed skeleton file names): ... this.
3386
148d66d8
JD
33872007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3388
3389 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3390 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3391 Summary" not "Directives".
3392 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3393 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3394 since the former is now the more complete one.
3395 (Prologue Alternatives): Likewise and do the same for %defines.
3396 (Table of Symbols): Add summary of %code, add summary of %define, and
3397 move full %code documentation to...
3398 (Decl Summary): ... here for consistency with other entries in these
3399 sections.
3400 Move %define entry in order to keep this list alphabetized.
3401 Reword %define entry a little to put less emphasis on the skeleton
3402 concept, which most users shouldn't have to think about.
3403
665f0c24
PE
34042007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3405
3406 Adjust to recent gnulib changes.
3407 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3408 Add string.h, string_.h, unistd_.h, wchar_.h.
3409 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3410 * src/system.h: Don't include <stpcpy.h>; this is now done by
3411 <string.h>.
3412
592d0b1e
PB
34132007-01-23 Paolo Bonzini <bonzini@gnu.org>
3414
3415 Simplify implementation of unqualified %code, implement macros for
3416 uniform treatment of boolean %define flags. Document %define.
3417 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3418 b4_percent_code_ifdef): New.
3419 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3420 * data/c++.m4: Define default value for global_tokens_and_yystype.
3421 * data/glr.cc: Likewise.
3422 * data/location.cc: Use b4_percent_define_flag_if.
3423
148d66d8 3424 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
3425
3426 * src/parse-gram.y (Unqualified %code): Change muscle name to
3427 b4_percent_code().
3428 (content.opt): Default to empty.
3429
a7867f53
JD
34302007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3431
3432 Implement support for relative and absolute skeleton file names.
3433 Discussed starting at
3434 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3435 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3436 (Bison Options): Document in --skeleton entry.
3437 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3438 full_skeleton can't necessarily hold all of pkgdatadir.
3439 If the specified skeleton file name contains a `/', don't prepend
3440 pkgdatadir.
3441 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3442 file name contains a `/', prepend the grammar file directory.
3443 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3444 * skeletons.at: New file.
3445 (relative skeleton file names): New test case.
3446 (installed skeleton file names): New test case.
3447 * tests/testsuite.at: Include skeletons.at.
3448
3449 * bootstrap: Update copyright to 2007.
3450
830c9b18
PB
34512007-01-17 Paolo Bonzini <bonzini@gnu.org>
3452
3453 * bootstrap: Remove occurrences of .#bootmp from the files.
3454
a8c2e813
AD
34552007-01-17 Akim Demaille <akim@epita.fr>
3456
3457 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3458 nonterminals.
3459 Use per-type %printer.
3460
279cabb6
JD
34612007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3462
3463 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3464 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3465 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3466 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3467 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3468 tests/glr-regression.at, tests/input.at, tests/local.at,
3469 tests/output.at, tests/torture.at: Update copyright to 2007.
3470
bb32f4f2
AD
34712007-01-16 Akim Demaille <akim@epita.fr>
3472
3473 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3474 error code.
3475 (Calc++ Scanner): Exit with failure if we can't open the input
3476 file.
3477 Accept "-" standing for stdin.
3478 (Calc++ Top Level): Print the result only if the parsing was
3479 successful.
3480
7cff04b5
AD
34812007-01-16 Akim Demaille <akim@epita.fr>
3482
3483 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3484
a4e25e1d
JD
34852007-01-15 Paolo Bonzini <bonzini@gnu.org>
3486 and Joel E. Denny <jdenny@ces.clemson.edu>
3487
3488 Clean up %define and %code implementation in M4 some. Most
3489 importantly, rename all related macros to be in the b4_percent_define
3490 and b4_percent_code namespaces. Also, complete support for `.' in
3491 %define variable names and %code qualifiers.
3492 * data/bison.m4 (b4_check_user_names): Check for special
3493 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3494 m4_foreach loops.
3495 (b4_get_percent_define, b4_get_percent_code): Rename to...
3496 (b4_percent_define_get, b4_percent_code_get): ... these.
3497 Extend documentation with examples.
3498 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3499 b4_percent_define_skeleton_variables and
3500 b4_percent_code_skeleton_qualifiers.
3501 Expect any value for the %define variable `foo' to be stored in the
3502 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3503 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3504 expect any unqualified %code blocks to be stored in a macro named
3505 `b4_percent_code_unqualified'.
3506 Use m4_indir so that %define variable names and %code qualifiers can
3507 contain `.', which is allowed by the grammar parser.
3508 (b4_percent_define_default): New macro to set a default value for a
3509 %define variable.
3510 (m4_wrap): Update wrapped code, and fix some underquoting.
3511 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3512 Expect grammar uses of %define variables and %code qualifiers to be
3513 defined in b4_percent_define_user_variables and
3514 b4_percent_code_user_qualifiers.
3515 * data/c++.m4: Use b4_percent_define_default rather than
3516 m4_define_default. Fix some underquoting. Skeleton usage of %define
3517 variable define_location_comparison now implies skeleton usage of
3518 %define variable filename_type.
3519 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3520 data/push.c, data/yacc.c: Update macro names.
3521 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3522 muscle names.
3523
e37c665c
JMG
35242007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3525
3526 DJGPP specific issues.
3527
3528 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3529 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3530
7d2d521f
JD
35312007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3532
3533 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3534 run parsers in all tests so that Valgrind is invoked during
3535 maintainer-check-valgrind.
3536 (Duplicate representation of merged trees): Free all semantic values.
3537 (Duplicated user destructor for lookahead): Likewise.
3538
e0ac9b4b
JD
35392007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3540
3541 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3542 command-line prefix.
3543 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3544 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3545 miss Valgrind messages.
3546 (Exploding the Stack Size with Malloc): Likewise.
3547
78143faa
JD
35482007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3549
3550 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3551 locals. Reported by Juan Manuel Guerrero at
3552 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3553 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3554 Fix some indentation also.
3555 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3556 explaining this issue.
3557
7ecec4dd
JD
35582007-01-09 Paolo Bonzini <bonzini@gnu.org>
3559 and Joel E. Denny <jdenny@ces.clemson.edu>
3560
3561 Simplify union and prologue handling, and escape union and lex/parse
3562 params with digraphs.
3563 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3564 values to the empty string since these are no longer guaranteed
3565 initialized by the front-end.
3566 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3567 braces around b4_user_stype since this is no longer done by the
3568 front-end.
3569 * src/files.c, src/files.h (pre_prologue_obstack,
3570 post_prologue_obstack): Remove.
3571 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3572 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3573 with digraphs. This fixes lex params and parse params.
3574 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3575 * src/output.c (prepare): Remove muscle insertion of the prologues.
3576 (output): Remove freeing of pre_prologue_obstack and
3577 post_prologue_obstack.
3578 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3579 than prologue_augment for prologue parsing so you don't need prologue
3580 obstacks.
5c80250c
JD
3581 (grammar_declaration): For %union RHS, use `braceless' instead of
3582 "{...}" so that braces are already stripped and code is escaped with
3583 digraphs.
7ecec4dd
JD
3584 * src/reader.c (prologue_augment): Remove.
3585 (reader): Remove initialization of pre_prologue_obstack and
3586 post_prologue_obstack.
3587 * src/reader.h (prologue_augment): Remove.
3588
3589 * data/c.m4: Remove stray parenthesis.
3590
16dc6a9e
JD
35912007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3592
3593 Remove quotes from variables names in %define directives and from
3594 qualifiers in %code directives, and restrict the characters that are
3595 allowed in them to M4-friendly ones. For %define, continue to support
3596 the quoted form as a deprecated feature. Discussed starting at
3597 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3598 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3599 %code.
3600 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
3601 (Decl Summary): In %defines entry, update mention of `%code requires'
3602 and `%code provides'.
16dc6a9e
JD
3603 (C++ Location Values): Update %define uses.
3604 (Calc++ Parser Interface): Likewise.
3605 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 3606 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
3607 * src/parse-gram.y (prologue_declaration): For %define variables, use
3608 `variable' instead of `STRING'.
3609 (grammar_declaration): For %code qualifiers, use `ID' instead of
3610 `STRING'.
3611 (variable): New nonterminal that takes an `ID' or a `STRING'.
3612 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3613 and %define uses.
3614 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3615 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3616 (%define errors): Update %define uses.
3617
e9813cd4
JD
36182007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3619
3620 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3621 instead of muscle_insert for %define values so that M4-special
3622 characters are replaced with digraphs.
3623 * tests/input.at (%define errors): Extend to check weird values.
3624
6afc30cc
JD
36252007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3626
3627 Instead of having skeletons declare all valid %define variables and
3628 %code qualifiers, provide macros that retrieve the associated values
3629 and build these lists automatically. Thus Bison will now warn when a
3630 variable or qualifier is not used by the skeleton in the current
3631 invocation regardless of whether it might sometimes be used by that
3632 skeleton in other invocations. Also, move all %define value macros to
3633 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3634 form, which is replaced by %code.
3635 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3636 (b4_check_user_names): ... this, and change the series of valid name
3637 arguments to a single list argument for names used in the skeleton
3638 similar to the existing list argument for names used in the grammar.
3639 Warn instead of complaining.
3640 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3641 values and %code code, to format %code code properly, and to build
3642 lists of all %define variables and %code qualifiers used in the
3643 skeleton: b4_skeleton_percent_define_variables and
3644 b4_skeleton_percent_code_qualifiers.
3645 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3646 Remove, and...
3647 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3648 the skeleton names lists can finish building first. In place of
3649 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3650 expect the lists b4_user_percent_define_variables and
3651 b4_user_percent_code_qualifiers.
3652 * data/c++.m4: Where setting default values for b4_parser_class_name,
3653 b4_location_type, b4_filename_type, b4_namespace, and
3654 b4_define_location_comparison, update their names to the
3655 b4_percent_define_ namespace.
3656 * data/glr.c: Don't use b4_check_percent_define_variables and
3657 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3658 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3659 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 3660 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
3661 * data/location.cc: Use b4_get_percent_define.
3662 * data/push.c: Don't use b4_check_percent_define_variables and
3663 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3664 * data/yacc.c: Likewise, and don't call m4_exit in
3665 b4_use_push_for_pull_if or m4_wrap code will never execute.
3666 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3667 Rename to...
3668 (muscle_grow_user_name_list): ... this for consistency with the
3669 terminology used in bison.m4.
3670 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3671 %define variable names, and rename muscle used_percent_define_variables
3672 to user_percent_define_variables.
3673 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3674 user_percent_code_qualifiers.
3675 (content): Remove.
3676 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3677 {CODE} form is no longer accepted.
3678 * tests/input.at (Reject bad %code qualifiers): Rename to...
3679 (Reject unused %code qualifiers): ... this, and update test output.
3680 (%define error): Update test output.
3681
7eb8a0bc
JD
36822007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3683
3684 Check for unrecognized %define variables similar to checking for
3685 unrecognized %code qualifiers. Check for redefined %define variables.
3686 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3687 generalizes...
3688 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3689 (b4_check_percent_define_variables): New, also wraps it.
3690 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3691 variables using b4_check_percent_define_variables.
3692 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3693 all those exercised in the test suite and all those listed in the
3694 `Default values' section of c++.m4. Are there others?
3695 * data/push.c, data/yacc.c: Declare no valid %define variables.
3696 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3697 similar to muscle_find, but it works even when the muscle stores a
3698 const value.
3699 (muscle_grow_used_name_list): New function for constructing the used
3700 name list muscles that b4_check_for_unrecognized_names requires.
3701 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3702 %define'd more than once. Define the b4_used_percent_define_variables
3703 muscle with muscle_grow_used_name_list.
3704 (grammar_declaration): Abbreviate %code code with
3705 muscle_grow_used_name_list.
3706 * tests/input.at (%define errors): New.
3707
3fc65ead
JD
37082007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3709
3710 Provide warn_at, complain_at, and fatal_at function callbacks to the
3711 skeletons, and use this for %code qualifier complaints.
3712 * data/bison.m4 (b4_error_at): New, invoked by...
3713 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3714 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3715 @fatal_at(...@) directives.
3716 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3717 qualifiers in b4_used_percent_code_qualifiers and to use
3718 b4_complain_at.
3719 * src/location.c, src/location.h (boundary_set_from_string): New global
3720 function.
3721 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3722 function.
3723 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3724 to b4_used_percent_code_qualifiers.
3725 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3726 function.
3727 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3728 (lineno): Rename to...
3729 (out_lineno): ... this so I don't misunderstand it again.
3730 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3731 here; these newlines are in the input but not the output file.
3732 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3733 (at_directive_perform): ... this new static function, and add handling
3734 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3735 directives.
3736 * tests/input.at (Reject bad %code qualifiers): Update test output with
3737 locations and extend.
3738
3739 * tests/output.at (Output file name: [, Output file name: ]): Remove
3740 bogus comment about these tests failing.
3741
1c7b7e1d
JD
37422007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3743
3744 Clean up b4_check_percent_code_qualifiers a little.
3745 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3746 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3747 documentation and add examples.
3748 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3749 qualifiers here.
3750
08af01c2
JD
37512007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3752
3753 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3754 unreliable -- especially when they're hidden inside another macro.
3755 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3756 data/c.m4: Remove m4_divert(-1).
3757 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3758 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3759 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 3760 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
3761 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3762 pushed and popped by m4sugar, should be first on the stack.
3763
3764 Provide warn, complain, and fatal function callbacks to the skeletons.
3765 This provides more flexibility than m4_fatal, improves the error
3766 message format, and captures messages for translation. Discussed
3767 starting at
3768 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3769 * data/bison.m4 (b4_error): New, invoked by...
3770 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3771 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3772 directives. Because these M4 macros might be called when the current
3773 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3774 the previous removal of uses of m4_divert, which caused trouble.
3775 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3776 m4_fatal to report unrecognized %code qualifiers.
3777 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3778 push parser requests.
3779 * data/glr.c: Use b4_complain instead of m4_fatal to report
3780 non-deterministic push parser requests.
3781 Update @output usage to @output(...@) form.
3782 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3783 report missing %defines. Update @output usage to @output(...@) form.
3784 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3785 @output(...@) form.
3786 * src/main.c (main): Invoke skel_scanner_free.
3787 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3788 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3789 obstack_for_string from flex-scanner.h.
3790 (YY_DECL): Use to declare skel_lex static.
3791 (decode_at_digraphs): Remove; now handled in the new
3792 SC_AT_DIRECTIVE_ARG start condition.
3793 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3794 functions.
3795 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3796 at_directive_argv): New static globals.
3797 (INITIAL): Use fail_for_invalid_at.
3798 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3799 recognize the start of a generalized `@directive(...@)' form and
3800 start...
3801 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3802 directive args (using the new obstack_for_string), to decode the
3803 contained @ diagraphs, and to perform the directive. It recognizes
3804 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3805 @output(...@).
3806 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3807 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3808 `@,'.
3809 (scan_skel): Initialize obstack_for_string on the first call.
3810 (skel_scanner_free): New function to free obstack_for_string.
3811 * tests/input.at (Reject bad %code qualifiers): Update test output.
3812
8e0a5e9e
JD
38132007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3814
3815 Consolidate the 4 prologue alternative directives (%code, %requires,
3816 %provides, and %code-top) into a single %code directive with an
3817 optional qualifier field. Discussed at
3818 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3819 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3820 alternatives.
3821 * doc/bison.texinfo (Prologue Alternatives): Update.
3822 (Decl Summary): Update to %code "requires" and %code "provides".
3823 (Calc++ Parser): Update to %code "requires".
148d66d8 3824 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
3825 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3826 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3827 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3828 which are skeleton-specific.
3829 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3830 declare what %code qualifiers it supports and to complain if any other
3831 qualifiers were used in the grammar.
3832 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3833 and b4_user_code([b4_percent_code_provides]) in place of
3834 b4_user_requires and b4_user_provides.
3835 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3836 Add b4_user_code([b4_percent_code_top]) and
3837 b4_user_code([b4_percent_code]).
3838 Invoke b4_check_percent_code_qualifiers.
3839 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3840 PERCENT_REQUIRES): Remove.
3841 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3842 %requires. Rewrite the %code RHS as the unqualified form defining the
3843 muscle b4_percent_code. Add another RHS for the qualified %code form,
3844 which defines muscles of the form b4_percent_code_QUALIFIER and the
3845 b4_used_percent_code_qualifiers muscle.
3846 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3847 PERCENT_REQUIRES): Remove.
3848 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3849 %code "requires" and %code "provides".
3850 * tests/input.at (Reject bad %code qualifiers): New.
3851
95021767
JD
38522007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3853
3854 Use the new code_props interface for destructors and printers.
3855 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3856 printer_location members, and change the type of the destructor and
3857 printer members to code_props.
3858 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3859 symbol_printer_get, semantic_type_destructor_set,
3860 semantic_type_printer_set, default_tagged_destructor_set,
3861 default_tagless_destructor_set, default_tagged_printer_set,
3862 default_tagless_printer_set): Use code_props in arguments and return
3863 types in place of char const * and location.
3864 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3865 since the locations are now contained in the return of
3866 symbol_destructor_get and symbol_printer_get.
3867 * src/output.c (symbol_destructors_output, symbol_printers_output):
3868 Replace with...
3869 (symbol_code_props_output): ... this to eliminate duplicate code.
3870 (output_skeleton): Update to use symbol_code_props_output.
3871 * src/reader.c (symbol_should_be_used): Update use of
3872 symbol_destructor_get.
3873 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3874 Update uses of the various _destructor_set and _printer_set functions.
3875 * src/symtab.c: (default_tagged_destructor_location,
3876 default_tagless_destructor_location, default_tagged_printer_location,
3877 default_tagless_printer_location): Remove since we...
3878 (default_tagged_destructor, default_tagless_destructor,
3879 default_tagged_printer, default_tagless_printer): ... change the type
3880 of these to code_props.
3881 (symbol_new, semantic_type_new, symbol_destructor_set,
3882 semantic_type_destructor_set, symbol_destructor_get,
3883 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3884 symbol_check_alias_consistency, default_tagged_destructor_set,
3885 default_tagless_destructor_set, default_tagged_printer_set,
3886 default_tagless_printer_set): Update.
3887 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3888 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3889 code_props members.
3890 (symbol_print): Use SYMBOL_CODE_PRINT.
3891
f6857bbf
JD
38922007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3893
3894 Use the new code_props interface for rule actions.
3895 * src/symlist.h (symbol_list): Replace action, action_location, and
3896 used members with a code_props action_props member.
3897 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3898 grammar_midrule_action, grammar_current_rule_merge_set,
3899 grammar_current_rule_symbol_append, packgram): Update.
3900 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3901 * src/scan-code.l (handle_action_dollar): Update.
3902 (translate_rule_action): Remove, no longer used.
3903 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3904
7c0c6181
JD
39052007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3906
3907 Use the new code_props interface in parse-gram.y.
3908 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3909 Update all uses of translate_* functions to use the new code_props
3910 interface and to use gram_scanner_last_string_free and
3911 code_scanner_last_string_free where possible.
3912 (grammar_declaration): symbol_list_destructor_set and
3913 symbol_list_printer_set now perform the translation, so don't do it
3914 here. Use gram_scanner_last_string_free where possible.
3915 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3916 translate_code): Remove, no longer used.
3917 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3918 symbol_list_printer_set): Perform code translation here rather than
3919 depending on the caller to do so.
3920
3921 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3922 * src/scan-gram.h (gram_last_string): Remove declaration.
3923 * src/scan-gram.l (last_string): Declare it static.
3924
28e52c0d
JD
39252007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3926
3927 Encapsulate code properties and related functionality for the various
3928 destructors, printers, and actions into a code_props structure and
3929 interface. This patch merely implements code_props in scan-code.h and
3930 scan-code.l. Future patches will rewrite other modules to use it.
3931 Discussed starting at
3932 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3933 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3934 consistently initialize const structs that have an empty location
3935 field.
3936 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3937 to ensure consistency.
3938 * src/scan-code.h (code_props): New structure.
3939 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3940 function, macro, and const global variable for initializing a
3941 code_props with no code.
3942 (code_props_plain_init, code_props_symbol_action_init,
3943 code_props_rule_action_init, code_props_translate_code): The rest of
3944 the new code_props functional interface. Among other things, the init
3945 functions set the code_props kind field so that
3946 code_props_translate_code will know whether to behave like
3947 translate_symbol_action, translate_rule_action, or translate_code.
3948 These old translate functions must remain until all other modules are
3949 updated to use the new code_props interface.
3950 (code_scanner_last_string_free): New function similar to
3951 gram_scanner_last_string_free.
3952 (code_scanner_free): Add documentation.
3953 * src/scan-code.l: Implement the new interface.
3954 (code_lex): Make it static, add a code_props* argument, and remove the
3955 rule argument.
3956 (last_string): New static global similar to the one in scan-gram.l.
3957 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3958 instead of rule.
3959 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3960 code_props since Bison may one day use this information for destructors
3961 and printers.
3962 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3963 (handle_action_dollar): Use symbol_list_n_get and set used flag
3964 directly since symbol_list_n_used_set is removed.
3965 (translate_action): Add a code_props* argument and remove the rule,
3966 action, and location arguments. Pass the code_props* on to code_lex.
3967 (translate_rule_action, translate_symbol_action, translate_code):
3968 Rewrite as wrappers around the new code_props interface.
3969 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3970 it would eventually need to break the encapsulation of code_props.
3971
96034983
JD
39722007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3973
3974 * etc/.cvsignore: New.
3975
945e396c
JD
39762007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3977
3978 Add maintainer-push-check to run maintainer-check using push parsing in
3979 place of pull parsing where available.
3980 * Makefile.am (maintainer-push-check): New.
3981 * data/bison.m4 (b4_use_push_for_pull_if): New.
3982 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3983 appropriately based on their existing values.
3984 (yypush_parse): Don't print push-parser-specific diagnostics if push
3985 parsing is being used in place of pull parsing.
3986 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3987 push.c.
3988 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3989 variable, and insert b4_use_push_for_pull_flag into muscles.
3990 * tests/Makefile.am (maintainer-push-check): New.
3991
7d596384
JD
39922006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3993
3994 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3995 (whether successful or failed) so that yypush_parse can be invoked
3996 again to start a new parse using the same yypstate.
3997 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3998 check multiple yypull_parse invocations on the same yypstate. For pull
3999 mode, extend to check multiple yyparse invocations.
4000 (Exploding the Stack Size with Alloca): Extend to try with
4001 %push-pull-parser.
4002 (Exploding the Stack Size with Malloc): Likewise.
4003
4004 * tests/calc.at (Simple LALR Calculator): Don't specify
4005 %skeleton "push.c" since %push-pull-parser implies that now.
4006 * tests/headers.at (export YYLTYPE): Don't check for the push
4007 declarations. Otherwise, this test case can't be used to see if push
4008 mode can truly emulate pull mode.
4009 * tests/input.at (Torturing the Scanner): Likewise.
4010 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4011 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4012 AT_YACC_IF, which now includes the case of push mode since %skeleton
4013 need not be used for push mode. This will be more intuitive once
4014 push.c is renamed to yacc.c.
4015
7172e23e
JD
40162006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4017
4018 For push mode, convert yyparse from a macro to a function, invoke yylex
4019 instead of passing a yylexp argument to yypull_parse, and don't
4020 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4021 Discussed starting at
4022 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4023 * data/bison.m4 (b4_pull_if): New.
4024 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4025 * data/push.c: Improve M4 quoting a little.
4026 (b4_generate_macro_args, b4_parenthesize): Remove.
4027 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4028 any time a pull parser is requested.
4029 Don't #define this as a wrapper around yypull_parse. Instead, when
4030 both push and pull are requested, make it a function that does that
4031 same thing.
4032 (yypull_parse): If there's a b4_prefix, #define this to
4033 b4_prefix[pull_parse] when both push and pull are requested.
4034 Don't define this as a function unless both push and pull are
4035 requested.
4036 Remove the yylexp argument and hard-code yylex invocation instead.
4037 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4038 %push-parser.
4039 * src/getargs.c (pull_parser): New global initialized to true.
4040 * getargs.h (pull_parser): extern it.
4041 * src/output.c (prepare): Insert pull_flag muscle.
4042 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4043 (prologue_declaration): Set both push_parser and pull_parser = true for
4044 %push-pull-parser. Set push_parser = true and pull_parser = false for
4045 %push-parser.
4046 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4047 %push-parser since there's no backward-compatibility concern here.
4048 Scan %push-pull-parser.
4049 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4050 instead of %push-parser.
4051 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4052 prototype it in the module that calls yyparse.
4053 * tests/input.at (Torturing the Scanner): Likewise.
4054 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4055
2e7944cb
JD
40562006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4057
4058 Update etc/bench.pl. Optimize push mode a little (the yyn change
4059 deserves most of the credit).
4060 * Makefile.am (SUBDIRS): Add etc subdirectory.
4061 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4062 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4063 yytoken, yyval, and yyloc declarations to...
4064 (yyparse or yypush_parse): ... here to improve performance. For
4065 yypush_parse invocations after the first, be sure to assign yyn its old
4066 value again.
4067 (yypstate_new): Don't bother initializing the yyresult field since the
4068 initial value isn't used.
4069 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4070 remove the #define that, in push mode, set it to yyps->NAME.
4071 * etc/Makefile.am: New.
4072 * etc/bench.pl: Remove and build it instead from...
4073 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4074 "tests/bison" from the build directory by default rather than just
4075 invoking "bison" from $PATH.
4076 (calc_grammar): Update push parser code: don't declare yylval globally,
4077 don't define yyparse_wrapper, and don't #define yyparse.
4078 (bench_grammar): Update to check all working combinations of yacc.c,
4079 push.c, impure, pure, pull, and push.
4080
c3d50342
JD
40812006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4082
4083 For push mode, add pull wrappers around yypush_parse.
4084 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4085 (yypull_parse): New function wrapping yypush_parse.
4086 (yyparse): New #define wrapping yypull_parse.
4087 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4088 is declared.
4089 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4090 prototype yylex in the module that calls yyparse, and don't prototype
4091 yyparse there. Otherwise, the yyparse expansion won't compile.
4092 * tests/input.at (Torturing the Scanner): Likewise.
4093
94ebeba5
JD
40942006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4095
4096 Enable push parsers to operate in impure mode. Thus, %push-parser no
4097 longer implies %pure-parser. The point of this change is to move
4098 towards being able to test the push parser code by running the entire
4099 test suite as if %push-parser had been declared.
4100 * data/push.c (yypush_parse): For impure mode, remove the
4101 yypushed_char, yypushed_val, and yypushed_loc arguments.
4102 Instead, declare these as local variables initialized to the global
4103 yychar, yylval, and yylloc.
4104 For the first yypush_parse invocation only, restore the initial values
4105 of these global variables when it's time to read a token since they
4106 have been overwritten.
4107 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4108 %push-parser.
4109 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4110 %pure-parser along with %push-parser since this test case was designed
4111 for pure push parsers.
4112 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4113 (AT_YACC_OR_PUSH_IF): New.
4114 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4115 add a note that it's still wrong for some cases (as it has been for a
4116 while).
4117 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4118 %push-parser no longer implies %pure-parser.
4119
a0633178
JD
41202006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4121
4122 Remove some unnecessary differences between the pull parser code and
4123 the push parser code. This patch enables yynerrs in push mode.
4124 * data/push.c: Reformat M4 a little.
4125 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4126 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4127 because push mode is on. Instead, if pure mode is on, move yynerrs
4128 to...
4129 (b4_declare_parser_state_variables): ... here.
4130 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4131 to yyps->NAME so it can be used in yypush_parse.
4132 (yypush_parse): Don't omit uses of yynerrs in push mode.
4133
8646b6a3
JD
41342006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4135
4136 Fix bug such that the first pushed token's value and location are
4137 sometimes overwritten (sometimes by %initial-action) before being used.
4138 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4139 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4140 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4141 more closely mimic the pull parser logic.
4142 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4143 time to read a token, which is after any initialization of yylval and
4144 yylloc.
4145 (gottoken): Rename label to...
4146 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4147 user namespace.
4148
9baf4d74
JD
41492006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4150
4151 Rearrange initialization of the parser state variables so that the
4152 skeleton doesn't have to have a copy for pull mode and another for push
4153 mode. This patch also fixes at least a bug such that yylloc was not
4154 initialized (with b4_location_initial_line and
4155 b4_location_initial_column) upon calling yypush_parse. However, that
4156 initialization now overwrites the first token's location;
4157 %initial-action assigning @$ already did the same thing, and both bugs
4158 will be fixed in a later patch.
4159 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4160 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4161 yyss, yyvs, yyls, and yystacksize.
4162 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4163 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4164 yylsp.
4165 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4166 yyps->NAME so it can be used in yypush_parse.
4167 (yyparse or yypush_parse): For yypush_parse, don't print the
4168 "Starting parse" diagnostic for invocations after the first.
4169 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4170 yypush_parse, only do it for the first invocation.
4171 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4172 initialization to occur in yypush_parse but only on the first
4173 invocation.
4174
23522164
JD
41752006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4176
4177 * data/push.c: Add CPP guards around push parser declarations in both
4178 the header and the code file.
4179 In the code file, move the push parser declarations to the same place
4180 they appear in the header file.
4181 Clean up the M4 some, especially the inconsistent underquoting in
4182 some b4_c_function_def and b4_c_function_decl uses.
4183
bb010fe5
JD
41842006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4185
4186 Encapsulate the push parser state variables into an M4 macro so the
4187 push skeleton doesn't have to list them again for pull mode's yyparse.
4188 For push mode, remove yypush_parse's local equivalents of these
4189 variables to eliminate unnecessary copying between the two sets at
4190 run-time. This patch also fixes at least a bug related to multiple
4191 %initial-action invocations in push mode.
4192 * data/push.c (b4_declare_parser_variables): Rename to...
4193 (b4_declare_scanner_communication_variables): ... this for clarity and
4194 update both uses.
4195 (b4_declare_yyparse_variables): Remove and move its contents to the one
4196 spot where it was invoked.
4197 (b4_declare_parser_state_variables): New macro containing the parser
4198 state variables required by push mode.
4199 (struct yypstate): Replace all fields but yynew with
4200 b4_declare_parser_state_variables.
4201 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4202 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4203 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4204 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4205 parser state variable declarations with
4206 b4_declare_parser_state_variables.
4207 Don't initialize parser state variables when calling yypush_parse since
4208 yypstate_new already does that.
4209 Invoke the user's initial action only upon the first yypush_parse
4210 invocation.
4211 Remove all code that copies between the local parser state variables
4212 and the yypstate.
4213
2d212f8c
JD
42142006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4215
4216 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4217 prevent a name collision in a future patch where these names will
4218 sometimes be #define'd.
4219 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4220 since it no longer has the same name as the existing argument.
4221 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4222
e6e704dc
JD
42232006-12-19 Paolo Bonzini <bonzini@gnu.org>
4224 and Joel E. Denny <jdenny@ces.clemson.edu>
4225
4226 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4227 that the argument is case-insensitive, and there's no `=' here.
4228 For the %skeleton entry, mention that %language is better.
4229 (Bison Options): Likewise for --language and --skeleton. Move the
4230 --skeleton entry so that the `Tuning the parser' section is sorted
4231 alphabetically on long options.
4232 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4233 %language directive in detail here; cross-reference the %language
4234 documentation instead.
4235 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4236 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 4237 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
4238 * examples/extexi (normalize): Instead of replacing every %require
4239 argument with the current Bison version, just substitute for
4240 `@value{VERSION}'. This guarantees that we're testing what actually
4241 appears in the documentation.
4242 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4243 rather than `@VERSION@'.
4244
0e021770
PE
42452006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4246
fd575f05
PE
4247 * NEWS: Reword the %language news a bit, and put it earlier.
4248
0e021770
PE
4249 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4250 Rewrite to simplify the logic.
4251 (language_argmatch): Likewise.
fd575f05
PE
4252 (program_name): We now own this var.
4253 * src/getargs.h (struct bison_language): Use char[] rather than
4254 const char *.
0e021770
PE
4255
4256 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4257 Java is supported.
4258 * src/complain.c (program_name): Remove decl; no longer needed.
4259 * src/main.c (program_name): Remove; now belongs to getargs.
4260
42612006-12-18 Paolo Bonzini <bonzini@gnu.org>
4262
4263 * NEWS: Document %language.
4264
4265 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4266
4267 * data/c-skel.m4, data/c++-skel.m4: New files.
4268 * data/glr.c: Complain on push parsers.
4269
4270 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4271 over %skeleton.
148d66d8 4272 (Decl Summary): Document %language and %skeleton.
0e021770
PE
4273 (Command line): Document -L.
4274
4275 * examples/extexi: Rewrite %require directive.
4276 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4277
4278 * src/files.c (compute_exts_from_gc): Look in language structure
4279 for .y extension.
4280 (compute_file_name_parts): Check whether .tab should be added.
4281 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4282 (language, skeleton_arg, language_argmatch): New.
4283 (long_options): Add --language.
4284 (getargs): Use skeleton_arg, add -L/--language.
4285 * src/getargs.h: Include location.h.
4286 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4287 * src/output.c (prepare): Pick default skeleton from struct language.
4288 Don't dispatch C skeletons here.
4289 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4290 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4291 * src/scan-gram.l ("%language"): New rule.
4292
4293 * tests/calc.at: Test %skeleton and %language.
4294 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4295 (AT_GLR_IF): Look for %skeleton "glr.cc".
4296 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4297 (AT_YACC_IF): Reject %language.
4298
5691bf57
PE
42992006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4300
db06f0ce
PE
4301 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4302 since it wasn't used; only the typedef name 'semantic_type' is needed.
4303 Also, omit trailing white space.
4304
5691bf57
PE
4305 * bootstrap: Sync from coreutils.
4306 (gnulib_extra_files): Add build-aux/announce.gen.
4307 (slurp): Adjust .gitignore files like .cvsignore files.
4308 * build-aux/announce-gen: Remove from CVS, since bootstrap
4309 now creates this.
4310
791934e4
JD
43112006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4312
4313 Make %push-parser imply %pure-parser. This fixes several bugs; see
4314 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4315 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4316 pure_parser = true.
4317 * data/push.c: Don't bother testing b4_push_if when deciding whether
4318 to expand b4_declare_parser_variables globally.
4319 (yypush_parse): Likewise in here.
4320
4321 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4322 (yy_reduce_print): Reformat M4 for readability.
4323
ee5abb37
JD
43242006-12-15 Bob Rossi <bob@brasko.net>
4325 and Joel Denny <jdenny@ces.clemson.edu>
4326
4327 * data/push.c (yypstate): Add typedef, and update all uses of
4328 struct yypstate to just yypstate.
4329 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4330
16ca01f9
JD
43312006-12-14 Bob Rossi <bob@brasko.net>
4332
4333 * data/push.c (yypush_parse): Declare prototype regardless of
4334 %locations option.
4335
ab8e7e1a
JD
43362006-12-14 Bob Rossi <bob@brasko.net>
4337
4338 * data/push.c (yyparse): Remove the prototype and the #define when in
4339 push-parser mode.
4340
9bf32be3
JD
43412006-12-13 Bob Rossi <bob@brasko.net>
4342
4343 * data/push.c (yypstate_init): Rename to...
4344 (yypstate_new): ... this and use b4_c_function_def.
4345 (yypstate_delete): New.
4346 (yypush_parse): Change parameters yynval and yynlloc to be const.
4347 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4348 yypstate_delete functions.
4349
f02e2948
JD
43502006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4351
4352 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4353 strange test case titles. Reported by Bob Rossi.
4354
38eb7751
PE
43552006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4356
4357 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4358 of potential ambiguities in GLR grammers.
4359
bd9d212b
JD
43602006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4361
4362 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4363 `bison ', use m4_index instead of m4_substr since chopping up a string
4364 containing M4-special characters causes problems here.
4365
4366 Fix a couple of bugs related to special characters in user-specified
4367 file names, and make it easier for skeletons to compute output file
4368 names with the same file name prefix as Bison-computed output file
4369 names.
4370 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4371 b4_parser_file_name and b4_spec_defines_file instead of
4372 @output_parser_name@ and @output_header_name@, which are now redundant.
4373 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4374 b4_parser_file_name, b4_spec_defines_file, and the new
4375 @basename(FILENAME@) instead of @output_parser_name@ and
4376 @output_header_name@, which inappropriately escaped the file names as
4377 C string literals.
4378 * src/files.c (all_but_ext): Remove static qualifier.
4379 (compute_output_file_names): Move `free (all_but_ext)' to...
4380 (output_file_names_free): ... here since all_but_ext is needed later.
4381 * src/files.h (all_but_ext): Extern.
4382 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4383 exactly what MUSCLE_INSERT_STRING used to do.
4384 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4385 characters are escaped properly.
4386 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4387 all_but_ext.
4388 For pkgdatadir muscle, maintain previous functionality by using
4389 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4390 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4391 digraphs would never be expanded. Hopefully no one has M4-special
4392 characters in his Bison installation path.
4393 * src/scan-skel.l: Don't parse @output_header_name@ and
4394 @output_parser_name@ anymore since they're now redundant.
4395 In @output, use decode_at_digraphs.
4396 Parse a new @basename command that invokes last_component.
4397 (decode_at_digraphs): New.
4398 (BASE_QPUTS): Remove unused.
4399 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4400 (Output file name): New tests.
4401
3f7ca628
JD
44022006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4403
4404 Warn about output files that are generated by the skeletons and that
4405 conflict with other output files.
4406 * data/glr.c: Don't generate the header file here when glr.cc does.
4407 * src/files.c (file_names, file_names_count): New static globals.
4408 (compute_output_file_names): Invoke output_file_name_check for files
4409 not generated by the skeletons and remove existing checks.
4410 (output_file_name_check): New function that warns about conflicting
4411 output file names.
4412 (output_file_names_free): Free file_names.
4413 * src/files.h (output_file_name_check): Declare.
4414 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4415 the skeletons.
4416 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4417 (Conflicting output files): New tests.
4418
178e123e
PE
44192006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4420
4421 * doc/bison.texinfo: Fix a couple of typos.
4422
44232006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
4424
4425 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4426 Rename to...
4427 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4428 update all uses.
4429 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4430 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4431 local pv.
4432 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4433 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4434
ea17f233
JD
44352006-12-07 Bob Rossi <bob@brasko.net>
4436 and Joel Denny <jdenny@ces.clemson.edu>
4437
4438 * data/push.c (yypvarsinit): Change return type from void* to struct
4439 yypvars*. No longer cast to void* on return.
4440 (struct yypvars): Remove yylen since it need not be remembered between
4441 yypushparse invocations.
4442 (yypushparse): Don't copy between yylen and pv->yylen.
4443
55a30bda
JD
44442006-12-05 Bob Rossi <bob@brasko.net>
4445
4446 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4447 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4448 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4449 (struct yypvars): Remove b4_declare_parser_variables.
4450 (yypvarsinit): Remove init code for removed variables.
4451 (global scope): Do not declare b4_declare_parser_variables if
4452 push or pure mode.
4453 (yypushparse): Add b4_declare_parser_variables.
4454 Init new local variables, and remove init code for removed
4455 yypvars variables.
4456 (yyparse): Delete.
4457 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4458 and yyparse for other modes.
4459 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4460 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4461 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4462 (AT_PURE_LEX_IF): True if pure or push parser.
4463
85894313
JD
44642006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4465
4466 Document Yacc prologue alternatives and default %destructor's and
4467 %printer's as experimental. Don't mention Java yet. Discussed at
4468 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4469 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4470 (2.3a): Annotate this entry to say the old forms of these features were
4471 also experimental.
4472 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 4473 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
4474 of Java (we'll want this back eventually).
4475
02975b9a
JD
44762006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4477
4478 Support a file name argument to %defines. Deprecate `=' in
4479 %file-prefix, %name-prefix, and %output. Discussed at
4480 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4481 * NEWS (2.3a+): Mention.
148d66d8 4482 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
4483 form of %defines, and remove `=' from entries for %file-prefix,
4484 %name-prefix, and %output.
4485 * src/parse-gram.y (prologue_declaration): Implement.
4486 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4487 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4488 all but one occurrence of %name-prefix.
4489 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4490 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4491 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4492 occurrence of each of %file-prefix and %output. Add check for %defines
4493 with argument.
4494 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4495 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4496 Remove the `=' from %output.
4497
287b314e
JD
44982006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4499
4500 Don't escape $ in test case titles since Autoconf 2.61 now does that
4501 correctly.
4502 * tests/actions.at (Default %printer and %destructor are not for error
4503 or $undefined): Here.
4504 (Default %printer and %destructor are not for $accept): Here.
4505 * tests/input.at (Invalid $n and @n): Here.
4506
3ebecc24
JD
45072006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4508
4509 Rename <!> to <>. Discussed starting at
4510 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4511 * NEWS (2.3a+): Update.
148d66d8 4512 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
4513 Update.
4514 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4515 * src/scan-gram.l (INITIAL): Implement.
4516 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4517 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4518 comment.
4519 * tests/actions.at (Default tagless %printer and %destructor,
4520 Default tagged and per-type %printer and %destructor,
4521 Default %printer and %destructor are not for error or $undefined,
4522 Default %printer and %destructor are not for $accept,
4523 Default %printer and %destructor for mid-rule values): Update.
4524 * tests/input.at (Default %printer and %destructor redeclared,
4525 Unused values with default %destructor): Update.
4526
26b8a438
JD
45272006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4528
4529 Don't let %prec take a nonterminal.
4530 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4531 token.
4532 * tests/input.at (%prec takes a token): New test checking that %prec
4533 won't take a nonterminal.
4534
07c39ae9
JD
45352006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4536
405d53b7
JD
4537 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4538 it was double-quoted.
07c39ae9
JD
4539 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4540 grammar is maintained with Bison's highest standards.
4541 * src/getargs.c: Fix some typos in Doxygen comments.
4542
580b8926
JD
45432006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4544
4545 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4546 later. Reported by Paul Eggert in
4547 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4548 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4549 * src/scan-code.l (translate_action): Don't bother invoking
4550 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4551 (code_scanner_free): Instead of invoking
4552 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4553 which frees more.
4554 * src/scan-gram.l (gram_scanner_free): Likewise.
4555 * src/scan-skel.l (scan_skel): Likewise.
4556
4502eadc
JD
45572006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4558
4559 * src/files.c (tr): Change return type to void.
4560 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4561 has been called previously for the same key.
4562 (muscle_find): Return storage instead of value so that
4563 --enable-gcc-warnings doesn't produce warnings that the return discards
4564 const. aver that the value and storage are the same since storage
4565 could potentially be NULL when value is not.
4566 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4567 same as 0.
4568
7746c8f6
PE
45692006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4570
4571 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4572 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4573 us a slightly cleaner distribution, and also works.
4574 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4575 gnulib changes.
4576
eb095650
PE
45772006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4578 and Paul Eggert <eggert@cs.ucla.edu>
4579
4580 Don't let Bison leak memory except when it complains.
4581 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4582 (spec_defines_file, dir_prefix): Now char *, not const char *,
4583 since they are freed.
4584 * src/files.c: Likewise.
4585 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4586 Likewise.
4587 (tr): Now operates in-place. All uses changed.
4588 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4589 values.
4590 (compute_file_name_parts, compute_output_file_names): Don't store
4591 read-only data in variables that will be freed.
4592 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4593 src_extension, and header_extension.
4594 (output_file_names_free): New public function to free
4595 spec_verbose_file, spec_graph_file, spec_defines_file,
4596 parser_file_name, and dir_prefix.
4597 * src/getargs.c (getargs): Don't store read-only data in variables that
4598 will be freed.
4599 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4600 (which previously existed but was unused), and quotearg_free.
4601 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4602 * src/muscle_tab.c: Likewise.
4603 (muscle_entry): Make the value char const *,
4604 and add a new storage member that is char * and can be freed.
4605 (muscle_entry_free): New private function.
4606 (muscle_init): Use it instead of free.
4607 (muscle_insert, muscle_grow): Update and use new storage member.
4608 (muscle_code_grow): Free the string passed to muscle_grow
4609 since it's not needed anymore.
4610 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4611 add a new `char *code' member.
4612 ("{...}"): Declare semantic type as code.
4613 * src/scan-code.h (translate_rule_action):
4614 (translate_symbol_action, translate_code, translate_action): Return
4615 `char const *' rather than `char *' since external code should not free
4616 these strings.
4617 * src/scan-code.l: Likewise.
4618 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4619 which is "{...}" in the parser.
4620 * tests/Makefile.am (maintainer-check-valgrind): Set
4621 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4622 Valgrind.
4623 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4624 complain.
4625 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4626 expecting a non-zero exit status sets --leak-check=summary and
4627 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4628 this case, and we don't want to hear about it.
4629
ac564be4
PE
46302006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4631
4632 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4633 instead of from the template, to simplify configuration a bit.
4634 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4635 and m4/wint_t.m4, as they are needed with the latest gnulib.
4636
17bd8a73
JD
46372006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4638
4639 Disable unset/unused mid-rule value warnings by default, and recognize
4640 --warnings=midrule-values to enable them. Discussed starting at
4641 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4642 * NEWS (2.3a+): Mention.
4643 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4644 warnings): Add entry for midrule-values subargument.
4645 * src/reader.c (symbol_should_be_used): Don't return true just because
4646 the value is a set/used mid-rule value unless
4647 --warnings=midrule-values was specified.
4648 * tests/input.at (Unused values, Unused values before symbol
4649 declarations): Run tests with and without --warnings=midrule-values.
4650
4651 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4652 than LIST_FREE directly.
4653
89eb3c76
JD
46542006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4655
4656 Finish implementing --warnings=error, which should not be implied by
4657 --warnings=all (or by its synonyms -W and --warnings without
4658 subarguments).
4659 * src/complain.c (set_warning_issued): New function to report that
4660 warnings are being treated as errors and to record an error if so.
4661 Invoke...
4662 (warn_at, warn): ... here.
4663 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4664 "error - warnings are errors" does not appear above "all - all of the
4665 above".
4666 (getargs): For -W and --warnings without subarguments, don't let
4667 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4668 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4669
ba7560e2
JD
46702006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4671
4672 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4673 empty subargument list. For example: `bison --warnings= parser.y'.
4674
31283fc3
JD
46752006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4676
4677 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4678 the parser header file so that gcc doesn't warn.
4679
12e35840
JD
46802006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4681
4682 Split the default %destructor/%printer into two kinds: <*> and <!>.
4683 Discussed starting at
4684 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4685 * NEWS (2.3a+): Mention.
4686 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4687 previous change today related to mid-rules.
148d66d8 4688 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 4689 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
4690 (TYPE_TAG_ANY): Add as <*>.
4691 (TYPE_TAG_NONE): Add as <!>.
4692 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4693 for <*> and <!>.
4694 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4695 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4696 * src/symlist.c (symbol_list_default_new): Split into tagged and
4697 tagless versions.
4698 (symbol_list_destructor_set, symbol_list_printer_set): Split
4699 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4700 SYMLIST_DEFAULT_TAGLESS.
4701 * src/symlist.h: Update symbol_list_default*_new prototypes.
4702 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4703 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4704 * src/symtab.c (default_destructor, default_destructor_location,
4705 default_printer, default_printer_location): Split each into tagged and
4706 tagless versions.
4707 (symbol_destructor_get, symbol_destructor_location_get,
4708 symbol_printer_get, symbol_printer_location_get): Implement tagged
4709 default and tagless default cases.
4710 (default_destructor_set, default_printer_set): Split each into tagged
4711 and tagless versions.
4712 * src/symtab.h: Update prototypes.
4713 * tests/actions.at (Default %printer and %destructor): Rename to...
4714 (Default tagless %printer and %destructor): ... this, and extend.
4715 (Per-type %printer and %destructor): Rename to...
4716 (Default tagged and per-type %printer and %destructor): ... this, and
4717 extend.
4718 (Default %printer and %destructor for user-defined end token): Extend.
4719 (Default %printer and %destructor are not for error or $undefined):
4720 Update.
4721 (Default %printer and %destructor are not for $accept): Update.
4722 (Default %printer and %destructor for mid-rule values): Extend.
4723 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4724 (Unused values with default %destructor): Extend.
4725
f91b1629
JD
47262006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4727
4728 Don't apply the default %destructor/%printer to an unreferenced midrule
4729 value. Mentioned at
4730 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4731 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4732 like $@n instead of just @n so that the default %destructor/%printer
4733 logic doesn't see them as user-defined symbols.
4734 (symbol_is_dummy): Check for both forms of the name.
4735 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4736 name for which the midrule value is referenced in any action.
4737 * tests/actions.at (Default %printer and %destructor for mid-rule
4738 values): New test.
4739 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4740 for change to dummy symbol names.
4741
519d0004
JD
47422006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4743
4744 Warn about unset midrule $$ if the corresponding $n is used.
4745 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4746 $n usage.
4747 (packgram): Before invoking grammar_rule_check on any rule, make sure
4748 all actions have already been scanned in order to set `used' flags.
4749 Otherwise, checking that a midrule's $$ is set will not always work
4750 properly because the midrule check must forward-reference the midrule's
4751 parent rule.
4752 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4753 warning.
4754
a501eca9
JD
47552006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4756
4757 More improvements to the documentation of the prologue alternatives:
4758 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4759 Bison manual.
4760 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4761 some text to clarify the relative importance of the new directives and
4762 to show how these directives may be viewed as code labels.
4763
2cbe6b7f
JD
47642006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4765
4766 Similar to the recently removed %before-header, add %code-top as the
4767 alternative to the pre-prologue. Mentioned at
4768 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4769 Also, let the prologue alternatives appear in the grammar section.
4770 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4771 (prologue_declaration): Move the existing prologue alternatives to...
4772 (grammar_declaration): ... here and add %code-top.
4773 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4774
4775 Clean up and extend documentation for the prologue alternatives.
4776 * NEWS (2.3a+): Describe prologue alternatives.
4777 * doc/bison.texinfo (Prologue): Move discussion of prologue
4778 alternatives to...
4779 (Prologue Alternatives): ... this new section, and extend it to discuss
4780 all 4 directives in detail.
148d66d8
JD
4781 (Table of Symbols): Clean up discussion of prologue alternatives and
4782 add %code-top.
2cbe6b7f 4783
e557d3ea
JMG
47842006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4785
4786 DJGPP specific issues.
4787
4788 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4789 config.bat accordingly.
4790 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4791 * djgpp/config.site: Likewise.
4792
136a0f76
PB
47932006-10-16 Paolo Bonzini <bonzini@gnu.org>
4794
27bd5d67
PB
4795 Replace %*-header with %provides, %requires, %code. See discussion at
4796 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4797
136a0f76
PB
4798 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4799 (b4_user_start_header): Remove.
4800 * data/glr.c: Use new macros instead of b4_*start_header
4801 and b4_*end_header.
4802 * data/glr.cc: Likewise.
4803 * data/lalr1.cc: Likewise.
4804 * data/push.c: Likewise.
4805 * data/yacc.c: Likewise.
4806
4807 * doc/bison.texinfo: Remove %before-header, rename
4808 %{start,end,after}-header to %requires, %provides, %code.
4809
4810 * src/parse-gram.y: Likewise (also rename token names accordingly).
4811 * src/scan-gram.l: Likewise.
4812 * tests/actions.at: Likewise.
4813
10f429ef
PE
48142006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4815
4816 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4817 Problem reported by Joel E. Denny.
4818
48192006-10-14 Jim Meyering <jim@meyering.net>
4820
4821 (Sync from coreutils.)
4822 Work also when the working directory (with e.g. coreutils sources)
4823 is version controlled with git, rather than CVS.
4824 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4825 rather than CVS.
4826 In messages and comments, say e.g., "checked-out sources",
4827 rather than "CVS sources".
4828 (version_controlled_file): New function. Work for git as well as
4829 for CVS. Don't use grep's -q option.
4830 (slurp): Call it here, in place of CVS-specific code.
4831
c4bd5bf7
JD
48322006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4833
4834 Fix testsuite for ./configure --enable-gcc-warnings:
4835 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4836 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4837 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4838 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4839 * test/regression.at (Diagnostic that expects two alternatives):
4840 Likewise.
4841
46356ea4
PE
48422006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4843
231ed89a
PE
4844 * bootstrap.conf (gnulib_modules): Add config-h.
4845 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4846 worry about HAVE_CONFIG_H.
4847 * lib/abitset.c: Likewise.
4848 * lib/bitset.c: Likewise.
4849 * lib/bitset_stats.c: Likewise.
4850 * lib/bitsetv-print.c: Likewise.
4851 * lib/bitsetv.c: Likewise.
4852 * lib/ebitset.c: Likewise.
4853 * lib/get-errno.c: Likewise.
4854 * lib/lbitset.c: Likewise.
4855 * lib/subpipe.c: Likewise.
4856 * lib/timevar.c: Likewise.
4857 * lib/vbitset.c: Likewise.
4858 * lib/bitset.c: Include "bitset.h" first, to test interface.
4859 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4860 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4861 * lib/bitsetv.c: Include "bitsetv.h" first.
4862 * lib/get-errno.c: Include "get-errno.h" first.
4863 * m4/.cvsignore: Add config-h.m4.
4864 * tests/actions.at (Default %printer and %destructor for ...):
4865 Adjust expected line numbers in output to reflect removal of #if
4866 HAVE_CONFIG_H lines.
4867 * tests/glr-regression.at (Missed %merge type warnings when ...):
4868 Likewise.
4869 * tests/regression.at (Braced code in declaration in rules section):
4870 Likewise.
4871 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4872 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4873 Include <config.h> unconditionally.
4874
46356ea4
PE
4875 * bootstrap: Sync from coreutils, as follows:
4876
4877 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4878
4879 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4880 variable was sometimes used without being initialized. This
4881 messed up the installation of the INSTALL file in some cases.
4882
4883 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4884
4885 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4886 --copy. Inspired by a suggestion from Bruno Haible.
4887
4888 2006-10-03 Jim Meyering <jim@meyering.net>
4889
4890 * bootstrap: Undo last change to this file, since now gnulib-tool
4891 sticks with the automake default in generating dependencies.
4892
dd4bf078
PE
48932006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4894
cf2a5f7c
PE
4895 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4896 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4897
4898 * doc/bison.1: Add copyright notice.
4899
4900 * data/glr.c: Don't include <stdarg.h>; not used.
4901
35fe0834
PE
4902 * NEWS: The -g and --graph options now output graphs in Graphviz
4903 DOT format, not VCG format.
4904 * doc/bison.1: Likewise.
4905 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
4906 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4907 of this change in
4908 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
4909 * TODO: Remove Graphviz entry.
4910 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4911 remove vcg.c, vcg.h, vcg_defaults.h.
4912 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4913 * src/graphviz.c, src/graphviz.h: New files.
4914 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4915 * src/files.h: Make comment more generic.
4916 * src/main.c (main): Likewise.
4917 * src/print_graph.h: Likewise.
4918 * src/getargs.c (usage): Make usage description more generic.
4919 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4920 (static_graph, fgraph): Remove. All uses changed to pass
4921 arguments instead of sharing a static var.
4922 (print_core, print_actions, print_state, print_graph):
4923 Output graphviz format rather than VCG format.
4924 * tests/.cvsignore: Remove *.vcg; add *.dot.
4925 * tests/output.at: Expect *.dot files, not *.vcg files.
4926
dd4bf078
PE
4927 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4928 accommodates the 2006-10-08 change.
4929
efdd7421
PE
49302006-10-11 Bob Rossi <bob@brasko.net>
4931
4932 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4933 (b4_yyssa, b4_yyerror_range): New macros.
4934 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4935 (yypvarsinit): Remove init of removed fields.
4936 (yypushparse): Remove use of removed fields; use new macros instead.
4937
96a1981a
PE
49382006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4939
4940 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4941 in a push parser. Reindent slightly to match yacc.c better.
4942
49432006-10-11 Bob Rossi <bob@brasko.net>
4944
46356ea4
PE
4945 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4946 yymsg_alloc fields.
4947 (yypvarsinit, yypushparse): Remove init of removed fields.
4948 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 4949
c1630a8b
PE
49502006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4951
4952 * THANKS: Add Paolo Bonzini and Bob Rossi.
4953
90b9908d
PB
49542006-10-08 Paolo Bonzini <bonzini@gnu.org>
4955
4956 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4957 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4958 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4959 b4_define_user_cde and uses): Remove.
4960 (b4_comment, b4_prefix, b4_sync_start): New.
4961 * data/bison.m4: New file, with most of the content removed from c.m4.
4962 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4963 * src/output.c (output_skeleton): Pass bison.m4.
4964 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4965 only if specified.
4966
cf806753
PE
49672006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4968
4969 Fix test failure reported by Tom Lane in
4970 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4971 and try to make such failures easier to catch in the future.
4972 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4973 that's now the caller's responsibility.
4974 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4975 Set yychar = YYEOF if it's negative.
4976 * tests/actions.at (yylex): Abort if asked to read past EOF.
4977 * tests/conflicts.at (yylex): Likewise.
4978 * tests/cxx-type.at (yylex): Likewise.
4979 * tests/glr-regression.at (yylex): Likewise.
4980 * tests/input.at (yylex): Likewise.
4981 * tests/regression.at (yylex): Likewise.
4982 * tests/torture.at (yylex): Likewise.
4983
0e2f006a
PE
49842006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4985
4986 Fix problems with translating English-language diagnostics.
4987 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4988 respect to bison-runtime pot generation. The YY_ stuff
4989 wasn't being captured.
4990 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4991 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4992 * runtime-po/POTFILES.in: Add data/push.c.
4993
e3ddc1e3
PE
49942006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4995
4996 Merge bootstrap changes from coreutils.
4997
4998 2006-09-28 Jim Meyering <jim@meyering.net>
4999
5000 Automatically generated dependencies are important even
5001 when all of the sources in a directory come from gnulib.
5002 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5003 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5004
5005 2006-09-23 Jim Meyering <jim@meyering.net>
5006
5007 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5008
5009 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5010
5011 * bootstrap: Add support for --force.
5012 (usage): New function. Describe usage less tersely.
5013 (CVS_only_file): New var.
5014
01e972b3
PE
50152006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5016
5017 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5018 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5019 Adjust white space and comments to match GNU style better.
5020
c63d3e90
PE
50212006-09-20 Bob Rossi <bob@brasko.net>
5022
5023 * data/push.c (yyresult_get): Remove function.
5024 (YYPUSH_MORE): Add #define.
5025 (yypushparse): Modify return value.
5026
e70f46d1
PE
50272006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5028
5029 * stamp-h.in: Remove; no longer needed.
5030 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5031 Remove config.h, config.hin, intl (no longer created).
5032 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5033 stamp-h1.
5034
5035 Sync bootstrap from coreutils, as follows:
5036
5037 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5038
5039 * bootstrap (symlink_to_gnulib): New function.
5040 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5041 to copies-of-gnulib.
5042 (cp_mark_as_generated, slurp, gnulib_files):
5043 Avoid making a copy if it's the same as the old version.
5044 (gnulib_files): Add support for this variable (used by Bison).
5045
a92be413
PE
50462006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5047
5048 * src/getargs.c (usage): Rework to use conventions similar to
5049 coreutils, to make translation a bit easier and the code a bit
5050 smaller. Problem reported by Tim Van Holder.
5051
4f82b42a
PE
50522006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5053
3b2942e6
PE
5054 Use some of gnulib's new modules, taken from coreutils.
5055
5056 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5057 * bootstrap.conf: New file.
5058 (gnulib_modules): Add configmake, inttypes, unistd.
5059 (XGETTEXT_OPTIONS): Add complain, complain_at,
5060 fatal, fatal_at, warn, warn_at, unexpected_end.
5061 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5062 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5063 (gl_EARLY): Add.
5064 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5065 (gl_INIT): Add
5066 (GNULIB_AUTOCONF_SNIPPET): Remove.
5067 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5068 the pickiest.
5069 * lib/.cvsignore: Add inttypes_.h.
5070 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5071 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5072 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5073 no-longer-necessary initializations.
5074 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5075 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5076 use the unistd module.
5077 * src/system.h: Likewise.
5078 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5079 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5080 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5081 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5082 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5083 * src/system.h: Include inttypes.h unconditionally, now that we
5084 use the inttypes module. Don't bother to include stdint.h, since
5085 inttypes.h now does that for us.
5086 (LOCALEDIR): Remove, now that we use the configmake module.
5087 * src/getargs.c: Include configmake.h.
5088 * src/main.c: Likewise.
5089 * src/output.c: Likewise.
5090 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5091 not from $abs_top_builddir, since config.h moved.
5092
5093
4f82b42a
PE
5094 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5095 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5096
5097 * src/parse-gram.y (symbol_declaration): Don't put statements
5098 before declarations; it's not portable to C89.
5099 * src/scan-code.l (handle_action_at): Likewise.
5100
5101 * src/scan-code.l: Always initialize braces_level; the old code
5102 left it uninitialized and therefore had undefined behavior.
5103
5104 Don't attempt to redefine 'assert', since it runs afoul of
5105 systems where standard headers (mistakenly) include <assert.h>.
5106 Instead, define and use our own alternative, called 'aver'.
5107 * src/reader.c: Don't include assert.h, since we no longer
5108 use assert.
5109 * src/scan-code.l: Likewise.
5110 * src/system.h (assert): Remove, replacing with....
5111 (aver): New function, taking a bool arg. All uses changed.
5112 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5113 not merely an integer.
5114
31c10e38
PE
51152006-09-15 Bob Rossi <bob@brasko.net>
5116
5117 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5118 * data/c.m4 (YYPUSH): New.
5119 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5120 * src/getargs.c (push_parser): New var.
5121 * src/getargs.h (push_parser): New declaration.
5122 * src/output.c (prepare): Add macro insertion of `push_flag'.
5123 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5124 (prologue_declaration): Parse %push-parser.
5125 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5126 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5127 list of removed lines from the traces observed.
5128 (AT_CHECK_CALC_LALR): Added push parser tests.
5129
fa7b79c0
PE
51302006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5131
21fe08ca
PE
5132 * NEWS: Version 2.3a.
5133 * configure.ac (AC_INIT): Likewise.
5134
e8ec4d9b
PE
5135 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5136 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5137 due to header ordering dependencies. I don't know why the #define
5138 was there.
5139
fa7b79c0
PE
5140 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5141 runtime cost when YYDEBUG is not defined, and so that some tests
5142 that used to fail now work. Problem and initial suggestion by
5143 Paolo Bonzini.
5144 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5145 * data/glr.cc (b4_parser_class_name):
5146 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5147 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5148 (yydebug_) [YYDEBUG]: New member.
5149 (yycdebug_): Now defined only if YYDEBUG.
5150 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5151 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5152 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5153 if YYYDEBUG.
5154 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5155 Define only if YYDEBUG.
5156 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5157 set_debug_level.
5158 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5159 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5160 AT_CHECK_CALC_GLR_CC that are working now.
5161
4ec13d60
PE
51622006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5163
5164 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5165 We don't need them in glr.cc, and glr.c defines them.
5166 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5167 assumes that defining it to anything is the same as defining
5168 it to 1. Problem reported by Paolo Bonzini.
5169
8e1687ae
PE
51702006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5171
5172 * data/c.m4 (b4_null, b4_case): Define.
5173 * src/output.c (prepare_symbols): Use b4_null.
5174 (user_actions_output): Use b4_case.
5175
3dc5e96b
PE
51762006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5177
aef3da86
PE
5178 * data/glr.c (b4_shared_declarations): Put start-header first,
5179 before any #includes that we generate, so that feature-test
5180 macros work. Problem reported by Michael Deutschmann in
5181 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5182 * data/lalr1.cc: Likewise.
5183 * doc/bison.texinfo (Prologue): Document that feature-test macros
5184 should be defined before any Bison declarations.
5185 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5186 that depend on location.hh after, not before, Bison decls, since
5187 we now include location.hh after the first user prologue.
5188
3dc5e96b
PE
5189 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5190 Sander Brandenburg in
5191 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5192 Also, fix minor white space and comment issues.
aef3da86
PE
5193 (Prologue): Mention that it's better to define feature-test macros
5194 before Bison declarations. Problem reported by Michael Deutschmann.
5195
5196 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5197 by Jim Meyering.
5198 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5199 This adjusts to recent gnulib changes.
3dc5e96b 5200
b2a0b7ca
JD
52012006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5202
5203 Finish implementation of per-type %destructor/%printer. Discussed
5204 starting at
5205 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5206 and
5207 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5208 * NEWS (2.3+): Add a description of this feature to the default
5209 %destructor/%printer description.
5210 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5211 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5212 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5213 list node contains a semantic type.
5214 * src/symtab.c, src/symtab.h: Extend with a table that associates
5215 semantic types with their %destructor's and %printer's.
5216 (semantic_type_from_uniqstr, semantic_type_get,
5217 semantic_type_destructor_set, semantic_type_printer_set): New functions
5218 composing the public interface of that table.
5219 (symbol_destructor_get, symbol_destructor_location_get,
5220 symbol_printer_get, symbol_printer_location_get): If there's no
5221 per-symbol %destructor/%printer, look up the per-type before trying
5222 the default.
5223 * tests/actions.at (Per-type %printer and %destructor): New test case.
5224 * tests/input.at (Default %printer and %destructor redeclared):
5225 Extend to check that multiple occurrences of %symbol-default in a
5226 single %destructor/%printer declaration is an error.
5227 (Per-type %printer and %destructor redeclared, Unused values with
5228 per-type %destructor): New test cases.
5229
3be03b13
JD
52302006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5231
5232 Require default %destructor/%printer to be declared using
5233 %symbol-default instead of an empty symbol list, and start working on
5234 new per-type %destructor/%printer. Discussed at
5235 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5236 * NEWS (2.3+): Add %symbol-default to example.
5237 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 5238 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
5239 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5240 (generic_symlist, generic_symlist_item): New nonterminals for creating
5241 a list in which each item is a symbol, semantic type, or
5242 %symbol-default.
5243 (grammar_declaration): Use generic_symlist in %destructor and %printer
5244 declarations instead of symbols.1 or an empty list.
5245 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5246 for changes to symbol_list.
5247 * src/reader.c: Update for changes to symbol_list.
5248 * src/scan-code.l: Likewise.
5249 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5250 * src/symlist.c, src/symlist.h: Extend such that a list node may
5251 represent a semantic type or a %symbol-default in addition to just an
5252 ordinary symbol. Add switched functions for setting %destructor's and
5253 %printer's.
5254 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5255 %destructor/%printer declarations.
5256
3508ce36
JD
52572006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5258
5259 Whether the default %destructor/%printer applies to a particular symbol
5260 isn't a question of whether the user *declares* that symbol (in %token,
5261 for example). It's a question of whether the user by any means
5262 *defines* the symbol at all (by simply using a char token, for
5263 example). $end is defined by Bison whereas any other token with token
5264 number 0 is defined by the user. The error token is always defined by
5265 Bison regardless of whether the user declares it with %token, but we
5266 may one day let the user define error as a nonterminal instead.
5267 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5268 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5269 the meaning of "user-defined".
5270 * tests/actions.at (Default %printer and %destructor for user-declared
5271 end token): Rename to...
5272 (Default %printer and %destructor for user-defined end token): ...
5273 this.
5274
5275 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5276 computation of whether to apply the default, don't maintain a list of
5277 every Bison-defined symbol. Instead, just check for a first character
5278 of '$', which a user symbol cannot have, and check for the error token.
5279
9350499c
JD
52802006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5281
5282 Don't apply the default %destructor or %printer to the error token,
5283 $undefined, or $accept. This change fits the general rule that the
5284 default %destructor and %printer are only for user-declared symbols,
5285 and it solves several difficulties that are described in the new test
5286 cases listed below.
5287 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5288 * tests/actions.at (Default %printer and %destructor are not for error
5289 or $undefined, Default %printer and %destructor are not for $accept):
5290 New test cases.
5291
4d7370cb
JD
52922006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5293
5294 Allow %start after the first rule.
5295 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5296 when parsing the first rule.
5297 (check_and_convert_grammar): Search for it here after all grammar
5298 declarations have been parsed. Skip midrules, which have dummy LHS
5299 nonterminals.
5300 * src/symtab.c (symbol_is_dummy): New function.
5301 * src/symtab.h (symbol_is_dummy): Declare it.
5302 * tests/input.at (%start after first rule): New test.
5303
6d0ef4ec
JD
53042006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5305
5306 Redo some of the previous commit: add back the ability to use
5307 non-aliased/undeclared string literals since it might be useful to
5308 those declaring %token-table.
5309 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5310 commit: don't worry about complaints from symbols_pack.
5311 * src/symtab.c (symbol_new, symbol_class_set,
5312 symbol_check_alias_consistency): Undo changes in previous commit: count
5313 each string literal as a new symbol and token, assign it a symbol
5314 number, and don't complain about non-aliased string literals.
5315 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5316 and token counts but does still set aliased tokens to the same number,
5317 symbol_pack_processor now leaves empty slots in the symbols array.
5318 Remove those slots.
5319 * tests/regression.at (Undeclared string literal): Remove test case
5320 added in previous commit since non-aliased string literals are allowed
5321 again.
5322 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5323 remove unnecessary string literal declarations.
5324 * tests/sets.at (Firsts): Likewise.
5325
965537bc
JD
53262006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5327
5328 Don't allow an undeclared string literal, but allow a string literal to
5329 be used before its declaration.
5330 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5331 symbols_pack complained.
5332 * src/symtab.c (symbol_new): Don't count a string literal as a new
5333 symbol.
5334 (symbol_class_set): Don't count a string literal as a new token, and
5335 don't assign it a symbol number since symbol_make_alias does that.
5336 (symbol_make_alias): It's not necessary to decrement the symbol and
5337 token counts anymore. Don't assume that an alias declaration occurs
5338 before any uses of the identifier or string, and thus don't assert that
5339 one of them has the highest symbol number so far.
5340 (symbol_check_alias_consistency): Complain if there's a string literal
5341 that wasn't declared as an alias.
5342 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5343 symbol_pack asserts that every token has been assigned a symbol number
5344 although undeclared string literals have not.
5345 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 5346 string literal): New test cases.
965537bc
JD
5347 (Characters Escapes, Web2c Actions): Declare string literals as
5348 aliases.
5349 * tests/sets.at (Firsts): Likewise.
5350
47aee066
JD
53512006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5352
5353 In the grammar scanner, STRING_FINISH unclosed constructs and return
5354 them to the parser in order to improve error messages.
5355 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5356 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5357 * tests/input.at (Unclosed constructs): New test case.
5358 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5359 seen.
5360
5361 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5362 unused global.
5363
1f6b3679
JD
53642006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5365
5366 Handle string aliases for character tokens correctly.
5367 * src/symtab.c (symbol_user_token_number_set): If the token has an
5368 alias, check and set its alias's user token number instead of its own,
5369 which is set to indicate the alias. Previously, every occurrence of
5370 the character token in the grammar overwrote that alias indicator with
5371 the character code.
5372 * tests/input.at (String aliases for character tokens): New test.
5373
219741d8
JD
53742006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5375
5376 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5377
11daa4e7
PE
53782006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5379
5380 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5381 to prevent failures when building on older platforms.
5382 Check for autopoint failure.
5383 Set XGETTEXT_OPTIONS to values that check for C format strings,
5384 so that translators are warned about them (this also helps
5385 prevent core dumps).
5386
5387 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5388 function, since it simplifies our code a bit.
5389
5390 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5391 rather than -W, so we don't get bogus warnings about sign comparisons.
5392 Add -Wpointer-arith, since that warning is useful (it reports code
5393 that does not conform to C89 and that some compilers reject).
5394 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5395 since it's no longer needed.
5396
f9bfc42a
JD
53972006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5398
5399 Clean up scanners a bit.
5400 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5401 definitions so gcc won't warn when obstack_for_string is unused.
5402 * src/scan-code.l: config.h and system.h are already #include'd by
5403 scan-code-c.c, so get rid of them here.
5404 * src/scan-gram.l: Likewise.
5405 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5406 definitions rather than duplicating the rest of it.
5407 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5408
06e8700a
JD
54092006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5410
5411 Suppress signed/unsigned comparison warnings for yycheck.
5412 * data/c.m4 (b4_safest_int_type): New macro.
5413 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5414 a signed int type, cast it to b4_safest_int_type first.
5415 * data/yacc.c: Likewise.
5416 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5417 also overwritten.
5418
9c437126
PE
54192006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5420
5421 * doc/bison.texinfo: Fix some typos.
5422
284d8a13
PE
54232006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5424
5425 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5426 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5427
5428 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5429 the latest gnulib does this a different way.
5430 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5431 translation was patched, so stop omitting it.
5432
ec5479ce
JD
54332006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5434
5435 Enable declaration of default %printer/%destructor. Make the parser
5436 use these for all user-declared grammar symbols for which the user does
5437 not declare a specific %printer/%destructor. Thus, the parser uses it
5438 for token 0 if the user declares it but not if Bison generates it as
5439 $end. Discussed starting at
5440 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5441 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5442 and
5443 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5444 * NEWS (2.3+): Mention.
5445 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5446 declare a %destructor for a mid-rule's semantic value. It's just
5447 impossible to declare one specific to it.
5448 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5449 code. Describe default %destructor form.
5450 * src/parse-gram.y (grammar_declaration): Parse default
5451 %printer/%destructor declarations.
5452 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5453 and symbol_destructor_location_get rather than accessing the destructor
5454 and destructor_location members of struct symbol.
5455 (symbol_printers_output): Likewise but for %printer's.
5456 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5457 again.
5458 * src/symtab.c (default_destructor, default_destructor_location,
5459 default_printer, default_printer_location): New static global
5460 variables to record the default %destructor and %printer.
5461 (symbol_destructor_get, symbol_destructor_location_get,
5462 symbol_printer_get, symbol_printer_location_get): New functions to
5463 compute the appropriate %destructor and %printer for a symbol.
5464 (default_destructor_set, default_printer_set): New functions to set the
5465 default %destructor and %printer.
5466 * src/symtab.h: Prototype all those new functions.
5467 * tests/actions.at (Default %printer and %destructor): New test to
5468 check that the right %printer and %destructor are called, that they're
5469 not called for $end, and that $$ and @$ work correctly.
5470 (Default %printer and %destructor for user-declared end token): New
5471 test to check that the default %printer and %destructor are called for
5472 a user-declared end token.
5473 * tests/input.at (Default %printer and %destructor redeclared, Unused
5474 values with default %destructor): New tests to check related grammar
5475 warnings and errors.
5476
868d2d96
JD
54772006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5478
5479 Clean up handling of %destructor for the end token (token 0).
5480 Discussed starting at
5481 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5482 and
5483 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5484
5485 Make the skeletons consistent in how they pop the end token and invoke
5486 its %destructor.
5487 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5488 state, which has token number 0, since this would invoke the
5489 %destructor for the end token.
5490 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5491 until after shifting the end token, or else it won't be popped.
5492 * data/yacc.c (yyparse): Likewise.
5493
5494 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5495 it's the end token. Upon termination, destroy an unshifted lookahead
5496 even when it's the end token.
5497 * data/lalr1.cc (yy::parser::parse): Likewise.
5498 * data/yacc.c (yyparse): Likewise.
5499
5500 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5501 value warnings for the end token when the user gives the end token a
5502 %destructor.
5503
5504 * tests/actions.at (Printers and Destructors): Test all the above.
5505
62a9592d
PE
55062006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5507
5508 Update to latest gnulib and gettext versions.
5509 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5510 Add fopen-safer.
5511 (gnulib_files): Add m4/warning.m4. Don't worry about files
5512 overwritten by autopoint.
5513 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5514 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5515 rejects them.
5516 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5517 so that we can remove the intl files at a better time.
5518 (intl_files_to_remove): Remove aclocal.m4, since it gets
5519 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5520 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5521 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5522 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5523 Remove datarootdir hack; no longer needed.
5524 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5525 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5526 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5527 strdup.h.
5528 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5529 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5530
10d6970f
PE
55312006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5532
5533 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5534 it with --assume-autoconf='latest-stable'.
5535
50a33993
JD
55362006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5537
5538 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5539 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5540 YYSTYPE' and `{'.
5541 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5542 those from muscle_tab.c since the old ones are misleading.
5543
2ce4ed68
AD
55442006-07-13 Akim Demaille <akim@epita.fr>
5545
5546 Support %define "KEY" {VALUE}.
5547 * src/scan-code.h, src/scan-code.l (translate_action)
5548 (translate_rule_action, translate_symbol_action, translate_code):
5549 Return char *, not const char *.
5550 * src/parse-gram.y (declaration): Rename as...
5551 (prologue_declaration): this.
5552 (string_content): Remove this nonterminal, use STRING.
5553 (braceless, content, content.opt): New nonterminal.
5554 Use them.
5555 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5556 as value.
5557 * src/scan-gram.l (getargs.h): Don't include it.
5558
db7e5eb5
PE
55592006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5560
5561 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5562 rather than a for-loop that declares a local bool variable. This
5563 should work around a compatibility problem with a Cray x1e C++
5564 compiler reported by Hung Nguyen in
5565 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5566 The for-loop was introduced in the 2004-11-17 change but I don't
5567 know why it was needed.
5568
a5d80ba5
AD
55692006-07-12 Akim Demaille <akim@epita.fr>
5570
5571 * data/c.m4: Comment changes.
5572
23eb2a69
AD
55732006-07-10 Akim Demaille <akim@lrde.epita.fr>
5574
5575 * src/complain.c (error_message, ERROR_MESSAGE): New.
5576 To factor...
5577 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5578 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5579
ddc8ede1
PE
55802006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5581
5582 * NEWS: Instead of %union, you can define and use your own union type
5583 YYSTYPE if your grammar contains at least one <type> tag.
5584 Your YYSTYPE need not be a macro; it can be a typedef.
5585 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5586 (Union Decl, Decl Summary): Document this.
5587 * data/glr.c (YYSTYPE): Implement this.
5588 * data/glr.cc (YYSTYPE): Likewise.
5589 * data/lalr1.cc (YYSTYPE): Likewise.
5590 * data/yacc.c (YYSTYPE): Likewise.
5591 * src/output.c (prepare): Output tag_seen_flag.
5592 * src/parse-gram.y (declaration, grammar_declaration):
5593 Use 'union_seen' rather than 'typed' to determine whether
5594 %union has been seen, since grammars can now be typed without
5595 %union.
5596 (symbol_declaration, type.opt, symbol_def):
5597 Keep track of whether a tag has been seen.
5598 * src/reader.c (union_seen, tag_seen): New vars.
5599 (typed): remove.
5600 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5601 * src/scan-code.l (untyped_var_seen): New variable.
5602 (handle_action_dollar): Adjust to above changes.
5603 (handle_action_dollar, handle_action_at):
5604 Improve overflow checking for outlandish numbers.
5605 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5606 avoid new diagnostics generated by above changes.
5607 * tests/regression.at (YYSTYPE typedef): Add test to check
5608 for type tags without %union.
5609
5610 * src/symlist.c (symbol_list_length): Return int, not unsigned
5611 int, since callers expect int. This may need to get revisited
5612 once we have proper integer overflow checking.
5613
5614 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5615 object is now static.
5616
5617 * src/getargs.c (flags_argmatch): Return void, not int,
5618 to pacify ./configure --enable-gcc-warnings.
5619
5620 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5621 since last_string is already defined to FLEX_PREFIX (last_string).
5622
7b42569e
AD
56232006-07-09 Akim Demaille <akim@lrde.epita.fr>
5624
5625 Implement --warnings/-W.
5626 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5627 replaced by...
5628 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5629 Adjust callers.
5630 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5631 (warnings_args, warnings_types): New.
5632 (getargs, short_options, long_options): Accept -W/--warnings.
5633 Sort the options by alphabetical order, upper case letter right
5634 before its lower case.
5635
3b452f4e
JD
56362006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5637
5638 Change %merge result type clash warnings to errors. Discussed at
5639 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5640 * src/reader.c (record_merge_function_type): Use complain_at.
5641 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5642 declared later): Update test case results.
5643
b8a41559
AD
56442006-07-09 Akim Demaille <akim@lrde.epita.fr>
5645
5646 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5647 to be in alphabetical order.
5648 (trace_args): Spelling fixes.
5649
cd9e1ba2
PE
56502006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5651
5652 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5653 so they don't collide with user-defined macros.
5654 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5655 this was never guaranteed, and now that we're using gnulib stdint,
5656 which defines int_fast16_t to long int, the problem is exposed.
5657
cb48f191
PE
56582006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5659
b8445a15
PE
5660 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5661 need the full POSIX semantics (and weren't implementing them
5662 anyway).
5663
cb48f191
PE
5664 Adjust to Autoconf 2.60 and today's gnulib.
5665 * bootstrap (gnulib_modules): Add stdint.
5666 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5667 no longer copies it.
5668 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5669 since stdint needs the former and wcwidth (which is now required
5670 by mbswidth) needs the latter.
5671 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5672 work around a compatibility glitch between gettext 0.14.6 and
5673 Autoconf 2.60.
5674 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5675 Do not check for uintptr_t, since new stdint module does the right
5676 thing.
5677 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5678 Add stdint.h, stdint_.h, wcwidth.h.
5679 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5680 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5681 stdint.m4, wchar_t.m4, wcwidth.m4.
5682 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5683 usual order for ../lib/*.h files.
5684 (file_name_split): Use last_component, not base_name, to adjust
5685 to gnulib changes.
5686 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5687 for ../lib/*.h files.
5688 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5689 Define unconditionally, since we now assume the stdint module.
5690 * src/scan-skel.l: Include <dirname.h>.
5691 (BASE_QPUTS): Use last_component, not base_name.
5692 * src/system.h: Include <unlocked-io.h> in the usual order
5693 for ../lib/*.h files. Include <stdint.h> unconditionally,
5694 since we now use the stdint module.
5695 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5696 HAVE_UINTPTR_T, since we now use the stdint module.
5697 (base_name): Remove decl, since files now include <dirname.h>
5698 to get the decl.
5699
cd48d21d
AD
57002006-07-08 Akim Demaille <akim@lrde.epita.fr>
5701
5702 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5703 New, default to 1.
5704 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5705 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5706 default.
5707 * tests/calc.at: Adjust.
5708
8ec0a172
AD
57092006-07-08 Akim Demaille <akim@lrde.epita.fr>
5710
b8445a15 5711 * data/c.m4 (b4_basename): New.
8ec0a172
AD
5712 (b4_syncline): Also output the location of its invocation (from
5713 the skeleton).
5714 (b4_user_action, b4_define_user_action, b4_user_actions)
5715 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5716 (b4_user_stype): New.
5717 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5718
4a678af8
JD
57192006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5720
5721 In the grammar file, the first column is 1 not 0 on the first line as
5722 on every other line.
5723 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5724 * tests/input.at (Torturing the Scanner): Update output.
5725
5726 * src/scan-gram.l (scanner_cursor): Declare it static.
5727
dd60572a
JD
57282006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5729
5730 In warnings, say "previous declaration" rather than "first
5731 declaration".
5732 * src/symtab.c (redeclaration): Do that here.
5733 * src/reader.c (record_merge_function_type): In the case of a result
5734 type clash, report the previous declaration rather than the very first
5735 one in the grammar file.
5736 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5737 declared later): Add a third declaration to check this behavior.
5738 * tests/input.at (Incompatible Aliases): Update output.
5739
2073e1b6
AD
57402006-06-27 Akim Demaille <akim@epita.fr>
5741
5742 * doc/Doxyfile.in: New.
5743 * doc/Makefile.am: Use it.
5744 * src/lalr.h, src/symtab.h: Initial doxygenation.
5745
8ee5b538
JD
57462006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5747
5748 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
5749 declared after the %merge. This continues the effort of the previous
5750 patch.
8ee5b538
JD
5751 * src/reader.c (get_merge_function): Don't set the merger type yet.
5752 (record_merge_function_type): New function for setting the merger type
5753 and checking for clashes.
5754 (grammar_current_rule_merge_set): Set the location of the %merge for
5755 the current rule.
5756 (packgram): Invoke record_merge_function_type for each rule now that
5757 all symbol type declarations have been parsed.
5758 * src/reader.h (merger_list.type_declaration_location): New member
5759 storing the location of the first %merge from which the type for this
5760 merging function was derived.
5761 * src/symlist.h (symbol_list.merger_declaration_location): New member
5762 storing the location of a rule's %merge, if any.
5763 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5764 declared later): New test to catch the error fixed by the above patch.
5765
ffa4ba3a
JD
57662006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5767
5768 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
5769 declarations appear after the rules. Discussed at
5770 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5771 and
5772 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5773 Don't mistake the type of $$ in a midrule to be that of its parent
5774 rule's $$.
ffa4ba3a
JD
5775 * src/reader.c (grammar_current_rule_end): Don't invoke
5776 grammar_rule_check yet since not all symbol declarations may have been
5777 parsed yet.
5778 (grammar_midrule_action): Likewise.
5779 Don't record whether the midrule's $$ has been used yet since actions
5780 haven't been translated yet.
5781 Record the midrule's parent rule and its RHS index within the parent
5782 rule.
5783 (grammar_current_rule_action_append): Don't translate the action yet
5784 since not all symbol declarations may have been parsed yet and, thus,
5785 warnings about types for $$, $n, @$, and @n can't be reported yet.
5786 (packgram): Translate the action and invoke grammar_rule_check now that
5787 all symbol declarations have been parsed.
5788 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5789 after parsing the entire grammar file, the symbol list here in the case
5790 of a midrule is actually the midrule's empty RHS, so reference its
5791 parent rule's RHS where necessary.
5792 On the other hand, now that you can already know it's a midrule, you
5793 aren't forced to think $$ has the same type as its parent rule's $$.
5794 (handle_action_at): In the case of a midrule, reference the parent rule
5795 where necessary.
5796 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5797 members.
5798 (symbol_list_length): Now that this is invoked after all rules have
5799 been parsed, a NULL symbol (rather than a NULL symbol list node)
5800 terminates a rule. symbol_list_print already does this correctly.
5801 * src/symlist.h (symbol_list.midrule_parent_rule,
5802 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5803 remember their relationships with their parents.
5804 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5805 fixed by the above patch.
5806 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5807 implementing...
5808 (Unused values): ... this old test case and...
5809 (Unused values before symbol declarations): ... this new test case.
5810 This one is the same as `Unused values' except that all symbol
5811 declarations appear after the rules in order to catch the rest of the
5812 errors fixed by the above patch.
5813
e256e17f
JD
58142006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5815
300a1930
JD
5816 More cleanup.
5817 * src/reader.c (current_rule): Declare it static since it's no longer
5818 used outside this file.
5819 (grammar_current_rule_action_append): Remove redundant arguments from
5820 translate_rule_action invocation.
5821 * src/reader.h (current_rule): Remove this unused extern.
5822 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5823 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 5824
381ecb06
JD
58252006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5826
5827 Clean up yesterday's patch.
5828 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5829 to...
5830 * src/reader.c (grammar_current_rule_action_append): ... here for
5831 consistency with grammar_current_rule_symbol_append.
5832 * tests/regression.at (Braced code in declaration in rules section):
5833 Make yyerror and yylex static as usual.
5834
4210cd0b
JD
58352006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5836
5837 Fix bug that mistakes braced code in a declaration in the rules section
5838 to be a rule action. Mentioned at
5839 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5840 * src/scan-gram.l: Move midrule action detection from the start of the
5841 scanning of any braced code to...
5842 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5843 action. For readability, use $2 and @2 rather than the equivalent
5844 global variables.
5845 * tests/regression.at (Braced code in declaration in rules section):
5846 New test to catch the error fixed by the above patch.
5847
5848 Work on code readability some.
5849 * src/scan-code.l (current_rule): Get rid of this misleading and
5850 redundant declaration: it's actually extern'ed in reader.h.
5851 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5852 translate_action): Add a rule argument and use it instead of the global
5853 current_rule.
5854 (translate_rule_action): This already receives current_rule through an
5855 argument, so pass it on to translate_action instead of assigning
5856 current_rule to current_rule.
5857 (translate_symbol_action, translate_code): Pass rule = NULL to
5858 translate_action.
5859
34f98f46
JD
58602006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5861
5862 Rename %before-definitions to %start-header and %after-definitions to
5863 %end-header. Don't use these declarations to separate pre-prologue
5864 blocks from post-prologue blocks. Add new order-independent
5865 declarations %before-header and %after-header as alternatives to the
5866 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5867 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5868 * NEWS (2.3+): Update for these changes.
5869 * data/glr.c (b4_before_definitions): Update to...
5870 (b4_start_header): ... this.
5871 (b4_after_definitions): Update to...
5872 (b4_end_header): ... this.
5873 * data/glr.cc: Likewise.
5874 * data/lalr1.cc: Likewise.
5875 * data/yacc.c: Likewise.
5876 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5877 prologue blocks with %*-header declarations.
5878 (Calc++ Parser): Likewise.
91661ebb 5879 (Decl Summary): Update names.
148d66d8 5880 (Table of Symbols): Update description.
34f98f46
JD
5881 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5882 (PERCENT_END_HEADER): ... this.
5883 (PERCENT_BEFORE_DEFINITIONS): Update to...
5884 (PERCENT_START_HEADER): ... this.
5885 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5886 (declaration): Update token names and m4 macro names.
5887 When parsing %end-header and %start-header, invoke translate_code
5888 before muscle_code_grow, and no longer set global booleans to remember
5889 whether these declarations have been seen.
5890 Parse new %after-header and %before-header.
5891 * src/reader.c (before_definitions, after_definitions): Remove.
5892 (prologue_augment): Accept a new bool argument to specify whether to
5893 augment the pre-prologue or post-prologue.
5894 * src/reader.h (before_definitions, after_definitions): Remove these
5895 extern's.
5896 (prologue_augment): Add new bool argument.
5897 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5898 (PERCENT_END_HEADER): ... this.
5899 (PERCENT_BEFORE_DEFINITIONS): Update to...
5900 (PERCENT_START_HEADER): ... this.
5901 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5902 * tests/actions.at (Printers and Destructors): Update names.
5903
31b2b07e
JD
59042006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5905
5906 Add comparison operators for C++ location classes. Discussed at
5907 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5908 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5909 declaration indicating whether filename_type has an operator==. If
5910 filename_type is `std::string', it defaults to `1', `0' otherwise.
5911 * data/location.cc: Iff b4_define_location_comparison is `1', add
5912 operator== and operator!= for class position and for class location.
5913
5914 Some minor fixes.
5915 * src/scan-action.l: Remove unused file.
5916 * src/symtab.c (symbol_printer_set): Use printer_location not
5917 destructor_location.
5918 * src/symtab.h (struct symbol): Replace incorrect source comment for
5919 printer members.
5920 * tests/input.at (Incompatible Aliases): Update output with correct
5921 printer location.
5922
9bc0dd67
JD
59232006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5924
5925 Don't put the pre-prologue in the header file. For the yacc.c code
5926 file and the glr.c header and code files, move the pre-prologue before
5927 the token definitions. Add new %before-definitions and
5928 %after-definitions to declare code that will go in both the header file
5929 and code file. Discussed at
5930 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5931 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5932 and
5933 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5934 * NEWS (2.3+): Describe these changes.
5935 * data/glr.c (b4_pre_prologue): Move from within to before...
5936 (b4_shared_declarations): ... this.
5937 Add new b4_before_definitions before b4_token_enums.
5938 Add new b4_after_definitions at the end.
5939 * data/glr.cc (b4_pre_prologue): Replace with...
5940 (b4_before_definitions): ... this in the header file.
5941 (b4_after_definitions): New near the end of the header file.
5942 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5943 code file right before including the header file.
5944 (b4_before_definitions): New in the previous position of
5945 b4_pre_prologue in the header file.
5946 (b4_after_definitions): New near the end of the header file.
5947 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5948 (b4_token_enums_defines): In the code file, move to right before
5949 YYSTYPE for consistency with the header file.
5950 (b4_before_definitions): New right before b4_token_enums_defines in
5951 both the header and code file.
5952 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5953 header and code file.
5954 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5955 of prologues for %union dependencies.
91661ebb
JD
5956 (Decl Summary): In %defines description, mention the effect of
5957 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
5958 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5959 than in the pre-prologue so that make check succeeds.
148d66d8 5960 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
5961 %after-definitions.
5962 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5963 %before-definitions.
5964 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5965 (declaration): Parse those declarations and append to
5966 b4_before_definitions and b4_after_definitions, respectively.
5967 * src/reader.c (before_definitions, after_definitions): New bools to
5968 track whether those declarations have been seen.
5969 (prologue_augment): Add to the post-prologue if %union,
5970 %before-definitions, or %after-definitions has been seen.
5971 * src/reader.h (before_definitions, after_definitions): New extern's.
5972 * src/scan-gram.l: Scan the new declarations.
5973 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5974 prologue block in a %before-definitions or a %after-definitions based
5975 on whether the %union is declared.
5976 * tests/regression.at (Early token definitions with --yacc, Early token
5977 definitions without --yacc): Move tests for token definitions into the
5978 post-prologue since token names are no longer defined in the
5979 pre-prologue.
5980
203b9274
AD
59812006-06-20 Akim Demaille <akim@epita.fr>
5982
5983 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5984 (symbol_get): Use it.
5985 * src/parse-gram.y: Use it.
5986
a7ee59cf
JD
59872006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5988
5989 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5990 build succeeds when configured with --enable-gcc-warnings.
5991
5a2baae7
PE
59922006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5993
33ad1a9c
PE
5994 * src/parse-gram.y (char_name): New function.
5995 (CHAR, STRING, string_content): For %printer, properly escape.
5996 (ID): Prefer fputs to fprintf.
5997 (id): Reindent to be consistent with other rules.
5998 Properly quote char.
5999
5a2baae7
PE
6000 The Translation Project changed its way of publishing translations
6001 to maintainers. I haven't received any responses to my request
6002 for supporting the old way, or for documenting the new way. I
6003 have modified 'bootstrap' to use screen scraping
6004 (in this case, HTML scraping). This is unreliable and inelegant,
6005 but I don't see any better way. Yuck.
6006 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6007 (get_translations): New function, which uses HTML scraping to
6008 deduce locations of latest translations.
6009 Use this function to grab both bison and bison-runtime .po files.
6010 Don't bother priming the pump for the runtime-po domain any more,
6011 as it's now translated better than bison is.
6012
58d7a1a1
AD
60132006-06-19 Akim Demaille <akim@epita.fr>
6014
6015 * src/scan-gram.l: No longer "parse" things after `%union' until
6016 `{'. Rather, return a single "%union" token.
6017 No longer make symbols: return strings, and leave the conversion
6018 to symbols to the parser.
6019 (SC_PRE_CODE, token_type): Remove.
6020 * src/parse-gram.y (%union): New field `character'.
6021 Sort tokens.
6022 (CHAR): New token.
6023 (ID, ID_COLON): Now that the scanner no longer makes them
6024 identifiers, adjust all uses to invoke symbol_get.
6025 (id_colon): New, wraps the conversion from string to symbol.
6026 (%union): Accept a possible union_name.
6027 (symbol): Now can be a char.
6028 * data/c.m4 (b4_union_name): Leave a default value.
6029 * data/glr.c, data/yacc.c: Use it.
6030
b931235e
JD
60312006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6032
6033 For associating token numbers with token names for "yacc.c", don't use
6034 #define statements unless `--yacc' is specified; always use enum
6035 yytokentype. Most important discussions start at:
6036 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6037 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6038 and
6039 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6040 * NEWS (2.3+): Mention.
6041 * data/c.m4 (b4_yacc_if): New.
6042 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6043 token #define's.
6044 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6045 on token name definitions.
6046 * src/getargs.c (usage): Capitalize `Yacc' in English.
6047 * src/output.c (prepare): Define b4_yacc_flag.
6048 * tests/regression.at (Early token definitions): Test that tokens names
6049 are defined before the pre-prologue not just before the post-prologue.
6050 Remove this test case and copy to...
6051 (Early token definitions with --yacc): ... this to test #define's.
6052 (Early token definitions without --yacc): ... and this to test enums.
6053
9e6e7ed2
PE
60542006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6055
6056 * NEWS: Reword the post-2.3 change to not be so optimistic about
6057 removing the old "look-ahead" spelling.
6058 Update previous look-ahead/lookahead change reports.
6059 * REFERENCES: look-ahead -> lookahead (since that's
6060 what he actually wrote).
6061 * doc/refcard.tex: look ahead -> lookahead,
6062 look-ahead -> lookahead
6063
742e4900
JD
60642006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6065
6066 For consistency, use `lookahead' instead of `look-ahead' or
6067 `look_ahead'. Discussed starting at
6068 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6069 and then at
6070 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6071 * NEWS: For the next release, note the change to `--report'.
6072 * TODO, doc/bison.1: Update English.
6073 * doc/bison.texinfo: Update English.
6074 (Understanding Your Parser, Bison Options): Document as
6075 `--report=lookahead' rather than `--report=look-ahead'.
6076 * src/conflicts.c: Update English in comments.
6077 (lookahead_set): Rename from look_ahead_set.
6078 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6079 (resolve_sr_conflict): Rename local look_ahead_tokens to
6080 lookahead_tokens, and update other uses.
6081 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6082 count_rr_conflicts, conflicts_free): Update uses.
6083 * src/getargs.c (report_args): Move "lookahead" before alternate
6084 spellings.
6085 (report_types): Update uses.
6086 (usage): For `--report' usage description, state `lookahead' spelling
6087 rather than `look-ahead'.
6088 * src/getargs.h (report.report_lookahead_tokens): Rename from
6089 report_look_ahead_tokens.
6090 * src/lalr.c: Update English in comments.
6091 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6092 (state_lookahead_tokens_count): Rename from
6093 state_look_ahead_tokens_count.
6094 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6095 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6096 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6097 Update other uses.
6098 Update English in output.
6099 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6100 * src/print.c: Update English in comments.
6101 (lookahead_set): Rename from look_ahead_set.
6102 (print_reduction): Rename argument lookahead_token from
6103 look_ahead_token.
6104 (print_core, state_default_rule, print_reductions, print_results):
6105 Update uses.
6106 * src/print_graph.c: Update English in comments.
6107 (print_core): Update uses.
6108 * src/state.c: Update English in comments.
6109 (reductions_new): Update uses.
6110 (state_rule_lookahead_tokens_print): Rename from
6111 state_rule_look_ahead_tokens_print, and update other uses.
6112 * src/state.h: Update English in comments.
6113 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6114 (state_rule_lookahead_tokens_print): Rename from
6115 state_rule_look_ahead_tokens_print.
6116 * src/tables.c: Update English in comments.
6117 (conflict_row, action_row): Update uses.
6118 * tests/glr-regression.at
6119 (Incorrect lookahead during deterministic GLR,
6120 Incorrect lookahead during nondeterministic GLR): Rename
6121 print_look_ahead to print_lookahead.
6122 * tests/torture.at: Update English in comments.
6123 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6124 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6125 (Many lookahead tokens): Update uses.
6126 * data/glr.c: Update English in comments.
6127 * lalr1.cc: Likewise.
6128 * yacc.c: Likewise.
6129 * src/conflicts.h: Likewise.
6130 * src/lalr.h: Likewise.
6131 * src/main.c: Likewise.
6132 * src/output.c: Likewise.
6133 * src/parse-gram.c: Likewise.
6134 * src/tables.h: Likewise.
6135 * tests/calc.at: Likewise.
6136
3c40d0b5
JD
61372006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6138
6139 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6140
5d278082
PE
61412006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6142
6143 * TODO: Add request from Nelson H. F. Beebe to be able to install
6144 Bison without installing the yacc script.
6145
9e668899
JD
61462006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6147
6148 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6149 and yytext if they're already #define'd.
6150 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6151 * src/scan-code-c.c: ... here.
6152 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6153 <config.h>.
6154
0c8e079f
JD
61552006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6156
6157 Get Bison to build again when configured with --enable-gcc-warnings.
6158 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6159 missing #include's.
6160 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6161 loc argument as it shadows a global.
6162 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6163 invocation.
6164
6165 * src/.cvsignore: Add scan-code.c.
6166
2346344a
AD
61672006-06-07 Akim Demaille <akim@epita.fr>
6168
6169 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6170 to...
6171 * src/scan-code.l: here.
6172 * tests/input.at (Torturing the Scanner): Fix another location
6173 error.
6174
4862bdfd
AD
61752006-06-07 Akim Demaille <akim@epita.fr>
6176
6177 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6178
e9071366
AD
61792006-06-06 Akim Demaille <akim@epita.fr>
6180
6181 Extract the parsing of user actions from the grammar scanner.
6182 As a consequence, the relation between the grammar scanner and
6183 parser is much simpler. We can also split "composite tokens" back
6184 into simple tokens.
6185 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6186 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6187 rename as...
6188 * src/location.h, src/location.c (add_column_width)
6189 (location_compute): these.
6190 Fix the column count: the initial column is 0.
6191 (location_print): Be robust to ending column being 0.
6192 * src/location.h (boundary_set): New.
6193 * src/main.c: Adjust to scanner_free being renamed as
6194 gram_scanner_free.
6195 * src/output.c: Include scan-code.h.
6196 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6197 Use boundary_set.
6198 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6199 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6200 which is now, again, a separate token.
6201 Adjust all dependencies.
6202 Whereever actions with $ and @ are used, use translate_code.
6203 (action): Remove this nonterminal which is now useless.
6204 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6205 (grammar_current_rule_action_append): Use translate_code.
6206 (packgram): Bound check ruleno, itemno, and rule_length.
6207 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6208 (last_string, last_braced_code_loc, max_left_semantic_context)
6209 (scanner_initialize, scanner_free, scanner_last_string_free)
6210 (gram_out, gram_lineno, YY_DECL_): Move to...
6211 * src/scan-gram.h: this new file.
6212 (YY_DECL): Rename as...
6213 (GRAM_DECL): this.
6214 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6215 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6216 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6217 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6218 Move these declarations, and...
6219 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6220 these to...
6221 * src/flex-scanner.h: this new file.
6222 * src/scan-gram.l (rule_length, rule_length_overflow)
6223 (increment_rule_length): Remove.
6224 (last_braced_code_loc): Rename as...
6225 (gram_last_braced_code_loc): this.
6226 Adjust to the changes of the parser.
6227 Move all the handling of $ and @ into...
6228 * src/scan-code.l: here.
6229 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6230 (handle_action_dollar, handle_action_at): Move to...
6231 * src/scan-code.l: here.
6232 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6233 scan-code.h, scan-code-c.c, scan-gram.h.
6234 (EXTRA_bison_SOURCES): Add scan-code.l.
6235 (BUILT_SOURCES): Add scan-code.c.
6236 (yacc): Be robust to white spaces.
6237
6238 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6239 * tests/regression.at: Adjust the column numbers.
6240 * tests/regression.at: Adjust the error message.
7891a7c4 6241
184e42f0
JD
62422006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6243
6244 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6245 Use Akim's wording from
6246 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6247
7891a7c4
JD
62482006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6249
6250 Between Bison releases, manually append `+' to the previous Bison
6251 release number, and use that as a signal to automatically print the
6252 ChangeLog's CVS Id keyword from --version. Discussed starting at
6253 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6254 * ChangeLog: Add Id header.
6255 * configure.ac (AC_INIT): Append `+' to `2.3'.
6256 * src/.cvsignore: Add revision.c.
6257 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6258 (BUILT_SOURCES): Add revision.c.
6259 (revision.c): New target rule. This file defines a new global variable
6260 named revision. It initializes it with either the Id from ChangeLog
6261 or, if VERSION doesn't contain `+', with the empty string.
6262 * src/getargs.c (version): Print the value of revision.
6263 * src/revision.h: Extern revision.
6264
4ad3ed84
PE
62652006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6266
6267 * NEWS: Version 2.3.
6268 * configure.ac (AC_INIT): Likewise.
6269
02103984
PE
62702006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6271
6272 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6273 with no arguments, not as an object-like macro. This is for
6274 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6275 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6276 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6277 Document this.
6278
2c08afa5
JD
62792006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6280
6281 * src/getargs.c (usage): Back out yesterday's modification of the
6282 --help output so that we don't have to wait for translation before
6283 releasing 2.3.
6284
6077da58
PE
62852006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6286
6287 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6288 Problem reported by Akim Demaille.
6289
2a26b6c2
JD
62902006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6291
6292 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6293
aefef0d6
PE
62942006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6295
6296 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6297 generated source code. Problem reported by Frans Englich in
6298 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6299
fcd8e201
PE
63002006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6301
6302 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6303 shell, not within 'make', so that 'make' by an ordinary builder
6304 (using GNU make) does not worry about configuring gzip. This also
6305 works around a bug reported independently by Keith Thompson and by
6306 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6307 stderr rather than stdout, messing up the build logs.
6308
7b5cdcbd
JD
63092006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6310
6311 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6312 to make sure that YYID will never be unused. This fixes a 'make
6313 maintainer-check' failure caused by the recent changes to the 'Trivial
6314 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6315 not used.
6316 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6317
5ad0a449
JD
63182006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6319
6320 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6321 state before an empty RHS is always resolved here. Only the location
6322 of that state is guaranteed to be resolved, and that's enough. This
6323 fixes the remaining bug reported by Derek M. Jones in
6324 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6325 * tests/glr-regression.at (Uninitialized location when reporting
6326 ambiguity): Test the above case.
6327 Also, the embedded comments in this test case claim it checks the case
6328 of an empty RHS that has inherited the initial location. However, the
6329 corresponding LHS was already resolved, so yyresolveLocations didn't
6330 actually have reason to modify it. Fix this by forcing
6331 nondeterministic operation at the beginning of the parse.
6332
50cce58e
PE
63332006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6334
6335 * data/c.m4 (b4_yy_symbol_print_generate):
6336 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6337 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6338 of the bugs reported today by Derek M Jones in
6339 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6340 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6341 defined to be a type name without parens or brackets.
6342 (Location Type): Similarly for YYLTYPE.
6343 * tests/regression.at (Trivial grammars): Put in a test for this
6344 bug that will be caught by 'make maintainer-check' (though not,
6345 alas, by 'make check' unless your compiler is picky).
6346
ab8d9dc5
PE
63472006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6348
0d2c8934 6349 * NEWS: Version 2.2.
ab8d9dc5
PE
6350 * configure.ac (AC_INIT): Likewise.
6351
9138c575
JD
63522006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6353
6354 * data/glr.c (yyreportTree): Make room in yystates for the state
6355 preceding the RHS. This fixes the segmentation fault reported by Derek
6356 M. Jones in
6357 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6358 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6359 to the user. Reported for yyreportTree by Derek M. Jones later in the
6360 same thread.
6361 * THANKS: Add Derek M. Jones.
6362 Update my email address.
6363 Fix typo in Steve Murphy's name.
6364
276f48df
PE
63652006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6366
d6645148
PE
6367 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6368 checking against YYLAST that caused the parser to miss a potential
6369 alternative in its diagnostic.
6370 Problem reported by Maria Jose Moron Fernandez in
6371 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6372 * data/lalr1.cc (yysyntax_error_): Likewise.
6373 * data/yacc.c (yysyntax_error): Likewise.
6374 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6375 tokens, in case we run into an older C compiler.
6376 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6377 Use them to check for the off-by-one error fixed above.
6378
276f48df
PE
6379 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6380 YYSIZE_T, not size_t.
6381 * tests/regression.at (Trivial grammars): New test, to catch
6382 the error fixed by the above patch.
6383
cd8b5791
AD
63842006-05-14 Akim Demaille <akim@lrde.epita.fr>
6385
6386 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6387 scheme.
6388 Reported by Steve Murphy.
6389
34376418
AD
63902006-05-14 Akim Demaille <akim@lrde.epita.fr>
6391
6392 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6393 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6394
327afc7c
AD
63952006-05-14 Akim Demaille <akim@lrde.epita.fr>
6396
6397 Implement --trace=m4.
6398 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6399 * src/output.c (output_skeleton): When set, pass -dV to m4.
6400
6401 Factor the handling of flags in m4.
6402 * src/output.c (prepare): Rename the muscle names debug, defines,
6403 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6404 * data/c.m4: Adjust.
6405 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6406 Use b4_define_flag_if to define other b4_FLAG_if macros.
6407 (b4_location_if): As a consequence, rename as...
6408 (b4_locations_if): this, for consistency.
6409 Adjust all the skeletons.
6410
ba9ecd19
AD
64112006-05-14 Akim Demaille <akim@lrde.epita.fr>
6412
6413 * etc/bench.pm: Shorten bench names.
6414
4e83ea15
AD
64152006-05-14 Akim Demaille <akim@lrde.epita.fr>
6416
6417 * src/output.h, src/output.c (error_verbose): Move to...
6418 * src/getargs.h, src/getargs.c: here.
6419 Sort the flags.
6420 Adjust dependencies.
6421
6e93d810
PE
64222006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6423
6424 * data/c.m4 (b4_copyright): Put the special exception for Bison
6425 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
6426 uses changed. Suggested by Akim Demaille. Also, wrap the
6427 copyright notice, in case it is longer than 80 columns. Replace
6428 comma by newline after title.
6e93d810 6429
eaea13f5
PE
64302006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6431
6432 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6433 incompatibility, not a bug. Mention that it wasn't fixed as of
6434 flex 2.5.33.
6435
3cf084ec
AD
64362006-05-11 Akim Demaille <akim@lrde.epita.fr>
6437
6438 * examples/extexi: Enforce the precedence of concatenation over
6439 >>.
0a9f1c7d 6440 Reported by Tommy Nordgren.
3cf084ec 6441
32c96bd7
AD
64422006-05-11 Akim Demaille <akim@lrde.epita.fr>
6443
6444 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6445 with the member "token".
f94705b2 6446 Reported by Martin Nylin.
32c96bd7 6447
eaea13f5
PE
64482006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6449
6450 * data/glr.c: Switch to Bison 2.2 special-exception language in
6451 the copyright notice. Use more-regular format for titles and
6452 copyright notices.
6453 * data/glr.cc: Likewise.
6454 * data/location.cc: Likewise.
6455 * data/yacc.cc: Likewise.
6456 * doc/bison.texinfo (Conditions): Document this.
6457 * NEWS: likewise. Upgrade version to 2.2.
6458
6e2d1146
AD
64592006-04-27 Akim Demaille <akim@lrde.epita.fr>
6460
6461 * data/glr.cc: Remove dead code.
6462
47671055
PE
64632006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6464
6465 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6466 that variable and the line breaks the bootstrap. Problem reported
6467 by Juan M. Guerrero.
6468
ed2e6384
AD
64692006-04-24 Akim Demaille <akim@lrde.epita.fr>
6470
6471 * doc/bison.texinfo (Multiple start-symbols): New.
6472
3cedc2dc
AD
64732006-04-24 Akim Demaille <akim@lrde.epita.fr>
6474
6475 * etc/README, etc/bench.pl: New.
6476
b2ddc3f3
AD
64772006-04-03 Akim Demaille <akim@lrde.epita.fr>
6478
6479 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6480 rule.
6481 Reported by Mickael Labau.
6482 * tests/input.at (Torturing the Scanner): Test it.
6483
91e3ac9a
PE
64842006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6485
6486 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6487 Problem reported by Bob Rossi.
6488
64892006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6490
6491 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6492 and didn't really work.
6493 For the index, use @ifnotinfo, not @iftex.
6494 Minor cleanups of spacing and terminology.
6495
5cf61e93
AD
64962006-03-12 Akim Demaille <akim@lrde.epita.fr>
6497
6498 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6499 of AT_NAME_PREFIX when %name-prefix is not used.
6500
aa08666d
AD
65012006-03-12 Akim Demaille <akim@lrde.epita.fr>
6502
6503 Apply --prefix to C++ skeletons too: they change the namespace.
6504 The test suite already exercize these cases.
6505 * data/c++.m4 (b4_namespace): New.
6506 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6507 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6508 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6509 * doc/bison.texinfo: Document it.
6510 (Option Cross Key): Use @multitable in all formats. It looks
6511 nicer, even in TeX outputs.
6512 (Rules): Use the same code whatever the output type is.
6513 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6514 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6515 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 6516
45567173
AD
65172006-03-10 Akim Demaille <akim@lrde.epita.fr>
6518
6519 * TODO: Remove dead items.
6520
e9d8f881 65212006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
6522
6523 * doc/FAQ: Remove, merged into...
6524 * doc/bison.texinfo (FAQ): this.
6525 * doc/Makefile.am (EXTRA_DIST): Adjust.
6526
c095d689
AD
65272006-03-10 Akim Demaille <akim@lrde.epita.fr>
6528
6529 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6530 even if empty.
6531 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6532 * doc/bison.texinfo (Calc++ Scanner): Use it.
6533
6e0f8287
PE
65342006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6535
6536 Fix two nits reported by twlevo, plus one more that I discovered.
6537
6538 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6539 this is the usual Bison style.
6540 * src/location.h (location_print): Likewise.
6541
6542 * src/reader.h (token_name): Likewise.
6543
d6b771c3
PE
65442006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6545
6546 Fix some nits reported by twlevo.
6547 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6548 and "POSIX". Use more-modern syntax for URLs. Mention C++
6549 and ask for Java. Don't hardwire OS version numbers. Add
6550 copyright notice.
6551 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6552 * src/conflicts.c (solved_conflicts_obstack): Now static.
6553
1e137b71
JD
65542006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6555
6556 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6557 page. Say "you can use it" not "you may use it" as on the web page;
6558 we're describing capabilities not granting permission.
6559
73f2e47e
PE
65602006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6561
6d05403d
PE
6562 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6563 shadowing warnings. Use usual patter for iterating through RHS.
6564 * tests/glr-regression.at
6565 (Uninitialized location when reporting ambiguity):
6566 Modify yylex so that it uses its argument, rather than trying
6567 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6568 const char -> char const.
6569
73f2e47e
PE
6570 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6571 Don't use tabs inside commands; it messes up 'ps'.
6572 Problem reported by twlevo.
6573
8710fc41
JD
65742006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6575
6576 * tests/glr-regression.at (Uninitialized location when reporting
6577 ambiguity): New test case.
6578 * data/glr.c (yyresolveLocations): New function, which uses
6579 YYLLOC_DEFAULT.
6580 (yyresolveValue): Invoke yyresolveLocations before reporting an
6581 ambiguity.
6582 * doc/bison.texinfo (Default Action for Locations): Note
6583 YYLLOC_DEFAULT's usage for ambiguity locations.
6584 (GLR Semantic Actions): Cross-reference those notes.
6585
ae952af2
JD
65862006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6587
6588 * tests/glr-regression.at (Leaked semantic values when reporting
6589 ambiguity): Remove unnecessary union and type declarations.
6590 (Leaked lookahead after nondeterministic parse syntax error): New test
6591 case.
6592 * data/glr.c (yyparse): Check for zero stacks remaining before
6593 attempting to shift the lookahead so that you don't lose it.
6594
35ee866a
JD
65952006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6596
6597 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6598 * tests/glr-regression.at (Leaked semantic values when reporting
6599 ambiguity): New test case.
6600 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6601 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6602 now unnecessary yystackp parameter.
6603 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6604 destructors can be called.
6605
6606 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6607 in existing testcases.
6608
520181ab
JD
66092006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6610
6611 Don't leak semantic values for parent RHS when a user action cuts the
6612 parser, and clean up related code a bit.
6613 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
6614 cuts parse): Rename to...
6615 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
6616 for leaked parent RHS values.
6617 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6618 between an unresolved state (non-empty chain of semantic options) and
6619 an incomplete one (signaled by an empty chain).
ae952af2 6620 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
6621 successfully or unsuccessfully resolved yyGLRState to...
6622 (yyresolveValue): ... here so that yyresolveValue always leaves a
6623 yyGLRState with consistent data and thus is easier to understand.
6624 Remove the yyvalp and yylocp parameters since they are always just
6625 taken from the yys parameter. When reporting a discarded merged value
6626 in debugging output, note that it is incompletely merged. Document the
6627 interface.
6628 (yyresolveAction): If resolving any of the RHS states fails, destroy
6629 them all rather than leaking them. Thus, as long as user actions are
6630 written to clean up the RHS correctly, yyresolveAction always cleans up
6631 the RHS of a semantic option. Document the interface.
6632
18d9185c
PE
66332006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6634
6635 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6636 led to a segmentation fault in GNU Pascal. Problem reported
6637 by Waldek Hebisch.
6638
841a7737
JD
66392006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6640
6641 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6642 mid-rule action inside a nonterminal symbol in order to declare a
6643 destructor for its semantic value.
6644
fc3f467f
PE
66452006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6646
6647 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6648 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6649 __cplusplus && ! defined _STDLIB_H && !
6650 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6651 defined free))]: Include <stdlib.h> rather than rolling our own
6652 declarations of malloc and free, to avoid problems with
6653 incompatible declarations (using 'throw') C++'s stdlib.h. This
6654 should fix Debian bug 340012
6655 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6656 reported by Guillaume Melquiond.
6657
a3af26dd
PE
66582006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6659
4d7bc38c
PE
6660 * NEWS: Clarify symbols versus types in unused-value warnings.
6661
a3af26dd
PE
6662 * configure.ac (AC_INIT): Bump version number.
6663
4e26c69e
PE
66642006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6665
6666 * NEWS: Version 2.1a.
6667 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6668 since C99 requires this.
6669
498e897c
PE
66702006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6671
6672 * m4/c-working.m4: New file.
6673 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6674
57bb17ca
PE
66752006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6676
6677 * Makefile.maint: Merge from coreutils.
6678
0be105dc
PE
66792006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6680
6681 More portability fixes for problems summarized by Nelson H. F. Beebe.
6682
6683 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6684 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6685 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6686 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6687 messes up because C++ code is compiled in 32-bit mode but linked
6688 in 64-bit mode.
6689
6fc0c024
PE
66902006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6691
6692 More portability fixes for problems summarized by Nelson H. F. Beebe.
6693
7870f699
PE
6694 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6695 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6696
6fc0c024
PE
6697 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6698 nodist_PROGRAMS, since we don't need to actually compile the
6699 example if we're just doing a plain 'make'. This avoids bothering
6700 the installer unnecessarily about problems due to weird C++
6701 compilers.
6702
fe6c2fde
PE
67032006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6704
6705 More portability fixes for problems summarized by Nelson H. F. Beebe.
6706
6707 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6708 than #include "...", and compile with -I'.'. The old method was
6709 not portable, according to Posix and the C standard, and it does
6710 not work with Sun C 5.7, where previous #line directives affect
6711 the working directory used in later #include "..." directives.
6712
927b425b
JMG
67132006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6714
6715 Various DJGGP specific issues in /djgpp
6716
d9735e9e
PE
67172006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6718
6719 More portability fixes for problems summarized by Nelson H. F. Beebe.
6720
6721 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6722 '#include <map>' works and that you can apply ++ to iterators.
6723
5a6755af
PE
67242006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6725
67a0dc4f
PE
6726 Work around portability problems summarized by Nelson H. F. Beebe in
6727 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6728
8c86f0ef
PE
6729 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6730 that '#include <string>' works.
6731
de35dd59
PE
6732 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6733 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6734 "warning: sorry: semantics of inline function static data `const
6735 unsigned char translate_table[262]' are wrong (you'll wind up with
6736 multiple copies)".
6737
67a0dc4f
PE
6738 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6739 or, xor to not_, and_, or_, and xor_, respectively. This works
6740 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6741 random system header somewhere that includes the equivalent of
6742 <iso646.h>.
6743
5a6755af
PE
6744 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6745 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 6746 Suite Version 2.0.
5a6755af 6747
3f001415
JD
67482006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6749
6750 During deterministic GLR operation, user actions should be able to
6751 influence the parse by changing yychar. To make this easier to fix and
6752 to make glr.c easier to evolve in general, don't maintain yytoken in
6753 parallel with yychar; just compute yytoken when needed.
6754 * tests/glr-regression.at (Incorrect lookahead during deterministic
6755 GLR): Check that setting yychar in a user action has the intended
6756 effect.
6757 * data/glr.c (yyGLRStack): Remove yytokenp member.
6758 (yyclearin): Don't set *yytokenp.
6759 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6760 yychar rather than *yytokenp to determine the current lookahead.
6761 Compute yytoken locally when needed.
6762 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6763 point to.
6764
6765 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6766 after `--report' documentation.
6767
e2a8c0f5
PE
67682006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6769
6770 * src/parse-gram.y (grammar_declaration): Location of printer
6771 symbol is @1, not list->location. Bug reported by twlevo.
6772 * tests/input.at (Incompatible Aliases): Adjust to above change.
6773
6b702268
PE
67742006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6775
27622431
PE
6776 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6777 all the test at once. This makes the output easier to read in the
6778 normal case.
6779
6b702268
PE
6780 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6781 got from <http://bro-ids.org/download.html>. The bug is that
6782 when two actions appeared in succession, the second one was
6783 scanned before the first one was added to the grammar rule
6784 as a midrule action. Bison then output the incorrect warning
6785 "parse.y:905.17-906.36: warning: unused value: $3".
6786 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6787 associated with a value.
6788 (rhs): Don't invoke grammar_current_rule_action_append.
6789 (action): Invoke it here instead.
6790 * src/reader.c (grammar_midrule_action): Now extern.
6791 (grammar_current_rule_action_append): Don't invoke
6792 grammar_midrule_action; that is now the scanner's job.
6793 * src/reader.h (last_string, last_braced_code_loc):
6794 (grammar_midrule_action): New decls.
6795 * src/scan-gram.l (last_string): Now extern, sigh.
6796 (last_braced_code_loc): New extern variable.
6797 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6798 rule already has an action.
6799 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6800 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6801 Add some tests to check that the above changes fixed the bug.
6802
d40ba6c2
PE
68032006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6804
6805 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6806 All used changed. Check whether the symbol has a destructor,
6807 not whether it is typed.
6808 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6809 that the values are still reported as unused. All line numbers
6810 adjusted.
6811
401aace6
PE
68122006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6813
6814 Work around a bug in bro 0.8, which underparenthesizes its
6815 definition of YYLLOC_DEFAULT.
6816 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6817 their arguments.
6818 * data/lalr1.cc: Likewise.
6819 * data/yacc.cc: Likewise.
6820
06f01bc4
PE
68212006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6822
401aace6
PE
6823 Work around a bug in Pike 7.0, and give the Pike folks a
6824 better way to override the usual int widths.
6825 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6826 user can override the types.
6827 (short): #undef, to work around a bug in Pike 7.0.
6828 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6829 (union yyalloc.yyss): Use yytype_int16 rather than short.
6830 All uses changed.
6831 (yysigned_char): Remove.
6832 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6833 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6834 * tests/regression.at (Web2c Actions): Adjust to above changes.
6835
6836 * src/reader.c (check_and_convert_grammar): New function.
6837 (reader): Close the input file even if something went wrong during
6838 parsing. Minor file descriptor leak reported by twlevo.
6839
06f01bc4
PE
6840 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6841 to pacify gcc -Wswitch-default.
6842 * src/scan-gram.l (adjust_location): Use a default: break; case
6843 to pacify gcc -Wswitch-default.
6844 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6845 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6846 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6847 Move these decls to scan-skel.l, since they don't need to be
6848 visible elsewhere.
6849 * src/scan-skel.l: Accept the above decls.
6850 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6851 is used.
6852
02650b7f
PE
68532006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6854
6855 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6856 since we don't want to insist on a version number at the start
6857 of the changelog every time.
6858 * Makefile.maint: Sync from coreutils a bit better.
6859 (sc_trailing_blank): Renamed from sc_trailing_space.
6860 All uses changed.
6861 (sc_no_if_have_config_h, sc_require_config_h):
6862 (sc_prohibit_assert_without_use): New rules.
6863 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6864 (sc_dd_max_sym_length): Fix leading spaces in rule.
6865 (sc_system_h_headers): Prefix with @.
6866 (sc_useless_cpp_parens, m4-check): Output line numbers.
6867 (changelog-check): Allow version only in head.
6868 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6869 satisfy new Makefile.maint rule.
6870 * data/glr.c: Likewise.
6871 * data/glr.cc: Likewise.
6872 * data/lalr1.cc: Likewise.
6873 * data/yacc.c: Likewise.
6874 * lib/ebitsetv.c: Likewise.
6875 * lib/lbitset.c: Likewise.
6876 * lib/subpipe.c: Likewise.
6877 * lib/timevar.c: Likewise.
6878 * src/system.h: Likewise.
6879 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6880 * djgpp/Makefile.maint: Add copyright notice.
6881 * djgpp/README.in: Likewise.
6882 * djgpp/config.bat: Likewise.
6883 * djgpp/config.site: Likewise.
6884 * djgpp/config_h.sed: Likewise.
6885 * djgpp/djunpack.bat: Likewise.
6886 * djgpp/config.sed: Fix copyright notice to match standard format.
6887 * djgpp/subpipe.h: Likewise.
6888 * lib/bitsetv-print.c: Likewise.
6889 * lib/bitsetv.c: Likewise.
6890 * lib/subpipe.h: Likewise.
6891 * lib/timevar.c: Likewise.
6892 * lib/timevar.h: Likewise.
6893 * djgpp/subpipe.c: Use standard recipe for config.h.
6894 * lib/abitset.c: Likewise.
6895 * lib/bitset.c: Likewise.
6896 * lib/bitset_stats.c: Likewise.
6897 * lib/bitsetv-print.c: Likewise.
6898 * lib/bitsetv.c: Likewise.
6899 * lib/ebitsetv.c: Likewise.
6900 * lib/get-errno.c: Likewise.
6901 * lib/lbitset.c: Likewise.
6902 * lib/subpipe.c: Likewise.
6903 * lib/timevar.c: Likewise.
6904 * lib/vbitset.c: Likewise.
6905 * tests/local.at: Likewise.
6906 * src/scan-gram.l: Don't include verify.h, since system.h does
6907 that for us.
6908 * .x-sc_require_config_h: New file.
6909 * .x-sc_unmarked_diagnostics: New file.
6910
287c78f6
PE
69112006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6912
287c78f6
PE
6913 Be a bit more systematic about using 'abort'.
6914 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6915 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6916 Put 'default: abort ();' before some other case, to satisfy older
6917 pedantic compilers.
6918 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6919 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6920 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6921 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
6922 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6923 (get_decision_str, get_orientation_str, get_node_alignment_str):
6924 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6925 (get_linestyle_str, get_arrowstyle_str): Likewise.
6926 * src/conflicts.c (resolve_sr_conflict):
6927 Use a default case rather than one for the one remaining enum
6928 value, to catch invalid enum values as well.
6929 * src/lalr.c (set_goto_map, map_goto):
6930 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6931 * src/nullable.c (nullable_compute, token_definitions_output):
6932 Likewise.
6933 * src/reader.c (packgram, reader): Likewise.
6934 * src/state.c (transitions_to, state_new, state_reduction_find):
6935 Likewise.
6936 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6937 (symbol_pack): Likewise.
6938 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
6939 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6940 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
6941 * src/system.h: Don't include <assert.h>.
6942 (assert): New macro.
6943
6944 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6945 (Destructor Decl, Parser Function, Pure Calling):
6946 Describe rules for braces inside C code more carefully.
287c78f6 6947
c66dfadd
PE
69482006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6949
c21493b8
PE
6950 Fix some porting glitches found by Nelson H. F. Beebe.
6951 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6952 compilers that don't understand that abort () does not return.
6953 * src/state.c (transitions_to): Likewise.
6954 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6955 that '#include <cstdlib>' works.
6956 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6957 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6958 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6959 for the benefit of some pre-C99 compilers.
6960
b6e3facf
PE
6961 * bootstrap: Undo changes to gnulib files that autoreconf made.
6962
c66dfadd
PE
6963 Minor fixups to get 'make maintainer-check' to work.
6964 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6965 with the new verify.h implementation.
6966 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6967 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6968 * data/yacc.c (YYUSE): Likewise.
6969 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6970 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6971 * src/parse-gram.y (declaration): Don't pass a string constant
6972 to a function that expects char *, since GCC might complain
6973 about the constant value.
6974 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6975 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6976 before #defining them.
6977 * tests/glr-regression.at
6978 (Incorrectly initialized location for empty right-hand side in GLR):
6979 In yyerror, use the msg arg.
6980 (Corrupted semantic options if user action cuts parse):
6981 (Incorrect lookahead during deterministic GLR):
6982 (Incorrect lookahead during nondeterministic GLR):
6983 Don't name a local var 'index'; it shadows string.h's 'index'.
6984
ed94ef2a
AD
69852006-01-19 Akim Demaille <akim@epita.fr>
6986
6987 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6988 location, not just parts of it.
6989
e9ad4aec
PE
69902006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6991
d6ca7905
PE
6992 * NEWS: Document the fact that multiple %unions are now allowed.
6993 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
6994 * TODO: This feature is now implemented, so remove it from
6995 the wishlist.
d6ca7905 6996
ef1b70e0
PE
6997 * Makefile.maint: Merge with coreutils Makefile.maint.
6998 (CVS_LIST): Use build-aux version if available.
6999 (VERSION_REGEXP): New macro.
7000 (syntax-check-rules): Add sc_no_if_have_config_h,
7001 sc_prohibit_assert_without_use, sc_require_config_h,
7002 sc_useless_cpp_parens.
7003 (sc_obsolete_symbols): Check for O_NDELAY.
7004 (sc_dd_max_sym_length): Track coreutils.
7005 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7006 (sc_useless_cpp_parens): New rule.
7007 (news-date-check): Look for version or today's date.
7008 (changelog-check): Don't require version number near head.
7009 (copyright-check): Use current year instead of hardwiring 2005.
7010 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7011 (announcement): Add --gpg-key-ID.
7012
7013 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7014 with "file system".
7015
2073ce56 7016 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
7017 array. Problem reported by twlevo.
7018 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7019 * src/lalr.c (build_relations): Rely on new sentinel.
7020 * src/gram.c (gram_free): Adjust to new sentinel.
7021
b7691f15
JD
70222006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7023
7024 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7025 yylookaheadNeeds. All uses updated.
7026 (yysplitStack): Rename local yynewLookaheadStatuses to
7027 yynewLookaheadNeeds.
7028 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7029 GLR): In comments, change `lookahead status' to `lookahead need'.
7030
ddee1b06
PH
70312006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7032
7033 * data/glr.c (yysplitStack): A little stylistic rewrite.
7034
12f4614d
PH
70352006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7036
7037 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7038
32c29292
JD
70392006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7040
7041 * doc/bison.texinfo: Fix some typos.
7042 (GLR Semantic Actions): New subsection discussing special
7043 considerations because GLR semantic actions might be deferred.
7044 (Actions): Mention look-ahead usage of yylval.
7045 (Actions and Locations): Mention look-ahead usage of yylloc.
7046 (Special Features for Use in Actions): Add YYEOF entry and mention it
7047 in the yychar entry.
7048 In the yychar entry, remove mention of the local yychar case (pure
7049 parser) since this is irrelevant information when writing semantic
148d66d8 7050 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
7051 yychar is otherwise described as an external variable.
7052 In the yychar entry, don't call it the `current' look-ahead since it
7053 isn't when semantic actions are deferred.
7054 In the yychar and yyclearin entries, add note about deferred semantic
7055 actions.
7056 Add yylloc and yylval entries discussing look-ahead usage.
7057 (Look-Ahead Tokens): When discussing yychar, don't call it the
7058 `current' look-ahead, and do mention yylval and yylloc.
7059 (Error Recovery): Cross-reference `Action Features' when mentioning
7060 yyclearin.
148d66d8 7061 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
7062 look-ahead.
7063 In the yylloc and yylval entries, mention look-ahead usage.
7064
de366a2f 70652006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
7066
7067 * tests/glr-regression.at: Update copyright year to 2006.
7068
bf70fa87
JD
70692006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7070
7071 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7072 use during nondeterministic operation to track which stacks have
7073 actually needed the current lookahead.
7074 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7075 Allocate, deallocate, resize, and otherwise shuffle space for
7076 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7077 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7078 appropriately during nondeterministic operation.
7079 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7080 members to store the current lookahead to be used by the deferred
7081 user action.
7082 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7083 from which the RHS is taken. Set the lookahead members of the new
7084 yySemanticOption according to the lookahead status for stack yyk.
7085 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7086 yyaddDeferredAction.
7087 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7088 members of yySemanticOption before invoking yyuserAction, and then set
7089 them back to their current values afterward.
7090 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7091 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7092 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7093 titles for consistency.
7094 (Leaked merged semantic value if user action cuts parse): In order to
7095 suppress lint warnings, use arguments in merge function, and assign
7096 char value < 128 in main.
7097 (Incorrect lookahead during deterministic GLR): New test case.
7098 (Incorrect lookahead during nondeterministic GLR): New test case.
7099
05449a2c
JD
71002006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7101
de366a2f 7102 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
7103 !yyvaluep as signal that no semantic value is available to print.
7104 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7105 to print a semantic value.
7106
4158e0a1 71072006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 7108
4158e0a1
JD
7109 * tests/glr-regression.at: For consistency with my newer test cases,
7110 don't thank myself.
7111
d659304d
JD
71122006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7113
7114 * data/glr.c (yyresolveValue): When merging semantic options, if at
7115 least one user action succeeds but a later one cuts the parse, then
7116 destroy the semantic value before returning rather than leaking it.
7117 (yyresolveStates): If a user action cuts the parse and thus
7118 yyresolveValue fails, ignore the (unset) semantic value rather than
7119 corrupting the yyGLRState, and empty the semantic options list since
7120 the user actions should have called all necessary destructors.
7121 Simplify code with YYCHK.
7122 * tests/glr-regression.at (Corrupted semantic options if user action
7123 cuts parse): New test case.
7124 (Undesirable destructors if user action cuts parse): New test case.
7125 Before applying any of this patch, this test case never actually failed
7126 for me... but only because the corrupted semantic options usually
7127 masked this bug.
7128 (Leaked merged semantic value if user action cuts parse): New test
7129 case.
7130
6ec2c0f2
AD
71312006-01-05 Akim Demaille <akim@epita.fr>
7132
7133 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7134
1b9c21fb
PE
71352006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7136
7137 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7138 _MSC_VER. Problem reported by Cenzato Marco.
7139 (b4_c_function_def): Use it.
7140 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7141 b4_c_modern.
7142 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7143 than rolling our own.
7144
84866159
AD
71452006-01-04 Akim Demaille <akim@epita.fr>
7146
7147 Also warn about non-used mid-rule values.
7148 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7149 member.
7150 (symbol_list_new): Adjust.
7151 * src/reader.c (symbol_typed_p): New.
7152 (grammar_rule_check): Use it.
7153 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7154 Check its rule.
7155 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7156 Use it.
7157 * tests/actions.at (Exotic Dollars): Adjust.
7158
378f4bd8
AD
71592006-01-04 Akim Demaille <akim@epita.fr>
7160
7161 * src/reader.c (grammar_midrule_action): If $$ is set in a
7162 mid-rule, move the `used' bit to its lhs.
7163 * tests/input.at (Unused values): New.
7164 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7165
e2a21b6f
PE
71662006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7167
54662697
PE
7168 * doc/bison.texinfo (Bison Options): Say more accurately what
7169 --yacc does.
7170 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7171 about declarations in the grammar when in Yacc mode, as POSIX does
7172 not require a diagnostic when the grammar uses extensions.
7173
7174 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7175
073f9288
PE
7176 Warn about dubious constructions like "%token T T".
7177 Reported by twlevo.
7178 * src/symtab.h (struct symbol.declared): New member.
7179 * src/symtab.c (symbol_new): Initialize it to false.
7180 (symbol_class_set): New arg DECLARING, specifying whether
7181 this is a declaration that we want to warn about, if there
7182 is more than one of them. All uses changed.
7183
1221b78a
PE
7184 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7185 Allow multiple %union directives, whose contents concatenate.
7186 * src/parse-gram.y (grammar_declaration): Likewise.
7187 Use muscle_code_grow, so that we don't need stype_line any more.
7188 All uses changed.
7189
7190 * src/muscle_tab.c (muscle_grow): Fix comment.
7191
e2a21b6f
PE
7192 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7193 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7194 Update copyright year to 2006.
7195
8f7e3cf9
AD
71962006-01-03 Akim Demaille <akim@epita.fr>
7197
7198 Have glr.cc pass (some of) the calc.at tests.
7199 * data/glr.cc (b4_parse_param_orig): New.
7200 (b4_parse_param): Improve its definition, and bound it more
7201 clearly in the skeleton.
7202 (b4_epilogue): Append, instead of prepending, in order to keep
7203 #line consistency.
7204 Simplify the generation of auxiliary functions: locations and
7205 purity are mandated.
7206 (b4_global_tokens_and_yystype): Honor it.
7207 * data/location.cc (c++.m4): Don't include it.
7208 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7209 and AT_SKEL_CC_IF.
7210 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7211 AT_LALR1_CC_IF.
7212 Be sure to initialize the first position's filename.
7213 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7214 mandated anyway.
7215 (AT_CHECK_CALC_GLR_CC): New.
7216 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7217
3953ed88
AD
72182006-01-02 Akim Demaille <akim@epita.fr>
7219
7220 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7221 c.m4.
0a96ba81 7222 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
7223 * data/glr.cc: Do not include stack.hh.
7224
9ecafbbf
AD
72252006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7226
7227 * data/glr.c: Reformat whitespace with tabs.
7228 (b4_lpure_formals): Remove this unused m4 macro.
7229 * tests/cxx-type.at: Reformat whitespace with tabs.
7230 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7231 since it's a member. Rename type to isNterm for clarity.
7232
c4d497a0
AD
72332005-12-29 Akim <akim@sulaco.local>
7234
7235 Let glr.cc catch up with symbol_value_print.
7236 * data/glr.cc (b4_yysymprint_generate): Replace by...
7237 (b4_yy_symbol_print_generate): this.
7238 (yy_symbol_print, yy_symbol_value_print): Declare them.
7239
4517da37
PE
72402005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7241
7242 * src/location.h (boundary): Note that a line or column equal
7243 to INT_MAX indicates an overflow.
7244 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7245 (rule_length_overflow, increment_rule_length, add_column_width):
7246 New functions.
7247 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7248 (<SC_BRACED_CODE>"}"):
7249 Use increment_rule_length rather than incrementing it by hand.
7250 (adjust_location, handle_syncline): Diagnose overflow.
7251 (handle_action_dollar, handle_action_at):
7252 Fix bug with monstrosities like $-2147483648.
7253 Remove now-unnecessary checks.
7254 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7255 (convert_ucn_to_byte): Verify assumptions.
7256 (handle_syncline): New arg LOC. All callers changed.
7257 Don't store through a value derived from char const * pointer.
7258
7259 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7260 GCC warnings.
7261
e3233bf6
PE
72622005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7263
7264 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7265 Remove unnecessary forward static decls.
7266
8f3596a6
AD
72672005-12-27 Akim Demaille <akim@epita.fr>
7268
7269 * src/reader.c (grammar_current_rule_check): Also check that $$
7270 is used.
7271 Take the rule to check as argument, hence rename as...
7272 (grammar_rule_check): this.
7273 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7274 Rename as...
7275 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7276 (grammar_midrule_action, grammar_symbol_append): Now static.
7277 * tests/torture.at (input): Don't rely on the default action
7278 being always performed.
7279 * tests/calc.at: "Set" $$ even when the action is "cut" with
7280 YYERROR or other.
7281 * tests/actions.at (Exotic Dollars): Instead of using unused
7282 values, check that the warning is issued.
7283
721be13c
PE
72842005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7285
7286 * NEWS: Improve wording for unused-value warnings.
7287
a0af42fc
AD
72882005-12-22 Akim Demaille <akim@epita.fr>
7289
7290 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7291 (b4_yysymprint_generate): Rename as...
7292 (b4_yy_symbol_print_generate): this.
7293 Generate yy_symbol_print instead of yysymprint.
7294 Generate also yy_symbol_value_print, and use it.
7295
affac613
AD
72962005-12-22 Akim Demaille <akim@epita.fr>
7297
721be13c 7298 * NEWS: Warn about unused values.
affac613
AD
7299 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7300 a `used' member.
7301 (symbol_list_n_get, symbol_list_n_used_set): New.
7302 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7303 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7304 * src/reader.c (grammar_current_rule_check): Check that values are
7305 used.
7306 * src/symtab.c (symbol_print): Accept 0.
7307 * tests/existing.at: Remove the type information.
7308 Empty the actions.
7309 Remove useless actions (beware of mid-rule actions: perl -000
7310 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7311 * tests/actions.at (Exotic Dollars): Use unused values.
7312 * tests/calc.at: Likewise.
7313 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7314 Likewise.
7315
7316 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7317 rule_useful_p.
7318
9d9b8b70
PE
73192005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7320
8bb4c753
PE
7321 Undo 2005-12-01 tentative license wording change. The wording is
7322 still being reviewed by the lawyers, and we don't want to wait for
7323 them before publishing a test release. For now, revert to the
7324 previous wording.
7325 * NEWS: Undo 2005-12-01 change.
7326 * data/glr.c: Revert to previous license wording.
7327 * data/glr.cc: Likewise.
7328 * data/lalr1.cc: Likewise.
7329 * data/location.cc: Likewise.
7330 * data/yacc.c: Likewise.
7331
9d9b8b70
PE
7332 * NEWS: Reword %destructor vs YYABORT etc.
7333 * data/glr.c: Use American spacing, for consistency.
7334 * data/glr.cc: Likewise.
7335 * data/lalr1.cc: Likewise.
7336 * data/yacc.c: Likewise.
7337 * data/yacc.c: Reformat comments slightly.
7338 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7339 for consistency. Fix some spelling errors and reword recently-included
7340 text slightly.
7341 * tests/cxx-type.at: Cast results of malloc, for C++.
7342
2c3b392a
AD
73432005-12-21 Joel E. Denny <address@hidden>
7344
7345 * tests/cxx-type.at: Construct a tree, count the parents of shared
7346 nodes, and free each node once and only once. Previously, the memory
7347 for semantic values was leaked instead.
7348
d6cff4dc
AD
73492005-12-21 Joel E. Denny <address@hidden>
7350
7351 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7352 (yylval, yylloc): If pure, #define to yystackp->yyval and
7353 yystackp->yyloc similar to yychar and yynerrs.
7354 (yyparse): If pure, remove local yylval and yylloc. Add local
7355 yystackp to accommodate pure definitions of yylval and yylloc.
7356 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7357 yylvalp and yyllocp to &yylval and &yylloc.
7358 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7359 namespace. Previously, nerrs and char were missing, but lval and lloc
7360 weren't necessary.
7361 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7362 yylvalp and yyllocp parameters since, if pure, these are now always
7363 accessible through yystackp. If not pure, they are still accessible
7364 globally.
7365 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7366 `if (YYID (N))' to pacify lint.
7367
a85284cf
AD
73682005-12-21 Akim Demaille <akim@epita.fr>
7369
7370 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7371 destroy the RHS symbols of a rule.
7372 * data/yacc.c (yylen): Initialize to 0.
7373 Keep its value to the number of items to possibly shift.
7374 In particular, a regular successful parse that ends on YYFINAL by
7375 a (internal) YYACCEPT must not have yylen != 0.
7376 (yyerrorlab, yyreturn): Pop the RHS.
7377 Reorder a bit to emphasize the `shifting' bits of code.
7378 (YYPOPSTACK): Now accept a number of items to pop.
7379 * data/lalr1.cc: Likewise.
7380 * data/glr.c: Formatting changes.
7381 Use goto instead of fall through.
7382 * doc/bison.texinfo (Destructor Decl): Complete.
7383
d508c281
JMG
73842005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7385
7386 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7387 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7388 * djgpp/config.bat: Replace every occurence of the file name
7389 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7390 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7391 * djgpp/config.sed: Replace every occurence of the file name
7392 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7393 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7394 * djgpp/djunpack.bat: DJGPP specific file.
7395 * djgpp/fnchange.lst: DJGPP specific file.
7396 * djgpp/README.in: Add new information about how to unpack the bison
7397 source on MSDOS and other systems which have 8.3 file name restrictions
7398 using djunpack.bat and fnchange.lst.
7399
3e7a2cd9
PE
74002005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7401
7402 * bootstrap (build_cvs_prefix): Remove; unused.
7403 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7404 when getting gnulib.
7405
74062005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7407
7408 * data/glr.c: Reorder typedef declarations for structs to match order
7409 of struct declarations.
7410 Rename yystack everywhere to yystackp except in yyparse where it's not
7411 a pointer.
7412 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7413 consistency.
7414 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7415 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7416 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7417 lint.
7418
877519f8
PE
74192005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7420
0eca5a39
PE
7421 * tests/sets.at (Accept): Fix typos in regular expression used to
7422 sed out the final state number.
7423
2cec9080
PE
7424 Work around portability problem on Solaris 10: flex-generated
7425 files include <stdio.h> before <config.h>, which messes up
7426 because the latter defines __EXTENSIONS__. Address the problem
7427 by creating two new little files that include <config.h> first,
7428 then include the flex-generated files. Rewrite everyone else
7429 to include <config.h> first, as well.
7430 * lib/timevar.c: Always include "config.h".
7431 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7432 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7433 (EXTRA_bison_SOURCES): New macro.
7434 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7435 * src/system.h: Don't include config.h.
7436 * src/LR0.c: Include <config.h> first.
7437 * src/assoc.c: Likewise.
7438 * src/closure.c: Likewise.
7439 * src/complain.c: Likewise.
7440 * src/conflicts.c: Likewise.
7441 * src/derives.c: Likewise.
7442 * src/files.c: Likewise.
7443 * src/getargs.c: Likewise.
7444 * src/gram.c: Likewise.
7445 * src/lalr.c: Likewise.
7446 * src/location.c: Likewise.
7447 * src/main.c: Likewise.
7448 * src/muscle_tab.c: Likewise.
7449 * src/nullable.c: Likewise.
7450 * src/output.c: Likewise.
7451 * src/parse-gram.y: Likewise.
7452 * src/print.c: Likewise.
7453 * src/print_graph.c: Likewise.
7454 * src/reader.c: Likewise.
7455 * src/reduce.c: Likewise.
7456 * src/relation.c: Likewise.
7457 * src/state.c: Likewise.
7458 * src/symlist.c: Likewise.
7459 * src/symtab.c: Likewise.
7460 * src/tables.c: Likewise.
7461 * src/uniqstr.c: Likewise.
7462 * src/vcg.c: Likewise.
7463
877519f8
PE
7464 * src/parse-gram.y: Fix minor problems uncovered by lint.
7465 (current_lhs, current_lhs_location): Now static.
7466 (current_assoc): Remove unused variable.
7467
7468 Cleanups so that Bison-generated parsers have less lint.
7469 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7470 Prepend /*ARGSUSED*/, for lint's sake.
7471 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7472 definition if 'lint' is defined.
7473 (YYID): New macro (or function, if lint).
7474 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7475 * data/yacc.c: Likewise.
7476 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7477 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7478 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7479 is C++ only.
7480 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7481 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7482 Use YYID(0) rather than 0, for lint.
7483 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7484 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7485
f5228370
PE
74862005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7487
7488 * tests/glr-regression.at
7489 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7490 Close memory leak reported by twlevo.
7491
69ce078b
PE
74922005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7493
6ff99711
PE
7494 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7495 all stacks.
7496 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
7497 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7498 New test case.
7499 (Duplicated user destructor for lookahead): This test now is expected
7500 to succeed.
7501
af3412cd
PE
75022005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7503
32b5b719 7504 * NEWS: Document the following change.
af3412cd
PE
7505 * data/yacc.c: Say "parser skeleton" rather than "file", since
7506 it's no longer just a file.
7507 * data/glr.c: Grant a special exception for C GLR parsers, that
7508 reads like the already-existing exception for C LALR(1) parsers.
7509 * data/glr.cc: Likewise.
7510 * data/lalr1.cc: Likewise.
7511 * data/location.cc: Likewise.
7512 * data/yacc.c: Reword the "written by" statement to clarify that
7513 it was the parser skeleton, not the entire output file.
7514 * data/glr.c: Written by Paul Hilfinger.
7515 * data/glr.cc: Written by Akim Demaille.
7516 * data/lalr1.cc: Likewise.
7517
035aa4a0
PE
75182005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7519
d9963c85
PE
7520 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7521 Fix typos in previous change that broke 'make check'.
7522 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7523 supported in C.
7524 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7525 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7526 We can revert this once things settle down.
7527
035aa4a0
PE
7528 * src/conflicts.c (conflicts_print): Don't print file name twice
7529 when %expect fails because there were no conflicts.
7530 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7531 change.
7532 * tests/conflicts.at (%expect not enough, %expect too much):
7533 (%expect with reduce conflicts): Adjust to new behavior.
7534
75352005-11-18 Akim Demaille <akim@epita.fr>
7536
7537 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7538 errors.
7539 * NEWS: Document this.
7540 * doc/bison.texinfo (Expect Decl): Likewise.
7541
d1ff7a7c
AD
75422005-11-16 Akim Demaille <akim@epita.fr>
7543
7544 Generalize the display of semantic values and locations in traces.
7545 * data/glr.c (yy_reduce_print): Fix indices (again).
7546 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7547 literal integers.
7548 * data/lalr1.cc (yyreduce_print): Rename as...
7549 (yy_reduce_print): this.
7550 Display values and locations.
7551 * data/yacc.c (yy_reduce_print): Likewise.
7552 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7553 (yysymprint): Move higher to be visible from yy_reduce_print).
7554 (yyparse): Adjust.
7555 * tests/calc.at: Adjust the expected length of the traces.
7556
6de5398d
AD
75572005-11-14 Akim Demaille <akim@epita.fr>
7558
7559 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7560 from 1 to N, while values and location start at 0.
7561 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7562
a1373f55
AD
75632005-11-14 Akim Demaille <akim@epita.fr>
7564
7565 * data/glr.c (yy_reduce_print): Fix the $ number.
7566
613d8952
AD
75672005-11-14 Akim Demaille <akim@epita.fr>
7568
7569 "Use" parse parameters.
7570 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7571 * data/glr.c, data/glr.cc: Use them.
7572 * data/glr.c (YYUSE): Have a C++ definition that supports
7573 non-pointer types.
7574
b2741627
AD
75752005-11-14 Akim Demaille <akim@epita.fr>
7576
7577 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7578
5059b5c8
AD
75792005-11-14 Akim Demaille <akim@epita.fr>
7580
42249483
AD
7581 * data/glr.cc: New.
7582 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 7583
4626a15d
AD
75842005-11-12 Akim Demaille <akim@epita.fr>
7585
7586 Let position and location be PODs.
7587 * data/location.cc (position::initialize, location::initialize): New.
7588 (position::position, location::location): Define only if
7589 b4_location_constructors is defined.
7590 * data/lalr1.cc (b4_location_constructors): Define it for backward
7591 compatibility.
7592 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7593
75942005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
7595
7596 * data/lalr1.cc: Move the body of the ctor and dtor into the
7597 parser file (instead of the header).
7598 Wrap the implementations in a "namespace yy".
7599
76002005-11-12 Akim Demaille <akim@epita.fr>
7601
7602 Have glr.c include its header file when created.
7603 * data/glr.c (b4_shared_declarations): New.
7604 Output them verbatim in the parser if !%defines, otherwise
7605 output then in the header file, and include it instead.
7606
1989d947
AD
76072005-11-11 Akim Demaille <akim@epita.fr>
7608
7609 * data/glr.c: Comment changes.
7610
76112005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
7612
7613 When yydebug, report semantic and location values for reductions.
7614 * data/glr.c (yy_reduce_print): Report the semantic values and the
7615 locations.
7616 (YY_REDUCE_PRINT): Adjust.
7617 (yyglrReduce): Use them.
7618 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7619 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7620 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7621 traces.
7622
02998094
AD
76232005-11-10 Akim Demaille <akim@epita.fr>
7624
7625 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7626 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7627 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7628
5210672f
PE
76292005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7630
7631 * m4/cxx.m4, examples/Makefile.am: Don't build
7632 examples/calc++ if no C++ compiler is available. (trivial change)
7633
a8991a1d
AD
76342005-11-09 Akim Demaille <akim@epita.fr>
7635
7636 * src/scan-skel.l: Use a couple of asserts.
7637
36b5e963
AD
76382005-11-03 Akim Demaille <akim@epita.fr>
7639
7640 In some (weird) cases, the final state number is incorrect.
7641 Reported by Alexandre Duret-Lutz.
7642 * src/LR0.c (state_list_append): Remove the computation of
7643 final_state.
7644 (save_reductions): Do it here.
7645 (get_state): Alpha conversion.
7646 (generate_states): Use a for loop.
7647 * src/gram.h (item_number_is_rule_number)
7648 (item_number_is_symbol_number): New.
7649 * src/state.c: Use assert.
7650 * src/system.h: Include assert.h.
7651 * tests/sets.at (Accept): New.
7652
44e7ead1
PH
76532005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7654
7655 * data/glr.c (yyfill): Adjust comment.
36b5e963 7656 (yyresolveAction): Initialize default location properly
44e7ead1
PH
7657 for empty right-hand sides.
7658 (yydoAction): Ditto.
7659 Add comment explaining apparently dead code.
36b5e963
AD
7660 * tests/glr-regression.at
7661 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 7662 New test.
36b5e963 7663
e10a80ee
PE
76642005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7665
7666 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7667 gnulib when interrupted. This fixes some race conditions and
7668 works around some portability problems (one noted by Paul
7669 Hilfinger).
7670
067b32ee
AD
76712005-10-22 Akim <akim@epita.fr>
7672
7673 * Makefile.cfg: Adjust to config -> build-aux.
7674 Reported by twledo.
7675
4b367315
AD
76762005-10-21 Akim Demaille <akim@epita.fr>
7677
7678 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7679 the %parse-params.
7680 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7681 * data/yacc.c (b4_Pure_if): Rename as...
7682 (b4_yacc_pure_if): this.
7683 (YY_SYMBOL_PRINT, yyparse): Adjust.
7684 * doc/bison.texinfo: Formatting changes.
7685
24cc23d9
AD
76862005-10-21 Akim Demaille <akim@epita.fr>
7687
7688 Finish the transition config -> build-aux.
7689 * configure.ac, Makefile.am: Use build-aux.
7690 * config/prev-version, config/announce-gen, config/Makefile.am:
7691 Move to...
7692 * build-aux/prev-version, build-aux/announce-gen,
7693 * build-aux/Makefile.am: here.
7694
d4476375
AD
76952005-10-14 Akim Demaille <akim@epita.fr>
7696
7697 * examples/calc++/test: Use set -x only when VERBOSE.
7698
302c0aee
PE
76992005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7700
7701 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7702 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7703
7625ec2c
AD
77042005-10-13 Akim Demaille <akim@epita.fr>
7705
7706 * src/scan-skel.l: Output the base name parts of the parser and
7707 header file names.
302c0aee 7708 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
7709 additional checks.
7710 Use this to exercise C++ outputs in subdirs.
7711 Reported by Oleg Smolsky.
7712
ba0fe3c7
PE
77132005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7714
7715 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7716 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7717 Problem reported by John P. Hartmann.
7718 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7719 already defined it.
7720
9b8a5ce0
AD
77212005-10-12 Akim Demaille <akim@epita.fr>
7722
7723 * src/parse-gram.y (version_check): Exit 63 to please missing
7724 (stands for "version mismatch).
7725 * tests/input.at, doc/bison.texinfo: Adjust.
7726
4f6e011e
PE
77272005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7728
7729 Work around portability problems with Visual Age C compiler
7730 (xlc and xlC_r) reported by John P. Hartmann.
7731 * data/location.cc (initial_column, initial_line): Remove.
7732 All uses replaced by 0 and 1.
7733 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7734 that xlc complains about.
7735 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 7736 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 7737 as __STDC__.
4d7aa45e
PE
7738 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7739 __STDC_VERSION__. Use it everywhere instead of looking at
7740 __STDC__ and __cplusplus.
4f6e011e 7741
a1b3bf8c
AD
77422005-10-10 Akim Demaille <akim@epita.fr>
7743
7744 * examples/calc++/test: Be quiet unless VERBOSE.
7745
412e44aa
PE
77462005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7747
2a4647a3
PE
7748 * data/c.m4 (yydestruct, yysymprint):
7749 Use YYUSE instead of casting to void.
7750 * data/glr.c (YYUSE): New macro.
7751 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7752 Use it instead of rolling our own.
7753 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7754 (YYCHK1):
7755 Use /*CONSTCOND*/ to suppress lint warnings.
7756 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7757 (YY_STACK_PRINT): Use 'false' not '0'.
7758 (YYUSE): New macro.
7759 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7760 * data/yacc.c (YYUSE): New macro.
7761 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7762 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7763 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7764
7765
412e44aa
PE
7766 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7767 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7768
88c6637f
PE
77692005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7770
2f4f028d
PE
7771 Undo the parts of the unlocked-I/O change that substituted
7772 putc or puts for printf. This might hurt performance a bit,
7773 but some people prefer the printf style.
7774 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7775 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7776 All uses replaced by YYFPRINTF and YYDPRINTF.
7777 * data/yacc.c: Likewise.
7778 * lib/bitset.c (bitset_print): Likewise.
7779 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7780 putc and puts.
7781 * lib/lbitset.c (debug_lbitset): Likewise.
7782 * src/closure.c (print_firsts, print_fderives): Likewise.
7783 * src/gram.c (grammar_dump): Likewise.
7784 * src/lalr.c (look_ahead_tokens_print): Likewise.
7785 * src/output.c (escaped_output): Likewise.
7786 (user_actions_output): Break apart two printfs.
7787 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7788 * src/reduce.c (reduce_print): Likewise.
7789 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7790 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7791
88c6637f
PE
7792 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7793 Use assignments rather than casts-to-void to suppress
7794 unused-variable warnings. This pacifies 'lint'.
7795 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7796 unused-variable warnings.
7797
fb32e373
JMG
77982005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7799
7800 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7801
edb8f44f
PE
78022005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7803
fb9c0b33
PE
7804 Use unlocked I/O for a minor performance improvement on hosts like
7805 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7806 is to use the gnlib unlocked-io module, and to prefer putc and
7807 puts to printf when either will work (since the latter doesn't
7808 come in an unlocked flavor).
7809 * bootstrap (gnulib_modules): Add unlocked-io.
7810 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7811 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7812 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7813 and similarly for puts and putc and printf.
7814 * data/yacc.c: Likewise.
7815 * lib/bitset.c (bitset_print): Likewise.
7816 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7817 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7818 to printf.
7819 * lib/lbitset.c (debug_lbitset): Likewise.
7820 * src/closure.c (print_firsts, print_fderives): Likewise.
7821 * src/gram.c (grammar_dump): Likewise.
7822 * src/lalr.c (look_ahead_tokens_print): Likewise.
7823 * src/output.c (escaped_output): Likewise.
7824 (user_actions_output): Coalesce two printfs.
2f4f028d 7825 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
7826 * src/reduce.c (reduce_print): Likewise.
7827 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 7828 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 7829
edb8f44f
PE
7830 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7831 this confuses xgettext.
7832
b50d2359
AD
78332005-10-02 Akim Demaille <akim@epita.fr>
7834
7835 * bootstrap (gnulib_modules): Add strverscmp.
7836 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7837 * m4/.cvsignore: Add strverscmp.m4.
7838 * src/parse-gram.y (%require): New token, new rule.
7839 (version_check): New.
7840 * src/scan-gram.l (%require): Adjust.
7841 * tests/input.at (AT_REQUIRE): New.
7842 Use it.
7843 * doc/bison.texinfo (Require Decl): New.
7844 (Calc++ Parser): Use %require.
7845
21667f64
AD
78462005-10-02 Akim Demaille <akim@epita.fr>
7847
7848 * data/location.cc: New.
7849
2b81e969
AD
78502005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7851 Akim Demaille <akim@epita.fr>
7852
7853 Make sure -odir/foo.cc creates dir/location.hh etc.
7854 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7855 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7856 (spec_defines_file): Now const.
7857 (dir_prefix): New.
7858 (short_base_name): Remove.
7859 * src/files.c: Adjust.
7860 (dirname.h): Include.
7861 (base_name): Don't prototype it.
7862 (finput): Remove, duplicates gram_in.
7863 (full_base_name, short_base_name): Replace by...
7864 (all_but_ext, all_but_tab_ext): these.
7865 (compute_base_names): Rename as...
7866 (compute_file_name_parts): this.
7867 Update to compute the new variables, including dir_prefix.
7868 Adjust dependencies.
7869 * src/output.c (prepare): Output them.
7870 * src/reader.c: Adjust to use gram_in, not finput.
7871 * src/scan-skel.l (@dir_prefix@): New.
7872
ad6a9b97
JMG
78732005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7874
7875 * lib/subpipe.c: New function end_of_output_subpipe() added
7876 to allow support for non-posix systems. This is a no-op function
7877 for posix systems.
7878
7879 * lib/subpipe.h: New function end_of_output_subpipe() added
7880 to allow support for non-posix systems. This is a no-op function
7881 for posix systems.
7882
7883 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7884 handle the lack of pipe/fork functionality on non-posix systems.
7885
7886 * djgpp/Makefile.maint: DJGPP specific file.
7887
7888 * djgpp/README.in: DJGPP specific file.
7889
7890 * djgpp/config.bat: DJGPP specific configuration file.
7891
7892 * djgpp/config.sed: DJGPP specific configuration file.
7893
7894 * djgpp/config.site: DJGPP specific configuration file.
7895
7896 * djgpp/config_h.sed: DJGPP specific configuration file.
7897
7898 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7899
7900 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7901
fc695704
AD
79022005-10-02 Akim Demaille <akim@epita.fr>
7903
7904 * data/location.cc: New, extract from...
7905 * data/lalr1.cc: here.
7906 (location.hh): Include it after the user prologue, in case the
7907 filename type is defined by the user.
7908 Forward declation location and position before the pre-prologue.
7909 (yyresult_): Rename as...
7910 (yyresult): this, it's a local variable, not an attribute.
7911 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7912
79132005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
7914
7915 * examples/extexi: Restore the #line generation.
7916
fb9712a9
AD
79172005-09-30 Akim Demaille <akim@epita.fr>,
7918 Alexandre Duret-Lutz <adl@gnu.org>
7919
7920 Move the token type and YYSTYPE in the parser class.
7921 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7922 (parser::token): New, from the moved free definition of tokens.
7923 (parser::semantic_value): Now a full definition instead of an
7924 indirection to YYSTYPE.
7925 (b4_post_prologue): No longer included in the header file, but
7926 in the implementation file.
7927 * doc/bison.texi (C+ Language Interface): Update.
7928 * src/parse-gram.y: Support unary %define.
7929 * tests/actions.at: Define global_tokens_and_yystype for backward
7930 compatibility until we update the tests.
7931 * tests/calc.at: Idem.
7932 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7933 to simplify the code.
7934
55f0c7b1
PE
79352005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7936
7937 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7938 Ah, the good old days! Problem reported by Peter Klein.
7939 * bootstrap (gnulib_modules): Add strerror, strtoul.
7940 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7941 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7942
fb9712a9 79432005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
7944
7945 * data/c.m4 (b4_error_verbose_if): New.
7946 * data/lalr1.cc: Use it.
7947 (YYERROR_VERBOSE_IF): Remove.
7948 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7949 parser members, replaced by...
7950 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7951 local variables.
7952 (yysyntax_error_): Takes the state number as argument.
7953 (yyreduce_print_): Use the argument yyrule, not the former
7954 attribute yyn_.
7955
8a6f72f3
PE
79562005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7957
7958 * bootstrap (gnulib_modules): Add verify.
7959 * lib/.cvsignore: Add verify.h.
7960 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7961 * src/system.h (verify): Remove.
7962 Include verify.h instead.
7963 * src/tables.c (tables_generate): Use new API for 'verify'.
7964
0d50976f
PE
79652005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7966
ebc3737e
PE
7967 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7968 local variables whose names begin with 'yy'.
7969 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7970 Trivial changes from Joel E. Denny.
7971
0d50976f
PE
7972 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7973 it itself.
7974 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7975 don't use alloca any more.
7976
7977 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7978 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 7979 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
7980 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7981 to match yacc.c, to test more hosts.
7982
a05b79df
PE
79832005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7984
55289366
PE
7985 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7986 doesn't affect behavior.
7987 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7988 Solaris, AIX, MSC.
7989 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7990 This works a bit better with glibc, if user code has already included
7991 stdlib.h.
7992 * doc/bison.texinfo (Bison Parser): Document that users can't
7993 arbitrarily use malloc and free for other purposes. Document
7994 that <alloca.h> and <malloc.h> might be included.
7995 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7996 user must declare alloca.
7997
a05b79df
PE
7998 * HACKING (release): Forwarn the Translation Project about
7999 stable releses.
8000
3ab2ca22
AD
80012005-09-20 Akim Demaille <akim@epita.fr>
8002
8003 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8004
a9739e7c
PE
80052005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8006
a702593e
PE
8007 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8008 (YYSTACK_ALLOC_MAXIMUM): Use it.
8009 (yysyntax_error): New function.
8010 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8011 multiple syntax errors are reported, and alloca is being used.
8012 Instead, reallocate buffers twice as big each time, so that
8013 we waste at most half the allocated memory. Start with a small
8014 (128-byte) buffer that will suffice in most cases anyway.
8015 Use yysyntax_error to do most of the work.
8016
8017 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8018 yynerrs is the number of errors reported, not the number of
8019 errors encountered.
8020
a9739e7c
PE
8021 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8022 Mark it as expected to fail.
8023 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8024 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8025 Don't start user-code symbols with "yy", to avoid name space problems.
8026
f479c6c6
AD
80272005-09-19 Akim Demaille <akim@epita.fr>
8028
8029 Remove the traits, failed experiment.
8030 It never proved useful, and anyway because of the current
8031 definition, it was not possible to have several specialization of
8032 this traits, making it useless.
8033 * data/lalr1.cc (yy:traits): Remove.
8034 Inline its definitions in the parser class.
8035
e2586f82
AD
80362005-09-19 Akim Demaille <akim@epita.fr>
8037
8038 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8039 least Mac OSX with a /usr/local install of gettext.
8040
2e8cf949
AD
80412005-09-19 Akim Demaille <akim@epita.fr>
8042
8043 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8044 and yytoken for similarity with the other skeletons.
8045
c7fb0b90
AD
80462005-09-19 Akim Demaille <akim@epita.fr>
8047
4e26c69e 8048 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 8049
1bd0deda
PE
80502005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8051
8052 * NEWS: Version 2.1.
8053
8054 * NEWS: Remove notice of yytname change, since it was never in an
8055 official release.
8056 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8057 diagnostic.
8058 * src/output.c (prepare): Likewise.
8059 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8060 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8061 is not defined. This is an awful hack, but it's enough for now.
8062 All callers changed.
8063 * tests/glr-regression-at (make_value): Args are const pointers now,
8064 to avoid GCC warning.
8065 (Duplicated user destructor for lookahead): New test. Currently
8066 skipped. It fails on my host but I'm not sure it'll always fail.
8067
80682005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
8069
8070 * src/symtab.h (struct symbol): Declare the printer and destructor
8071 as const, to avoid accidental calls to free.
8072 (symbol_destructor_set, symbol_printer_set): Adjust.
8073 * src/symtab.c: Adjust.
8074
1bd0deda 80752005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
8076
8077 * data/c.m4 (b4_token_enums): New.
8078 (b4_token_defines): Rename as...
8079 (b4_token_enums_defines): this.
8080 (b4_token_defines): New, output only the #defines.
8081 * data/yacc.c, data/glr.c: Adjust.
8082 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8083 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8084 as default values.
8085
dbcdae2d
AD
80862005-09-16 Akim Demaille <akim@epita.fr>
8087
8088 * data/lalr1.cc (yylex_): Remove, inline its code.
8089 (yyreport_syntax_error_): Remove, replaced by...
8090 (yysyntax_error_): this which returns a string and leaves to the
8091 caller the call to the users' error function.
8092 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8093 Move from members of the parser object...
8094 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8095 to local variables of the parse function.
8096
70d8f291
AD
80972005-09-16 Akim Demaille <akim@epita.fr>
8098
8099 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8100 since it's in Bison's name space.
8101
b47dbebe
PE
81022005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8103
ae199bf1
PE
8104 * data/glr.c (yyresolveValue): Add default case to pacify
8105 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8106
b47dbebe
PE
8107 * NEWS: Document when yyparse started to return 2.
8108 * doc/bison.texinfo (Parser Function): Document when yyparse
8109 returns 2.
8110
8111 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8112 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8113 changed.
8114 (class position): file_name -> filename (reverting). All uses changed.
8115
81162005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8117
8118 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8119 do anything if $@ exists. This reverts part of the 2005-07-07
8120 patch.
8121
00292f66
PE
81222005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8123
8124 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8125 contains obsolete information and isn't worth distributing as a
8126 separate file anyway.
8127 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8128 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8129 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8130 (yyparse): Abort if user code uses longjmp to throw an unexpected
8131 value.
8132
a420f962
PE
81332005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8134
00292f66
PE
8135 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8136 Suggested by twlevo@xs4all.nl.
8137
127287e9
PE
8138 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8139 This avoids a diagnostic from gcc -Wswitch-enum.
8140 Problem reported by twlevo@xs4all.nl.
8141
a420f962
PE
8142 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8143 standards. Use "file name" or "file" or "name", depending on
8144 the context.
8145 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8146 not to hack/foo.tab.c.
8147 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
8148 * data/glr.c: b4_filename -> b4_file_name.
8149 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8150 All uses changed.
8151 (class position): filename -> file_name. All uses changed.
8152 * data/yacc.c: b4_filename -> b4_file_name.
8153 * lib/bitset.h: filename -> file_name in local vars.
8154 * lib/bitset_stats.c: Likewise.
8155 * src/files.c: Likewise.
8156 * src/scan-skel.l ("@output ".*\n): Likewise.
8157 * src/files.c (file_name_split): Renamed from filename_split.
8158 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
8159
81602005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8161
8162 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8163 to accommodate latest gnulib.
8164
8165 * tests/glr-regression.at (Duplicate representation of merged trees):
8166 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8167
8168 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8169 needed.
8170
42a6501d
PE
81712005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8172
8173 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8174 All uses changed. Invoke user destructor after an error during a
8175 split parse (trivial change from Joel E. Denny).
8176
8177 * tests/glr-regression.at
8178 (User destructor after an error during a split parse): New test case.
8179 Problem reported by Joel E. Denny in:
8180 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8181
ef9a1faf
PE
81822005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8183
5b4aaf78
PE
8184 * README-cvs: Give URLs for recommended tools.
8185 Mention Gzip version problem, and bootstrapping issues.
8186 Remove troubleshooting section, as it's somewhat obsolete.
8187
b5240ba5
PE
8188 * bootstrap (no_cache): New var, to accommodate different wget
8189 variants. Use it instead of '-C off'. Problem reported by
8190 twlevo@xs4all.nl.
8191
ef9a1faf
PE
8192 * data/glr.c (yydestroyStackItem): New function.
8193 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8194 debugging information. Problem reported by Joel E. Denny.
8195
e6efa9da
AD
81962005-08-25 Akim Demaille <akim@epita.fr>
8197
8198 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8199
adc90f13
PE
82002005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8201
8202 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8203 Don't invoke destructor on unresolved entries.
8204 * tests/glr-regression.at
8205 (User destructor for unresolved GLR semantic value): New test case.
8206 Problem reported by Joel E. Denny in:
8207 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8208
f9315de5
PE
82092005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8210
15d29c1f
PE
8211 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8212 Add strnlen.c.
8213 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8214 lib-prefix.m4, po.m4.
8215
dd5f2af2
PE
8216 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8217 in yydestruct diagnostic, since it might not be an error.
8218 Problem reported by Joel Denny near end of
8219 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 8220 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
8221 * data/yacc.c (yyreturn): Likewise.
8222 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8223
8224 * src/files.c: Remove obsolete FIXME comment.
8225
8226 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8227 with the other templates, and to fix bogus run-on messages such
8228 as the one reported at the end of
8229 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8230 All callers changed to avoid the newline.
8231 (yyprocessOneStack): Output two lines rather than one, to accommodate
8232 the above change. This changes the debug output format slightly.
8233
f9315de5
PE
8234 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8235 reported by Joel E. Denny in
8236 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8237 (trivial change).
8238 * tests/glr-regression.at (Duplicate representation of merged trees):
8239 New test, from Joel E. Denny in:
8240 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8241 * THANKS: Add Joel E. Denny.
8242
8243 * configure.ac (AC_INIT): Bump to 2.0c.
8244
04098407
PE
82452005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8246
8247 * NEWS: Version 2.0b.
8248
ca5d2013
PE
8249 * Makefile.am (SUBDIRS): Put examples before tests, so that
8250 "make check" doesn't finish with "All 1 tests passed".
8251
3d54b576
PE
8252 * tests/regression.at (Token definitions): Don't rely on
8253 AT_PARSER_CHECK for data that contains backslashes. It currently
8254 uses 'echo', and 'echo' isn't portable if its argument contains
8255 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8256 that the byte '\0xff' is not printable in the C locale; it is,
8257 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8258 not printable, so use '\0x81' to test.
8259
d53ae497
PE
8260 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8261 version of GCC, since the macro is used with non-GCC compilers.
8262
fc01665e
PE
8263 Fix core dump reported by Pablo De Napoli in
8264 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8265 * tests/regression.at (Invalid inputs with {}): New test.
8266 * src/parse-gram.y (token_name): Translate type before using
8267 it as an index.
8268
04098407
PE
8269 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8270 the user's name space. All uses changed to __attribute__
8271 ((__unused__)).
8272 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8273 Add __attribute__ ((__noreturn__)).
8274
8275 * etc/clcommit: Remove. We weren't using it, and it failed
8276 "make maintainer-distcheck".
8277 * Makefile.maint: Merge from coreutils.
8278 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8279 (syntax-check-rules): Change list of rules as described below.
8280 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8281 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8282 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8283 (sc_trailing_space): New rules.
8284 (sc_xalloc_h_in_src): Remove.
8285 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8286 (sc_space_tab, sc_error_exit_success, sc_changelog):
8287 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8288 (makefile-check, po-check, author_mark_check):
8289 (makefile_path_separator_check, copyright-check):
8290 Use grep -n, to make it easier to find violations.
8291 Use CVS_LIST and CVS_LIST_EXCEPT.
8292 (header_regexp, h_re): Remove.
8293 (dd_c): New macro.
8294 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8295 (my-distcheck): Use more-modern GCC flags.
8296 (signatures, %.asc): Remove.
8297 (rel-files, announcement): Remove signatures.
8298 Restore old updating code, even though we don't use it, so
8299 that we're the same as coreutils.
8300 (alpha, beta, major): Depend on news-date-check.
8301 Make the upload commands.
8302
8303 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8304 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8305 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8306 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8307 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8308 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8309 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8310 * tests/sets.at: Likewise.
8311
8312 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8313 we comment out the Autoconf version number.
8314 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8315 it's error-prone and "make maintainer-distcheck" rejects it.
8316
8317 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8318 Indent calls to "error" to pacify "make maintainer-distcheck",
8319 when the calls are not intended to be translated.
8320 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8321
8322 * src/Makefile.am (DEFS): Use +=, to pacify
8323 "make maintainer-distcheck".
8324 (bison_SOURCES): Add scan-skel.h.
8325 (sc_tight_scope): New rule, from coreutils.
8326
8327 * src/files.c (src_extension, header_extension):
8328 Now static, not extern.
8329 * src/getargs.c (short_options): Likewise.
8330 * src/muscle_tab.c (muscle_table): Likewise.
8331 * src/parse-gram.y (current_class, current_type, current_prec):
8332 Likewise.
8333 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8334 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8335 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8336 void, to avoid warning when NLS is disabled.
8337 * src/output.c: Include scan-skel.h.
8338 (scan_skel): Remove decl, since scan-skel.h does this.
8339 (output_skeleton):
8340 Indent calls to "error" to pacify "make maintainer-distcheck".
8341 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8342 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8343 "make maintainer-distcheck".
8344 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8345 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8346 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8347 (skel_lex_destroy, scan_skel): Move these decls to...
8348 * src/scan-skel.h: New file.
8349 * src/uniqstr.c (uniqstr_assert):
8350 Indent calls to "error" to pacify "make maintainer-distcheck".
8351
8352 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8353 not @VAR@.
8354
8355 * tests/torture.at: Revamp to avoid misuse of atoi that
8356 "make maintainer-distcheck" complained about.
8357
8358 * examples/extexi (message): Don't print a message more than once,
8359 and omit line-number decoration that makes Emacs compile think
8360 that informative messages are worth worrying about.
8361
83622005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8363
8364 * configure.ac: Update version number.
8365
8366 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8367 accidentally.
8368 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8369 autogenerated by the maintainer.
8370 * examples/calc++/.cvsignore: Add *.yy.
8371
8372 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8373 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8374 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8375
8376 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8377
8378 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8379 from maintainer-distcheck about casting the argument of 'free'.
8380
8381 * NEWS: Mention recent yytname changes.
8382 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8383
8384 * bootstrap: For translations that have not yet been upgraded to
8385 the new runtime-po domain, prime the pump by extracting the
8386 relevant strings from the obsolete translations. This code can be
8387 removed once the bison-runtime domain has been translated by each
8388 team.
8389
8390 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8391 now that token names are already quoted.
8392
8393 Fix problem reported by Anthony Heading.
8394 * data/glr.c (YYTOKEN_TABLE): New macro.
8395 (yytname): Define if YYTOKEN_TABLE.
8396 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8397 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8398 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8399 * src/output.c (prepare_symbols): Output token_table_flag.
8400
0ffda363
PE
84012005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8402
8403 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8404 again if the first call fails.
8405
8406 * data/glr.c (yytnamerr): New function.
8407 (yyreportSyntaxError): Use it to dequote most string literals.
8408 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8409 with other skeletons. All uses changed.
8410 (yytnameerr_): New function.
8411 (yyreport_syntax_error): Use it to dequote most string literals.
8412 * data/yacc.c (yytnamerr): New function.
8413 (yyerrlab): Use it to decode most string literals.
8414 * doc/bison.texinfo (Decl Summary, Calling Convention):
8415 Clarify quoting convention of yytname.
8416 * src/output.c (prepare_symbols): Quote all names. This undoes
8417 the 2005-04-17 change, which is now accomplished (mostly) via
8418 changes in the parsers as described above.
8419 * tests/regression.at (Token definitions, Web2c Actions):
8420 Undo most 2005-04-17 change here, too.
8421
84222005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8423
8424 Fix more problems reported by twlevo@xs4all.nl.
8425 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8426 remove trailing spaces. This loses the exit status of ./types,
8427 and isn't needed since ./types shouldn't be emitting trailing
8428 spaces.
8429 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8430 as the stack isn't valid in that case.
8431
8432 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8433 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8434 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8435 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8436 is used.
8437 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8438 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8439 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8440 Likewise.
8441
8442 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8443 overly-picky compilers that reject 'char *foo = "bar";'.
8444
8445 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8446 to FILE * parameter, not to stderr. This fixes a typo introduced
8447 in the 2005-07-12 change.
8448
8449 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8450 warnings from GCC 4.
8451
8452 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8453 (yyglrShiftDefer, yysplitStack):
8454 Remove unused parameters b4_pure_formals. All uses changed.
8455 (yyglrShift): Remove unused parameters b4_user_formals.
8456 All uses changed.
8457 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8458
6100a9aa
PE
84592005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8460
258b75ca
PE
8461 Destructor cleanups and regularization among the three skeletons.
8462 * NEWS: Document the behavior changes.
8463 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8464 stack before failing, as the cleanup code will do it for us now.
8465 * data/lalr1.cc (yyerrlab): Likewise.
8466 * data/glr.c (yyparse): Pop everything off the stack before
8467 freeing it, so that destructors get called properly.
8468 * data/lalr1.cc (yyreturn): Likewise.
8469 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8470 This is more consistent.
8471 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8472 why destructors might be called. 1.875 -> 2.1.
8473 (Destructor Decl, Decl Summary, Table of Symbols):
8474 Some English-language cleanups for %destructor.
8475 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8476 Add output line for destructor of start symbol.
8477 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8478 because of that same extra output line.
8479
1a059451
PE
8480 * NEWS: Document minor wording changes in diagnostics of
8481 Bison-generated parsers.
8482 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8483 Remove unused formals. All uses changed.
8484 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8485 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8486 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8487 Rename yyoverflowab to yyexhaustedlab.
8488 When memory exhaustion occurs during syntax-error reporting,
8489 report it separately rather than in a single diagnostic; this
8490 eases translation.
8491 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8492 (Memory Exhausted): Renamed from Parser Stack Overflow.
8493 Revamp wording slightly to prefer "memory exhaustion".
8494 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8495
97460c78
PE
8496 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8497
30757c8c
PE
8498 Add i18n support to the GLR skeleton. Partially fix the C++
8499 skeleton; a C++ expert needs to finish this. Remove debugging
8500 msgids; there's little point to having them translated, since they
8501 can be understood only by someone who can read the
8502 (English-language) source code.
8503
8504 Generate runtime-po/bison-runtime.pot automatically, so that we
8505 don't have to worry about garbage getting in that file. We'll
8506 make sure after the next official release that old msgids don't
8507 get lost. See
8508 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8509
8510 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8511 Now auto-generated.
8512 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8513 Fix typos in explanations of the runtime file.
8514 * bootstrap: Change gettext keyword from YYI18N to YY_.
8515 Use standard Makefile.in.in in runtime-po, since we'll arrange
8516 for backward-compatible bison-runtime.po files in a different way.
8517 * data/glr.c (YY_): New macro, from yacc.c.
8518 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8519 Translate messages intended for users.
8520 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8521 the wording in the other skeletons. We don't know that the memory
8522 is virtual.
8523 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8524 Use same method that yacc.c uses.
8525 Don't translate debugging messages.
8526 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8527 it doesn't work (yet), and requires C++ expertise to fix.
8528 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8529 Move defn to a more logical place, to be consistent with other
8530 skeletons.
8531 Don't translate debugging messages.
8532 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8533 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8534 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8535 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8536
ac8c5689
PE
8537 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8538 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8539 void, not int.
8540 * tests/glr-regression.at (Badly Collapsed GLR States):
8541 Likewise.
8542 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8543 yylex should return 0 at EOF rather than aborting.
8544
6100a9aa
PE
8545 Improve tests for stack overflow in GLR parser.
8546 Problem reported by twlevo@xs4all.nl.
8547 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8548 All uses removed.
8549 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8550 can handle the problem.
8551 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8552 (yyparse): New local variable yyresult to record the result.
8553 Use result of setjmp to set it, rather than storing itinto
8554 struct.
8555 (yyDone): Remove label.
8556 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8557 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8558 if YYABORT is used).
8559 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8560 yyparse status; put status > 1 into diagnostic.
8561 Check that status==2 works.
8562 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8563 Use exit status 3 for failure to open (which shouldn't happen).
8564
15f40952
PE
85652005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8566
67fd79c4
PE
8567 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8568 1 on syntax error; just let yyparse do its thing.
8569 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8570 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8571 (Exploding the Stack Size with Alloca):
8572 (Exploding the Stack Size with Malloc):
8573 Expect exit status 2, not 1, since the parser is supposed to blow
8574 its stack. Problem reported by twlevo@xs4all.nl.
8575
15f40952
PE
8576 * data/glr.c (yyparse): Don't assume that the initial calls
8577 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8578 Print a stack-overflow message and fail instead.
8579 Initialize the line-number information before creating the stack,
8580 so that the stack-overflow message can report line zero safely.
8581
f32c66b5
PE
85822005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8583
a22ff96f 8584 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
8585 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8586 (yyuserMerge): Provide a default case if b4_mergers is empty.
8587 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8588 * tests/glr-regression.at
8589 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 8590 Add casts to pacify C++ compilers.
1beb0b24
PE
8591 * tests/glr-regression.at (Improper merging of GLR delayed action
8592 sets): Declare yylex before using it.
f32c66b5 8593 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
8594 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8595 test for valgrind; valgrind is independent of g++.
8596 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8597 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8598 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8599 Use a destructor, so that we can expand the stack. Change
8600 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 8601
d741bd1b
PE
86022005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8603
8604 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8605 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8606
0410a6e0
PE
86072005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8608
8609 * PACKAGING: New file, suggested by Bruno Haible and taken from
8610 similar wording in gettext's PACKAGING file.
8611 * NEWS: Mention PACKAGING.
8612 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8613
f7ab6a50
PE
86142005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8615
baf785db 8616 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
8617 * bootstrap: Get runtime translations into runtime-po.
8618 Create runtime-po files automatically, if possible.
8619 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8620 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8621 does not infringe on the user's name space.
8622 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8623 * doc/bison.texinfo (Internationalization): Revamp the English
8624 and Texinfo syntax a bit, to try to make it clearer.
8625 (Bison Options, Option Cross Key): Mention --print-localedir.
8626 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8627 YYENABLE_NLS. Quote a bit more.
8628 * runtime-po/.cvsignore: New file.
8629 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8630 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8631 * runtime-po/quot.sed: Likewise.
8632 * runtime-po/boldquot.sed: Likewise.
8633 * runtime-po/en@quot.header: Likewise.
8634 * runtime-po/en@boldquot.header: Likewise.
8635 * runtime-po/insert-header.sin: Likewise.
8636 * runtime-po/remove-potcdate.sin: Likewise.
8637 * runtime-po/Makevars: Likewise.
8638 * runtime-po/LINGUAS: Likewise.
8639 * runtime-po/de.po: Likewise; we will rely on the translation project
8640 to maintain this, so "bootstrap" should get it.
0410a6e0 8641 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
8642 its value.
8643 * src/main.c (main): Bind the bison-runtime domain, too.
8644
86452005-07-12 Bruno Haible <bruno@clisp.org>
8646
8647 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8648 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8649 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8650 * runtime-po: New directory.
8651 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8652 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8653 * runtime-po/Rules-quot: New file, copied from po/.
8654 * runtime-po/quot.sed: Likewise.
8655 * runtime-po/boldquot.sed: Likewise.
8656 * runtime-po/en@quot.header: Likewise.
8657 * runtime-po/en@boldquot.header: Likewise.
8658 * runtime-po/insert-header.sin: Likewise.
8659 * runtime-po/remove-potcdate.sin: Likewise.
8660 * runtime-po/Makevars: New file.
8661 * runtime-po/POTFILES.in: New file.
8662 * runtime-po/LINGUAS: New file.
8663 * runtime-po/bison-runtime.pot: New file.
8664 * runtime-po/de.po: New file.
8665 * m4/bison.m4: New file.
8666 * Makefile.am (SUBDIRS): Add runtime-po.
8667 (aclocaldir, aclocal_DATA): New variables.
8668 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8669 Define aclocaldir.
8670 * src/getargs.c (usage): Document --print-localedir option.
8671 (PRINT_LOCALEDIR_OPTION): New enum item.
8672 (long_options): Add --print-localedir option.
8673 (getargs): Handle --print-localedir option.
8674 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8675 (Internationalization): New section.
8676
22dda0f0
AD
86772005-07-12 Akim Demaille <akim@epita.fr>
8678
8679 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8680 for consistency with the rest of the code.
8681 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8682 Add separators.
8683
82b248ad
AD
86842005-07-12 Akim Demaille <akim@epita.fr>
8685
8686 * src/parse-gram.y: Use %printer instead of YYPRINT.
8687
fa0e9314
AD
86882005-07-12 Akim Demaille <akim@epita.fr>
8689
867a3e00
AD
8690 * src/symtab.h, src/symtab.c (symbol_print): New.
8691 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8692 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8693
86942005-07-12 Akim Demaille <akim@epita.fr>
8695
8696 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
8697 b4_at_dollar and b4_dollar_dollar.
8698
e054b190
PE
86992005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8700
8701 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8702 and Pennello's paper.
8703
34160ec4
PE
87042005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8705
407d4a75
PE
8706 * data/yacc.c (yyparse): Undo previous patch. Instead,
8707 set yylsp[0] and yyvsp[0] only if the initial action
8708 sets yylloc and yylval, respectively.
8709
34160ec4
PE
8710 * data/yacc.c (yyparse): In the initial action, set
8711 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8712 This avoids the use of undefined variables if the initial
8713 action does not set yylloc and/or yylval.
8714
c3d5a4a7
PE
87152005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8716
b34d96c1
PE
8717 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8718 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8719 Remove from CVS. These files are automatically generated.
8720 * examples/extexi: Clarify that this file is now part of Bison,
8721 not GNU M4, and that it works with any POSIX-compatible Awk.
8722 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8723 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8724 so that we also get calc++-parser.yy. Geneate it.
8725 Use $(AWK), not gawk, since any conforming Awk will do.
8726 Put comment before action, since older 'make' can't handle comment
8727 in action.
8728 $(BUILT_SOURCES): List all built sources, not just some of them.
8729 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8730 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8731 $($(calc_sources_generated)): Remove unnecessary test for existence
8732 of target. (This had a shell syntax error anyway; a stray "x".)
8733 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8734 calc++-parser.yy.
8735 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8736
c3d5a4a7
PE
8737 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8738 implied by the other modules.
8739
828c373b
AD
87402005-07-06 Akim Demaille <akim@epita.fr>
8741
8742 Bind examples/calc++ to the package.
8743 * examples/calc++/Makefile: Remove, replaced by...
8744 * examples/calc++/Makefile.am: ... this new file.
8745 * examples/calc++/test: Remove input.
8746 * examples/calc++/compile: Remove.
8747 * examples/Makefile.am: New.
8748 * configure.ac, Makefile.am: Adjust.
8749 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8750
63cb01d6
PE
87512005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8752
fd2df2ed
PE
8753 * data/glr.c (yyFail): Drastically simplify; since the format argument
8754 never had any % directives, we can simply pass it to yyerror.
8755 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8756 be modified later, as that is the usual style in glr.c.
8757 Problems reported by Paul Hilfinger.
8758
63cb01d6
PE
8759 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8760 and size overflow errors.
8761 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8762 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8763 (YYSIZEMAX): New macro.
8764 (yystpcpy): New function, taken from yacc.c.
8765 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8766 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8767 so that we don't have to maintain their signatures.
8768 (yyFail): Check for buffer overflow, by using vsnprintf rather
8769 than vsprintf. Allocate a bigger buffer if possible.
8770 Report an error if buffer allocation fails.
8771 (yyStackOverflow): New function.
8772 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8773 the initialization was successful. It might fail if storage was
8774 exhausted.
8775 (yyexpandGLRStack): Add more checks for storage allocation failure.
8776 Use yyStackOverflow to report failures.
8777 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8778 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8779 Don't assume stack number fits in int.
8780 (yysplitStack): Check for storage allocation failure.
8781 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8782 can print diagnostics on storage allocation failure. All callers
8783 changed.
8784 (yyresolveValue): Use yybool for boolean.
8785 (yyreportSyntaxError): Check for size-calculation overflow.
8786 This code is taken from yacc.c.
8787 (yyparse): Check for storage allocation errors when allocating
8788 the initial stack.
8789
1c59e0a1
AD
87902005-07-05 Akim Demaille <akim@epita.fr>
8791
8792 Extract calc++ from the documentation.
8793 * doc/bison.texinfo (Calc++): Add the extraction marks.
8794 * examples/extexi: New, from the aborted GNU Programming 2E.
8795 Separate the different paragraph of a file with empty lines.
8796 * examples/Makefile: Use it to extract the whole calc++ example.
8797
8a0adb01
AD
87982005-06-24 Akim Demaille <akim@epita.fr>
8799
8800 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8801 class typedefs.
8802
12545799
AD
88032005-06-22 Akim Demaille <akim@epita.fr>
8804
8805 * doc/bison.texinfo (C++ Language Interface): First stab.
8806 (C++ Parsers): Remove.
8807
99be0235
AD
88082005-06-22 Akim Demaille <akim@epita.fr>
8809
8810 * data/lalr1.cc (yylex_): Honor %lex-param.
8811
0ffd4fd1
AD
88122005-06-22 Akim Demaille <akim@epita.fr>
8813
8814 Start a set of simple examples.
8815 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8816 * examples/calc++/calc++-driver.hh,
8817 * examples/calc++/calc++-parser.yy,
8818 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8819 * examples/calc++/compile, examples/calc++/test: New.
8820
0925ebb4
PE
88212005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8822
8823 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8824 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8825 which stems from the 2005-05-27 patch.
8826
43d3b664
PH
88272005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8828
8829 * data/glr.c: Modify treatment of unused parameters to permit use
8830 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8831
3062864d
PE
88322005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8833
8834 Fix infringement on user name space reported by Janos Zoltan Szabo.
8835 * data/yacc.c (yyparse): strlen -> yystrlen.
8836
989b5b8e
AD
88372005-05-30 Akim Demaille <akim@epita.fr>
8838
8839 * data/lalr1.cc (_): New.
8840 Translate the various messages.
8841
bedf57f5
PE
88422005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8843
8844 Fix infringement on user name space reported by Bruno Haible.
8845 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8846 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8847 the user's name space.
8848 (alloca): Include <stdlib.h> to get it, if it's not built in.
8849 (YYMALLOC, YYFREE): Define only if needed.
8850 (malloc, free): Declare, but only if needed, as this infringes on
8851 the user name space.
8852
4d1801f1
PE
88532005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8854
8855 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8856 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8857 with %d format.
8858 * lib/ebitset.c (min, max): Undef before defining.
8859 * lib/vbitset.c (min, max): Likewise.
8860 * lib/subpipe.c (create_subpipe): Save local variables in case
8861 vfork clobbers them.
8862
88632005-05-24 Bruno Haible <bruno@clisp.org>
8864
8865 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8866 error message syntax used by gcc-4.0.
8867
b94a9e1e
PE
88682005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8869
85ac3861
PE
8870 * README: Mention m4 1.4.3. Remove obsolete advice about
8871 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8872
b94a9e1e
PE
8873 * bootstrap: Remove workaround for problem I encountered with
8874 gettext 0.14.1; it seems to be fixed now.
8875
51c30d21
PE
88762005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8877
009ce67d
PE
8878 * NEWS: Version 2.0a.
8879
f2a97c62
PE
8880 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8881 the previous change.
8882
c8775f93
PE
8883 Various maintainer cleanups.
8884 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8885 conftest*, for benefit of CVS commands run at the same time as
8886 "configure". Add build-aux, since "bootstrap" now creates it and
8887 its subfiles.
8888 * Makefile.cfg (move_if_change): Remove.
8889 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8890 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8891 (po_repo, do-po-update, po-update, wget_files, get-targets):
8892 (config.guess-url_prefix, config.sub-url_prefix):
8893 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8894 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8895 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8896 Remove.
8897 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8898 this is now the recommended name.
8899 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8900 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8901 ylwrap. These files now go into build-aux.
8902 * config/move-if-change: Remove.
8903 * config/prev-version.txt: Bump from 1.75 to 2.0.
8904
3ea5f0ec
PE
8905 * bootstrap: Add stdio-safer, unistd-safer modules.
8906 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8907 we don't need it).
8908 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8909 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8910 * lib/subpipe.c: Include "unistd-safer.h".
8911 (create_subpipe): Make sure all the newly-created
8912 file descriptors are > 2, so that diagnostics don't
8913 get sent down them (which might cause Bison to hang, in theory).
8914 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8915 * src/files.c (xfopen): Use fopen_safer, not fopen.
8916
51c30d21
PE
8917 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8918 yesterday's yacc.c fix.
8919
cea1469d
PE
89202005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8921
3ea5f0ec
PE
8922 * data/glr.c, data/lalr1.cc: Update copyright date.
8923
cea1469d
PE
8924 Fix a destructor bug reported by Wolfgang Spraul in
8925 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8926 * data/yacc.c (yyabortlab): Don't call destructor, and
8927 don't set yychar to EMPTY.
8928 (yyoverflowlab): Don't call destructor.
8929 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8930 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8931 since we no longer output the message "discarding lookahead token
8932 end of input ()".
8933
5e6f62f2
PH
89342005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8935
8936 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8937 fix a small glitch in debugging output.
8938 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8939 after YY_SYMBOL_PRINT where needed.
8940
8941 (struct yyGLRState): Add some comments.
8942 (struct yySemanticOption): Add some comments.
8943 (union yyGLRStackItem): Add comment.
8944
8945 (yymergeOptionSets): Correct this to properly perform the union,
8946 avoiding infinite reported by Michael Rosien.
8947 Update comment.
8948
8949 * tests/glr-regression.at: Add test for GLR merging error reported
8950 by M. Rosien.
cea1469d 8951
0fb669f9
PE
89522005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8953
8954 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8955 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8956 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8957 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8958 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8959 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8960 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8961 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8962 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8963 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8964 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8965 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8966 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8967 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8968 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8969 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8970 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8971 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8972 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8973 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8974 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8975 src/output.h, src/parse-gram.c, src/parse-gram.h,
8976 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8977 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8978 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8979 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8980 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8981 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8982 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8983 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8984 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8985 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8986 tests/reduce.at, tests/regression.at, tests/sets.at,
8987 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8988 Update FSF postal mail address.
8989
51f4735e
PE
89902005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8991
8992 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8993 Problem reported by Ralf Menzel.
8994
80ce3401
PE
89952005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8996
8997 * tests/actions.at: Test that stack overflow invokes destructors.
8998 From Marcus Holland-Moritz.
8999 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9000 from here....
9001 (yyreturn): to here. That way, destructors are called properly
9002 even if the stack overflows, or the user calls YYACCEPT or
9003 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9004 (yyoverflowlab): Destroy the lookahead.
9005
90062005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9007
9008 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9009
72f000b0
PE
90102005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9011
9012 * NEWS: Bison-generated C parsers no longer quote literal strings
9013 associated with tokens.
9014 * src/output.c (prepare_symbols): Don't escape strings,
9015 since users don't want to see C escapes.
9016 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9017 in diagnostics.
c19683bb 9018 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
9019 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9020
1094323f
PE
90212005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9022
9023 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9024 the data size is known to be too small and we can't increase it.
9025 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9026
ca407bdf
PE
90272005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9028
9029 * src/parse-gram.y: Include quotearg.h.
9030 (string_as_id): Quote $1 before using it as a key, since the
9031 lexer no longer quotes it for us.
9032 (string_content): Don't strip quotes, since lexer no longer
9033 quotes it for us.
9034 * src/scan-gram.l: Include quotearg.h.
9035 ("\""): Omit quote.
9036 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9037 a key, since the rest of the lexer doesn't quote it.
9038 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9039 * tests/regression.at (Token definitions): Check for backslashes
9040 in token strings.
9041
9042 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9043 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9044 (yyparse): Revamp code to generate long syntax error message, to
9045 make it easier to translate, and to avoid problems with arithmetic
9046 overflow. Change "virtual memory" to "memory" in diagnostic, since
9047 we don't know whether the memory is virtual.
9048
1ce59070
PE
90492005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9050
9051 * NEWS: Bison-generated C parsers now use the _ macro to
9052 translate strings.
9053 * data/yacc.c (_) [!defined _]: New macro.
9054 All English strings wrapped inside this macro.
9055 * doc/bison.texinfo (Bison Parser): Document _.
9056 * po/POTFILES.in: Include src/parse-gram.c, since it now
9057 includes translateable strings that parse-gram.y doesn't.
9058
a749a695
PE
90592005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9060
9061 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9062 reverting the 2004-10-11 change to this function.
9063 (symbol_check_alias_consistency): Don't call symbol_type_set
9064 if the type name is already correct.
9065 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9066
8fb1053b
PE
90672005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9068
9069 * tests/regression.at (Token definitions): Don't use a token named
9070 c, as that generates a "#define c ..." that runs afoul of buggy
9071 stdlib.h that uses the identifier c as a member of struct
9072 drand48_data. Problem reported by Horst Wente.
9073
ff498c4a
PE
90742005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9075
9076 * bootstrap: Change translation URL from
9077 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9078 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9079 redirection glitches. Problem reported by twlevo@xs4all.nl.
9080
65211d70
PE
90812005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9082
9083 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9084 after operands; POSIX says this isn't portable for the c99 command.
9085
9577fb1f
PE
90862005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9087
9088 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9089 immediately if a data overrun has occurred; this may help us track
9090 down what may be a spurious failure on MacOS.
9091
78b178f7
PE
90922005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9093
a2599d0f
PE
9094 Respond to problems reported by twlevo@xs4all.nl.
9095
9096 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9097
78b178f7
PE
9098 * src/vcg.h: Comment fix.
9099 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9100 (G_CMAX): Change to -1 instead of INT_MAX.
9101
9102 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 9103
7296e729
PE
91042005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9105
9106 * src/tables.c (state_number_to_vector_number): Put it inside an
9107 "#if 0", since it's not currently used. Problem reported by
9108 Roland McGrath.
9109
05ac60f3
PE
91102005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9111
9112 * src/output.c (escaped_output): Renamed from
9113 escaped_file_name_output, since we now use it for symbol tags as
9114 well. All uses changed.
9115 (symbol_destructors_output, symbol_printers_output):
9116 Escape symbol tags too.
9117 Problem reported by Matyas Forstner in
9118 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9119
9120 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9121 not needed.
9122 * src/output.c (user_actions_output, token_definitions_output,
9123 symbol_destructors_output, symbol_printers_output): Likewise.
9124 * src/reader.c (prologue_augment): Likewise.
9125 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9126
9127 * src/vcg.c (output_edge): Don't quote linestyle arg.
9128 Problem reported by twlevo@xs4all.nl.
9129
7eb453ac
PE
91302005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9131
9132 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9133 example, reported by Derek M Jones. Also, make the example even
9134 more outrageous, to better illustrate how bad the problem is.
9135
4c04c52a
PE
91362005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9137
9138 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9139 putsym. Typo reported by Sebastian Piping.
9140
a61e1620
PE
91412005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9142
9143 * doc/bison.texinfo (Language and Grammar): some -> same
9144 (Epilogue): int he -> in the
9145 Typos reported by Sebastian Piping via Justin Pence.
9146
9ec93868
PE
91472005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9148
9149 * tests/glr-regression.at (Improper handling of embedded actions
9150 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9151 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9152 with dollar signs in test names.
9153 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9154 for a similar reason.
9155
73ce7e7e
PE
91562005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9157
9158 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9159 wants to redefine G_VIEW.
9160
2e72b98e
PE
91612005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9162
9163 * src/vcg.c (get_view_str): Remove case for normal_view.
9164 Problem reported by twlevo@xs4all.nl.
9165
e0d634e5
PE
91662005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9167
ccf830a4
PE
9168 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9169 Problem reported by twlevo@xs4all.nl.
9170
e0d634e5
PE
9171 * doc/bison.texinfo: Change @dircategory from "GNU programming
9172 tools" to "Software development". Requested by Richard Stallman
9173 via Karl Berry.
9174
7bbc8cb0
PE
91752005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9176
9177 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9178 Problem reported by twlevo@xs4all.nl.
9179
08b770bc
PE
91802005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9181
9182 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9183 keyword; it's not needed with modern compilers, and it doesn't
9184 affect correctness with older compilers. Suggested by
9185 twlevo@xs4all.nl.
9186
95f22ad2
PE
91872005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9188
9189 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9190 gcc -Wswitch-default.
9191 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9192 * data/yacc.c (yyparse): Likewise.
9193
d229d15c
PE
91942005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9195
9196 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9197 already. Let config.h define any nonstandard values.
9198
ecadd90f
PE
91992005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9200
9201 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9202 for the benefit of slower hosts. Problem reported by
9203 Nelson H. F. Beebe.
9204
213744b5
PE
92052005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9206
9207 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9208 being defined and not used.
9209 * data/lalr1.cc (yyparse): Likewise.
9210 Use "if (false)" rather than "if (0)".
9211
249d3236
PE
92122005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9213
9214 * TODO: Mention that we should allow NUL bytes in tokens.
9215
987cc1fb
PE
92162005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9217
9218 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9219 Problem reported by Hans Aberg.
9220
08fe02d9
PE
92212005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9222
9223 * src/getargs.c (version): Happy new year; update overall
9224 program copyright date from 2004 to 2005.
9225
9226 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9227 Problem reported by Hans Aberg.
9228 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9229 (Output file names.): Add a test for the case when standard output
9230 is closed.
9231
010c0266
PE
92322004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9233
9234 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9235 to fix an oversight in the Bison 2.0 manual.
9236
da12206a
PE
92372004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9238
9239 * NEWS: Version 2.0. Reformat the existing news items since
9240 1.875, so that related items are grouped together.
3a4734aa 9241 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
9242 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9243
c935d934
PE
9244 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9245 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9246 otherwise, we're not testing alloca. Unfortunately there's no
9247 simple way to consult HAVE_ALLOCA here.
9248
da12206a
PE
9249 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9250 for yymsg, too.
9251
9252 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9253 hand. This avoids a warning about comparing int to size_t when
9254 GCC warnings are enabled.
9255
0a2c5137
PE
92562004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9257
d7e14fc0
PE
9258 * NEWS: Bison-generated parsers no longer default to using the
9259 alloca function (when available) to extend the parser stack, due
9260 to widespread problems in unchecked stack-overflow detection.
9261 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9262 responsibility to set it to a positive value. This lets the user
9263 specify a value that is not a preprocessor constant.
9264 * data/yacc.c (YYMAXDEPTH): Likewise.
9265 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9266 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9267 to be a compile-time constant. However, explain the constraints on it.
9268 Also, explain the constraints on YYINITDEPTH.
9269 (Table of Symbols): Explain that alloca is no longer the default.
9270 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9271 to 1.
9272
0a2c5137
PE
9273 * doc/bison.texinfo (Location Default Action): Mention that n must
9274 be zero when k is zero. Suggested by Frank Heckenbach.
9275
e019c247
AD
92762004-12-22 Akim Demaille <akim@epita.fr>
9277
9278 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9279 (parser::state_type, parser::semantic_type, parser::location_type):
9280 Private, not public.
9281 (parser::parse): Return ints, not bool.
9282 Returning a bool introduces a problem: 0 corresponds to false, and
9283 it seems weird to return false on success. Returning true changes
9284 the conventions for yyparse.
9285 Alternatively we could return void and send an exception.
9286 There is no clear consensus (yet?).
9287 (state_stack, semantic_stack, location_stack): Rename as...
9288 (state_stack_type, semantic_stack_type, location_stack_type): these.
9289 Private, not public.
9290 * tests/c++.at: New.
9291 * tests/testsuite.at, tests/Makefile.am: Adjust.
9292
72731bb7
AD
92932004-12-21 Akim Demaille <akim@epita.fr>
9294
9295 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9296
9a0d8bec
AD
92972004-12-21 Akim Demaille <akim@epita.fr>
9298
9299 Don't impose std::string for filenames.
9300
9301 * data/lalr1.cc (b4_filename_type): New.
9302 (position::filename): Use it.
9303 (parser.hh): Move the inclusion of stack.hh and location.hh below
9304 the user code, so that needed headers for the filename type can be
9305 included first.
72731bb7
AD
9306 Forward declare them before the user code.
9307 * tests/Makefile.am (check-local, installcheck-local): Pass
9308 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 9309
99880de5
AD
93102004-12-20 Akim Demaille <akim@epita.fr>
9311
9312 Use more STL like names: my_class instead of MyClass.
9313
9314 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9315 (SemanticStack, SemanticType, StateStack, StateType)
9316 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9317 (Parser::value): Rename as...
9318 (location_stack, location_type, rhs_number_type, semantic_stack)
9319 (semantic_type, state_stack, state_type, token_number_type, stack)
9320 (slice, traits, parser::yylloc, parser::yylval): these.
9321
9322 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9323
9bec482e
PE
93242004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9325
9326 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9327 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9328
f6fbd3da
PE
93292004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9330
9331 Remove uses of 'short int' and 'unsigned short int'. This raises
9332 some arbitrary limits. It uses more memory but nowadays that's
9333 not much of an issue.
9334
9335 This change does not affect the generated parsers; that's a different
9336 task, as some users will want to conserve memory there.
9337
9338 Ideally we should use size_t to represent all object counts, and
9339 something like ptrdiff_t to represent signed differences of object
9340 counts; but that will require more code-cleanup than I have the
9341 time to do right now.
9342
9343 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9344 Use size_t, not int or short int, to count objects.
9345 * src/closure.c (nritemset, closure): Likewise.
9346 * src/closure.h (nritemset, closure): Likewise.
9347 * src/nullable.c (nullable_compute): Likewise.
9348 * src/print.c (print_core): Likewise.
9349 * src/print_graph.c (print_core): Likewise.
9350 * src/state.c (state_compare, state_hash): Likewise.
9351 * src/state.h (struct state): Likewise.
9352 * src/tables.c (default_goto, goto_actions): Likewise.
9353
9354 * src/gram.h (rule_number, rule): Use int, not short int.
9355 * src/output.c (prepare_rules): Likewise.
9356 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9357 errs, reductions): Likewise.
9358 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9359 Likewise.
9360 * src/tables.c (vector_number, tally, action_number,
9361 ACTION_NUMBER_MINIMUM): Likewise.
9362 * src/output.c (muscle_insert_short_int_table): Remove.
9363
efeed023
AD
93642004-12-17 Akim Demaille <akim@epita.fr>
9365
9366 * data/lalr1.cc: Extensive Doxygenation.
9367 (error_): Rename as...
9368 (error): this, since it is visible to the user.
9369 Adjust callers.
9370 (Parser::message): Now an automatic variable from...
9371 (Parser::yyreport_syntax_error_): here.
9372 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9373 Parser::error.
9374 * tests/input.at: Escape $.
9375
bc82c5a5
PE
93762004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9377
9378 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9379 Parenthesize rhs to avoid obscure problems with mistakes like
9380 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9381 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9382 b4_rhs_location): Likewise.
9383 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9384 b4_rhs_location): Likewise.
9385
fd19f271
AD
93862004-12-16 Akim Demaille <akim@epita.fr>
9387
9388 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9389 yacc.c: be sure to stay within yycheck_.
9390 * tests/actions.at: Re-enable C++ tests.
9391
10454ea4
AD
93922004-12-16 Akim Demaille <akim@epita.fr>
9393
9394 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9395 real.
9396
c5b95ccf
AD
93972004-12-16 Akim Demaille <akim@epita.fr>
9398
9399 Use #define to handle the %name-prefix.
9400
9401 * data/glr.c, data/yacc.c: Comment changes.
9402 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9403 so that one can refer to yylex in the parser file, and have it
9404 renamed, as is the case with other skeletons.
9405
617a8f12
AD
94062004-12-16 Akim Demaille <akim@epita.fr>
9407
9408 Move lalr1.cc internals into yy*.
9409
9410 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9411 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9412 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9413 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9414 (empty_, final_, terror_, errcode_, ntokens_)
9415 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9416 (looka_, ilooka_, error_range_, nerrs_):
9417 Rename as...
9418 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9419 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9420 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9421 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9422 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9423 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9424 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9425 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9426 these.
9427
1e547e6e
PE
94282004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9429
9430 Fix some problems reported by twlevo at xs4all.
9431 * src/symtab.c (symbol_new): Report an error if the input grammar
9432 contains too many symbols. This is better than calling abort() later.
9433 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9434 (struct node, struct graph):
9435 Rename member expand to stretch. All uses changed.
9436 (struct graph): Remove member layoutalgorithm. All uses removed.
9437 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9438 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9439 All uses changed.
9440 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9441
735d6bd4
AD
94422004-12-15 Akim Demaille <akim@epita.fr>
9443
9444 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9445 Add more Doxygen comments.
9446 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9447 (report_syntax_error_, translate_): Rename as...
9448 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9449 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9450
2e1f5829
AD
94512004-12-15 Akim Demaille <akim@epita.fr>
9452
9453 * data/lalr1.cc (lex_): Rename as...
9454 (yylex_): this.
9455 Move the trace here.
9456 Take the %name-prefix into account.
9457 Reported by Alexandre Duret-Lutz.
9458
a3cb6248
AD
94592004-12-15 Akim Demaille <akim@epita.fr>
9460
9461 Simplify the C++ parser constructor.
9462
9463 * data/lalr1.cc (debug_): Rename as...
9464 (yydebug_): so that the parser's internals are always in the yy*
9465 pseudo namespace.
9466 Adjust uses.
9467 (b4_parse_param_decl): Remove the leading comma as it is now only
9468 called as unique argument list.
9469 (Parser::Parser): Remove the constructor accepting a location and
9470 an initial debugging level.
9471 Remove from the other ctor the argument for the debugging level.
9472 (debug_level_type, debug_level, set_debug_level): New.
9473
9474 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9475 constructor calls.
9476
07fed891
AD
94772004-12-15 Akim Demaille <akim@epita.fr>
9478
9479 Remove b4_root related material: failure experiment
a3cb6248 9480 (which goal was to allow to derive from a class).
07fed891
AD
9481
9482 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9483 definitions and uses.
9484
e603eaa5
PE
94852004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9486
9487 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9488 not 2, since it's not portable to subtract 1 from the start of an
9489 array. The new item 0 is never set or used. All uses changed.
9490
9491 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9492 the default definition of YYLLOC_DEFAULT. Problem reported
9493 by Frank Heckenbach.
9494
fafb007d
PE
94952004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9496
9497 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9498 the normal case and one for the error case. Just use the
9499 first one uniformly. Problem reported by Frank Heckenbach.
9500 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9501 use exactly the same macro in both places.
9502 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9503 so that the normal-case YYRHSLOC works for the error case too.
9504 All uses changed.
9505 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9506 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9507 * doc/bison.texinfo (Location Default Action): Don't claim that
9508 we have an array of locations. Use the same macro for both glr
9509 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9510 the index is 0.
9511
48814dcd
PE
95122004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9513
a4e1a53b
PE
9514 * HACKING: Update email addresses to send announcements to.
9515
48814dcd
PE
9516 * configure.ac (AC_INIT): Bump version to 1.875f.
9517
337116ba
PE
95182004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9519
9520 * NEWS: Version 1.875e.
9521 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9522
9523 * src/scan-skel.l: Include "complain.h", for "fatal".
9524
9525 * src/relation.h (relation_print, relation_digraph):
9526 Relation sizes are of type relation_node, not size_t (this is
9527 merely a doc fix, since the two types are equivalent).
9528 (relation_transpose): Relation sizes are of type relation_node,
9529 not int.
9530 * src/relation.c: Likewise.
9531 (top, infinity): Now of type relation_node, not int.
9532 (traverse, relation_transpose): Use relation_node, not int.
9533
9534 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9535 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9536 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9537
9538 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 9539 specifying whether the test should be skipped. Use it tp
337116ba 9540 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 9541 fail on some hosts, and should be skipped.
337116ba 9542
da2a7671
PE
95432004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9544
9545 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9546 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9547 unless otherwise specified below.
9548
9549 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9550 to allocate kernel_base, kernel_items, kernel_size, since
9551 they needn't be initialized to 0.
9552 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9553 * src/closure.c (new_closure): Likewise, for itemset.
9554 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9555 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9556 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9557 (build_relations): Likewise for edge, states1, includes.
9558 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9559 * src/reader.c (packgram): Likewise, for ritem, rules.
9560 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9561 * src/relation.c (relation_digraph): Likewise for VERTICES.
9562 (relation_transpose): Likewise for new_R, end_R.
9563 * src/symtab.c (symbols_token_translations_init): Likewise for
9564 token_translations.
9565 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9566 (token_actions): Likewise for yydefact, actrow, conflrow,
9567 conflict_list.
9568 (save_column): Likewise for froms[symno], tos[symno].
9569 (goto_actions): Likewise for state_count.
9570 (pack_table): Likewise for base, pos, check.
9571 (tables_generate): Likewise for width.
9572
9573 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9574 for initial core. Just have a separate core, so we needn't worry
9575 about whether kernel_size and kernel_base are initialized.
9576
9577 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9578 kernel_size, kernel_items): Remove unnecessary initialization.
9579 * src/conflicts.c (conflicts): Likewise.
9580 * src/derives.c (derives): Likewise.
9581 * src/muscle_tablc (muscle_insert): Likewise.
9582 * src/relation.c (relation_digraph): Likewise.
9583 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9584 conflrow, conflict_table, conflict_list, table, check):
9585 Likewise.
9586
9587 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9588 This is because all callers pass unsigned int.
9589 * src/closure.h (new_closure): Likewise.
9590
9591 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9592 (build_relations): Initialize includes[i] in all cases.
9593 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9594 and rules[ruleno].precsym. Initialize members in order.
9595 * src/relation.c (relation_transpose): Always initialize new_R[i]
9596 and end_R[i].
9597 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9598
9599 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9600 conflict_list[0] was always 0, but now it isn't initialized.
9601
9602 * src/table.c (table_grow): When conflict_table grew, the grown
9603 area wasn't cleared. Fix this.
9604
9605 * lib/.cvsignore: Add strdup.c, strdup.h.
9606 * m4/.cvsignore: Add strdup.m4.
9607
00baeeac
PE
96082004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9609
9610 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9611 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9612 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9613 ngotos + 1 without checking for overflow.
9614 (build_relations): Use END_NODE, not -1, to denote end of edges.
9615 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9616 build_relations): Use goto_number, not int, for goto numbers.
9617 * src/tables.c (save_column, default_goto): Likewise.
9618
be3d9d42
AD
96192004-11-23 Akim Demaille <akim@epita.fr>
9620
9621 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9622 of #defining from yystype.
9623 Don't typedef yystype, C++ does not need it.
9624 This lets it possible to forward declare it as union.
9625
78e526d5
PE
96262004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9627
9628 * bootstrap (gnulib_modules): Add extensions.
9629 Problem reported by Jim Meyering.
9630
afbb696d
PE
96312004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9632
9633 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9634 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9635 src/system.h, src/tables.c: XFREE -> free, to accommodate
9636 recent change to gnulib xalloc.h.
78e526d5 9637 Problem reported by Jim Meyering.
afbb696d 9638
c1f8f16a
AD
96392004-11-17 Akim Demaille <akim@epita.fr>
9640
9641 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9642
db7e5eb5 96432004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
9644 Alexandre Duret-Lutz <adl@gnu.org>
9645
9646 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9647 changes.
9648 (YYCDEBUG): Adjust.
9649 Use it instead of cdebug_.
9650 (Parser::debug_stream, Parser::set_debug_stream): New.
9651 (Parser::symprint_): Define cdebug_ for temporary backward
9652 compatibility.
9653 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9654 debug_stream ().
9655
68e11668
AD
96562004-11-17 Akim Demaille <akim@epita.fr>
9657
9658 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9659 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9660 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9661 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9662
97cbc73e
PE
96632004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9664
9665 * data/glr.c (yyloc_default): Remove; not used.
9666 Problem reported by Frank Heckenbach.
9667
e342c3be
AD
96682004-10-25 Akim Demaille <akim@epita.fr>
9669
9670 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9671 Introduce another definition to address simple location arrays.
9672 (yyGLRStack): New member: yyerror_range.
9673 (yyrecoverSyntaxError, yyparse): Update it.
9674 (yyrecoverSyntaxError): Use it when shifting the error token to
9675 have an accurate range, equivalent to the one computed by both
9676 yacc.c and lalr1.cc.
9677 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9678 that column numbers start at column 0, as per GNU Coding
9679 Standards, the others tests, and the doc.
9680 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9681 Adjust to the above change (first column is 0).
9682 And adjust the location of the "<error>", now covering the whole
9683 line.
9684
93602feb 96852004-10-22 Akim Demaille <akim@epita.fr>
04098407 9686 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
9687
9688 Remove some arbitrary limits on goto numbers and relations.
9689 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9690 initial values, since they're never used.
9691 (set_goto_map): ngotos is now unsigned, so test for overflow
9692 by seeing whether it wraps around to zero.
9693 * src/lalr.h (goto_number): Now size_t, not short int.
9694 (GOTO_NUMBER_MAXIMUM): Remove.
9695 * src/relation.c (relation_print, traverse, relation_transpose):
9696 Check for END_NODE rather than looking at sign.
9697 * src/relation.h (END_NODE): New macro.
9698 (relation_node): Now size_t, not short int.
9699
dba08b04
PE
97002004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9701
9702 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9703 keyword, not an identifier. Problem reported by Baron Schwartz in
9704 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9705
df09ef2e
AD
97062004-10-11 Akim Demaille <akim@epita.fr>
9707
9708 * src/symtab.c (symbol_check_alias_consistency): Also check
9709 type names, destructors, and printers.
9710 Reported by Alexandre Duret-Lutz.
9711 Recode the handling of associativity and precedence in terms
9712 of symbol_precedence_set.
9713 Accept no redeclaration at all, not even equal to the previous
9714 value.
9715 (redeclaration): New.
9716 Use it to factor redeclaration complaints.
9717 (symbol_make_alias): Don't set the type of the alias, let
9718 symbol_check_alias_consistency do it as for other features.
9719 * src/symtab.h (symbol): Add new member prec_location, and
9720 type_location.
9721 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9722 * tests/input.at (Incompatible Aliases): New.
9723
146bc99d
PE
97242004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9725
9726 .cvsignore fixes to accommodate gnulib changes,
9727 and the practice of naming build directories "_build".
9728 * .cvsignore: Add "_*". Sort.
9729 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9730 * m4/.cvsignore: Add "*_gl.m4".
9731
e503aa60
AD
97322004-10-06 Akim Demaille <akim@epita.fr>
9733
9734 * src/parse-gram.y (add_param): Fix the truncation of trailing
9735 spaces.
9736
b4a20338
AD
97372004-10-05 Akim Demaille <akim@epita.fr>
9738
9739 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9740 whether the reducion was empty or not. This leaves room to
9741 improve the use of YYLLOC_DEFAULT in such a case.
9742 lalr1.cc is still experimental, so changing this is acceptable.
9743 And finally, there are probably not many users who changed the
9744 handling of locations in GLR, so changing is admissible too.
9745
9746 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9747 empty reduction, set @$ to an empty location ending the previously
9748 stacked symbol.
9749 Adjust uses to make sure the code is triggered on empty
9750 reductions.
9751 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9752 expected output: empty reductions have empty locations.
9753
f85a5e6f
AD
97542004-09-29 Akim Demaille <akim@epita.fr>
9755
9756 * data/lalr1.cc: Move towards a more standard C++ coding style
9757 for templates: Class < T > -> Class<T>.
9758
b203fc2c
AD
97592004-09-29 Akim Demaille <akim@epita.fr>
9760
9761 * data/lalr1.cc: Reinstall the former ctor, for sake of
9762 compatibility, but warn it will be removed.
9763 Move towards a more standard C++ coding style (i.e., type *var ->
9764 type* var).
9765
5b7e1e73
PE
97662004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9767
3fee967f
PE
9768 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9769 since it's less likely to work if NULs are involved in the future.
5b7e1e73 9770
0dcca5c2
AD
97712004-09-27 Akim Demaille <akim@epita.fr>
9772
9773 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9774
6dde1c82
AD
97752004-09-27 Akim Demaille <akim@epita.fr>
9776
9777 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 9778 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
9779 and argument names.
9780 (b4_cc_constructor_call): Likewise.
9781
b233d555
AD
97822004-09-24 Akim Demaille <akim@epita.fr>
9783
9784 * src/parse-gram.y (add_param): Strip the leading and trailing
9785 blanks from a formal argument declaration.
9786 (YY_LOCATION_PRINT): New.
9787
619404e3
AD
97882004-09-24 Akim Demaille <akim@epita.fr>
9789
9790 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9791 after the location.
9792
dd8d9022
AD
97932004-09-24 Akim Demaille <akim@epita.fr>
9794
9795 * doc/bison.texinfo (Table of Symbols): Sort.
9796
0092f063
AD
97972004-09-21 Akim Demaille <akim@epita.fr>
9798
9799 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9800 the useless parentheses.
9801 Suggested by Paul Eggert.
9802
451364ed
AD
98032004-09-20 Akim Demaille <akim@epita.fr>
9804
9805 Let the initial-action act on the look-ahead, and use it for the
9806 "initial push" (corresponding to an hypothetical beginning-of-file).
9807 And let lalr1.cc honor %initial-action.
9808
9809 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9810 example.
9811 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9812 (Parser::Parser): Remove the ctor that used to initialize it.
9813 (Parser::parse): Like in the other skeletons, issue the "starting
9814 parse" message before any action.
9815 Honor %initial-action.
9816 Initialize the stacks with the lookahead.
9817 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9818 look-ahead.
9819 Push them in the stacks.
9820 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9821
18d192f0
AD
98222004-09-20 Akim Demaille <akim@epita.fr>
9823
9824 * doc/bison.texinfo (Initial Action Decl): New.
9825
b8458aa5
AD
98262004-09-20 Akim Demaille <akim@epita.fr>
9827
9828 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9829 clearer criterion to define it.
9830 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9831 When reducing on an empty RHS, use the latest stacked location as
9832 location.
9833 yylloc is not always available.
9834 * data/glr.c: Likewise.
9835 Also, honor initial-actions.
9836
3fc16193
AD
98372004-09-20 Akim Demaille <akim@epita.fr>
9838
9839 * data/yacc.c (YY_LOCATION_PRINT): New.
9840 Define when we know YYLTYPE's structure, i.e., when the default
9841 YYLLOC_DEFAULT is used.
9842 * data/c.m4 (b4_yysymprint_generate): Use it.
9843 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9844 value of the result.
9845 (error_start_): Replace with...
9846 (error_range_): this location array.
9847 This allows to replace code relying on the implementation of
9848 locations by portable code.
9849 * data/yacc.c (yylerrsp): Replace with...
9850 (yyerror_range): this.
9851 Every time a token is popped, update yyerror_range[0], to have an
9852 accurate location for the error token.
9853 * data/glr.c (YY_LOCATION_PRINT): New.
9854 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9855 deference a pointer.
9856 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9857 report the location in %printers.
9858
9859 * src/scan-skel.l: Instead of abort, report error messages to ease
9860 understanding skeleton scanning failures.
9861
ecfe33e7
AD
98622004-09-16 Akim Demaille <akim@epita.fr>
9863
9864 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9865 (iterator, const_iterator): these, to be more in the C++ spirit.
9866 Also, return reverse iterators so that when displaying the stack
9867 we display its bottom first.
9868 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9869 from yacc.c.
9870 We should probably use vector here though.
9871
1576d44d
AD
98722004-09-16 Akim Demaille <akim@epita.fr>
9873
9874 Have more complete shift traces.
9875
9876 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9877 to report Shifts instead of ad hoc YYDPRINTF invocations,
9878 including for the error token.
9879 * data/lalr1.cc (symprint_): Output the location.
9880 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9881 output the location within the %printer.
9882 Activate GLR tests, at least to make sure they compile properly.
9883 They still don't pass though.
9884 * tests/calc.at: Adjust expect verbose output, since now "Entering
9885 state..." is on a different line than the "Shifting" message.
9886
9c66f418
AD
98872004-09-08 Akim Demaille <akim@epita.fr>
9888
9889 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9890 Bison directive from the Bison file to the invocation of this
9891 macro, so that these directives are passed to
9892 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9893 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9894 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9895 the extra Bison directives instead of the whole series.
9896 Change the grammar so that there are recoverable errors, and
9897 unrecoverable errors. Now we can have the parser give up before
9898 consuming the whole input. As a result we now can observe that
9899 the lookahead is freed when needed.
9900 Change the parser source to parse argv[1] instead of a hard coded
9901 string.
9902 Simplify yylex, and give a value and location to EOF.
9903 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9904 passed directives already coded in the file.
9905 Add some tests to check the location of "error".
9906 For some tests, the C++ parser is correct, and not yacc.c.
9907 For other tests, they provide different, but unsatisfying, values,
9908 so keep the C++ value so that at least one parser is "correct"
9909 according to the test suite.
9910 (Actions after errors): Remove, this is subsumed by the
9911 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9912
52d5733f
AD
99132004-09-06 Akim Demaille <akim@epita.fr>
9914
9915 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 9916 (Parser::pop): New.
52d5733f
AD
9917 Use it.
9918
a0e68930
AD
99192004-09-06 Akim Demaille <akim@epita.fr>
9920
9921 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9922 argument, an informative message.
9923 Call YY_SYMBOL_PRINT.
9924 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9925 * data/lalr1.cc (destruct_): Likewise.
9926 In addition, no longer depend on b4_yysymprint_generate and
9927 b4_yydestruct_generate to generate these functions, do it "by
9928 hand".
9929
e757bb10
AD
99302004-09-03 Akim Demaille <akim@epita.fr>
9931
9932 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9933 invoked, yydestruct the lookahead.
9934 * tests/calc.at (Calculator $1): Update the expected lengths of
9935 traces: there is an added line for the discarded lookahead.
9936 * doc/bison.texinfo (Destructor Decl): Some rewording.
9937 Define "discarded" symbols.
9938
0fe1f06d
AD
99392004-09-02 Akim Demaille <akim@epita.fr>
9940
9941 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9942
284acc8b
AD
99432004-09-02 Akim Demaille <akim@epita.fr>
9944
9945 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9946 (YYDSYMPRINTF): Rename as...
9947 (YY_SYMBOL_PRINT): this.
9948 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9949 two.
9950 Use it instead of direct symprint_ calls.
9951 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9952 one.
9953
a5eb1ed2
AD
99542004-09-02 Akim Demaille <akim@epita.fr>
9955
b7c72fe1
AD
9956 * data/lalr1.cc (b4_yysymprint_generate): New.
9957 (symprint_): New member function, defined when YYDEBUG.
9958 Use it consistently instead of token/nterm debugging output by
9959 hand.
a5eb1ed2
AD
9960 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9961 %printer calls to use cdebug_ when using lalr1.cc.
9962
417141dd
AD
99632004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9964
9965 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9966 with #ifdef YYDEBUG.
9967
2fa09258
AD
99682004-08-26 Akim Demaille <akim@epita.fr>
9969
9970 * doc/bison.texinfo (Implementing Loops): Rename as...
9971 (Implementing Gotos/Loops): this.
9972
9378b508
PE
99732004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9974
9975 Adjust to latest gnulib.
9976 * bootstrap (gnulib_modules): Add xalloc-die.
9977 Set LC_ALL=C so that file names sort consistently.
9978 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9979 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9980 uintmax_t.m4, ulonglong.m4.
9981 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9982 po.m4 since we are now using _gl.m4 instead.
9983
87a8ad5c
PE
99842004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9985
9986 * src/scan-action.l: Remove. Scanning of semantic actions is
9987 handled in scan-gram.l.
9988
dca81a78
PE
99892004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9990
9991 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9992
9993 * src/location.h (struct): The file member is a uniqstr.
9994 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9995
c9cbf7c5
PE
99962004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9997
9998 Fix bug with non-%union parsers that have printers or destructors,
9999 which led to a Bison core dump. Reported by Peter Fales in
10000 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 10001
c9cbf7c5
PE
10002 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10003 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10004 not to our own type.
10005 * src/output.c (symbol_destructors_output, symbol_printers_output):
10006 Don't assume %union.
10007 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10008 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10009 UNION-FLAG. All callers changed.
10010 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10011 Use type char, not unsigned int, when declaring an array of char;
10012 this lets us remove a cast.
10013 (Printers and Destructors): Add non-%union test cases.
10014
fa7e68c3
PE
100152004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10016
10017 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10018 GLR writeups. E.g., avoid frenchspacing and the future tense,
10019 change "lookahead" to "look-ahead", and change "wrt" to "with
10020 respect to".
2fa09258 10021
fa7e68c3
PE
100222004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10023
10024 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10025 New sections, split off from the GLR Parsers section. Put the new
10026 Simple GLR Parser near the start of the GLR section, for clarity.
10027 Rewrite connective text.
10028
99a9344e
PE
100292004-06-21 Frank Heckenbach <frank@g-n-u.de>
10030
10031 * doc/bison.texinfo (Simple GLR Parsers): New section.
10032
8dd162d3
PE
100332004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10034
10035 * NEWS, TODO, doc/bison.texinfo:
10036 Use "look-ahead" instead of "lookahead", to be consistent.
10037 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10038 while we're fixing "look-ahead".
10039 * src/conflicts.c (shift_set): Renamed from shiftset.
10040 (look_ahead_set): Renamed from lookaheadset.
10041 * src/print.c: Likewise.
10042 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10043 name for "lookahead".
10044 (report_types, usage): Likewise.
10045 * src/getargs.h (report_look_ahead_tokens): Renamed from
10046 report_lookaheads.
10047 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10048 compute_lookaheads.
10049 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10050 (look_ahead_tokens_print): Renamed from lookaheads_print.
10051 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10052 state_rule_lookaheads_print.
10053 * src/state.h: Likewise.
10054 (reductions.look_ahead_tokens): Renamed from lookaheads.
10055 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10056 AT_DATA_LOOKAHEADS_GRAMMAR.
10057
57a90331
PE
100582004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10059
10060 * README: Update location of patched M4 distribution.
10061
8ed3234a
PE
100622004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10063
10064 Don't assume the C++ compiler takes the same arguments as the C compiler
10065 (trivial change).
10066 * configure.ac (O0CXXFLAGS): New var.
10067 * tests/atlocal.in (CXXFLAGS): Use it.
10068
07971983
PE
100692004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10070
10071 Fix some "make check" problems with C++ reported by
10072 Albert Chin-A-Young for Tru64 C++ in this thread:
10073 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10074
10075 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10076 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10077 Output to a .cc file for C++, not to a .c file.
10078 * tests/calc.at (AT_CHECK_CALC): Likewise.
10079 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10080 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10081
29058652
PE
100822004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10083
10084 * tests/calc.at, tests/actions.at: Workaround for SGI
10085 C++ compiler. (trivial change)
10086
62cb8a99
PE
100872004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10088
fd418816
PE
10089 Spent a few hours checking out which prerequisite versions the
10090 current sources actually require. I went all the way back to
10091 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10092 a seemingly endless set of combinations of versions more recent
10093 than that. The bottom line is that the current sources require
10094 fairly recent versions of the build tools, and it'll be some work
10095 to change this.
10096 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10097 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10098 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10099 Add comments explaining why those particular versions are
10100 currently needed.
2fa09258 10101
62cb8a99
PE
10102 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10103 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 10104 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
10105
10106 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10107 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10108
caa52c10
PE
101092004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10110
10111 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10112 0.11.5. Suggested by Bruno Haible.
10113 * bootstrap: Remove gettext version checking.
10114
10115 * doc/bison.texinfo (Decl Summary): Also mention that %union
10116 can depend on prerequisite types. Problem reported by Tim
10117 Van Holder.
10118
4bfd5e4e
PE
101192004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10120
2cef3017
PE
10121 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10122 * README-alpha: Don't tell people not to package this.
10123
b9c85d5c
PE
10124 * bootstrap: Don't assume $(...) works; use `...` instead.
10125 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10126 gettext better.
10127
4bfd5e4e
PE
10128 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10129 put into the -d output file, and mention what to do if YYSTYPE is
10130 defined as a macro.
10131
6a36ff94
PE
101322004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10133
6712933e
PE
10134 Undo change made earlier today: it caused autopoint to not bring
10135 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10136 autopoint's.
10137
10138 * bootstrap: Check that gettext version matches what's in
10139 configure.ac. Warn users to ignore robots.txt ERROR 404.
10140 * bootstrap: Undo today's earlier change (logged below).
10141 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 10142
6a36ff94
PE
10143 The gettext version checking is causing more trouble than it's
10144 curing; remove it. Problem reported by Paul Hilfinger.
10145
10146 * bootstrap: Issue a warning that one can expect a message
10147 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10148 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10149
209ea708
PE
101502004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10151
10152 Ensure that the C++ compiler used for testing actually works on a
10153 simple test program; if not, skip the C++-related tests. Problem
10154 reported by Vin Shelton in:
161a71f3 10155 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
10156
10157 * m4/cxx.m4: New file.
10158 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10159 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10160 * tests/local.at (AT_COMPILE_CXX): Use it.
10161
41ca2549
PE
101622004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10163
383e69dc
PE
10164 * data/glr.c (yylloc): Output this macro even if locations are not
10165 being generated, as the GLR parser needs it even in that case.
10166 Problem reported by Troy A. Johnson
10167 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10168
41ca2549
PE
10169 * configure.ac (AC_INIT): Update to 1.875e.
10170
e476c87d
PE
101712004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10172
10173 * NEWS: Version 1.875d.
10174 * configure.ac (AC_INIT): Likewise.
10175 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10176
10177 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10178 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10179 lalr1.cc runs afoul of the first, and the last two are no longer
10180 supported by GCC 3.4.0.
10181 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10182 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10183
233a88ad
PE
101842004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10185
10186 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10187 unsigned int, for compatibility with latest gnulib hash module.
10188 * src/state.c (state_hash, state_hasher): Likewise.
10189 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10190 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 10191
12ffdd28
PE
101922004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10193
10194 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10195
10196 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10197 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10198 character and string literals.
10199 (unexpected_end): New function.
10200 (unexpected_eof): Use it.
10201 (unexpected_newline): New function.
10202 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10203 actions.
e476c87d 10204
12ffdd28
PE
10205 * NEWS: Document %expect-rr.
10206
10207 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10208 Fix typo by replacing $1 with $option.
10209 Remove more 'intl'-related files.
9668e2be 10210 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
10211
10212 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10213 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10214 strtoul.c.
10215 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10216 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10217 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10218 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10219 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10220 * src/.cvsignore: Add *.output.
10221
10222 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10223 gets copied to the output file.
e476c87d 10224
1f65350a
PE
102252004-04-28 Paul Eggert <eggert@twinsun.com>
10226
10227 Get files from the gnulib and po repositories, instead of relying
10228 on them being in our CVS. Upgrade to latest versions of gnulib
10229 and Automake.
10230
10231 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10232 * bootstrap: Bootstrap from gnulib and po repositories.
10233 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10234 * README-cvs: Document these changes. Remove version numbers from
10235 mentions of build tools, since they change so often. Mention Flex.
10236
10237 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10238 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
10239 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10240 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 10241 does this for us.
12ffdd28
PE
10242 (AC_ISC_POSIX): Remove; we no longer support this
10243 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
10244 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10245 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10246 Do not check for C89 headers, except for locale.h which is used
10247 by the Yacc library and must port to K&R hosts.
10248 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10249 Do not check for C89 functions, except for setlocale which is
10250 used by the Yacc library.
10251 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10252 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10253 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10254 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10255 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10256 AM_GNU_GETTEXT): Remove; now done by:
10257 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10258 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10259 for us.
10260
10261 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10262 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10263 Define to empty, as gnulib.mk will do the rest for us.
10264 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10265 for us.
10266 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10267 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10268
10269 * src/files.c: Include gnulib's xstrndup.h.
10270
10271 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10272 (REALLOC): Use xnrealloc, for likewise.
10273 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10274 (strnlen, memrchr): Remove decls; functions no longer used.
10275 Include <stpcpy.h>.
10276
10277 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10278 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10279 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10280 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10281 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10282 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10283 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10284 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10285 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10286 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10287 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10288 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10289 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10290 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10291 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10292 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10293 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10294 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10295 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10296 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10297 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10298 Remove, as these files are now generated automatically
10299 by bootstrap or automake.
10300
10301 * po/ChangeLog: Remove: all but one entry was a duplicate
10302 of this file, and I moved that 2000-11-02 entry here.
10303
10304 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10305 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10306 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10307 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10308 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10309 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10310 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10311 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10312 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10313 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10314 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10315 xstrndup.h.
10316 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10317 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10318 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10319 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10320 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10321 * src/.cvsignore: Remove *_.c.
10322
10323
10324 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10325 support it. (The latest stable gzip doesn't.)
10326
103272004-04-27 Paul Eggert <eggert@twinsun.com>
10328
10329 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10330 case, as stos_ is now used by destructors due to the 2004-02-09
10331 change.
10332
10333 Remove more K&R C support.
10334 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10335 * lib/subpipe.c (errno): Remove decl.
10336 Include <stdlib.h> unconditionally.
10337 (EXIT_FAILURE): Remove macro.
10338 * src/complain.c (vfprintf, strerror): Remove.
10339 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10340 unconditionally.
10341 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10342 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10343 (strchr, strspn, memchr): Remove decls.
10344 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10345 unconditionally. Do not declare perror.
10346 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10347 unconditionally.
10348
10349 * src/complain.c (_): Remove useless defn, as system.h defines this.
10350
10351 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10352 with latest obstack.h.
10353 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10354 to procedure types, as obstack.h now does that for us.
10355 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10356
10357 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10358 so that this include file can stand alone.
10359 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10360 does this now. Include subpipe.h first after config.h, to
10361 test whether it can stand alone.
10362
10363 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10364 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10365 unused declaration.
10366
10367 * tests/synclines.at (%union synch line): Put a dummy member in
10368 the union, because empty unions aren't allowed in C. Caught
10369 by GCC 3.4.0.
10370
4f16766c
PE
103712004-04-13 Jim Meyering <jim@meyering.net>
10372
10373 * src/conflicts.c (conflicts_print): Correct format string typo:
10374 use `%%' to produce literal `%'. (trivial change)
10375
779e7ceb
PE
103762004-03-30 Paul Eggert <eggert@twinsun.com>
10377
10378 * src/getargs.c (version): Update copyright year to 2004.
10379
10380 * data/c.m4 (b4_int_type): Use 'short int' rather than
10381 'short', and similarly for 'long', 'unsigned', etc.
10382 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10383 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10384 yy_yypstack, yydumpstack): Likewise.
10385 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10386 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10387 Likewise.
10388 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10389 yy_stack_print, yyparse): Likewise.
10390 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10391 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10392 * lib/bitset.c (bitset_print): Likewise.
10393 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10394 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10395 * lib/bitsetv.c (bitsetv_dump): Likewise.
10396 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10397 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10398 Likewise.
10399 * src/LR0.c (allocate_itemsets): Likewise.
10400 * src/gram.h (rule_number, rule): Likewise.
10401 * src/lalr.h (goto_number): Likewise.
10402 * src/nullable.c (nullable_compute): Likewise.
10403 * src/output.c (prepare_rules): Likewise.
10404 * src/relation.c (relation_print, relation_digraph): Likewise.
10405 * src/relation.h (relation_node): Likewise.
10406 * src/state.h (state_number, transitions, errs, reductions,
10407 struct state): Likewise.
10408 * src/symtab.h (symbol_number, struct symbol): Likewise.
10409 * src/tables.c (vector_number, tally, action_number,
10410 default_goto, goto_actions): Likewise.
10411 * tests/existing.at (GNU Cim Grammar): Likewise.
10412 * tests/regression.at (Web2c Actions): Likewise.
10413
10414 * src/output.c (muscle_insert_short_int_table): Renamed from
10415 muscle_insert_short_table. All uses changed.
10416
d6328241
PH
104172004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10418
10419 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10420 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10421 Add %expect-rr rule.
4f16766c 10422
d6328241
PH
10423 * src/scan-gram.l: Recognize %expect-rr.
10424
4f16766c 10425 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 10426 expected_conflicts.
4f16766c 10427 (expected_rr_conflicts): Declare.
d6328241
PH
10428
10429 * src/conflicts.c (expected_sr_conflicts): Rename from
10430 expected_conflicts.
10431 (expected_rr_conflicts): Define.
10432 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10433 for GLR parsers.
10434 Use expected_sr_conflicts in place of expected_conflicts.
10435 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 10436
d6328241 10437 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 10438
1452af69
PE
104392004-03-08 Paul Eggert <eggert@gnu.org>
10440
10441 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 10442 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
10443
10444 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10445 in lalr1.cc.
10446 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10447 * src/scan-gram.l (scan_integer): New function.
10448 ({int}): Use it.
10449 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10450 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10451 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10452 Say "long int", not "long", for uniformity with GNU style.
10453
006d217d
PE
104542004-02-25 Paul Eggert <eggert@twinsun.com>
10455
10456 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10457 compilers. This fixes a problem with Intel's C++ compiler being
10458 chatty, reported by Guido Trentalancia in
161a71f3 10459 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 10460
c2729758
ADL
104612004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10462
10463 Support %destructor and merge error locations in lalr1.cc.
10464
10465 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10466 (Parser::stos_): Define unconditionally.
10467 (Parser::destruct_): New method. Generate its body with
10468 b4_yydestruct_generate.
10469 (Parser::error_start_): New attribute.
10470 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10471 token which are discarded.
10472 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10473 error_start_ when erroneous token are discarded.
10474 (Parser::parse) <yyerrlab1>: Compute the location of the error
10475 token so that it covers all the discarded tokens.
10476 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10477 it can be called with `%skeleton "lalr1.cc"', and do that.
10478
dd0e0635
PE
104792004-02-02 Paul Eggert <eggert@twinsun.com>
10480
10481 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10482 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10483 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10484 There's no need to mention top_builddir since Automake does that
10485 for us.
10486 (INCLUDES): Remove, as Automake says it's obsolescent.
10487 Contents migrated into AM_CPPFLAGS as described above.
10488 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10489
104902004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10491
10492 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10493 (yyreportSyntaxError): Handle case where lookahead token is
10494 YYEMPTY.
10495
be16239b
PH
104962004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10497
10498 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10499 resulting parsers are compilable with C++.
10500
5fa90832
PE
105012003-12-23 Paul Eggert <eggert@twinsun.com>
10502
10503 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10504 * src/output.c (output_skeleton): Rename local var.
10505 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10506 Bison tokens, as this runs afoul of the 2003-10-07 change that
10507 disallowed NUL bytes in character constants or string literals.
10508
10509 * tests/local.at: Require Autoconf 2.59's Autotest.
10510 * tests/testsuite.at: Don't include local.at, since we now assume
10511 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10512 including it.
10513 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10514 multiple inclusion warnings.
dd0e0635 10515
b165c324
AD
105162003-12-02 Akim Demaille <akim@epita.fr>
10517
10518 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10519 conditions.
10520 From Bruno Haible.
10521
26e06a21
ADL
105222003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10523
10524 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10525
92ac3705
PE
105262003-10-07 Paul Eggert <eggert@twinsun.com>
10527
6a5ecb38
PE
10528 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10529 if testsuite doesn't exist.
10530
92ac3705
PE
10531 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10532 literals, unfortunately.
10533 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10534 Complain about NUL bytes in character constants or string literals.
10535
91d2c560
PE
105362003-10-05 Paul Eggert <eggert@twinsun.com>
10537
10538 * NEWS: Don't document %no-default-prec, as it's still
10539 too experimental.
10540 * doc/bison.texinfo: Document %no-default-prec only if
10541 the defaultprec flag is set. Normally it's not.
10542
0cc3da3a
PE
105432003-10-04 Paul Eggert <eggert@twinsun.com>
10544
10545 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10546 non-modifiable lvalue, instead of a modifiable one.
10547 * doc/bison.texinfo (Actions): Document that $$ can
10548 be assigned to. Do not claim that $$ and $N are
10549 array element references: user code should not rely on this.
10550
22fccf95
PE
105512003-10-01 Paul Eggert <eggert@twinsun.com>
10552
10553 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10554 (grammar_declaration): Use it.
10555 * src/scan-gram.l: New token %no-default-prec.
10556 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10557 * NEWS, doc/bison.texinfo: Document the above.
10558
fc8f2965
AD
105592003-10-01 Akim Demaille <akim@epita.fr>
10560
10561 VCG no longer supports long_straight_phase.
10562
10563 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10564 * src/print_graph.c (print_graph): Adjust.
10565
39a06c25
PE
105662003-09-30 Frank Heckenbach <frank@g-n-u.de>
10567 and Paul Eggert <eggert@twinsun.com>
10568
10569 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10570 Table of Symbols): Document %default-prec.
10571 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10572 (grammar_declaration): Set default_prec on %default-prec.
10573 * src/scan-gram.l (%default-prec): New token.
10574 * src/reader.h (default_prec): New flag.
10575 * src/reader.c: Likewise.
10576 (packgram): Handle it.
10577 * tests/conflicts.at (%default-prec without %prec,
10578 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 10579
39a06c25
PE
105802003-09-30 Paul Eggert <eggert@twinsun.com>
10581
10582 * tests/testsuite.at: Include local.at, not input.at, fixing
10583 a typo in the 2003-08-25 patch.
10584
62b6aef9
AD
105852003-08-27 Akim Demaille <akim@epita.fr>
10586
10587 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10588 GCC warnings.
10589
89e1cc61
AD
105902003-08-26 Akim Demaille <akim@epita.fr>
10591
10592 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10593 "<\#" to avoid magic from Gnus when posting parts of this script.
10594
a08460b0
AD
105952003-08-26 Akim Demaille <akim@epita.fr>
10596
10597 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10598 (Parser::parse): here.
10599 Adjust: nerrs and errstatus is now replaced by...
10600 (Parser::nerrs_, Parser::errstatus_): New.
10601
603f1cfd
AD
106022003-08-25 Akim Demaille <akim@epita.fr>
10603
10604 * config/announce-gen, Makefile.cfg: New.
10605 * Makefile.am: Adjust.
10606 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10607 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10608
cd3684cf
AD
106092003-08-25 Akim Demaille <akim@epita.fr>
10610
10611 When reducing initial empty rules, Bison parser read an initial
10612 location that is not defined. This results in garbage, and that
10613 affects Bison's own parser. Therefore we need (i) to extend Bison
10614 to support a means to initialize this location, and (ii) to use
10615 this CVS Bison to fix CVS Bison's parser.
10616
10617 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10618 with...
10619 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10620 * src/parse-gram.y: Adjust.
10621 (%initial-action): New.
10622 (%error-verbose): Since we require CVS Bison, there is no reason
10623 not to use it.
10624 * src/scan-gram.l: Adjust.
10625 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10626 * data/yacc.c (yyparse): Use b4_initial_action.
10627
4e03e201
AD
106282003-08-25 Akim Demaille <akim@epita.fr>
10629
10630 * doc/bison.texinfo: Don't promote stdout for error messages.
10631
8c182d05
AD
106322003-08-25 Akim Demaille <akim@epita.fr>
10633
10634 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10635 From Alexandre Duret-Lutz.
10636
6a60c4cf
PE
106372003-08-25 Akim Demaille <akim@epita.fr>
10638
10639 Version 1.875c.
10640
25f66e1a
AD
106412003-08-25 Akim Demaille <akim@epita.fr>
10642
10643 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10644 Use them.
10645
5348bfbe
AD
106462003-08-25 Akim Demaille <akim@epita.fr>
10647
10648 * data/lalr1.cc (Parser::reduce_print_): New.
10649 Use it.
10650
47301314
AD
106512003-08-25 Akim Demaille <akim@epita.fr>
10652
10653 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10654 error recovery loops. This patch is based on
161a71f3 10655 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
10656 Also, augment the similarity between lalr1.cc and yacc.c.
10657 Note: the locations of error recovery rules are not correct yet.
10658
10659 * data/lalr1.cc: Comment changes to augment the similarity between
10660 lalr1.cc and yacc.c.
10661 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10662 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10663 yyerrlab), when hitting EOF, pop the whole stack here instead of
10664 merely falling thru the default error handling mechanism.
10665 (yyerrorlab): New label, with the old contents of YYERROR,
10666 plus the following change: pop the stack of rhs corresponding
10667 to the production that invoked YYERROR. That is how Yacc
10668 behaves (required by POSIX).
10669 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10670 fail.
10671
1f7a61ff
AD
106722003-08-25 Akim Demaille <akim@epita.fr>
10673
10674 Tune local.at so that people can "autom4te -l autotest calc.at -o
10675 calc" for instance, to extract a sub test suite.
10676
10677 * tests/testsuite.at: Move the initialization, Autotest version
10678 requirement, and AT_TESTED invocation into...
10679 * tests/local.at: here.
10680 * tests/testsuite.at: Include it for compatibility with Autoconf
10681 2.57.
10682 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10683 be ignore.
10684
327b5b56
PE
106852003-08-04 Paul Eggert <eggert@twinsun.com>
10686
10687 Rework code slightly to avoid gcc -Wtraditional warnings.
10688 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10689 The returned value is now stored in *YY0. All callers changed.
10690 * src/output.c (merge_output): Adjust to the above change.
10691
0051e3ed
PE
106922003-07-26 Paul Eggert <eggert@twinsun.com>
10693
10694 * data/glr.c (YYASSERT): New macro.
10695 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10696 yyresolveStates, yyprocessOneStack):
10697 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10698 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 10699
137437c6
PE
107002003-07-25 Paul Eggert <eggert@twinsun.com>
10701
5b620e06
PE
10702 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10703 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 10704 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
10705 by Frank Heckenbach, though I have omitted the structure-initialization
10706 part of his glr-knr.diff patch since I recall that the Portable
10707 C Compiler didn't require that change.
10708
137437c6
PE
10709 Let the user specify how to allocate and free memory.
10710 Derived from a suggestion by Frank Heckenbach in
161a71f3 10711 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
10712 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10713 All uses of free, malloc, realloc changed to use these macros,
10714 and unnecessary casts removed.
10715 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10716
ddb85ca5
PE
107172003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10718
10719 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10720 use s.empty() rather than s == "" to test for empty string; see
161a71f3 10721 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
10722 (trivial change)
10723
39910e09
AD
107242003-06-25 Akim Demaille <akim@epita.fr>
10725
10726 * config/depcomp, config/install-sh: Update from masters.
10727
0ae99356
PE
107282003-06-20 Paul Eggert <eggert@twinsun.com>
10729
10730 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10731 and return properly parenthesized result.
10732 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10733 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10734 Remove unnecessary parentheses from uses.
10735 * doc/bison.texinfo (Location Default Action): Describe the
10736 conventions for parentheses.
10737
cd05d13c
PE
107382003-06-19 Paul Eggert <eggert@twinsun.com>
10739
81fd08ca
PE
10740 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10741 yyreportTree): Do not assume that size_t is the same width as int,
10742 when printing sizes. Print sizes using an unsigned format.
10743 Problem reported by Frank Heckenbach in
161a71f3 10744 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 10745
cd05d13c
PE
10746 Port to Forte Developer 7 C compiler.
10747 * data/glr.c (struct YYLTYPE): If locations are not being used,
10748 declare a single dummy member, as empty structs do not conform
10749 to the C standard.
10750 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10751 the Forte Developer 7 C compiler complains that end-of-loop
10752 code is not reached.
10753
4dcf140b
PE
107542003-06-17 Paul Eggert <eggert@twinsun.com>
10755
10756 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10757 avoid warnings from picky compilers about redefinition of PARAMS.
10758
8dd76bee
PE
107592003-06-17 Paul Eggert <eggert@twinsun.com>
10760
10761 Version 1.875b.
10762
10763 * NEWS: Document 1.875b.
10764
10765 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10766 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10767 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10768 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10769 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10770 per recent gettext manual's suggestion.
10771 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10772 Use prototypes, not old-style definitions.
10773 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10774 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10775 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10776 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10777 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10778 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10779 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10780 vbitset_or_and_cmp, vbitset_copy): Likewise.
10781
10782 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10783 Do not include <stdlib.h>.
10784 (PARAMS): Define unconditionally for C89.
10785 (ATTRIBUTE_NORETURN): Remove.
10786 (ATTRIBUTE_UNUSED): Define unconditionally.
10787
10788 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 10789 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
10790 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10791 * lib/vbitset.c, lib/vbitset.h: New files.
10792 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10793 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10794 from libbitset.
10795
10796 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10797 `How Can I Reset @code{yyparse}', since texinfo does not allow
10798 arbitrary @ in node names.
10799
10800 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10801 shouldn't be needed according to the gettext 0.12.1 documentation
10802 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 10803 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 10804 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 10805 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 10806
8dd76bee
PE
10807 * lib/.cvsignore: Add stdbool.h.
10808 * m4/.cvsignore: Add nls.m4, po.m4.
10809
10810 Upgrade to CVS gnulib.
10811 * stdbool_.h: File renamed from stdbool.h.in.
10812 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10813 AC_HEADER_STDBOOL.
10814 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10815 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10816 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10817 (MOSTLYCLEANFILES): New var.
10818 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10819 (stdbool.h): New rule.
10820 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10821 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10822 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10823 m4/quote.m4: Upgrade to today's gnulib.
10824
10825 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10826 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10827 the tests right now.
10828 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10829 yyerror are declared before use; C99 requires this.
10830
25005f6a
PH
108312003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10832
10833 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10834 first.
10835 (yyrecoverSyntaxError): Correct the logic for setting and testing
10836 yyerrState.
10837 Correct comment on handling EOF.
10838 Allow states with only a default reduction, rather than failing
8dd76bee 10839 (I can't quite reconstruct why these were not allowed before).
25005f6a 10840
137437c6 10841 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 10842 buffer overruns, corrupting state.
8dd76bee
PE
10843
10844 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
10845 definition.
10846 * src/reader.h (max_left_semantic_context): New variable declaration.
10847 * src/scan-gram.l (max_left_semantic_context): Define.
10848 (handle_action_dollar): Update max_left_semantic_context.
10849 * data/glr.c (YYMAXLEFT): New definition.
10850 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10851 (yyresolveAction): Ditto.
10852
10853 Fixes to problems with location handling in GLR parsers reported by
10854 Frank Heckenbach (2003/06/05).
10855
10856 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10857 (YYRHSLOC): Add parentheses, and define only if locations used.
10858 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10859 locations not used.
10860 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10861 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 10862
25005f6a
PH
10863 * tests/cxx-type.at: Exercise location information; update tests
10864 to differentiate output with and without locations.
8dd76bee 10865 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
10866 because default YYLTYPE not yet defined.
10867 Change semantic actions to compute strings, rather than printing
10868 them directly (to test proper passing of semantics values). Change
10869 output to prefix notation and update test data and expected results.
10870 (yylex): Track locations.
10871 (stmtMerge): Return value rather than printing, and include arguments
10872 in value.
8dd76bee 10873
711f40b7
PE
108742003-06-03 Paul Eggert <eggert@twinsun.com>
10875
10876 Avoid warnings generated by GCC 2.95.4 when Bison is
10877 configured with --enable-gcc-warnings.
10878 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10879 yy::]b4_parser_class_name[::translate_,
10880 yy::Stack::operator[] (unsigned),
10881 yy::Stack::operator[] (unsigned) const,
10882 yy::Slice::operator[] (unsigned),
10883 yy::Slice::operator[] (unsigned) const):
10884 Rename local vars to avoid warnings.
10885 * tests/glr-regression.at (Improper handling of embedded actions
10886 and $-N in GLR parsers): Remove unused local variable from yylex.
10887 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10888 (void) as arg when not pure, since we now assume C89 when building
10889 Bison. Pacify GCC by using parameter.
10890
ac695f7d
PE
108912003-06-02 Paul Eggert <eggert@twinsun.com>
10892
10893 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10894 yy::Location::lines, yy::Location::columns): Rename arguments
10895 to avoid shadowing; this removes a warning generated by GCC 3.3.
10896
26ec81e0
PE
108972003-06-01 Paul Eggert <eggert@twinsun.com>
10898
10899 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10900 to g++, as GCC 3.3 complains if you do it.
10901 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10902 everything that WARNING_CFLAGS has, except omit warnings
10903 not suitable for C++.
10904 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10905 * tests/atlocal.in (CXXFLAGS): New var.
10906 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10907
10908 Fix a GLR parser bug I reported in February; see
161a71f3 10909 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
10910 The problem was that GLR parsers did not conform to the C standard,
10911 because actions like { $1 = $2 + $3; } expanded to expressions
10912 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10913 to a local variable. The C standard says that expressions
10914 like (var = f ()) + (var = f ()) have undefined behavior.
10915 Another problem was that GCC sometimes issues warnings that
10916 yyfill and its parameters are unused.
10917
10918 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10919 as possibly unused.
10920 (yyfill): New function.
10921 (YYFILL): Use it.
10922 (yyuserAction): Change type of yynormal to bool, so that it matches
10923 the new yyfill signature. Mark it as possibly unused.
10924
10925
10926 Follow up on a bug I reported in February, where a Bison-generated
10927 parser can loop. Provide a test case and a fix for yacc.c. I
10928 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10929 The original bug report is in:
161a71f3 10930 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
10931
10932 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10933 macro's size was becoming unwieldy.
10934 (yyerrlab): Do not discard an empty lookahead symbol, as this
10935 might destroy garbage.
10936 (yyerrorlab): New label, with the old contents of YYERROR,
10937 plus the following change: pop the stack of rhs corresponding
10938 to the production that invoked YYERROR. That is how Yacc
10939 behaves, and POSIX requires this behavior.
10940 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10941 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10942 Define 'alarm' to do nothing if unistd.h is not available.
10943 Add a new rule "exp: '-' error;" to test the above change to
10944 data/yacc.c. Use 'alarm' to abort any test taking longer than
10945 10 seconds, as it's probably looping.
10946 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10947 Also, the new yacc.c generates two fewer diagnostics for an
10948 existing test.
10949
d0829076
PE
109502003-05-24 Paul Eggert <eggert@twinsun.com>
10951
c6ae27df
PE
10952 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10953 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10954 This fixes a problem reported by John Bowman when the Compaq/HP
10955 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10956 -ansi -Wall -gall).
10957 * data/yacc.c (union yyalloc): Likewise.
10958 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 10959
d0829076
PE
10960 Switch from 'int' to 'bool' where that makes sense.
10961
10962 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10963 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10964 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10965 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10966 Return or accept bool, not int. All callers changed.
10967 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10968 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10969 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10970 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10971 bitset_or_and_cmp_): Likewise.
10972 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10973 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10974 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10975 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10976 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10977 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10978 bitset_stats_or_and_cmp): Likewise.
10979 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10980 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10981 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10982 ebitset_xor_cmp): Likewise.
10983 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10984 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10985 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10986 lbitset_xor_cmp): Likewise.
10987 * lib/bbitset.h: Include <stdbool.h>.
10988 (struct bitset_vtable): The following members now return bool, not
10989 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10990 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10991 or_and_cmp).
10992 * src/conflicts.c (count_rr_conflicts): Likewise.
10993 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10994 All uses changed.
10995 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10996 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10997 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10998 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10999 graph_flag): Likewise.
11000 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11001 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11002 graph_flag): Likewise.
11003 * src/output.c (error_verbose): Likewise.
11004 * src/output.h (error_verbose): Likewise.
11005 * src/reader.c (start_flag, typed): Likewise.
11006 * src/reader.h (typed): Likewise.
11007 * src/getargs.c (LOCATIONS_OPTION): New constant.
11008 (long_options, getargs): Use it.
11009 * src/lalr.c (build_relations): Use bool, not int.
11010 * src/nullable.c (nullable_compute): Likewise.
11011 * src/print.c (print_reductions): Likewise.
11012 * src/tables.c (action_row, pack_vector): Likewise.
11013 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11014 * src/output.c (prepare): Use it.
11015 * src/output.c (token_definitions_output,
11016 symbol_destructors_output, symbol_destructors_output): Use string,
11017 not boolean integer, to keep track of whether to output separator.
11018 * src/print_graph.c (print_core): Likewise.
11019 * src/state.c (state_rule_lookaheads_print): Likewise.
11020
11021 * config/install-sh: Sync from automake 1.7.5.
11022
6b2584b7
PE
110232003-05-14 Paul Eggert <eggert@twinsun.com>
11024
11025 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11026 semicolon after a grammar declaration, in the interest of possible
11027 future changes to the Bison input language.
11028 Do not allow a stray semicolon at the start of the grammar.
11029 (rhses.1): Allow one or more semicolons after any rule, including
11030 just before "|" as required by POSIX.
11031 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11032 grammar.
11033
caf37a36
ADL
110342003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11035
11036 %parse-param support for lalr1.cc.
11037
11038 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11039 b4_cc_constructor_calls, b4_cc_constructor_call,
11040 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11041 definitions.
11042 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11043 parse-param arguments.
11044 (yy::b4_parser_class_name): Declare instance variables to
11045 hold parse-param arguments.
11046 * tests/calc.at: s/value/semantic_value/ because value clashes
11047 with a member of yy::b4_parser_class_name. Adjust C++ code
11048 to handle %parse-param. Enable %parse-param test in C++.
11049
3ab37077
PE
110502003-05-12 Paul Eggert <eggert@twinsun.com>
11051
11052 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11053 English a bit. Fix fclose typo. Change "const char" to "char
11054 const", and use ANSI C rather than K&R for "main". Suggest
11055 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11056 and suggest yy_switch_to_buffer.
11057
110582003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
11059
11060 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11061 C89. This avoids a diagnostic on compilers that define __STDC__
11062 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 11063 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 11064
e743727f
PE
110652003-05-03 Paul Eggert <eggert@twinsun.com>
11066
11067 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11068 Do not overrun array bounds.
11069 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 11070 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 11071
916708d5
AD
110722003-04-29 Akim Demaille <akim@epita.fr>
11073
11074 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11075 * src/getargs.c, src/getargs.h: here, as bool, not int.
11076 (nondeterministic_parser): New.
11077 * src/parse-gram.y, src/scan-gram.l: Support
11078 %nondeterministic-parser.
11079 * src/output.c (prepare): Use nondeterministic_parser instead
11080 of glr_parser where appropriate.
11081 * src/tables.c (conflict_row, action_row, save_row)
11082 (token_actions, token_actions, pack_vector): Ditto.
11083
a06ea4aa
AD
110842003-04-29 Akim Demaille <akim@epita.fr>
11085
11086 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11087
211074ca
AD
110882003-04-29 Akim Demaille <akim@epita.fr>
11089
11090 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11091 with %pure-parser and %locations to exercise the patch from Yakov
11092 Markovitch below.
11093
6175ffe3
PE
110942003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11095
11096 * data/yacc.c: (b4_lex_param): Corrected for the case where
11097 %lex-param is provided and %pure-parser isn't.
11098
b1e95857
PE
110992003-04-27 Paul Eggert <eggert@twinsun.com>
11100
11101 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 11102 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
11103 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11104 if it is not defined.
11105 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11106
acda9df6
PE
111072003-04-26 Paul Eggert <eggert@twinsun.com>
11108
3470c57b
PE
11109 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11110 Declare to be of type suitable for the ninf value itself, not of
11111 type suitable for the corresponding table, since the latter might
11112 be unsigned but the ninf value might be negative. This fixes a
11113 bug reported by Alexandre Duret-Lutz in
161a71f3 11114 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 11115
acda9df6
PE
11116 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11117 invokes it. We shouldn't invoke it twice because it will attempt
11118 to put error.o in the archive twice. This fixes a glitch reported
11119 by Martin Mokrejs in
161a71f3 11120 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 11121
b5250f26
PE
111222003-04-21 Paul Eggert <eggert@twinsun.com>
11123
11124 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11125 to gnulib.
11126
089ac0f1
PE
111272003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11128
11129 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11130 Fix obvious typo that results in uncompilable GLR parsers
11131 when both %pure-parser and %locations are used. (trivial change)
11132
5ededac6
PE
111332003-04-17 Paul Eggert <eggert@twinsun.com>
11134
1b8f2fff
PE
11135 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11136 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11137 Do not insert the expected token via unput, as this runs afoul
11138 of a POSIX-compatibility bug in flex 2.5.31.
11139 All uses changed to BEGIN the parent state,
11140 since we no longer insert the expected token via unput.
11141 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11142 that is no longer emitted after the above change.
11143
5ededac6
PE
11144 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11145 the first one. This change is from Paul Hilfinger, and it fixes
11146 regression reported by Werner Lemberg in
161a71f3 11147 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
11148
11149 (resolve_sr_conflict): Don't invoke state_errs_set
11150 unless one or more tokens have been explicitly made errors.
11151 Otherwise, the above change causes Bison to abort.
11152
11153 * tests/existing.at (GNU pic Grammar): New test case, taken from
11154 Lemberg's email.
11155
b8be9132
AD
111562003-03-31 Akim Demaille <akim@epita.fr>
11157
11158 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11159
d423d460
AD
111602003-03-31 Akim Demaille <akim@epita.fr>
11161
11162 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11163 output.
11164
c7e441b4
AD
111652003-03-31 Akim Demaille <akim@epita.fr>
11166
11167 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11168 From Paul Hilfinger.
11169
231897ad
AD
111702003-03-29 Akim Demaille <akim@epita.fr>
11171
11172 * m4/error.m4: Do not put under dynamic conditions some code which
11173 expansion is under static control.
11174
5b066063
AD
111752003-03-29 Akim Demaille <akim@epita.fr>
11176
11177 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11178
22a74fec
AD
111792003-03-29 Akim Demaille <akim@epita.fr>
11180
11181 * doc/bison.texinfo (Strings are Destroyed): New.
11182
0eee27e7
PE
111832003-03-13 Paul Eggert <eggert@twinsun.com>
11184
11185 * .cvsignore: Add configure.lineno.
11186 * src/.cvsignore: Add yacc.
11187 * tests/.cvsignore: Add testsuite.log.
11188 * doc/fdl.texi: Sync with latest FSF version.
11189
f61aad93
PE
111902003-03-12 Paul Eggert <eggert@twinsun.com>
11191
537636c7
PE
11192 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11193 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11194 cursor, instead of leaving it undefined. This fixes a bug
11195 reported by Tim Van Holder in
161a71f3 11196 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
11197 * tests/input.at (Torturing the Scanner): Test the scanner on
11198 an empty input file, which was Tim Van Holder's test case.
11199
11200 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11201 <sys/resource.h> can be included, include sys/time.h and
11202 sys/times.h first, if available. This works around the SunOS
11203 4.1.4 porting bug reported by Bruce Becker in
161a71f3 11204 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
11205
11206 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11207 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11208 AC_HEADER_SYS_WAIT.
11209
f61aad93
PE
11210 Merge changes from gnulib. This was prompted because the CVS
11211 snapshot didn't build on Solaris 7 due to strnlen problems.
11212
11213 These changes need to be merged back into gnulib:
11214 * lib/hash.c: Include <stdbool.h> unconditionally.
11215 * m4/onceonly.m4 (m4_quote): New macro.
11216 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11217 Quote AC_FOREACH variable-expansions properly.
11218 The 2003-01-03 obstack.h change also needs merging.
11219 {end of changes requiring merging}
5b066063 11220
f61aad93
PE
11221 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11222 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11223 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11224 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11225 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11226 New files, imported from gnulib.
11227 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11228 above.
11229
11230 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11231 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11232 gnulib sources.
11233
11234 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11235 Add.
11236 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11237 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11238 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11239 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11240 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11241 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11242 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11243 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11244 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11245 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11246 (jm_PREREQ_ARGMATCH): Remove.
11247 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11248 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11249
11250 * src/system.h: Include <stdbool.h> unconditionally.
11251
11252 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11253 assuming at least C89 in the bitset code for some time now.
11254
d2ffe116
AD
112552003-03-03 Akim Demaille <akim@epita.fr>
11256
11257 * ro.po: New.
11258
052826fd
AD
112592003-03-02 Akim Demaille <akim@epita.fr>
11260
11261 * doc/bison.texinfo (Table of Symbols): Reactivate the
11262 documentation for %lex-param, and %parse-param.
11263
c4749565
AD
112642003-03-02 Akim Demaille <akim@epita.fr>
11265
11266 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11267 generate verbose error messages.
11268 Use the number of tokens as an upper bound in yytname, as it
11269 cannot be a non terminal.
11270
d5286af1
AD
112712003-03-02 Akim Demaille <akim@epita.fr>
11272
11273 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11274 message.
11275
22e304a6
AD
112762003-03-02 Akim Demaille <akim@epita.fr>
11277
22e304a6
AD
11278 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11279 Use them to exercise yycheck overrun.
11280 Based on Andrew Suffield's grammar.
11281
67a25fed
AD
112822003-03-02 Akim Demaille <akim@epita.fr>
11283
11284 Create tests/local.at for Bison generic testing macros.
11285
11286 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11287 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11288 This new file.
11289 * tests/calc.at (AT_CHECK_CALC): Adjust.
11290 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11291 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11292 * tests/local.at: here.
11293 (AT_COMPILE_CXX): Tags the tests using it as c++.
11294 Ignore the test if CXX is not functional.
11295
9c2b381f
PE
112962003-03-01 Paul Eggert <eggert@twinsun.com>
11297
11298 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11299 not loc->end, since loc->end might contain garbage and this leads
11300 to undefined behavior on some platforms.
11301 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11302 depend on *loc, so that the reader doesn't give the the false
11303 impression that *loc is initialized.
11304 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11305 does not survive the return.
11306
0433ba88
AD
113072003-03-01 Akim Demaille <akim@epita.fr>
11308
11309 * src/scan-gram.l (code_start): Always initialize it when entering
11310 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11311 yylex invocation. An alternative would be making it static, but
11312 then it starts with the second %%'s beginning, instead of its end.
11313
b305ea69
PE
113142003-02-28 Paul Eggert <eggert@twinsun.com>
11315
11316 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11317 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 11318 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 11319
c3d25e01
PE
113202003-02-26 Paul Eggert <eggert@twinsun.com>
11321
11322 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11323 Remove Sequent/Pyramid discussion (nobody uses them any more).
11324 Merge VMS and MS-DOS discussion; these ports may well be dead
11325 but let's keep mentioning them for now. Put <> around email
11326 addresses. Add copyright notice.
11327
c267ffbc
PE
113282003-02-24 Paul Eggert <eggert@twinsun.com>
11329
11330 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11331 to avoid collision with flex use of yylineno.
11332 Problem reported by Bruce Lilly in
161a71f3 11333 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
11334 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11335 * data/yacc.c (yy_reduce_print): Likewise.
11336
11337 * config/depcomp: Sync with Automake 1.7.3.
11338
f939fc12
AD
113392003-02-21 Akim Demaille <akim@epita.fr>
11340
11341 * data/lalr1.cc: Use temporary variables instead of casts to
11342 change integer types.
11343 Suggested by Paul Eggert.
11344
95923bd6
AD
113452003-02-21 Akim Demaille <akim@epita.fr>
11346
11347 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11348 to avoid confusions with lalr1.cc's notion of Position.
11349 Suggested by Paul Eggert.
11350
2cdc240e
AD
113512003-02-20 Akim Demaille <akim@epita.fr>
11352
11353 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11354 before initial_columns.
11355 (location.hh): Use consistent variable names when defining the
11356 operator<<.
11357 Use "last" so that we subtract from Positions, not from unsigned.
11358
5d003116
AD
113592003-02-20 Akim Demaille <akim@epita.fr>
11360
11361 * data/lalr1.cc (position.hh): New subfile, including the extended
11362 and Doxygen'ed documentation of class Position.
11363 (location.hh): Use it.
11364 Document a` la Doxygen.
ba1ecc07 11365 With the help of Benoit Perrot.
5d003116 11366
d02b25f9
AD
113672003-02-20 Akim Demaille <akim@epita.fr>
11368
11369 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11370 AT_YACC_IF.
11371 Redefine AT_YYERROR_SEES_LOC_IF using it.
11372 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11373 not defined.
11374 Don't use the location in yy::Parser::error_ and
11375 yy::Parser::print_ when not %locations.
11376 Activate more lalr1.cc tests.
11377
0d1c3a04
AD
113782003-02-19 Akim Demaille <akim@epita.fr>
11379
11380 * data/lalr1.cc: When displaying a line number, be sure to make it
11381 an int.
11382
60a777aa
AD
113832003-02-19 Akim Demaille <akim@epita.fr>
11384
11385 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11386 Remove, useless.
11387 (YYABORT, YYACCEPT, YYERROR): New.
11388 * tests/calc.at: Renable the lalr1.cc test.
11389
0b86fc41
AD
113902003-02-19 Akim Demaille <akim@epita.fr>
11391
11392 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11393 error recovery, mixing with/without pops and discarding of the
11394 lookahead.
11395 Exercise YYERROR.
11396 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11397
da99a5dc
PE
113982003-02-17 Paul Eggert <eggert@twinsun.com>
11399
11400 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11401 * tests/testsuite.at (AT_COMPILE): Use them.
11402 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 11403 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 11404
93b8c255
PE
114052003-02-12 Paul Eggert <eggert@twinsun.com>
11406
11407 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11408 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 11409 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
11410 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11411 Check for malloc failure, for consistency with yacc.c.
11412 (yytname_size): Remove, for consistency with yacc.c.
11413
11414 The bug still remains in data/lalr1.cc, as I didn't have time
11415 to fix it there.
11416
7548fed2
AD
114172003-02-06 Akim Demaille <akim@epita.fr>
11418
11419 * configure.ac (GXX): Rename as...
11420 (CXX): this, to keep the original Autoconf semantics.
11421 Require 2.57.
11422 * data/lalr1.cc: Fix b4_copyright invocations.
11423 If YYDEBUG is not defined, don't depend upon name_ being defined.
11424 (location.hh): Include string and iostream.
11425 (Position::filename): New member.
11426 (Position::Position ()): New.
11427 (operator<< (Position)): New.
11428 (operator- (Position, int)): New.
11429 (Location::first, Location::last): Rename as...
11430 (Location::begin, Location::end): these, to mock the conventional
11431 iterator names.
11432 (operator<< (Location)): New.
11433 * tests/atlocal.in (CXX): New.
11434 * tests/testsuite.at (AT_COMPILE_CXX): New.
11435 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11436 locations in a more synthetic way.
11437 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11438 lalr1.cc is used.
11439 Adjust the C locations to match those from Emacs: first column is
11440 column 0.
11441 Change all the expected results.
11442 Conform to the GCS: simplify the locations when applicable.
11443 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11444 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11445 these CPP macros with the m4 macros new defined by...
11446 (AT_CHECK_PUSHDEFS): this, i.e.:
11447 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 11448 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
11449 New macros.
11450 (AT_CHECK_POPDEFS): Undefine them.
11451 (AT_CHECK_CALC_LALR1_CC): New.
11452 Use it for the first lalr1.cc test.
11453
43a176ef
AD
114542003-02-04 Akim Demaille <akim@epita.fr>
11455
11456 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11457 Location as is defined.
11458
fc049e9c
AD
114592003-02-04 Akim Demaille <akim@epita.fr>
11460
11461 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11462 name_ being defined.
11463
a737b216
PE
114642003-02-03 Paul Eggert <eggert@twinsun.com>
11465
11466 * src/gram.h (start_symbol): Remove unused decl.
11467
11468 Use more-consistent naming conventions for local vars.
11469
11470 * src/derives.c (derives_compute): Change type of local var from
11471 int to rule_number.
11472 * src/gram.c (grammar_rules_partial_print): Likewise.
11473 * src/print.c (print_core): Likewise.
11474 * src/reduce.c (reduce_grammar_tables): Likewise.
11475
11476 * src/gram.c (grammar_dump): Change name of item_number *
11477 local var from r to rp.
11478 * src/nullable.c (nullable_compute): Likewise.
11479
11480 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11481
11482 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11483 for symbol or symbol_number var.
11484 * src/reader.c (grammar_start_symbol_set): Likewise.
11485 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11486 Likewise.
11487 * src/state.c (transitions_to): Likewise.
11488 * src/state.h: Likewise.
11489 * src/tables.c (symbol_number_to_vector_number): Likewise.
11490
11491 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11492 char * var.
11493
11494 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11495 var.
11496
11497 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11498 var.
11499
11500 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11501 Use str, not s, for char * var. Use ch, not c, for character var.
11502 Use size for size var.
11503
11504 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11505 char * var.
11506 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11507 uniqstr var.
11508 * src/uniqstr.h: Likewise.
11509
11510 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11511 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11512 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11513 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11514 param to have same name as that of enum, so that we don't use
11515 "s" to stand for a non-state.
11516
68e93ad5
AD
115172003-02-02 Akim Demaille <akim@epita.fr>
11518
11519 * src/scan-skel.l: Scan more than one inert character per yylex
11520 invocation.
11521
92898986
PE
115222003-02-01 Paul Eggert <eggert@twinsun.com>
11523
11524 Version 1.875a.
11525
1d9d5d71
PE
11526 * po/LINGUAS: Add ms.
11527
0435d061
AD
115282003-01-30 Akim Demaille <akim@epita.fr>
11529
11530 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11531
6029a57f
PH
115322003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11533
11534 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11535 of $1.
0435d061
AD
11536
11537 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 11538 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 11539 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 11540
6029a57f
PH
11541 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11542 (b4_rhs_location): Ditto.
0435d061 11543 (yyfill): New function to copy from stack tree into array
6029a57f 11544 incrementally.
0435d061
AD
11545 (yyuserAction): Modify to allow incremental move of semantic values
11546 to rhs array when in GLR mode.
11547 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
11548 as needed.
11549 Remove dummy use of yystack, as there is now a guaranteed use.
11550 (yydoAction): Modify to allow incremental move of semantic values
11551 to rhs array when in GLR mode.
11552 (yyresolveAction): Ditto.
11553 (yyglrShiftDefer): Update comment.
0435d061 11554 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
11555 (yyglrReduce): Ditto.
11556 (yydoAction): Ditto
0435d061 11557
6029a57f
PH
11558 * tests/glr-regr1.at: Rename to ...
11559 * tests/glr-regression.at: Add new regression test for the problems
11560 described above (adapted from S. Eken).
11561 Update copyright notice.
11562 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11563 * tests/Makefile.am: Ditto.
11564
6cee6297
PE
115652003-01-28 Paul Eggert <eggert@twinsun.com>
11566
11567 * data/lalr1.cc: Do not use @output_header_name@ unless
11568 b4_defines_flag is set. This fixes two bugs reported by
11569 Tim Van Holder in
161a71f3
PE
11570 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11571 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 11572
b2a836b5
PE
115732003-01-21 Paul Eggert <eggert@twinsun.com>
11574
11575 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11576 we don't need to worry about yyerrlab1 being reported as an
11577 "unused label" by non-GCC C compilers. The downside is that if
11578 locations are used then a couple of statements are duplicated each
11579 time YYERROR is invoked, but the upside is that the warnings
11580 should vanish.
11581 (yyerrlab1): Move code to YERROR.
11582 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11583 This reverts some of the 2002-12-27 change.
11584
4196b931
PE
115852003-01-17 Paul Eggert <eggert@twinsun.com>
11586
11587 * src/output.c (symbol_printers_output): Fix typo that led
11588 to core dump. Problem reported by Antonio Rus in
161a71f3 11589 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 11590
3ae831b4
AD
115912003-01-13 Akim Demaille <akim@epita.fr>,
11592 Quoc Peyrot <chojin@lrde.epita.fr>,
11593 Robert Anisko <anisko_r@lrde.epita.fr>
11594
11595 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11596 when the stacks contain one element, as the loop would otherwise
11597 free the last state, and then use the top state (the one we just
11598 popped). This means that the initial elements will not be freed
11599 explicitly, as is the case in yacc.c; it is not a problem, as
11600 these elements have fake values.
11601
e3aa65c5
PE
116022003-01-11 Paul Eggert <eggert@twinsun.com>
11603
11604 * NEWS: %expect-violations are now just warnings, reverting
11605 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11606 bootstrapping problem reported by Matthias Klose; see
161a71f3 11607 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
11608 * src/conflicts.c (conflicts_print): Likewise.
11609 * tests/conflicts.at (%expect not enough, %expect too much,
11610 %expect with reduce conflicts): Likewise.
11611 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11612 that the warning is enabled if the number of conflicts changes
11613 (not necessarily increases).
11614
11615 * src/getargs.c (version): Update copyright year.
11616
f0057011
AD
116172003-01-09 Akim Demaille <akim@epita.fr>
11618
11619 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11620
1ee6d2a0
PE
116212003-01-08 Paul Eggert <eggert@twinsun.com>
11622
11623 * Makefile.maint (WGETFLAGS):
11624 New macro, containing "-C off" to disable proxy caches.
11625 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11626 (rel-check): Use $(WGET) instead of wget.
11627
d4fd77c4
PE
116282003-01-06 Paul Eggert <eggert@twinsun.com>
11629
11630 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11631 the GLR paper of Scott, Johnstone and Hussain.
11632
464c6927
PE
116332003-01-04 Paul Eggert <eggert@twinsun.com>
11634
d600ee67
PE
11635 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11636 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11637 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11638 (EXTRA_LIBRARIES): New var, for liby.a.
11639 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11640 (EXTRA_SCRIPTS): New var, for yacc.
11641
464c6927
PE
11642 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11643 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11644 Problem reported by Nelson H. F. Beebe.
11645
116462003-01-03 Paul Eggert <eggert@twinsun.com>
11647
11648 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11649 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11650 when compiling Bison 1.875's `bitset bset = obstack_alloc
11651 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11652
11653 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11654 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11655 grow to a huge size with typical invocation.
d600ee67 11656
464c6927
PE
11657 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11658 Use the pattern recommended by Autoconf 2.57, except also protect
11659 against double-definition.
11660 * src/system.h: Likewise.
11661 Portability issues reported by Nelson H. F. Beebe.
d600ee67 11662
464c6927
PE
11663 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11664 All uses changed. Provide a definition in both C and C++.
11665 (yytrue, yyfalse): Define even if defined (__cplusplus).
11666
11667 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11668 Reported by Nelson H. F. Beebe.
d600ee67 11669
464c6927
PE
11670 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11671
0f42c7d5
PE
116722003-01-02 Paul Eggert <eggert@twinsun.com>
11673
11674 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11675 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11676 Bug reported by Nelson H. F. Beebe.
11677
dc546b0f
PE
116782003-01-01 Paul Eggert <eggert@twinsun.com>
11679
11680 * Version 1.875.
11681
2c09b6a7
PE
116822002-12-30 Paul Eggert <eggert@twinsun.com>
11683
11684 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11685 Moved here from...
11686 (<INITIAL>","): Here. This causes stray "," to be treated
11687 more uniformly.
11688
dc546b0f 11689 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
11690 last brace in braced code when not in Yacc mode, for compatibility
11691 with Bison 1.35. This resurrects the 2001-12-15 patch to
11692 src/reader.c.
11693
11694 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11695 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11696
535c0f63
PE
116972002-12-28 Paul Eggert <eggert@twinsun.com>
11698
11699 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11700 that of SYM's type. This fixes Debian bug 168069, reported by
11701 Thomas Olsson.
d600ee67 11702
963fcc17
PE
117032002-12-28 Paul Eggert <eggert@twinsun.com>
11704
11705 Version 1.75f.
11706
11707 Switch back to the Yacc style of conflict reports, undoing some
11708 of the 2002-07-30 change.
11709 * doc/bison.texinfo (Understanding): Use Yacc style for
11710 conflict reports. Also, use new way of locating rules.
11711 * src/conflicts.c (conflict_report):
11712 Renamed from conflict_report_yacc, removing the old
11713 'conflict_report'. Translate the entire conflict report at once,
11714 so that we don't assume that "," has the same interpretation in
11715 all languages.
11716 (conflicts_output): Use Yacc-style conflict report for each state,
11717 instead of our more-complicated style.
11718 (conflicts_print): Use Yacc-style conflict report, except print
11719 the input file name when not emulating Yacc.
11720 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11721 Conflicted Reduction, %expect not enough, %expect too much,
11722 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11723 * tests/existing.at (GNU Cim Grammar): Likewise.
11724 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11725
11726 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11727 fatal): Don't invoke fflush; it's not needed and it might even be
11728 harmful for stdout, as stdout might not be open.
11729 * src/reduce.c (reduce_print): Likewise.
11730
b1efe548
PE
117312002-12-27 Paul Eggert <eggert@twinsun.com>
11732
11733 Fix a bug where error locations were not being recorded correctly.
11734 This problem was originally reported by Paul Hilfinger in
161a71f3 11735 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
11736
11737 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11738 top of the location stack's error locations.
11739 (yyerrlab): Set it. When discarding a token, push its location
11740 onto yylerrsp so that we don't lose track of the error's end.
11741 (yyerrlab1): Now is only the target of YYERROR, so that we can
11742 properly record the location of the action that failed. For GCC
11743 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11744 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11745 (yyerrlab2): New label, which yyerrlab now falls through to.
11746 Compute the error's location by applying YYLLOC_DEFAULT to
11747 the locations of all the symbols that went into the error.
11748 * doc/bison.texinfo (Location Default Action): Mention that
11749 YYLLOC_DEFAULT is also invoked for syntax errors.
11750 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11751 Error locations include the locations of all the tokens that were
11752 discarded, not just the last token.
d600ee67 11753
983c5c2c
PE
117542002-12-26 Paul Eggert <eggert@twinsun.com>
11755
b1efe548
PE
11756 * src/files.c: Include quote.h.
11757 (compute_output_file_names): Warn if we detect conflicting
11758 outputs to the same file. This should catch the misunderstanding
11759 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11760
11761 * src/conflicts.c (conflicts_print): If the user specifies
11762 "%expect N", report an error if there are any reduce/reduce
11763 conflicts. This is what the manual says should happen.
11764 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11765 * tests/conflicts.at (%expect with reduce conflicts): New test.
11766
983c5c2c
PE
11767 Don't use m4_include on relative file names, as it doesn't work as
11768 desired if there happens to be a file with that name under ".".
d600ee67 11769
983c5c2c
PE
11770 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11771 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11772 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11773 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11774 * src/output.c (output_skeleton): Use full path names when
11775 specifying a file to include; don't rely on include path, as
11776 it's unreliable when the working file contains a file with
11777 that name.
d600ee67 11778
983c5c2c
PE
117792002-12-25 Paul Eggert <eggert@twinsun.com>
11780
11781 Remove obsolete references to bison.simple and bison.hairy.
11782 Problem mentioned by Aubin Mahe in
161a71f3 11783 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
11784 * data/glr.c: Comment fix.
11785 * doc/bison.1: Remove references. Also, mention "yacc".
11786
11787 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11788 with -g option.
11789
11790 * src/parse-gram.y (declaration): Use enum "report_states" rather
11791 than its numeric value 1.
11792
11793 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11794 opening a new one. This fixes Debian bug 165349, reported by
11795 Bruce Stephens.
11796
23f2d9dc
PE
117972002-12-24 Paul Eggert <eggert@twinsun.com>
11798
11799 Version 1.75e.
11800
11801 * Makefile.maint (cvs-update): Don't assume that the shell
11802 supports $(...), as Solaris sh doesn't.
11803
11804 * src/parse-gram.y (lloc_default): Remove test for empty
11805 nonterminals at the end, since it didn't change the result.
11806
118072002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
11808
11809 If the user does not define YYSTYPE as a macro, Bison now declares it
11810 using typedef instead of defining it as a macro. POSIX requires this.
11811 For consistency, YYLTYPE is also declared instead of defined.
11812
11813 %union directives can now have a tag before the `{', e.g., the
11814 directive `%union foo {...}' now generates the C code
11815 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11816 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11817 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11818 instead of `yyltype'.
11819
11820 `yystype' and `yyltype' are now obsolescent macros instead of being
11821 typedefs or tags; they are no longer documented and will be
11822 withdrawn in a future release.
11823
11824 * data/glr.c (b4_location_type): Remove.
11825 (YYSTYPE): Renamed from yystype.
11826 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11827 (struct YYLTYPE): Renamed from struct yyltype.
11828 (YYLTYPE): Renamed from yyltype.
11829 (yyltype, yystype): New (and obsolescent) macros,
11830 for backward compatibility.
11831 * data/yacc.c: Likewise.
11832
11833 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11834 does not specify a union tag. This is for compatibility with
11835 Solaris 9 yacc.
11836
11837 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11838 const *, since it is now modified by stripping surrounding { }.
11839 (current_braced_code): Remove.
11840 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11841 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11842 trailing " {...}". Now of type <chars>.
11843 (grammar_declaration): Adjust to bundled tokens.
11844 (code_content): Remove; stripping is now done by add_param.
11845 (print_token_value): Print contents of bundled tokens.
11846 (token_name): New function.
11847
11848 * src/reader.h (braced_code, current_braced_code): Remove.
11849 (token_name): New decl.
11850
11851 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11852 token_type, not braced_code code_kind. All uses changed.
11853 (SC_PRE_CODE): New state, for scanning after a keyword that
11854 has (or usually has) an immediately-following braced code.
11855 (token_type): New local var, to keep track of which token type
11856 to return when scanning braced code.
11857 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 11858 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
11859 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11860 instead of returning a token type immediately.
11861 (<INITIAL>"{"): Set token type.
11862 (<SC_BRACED_CODE>"}"): Use it.
11863 (handle_action_dollar, handle_action_at): Now returns bool
11864 indicating success. Fail if ! current_rule; this prevents a core dump.
11865 (handle_symbol_code_dollar, handle_symbol_code_at):
11866 Remove; merge body into caller.
11867 (handle_dollar, handle_at): Complain in invalid contexts.
11868
11869 * NEWS, doc/bison.texinfo: Document the above.
11870 * NEWS: Fix years and program names in copyright notice.
11871
879ca4f8
PE
118722002-12-17 Paul Eggert <eggert@twinsun.com>
11873
11874 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11875 Reporting, Table of Symbols): Omit mentions of %lex-param and
11876 %parse-param from the documentation for now.
11877
1c5fe69d
PE
118782002-12-15 Paul Eggert <eggert@twinsun.com>
11879
11880 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11881 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11882 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
11883 disagreed with the Bison documentation. Bug
11884 reported by Andrew Walrond.
d600ee67 11885
1c5fe69d
PE
11886 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11887 as the caller now does that.
11888 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11889 (YYEMPTY): Parenthesize right hand side, since others use it.
11890 (yyparse): Don't assume that our generated code is the only code
11891 that sets yychar.
11892
d1de5372
PE
118932002-12-13 Paul Eggert <eggert@twinsun.com>
11894
11895 Version 1.75d.
11896
11897 POSIX requires a "yacc" command.
11898 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11899 (MOSTLYCLEANFILES): Add yacc.
11900 (yacc): New rule.
1c5fe69d 11901 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
11902 as an alias for bison y.
11903
11904 * po/LINGUAS: Add da.
d600ee67 11905
d1de5372
PE
11906 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11907 problem with latest <getopt.h>.
11908 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11909
11910 * doc/fdl.texi: Upgrade to 1.2.
11911 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11912 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11913 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11914 gnulib.
11915 * config/install-sh: Sync with autotools.
11916
11917 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 11918 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
11919 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11920 locations are requested.
11921 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11922 locations are requested.
11923
d0f3fe23
PE
119242002-12-12 Paul Eggert <eggert@twinsun.com>
11925
11926 Remove unportable casts and storage allocation tricks.
11927 While we're at it, remove almost all casts, since they
11928 usually aren't needed and are a sign of trouble.
11929
11930 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11931
11932 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11933 the pointer DSET returned by malloc; this isn't portable.
11934 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11935 Similarly for DERIVES.
11936 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11937 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11938 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11939
11940 * src/derives.c (derives_compute): Do not bother invoking
11941 int_of_rule_number, since rule numbers are integers.
11942
11943 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11944 rather than XMALLOC (char, N).
11945
11946 * src/files.c (filename_split): Rewrite to avoid cast.
11947
11948 * src/gram.h (symbol_number_as_item_number,
11949 item_number_as_symbol_number, rule_number_as_item_number,
11950 item_number_as_rule_number):
11951 Now inline functions rather than macros, to avoid casts.
11952 * src/state.h (state_number_as_int): Likewise.
11953 * src/tables.c (state_number_to_vector_number,
11954 symbol_number_to_vector_number): Likewise.
11955
11956 * src/gram.h (int_of_rule_number): Remove; no longer used.
11957
11958 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11959 since the resulting storage is always stored into.
11960
11961 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11962 where it's needed.
11963
11964 * src/muscle_tab.c (muscle_m4_output):
11965 Now inline. Return bool, not int.
11966 * src/state.c (state_compare): Likewise.
11967 * src/symtab.c (symbol_check_defined,
11968 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11969 hash_compare_symbol, hash_symbol):
11970 Likewise.
11971 * src/uniqstr.c (uniqstr_print): Likewise.
11972 * src/muscle_tab.c (muscle_m4_output_processor):
11973 New function, to avoid casts.
11974 * src/state.c (state_comparator, stage_hasher): Likewise.
11975 * src/symtab.c (symbol_check_defined_processor,
11976 symbol_check_alias_consistency_processor, symbol_pack_processor,
11977 symbol_translation_processor, hash_symbol_comparator,
11978 hash_symbol_hasher): Likewise.
11979 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11980 * src/muscle_tab.c (muscles_m4_output):
11981 Use new functions instead of casting old functions unportably.
11982 * src/state.c (state_hash_new): Likewise.
11983 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11984 symbols_token_translations_init):
11985 Likewise.
11986 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11987
11988 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11989 var instead of casting to long, to avoid casts.
11990 (prepare_states): Use MALLOC rather than alloca, so that we don't
11991 have to worry about alloca.
11992 * src/state.c (state_hash_lookup): Likewise.
11993
11994 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11995 local var instead of casting to unsigned char, to avoid casts.
11996
11997 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11998 STATE_ALLOC): Remove.
11999 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12000 rather than calloc, and use offsetof to avoid allocating slightly
12001 too much storage.
12002 (state_new): Initialize all members.
12003
12004 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12005
12006 * src/symtab.c (symbol_free): Remove; unused.
12007 (symbol_get): Remove cast in lhs of assignment.
12008 (symbols_do): Now static. Accept generic arguments, not
12009 hashing-related ones.
12010
12011 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12012 (symbol_processor): Remove.
12013 (symbols_do): Remove decl; now static.
12014
12015 * src/system.h (alloca): Remove; decl no longer needed.
12016 (<stddef.h>): Include, for offsetof.
12017 (<inttypes.>, <stdint.h>): Include if available.
12018 (uintptr_t): New type, if system lacks it.
12019 (CALLOC, MALLOC, REALLOC): New macros.
12020 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12021 new macros.
12022
12023 * src/tables.c (table_size): Now int, to pacify GCC.
12024 (table_grow, table_ninf_remap): Use signed table size.
12025 (save_row): Don't bother initializing locals when not needed.
12026 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12027 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12028
12029 * src/vcg.h: Correct misspellings.
12030
12031 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12032
12033
12034 * src/getargs.c (getargs): Don't assume EOF == -1.
12035
26b4a969
PE
120362002-12-09 Paul Eggert <eggert@twinsun.com>
12037
12038 Change identifier spellings to avoid collisions with names
12039 that are reserved by POSIX.
12040
12041 Don't use names ending in _t, since POSIX reserves them.
12042 For consistency, remove _e and _s endings -- they're weren't
12043 needed to remove ambiguity. All uses changed.
12044 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12045 turn was just renamed from struniq_t.
12046 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12047 which in turn was just renamed from struniq_processor_t.
12048 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12049 in turn was renamed from hash_compare_struniq_t.
12050 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12051 (state_list): Renamed from state_list_t.
12052 * src/assoc.h (assoc): Renamed from assoc_t.
12053 * src/conflicts.c (enum conflict_resolution): Renamed from
12054 enum conflict_resolution_e.
12055 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12056 (rule_list): Renamed from rule_list_t.
12057 * src/getargs.h (enum trace): Renamed from enum trace_e.
12058 (enum report): Renamed from enum report_e.
12059 * src/gram.h (item_number): Renamed from item_number_t.
12060 (rule_number): Renamed from rule_number_t.
12061 (struct rule_s): Remove the "rule_s" part; not used.
12062 (rule): Renamed from rule_t.
12063 (rule_filter): Renamed from rule_filter_t.
12064 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12065 (goto_list): Renamed from goto_list_t.
12066 * src/lalr.h (goto_number): Renamed from goto_number_t.
12067 * src/location.h (location): Renamed from location_t.
12068 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12069 and moved here from:
12070 * src/muscle_tab.h (muscle_entry_t): here.
12071 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12072 (rule_list): Renamed from rule_list_t.
12073 * src/print_graph.c (static_graph): Renamed from graph.
12074 * src/reader.h (braced_code): Renamed from braced_code_t.
12075 Remove brace_code_e tag.
12076 * src/relation.h (relation_node): Renamed from relation_node_t.
12077 (relation_nodes): Renamed from relation_nodes_t.
12078 (relation): Renamed from relation_t.
12079 * src/state.h (state_number): Renamed from state_number_t.
12080 (struct state): Renamed from struct state_s.
12081 (state): Renamed from state_t.
12082 (transitions): Renamed from transitions_t. Unused (and
12083 misspelled) transtion_s tag removed.
12084 (errs): Renamed from errs_t. Unused errs_s tag removed.
12085 (reductions): Renamed from reductions_t. Unused tag
12086 reductions_s removed.
12087 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12088 (struct symbol_list): Renamed from struct symbol_list_s.
12089 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12090 (struct symbol): Renamed from struct symbol_s.
12091 (symbol): Renamed from symbol_t.
12092 * src/tables.c (vector_number): Renamed from vector_number_t.
12093 (action_number): Renamed from action_t.
12094 * src/tables.h (base_number): Renamed from base_t.
12095 * src/vcg.h (enum color): Renamed from enum color_e.
12096 (enum textmode): Renamed from enum textmode_e.
12097 (enum shape): Renamed from enum shape_e.
12098 (struct colorentry): Renamed from struct colorentry_s.
12099 (struct classname): Renamed from struct classname_s.
12100 (struct infoname): Renamed from struct infoname_s.
12101 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12102 (enum decision): Renamed from enum decision_e.
12103 (enum orientation): Renamed from enum orientation_e.
12104 (enum alignment): Renamed from enum alignment_e.
12105 (enum arrow_mode): Renamed from enum arrow_mode_e.
12106 (enum crossing_type): Renamed from enum crossing_type_e.
12107 (enum view): Renamed from enum view_e.
12108 (struct node): Renamed from struct node_s.
12109 (node): Renamed from node_t.
12110 (enum linestyle): Renamed from enum linestyle_e.
12111 (enum arrowstyle): Renamed from enum arrowstyle_e.
12112 (struct edge): Renamed from struct edge.
12113 (edge): Renamed from edge_t.
12114 (struct graph): Renamed from struct graph_s.
12115 (graph): Renamed from graph_t.
12116 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12117 Rename value_t -> value.
12118 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12119 value_t_as_yystype -> value_as_yystype.
12120
12121 Don't include <errno.h> in the mainstream code, since it
12122 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12123 * lib/get-errno.c, lib/get-errno.h: New files.
12124 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12125 get-errno.c.
12126 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12127 * src/output.c (output_skeleton): Likewise.
12128 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12129 instead of errno.
12130 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12131 Likewise.
12132 (handle_action_dollar, handle_action_at): Likewise.
12133 * src/system.h: Do not include <errno.h>.
12134 (TAB_EXT): Renamed from EXT_TAB.
12135 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12136
12137 Avoid str[a-z]*, since <string.h> reserves that name space.
12138 Change all instances of "struniq" in names to "uniqstr", and
12139 likewise for "STRUNIQ" and "UNIQSTR".
12140 * src/uniqstr.c: Renamed from src/struniq.c.
12141 * src/uniqstr.h: Renamed from src/struniq.h.
12142 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12143 * src/files.c (strsuffix): Remove; unused.
12144 (concat2): Renamed from stringappend. Now static.
12145 * src/files.h (strsuffix, stringappend): Remove; unused.
12146 * src/parse-gram.y (<chars>): Renamed from <string>.
12147 (<uniqstr>): Renamed from <struniq>.
12148 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12149 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12150 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12151 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12152 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12153 (N_EXPAND): Renamed from N_STRETCH.
12154
12155 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12156 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12157 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12158 Remove; unused.
12159 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12160 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12161 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12162 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12163 (BASE_MAXIMUM): Renamed from BASE_MAX.
12164 (BASE_MINIMUM): Renamed from BASE_MIN.
12165 (ACTION_MAX): Remove; unused.
12166 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12167 Unnecessary casts removed from above defines.
12168
12169
12170 Fix misspelling in names.
12171 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12172 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12173 G_NODE_ALIGNEMENT.
12174
12175
12176 * lib/timevar.c (timevar_report): Renamed from time_report,
12177 for consistency with other names.
12178 * lib/timevar.h (timevar_report): New decl.
12179 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12180
12181
12182 Sort include-file uses.
12183
12184 Reorder all include files under src to be in the order "system.h".
12185 then the ../lib include files in angle brackets (alphabetized),
12186 then the . include files in double-quotes (alphabetized). Fix
12187 dependency breakages encountered in this process, as follows:
12188 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12189 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12190 * src/state.h: Include "symtab.h".
12191
996b1c7e
PE
121922002-12-08 Paul Eggert <eggert@twinsun.com>
12193
12194 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12195 since this causes problems when __file__ contains character
12196 sequences like "@" that are treated specially by src/scan-skel.l.
12197 Instead, just use the file's basename. This fixes the bug
12198 reported by Martin Mokrejs in
161a71f3 12199 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 12200
e19c4e5d
PE
122012002-12-06 Paul Eggert <eggert@twinsun.com>
12202
12203 Add support for rules that do not have trailing semicolons, as
12204 POSIX requires. Improve the quality of locations in Bison
12205 diagnostics.
26b4a969 12206
e19c4e5d
PE
12207 * src/location.c: Include <quotearg.h>.
12208 (empty_location): Now const.
12209 (location_print): New function. Follow the recommendation of the
12210 GNU Coding Standards for locations that span file boundaries.
12211 * src/location.h: Do not include <quotearg.h>; no longer needed.
12212 (boundary): New type.
12213 (location_t): Use it. This allows locations to span file boundaries.
12214 All member uses changed: file -> start.file or end.file (as needed),
12215 first_line -> start.line, first_column -> start.column,
12216 last_line -> end.line, last_column -> end.column.
12217 (equal_boundaries): New function.
12218 (LOCATION_RESET, LOCATION_STEP): Remove.
12219 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12220 (empty_location): Now const.
12221 (location_print): New decl.
12222 * src/parse-gram.y (lloc_default): New function, which handles
12223 empty locations more accurately.
12224 (YYLLOC_DEFAULT): Use it.
12225 (%token COLON): Remove.
12226 (%token ID_COLON): New token.
26b4a969 12227 (rules): Use it.
e19c4e5d
PE
12228 (declarations, rules): Remove trailing semicolon.
12229 (declaration, rules_or_grammar_declaration):
12230 Allow empty (";") declaration.
12231 (symbol_def): Remove empty actions; no longer needed.
12232 (rules_or_grammar_declaration): Remove trailing semicolon.
12233 (semi_colon.opt): Remove.
12234 * src/reader.h: Include location.h.
12235 (scanner_cursor): New decl.
12236 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12237 rolling our own.
12238 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12239 of *loc.
12240 (STEP): Remove. No longer needed, now that adjust_location does
12241 the work. All uses removed.
12242 (scanner_cursor): New var.
12243 (adjust_location): Renamed from extend_location. It now sets
12244 *loc and adjusts the scanner cursor. All uses changed.
12245 Don't bother testing for CR.
12246 (handle_syncline): Remove location arg; now updates scanner cursor.
12247 All callers changed.
12248 (unexpected_end_of_file): Now accepts start boundary of token or
12249 comment, not location. All callers changed. Update scanner cursor,
12250 not the location.
12251 (SC_AFTER_IDENTIFIER): New state.
12252 (context_state): Renamed from c_context. All uses changed.
12253 (id_loc, code_start, token_start): New local vars.
12254 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12255 processing of Yacc white space and equivalents here.
12256 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12257 instead of returning ID immediately, since we need to search for
12258 a subsequent colon.
12259 (<INITIAL>"'", "\""): Save token_start.
12260 (<INITIAL>"%{", "{", "%%"): Save code_start.
12261 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12262 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12263 BEGIN context_state at end, not INITIAL.
12264 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12265 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12266 Return correct token start.
12267 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12268 the start of a character, string or multiline comment is found.
12269 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12270 Reduction): Adjust reported locations to match the more-precise
12271 results now expected.
12272 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12273 * tests/reduce.at (Useless Rules, Reduced Automaton,
12274 Underivable Rules): Likewise.
12275 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12276 or "|"' now that so many other tokens are allowed by the new grammar.
12277
12278 * src/complain.h (current_file): Remove duplicate decl;
12279 current_file is now owned by files.h.
12280 * src/complain.c, src/scan-gram.l: Include files.h.
12281
122822002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 12283
e19c4e5d
PE
12284 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12285 promotes to int; it might be unsigned int.
12286 * data/yacc.c (yy_reduce_print): Likewise.
12287
12288 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12289 be #defined in the prologue, not in the Bison declarations.
12290 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 12291
b64755e3
PE
122922002-12-02 Paul Eggert <eggert@twinsun.com>
12293
12294 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12295 * lib/strtoul.c: New file, from gnulib.
12296 This fixes a porting bug reported by Peter Klein in
161a71f3 12297 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 12298
6e746484
PE
122992002-11-30 Paul Eggert <eggert@twinsun.com>
12300
b64755e3
PE
12301 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12302 and put only a forward declaration in the prologue. This is for
12303 consistency with the other scanner helper functions.
12304
6ba55592
PE
12305 Type clashes now generate warnings, not errors, since it
12306 appears that POSIX may allow some grammars with type clashes.
12307 * src/reader.c (grammar_current_rule_check): Warn about
12308 type clashes instead of complaining.
12309 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12310
6e746484
PE
12311 Add Yacc library, since POSIX requires it.
12312 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12313 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12314 * lib/main.c, lib/yyerror.c: New files.
12315
12316 gram_error can be static; it need not be extern.
12317 * src/reader.h (gram_error): Remove decl.
12318 * src/parse-gram.y (gram_error): Now static. Add static decl.
12319 (print_token_value): Omit parameter names from forward decl,
12320 for consistency.
12321
88510f9c
PE
123222002-11-29 Paul Eggert <eggert@twinsun.com>
12323
6e746484
PE
12324 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12325 be declared before being used. E.g., one should typically
12326 declare them in the prologue. Use GNU coding style in examples.
12327 Put "const" consistently after the type it modifies. Mention
12328 that C99 supports "inline". Mention that yyerror traditionally
12329 returns "int".
12330
88510f9c
PE
12331 %parse-param and %lex-param now take just one argument, the
12332 declaration; the argument name is deduced from the declaration.
12333
12334 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12335 Reporting, Table of Symbols): Document this.
12336 * src/parse-gram.y (add_param): New function.
12337 (COMMA): Remove.
12338 (declaration): Implement new rule for %parse-param and %lex-param.
12339 * src/scan-gram.l: "," now elicits a warning, rather than being
12340 a token; this is more compatible with byacc.
12341 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12342
bb92250c
PE
123432002-11-27 Paul Eggert <eggert@twinsun.com>
12344
12345 Rename identifiers to avoid real and potential collisions.
12346
12347 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12348 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 12349 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
12350 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12351 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12352 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12353 All uses changed.
12354 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12355 The name "yycontrol" violates the name space rules, and this stuff
12356 wasn't being used anyway.
12357 (input): Remove action; this stuff wasn't being used.
12358 (gram_error): Rename local variable yylloc -> loc.
12359 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12360 (YY_DECL): Don't use "yy" at start of local variables.
12361 All uses changed, e.g., yylloc -> loc.
12362 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12363 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12364 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12365 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12366
12367 * src/parse-gram.y (gram_error): loc is now const *.
12368 * src/reader.h (gram_error): Likewise.
12369
3af4feb2
PE
123702002-11-24 Paul Eggert <eggert@twinsun.com>
12371
12372 Version 1.75c.
12373
12374 * tests/actions.at (Actions after errors): Use an output format
12375 more similar to that of the Printers and Destructors test.
12376 Test the position of the ';' token too.
12377 (Printers and Destructors): Likewise.
12378 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12379 unnecessarily alarming people when the test fails.
12380
12381 * data/yacc.c (yyerrlab1): Move this label down, so that the
12382 parser does not discard the lookahead token if the user code
12383 invokes YYERROR. This change is required for POSIX conformance.
12384
12385 * lib/error.c: Sync with gnulib.
12386
123872002-11-22 Paul Eggert <eggert@twinsun.com>
12388
12389 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12390 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12391 * lib/xmalloc.c: Likewise.
26b4a969 12392
58004308
PE
123932002-11-20 Paul Eggert <eggert@twinsun.com>
12394
12395 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12396
123972002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 12398
58004308
PE
12399 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12400 should use `if (! x) abort ();' rather than `assert (x);', and
12401 anyway it's one less thing to worry about configuring.
12402
12403 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12404 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12405 and replace all instances of assert with abort.
12406 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12407 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12408
12409 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12410 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12411 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12412 hash_find_entry, hash_rehash, hash_insert): Likewise.
12413 * src/conflicts.c (resolve_sr_conflict): Likewise.
12414 * src/lalr.c (set_goto_map, map_goto): Likewise.
12415 * src/nullable.c (nullable_compute): Likewise.
12416 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12417 * src/reader.c (packgram, reader): Likewise.
12418 * src/state.c (state_new, state_free, state_transitions_set,
12419 state_reduction_find): Likewise.
12420 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12421 symbol_pack): Likewise.
12422 * src/tables.c (conflict_row, pack_vector): Likewise.
12423 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12424 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12425 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12426 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12427
12428 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12429 (ARGMATCH_CONSTRAINT): New macro.
12430 (ARGMATCH_ASSERT): Use it.
12431
12432 * src/system.h (verify): New macro.
12433 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12434 rather than assert.
12435 * src/tables.c (tables_generate): Likewise.
12436
12437 * src/struniq.c (struniq_assert): Now returns void, and aborts
12438 if the assertion is false.
12439 (struniq_assert_p): Remove.
12440 * src/struniq.h: Likewise.
12441
76ae8198
PE
124422002-11-18 Paul Eggert <eggert@twinsun.com>
12443
12444 * data/glr.c (yygetLRActions): Replace `yyindex' with
12445 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12446 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 12447 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 12448
d3c4e709
AD
124492002-11-18 Akim Demaille <akim@epita.fr>
12450
12451 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12452 space.
12453 From Tim Van Holder.
12454
8d8a7238
PE
124552002-11-17 Paul Eggert <eggert@twinsun.com>
12456
12457 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12458 to "SyntaxError" for consistency with my 2002-11-15 change.
12459
12460 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12461 not define to {}, since this breaks the common use of `YYDPRINTF
12462 ((...));' if a single statement is desired (e.g. before `else').
12463 Work around GCC warnings by surrounding corresponding calls with
12464 {} if needed.
12465 (yyhasResolvedValue): Remove unused function.
12466 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12467 loop body.
12468 (yyreportSyntaxError): Renamed from yyreportParseError.
12469 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12470 All uses changed.
12471 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12472 extern when possible. Remove unused initializations.
12473
b0937b22
AD
124742002-11-16 Akim Demaille <akim@epita.fr>
12475
12476 Augment the similarity between GLR and LALR traces.
12477
12478 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12479 (YY_REDUCE_PRINT): New.
12480 (yyparse): Use them.
12481 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12482 YYDPRINT here.
12483 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12484 state reached after the reduction/recovery, since...
12485 (yyparse, yyprocessOneStack): Report the state we are entering in.
12486
c5e3e510
AD
124872002-11-16 Akim Demaille <akim@epita.fr>
12488
12489 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12490 Add support for --trace=skeleton.
12491 * src/scan-skel.l: %option debug.
12492 Scan strings of non-@ or \n instead of character by character.
12493 (scan_skel): Handle trace_skeleton.
12494 (QPUTS): New.
12495 (@output_parser_name@, @output_header_name@): ``Restore'' their
12496 support (used to be M4 macros).
12497 * data/yacc.c: Quote larger chunks, a la glr.c.
12498 * data/lalr1.cc: Likewise.
12499 The header guards are no longer available, so use some other
12500 string than `YYLSP_NEEDED'.
12501
4c6cc1db
AD
125022002-11-16 Akim Demaille <akim@epita.fr>
12503
12504 Make the ``Printers and Destructors'' test more verbose, taking
12505 `yacc.c''s behavior as (possibly wrong) reference.
12506
12507 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12508 instead of fprint on stdout.
12509 Set and report the last_line of the symbols.
12510 Consistently display values and locations.
12511
6d9e8019
PE
125122002-11-16 Paul Eggert <eggert@twinsun.com>
12513
12514 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12515
6e649e65
PE
125162002-11-15 Paul Eggert <eggert@twinsun.com>
12517
b25d88f6
PE
12518 * tests/actions.at (Actions after errors): New test case.
12519
6e649e65
PE
12520 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12521 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12522 tests/action.at, tests/calc.at, tests/conflicts.at,
12523 tests/cxx-type.at, tests/regression.at:
12524 "parse error" -> "syntax error" for POSIX compatibility.
12525 "parsing stack overflow..." -> "parser stack overflow" so
12526 that code matches Bison documentation.
12527
0f39aab9
AD
125282002-11-15 Akim Demaille <akim@epita.fr>
12529
12530 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12531 take two BRACED_CODE, not two string_content.
12532 Free the scanner's obstack when we are done.
12533 (code_content): New.
12534 * tests/calc.at: Adjust.
12535 * doc/bison.texinfo: Adjust.
12536 Also, make sure to include the `,' for these declarations.
12537
761c1926
AD
125382002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12539
12540 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12541 definition; avoids potential autoreconf problems.
12542
b0f98b10
AD
125432002-11-15 Akim Demaille <akim@epita.fr>
12544
12545 Always check the value returned by yyparse.
12546
12547 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12548 returned by yyparse.
12549 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12550 Adjust calls.
12551 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12552 returned by yyparse.
12553
970785f1
PH
125542002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12555
12556 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12557 on input.at test.
12558
8fcc7db1
PE
125592002-11-14 Paul Eggert <eggert@twinsun.com>
12560
7ec1b48e
PE
12561 * src/output.c (output_skeleton): Call xfopen instead of
12562 duplicating xfopen's body.
12563
cfff7583 12564 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 12565 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 12566
8fcc7db1
PE
12567 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12568 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12569 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12570 file twice in the grammar, as an extra check.
12571
12572 * tests/input.at (Torturing the Scanner): Surround the
12573 backslash-newline tests with "#if 0", to make it less likely that
12574 we'll run into compiler bugs. Bring back solitary \ inside
12575 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 12576 test backslash-newline in C character constant.
8fcc7db1 12577
4e8d992c
AD
125782002-11-14 Akim Demaille <akim@epita.fr>
12579
12580 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12581 status of the compiler.
f32b346d 12582 Calling `exit 1' is no longer needed.
4e8d992c
AD
12583 Reported by Nelson H. F. Beebe.
12584
9501dc6e
AD
125852002-11-14 Akim Demaille <akim@epita.fr>
12586
12587 * tests/atlocal.in (CPPFLAGS): We have config.h.
12588 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12589 New.
12590 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12591 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12592 * tests/regression.at, tests/torture.at: Use them for all the
12593 grammars that are to be compiled.
12594 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12595 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12596 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12597
18b519c0
AD
125982002-11-14 Akim Demaille <akim@epita.fr>
12599
12600 * doc/bison.texinfo: Various formatting changes (alignments in
12601 samples, additional @group/@end group, GCS in samples.
12602 Use @deffn instead of simple @table to define the directives,
12603 macros, variables etc.
12604
9a86cdb9
PE
126052002-11-13 Paul Eggert <eggert@twinsun.com>
12606
daa33def 12607 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 12608 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 12609
daa33def 12610 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 12611 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
12612 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12613 * tests/headers.at (export YYLTYPE): Likewise.
12614
12615 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 12616 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 12617
9a86cdb9
PE
12618 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12619 comments, since they're not portable. Use GNU coding style.
12620
9c1e26bd
AD
126212002-11-13 Akim Demaille <akim@epita.fr>
12622
12623 * data/yacc.c: Leave bigger chunks of quoted text.
12624 (YYDSYMPRINTF): New.
12625 Use it to report symbol activities.
12626 * data/glr.c (YYDSYMPRINTF): New.
12627 Use it.
12628
87f721cc
PE
126292002-11-12 Paul Eggert <eggert@twinsun.com>
12630
12631 Version 1.75b.
12632
12633 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12634 (yyglrReduce): Return yyok, not 0.
12635 This should avoid the enumerated-type warnings reported
464c6927 12636 by Nelson H. F. Beebe in
161a71f3 12637 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
12638
12639 * lib/bbitset.h (BITSET_INLINE): Remove.
12640 * lib/bitset.h [! BITSET_INLINE]: Remove.
12641 (bitset_set, bitset_reset, bitset_test): Rename local vars
12642 to avoid shadowing warnings by GCC.
12643
12644 * data/glr.c (inline): Remove #define. It's the user's
12645 responsibility to #define it away, just like 'const'.
464c6927 12646 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 12647 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 12648
87f721cc
PE
12649 * Makefile.maint (po-check): Scan .l and .y files instead of the
12650 .c and the .h files that they generate. This fixes the bug
12651 reported by Tim Van Holder in:
161a71f3 12652 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
12653 Look for N_ as well as for _. Try to avoid matching #define for
12654 N_ and _.
12655 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12656 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12657 * src/scan-gram.l: Revamp regular expressions so that " and '
12658 do not confuse xgettext.
12659
12660 * src/struniq.h (struniq_new): Do not declare the return type
12661 to be 'const'; this violates the C standard.
12662 * src/struniq.c (struniq_new): Likewise.
12663
be14ade5
AD
126642002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12665
12666 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12667 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12668 linker.
12669
05291fbc
AD
126702002-11-12 Akim Demaille <akim@epita.fr>
12671
12672 * Makefile.maint: Sync with Autoconf:
12673 (local_updates): New.
12674
1f5fd52e
AD
126752002-11-12 Akim Demaille <akim@epita.fr>
12676
12677 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12678
283f1e64
AD
126792002-11-12 Akim Demaille <akim@epita.fr>
12680
12681 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12682 locations.
12683
886b69d1
AD
126842002-11-12 Akim Demaille <akim@epita.fr>
12685
12686 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12687 not yyvalue.
12688
3df37415
AD
126892002-11-12 Akim Demaille <akim@epita.fr>
12690
12691 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12692 Use it to test the GLR parser.
12693
7bd6c77e
AD
126942002-11-12 Akim Demaille <akim@epita.fr>
12695
12696 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12697 defines it.
12698 * data/glr.c (yystos): New.
12699 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12700 (YYDSYMPRINT): New.
12701 (yyval): Don't define it, it is handled via M4.
12702 (yyrecoverParseError): Free verbosely the discarded symbols.
12703 * data/yacc.c (yysymprint): Remove, rather...
12704 (b4_yysymprint_generate): invoke.
12705 * data/c.m4 (b4_yysymprint_generate): New.
12706 Accept pointers as arguments, as opposed to the version from
12707 yacc.c.
12708 (b4_yydestruct_generate): Likewise.
12709 * tests/cations.at (Printers and Destructors): Use Bison directives
12710 instead of CPP macros.
12711 Don't rely on internal details.
12712
b0400cc6
AD
127132002-11-12 Akim Demaille <akim@epita.fr>
12714
12715 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12716 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12717 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12718 it against YYEMPTY and so forth), work on yytoken (i.e., set
12719 it to YYEMPTY etc.).
12720 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12721 (b4_symbol_actions): Remove.
12722 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12723 for 0, end-of-input.
12724
72f889cc
AD
127252002-11-12 Akim Demaille <akim@epita.fr>
12726
12727 * doc/bison.texinfo (Destructor Decl): New.
12728
b1ae9233
AD
127292002-11-12 Akim Demaille <akim@epita.fr>
12730
12731 * src/tables.c (tables_generate): Use free for pointers that
12732 cannot be NULL, not XFREE.
12733 (pack_vector): Use assert, not fatal, for bound violations.
12734 * src/state.c (state_new): Likewise.
12735 * src/reader.c (reader): Likewise.
12736 * src/lalr.c (set_goto_map): Likewise.
72f889cc 12737 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
12738 the file name.
12739
7ec2d4cd
AD
127402002-11-12 Akim Demaille <akim@epita.fr>
12741
12742 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12743 Restore.
12744 * src/scan-gram.l (last_string): Is global to the file, not to
12745 yylex.
12746 * src/parse-gram.y (input): Don't append the epilogue here,
12747 (epilogue.opt): do it here, and free the scanner's obstack.
12748 * src/reader.c (epilogue_set): Rename as...
12749 (epilogue_augment): this.
12750 * data/c.m4 (b4_epilogue): Defaults to empty.
12751
573a6cd3
AD
127522002-11-12 Akim Demaille <akim@epita.fr>
12753
12754 * src/getargs.c (long_options): Remove duplicates.
12755 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12756 Remove.
12757 * doc/bison.rnh: Remove.
12758 * doc/bison.texinfo (VMS Invocation): Remove.
12759
95612cfa
AD
127602002-11-12 Akim Demaille <akim@epita.fr>
12761
12762 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12763 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12764
12765 Use struniq for symbols.
12766
12767 * src/symtab.h (symbol_t): The tag member is a struniq.
12768 (symbol_type_set): Adjust.
12769 * src/symtab.c (symbol_new): Takes a struniq.
12770 (symbol_free): Don't free the tag member.
12771 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12772 (hash_compare_symbol, hash_symbol): these.
12773 Use the fact that tags as struniqs.
12774 (symbol_get): Use struniq_new.
12775 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12776 Returns a strniq.
12777 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12778 and type members are struniqs.
12779 * src/reader.c (get_merge_function)
12780 (grammar_current_rule_merge_set): Adjust.
12781 (TYPE, current_type): Are struniq.
12782
12783 Use struniq for file names.
12784
12785 * src/files.h, src/files.c (infile): Split into...
12786 (grammar_file, current_file): these.
12787 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12788 * src/reduce.c (reduce_print): Likewise.
12789 * src/getargs.c (getargs): Likewise.
12790 * src/complain.h, src/complain.c: Likewise.
12791 * src/main.c (main): Call struniqs_new early enough to use it for
12792 file names.
12793 Don't free the input file name.
12794
3e6656f9
AD
127952002-11-12 Akim Demaille <akim@epita.fr>
12796
12797 * src/symtab.c (symbol_free): Remove dead deactivated code:
12798 type_name are properly removed.
12799 Don't use XFREE to free items that cannot be NULL.
12800 * src/struniq.h, src/struniq.c: New.
12801 * src/main.c (main): Initialize/free struniqs.
12802 * src/parse-gram.y (%union): Add astruniq member.
12803 (yyprint): Adjust.
12804 * src/scan-gram.l (<{tag}>): Return a struniq.
12805 Free the obstack bit that used to store it.
12806 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12807
7672019c
PE
128082002-11-11 Paul Eggert <eggert@twinsun.com>
12809
12810 Revamp to fix many (but not all) of the C- and M4-related quoting
12811 problems. Among other things, this fixes the Bison bug reported
12812 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 12813 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
12814
12815 Use new @ escapes consistently. Represent brackets with @{ and @}
12816 rather than @<:@ and @:>@, since this works a bit better with dumb
12817 editors like vi. Represent @ with @@, since @ is now consistently
12818 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12819 __ofile__, to avoid unexpected expansions. Similarly, use @output
12820 rather than #output.
12821
12822 * data/c.m4 (b4_copyright): Omit file name from comment, since
12823 the file name could contain "*/".
12824 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12825 be quoted. All uses changed.
12826
12827 * data/glr.c: Use new @ escapes consistently.
12828 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12829 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12830 Remove, since they couldn't handle arbitrary characters in file
12831 names.
12832 * data/lalr1.cc: Likewise.
12833 * data/yacc.c: Likewise.
12834
12835 * src/files.c (output_infix): Remove; all uses removed.
12836 * src/files.h: Likewise.
12837
12838 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12839 mishandled funny characters in file names, and anyway it isn't
12840 needed any more.
12841 * data/yacc.c: Likewise.
12842 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12843
12844 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12845 * data/yacc.c: Likewise.
12846
12847 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12848 strings now.
12849 (muscle_init): Quote filename as a C string.
12850 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12851 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12852 * src/output.c (escaped_file_name_output): New function.
12853 (prepare_symbols): Quote tokens for M4.
12854 (prepare): Don't insert output_infix, output_prefix,
12855 output_parser_name, output_header_name; this is now down by scan-skel.
12856 Insert skeleton as a C string.
12857
12858 * src/output.c (user_actions_output, symbol_destructors_output,
12859 symbol_printers_output): Quote filenames for C and M4.
12860 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12861
12862 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12863 escapes other than \\ and \'; this simplifies the code.
12864 (<SC_STRING>): Likewise, for \\ and \".
12865 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12866 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12867 Use new escapes @{ and @} for [ and ].
12868
12869 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12870 them with auto vars.
12871 Switch to new escape scheme, where @ is the escape character uniformly.
12872 Abort if a stray escape character is found. Avoid unbounded input
12873 buffer when parsing non-escaped text.
12874
12875 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12876 __oline__, #output, $@, and @{ do not have unintended meanings.
12877
acea4f3b
PE
128782002-11-09 Paul Eggert <eggert@twinsun.com>
12879
12880 Fix the test failure due to GCC warnings described in
161a71f3 12881 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
12882 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12883 evaluate to 0 if it's impossible for NINF to be in the respective
12884 table.
12885 (yygetLRActions, yyrecoverParseError): Use them.
12886
12887 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12888 counted in the token inserted at end of file. Now takes
12889 location_t *, not location_t, so that the location can be
12890 adjusted. All uses changed.
12891
12892 * tests/regression.at (Invalid inputs): Adjust wording in
12893 diagnostic to match the new behavior.
12894
12895 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12896 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12897 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12898 abort ();'. This reduces the runtime of the "Many lookaheads"
12899 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12900 GCC 3.2.
12901
20ef1ad5
PE
129022002-11-07 Paul Eggert <eggert@twinsun.com>
12903
12904 * src/parse-gram.y (CHARACTER): Remove unused token.
12905 All uses removed.
12906
12907 * src/scan-gram.l: Remove stack option. We no longer use the
12908 stack, since the stack was never deeper than 1; instead, use the
12909 new auto var c_context to record the stacked value.
12910
12911 Remove nounput option. At an unexpected end of file, we now unput
12912 the minimal input necessary to end cleanly; this simplifies the
12913 code.
12914
12915 Avoid unbounded token sizes where this is easy.
12916
12917 (unexpected_end_of_file): New function.
12918 Use it to systematize the error message on unexpected EOF.
12919 (last-string): Now auto, not static.
12920 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12921 (scanner_last_string_free): Remove; not used.
12922 (percent_percent_count): Move decl to just before use.
12923 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12924 not the (never otherwised-used) CHARACTER.
12925
93724f13
AD
129262002-11-07 Akim Demaille <akim@epita.fr>
12927
12928 Let yyerror always receive the msg as last argument, so that
12929 yyerror can be variadic.
12930
12931 * data/yacc.c (b4_yyerror_args): New.
12932 Use it when calling yyerror.
12933 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12934 Use it when calling yyerror.
12935 * doc/bison.texinfo (Error Reporting): Adjust.
12936 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12937 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12938
6e40b4eb
AD
129392002-11-06 Akim Demaille <akim@epita.fr>
12940
12941 #line should have quoted strings.
12942 Ideally, this should be done by m4_quotearg.
12943
12944 * src/scan-skel.l: Include quotearg.h.
12945 Quote __ofile__.
12946 * src/output.c (symbol_printers_output)
12947 (symbol_destructors_output): Quote the file name.
12948
2dfbfc12
AD
129492002-11-06 Akim Demaille <akim@epita.fr>
12950
12951 * tests/regression.at (Invalid inputs): Adjust to the recent
12952 messages.
12953
437c2d80
AD
129542002-11-06 Akim Demaille <akim@epita.fr>
12955
12956 Restore --no-lines.
12957 Reported by Jim Kent.
12958
12959 * data/c.m4 (b4_syncline): New.
12960 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12961 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12962 * src/output.c (user_actions_output): Likewise.
12963 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 12964 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 12965
900c5db5
AD
129662002-11-06 Akim Demaille <akim@epita.fr>
12967
12968 * src/main.c (main): Free `infile'.
12969 * src/scan-gram.l (handle_syncline): New.
12970 Recognize `#line'.
12971 * src/output.c (user_actions_output, symbol_destructors_output)
12972 (symbol_printers_output): Use the location's file name, not
12973 infile.
12974 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12975
e183b123 129762002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 12977
e183b123 12978 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 12979 either has GLR conflict entries.
e183b123 12980
193eb6b7
PE
129812002-11-05 Paul Eggert <eggert@twinsun.com>
12982
e183b123
PE
12983 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12984 "integer out of range" rather than "invalid value".
12985 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12986 accordingly.
12987
193eb6b7
PE
12988 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12989 Also, remove one static variable in the scanner.
12990
12991 * src/scan-gram.l (braces_level): Now auto, not static.
12992 Initialize to zero if the compiler is being picky.
12993 (INITIAL): Clear braces_level instead of incrementing it.
12994 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12995 as POSIX 1003.1-2001 requires.
12996 * src/system.h (IF_LINT): New macro, taken from coreutils.
12997 * configure.ac: Define "lint" if --enable-gcc-warnings.
12998
29c01725
AD
129992002-11-05 Akim Demaille <akim@epita.fr>
13000
13001 * src/scan-gram.l: When it starts with `%', complain about the
13002 whole directive, not just that `invalid character: %'.
13003
8aeac3ca
AD
130042002-11-04 Akim Demaille <akim@epita.fr>
13005
13006 * Makefile.maint: Update from Autoconf.
13007 (update, cvs-update, po-update, do-po-update): New.
13008
793a58bb
AD
130092002-11-04 Akim Demaille <akim@epita.fr>
13010
13011 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13012 and yyerror.
13013 Have yyerror `use' its arguments.
13014 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13015 returns true when location & yacc & pure & parse-param.
13016 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13017
c4d720cd
AD
130182002-11-04 Akim Demaille <akim@epita.fr>
13019
13020 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13021 clashes.
13022 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13023 font-lock-mode.
13024 Use complain_at.
13025 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13026 slot 0.
13027
613a0dc5
PE
130282002-11-03 Paul Eggert <eggert@twinsun.com>
13029
13030 * src/reader.c (get_merge_function, grammar_current_rule_check):
13031 Use consistent diagnostics for reporting type name clashes.
13032 Quote the types with <>, for consistency with Yacc.
13033 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13034
2a8d363a
AD
130352002-11-03 Akim Demaille <akim@epita.fr>
13036
13037 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13038 New.
13039 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13040 (b4_parse_param): Remove.
13041 Use b4_identification.
13042 Propagate b4_pure_args where needed to pass them to yyerror.
13043 * data/glr.m4 (b4_parse_param): Remove.
13044 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13045 (b4_lpure_formals): New.
13046 Use b4_identification.
13047 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13048 b4_user_formals and b4_user_args.
13049 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13050 (yyreportAmbiguity): When using a pure parser, also need
13051 the location, and the parse-params.
13052 Adjust callers.
13053 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13054 When using a pure parser, also need the parse-params.
13055 Adjust callers.
13056 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13057 (%pure-parser + %parse-param) LALR and GLR parsers.
13058 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13059 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13060 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13061 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13062 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13063 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13064 * doc/bison.texinfo: Untabify the whole file.
13065 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13066 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13067 (Error Reporting): Adjust to these new directives.
13068 Document %error-verbose, deprecate YYERROR_VERBOSE.
13069
9e32add8
AD
130702002-11-03 Akim Demaille <akim@epita.fr>
13071
13072 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13073 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13074 command line options.
13075 * tests/cxx-type.at: Formatting changes.
13076
b02d90a5
PE
130772002-11-03 Paul Eggert <eggert@twinsun.com>
13078
13079 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13080 to count columns correctly, and to check for invalid inputs.
9e32add8 13081
b02d90a5
PE
13082 Use mbsnwidth to count columns correctly. Account for tabs, too.
13083 Include mbswidth.h.
13084 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13085 (extend_location): New function.
13086 (YY_LINES): Remove.
13087
13088 Handle CRLF in C code rather than in Lex code.
13089 (YY_INPUT): New macro.
13090 (no_cr_read): New function.
13091
13092 Scan UCNs, even though we don't fully handle them yet.
13093 (convert_ucn_to_byte): New function.
13094
13095 Handle backslash-newline correctly in C code.
13096 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13097 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13098 all uses changed.
13099 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13100 Use {splice} wherever C allows backslash-newline.
13101 YY_STEP after space, newline, vertical-tab.
13102 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 13103
b02d90a5
PE
13104 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13105
13106 ({int}, handle_action_dollar, handle_action_at): Check for integer
13107 overflow.
9e32add8 13108
b02d90a5
PE
13109 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13110
13111 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13112 as well as \000. Check for UCHAR_MAX, not 255.
13113 Allow \x with an arbitrary positive number of digits, as in C.
13114 Check for overflow here.
13115 Allow \? and UCNs, for compatibility with C.
13116
13117 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13118 with quote slot used by complain_at.
13119
13120 * tests/input.at: Add tests for backslash-newline, m4 quotes
13121 in symbols, long literals, and funny escapes in strings.
13122
13123 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13124 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13125 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13126 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13127 * m4/mbswidth.m4: New file, from GNU coreutils.
13128
13129 * doc/bison.texinfo (Grammar Outline): Document // comments.
13130 (Symbols): Document that trigraphs have no special meaning in Bison,
13131 nor is backslash-newline allowed.
13132 (Actions): Document that trigraphs have no special meaning.
13133
13134 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13135 no longer used.
13136
131372002-11-02 Paul Eggert <eggert@twinsun.com>
13138
13139 * src/reader.c: Don't include quote.h; not needed.
13140 (get_merge_function): Reword warning to be consistent with
13141 type clash diagnostic in grammar_current_rule_check.
13142
13143 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13144 bug in trigraph handling.
13145
13146 * src/output.c (prepare_symbols): When printing token names,
13147 escape "[" as "@<:@" and likewise for "]".
13148
13149 * src/system.h (errno): Remove declaration, as we are now
13150 assuming C89 or better, and C89 guarantees errno.
13151
762b212b
PE
131522002-10-30 Paul Eggert <eggert@twinsun.com>
13153
13154 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13155 Check for close failures.
13156 * src/files.h (xfclose): Return void, not int, since it always
13157 returned zero.
13158 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13159 indicates one.
13160 * src/output.c (output_skeleton): Use xfclose rather than fclose
13161 and ferror. xfclose now checks ferror.
13162
13163 * data/glr.c (YYLEFTMOST_STATE): Remove.
13164 (yyreportTree): Use a stack-based leftmost state. This avoids
13165 our continuing battles with bogus warnings about initializers.
13166
56100c60
AD
131672002-10-30 Akim Demaille <akim@epita.fr>
13168
13169 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13170 #if.
13171
51b4a04c
PH
131722002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13173
13174 * tests/glr-regr1.at: New test for reported regressions.
13175 * tests/testsuite.at: Add glr-regr1.at test.
13176 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 13177
bf1ebda2
PE
131782002-10-24 Paul Eggert <eggert@twinsun.com>
13179
5c16c6b1
PE
13180 Version 1.75a.
13181
bf1ebda2
PE
13182 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13183 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13184 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13185 Don't assume strdup exists; POSIX says its an XSI extension.
13186 Check for buffer overflow on input.
13187
b526ee61
AD
131882002-10-24 Akim Demaille <akim@epita.fr>
13189
13190 * src/output.c (output_skeleton): Don't disable M4sugar comments
13191 too soon: it results in comments being expanded.
13192 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13193 first output.
13194
f1886bb2
AD
131952002-10-24 Akim Demaille <akim@epita.fr>
13196
13197 * data/yacc.c (m4_int_type): New.
13198 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13199 char' as only yacc.c wants K&R portability.
13200 * data/glr.c (yysigned_char): Remove.
13201 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13202 Reported by Quoc Peyrot.
13203
c5576256
PE
132042002-10-23 Paul Eggert <eggert@twinsun.com>
13205
13206 * src/main.c (main): With --trace=time, report times even if a
13207 non-fatal error occurs. Formerly, the times were reported in some
13208 such cases but not in others.
13209 * src/reader.c (reader): Just return if a complaint has been issued,
13210 instead of exiting, so that 'main' can report times.
13211
27b0ffea
AD
132122002-10-22 Akim Demaille <akim@epita.fr>
13213
13214 * src/system.h: Include sys/types.
13215 Reported by Bert Deknuydt.
13216
223a7883
PE
132172002-10-23 Paul Eggert <eggert@twinsun.com>
13218
13219 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13220 Suggested by Art Haas.
13221
132222002-10-22 Paul Eggert <eggert@twinsun.com>
13223
13224 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13225 decl; not needed any more.
13226 * src/main.c (main): Use return to exit, undoing yesterday's change.
13227 The last OS that we could find where this wouldn't work is
13228 SunOS 3.5, and that's too old to worry about now.
13229
13230 * data/glr.c (struct yyltype): Define members even when not
13231 doing locations. This is more consistent with yacc.c, and it
13232 works around the following bug reports:
161a71f3
PE
13233 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13234 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 13235
223a7883
PE
13236 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13237 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13238 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13239
8b76775a
AD
132402002-10-22 Akim Demaille <akim@epita.fr>
13241
13242 * data/README: New.
13243
6db10d14
PE
132442002-10-21 Paul Eggert <eggert@twinsun.com>
13245
13246 Be consistent about 'bool'; the old code used an enum in one
13247 module and an int in another, and this violates the C standard.
13248 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13249 * configure.ac (AC_HEADER_STDBOOL): Add.
13250 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13251 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13252 * src/symtab.c (hash_compare_symbol_t): Likewise.
13253 * src/system.h (bool, false, true): Use a definition consistent
13254 with ../lib/hash.c. All uses changed.
13255
13256 * src/complain.c (warning_issued): Renamed from warn_message_count,
13257 so that we needn't worry about integer overflow (!).
13258 Now of type bool. All uses changed.
13259 (complaint_issued): Renamed from complain_message_count; likewise.
13260
13261 * src/main.c (main): Use exit to exit with failure.
27b0ffea 13262
6db10d14
PE
13263 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13264 rather than 1 and 0.
13265 * src/main.c (main): Likewise.
13266 * src/getargs.c (getargs): Likewise.
13267 * src/reader.c (reader): Likewise.
13268
13269 * src/getarg.c (getargs): Remove duplicate code for
13270 "Try `bison --help'".
13271
13272 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13273 What was that "2" for?
13274
13275 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13276 * src/getargs.c (usage): Likewise.
13277
13278 * src/getargs.c (getargs): When there are too few operands, report
13279 the last one. When there are too many, report the first extra
13280 one. This is how diffutils does it.
13281
92a060fd
PE
132822002-10-20 Paul Eggert <eggert@twinsun.com>
13283
13284 Remove K&R vestiges.
13285 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13286 * src/complain.c (VA_START): Remove. Assume prototypes.
13287 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13288 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13289 fatal): Assume prototypes.
13290 * src/complain.h: Assume prototypes.
13291 * src/system.h (PARAMS): Remove.
13292 Include <limits.h> unconditionally, since it's guaranteeed even
13293 for a freestanding C89 compiler.
13294 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13295 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 13296
e7cb57c0
AD
132972002-10-20 Akim Demaille <akim@epita.fr>
13298
13299 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13300 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13301 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13302 (yyresolveStates, yyresolveAction, yyresolveStack)
13303 (yyprocessOneStack): Use them.
13304 (yy_reduce_print): New.
13305 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13306
0245f82d
AD
133072002-10-20 Akim Demaille <akim@epita.fr>
13308
13309 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13310 arguments and output `void'.
13311 (b4_c_function): Rename as...
13312 (b4_c_function_def): this.
13313 (b4_c_function_decl, b4_c_ansi_function_def)
13314 (b4_c_ansi_function_decl): New.
13315 Change the interpretation of the arguments: before `int, foo', now
13316 `int foo, foo'.
13317 * data/yacc.c (yyparse): Prototype and define thanks to these.
13318 Adjust b4_c_function_def uses.
13319 * data/glr.c (yyparse): Likewise, but ANSI only.
13320
39912f52
AD
133212002-10-20 Akim Demaille <akim@epita.fr>
13322
13323 * src/output.c (prepare): Move the definition of `tokens_number',
13324 `nterms_number', `undef_token_number', `user_token_number_max'
13325 to...
13326 (prepare_tokens): Here.
13327 (prepare_tokens): Rename as...
13328 (prepare_symbols): this.
13329 (prepare): Move the definition of `rules_number' to...
13330 (prepare_rules): here.
13331 (prepare): Move the definition of `last', `final_state_number',
13332 `states_number' to...
13333 (prepare_states): here.
13334 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13335
20c1e2ad
AD
133362002-10-20 Akim Demaille <akim@epita.fr>
13337
13338 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13339
21964f43
AD
133402002-10-20 Akim Demaille <akim@epita.fr>
13341
13342 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13343 * data/c.m4: here.
13344
66d30cd4
AD
133452002-10-20 Akim Demaille <akim@epita.fr>
13346
13347 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13348 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13349 `pair'.
13350 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13351 `name' to...
13352 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13353 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13354 These.
13355
95f2c9fe
PE
133562002-10-19 Paul Eggert <eggert@twinsun.com>
13357
13358 Do not create a temporary file, as that involves security and
13359 cleanup headaches. Instead, use a pair of pipes.
13360 Derived from a suggestion by Florian Krohm.
13361 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13362 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13363 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13364 (BISON_PREREQ_SUBPIPE): Add.
13365 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13366 Add subpipe.h, subpipe.c.
13367 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13368 * po/POTFILES.in: Add lib/subpipe.c.
13369 * src/output.c: Include "subpipe.h".
13370 (m4_invoke): Remove decl.
13371 (scan_skel): New decl.
13372 (output_skeleton): Use pipe rather than temporary file for m4 input.
13373 Check that m4sugar.m4 is readable, to avoid deadlock.
13374 Check for pipe I/O error.
13375 * src/scan-skel.l (readpipe): Remove decl.
13376 (scan_skel): New function, to be used in place of m4_invoke.
13377 Read from stream rather than file.
66d30cd4 13378
95f2c9fe
PE
13379 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13380 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13381 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13382 this generates a more-accurate value anyway.
13383
13384 * lib/timevar.c (timervar_accumulate): Rename locals to
13385 avoid confusion with similarly-named more-global.
13386 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13387
13388 * src/output.c (prepare): Use xstrdup to convert char const *
13389 to char *, to avoid GCC warning.
13390
c19988b7
AD
133912002-10-19 Akim Demaille <akim@epita.fr>
13392
13393 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13394 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13395 Use them to have `calc.y' ready for %pure-parser.
13396 * data/yacc.c (YYLEX): Pass a yylex return type to
13397 b4_c_function_call.
13398
ae7453f2
AD
133992002-10-19 Akim Demaille <akim@epita.fr>
13400
13401 Prototype support of %lex-param and %parse-param.
13402
13403 * src/parse-gram.y: Add the definition of the %lex-param and
13404 %parse-param tokens, plus their rules.
13405 Drop the `_' version of %glr-parser.
13406 Add the "," token.
13407 * src/scan-gram.l (INITIAL): Scan them.
13408 * src/muscle_tab.c: Comment changes.
13409 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13410 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13411 (muscle_entry_s): The `value' member is no longer const.
13412 Adjust all dependencies.
13413 * src/muscle_tab.c (muscle_init): Adjust: use
13414 MUSCLE_INSERT_STRING.
13415 Initialize the obstack earlier.
13416 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13417 (muscle_pair_list_grow): New.
13418 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13419 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13420 * tests/calc.at: Use %locations, not --locations.
13421 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13422
0e575721
AD
134232002-10-19 Akim Demaille <akim@epita.fr>
13424
13425 * src/getargs.c (usage): Take status as argument and exit
13426 accordingly.
13427 Report the traditional `Try ... --help' message when status != 0.
13428 (usage, version): Don't take a FILE * as arg, it is pointless.
13429 (getargs): When there is an incorrect number of arguments, make it
13430 an error, and report it GNUlically thanks to `usage ()'.
13431
724ce7f5
PE
134322002-10-18 Paul Eggert <eggert@twinsun.com>
13433
3a781eb2
PE
13434 * data/glr.c (yyreportParseError): Don't assume that sprintf
13435 yields the length of the printed string, as this is not true
13436 on SunOS 4.1.4. Reported by Peter Klein.
13437
724ce7f5
PE
13438 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13439 * tests/conflicts.at (%nonassoc and eof): Likewise.
13440 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13441
473d0a75
AD
134422002-10-17 Akim Demaille <akim@epita.fr>
13443
13444 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13445 * src/getargs.c (trace_types, trace_args): Adjust.
13446 * src/reader.c (grammar_current_rule_prec_set)
13447 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13448 Standardize error messages.
13449 And s/@prec/%prec/!
13450 (reader): Use trace_flag to enable scanner/parser debugging,
13451 instead of an adhoc scheme.
13452 * src/scan-gram.l: Remove trailing debugging code.
13453
e76d2469
PE
134542002-10-16 Paul Eggert <eggert@twinsun.com>
13455
93e2236a
PE
13456 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13457 MUSCLE_TAB_H.
13458
e76d2469
PE
13459 * NEWS: Officially drop support for building Bison with K&R C,
13460 since it didn't work anyway and it's not worth worrying about.
13461 * Makefile.maint (wget_files): Remove ansi2knr.c.
13462 (ansi2knr.c-url_prefix): Remove.
13463 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13464 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13465 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13466
5bd1c419
PE
134672002-10-15 Paul Eggert <eggert@twinsun.com>
13468
13469 Stop using the "enum_" trick for K&R-style function definitions;
13470 it confused me, and I was the author! Instead, assume that people
13471 who want to use K&R C compilers (when using these modules in GCC,
13472 perhaps?) will run ansi2knr.
13473
13474 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13475 All uses of "enum_" changed to "enum ".
13476 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13477 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 13478
5bd1c419
PE
13479 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13480 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13481 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13482 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13483 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13484 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13485 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13486 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13487 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13488 Use function prototypes; this removes the need for declaring
13489 static functions simply to provide their prototypes.
13490 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13491 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13492 bitset_count_, bitset_create, bitset_dump, bitset_first,
13493 bitset_free, bitset_init, bitset_last, bitset_next,
13494 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13495 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13496 bitset_print, bitset_release_memory, bitset_toggle_,
13497 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13498 debug_bitset): Likewise.
13499 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13500 * lib/bitset_stats.c (bitset_log_histogram_print,
13501 bitset_percent_histogram_print, bitset_stats_and,
13502 bitset_stats_and_cmp, bitset_stats_and_or,
13503 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13504 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13505 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13506 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13507 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13508 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13509 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13510 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13511 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13512 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13513 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13514 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13515 bitset_stats_zero): Likewise.
13516 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13517 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13518 bitsetv_dump, debug_bitsetv): Likewise.
13519 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13520 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13521 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13522 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13523 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13524 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13525 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13526 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13527 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13528 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13529 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13530 Likewise.
13531 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13532 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13533 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13534 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13535 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13536 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13537 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13538 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13539 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13540 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13541 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 13542
ae26e1f0
AD
135432002-10-14 Akim Demaille <akim@epita.fr>
13544
13545 Version 1.75.
13546
d43baf71
AD
135472002-10-14 Akim Demaille <akim@epita.fr>
13548
13549 * tests/Makefile.am (maintainer-check-posix): New.
13550
7ebc83e3
AD
135512002-10-14 Akim Demaille <akim@epita.fr>
13552
13553 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13554 member.
13555
05846dae
AD
135562002-10-14 Akim Demaille <akim@epita.fr>
13557
13558 * src/tables.c (table_ninf_remap): base -> tab.
13559 Reported by Matt Rosing.
13560
1318e37d
PE
135612002-10-14 Paul Eggert <eggert@twinsun.com>
13562
447fbb17
PE
13563 * tests/action.at, tests/calc.at, tests/conflicts.at,
13564 tests/cxx-type.at, tests/headers.at, tests/input.at,
13565 tests/regression.at, tests/synclines.at, tests/torture.at:
13566 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13567 so that the tests still work even if POSIXLY_CORRECT is set.
13568 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 13569
1318e37d
PE
13570 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13571 for portability to K&R hosts. Fix typo: signed char is guaranteed
13572 only to 127, not to 128.
13573 * data/glr.c (yysigned_char): New type.
13574 * data/yacc.c (yysigned_char): Likewise.
13575 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13576
cc0f0794
PE
135772002-10-13 Paul Eggert <eggert@twinsun.com>
13578
5038f418
PE
13579 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13580 true due to limited range of data type" warning from GCC.
13581
cc0f0794
PE
13582 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13583 by wrapping enum yytokentype's definition inside #ifndef
13584 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13585
6fed0802
AD
135862002-10-13 Akim Demaille <akim@epita.fr>
13587
13588 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13589 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13590
32f0598d
AD
135912002-10-13 Akim Demaille <akim@epita.fr>
13592
13593 * Makefile.maint: Update from Autoconf 2.54.
13594 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13595
7ea9a33f
AD
135962002-10-13 Akim Demaille <akim@epita.fr>
13597
13598 * src/print.c (print_state): Separate the list of solved conflicts
13599 from the other items.
13600 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13601
ea99527d
AD
136022002-10-13 Akim Demaille <akim@epita.fr>
13603
13604 Let nondeterministic skeletons be usable with deterministic
13605 tables.
13606
13607 With the patch, GAWK compiled by GCC without -O2 passes its test
13608 suite using a GLR parser driven by LALR tables. It fails with -O2
13609 because `struct stat' gives two different answers on my machine:
13610 88 (definition of an auto var) and later 96 (memset on this var).
13611 Hence the stack is badly corrumpted. The headers inclusion is to
13612 blame: if I move the awk.h inclusion before GLR's system header
13613 inclusion, the two struct stat have the same size.
13614
13615 * src/tables.c (pack_table): Always create conflict_table.
13616 (token_actions): Always create conflict_list.
13617 * data/glr.c (YYFLAG): Remove, unused.
13618
f377f69f
AD
136192002-10-13 Akim Demaille <akim@epita.fr>
13620
13621 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13622 (O0FLAGS): New.
13623 (VALGRIND, GXX): New.
13624 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13625 * tests/bison.in: Run $PREBISON a pre-command.
13626 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13627 (maintainer-check-g++): New.
13628 * Makefile.am (maintainer-check): New.
13629
2a1fe6ed
AD
136302002-10-13 Akim Demaille <akim@epita.fr>
13631
13632 * data/glr.c: Formatting changes.
13633 Tweak some trace messages to match yacc.c's.
13634
f50adbbd
AD
136352002-10-13 Akim Demaille <akim@epita.fr>
13636
13637 GLR parsers sometimes raise parse errors instead of performing the
13638 default reduction.
13639 Reported by Charles-Henry de Boysson.
13640
13641 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 13642 check the length of the traces when %glr.
f50adbbd
AD
13643 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13644 GLR's traces.
13645 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13646 Test GLR parsers.
13647 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13648 (yyltype): Remove the yy prefix from the member names.
13649 (yytable): Complete its comment.
13650 (yygetLRActions): Map error action number from YYTABLE from
13651 YYTABLE_NINF to 0.
13652 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13653 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13654 not satisfying as we could compare an YYACTION computed from
13655 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13656 only value for error actions.
13657 (yyreportParseError): In verbose parse error messages, don't issue
13658 `error' in the list of expected tokens.
13659 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13660 next action to perform to match glr.c's decoding.
13661 (yytable): Complete its comment.
13662
bcbad5b9
PE
136632002-10-13 Paul Eggert <eggert@twinsun.com>
13664
13665 Fix problem reported by Henrik Grubbstroem in
161a71f3 13666 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
13667 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13668 because the Bison parser reads the second action before reducing
13669 the first one.
13670 * src/scan-gram.l (rule_length): New static var.
13671 Use it to keep track of the rule length in the scanner, since
13672 we can't expect the parser to be in lock-step sync with the scanner.
13673 (handle_action_dollar, handle_action_at): Use this var.
13674 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 13675
14904b89
PE
136762002-10-12 Paul Eggert <eggert@twinsun.com>
13677
1fe611e5
PE
13678 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13679 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13680 Include <sys/time.h> when checking for clock_t and struct tms.
13681 Use same include order as source.
13682 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 13683 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 13684
1fe611e5
PE
13685 * lib/timevar.c: Update copyright date and clarify comments.
13686 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 13687
1fe611e5
PE
13688 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13689 GCC version as of today, then merge Bison's changes.
13690 Change "GCC" to "Bison" in copyright notice. timevar.def's
13691 author is Akim, so change that too.
13692
98194095
PE
13693 * src/reader.c (grammar_current_rule_check):
13694 Don't worry about the default action if $$ is untyped.
13695 Prevents bogus warnings reported by Jim Gifford in
161a71f3 13696 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 13697
14904b89
PE
13698 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13699 * data/glr.c, data/lalr1.cc, data/yacc.c:
13700 Output token definitions before the first part of user declarations.
13701 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 13702 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 13703
ff6dca18
PE
137042002-10-11 Paul Eggert <eggert@twinsun.com>
13705
13706 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13707 (yyparse): here. This undoes some of the 2002-07-25 change.
13708 Compatibility problem reported by Ralf S. Engelschall with
13709 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13710
eb714592
AD
137112002-10-11 Akim Demaille <akim@epita.fr>
13712
13713 * tests/regression.at Characters Escapes): New.
13714 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13715 characters.
13716 Reported by Jan Nieuwenhuizen.
13717
b7195100
AD
137182002-10-11 Akim Demaille <akim@epita.fr>
13719
13720 * po/id.po: New.
13721
f28a0f2d
PE
137222002-10-10 Paul Eggert <eggert@twinsun.com>
13723
13724 Portability fixes for bitsets; this also avoids several GCC
13725 warnings.
13726
13727 * lib/abitset.c: Include <stddef.h>, for offsetof.
13728 * lib/lbitset.c: Likewise.
13729
13730 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13731 properly for vectors of objects. Do not assume that adding a
13732 header size to a multiple of a word size yields a value that is
13733 properly aligned for the whole union.
13734 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13735
13736 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13737 unique names for structures.
13738 * lib/ebitset.c (ebitset_bytes): Likewise.
13739 * lib/lbitset.c (lbitset_bytes): Likewise.
13740
13741 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13742 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13743 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13744 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13745 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13746 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13747 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13748 to improve the type-checking that GCC can do.
13749 * lib/bitset.c (bitset_op4_cmp): Likewise.
13750 * lib/bitset_stats.c (bitset_stats_count,
13751 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13752 bitset_stats_copy, bitset_stats_disjoint_p,
13753 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13754 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13755 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13756 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13757 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13758 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13759 bitset_stats_or_and_cmp): Likewise.
13760 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13761 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13762 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13763 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13764
13765 * lib/abitset.h: Include bitset.h, not bbitset.h.
13766 * lib/ebitset.h: Likewise.
13767 * lib/lbitset.h: Likewise.
13768
13769 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13770 All instances of parameters of type enum bitset_opts are now of
13771 type enum_bitset_opts, to conform to the C Standard, and similarly
13772 for enum_bitset_type.
13773 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13774 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13775
13776 Do not use "struct bitset_struct" to mean different things in
13777 different modules. Not only is this confusing, it violates
13778 the C Standard, which requires that structure types in different
13779 modules must be compatible if one is to be passed to the other.
13780 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13781 All instances of "struct bitset_struct *" replaced with "bitset".
13782 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13783 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13784 struct lbitset_struct, struct bitset_stats_struct): New types.
13785 All uses of struct bitset_struct changed to union bitset_union,
13786 etc.
ba0fe3c7 13787 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
13788 struct bitset_struct): Remove.
13789 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13790 struct bitset_struct): Remove.
13791 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13792 bitset_struct): Remove.
13793 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13794 Likewise.
13795
13796 Do not call a function of type T using a call that assumes the
13797 function is of a different type U. Standard C requires that a
13798 function must be called with a type that is compatible with its
13799 definition.
13800 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13801 New decls.
13802 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13803 New functions.
13804 * lib/ebitset.c (PFV): Remove.
13805 * lib/lbitset.c (PFV): Likewise.
13806 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13807 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13808 decls.
13809 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13810 (ebitset_vtable): Use them.
13811 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13812 lbitset_xor): New functions.
13813 (lbitset_vtable): Use them.
13814
13815 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13816 Declare.
13817
13818 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13819 GCC warning.
13820 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13821 Use offsetof, for simplicity.
13822
6fbe4984
PE
138232002-10-06 Paul Eggert <eggert@twinsun.com>
13824
13825 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13826 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 13827 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
13828 which was inadvertently undone by the 2002-09-30 patch.
13829 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13830 the same width as int.
13831
420f93c8
PE
138322002-10-04 Paul Eggert <eggert@twinsun.com>
13833
13834 Version 1.50.
13835
13836 * configure.ac (AC_INIT), NEWS: Increment version number.
13837
13838 * doc/bison.texinfo: Minor spelling, grammar, and white space
13839 fixes.
13840 (Symbols): Mention that any negative value returned from yylex
13841 signifies end-of-input. Warn about negative chars. Mention
13842 the portable Standard C character set.
13843
13844 The GNU coding standard says CFLAGS and YFLAGS are reserved
13845 for the installer to set.
13846 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13847 * src/Makefile.am (AM_CFLAGS): Likewise.
13848 (AM_YFLAGS): Renamed from YFLAGS.
13849
13850 Fix some MAX and MIN problems.
13851 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13852 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13853 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13854 * src/reader.c (reader): Use it.
13855
13856 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13857 POSIX 1003.1-2001 has removed fgrep.
13858
138592002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13860
13861 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13862 interpreted as signed.
13863 * lib/ebitset.c (ebitset_list): Fix bug.
13864
ff68026d
PE
138652002-10-01 Paul Eggert <eggert@twinsun.com>
13866
13867 More fixes for 64-bit hosts and large bitsets.
13868
13869 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13870 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13871 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13872 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13873 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13874 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13875 bitset_count_): Likewise.
13876 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13877 bitset_first, bitset_last): Likewise.
13878 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13879 bitset_stats_list_reverse, bitset_stats_size,
13880 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13881 Likewise.
13882 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13883 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13884 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13885 bitsetv_reflexive_transitive_closure): Likewise.
13886 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13887 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13888 Likewise.
13889 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13890 Likewise.
420f93c8 13891
ff68026d
PE
13892 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13893 Use size_t, not unsigned int, to count bytes.
13894 * lib/abitset.h (abitset_bytes): Likewise.
13895 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13896 Likewise.
13897 * lib/bitset.h (bitset_bytes): Likewise.
13898 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13899 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13900 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13901 * lib/ebitset.c (ebitset_bytes): Likewise.
13902 * lib/ebitset.h (ebitset_bytes): Likewise.
13903 * lib/lbitset.c (lbitset_bytes): Likewise.
13904 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 13905
ff68026d
PE
13906 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13907 abitset_subset_p, abitset_disjoint_p, abitset_and,
13908 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13909 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13910 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13911 abitset_or_and, abitset_or_and_cmp):
13912 Use bitset_windex instead of unsigned int.
13913 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13914 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13915 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13916 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13917 Likewise.
13918 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 13919
ff68026d
PE
13920 * lib/bitset.c (bitset_print):
13921 Use proper printf formats for widths of integer types.
13922 * lib/bitset_stats.c (bitset_percent_histogram_print,
13923 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13924 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13925 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13926 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 13927
ff68026d
PE
13928 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13929 BITSET_SIZE_MAX): New macros.
13930 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13931 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13932 to BITSET_WINDEX_MAX.
13933
13934 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13935 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13936 since we now return the bitset_bindex type (not int).
13937
13938 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13939 when computing sizes.
13940 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13941
13942 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13943 and avoid cast to unsigned.
13944
6aa452a6
AD
139452002-09-30 Akim Demaille <akim@epita.fr>
13946
13947 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13948 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13949 Updates from Michael Hayes.
13950
927f7817
AD
139512002-09-30 Art Haas <ahaas@neosoft.com>
13952
13953 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13954 invocations.
13955 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13956 defined.
13957
9738f41e
AD
139582002-09-27 Akim Demaille <akim@epita.fr>
13959
13960 Version 1.49c.
13961
a5c75d7f
AD
139622002-09-27 Akim Demaille <akim@epita.fr>
13963
13964 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13965 (Because of AC_LIBSOURCE).
13966
8280e179
AD
139672002-09-27 Akim Demaille <akim@epita.fr>
13968
13969 Playing with Autoscan.
13970
13971 * configure.ac: Remove the old LIBOBJ tweaks.
13972 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13973 * lib/strrchr.c: New.
13974 * lib/strtol.c: New, from the Coreutils 4.5.1.
13975
ae64af35
AD
139762002-09-27 Akim Demaille <akim@epita.fr>
13977
13978 Playing with Autoscan.
13979
13980 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13981 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13982 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13983 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13984 Coreutils 4.5.1.
13985
d1a1114f
AD
139862002-09-24 Akim Demaille <akim@epita.fr>
13987
13988 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13989 (Frequently Asked Questions, Parser Stack Overflow): New.
13990
b906441c
AD
139912002-09-13 Akim Demaille <akim@epita.fr>
13992
13993 Playing with autoscan.
13994
13995 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13996 * src/files.c (skeleton_find): Remove, unused.
13997 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13998 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13999
bd701811
AD
140002002-09-13 Akim Demaille <akim@epita.fr>
14001
14002 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14003 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14004
e0a13e7b
AD
140052002-09-13 Akim Demaille <akim@epita.fr>
14006
14007 * configure.ac: Require 2.54.
14008 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14009 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14010 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14011 Remove, provided by Autoconf macros.
14012
c97011bf
AD
140132002-09-12 Akim Demaille <akim@epita.fr>
14014
14015 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14016
d862b1be
AD
140172002-09-12 Akim Demaille <akim@epita.fr>
14018
14019 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14020 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14021 Reported by Martin Mokrejs.
14022
3d38c03a
AD
140232002-09-10 Akim Demaille <akim@epita.fr>
14024
14025 * src/parse-gram.y: Associate a human readable string to each
14026 token type.
14027 * tests/regression.at (Invalid inputs): Adjust.
14028
b6347355
AD
140292002-09-10 Gary V. Vaughan <gary@gnu.org>
14030
14031 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14032 with an Autoconf-2.5x style configure.ac.
14033
09ba4ab2
PE
140342002-09-06 Paul Eggert <eggert@twinsun.com>
14035
14036 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14037 exception applies only to yacc.c. This is a modification of a
14038 patch originally suggested by Akim Demaille.
14039
21846f69
AD
140402002-09-06 Akim Demaille <akim@epita.fr>
14041
09ba4ab2
PE
14042 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14043 here to...
14044 * data/yacc.c: here.
14045
21846f69
AD
14046 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14047 LocationType.
14048 (b4_ltype): Default to yy::Location from location.hh.
14049
c0ad8bf3
AD
140502002-09-04 Jim Meyering <jim@meyering.net>
14051
14052 * data/yacc.c: Guard the declaration of yytoknum also with
14053 `#ifdef YYPRINT', so it is declared only when used.
14054
3a93251e
AD
140552002-09-04 Akim Demaille <akim@epita.fr>
14056
14057 * configure.in: Rename as...
14058 * configure.ac: this.
14059 Bump to 1.49c.
14060
427c0dda
AD
140612002-09-04 Akim Demaille <akim@epita.fr>
14062
14063 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14064 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14065 translate maintainer only messages.
14066
6a254321
PE
140672002-08-12 Paul Eggert <eggert@twinsun.com>
14068
645e30d1
PE
14069 Version 1.49b.
14070
6a254321
PE
14071 * Makefile.am (SUBDIRS): Remove intl.
14072 (DISTCLEANFILES): Remove.
14073 * NEWS: Mention that GNU M4 is now required. Clarify what is
14074 meant by "larger grammars". Mention the pt_BR translation.
14075 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14076 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14077 Bump version from 0.11.2 to 0.11.5.
14078 (BISON_PREREQ_STAGE): Remove.
14079 (AM_GNU_GETTEXT): Use external gettext.
14080 (AC_OUTPUT): Remove intl/Makefile.
14081
14082 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14083
14084 * data/glr.c: Include string.h, for strlen.
14085 (yyreportParseError): Use size_t for yysize.
14086 (yy_yypstack): No longer nested inside yypstates, as nested
14087 functions are not portable. Do not assume size_t is the
14088 same width as int.
14089 (yypstates): Do not assume that ptrdiff_t is the same width
14090 as int, and similarly for yyposn and YYINDEX.
14091
14092 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14093
14094 * lib/Makefile.am (INCLUDES): Do not include from the intl
14095 directory, which has been removed.
14096 * src/Makefile.am (INCLUDES): Likewise.
14097
14098 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14099 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14100 New vars.
14101
14102 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14103 * tests/Makefile.am (EXTRA_DIST): Likewise.
14104
14105 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14106 Do not assume that bitset_windex is the same width as unsigned.
14107
14108 * lib/abitset.c (abitset_unused_clear): Do not assume that
14109 bitset_word is the same width as int.
14110 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14111 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14112 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14113 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14114 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14115
14116 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14117 portability to one's complement hosts!).
14118 * lib/ebitset.c (ebitset_op1): Likewise.
14119 * lib/lbitset.c (lbitset_op1): Likewise.
14120
14121 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14122 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14123 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14124 Sync with fileutils.
14125 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14126 lib/gettext.h: Sync with diffutils.
14127
14128 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14129 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14130
14131 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14132 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14133 check for void *.
14134
14135 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14136 size_t; the old version tried to do this but casted improperly.
14137 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14138 (bitset_test): Now returns int, not unsigned long.
14139
14140 * lib/bitset_stats.c: Include "gettext.h".
14141 (_): New macro.
14142 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14143 name locals "index", as it generates unnecessary warnings on some
14144 hosts that have an "index" function.
14145
14146 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14147 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14148 they need translation.
14149 * src/LR0.c (state_list_append, new_itemsets, get_state,
14150 append_states, generate_states): Likewise.
14151 * src/assoc.c (assoc_to_string): Likewise.
14152 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14153 * src/gram.c (grammar_dump): Likewise.
14154 * src/injections.c (injections_compute): Likewise.
14155 * src/lalr.c (lookaheads_print): Likewise.
14156 * src/relation.c (relation_transpose): Likewise.
14157 * src/scan-gram.l: Likewise.
14158 * src/tables.c (table_grow, pack_vector): Likewise.
14159
14160 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14161 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14162 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14163 * m4/mbstate_t.m4: Sync with fileutils.
14164 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14165
14166 * po/LINGUAS: Add pt_BR.
14167 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14168 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14169 lib/timevar.c.
14170 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14171 manual recommends.
14172 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14173
14174 * src/complain.c (strerror_r): Remove decl; not needed.
14175 (strerror): Use same pattern as ../lib/error.c.
14176
14177 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14178
14179 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14180
14181 * src/main.c (main): Cast result of bindtextdomain and textdomain
14182 to void, to avoid a GCC warning when --disable-nls is in effect.
14183
14184 * src/scan-gram.l: Use strings rather than escapes when possible,
14185 to minimize the number of warnings from xgettext.
14186 (handle_action_dollar, handle_action_at): Don't use isdigit,
14187 as it mishandles negative chars and it may not work as expected
14188 outside the C locale.
14189
14190 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14191 this is a GCC extension and is not portable to other compilers.
14192
14193 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14194 Do not include <ctype.h>; no longer needed.
14195 Do not include <malloc.h>; no longer needed (and generates
14196 warnings on OpenBSD 3.0).
14197
14198 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14199 it's not portable.
14200
14201 * tests/regression.at: Do not use 'cc -c input.c -o input';
14202 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14203
14204 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14205 exit status as failure, not just exit status 1. Sun C exits
14206 with status 2 sometimes.
14207
14208 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14209 Use it for the two large tests.
14210
c8f002c7
AD
142112002-08-02 Akim Demaille <akim@epita.fr>
14212
14213 * src/conflicts.c (conflicts_output): Don't output rules never
14214 reduced here, since anyway that computation doesn't work.
14215 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14216 (rule_useless_p, rule_never_reduced_p): New.
14217 (grammar_rules_partial_print): Use a filter instead of a range.
14218 Display the title only if needed.
14219 (grammar_rules_print): Adjust.
14220 (grammar_rules_never_reduced_report): New.
14221 * src/tables.c (action_row): Move the computation of rules never
14222 reduced to...
14223 (token_actions): here.
14224 * src/main.c (main): Make the parser before making the report, so
14225 that rules never reduced are computed.
14226 Call grammar_rules_never_reduced_report.
14227 * src/print.c (print_results): Report rules never reduced.
14228 * tests/conflicts.at, tests/reduce.at: Adjust.
14229
cd08e51e
AD
142302002-08-01 Akim Demaille <akim@epita.fr>
14231
14232 Instead of attaching lookaheads and duplicating the rules being
14233 reduced by a state, attach the lookaheads to the reductions.
14234
14235 * src/state.h (state_t): Remove the `lookaheads',
14236 `lookaheads_rule' member.
14237 (reductions_t): Add a `lookaheads' member.
14238 Use a regular array for the `rules'.
14239 * src/state.c (reductions_new): Initialize the lookaheads member
14240 to 0.
14241 (state_rule_lookaheads_print): Adjust.
14242 * src/state.h, src/state.c (state_reductions_find): New.
14243 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14244 (count_rr_conflicts): Adjust.
14245 * src/lalr.c (LArule): Remove.
14246 (add_lookback_edge): Adjust.
14247 (state_lookaheads_count): New.
14248 (states_lookaheads_initialize): Merge into...
14249 (initialize_LA): this.
14250 (lalr_free): Adjust.
14251 * src/main.c (main): Don't free nullable and derives too early: it
14252 is used by --verbose.
14253 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14254
bb0027a9
AD
142552002-08-01 Akim Demaille <akim@epita.fr>
14256
14257 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14258 `rule_number_t**'.
14259 (set_derives, free_derives): Rename as...
14260 (derives_compute, derives_free): this.
14261 Adjust all dependencies.
14262 * src/nullable.c (set_nullable, free_nullable): Rename as...
14263 (nullable_compute, nullable_free): these.
14264 (rule_list_t): Store rule_t *, not rule_number_t.
14265 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14266 pointers, instead of their numbers.
14267 * src/main.c (main): Call nullable_free, and derives_free earlier,
14268 as they were lo longer used.
14269
3325ddc4
AD
142702002-08-01 Akim Demaille <akim@epita.fr>
14271
14272 * lib/timevar.c (get_time): Include children time.
14273 * src/lalr.h (LA, LArule): Don't export them: used with the
14274 state_t.
14275 * src/lalr.c (LA, LArule): Static.
14276 * src/lalr.h, src/lalr.c (lalr_free): New.
14277 * src/main.c (main): Call it.
14278 * src/tables.c (pack_vector): Check whether loc is >= to the
14279 table_size, not >.
14280 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14281 (tables_generate): do it, since that's also it which allocates
14282 them.
14283 Don't free LA and LArule, main does.
14284
c6f1a33c
AD
142852002-07-31 Akim Demaille <akim@epita.fr>
14286
14287 Separate parser tables computation and output.
14288
14289 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14290 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14291 (yydefgoto, yydefact, high): Move to...
14292 * src/tables.h, src/tables.c: here.
14293 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14294 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14295 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14296 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14297 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14298 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14299 (action_row, save_row, token_actions, save_column, default_goto)
14300 (goto_actions, sort_actions, matching_state, pack_vector)
14301 (table_ninf_remap, pack_table, prepare_actions): Move to...
14302 * src/tables.c: here.
14303 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14304 * src/output.c (token_actions, output_base, output_conflicts)
14305 (output_check): Merge into...
14306 (prepare_actions): this.
14307 (actions_output): Rename as...
14308 (user_actions_output): this.
14309 * src/main.c (main): Call tables_generate and tables_free.
14310
1509d42f
AD
143112002-07-31 Akim Demaille <akim@epita.fr>
14312
14313 Steal GCC's --time-report support.
14314
14315 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14316 stolen/adjusted from GCC.
14317 * m4/stage.m4: Remove time related checks.
14318 * m4/timevar.m4: New.
14319 * configure.in: Adjust.
14320 * src/system.h: Adjust to using timevar.h.
14321 * src/getargs.h, src/getargs.c: Support trace_time for
14322 --trace=time.
14323 * src/main.c (stage): Remove.
14324 (main): Replace `stage' invocations with timevar calls.
14325 * src/output.c: Insert pertinent timevar calls.
14326
273a74fa
AD
143272002-07-31 Akim Demaille <akim@epita.fr>
14328
14329 Let --trace have arguments.
14330
14331 * src/getargs.h (enum trace_e): New.
14332 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14333 (long_options, short_options): --trace/-T takes an optional
14334 argument.
14335 Change all the uses of trace_flag to reflect the new flags.
14336 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14337
14338 Strengthen `stage' portability.
14339
14340 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14341 * configure.in: Use it.
14342 Don't check for malloc.h and sys/times.h.
14343 * src/system.h: Include them when appropriate.
14344 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14345 times and struct tms are available.
14346
217598da
AD
143472002-07-30 Akim Demaille <akim@epita.fr>
14348
14349 In verbose parse error message, don't report `error' as an
14350 expected token.
14351 * tests/actions.at (Printers and Destructors): Adjust.
14352 * tests/calc.at (Calculator $1): Adjust.
14353 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14354 error message, do not report the parser accepts the error token in
14355 that state.
14356
52489d44
AD
143572002-07-30 Akim Demaille <akim@epita.fr>
14358
14359 Normalize conflict related messages.
14360
14361 * src/complain.h, src/complain.c (warn, complain): New.
14362 * src/conflicts.c (conflicts_print): Use them.
14363 (conflict_report_yacc): New, extracted from...
14364 (conflicts_print): here.
14365 * tests/conflicts.at, tests/existing.at: Adjust.
14366
e8832397
AD
143672002-07-30 Akim Demaille <akim@epita.fr>
14368
14369 Report rules which are never reduced by the parser: those hidden
14370 by conflicts.
14371
14372 * src/LR0.c (save_reductions): Don't make the final state too
14373 different: save its reduction (accept) instead of having a state
14374 without any action (no shift or goto, no reduce).
14375 Note: the final state is now a ``regular'' state, i.e., the
14376 parsers now contain `reduce 0' as default reduction.
14377 Nevertheless, since they decide to `accept' when yystate =
14378 final_state, they still will not reduce rule 0.
14379 * src/print.c (print_actions, print_reduction): Adjust.
14380 * src/output.c (action_row): Track reduced rules.
14381 (token_actions): Report rules never reduced.
14382 * tests/conflicts.at, tests/regression.at: Adjust.
14383
caf23d24
AD
143842002-07-30 Akim Demaille <akim@epita.fr>
14385
14386 `stage' was accidently included in a previous patch.
14387 Initiate its autoconfiscation.
14388
14389 * configure.in: Look for malloc.h and sys/times.h.
14390 * src/main.c (stage): Adjust.
14391 Report only when trace_flag.
14392
640748ee
AD
143932002-07-29 Akim Demaille <akim@epita.fr>
14394
14395 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14396 state_number_t.
14397 (errs_t): symbol_t*, not symbol_number_t.
14398 (reductions_t): rule_t*, not rule_number_t.
14399 (FOR_EACH_SHIFT): New.
14400 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14401 * src/print.c, src/print_graph.c: Adjust.
14402
88bce5a2
AD
144032002-07-29 Akim Demaille <akim@epita.fr>
14404
14405 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14406
14407 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14408 (endtoken, accept): these.
14409 * src/reader.c (reader): Set endtoken's default tag to "$end".
14410 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14411 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14412 Adjust.
14413
1bfb97db
AD
144142002-07-29 Akim Demaille <akim@epita.fr>
14415
14416 * src/reduce.c (reduce_grammar): When the language is empty,
14417 complain about the start symbol, not the axiom.
14418 Use its location.
14419 * tests/reduce.at (Empty Language): New.
14420
fc5734fe
AD
144212002-07-26 Akim Demaille <akim@epita.fr>
14422
14423 * src/reader.h, src/reader.c (gram_error): ... can't get
14424 yycontrol without making too strong assumptions on the parser
14425 itself.
14426 * src/output.c (prepare_tokens): Use the real 0th value of
14427 token_translations instead of `0'.
14428 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14429 visible here.
14430 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14431 for the time being: %locations ought to provide it to yyerror.
14432
3650b4b8
AD
144332002-07-25 Akim Demaille <akim@epita.fr>
14434
14435 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14436 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14437 * tests/regression.at (Web2c Actions): Adjust.
14438
4b3d3a8e
AD
144392002-07-25 Akim Demaille <akim@epita.fr>
14440
14441 Stop storing rules from 1 to nrules + 1.
14442
14443 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14444 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14445 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14446 Iterate from 0 to nrules.
14447 Use rule_number_as_item_number and item_number_as_rule_number.
14448 Adjust to `derive' now containing possibly 0.
14449 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14450 Handle the `- 1' part in rule numbers from/to item numbers.
14451 * src/conflicts.c (log_resolution): Fix the message which reversed
14452 shift and reduce.
14453 * src/output.c (action_row): Initialize default_rule to -1.
14454 (token_actions): Adjust.
14455 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14456 expected output.
14457 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14458
4a2a22f4
AD
144592002-07-25 Akim Demaille <akim@epita.fr>
14460
14461 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14462 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14463 (b4_c_knr_arg_decl): New.
14464 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14465 yyreport_parse_error.
14466
b8df3223
AD
144672002-07-25 Akim Demaille <akim@epita.fr>
14468
14469 * data/yacc.c (yyreport_parse_error): New, extracted from...
14470 (yyparse): here.
14471 (yydestruct, yysymprint): Move above yyparse.
14472 Be K&R compliant.
14473
a762e609
AD
144742002-07-25 Akim Demaille <akim@epita.fr>
14475
14476 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14477 replace...
14478 (b4_sint_type, b4_uint_type): these.
14479 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14480 * tests/regression.at (Web2c Actions): Adjust.
14481
12b0043a
AD
144822002-07-25 Akim Demaille <akim@epita.fr>
14483
14484 * src/gram.h (TIEM_NUMBER_MAX): New.
14485 (item_number_of_rule_number, rule_number_of_item_number): Rename
14486 as...
14487 (rule_number_as_item_number, item_number_as_rule_number): these.
14488 Adjust dependencies.
14489 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14490 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14491 (symbol_number_to_vector_number): New.
14492 (order): Of vector_number_t* type.
14493 (base_t, BASE_MAX, BASE_MIN): New.
14494 (froms, tos, width, pos, check): Of base_t type.
14495 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14496 (actrow): Of action_number_t type.
14497 (conflrow): Of unsigned int type.
14498 (table_ninf, base_ninf): New.
14499 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14500 (muscle_insert_int_table, muscle_insert_base_table)
14501 (muscle_insert_rule_number_table): New.
14502 (prepare_tokens): Output `toknum' as int_table.
14503 (action_row): Returns a rule_number_t.
14504 Use ACTION_MIN, not SHRT_MIN.
14505 (token_actions): yydefact is rule_number_t*.
14506 (table_ninf_remap): New.
14507 (pack_table): Use it for `base' and `table'.
14508 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14509 replaced with...
14510 (YYPACT_NINF, YYTABLE_NINF): these.
14511 (yypact, yytable): Compute their types instead of hard-coded
14512 `short'.
14513 * tests/regression.at (Web2c Actions): Adjust.
14514
5dde258a
AD
145152002-07-19 Akim Demaille <akim@epita.fr>
14516
14517 * src/scan-gram.l (id): Can start with an underscore.
14518
a945ec39
AD
145192002-07-16 Akim Demaille <akim@epita.fr>
14520
14521 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14522 Adjust all former `associativity' dependencies.
14523 * src/symtab.c (symbol_new): Default associativity is `undef', not
14524 `right'.
14525 (symbol_check_alias_consistence): Adjust.
14526
fae437e8
AD
145272002-07-09 Akim Demaille <akim@epita.fr>
14528
14529 * doc/bison.texinfo: Properly set the ``header'' part.
14530 Use @dircategory ``GNU programming tools'' as per Texinfo's
14531 documentation.
14532 Use @copying.
14533
1a715ef2
AD
145342002-07-09 Akim Demaille <akim@epita.fr>
14535
14536 * lib/quotearg.h: Protect against multiple inclusions.
14537 * src/location.h (location_t): Add a `file' member.
14538 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14539 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14540 `error_one_per_line' support.
14541
a5d50994
AD
145422002-07-09 Akim Demaille <akim@epita.fr>
14543
14544 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14545 * src/reader.c (lineno): Remove.
14546 Adjust all dependencies.
14547 (get_merge_function): Take a location and use complain_at.
14548 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14549 * tests/regression.at (Invalid inputs, Mixing %token styles):
14550 Adjust.
14551
b275314e
AD
145522002-07-09 Akim Demaille <akim@epita.fr>
14553
14554 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14555 recovery rule, and forbid extensions when --yacc.
14556 (gram_error): Use complain_at.
14557 * src/reader.c (reader): Exit if there were parse errors.
14558
865b9df1
AD
145592002-07-09 Akim Demaille <akim@epita.fr>
14560
14561 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14562 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14563 Reported by R Blake <blakers@mac.com>.
14564
c76e14da
AD
145652002-07-09 Akim Demaille <akim@epita.fr>
14566
14567 * data/yacc.c: Output the copyright notive in the header.
14568
7db2ed2d
AD
145692002-07-03 Akim Demaille <akim@epita.fr>
14570
14571 * src/output.c (froms, tos): Are state_number_t.
14572 (save_column): sp, sp1, and sp2 are state_number_t.
14573 (prepare): Rename `final' as `final_state_number', `nnts' as
14574 `nterms_number', `nrules' as `rules_number', `nstates' as
14575 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14576 unused.
14577 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14578 * data/lalr1.cc (nsym_): Remove, unused.
14579
e68e0410
AD
145802002-07-03 Akim Demaille <akim@epita.fr>
14581
14582 * src/lalr.h, src/lalr.c (goto_number_t): New.
14583 * src/lalr.c (goto_list_t): New.
14584 Propagate them.
14585 * src/nullable.c (rule_list_t): New.
14586 Propagate.
14587 * src/types.h: Remove.
14588
e1a4f3a4
AD
145892002-07-03 Akim Demaille <akim@epita.fr>
14590
14591 * src/closure.c (print_fderives): Use rule_rhs_print.
14592 * src/derives.c (print_derives): Use rule_rhs_print.
14593 (rule_list_t): New, replaces `shorts'.
14594 (set_derives): Add comments.
14595 * tests/sets.at (Nullable, Firsts): Adjust.
14596
536545f3
AD
145972002-07-03 Akim Demaille <akim@epita.fr>
14598
14599 * src/output.c (prepare_actions): Free `tally' and `width'.
14600 (prepare_actions): Allocate and free `order'.
14601 * src/symtab.c (symbols_free): Free `symbols'.
14602 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14603 * src/output.c (m4_invoke): Move to...
14604 * src/scan-skel.l: here.
14605 (<<EOF>>): Close yyout, and free its name.
14606
8b752b00
AD
146072002-07-03 Akim Demaille <akim@epita.fr>
14608
14609 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14610
14611 * src/LR0.c (new_state): Merge into...
14612 (state_list_append): this.
14613 (new_states): Merge into...
14614 (generate_states): here.
14615 (set_states): Don't ensure a proper `errs' state member here, do it...
14616 * src/conflicts.c (conflicts_solve): here.
14617 * src/state.h, src/state.c: Comment changes.
14618 (state_t): Rename member `shifts' as `transitions'.
14619 Adjust all dependencies.
14620 (errs_new): For consistency, also take the values as argument.
14621 (errs_dup): Remove.
14622 (state_errs_set): New.
14623 (state_reductions_set, state_transitions_set): Assert that no
14624 previous value was assigned.
14625 (state_free): New.
14626 (states_free): Use it.
14627 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14628 temporary storage: use `errs' and `nerrs' as elsewhere.
14629 (set_conflicts): Allocate and free this `errs'.
14630
613f5e1a
AD
146312002-07-02 Akim Demaille <akim@epita.fr>
14632
14633 * lib/libiberty.h: New.
14634 * lib: Update the bitset implementation from upstream.
14635 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14636 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14637 * src/main.c: Adjust bitset stats calls.
14638
26e0cadc
PE
146392002-07-01 Paul Eggert <eggert@twinsun.com>
14640
14641 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14642 char, so that negative chars don't collide with $.
14643
1154cced
AD
146442002-06-30 Akim Demaille <akim@epita.fr>
14645
14646 Have the GLR tests be `warning' checked, and fix the warnings.
14647
14648 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14649 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14650 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14651 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14652 (yyaddDeferredAction): static.
14653 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14654 (yyreportParseError): yyprefix is const.
14655 yytokenp is used only when verbose.
14656 (yy__GNUC__): Replace with __GNUC__.
14657 (yypdumpstack): yyi is size_t.
14658 (yypreference): Un-yy local variables and arguments, to avoid
14659 clashes with `yyr1'. Anyway, we are not in the user name space.
14660 (yytname_size): be an int, as is compared with ints.
14661 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14662 Use them.
14663 * tests/cxx-gram.at: Use quotation to protect $1.
14664 Use AT_COMPILE to enable warnings hunts.
14665 Prototype yylex and yyerror.
14666 `Use' argc.
14667 Include `string.h', not `strings.h'.
14668 Produce and prototype stmtMerge only when used.
14669 yylex takes a location.
14670
97650f4e
AD
146712002-06-30 Akim Demaille <akim@epita.fr>
14672
14673 We spend a lot of time in quotearg, in particular when --verbose.
14674
14675 * src/symtab.c (symbol_get): Store a quoted version of the key.
14676 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14677 Adjust all callers.
14678
d2576365
AD
146792002-06-30 Akim Demaille <akim@epita.fr>
14680
14681 * src/state.h (reductions_t): Rename member `nreds' as num.
14682 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14683 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14684
ccaf65bc
AD
146852002-06-30 Akim Demaille <akim@epita.fr>
14686
14687 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14688 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14689 (shifts_to): Rename as...
14690 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14691 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14692 (TRANSITION_IS_DISABLED, transitions_to): these.
14693
87675353
AD
146942002-06-30 Akim Demaille <akim@epita.fr>
14695
14696 * src/print.c (print_shifts, print_gotos): Merge into...
14697 (print_transitions): this.
14698 (print_transitions, print_errs, print_reductions): Align the
14699 lookaheads columns.
14700 (print_core, print_transitions, print_errs, print_state,
14701 print_grammar): Output empty lines separator before, not after.
14702 (state_default_rule_compute): Rename as...
14703 (state_default_rule): this.
14704 * tests/conflicts.at (Defaulted Conflicted Reduction),
14705 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14706 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14707
ce4ccb4b
AD
147082002-06-30 Akim Demaille <akim@epita.fr>
14709
14710 Display items as we display rules.
14711
14712 * src/gram.h, src/gram.c (rule_lhs_print): New.
14713 * src/gram.c (grammar_rules_partial_print): Use it.
14714 * src/print.c (print_core): Likewise.
14715 * tests/conflicts.at (Defaulted Conflicted Reduction),
14716 (Unresolved SR Conflicts): Adjust.
14717 (Unresolved SR Conflicts): Adjust and rename as...
14718 (Resolved SR Conflicts): this, as was meant.
14719 * tests/regression.at (Web2c Report): Adjust.
14720
bc933ef1
AD
147212002-06-30 Akim Demaille <akim@epita.fr>
14722
14723 * src/print.c (state_default_rule_compute): New, extracted from...
14724 (print_reductions): here.
14725 Pessimize, but clarify the code.
14726 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14727
53d4308d
AD
147282002-06-30 Akim Demaille <akim@epita.fr>
14729
14730 * src/output.c (action_row): Let default_rule be always a rule
14731 number.
14732
574fb2d5
AD
147332002-06-30 Akim Demaille <akim@epita.fr>
14734
14735 * src/closure.c (print_firsts, print_fderives, closure):
14736 Use BITSET_EXECUTE.
14737 * src/lalr.c (lookaheads_print): Likewise.
14738 * src/state.c (state_rule_lookaheads_print): Likewise.
14739 * src/print_graph.c (print_core): Likewise.
14740 * src/print.c (print_reductions): Likewise.
14741 * src/output.c (action_row): Likewise.
14742 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14743
05811fd7
AD
147442002-06-30 Akim Demaille <akim@epita.fr>
14745
14746 * src/print_graph.c: Use report_flag.
14747
0e4d5753
AD
147482002-06-30 Akim Demaille <akim@epita.fr>
14749
14750 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14751 to...
14752 * src/relation.h, src/relation.c (traverse, relation_digraph)
14753 (relation_print, relation_transpose): New.
14754
24c7d800
AD
147552002-06-30 Akim Demaille <akim@epita.fr>
14756
14757 * src/state.h, src/state.c (shifts_to): New.
14758 * src/lalr.c (build_relations): Use it.
14759
9222837b
AD
147602002-06-30 Akim Demaille <akim@epita.fr>
14761
14762 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14763 (item_number_of_rule_number, rule_number_of_item_number): New.
14764 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14765 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14766 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14767 Propagate their use.
14768 Much remains to be done, in particular wrt `shorts' from types.h.
14769
260008e5
AD
147702002-06-30 Akim Demaille <akim@epita.fr>
14771
14772 * src/symtab.c (symbol_new): Initialize the `printer' member.
14773
8a731ca8
AD
147742002-06-30 Akim Demaille <akim@epita.fr>
14775
14776 * src/LR0.c (save_reductions): Remove, replaced by...
14777 * src/state.h, src/state.c (state_reductions_set): New.
14778 (reductions, errs): Rename as...
14779 (reductions_t, errs_t): these.
14780 Adjust all dependencies.
14781
32e1e0a4
AD
147822002-06-30 Akim Demaille <akim@epita.fr>
14783
14784 * src/LR0.c (state_list_t, state_list_append): New.
14785 (first_state, last_state): Now symbol_list_t.
14786 (this_state): Remove.
14787 (new_itemsets, append_states, save_reductions): Take a state_t as
14788 argument.
14789 (set_states, generate_states): Adjust.
14790 (save_shifts): Remove, replaced by...
14791 * src/state.h, src/state.c (state_shifts_set): New.
14792 (shifts): Rename as...
14793 (shifts_t): this.
14794 Adjust all dependencies.
14795 * src/state.h (state_t): Remove the `next' member.
14796
e5fb6710
AD
147972002-06-30 Akim Demaille <akim@epita.fr>
14798
14799 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14800 escaped in slot 0.
14801
c7ca99d4
AD
148022002-06-30 Akim Demaille <akim@epita.fr>
14803
14804 Use hash.h for the state hash table.
14805
14806 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14807 (allocate_storage): Use state_hash_new.
14808 (free_storage): Use state_hash_free.
14809 (new_state, get_state): Adjust.
14810 * src/lalr.h, src/lalr.c (states): Move to...
14811 * src/states.h (state_t): Remove the `link' member, no longer
14812 used.
14813 * src/states.h, src/states.c: here.
14814 (state_hash_new, state_hash_free, state_hash_lookup)
14815 (state_hash_insert, states_free): New.
14816 * src/states.c (state_table, state_compare, state_hash): New.
14817 * src/output.c (output_actions): Do not free states now, since we
14818 still need to know the final_state number in `prepare', called
14819 afterwards. Do it...
14820 * src/main.c (main): here: call states_free after `output'.
14821
df0e7316
AD
148222002-06-30 Akim Demaille <akim@epita.fr>
14823
14824 * src/state.h, src/state.c (state_new): New, extracted from...
14825 * src/LR0.c (new_state): here.
14826 * src/state.h (STATE_ALLOC): Move to...
14827 * src/state.c: here.
14828 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14829 * src/state.h, src/state.c: here.
14830
39f41916
AD
148312002-06-30 Akim Demaille <akim@epita.fr>
14832
14833 * src/reader.c (gensym): Rename as...
14834 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14835 (getsym): Rename as...
14836 (symbol_get): this.
14837
d57650a5
AD
148382002-06-30 Akim Demaille <akim@epita.fr>
14839
14840 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14841 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14842 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14843 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14844
5a08f1ce
AD
148452002-06-30 Akim Demaille <akim@epita.fr>
14846
14847 Make the test suite pass with warnings checked.
14848
14849 * tests/actions.at (Printers and Destructors): Improve.
14850 Avoid unsigned vs. signed issues.
14851 * tests/calc.at: Don't exercise the scanner here, do it...
14852 * tests/input.at (Torturing the Scanner): here.
14853
720623af
PH
148542002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14855
88e7e941 14856 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
14857 reorganize first lines parallel to yacc.c.
14858
fb8135fa
AD
148592002-06-28 Akim Demaille <akim@epita.fr>
14860
14861 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14862 (b4_token_enum, b4_token_defines): New, factored from...
14863 * data/lalr1.cc, data/yacc.c, glr.c: here.
14864
41442480
AD
148652002-06-28 Akim Demaille <akim@epita.fr>
14866
14867 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14868 unused variables.
14869 * src/output.c (merger_output): static.
14870
e0e5bf84
AD
148712002-06-28 Akim Demaille <akim@epita.fr>
14872
ba0fe3c7 14873 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
14874 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14875 pacify GCC.
14876 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 14877
676385e2
PH
148782002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14879
14880 Accumulated changelog for new GLR parsing features.
14881
6a254321 14882 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
14883 conflicts_total_count.
14884 * src/conflicts.h: Ditto.
14885 * src/output.c (token_actions): Use the new name.
14886 (output_conflicts): Change conflp => conflict_list_heads, and
14887 confl => conflict_list for better readability.
14888 * data/glr.c: Use the new names.
14889 * NEWS: Add self to GLR announcement.
e0e5bf84 14890
676385e2
PH
14891 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14892
14893 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14894 Akim Demaille.
14895
14896 * data/bison.glr: Change name to glr.c
14897 * data/glr.c: Renamed from bison.glr.
14898 * data/Makefile.am: Add glr.c
e0e5bf84
AD
14899
14900 * src/getargs.c:
14901
676385e2 14902 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 14903 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 14904
676385e2
PH
14905 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14906
14907 * data/bison.glr: Be sure to restore the
14908 current #line when returning to the skeleton contents after having
14909 exposed the input file's #line.
14910
14911 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14912
14913 * data/bison.glr: Bring up to date with changes to bison.simple.
14914
14915 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14916
14917 * data/bison.glr: Correct definitions that use b4_prefix.
14918 Various reformatting.
14919 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14920 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14921 yytokenp argument; now part of stack.
14922 (yychar): Define to behave as documented.
14923 (yyclearin): Ditto.
e0e5bf84 14924
676385e2
PH
14925 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14926
14927 * src/reader.h: Add declaration for free_merger_functions.
14928
14929 * src/reader.c (merge_functions): New variable.
14930 (get_merge_function): New function.
14931 (free_merger_functions): New function.
14932 (readgram): Check for %prec that is not followed by a symbol.
14933 Handle %dprec and %merge declarations.
14934 (packgram): Initialize dprec and merger fields in rules array.
14935
14936 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14937 conflict_list_cnt, conflict_list_free): New variables.
14938 (table_grow): Also grow conflict_table.
e0e5bf84 14939 (prepare_rules): Output dprec and merger tables.
676385e2 14940 (conflict_row): New function.
e0e5bf84 14941 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
14942 default reduction in conflicted states for GLR parser so that there
14943 are spaces for the conflict lists.
14944 (save_row): Also save conflict information.
14945 (token_actions): Allocate conflict list.
14946 (merger_output): New function.
14947 (pack_vector): Pack conflict table, too.
14948 (output_conflicts): New function to output yyconflp and yyconfl.
14949 (output_check): Allocate conflict_tos.
14950 (output_actions): Output conflict tables, also.
14951 (output_skeleton): Output b4_mergers definition.
14952 (prepare): Output b4_max_rhs_length definition.
14953 Use 'bison.glr' as default skeleton for GLR parsers.
14954
14955 * src/gram.c (glr_parser): New flag.
14956 (grammar_free): Call free_merger_functions.
14957
14958 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14959 all pairs of conflicting reductions, rather than just all tokens
14960 causing conflicts. Needed to size conflict tables.
e0e5bf84 14961 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
14962 interface.
14963 (conflicts_print): Ditto.
14964 (count_total_conflicts): New function.
14965
14966 * src/reader.h (merger_list): New type.
14967 (merge_functions): New variable.
14968
14969 * src/lex.h (tok_dprec, tok_merge): New token types.
14970
14971 * src/gram.h (rule_s): Add dprec and merger fields.
14972 (glr_parser): New flag.
14973
14974 * src/conflicts.h (count_total_conflicts): New function.
14975
14976 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14977
14978 * doc/bison.texinfo (Generalized LR Parsing): New section.
14979 (GLR Parsers): New section.
14980 (Language and Grammar): Mention GLR parsing.
14981 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14982 Correct typo ("tge" -> "the").
14983
14984 * data/bison.glr: New skeleton for GLR parsing.
14985
14986 * tests/cxx-gram.at: New tests for GLR parsing.
14987
14988 * tests/testsuite.at: Include cxx-gram.at.
14989
14990 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 14991
676385e2
PH
14992 * src/parse-gram.y:
14993
14994 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14995
14996 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 14997
b5480d74 149982002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
14999
15000 * src/options.h, src/options.c: Remove.
15001 * src/getargs.c (short_options, long_options): New.
15002
60491a94
AD
150032002-06-27 Akim Demaille <akim@epita.fr>
15004
15005 * data/bison.simple, data/bison.c++: Rename as...
15006 * data/yacc.c, data/lalr1.cc: these.
15007 * doc/bison.texinfo (Environment Variables): Remove.
15008
9be0c25b
AD
150092002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15010
15011 * src/getargs.c (report_argmatch): Initialize strtok().
15012
1ae72863
AD
150132002-06-20 Akim Demaille <akim@epita.fr>
15014
15015 * data/bison.simple (b4_symbol_actions): New, replaces...
15016 (b4_symbol_destructor, b4_symbol_printer): these.
15017 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15018 user token numbers.
15019
87542d29
AD
150202002-06-20 Akim Demaille <akim@epita.fr>
15021
15022 * data/bison.simple (yydestructor): Rename as...
15023 (yydestruct): this.
15024
1a31ed21
AD
150252002-06-20 Akim Demaille <akim@epita.fr>
15026
15027 * src/symtab.h, src/symtab.c (symbol_type_set)
15028 (symbol_destructor_set, symbol_precedence_set): The location is
15029 the last argument.
15030 Adjust all callers.
15031
e776192e
AD
150322002-06-20 Akim Demaille <akim@epita.fr>
15033
15034 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15035 internals.
15036 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15037 Takes a location.
15038 * src/symtab.h, src/symtab.c (symbol_class_set)
15039 (symbol_user_token_number_set): Likewise.
15040 Adjust all callers.
15041 Promote complain_at.
15042 * tests/input.at (Type Clashes): Adjust.
15043
5c1180b3
AD
150442002-06-20 Akim Demaille <akim@epita.fr>
15045
15046 * data/bison.simple (YYLEX): Fix the declaration when
15047 %pure-parser.
15048
e3170060
AD
150492002-06-20 Akim Demaille <akim@epita.fr>
15050
15051 * data/bison.simple (yysymprint): Don't print the token number,
15052 just its name.
15053 * tests/actions.at (Destructors): Rename as...
15054 (Printers and Destructors): this.
15055 Also exercise %printer.
15056
253862fd
AD
150572002-06-20 Akim Demaille <akim@epita.fr>
15058
15059 * data/bison.simple (YYDSYMPRINT): New.
15060 Use it to remove many of the #if YYDEBUG/if (yydebug).
15061
366eea36
AD
150622002-06-20 Akim Demaille <akim@epita.fr>
15063
15064 * src/symtab.h, src/symtab.c (symbol_t): printer and
15065 printer_location are new members.
15066 (symbol_printer_set): New.
15067 * src/parse-gram.y (PERCENT_PRINTER): New token.
15068 Handle its associated rule.
15069 * src/scan-gram.l: Adjust.
15070 (handle_destructor_at, handle_destructor_dollar): Rename as...
15071 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15072 * src/output.c (symbol_printers_output): New.
15073 (output_skeleton): Call it.
15074 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15075 since there are already many grammar files with a user `yyprint'.
15076 Replace the calls to YYPRINT to calls to yysymprint.
15077 * tests/calc.at: Adjust.
15078 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15079 taking advantage of parser very internal details (stack size!).
15080
4f25ebb0
AD
150812002-06-20 Akim Demaille <akim@epita.fr>
15082
15083 * src/scan-gram.l: Complete the scanner with the missing patterns
15084 to pacify Flex.
15085 Use `quote' and `symbol_tag_get' where appropriate.
15086
93b68a0e
AD
150872002-06-19 Akim Demaille <akim@epita.fr>
15088
15089 * tests/actions.at (Destructors): Augment to test locations.
15090 * data/bison.simple (yydestructor): Pass it the current location
15091 if locations are enabled.
15092 Prototype only when __STDC__ or C++.
15093 Change the argument names to move into the yy name space: there is
15094 user code here.
15095
58612f1d
AD
150962002-06-19 Akim Demaille <akim@epita.fr>
15097
74310291
AD
15098 * data/bison.simple (b4_pure_if): New.
15099 Use it instead of #ifdef YYPURE.
15100
151012002-06-19 Akim Demaille <akim@epita.fr>
15102
15103 * data/bison.simple (b4_location_if): New.
58612f1d
AD
15104 Use it instead of #ifdef YYLSP_NEEDED.
15105
f25bfb75
AD
151062002-06-19 Akim Demaille <akim@epita.fr>
15107
15108 Prepare @$ in %destructor, but currently don't bind it in the
15109 skeleton, as %location use is not cleaned up yet.
15110
15111 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15112 (handle_action_at): New.
15113 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15114 a braced_code_t and a location as additional arguments.
15115 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15116 unquote one when outputting `b4_dollar_dollar'.
15117 Adjust callers.
15118 * data/bison.simple (b4_eval): Remove.
15119 (b4_symbol_destructor): Adjust.
15120 * tests/input.at (Invalid @n): Adjust.
15121
c732d2c6
AD
151222002-06-19 Zack Weinberg <zack@codesourcery.com>
15123
15124 * doc/bison.texinfo: Document ability to have multiple
15125 prologue sections.
15126
8c165d89
AD
151272002-06-18 Akim Demaille <akim@epita.fr>
15128
15129 * src/files.c (compute_base_names): When computing the output file
15130 names from the input file name, strip the directory part.
15131
ca98bf57
AD
151322002-06-18 Akim Demaille <akim@epita.fr>
15133
15134 * data/bison.simple.new: Comment changes.
15135 Reported by Andreas Schwab.
15136
0bfb02ff
AD
151372002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15138
15139 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15140 there are no `label `yyoverflowlab' defined but not used' warnings
15141 when yyoverflow is defined.
15142
24c0aad7
AD
151432002-06-18 Akim Demaille <akim@epita.fr>
15144
15145 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15146 new member.
15147 (symbol_destructor_set): Adjust.
15148 * src/output.c (symbol_destructors_output): Output the destructor
15149 locations.
15150 Output the symbol name.
15151 * data/bison.simple (b4_symbol_destructor): Adjust.
15152
5719c109
AD
151532002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15154 and Akim Demaille <akim@epita.fr>
15155
15156 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15157 what's left on the stack when the error recovery hits EOF.
15158 * tests/actions.at (Destructors): Complete to exercise this case.
15159
9280d3ef
AD
151602002-06-17 Akim Demaille <akim@epita.fr>
15161
15162 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15163 arguments is really empty, not only equal to `[]'.
15164 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15165 member.
15166 (symbol_destructor_set): New.
15167 * src/output.c (symbol_destructors_output): New.
15168 * src/reader.h (brace_code_t, current_braced_code): New.
15169 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15170 (handle_dollar): Rename as...
15171 (handle_action_dollar): this.
15172 (handle_destructor_dollar): New.
15173 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15174 (grammar_declaration): Use it.
15175 * data/bison.simple (yystos): Is always defined.
15176 (yydestructor): New.
15177 * tests/actions.at (Destructors): New.
15178 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15179
dafdc66f
AD
151802002-06-17 Akim Demaille <akim@epita.fr>
15181
15182 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15183 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15184 rule_length only when needed.
15185 * src/output.c (actions_output, token_definitions_output): Output
15186 the full M4 block.
15187 * src/symtab.c: Don't access directly to the symbol tag, use
15188 symbol_tag_get.
15189 * src/parse-gram.y: Use symbol_list_free.
15190
56c47203
AD
151912002-06-17 Akim Demaille <akim@epita.fr>
15192
15193 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15194 (symbol_list_prepend, get_type_name): Move to...
15195 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15196 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15197 Adjust all callers.
15198 (symbol_list_free): New.
15199 * src/scan-gram.l (handle_dollar): Takes a location.
15200 * tests/input.at (Invalid $n): Adjust.
15201
1e0bab92
AD
152022002-06-17 Akim Demaille <akim@epita.fr>
15203
15204 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15205 (symbol_list_prepend): New.
15206 * src/parse-gram.y (%union): `list' is a new member.
15207 (symbols.1): New, replaces...
15208 (terms_to_prec.1, nterms_to_type.1): these.
15209 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15210 Take a location as additional argument.
15211 Adjust all callers.
15212
04e60654
AD
152132002-06-15 Akim Demaille <akim@epita.fr>
15214
15215 * src/parse-gram.y: Move %token in the declaration section so that
15216 we don't depend upon CVS Bison.
15217
10e5b8bd
AD
152182002-06-15 Akim Demaille <akim@epita.fr>
15219
15220 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15221 * src/print.c (print_core): Use it.
15222
9801d40c
AD
152232002-06-15 Akim Demaille <akim@epita.fr>
15224
15225 * src/conflicts.c (log_resolution): Accept the rule involved in
15226 the sr conflicts instead of the lookahead number that points to
15227 that rule.
15228 (flush_reduce): Accept the current lookahead vector as argument,
15229 instead of the index in LA.
15230 (resolve_sr_conflict): Accept the current number of lookahead
15231 bitset to consider for the STATE, instead of the index in LA.
15232 (set_conflicts): Adjust.
15233 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15234
c0263492
AD
152352002-06-15 Akim Demaille <akim@epita.fr>
15236
15237 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15238 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15239 Adjust all dependencies.
15240 * src/lalr.c (initialize_lookaheads): Split into...
15241 (states_lookaheads_count, states_lookaheads_initialize): these.
15242 (lalr): Adjust.
15243
9757c359
AD
152442002-06-15 Akim Demaille <akim@epita.fr>
15245
15246 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15247 out of...
15248 (grammar_rules_print): here.
15249 * src/reduce.c (reduce_output): Use it.
15250 * tests/reduce.at (Useless Rules, Reduced Automaton)
15251 (Underivable Rules): Adjust.
15252
6b98e4b5
AD
152532002-06-15 Akim Demaille <akim@epita.fr>
15254
15255 Copy BYacc's nice way to report the grammar.
15256
15257 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15258 New.
15259 Don't print the rules' location, it is confusing and useless.
15260 (rule_print): Use grammar_rhs_print.
15261 * src/print.c (print_grammar): Use grammar_rules_print.
15262
6b98e4b5
AD
152632002-06-15 Akim Demaille <akim@epita.fr>
15264
15265 Complete and rationalize `useless thing' warnings.
15266
15267 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15268 (symbol_tag_print): New.
15269 Use them everywhere in place of accessing directly the tag member.
15270 * src/gram.h, src/gram.c (rule_print): New.
15271 Use it where a rule used to be printed `by hand'.
15272 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15273 (reduce_grammar_tables): Report the useless rules.
15274 (reduce_print): Useless things are a warning, not an error.
15275 Report it as such.
15276 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15277 (Reduced Automaton, Underivable Rules): Adjust.
15278 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15279 * tests/conflicts.at (Unresolved SR Conflicts)
15280 (Solved SR Conflicts): Adjust.
15281
ee000ba4
AD
152822002-06-15 Akim Demaille <akim@epita.fr>
15283
15284 Let symbols have a location.
15285
15286 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15287 (getsym): Adjust.
15288 Adjust all callers.
15289 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15290 Use location_t, not int.
15291 * src/symtab.c (symbol_check_defined): Take advantage of the
15292 location.
15293 * tests/regression.at (Invalid inputs): Adjust.
15294
8efe435c
AD
152952002-06-15 Akim Demaille <akim@epita.fr>
15296
15297 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15298 (input): Don't try to initialize yylloc here, do it in the
15299 scanner.
15300 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15301 * src/gram.h (rule_t): Change line and action_line into location
15302 and action_location, of location_t type.
15303 Adjust all dependencies.
15304 * src/location.h, src/location.c (empty_location): New.
15305 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15306 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15307 (grammar_current_rule_symbol_append)
15308 (grammar_current_rule_action_append): Expect a location as argument.
15309 * src/reader.c (grammar_midrule_action): Adjust to attach an
15310 action's location as dummy symbol location.
15311 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15312 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15313 the line numbers.
15314
1921f1d7
AD
153152002-06-14 Akim Demaille <akim@epita.fr>
15316
15317 Grammar declarations may be found in the grammar section.
15318
15319 * src/parse-gram.y (rules_or_grammar_declaration): New.
15320 (declarations): Each declaration may end with a semicolon, not
15321 just...
15322 (grammar_declaration): `"%union"'.
15323 (grammar): Branch to rules_or_grammar_declaration.
15324
4515534c
AD
153252002-06-14 Akim Demaille <akim@epita.fr>
15326
15327 * src/main.c (main): Invoke scanner_free.
15328
f958596b
AD
153292002-06-14 Akim Demaille <akim@epita.fr>
15330
15331 * src/output.c (m4_invoke): Extracted from...
15332 (output_skeleton): here.
15333 Free tempfile.
15334
2c569025
AD
153352002-06-14 Akim Demaille <akim@epita.fr>
15336
15337 * src/parse-gram.y (directives, directive, gram)
15338 (grammar_directives, precedence_directives, precedence_directive):
15339 Rename as...
15340 (declarations, declaration, grammar, grammar_declaration)
15341 (precedence_declaration, precedence_declarator): these.
15342 (symbol_declaration): New.
15343
592e8d4d
AD
153442002-06-14 Akim Demaille <akim@epita.fr>
15345
15346 * src/files.c (action_obstack): Remove, unused.
15347 (output_obstack): Remove it, and all its dependencies, as it is no
15348 longer needed.
15349 * src/reader.c (epilogue_set): Build the epilogue in the
15350 muscle_obstack.
15351 * src/output.h, src/output.c (muscle_obstack): Move to...
15352 * src/muscle_tab.h, src/muscle_tab.h: here.
15353 (muscle_init): Initialize muscle_obstack.
15354 (muscle_free): New.
15355 * src/main.c (main): Call it.
15356
0c15323d
AD
153572002-06-14 Akim Demaille <akim@epita.fr>
15358
15359 * src/location.h: New, extracted from...
15360 * src/reader.h: here.
15361 * src/Makefile.am (noinst_HEADERS): Merge into
15362 (bison_SOURCES): this.
15363 Add location.h.
15364 * src/parse-gram.y: Use location_t instead of Bison's.
15365 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15366 Use location_t instead of ints.
15367
e96c9728
AD
153682002-06-14 Akim Demaille <akim@epita.fr>
15369
15370 * data/bison.simple, data/bison.c++: Be sure to restore the
15371 current #line when returning to the skeleton contents after having
15372 exposed the input file's #line.
15373
75d1fe16
AD
153742002-06-12 Akim Demaille <akim@epita.fr>
15375
15376 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15377 eager.
15378 * tests/actions.at (Exotic Dollars): New.
15379
6c35d22c
AD
153802002-06-12 Akim Demaille <akim@epita.fr>
15381
15382 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15383 ['"/] too eagerly.
15384 * tests/input.at (Torturing the Scanner): New.
15385
1d6412ad
AD
153862002-06-11 Akim Demaille <akim@epita.fr>
15387
15388 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15389 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15390 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15391 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15392 * src/reader.c (reader): Use it.
15393
4cdb01db
AD
153942002-06-11 Akim Demaille <akim@epita.fr>
15395
15396 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15397 Adjust all callers.
15398 (scanner_last_string_free): New.
15399
44995b2e
AD
154002002-06-11 Akim Demaille <akim@epita.fr>
15401
15402 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15403 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15404 (last_string, YY_OBS_FREE): New.
15405 Use them when returning an ID.
15406
e9955c83
AD
154072002-06-11 Akim Demaille <akim@epita.fr>
15408
15409 Have Bison grammars parsed by a Bison grammar.
15410
15411 * src/reader.c, src/reader.h (prologue_augment): New.
15412 * src/reader.c (copy_definition): Remove.
15413
15414 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15415 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15416 (grammar_current_rule_prec_set, grammar_current_rule_check)
15417 (grammar_current_rule_symbol_append)
15418 (grammar_current_rule_action_append): Export.
15419 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15420 (symbol_list_action_append): Remove.
15421 Hook the routines from reader.
15422 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15423 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15424
15425 * src/reader.c (read_declarations): Remove, unused.
15426
15427 * src/parse-gram.y: Handle the epilogue.
15428 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15429 (grammar_start_symbol_set): this.
15430 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15431 * src/reader.c (readgram): Remove, unused.
15432 (reader): Adjust to insert eoftoken and axiom where appropriate.
15433
15434 * src/reader.c (copy_dollar): Replace with...
15435 * src/scan-gram.h (handle_dollar): this.
15436 * src/parse-gram.y: Remove `%thong'.
15437
15438 * src/reader.c (copy_at): Replace with...
15439 * src/scan-gram.h (handle_at): this.
15440
15441 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15442 New.
15443
15444 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15445 time being.
15446
15447 * src/reader.h, src/reader.c (grammar_rule_end): New.
15448
15449 * src/parse.y (current_type, current_class): New.
15450 Implement `%nterm', `%token' support.
15451 Merge `%term' into `%token'.
15452 (string_as_id): New.
15453 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15454 type name.
15455
15456 * src/parse-gram.y: Be sure to handle properly the beginning of
15457 rules.
15458
15459 * src/parse-gram.y: Handle %type.
15460 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15461
15462 * src/parse-gram.y: More directives support.
15463 * src/options.c: No longer handle source directives.
15464
15465 * src/parse-gram.y: Fix %output.
15466
15467 * src/parse-gram.y: Handle %union.
15468 Use the prologue locations.
15469 * src/reader.c (parse_union_decl): Remove.
15470
15471 * src/reader.h, src/reader.c (epilogue_set): New.
15472 * src/parse-gram.y: Use it.
15473
15474 * data/bison.simple, data/bison.c++: b4_stype is now either not
15475 defined, then default to int, or to the contents of %union,
15476 without `union' itself.
15477 Adjust.
15478 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15479
15480 * src/output.c (actions_output): Don't output braces, as they are
15481 already handled by the scanner.
15482
15483 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15484 characters to themselves.
15485
15486 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15487 that the epilogue has a proper #line.
15488
15489 * src/parse-gram.y: Handle precedence/associativity.
15490
15491 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15492 a terminal.
15493 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15494 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15495 at all to define terminals that cannot be emitted.
15496
15497 * src/scan-gram.l: Escape M4 characters.
15498
15499 * src/scan-gram.l: Working properly with escapes in user
15500 strings/characters.
15501
15502 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15503 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15504 grammar.
15505 Use more modest sizes, as for the time being the parser does not
15506 release memory, and therefore the process swallows a huge amount
15507 of memory.
15508
15509 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15510 stricter %token grammar.
15511
15512 * src/symtab.h (associativity): Add `undef_assoc'.
15513 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15514 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15515
15516 * tests/regression.at (Invalid %directive): Remove, as it is now
15517 meaningless.
15518 (Invalid inputs): Adjust to the new error messages.
15519 (Token definitions): The new grammar doesn't allow too many
15520 eccentricities.
15521
15522 * src/lex.h, src/lex.c: Remove.
15523 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15524 (copy_character, copy_string2, copy_string, copy_identifier)
15525 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15526 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15527 (parse_action): Remove.
15528 * po/POTFILES.in: Adjust.
15529
2e047461
AD
155302002-06-11 Akim Demaille <akim@epita.fr>
15531
cd05d13c 15532 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
15533 rule's action member: return the action as a string.
15534 Don't require `rule_length' as an argument: compute it.
15535 (grammar_current_rule_symbol_append)
15536 (grammar_current_rule_action_append): New, eved out from
15537 (readgram): here.
15538 Remove `action_flag', `rulelength', unused now.
15539
9af3fbce
AD
155402002-06-11 Akim Demaille <akim@epita.fr>
15541
15542 * src/reader.c (grammar_current_rule_prec_set).
15543 (grammar_current_rule_check): New, eved out from...
15544 (readgram): here.
15545 Remove `xaction', `first_rhs': useless.
15546 * tests/input.at (Type clashes): New.
15547 * tests/existing.at (GNU Cim Grammar): Adjust.
15548
1485e106
AD
155492002-06-11 Akim Demaille <akim@epita.fr>
15550
15551 * src/reader.c (grammar_midrule_action): New, Eved out from
15552 (readgram): here.
15553
da4160c3
AD
155542002-06-11 Akim Demaille <akim@epita.fr>
15555
15556 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15557 New.
15558 (readgram): Use them as replacement of inlined code, crule and
15559 crule1.
15560
f6d0f937
AD
155612002-06-11 Akim Demaille <akim@epita.fr>
15562
15563 * src/reader.c (grammar_end, grammar_symbol_append): New.
15564 (readgram): Use them.
15565 Make the use of `p' as local as possible.
15566
69078d4b
AD
155672002-06-10 Akim Demaille <akim@epita.fr>
15568
15569 GCJ's parser requires the tokens to be defined before the prologue.
15570
15571 * data/bison.simple: Output the token definition before the user's
15572 prologue.
15573 * tests/regression.at (Braces parsing, Duplicate string)
15574 (Mixing %token styles): Check the output from bison.
15575 (Early token definitions): New.
15576
5e424082
AD
155772002-06-10 Akim Demaille <akim@epita.fr>
15578
15579 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15580 assigning twice the same user number to a token, so that we can
15581 use it in...
15582 * src/lex.c (lex): here.
15583 Also use `symbol_class_set' instead of hand written code.
15584 * src/reader.c (parse_assoc_decl): Likewise.
15585
44536b35
AD
155862002-06-10 Akim Demaille <akim@epita.fr>
15587
15588 * src/symtab.c, src/symtab.c (symbol_class_set)
15589 (symbol_user_token_number_set): New.
15590 * src/reader.c (parse_token_decl): Use them.
15591 Use a switch instead of ifs.
15592 Use a single argument.
15593
8b9f2372
AD
155942002-06-10 Akim Demaille <akim@epita.fr>
15595
15596 Remove `%thong' support as it is undocumented, unused, duplicates
15597 `%token's job, and creates useless e-mail traffic with people who
15598 want to know what it is, why it is undocumented, unused, and
15599 duplicates `%token's job.
15600
15601 * src/reader.c (parse_thong_decl): Remove.
15602 * src/options.c (option_table): Remove "thong".
15603 * src/lex.h (tok_thong): Remove.
15604
3ae2b51f
AD
156052002-06-10 Akim Demaille <akim@epita.fr>
15606
15607 * src/symtab.c, src/symtab.c (symbol_type_set)
15608 (symbol_precedence_set): New.
15609 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15610 (value_components_used): Remove, unused.
15611
2f1afb73
AD
156122002-06-09 Akim Demaille <akim@epita.fr>
15613
15614 Move symbols handling code out of the reader.
15615
15616 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15617 (axiom): Move to...
15618 * src/symtab.h, src/symtab.c: here.
15619
15620 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15621 * src/reader.c (startval): Rename as...
15622 * src/symtab.h, src/symtab.c (startsymbol): this.
15623 * src/reader.c: Adjust.
15624
15625 * src/reader.c (symbol_check_defined, symbol_make_alias)
15626 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15627 (token_translations_init)
15628 Move to...
15629 * src/symtab.c: here.
15630 * src/reader.c (packsymbols): Move to...
15631 * src/symtab.h, src/symtab.c (symbols_pack): here.
15632 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15633 argument.
15634
e9bca3ad
AD
156352002-06-03 Akim Demaille <akim@epita.fr>
15636
15637 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15638 then statements.
15639
86eff183
AD
156402002-06-03 Akim Demaille <akim@epita.fr>
15641
15642 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15643 structs with non literals.
15644 * src/scan-skel.l: never-interactive.
15645 * src/conflicts.c (enum conflict_resolution_e): No trailing
15646 comma.
15647 * src/getargs.c (usage): Split long literal strings.
15648 Reported by Hans Aberg.
15649
717be197
AD
156502002-05-28 Akim Demaille <akim@epita.fr>
15651
15652 * data/bison.c++: Use C++ ostreams.
15653 (cdebug_): New member.
15654
670ddffd
AD
156552002-05-28 Akim Demaille <akim@epita.fr>
15656
15657 * src/output.c (output_skeleton): Be sure to allocate enough room
15658 for `/' _and_ for `\0' in full_skeleton.
15659
769b430f
AD
156602002-05-28 Akim Demaille <akim@epita.fr>
15661
15662 * data/bison.c++: Catch up with bison.simple:
15663 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15664 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15665 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15666 and popping traces.
15667
7067cb36
PH
156682002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15669
15670 * src/output.c (output_skeleton): Put an explicit path in front of
15671 the skeleton file name, rather than relying on the -I directory,
15672 to partially alleviate effects of having a skeleton file lying around
15673 in the current directory.
769b430f 15674
4a713ec2
PH
156752002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15676
769b430f 15677 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
15678 obstack_printf should be obstack_fgrow1.
15679
b408954b
AD
156802002-05-26 Akim Demaille <akim@epita.fr>
15681
15682 * src/state.h (state_t): `solved_conflicts' is a new member.
15683 * src/LR0.c (new_state): Set it to 0.
15684 * src/conflicts.h, src/conflicts.c (print_conflicts)
15685 (free_conflicts, solve_conflicts): Rename as...
15686 (conflicts_print, conflicts_free, conflicts_solve): these.
15687 Adjust callers.
15688 * src/conflicts.c (enum conflict_resolution_e)
15689 (solved_conflicts_obstack): New, used by...
15690 (log_resolution): this.
15691 Adjust to attach the conflict resolution to each state.
15692 Complete the description with the precedence/associativity
15693 information.
15694 (resolve_sr_conflict): Adjust.
15695 * src/print.c (print_state): Output its solved_conflicts.
15696 * tests/conflicts.at (Unresolved SR Conflicts)
15697 (Solved SR Conflicts): Exercise --report=all.
15698
a49aecd5
AD
156992002-05-26 Akim Demaille <akim@epita.fr>
15700
15701 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15702 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15703 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15704 (token_number_t, item_number_as_token_number)
15705 (token_number_as_item_number, muscle_insert_token_number_table):
15706 Rename as...
15707 (symbol_number_t, item_number_as_symbol_number)
15708 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15709 these, since it is more appropriate.
15710
5504898e
AD
157112002-05-26 Akim Demaille <akim@epita.fr>
15712
15713 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15714 `Error:' lines.
15715 * data/bison.simple (yystos) [YYDEBUG]: New.
15716 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15717 error recovery.
15718 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15719
ec3bc396
AD
157202002-05-25 Akim Demaille <akim@epita.fr>
15721
15722 * doc/bison.texinfo (Debugging): Split into...
15723 (Tracing): this new section, its former contents, and...
15724 (Understanding): this new section.
15725 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15726 by...
15727 (report_flag): this.
15728 Adjust all dependencies.
15729 (report_args, report_types, report_argmatch): New.
15730 (usage, getargs): Report/support -r, --report.
15731 * src/options.h
15732 (struct option_table_struct): Rename as..,
15733 (struct option_table_s): this.
15734 Rename the `set_flag' member to `flag' to match with getopt_long's
15735 struct.
15736 * src/options.c (option_table): Split verbose into an entry for
15737 %verbose, and another for --verbose.
15738 Support --report/-r, so remove -r from the obsolete --raw.
15739 * src/print.c: Attach full item sets and lookaheads reports to
15740 report_flag instead of trace_flag.
15741 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15742
78df8250
PE
157432002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15744 and Paul Eggert <eggert@twinsun.com>
769b430f 15745
78df8250
PE
15746 * data/bison.simple (yyparse): Correct error handling to conform to
15747 POSIX and yacc. Specifically, after syntax error is discovered,
15748 do not reduce further before shifting the error token.
15749 Clean up the code a bit by removing the labels yyerrdefault,
15750 yyerrhandle, yyerrpop.
15751 * NEWS: Document the above.
15752
c0c9ea05
PH
157532002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15754
15755 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15756 type; it isn't always big enough, since it doesn't necessarily
15757 include non-terminals.
769b430f 15758 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
15759 the latter can be removed.
15760 (yy_token_number_type): Remove, only one use.
15761 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15762 don't use TokenNumberType as element type.
769b430f 15763
c0c9ea05
PH
15764 * tests/regression.at: Modify expected output to agree with change
15765 to yyr1 and yytranslate.
769b430f 15766
6390a83f
FK
157672002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15768
15769 * src/reader.c (parse_action): Use copy_character instead of
15770 obstack_1grow.
15771
db7c8e9a
AD
157722002-05-13 Akim Demaille <akim@epita.fr>
15773
15774 * tests/regression.at (Token definitions): Prototype yylex and
15775 yyerror.
15776
fcc61800
PH
157772002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15778
158c687b 15779 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
15780 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15781 32-bit arithmetic.
15782 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15783
5683e9b2
AD
157842002-05-07 Akim Demaille <akim@epita.fr>
15785
15786 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15787 avoid GCC warnings.
15788
0c2d3f4c
AD
157892002-05-07 Akim Demaille <akim@epita.fr>
15790
15791 Kill GCC warnings.
15792
15793 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15794 over the RHS of each rule.
15795 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15796 * src/state.h (state_t): Member `nitems' is unsigned short.
15797 * src/LR0.c (get_state): Adjust.
15798 * src/reader.c (packgram): Likewise.
15799 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15800 `Type'.
15801 (muscle_insert_int_table): Remove, unused.
15802 (prepare_rules): Remove `max'.
15803
1565b720
AD
158042002-05-06 Akim Demaille <akim@epita.fr>
15805
15806 * src/closure.c (print_firsts): Display of the symbol tags.
15807 (bitmatrix_print): Move to...
15808 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15809 here.
15810 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15811
cfaee611
AD
158122002-05-06 Akim Demaille <akim@epita.fr>
15813
15814 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15815 hash_do_for_each.
15816
458be8e0
AD
158172002-05-06 Akim Demaille <akim@epita.fr>
15818
15819 * src/LR0.c (new_state, get_state): Instead of using the global
15820 `kernel_size' and `kernel_base', have two new arguments:
15821 `core_size' and `core'.
15822 Adjust callers.
15823
a900a624
AD
158242002-05-06 Akim Demaille <akim@epita.fr>
15825
15826 * src/reader.c (packgram): No longer end `ritem' with a 0
15827 sentinel: it is not used.
15828
d4e7d3a1
AD
158292002-05-05 Akim Demaille <akim@epita.fr>
15830
15831 New experimental feature: display the lookaheads in the report and
15832 graph.
15833
15834 * src/print (print_core): When --trace-flag, display the rules
15835 lookaheads.
15836 * src/print_graph.c (print_core): Likewise.
15837 Swap the arguments.
15838 Adjust caller.
15839
39ceb25b
AD
158402002-05-05 Akim Demaille <akim@epita.fr>
15841
15842 * tests/torture.at (Many lookaheads): New test.
15843
5372019f
AD
158442002-05-05 Akim Demaille <akim@epita.fr>
15845
15846 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15847 (GENERATE_MUSCLE_INSERT_TABLE): this.
15848 (output_int_table, output_unsigned_int_table, output_short_table)
15849 (output_token_number_table, output_item_number_table): Replace with...
15850 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15851 (muscle_insert_short_table, muscle_insert_token_number_table)
15852 (muscle_insert_item_number_table): these.
15853 Adjust all callers.
15854 (prepare_tokens): Don't free `translations', since...
15855 * src/reader.h, src/reader.c (grammar_free): do it.
15856 Move to...
15857 * src/gram.h, src/gram.c (grammar_free): here.
15858 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15859 b4_translate_max.
15860
5df5f6d5
AD
158612002-05-05 Akim Demaille <akim@epita.fr>
15862
15863 * src/output.c (output_unsigned_int_table): New.
15864 (prepare_rules): `i' is unsigned.
15865 `prhs', `rline', `r2' are unsigned int.
15866 Rename muscle `rhs_number_max' as `rhs_max'.
15867 Output muscles `prhs_max', `rline_max', and `r2_max'.
15868 Free rline and r1.
15869 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15870 to compute types instead of constant types.
15871 * tests/regression.at (Web2c Actions): Adjust.
15872
b87f8b21
AD
158732002-05-04 Akim Demaille <akim@epita.fr>
15874
15875 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15876 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15877 Adjust dependencies.
15878 * src/output.c (token_definitions_output): Be sure not to output a
15879 `#define 'a'' when fed with `%token 'a' "a"'.
15880 * tests/regression.at (Token definitions): New.
15881
8bb936e4
PE
158822002-05-03 Paul Eggert <eggert@twinsun.com>
15883
15884 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15885 for K&R C.
15886
158872002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15888
15889 * Makefile.am (SUBDIRS): Remove intl.
15890 (EXTRA_DIST): Add config/config.rpath.
15891
53c71a12
AD
158922002-05-03 Akim Demaille <akim@epita.fr>
15893
15894 * data/bison.simple (m4_if): Don't output empty enums.
15895 And actually, output valid enum definitions :(.
15896
289dd0cf
AD
158972002-05-03 Akim Demaille <akim@epita.fr>
15898
15899 * configure.bat: Remove, completely obsolete.
15900 * Makefile.am (EXTRA_DIST): Adjust.
15901 Don't distribute config.rpath...
15902 * config/Makefile.am (EXTRA_DIST): Do it.
15903
db85e524
AD
159042002-05-03 Akim Demaille <akim@epita.fr>
15905
15906 * configure.in (GETTEXT_VERSION): New.
15907 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15908
83ccf991
AD
159092002-05-03 Akim Demaille <akim@epita.fr>
15910
15911 * data/bison.simple (b4_token_enum): New.
15912 (b4_token_defines): Use it to output tokens both as #define and
15913 enums.
15914 Suggested by Paul Eggert.
15915 * src/output.c (token_definitions_output): Don't output spurious
15916 white spaces.
15917
1f418995
AD
159182002-05-03 Akim Demaille <akim@epita.fr>
15919
15920 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15921
45119f04
RA
159222002-05-02 Robert Anisko <robert@lrde.epita.fr>
15923
15924 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15925 Update the stack class, give a try to deque as the default container.
15926
b2d52318
AD
159272002-05-02 Akim Demaille <akim@epita.fr>
15928
15929 * data/bison.simple (yyparse): Do not implement @$ = @1.
15930 (YYLLOC_DEFAULT): Adjust to do it.
15931 * doc/bison.texinfo (Location Default Action): Fix.
15932
3a8b4109
AD
159332002-05-02 Akim Demaille <akim@epita.fr>
15934
15935 * src/reader.c (parse_braces): Merge into...
15936 (parse_action): this.
15937
84614e13
AD
159382002-05-02 Akim Demaille <akim@epita.fr>
15939
15940 * configure.in (ALL_LINGUAS): Remove.
15941 * po/LINGUAS, hr.po: New.
15942
fdbcd8e2
AD
159432002-05-02 Akim Demaille <akim@epita.fr>
15944
15945 Remove the so called hairy (semantic) parsers.
15946
15947 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15948 * src/gram.h, src/gram.c (semantic_parser): Remove.
15949 (rule_t): Remove the guard and guard_line members.
15950 * src/lex.h (token_t): remove tok_guard.
15951 * src/options.c (option_table): Remove %guard and %semantic_parser
15952 support.
15953 * src/output.c, src/output.h (guards_output): Remove.
15954 (prepare): Adjust.
15955 (token_definitions_output): Don't output the `T'
15956 tokens (???).
15957 (output_skeleton): Don't output the guards.
15958 * src/files.c, src/files.c (attrsfile): Remove.
15959 * src/reader.c (symbol_list): Remove the guard and guard_line
15960 members.
15961 Adjust dependencies.
15962 (parse_guard): Remove.
15963 * data/bison.hairy: Remove.
15964 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15965 BISON_HAIRY.
15966
82b6cb3f
AD
159672002-05-02 Akim Demaille <akim@epita.fr>
15968
15969 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15970 (parse_guard): Rename the formal argument `stack_offset' as
15971 `rule_length', which is more readable.
15972 Adjust callers.
15973 (copy_at, copy_dollar): Instead of outputting the hard coded
15974 values of $$, $n and so forth, output invocation to b4_lhs_value,
15975 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
15976 Note: this patch partially drops `semantic-parser' support: it
15977 always does `rule_length - n', where semantic parsers ought to
15978 always use `-n'.
82b6cb3f
AD
15979 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15980 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15981
6cbfbcc5
AD
159822002-05-02 Akim Demaille <akim@epita.fr>
15983
15984 * configure.in (AC_INIT): Bump to 1.49b.
15985 (AM_INIT_AUTOMAKE): Short invocation.
15986
b8548114
AD
159872002-05-02 Akim Demaille <akim@epita.fr>
15988
15989 Version 1.49a.
15990
c20cd1fa
AD
159912002-05-01 Akim Demaille <akim@epita.fr>
15992
15993 * src/skeleton.h: Remove.
15994
8a9566d4
AD
159952002-05-01 Akim Demaille <akim@epita.fr>
15996
15997 * src/skeleton.h: Fix the #endif.
15998 Reported by Magnus Fromreide.
15999
8c6d399a
PE
160002002-04-26 Paul Eggert <eggert@twinsun.com>
16001
16002 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16003 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 16004 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 16005
2b7ed18a
RA
160062002-04-25 Robert Anisko <robert@lrde.epita.fr>
16007
16008 * src/scan-skel.l: Postprocess quadrigraphs.
16009
16010 * src/reader.c (copy_character): New function, used to output
16011 single characters while replacing `[' and `]' with quadrigraphs, to
16012 avoid troubles with M4 quotes.
16013 (copy_comment): Output characters with copy_character.
16014 (read_additionnal_code): Likewise.
16015 (copy_string2): Likewise.
16016 (copy_definition): Likewise.
16017
16018 * tests/calc.at: Exercise M4 quoting.
16019
34a89c50
AD
160202002-04-25 Akim Demaille <akim@epita.fr>
16021
16022 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16023 between `!' and the command.
16024 Reported by Paul Eggert.
16025
0dd1580a
RA
160262002-04-24 Robert Anisko <robert@lrde.epita.fr>
16027
16028 * tests/calc.at: Exercise prologue splitting.
16029
16030 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16031 `b4_post_prologue' instead of `b4_prologue'.
16032
16033 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16034 muscles.
16035 (output): Free pre_prologue_obstack and post_prologue_obstack.
16036 * src/files.h, src/files.c (attrs_obstack): Remove.
16037 (pre_prologue_obstack, post_prologue_obstack): New.
16038 * src/reader.c (copy_definition): Add a parameter to specify the
16039 obstack to fill, instead of using attrs_obstack unconditionally.
16040 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16041 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16042
83c1796f
PE
160432002-04-23 Paul Eggert <eggert@twinsun.com>
16044
16045 * data/bison.simple: Remove unnecessary commentary and white
16046 space differences from 1_29-branch.
16047 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16048
16049 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16050 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16051 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16052 constructors or destructors.
16053
16054 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16055
1207eeac
AD
160562002-04-23 Akim Demaille <akim@epita.fr>
16057
16058 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16059 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16060 location with columns.
16061 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16062 All reported by Paul Eggert.
16063
78ab8f67
AD
160642002-04-22 Akim Demaille <akim@epita.fr>
16065
16066 * src/reduce.c (dump_grammar): Move to...
16067 * src/gram.h, src/gram.c (grammar_dump): here.
16068 Be sure to separate long item numbers.
16069 Don't read the members of a rule's prec if its nil.
16070
133c20e2
AD
160712002-04-22 Akim Demaille <akim@epita.fr>
16072
16073 * src/output.c (table_size, table_grow): New.
16074 (MAXTABLE): Remove, replace uses with table_size.
16075 (pack_vector): Instead of dying when the table is too big, grow it.
16076
9515e8a7
AD
160772002-04-22 Akim Demaille <akim@epita.fr>
16078
16079 * data/bison.simple (yyr1): Its type is that of a token number.
16080 * data/bison.c++ (r1_): Likewise.
16081 * tests/regression.at (Web2c Actions): Adjust.
16082
23c5a174
AD
160832002-04-22 Akim Demaille <akim@epita.fr>
16084
16085 * src/reader.c (token_translations_init): 256 is now the default
16086 value for the error token, i.e., it will be assigned another
16087 number if the user assigned 256 to one of her tokens.
16088 (reader): Don't force 256 to error.
16089 * doc/bison.texinfo (Symbols): Adjust.
16090 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16091 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16092 etc. instead of 10, 20, 30 (which was used to `jump' over error
16093 (256) and undefined (2)).
16094
5fbb0954
AD
160952002-04-22 Akim Demaille <akim@epita.fr>
16096
16097 Propagate more token_number_t.
16098
16099 * src/gram.h (token_number_as_item_number)
16100 (item_number_as_token_number): New.
16101 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16102 Use it to create output_item_number_table and
16103 output_token_number_table.
16104 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16105 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16106 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16107 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16108
4f940944
AD
161092002-04-22 Akim Demaille <akim@epita.fr>
16110
16111 * src/output.h, src/output.c (get_lines_number): Remove.
16112
3ded9a63
AD
161132002-04-19 Akim Demaille <akim@epita.fr>
16114
16115 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16116 as Lex/Flex'.
16117 (Debugging): More details about enabling the debugging features.
16118 (Table of Symbols): Describe $$, $n, @$, and @n.
16119 Suggested by Tim Josling.
16120
e0c471a9
AD
161212002-04-19 Akim Demaille <akim@epita.fr>
16122
16123 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16124
fecc10cd
AD
161252002-04-10 Akim Demaille <akim@epita.fr>
16126
16127 * src/system.h: Rely on HAVE_LIMITS_H.
16128 Suggested by Paul Eggert.
16129
51dec47b
AD
161302002-04-09 Akim Demaille <akim@epita.fr>
16131
16132 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16133 full stderr, and strip it according to the bison options, instead
16134 of composing the error message from different bits.
16135 This makes it easier to check for several error messages.
16136 Adjust all the invocations.
16137 Add an invocation exercising the error token.
16138 Add an invocation demonstrating a stupid error message.
16139 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16140 Adjust the tests.
16141 Error message are for stderr, not stdout.
16142
007a50a4
AD
161432002-04-09 Akim Demaille <akim@epita.fr>
16144
16145 * src/gram.h, src/gram.c (error_token_number): Remove, use
16146 errtoken->number.
16147 * src/reader.c (reader): Don't specify the user token number (2)
16148 for $undefined, as it uselessly prevents using it.
16149 * src/gram.h (token_number_t): Move to...
16150 * src/symtab.h: here.
16151 (state_t.number): Is a token_number_t.
16152 * src/print.c, src/reader.c: Use undeftoken->number instead of
16153 hard coded 2.
16154 (Even though this 2 is not the same as above: the number of the
16155 undeftoken remains being 2, it is its user token number which
16156 might not be 2).
16157 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16158 `user_token_number_max'.
16159 Output `undef_token_number'.
16160 * data/bison.simple, data/bison.c++: Use them.
16161 Be sure to map invalid yylex return values to
16162 `undef_token_number'. This saves us from gratuitous SEGV.
16163
16164 * tests/conflicts.at (Solved SR Conflicts)
16165 (Unresolved SR Conflicts): Adjust.
16166 * tests/regression.at (Web2c Actions): Adjust.
16167
06446ccf
AD
161682002-04-08 Akim Demaille <akim@epita.fr>
16169
16170 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16171 Adding #line.
16172 Remove the duplicate `typedefs'.
16173 (RhsNumberType): Fix the declaration and various other typos.
16174 Use __ofile__.
16175 * data/bison.simple: Use __ofile__.
16176 * src/scan-skel.l: Handle __ofile__.
16177
62a3e4f0
AD
161782002-04-08 Akim Demaille <akim@epita.fr>
16179
16180 * src/gram.h (item_number_t): New, the type of item numbers in
16181 RITEM. Note that it must be able to code symbol numbers as
16182 positive number, and the negation of rule numbers as negative
16183 numbers.
16184 Adjust all dependencies (pretty many).
16185 * src/reduce.c (rule): Remove this `short *' pointer: use
16186 item_number_t.
16187 * src/system.h (MINSHORT, MAXSHORT): Remove.
16188 Include `limits.h'.
16189 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16190 (shortcpy): Remove.
16191 (MAXTABLE): Move to...
16192 * src/output.c (MAXTABLE): here.
16193 (prepare_rules): Use output_int_table to output rhs.
16194 * data/bison.simple, data/bison.c++: Adjust.
16195 * tests/torture.at (Big triangle): Move the limit from 254 to
16196 500.
16197 * tests/regression.at (Web2c Actions): Ajust.
16198
16199 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16200 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16201 passes, but produces negative #line number, once fixed, GCC is
16202 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16203 C), it passes.
16204 * src/state.h (state_h): Code input lines on ints, not shorts.
16205
bb88b0fc
AD
162062002-04-08 Akim Demaille <akim@epita.fr>
16207
16208 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16209 and then the grammar.
16210
9a636f47
AD
162112002-04-08 Akim Demaille <akim@epita.fr>
16212
16213 * src/system.h: No longer using strndup.
16214
680e8701
AD
162152002-04-07 Akim Demaille <akim@epita.fr>
16216
16217 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16218 * src/output.c (output_table_data): Return the longest number.
16219 (prepare_tokens): Output `token_number_max').
16220 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16221 New.
16222 Use them to define yy_token_number_type/TokenNumberType.
16223 Use this type for yytranslate.
16224 * tests/torture.at (Big triangle): Push the limit from 124 to
16225 253.
16226 * tests/regression.at (Web2c Actions): Adjust.
16227
817e9f41
AD
162282002-04-07 Akim Demaille <akim@epita.fr>
16229
16230 * tests/torture.at (Big triangle): New.
16231 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16232 * tests/existing.at: here.
16233
5123689b
AD
162342002-04-07 Akim Demaille <akim@epita.fr>
16235
16236 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16237 nritems.
16238 Adjust dependencies.
16239
f3849179
AD
162402002-04-07 Akim Demaille <akim@epita.fr>
16241
16242 * src/reader.c: Normalize increments to prefix form.
16243
bd02036a
AD
162442002-04-07 Akim Demaille <akim@epita.fr>
16245
16246 * src/reader.c, symtab.c: Remove debugging code.
16247
db8837cb
AD
162482002-04-07 Akim Demaille <akim@epita.fr>
16249
16250 Rename all the `bucket's as `symbol_t'.
16251
16252 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16253 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16254 * src/symtab.c, src/symtab.h (bucket): Rename as...
16255 (symbol_t): this.
16256 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16257 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16258 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16259 (buckets_new, buckets_free, buckets_do): Rename as...
16260 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16261 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16262 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16263 (symbols_new, symbols_free, symbols_do): these.
16264
72a23c97
AD
162652002-04-07 Akim Demaille <akim@epita.fr>
16266
16267 Use lib/hash for the symbol table.
16268
16269 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16270 EOF.
16271 * src/lex.c (lex): Set the `number' member of new terminals.
16272 * src/reader.c (bucket_check_defined, bucket_make_alias)
16273 (bucket_check_alias_consistence, bucket_translation): New.
16274 (reader, grammar_free, readgram, token_translations_init)
16275 (packsymbols): Adjust.
16276 (reader): Number the predefined tokens.
16277 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16278 for predefined tokens.
16279 * src/symtab.h (bucket): Remove all the hash table related
16280 members.
16281 * src/symtab.c (symtab): Replace by...
16282 (bucket_table): this.
16283 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16284 (buckets_new, buckets_do): New.
16285
280a38c3
AD
162862002-04-07 Akim Demaille <akim@epita.fr>
16287
16288 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16289 (start_symbol, max_user_token_number, semantic_parser)
16290 (error_token_number): Initialize.
16291 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16292 Initialize.
16293 (reader): Don't.
16294 (errtoken, eoftoken, undeftoken, axiom): Extern.
16295
03b31c0c
AD
162962002-04-07 Akim Demaille <akim@epita.fr>
16297
16298 * src/gram.h (rule_s): prec and precsym are now pointers
16299 to the bucket giving the priority/associativity.
16300 Member `associativity' removed: useless.
16301 * src/reduce.c, src/conflicts.c: Adjust.
16302
8b3df748
AD
163032002-04-07 Akim Demaille <akim@epita.fr>
16304
16305 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16306 Properly escape the symbols' TAG when outputting them.
16307
e601aa1d
AD
163082002-04-07 Akim Demaille <akim@epita.fr>
16309
16310 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16311
b0299a2e
AD
163122002-04-07 Akim Demaille <akim@epita.fr>
16313
16314 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16315 (LArule): this, which is an array to rule_t*.
16316 * src/print.c, src/conflicts.c: Adjust.
16317
d7e1f00c
AD
163182002-04-07 Akim Demaille <akim@epita.fr>
16319
16320 * src/gram.h (rule_t): Rename `number' as `user_number'.
16321 `number' is a new member.
16322 Adjust dependencies.
16323 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16324
cc9305dd
AD
163252002-04-07 Akim Demaille <akim@epita.fr>
16326
16327 As a result of the previous patch, it is no longer needed
16328 to reorder ritem itself.
16329
16330 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16331
b0940840
AD
163322002-04-07 Akim Demaille <akim@epita.fr>
16333
16334 Be sure never to walk through RITEMS, but use only data related to
16335 the rules themselves. RITEMS should be banished.
16336
16337 * src/output.c (output_token_translations): Rename as...
16338 (prepare_tokens): this.
16339 In addition to `translate', prepare the muscles `tname' and
16340 `toknum', which were handled by...
16341 (output_rule_data): this.
16342 Remove, and move the remainder of its outputs into...
16343 (prepare_rules): this new routines, which also merges content from
16344 (output_gram): this.
16345 (prepare_rules): Be sure never to walk through RITEMS.
16346 (output_stos): Rename as...
16347 (prepare_stos): this.
16348 (output): Always invoke prepare_states, after all, just don't use it
16349 in the output if you don't need it.
16350
643a5994
AD
163512002-04-07 Akim Demaille <akim@epita.fr>
16352
16353 * src/LR0.c (new_state): Display `nstates' as the name of the
16354 newly created state.
16355 Adjust to initialize first_state and last_state if needed.
16356 Be sure to distinguish the initial from the final state.
16357 (new_states): Create the itemset of the initial state, and use
16358 new_state.
16359 * src/closure.c (closure): Now that the initial state has its
16360 items properly set, there is no need for a special case when
16361 creating `ruleset'.
16362
16363 As a result, now the rule 0, reducing to $axiom, is visible in the
16364 outputs. Adjust the test suite.
16365
16366 * tests/conflicts.at (Solved SR Conflicts)
16367 (Unresolved SR Conflicts): Adjust.
16368 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16369 * tests/conflicts.at (S/R in initial): New.
16370
b4c4ccc2
AD
163712002-04-07 Akim Demaille <akim@epita.fr>
16372
16373 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16374 the RHS of the rules.
16375 * src/output.c (output_gram): Likewise.
16376
bba97eb2
AD
163772002-04-07 Akim Demaille <akim@epita.fr>
16378
16379 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16380 bucket.
16381 Adjust all dependencies.
16382 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16383 `number' of the buckets too.
16384 * src/gram.h: Include `symtab.h'.
16385 (associativity): Move to...
16386 * src/symtab.h: here.
16387 No longer include `gram.h'.
16388
c3b407f4
AD
163892002-04-07 Akim Demaille <akim@epita.fr>
16390
16391 * src/gram.h, src/gram.c (rules_rhs_length): New.
16392 (ritem_longest_rhs): Use it.
16393 * src/gram.h (rule_t): `number' is a new member.
16394 * src/reader.c (packgram): Set it.
16395 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16396 the end of `rules', and count them out of `nrules'.
16397 (reduce_output, dump_grammar): Adjust.
16398 * src/print.c (print_grammar): It is no longer needed to check for
16399 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16400 * tests/reduce.at (Reduced Automaton): New test.
16401
11652ab3
AD
164022002-04-07 Akim Demaille <akim@epita.fr>
16403
16404 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16405 lacking `+ 1' to nrules, Bison reported as useless a token if it
16406 was used solely to set the precedence of the last rule...
16407
26b23c1a
AD
164082002-04-07 Akim Demaille <akim@epita.fr>
16409
16410 * data/bison.c++, data/bison.simple: Don't output the current file
16411 name in #line, to avoid useless diffs between two identical
16412 outputs under different names.
16413
18bcecb0
AD
164142002-04-07 Akim Demaille <akim@epita.fr>
16415
16416 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16417 Normalize loops to using `< nrules + 1', not `<= nrules'.
16418
fa770c86
AD
164192002-04-07 Akim Demaille <akim@epita.fr>
16420
16421 * TODO: Update.
16422
d9b739c3
AD
164232002-04-07 Akim Demaille <akim@epita.fr>
16424
16425 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16426 bucket.value as bucket.number.
16427
99013900
AD
164282002-04-07 Akim Demaille <akim@epita.fr>
16429
16430 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16431 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16432 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16433 RHS, instead of being an index in RITEMS.
16434
e966383b
PE
164352002-04-04 Paul Eggert <eggert@twinsun.com>
16436
16437 * doc/bison.texinfo: Update copyright date.
16438 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16439 (Symbols): Warn about running Bison in one character set,
16440 but compiling and/or running in an incompatible one.
16441 Warn about character code 256, too.
16442
164432002-04-03 Paul Eggert <eggert@twinsun.com>
16444
16445 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16446 YYERROR_VERBOSE is nonzero, not whether it is defined.
16447
16448 Merge changes from bison-1_29-branch.
c307773e 16449
8d6c48b9
PE
164502002-03-20 Paul Eggert <eggert@twinsun.com>
16451
16452 Merge fixes from Debian bison_1.34-1.diff.
16453
16454 * configure.in (AC_PREREQ): 2.53.
16455
e53c6322
AD
164562002-03-20 Akim Demaille <akim@epita.fr>
16457
16458 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16459
9ffbeca7
PE
164602002-03-19 Paul Eggert <eggert@twinsun.com>
16461
21db0b2a
PE
16462 * src/bison.simple (YYCOPY): New macro.
16463 (YYSTACK_RELOCATE): Use it.
16464 Remove Type arg; no longer needed. All callers changed.
16465 (yymemcpy): Remove; no longer needed.
16466
9ffbeca7
PE
16467 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16468 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16469
642cb8f8
AD
164702002-03-19 Akim Demaille <akim@epita.fr>
16471
16472 Test and fix the #line outputs.
16473
16474 * tests/atlocal.at (GCC): New.
16475 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 16476 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
16477 (Action synch line, Epilogue synch line): New tests.
16478 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16479 * data/bison.simple, data/bison.c++: Use it.
16480
3c31a486
AD
164812002-03-19 Akim Demaille <akim@epita.fr>
16482
16483 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16484 (Solved SR Conflicts, %expect not enough, %expect right)
16485 (%expect too much): Move to...
16486 * tests/conflicts.at: this new file.
16487
0d8bed56
AD
164882002-03-19 Akim Demaille <akim@epita.fr>
16489
16490 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16491 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16492 that we can move to enums for instance.
16493 * src/output.c (token_definitions_output): Output a list of
16494 `token-name, token-number' instead of the #define.
16495 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16496
9208d17f
AD
164972002-03-14 Akim Demaille <akim@epita.fr>
16498
16499 Use Gettext 0.11.1.
16500
af27eacb
RA
165012002-03-09 Robert Anisko <robert@lrde.epita.fr>
16502
16503 * data/bison.c++: Make the user able to add members to the generated
16504 parser by subclassing.
16505
9101a310
RA
165062002-03-05 Robert Anisko <robert@lrde.epita.fr>
16507
16508 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16509 a character.
16510 Reported by Nicolas Tisserand and Nicolas Burrus.
16511
fff9bf0b
RA
165122002-03-04 Robert Anisko <robert@lrde.epita.fr>
16513
16514 * src/reader.c: Warn about lacking semi-colons, do not complain.
16515
64dba31e
RA
165162002-03-04 Robert Anisko <robert@lrde.epita.fr>
16517
16518 * data/bison.c++: Remove a debug line.
16519
374f5a14
RA
165202002-03-04 Robert Anisko <robert@lrde.epita.fr>
16521
16522 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16523 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16524 provide a default implementation.
16525
bfcf1f3a
AD
165262002-03-04 Akim Demaille <akim@epita.fr>
16527
16528 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16529 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16530 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16531 * tests/semantic.at (Parsing Guards): Similarly.
16532 * src/reader.at (readgram): Complain if the last rule is not ended
16533 with a semi-colon.
16534
65ccf9fc
AD
165352002-03-04 Akim Demaille <akim@epita.fr>
16536
16537 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16538 * src/closure.c: here.
16539 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16540 RTC.
16541 * src/warshall.h, src/warshall.c: Remove.
16542 * tests/sets.at (Broken Closure): Adjust.
16543
d0039cbc
AD
165442002-03-04 Akim Demaille <akim@epita.fr>
16545
16546 * src/output.c (output_skeleton): tempdir is const.
16547 bytes_read is unused.
16548
345cea78
AD
165492002-03-04 Akim Demaille <akim@epita.fr>
16550
16551 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16552 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16553 Update.
16554 From Michael Hayes.
16555
564801f7
AD
165562002-03-04 Akim Demaille <akim@epita.fr>
16557
16558 * src/closure.c (closure): `r' is unused.
16559
e5352bc7
AD
165602002-03-04 Akim Demaille <akim@epita.fr>
16561
16562 * tests/sets.at (Broken Closure): Add the ending `;'.
16563 * src/reader.at (readgram): Complain if a rule is not ended with a
16564 semi-colon.
16565
914feea9
AD
165662002-03-04 Akim Demaille <akim@epita.fr>
16567
16568 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16569 (count_sr_conflicts): Use bitset_count.
16570 * src/reduce.c (inaccessable_symbols): Ditto.
16571 (bits_size): Remove.
16572 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16573
f0250de6
AD
165742002-03-04 Akim Demaille <akim@epita.fr>
16575
16576 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16577 * src/reduce.c: Remove the `bitset_zero's following the
16578 `bitset_create's, as now it is performed by the latter.
16579
ef017502
AD
165802002-03-04 Akim Demaille <akim@epita.fr>
16581
16582 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16583 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16584 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16585 latest sources from Michael.
16586
76514394
AD
165872002-03-04 Akim Demaille <akim@epita.fr>
16588
16589 * src/output.c (output): Don't free the grammar.
16590 * src/reader.c (grammar_free): New.
16591 * src/main.c (main): Call it and don't free symtab here.
16592
55024580
AD
165932002-03-04 Akim Demaille <akim@epita.fr>
16594
16595 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16596 before returning.
16597 Reported by Benoit Perrot.
16598
f9abaa2c
AD
165992002-03-04 Akim Demaille <akim@epita.fr>
16600
16601 Use bitset operations when possible, not loops over bits.
16602
16603 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16604 bitset_or.
16605 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16606 * src/reduce.c (useless_nonterminals): Formatting changes.
16607 * src/warshall.c (TC): Use bitset_or.
16608
0e721e75
AD
166092002-03-04 Akim Demaille <akim@epita.fr>
16610
16611 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16612 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16613 Ditto.
16614
0fb1ffb1
AD
166152002-03-04 Akim Demaille <akim@epita.fr>
16616
16617 * src/lalr.c (F): Now a bitset*.
16618 Adjust all dependencies.
16619
b86796bf
AD
166202002-03-04 Akim Demaille <akim@epita.fr>
16621
16622 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16623 Adjust all dependencies.
16624
602bbf31
AD
166252002-03-04 Akim Demaille <akim@epita.fr>
16626
16627 * src/L0.c, src/LR0.h (nstates): Be size_t.
16628 Adjust comparisons (signed vs unsigned).
16629 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16630 bitset*.
16631 Adjust all dependencies.
16632
d8a0245c
AD
166332002-03-04 Akim Demaille <akim@epita.fr>
16634
16635 * src/closure.c (firsts): Now, also a bitset.
16636 Adjust all dependencies.
16637 (varsetsize): Remove, now unused.
16638 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16639
34ba9743
AD
166402002-03-04 Akim Demaille <akim@epita.fr>
16641
16642 * src/print.c: Convert to use bitset.h, not hand coded iterations
16643 over ints.
16644
ed86e78c
AD
166452002-03-04 Akim Demaille <akim@epita.fr>
16646
16647 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16648
dfdb1797
AD
166492002-03-04 Akim Demaille <akim@epita.fr>
16650
16651 * src/closure.c (ruleset): Be a bitset.
16652 (rulesetsize): Remove.
16653
7086e707
AD
166542002-03-04 Akim Demaille <akim@epita.fr>
16655
16656 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16657 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16658 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16659 * src/closure.c (fderives): Be an array of bitsets.
16660
98254360
RA
166612002-02-28 Robert Anisko <robert@lrde.epita.fr>
16662
16663 * data/bison.c++: Merge the two generated headers. Insert a copyright
16664 notice in each output file.
16665
a75c057f
AD
166662002-02-28 Akim Demaille <akim@epita.fr>
16667
16668 * data/bison.c++: Copy the prologue of bison.simple to fetch
16669 useful M4 definitions, such as b4_header_guard.
16670
06b00abc
AD
166712002-02-25 Akim Demaille <akim@epita.fr>
16672
16673 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
16674 translator friendly scheme for the bgr
16675 copyright notice.
06b00abc 16676
70e7d534
AD
166772002-02-25 Akim Demaille <akim@epita.fr>
16678
16679 * src/output.c (header_output): Remove, now handled completely via
16680 M4.
16681
abe017f6
AD
166822002-02-25 Akim Demaille <akim@epita.fr>
16683
16684 * m4/m4.m4: New, from CVS Autoconf.
16685 * configure.in: Invoke it.
16686 * src/output.c (output_skeleton): Use its result instead of the
16687 hard coded name.
16688
381fb12e
AD
166892002-02-25 Akim Demaille <akim@epita.fr>
16690
16691 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16692 Fileutils 4.1.5.
16693 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16694 * src/output.c (output_skeleton): Use mkstemp to create a real
16695 temporary file.
16696 Move the filling of `skeleton' and its muscle to...
16697 (prepare): here.
16698 (output): Move the definition of the prologue muscle to...
16699 (prepare): here.
16700 * src/system.h (DEFAULT_TMPDIR): New.
16701
6f38107f
PE
167022002-02-14 Paul Eggert <eggert@twinsun.com>
16703
16704 Remove the support for C++ namespace cleanliness; it was
16705 causing more problems than it was curing, since it didn't work
16706 properly on some nonstandard C++ compilers. This can wait
16707 for a proper C++ parser.
16708
16709 * NEWS: Document this.
16710 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16711 of C++, as it's treated like C now.
16712 * src/bison.simple (YYSTD): Remove.
16713 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16714 Treat C++ just like Standard C instead of trying to support
16715 namespace cleanliness.
16716
80cce3da
AD
167172002-02-14 Akim Demaille <akim@epita.fr>
16718
16719 * tests/regression.at (else): Adjust to Andreas' change.
16720
842e8679
AD
167212002-02-14 Akim Demaille <akim@epita.fr>
16722
16723 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16724
4bda3f10
AD
167252002-02-13 Andreas Schwab <schwab@suse.de>
16726
16727 * src/output.c (output_rule_data): Don't output NULL, it might
16728 not be defined yet.
16729
4162fa07 167302002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 16731
4162fa07
RA
16732 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16733 (Copyright notice): Update.
b418ecd8 16734
bd16a5dc
AD
167352002-02-11 Akim Demaille <akim@epita.fr>
16736
16737 * tests/regression.at (%nonassoc and eof): Don't include
16738 nonportable headers.
16739
8d69a1a3
RA
167402002-02-08 Robert Anisko <robert@lrde.epita.fr>
16741
16742 * data/bison.c++: Correct error recovery. Make the user able to
16743 initialize the starting location.
16744
9b2d0677
AD
167452002-02-07 Akim Demaille <akim@epita.fr>
16746
16747 * tests/input.at: New.
16748
69e2658b
RA
167492002-02-07 Robert Anisko <robert@lrde.epita.fr>
16750
16751 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 16752 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
16753 directives around tables only needed for debugging.
16754
4aacc3a7
RA
167552002-02-07 Robert Anisko <robert@lrde.epita.fr>
16756
16757 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16758 C++ parsers.
16759 (yy::b4_name::parse): Use print_.
16760
762a801e
RA
167612002-02-07 Robert Anisko <robert@lrde.epita.fr>
16762
16763 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16764
4bb2bc3f
RA
167652002-02-07 Robert Anisko <robert@lrde.epita.fr>
16766
16767 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16768 C++ parsers.
16769 (yy::b4_name::parse): Build verbose error messages, and use error_.
16770
6b45a3ca
RA
167712002-02-06 Robert Anisko <robert@lrde.epita.fr>
16772
16773 * data/bison.c++: Fix m4 quoting in comments.
16774
50997c6e
RA
167752002-02-06 Robert Anisko <robert@lrde.epita.fr>
16776
16777 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16778 not expanded by m4.
16779
3f3eed27
AD
167802002-02-05 Akim Demaille <akim@epita.fr>
16781
16782 * data/bison.c++: Adjust to the M4 back end.
16783 More is certainly needed.
16784
be2a1a68
AD
167852002-02-05 Akim Demaille <akim@epita.fr>
16786
16787 Give a try to M4 as a back end.
16788
16789 * lib/readpipe.c: New, from wdiff.
16790 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16791 BISON_HAIRY.
16792 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16793 specific values. Now it is m4 that performs the lookup.
16794 * src/parse-skel.y: Remove.
16795 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16796 * src/output.c (actions_output, guards_output)
16797 (token_definitions_output): No longer keeps track of the output
16798 line number, hence remove the second argument.
16799 (guards_output): Check against the guard member of a rule, not the
16800 action member.
16801 Adjust callers.
16802 (output_skeleton): Don't look for the skeleton location, let m4 do
16803 that.
16804 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16805 file will be used.
16806 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16807 (prepare): Given that for the time being changesyntax is not
16808 usable in M4, rename the muscles using `-' to `_'.
16809 Define `defines_flag', `output_parser_name' and `output_header_name'.
16810 * src/output.h (actions_output, guards_output)
16811 (token_definitions_output): Adjust prototypes.
16812 * src/scan-skel.l: Instead of scanning the skeletons, it now
16813 processes the output of m4: `__oline__' and `#output'.
16814 * data/bison.simple: Adjust to be used by M4(sugar).
16815 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16816 to date.
16817 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16818 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16819 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16820 shamelessly stolen from CVS Autoconf.
16821
beda758b
AD
168222002-02-05 Akim Demaille <akim@epita.fr>
16823
16824 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16825 * configure.in: Check for the declarations of free and malloc.
16826 * src/muscle_tab.c: Adjust.
16827
5ece6d43
AD
168282002-02-05 Akim Demaille <akim@epita.fr>
16829
16830 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16831 which have no values.
16832
5bb18f9a
AD
168332002-02-05 Akim Demaille <akim@epita.fr>
16834
16835 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16836 * data/: here.
16837
894dd62e
PE
168382002-01-29 Paul Eggert <eggert@twinsun.com>
16839
16840 * src/bison.simple (YYSIZE_T): Do not define merely because
16841 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16842 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16843
82841af7
AD
168442002-01-27 Akim Demaille <akim@epita.fr>
16845
16846 Fix `%nonassoc and eof'.
16847
16848 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16849 which were not properly copied! Replace
16850 memcpy (res->errs, src->errs, src->nerrs);
16851 with
16852 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16853 !!!
16854 * tests/regression.at (%nonassoc and eof): Adjust to newest
16855 Autotest: `.' is not in the PATH.
16856
318b76e9
AD
168572002-01-27 Akim Demaille <akim@epita.fr>
16858
16859 * tests/sets.at (AT_EXTRACT_SETS): New.
16860 (Nullable): Use it.
16861 (Firsts): New.
16862
30d2f3d5
AD
168632002-01-26 Akim Demaille <akim@epita.fr>
16864
16865 * tests/actions.at, tests/calc.at, tests/headers.at,
16866 * tests/torture.at: Adjust to the newest Autotest which no longer
16867 forces `.' in the PATH.
16868
30f8c395
AD
168692002-01-25 Akim Demaille <akim@epita.fr>
16870
16871 * tests/regression.at (%nonassoc and eof): New.
16872 Suggested by Robert Anisko.
16873
29ae55f1
AD
168742002-01-24 Akim Demaille <akim@epita.fr>
16875
16876 Bison dumps core when trying to complain about broken input files.
16877 Reported by Cris van Pelt.
16878
16879 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16880 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16881 into...
16882 (Invalid inputs): Strengthen: exercise parse_percent_token.
16883
2b548aa6
RA
168842002-01-24 Robert Anisko <robert.anisko@epita.fr>
16885
16886 * src/Makefile.am: Add bison.c++.
16887 * src/bison.c++: New skeleton.
16888
bb0146c2
AD
168892002-01-21 Paolo Bonzini <bonzini@gnu.org>
16890
16891 * po/it.po: New.
16892
bec30531
AD
168932002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16894
16895 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16896
fc6edc45
MA
168972002-01-20 Marc Autret <marc@gnu.org>
16898
16899 * src/files.c (compute_output_file_names): Fix
16900
5e5d5415
MA
169012002-01-20 Marc Autret <marc@gnu.org>
16902
16903 * tests/output.at: New test.
16904 * src/files.c (compute_base_names): Don't map extensions when
16905 the YACC flag is set, use defaults.
16906 Reported by Evgeny Stambulchik.
16907
44ea3fbd
MA
169082002-01-20 Marc Autret <marc@gnu.org>
16909
ba0fe3c7
PE
16910 * src/system.h: Need to define __attribute__ away for non-GCC
16911 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
16912 Suggested by Albert Chin-A-Young.
16913
338963d1
TVH
169142002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16915
16916 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16917 canonical definition.
16918 * src/system.h: Use the canonical definition for PARAMS (avoids
16919 a conflict with the macro from lib/hash.h).
16920
c57b2479
AD
169212002-01-11 Akim Demaille <akim@epita.fr>
16922
16923 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 16924 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 16925
b85810ae
AD
169262002-01-09 Akim Demaille <akim@epita.fr>
16927
16928 * src/files.c, src/files.h (output_infix): New.
16929 (tab_extension): Remove.
16930 (compute_base_names): Compute the former, drop the latter.
16931 * src/output.c (prepare): Insert the muscles `output-infix', and
16932 `output-suffix'.
16933 * src/parse-skel.y (string, string.1): New.
16934 (section.header): Use it.
16935 (section.yacc): Remove.
16936 (prefix): Remove too.
16937 * src/scan-skel.l: Adjust.
16938 * src/bison.simple, src/bison.hairy: Adjust.
16939
cae60122
AD
169402002-01-09 Akim Demaille <akim@epita.fr>
16941
16942 * configure.in (WERROR_CFLAGS): Compute it.
16943 * src/Makefile.am (CFLAGS): Pass it.
16944 * tests/atlocal.in (CFLAGS): Idem.
16945 * src/files.c: Fix a few warnings.
16946 (get_extension_index): Remove, unused.
16947
ae404801
AD
169482002-01-08 Akim Demaille <akim@epita.fr>
16949
16950 * src/getargs.c (AS_FILE_NAME): New.
16951 (getargs): Use it to convert DOSish file names.
16952 * src/files.c (base_name): Rename as full_base_name to avoid
16953 clashes with `base_name ()'.
16954 (filename_split): New.
16955 (compute_base_names): N-th rewrite, using filename_split.
16956
22312b71
AD
169572002-01-08 Akim Demaille <akim@epita.fr>
16958
16959 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16960 New, stolen from the Fileutils 4.1.
16961 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16962 * configure.in: Check for the presence of memrchr, and of its
16963 prototype.
16964
a67cef01
TVH
169652002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16966
16967 * lib/hash.h (__P): Added definition for this macro.
16968 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16969 BUILT_SOURCES, to ensure they are generated first.
16970 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16971 %error-verbose to allow bootstrapping with bison 1.30x.
16972
2b25d624
AD
169732002-01-06 Akim Demaille <akim@epita.fr>
16974
16975 * src/reader.c (parse_braces): Don't fetch the next char, the
16976 convention is to fetch on entry.
16977 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16978 'switch' without a following semicolon.
16979 * tests/regression.at (braces parsing): New.
16980
3460813b
AD
169812002-01-06 Akim Demaille <akim@epita.fr>
16982
16983 Bison is dead wrong in its RR conflict reports.
16984
16985 * tests/torture.at (GNU Cim Grammar): New.
16986 * src/conflicts.c (count_rr_conflicts): Fix.
16987
73784c64
AD
169882002-01-06 Akim Demaille <akim@epita.fr>
16989
16990 Creating package.m4 from configure.ac causes too many problems.
16991
16992 * tests/Makefile.am (package.m4): Create it by hand,
16993 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16994
25d81090
AD
169952002-01-06 Akim Demaille <akim@epita.fr>
16996
16997 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16998 skeleton.h.
16999
a9b8959e
PE
170002002-01-04 Paul Eggert <eggert@twinsun.com>
17001
17002 * doc/bison.texinfo (Debugging):
17003 Remove YYSTDERR; it's no longer defined or used.
17004 Also, s/cstdio.h/cstdio/.
17005
25d81090
AD
170062002-01-03 Akim Demaille <akim@epita.fr>
17007
17008 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17009
1109455c
AD
170102002-01-03 Akim Demaille <akim@epita.fr>
17011
17012 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17013 tracing code to --trace, wait for a better --trace option, with
17014 args.
17015
7ea5e977
AD
170162002-01-03 Akim Demaille <akim@epita.fr>
17017
17018 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17019 The ISO C++ standard is extremely clear about it: stderr is
17020 considered a macro, not a regular symbol (see table 94 `Header
17021 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17022 Therefore std:: does not apply to it. It still does with fprintf.
17023 Also, s/cstdio.h/cstdio/.
17024
fab5b110
AD
170252002-01-03 Akim Demaille <akim@epita.fr>
17026
17027 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17028 for non system headers.
17029
aed7fd9b
AD
170302002-01-02 Akim Demaille <akim@epita.fr>
17031
17032 Equip the skeleton chain with location tracking, runtime trace,
17033 pure parser and scanner.
17034
17035 * src/parse-skel.y: Request a pure parser, locations, and prefix
17036 renaming.
17037 (%union): Having several members with the same type does not help
17038 type mismatches, simplify.
17039 (YYPRINT, yyprint): New.
17040 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17041 (skel_error): this.
17042 Handle locations.
17043 * src/scan-skel.l: Adjust to these changes.
17044 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17045 (LOCATION_PRINT, skel_control_t): New.
17046
24fad99e
AD
170472001-12-30 Akim Demaille <akim@epita.fr>
17048
17049 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17050 replace `gb' with BLANKS.
17051 * src/scan-skel.l: Adjust.
17052
a4b36db4
AD
170532001-12-30 Akim Demaille <akim@epita.fr>
17054
17055 * src/system.h: We don't need nor want bcopy.
17056 Throw away MS-DOS crap: we don't need getpid.
17057 * configure.in: We don't need strndup. It was even causing
17058 problems: because Flex includes the headers *before* us,
17059 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17060 not visible.
17061 * lib/xstrndup.c: New.
17062 * src/scan-skel.l: Use it.
17063 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17064 * src/parse-skel.y: Use %directives instead of #defines.
17065
1239777d
AD
170662001-12-30 Akim Demaille <akim@epita.fr>
17067
17068 * src/skeleton.h: New.
17069 * src/output.c (output_parser, output_master_parser): Remove, dead
17070 code.
17071 * src/output.h (get_lines_number, actions_output, guards_output)
17072 (token_definitions_output): Prototype them.
17073 * src/parse-skel.y: Add the license notice.
17074 Include output.h and skeleton.h.
17075 (process_skeleton): Returns void, and takes a single parameter.
17076 * src/scan-skel.l: Add the license notice.
17077 Include skeleton.h.
17078 Don't use %option yylineno: it seems that then Flex imagines
17079 REJECT has been used, and therefore it won't reallocate its
17080 buffers (which makes no other sense to me than a bug). It results
17081 in warnings for `unused: yy_flex_realloc'.
17082
9b3add5b
RA
170832001-12-30 Robert Anisko <robert.anisko@epita.fr>
17084
17085 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17086 (MUSCLE_INSERT_PREFIX): ...to there.
17087 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17088 (MUSCLE_INSERT_PREFIX): Move from here...
17089
17090 * src/bison.hairy: Add a section directive. Put braces around muscle
17091 names. This parser skeleton is still broken, but Bison should not
17092 choke on a bad muscle 'syntax'.
17093 * src/bison.simple: Add a section directive. Put braces around muscle
17094 names.
17095
17096 * src/files.h (strsuffix, stringappend): Add declarations.
17097 (tab_extension): Add declaration.
17098 (short_base_name): Add declaration.
17099
17100 * src/files.c (strsuffix, stringappend): No longer static. These
17101 functions are used in the skeleton parser.
17102 (tab_extension): New.
17103 (compute_base_names): Use the computations done in this function
fab5b110 17104 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
17105 names.
17106 (short_base_name): No longer static.
17107
17108 * src/output.c (output_skeleton): New.
17109 (output): Disable call to output_master_parser, and give a try to
17110 a new skeleton handling system.
17111 (guards_output, actions_output): No longer static.
17112 (token_definitions_output, get_lines_number): No longer static.
17113
17114 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17115
fab5b110 17116 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
17117 parse-skel.y.
17118
17119 * src/parse-skel.y: New file.
17120 * src/scan-skel.l: New file.
17121
b5b61c61
AD
171222001-12-29 Akim Demaille <akim@epita.fr>
17123
17124 %name-prefix is broken.
17125
17126 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17127 Adjust all dependencies.
17128 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17129 %name-prefix.
17130
17131 Renaming yylval but not yylloc is not consistent. Now we do.
17132
17133 * src/bison.simple: Prefix yylloc if used.
17134 * doc/bison.texinfo (Decl Summary): Document that.
17135
8c9a50be
AD
171362001-12-29 Akim Demaille <akim@epita.fr>
17137
17138 * doc/bison.texinfo: Promote `%long-directive' over
17139 `%long_directive'.
17140 Remove all references to fixed-output-files, yacc is enough.
17141
d99361e6
AD
171422001-12-29 Akim Demaille <akim@epita.fr>
17143
17144 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17145 user prologue. These are defaults.
17146 * tests/actions.at (Mid-rule actions): Make sure the user can
17147 define YYDEBUG and YYERROR_VERBOSE.
17148
b9cecb91
AD
171492001-12-29 Akim Demaille <akim@epita.fr>
17150
17151 * src/output.c (header_output): Don't forget to export YYLTYPE and
17152 yylloc.
17153 * tests/headers.at (export YYLTYPE): New, make sure it does.
17154 * tests/regression.at (%union and --defines, Invalid CPP headers):
17155 Move to...
17156 * tests/headers.at: here.
17157
aea13e97
AD
171582001-12-29 Akim Demaille <akim@epita.fr>
17159
17160 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17161
931394cb
AD
171622001-12-29 Akim Demaille <akim@epita.fr>
17163
17164 * tests/actions.at (Mid-rule actions): Output on a single line
17165 instead of several.
17166
704a47c4
AD
171672001-12-29 Akim Demaille <akim@epita.fr>
17168
17169 * doc/bison.texinfo: Formatting changes.
17170
091e20bb
AD
171712001-12-29 Akim Demaille <akim@epita.fr>
17172
17173 Don't store the token defs in a muscle, just be ready to output it
17174 on command. Now possible via `symbols'. Fixes a memory leak.
17175
17176 * src/output.c (token_definitions_output): New.
17177 (output_parser, header_output): Use it.
17178 * src/reader.c (symbols_save): Remove.
17179
cce71710
AD
171802001-12-29 Akim Demaille <akim@epita.fr>
17181
17182 * src/bison.simple: Do not provide a default for YYSTYPE and
17183 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17184 default.
17185
82c035a8
AD
171862001-12-29 Akim Demaille <akim@epita.fr>
17187
17188 Mid-rule actions are simply... ignored!
17189
17190 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17191 the empty-rule associated to the dummy symbol, not to the host
17192 rule.
17193 * tests/actions.at (Mid-rule actions): New.
17194
8419d367
AD
171952001-12-29 Akim Demaille <akim@epita.fr>
17196
17197 Memory leak.
17198
17199 * src/reader.c (reader): Free grammar.
17200
375d5806
AD
172012001-12-29 Akim Demaille <akim@epita.fr>
17202
17203 Memory leak.
17204
17205 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17206 since it allocates it for each state, although only one is needed.
17207 (allocate_storage): Do it here.
17208
f51cb8ff
AD
172092001-12-29 Akim Demaille <akim@epita.fr>
17210
17211 * src/options.h, src/options.c (create_long_option_table): Rename
17212 as...
17213 (long_option_table_new): this, with a clearer prototype.
17214 (percent_table): Remove, unused,
17215 * src/getargs.c (getargs): Adjust.
17216
29e88316
AD
172172001-12-29 Akim Demaille <akim@epita.fr>
17218
17219 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17220 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17221 as states.
17222
b9f71f19
AD
172232001-12-29 Akim Demaille <akim@epita.fr>
17224
17225 * src/lalr.c (build_relations): Rename `states' as `states1'.
17226 Sorry, I don't understand exactly what it is, no better name...
17227
1a2b5d37
AD
172282001-12-29 Akim Demaille <akim@epita.fr>
17229
17230 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17231 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17232 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17233 as rules.
17234
1cca533e
AD
172352001-12-29 Akim Demaille <akim@epita.fr>
17236
17237 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17238 ago.
17239
c03ae966
AD
172402001-12-29 Akim Demaille <akim@epita.fr>
17241
17242 * src/reader.c, src/reader.h (user_toknums): Remove.
17243 Adjust all users to use symbols[i]->user_token_number.
17244
5a670b1e
AD
172452001-12-29 Akim Demaille <akim@epita.fr>
17246
17247 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17248 Adjust all users to use symbols[i]->prec or ->assoc.
17249
ad949da9
AD
172502001-12-29 Akim Demaille <akim@epita.fr>
17251
17252 * src/reader.c, src/reader.h (tags): Remove.
17253 Adjust all users to use symbols[i]->tag.
17254
0e78e603
AD
172552001-12-29 Akim Demaille <akim@epita.fr>
17256
17257 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17258 and rule_table.
17259 * src/reader.c (packsymbols): Fill this table.
17260 Drop sprec.
17261 * src/conflicts.c (resolve_sr_conflict): Adjust.
17262 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17263 single table.
17264 Use symbols[i]->tag instead of tags[i].
17265
213e640e
AD
172662001-12-29 Akim Demaille <akim@epita.fr>
17267
17268 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17269 In addition, put a comment in there, to replace...
17270 * tests/regression.at (%union and C comments): Remove.
17271
e7b8bef1
AD
172722001-12-29 Akim Demaille <akim@epita.fr>
17273
17274 * tests/regression.at (Web2c Actions): Blindly move the actual
17275 output as expected output. The contents *seem* right to me, but I
17276 can't pretend reading perfectly parser tables... Nonetheless, all
17277 the other tests pass correctly, the table look OK, even though the
17278 presence of `$axiom' is to be noted: AFAICS it is useless (but
17279 harmless).
17280
b68e7744
AD
172812001-12-29 Akim Demaille <akim@epita.fr>
17282
17283 * src/reader.c (readgram): Don't add the rule 0 if there were no
17284 rules read. In other words, add it _after_ having performed
17285 grammar sanity checks.
17286 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17287
78d5bae9
AD
172882001-12-29 Akim Demaille <akim@epita.fr>
17289
17290 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17291 visible, and some states have now a different number.
17292
ff442794
AD
172932001-12-29 Akim Demaille <akim@epita.fr>
17294
17295 * src/reader.c (readgram): Bind the initial rule's lineno to that
17296 of the first rule.
17297 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17298 (Solved SR Conflicts): Adjust rule 0's line number.
17299
610ab194
AD
173002001-12-29 Akim Demaille <akim@epita.fr>
17301
17302 Fix the `GAWK Grammar' failure.
17303
17304 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17305 the reductions of the first state which was mistakenly confused
17306 with the final state because precisely final_state was initialized
17307 to 0.
17308 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17309 now noticed by Bison.
17310 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17311 have a reduction on $default.
17312
29d29c8f
AD
173132001-12-29 Akim Demaille <akim@epita.fr>
17314
17315 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17316 rule line numbers.
17317 * src/closure.c (print_closure): Likewise.
17318 * src/derives.c (print_derives): Likewise.
17319 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17320 now.
17321
7c6b64d0
AD
173222001-12-29 Akim Demaille <akim@epita.fr>
17323
17324 * src/lalr.c (lookaheads_print): New.
17325 (lalr): Call it when --trace-flag.
17326 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17327 are dumped.
17328
3d4daee3
AD
173292001-12-29 Akim Demaille <akim@epita.fr>
17330
17331 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17332 when walking through ritem, even via rule->rhs.
17333 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17334 (useful_production, useless_nonterminals): Likewise.
17335 (reduce_grammar_tables): Likewise, plus update nritems.
17336 * src/nullable.c (set_nullable): Likewise.
17337 * src/lalr.c (build_relations): Likewise.
17338 * tests/sets.at (Nullable): Adjust.
17339 Fortunately, now, the $axiom is no longer nullable.
17340
9e7f6bbd
AD
173412001-12-29 Akim Demaille <akim@epita.fr>
17342
17343 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17344 the 0-sentinel.
17345 * src/gram.c (ritem_longest_rhs): Likewise.
17346 * src/reduce.c (nonterminals_reduce): Likewise.
17347 * src/print_graph.c (print_graph): Likewise.
17348 * src/output.c (output_rule_data): Likewise.
17349 * src/nullable.c (set_nullable): Likewise.
17350
255ef638
AD
173512001-12-29 Akim Demaille <akim@epita.fr>
17352
17353 * src/output.c: Comment changes.
17354
0d8a7363
AD
173552001-12-27 Paul Eggert <eggert@twinsun.com>
17356
17357 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17358 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17359 Sparc, as they were causing more porting problems than the
17360 (minor) performance improvement was worth.
17361
17362 Also, catch up with 1.31's YYSTD.
17363
3db472b9
AD
173642001-12-27 Akim Demaille <akim@epita.fr>
17365
17366 * src/output.c (output_gram): Rely on nritems, not the
17367 0-sentinel. See below.
17368 Use -1 as separator, not 0.
17369 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17370 Rely on -1 as separator in yyrhs, instead of 0.
17371 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17372 twice `Now at end of input', therefore there are two lines less to
17373 expect.
17374
b365aa05
AD
173752001-12-27 Akim Demaille <akim@epita.fr>
17376
17377 * tests/regression.at (Unresolved SR Conflicts):
17378 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17379 below.
17380
30171f79
AD
173812001-12-27 Akim Demaille <akim@epita.fr>
17382
17383 * src/LR0.c (new_state): Recognize the final state by the fact it
17384 is reached by eoftoken.
17385 (insert_start_shifting_state, insert_eof_shifting_state)
17386 (insert_accepting_state, augment_automaton): Remove, since now
17387 these states are automatically computed from the initial state.
17388 (generate_states): Adjust.
17389 * src/print.c: When reporting a rule number to the user, substract
17390 1, so that the axiom rule is rule 0, and the first user rule is 1.
17391 * src/reduce.c: Likewise.
17392 * src/print_graph.c (print_core): For the time being, just as for
17393 the report, depend upon --trace-flags to dump the full set of
17394 items.
17395 * src/reader.c (readgram): Once the grammar read, insert the rule
17396 0: `$axiom: START-SYMBOL $'.
17397 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17398 number of the states has changed (the final state is no longer
17399 necessarily the last), catch up.
17400
75142d45
AD
174012001-12-27 Akim Demaille <akim@epita.fr>
17402
17403 Try to make the use of the eoftoken valid. Given that its value
17404 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17405 is used instead of > 0 where appropriate, (ii), depend upon nritems
17406 instead of the 0-sentinel.
17407
17408 * src/gram.h, src/gram.c (nritems): New.
17409 Expected to be duplication of nitems, but for the time being...
17410 * src/reader.c (packgram): Assert nritems and nitems are equal.
17411 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17412 * src/closure.c (print_closure, print_fderives): Likewise.
17413 * src/gram.c (ritem_print): Likewise.
17414 * src/print.c (print_core, print_grammar): Likewise.
17415 * src/print_graph.c: Likewise.
17416
b7c49edf
AD
174172001-12-27 Akim Demaille <akim@epita.fr>
17418
17419 * src/main.c (main): If there are complains after grammar
17420 reductions, then output the report anyway if requested, then die.
17421 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17422 * src/reader.c (eoftoken): New.
17423 (parse_token_decl): If the token being defined has value `0', it
17424 is the eoftoken.
17425 (packsymbols): No longer hack `tags' to insert `$' by hand.
17426 Be sure to preserve the value of the eoftoken.
17427 (reader): Make sure eoftoken is defined.
17428 Initialize nsyms to 0: now eoftoken is created just like the others.
17429 * src/print.c (print_grammar): Don't special case the eof token.
17430 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17431 lie anyway, albeit pleasant.
17432 * tests/calc.at: Exercise error messages with eoftoken.
17433 Change the grammar so that empty input is invalid.
17434 Adjust expectations.
17435 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17436
ec2da99f
AD
174372001-12-27 Akim Demaille <akim@epita.fr>
17438
17439 * configure.in: Check the protos of strchr ans strspn.
17440 Replace strchr if needed.
17441 * src/system.h: Provide the protos of strchr, strspn and memchr if
17442 missing.
17443 * lib/strchr.c: New.
17444 * src/reader.c (symbols_save): Use strchr.
17445
8adfa272
AD
174462001-12-27 Akim Demaille <akim@epita.fr>
17447
17448 * src/print.c, src/print_graph.c (escape): New.
17449 Use it to quote the TAGS outputs.
17450 * src/print_graph.c (print_state): Now errors are in red, and
17451 reductions in green.
17452 Prefer high to wide: output the state number on a line of its own.
17453
80dac38c
AD
174542001-12-27 Akim Demaille <akim@epita.fr>
17455
17456 * src/state.h, src/state.c (reductions_new): New.
17457 * src/LR0.c (set_state_table): Let all the states have a
17458 `reductions', even if reduced to 0.
17459 (save_reductions): Adjust.
17460 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17461 * src/print.c (print_reductions, print_actions): Adjust.
17462 * src/output.c (action_row): Adjust.
17463
2cec70b9
AD
174642001-12-27 Akim Demaille <akim@epita.fr>
17465
17466 * src/state.h, src/state.c (errs_new, errs_dup): New.
17467 * src/LR0.c (set_state_table): Let all the states have an errs,
17468 even if reduced to 0.
17469 * src/print.c (print_errs, print_reductions): Adjust.
17470 * src/output.c (output_actions, action_row): Adjust.
17471 * src/conflicts.c (resolve_sr_conflict): Adjust.
17472
13ca549a
AD
174732001-12-27 Akim Demaille <akim@epita.fr>
17474
17475 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17476
5092aba5
AD
174772001-12-27 Akim Demaille <akim@epita.fr>
17478
17479 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17480 * src/print.c: here.
17481 (lookaheadset, shiftset): New, used as additional storage by
17482 print_reductions.
17483 (print_results): Adjust.
17484 (print_shifts, print_gotos, print_errs): New, extracted from...
17485 (print_actions): here.
17486 * src/print_graph.c (print_actions): Remove dead code.
17487
11e2beca
AD
174882001-12-27 Akim Demaille <akim@epita.fr>
17489
17490 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17491 `$n' and `@n'.
17492
dac3c910
AD
174932001-12-27 Akim Demaille <akim@epita.fr>
17494
17495 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17496 (build_relations): Adjust.
17497
d0b0fefa
AD
174982001-12-27 Akim Demaille <akim@epita.fr>
17499
17500 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17501 duplication.
17502
adc8c848
AD
175032001-12-27 Akim Demaille <akim@epita.fr>
17504
17505 * src/reader.c (packgram): Catch nitems overflows.
17506
14d293ac
AD
175072001-12-27 Akim Demaille <akim@epita.fr>
17508
17509 * src/files.c, src/files.h (guard_obstack): Remove.
17510 * src/output.c (output): Adjust.
17511 * src/reader.c (parse_braces): New, factoring...
17512 (copy_action, copy_guard): these two which are renamed as...
17513 (parse_action, parse_guard): these.
17514 As a voluntary consequence, using braces around guards is now
17515 mandatory.
17516
f499b062
AD
175172001-12-27 Akim Demaille <akim@epita.fr>
17518
17519 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17520 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17521 members.
17522 (symbol_list_new): Adjust.
17523 (copy_action): action_line is the first line, not the last.
17524 (copy_guard): Just as for actions, store the `action' only, not
17525 the switch/case/break flesh.
17526 Don't parse the user action that might follow the guard, let...
17527 (readgram): do it, i.e., now, there can be an action after a
17528 guard.
17529 In other words the guard is just explicitly optional.
17530 (packgram): Adjust.
17531 * src/output.c (guards_output): New.
17532 (output_parser): Call it when needed.
17533 (output): Also free the guard and attrs obstacks.
17534 * src/files.c, src/files.h (obstack_save): Remove.
17535 (output_files): Remove.
17536 As a result, if one needs the former `.act' file, using an
17537 appropriate skeleton which requires actions and guards is now
17538 required.
17539 * src/main.c (main): Adjust.
17540 * tests/semantic.at: New.
17541 * tests/regression.at: Use `input.y' as input file name.
17542 Avoid 8+3 problems by requiring input.c when the test needs the
17543 parser.
17544
d945f5cd
AD
175452001-12-27 Akim Demaille <akim@epita.fr>
17546
17547 * src/reader.c (symbol_list_new): Be sure to initialize all the
17548 fields.
17549
d200e455
AD
175502001-12-27 Akim Demaille <akim@epita.fr>
17551
17552 All the hacks using a final pseudo state are now useless.
17553
17554 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17555 * src/lalr.c (nLA): New.
17556 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17557 instead of lookaheadsp from the pseudo state (nstate + 1).
17558
f9507c28
AD
175592001-12-27 Akim Demaille <akim@epita.fr>
17560
17561 * src/output.c (action_row, token_actions): Use a state_t instead
17562 of a integer, and nlookaheads instead of the following state's
17563 lookaheadsp.
17564
065fbd27
AD
175652001-12-27 Akim Demaille <akim@epita.fr>
17566
17567 * src/conflicts.c (log_resolution, flush_shift)
17568 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17569 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17570 (conflicts_print, print_reductions): Use a state_t instead of an
17571 integer when referring to a state.
17572 As much as possible, depend upon nlookaheads, instead of the
17573 `lookaheadsp' member of the following state (since lookaheads of
17574 successive states are successive, the difference between state n + 1
17575 and n served as the number of lookaheads for state n).
17576 * src/lalr.c (add_lookback_edge): Likewise.
17577 * src/print.c (print_core, print_actions, print_state)
17578 (print_results): Likewise.
17579 * src/print_graph.c (print_core, print_actions, print_state)
17580 (print_graph): Likewise.
17581 * src/conflicts.h: Adjust.
17582
1b177bd7
AD
175832001-12-27 Akim Demaille <akim@epita.fr>
17584
17585 * src/bison.hairy: Formatting/comment changes.
17586 ANSIfy.
17587 Remove `register' indications.
17588 Add plenty of `static'.
17589
7742ddeb
AD
175902001-12-27 Akim Demaille <akim@epita.fr>
17591
17592 * src/output.c (prepare): Drop the muscle `ntbase' which
17593 duplicates ntokens.
17594 * src/bison.simple: Formatting/comment changes.
17595 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17596 is an undocumented synonym.
17597
1fa14068
AD
175982001-12-22 Akim Demaille <akim@epita.fr>
17599
17600 * src/output.c (output_table_data): Change the prototype to use
17601 `int' for array ranges: some invocations do pass an int, not a
17602 short.
17603 Reported by Wayne Green.
17604
b9752825
AD
176052001-12-22 Akim Demaille <akim@epita.fr>
17606
17607 Some actions of web2c.y are improperly triggered.
17608 Reported by Mike Castle.
17609
17610 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17611 * tests/regression.at (Web2c): Rename as...
17612 (Web2c Report): this.
17613 (Web2c Actions): New.
17614
776209d6
AD
176152001-12-22 Akim Demaille <akim@epita.fr>
17616
17617 Reductions in web2c.y are improperly reported.
17618 Reported by Mike Castle.
17619
17620 * src/conflicts.c (print_reductions): Fix.
17621 * tests/regression.at (Web2c): New.
17622
275fc3ad
AD
176232001-12-18 Akim Demaille <akim@epita.fr>
17624
17625 Some host fail on `assert (!"foo")', which expands to
17626 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17627 Reported by Nelson Beebee.
17628
17629 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17630 `#define it_succeeded 0' and `assert (it_succeeded)'.
17631
897668ee
MA
176322001-12-17 Marc Autret <autret_m@epita.fr>
17633
17634 * src/bison.simple: Don't hard code the skeleton line and filename.
17635 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17636 New line counter 'skeleton_line' (skeleton-line muscle).
17637
ab3399e0
PE
176382001-12-17 Paul Eggert <eggert@twinsun.com>
17639
17640 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17641 YYDEBUG must be defined to a nonzero value.
17642
17643 * src/bison.simple (yytname): Do not assume that the user defines
17644 YYDEBUG to a properly parenthesized expression.
17645
3877f72b
AD
176462001-12-17 Akim Demaille <akim@epita.fr>
17647
17648 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17649 nlookaheads is a new member.
17650 Adjust all users.
17651 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17652 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17653 state.
776209d6 17654
331dbc1b
AD
176552001-12-17 Akim Demaille <akim@epita.fr>
17656
17657 * src/files.h, src/files.c (open_files, close_files): Remove.
17658 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17659 let...
17660 * src/reader.c (reader): Do it.
776209d6 17661
be750e4c
AD
176622001-12-17 Akim Demaille <akim@epita.fr>
17663
17664 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 17665
709ae8c6
AD
176662001-12-17 Akim Demaille <akim@epita.fr>
17667
17668 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17669 (flush_reduce): New.
17670 (resolve_sr_conflict): Adjust.
776209d6 17671
f87685c3
AD
176722001-12-17 Akim Demaille <akim@epita.fr>
17673
17674 * src/output.c (output_obstack): Be static and rename as...
17675 (format_obstack): this, to avoid any confusion with files.c's
17676 output_obstack.
17677 * src/reader.h (muscle_obstack): Move to...
17678 * src/output.h: here, since it's defined in output.c.
17679
837491d8
AD
176802001-12-17 Akim Demaille <akim@epita.fr>
17681
17682 * src/output.c (action_row, save_column, default_goto)
17683 (sort_actions, matching_state, pack_vector): Better variable
17684 locality.
17685
796d61fb
AD
176862001-12-17 Akim Demaille <akim@epita.fr>
17687
17688 * src/output.c: Various formatting changes.
776209d6 17689
64d15509
AD
176902001-12-17 Akim Demaille <akim@epita.fr>
17691
17692 * src/files.c (output_files): Free the output_obstack.
17693 * src/main.c (main): Call print and print_graph conditionally.
17694 * src/print.c (print): Work unconditionally.
17695 * src/print_graph.c (print_graph): Work unconditionally.
17696 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17697
fbc8ecb7
MA
176982001-12-16 Marc Autret <autret_m@epita.fr>
17699
17700 * src/output.c (actions_output): Fix. When we use %no-lines,
17701 there is one less line per action.
17702
f0440388
MA
177032001-12-16 Marc Autret <autret_m@epita.fr>
17704
17705 * src/bison.simple: Remove a useless #line directive.
17706 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17707 * src/output.c (get_lines_number): New.
776209d6 17708 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
17709 output muscles.
17710 Fix line numbering.
17711 (actions_output): Computes the number of lines taken by actions.
17712 (output_master_parser): Insert new skeleton which is the name of
17713 the output parser file name.
17714
a79986b8
MA
177152001-12-15 Marc Autret <autret_m@epita.fr>
17716
17717 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17718
4ec8e00f
MA
177192001-12-15 Marc Autret <autret_m@epita.fr>
17720
17721 * src/output.c (output_gram): Keep track of the hairy one.
17722
1a4648ff
AD
177232001-12-15 Akim Demaille <akim@epita.fr>
17724
17725 Make `make distcheck' work.
17726
17727 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17728 system.h which uses libgettext.h.
17729
9c2c67e6
AD
177302001-12-15 Akim Demaille <akim@epita.fr>
17731
17732 * src/nullable.c (set_nullable): Useless rules must be skipped,
17733 otherwise, since we range over their symbols, we might look at a
17734 nonterminal which no longer ``exists'', i.e., it is not counted in
17735 `nvars', hence we overflow our arrays.
17736
93ede233
AD
177372001-12-15 Akim Demaille <akim@epita.fr>
17738
17739 The header can also be produced directly, without any obstack!
17740 Yahoo!
17741
17742 * src/files.c, src/files.h (defines_obstack): Remove.
17743 (compute_header_macro): Global.
17744 (defines_obstack_save): Remove.
17745 * src/reader.c (parse_union_decl): No longer output to
17746 defines_obstack: its content can be found in the `stype' muscle
17747 anyway.
17748 (output_token_translations): Merge into...
17749 (symbols_output): this.
17750 Rename as...
17751 (symbols_save): this.
17752 (reader): Adjust.
17753 * src/output.c (header_output): New.
17754 (output): Call it.
17755
2666f928
AD
177562001-12-15 Akim Demaille <akim@epita.fr>
17757
17758 * src/reader.c (parse_union_decl): Instead of handling two obstack
17759 simultaneously, use one to define the `stype' muscle, and use the
17760 value of the latter to fill defines_obstack.
17761 (copy_comment): Remove.
17762 (copy_comment2): Work for a single obstack.
17763 Rename as...
17764 (copy_comment): this.
17765
428046f8
AD
177662001-12-15 Akim Demaille <akim@epita.fr>
17767
17768 * src/lex.c, src/lex.h (xgetc): No longer static.
17769 * src/reader.c (parse_union_decl): Revamp.
17770
ea52d706
AD
177712001-12-15 Akim Demaille <akim@epita.fr>
17772
17773 Still making progress in separating Bison into (i) input, (ii)
17774 process, (iii) output: now we can directly output the parser file
17775 without using table_obstack at all.
17776
17777 * src/files.c, src/files.h (table_obstack): Bye bye.
17778 (parser_file_name): New.
17779 * src/files.c (compute_output_file_names): Compute it.
17780 * src/output.c (actions_output, output_parser)
17781 (output_master_parser): To a file instead of an obstack.
17782
3f96f4dc
AD
177832001-12-15 Akim Demaille <akim@epita.fr>
17784
17785 Attach actions to rules, instead of pre-outputting them to
17786 actions_obstack.
17787
17788 * src/gram.h (rule_t): action and action_line are new members.
17789 * src/reader.c (symbol_list): Likewise.
17790 (copy_action): Save the actions within the rule.
17791 (packgram): Save them in rule_table.
17792 * src/output.c (actions_output): New.
17793 (output_parser): Use it on `%%actions'.
17794 (output_rule_data): Don't free rule_table.
17795 (output): Do it.
17796 (prepare): Don't save the `action' muscle.
17797 * src/bison.simple: s/%%action/%%actions/.
17798
51576fb3
AD
177992001-12-15 Akim Demaille <akim@epita.fr>
17800
17801 * src/reader.c (copy_action): When --yacc, don't append a `;'
17802 to the user action: let it fail if lacking.
dee049eb 17803 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 17804
2648a72d
AD
178052001-12-14 Akim Demaille <akim@epita.fr>
17806
17807 * src/lex.c (literalchar): Simply return the char you decoded, non
17808 longer mess around with obstacks and int pointers.
17809 Adjust all callers.
17810
92790e5b
AD
178112001-12-14 Akim Demaille <akim@epita.fr>
17812
17813 * src/lex.c (literalchar): Don't escape the special characters,
17814 just decode them, and keep them as char (before, eol was output as
17815 the 2 char string `\n' etc.).
17816 * src/output.c (output_rule_data): Use quotearg to output the
17817 token strings.
17818
927c1557
PE
178192001-12-13 Paul Eggert <eggert@twinsun.com>
17820
17821 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17822 Do not infringe on the global user namespace when using C++.
17823 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17824 All uses of `fprintf' and `stderr' changed.
17825
17826 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17827
ed8e1f68
AD
178282001-12-13 Akim Demaille <akim@epita.fr>
17829
17830 The computation of nullable is broken: it doesn't handle empty
17831 RHS's properly.
17832
17833 * tests/torture.at (GNU AWK Grammar): New.
17834 * tests/sets.at (Nullable): New.
17835 * src/nullable.c (set_nullable): Instead of blindly looping over
17836 `ritems', loop over the rules, and then over their rhs's.
17837
17838 Work around Autotest bugs.
17839
17840 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17841 frame, because Autotest understand lines starting with a `+' as
17842 traces from the shell. Then, they are not processed properly.
17843 Admittedly an Autotest bug, but we don't have time to wait for
17844 Autotest to catch up.
17845 * tests/regression.at (Broken Closure): Adjust to the new table
17846 frames.
17847 Move to...
17848 * tests/sets.at: here.
17849
cb581495
AD
178502001-12-13 Akim Demaille <akim@epita.fr>
17851
17852 * src/closure.c (closure): Use nrules instead of playing tricks
17853 with BITS_PER_WORD.
17854
2e729273
AD
178552001-12-13 Akim Demaille <akim@epita.fr>
17856
17857 * src/print.c (print_actions): Output the handling of `$' as the
17858 traces do: shifting the token EOF. Before EOF was treated as a
17859 nonterminal.
17860 * tests/regression.at: Adjust some tests.
17861 * src/print_graph.c (print_core): Complete the set of items via
17862 closure. The next-to-final and final states are still unsatisfying,
17863 but that's to be addressed elsewhere.
17864 No longer output the rule numbers, but do output the state number.
17865 A single loop for the shifts + gotos is enough, but picked a
17866 distinct color for each.
17867 (print_graph): Initialize and finalize closure.
17868
107f7dfb
AD
178692001-12-13 Akim Demaille <akim@epita.fr>
17870
17871 * src/reader.c (readgram): Remove dead code, an strip useless
17872 braces.
17873 (get_type): Remove, unused.
17874
9b53a24f
AD
178752001-12-12 Akim Demaille <akim@epita.fr>
17876
17877 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17878 on that of lib/error.c.
17879
dbfb6dcd
AD
178802001-12-12 Akim Demaille <akim@epita.fr>
17881
17882 Some hosts don't like `/' in includes.
17883
17884 * src/system.h: Include libgettext.h without qualifying the path.
17885 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17886 $(top_srcdir).
17887
c25fb648
MA
178882001-12-11 Marc Autret <autret_m@epita.fr>
17889
17890 * src/output.c (output_parser): Remove useless muscle.
17891
710ddc4f
MA
178922001-12-11 Marc Autret <autret_m@epita.fr>
17893
17894 * src/bison.simple: Remove #line just before %%epilogue. It
17895 is now handled in ...
17896 * src/reader.c (read_additionnal_code): Add the output of a
17897 #line for the epilogue.
17898
e83d80b8
MA
178992001-12-10 Marc Autret <autret_m@epita.fr>
17900
927c1557 17901 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
17902 replace precedent remove.
17903 * src/bison.simple: Remove #line before %%prologue because
17904 %%input-line is wrong at this time.
17905
971d5158
MA
179062001-12-10 Marc Autret <autret_m@epita.fr>
17907
17908 * src/reader.c (symbols_output): Clean up.
927c1557 17909 * src/output.c (output_gram, output): Clean up.
971d5158 17910
5edafffd
AD
179112001-12-10 Akim Demaille <akim@epita.fr>
17912
17913 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17914 * src/LR0.c (set_state_table): here.
17915 * src/lalr.c (lalr): Call it.
17916
0279f8e9
AD
179172001-12-10 Akim Demaille <akim@epita.fr>
17918
17919 * src/state.h (shifts): Remove the `number' member: shifts are
17920 attached to state, hence no longer need to be labelled with a
17921 state number.
17922
190c4f5f
AD
179232001-12-10 Akim Demaille <akim@epita.fr>
17924
17925 Now that states have a complete set of members, the linked list of
17926 shifts is useless: just fill directly the state's shifts member.
17927
17928 * src/state.h (shifts): Remove the `next' member.
17929 * src/LR0.c (first_state, last_state): Remove.
17930 Adjust the callers.
17931 (augment_automaton): Don't look for the shifts that must be added
17932 a shift on EOF: it is those of the state we looked for! But now,
17933 since shifts are attached, it is no longer needed to looking
17934 merely by its id: its number.
17935
2a73b93d
AD
179362001-12-10 Akim Demaille <akim@epita.fr>
17937
17938 * src/LR0.c (augment_automaton): Better variable locality.
17939 Remove an impossible branch: if there is a state corresponding to
17940 the start symbol being shifted, then there is shift for the start
17941 symbol from the initial state.
17942
74392f6a
AD
179432001-12-10 Akim Demaille <akim@epita.fr>
17944
17945 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17946 only when appropriate: when insert_start_shifting_state' is not
17947 invoked.
17948 * tests/regression.at (Rule Line Numbers): Adjust.
17949
37c82725
AD
179502001-12-10 Akim Demaille <akim@epita.fr>
17951
17952 * src/LR0.c (augment_automaton): Now that all states have shifts,
17953 merge the two cases addition shifts to the initial state.
17954
6a164e0c
AD
179552001-12-10 Akim Demaille <akim@epita.fr>
17956
17957 * src/lalr.c (set_state_table): Move to...
17958 * src/LR0.c: here.
17959 * src/lalr.c (lalr): Don't call it...
17960 * src/LR0.c (generate_states): do it.
17961 * src/LR0.h (first_state): Remove, only the table is used.
17962
7215de24
AD
179632001-12-10 Akim Demaille <akim@epita.fr>
17964
17965 * src/LR0.h (first_shift, first_reduction): Remove.
17966 * src/lalr.c: Don't use first_shift: find shifts through the
17967 states.
17968
80e25d4d
AD
179692001-12-10 Akim Demaille <akim@epita.fr>
17970
17971 * src/LR0.c: Attach shifts to states as soon as they are
17972 computed.
17973 * src/lalr.c (set_state_table): Instead of assigning shifts to
17974 state, just assert that the mapping was properly done.
17975
0ab3728b
AD
179762001-12-10 Akim Demaille <akim@epita.fr>
17977
17978 * src/LR0.c (insert_start_shift): Rename as...
17979 (insert_start_shifting_state): this.
17980 (insert_eof_shifting_state, insert_accepting_state): New.
17981 (augment_automaton): Adjust.
17982 Better locality of the variables.
17983 When looking if the start_symbol is shifted from the initial
17984 state, using `while (... symbol != start_symbol ...)' sounds
17985 better than `while (... symbol < start_symbol ...)': If fail
17986 to see how the order between symbols could be relevant!
17987
78af9bbc
AD
179882001-12-10 Akim Demaille <akim@epita.fr>
17989
17990 * src/getargs.h: Don't declare `spec_name_prefix' and
17991 `spec_file_prefix', declared by src/files.h.
17992 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17993 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17994 * src/output.c (prepare): Adjust.
17995 * src/reader.c (symbols_output): Likewise.
17996 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17997
bdef2a41
AD
179982001-12-10 Akim Demaille <akim@epita.fr>
17999
18000 * src/muscle_tab.c (muscle_init): NULL is a better default than
18001 `"0"'.
18002
3735969c
AD
180032001-12-10 Akim Demaille <akim@epita.fr>
18004
18005 * src/reader.c (reader): Calling symbols_output once is enough.
18006
49701457
AD
180072001-12-10 Akim Demaille <akim@epita.fr>
18008
18009 Now that states have a complete set of members, the linked list of
18010 reductions is useless: just fill directly the state's reductions
18011 member.
18012
18013 * src/state.h (struct reductions): Remove member `number' and
18014 `next'.
18015 * src/LR0.c (first_reduction, last_reduction): Remove.
18016 (save_reductions): Don't link the new reductions, store them in
18017 this_state.
18018 * src/lalr.c (set_state_table): No need to attach reductions to
18019 states, it's already done.
18020 * src/output.c (output_actions): No longer free the shifts, then
18021 the reductions, then the states: free all the states and their
18022 members.
18023
0edad749
AD
180242001-12-10 Akim Demaille <akim@epita.fr>
18025
18026 * src/options.c (OPTN, DRTV, BOTH): New.
18027 (option_table): Use them.
18028
0edad749
AD
18029 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18030 the job of system.h.
18031 * src/options.c: Don't include stdio.h and xalloc.h for the same
18032 reasons.
18033
5449dd0f
AD
180342001-12-10 Akim Demaille <akim@epita.fr>
18035
18036 * src/output.c (output, prepare): Make sure the values of the
18037 muscles `action' and `prologue' are 0-terminated.
18038
a870c567
AD
180392001-12-10 Akim Demaille <akim@epita.fr>
18040
18041 Clean up GCC warnings.
18042
18043 * src/reader.c (copy_action): `buf' is not used.
18044 (parse_skel_decl): Be static.
18045 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18046 * src/options.h (create_long_option_table): Have a real prototype.
18047 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18048 (hash_delete_at): Return const void *.
18049 Adjust casts to preserve the const.
18050
80df8768
AD
180512001-12-10 Akim Demaille <akim@epita.fr>
18052
18053 * configure.in: Require 2.52g.
18054 M4 is not needed, but AUTOM4TE is.
18055 * m4/m4.m4: Remove.
18056 * tests/Makefile.am: Adjust.
18057
f693ad14
AD
180582001-12-10 Akim Demaille <akim@epita.fr>
18059
18060 One structure for states is enough, even though theoretically
18061 there are LR(0) states and LALR(1) states.
18062
18063 * src/lalr.h (state_t): Remove.
18064 (state_table): Be state_t **, not state_t *.
18065 * src/state.h (core, CORE_ALLOC): Rename as...
18066 (state_t, STATE_ALLOC): this.
18067 Add the LALR(1) members: shifts, reductions, errs.
18068 * src/LR0.c (state_table): Rename as...
18069 (state_hash): this, to avoid name clashes with the global
18070 `state_table'.
18071 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18072 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18073
74ffbcb6
AD
180742001-12-10 Akim Demaille <akim@epita.fr>
18075
18076 Bison dumps core on bash.y.
18077 Reported by Pascal Bart.
18078
18079 * src/warshall.c (bitmatrix_print): New.
18080 (TC): Use it.
ba0fe3c7 18081 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
18082 j must be the outer loop.
18083 * tests/regression.at (Broken Closure): New.
18084
07708e19
AD
180852001-12-05 Akim Demaille <akim@epita.fr>
18086
18087 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18088 its argument.
ba1ecc07 18089 Reported by Peter Hamorsky.
07708e19 18090
92b16366
AD
180912001-12-05 Akim Demaille <akim@epita.fr>
18092
18093 * src/conflicts.c (err_table): Remove.
18094 (resolve_sr_conflict): Adjust.
18095 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18096 Rename as...
18097 (state_t.reductions, state_t.shifts): this.
18098
076ab033
AD
180992001-12-05 Akim Demaille <akim@epita.fr>
18100
18101 * src/reduce.c (reduce_grammar_tables): No longer disable the
18102 removal of useless rules via CPP but via `if (0)', so that the
18103 compiler still check the code is valid.
18104 For instance, it should have noticed `rline' no longer exists: use
18105 the `line' member of rule_t.
18106 * src/gram.c (dummy, rline): Remove, unused.
18107
3843c413
AD
181082001-12-05 Akim Demaille <akim@epita.fr>
18109
18110 * src/output.c (pack_vector): Use assert, not berror.
18111 * src/main.c (berror): Remove, unused.
18112
43168960
AD
181132001-12-05 Akim Demaille <akim@epita.fr>
18114
18115 New experimental feature: if --verbose --trace output all the
18116 items of a state, not only its kernel.
18117
18118 * src/print.c (print_core): If `trace_flag', then invoke closure
18119 before outputting the items of the state (print_core is no longer
18120 a correct name them).
18121 (print_results): Invoke new_closure/free_closure if needed.
18122
b2872512
AD
181232001-12-05 Akim Demaille <akim@epita.fr>
18124
18125 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18126 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18127 (nitemset): for consistency with the rest of the project.
18128
23cbcc6c
AD
181292001-12-05 Akim Demaille <akim@epita.fr>
18130
18131 * src/closure.c (print_closure): Improve.
18132 (closure): Use it for printing input and output.
18133
03ec521c
AD
181342001-12-05 Akim Demaille <akim@epita.fr>
18135
18136 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18137 indexed by nonterminals.
18138
3a7456dd
AD
181392001-12-05 Akim Demaille <akim@epita.fr>
18140
18141 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18142 what it was!).
18143 * src/warshall.h: Remove accidental duplication of the content.
18144
1cbcf2e7
AD
181452001-12-05 Akim Demaille <akim@epita.fr>
18146
18147 * src/closure.c (set_fderives): De-obfuscate.
18148
84182270
AD
181492001-12-05 Akim Demaille <akim@epita.fr>
18150
18151 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18152
3f6f053c
AD
181532001-12-05 Akim Demaille <akim@epita.fr>
18154
18155 * src/closure.c (set_firsts): De-obfuscate.
18156
7a5350ba
AD
181572001-12-05 Akim Demaille <akim@epita.fr>
18158
18159 * src/output.c (action_row): De-obfuscate
18160 using the good o' techniques: arrays not pointers, variable
18161 locality, BITISSET, RESETBIT etc.
18162
d954473d
AD
181632001-12-05 Akim Demaille <akim@epita.fr>
18164
18165 Pessimize the code to simplify it: from now on, all the states
18166 have a valid SHIFTS, which NSHIFTS is possibly 0.
18167
18168 * src/LR0.c (shifts_new): Be global and move to..
18169 * src/state.c, src/state.h: here.
18170 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18171 * src/print_graph: Adjust.
18172
9839bbe5
AD
181732001-12-05 Akim Demaille <akim@epita.fr>
18174
18175 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18176 * src/conflicts.c: Use it.
18177 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18178 incorrectly ``simplified''.
18179
9f136c07
AD
181802001-12-05 Akim Demaille <akim@epita.fr>
18181
18182 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18183 using the good o' techniques: arrays not pointers, variable
18184 locality, BITISSET, RESETBIT etc.
18185
b608206e
AD
181862001-12-05 Akim Demaille <akim@epita.fr>
18187
18188 * src/state.h (SHIFT_SYMBOL): New.
18189 * src/conflicts.c: Use it to deobfuscate.
18190
52afa962
AD
181912001-12-05 Akim Demaille <akim@epita.fr>
18192
18193 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18194 (print_reductions): De-obfuscate using the good o' techniques:
18195 arrays not pointers, variable locality, BITISSET.
18196
e74dc321
AD
181972001-12-05 Akim Demaille <akim@epita.fr>
18198
18199 * src/conflicts.c (print_reductions): Arrays, not pointers.
18200 Use BITISSET.
18201
768fca83
AD
182022001-12-05 Akim Demaille <akim@epita.fr>
18203
18204 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18205
a17e599f
AD
182062001-12-05 Akim Demaille <akim@epita.fr>
18207
18208 * src/conflicts.c (print_reductions): Improve variable locality.
18209
a04bc341
AD
182102001-12-05 Akim Demaille <akim@epita.fr>
18211
18212 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18213
c8ea038e
AD
182142001-12-05 Akim Demaille <akim@epita.fr>
18215
18216 * src/conflicts.c (print_reductions): Improve variable locality.
18217
aa2aab3c
AD
182182001-12-05 Akim Demaille <akim@epita.fr>
18219
18220 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18221 * src/lalr.c: Use them.
18222
b178c8cc
AD
182232001-12-05 Akim Demaille <akim@epita.fr>
18224
18225 * src/LR0.c (augment_automaton): Formatting changes.
18226 Better variable locality.
18227
f67d13aa
AD
182282001-12-05 Akim Demaille <akim@epita.fr>
18229
18230 * src/lalr.c (matrix_print): New.
18231 (transpose): Use it.
18232 Use arrays instead of pointers.
18233
c2713865
AD
182342001-12-05 Akim Demaille <akim@epita.fr>
18235
18236 * src/lalr.c (maxrhs): Move to...
18237 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18238 * src/lalr.c (build_relations): Adjust.
18239
9887c18a
AD
182402001-12-05 Akim Demaille <akim@epita.fr>
18241
18242 * src/lalr.c (transpose): Free the memory allocated to the
18243 argument, as it is replaced by the results by the unique caller.
18244 (build_relations): Merely invoke transpose: it handles the memory
18245 deallocation.
18246 Improve variable locality.
18247 Avoid variables used as mere abbreviations.
18248 (compute_lookaheads): Use arrays instead of pointers.
18249
4d4f699c
AD
182502001-12-05 Akim Demaille <akim@epita.fr>
18251
18252 * src/lalr.c (initialize_F): Improve variable locality.
18253 Avoid variables used as mere abbreviations.
18254
80a69750
AD
182552001-12-05 Akim Demaille <akim@epita.fr>
18256
18257 * src/derives.c (print_derives): Display the ruleno.
18258 * src/lalr.c (initialize_F, transpose): Better variable locality
18259 to improve readability.
18260 Avoid variables used as mere abbreviations.
18261
fe961097
AD
182622001-12-05 Akim Demaille <akim@epita.fr>
18263
18264 * src/lalr.c (traverse): Use arrays instead of pointers.
18265
e3e4e814
AD
182662001-12-05 Akim Demaille <akim@epita.fr>
18267
18268 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18269 the handling of squeue.
18270 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18271
630e182b
AD
182722001-12-05 Akim Demaille <akim@epita.fr>
18273
18274 Because useless nonterminals are now kept alive (instead of being
18275 `destroyed'), we now sometimes examine them, and store information
18276 related to them. Hence we need to know their number, and adjust
18277 memory allocations.
18278
18279 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18280 static.
18281 * src/LR0.c (allocate_itemsets): The memory allocated to
18282 `symbol_count' was used for two different purpose: once to count
18283 the number of occurrences of each symbol, and later reassigned to
18284 `shift_symbol', containing the symbol that can be shifted from a
18285 given state.
18286 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18287 only, and...
18288 (new_itemsets): Allocate `shift_symbol' here.
18289 (allocate_itemsets): symbol_count includes useless nonterminals.
18290 Make room for them.
18291 (free_storage): Use `free', not `XFREE', for pointers that cannot
18292 be null.
18293
81b51460
AD
182942001-12-05 Akim Demaille <akim@epita.fr>
18295
18296 * src/nullable.c (set_nullable): Deobfuscate the handling of
18297 ritem.
18298 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18299
3067fbef
AD
183002001-12-05 Akim Demaille <akim@epita.fr>
18301
18302 * src/gram.c, src/gram.h (ritem_print): New.
18303 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18304 (This useless function was defined only to work around VMS linkers
18305 that can't handle compilation units with variables only).
18306 * src/reduce.c (dump_grammar): Use it to trace the construction of
18307 ritem.
18308
c2bea5f9
PE
183092001-12-04 Paul Eggert <eggert@twinsun.com>
18310
7d27c823
PE
18311 * src/bison.simple (union yyalloc): Change member names
18312 to be the same as the stack names.
18313 (yyparse): yyptr is now union yyalloc *, not char *.
18314 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18315 and may generate better code on some machines.
c2bea5f9
PE
18316 (yystpcpy): Use prototype if __STDC__ is defined, not just
18317 if __cplusplus is defined.
35687a9d 18318
2c8a9dfa
AD
183192001-11-30 Akim Demaille <akim@epita.fr>
18320
18321 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18322 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18323 Gettext doesn't compile cleanly, and dies with -Werror.
18324 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18325 Include WARNING_CFLAGS here.
18326 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18327 before being defined.
18328
f4e421e6
AD
183292001-11-27 Paul Eggert <eggert@twinsun.com>
18330
18331 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18332 First arg is int, not unsigned.
18333 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18334 (SIZE_MAX, UINT_MAX): New macros.
18335 (quotearg_n_options): Abort if N is negative.
18336 Avoid overflow check on hosts where size_t is 64 bits and int
18337 is 32 bits, as overflow is impossible there.
18338 Fix off-by-one typo that caused unnecessary reallocation.
18339
7093d0f5
AD
183402001-11-29 Paul Eggert <eggert@twinsun.com>
18341
18342 Name space cleanup in generated parser.
18343
18344 * doc/bison.texinfo (Bison Parser): Discuss system headers
18345 and their effect on the user name space.
18346
18347 * src/bison.simple:
18348 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18349 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18350 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18351
18352 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18353 on user names when possible.
18354
18355 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18356 Simplify test for whather <alloca.h> exists.
18357
18358 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18359
18360 (<stdio.h>): Include if YYDEBUG.
18361
18362 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18363 ! defined (yyoverflow) && ! defined (yymemcpy).
18364
18365 (yymemcpy, yyparse): Rename local variables as needed so that
18366 they all begin with 'yy'.
18367
18368 (yystrlen, yystpcpy): New functions.
18369
18370 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18371 All uses changed.
18372
18373 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18374 instead of relying on string.h functions. Use YYSTACK_ALLOC
18375 and YYSTACK_FREE instead of malloc and free.
18376
fd51e5ff
AD
183772001-11-30 Akim Demaille <akim@epita.fr>
18378
18379 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18380 before their first uses.
18381 (YYBISON, YYPURE): Move to the top of the output.
18382
7d13ff5f
AD
183832001-11-30 Akim Demaille <akim@epita.fr>
18384
18385 * tests/reduce.at (Useless Nonterminals): Fix.
18386
892a3995
AD
183872001-11-30 Akim Demaille <akim@epita.fr>
18388
18389 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18390 if body instead of `;' to pacify GCC's warnings.
18391
68f1e3ed
AD
183922001-11-30 Akim Demaille <akim@epita.fr>
18393
18394 Instead of mapping the LHS of unused rules to -1, keep the LHS
18395 valid, but flag the rules as invalid.
18396
18397 * src/gram.h (rule_t): `useful' is a new member.
18398 * src/print.c (print_grammar): Adjust.
18399 * src/derives.c (set_derives): Likewise.
18400 * src/reader.c (packgram, reduce_output): Likewise.
18401 * src/reduce.c (reduce_grammar_tables): Likewise.
18402 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18403
d2d1b42b
AD
184042001-11-30 Akim Demaille <akim@epita.fr>
18405
18406 * src/reduce.c (reduce_output): Formatting changes.
18407 * src/print.c (print_results, print_grammar): Likewise.
18408 * tests/regression.at (Rule Line Numbers)
18409 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18410
760b53a8
AD
184112001-11-30 Akim Demaille <akim@epita.fr>
18412
18413 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18414 useless nonterminals, move them at the end of the symbol arrays.
18415 (reduce_output): Adjust.
18416 * tests/reduce.at (Useless Nonterminals): Adjust.
18417
00238958
AD
184182001-11-30 Akim Demaille <akim@epita.fr>
18419
18420 * src/reduce.c: Various comment/formatting changes.
18421 (nonterminals_reduce): New, extracted from...
18422 (reduce_grammar_tables): here.
18423 (reduce_grammar): Call nonterminals_reduce.
18424
396452de
PE
184252001-11-29 Paul Eggert <eggert@twinsun.com>
18426
18427 * src/bison.simple (YYSTACK_REALLOC): Remove.
18428 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18429 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18430 New macros.
18431 (union yyalloc): New type.
18432 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18433 an arbitrary restriction on hosts where size_t is wider than int.
18434
18435 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18436 a parser stack overflow. Allocate just one block of memory for all
18437 three stacks, instead of allocating three blocks; this typically is
18438 faster and reduces fragmentation.
18439
18440 Do not limit the number of items in the stack to a value that fits
18441 in 'int', as this is an arbitrary limit on hosts with 64-bit
18442 size_t and 32-bit int.
18443
147e184c
MA
184442001-11-29 Marc Autret <autret_m@epita.fr>
18445
18446 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18447 of defining YYERROR_VERBOSE.
18448 [AT_DATA]: $4 is now out of C declarations in the prologue.
18449
426cf563
MA
184502001-11-28 Marc Autret <autret_m@epita.fr>
18451
18452 * src/reader.c (parse_dquoted_param): New.
18453 (parse_skel_decl): Use it.
18454 * src/lex.h: Add its prototype.
18455 * src/lex.c (literalchar): Become not static.
18456
c7925b99
MA
184572001-11-28 Marc Autret <autret_m@epita.fr>
18458
18459 * src/output.h: And put its extern declaration here.
18460 * src/output.c (error_verbose): Define here.
18461 (prepare): Echo name modification.
18462 * src/getargs.h: Clean its extern declaration.
18463 * src/getargs.c (error_verbose_flag): Remove.
18464 (getargs): Remove case 'e'.
18465 * src/options.c (option_table): 'error-verbose' is now seen as simple
18466 percent option.
18467 Include output.h.
18468
18469 * src/reader.c (read_declarations): Remove case tok_include.
18470 (parse_include_decl): Remove.
18471 * src/lex.h (token_t): Remove tok_include.
18472 * src/options.c (option_table): 'include' is now a simple command line
18473 option.
18474
5b5d1929
MA
184752001-11-28 Marc Autret <autret_m@epita.fr>
18476
18477 * src/bison.simple: Adjust muscle names.
18478 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18479 * src/output.c (prepare): s/_/-/ for the muscles names.
18480 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18481
8850be4b
MA
184822001-11-28 Marc Autret <autret_m@epita.fr>
18483
18484 * src/bison.simple: Fix debug.
18485 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18486
4a38e613
AD
184872001-11-28 Akim Demaille <akim@epita.fr>
18488
18489 * src/LR0.c (shifts_new): New.
18490 (save_shifts, insert_start_shift, augment_automaton): Use it.
18491
4b35e1c1
AD
184922001-11-28 Akim Demaille <akim@epita.fr>
18493
18494 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18495 keep ruleno only.
18496
d2b04478
AD
184972001-11-28 Akim Demaille <akim@epita.fr>
18498
18499 * src/closure.c (closure): Instead of looping over word in array
18500 then bits in words, loop over bits in array.
18501
2c4c30aa
AD
185022001-11-28 Akim Demaille <akim@epita.fr>
18503
18504 * src/closure.c (closure): No longer optimize the special case
18505 where all the bits of `ruleset[r]' are set to 0, to make the code
18506 clearer.
18507
576890b7
AD
185082001-11-28 Akim Demaille <akim@epita.fr>
18509
18510 * src/closure.c (closure): `r' and `c' are new variables, used to
18511 de-obfuscate accesses to RULESET and CORE.
18512
cb487d7d
AD
185132001-11-28 Akim Demaille <akim@epita.fr>
18514
18515 * src/reduce.c (reduce_print): Use ngettext.
18516 (dump_grammar): Improve the trace accuracy.
18517
6013d43f
AD
185182001-11-28 Akim Demaille <akim@epita.fr>
18519
18520 * src/reduce.c (dump_grammar): Don't translate trace messages.
18521
cb4956ee
AD
185222001-11-28 Akim Demaille <akim@epita.fr>
18523
18524 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18525 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18526 as all tags are free'ed afterwards.
18527 From Enrico Scholz.
18528
648185ab
PE
185292001-11-27 Paul Eggert <eggert@twinsun.com>
18530
18531 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18532 use alloca when we didn't want to, and vice versa.
18533
68254a03
MA
185342001-11-27 Marc Autret <autret_m@epita.fr>
18535
9113b58f
AD
18536 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18537 initialization.
68254a03
MA
18538 * src/output.c (prepare): Remove its update.
18539
04d843a2
MA
185402001-11-27 Marc Autret <autret_m@epita.fr>
18541
18542 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18543 Use %error-verbose.
18544
d2079671 185452001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
18546
18547 * src/bison.simple: Remove YYERROR_VERBOSE using.
18548 Use %%error_verbose.
18549 (yyparse): Likewise.
18550 * src/output.c (prepare): Give its final value.
18551 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18552 * src/getargs.h: Add its extern declaration.
18553 * src/getargs.c (error_verbose_flag): New int.
18554 (getargs): Update to catch new case.
18555 * src/options.c (option_table): 'error-verbose' is a new option.
18556 (shortopts): Update.
18557
e0327bc8
AD
185582001-11-27 Akim Demaille <akim@epita.fr>
18559
18560 * src/system.h: Use intl/libgettext.h.
18561 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18562
000f1a3c
AD
185632001-11-27 Akim Demaille <akim@epita.fr>
18564
18565 * tests/torture.at (Exploding the Stack Size with Malloc):
18566 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18567
26cfe0be
AD
185682001-11-27 Akim Demaille <akim@epita.fr>
18569
18570 * src/files.c: Include error.h.
18571 Reported by Hans Aberg.
18572
f6bd5427
MA
185732001-11-26 Marc Autret <autret_m@epita.fr>
18574
d2079671 18575 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
18576 (read_declarations): Add case tok_include.
18577 * src/getargs.h (include): Add its extern definition.
18578 * src/getargs.c (include): New const char *.
18579 (getargs): Add case '-I'.
18580 * src/options.c (option_table): Add include as command line and
18581 percent option.
18582 * src/lex.h (token_t): Add tok_include.
18583
2ca209c1
AD
185842001-11-26 Akim Demaille <akim@epita.fr>
18585
18586 * src/reader.c (readgram): Make sure rules for mid-rule actions
18587 have a lineno equal to that of their host rule.
18588 Reported by Hans Aberg.
18589 * tests/regression.at (Rule Line Numbers): New.
18590
0e41b407
AD
185912001-11-26 Akim Demaille <akim@epita.fr>
18592
18593 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18594 size_ts.
18595
185962001-11-26 Akim Demaille <akim@epita.fr>
18597
18598 * src/complain.c, src/complain.h (error): Remove, provided by
18599 lib/error.[ch].
18600
e0c40012
AD
186012001-11-26 Akim Demaille <akim@epita.fr>
18602
18603 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18604 issue an error message.
18605 * tests/regression.at (Invalid %directive): New.
18606 Reported by Hans Aberg.
18607
5e147124
AD
186082001-11-26 Akim Demaille <akim@epita.fr>
18609
18610 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18611 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18612
a034c8b8
AD
186132001-11-26 Akim Demaille <akim@epita.fr>
18614
18615 * src/conflicts.c (conflicts_print): Don't complain at all when
18616 there are no reduce/reduce conflicts, and as many shift/reduce
18617 conflicts as expected.
18618 * tests/regression.at (%expect right): Adjust.
18619
c64a20f3
AD
186202001-11-23 Akim Demaille <akim@epita.fr>
18621
18622 * lib/alloca.c: Update, from fileutils.
18623
5b0d29bb
AD
186242001-11-23 Akim Demaille <akim@epita.fr>
18625
18626 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18627
722c4bfe
AD
186282001-11-23 Akim Demaille <akim@epita.fr>
18629
18630 * src/system.h: Include alloca.h.
18631 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18632
6255b435
AD
186332001-11-23 Akim Demaille <akim@epita.fr>
18634
18635 * src/print_graph.c (print_actions): Remove `rule', unused.
18636 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18637 pacify GCC's signed < unsigned warnings.
18638 * src/closure.c (itemsetsize): Likewise.
18639 * src/reader.c (symbol_list_new): Static.
18640
b29b2ed5
AD
186412001-11-23 Akim Demaille <akim@epita.fr>
18642
18643 Attaching lineno to buckets is stupid, since only one copy of each
18644 symbol is kept, only the line of the first occurrence is kept too.
18645
18646 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18647 * src/reader.c (rline_allocated): Remove, unused.
18648 (symbol_list): Have a `line' member.
18649 (symbol_list_new): New.
18650 (readgram): Use it.
18651 * src/print.c (print_grammar): Output the rule line numbers.
18652 * tests/regression.at (Solved SR Conflicts)
18653 (Unresolved SR Conflicts): Adjust.
18654 Reported by Hans Aberg.
18655
a81b1d4a
MA
186562001-11-22 Marc Autret <autret_m@epita.fr>
18657
18658 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18659
c1ecb3c1
MA
186602001-11-22 Marc Autret <autret_m@epita.fr>
18661
18662 * src/muscle_tab.c (muscle_init): Remove initialization of
18663 skeleton muscle.
18664 * src/output.c (output_master_parser): Do it here.
18665
fbe01355
AD
186662001-11-20 Akim Demaille <akim@epita.fr>
18667
18668 * po/sv.po: New.
18669 * configure.in (ALL_LINGUAS): Adjust.
18670 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18671 longer contains strings to translate.
18672
81e895c0
AD
186732001-11-19 Akim Demaille <akim@epita.fr>
18674
18675 * src/conflicts.c (conflicts_print): Add a missing \n.
18676
6bb1878b
AD
186772001-11-19 Akim Demaille <akim@epita.fr>
18678
18679 * src/nullable.c (nullable_print): New.
18680 (set_nullable): Call it when tracing.
18681 Better locality of variables.
18682
d9ec2d07
AD
186832001-11-19 Akim Demaille <akim@epita.fr>
18684
18685 * src/print.c (print_actions): Better locality of variables.
18686
720e5c1b
AD
186872001-11-19 Akim Demaille <akim@epita.fr>
18688
18689 * src/derives.c (print_derives): Fix and enrich.
18690 * src/closure.c (print_fderives): Likewise.
18691
fb908786
AD
186922001-11-19 Akim Demaille <akim@epita.fr>
18693
18694 * src/closure.c (itemsetend): Remove, replaced with...
18695 (itemsetsize): new.
18696
125ecb56
AD
186972001-11-19 Akim Demaille <akim@epita.fr>
18698
18699 * src/LR0.c (kernel_end): Remove, replaced with...
18700 (kernel_size): new.
18701
d8cf039f
AD
187022001-11-19 Akim Demaille <akim@epita.fr>
18703
18704 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18705 to clarify.
18706
7bec0760
AD
187072001-11-19 Akim Demaille <akim@epita.fr>
18708
18709 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18710
c87d4863
AD
187112001-11-19 Akim Demaille <akim@epita.fr>
18712
18713 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18714 trace messages.
18715 * src/LR0.c: Likewise.
18716 (allocate_itemsets): Use arrays instead of pointers to clarify.
18717
9bfe901c
AD
187182001-11-19 Akim Demaille <akim@epita.fr>
18719
18720 * src/getargs.c (statistics_flag): Replace with...
18721 (trace_flag): New.
18722 (longopts): Accept --trace instead of --statistics.
18723 * src/getargs.h, src/options.c: Adjust.
18724 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18725 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18726
97db7bd4
AD
187272001-11-19 Akim Demaille <akim@epita.fr>
18728
cc72668c 18729 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
18730 pointers to clarify the code.
18731 (save_reductions, save_shifts): Factor common parts of alternatives.
18732
2c5f66ed
AD
187332001-11-19 Akim Demaille <akim@epita.fr>
18734
18735 * src/LR0.c (new_state, get_state): Complete TRACE code.
18736 * src/closure.c: Include `reader.h' to get `tags', needed by the
18737 trace code.
18738 Rename the conditional DEBUG as TRACE.
18739 Output consistently TRACEs to stderr, not stdout.
18740 * src/derives.c: Likewise.
18741 * src/reduce.c: (inaccessable_symbols): Using if is better style
18742 than goto.
18743 Use `#if TRACE' instead of `#if 0' for tracing code.
18744
300f275f
AD
187452001-11-19 Akim Demaille <akim@epita.fr>
18746
18747 * src/system.h (LIST_FREE, shortcpy): New.
18748 * src/LR0.c: Use them.
18749 * src/output.c (free_itemsets, free_reductions, free_shifts):
18750 Remove, replaced by LIST_FREE.
18751
f59c437a
AD
187522001-11-19 Akim Demaille <akim@epita.fr>
18753
18754 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18755 (REDUCTIONS_ALLOC): New.
18756 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18757 allocation.
18758
6986fd9e
AD
187592001-11-19 Akim Demaille <akim@epita.fr>
18760
18761 * src/LR0.c (new_state): Complete trace code.
18762 * src/nullable.c (set_nullable): Don't translate traces.
18763
4bc30f78
AD
187642001-11-19 Akim Demaille <akim@epita.fr>
18765
18766 * src/print_graph.c (print_core): Better locality of variables.
18767 * src/print.c (print_core): Likewise.
18768
08a946e0
AD
187692001-11-19 Akim Demaille <akim@epita.fr>
18770
18771 * src/vcg.c: You do the output, so you are responsible of the
18772 handling of VCG syntax, in particular: use quotearg.
18773 * src/print_graph.c: Don't.
18774 (print_actions): Don't output the actions as part of the nodes,
18775 since that's the job of the edges.
18776 (print_state): Don't output by hand: fill the node description,
9bfe901c 18777 and ask for its output.
08a946e0 18778
f0473484
AD
187792001-11-19 Akim Demaille <akim@epita.fr>
18780
cc72668c
AD
18781 * src/bison.simple (yyparse): When verbosely reporting an error,
18782 no longer put additional quotes around token names.
f0473484
AD
18783 * tests/calc.at: Adjust.
18784
e41dc700
AD
187852001-11-19 Akim Demaille <akim@epita.fr>
18786
18787 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18788 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18789 * src/output.c: Adjust.
18790
652a871c
AD
187912001-11-19 Akim Demaille <akim@epita.fr>
18792
18793 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18794 (rule_t): this.
18795 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18796
b2ed6e58
AD
187972001-11-19 Akim Demaille <akim@epita.fr>
18798
18799 * src/gram.h (rule_t): New.
18800 (rule_table): New.
18801 (rrhs, rlhs): Remove, part of state_t.
18802 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18803 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18804 * src/reader.c, src/reduce.c: Adjust.
18805
edad7067
AD
188062001-11-19 Akim Demaille <akim@epita.fr>
18807
18808 * src/reader.c (symbols_output): New, extracted from...
18809 (packsymbols): Here.
18810 (reader): Call it.
18811
3feec034
AD
188122001-11-19 Akim Demaille <akim@epita.fr>
18813
18814 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18815 (maxrhs): this new function.
18816
ddcd5fdf
AD
188172001-11-19 Akim Demaille <akim@epita.fr>
18818
cc72668c 18819 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
18820 Adjust.
18821
bb527fc2
AD
188222001-11-19 Akim Demaille <akim@epita.fr>
18823
cc72668c 18824 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
18825 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18826 * src/lalr.c: Adjust.
18827
a845a697
AD
188282001-11-19 Akim Demaille <akim@epita.fr>
18829
18830 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18831 (set_state_table): handle the `lookaheads' members.
18832
f004bf6a
AD
188332001-11-19 Akim Demaille <akim@epita.fr>
18834
cc72668c
AD
18835 * src/lalr.h (lookaheads): Removed array, whose contents is now
18836 a member of...
f004bf6a
AD
18837 (state_t): this structure.
18838 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18839 Adjust.
18840
de326cc0
AD
188412001-11-19 Akim Demaille <akim@epita.fr>
18842
cc72668c
AD
18843 * src/lalr.h (consistent): Removed array, whose contents is now
18844 a member of...
de326cc0
AD
18845 (state_t): this structure.
18846 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18847 Adjust.
18848
90b4416b
AD
188492001-11-19 Akim Demaille <akim@epita.fr>
18850
cc72668c
AD
18851 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18852 contents are now members of...
90b4416b
AD
18853 (state_t): this structure.
18854 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18855 Adjust.
18856
9703cc49
AD
188572001-11-19 Akim Demaille <akim@epita.fr>
18858
18859 * src/lalr.h (state_t): New.
18860 (state_table): Be a state_t * instead of a core **.
18861 (accessing_symbol): Remove, part of state_t.
18862 * src/lalr.c: Adjust.
18863 (set_accessing_symbol): Merge into...
18864 (set_state_table): this.
18865 * src/print_graph.c, src/conflicts.c: Adjust.
18866
d803322e
AD
188672001-11-14 Akim Demaille <akim@epita.fr>
18868
18869 * tests/calc.at, tests/output.at, tests/regression.at,
18870 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18871 now the tests are run in private dirs, therefore AC_CLEANUP and
18872 family can be simplified to 0-ary.
18873 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18874 use abs. path to find config.h.
18875 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18876 stderr, there can be way too much random noise.
18877 Instead pass -Werror to GCC and rely on the exit status.
18878 Reported by Wolfram Wagner.
18879
3d76b07d
AD
188802001-11-14 Akim Demaille <akim@epita.fr>
18881
18882 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18883 defined only if yyoverflow is defined, to avoid `warning: unused
18884 variable `yyvs1''.
18885 Reported by The Test Suite.
18886
09b503c8
AD
188872001-11-14 Akim Demaille <akim@epita.fr>
18888
18889 * src/print.c: Include reduce.h.
18890 Reported by Hans Aberg.
18891
188922001-11-14 Akim Demaille <akim@epita.fr>
18893
18894 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18895 Revert a previous patch: these are really const.
18896 * src/conflicts.c (conflict_report): Additional useless pair of
18897 braces to pacify GCC's warnings for `if () if () {} else {}'.
18898 * src/lex.c (parse_percent_token): Replace equal_offset with
18899 arg_offset.
18900 arg is const.
18901 Be sure to strdup `arg' when used, since there is no reason for
18902 token_buffer not to change.
18903
0f37a994
AD
189042001-11-14 Akim Demaille <akim@epita.fr>
18905
18906 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18907 definition.
18908 * src/main.c (main): Use them.
18909 Suggested by Hans Aberg.
18910
d39d93b8
AD
189112001-11-12 Akim Demaille <akim@epita.fr>
18912
18913 * src/system.h (ngettext): Now that we use ngettext, be sure to
18914 provide a default definition when NLS are not used.
18915
9edcd895
AD
189162001-11-12 Akim Demaille <akim@epita.fr>
18917
18918 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18919 Use @kbd to denote user input.
18920 (Language and Grammar): ANSIfy the example.
18921 Adjust its layout for info/notinfo.
18922 (Location Tracking Calc): Output error messages to stderr.
18923 Output locations in a more GNUtically correct way.
18924 Fix a couple of Englishos.
18925 Adjust @group/@end group pairs.
18926
7da99ede
AD
189272001-11-12 Akim Demaille <akim@epita.fr>
18928
e3aa65c5 18929 %expect was not functioning at all.
7da99ede
AD
18930
18931 * src/conflicts.c (expected_conflicts): Set to -1.
18932 (conflict_report): Use ngettext.
18933 (conflicts_print): Check %expect and make its violation an error.
18934 * doc/bison.texinfo (Expect Decl): Adjust.
18935 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18936 * tests/regression.at (%expect not enough, %expect right)
18937 (%expect too much): New.
18938
ba9dda1a
AD
189392001-11-12 Akim Demaille <akim@epita.fr>
18940
18941 * tests/regression.at (Conflicts): Rename as...
18942 (Unresolved SR Conflicts): this.
18943 (Solved SR Conflicts): New.
18944
337c5bd1
AD
189452001-11-12 Akim Demaille <akim@epita.fr>
18946
18947 * src/reduce.c (print_results): Rename as...
18948 (reduce_output): This.
18949 Output to OUT, passed as argument, instead of output_obstack.
18950 (dump_grammar): Likewise.
18951 (reduce_free): New.
18952 Also free V1.
18953 (reduce_grammar): No longer call reduce_output, since...
18954 * src/print.c (print_results): do it.
18955 * src/main.c (main): Call reduce_free;
18956
c73a41af
AD
189572001-11-12 Akim Demaille <akim@epita.fr>
18958
18959 * src/conflicts.c (print_reductions): Accept OUT as argument.
18960 Output to it, not to output_obstack.
18961 * src/print.c (print_actions): Adjust.
18962
0df87bb6
AD
189632001-11-12 Akim Demaille <akim@epita.fr>
18964
18965 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18966 the result instead of using...
18967 (src_total, rrc_total, src_count, rrc_count): Remove.
18968 (any_conflicts): Remove.
18969 (print_conflicts): Split into...
18970 (conflicts_print, conflicts_output): New.
18971 * src/conflicts.h: Adjust.
18972 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 18973 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
18974 * tests/regression.at (Conflicts): New.
18975 Reported by Tom Lane.
18976
e4d3d4de
AD
189772001-11-12 Akim Demaille <akim@epita.fr>
18978
18979 * tests/regression.at (Invalid input): Remove, duplicate with
18980 ``Invalid input: 1''.
18981
6d7d248e
AD
189822001-11-12 Akim Demaille <akim@epita.fr>
18983
18984 * tests/torture.at (AT_DATA_STACK_TORTURE)
18985 (Exploding the Stack Size with Alloca)
18986 (Exploding the Stack Size with Malloc): New.
18987
e9e4c321
AD
189882001-11-12 Akim Demaille <akim@epita.fr>
18989
18990 * src/bison.simple (YYSTACK_REALLOC): New.
18991 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 18992 Reported by Per Allansson.
e9e4c321 18993
5f7e0832
AD
189942001-11-12 Pascal Bart <pascal.bart@epita.fr>
18995
18996 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18997 define CPP macro, which substitute YYSTYPE by yystype.
18998 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18999 with yyltype/YYLTYPE. This allows inclusion of the generated
19000 header within the parser if the compiler, such as GGC, accepts
19001 multiple equivalent #defines.
19002 From Akim.
19003
e3f1699f
AD
190042001-11-05 Akim Demaille <akim@epita.fr>
19005
19006 * src/reader.c (symbols_output): New, extracted from...
19007 (packsymbols): here.
19008 (reader): Adjust.
19009
65be0866
AD
190102001-11-05 Akim Demaille <akim@epita.fr>
19011
19012 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19013
e4d910bf
AD
190142001-11-05 Akim Demaille <akim@epita.fr>
19015
19016 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19017 pattern.
19018
951366c1
AD
190192001-11-05 Akim Demaille <akim@epita.fr>
19020
19021 * src/options.h (struct option_table_struct): set_flags is void*.
19022 * src/options.c (longopts): Support `--output' and `%output'.
19023 (usage): Adjust.
19024 * src/lex.h (tok_setopt): Remove, replaced with...
19025 (tok_intopt, tok_stropt): these new guys.
19026 * src/lex.c (getopt.h): Not needed.
19027 (token_buffer, unlexed_token_buffer): Not const.
19028 (percent_table): Promote `-' over `_' in directive names.
19029 Active `%name-prefix', `file-prefix', and `output'.
19030 (parse_percent_token): Accept possible arguments to directives.
19031 Promote `-' over `_' in directive names.
19032
d8988b2f
AD
190332001-11-04 Akim Demaille <akim@epita.fr>
19034
19035 * doc/bison.texinfo (Decl Summary): Split the list into
19036 `directives for grammars' and `directives for bison'.
19037 Sort'em.
19038 Add description of `%name-prefix', `file-prefix', and `output'.
19039 Promote `-' over `_' in directive names.
19040 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19041 Simplify the description of `--name-prefix'.
19042 Promote `-' over `_' in directive names.
19043 Promote `--output' over `--output-file'.
19044 Fix the description of `--defines'.
19045 * tests/output.at: Exercise %file-prefix and %output.
19046
6468d18e
AD
190472001-11-02 Akim Demaille <akim@epita.fr>
19048
19049 * doc/refcard.tex: Update.
19050
6b7e85b9
AD
190512001-11-02 Akim Demaille <akim@epita.fr>
19052
19053 * src/symtab.h (SUNDEF): New.
19054 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19055 stand for `uninitialized', instead of 0.
19056 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19057 * src/lex.c (lex): Adjust.
19058
19059 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19060 Number it 0.
19061 Let yylex return it instead of a plain 0.
19062 Reported by Dick Streefland.
19063
cd5aafcf
AD
190642001-11-02 Akim Demaille <akim@epita.fr>
19065
19066 * tests/regression.at (Mixing %token styles): New test.
19067
037ca2f1
AD
190682001-11-02 Akim Demaille <akim@epita.fr>
19069
19070 * src/reader.c (parse_thong_decl): Formatting changes.
19071 (token_translations_init): New, extracted from...
19072 (packsymbols): Here.
19073 Adjust.
19074
270a173c
AD
190752001-11-01 Akim Demaille <akim@epita.fr>
19076
19077 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19078 Check that `9foo.y' produces correct cpp guards.
19079 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19080 guards.
19081 Reported by Wwp.
19082
561f9a30
AD
190832001-11-01 Akim Demaille <akim@epita.fr>
19084
19085 * tests/regression.at (Invalid input: 2): New.
19086 * src/lex.c (unlexed_token_buffer): New.
19087 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19088 too.
19089 Reported by Wwp.
19090
f987e9d2
AD
190912001-11-01 Akim Demaille <akim@epita.fr>
19092
19093 * tests/calc.at: Catch up with 1.30.
19094 * configure.in: Bump to 1.49a.
19095 Adjust to newer Autotest.
19096
0846f581
PB
190972001-10-19 Pascal Bart <pascal.bart@epita.fr>
19098
19099 * src/conflicts.c: Move global variables rrc_total and src_total ...
19100 (print_conflicts): here.
19101 * src/output.c (output): Free global variable user_toknums.
19102 * src/lex.c (token_obstack): Become static.
19103
3c1a79b3
AD
191042001-10-18 Akim Demaille <akim@epita.fr>
19105
19106 * tests/atlocal.in (GCC): Add.
19107 * tests/calc.at: s/m4_match/m4_bmatch/.
19108 s/m4_patsubst/m4_bpatsubst/.
19109 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19110 * configure.in: AC_SUBST(GCC).
19111
5d52e7d0
MA
191122001-10-14 Marc Autret <autret_m@epita.fr>
19113
19114 * src/options.c (create_long_option_table): Fix.
19115
631aa1d3
AD
191162001-10-10 Akim Demaille <akim@epita.fr>
19117
19118 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19119
f6ec6d13
AD
191202001-10-04 Akim Demaille <akim@epita.fr>
19121
19122 * src/reader.c (parse_union_decl): Push the caracters in
19123 union_obstack, not attrs_obstack.
19124
342b8b6e
AD
191252001-10-04 Akim Demaille <akim@epita.fr>
19126
19127 Merge in the branch 1.29.
19128
19129 * src/reader.c (packsymbols): Use a temporary obstack for
19130 `%%tokendef', since output_stack is already used elsewhere.
19131
19132 2001-10-02 Akim Demaille <akim@epita.fr>
19133
19134 Bump 1.29d.
19135
19136 2001-10-02 Akim Demaille <akim@epita.fr>
19137
19138 Version 1.29c.
19139
19140 2001-10-02 Akim Demaille <akim@epita.fr>
19141
19142 * tests/regression.at (Invalid CPP headers): New.
19143 From Alexander Belopolsky.
19144 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19145
19146 2001-10-02 Akim Demaille <akim@epita.fr>
19147
19148 * tests/regression.at (Invalid input): New.
19149 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19150 Reported by Shura.
19151
19152 2001-10-02 Akim Demaille <akim@epita.fr>
19153
19154 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19155
19156 2001-10-02 Akim Demaille <akim@epita.fr>
19157
19158 * src/output.c (output_parser): Assert `skeleton'.
19159 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19160 systems.
19161 From Shura.
19162
19163 2001-10-01 Marc Autret <autret_m@epita.fr>
19164
19165 * src/lex.h: Echo modifications.
19166 * src/lex.c (unlex): Parameter is now token_t.
19167 From Hans Aberg.
19168
19169 2001-10-01 Marc Autret <autret_m@epita.fr>
19170
19171 * src/main.c: Include lex.h.
19172 From Hans Aberg.
19173
19174 2001-09-29 Akim Demaille <akim@epita.fr>
19175
19176 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19177
19178 2001-09-28 Akim Demaille <akim@epita.fr>
19179
19180 * tests/testsuite.at: Update to newer Autotest.
19181 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19182
19183 2001-09-27 Akim Demaille <akim@epita.fr>
19184
19185 Position independent wrapper.
19186
19187 * tests/bison: Remove.
19188 * tests/bison.in: New.
19189 * configure.in: Adjust.
19190
19191 2001-09-27 Paul Eggert <eggert@twinsun.com>
19192
19193 Port quotearg fixes from tar 1.13.24.
19194
19195 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19196 tm to be declared.
19197 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19198 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19199
19200 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19201 * m4/mbrtowc.m4: New file.
19202 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19203 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19204
19205 2001-09-27 Akim Demaille <akim@epita.fr>
19206
19207 Bump to 1.29c.
19208
19209 2001-09-27 Akim Demaille <akim@epita.fr>
19210
19211 Version 1.29b.
19212
19213 2001-09-25 Akim Demaille <akim@epita.fr>
19214
19215 * src/system.h: Include `xalloc.h'.
19216 Remove it from the C files.
19217 * src/files.c (output_files): Free the obstacks.
19218 * src/lex.c (init_lex): Rename as...
19219 (lex_init): this.
19220 (lex_free): New.
19221 * src/main.c (main): Use it.
19222
19223 2001-09-24 Marc Autret <autret_m@epita.fr>
19224
19225 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19226 to output informations in fout (FILE*).
19227 (open_graph, close_graph): Likewise.
19228 (output_graph, output_edge, output_node): Likewise.
19229 * src/vcg.h: Update function prototypes.
19230 * src/print_graph.c (print_graph): Open output graph file.
19231 (print_actions): Adjust.
19232 * src/files.h: Remove extern declaration.
19233 * src/files.c: Remove graph_obstack declaration.
19234 (open_files): Remove graph_obstack initialization.
19235 (output_files): Remove graph_obstack saving.
19236
19237 2001-09-24 Marc Autret <autret_m@epita.fr>
19238
19239 * src/files.c (compute_output_file_names): Fix.
19240
19241 2001-09-24 Marc Autret <autret_m@epita.fr>,
19242 Akim Demaille <akim@epita.fr>
19243
19244 * src/reader.c (reader): Remove call to free_symtab ().
19245 * src/main.c (main): Call it here.
19246 Include symtab.h.
19247 * src/conflicts.c (initialize_conflicts): Rename as...
19248 (solve_conflicts): this.
19249 * src/print.c (print_core, print_actions, print_state)
19250 (print_grammar): Dump to a file instead a `output_obstack'.
19251 (print_results): Dump `output_obstack', and then proceed with the
19252 FILE *.
19253 * src/files.c (compute_output_file_names, close_files): New.
19254 (output_files): Adjust.
19255 * src/main.c (main): Adjust.
19256
19257 2001-09-23 Marc Autret <autret_m@epita.fr>
19258
19259 * src/files.c (compute_header_macro): Computes header macro name
19260 from spec_defines_file when given.
19261
19262 2001-09-23 Marc Autret <autret_m@epita.fr>
19263
19264 * src/files.c (output_files): Add default extensions.
19265
19266 2001-09-22 Akim Demaille <akim@epita.fr>
19267
19268 * src/conflicts.c (finalize_conflicts): Rename as...
19269 (free_conflicts): this.
19270
19271 2001-09-22 Akim Demaille <akim@epita.fr>
19272
19273 * src/gram.c (gram_free): Rename back as...
19274 (dummy): this.
19275 (output_token_translations): Free `token_translations'.
19276 * src/symtab.c (free_symtab): Free the tag field.
19277
19278 2001-09-22 Akim Demaille <akim@epita.fr>
19279
19280 Remove `translations' as it is always set to true.
19281
19282 * src/gram.h: Adjust.
19283 * src/reader.c (packsymbols, parse_token_decl): Adjust
19284 * src/print.c (print_grammar): Adjust.
19285 * src/output.c (output_token_translations): Adjust.
19286 * src/lex.c (lex): Adjust.
19287 * src/gram.c: Be sure the set pointers to NULL.
19288 (dummy): Rename as...
19289 (gram_free): this.
19290
19291 2001-09-22 Akim Demaille <akim@epita.fr>
19292
19293 * configure.in: Invoke AM_LIB_DMALLOC.
19294 * src/system.h: Use dmalloc.
19295 * src/LR0.c: Be sure to have pointers initialized to NULL.
19296 (allocate_itemsets): Allocate kernel_items only if needed.
19297
19298 2001-09-22 Akim Demaille <akim@epita.fr>
19299
19300 * configure.in: Bump to 1.29b.
19301 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19302 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19303 need xmalloc.c in calc.y.
19304 From Pascal Bart.
19305
19306 2001-09-21 Akim Demaille <akim@epita.fr>
19307
19308 Version 1.29a.
19309 * Makefile.maint, config/config.guess, config/config.sub,
19310 * config/missing: Update from masters.
19311 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19312 upon package.m4.
19313 * configure.in (ALL_LINGUAS): Add `tr'.
19314
19315 2001-09-21 Akim Demaille <akim@epita.fr>
19316
19317 * tests/Makefile.am (package.m4): Move to...
19318 ($(srcdir)/$(TESTSUITE)): here.
19319
19320 2001-09-20 Akim Demaille <akim@epita.fr>
19321
19322 * src/complain.c: No longer try to be standalone: use system.h.
19323 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19324 * src/complain.h: Likewise.
19325 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19326 Remove the unused variable `n'.
19327 From Albert Chin-A-Young.
19328
19329 2001-09-18 Marc Autret <autret_m@epita.fr>
19330
19331 * doc/bison.1: Update.
19332 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19333 descriptions.
19334 (Option Cross Key): Update.
19335 Add --graph.
19336
19337 2001-09-18 Marc Autret <autret_m@epita.fr>
19338
19339 * tests/regression.at: New test (comment in %union).
19340
19341 2001-09-18 Marc Autret <autret_m@epita.fr>
19342
19343 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19344 do that.
19345 Reported by Keith Browne.
19346
19347 2001-09-18 Marc Autret <autret_m@epita.fr>
19348
19349 * tests/output.at: Add tests for --defines and --graph.
19350
19351 2001-09-18 Marc Autret <autret_m@epita.fr>
19352
19353 * tests/output.at: Removes tests of %{header,src}_extension features.
19354
19355 2001-09-18 Akim Demaille <akim@epita.fr>
19356
19357 * tests/Makefile.am (package.m4): New.
19358 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19359 (_AT_CHECK_CALC_ERROR): Likewise.
19360 Factor the `, ' part of verbose error messages.
19361
19362 2001-09-18 Marc Autret <autret_m@epita.fr>
19363
19364 * src/getargs.c (longopts): Declare --defines and --graph as options
19365 with optional arguments.
19366 * src/files.h: Add extern declarations.
19367 * src/files.c (spec_graph_file, spec_defines_file): New.
19368 (output_files): Update.
19369 Remove CPP-outed code.
19370
19371 2001-09-18 Marc Autret <autret_m@epita.fr>
19372
19373 Turn off %{source,header}_extension feature.
19374
19375 * src/files.c (compute_exts_from_gf): Update.
19376 (compute_exts_from_src): Update.
19377 (output_files): CPP-out useless code.
19378 * src/files.h: Remove {header,source}_extension extern declarations.
19379 * src/reader.c (parse_dquoted_param): CPP-out.
19380 (parse_header_extension_decl): Remove.
19381 (parse_source_extension_decl): Remove.
19382 (read_declarations): Remove cases tok_{hdrext,srcext}.
19383 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19384 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19385
19386 2001-09-10 Akim Demaille <akim@epita.fr>
19387
19388 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19389 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19390 (AT_CHECK_OUTPUT): this.
19391 Merely check ls' exit status, its output is useless.
19392
19393 2001-09-10 Akim Demaille <akim@epita.fr>
19394
19395 * tests/calc.at: Use m4_match.
19396 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19397
19398 2001-09-10 Marc Autret <autret_m@epita.fr>,
19399 Akim Demaille <akim@epita.fr>
19400
19401 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19402 enum color_e.
19403 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19404 to `normal'.
19405 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19406 * src/lex.h: Adjust prototype.
19407 (token_t): Add `tok_undef'.
19408 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19409 (parse_percent_token): Now returns token_t.
19410 Add default statement in switch.
19411 (lex): Separate `c' as an input variable, from the token_t result
19412 part.
19413 (unlexed): Is a token_t.
19414
19415 2001-09-10 Akim Demaille <akim@epita.fr>
19416
19417 * configure.in: Bump to 1.29a.
19418
19419 2001-09-07 Akim Demaille <akim@epita.fr>
19420
19421 Version 1.29.
19422
19423 2001-08-30 Akim Demaille <akim@epita.fr>
19424
19425 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19426 * m4/atconfig.m4: Remove.
19427 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19428 * tests/bison: New.
19429 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19430 m4_if, m4_patsubst, and m4_regexp.
19431 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19432 `input' file instead of echo.
19433
19434 2001-08-29 Akim Demaille <akim@epita.fr>
19435
19436 Bump to 1.28e.
19437
19438 2001-08-29 Akim Demaille <akim@epita.fr>
19439
19440 Version 1.28d.
19441
19442 2001-08-29 Paul Eggert <eggert@twinsun.com>
19443
19444 * src/bison.simple (yyparse): Don't take the address of an
19445 item before the start of an array, as that doesn't conform to
19446 the C Standard.
19447
19448 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19449
19450 * doc/bison.texinfo (Location Tracking Calc): New node.
19451
19452 2001-08-29 Paul Eggert <eggert@twinsun.com>
19453
19454 * src/output.c (output): Do not define const, as this now
19455 causes more problems than it cures.
19456
19457 2001-08-29 Akim Demaille <akim@epita.fr>
19458
19459 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19460 the nodes.
19461 Be sure to tag the `detailmenu'.
19462
19463 2001-08-29 Akim Demaille <akim@epita.fr>
19464
19465 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19466 download in a tmp dir.
19467
19468 2001-08-28 Marc Autret <autret_m@epita.fr>
19469
19470 * config/depcomp: New file.
19471
19472 2001-08-28 Marc Autret <autret_m@epita.fr>
19473
19474 * doc/bison.1 (mandoc): Adjust.
19475 From Juan Manuel Guerrero.
19476
19477 2001-08-28 Marc Autret <autret_m@epita.fr>
19478
19479 * src/print_graph.c (print_state): Fix.
19480
19481 2001-08-27 Marc Autret <autret_m@epita.fr>
19482
19483 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19484 char * members.
19485 Echo modifications to the functions prototypes.
19486 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19487
19488 2001-08-27 Marc Autret <autret_m@epita.fr>
19489
19490 * src/vcg.c: Include `xalloc.h'.
19491 (add_colorentry): New.
19492 (add_classname): New.
19493 (add_infoname): New.
19494 * src/vcg.h: Add new prototypes.
19495
19496 2001-08-27 Akim Demaille <akim@epita.fr>
19497
19498 * Makefile.maint: Sync. again with CVS Autoconf.
19499
19500 2001-08-27 Akim Demaille <akim@epita.fr>
19501
19502 * Makefile.maint: Formatting changes.
19503 (po-update, cvs-update, update): New targets.
19504 (AMTAR): Remove.
19505
19506 2001-08-27 Akim Demaille <akim@epita.fr>
19507
19508 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19509 * Makefile.maint: Sync. with CVS Autoconf.
19510
19511 2001-08-27 Marc Autret <autret_m@epita.fr>
19512
19513 * src/vcg.h (struct infoname_s): New.
19514 (struct colorentry_s): New.
19515 (graph_s): New fields {vertical,horizontal}_order in structure.
19516 Add `infoname' field.
19517 Add `colorentry' field;
19518 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19519 (G_HORIZONTAL_ORDER): New.
19520 (G_INFONAME): New.
19521 (G_COLORENTRY): New.
19522 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19523 Add output of `infoname'.
19524 Add output of `colorentry'.
19525
19526 2001-08-27 Marc Autret <autret_m@epita.fr>
19527
19528 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19529 This one shadowed a global parameter.
19530
19531 2001-08-24 Marc Autret <autret_m@epita.fr>
19532
19533 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19534 instead of `unsigned'.
19535 (print_state): Do not call obstack_object_size () in obstack_grow ()
19536 to avoid macro variables shadowing.
19537
19538 2001-08-23 Marc Autret <autret_m@epita.fr>
19539
19540 * src/lex.c (percent_table): Typo: s/naem/name/.
19541 Add graph option.
19542 Normalize new options declarations.
19543
19544 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19545
19546 * tests/suite.at: Exercise %header_extension and %source_extension.
19547
19548 2001-08-16 Marc Autret <autret_m@epita.fr>
19549
19550 * src/reader.c (parse_dquoted_param): New.
19551 (parse_header_extension_decl): Use it.
19552 (parse_source_extension_decl): Likewise.
19553
19554 2001-08-16 Marc Autret <autret_m@epita.fr>
19555
19556 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19557 (get_xxxx_str): Use assert () instead of complain ().
19558 Remove return invokations in default cases.
19559 (get_decision_str): Modify default behaviour. Remove second argument.
19560 Echo modifications on calls.
19561 (output_graph): Fix.
19562
19563 2001-08-16 Marc Autret <autret_m@epita.fr>
19564
19565 * src/getargs.c (usage): Update with ``-g, --graph''.
19566
19567 2001-08-16 Marc Autret <autret_m@epita.fr>
19568
19569 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19570 (Option Cross Key): Likewise.
19571 * doc/bison.1: Update.
19572
1c8c2190
PB
195732001-09-25 Pascal Bart <pascal.bart@epita.fr>
19574
19575 * src/output.c (output_master_parser): Don't finish action_obstack.
19576 (output_parser): Don't care about the muscle action, here.
19577 (prepare): Copy the action_obstack in the action muscle.
19578 (output): Free action_obstack.
19579
180d45ba
PB
195802001-09-23 Pascal Bart <pascal.bart@epita.fr>
19581
19582 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19583 will contain `%union' declaration.
19584 (parse_union_decl): Delete #line directive output.
19585 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19586 informations about %union.
19587 (parse_union_decl): Copy the union_obstack in the muscle stype.
19588 * src/bison.simple: Add new #line directive.
19589 Add typdef %%stype YYSTYPE.
19590
c51d1a19
PB
195912001-09-23 Pascal Bart <pascal.bart@epita.fr>
19592
19593 * src/bison.simple: Add new `#line' directive.
19594
6f9344da
PB
195952001-09-22 Pascal Bart <pascal.bart@epita.fr>
19596
19597 * src/bison.simple: New `#line' directive.
19598 * src/output.c (output_parser): Support new dynamic muscle input_line.
19599
652def80
MA
196002001-09-22 Marc Autret <autret_m@epita.fr>
19601
19602 * src/output.c (output_master_parser): New.
19603 (output_parser): Be more re-entrant.
19604
25b222fa
MA
196052001-09-21 Marc Autret <autret_m@epita.fr>
19606
19607 * src/reader.c (copy_definition, parse_union_decl): Update and use
19608 `linef' muscle.
19609 (copy_action): Likewise.
19610 Use obstack_1grow ().
19611 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19612
6bc35ae5
MA
196132001-09-21 Marc Autret <autret_m@epita.fr>
19614
19615 * src/options.c (option_table): Adjust.
19616 * src/lex.c (parse_percent_token): Fix.
19617
c0629aa1
PB
196182001-09-20 Pascal Bart <pascal.bart@epita.fr>
19619
19620 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 19621
82b6d266
PB
196222001-09-20 Pascal Bart <pascal.bart@epita.fr>
19623
19624 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19625 is now an option_table_struct*.
19626 (option_strcmp): New function option_strcmp.
19627 (parse_percent_token): Call option_strcmp.
19628 * src/getargs.c (xalloc.h, options.h): Include it.
19629 (getargs): Call create_long_option_table.
19630 (getargs): Free longopts at the end of the function.
19631 (shortopts): Move in options.c.
19632 * src/options.c (create_long_option_table): New function. Convert
19633 information from option_table to option structure.
19634 * src/reader.c (options.h): Include it.
19635
19636 * src/Makefile.am: Adjust.
19637 * src/options.c (option_table): Create from longopts and percent_table.
19638 * src/getargs.c (longopts): Delete.
19639 * src/lex.c (struct percent_table_struct): Delete.
19640 (percent_table): Delete.
19641 (options.h): Include it.
19642 * src/options.c: Create.
19643 * src/options.h: Create.
19644 Declare enum opt_access_e.
19645 Define struct option_table_struct.
19646
75f5aaea
MA
196472001-09-20 Marc Autret <autret_m@epita.fr>
19648
19649 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19650 sections of Bison.
19651
f508cb0a
PB
196522001-09-19 Pascal Bart <pascal.bart@epita.fr>
19653
19654 * src/bison.simple: s/%%filename/%%skeleton.
19655 * src/muscle_tab.c (getargs.h): Include it.
19656 (muscle_init): Insert new muscle skeleton.
19657
13105fc1
PB
196582001-09-18 Pascal Bart <pascal.bart@epita.fr>
19659
19660 * src/output.c (output_parser): Delete unused variable actions_dumped.
19661
b0c4483e
PB
196622001-09-07 Pascal Bart <pascal.bart@epita.fr>
19663
19664 * src/output.c (output): Delete call to reader_output_yylsp.
19665 * src/reader.c (reader): Likewise.
ba0fe3c7 19666 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 19667
11d82f03
MA
196682001-09-02 Marc Autret <autret_m@epita.fr>
19669
19670 * src/reader.c: Include muscle_tab.h.
19671 (parse_union_decl): Update.
19672 (parse_macro_decl): Rename parse_muscle_decl.
19673 Update to use renamed functions and variable.
19674 (read_declarations, copy_action, read_additionnal_code, : Updated
19675 with correct variables and functions names.
19676 (packsymbols, reader): Likewise.
342b8b6e 19677
11d82f03 19678 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 19679
11d82f03
MA
19680 * src/output.c: Include muscle_tab.h
19681 In all functions using macro_insert, change by using muscle_insert ().
19682 (macro_obstack): Rename muscle_obstack.
19683 Echo modifications in the whole file.
19684 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19685 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19686 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19687
19688 * src/muscle_tab.h: Update double inclusion macros.
19689 (macro_entry_s): Rename muscle_entry_s.
19690 Update prototypes.
342b8b6e 19691
11d82f03
MA
19692 * src/muscle_tab.c: Include muscle_tab.h.
19693 Rename macro_tabble to muscle_table.
19694 (mhash1, mhash2, mcmp): Use muscle_entry.
19695 (macro_init): Rename muscle_init. Update.
19696 (macro_insert): Rename muscle_insert. Update.
19697 (macro_find): Rename muscle_find. Update.
19698
19699 * src/main.c: Include muscle_tab.h.
19700 (main): Call muscle_init ().
19701 * src/Makefile.am (bison_SOURCES): Echo modifications.
19702
93a37297
MA
197032001-09-02 Marc Autret <autret_m@epita.fr>
19704
f753cd62 19705 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 19706
f753cd62
MA
19707 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19708
197092001-09-02 Marc Autret <autret_m@epita.fr>
19710
19711 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 19712
682d48cd
PB
197132001-09-01 Pascal Bart <pascal.bart@epita.fr>
19714
342b8b6e 19715 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
19716 filename.
19717
087c8fda
MA
197182001-09-01 Marc Autret <autret_m@epita.fr>
19719
19720 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19721 to an explicit value to activate the feature. We do it here.
19722
dda680cb
PB
197232001-08-31 Pascal Bart <pascal.bart@epita.fr>
19724
19725 * src/output.c (prepare): Delete the `filename' muscule insertion.
19726 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19727 (parse_union_decl): Likewise.
19728 * src/macrotab.c (macro_init): Initialize filename by infile.
19729
9e644e64
MA
197302001-08-31 Marc Autret <autret_m@epita.fr>
19731
19732 * src/bison.simple (YYLSP_NEEDED): New definition.
19733 * src/output.c (prepare): Add macro insertion of `locations_flag'
19734
17da6427
PB
197352001-08-31 Pascal Bart <pascal.bart@epita.fr>
19736
19737 * src/output.c (prepare): Delete insertion of previous muscles,
19738 and insert the `prefix' muscles.
19739 * src/macrotab.c (macro_init): Likewise.
19740 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 19741 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
19742 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19743 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 19744 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
19745 name_prefix.
19746
e8cb70b9
PB
197472001-08-31 Pascal Bart <pascal.bart@epita.fr>
19748
19749 * src/main.c (main): Standardize.
19750 * src/output.c (output_table_data, output_parser): Likewise.
19751 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19752
63c2d5de
MA
197532001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19754
342b8b6e 19755 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
19756 %%epilogue.
19757 * src/output.c (output): Rename %%declarations to %%prologue.
19758 * src/bison.simple: Echo modifications.
342b8b6e 19759
d8cb5183
MA
197602001-08-31 Marc Autret <autret_m@epita.fr>
19761
19762 * src/reader.c (readgram): CleanUp.
19763 (output_token_defines): Likewise.
19764 (packsymbols): Likewise.
19765 (reader): Likewise.
19766 * src/output.c (output): CPP-out useless code.
19767
6c686258
PB
197682001-08-31 Pascal Bart <pascal.bart@epita.fr>
19769
342b8b6e 19770 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
19771 output_trailers and output_headers.
19772 * src/output.h: Remove obsolete functions prototypes of output_headers
19773 and output_trailers.
19774
8f451ef7
PB
197752001-08-30 Pascal Bart <pascal.bart@epita.fr>
19776
19777 * src/main.c: Include macrotab.h.
342b8b6e 19778 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
19779 Adjust functions prototypes.
19780 * src/macrotab.c (macro_insert): Constify key and value.
19781 (macro_find): Constify key.
19782 (macro_insert): Include 'xalloc.h'
19783 (macro_insert): Use XMALLOC.
19784 (macro_find): Constify return value.
19785 * src/output.c (output_table_data): Rename table to table_data.
19786 (output_parser): Constify macro_key, macro_value.
19787
997b6fd0 197882001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
19789
19790 * src/reader.c (parse_skel_decl): New.
342b8b6e 19791 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
19792 * src/lex.h (token_t): New token `tok_skel'.
19793 * src/lex.c (percent_table): Add skeleton option entry.
19794 Standardize.
19795
ff48177d
MA
197962001-08-29 Marc Autret <autret_m@epita.fr>
19797
19798 * src/bison.simple: Add %%user_code directive at the end.
19799 * src/reader.c (read_additionnal_code): New.
19800 (reader): Use it.
19801 * src/output.c (output_program): Remove.
19802 (output): Update.
19803
b33160bf
MA
198042001-08-28 Marc Autret <autret_m@epita.fr>
19805
19806 * src/output.c (output_actions): Clean up.
4e5caae2 19807 (output_gram): CPP-out useless code.
b33160bf
MA
19808 * src/reader.c (reader): Clean up, CPP-out useless code.
19809
d1a2daf7
PB
198102001-08-28 Pascal Bart <pascal.bart@epita.fr>
19811
342b8b6e 19812 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 19813 directive.
d1a2daf7
PB
19814 * src/bison.simple: Add `%%definitions'.
19815
2b763dfe
MA
198162001-08-28 Marc Autret <autret_m@epita.fr>
19817
19818 * config/depcomp: New file.
19819
f1a87ef6
PE
198202001-08-27 Paul Eggert <eggert@twinsun.com>
19821
19822 * src/bison.simple (yyparse): Don't take the address of an
19823 item before the start of an array, as that doesn't conform to
19824 the C Standard.
19825
82e236e2
RA
198262001-08-27 Robert Anisko <robert.anisko@epita.fr>
19827
f1a87ef6 19828 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
19829 obstack. It was done too late here.
19830
19831 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19832 completely wrong.
19833 (reader): Initialize the macro obstack here, since we need it to grow
19834 '%define' directives.
19835
19836 * src/reader.h: Declare the macro obstack as extern.
19837
b0cfa28a
RA
198382001-08-27 Robert Anisko <robert.anisko@epita.fr>
19839
19840 * src/output.c (output_parser): Fix. Store single '%' characters in
19841 the output obstack instead of throwing them away.
19842
6fc74234
AD
198432001-08-27 Akim Demaille <akim@epita.fr>
19844
19845 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19846
9c76d118
RA
198472001-08-25 Robert Anisko <robert.anisko@epita.fr>
19848
19849 * lib/Makefile.am: Adjust.
19850
a8289c62
RA
198512001-08-25 Robert Anisko <robert.anisko@epita.fr>
19852
19853 * src/bison.simple: Update and add '%%' directives.
19854
b6610515
RA
198552001-08-25 Robert Anisko <robert.anisko@epita.fr>
19856
19857 * src/reader.c (reader): Remove calls to 'output_headers' and
19858 'output_trailers'. Remove some C output.
19859 (readgram): Disable a piece of code that was writing a default
19860 definition for 'YYSTYPE'.
19861 (reader_output_yylsp): Remove.
19862 (packsymbols): Output token defintions to a macro.
19863 (copy_definition): Disable C output.
6fc74234 19864
b6610515
RA
19865 * src/reader.c (parse_macro_decl): New function used to parse macro
19866 declarations.
19867 (copy_string2): Put the body of copy_string into this new function.
19868 Add a parameter to let the caller choose whether he wants to copy the
19869 string delimiters or not.
19870 (copy_string): Be a simple call to copy_string2 with the last argument
19871 bound to true.
19872 (read_declarations): Add case for macro definition.
19873 (copy_identifier): New.
6fc74234 19874 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
19875 rather than lex.
19876
26f609ff
RA
198772001-08-25 Robert Anisko <robert.anisko@epita.fr>
19878
19879 * src/output.c (prepare): Add prefixed names.
19880 (output_parser): Output semantic actions.
19881 (output_parser): Fix bug on '%%line' directives.
6fc74234 19882
26f609ff
RA
19883 * src/output.c (output_headers): Remove. The C code printed by this
19884 function should now be in the skeletons.
19885 (output_trailers): Remove.
19886 (output): Disable call to 'reader_output_yylsp'.
19887 (output_rule_data): Do not output tables to the table obstack.
19888
19889 * src/output.c: Remove some C dedicated output.
19890 Improve the use of macro and output obstacks.
19891 (output_defines): Remove.
6fc74234 19892
26f609ff
RA
19893 * src/output.c (output_token_translations): Associate 'translate'
19894 table with a macro. No output to the table obstack.
19895 (output_gram): Same for 'rhs' and 'prhs'.
19896 (output_stos): Same for 'stos'.
19897 (output_rule_data): Same for 'r1' and 'r2'.
19898 (token_actions): Same for 'defact'.
19899 (goto_actions): Same for 'defgoto'.
19900 (output_base): Same for 'pact' and 'pgoto'.
19901 (output_table): Same for 'table'.
19902 (output_check): Same for 'check'.
6fc74234 19903
26f609ff
RA
19904 * src/output.c (output_table_data): New function.
19905 (output_short_table): Remove.
19906 (output_short_or_char_table): Remove.
6fc74234 19907
26f609ff
RA
19908 * src/output.c (output_parser): Replace most of the skeleton copy code
19909 with something new. Skeletons are now processed character by character
19910 rather than line by line, and Bison looks for '%%' macros. This is the
19911 first step in making Bison's output process (a lot) more flexible.
19912 (output_parser): Use the macro table.
19913
6f43b113
RA
199142001-08-25 Robert Anisko <robert.anisko@epita.fr>
19915
19916 * src/main.c (main): Initialize the macro table.
19917
dd3127cf
RA
199182001-08-25 Robert Anisko <robert.anisko@epita.fr>
19919
19920 * src/lex.c (percent_table): Add tok_define.
19921 * src/lex.h: Add tok_define.
19922
aa321494
RA
199232001-08-25 Robert Anisko <robert.anisko@epita.fr>
19924
19925 * src/macrotab.c: New file.
19926 * src/macrotab.h: New file.
19927 * src/Makefile.am: Update.
19928
68bd3b6b
RA
199292001-08-25 Robert Anisko <robert.anisko@epita.fr>
19930
19931 * lib/hash.c: New file.
19932 * lib/hash.h: New file.
19933 * lib/Makefile.am: Update.
19934
45f8dd1e
AD
199352001-08-15 Akim Demaille <akim@epita.fr>
19936
19937 Version 1.28c.
19938
40a64a7a 199392001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
19940
19941 * src/reader.c (readgram): Indent output macro YYSTYPE.
19942 (packsymbols): Likewise.
19943 (output_token_defines): Likewise.
19944 * src/files.c: Standardize.
19945 (compute_header_macro): New.
19946 (defines_obstack_save): New. Use compute_header_macro.
19947 (output_files): Update. Use defines_obstack_save.
19948
f9a8293a
AD
199492001-08-15 Akim Demaille <akim@epita.fr>
19950
19951 * doc/bison.texinfo (Table of Symbols): Document
19952 YYSTACK_USE_ALLOCA.
19953
150ca7a7
AD
199542001-08-15 Akim Demaille <akim@epita.fr>
19955
19956 * missing: Update from CVS Automake.
19957 * config/config.guess, config/config.sub, config/texinfo.tex:
19958 Update from gnu.org.
19959
69b5cec4
AD
199602001-08-15 Akim Demaille <akim@epita.fr>
19961
19962 * Makefile.maint: Sync with CVS Autoconf.
19963
f2b5126e
PB
199642001-08-14 Pascal Bart <pascal.bart@epita.fr>
19965
69b5cec4 19966 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
19967 `fdl.texi'.
19968 * doc/fdl.texi: Add to package.
19969
4ecbf796
MA
199702001-08-14 Marc Autret <autret_m@epita.fr>
19971
19972 Turn on %{source,header}_extension features.
19973
69b5cec4 19974 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
19975 source_extension.
19976 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 19977 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
19978 between options.
19979
95fb5662
MA
199802001-08-14 Marc Autret <autret_m@epita.fr>
19981
19982 * src/files.c (compute_base_names): Add extensions computing when
19983 `--file-prefix' used.
19984 Standardize function calls.
19985
78d09da9
MA
199862001-08-13 Marc Autret <autret_m@epita.fr>
19987
69b5cec4 19988 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
19989 defining it (defined but null disables alloca).
19990
5a009f2c
MA
199912001-08-13 Marc Autret <autret_m@epita.fr>
19992
19993 * src/bison.simple (_yy_memcpy): CPP reformat.
19994
1e41465a
PB
199952001-08-13 Pascal Bart <pascal.bart@epita.fr>
19996
19997 * tests/atconfig.in (CPPFLAGS): Fix.
19998
c67a198d
PB
199992001-08-10 Pascal Bart <pascal.bart@epita.fr>
20000
79282c6c 20001 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
20002 `gpl.texi'.
20003 * doc/gpl.texi: Add to package.
20004
09a6de7e
MA
200052001-08-10 Marc Autret <autret_m@epita.fr>
20006
20007 * src/print_graph.h: Fix.
20008 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20009
b77b9ee0
AD
200102001-08-10 Akim Demaille <akim@epita.fr>
20011
20012 * src/system.h: Provide default declarations for stpcpy, strndup,
20013 and strnlen.
20014
3e259915
MA
200152001-08-10 Robert Anisko <anisko_r@epita.fr>
20016
20017 * doc/bison.texinfo (Locations): Update @$ stuff.
20018
ca96bc2d
MA
200192001-08-09 Robert Anisko <anisko_r@epita.fr>
20020
20021 * src/bison.simple (YYLLOC_DEFAULT): Update.
20022 (yyparse): Adjust.
20023
fdc6758b
MA
200242001-08-08 Marc Autret <autret_m@epita.fr>
20025
b77b9ee0 20026 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
20027 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20028 Reported by Fabrice Bauzac.
957d4dbf 20029
600cad3b
MA
200302001-08-08 Marc Autret <autret_m@epita.fr>
20031
20032 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20033 * src/vcg.c (output_node): Fix.
20034 * src/vcg.h: Cleanup.
20035 * src/print_graph.c: Add comments.
b77b9ee0 20036 (node_output_size): New global variable. Simplify the formatting of
600cad3b 20037 the VCG graph output.
b77b9ee0 20038 (print_actions): Unused code is now used. It notifies the final state
600cad3b 20039 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 20040 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
20041 blue.
20042 Get the current node name and node_obstack by argument.
20043 (node_obstack): New variable.
20044 (print_state): Manage node_obstack.
20045 (print_core): Use node_obstack given by argument.
20046 A node is not only computed here but in print_actions also.
20047 (print_graph): CPP out useless code instead of commenting it.
20048
976e528f
AD
200492001-08-07 Pascal Bart <pascal.bart@epita.fr>
20050
20051 * tests/atconfig.in (CPPFLAGS): Fix.
20052
20e8e5ca
AD
200532001-08-07 Akim Demaille <akim@epita.fr>
20054
20055 * src/print_graph.c (quote): New.
20056 (print_core): Use it.
20057
957d4dbf 200582001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 20059
3e3da797
AD
20060 * src/vcg.c (complain.h): Include it.
20061 Unepitaize `return' invocations.
c4b66126 20062 [NDEBUG] (main): Remove.
79282c6c 20063 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
20064 * src/files.c (open_files): Initialize graph_obstack.
20065 * src/print_graph.c (print_actions): CPP out useless code.
20066 (print_core): Don't output the last `\n' in labels.
20067 Use `quote'.
20068 * src/files.c (output_files): Output the VCG file.
20069 * src/main.c (main): Invoke print_graph ();
3e3da797 20070
957d4dbf 200712001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
20072
20073 Automaton VCG graph output.
20074 Using option ``-g'' or long option ``--graph'', you can generate
20075 a gram_filename.vcg file containing a VCG description of the LALR (1)
20076 automaton of your grammar.
20077
20078 * src/main.c: Call to print_graph() function.
20079 * src/getargs.h: Update.
20080 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20081 (graph_flag): New flag.
20082 (longopts): Update.
20083 (getargs): Add case `g'.
20084 * src/files.c (graph_obstack): New obstack struct.
20085 (open_files): Initialize new obstack.
20086 (output_files): Saves graph_obstack if required.
20087 * src/files.h (graph_obstack): New extern declaration.
20088 * src/Makefile.am: Add new source files.
20089
927c1557 200902001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
20091
20092 * src/print_graph.c, src/print_graph.h (graph): New.
20093 * src/vcg.h: New file.
20094 * src/vcg.c: New file, VCG graph handling.
20095
7333d403
AD
200962001-08-06 Marc Autret <autret_m@epita.fr>
20097
20098 Add of %source_extension and %header_extension which specify
20099 the source or/and the header output file extension.
20100
20101 * src/files.c (compute_base_names): Remove initialisation of
20102 src_extension and header_extension.
20103 (compute_exts_from_gf): Update.
20104 (compute_exts_from_src): Update.
20105 (output_files): Update.
20106 * src/reader.c (parse_header_extension_decl): New.
20107 (parse_source_extension_decl): New.
20108 (read_declarations): New case statements for the new tokens.
20109 * src/lex.c (percent_table): Add entries for %source_extension
20110 and %header_extension.
20111 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20112
84163231
AD
201132001-08-06 Marc Autret <autret_m@epita.fr>
20114
20115 * configure.in: Bump to 1.28c.
20116 * doc/bison.texinfo: Texinfo thingies.
20117
8303fc42
AD
201182001-08-04 Pascal Bart <pascal.bart@epita.fr>
20119
20120 * tests/atconfig.in (CPPFLAGS): Add.
20121 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20122
70a84437
AD
201232001-08-03 Akim Demaille <akim@epita.fr>
20124
20125 Version 1.28b.
20126
2ce10144
AD
201272001-08-03 Akim Demaille <akim@epita.fr>
20128
20129 * tests/Makefile.am (check-local): Ship testsuite.
20130 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20131 Include `string.h'.
20132
1e3e4bc1
AD
201332001-08-03 Akim Demaille <akim@epita.fr>
20134
20135 * configure.in: Try using -Wformat when compiling.
20136
42b45b7f
AD
201372001-08-03 Akim Demaille <akim@epita.fr>
20138
20139 * configure.in: Bump to 1.28b.
20140
8f13fe33
AD
201412001-08-03 Akim Demaille <akim@epita.fr>
20142
20143 * src/complain.c: Adjust strerror_r portability issues.
20144
b37ba92c
AD
201452001-08-03 Akim Demaille <akim@epita.fr>
20146
20147 Version 1.28a.
20148
b0ce6046
AD
201492001-08-03 Akim Demaille <akim@epita.fr>
20150
20151 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20152 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20153 * src/getargs.c: Include complain.h.
20154 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20155 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20156
d01c415b
AD
201572001-08-03 Akim Demaille <akim@epita.fr>
20158
20159 * src/reader.c (readgram): Display hidden chars in error messages.
20160
459dd1a6
AD
201612001-08-03 Akim Demaille <akim@epita.fr>
20162
20163 Update to gettext 0.10.39.
20164
53b74c0c
AD
201652001-08-03 Akim Demaille <akim@epita.fr>
20166
20167 * lib/strspn.c: New.
20168
234a3be3
AD
201692001-08-01 Marc Autret <autret_m@epita.fr>
20170
20171 * doc/bison.texinfo: Update.
20172 * doc/bison.1 (mandoc): Update.
20173 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20174 * src/files.c: Support output files extensions computing.
20175 (src_extension): New static variable.
20176 (header_extension): New static variable.
20177 (tr): New function.
20178 (get_extension_index): New function, gets the index of an extension
20179 filename in a string.
20180 (compute_exts_from_gf): New function, computes extensions from the
20181 grammar file extension.
20182 (compute_exts_from_src): New functions, computes extensions from the
20183 C source file extension, file given by ``-o'' option.
20184 (compute_base_names): Update.
20185 (output_files): Update.
20186
847bf1f5
AD
201872001-08-01 Robert Anisko <anisko_r@epita.fr>
20188
d995fee7 20189 * doc/bison.texi: Document @$.
847bf1f5
AD
20190 (Locations): New section.
20191
d074a105
AD
201922001-07-18 Akim Demaille <akim@epita.fr>
20193
20194 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20195 * config/prev-version.txt, config/move-if-change: New.
20196 * Makefile.am: Adjust.
20197
3419715d
AD
201982001-07-08 Pascal Bart <pascal.bart@epita.fr>
20199
20200 * src/bison.simple (yyparse): Suppress warning `comparaison
20201 between signed and unsigned'.
20202
62ab6972
AD
202032001-07-05 Pascal Bart <pascal.bart@epita.fr>
20204
20205 * src/getargs.h (raw_flag): Remove.
20206 * src/getargs.c: Die on `-r'/`--raw'.
20207 * src/lex.c (parse_percent_token): Die on `%raw'.
20208 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20209 * tests/calc.at: Suppress test with option `--raw'.
20210
1e24cc5b
AD
202112001-07-14 Akim Demaille <akim@epita.fr>
20212
20213 * config/: New.
20214 * configure.in: Require Autoconf 2.50.
20215 Update to gettext 0.10.38.
20216
32dfccf8
AD
202172001-03-16 Akim Demaille <akim@epita.fr>
20218
20219 * doc/bison.texinfo: ANSIfy the examples.
20220
cd5bd6ac
AD
202212001-03-16 Akim Demaille <akim@epita.fr>
20222
20223 * getargs.c (skeleton): New variable.
20224 (longopts): --skeleton is a new option.
20225 (shortopts, getargs): -S is a new option.
20226 * getargs.h: Declare skeleton.
20227 * output.c (output_parser): Use it.
20228
5141b016
AD
202292001-03-16 Akim Demaille <akim@epita.fr>
20230
20231 * m4/strerror_r.m4: New.
20232 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20233 * lib/error.h, lib/error.c: Update.
20234
447992b9
AD
202352001-03-16 Akim Demaille <akim@epita.fr>
20236
20237 * src/getargs.c (longopts): Clean up.
20238
274d42ce
AD
202392001-02-21 Akim Demaille <akim@epita.fr>
20240
20241 * src/reader.c (gensym): `gensym_count' is your own.
20242 Use a static buf to create the symbol name, as token_buffer is no
20243 longer a buffer.
20244
22c821f3
AD
202452001-02-08 Akim Demaille <akim@epita.fr>
20246
20247 * src/conflicts.c (conflict_report): Be sure not to append to res
20248 between two calls, which could happen if both first sprintf were
20249 skipped, but not the first cp += strlen.
20250
18569462
AD
202512001-02-08 Akim Demaille <akim@epita.fr>
20252
20253 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20254 New, from fileutils 4.0.37.
20255 * configure.in: Require Autoconf 2.49c. I took some time before
20256 making this decision. This is the only way out for portability
20257 issues in Bison, it would mean way too much duplicate effort to
20258 import in Bison features implemented in 2.49c since 2.13.
20259 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20260
0d8f3c8a
AD
202612001-02-02 Akim Demaille <akim@epita.fr>
20262
20263 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 20264 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 20265
f17bcd1f
AD
202662001-01-19 Akim Demaille <akim@epita.fr>
20267
20268 Get rid of the ad hoc handling of token_buffer in the scanner: use
20269 the obstacks.
20270
20271 * src/lex.c (token_obstack): New.
20272 (init_lex): Initialize it. No longer call...
20273 (grow_token_buffer): this. Remove it.
20274 Adjust all the places which used it to use the obstack.
20275
511e79b3
AD
202762001-01-19 Akim Demaille <akim@epita.fr>
20277
20278 * src/lex.h: Rename all the tokens:
20279 s/\bENDFILE\b/tok_eof/g;
20280 s/\bIDENTIFIER\b/tok_identifier/g;
20281 etc.
20282 Let them be enums, not #define, to ease debugging.
20283 Adjust all the code.
20284
0d6508ef
AD
202852001-01-18 Akim Demaille <akim@epita.fr>
20286
20287 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20288 * src/lex.c (maxtoken, grow_token_buffer): Static.
20289
6deb4447
AD
202902001-01-18 Akim Demaille <akim@epita.fr>
20291
20292 Since we now use obstacks, more % directives can be enabled.
20293
20294 * src/lex.c (percent_table): Also accept `%yacc',
20295 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20296 `%debug'.
20297 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20298 instead of returning a token.
20299 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20300 * src/reader.c (read_declarations): Adjust.
20301 * src/files.c (open_files): Don't call `compute_base_names', don't
20302 compute `attrsfile' since they depend upon data which might be
20303 *in* the input file now.
20304 (output_files): Do it here.
20305 * src/output.c (output_headers): Document the fact that this patch
20306 introduces a guaranteed SEGV for semantic parsers.
20307 * doc/bison.texinfo: Document them.
20308 * tests/suite.at: Exercise these %options.
20309
ff4423cc
AD
203102000-12-20 Akim Demaille <akim@epita.fr>
20311
20312 Also handle the output file (--verbose) with obstacks.
20313
20314 * files.c (foutput): Remove.
20315 (output_obstack): New.
20316 Adjust all dependencies.
20317 * src/conflicts.c: Return a string.
20318 * src/system.h (obstack_grow_string): Rename as...
20319 (obstack_sgrow): this. Be ready to work with non literals.
20320 (obstack_fgrow4): New.
20321
956dba3a
AD
203222000-12-20 Akim Demaille <akim@epita.fr>
20323
20324 * src/files.c (open_files): Fix the computation of short_base_name
20325 in the case of `-o foo.tab.c'.
20326
337bab46
AD
203272000-12-20 Akim Demaille <akim@epita.fr>
20328
20329 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20330 (copy_dollar): Now that everything uses obstacks, get rid of the
20331 FILE * parameters.
20332
5d3214b8
AD
203332000-12-20 Akim Demaille <akim@epita.fr>
20334
20335 * src/files.c (open_files): Actually the `.output' file is based
20336 on the short_base_name, not base_name.
20337 * tests/suite.at (Checking output file names): Adjust.
20338
29092a57
AD
203392000-12-20 Akim Demaille <akim@epita.fr>
20340
20341 * src/bison.s1: Remove, we now use directly...
20342 * src/bison.simple: this.
20343 * src/Makefile.am: Use pkgdata instead of data.
20344
ea5607fd
AD
203452000-12-20 Akim Demaille <akim@epita.fr>
20346
20347 * src/files.c (guard_obstack): New.
20348 (open_files): Initialize it.
20349 (output_files): Dump it...
20350 * src/files.h: Export it.
20351 * src/reader.c (copy_guard): Use it.
20352
27110317
AD
203532000-12-19 Akim Demaille <akim@epita.fr>
20354
20355 * src/files.c (outfile, defsfile, actfile): Removed as global
20356 vars.
20357 (open_files): Don't compute them.
20358 (output_files): Adjust.
20359 (base_name, short_base_name): Be global.
20360 Adjust dependencies.
20361
19c50364
AD
203622000-12-19 Akim Demaille <akim@epita.fr>
20363
20364 * src/files.c (strsuffix): New.
20365 (stringappend): Be just like strcat but allocate.
20366 (base_names): Eve out from open_files.
20367 Try to simplify the rather hairy computation of base_name and
20368 short_base_name.
20369 (open_files): Use it.
20370 * tests/suite.at (Checking output file names): New test.
20371
573c1d9f
AD
203722000-12-19 Akim Demaille <akim@epita.fr>
20373
20374 * src/system.h (obstack_grow_literal_string): Rename as...
20375 (obstack_grow_string): this.
20376 * src/output.c (output_parser): Recognize `%% actions' instead of
20377 `$'.
20378 * src/bison.s1: s/$/%% actions/.
20379 * src/bison.hairy: Likewise.
20380
ef7ddedd
AD
203812000-12-19 Akim Demaille <akim@epita.fr>
20382
20383 * src/output.c (output_parser): Compute the `#line' lines when
20384 there are.
20385 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20386 Suggested by Hans Aberg.
20387
ff61dabd
AD
203882000-12-19 Akim Demaille <akim@epita.fr>
20389
20390 Let the handling of the skeleton files be local to the procedures
20391 that use it.
20392
20393 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20394 longer static.
20395 (fparser, open_extra_files): Remove.
20396 (open_files, output_files): Don't take care of fparser.
20397 * src/files.h: Adjust.
20398 * src/output.c (output_parser): Open and close the file to the
20399 skeleton.
20400 * src/reader.c (read_declarations): When %semantic_parser, open
20401 fguard.
20402
55b96341
AD
204032000-12-19 Akim Demaille <akim@epita.fr>
20404
20405 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20406 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20407
358c15b7
AD
204082000-12-19 Akim Demaille <akim@epita.fr>
20409
20410 * src/files.c (open_files): Yipee! We no longer need all the code
20411 looking for `/tmp' since we have no tmp file.
20412
7de3329e
AD
204132000-12-19 Akim Demaille <akim@epita.fr>
20414
20415 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20416 New macros.
20417 * src/files.c (open_files): Less dependency on MSDOS etc.
20418
3abcd459
AD
204192000-12-14 Akim Demaille <akim@epita.fr>
20420
20421 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20422 Provide a default definition.
20423 Use it when executing the default @ action.
20424 * src/reader.c (reader_output_yylsp): No longer include
20425 `timestamp' and `text' in the default YYLTYPE.
20426
2a91a95e
AD
204272000-12-12 Akim Demaille <akim@epita.fr>
20428
20429 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20430 (copy_guard): Quote the file names.
20431 Reported by Laurent Mascherpa.
20432
14d3eb9b
AD
204332000-12-12 Akim Demaille <akim@epita.fr>
20434
20435 * src/output.c (output_headers, output_program, output): Be sure
20436 to escape special characters when outputting filenames.
20437 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20438 (output_headers): Don't depend on them, Use ACTSTR.
20439
d7045ec6
AD
204402000-11-17 Akim Demaille <akim@epita.fr>
20441
20442 * lib/obstack.h: Formatting changes.
20443 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20444 prevents type checking.
20445 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20446 cast the value to (void *): assigning a `foo *' to a `void *'
20447 variable is valid.
20448 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20449 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20450 append characters.
20451
6fd54b73
AD
204522000-11-17 Akim Demaille <akim@epita.fr>
20453
20454 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20455 as...
20456 (suite.m4, regression.m4, calc.m4): these.
20457 * tests/atgeneral.m4: Update from CVS Autoconf.
20458
4c50eae6
AD
204592000-11-17 Akim Demaille <akim@epita.fr>
20460
20461 * tests/regression.m4 (%union and --defines): New test,
20462 demonstrating a current bug in the obstack implementation.
20463
a35f64ea
AD
204642000-11-17 Akim Demaille <akim@epita.fr>
20465
20466 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20467 macros.
20468 Use them to declare the variables which are global or local to
20469 `yyparse'.
20470
7de23534
AD
204712000-11-17 Akim Demaille <akim@epita.fr>
20472
20473 * acconfig.h: Remove, no longer used.
20474
aa7815f5
AD
204752000-11-07 Akim Demaille <akim@epita.fr>
20476
20477 * src: s/Copyright (C)/Copyright/g.
20478
5af1f549
AD
204792000-11-07 Akim Demaille <akim@epita.fr>
20480
20481 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20482 defining.
20483 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20484
553e2b22
AD
204852000-11-07 Akim Demaille <akim@epita.fr>
20486
20487 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20488 Merge in a single CPP if/else.
20489
8a4f41d6
AD
204902000-11-07 Akim Demaille <akim@epita.fr>
20491
20492 * src/output.c (output): Remove useless variables.
20493 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20494 argument `data' for consistency with the prototypes.
20495 Qualify it `const'.
20496 (obstack_copy, obstack_copy0): Rename the second argument as
20497 `address' for consistency. Qualify it `const'.
20498 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20499 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20500 `const' their input argument (`data' or `address').
20501 Adjust the corresponding macros to include `const' in casts.
20502
095a3fb5
AD
205032000-11-03 Akim Demaille <akim@epita.fr>
20504
20505 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20506 s/PFILE1/BISON_HAIRY/.
20507 Adjust dependencies.
20508
d1cdce7c
AD
205092000-11-03 Akim Demaille <akim@epita.fr>
20510
090c5ebf 20511 For some reason, this was not applied.
d1cdce7c
AD
20512
20513 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20514 `unlink': it's no longer used.
20515
9311529b
AD
205162000-11-03 Akim Demaille <akim@epita.fr>
20517
20518 * src/files.c (skeleton_find): New function, eved out of...
20519 (open_files, open_extra_files): here.
20520
d8880f69
AD
205212000-11-03 Akim Demaille <akim@epita.fr>
20522
20523 Don't use `atexit'.
20524
20525 * src/files.c (obstack_save): New function.
20526 (done): Rename as...
20527 (output_files): this.
20528 Use `obstack_save'.
20529 * src/main.c (main): Don't use `atexit' to register `done', since
20530 it no longer has to remove tmp files, just call `output_files'
20531 when there are no errors.
20532
0dbb648e
AD
205332000-11-02 Akim Demaille <akim@epita.fr>
20534
20535 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20536 `unlink': it's no longer used.
20537 * src/files.h: Formatting changes.
20538
896fe5c1
AD
205392000-11-02 Akim Demaille <akim@epita.fr>
20540
20541 Remove the last uses of mktemp and unlink/delete.
20542
20543 * src/files.c (fdefines, ftable): Removed.
20544 (defines_ostack, table_obstack): New.
20545 Adjust dependencies of the former into uses of the latter.
20546 * src/output.c (output_short_or_char_table, output_short_table):
20547 Convert to using obstacks.
20548 * src/reader.c (copy_comment2): Accept one FILE * and two
20549 obstacks.
20550 (output_token_defines, reader_output_yylsp): Use obstacks.
20551 * src/system.h (obstack_fgrow3): New.
1f65350a 20552 * po/POTFILES.in: Adjust.
896fe5c1 20553
dd60faec
AD
205542000-11-01 Akim Demaille <akim@epita.fr>
20555
20556 Change each use of `fattrs' into a use of `attrs_obstack'.
20557
20558 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20559 * src/files.c (fattrs): Remove.
20560 (attrs_obstack): New.
20561 Adjust all dependencies.
20562 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20563
8c7ebe49
AD
205642000-11-01 Akim Demaille <akim@epita.fr>
20565
20566 Introduce obstacks.
20567 Change each use of `faction' into a use of `action_obstack'.
20568
20569 * lib/obstack.h, lib/obstack.c: New files.
20570 * src/files.c (faction): Remove.
20571 (action_obstack): New.
20572 Adjust all dependencies.
20573
77aee789
AD
205742000-10-20 Akim Demaille <akim@epita.fr>
20575
20576 * lib/quote.h (PARAMS): New macro. Use it.
20577
43591cec
AD
205782000-10-16 Akim Demaille <akim@epita.fr>
20579
20580 * src/output.c (output_short_or_char_table): New function.
20581 (output_short_table, output_token_translations): Use it.
20582 (goto_actions): Use output_short_table.
20583
1e9798d5
AD
205842000-10-16 Akim Demaille <akim@epita.fr>
20585
20586 * src/symtab.c (bucket_new): New function.
20587 (getsym): Use it.
20588
20589 * src/output.c (output_short_table): New argument to display the
20590 comment associated with the table.
20591 Adjust dependencies.
20592 (output_gram): Use it.
20593 (output_rule_data): Nicer output layout for YYTNAME.
20594
f282676b
AD
205952000-10-16 Akim Demaille <akim@epita.fr>
20596
20597 * src/lex.c (read_typename): New function.
20598 (lex): Use it.
20599 * src/reader.c (copy_dollar): Likewise.
20600
550a72a3
AD
206012000-10-16 Akim Demaille <akim@epita.fr>
20602
20603 * src/reader.c (copy_comment2): Expect the input stream to be on
20604 the `/' which is suspected to open a comment, instead of being
20605 called after `//' or `/*' was read.
20606 (copy_comment, copy_definition, parse_union_decl, copy_action)
20607 (copy_guard): Adjust.
20608
131e2fef
AD
206092000-10-16 Akim Demaille <akim@epita.fr>
20610
20611 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20612 `read_signed_integer'.
20613
79282c5a
AD
206142000-10-16 Akim Demaille <akim@epita.fr>
20615
20616 * src/reader.c (copy_dollar): New function.
20617 (copy_guard, copy_action): Use it.
20618
ff4a34be
AD
206192000-10-16 Akim Demaille <akim@epita.fr>
20620
20621 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20622 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20623 New files, from Fileutils 4.0.27.
20624 * src/main.c (printable_version): Remove.
20625 * src/lex.c, src/reader.c: Use `quote'.
20626
206272000-10-04 Akim Demaille <akim@epita.fr>
20628
20629 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20630
14ded682
AD
206312000-10-04 Akim Demaille <akim@epita.fr>
20632
20633 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20634
8e03724b
AD
206352000-10-04 Akim Demaille <akim@epita.fr>
20636
20637 When a literal string is used to define two different tokens,
20638 `bison -v' segfaults.
20639 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20640
20641 * tests/regression.m4: New file.
20642 Include the core of the sample provided by Piotr Gackiewicz.
20643 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20644 properly.
20645
a9e64249
AD
206462000-10-04 Akim Demaille <akim@epita.fr>
20647
20648 * src/reader.c (parse_expect_decl): Keep `count' within the size
20649 of `buffer'.
20650 From Neil Booth.
20651
da9abf43
AD
206522000-10-02 Paul Eggert <eggert@twinsun.com>
20653
20654 * bison.s1 (yyparse): Assign the default value
20655 unconditionally, to avoid a GCC warning and make the parser a
20656 tad smaller.
20657
c33638bb
AD
206582000-10-02 Akim Demaille <akim@epita.fr>
20659
20660 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20661 options.
20662
444c570a
AD
206632000-10-02 Akim Demaille <akim@epita.fr>
20664
20665 * src/derives.c, src/print.c, src/reduce.c: To ease the
20666 translation, move some `\n' out of the translated strings.
20667
89cab50d
AD
206682000-10-02 Akim Demaille <akim@epita.fr>
20669
20670 The location tracking mechanism is precious for parse error
20671 messages. Nevertheless, it is enabled only when `@n' is used in
20672 the grammar, which is a different issue (you can use it in error
20673 message, but not in the grammar per se). Therefore, there should
20674 be another means to enable it.
20675
20676 * src/getargs.c (getargs): Support `--locations'.
20677 (usage): Report it.
20678 * src/getargs.h (locationsflag): Export it.
20679 * src/lex.c (percent_table): Support `%locations'.
20680 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20681 with `locationsflag'.
20682 * doc/bison.texinfo: Document `--locations' and `%locations'.
20683 Sort the options.
20684 * tests/calc.m4: Test it.
20685
20686 For regularity of the names, replace each
20687 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20688 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20689 In addition replace each `flag' with `_flag'.
20690
d6c2cba0
AD
206912000-10-02 Akim Demaille <akim@epita.fr>
20692
20693 Also test parse error messages, including with YYERROR_VERBOSE.
20694
20695 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20696 associative).
20697 Use it to check the computations.
20698 Use it to check `nonassoc' is honored.
20699 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20700 `--yyerror-verbose'.
20701 (_AT_CHECK_CALC): Adjust to this option.
20702 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20703
5a35a6cb
AD
207042000-10-02 Akim Demaille <akim@epita.fr>
20705
20706 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20707 the latter demonstrates a flaw in the handling of non debugging
20708 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20709 was used in order to simplify:
20710
20711 #if YYDEBUG
20712 if (yydebug)
20713 {
20714 ...
20715 }
20716 #endif
20717
20718 into
20719
20720 if (yydebug)
20721 {
20722 ...
20723 }
20724
20725 unfortunately this leads to a CPP conflict when
20726 `--name-prefix=foo' is used since it produces `#define yydebug
20727 foodebug'.
20728
20729 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20730 (YYDPRINTF): New macro.
20731 Spread its use.
20732 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20733 the bison options.
20734 Also test `--verbose', `--defines' and `--name-prefix'.
20735
71da9eea
AD
207362000-10-02 Akim Demaille <akim@epita.fr>
20737
20738 Improve the readability of the produced parsers.
20739
20740 * src/bison.s1: Formatting changes.
20741 Improve the comment related to the `$' mark.
20742 (yydefault): Don't fall through to `yyresume': `goto' there.
20743 * src/output.c (output_parser): When the `$' is met, skip the end
20744 of its line.
20745 New variable, `number_of_dollar_signs', to check there's exactly
20746 one `$' in the parser skeleton.
20747
95e36146
AD
207482000-10-02 Akim Demaille <akim@epita.fr>
20749
20750 * lib/xstrdup.c: New file, from the fileutils.
20751 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20752 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20753 instead of strlen + xmalloc + strcpy.
20754 * src/symtab.c (copys): Remove, use xstrdup instead.
20755
d7020c20
AD
207562000-10-02 Akim Demaille <akim@epita.fr>
20757
20758 * src/gram.h (associativity): New enum type which replaces the
20759 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20760 `right_assoc', `left_assoc' and `non_assoc'.
20761 Adjust all dependencies.
20762 * src/reader.c: Formatting changes.
20763 (LTYPESTR): Don't define it, use it as a literal in
20764 `reader_output_yylsp'.
20765 * src/symtab.h (symbol_class): New enum type which replaces the
20766 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20767 `sunknown', `stoken and `snterm'.
20768
1916f98e
AD
207692000-10-02 Akim Demaille <akim@epita.fr>
20770
20771 * src/getargs.c (fixed_outfiles): Rename as...
20772 (yaccflag): for consistency and accuracy.
20773 Adjust dependencies.
20774
d7913476
AD
207752000-10-02 Akim Demaille <akim@epita.fr>
20776
20777 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20778 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20779 difficult and introduced a lot of core dump. It turns out that
20780 Bison used an implementation of `xmalloc' based on `calloc', and
20781 at various places it does depend upon the initialization to 0. I
20782 have not tried to isolate the pertinent places, and all the former
20783 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20784 someone should address this issue.
20785
20786 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20787 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20788 files.
20789 Adjust dependencies.
20790 * src/warshall.h: New file.
20791 Propagate.
20792
340ef489
AD
207932000-10-02 Akim Demaille <akim@epita.fr>
20794
20795 Various anti-`extern in *.c' changes.
20796
20797 * src/system.h: Include `assert.h'.
20798
b2ca4022
AD
207992000-10-02 Akim Demaille <akim@epita.fr>
20800
20801 * src/state.h (nstates, final_state, first_state, first_shift)
20802 (first_reduction): Move their exportation from here...
20803 * src/LR0.h: to here.
20804 Adjust dependencies.
20805 * src/getargs.c (statisticsflag): New variable.
20806 Add support for `--statistics'.
20807 Adjust dependencies.
20808
20809 Remove a lot of now useless `extern' statements in most files.
20810
403b315b
AD
208112000-10-02 Akim Demaille <akim@epita.fr>
20812
20813 * src/LR0.h: New file.
20814 Propagate its use.
20815
07a58c13
AD
208162000-10-02 Akim Demaille <akim@epita.fr>
20817
20818 * src/print.h: New file.
20819 Propagate its use.
20820 * src/print.c: Formatting and ordering changes.
20821 (verbose, terse): Replace with...
20822 (print_results): this new function.
20823 Adjust dependencies.
20824
0619caf0
AD
208252000-10-02 Akim Demaille <akim@epita.fr>
20826
20827 * src/conflicts.c (conflict_report): New function.
20828 (conflict_log, verbose_conflict_log): Replace with...
20829 (print_conflicts): this function.
20830 Adjust dependencies.
20831 * src/conflicts.h: New file.
20832 Propagate its inclusion.
20833
3519ec76
AD
208342000-10-02 Akim Demaille <akim@epita.fr>
20835
20836 * src/nullable.h: New file.
20837 Propagate its inclusion.
20838 * src/nullable.c: Formatting changes.
20839
015acc48
AD
208402000-10-02 Akim Demaille <akim@epita.fr>
20841
20842 * src/reduce.h: New file.
20843 Propagate its inclusion.
20844 * src/reduce.c: Topological sort and other formatting changes.
20845 (bool, TRUE, FALSE): Move their definition to...
20846 * src/system.h: here.
20847
8963a27b
AD
208482000-10-02 Akim Demaille <akim@epita.fr>
20849
20850 * src/files.c: Formatting changes.
20851 (tryopen, tryclose, openfiles): Rename as...
20852 (xfopen, xfclose, open_files): this.
20853 (stringappend): static.
20854 * src/files.h: Complete the list of exported symbols.
20855 Propagate its use.
20856
a70083a3
AD
208572000-10-02 Akim Demaille <akim@epita.fr>
20858
20859 * src/reader.h: New file.
20860 Propagate its use instead of tedious list of `extern' and
20861 prototypes.
20862 * src/reader.c: Formatting changes, topological sort,
20863 s/register//.
20864
abadc117
AD
208652000-10-02 Akim Demaille <akim@epita.fr>
20866
20867 * src/lex.h: Prototype `lex.c' exported functions.
20868 * src/reader.c: Adjust.
20869 * src/lex.c: Formatting changes.
20870 (safegetc): Rename as...
20871 (xgetc): this.
20872
720d742f
AD
208732000-10-02 Akim Demaille <akim@epita.fr>
20874
20875 * src/lalr.h: New file.
20876 Propagate its inclusion instead of prototypes and `extern'.
20877 * src/lalr.c: Formatting changes, topological sorting etc.
20878
f2acea59
AD
208792000-10-02 Akim Demaille <akim@epita.fr>
20880
20881 * src/output.c (token_actions): Introduce a temporary array,
20882 YYDEFACT, that makes it possible for this function to use
20883 output_short_table.
20884
d019d655
AD
208852000-10-02 Akim Demaille <akim@epita.fr>
20886
20887 `user_toknums' is output as a `short[]' in `output.c', while it is
20888 defined as a `int[]' in `reader.c'. For consistency with the
20889 other output tables, `user_toknums' is now defined as a table of
20890 shorts.
20891
20892 * src/reader.c (user_toknums): Be a short table instead of an int
20893 table.
20894 Adjust dependencies.
20895
20896 Factor the short table outputs.
20897
20898 * src/output.c (output_short_table): New function.
20899 * src/output.c (output_gram, output_stos, output_rule_data)
20900 (output_base, output_table, output_check): Use it.
20901
6c89f1c1
AD
209022000-10-02 Akim Demaille <akim@epita.fr>
20903
20904 * src/output.c (output): Topological sort of the functions, in
20905 order to get rid of the `static' prototypes.
20906 No longer use `register'.
20907 * src/output.h: New file.
20908 Propagate its inclusion in files explicitly prototyping functions
20909 from output.c.
20910
d9efd181
AD
209112000-09-21 Akim Demaille <akim@epita.fr>
20912
20913 * src/atgeneral.m4: Update from Autoconf.
20914
c29240e7 209152000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
20916
20917 * src/closure.h: New file.
20918 * src/closure.c: Formatting changes, topological sort over the
20919 functions, use of closure.h.
20920 (initialize_closure, finalize_closure): Rename as...
20921 (new_closure, free_closure): these. Adjust dependencies.
20922 * src/LR0.c: Formatting changes, topological sort, use of
20923 cloture.h.
20924 (initialize_states): Rename as...
20925 (new_states): this.
20926 * src/Makefile.am (noinst_HEADERS): Adjust.
20927
499daa50
AD
209282000-09-20 Akim Demaille <akim@epita.fr>
20929
20930 * src/acconfig.h: Don't protect config.h against multiple
20931 inclusion.
20932 Don't define PARAMS.
20933 * src/system.h: Define PARAMS.
20934 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20935 purpose of config.h. system.h must not try to fix wrong
20936 definitions in config.h.
20937
cc84fd5d
AD
209382000-09-20 Akim Demaille <akim@epita.fr>
20939
20940 * src/derives.h: New file.
20941 * src/main.c, src/derives.h: Use it.
20942 Formatting changes.
20943 * src/Makefile.am (noinst_HEADERS): Adjust.
20944
db5b3a89
AD
209452000-09-20 Akim Demaille <akim@epita.fr>
20946
20947 * tests/atgeneral.m4: Update from Autoconf.
20948 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20949 (AT_CHECK_CALC): New macros.
20950 Use these macros to test bison with options `', `--raw',
20951 `--debug', `--yacc', `--yacc --debug'.
20952
ceed8467
AD
209532000-09-19 Akim Demaille <akim@epita.fr>
20954
20955 * src/output.c: Formatting changes.
20956 * src/machine.h: Remove, leaving its contents in...
20957 * src/system.h: here.
20958 Include stdio.h.
20959 Adjust all dependencies on stdio.h and machine.h.
20960 * src/getargs.h: New file.
20961 Let all `extern' declarations about getargs.c be replaced with
20962 inclusion of `getargs.h'.
20963 * src/Makefile.am (noinst_HEADERS): Adjust.
20964
20965 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20966 scope.
20967 (yyerror): Returns void, not int.
20968 * doc/bison.texinfo: Formatting changes.
20969
05a1d24b
AD
209702000-09-19 Akim Demaille <akim@epita.fr>
20971
20972 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20973 portable.
20974
cbd25751
AD
209752000-09-18 Akim Demaille <akim@epita.fr>
20976
20977 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20978 * src/Makefile.am (INCLUDES): Don't.
20979 Be ready to fetch headers in lib/.
20980
13863333
AD
209812000-09-18 Akim Demaille <akim@epita.fr>
20982
20983 * doc/bison.texinfo: Update the copyright.
20984 ANSIfy and GNUify the examples.
20985 Remove the old menu.
20986
0d533154
AD
209872000-09-18 Akim Demaille <akim@epita.fr>
20988
20989 First set of tests: use the `calc' example from the documentation.
20990
20991 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20992 is defined only when YYDEBUG is.
20993 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20994 * src/files.c (tryopen, tryclose): Formatting changes.
20995 Move to the top and be static.
20996 * src/reader.c (read_signed_integer): Likewise.
20997 * tests/calc.m4: New file.
20998 * Makefile.am, suite.m4: Adjust.
20999 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21000
e79137ac
AD
210012000-09-18 Akim Demaille <akim@epita.fr>
21002
21003 Add support for an Autotest test suite for Bison.
21004
21005 * m4/m4.m4, m4/atconfig.m4: New files.
21006 * m4/Makefile.am (EXTRA_DIST): Adjust.
21007 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21008 files.
21009 * src/getargs.c: Display a more standard --version message.
21010 * src/reader.c (reader): Formatting changes.
21011 No longer depend upon VERSION_STRING.
21012 * configure.in: No longer use `dnl'.
21013 Set up the test suite and the new directory `tests/.
21014 (VERSION_STRING): Remove.
21015
27821bff
AD
210162000-04-14 Akim Demaille <akim@epita.fr>
21017
21018 * src/reader.c (copy_comment2): New function, same as former
21019 `copy_comment', but outputs into two FILE *.
21020 (copy_comment): Use it.
21021 (parse_union_decl): Use it.
21022 (get_type, parse_start_decl): Use the same `invalid' message.
21023 (parse_start_decl, parse_union_decl): Use the same `multiple'
21024 message.
21025 (parse_union_decl, copy_guard, copy_action): Use the same
21026 `unmatched' message.
21027 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21028
cfe5fbc0
AD
210292000-03-31 Akim Demaille <akim@epita.fr>
21030
21031 * src/files.c (tryopen, tryclose): Move to the top.
21032 Be static.
21033
cb7db13e
AD
210342000-03-31 Akim Demaille <akim@epita.fr>
21035
21036 * src/main.c (main): Don't call `done', exit does it.
21037
a0f6b076
AD
210382000-03-31 Akim Demaille <akim@epita.fr>
21039
36281465
AD
21040 * allocate.c: s/return (foo)/return foo/.
21041 * lalr.c: Likewise.
21042 * LR0.c: Likewise.
21043 * output.c: Likewise.
21044 * reader.c: Likewise.
21045 * symtab.c: Likewise.
21046 * vmsgetargs.c: Likewise.
21047
210482000-03-31 Akim Demaille <akim@epita.fr>
21049
21050 Clean up the error reporting functions.
a0f6b076
AD
21051
21052 * src/report.c: New file.
21053 * src/report.h: Likewise.
21054 * src/Makefile.am: Adjust.
21055 * m4/error.m4: New file.
21056 * m4/Makefile.am: Adjust.
21057 * configure.in (jm_PREREQ_ERROR): Call it.
21058 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21059 Remove.
21060 (fatal, fatals): Remove. All callers use complain.c::fatal.
21061 (warn, warni, warns, warnss, warnss): Remove. All callers use
21062 complain.c::complain.
21063 (toomany): Remove, use fatal instead.
21064 * src/files.c (done): No argument, use complain_message_count.
21065 * src/main.c (main): Register `done' to `atexit'.
21066
21067 * src/getargs.c (usage): More `fputs', less `fprintf'.
21068
18539825
AD
210692000-03-28 Akim Demaille <akim@epita.fr>
21070
21071 * lib/: New directory.
21072 * Makefile.am (SUBDIRS): Adjust.
21073 * configure.in: Adjust.
21074 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21075 useless.
21076 * src/alloca.c: Moved to lib/.
21077 * src/getopt.c: Likewise.
21078 * src/getopt1.c: Likewise.
21079 * src/getopt.h: Likewise.
21080 * src/ansi2knr.c: Likewise.
21081 * src/ansi2knr.1: Likewise.
21082 * src/Makefile.am: Adjust.
21083 * lib/Makefile.am: New file.
21084
9f306f2a
AD
210852000-03-28 Akim Demaille <akim@epita.fr>
21086
21087 * src/getargs.c (usage): Refresh the help message.
21088
0ba347b6
AD
210892000-03-17 Akim Demaille <akim@epita.fr>
21090
21091 * src/getopt1.c: Updated from textutils 2.0e
21092 * src/getopt.c: Likewise.
21093 * src/getopt.h: Likewise.
21094
dbe7f271
AD
210952000-03-17 Akim Demaille <akim@epita.fr>
21096
21097 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21098 the file name, not the whole `#line LINE FILE'.
21099
75bbe78d
AD
211002000-03-17 Akim Demaille <akim@epita.fr>
21101
21102 On syntax errors, report the token on which we choked.
21103
aa5fd0ee
AD
21104 * src/bison.s1 (yyparse): In the label yyerrlab, when
21105 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 21106
7b306f52
AD
211072000-03-17 Akim Demaille <akim@epita.fr>
21108
aa5fd0ee 21109 * src/reader.c (copy_at): New function.
7b306f52
AD
21110 (copy_guard): Use it.
21111 (copy_action): Use it.
21112
e87b5700
AD
211132000-03-17 Akim Demaille <akim@epita.fr>
21114
21115 Be kind to translators, save some useless translations.
21116
aa5fd0ee 21117 * src/main.c (banner): New function.
e87b5700
AD
21118 (fatal_banner): Use it.
21119 (warn_banner): Use it.
21120
ae3c3164
AD
211212000-03-17 Akim Demaille <akim@epita.fr>
21122
aa5fd0ee
AD
21123 * src/reader.c (copy_definition): Use copy_string and
21124 copy_comment. Removed now unused `match', `ended',
21125 `cplus_comment'.
ae3c3164
AD
21126 (copy_comment, copy_string): Moved, to be visible from
21127 copy_definition.
21128
4dc58e7c
AD
211292000-03-17 Akim Demaille <akim@epita.fr>
21130
aa5fd0ee
AD
21131 * src/reader.c (copy_string): Declare `static inline'. No
21132 problems with inline, since it is checked by configure.
4dc58e7c
AD
21133 (copy_comment): Likewise.
21134
0a6384c4
AD
211352000-03-17 Akim Demaille <akim@epita.fr>
21136
aa5fd0ee 21137 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 21138
3cef001a
AD
211392000-03-17 Akim Demaille <akim@epita.fr>
21140
aa5fd0ee 21141 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
21142 (copy_action): Use it. Removed now unused `match', `ended',
21143 `cplus_comment'.
21144 (copy_guard): Likewise.
21145
ca36d2ef
AD
211462000-03-17 Akim Demaille <akim@epita.fr>
21147
aa5fd0ee 21148 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
21149 (copy_action): Use it.
21150 (copy_guard): Likewise.
21151
6666f98f
AD
211522000-03-17 Akim Demaille <akim@epita.fr>
21153
21154 Change the handling of @s so that they behave exactly like $s.
21155 There is now a pseudo variable @$ (readble and writable), location
21156 of the lhs of the rule (by default ranging from the location of
21157 the first symbol of the rhs, to the location of the last symbol,
21158 or, if the rhs is empty, YYLLOC).
21159
21160 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21161 yyval.
21162 (yyparse): When providing a default semantic action, provide a
21163 default location action.
21164 (after the $): No longer change `*YYLSP', just stack YYLOC the
21165 same way you stack YYVAL.
21166 * src/reader.c (read_declarations): Use warns.
21167 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21168 (copy_action, case '@'): Likewise.
21169 Use a standard error message, to save useless work from
21170 translators.
21171
41aca2e0
AD
211722000-03-17 Akim Demaille <akim@epita.fr>
21173
aa5fd0ee
AD
21174 * src/bison.s1: Formatting and cosmetics changes.
21175 * src/reader.c: Likewise.
41aca2e0
AD
21176 Update the Copyright notice.
21177
dc08c1d5
AD
211782000-03-17 Akim Demaille <akim@epita.fr>
21179
aa5fd0ee
AD
21180 * src/bison.s1 (#line): All set to `#line' only, since the
21181 Makefile now handles them.
dc08c1d5 21182
9ee3c97b
AD
211832000-03-16 Akim Demaille <akim@epita.fr>
21184
21185 * src/output.c (output_rule_data): Output the documentation of
21186 some of the tables.
21187 (Copyright notice): Update.
21188 Formatting changes.
21189
0de741ca
AD
211902000-03-16 Akim Demaille <akim@epita.fr>
21191
21192 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21193 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21194 One `#if YYDEBUG' remains, since it uses variables which are
21195 defined only if `YYDEBUG != 0'.
21196
bb10be54
AD
211972000-03-16 Akim Demaille <akim@epita.fr>
21198
21199 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21200 and related variables so that the similarities are highlighted.
21201
b07b484a
AD
212022000-03-16 Akim Demaille <akim@epita.fr>
21203
21204 * src/bison.s1: Properly indent CPP directives.
21205
361f60b3
AD
212062000-03-16 Akim Demaille <akim@epita.fr>
21207
21208 * src/bison.s1: Properly indent the `alloca' CPP section.
21209
8c44d3ec
AD
212102000-03-16 Akim Demaille <akim@epita.fr>
21211
21212 Do not hard code values of directories in `configure.in'.
21213 Update the `configure' tool chain.
21214
21215 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21216 src/makefile.am.
21217 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21218 (AC_OUTPUT): Add m4/Makefile.
21219 Bump to bison 1.28a, 1.29 has never been released.
21220 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21221 handled via src/Makefile.am.
21222 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21223 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21224 autoheader.
21225 * Makefile.am (SUBDIRS): Add m4.
21226 (ACLOCAL_AM_FLAGS): New variable.
21227 (AUTOMAKE_OPTIONS): Add check-news.
21228 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21229 the proper line number and file name.
21230 (DEFS): Propagate the location of bison library files and of the
21231 locale files.
21232 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21233 builddir.
21234 * acinclude.m4: Remove, replaced by the directory m4.
21235 * m4/Makefile.am (EXTRA_DIST): New variable.
21236 * m4/gettext.m4: New file, from the fileutils.
21237 * m4/lcmessage.m4: Likewise
21238 * m4/progtest.m4: Likewise.
21239 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21240
f95997e7
AD
212412000-03-10 Akim Demaille <akim@epita.fr>
21242
21243 * src/closure.c:
21244 Formatting changes of various comments.
21245 Respect the GNU coding standards at various places.
21246 Don't use `_()' when no translation is needed.
21247
212481999-12-13 Jesse Thilo <jthilo@gnu.org>
21249
21250 * src/files.c:
21251 OS/2 honors TMPDIR environment variable.
21252
212531999-12-13 Jesse Thilo <jthilo@gnu.org>
21254
21255 * doc/bison.texinfo: Tweaked spelling and grammar.
21256 Updated ISBN.
21257 Removed reference to price of printed copy.
21258 Mention BISON_SIMPLE and BISON_HAIRY.
21259
212601999-12-13 Jesse Thilo <jthilo@gnu.org>
21261
21262 * configure.in, NEWS:
21263 Bison 1.29 released.
21264
212651999-10-27 Jesse Thilo <jthilo@gnu.org>
21266
21267 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21268 Added reference card.
21269
212701999-07-26 Jesse Thilo <jthilo@gnu.org>
21271
21272 * po/ru.po: Added Russian translation.
21273
212741999-07-26 Jesse Thilo <jthilo@gnu.org>
21275
21276 * configure.in: Added Russian translation.
21277
212781999-07-06 Jesse Thilo <jthilo@gnu.org>
21279
21280 * configure.in, NEWS, README:
21281 Released version 1.28.
21282
212831999-06-14 Jesse Thilo <jthilo@gnu.org>
21284
21285 * src/system.h:
21286 Squashed redefinition warning on some systems.
21287
21288 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21289 Have configure build version string instead of relying on ANSI string
21290 concatentation.
21291
212921999-06-14 Jesse Thilo <jthilo@gnu.org>
21293
21294 * po/POTFILES.in: Got rid of version.c.
21295
212961999-06-14 Jesse Thilo <jthilo@gnu.org>
21297
21298 * acconfig.h, configure.in:
21299 Have configure build version string instead of relying on ANSI string
21300 concatentation.
21301
213021999-06-08 Jesse Thilo <jthilo@gnu.org>
21303
21304 * doc/bison.1:
21305 Dropped mention of `+' for long-named options.
21306
213071999-05-30 Jesse Thilo <jthilo@gnu.org>
21308
21309 * src/files.c: Added <unistd.h> for unlink().
21310
21311 * src/Makefile.am, src/system.h:
21312 I18n fixes.
21313
213141999-05-30 Jesse Thilo <jthilo@gnu.org>
21315
21316 * README: Added a FAQ list.
21317
21318 * configure.in, acconfig.h:
21319 I18n fixes.
21320
213211999-05-30 Jesse Thilo <jthilo@gnu.org>
21322
21323 * doc/FAQ, doc/Makefile.am:
21324 Added a FAQ list.
21325
213261999-05-19 Jesse Thilo <jthilo@gnu.org>
21327
21328 * src/alloc.h, src/symtab.h, src/version.c:
21329 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21330
213311999-04-18 Jesse Thilo <jthilo@gnu.org>
21332
21333 * src/.cvsignore, src/Makefile.am:
21334 Reorganized: sources in `src', documentation in `doc'.
21335
21336 * src/lex.c (literalchar):
21337 fixed the code for escaping double quotes (thanks
21338 Jonathan Czisny.)
21339
213401999-04-18 Jesse Thilo <jthilo@gnu.org>
21341
21342 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21343 Adjusted paths to reflect directory reorganization.
21344
213451999-04-18 Jesse Thilo <jthilo@gnu.org>
21346
21347 * doc/.cvsignore, doc/Makefile.am:
21348 Reorganized: sources in `src', documentation in `doc'.
21349
213501999-04-18 Jesse Thilo <jthilo@gnu.org>
21351
21352 * configure.in:
21353 Updated AC_INIT file to reflect directory reorganization.
21354
21355 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21356 Reorganized: sources in `src', documentation in `doc'.
21357
213581999-04-13 Jesse Thilo <jthilo@gnu.org>
21359
21360 * src/allocate.c:
21361 Don't declare calloc() and realloc() if not necessary.
21362
213631999-04-13 Jesse Thilo <jthilo@gnu.org>
21364
21365 * configure.in, acconfig.h, acinclude.m4:
21366 Don't declare calloc() and realloc() if not necessary.
21367
213681999-03-23 Jesse Thilo <jthilo@gnu.org>
21369
21370 * po/.cvsignore: Added i18n support.
21371
213721999-03-23 Jesse Thilo <jthilo@gnu.org>
21373
21374 * acconfig.h, configure.in, Makefile.am:
21375 Added i18n support.
21376
213771999-03-22 Jesse Thilo <jthilo@gnu.org>
21378
21379 * src/bison.s1: Fixed #line numbers.
21380
213811999-03-15 Jesse Thilo <jthilo@gnu.org>
21382
21383 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21384 Added PO files from Translation Project.
21385
213861999-03-03 Jesse Thilo <jthilo@gnu.org>
21387
21388 * Makefile.am:
21389 Added support for non-ANSI compilers (ansi2knr).
21390
213911999-02-16 Jesse Thilo <jthilo@gnu.org>
21392
21393 * configure.in: Bumped version number to 1.27.
21394
21395 * Makefile.am:
21396 Added `bison.simple' to list of files removed by `make distclean'.
21397
213981999-02-12 Jesse Thilo <jthilo@gnu.org>
21399
21400 * src/files.c, src/files.h:
21401 Defined locations of parser files in config.h instead of Makefile.
21402
214031999-02-12 Jesse Thilo <jthilo@gnu.org>
21404
21405 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21406 Defined locations of parser files in config.h instead of Makefile.
21407
214081999-02-09 Jesse Thilo <jthilo@gnu.org>
21409
21410 * Makefile.am:
21411 Removed inappropriate use of $< macro.
21412
214131999-02-05 Jesse Thilo <jthilo@gnu.org>
21414
21415 * po/Makefile.in.in, po/POTFILES.in:
21416 Add `po' directory skeleton.
21417
214181999-01-27 Jesse Thilo <jthilo@gnu.org>
21419
21420 * README: Document help-bison list.
21421
21422 * configure.in: Add check for mkstemp().
21423
214241999-01-20 Jesse Thilo <jthilo@gnu.org>
21425
21426 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21427 Hush a few compiler warnings.
21428
21429 * src/files.c:
21430 Add tryclose(), which verifies that fclose was successful.
21431 Hush a couple of compiler warnings.
21432
214331999-01-20 Jesse Thilo <jthilo@gnu.org>
21434
21435 * Makefile.am, OChangeLog:
21436 ChangeLog is now automatically generated. Include the old version as
21437 OChangeLog.
21438
214391999-01-14 Jesse Thilo <jthilo@gnu.org>
21440
21441 * 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:
21442 Update FSF address.
21443
214441999-01-14 Jesse Thilo <jthilo@gnu.org>
21445
21446 * doc/bison.texinfo: Fix formatting glitch.
21447
21448 * doc/bison.texinfo: Update FSF address.
21449
214501999-01-14 Jesse Thilo <jthilo@gnu.org>
21451
21452 * acconfig.h: Update FSF address.
21453
214541999-01-08 Jesse Thilo <jthilo@gnu.org>
21455
21456 * src/system.h:
21457 Don't define PACKAGE here, since config.h defines it.
21458
214591998-12-30 Jesse Thilo <jthilo@gnu.org>
21460
21461 * src/reader.c: Update copyright date.
21462
21463 * src/main.c:
21464 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21465 favor of output directly to stderr (avoids buffer overruns).
21466
21467 * src/reader.c: Some checks for premature EOF.
21468
21469 * 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:
21470 Use prototypes if the compiler understands them.
21471
21472 * src/files.c: Honor TMPDIR on Unix hosts.
21473 Use prototypes if the compiler understands them.
21474
21475 * src/reader.c:
21476 Fix a couple of buffer overrun bugs.
21477 Use prototypes if the compiler understands them.
21478
21479 * src/system.h: Include unistd.h and ctype.h.
21480 Use #ifdef instead of #if for NLS symbols.
21481
214821998-12-30 Jesse Thilo <jthilo@gnu.org>
21483
21484 * doc/bison.texinfo:
21485 Delete comment "consider using @set for edition number, etc..." since
21486 we now are doing so.
21487
214881998-12-30 Jesse Thilo <jthilo@gnu.org>
21489
21490 * configure.in:
21491 Use prototypes if the compiler understands them.
21492
21493 * NEWS: Document 1.26 highlights.
21494
21495 * Makefile.am: Require Automake 1.3 or later.
21496
21497 * acconfig.h:
21498 Use prototypes if the compiler understands them.
21499
215001998-12-29 Jesse Thilo <jthilo@gnu.org>
21501
21502 * src/version.c:
21503 Use VERSION symbol from automake for version number.
21504
215051998-12-29 Jesse Thilo <jthilo@gnu.org>
21506
21507 * acconfig.h, configure.in, version.cin:
21508 Use VERSION symbol from automake for version number.
21509
215101998-11-28 Jesse Thilo <jthilo@gnu.org>
21511
21512 * Makefile.am:
21513 Distribute original version of simple parser (bison.s1), not built
21514 version (bison.simple).
21515
215161998-11-28 Jesse Thilo <jthilo@gnu.org>
21517
21518 * doc/bison.texinfo: Add info dir entry.
21519
21520 * doc/bison.texinfo:
21521 Let automake put version number into documentation.
21522
215231998-11-26 Jesse Thilo <jthilo@gnu.org>
21524
21525 * src/bison.cld, src/build.com, src/vmshlp.mar:
21526 Add non-RCS files from /gd/gnu/bison.
21527
215281998-11-26 Jesse Thilo <jthilo@gnu.org>
21529
21530 * doc/bison.1:
21531 Document the BISON_HAIRY and BISON_SIMPLE variables.
21532
215331998-11-25 Jesse Thilo <jthilo@gnu.org>
21534
21535 * src/version.c: Build version.c automatically.
21536
21537 * src/reader.c:
21538 Fix token numbering (used to start at 258, not 257).
21539
21540 * src/system.h: Include config.h.
21541
21542 * src/getargs.c: Update bug report address.
21543
21544 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21545 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21546
215471998-11-25 Jesse Thilo <jthilo@gnu.org>
21548
21549 * Makefile.am:
21550 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21551
21552 * configure.in, version.cin:
21553 Build version.c automatically.
21554
21555 * AUTHORS: Add AUTHORS file.
21556
21557 * README: Update bug report address.
21558
21559 * bison.simple:
21560 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21561
21562 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21563 Add automake stuff.
21564
215651998-11-25 Jesse Thilo <jthilo@gnu.org>
21566
21567 * doc/bison.texinfo: Clean up some formatting.
21568
215691998-05-05 Richard Stallman <rms@gnu.org>
21570
21571 * doc/bison.texinfo:
21572 Explain better why to make a pure parser.
21573
215741998-01-05 Richard Stallman <rms@gnu.org>
21575
21576 * src/files.c (openfiles):
21577 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21578 find a temporary directory, if possible. Do not unlink files while
21579 they are open.
21580
215811997-08-25 Richard Stallman <rms@gnu.org>
21582
21583 * src/reader.c (stack_offset;):
21584 Change some warni to warns.
21585
21586 * src/lex.c (literalchar): Use warns, not warni.
21587
215881997-06-28 Richard Stallman <rms@gnu.org>
21589
21590 * src/bison.s1: Add a Bison version comment.
21591
21592 * src/main.c (fatal, warn, berror):
21593 Use program_name.
21594
215951997-06-28 Richard Stallman <rms@gnu.org>
21596
21597 * Makefile.in (bison_version): New variable.
21598 (dist): Use that variable.
21599 (bison.s1): Substitute the Bison version into bison.simple.
21600
21601 * bison.simple: Add a Bison version comment.
21602
216031997-06-18 Richard Stallman <rms@gnu.org>
21604
21605 * src/main.c (fatal, warn, berror):
21606 Make error messages standard.
21607 (toomany): Improve error message text.
21608
21609 * 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:
21610 new.h renamed to alloc.h.
21611
216121997-06-18 Richard Stallman <rms@gnu.org>
21613
21614 * Makefile.in: new.h renamed to alloc.h.
21615
216161997-05-24 Richard Stallman <rms@gnu.org>
21617
21618 * src/lex.c (literalchar):
21619 Fix the code for escaping \, " and '.
21620
21621 (lex): Avoid trouble when there are many chars
21622 to discard in a char literal with just several chars in it.
21623
216241997-05-17 Richard Stallman <rms@gnu.org>
21625
21626 * src/bison.s1:
21627 Use malloc, if using alloca is troublesome.
21628 (YYSTACK_USE_ALLOCA): New flag macro.
21629 Define it for some systems and compilers.
21630 (YYSTACK_ALLOC): New macro.
21631 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21632 If it was malloc'd, free it.
21633
216341997-05-17 Richard Stallman <rms@gnu.org>
21635
21636 * bison.simple:
21637 Use malloc, if using alloca is troublesome.
21638 (YYSTACK_USE_ALLOCA): New flag macro.
21639 Define it for some systems and compilers.
21640 (YYSTACK_ALLOC): New macro.
21641 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21642 If it was malloc'd, free it.
21643
216441997-04-23 Richard Stallman <rms@gnu.org>
21645
21646 * src/bison.s1:
21647 (alloca) [__hpux]: Always define as __builtin_alloca.
21648
216491997-04-23 Richard Stallman <rms@gnu.org>
21650
21651 * bison.simple:
21652 (alloca) [__hpux]: Always define as __builtin_alloca.
21653
216541997-04-22 Richard Stallman <rms@gnu.org>
21655
21656 * src/bison.s1:
21657 [__hpux]: Include alloca.h (right for HPUX 10)
21658 instead of declaring alloca (right for HPUX 9).
21659
21660 * src/bison.s1 (__yy_memcpy):
21661 Declare arg `count' as unsigned int.
21662 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21663
216641997-04-22 Richard Stallman <rms@gnu.org>
21665
21666 * bison.simple:
21667 [__hpux]: Include alloca.h (right for HPUX 10)
21668 instead of declaring alloca (right for HPUX 9).
21669
21670 * bison.simple (__yy_memcpy):
21671 Declare arg `count' as unsigned int.
21672 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21673
216741997-01-03 Richard Stallman <rms@gnu.org>
21675
21676 * src/allocate.c: [__STDC__ or _MSC_VER]:
21677 Declare calloc and realloc to return void *.
21678
216791997-01-02 Richard Stallman <rms@gnu.org>
21680
21681 * src/system.h:
21682 [_MSC_VER]: Include stdlib.h and process.h.
21683 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21684
21685 * src/main.c (main): Return FAILURE as a value.
21686 (printable_version): Declare arg as int, not char.
21687
216881997-01-02 Richard Stallman <rms@gnu.org>
21689
21690 * Makefile.in (dist):
21691 Explicitly check for symlinks, and copy them.
21692
216931996-12-19 Richard Stallman <rms@gnu.org>
21694
21695 * src/files.c:
21696 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21697
216981996-12-18 Paul Eggert <eggert@gnu.org>
21699
21700 * src/bison.s1 (yyparse):
21701 If __GNUC__ and YYPARSE_PARAM are both defined,
21702 declare yyparse to have a void * argument.
21703
217041996-12-18 Paul Eggert <eggert@gnu.org>
21705
21706 * bison.simple (yyparse):
21707 If __GNUC__ and YYPARSE_PARAM are both defined,
21708 declare yyparse to have a void * argument.
21709
217101996-12-17 Richard Stallman <rms@gnu.org>
21711
21712 * src/reduce.c (nbits): Add some casts.
21713
217141996-08-12 Richard Stallman <rms@gnu.org>
21715
21716 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21717
217181996-08-12 Richard Stallman <rms@gnu.org>
21719
21720 * bison.simple: Test _MSDOS as well as _MSDOS_.
21721
217221996-07-31 Richard Stallman <rms@gnu.org>
21723
21724 * src/bison.s1:
21725 [__sun && __i386]: Include alloca.h.
21726
217271996-07-31 Richard Stallman <rms@gnu.org>
21728
21729 * bison.simple:
21730 [__sun && __i386]: Include alloca.h.
21731
217321996-07-30 Richard Stallman <rms@gnu.org>
21733
21734 * src/bison.s1: Comment change.
21735
21736 * src/bison.s1: Test _MSDOS_, not MSDOS.
21737
217381996-07-30 Richard Stallman <rms@gnu.org>
21739
21740 * bison.simple: Comment change.
21741
21742 * bison.simple: Test _MSDOS_, not MSDOS.
21743
217441996-06-01 Richard Stallman <rms@gnu.org>
21745
21746 * 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:
21747 Insert `_' macro around many string constants.
21748
21749 * src/main.c:
21750 Insert `_' macro around many string constants.
21751
21752 (main): Call setlocale, bindtextdomain and textdomain.
21753
21754 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21755 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21756 [ENABLE_NLS]: Include libintl.h.
21757 [ENABLE_NLS] (gettext): Define.
21758 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21759 (N_, PACKAGE, LOCALEDIR): New macros.
21760
217611996-06-01 Richard Stallman <rms@gnu.org>
21762
21763 * POTFILES.in: New file.
21764
21765 * Makefile.in (allocate.o):
21766 Define target explicitly.
21767
21768 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21769 (LDFLAGS): Set to @LDFLAGS@.
21770 (configure): Run autoconf only if preceding `cd' succeeds.
21771 (bison.s1): Redirect output to temporary file then move the
21772 temporary to the target, rather than redirecting directly to bison.s1.
21773 (clean): Remove config.status and config.log.
21774 (distclean): Don't remove config.status here.
21775
217761996-05-12 Richard Stallman <rms@gnu.org>
21777
21778 * src/bison.s1:
21779 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21780
217811996-05-12 Richard Stallman <rms@gnu.org>
21782
21783 * bison.simple:
21784 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21785
217861996-05-11 Richard Stallman <rms@gnu.org>
21787
21788 * src/bison.s1 (__yy_memcpy):
21789 Really reorder the args, as was supposedly done on Feb 14 1995.
21790 (yyparse): Calls changed accordingly.
21791
217921996-05-11 Richard Stallman <rms@gnu.org>
21793
21794 * Makefile.in (dist): Don't use $(srcdir).
21795
21796 * bison.simple (__yy_memcpy):
21797 Really reorder the args, as was supposedly done on Feb 14 1995.
21798 (yyparse): Calls changed accordingly.
21799
218001996-01-27 Richard Stallman <rms@gnu.org>
21801
21802 * src/output.c (output_rule_data):
21803 Test YYERROR_VERBOSE in the conditional
21804 around the definition of ttyname.
21805
218061995-12-29 Richard Stallman <rms@gnu.org>
21807
21808 * src/bison.s1:
21809 Fix line numbers in #line commands.
21810
218111995-12-29 Richard Stallman <rms@gnu.org>
21812
21813 * bison.simple:
21814 Fix line numbers in #line commands.
21815
218161995-12-27 Richard Stallman <rms@gnu.org>
21817
21818 * src/bison.s1 (YYPARSE_PARAM_DECL):
21819 In C++, make it always null.
21820 (YYPARSE_PARAM_ARG): New macro.
21821 (yyparse): Use YYPARSE_PARAM_ARG.
21822
218231995-12-27 Richard Stallman <rms@gnu.org>
21824
21825 * bison.simple (YYPARSE_PARAM_DECL):
21826 In C++, make it always null.
21827 (YYPARSE_PARAM_ARG): New macro.
21828 (yyparse): Use YYPARSE_PARAM_ARG.
21829
218301995-11-29 Richard Stallman <rms@gnu.org>
21831
21832 * doc/bison.texinfo:
21833 Describe literal string tokens, %raw, %no_lines, %token_table.
21834
218351995-11-29 Daniel Hagerty <hag@gnu.org>
21836
21837 * doc/bison.texinfo: Fixed update date
21838
218391995-10-16 Richard Stallman <rms@gnu.org>
21840
21841 * src/version.c: Version 1.25.
21842
218431995-10-16 Richard Stallman <rms@gnu.org>
21844
21845 * NEWS: *** empty log message ***
21846
218471995-10-16 Richard Stallman <rms@gnu.org>
21848
21849 * doc/bison.1, doc/bison.rnh:
21850 Add new options.
21851
218521995-10-15 Richard Stallman <rms@gnu.org>
21853
21854 * src/vmsgetargs.c, src/getargs.c:
21855 Added -n, -k, and -raw switches.
21856 (noparserflag, toknumflag, rawtoknumflag): New variables.
21857
21858 * src/symtab.h (SALIAS):
21859 New #define for adding aliases to %token.
21860 (struct bucket): Added `alias' field.
21861
21862 * src/reduce.c (reduce_grammar):
21863 Revise error message.
21864 (print_notices): Remove final `.' from error message.
21865
21866 * src/reader.c (reader_output_yylsp):
21867 New function.
21868 (readgram): Use `#if 0' around code that accepted %command
21869 inside grammar rules: The documentation doesn't allow it,
21870 and it will fail since the %command processors scan for the next %.
21871 (parse_token_decl): Extended the %token
21872 declaration to allow a multi-character symbol as an alias.
21873 (parse_thong_decl): New function.
21874 (read_declarations): Added %thong declarations.
21875 (read_declarations): Handle NOOP to deal with allowing
21876 % declarations as another means to specify the flags.
21877 (readgram): Allow %prec prior to semantics embedded in a rule.
21878 (skip_to_char, read_declarations, copy_definition)
21879 (parse_token_decl, parse_start_decl, parse_type_decl)
21880 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21881 (get_type_name, copy_guard, copy_action, readgram)
21882 (get_type, packsymbols): Revised most error messages.
21883 Changed `fatal' to `warnxxx' to avoid aborting for error.
21884 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21885 (read_declarations): Improve the error message for
21886 an invalid character. Do not abort.
21887 (read_declarations, copy_guard, copy_action): Use
21888 printable_version to avoid unprintable characters in printed output.
21889 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21890 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21891 Allow the type of a non-terminal can be given
21892 more than once, as long as all specifications give the same type.
21893
21894 * src/output.c:
21895 (output_headers, output_trailers, output, output_gram)
21896 (output_rule_data): Implement noparserflag variable.
21897 Implement toknumflag variable.
21898 (output): Call reader_output_yylsp to output LTYPESTR.
21899
21900 * src/main.c (main):
21901 If reader sees an error, don't process the grammar.
21902 (fatals): Updated to not use VARARGS1.
21903 (printable_version, int_to_string, warn, warni, warns, warnss)
21904 (warnsss): New error reporting functions. Avoid abort for error.
21905
21906 * src/lex.h:
21907 Added THONG and NOOP for alias processing.
21908 Added SETOPT for the new code that allows setting options with %flags.
21909
21910 * src/lex.c:
21911 Include getopt.h. Add some extern decls.
21912 (safegetc): New function to deal with EOF gracefully.
21913 (literalchar); new function to deal with reading \ escapes.
21914 (lex): Use literalchar.
21915 (lex): Implemented "..." tokens.
21916 (literalchar, lex, parse_percent_token): Made tokenbuffer
21917 always contain the token. This includes growing the token
21918 buffer while reading an integer.
21919 (parse_percent_token): Replaced if-else statement with percent_table.
21920 (parse_percent_token): Added % declarations as another
21921 way to specify the flags -n, -l, and -r. Also added hooks for
21922 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21923 major changes to files.c.
21924 (lex) Retain in the incoming stream a character following
21925 an incorrect '/'.
21926 (skip_white_space, lex): Revised most error messages
21927 and changed fatal to warn to avoid aborting.
21928 (percent_table): Added %thong declarations.
21929
21930 * src/gram.h: Comment changes.
21931
21932 * src/files.c (openfiles, open_extra_files, done):
21933 Add faction flag
21934 and actfile file. Handle noparserflag. Both for -n switch.
21935
21936 * src/conflicts.c (resolve_sr_conflict):
21937 Remove use of alloca.
21938
219391995-06-01 Jim Meyering <meyering@gnu.org>
21940
21941 * doc/bison.texinfo: *** empty log message ***
21942
219431995-05-06 Richard Stallman <rms@gnu.org>
21944
21945 * src/bison.s1: Comment change.
21946
219471995-05-06 Richard Stallman <rms@gnu.org>
21948
21949 * bison.simple: Comment change.
21950
219511995-05-03 Richard Stallman <rms@gnu.org>
21952
21953 * src/version.c: Version now 1.24.
21954
21955 * src/bison.s1: Change distribution terms.
21956
21957 * src/version.c: Version now 1.23.
21958
219591995-05-03 Richard Stallman <rms@gnu.org>
21960
21961 * doc/bison.texinfo:
21962 Rewrite "Conditions for Using Bison".
21963 Update version to 1.24.
21964
219651995-05-03 Richard Stallman <rms@gnu.org>
21966
21967 * bison.simple: Change distribution terms.
21968
219691995-02-23 Richard Stallman <rms@gnu.org>
21970
21971 * src/files.c: Test __VMS_POSIX as well as VMS.
21972
219731995-02-14 Jim Meyering <meyering@gnu.org>
21974
21975 * src/bison.s1 (__yy_memcpy):
21976 Renamed from __yy_bcopy to avoid
21977 confusion. Reverse FROM and TO arguments to be consistent with
21978 those of memcpy.
21979
219801995-02-14 Jim Meyering <meyering@gnu.org>
21981
21982 * bison.simple (__yy_memcpy):
21983 Renamed from __yy_bcopy to avoid
21984 confusion. Reverse FROM and TO arguments to be consistent with
21985 those of memcpy.
21986
219871994-11-10 David J. MacKenzie <djm@gnu.org>
21988
21989 * NEWS: reformat
21990
21991 * NEWS: New file.
21992
21993 * Makefile.in (DISTFILES): Include NEWS.
21994
21995 * Makefile.in (DISTFILES):
21996 Include install-sh, not install.sh.
21997
21998 * configure.in: Update to Autoconf v2 macro names.
21999
220001994-10-05 David J. MacKenzie <djm@gnu.org>
22001
22002 * Makefile.in: fix typo
22003
22004 * Makefile.in (prefix, exec_prefix):
22005 Let configure set them.
22006
220071994-09-28 David J. MacKenzie <djm@gnu.org>
22008
22009 * Makefile.in: Set datadir to $(prefix)/share.
22010
220111994-09-15 Richard Stallman <rms@gnu.org>
22012
22013 * src/bison.s1:
22014 Update copyright notice and GPL version.
22015
220161994-09-15 Richard Stallman <rms@gnu.org>
22017
22018 * bison.simple:
22019 Update copyright notice and GPL version.
22020
220211994-07-12 Richard Stallman <rms@gnu.org>
22022
22023 * src/reduce.c, src/reader.c:
22024 entered into RCS
22025
220261994-05-05 David J. MacKenzie <djm@gnu.org>
22027
22028 * Makefile.in: entered into RCS
22029
220301994-03-26 Richard Stallman <rms@gnu.org>
22031
22032 * src/bison.s1: entered into RCS
22033
220341994-03-26 Richard Stallman <rms@gnu.org>
22035
22036 * bison.simple: entered into RCS
22037
220381994-03-25 Richard Stallman <rms@gnu.org>
22039
22040 * src/main.c: entered into RCS
22041
220421994-03-24 Richard Stallman <rms@gnu.org>
22043
22044 * src/conflicts.c: entered into RCS
22045
220461994-01-02 Richard Stallman <rms@gnu.org>
22047
22048 * Makefile.in: *** empty log message ***
22049
220501993-11-21 Richard Stallman <rms@gnu.org>
22051
22052 * src/bison.s1: *** empty log message ***
22053
220541993-11-21 Richard Stallman <rms@gnu.org>
22055
22056 * doc/bison.texinfo: entered into RCS
22057
22058 * doc/bison.texinfo: *** empty log message ***
22059
220601993-11-21 Richard Stallman <rms@gnu.org>
22061
22062 * bison.simple: *** empty log message ***
22063
220641993-10-25 David J. MacKenzie <djm@gnu.org>
22065
22066 * doc/bison.texinfo: *** empty log message ***
22067
220681993-10-19 Richard Stallman <rms@gnu.org>
22069
22070 * src/bison.s1: *** empty log message ***
22071
220721993-10-19 Richard Stallman <rms@gnu.org>
22073
22074 * bison.simple: *** empty log message ***
22075
220761993-10-14 Richard Stallman <rms@gnu.org>
22077
22078 * src/bison.s1: *** empty log message ***
22079
220801993-10-14 Richard Stallman <rms@gnu.org>
22081
22082 * bison.simple: *** empty log message ***
22083
220841993-09-14 David J. MacKenzie <djm@gnu.org>
22085
22086 * doc/bison.texinfo: *** empty log message ***
22087
220881993-09-13 Noah Friedman <friedman@gnu.org>
22089
22090 * Makefile.in: *** empty log message ***
22091
220921993-09-10 Richard Stallman <rms@gnu.org>
22093
22094 * src/conflicts.c: *** empty log message ***
22095
22096 * src/system.h: entered into RCS
22097
220981993-09-10 Richard Stallman <rms@gnu.org>
22099
22100 * doc/bison.1: entered into RCS
22101
221021993-09-06 Noah Friedman <friedman@gnu.org>
22103
22104 * src/version.c: entered into RCS
22105
221061993-09-06 Noah Friedman <friedman@gnu.org>
22107
22108 * Makefile.in: *** empty log message ***
22109
221101993-07-30 David J. MacKenzie <djm@gnu.org>
22111
22112 * Makefile.in: *** empty log message ***
22113
221141993-07-24 Richard Stallman <rms@gnu.org>
22115
22116 * src/bison.s1: *** empty log message ***
22117
221181993-07-24 Richard Stallman <rms@gnu.org>
22119
22120 * bison.simple: *** empty log message ***
22121
221221993-07-08 David J. MacKenzie <djm@gnu.org>
22123
22124 * Makefile.in: *** empty log message ***
22125
221261993-07-04 Richard Stallman <rms@gnu.org>
22127
22128 * src/bison.s1: *** empty log message ***
22129
221301993-07-04 Richard Stallman <rms@gnu.org>
22131
22132 * bison.simple: *** empty log message ***
22133
221341993-06-26 David J. MacKenzie <djm@gnu.org>
22135
22136 * src/getargs.c: entered into RCS
22137
221381993-06-26 David J. MacKenzie <djm@gnu.org>
22139
22140 * doc/bison.texinfo: *** empty log message ***
22141
22142 * doc/bison.1: New file.
22143
221441993-06-25 Richard Stallman <rms@gnu.org>
22145
22146 * src/getargs.c: New file.
22147
221481993-06-16 Richard Stallman <rms@gnu.org>
22149
22150 * src/bison.s1: *** empty log message ***
22151
221521993-06-16 Richard Stallman <rms@gnu.org>
22153
22154 * bison.simple: *** empty log message ***
22155
221561993-06-03 Richard Stallman <rms@gnu.org>
22157
22158 * src/bison.s1: New file.
22159
221601993-06-03 Richard Stallman <rms@gnu.org>
22161
22162 * doc/bison.texinfo: *** empty log message ***
22163
221641993-06-03 Richard Stallman <rms@gnu.org>
22165
22166 * bison.simple: New file.
22167
221681993-05-19 Richard Stallman <rms@gnu.org>
22169
22170 * doc/bison.texinfo: New file.
22171
221721993-05-07 Noah Friedman <friedman@gnu.org>
22173
22174 * Makefile.in: *** empty log message ***
22175
221761993-04-28 Noah Friedman <friedman@gnu.org>
22177
22178 * src/reader.c: *** empty log message ***
22179
221801993-04-23 Noah Friedman <friedman@gnu.org>
22181
22182 * src/alloc.h: entered into RCS
22183
221841993-04-20 David J. MacKenzie <djm@gnu.org>
22185
22186 * src/version.c: *** empty log message ***
22187
22188 * src/files.c, src/allocate.c:
22189 entered into RCS
22190
22191 * src/reader.c: *** empty log message ***
22192
22193 * src/lex.c: entered into RCS
22194
22195 * src/conflicts.c: New file.
22196
22197 * src/symtab.c: entered into RCS
22198
22199 * src/alloc.h: New file.
22200
22201 * src/LR0.c: entered into RCS
22202
222031993-04-18 Noah Friedman <friedman@gnu.org>
22204
22205 * src/reader.c: New file.
22206
22207 * src/version.c: *** empty log message ***
22208
222091993-04-18 Noah Friedman <friedman@gnu.org>
22210
22211 * Makefile.in: *** empty log message ***
22212
222131993-04-17 Noah Friedman <friedman@gnu.org>
22214
22215 * Makefile.in: *** empty log message ***
22216
222171993-04-15 Richard Stallman <rms@gnu.org>
22218
22219 * src/main.c, src/files.c:
22220 New file.
22221
222221993-04-15 Noah Friedman <friedman@gnu.org>
22223
22224 * configure.in: entered into RCS
22225
22226 * configure.in: *** empty log message ***
22227
22228 * configure.in: New file.
22229
222301993-04-14 Richard Stallman <rms@gnu.org>
22231
22232 * Makefile.in: New file.
22233
222341993-04-13 Richard Stallman <rms@gnu.org>
22235
22236 * src/version.c: New file.
22237
222381993-03-25 Richard Stallman <rms@gnu.org>
22239
22240 * src/output.c: entered into RCS
22241
222421992-09-25 Richard Stallman <rms@gnu.org>
22243
22244 * configure.bat: entered into RCS
22245
222461992-06-22 Richard Stallman <rms@gnu.org>
22247
22248 * src/vmsgetargs.c: entered into RCS
22249
222501992-06-22 Richard Stallman <rms@gnu.org>
22251
22252 * doc/bison.rnh: entered into RCS
22253
222541992-04-20 David J. MacKenzie <djm@gnu.org>
22255
22256 * README: entered into RCS
22257
222581992-01-22 Richard Stallman <rms@gnu.org>
22259
22260 * src/machine.h: entered into RCS
22261
222621991-12-21 Richard Stallman <rms@gnu.org>
22263
22264 * src/lalr.c, src/closure.c:
22265 entered into RCS
22266
222671991-12-20 Richard Stallman <rms@gnu.org>
22268
22269 * src/state.h: entered into RCS
22270
222711991-12-18 Richard Stallman <rms@gnu.org>
22272
22273 * src/print.c, src/nullable.c, src/derives.c:
22274 entered into RCS
22275
222761991-11-03 David J. MacKenzie <djm@gnu.org>
22277
22278 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22279 entered into RCS
22280
222811988-09-09 Richard Stallman <rms@gnu.org>
22282
22283 * src/bison.hairy: entered into RCS
22284
222851987-12-16 Richard Stallman <rms@gnu.org>
22286
22287 * REFERENCES: entered into RCS
dc546b0f 22288
f294a2c2 22289
04098407 22290 -----
f294a2c2 22291
04098407 22292 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
9126263e 22293 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
95021767 22294 Free Software Foundation, Inc.
f294a2c2 22295
04098407
PE
22296 Copying and distribution of this file, with or without
22297 modification, are permitted provided the copyright notice and this
22298 notice are preserved.