]> git.saurik.com Git - bison.git/blob - ChangeLog
TODO: YYPRINT.
[bison.git] / ChangeLog
1 2008-11-13 Akim Demaille <demaille@gostai.com>
2
3 TODO: YYPRINT.
4 * TODO (YYPRINT): New.
5
6 2008-11-13 Akim Demaille <demaille@gostai.com>
7
8 Comment changes.
9 * data/lalr1.cc, data/yacc.c: Fix the description of the
10 yytranslate and yytoknum tables.
11
12 2008-11-13 Akim Demaille <demaille@gostai.com>
13
14 Define make_symbol in the header.
15 To reach good performances these functions should be inlined (yet this is
16 to measure precisely). To this end they must be available to the caller.
17
18 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
19 location_type with the class name.
20 Since will now be output in the header, declare "inline".
21 No longer use b4_symbol_constructor_specializations, but
22 b4_symbol_constructor_definitions in the header.
23 Don't call it in the *.cc file.
24
25 2008-11-13 Akim Demaille <demaille@gostai.com>
26
27 Define yytranslate in the header for lex_symbol.
28 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
29 into the header file when using %define lex_symbol.
30 (yytranslate_): Declare inline.
31
32 2008-11-13 Akim Demaille <demaille@gostai.com>
33
34 Define the constructors of symbol_type in b4_symbol_constructor_definitions.
35 The constructors are called by the make_symbol functions, which a
36 forthcoming patch will move elsewhere. Hence the interest of putting them
37 together.
38
39 The stack_symbol_type does not need to be moved, it is used only by the
40 parser.
41
42 * data/lalr1.cc: Move symbol_type and symbol_base_type
43 constructors into...
44 (b4_symbol_constructor_definitions): here.
45 Adjust.
46
47 2008-11-13 Akim Demaille <demaille@gostai.com>
48
49 Make it easier to move the definition of yytranslate_.
50 Forthcoming changes will make it possible to use yytranslate_
51 from outside the parser implementation file.
52
53 * data/lalr1.cc (b4_yytranslate_definition): New.
54 Use it.
55
56 2008-11-13 Akim Demaille <demaille@gostai.com>
57
58 Remove useless class specification.
59 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
60 to refer to the class name to use a type defined by the class for
61 arguments of member functions.
62
63 2008-11-13 Akim Demaille <demaille@gostai.com>
64
65 Finer input type for yytranslate.
66 This patch is debatable: the tradition expects yylex to return an int
67 which happens to correspond to token_number (which is an enum). This
68 allows for instance to return characters (such as '*' etc.). But this
69 goes against the stronger typing I am trying to have with the new
70 lex interface which return a symbol_type. So in this case, feed
71 yytranslate_ with a token_type.
72
73 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
74 expect a token_type.
75
76 2008-11-13 Akim Demaille <demaille@gostai.com>
77
78 Honor lex-params in %define lex_symbol mode.
79 * data/lalr1.cc: Use b4_lex_param.
80
81 2008-11-13 Akim Demaille <demaille@gostai.com>
82
83 Simplify names.
84 * src/output.c (symbol_definitions_output): Rename symbol
85 attributes type_name and has_type_name as type and has_type.
86 * data/lalr1.cc: Adjust uses.
87
88 2008-11-13 Akim Demaille <demaille@gostai.com>
89
90 Use b4_type_names for the union type.
91 The union used to compute the size of the variant used to iterate over the
92 type of all the symbols, with a lot of redundancy. Now iterate over the
93 lists of symbols having the same type-name.
94
95 * data/lalr1.cc (b4_char_sizeof_): New.
96 (b4_char_sizeof): Use it.
97 Adjust to be called with a list of numbers instead of a single
98 number.
99 Adjust its caller for new-line issues.
100
101 2008-11-13 Akim Demaille <demaille@gostai.com>
102
103 Define the "identifier" of a symbol.
104 Symbols may have several string representations, for instance if they
105 have an alias. What I call its "id" is a string that can be used as
106 an identifier. May not exist.
107
108 Currently the symbols which have the "tag_is_id" flag set are those that
109 don't have an alias. Look harder for the id.
110
111 * src/output.c (is_identifier): Move to...
112 * src/symtab.c (is_identifier): here.
113 * src/symtab.h, src/symtab.c (symbol_id_get): New.
114 * src/output.c (symbol_definitions_output): Use it to define "id"
115 and "has_id".
116 Remove the definition of "tag_is_id".
117 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
118 "tag_is_id" were used to produce code.
119 We still use "tag" for documentation.
120
121 2008-11-11 Akim Demaille <demaille@gostai.com>
122
123 Locations are no longer required by lalr1.cc.
124 * data/lalr1.cc (_b4_args, b4_args): New.
125 Adjust all uses of locations to make them optional.
126 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
127 (AT_CHECK_NAMESPACE): Check the use of locations.
128 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
129 without locations with lalr1.cc.
130 Test these cases.
131 * tests/output.at: Check lalr1.cc with and without location
132 support.
133 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
134 Don't use locations.
135
136 2008-11-11 Akim Demaille <demaille@gostai.com>
137
138 AT_FULL_COMPILE.
139 * tests/local.at (AT_FULL_COMPILE): New.
140 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
141
142 2008-11-11 Akim Demaille <demaille@gostai.com>
143
144 Support parens in calc++.
145 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
146 * examples/calc++/test (run): Check the expected output.
147 Adjust callers.
148 Check parens too.
149
150 2008-11-11 Akim Demaille <demaille@gostai.com>
151
152 Simplify lalr1.cc since %defines is mandatory.
153 * data/lalr1.cc: Remove useless calls to b4_defines_if.
154
155 2008-11-11 Akim Demaille <demaille@gostai.com>
156
157 TODO: yyfmt.
158 * TODO (yysyntax_error): New item.
159
160 2008-11-11 Akim Demaille <demaille@gostai.com>
161
162 Prefer M4 to CPP.
163 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
164 YYERROR_VERBOSE.
165
166 2008-11-11 Akim Demaille <demaille@gostai.com>
167
168 Support i18n of the parse error messages.
169 * TODO (lalr1.cc/I18n): Remove.
170 * data/lalr1.cc (yysyntax_error_): Support the translation of the
171 error messages, as done in yacc.c.
172 Stay within the yy* pseudo namespace.
173
174 2008-11-11 Akim Demaille <demaille@gostai.com>
175
176 More TODO.
177 * TODO (single stack, yysyntax_error): New.
178
179 2008-11-11 Akim Demaille <demaille@gostai.com>
180
181 Make it possible to return a symbol_type from yylex.
182 * data/lalr1.cc (b4_lex_symbol_if): New.
183 (parse): When lex_symbol is defined, expected yylex to return the
184 complete lookahead.
185 * etc/bench.pl.in (generate_grammar_list): Extend to support this
186 yylex interface.
187 (bench_variant_parser): Exercise it.
188
189 2008-11-11 Akim Demaille <demaille@gostai.com>
190
191 Remove useless bench case.
192 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
193 no longer used.
194
195 2008-11-11 Akim Demaille <demaille@gostai.com>
196
197 Improve display of directives.
198 * etc/bench.pl.in (parse_term): Don't add useless eol.
199
200 2008-11-11 Akim Demaille <demaille@gostai.com>
201
202 Use string_cast in the bench.
203 * etc/bench.pl.in (generate_grammar_list): Define and use
204 string_cast.
205
206 2008-11-11 Akim Demaille <demaille@gostai.com>
207
208 Replace yychar with a Boolean.
209 * data/lalr1.cc (parse::yychar): Replace by...
210 (parse::yyempty): this.
211
212 2008-11-11 Akim Demaille <demaille@gostai.com>
213
214 Factor the tables.
215 * TODO: New item.
216
217 2008-11-11 Akim Demaille <demaille@gostai.com>
218
219 Let yytranslate handle the eof case.
220 * data/lalr1.cc (yytranslate_): Handle the EOF case.
221 Adjust callers.
222 No longer expect yychar to be equal to yyeof_, rather, test the
223 lookahead's (translated) kind.
224
225 2008-11-11 Akim Demaille <demaille@gostai.com>
226
227 yychar cannot be empty in yyerrlab.
228 * TODO (yychar == yyempty_): New.
229 * data/lalr1.cc: Remove the handling of this case.
230 This eases forthcoming changes related to yychar and yytranslate.
231
232 2008-11-11 Akim Demaille <demaille@gostai.com>
233
234 Bench: syntactic sugar for %define/#define.
235 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
236 (&bench_push_parser, bench_variant_parser): Use this feature.
237 (&eat): New.
238 Use it.
239
240 2008-11-11 Akim Demaille <demaille@gostai.com>
241
242 Less memory pressure on the "list" bench.
243 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
244 the values, to limit memory pressure.
245
246 2008-11-11 Akim Demaille <demaille@gostai.com>
247
248 Introduce make_symbol.
249 make_symbol provides a means to construct a full symbol (kind, value,
250 location) in a single shot. It is meant to be a Symbol constructor,
251 parameterized by the symbol kind so that overloading would prevent
252 incorrect kind/value pairs. Unfortunately parameterized constructors do
253 not work well in C++ (unless the parameter also appears as an argument,
254 which is not acceptable), hence the use of a function instead of a
255 constructor.
256
257 * data/lalr1.cc (b4_symbol_constructor_declaration_)
258 (b4_symbol_constructor_declarations)
259 (b4_symbol_constructor_specialization_)
260 (b4_symbol_constructor_specializations)
261 (b4_symbol_constructor_definition_)
262 (b4_symbol_constructor_definitions): New.
263 Use them where appropriate to generate declaration, declaration of
264 the specializations, and implementations of the templated
265 overloaded function "make_symbol".
266 (variant::variant): Always define a default ctor.
267 Also provide a copy ctor.
268 (symbol_base_type, symbol_type): New ctor overloads for value-less
269 symbols.
270 (symbol_type): Now public, so that functions such as yylex can use
271 it.
272
273 2008-11-11 Akim Demaille <demaille@gostai.com>
274
275 Inform m4 whether a tag is a valid id.
276 * src/output.c (is_identifier): New.
277 (symbol_definitions_output): Use it to define tag_is_id.
278 But maybe this should be done at m4 level?
279
280 2008-11-11 Akim Demaille <demaille@gostai.com>
281
282 Test 214 was failing: it greps with a pattern containing [ ]*
283 which obviously meant to catch spaces and tabs, but contained only
284 spaces. Tabulations in sources are a nuisance, so to simplify the
285 matter, get rid of all the tabulations in the Java sources. The
286 other skeletons will be treated equally later.
287
288 * data/java.m4, data/lalr1.java: Untabify.
289 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
290 tabulations are no longer generated.
291
292 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
293
294 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
295 * configure.ac: Adjust usage.
296 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
297 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
298 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
299
300 2008-11-10 Di-an Jan <dianj@freeshell.org>
301
302 Workaround Java's ``code too large'' problem for parser tables
303 in most cases, by using one function per initialization.
304 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
305 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
306 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
307 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
308 (yytname_): Use b4_typed_parser_table.
309 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
310 ``code too large'' error.
311
312 2008-11-10 Di-an Jan <dianj@freeshell.org>
313
314 * NEWS: Document them.
315
316 General Java skeleton improvements.
317 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
318 using gcj < 4.3 in the testsuite, according to comments in
319 gnulib/m4/javacomp.m4.
320 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
321 location_type, position_type): Remove extraneous brackets from
322 b4_percent_define_default.
323 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
324 m4_define and m4_define_default.
325 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
326 which marks the end of user code with appropriate syncline, like all
327 the other skeletons.
328 (b4_user_post_prologue): Add. Don't silently drop.
329 (yylex): Remove.
330 (parse): Inline yylex.
331 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
332 (%{...%}): Fix typo of %code imports.
333 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
334
335 Support annotations on parser class with %define annotations.
336 * data/lalr1.java (annotations): Add to parser class modifier.
337 * doc/bison.texinfo (Java Parser Interface): Document
338 %define annotations.
339 (Java Declarations Summary): Document %define annotations.
340 * tests/java.at (Java parser class modifiers): Test annotations.
341
342 Do not generate code for %error-verbose unless requested.
343 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
344 Make private. Make conditional on %error-verbose.
345 (getErrorVerbose, setErrorVerbose): New.
346 (yytnamerr_): Make conditional on %error-verbose.
347 (yysyntax_error): Make some code conditional on %error-verbose.
348 * doc/bison.texinfo (Java Bison Interface): Remove the parts
349 about %error-verbose having no effect.
350 (getErrorVerbose, setErrorVerbose): Document.
351
352 Move constants for token names to Lexer interface.
353 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
354 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
355 (parse): Qualify EOF to Lexer.EOF.
356 * doc/bison.texinfo (Java Parser Interface): Move documentation of
357 EOF and token names to Java Lexer Interface.
358 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
359
360 Make yyerror public.
361 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
362 (yyerror): Change to public. Add Javadoc comments. Use longer
363 parameter names. Make the body rather than the declarator
364 conditional on %locations.
365 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
366
367 Allow user to add code to the constructor with %code init.
368 * data/java.m4 (b4_init_throws): New, for %define init_throws.
369 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
370 Add %code init to the front of the constructor body.
371 * doc/bison.texinfo (YYParser.YYParser): Document %code init
372 and %define init_throws.
373 (Java Declarations Summary): Document %code init and
374 %define init_throws.
375 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
376 (Java constructor init and init_throws): Add tests.
377
378 2008-11-10 Akim Demaille <demaille@gostai.com>
379
380 Update TODO.
381 * TODO (-D): is implemented.
382 (associativity): Same precedence must have the same associativity.
383 For instance, how can a * b / c be parsed if * is %left and / is
384 %right?
385 (YYERRORCODE, YYFAIL, YYBACKUP): New.
386
387 2008-11-10 Akim Demaille <demaille@gostai.com>
388
389 Formatting changes.
390
391 2008-11-10 Akim Demaille <demaille@gostai.com>
392
393 More information about the symbols.
394 * src/output.c (type_names_output): Document all the symbols,
395 including those that don't have a type-name.
396 (symbol_definitions_output): Define "is_token" and
397 "has_type_name".
398 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
399 type-name, now that they are defined too in b4_type_names.
400
401 2008-11-10 Akim Demaille <demaille@gostai.com>
402
403 Regen.
404
405 2008-11-10 Akim Demaille <demaille@gostai.com>
406
407 Make parser::yytranslate static.
408 Small speedup (1%) on the list grammar. And makes yytranslate_ available
409 in non member functions.
410
411 * data/lalr1.cc (yytranslate_): Does not need to be a instance
412 function.
413
414 2008-11-10 Akim Demaille <demaille@gostai.com>
415
416 Avoid trailing spaces.
417 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
418 * data/lalr1.cc: Don't indent before rule and symbol actions, as
419 they can be empty, and anyway this incorrectly indents the first
420 action.
421
422 2008-11-10 Akim Demaille <demaille@gostai.com>
423
424 Comment changes.
425
426 2008-11-10 Akim Demaille <demaille@gostai.com>
427
428 Use "enum" for integral constants.
429 This is just nicer to read, I observed no speedup.
430
431 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
432 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
433 (yyuser_token_number_max_, yyundef_token_): Move into...
434 (yytranslate_): here.
435
436 2008-11-10 Akim Demaille <demaille@gostai.com>
437
438 Shortcuts in bench directives.
439 * etc/bench.pl.in (parse_dirs): New.
440 Use it.
441 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
442 Create the benches in "benches/".
443
444 2008-11-10 Akim Demaille <demaille@gostai.com>
445
446 Formatting changes.
447 * data/lalr1.cc: here.
448
449 2008-11-10 Akim Demaille <demaille@gostai.com>
450
451 Adjust verbose message to using emacs.
452 * etc/bench.pl.in: Inform compilation-mode when we change the
453 directory.
454 (generate_grammar_list): Recognize %define "variant" in addition
455 to %define variant.
456
457 2008-11-10 Akim Demaille <demaille@gostai.com>
458
459 Classify symbols by type-name.
460 * src/uniqstr.h (UNIQSTR_CMP): New.
461 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
462 (type_names_output): New.
463 (muscles_output): Use it.
464 * data/lalr1.cc (b4_symbol_action_): Remove.
465 (b4_symbol_case_, b4_type_action_): New.
466 Adjust uses of b4_symbol_action_ to use b4_type_action_.
467
468 2008-11-10 Akim Demaille <demaille@gostai.com>
469
470 Change the handling of the symbols in the skeletons.
471 Before we were using tables which lines were the symbols and which
472 columns were things like number, tag, type-name etc. It is was
473 difficult to extend: each time a column was added, all the numbers had
474 to be updated (you asked for colon $2, not for "tag"). Also, it was
475 hard to filter these tables when only a subset of the symbols (say the
476 tokens, or the nterms, or the tokens that have and external number
477 *and* a type-name) was of interest.
478
479 Now instead of monolithic tables, we define one macro per cell. For
480 instance "b4_symbol(0, tag)" is a macro name which contents is
481 self-decriptive. The macro "b4_symbol" provides easier access to
482 these cells.
483
484 * src/output.c (type_names_output): Remove.
485 (symbol_numbers_output, symbol_definitions_output): New.
486 (muscles_output): Call them.
487 (prepare_symbols): Define b4_symbols_number.
488
489 2008-11-10 Akim Demaille <demaille@gostai.com>
490
491 --trace=muscles
492 * src/getargs.h, src/getargs.c (trace_muscle): New.
493 (trace_types, trace_args): Support it.
494 * src/output.c (output_skeleton): Use it.
495
496 2008-11-10 Akim Demaille <demaille@gostai.com>
497
498 muscles_output.
499 * src/output.c (muscles_output): New, extracted from...
500 (output_skeleton): here.
501 Adjust.
502
503 2008-11-10 Akim Demaille <demaille@gostai.com>
504
505 Formatting changes.
506
507 2008-11-10 Akim Demaille <demaille@gostai.com>
508
509 Update the variant example.
510 * examples/variant.yy: Formatting changes.
511 One stage build.
512
513 2008-11-10 Akim Demaille <demaille@gostai.com>
514
515 Support constructor with an argument.
516 This improves the "list" bench by 2%.
517
518 * data/lalr1.cc (variant::build): Add an overloaded version with
519 an argument.
520 * tests/c++.at (AT_CHECK_VARIANT): Check it.
521
522 2008-11-10 Akim Demaille <demaille@gostai.com>
523
524 Test variants.
525 * tests/c++.at (AT_CHECK_VARIANTS): New.
526 Use it with and without %define assert.
527
528 2008-11-10 Akim Demaille <demaille@gostai.com>
529
530 Add %precedence support.
531 Unfortunately it is not possible to reuse the %prec directive. This
532 is because to please POSIX, we do not require to end the rules with a
533 semicolon. As a result,
534
535 foo: bar %prec baz
536
537 is ambiguous: either a rule which precedence is that of baz, or a rule,
538 and then a declaration of the precedence of the token baz.
539
540 * doc/bison.texinfo: Document %precedence.
541 (Precedence Only): New.
542 * src/assoc.h, src/assoc.c (precedence_assoc): New.
543 * src/conflicts.c (resolve_sr_conflict): Support it.
544 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
545 Parse it.
546 * tests/calc.at: Use %precedence for NEG.
547 * tests/conflicts.at (%precedence does not suffice)
548 (%precedence suffices): New tests.
549
550 2008-11-09 Akim Demaille <demaille@gostai.com>
551
552 Make benches in a sub dirs.
553 * etc/bench.pl.in ($dir): New.
554 Use it.
555 Check the use of constructors with an argument.
556 (bench_variant_parser): Fix.
557
558 2008-11-09 Akim Demaille <demaille@gostai.com>
559
560 fix eof condition
561
562 2008-11-09 Akim Demaille <demaille@gostai.com>
563
564 Fix --help.
565
566 2008-11-09 Akim Demaille <demaille@gostai.com>
567
568 Require the generation of parse-gram.output.
569 * src/Makefile.am (YACC): Pass --report=all.
570
571 2008-11-09 Akim Demaille <demaille@gostai.com>
572
573 Formatting changes.
574
575 2008-11-09 Akim Demaille <demaille@gostai.com>
576
577 Update TODO.
578 * TODO: Remove obsolete items.
579 Update others.
580
581 2008-11-09 Akim Demaille <demaille@gostai.com>
582
583 Enhance bench.pl.
584 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
585 (@token, $grammar, $bench): New.
586 (generate_grammar_variant): Rename as...
587 (generate_grammar_list): this.
588 (generate_grammar): Adjust.
589 (bench_grammar): Rename as...
590 (bench): this.
591 Use it in the various bench-marking routines.
592 (-b, -g): New options.
593
594 2008-11-09 Akim Demaille <demaille@gostai.com>
595
596 Use a static hierarchy for symbols in the C++ parser.
597 * data/lalr1.cc (symbol_base_type, symbol_type)
598 (stack_symbol_type): Make it a static hierarchy.
599 Adjust dependencies.
600
601 2008-11-09 Akim Demaille <demaille@gostai.com>
602
603 bench.pl -d, --directive.
604 * etc/bench.pl.in (@directive): New.
605 (&bench_grammar): Use it.
606 (&bench_list_grammar): New, to provide access to the "variant"
607 grammar.
608 Use it.
609 (getopts): Support -d, --directive.
610
611 2008-11-09 Akim Demaille <demaille@gostai.com>
612
613 Use inline for small operations.
614 * data/lalr1.cc (symbol_base_type, symbol_type)
615 (stack_symbol_type): Declare constructor and other operations as
616 inline.
617 (yy_destroy_): Inline.
618
619 2008-11-09 Akim Demaille <demaille@gostai.com>
620
621 Introduce a hierarchy for symbols.
622 * data/lalr1.cc (symbol_base_type, symbol_type): New.
623 (data_type): Rename as...
624 (stack_symbol_type): this.
625 Derive from symbol_base_type.
626 (yy_symbol_value_print_): Merge into...
627 (yy_symbol_print_): this.
628 Rename as...
629 (yy_print_): this.
630 (yydestruct_): Rename as...
631 (yy_destroy_): this.
632 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
633 (parser::parse): yyla is now of symbol_type.
634 Use its type member instead of yytoken.
635
636 2008-11-09 Akim Demaille <demaille@gostai.com>
637
638 Rename data_type and stack_symbol_type.
639 * data/lalr1.cc (data_type): Rename as...
640 (stack_symbol_type): this.
641
642 2008-11-09 Akim Demaille <demaille@gostai.com>
643
644 Handle semantic value and location together.
645 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
646 yydata.value and yydata.location.
647 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
648 (YY_SYMBOL_PRINT): Now take semantic value and location as a
649 single arg.
650 Adjust all callers.
651 (yydestruct_): New overload for a stack symbol.
652
653 2008-11-09 Akim Demaille <demaille@gostai.com>
654
655 Push a complete symbol, not connected parts.
656 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
657 state, value and location.
658 Adjust callers.
659
660 2008-11-09 Akim Demaille <demaille@gostai.com>
661
662 Agregate yylval and yylloc.
663 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
664 (parser::yyla): this.
665
666 2008-11-09 Akim Demaille <demaille@gostai.com>
667
668 Rely on the state stack to display reduction traces.
669 To display rhs symbols before a reduction, we used information about the rule
670 reduced, which required the tables yyrhs and yyprhs. Now use rely only on the
671 state stack to get the same information.
672
673 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
674 Use them.
675 (parser::yyrhs_, parser::yyprhs_): Remove.
676 (parser::yy_reduce_print_): Use the state stack.
677
678 2008-11-09 Akim Demaille <demaille@gostai.com>
679
680 Fuse yyval and yyloc into yylhs.
681 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
682 yylhs.
683 (parse): Replace yyval and yyloc with yylhs.value and
684 yylhs.location.
685 After a user action, compute yylhs.state earlier.
686 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
687 fresh error_token.
688
689 2008-11-09 Di-an Jan <dianj@freeshell.org>
690
691 Remove unused variable.
692 * src/output.c (type_names_output): Remove unused variable sep.
693
694 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
695
696 Change tests/output.at quoting.
697 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
698 expanding arguments.
699
700 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
701
702 Don't add a semicolon to actions for %skeleton or %language.
703 It breaks Java test cases as reported by Akim Demaille.
704 * src/scan-code.l: Implement.
705
706 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
707
708 Clean up %skeleton and %language priority implementation.
709 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
710 remove static qualifier because others will soon need to see it.
711 (language_prio): Likewise.
712 (getargs): Use command_line_prio rather than 0.
713 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
714 enum fields.
715 (skeleton_prio): Extern it.
716 (language_prio): Extern it.
717 * src/parse-gram.y: Use grammar_prio rather than 1.
718
719 2008-11-07 Akim Demaille <demaille@gostai.com>
720
721 Moving push traces into yypush_.
722 * data/lalr1.cc (yypush_): Now takes a optional trace message.
723 Adjust all uses.
724
725 2008-11-07 Akim Demaille <demaille@gostai.com>
726
727 The single-stack C++ parser is now the standard one.
728 * data/lalr1.cc: Rename as...
729 * data/lalr1-split.cc: this.
730 * data/lalr1-fusion.cc: Rename as...
731 * data/lalr1.cc: this.
732 * etc/bench.pl.in: Adjust.
733
734 2008-11-07 Akim Demaille <demaille@gostai.com>
735
736 Avoid empty-if warnings.
737 Reported by Quentin Hocquet.
738
739 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
740 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
741
742 2008-11-07 Akim Demaille <demaille@gostai.com>
743
744 Pass command line location to skeleton_arg and language_argmatch.
745 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
746 The location argument is now mandatory.
747 Adjust all dependencies.
748 (getargs): Use command_line_location.
749
750 2008-11-07 Akim Demaille <demaille@gostai.com>
751
752 -D, --define.
753 * src/getargs.c (usage): Document -D.
754 Fix help string for --locations.
755 (command_line_location): New.
756 (short_options, long_options, getargs): Support -D, --define.
757 (getargs): Move -d support at the right place.
758 * doc/bison.texinfo (Bison Options): Update.
759 * tests/input.at (%define, --define): New.
760
761 2008-11-07 Akim Demaille <demaille@gostai.com>
762
763 Initialize the muscle table before parsing the command line.
764 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
765 (getargs): Define file_name.
766 * src/main.c (main): Initialize muscle_tab before calling
767 getargs.
768 * src/muscle_tab.c (muscle_init): No longer define file_name, as
769 its value is not available yet.
770
771 2008-11-07 Akim Demaille <demaille@gostai.com>
772
773 Locations without columns for command line arguments.
774 * src/location.c (location_print): Don't display negative columns.
775 * src/location.h: Document this.
776
777 2008-11-07 Akim Demaille <demaille@gostai.com>
778
779 Fix --help.
780 * src/getargs.c (usage): Fix help string for -W.
781
782 2008-11-07 Akim Demaille <demaille@gostai.com>
783
784 Handle more general types of option arguments.
785 * build-aux/cross-options.pl: The argument ends at the first
786 space, not the first non-symbol character.
787 Use @var for each word appearing the argument description.
788
789 2008-11-07 Akim Demaille <demaille@gostai.com>
790
791 Destroy the variants that remain on the stack in case of error.
792 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
793 destructor.
794 Display the value only if yymsg is nonnull.
795 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
796
797 2008-11-07 Akim Demaille <demaille@gostai.com>
798
799 Add "%define assert" to variants.
800 This is used to help the user catch cases where some value gets
801 ovewritten by a new one. This should not happen, as this will
802 probably leak.
803
804 Unfortunately this uncovered a bug in the C++ parser itself: the
805 lookahead value was not destroyed between two calls to yylex. For
806 instance if the previous lookahead was a std::string, and then an int,
807 then the value of the std::string was correctly taken (i.e., the
808 lookahead was now an empty string), but std::string structure itself
809 was not reclaimed.
810
811 This is now done in variant::build(other&) (which is used to take the
812 value of the lookahead): other is not only stolen from its value, it
813 is also destroyed. This incurs a new performance penalty of a few
814 percent, and union becomes faster again.
815
816 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
817 (b4_variant_if): New.
818 (variant::built): New.
819 Use it whereever the status of the variant changes.
820 * etc/bench.pl.in: Check the penalty of %define assert.
821
822 2008-11-07 Akim Demaille <demaille@gostai.com>
823
824 Use "%define variant" in bench.pl.
825 * etc/bench.pl.in: No longer use the pseudo directive %variants,
826 just use %define variants.
827
828 2008-11-07 Akim Demaille <demaille@gostai.com>
829
830 Regen.
831 * src/parse-gram.h, src/parse-gram.c: Regen.
832
833 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
834
835 Fix user actions without a trailing semicolon.
836 Reported by Sergei Steshenko at
837 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
838 * THANKS (Sergei Steshenko): Add.
839 * src/scan-code.l (SC_RULE_ACTION): Fix it.
840 * tests/regression.at (Fix user actions without a trailing semicolon):
841 New test case.
842
843 2008-11-04 Akim Demaille <demaille@gostai.com>
844
845 Use b4_copyright_years.
846 * data/yacc.c (b4_copyright_years): New.
847 Fix its value according to the comments in the file.
848 Use it and undefine it.
849
850 2008-11-04 Akim Demaille <demaille@gostai.com>
851
852 Formatting changes.
853 * data/lalr1-fusion.cc, src/parse-gram.y: here.
854
855 2008-11-04 Akim Demaille <demaille@gostai.com>
856
857 Formatting changes.
858 * data/lalr1-fusion.cc: here.
859
860 2008-11-04 Akim Demaille <demaille@gostai.com>
861
862 Use strict on bench.pl.
863 * etc/bench.pl.in (&run, &generate_grammar): New.
864 Rename the grammar generating functions for consistency.
865 Change the interface so that the list of benches to run is passed
866 as (optionless) arguments.
867 (&compile): Use &run.
868
869 2008-11-04 Akim Demaille <demaille@gostai.com>
870
871 Remove spurious initial empty lines.
872 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
873 * data/yacc.c: End the @output lines with an @.
874
875 2008-11-04 Akim Demaille <demaille@gostai.com>
876
877 Improve the display of sizes.
878 * etc/bench.p.in: Higher precision.
879 Sort by decreasing size.
880
881 2008-11-04 Akim Demaille <demaille@gostai.com>
882
883 Don't memcpy C++ structures.
884 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
885 arguments.
886 (variant::build): New overload for
887 copy-construction-that-destroys.
888 (variant::swap): New.
889 (parser::yypush_): Use it in variant mode.
890
891 2008-11-04 Akim Demaille <demaille@gostai.com>
892
893 Better defaults for bench.pl.
894 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
895 default values.
896 Adjust &verbose uses.
897 (-q, --quiet): New.
898
899 2008-11-04 Akim Demaille <demaille@gostai.com>
900
901 Make variant.yy more complex.
902 std::list cannot be copied via memcpy, they are more demanding than
903 std::string. Use one std::list to strengthen the test.
904
905 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
906 Adjust.
907 Create a list of strings, instead of a single large string.
908
909 2008-11-04 Akim Demaille <demaille@gostai.com>
910
911 bench.pl --bench.
912 * etc/bench.pl.in (--bench, $bench): New.
913
914 2008-11-04 Akim Demaille <demaille@gostai.com>
915
916 Sort methods.
917 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
918 Define it after as().
919
920 2008-11-04 Akim Demaille <demaille@gostai.com>
921
922 Useless parens.
923 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
924
925 2008-11-04 Akim Demaille <demaille@gostai.com>
926
927 Issue missing synclines after user actions.
928 * data/c.m4 (b4_case): Issue synclines on the output file.
929
930 2008-11-04 Akim Demaille <demaille@gostai.com>
931
932 Remove trailing empty line.
933 * data/lalr1-fusion.cc: Don't add an empty line after the user's
934 epilogue.
935
936 2008-11-04 Akim Demaille <demaille@gostai.com>
937
938 Fix output of copyright years.
939 * data/bison.m4 (b4_copyright): Fix the indentation of the
940 copyright year paragraph.
941 Use b4_copyright_years when no years are given.
942 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
943 (b4_copyright_years): New.
944 Use it.
945
946 2008-11-04 Akim Demaille <demaille@gostai.com>
947
948 Avoid the spurious initial empty line.
949 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
950 the end of @output request to suppress the empty line that
951 results.
952
953 2008-11-04 Akim Demaille <demaille@gostai.com>
954
955 Remove parser::rhs_number_type.
956 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
957 (yyrhs_): Use b4_table_define.
958
959 2008-11-04 Akim Demaille <demaille@gostai.com>
960
961 Fix iteration type.
962 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
963
964 2008-11-04 Akim Demaille <demaille@gostai.com>
965
966 Factor the declaration of the integer tables.
967 * data/lalr1-fusion.cc (b4_table_define): New.
968 Use it.
969
970 2008-11-03 Akim Demaille <demaille@gostai.com>
971
972 Fix indentation of tables in lalr1.cc
973 * data/lalr1-fusion.cc: Fix the indentation.
974
975 2008-11-03 Akim Demaille <demaille@gostai.com>
976
977 Destroy the lhs symbols after reduction.
978 * data/lalr1-fusion.cc (parse): After the user action, when in
979 variant mode, destroy the lhs symbols.
980
981 2008-11-03 Akim Demaille <demaille@gostai.com>
982
983 Simplify yysyntax_error_ use.
984 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
985 type, but make it unnamed in the declaration when it is not used.
986
987 2008-11-03 Akim Demaille <demaille@gostai.com>
988
989 Let yy::variant::build return an lvalue.
990 * data/lalr1-fusion.cc (variant::build): Return a reference to the
991 object.
992
993 2008-11-03 Akim Demaille <demaille@gostai.com>
994
995 Define yy::variant only when needed.
996 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
997 used.
998
999 2008-11-03 Akim Demaille <demaille@gostai.com>
1000
1001 Bench the three-stack lalr1.cc.
1002 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
1003 one-stack one.
1004
1005 2008-11-03 Akim Demaille <demaille@gostai.com>
1006
1007 Fail on parse error in calc++.
1008 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
1009 status.
1010 * examples/calc++/test ($me, $number, $exit, run): New.
1011 Use them to propagate errors to the exit status.
1012
1013 2008-11-03 Akim Demaille <demaille@gostai.com>
1014
1015 Don't specify the skeleton twice in the example.
1016 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
1017 file does what is needed.
1018
1019 2008-11-03 Akim Demaille <demaille@gostai.com>
1020
1021 bench: Improve output.
1022 * etc/bench.pl.in (bench_grammar): Tune the printf format.
1023
1024 2008-11-03 Akim Demaille <demaille@gostai.com>
1025
1026 bench: check impact of %debug on variants.
1027 * etc/bench.pl.in (variant_grammar): Fix the computation of
1028 $variant.
1029 Generate a grammar file that can work with or without %debug.
1030 Do use the @directive.
1031 (bench_variant_parser): Check impact of %debug.
1032 (@directives): Rename all the occurrences to...
1033 (@directive): this, for consistency.
1034
1035 2008-11-03 Akim Demaille <demaille@gostai.com>
1036
1037 bench: report the size too.
1038 * etc/bench.pl.in ($iterations): Defaults to -3.
1039 (&bench_grammar): Require hireswallclock.
1040 Compute and display the size of the result.
1041 More comments.
1042
1043 2008-11-03 Akim Demaille <demaille@gostai.com>
1044
1045 bench: More use of the verbosity level.
1046 * etc/bench.pl.in ($verbose, &verbose): New.
1047 Use them.
1048 More POD documentation.
1049
1050 2008-11-03 Akim Demaille <demaille@gostai.com>
1051
1052 bench.pl: a command line interface
1053 * etc/bench.pl.in: More doc.
1054 Some fixes in the documentation.
1055 ($cflags, $iterations, &help, &getopt): New.
1056 Use them.
1057 (&variant_grammar): Let the number of stages be 10 times what is
1058 specified.
1059
1060 2008-11-03 Akim Demaille <demaille@gostai.com>
1061
1062 Bench the use of Boost.Variants.
1063 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
1064 New.
1065 (&compile): Be ready to compile C++ parsers.
1066 (&bench_push_parser): Move debug information to the outermost
1067 level.
1068 * THANKS: Add Michiel De Wilde.
1069
1070 2008-11-03 Akim Demaille <demaille@gostai.com>
1071
1072 bench.pl: Pass directives as a list instead of as a string.
1073 * etc/bench.pl.in (&directives): New.
1074 (&triangular_grammar, &calc_grammar): Use it to format the Bison
1075 directives.
1076 (&triangular_grammar): Do use the directives (were ignored).
1077 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
1078 directives.
1079
1080 2008-11-03 Akim Demaille <demaille@gostai.com>
1081
1082 Improve genericity of bench.pl.
1083 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
1084 argument.
1085 (&bench_push_parser): New.
1086 Call it.
1087
1088 2008-11-03 Akim Demaille <demaille@gostai.com>
1089
1090 Add documentation to bench.pl.
1091 * etc/bench.pl.in: Comment changes.
1092
1093 2008-11-03 Akim Demaille <demaille@gostai.com>
1094
1095 Fuse the three stacks into a single one.
1096 In order to make it easy to perform benchmarks to ensure that there are no
1097 performance loss, lalr1.cc is forked into lalr1-fusion.cc. Eventually,
1098 lalr1-fusion.cc will replace lalr1.cc.
1099
1100 Meanwhile, to make sure that lalr1-fusion.cc is correctly exercized by the
1101 test suite, the user must install a symbolic link from lalr1.cc to it.
1102
1103 Instead of having three stacks (state, value, location), use a stack
1104 of triples. This considerably simplifies the code (and it will be
1105 easier not to require locations as currently does the C++ parser),
1106 and also gives a 10% speedup according to etc/bench (probably mainly since
1107 memory allocation is done once instead of three times).
1108
1109 Another motivation is to make it easier to destruct properly
1110 semantic values: now that they are bound to their state (hence
1111 symbol type) it will be easier to call the appropriate destructor.
1112
1113 These changes should probably benefit the C parser too.
1114
1115 * data/lalr1.cc: Copy as... * data/lalr1-fusion.cc: this new
1116 file.
1117 (b4_rhs_value, b4_rhs_location): New definitions overriding those
1118 from c++.m4.
1119 (state_stack_type, semantic_stack_type, location_stack_type)
1120 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
1121 (data_type, stack_type, yystack_): New.
1122 (YYLLOC_DEFAULT, yypush_): Adjust.
1123 (yyerror_range): Now based on data_type, not location_type.
1124
1125 2008-11-03 Akim Demaille <demaille@gostai.com>
1126
1127 Push the state, value, and location at the same time.
1128 This is needed to prepare a forthcoming patch that fuses the three
1129 stacks into one.
1130
1131 * data/lalr1.cc (parser::yypush_): New.
1132 (parser::yynewstate): Change the semantics: instead of arriving to
1133 this label when value and location have been pushed, but yystate
1134 is to be pushed on the state stack, now the three of them must
1135 have been pushed before. yystate still must be the new state.
1136 This allows to use yypush_ everywhere instead of individual
1137 handling of the stacks.
1138
1139 2008-11-03 Akim Demaille <demaille@gostai.com>
1140
1141 Prefer references to pointers.
1142 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
1143 definition to use references instead of pointers.
1144 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
1145 Take the value and location as references.
1146 Adjust callers.
1147
1148 2008-11-03 Akim Demaille <demaille@gostai.com>
1149
1150 stack::size instead of stack::height.
1151 * data/lalr1.cc (stack::height): Rename as...
1152 (stack::size): this.
1153 Fix the output type.
1154 Comment changes.
1155
1156 2008-11-03 Akim Demaille <demaille@gostai.com>
1157
1158 Use variants to support objects as semantic values.
1159 This patch was inspired by work by Michiel De Wilde. But he used Boost
1160 variants which (i) requires Boost on the user side, (ii) is slow, and
1161 (iii) has useless overhead (the parser knows the type of the semantic value
1162 there is no reason to duplicate this information as Boost.Variants do).
1163
1164 This implementation reserves a buffer large enough to store the largest
1165 objects. yy::variant implements this buffer. It was implemented with
1166 Quentin Hocquet.
1167
1168 * src/output.c (type_names_output): New.
1169 (output_skeleton): Invoke it.
1170 * data/c++.m4 (b4_variant_if): New.
1171 (b4_symbol_value): If needed, provide a definition for variants.
1172 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
1173 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
1174 (b4_char_sizeof, yy::variant): New.
1175 (parser::parse): If variants are requested, define
1176 parser::union_type, parser::variant, change the definition of
1177 semantic_type, construct $$ before running the user action instead
1178 of performing a default $$ = $1.
1179 * examples/variant.yy: New.
1180 Based on an example by Michiel De Wilde.
1181
1182 2008-11-03 Akim Demaille <demaille@gostai.com>
1183
1184 Parameterize the extraction of semantic values.
1185 To make future changes easier, no longer rely on ".TYPE" being the
1186 way to get a semantic value.
1187
1188 * data/c.m4 (b4_symbol_value): New.
1189 Use it.
1190 * data/c++.m4, data/yacc.c: Use it.
1191 * data/glr.c: Use b4_symbol_value.
1192 (b4_rhs_data): New.
1193 Use it.
1194
1195 2008-11-03 Akim Demaille <demaille@gostai.com>
1196
1197 Prepare easier M4 changes.
1198 * data/lalr1.cc: Use escaped [] instead of literals to prepare
1199 future changes.
1200
1201 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1202
1203 Initiate further development.
1204 * NEWS: Create an empty section for new entries.
1205 * gnulib: Update submodule to HEAD.
1206
1207 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1208
1209 * NEWS: Version 2.4.
1210
1211 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1212
1213 Prepare for next release.
1214 * NEWS: Briefly mention changes since 2.3b.
1215 * README: Say GNU m4 1.4.6, which we've been requiring in release
1216 announcements already, not 1.4.3, which breaks the build.
1217
1218 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1219
1220 Say %language is experimental.
1221 We're thinking of extending it's effect on output file naming. See the
1222 thread at
1223 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1224 * NEWS: Say it's experimental.
1225 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1226 recommend it over %skeleton for now.
1227 (Bison Options): Likewise.
1228 (C++ Bison Interface): Use %skeleton not %language.
1229 (Calc++ Parser): Use %skeleton not %language.
1230 * src/getargs.c (usage): Say it's experimental.
1231
1232 2008-11-01 Di-an Jan <dianj@freeshell.org>
1233 Paolo Bonzini <bonzini@gnu.org>
1234
1235 Support all Java parser class modifiers.
1236 * data/java.m4 (b4_percent_define_get3): New.
1237 (b4_final_if, b4_strictfp_if): New.
1238 * data/lalr1.java (final, strictfp, extends, implements): Support.
1239 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1240 documentation.
1241 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1242 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1243 (AT_CHECK_JAVA_GREP): New.
1244 (Java parser class modifiers): New test.
1245 (Java parser class extends and implements): New test.
1246
1247 Model exception propagation better with throws and lex_throws.
1248 * data/java.m4 (b4_list2): New.
1249 (throws): Change default.
1250 * data/lalr1.java (yyaction): Add throws.
1251 (parse): Add lex_throws in addition to throws.
1252 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1253 * tests/java.at (Java throws specifications): New test.
1254
1255 Improve documentation for Java parsers.
1256 * doc/bison.texinfo (Java Parsers): Add subsections.
1257 Don't quote first argument of %define.
1258 (Java Bison Interface): Document output files. Move documentation
1259 of parser class and merge into Java Parser Interface. Document
1260 features that error out. Document directives with no effect.
1261 Move note about Javadoc higher.
1262 (Java Semantic Values): Explicitly mention stype.
1263 Document that generic types cannot be used.
1264 (Java Location Values): Use @deftypeivar. Document constructors.
1265 Correct return value for toString.
1266 (Java Parser Interface): List undocumented constants/fields.
1267 Move documentation of fields added by %parse-param closer to list
1268 of members. Document that token names are added as fields.
1269 Document constructors accurately. Remove error method.
1270 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1271 Interface. Describe %code lexer and yylex accutately.
1272 Remove documentation that does not match the code.
1273 (Java Action Features): New.
1274 (Java Differences): Add reference. Add item on semantic values.
1275 Add note about @{ ... @}. Clarify %% epilogue placement.
1276 (Java Declarations Summary): New.
1277
1278 Fix Java skeleton.
1279 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1280 (b4_remove_comma): Quote test argument.
1281 (b4_identification): Remove "bison" field.
1282 * tests/java.at (Java parser class and package names): New test.
1283 (Java %parse-param and %lex-param): New test.
1284 (Java stype, position_class and location_class): New test.
1285
1286 2008-10-31 Di-an Jan <dianj@freeshell.org>
1287
1288 * data/lalr1.jave: Update copyright years.
1289 (YYParser): Correct name of "generated from" file in Javadoc:
1290 use b4_file_name instead of @ofile@.
1291 (Location constructor): Correct Javadoc parameter name.
1292 (yylloc): Add missing opening m4 quote after b4_location_if.
1293 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1294 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1295 (YYParser constructor): Correct Javadoc parameter name.
1296
1297 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1298
1299 Always put auxiliary code files in the same dir as other output files.
1300 * src/files.c (compute_file_name_parts): When the user specifies
1301 --output but not --file-prefix, extract the directory prefix from the
1302 file prefix not from the grammar file name. This affects the location
1303 of files like location.hh generated by the C++ skeleton. The includes
1304 in the other output files require this fix.
1305 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1306 for expected output files.
1307 (Output files): Add a test for the above.
1308
1309 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1310
1311 * gnulib: Update submodule to HEAD.
1312
1313 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1314
1315 Update copyright year.
1316 * src/files.c: Here.
1317
1318 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1319
1320 Don't overwrite the input file.
1321 * src/files.c (output_file_name_check): Fatal error if using input file
1322 for output.
1323 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1324 argument.
1325 (Conflicting output files): Add test.
1326
1327 2008-10-28 Akim Demaille <demaille@gostai.com>
1328
1329 Space changes.
1330 * data/lalr1.cc: Formatting changes.
1331
1332 2008-10-28 Akim Demaille <demaille@gostai.com>
1333
1334 Don't define debugging functions when !YYDEBUG.
1335 * data/lalr1.cc (debug_stream, set_debug_stream)
1336 (debug_level_type, debug_level, set_debug_level): Don't
1337 declare them when YYDEBUG is not defined.
1338 The implementation are already YYDEBUG-aware.
1339
1340 2008-10-28 Akim Demaille <demaille@gostai.com>
1341
1342 Prefer "continue" for empty loop bodies.
1343 * etc/bench.pl.in: Use "continue" instead of {}.
1344
1345 2008-10-28 Akim Demaille <demaille@gostai.com>
1346
1347 Space and comments changes.
1348 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1349 * data/c.m4, data/lalr1.cc: Space changes.
1350
1351 2008-10-28 Akim Demaille <demaille@gostai.com>
1352
1353 Make gnulib a submodule.
1354 * gnulib: New.
1355 * .gitmodules (gnulib): New.
1356
1357 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1358
1359 Fix yyerror_range for user-defined location type in C++. Reported by
1360 Georg Sauthoff at
1361 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1362 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1363 * THANKS (Georg Sauthoff): Add.
1364
1365 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1366
1367 Update several administrative files mainly to facilitate releasing.
1368 * HACKING (Administrivia): Make the git-merge-changelog notes more
1369 helpful.
1370 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1371 (Release Procedure): Update for git and add numerous details that were
1372 previously missing.
1373 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1374 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1375 that announcements don't claim we bootstrapped with whatever bison
1376 happened to be in PATH. Add flex as a bootstrap tool.
1377 * Makefile.maint: Remove, previously replaced by maint.mk.
1378 * Makefile.cfg: Remove, and migrate settings to...
1379 * cfg.mk: ... here for the sake of `make announcement'.
1380 * bootstrap.conf (gnulib_modules): Add announce-gen.
1381 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1382 Berry.
1383
1384 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1385
1386 Small but important bugfixes for the Java skeleton.
1387 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1388 (yy_symbol_print): Call toString on yyvaluep.
1389
1390 2008-08-29 Akim Demaille <demaille@gostai.com>
1391
1392 Clarify UPDATED use.
1393 * doc/bison.texinfo: It refers to the last edition of this file,
1394 not to the release date of Bison.
1395 Reported by Joel E. Denny.
1396
1397 2008-08-29 Akim Demaille <demaille@gostai.com>
1398
1399 * README: Update FAQ pointer.
1400 Reported by Joel E. Denny.
1401
1402 2008-08-27 Eric Blake <ebb9@byu.net>
1403
1404 Resync m4sugar from autoconf.
1405 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1406 (m4_init): Adjust to latest m4.git changes.
1407 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1408 effects.
1409 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1410 (_m4_list_cmp): Reduce side effects.
1411
1412 2008-08-27 Akim Demaille <demaille@gostai.com>
1413
1414 Check yyerrok in calc.at.
1415 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1416 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1417 expected.
1418
1419 2008-08-27 Akim Demaille <demaille@gostai.com>
1420
1421 Support yyerrok in lalr1.cc.
1422 YYBACKUP is still to import back into lalr1.cc.
1423 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
1424
1425 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1426
1427 For maintainer-check*, don't recompile for a $(VERSION) update.
1428 * cfg.mk: New file.
1429 (_is-dist-target): Override the one in GNUmakefile.
1430 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1431
1432 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1433
1434 Update for recent change to gnulib.
1435 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1436 string.h now.
1437
1438 2008-08-15 Eric Blake <ebb9@byu.net>
1439
1440 Remaining m4sugar merge from autoconf.
1441 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1442 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1443 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1444 * src/output.c (output_skeleton): Tell m4 how to find it.
1445
1446 Partial m4sugar merge from autoconf: m4_map.
1447 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1448 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1449 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1450 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1451 for empty list.
1452 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1453 Likewise.
1454 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1455 declares it.
1456
1457 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1458
1459 Keep .version and PACKAGE_VERSION in sync.
1460 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1461 dependency, and add comments justifying this in more detail. Discussed
1462 starting at
1463 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1464
1465 2008-08-06 Eric Blake <ebb9@byu.net>
1466
1467 Partial m4sugar merge from autoconf: m4_shiftn.
1468 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1469 (m4_shift2, m4_shift3): New macros.
1470 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1471 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1472 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1473 * data/java.m4 (b4_remove_comma): Likewise.
1474
1475 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1476 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1477 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1478 (m4_init): Consolidate wrapped text into single m4_wrap.
1479 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1480 in wrapped text.
1481
1482 2008-08-05 Eric Blake <ebb9@byu.net>
1483
1484 Partial m4sugar merge from autoconf: builtins, version.m4.
1485 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1486 (m4_prepend): Remove, as it is unused and inherently quadratic,
1487 whereas m4_append is linear in newer m4.
1488 (m4_mkstemp): New builtin.
1489 (m4_symbols): Make rename conditional.
1490 (m4_version_prereq): Ensure fatal error if used in bison, which
1491 intentionally lacks version.m4.
1492
1493 Fix comments in m4sugar.
1494 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1495
1496 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1497
1498 Update for recent .gitignore fix in Gnulib.
1499 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1500 anchored .gitignore entries.
1501
1502 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1503
1504 Set gnu or gnits strictness.
1505 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1506 development and gnits strictness for releases. Based on Eric Blake's
1507 suggestion at
1508 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1509
1510 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
1511
1512 * NEWS: Clarify documentation of %language.
1513
1514 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
1515
1516 Support usage of git-merge-changelog.
1517 * .gitattributes: New.
1518 * HACKING: Document usage of git-merge-changelog.
1519 * bootstrap: Install git-merge-changelog entries in .git/config
1520 if appropriate.
1521
1522 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1523
1524 Remove remaining dependence on CVS Id keyword.
1525 * ChangeLog: For the sake of people still using CVS, don't use dollars
1526 when mentioning Id.
1527 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1528 unusual anyway.
1529 * data/xslt/xml2dot.xsl: Likewise.
1530 * data/xslt/xml2text.xsl: Likewise.
1531 * data/xslt/xml2xhtml.xsl: Likewise.
1532 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1533 * doc/Makefile.am (neutralize): Remove, no longer needed.
1534 (.x.1): Don't use neutralize.
1535 (edit): Don't substitute for ID.
1536 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1537
1538 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1539
1540 Fix dependence on computed configure variables.
1541 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1542 $(top_srcdir)/configure.ac so that changes to computed variables, such
1543 as PACKAGE_VERSION, are seen.
1544 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1545
1546 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1547
1548 Update copyright dates for recent changes.
1549 * Makefile.am: Here.
1550 * src/Makefile.am: Here.
1551 * src/reduce.c: Here.
1552 * tests/reduce.at: Here.
1553
1554 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1555
1556 Use git-version-gen for version names between releases.
1557 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1558 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1559 * .prev-version: New.
1560 * .version.in: Remove.
1561 * ChangeLog: Remove the Id previously used for capturing the CVS
1562 revision.
1563 * GNUmakefile: Remove, now copied from Gnulib.
1564 * Makefile.am: Add code suggested by comments in
1565 build-aux/git-version-gen.
1566 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1567 .prev-version, and .version.
1568 * NEWS (2.3b+): Rename to...
1569 (?.?): ... this because we're dropping the "+" version naming scheme,
1570 but, in general, we still can't be sure of our next release name.
1571 * bootstrap: Add a quick hack to remove from .gitignore the
1572 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1573 entry. This should really be fixed in gnulib instead.
1574 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1575 * configure.ac (AC_INIT): Set version name by invoking
1576 build-aux/git-version-gen.
1577 (AC_CONFIG_FILES): Remove .version, now generated by
1578 build-aux/git-version-gen.
1579 * maint.mk: New, copied from coreutils.
1580 * doc/.cvsignore (bison.1): Add.
1581 * doc/.gitignore (/bison.1): Add.
1582 * doc/bison.1: Remove, generated.
1583 * src/.cvsignore (revision.c): Remove.
1584 * src/.gitignore (/revision.c): Remove.
1585 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1586 (BUILT_SOURCES): Remove revision.c.
1587 (revision.c): Remove.
1588 * src/getargs.c (version): Don't print revision after the VERSION.
1589 * src/revision.h: Remove.
1590
1591 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1592
1593 Fix untranslatable composition of sentences. Reported by Goran
1594 Uddeborg at
1595 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1596 * THANKS (Goran Uddeborg): Add.
1597 * src/reduce.c (reduce_print): Report the number of nonterminals and
1598 rules useless in the grammar in separate sentences.
1599 * tests/reduce.at (Useless Rules): Update output.
1600 (Reduced Automaton): Likewise.
1601 (Underivable Rules): Likewise.
1602 (Empty Language): Likewise.
1603
1604 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1605
1606 Fix some .gitignore and .cvsignore problems.
1607 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1608 (insert_vc_ignore): ... this new function, which prepends `/' to all
1609 .gitignore entries before passing them to insert_sorted_if_absent.
1610 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1611 .cvsignore files are maintained even though Bison developers run
1612 bootstrap while using Git.
1613 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1614 unneeded by Bison.
1615 (gnulib): Add.
1616 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1617 unneeded. Reported by Eric Blake.
1618 * lib/.gitignore (/*~): Add.
1619 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1620 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1621 Blake.
1622 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1623
1624 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1625
1626 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1627 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1628 * bootstrap.conf (gnulib_modules): Add unsetenv.
1629 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1630 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1631 (/setenv.m4): Add.
1632 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1633 the first argument because it may become position-dependent, and unset
1634 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1635 Add comments explaining these issues in more detail.
1636
1637 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1638
1639 Add .gitignore everywhere based on .cvsignore.
1640 * .gitignore: New.
1641 * build-aux/.gitignore: New.
1642 * data/.gitignore: New.
1643 * doc/.gitignore: New.
1644 * etc/.gitignore: New.
1645 * examples/.gitignore: New.
1646 * examples/calc++/.gitignore: New.
1647 * lib/.gitignore: New.
1648 * m4/.gitignore: New.
1649 * po/.gitignore: New.
1650 * runtime-po/.gitignore: New.
1651 * src/.gitignore: New.
1652 * tests/.gitignore: New.
1653
1654 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1655
1656 * NEWS (2.3b+): New section, empty for now.
1657 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1658
1659 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1660
1661 * NEWS (2.3b): Update release date since there has been a delay in
1662 getting the announcements and tarballs out.
1663
1664 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1665
1666 * NEWS: Version 2.3b.
1667 * configure.ac (AC_INIT): Likewise.
1668 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1669
1670 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1671
1672 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1673 been doing it for years.
1674 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1675 (Release Procedure): Add FIXME about make alpha being unmaintained.
1676
1677 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1678
1679 * data/yacc.c: Reformat m4 a little for readability.
1680 * src/lalr.c (build_relations): Correct comment.
1681
1682 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1683
1684 DJGPP specific issue.
1685 * djgpp/config.sed: Fixes required to run configure scripts generated
1686 by autoconf 2.62.
1687
1688 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1689
1690 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1691 coordinator@translationproject.org.
1692
1693 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1694
1695 * THANKS: Add Eric Blake.
1696
1697 2008-04-23 Eric Blake <ebb9@byu.net>
1698
1699 Revert prior patch, by working around autoconf regression.
1700 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1701 ("Output file name: ("): Uncomment test.
1702 ("Output file name: )"): Likewise.
1703 Based on an idea from Noah Misch.
1704
1705 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1706
1707 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1708 2.61. Reported by Juan Manuel Guerrero at
1709 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1710 * tests/output.at ("Output file name: ("): Comment out test case for
1711 now.
1712 ("Output file name: )"): Likewise.
1713
1714 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1715
1716 * GNUmakefile: Update git-version-gen invocation so make dist
1717 succeeds.
1718
1719 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1720
1721 Update to the current gnulib CVS repository, and fix trigraph handling
1722 in Bison.
1723 * bootstrap: Update gnulib CVS repository URL.
1724 (symlink_to_dir): Encapsulate the code that guarantees the destination
1725 directory exists into...
1726 (check_dst_dir): ... this new function, and...
1727 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1728 fail when copying files into lib/uniwidth/.
1729 * src/output.c (prepare_symbols): When writing yytname muscles, where
1730 symbol names will be encoded in C-string literals, tell quotearg to
1731 escape trigraphs. This used to be the default in gnulib.
1732 * tests/regression.at (Token definitions): Because of the change in
1733 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1734 escapes trigraphs in symbol names. Thus, yytname no longer has
1735 trigraphs unnecessarily doubly escaped. Update test case output.
1736 Extend test case to be sure Bison's own error messages will no longer
1737 have trigraphs in symbol names unnecessarily escaped once.
1738
1739 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1740
1741 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1742 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1743 * .cvsignore: Add .version.
1744 * .version.in: New.
1745 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1746 * configure.ac (AC_CONFIG_FILES): Add .version.
1747 * build-aux/.cvsignore: Add git-version-gen.
1748
1749 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1750
1751 * NEWS (2.3a+): Mention that -g now takes an argument.
1752 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1753 consistency. Update the -g and -x entries now that they take
1754 arguments. Use brackets to indicate optional arguments.
1755 * src/getargs.c (usage): Explain the relationship between arguments of
1756 long and short options more completely. Document --defines and -d
1757 separately since the former takes an argument but, for POSIX Yacc, the
1758 latter does not.
1759 (short_options): Let -W take an optional argument like --warnings.
1760 (getargs): Sort cases.
1761
1762 2008-02-28 Akim Demaille <demaille@gostai.com>
1763
1764 * doc/bison.texinfo: Fix a few typos.
1765
1766 2008-02-28 Akim Demaille <akim@epita.fr>
1767
1768 * doc/bison.texinfo (Bison Options): Document -W.
1769 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1770
1771 2008-02-28 Akim Demaille <akim@epita.fr>
1772
1773 * src/getargs.c (short_options): Split and sort for readability.
1774 -g and -x take optional arguments, just like their long options.
1775 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1776 understand.
1777 Fix the handling of $opt which resulted in all the argument to be
1778 considered as optional.
1779
1780 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1781
1782 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1783 say its interface is experimental.
1784 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1785 Java.
1786 (Bison Options): In the -L and --language entry, mention Java.
1787 (Java Bison Interface): Say the interface is experimental.
1788 * src/getargs.c (usage): Mention -L and --language.
1789
1790 * NEWS (2.3a+): Say the push parsing interface is experimental.
1791 * doc/bison.texinfo (Push Decl): Likewise.
1792 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1793 (Push Parser Function): Likewise.
1794 (Pull Parser Function): Likewise.
1795 (Parser Create Function): Likewise.
1796 (Parser Delete Function): Likewise.
1797 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1798 yypull_parse, and yypush_parse entries.
1799
1800 * NEWS (2.3a+): Mention XML support, and say the schema is
1801 experimental.
1802 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1803 * src/getargs.c (usage): Say the XML schema is experimental.
1804
1805 * NEWS (2.3a+): Say option instead of flag.
1806
1807 2008-02-21 Wojciech Polak <polak@gnu.org>
1808
1809 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1810 text.
1811
1812 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1813
1814 Fix impure push parser compile error reported by Bob Rossi at
1815 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1816 * data/yacc.c: Clean up whitespace in the output a little.
1817 (yypstate_allocated): Define for impure push parsers regardless of
1818 whether the pull interface is also requested.
1819 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1820 check impure push parsers without the pull interface.
1821
1822 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1823 yyerror takes arguments specified by %parse-param while yypstate_new
1824 does not.
1825 * doc/bison.texinfo (Parser Create Function): Document that
1826 yypstate_new returns 0 for multiple impure parser instances.
1827 * tests/push.at (Push Parsing: Multiple impure instances): Update
1828 expected stderr output.
1829
1830 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1831
1832 * runtime-po/POTFILES.in (push.c): Remove.
1833
1834 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1835
1836 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1837 * data/push.c: Rename to...
1838 * data/yacc.c: ... this, overwriting it.
1839 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1840 `%push-pull-parser' -> `%define api.push_pull "both"'.
1841 Remove old yacc.c tests, and update push.c tests to yacc.c.
1842
1843 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1844
1845 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1846 `"%code top" blocks' instead of `%code "top" blocks'.
1847 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1848 Clean up whitespace in the output a little.
1849
1850 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1851
1852 Fix documentation problems reported by Tim Josling at
1853 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1854 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1855 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1856 integers. Explain the effect of literal string aliases on error
1857 messages. Copy token 0 documentation from the C++ skeleton
1858 documentation.
1859
1860 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1861
1862 Accept a token number in a %left, %right, or %nonassoc for POSIX
1863 conformance. Reported by Tim Josling at
1864 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1865 * NEWS (2.3a+): Mention.
1866 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1867 and code numbers are treated by precedence declarations.
1868 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1869 of symbols.1.
1870 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1871 of symbol.
1872 (symbol.prec): New, just like symbol but allows INT.
1873 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1874 longer holds.
1875 * tests/regression.at (Token number in precedence declaration): New
1876 test case.
1877
1878 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1879
1880 DJGPP specific issues.
1881 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1882 be changed. Copyright timestamp adjusted.
1883 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1884 be changed. Copyright timestamp adjusted.
1885 * djgpp/config.site: Copyright timestamp adjusted.
1886 * djgpp/config_h.sed: Copyright timestamp adjusted.
1887 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1888 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1889 filename translation list.
1890 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1891 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1892 files shall be created. Before trying to use the temp dir where the
1893 environment variable points to check that the dir really exists. If
1894 not default to the cwd as temp dir. Copyright timestamp adjusted.
1895 * djgpp/subpipe.h: Copyright timestamp adjusted.
1896 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1897
1898 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1899
1900 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
1901
1902 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
1903
1904 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
1905 Problem reported by Claudio Saavedra in
1906 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
1907
1908 2008-01-05 Wojciech Polak <polak@gnu.org>
1909
1910 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
1911 document's title with the input grammar file name.
1912
1913 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
1914
1915 Automate regression testing of the XML/XSLT implementation. Discussed
1916 starting at
1917 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
1918 * configure.ac (XSLTPROC): New substitution.
1919 * Makefile.am (maintainer-xml-check): New phony target invoking...
1920 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
1921 invoking make maintainer-check with BISON_TEST_XML=1.
1922 * tests/atlocal.in (XSLTPROC): New.
1923 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
1924 not to report reachable memory when Bison is expected to have a
1925 non-zero exit status and (2) to compare XML/XSLT output with --graph
1926 and --report=all output for every working grammar when
1927 BISON_TEST_XML=1.
1928 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
1929 (AT_BISON_CHECK_XML): New.
1930 (AT_QUELL_VALGRIND): New.
1931 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
1932 (AT_CHECK): ... don't redefine this since this was the old way to
1933 quell Valgrind.
1934 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
1935 AT_BISON_CHECK invocations.
1936 * tests/c++.at: Likewise.
1937 * tests/calc.at: Likewise.
1938 * tests/conflicts.at: Likewise.
1939 * tests/cxx-type.at: Likewise.
1940 * tests/existing.at: Likewise.
1941 * tests/glr-regression.at: Likewise.
1942 * tests/headers.at: Likewise.
1943 * tests/input.at: Likewise.
1944 * tests/java.at: Likewise.
1945 * tests/output.at: Likewise.
1946 * tests/push.at: Likewise.
1947 * tests/reduce.at: Likewise.
1948 * tests/regression.at: Likewise.
1949 * tests/sets.at: Likewise.
1950 * tests/skeletons.at: Likewise.
1951 * tests/synclines.at: Likewise.
1952 * tests/torture.at: Likewise.
1953 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
1954 tends to hang xsltproc.
1955 (Big horizontal): Likewise.
1956
1957 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1958
1959 In XML output, remove redundant class attribute on symbol element.
1960 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
1961 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
1962 look up a symbol to determine whether it's a nonterminal or terminal.
1963 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
1964 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
1965
1966 Add prec/assoc information to XML output.
1967 * src/gram.c (grammar_rules_print_xml): For each rule that has a
1968 %prec, add a percent_prec attribute.
1969 * src/print-xml.c (print_grammar): For each terminal that has a
1970 precedence or associativity, add a prec or assoc attribute.
1971 (xml_indent): New.
1972 (xml_puts): Use xml_indent.
1973 (xml_printf): Use xml_indent.
1974 * src/print-xml.h (xml_indent): Prototype.
1975
1976 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
1977 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
1978
1979 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1980
1981 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
1982 (bison:ruleByNumber): ... this for clarity.
1983 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
1984 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
1985 (xsl:template match="reduction"): Update.
1986 (xsl:template match="item"): Update.
1987 (xsl:template match="reduction"): Update.
1988
1989 In the XML output, don't print the list of rules where symbols appear.
1990 Compute it in XSLT instead. Discussed at
1991 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
1992 * data/xslt/bison.xsl (bison:ruleByLhs): New.
1993 (bison:ruleByRhs): New.
1994 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
1995 bison:ruleByRhs.
1996 (xsl:template match="terminal/rule"): Remove.
1997 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1998 bison:ruleByRhs.
1999 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2000 Remove.
2001 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2002 bison:ruleByRhs and mode="number-link" for rule template.
2003 (xsl:template match="terminal/rule"): Remove.
2004 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2005 bison:ruleByRhs and mode="number-link" for rule template.
2006 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2007 Rewrite as...
2008 (xsl:template match="rule" mode="number-link"): ... this.
2009 * src/print-xml.c (print_grammar): Don't print the list of rules.
2010
2011 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2012
2013 Don't let --report affect XML output; always print all information.
2014 Discussed at
2015 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2016 * src/conflicts.c (log_resolution): Implement.
2017 * src/print-xml.c (print_core): Implement.
2018 (print_state): Implement.
2019 (print_xml): Implement.
2020
2021 * NEWS (2.3a+): Fix quotes.
2022 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2023 don't let %verbose clear the list specified by --report.
2024
2025 2007-11-26 Akim Demaille <akim@epita.fr>
2026
2027 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2028
2029 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2030
2031 In the XML output, list useless and unused symbols and rules with the
2032 useful ones and add a "usefulness" attribute. Discussed starting at
2033 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2034 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2035 (grammar_rules_print_xml): Print all rules instead of just those
2036 useful in the grammar, and add a "usefulness" attribute.
2037 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2038 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2039 (print_grammar): Print all nonterminals instead of just useful ones,
2040 and add a "usefulness" attribute to nonterminals and terminals.
2041 (print_xml): Don't print a separate "reductions" or
2042 "rules-useless-in-parser" element.
2043 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2044 (reduce_xml): Remove.
2045 (reduce_token_unused_in_grammar): New.
2046 (reduce_nonterminal_useless_in_grammar): New.
2047 * src/reduce.h (reduce_xml): Remove prototype.
2048 (reduce_token_unused_in_grammar): Add prototype.
2049 (reduce_nonterminal_useless_in_grammar): Add prototype.
2050 * data/xslt/xml2text.xsl: Update for XML changes.
2051 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2052 * tests/reduce.at (Useless Terminals): Update output.
2053 (Useless Rules): Update output.
2054 (Reduced Automaton): Update output.
2055
2056 Say "Terminals unused in grammar" instead of "Unused terminals".
2057 * NEWS (2.3a+): Update.
2058 * doc/bison.texinfo (Understanding): Update example output.
2059 * src/reduce.c (reduce_output): Implement.
2060 * data/xslt/xml2text.xsl: Implement.
2061 * data/xslt/xml2xhtml.xsl: Implement.
2062
2063 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2064
2065 Accept --report-file=FILE to override the default `.output' filename.
2066 * NEWS (2.3a+): Mention.
2067 * doc/bison.texinfo (Bison Options): Add an entry.
2068 * src/files.c (compute_output_file_names): Don't override
2069 spec_verbose_file if already set.
2070 * src/getargs.c (usage): Document --report-file.
2071 (REPORT_FILE_OPTION): New anonymous enum member.
2072 (long_options): Add entry for it.
2073 (getargs): Add case for it setting spec_verbose_file.
2074
2075 * build-aux/cross-options.pl: Don't record a short option just because
2076 there's an arg.
2077 * doc/.cvsignore: Add yacc.1.
2078
2079 2007-11-14 Akim Demaille <akim@epita.fr>
2080
2081 * doc/yacc.1.in: New.
2082 * configure.ac, doc/Makefile.am: Adjust.
2083 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2084 config.h symbol.
2085 Use AC_SUBST for assignments too.
2086 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2087
2088 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2089
2090 * src/gram.c: Remove comments that duplicate comments in gram.h.
2091
2092 When reporting useless rules and nonterminals, say "useless in grammar"
2093 instead of "useless", and say "useless in parser" instead of "never
2094 reduced". Discussed starting at
2095 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2096 * NEWS (2.3a+): Mention this change.
2097 * data/xslt/xml2text.xsl: Update output text and expected input XML
2098 element names to match changes below.
2099 * data/xslt/xml2xhtml.xsl: Likewise.
2100 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2101 Contents: "Rules useless in parser due to conflicts".
2102 * doc/bison.texinfo (Decl Summary): Reword a little.
2103 (Understanding): Update example output for changes below.
2104 * src/gram.c: (rule_useful_p): Rename to...
2105 (rule_useful_in_grammar_p): ... this.
2106 (rule_useless_p): Rename to...
2107 (rule_useless_in_grammar_p): ... this.
2108 (rule_never_reduced_p): Rename to...
2109 (rule_useless_in_parser_p): ... this.
2110 (grammar_rules_print): Update for renames.
2111 (grammar_rules_print_xml): Update for renames.
2112 (grammar_rules_never_reduced_report): Rename to...
2113 (grammar_rules_useless_report): ... this since it is used for either
2114 kind of useless rule.
2115 * src/gram.h: Reword comments and update function names in prototypes.
2116 * src/main.c (main): Say "rule useless in parser due to conflicts".
2117 * src/print-xml.c (print_rules_never_reduced): Rename to...
2118 (print_rules_useless_in_parser): ... this, and rename output XML
2119 element "rules-never-reduced" to "rules-useless-in-parser".
2120 (print_xml): Update for rename.
2121 * src/print.c (print_results): Say "Rules useless in parser due to
2122 conflicts".
2123 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2124 (nonterminals_reduce): Say "nonterminal useless in grammar".
2125 (reduce_output): Say "Nonterminals useless in grammar".
2126 Say "Rules useless in grammar".
2127 (reduce_xml): Rename output XML element "useless" to
2128 "useless-in-grammar".
2129 (reduce_print): Don't report the count of grammatically useless rules
2130 as "rules never reduced" just because %yacc is specified.
2131 In the correct report of this count, say nonterminal(s) and rule(s)
2132 "useless in grammar".
2133 * tests/conflicts.at (S/R in initial): Update expected output.
2134 (Defaulted Conflicted Reduction): Likewise.
2135 (Unreachable States After Conflict Resolution): Likewise.
2136 * tests/existing.at (GNU pic Grammar): Likewise.
2137 * tests/reduce.at (Useless Nonterminals): Likewise.
2138 (Useless Rules): Likewise.
2139 (Reduced Automaton): Likewise.
2140 (Underivable Rules): Likewise.
2141 (Empty Language): Likewise.
2142
2143 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2144
2145 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2146 here document and before the EOF so that BSD's implementation of Bourne
2147 shell doesn't parse the delimiter as part of the here document.
2148 * doc/.cvsignore: Add cross-options.texi.
2149 * src/getargs.c (usage): Add a blank line after the warning categories.
2150
2151 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
2152
2153 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2154
2155 2007-11-05 Akim Demaille <akim@epita.fr>
2156
2157 Remove Id: from bison.1.
2158 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2159 (perl -0777 -pi -e 's/\.PP\nId): New.
2160 (.x.1): Use it to ignore the version control revision.
2161
2162 2007-11-05 Akim Demaille <demaille@gostai.com>
2163
2164 * build-aux/Makefile.am: Ship cross-options.pl.
2165 * doc/Makefile.am: Always refer to cross-options.texi with
2166 $(srcdir).
2167 (MAINTAINERCLEANFILES): Add it.
2168
2169 2007-11-04 Akim Demaille <demaille@gostai.com>
2170
2171 Generate the long/short option cross-table.
2172 * build-aux/cross-options.pl: New.
2173 * doc/Makefile.am (cross-options.texi): New.
2174 * doc/bison.texinfo: Use it.
2175
2176 2007-11-04 Akim Demaille <demaille@gostai.com>
2177
2178 Generate bison.1 using help2man.
2179 * doc/common.x, doc/bison.x: New.
2180 * doc/Makefile.am (bison.1, .x.1): New.
2181 The code is taken from autoconf-2.61/man/Makefile.am.
2182 * configure.ac: Look for help2man.
2183
2184 2007-11-04 Akim Demaille <demaille@gostai.com>
2185
2186 Complete --help.
2187 * src/getargs.c (usage): Document -W, make it clear that -d,
2188 -g and -x have optional arguments.
2189
2190 2007-11-04 Akim Demaille <demaille@gostai.com>
2191
2192 Find sha1sum when named gsha1sum.
2193 * bootstrap (find_tool): New.
2194 ($SHA1SUM): New.
2195
2196 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2197
2198 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2199 at
2200 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2201 * NEWS (2.3a+): Mention.
2202 * data/bison.m4 (b4_pure_if): Don't define it here.
2203 * data/c.m4 (b4_identification): Depend on individual skeletons to
2204 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2205 values of the %define variables api.pure or api.push_pull. Define
2206 YYPURE, YYPUSH, and YYPULL accordingly.
2207 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2208 glr.cc has already defined b4_pure_flag.
2209 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2210 Remove YYPUSH and YYPULL since they're back in b4_identification again.
2211 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
2212 * doc/bison.texinfo (Pure Decl): Update.
2213 (Push Decl): Update.
2214 (Decl Summary): Add api.pure to %define entry.
2215 In %pure-parser entry, say it's deprecated and reference %define.
2216 (Pure Calling): Update.
2217 (Error Reporting): Update.
2218 (C++ Scanner Interface): Update.
2219 (How Can I Reset the Parser): Update.
2220 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2221 reference %define.
2222 * src/getargs.c (pure_parser): Remove global variable.
2223 * src/getargs.h (pure_parser): Remove extern.
2224 * src/output.c (prepare): Don't define pure_flag muscle.
2225 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2226 wrapper around `%define api.pure'.
2227 * tests/calc.at (Simple LALR Calculator): Update.
2228 (Simple GLR Calculator): Update.
2229 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2230 Update.
2231 (GLR: Resolve ambiguity, pure, locations): Update.
2232 (GLR: Merge conflicting parses, pure, no locations): Update.
2233 (GLR: Merge conflicting parses, pure, locations): Update.
2234 * tests/glr-regression.at (Uninitialized location when reporting
2235 ambiguity): Update
2236 * tests/input.at (Unused %define api.pure): New test case.
2237 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2238 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2239 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2240
2241 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2242
2243 %define push_pull -> %define api.push_pull. Discussed starting at
2244 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2245 * data/push.c: Expect the new name.
2246 * data/yacc.c: Likewise.
2247 * doc/bison.texinfo (Push Decl): Update.
2248 (Decl Summary): Update %define entry.
2249 (Push Parser Function): Update.
2250 (Pull Parser Function): Update.
2251 (Parser Create Function): Update.
2252 (Parser Delete Function): Update.
2253 * tests/calc.at (Simple LALR Calculator): Update.
2254 * tests/input.at (%define enum variables): Update.
2255 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2256 (Push Parsing: Multiple impure instances): Update.
2257 (Push Parsing: Unsupported Skeletons): Update.
2258 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2259 (Exploding the Stack Size with Malloc): Update.
2260
2261 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2262 other entries some.
2263
2264 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2265
2266 For the XML output's terminal element, rename @number to @token-number,
2267 and add @symbol-number. In the nonterminal element, rename @number to
2268 @symbol-number. Discussed starting at
2269 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2270 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2271 renames.
2272 (xsl:template match="nonterminal"): Likewise.
2273 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2274 (xsl:template match="nonterminal"): Likewise.
2275 * src/print-xml.c (print_grammar): Implement.
2276
2277 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2278
2279 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2280 2007-10-11 change, the child elements here are items not rules.
2281 (xsl:template match="item"): New.
2282 (xsl:template match="rule"): Update for new reduced itemset.
2283 (xsl:template match="point"): Remove.
2284 (xsl:template match="empty"): For consistency with --graph, don't
2285 output "/* empty */".
2286 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2287 line-wrap, don't pass a negative value as first-line-length since this
2288 won't work with the following changes.
2289 (xsl:template name="line-wrap"): Simplify slightly.
2290 (xsl:template name="ws-search"): Eliminate recursion.
2291 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2292 set next to an item whose dot is not at the end of the RHS even if it
2293 happens to be associated with the same rule.
2294
2295 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2296
2297 Add %define lr.keep_unreachable_states.
2298 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2299 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2300 * src/main.c (main): Implement it.
2301 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2302 Extend to test it, and fix a typo.
2303
2304 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2305
2306 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
2307 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2308 the example .output text.
2309 * tests/regression.at (Extra lookahead sets in report): Improve wording
2310 of comments.
2311
2312 2007-10-17 Wojciech Polak <polak@gnu.org>
2313
2314 * src/print-xml.c (print_grammar): Renamed
2315 <terminal> and <nonterminal> attributes:
2316 "type" to "number" and "symbol" to "name".
2317 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2318 Use new attribute names.
2319 (xsl:template match="nonterminal"): Likewise.
2320 * data/xslt/xml2xhtml.xsl: Likewise.
2321
2322 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2323
2324 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2325 (Option Cross Key): Likewise.
2326
2327 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2328 next to an item whose dot is not at the end of the RHS even if it
2329 happens to be associated with the same rule.
2330 * src/print.c (print_core): Likewise.
2331 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2332 (Resolved SR Conflicts): Update output.
2333 * tests/regression.at (Extra lookahead sets in report): New test case.
2334
2335 2007-10-11 Wojciech Polak <polak@gnu.org>
2336
2337 * src/print-xml.c (print_core): Remove item set
2338 redundancy.
2339 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2340 Improve processing time. Suggested by Joel E. Denny.
2341 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2342 Write xsl:param "required" attribute as comment.
2343 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2344 (xsl:template match="rule"): Support new reduced itemset.
2345 (xsl:template match="point"): Remove.
2346 * data/xslt/xml2xhtml.xsl: Likewise.
2347
2348 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2349
2350 * src/getargs.c (version): Update copyright year.
2351
2352 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2353
2354 Make xml2dot.xsl and --graph produce the same output.
2355 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2356 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2357 escaped later.
2358 (xsl:template name="output-node"): Use the new escape template instead
2359 of the string-replace template directly.
2360 (xsl:template name="output-edge"): Likewise.
2361 (xsl:template name="escape"): New, escapes backslashes and newlines in
2362 addition to quotation marks.
2363 * src/graphviz.c (start_graph, output_node, output_edge): Add
2364 whitespace to output for legibility.
2365
2366 Make xml2text.xsl and --report produce the same output, and remove the
2367 XML "conflicts" element since a conflict summary is easily extracted
2368 from the automaton.
2369 * data/xslt/bison.xsl: New.
2370 (xsl:template match="state" mode="bison:count-conflicts): New.
2371 * data/xslt/xml2text.xsl: Import bison.xsl.
2372 (xsl:template match="bison-xml-report"): Instead of styling the
2373 "conflicts" element, style the "automaton" element with mode
2374 "conflicts". Unlike the former, the latter lists S/R and R/R
2375 conflicts for a state on the same line.
2376 (xsl:template match="conflicts"): Remove.
2377 (xsl:template match="conflict"): Remove.
2378 (xsl:template match="terminal"): Line-wrap the list of rules in which
2379 the terminal is used.
2380 (xsl:template match="nonterminal"): Likewise for nonterminals.
2381 (xsl:template match="automaton" mode="conflicts"): New.
2382 (xsl:template match="state" mode="conflicts"): New.
2383 (xsl:template name="line-wrap"): New.
2384 (xsl:template name="ws-search"): New.
2385 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2386 (xsl:template match="bison-xml-report"): Instead of styling the
2387 "conflicts" element, style the "automaton" element with mode
2388 "conflicts."
2389 (xsl:template match="conflicts"): Remove.
2390 (xsl:template match="conflict"): Remove.
2391 (xsl:template match="automaton" mode="conflicts"): New.
2392 (xsl:template match="state" mode="conflicts): New.
2393 * src/conflicts.c (conflicts_output_xml): Remove.
2394 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2395 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2396 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2397 the corresponding XSLT is easier. Also, never wrap between a word and
2398 the comma that follows it.
2399
2400 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2401
2402 Improve C++ namespace support. Discussed starting at
2403 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2404 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2405 b4_namespace_close): New macros that interpret the %define variable
2406 "namespace" so its value can contain "::" to indicate nested
2407 namespaces.
2408 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2409 the above macros.
2410 * data/lalr1.cc (b4_namespace): Likewise.
2411 * data/location.cc (b4_namespace): Likewise.
2412 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2413 inside a new table in the general %define entry. Document `%define
2414 namespace' there as well. Point the %name-prefix entry to it since it
2415 explains it more completely in the case of C++.
2416 (C++ Bison Interface): Mention `%define namespace' instead of
2417 %name-prefix.
2418 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2419 entry suffices.
2420 * tests/c++.at (Relative namespace references): New test case.
2421 (Absolute namespace references): New test case.
2422 (Syntactically invalid namespace references): New test case.
2423 * tests/input.at (C++ namespace reference errors): New test case.
2424
2425 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2426
2427 Add syncline support and location accessor to internal %define
2428 interfaces.
2429 * data/bison.m4 (b4_percent_define_get_loc): New.
2430 (b4_percent_define_get_syncline): New.
2431 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2432 (b4_percent_define_default): Record defining location as line 1 rather
2433 than 0 for the sake of synchronizing #line's, and define
2434 b4_percent_define_syncline(VARIABLE).
2435 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2436 * src/muscle_tab.c (muscle_syncline_grow): New.
2437 (muscle_code_grow): Use muscle_syncline_grow.
2438 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2439 define b4_percent_define_syncline(VARIABLE).
2440 (muscle_percent_define_get_loc): New.
2441 (muscle_percent_define_get_syncline): New.
2442 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2443 remove some unused variables.
2444 (muscle_percent_define_default): Record defining location as line 1
2445 rather than 0 for the sake of synchronizing #line's, and define
2446 b4_percent_define_syncline(VARIABLE).
2447 (muscle_percent_define_check_values): Use
2448 muscle_percent_define_get_loc.
2449 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2450 (muscle_percent_define_get_syncline): Prototype.
2451 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2452 defaults): Update output for location change.
2453 (Complaining during macro argument expansion): Extend to test
2454 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2455
2456 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2457
2458 Fix some error-reporting macro bugs.
2459 * data/bison.m4 (b4_cat): New.
2460 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2461 to stdout so they don't become arguments to other macros. Update
2462 comments and add examples.
2463 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2464 add examples.
2465 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2466 after printing the error directive so that M4 doesn't report subsequent
2467 problems that are induced by this problem.
2468 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2469 instead of just in them. Recognize @\n in both places. Both expand to
2470 the empty string. Needed by b4_cat.
2471 * tests/skeletons.at (Complaining during macro argument expansion):
2472 New test case.
2473 (Fatal errors make M4 exit immediately): New test case.
2474
2475 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2476
2477 Implement --print-datadir.
2478 * src/getargs.c (usage): Mention.
2479 (PRINT_DATADIR_OPTION): New anonymous enum member.
2480 (long_options): Add entry for it.
2481 (getargs): Add case for it calling compute_pkgdatadir.
2482 * src/output.c (output_skeleton): Encapsulate data directory
2483 computation from here...
2484 (prepare): ... and from here...
2485 (compute_pkgdatadir): ... into this new function.
2486 * src/output.h (compute_pkgdatadir): Prototype.
2487
2488 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2489
2490 * src/print-xml.c (escape_bufs): New static global variable
2491 replacing...
2492 (xml_escape_n): ... the static local variable buf here.
2493 (print_xml): Free memory for escape_bufs.
2494 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2495
2496 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2497
2498 Replace `%push-parser' and `%push-pull-parser' with
2499 `%define push_pull "push"' and `%define push_pull "both"'.
2500 `%define push_pull "pull"' is the default.
2501 * doc/bison.texinfo (Push Decl, Push Parser Function,
2502 Pull Parser Function, Parser Create Function, Parser Delete Function):
2503 Update declarations.
2504 (Decl Summary, Table of Symbols): Replace %push-parser and
2505 %push-pull-parser entries with a %define push_pull entry.
2506 * data/bison.m4 (b4_percent_define_check_values): New macro.
2507 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2508 definitions...
2509 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2510 definitions...
2511 * data/push.c: ... to here and compute them from the value of the
2512 %define variable push_pull.
2513 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2514 parsing requests here...
2515 * data/yacc.c: ... hack this to switch to push.c any time
2516 b4_use_push_pull_flag or the %define variable push_pull is set. This
2517 will go away when we mv push.c yacc.c.
2518 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2519 push parsing is not supported since unused %define variables are
2520 reported anyway.
2521 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2522 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2523 comments for consistency with b4_percent_define_check_values.
2524 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2525 muscles.
2526 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2527 Remove.
2528 (prologue_declaration): Remove %push-parser and %push-pull-parser
2529 rules.
2530 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2531 * tests/calc.at: Update declarations.
2532 * tests/input.at (%define enum variables): New test case.
2533 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2534 declaration.
2535 (Push Parsing: Multiple impure instances): Update declaration.
2536 (Push Parsing: Unsupported Skeletons): New test case.
2537 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2538 declaration.
2539 (Exploding the Stack Size with Malloc): Update declaration.
2540
2541 2007-09-24 Wojciech Polak <polak@gnu.org>
2542
2543 Add XSLT transformations.
2544
2545 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2546 * data/xslt/xml2text.xsl: Transform XML into plain text.
2547 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2548 * data/Makefile.am (xsltdir): New variable.
2549 (dist_xslt_DATA): Add xslt/*.xsl files.
2550
2551 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2552
2553 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2554 Problem reported by Wojciech Polak.
2555 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2556 (xml_printf): Undo change I made on 21 September; that is,
2557 indent 2 spaces, not 1.
2558
2559 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2560
2561 Pacify ./configure --enable-gcc-warnings.
2562 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2563 `char const *' instead of `char *'.
2564 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2565 local variable `sep'.
2566
2567 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2568
2569 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2570 elsewhere.
2571 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2572 (xml_printf): Indent just 1 space for level.
2573 (e_char, xlate_char): Remove.
2574 (xml_escape_string): Rewrite to avoid undefined behavior (used
2575 storage that was freed from the stack).
2576 (xml_escape_n): Don't bother checking for subscript error.
2577
2578 2007-09-21 Wojciech Polak <polak@gnu.org>
2579
2580 Add Bison XML Automaton Report.
2581
2582 Add support for an -x option to generate an XML report.
2583 It is not documented yet.
2584 * src/print-xml.c: New file.
2585 * src/print-xml.h: Likewise.
2586 * lib/timevar.def (TV_XML): New var.
2587 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2588 * src/conflicts.c: Include print-xml.h.
2589 (solved_conflicts_xml_obstack): New var.
2590 (log_resolution, conflicts_solve, conflicts_free):
2591 Add support for XML report.
2592 (conflicts_output_val): New function.
2593 * src/conflicts.h (conflicts_output_val): New decl.
2594 * src/files.c (spec_xml_file): New var.
2595 (compute_output_file_names, output_file_names_free): Add XML support.
2596 * src/files.h (spec_xml_file): New decl.
2597 * src/getargs.c (xml_flag): New var.
2598 (usage, short_options, long_options, getargs): Add XML support.
2599 * src/getargs.h (xml_flag): New decl.
2600 * src/gram.c: Include print-xml.h.
2601 (rule_lhs_print_xml, rule_rhs_print_xml):
2602 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2603 New functions.
2604 * src/gram.h: Declare external ones.
2605 * src/main.c: Include print-xml.h.
2606 (main): Add XML support.
2607 * src/reduce.c: Include print-xml.h.
2608 (reduce_xml): New function.
2609 * src/reduce.h: Declare it.
2610 * src/state.c: Include print-xml.h.
2611 (state_new): Add XML support.
2612 (state_rule_lookahead_tokens_print_xml): New function.
2613 * src/state.h: Declare it.
2614 (struct state): New member solved_conflicts_xml.
2615 * src/symtab.c (symbol_class_get_string): New function.
2616 * src/symtab.h: Declare it.
2617
2618 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2619
2620 * GNUmakefile: Switch to coreutils's version.
2621 * bootstrap: Likewise.
2622 * Makefile.cfg: Adjust to new GNUmakefile.
2623 * README-hacking: Likewise.
2624
2625 Import from gnulib:
2626
2627 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2628 Bruno Haible <bruno@clisp.org>
2629
2630 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2631 and is a script that invokes bison. Tighten the code. Add comments.
2632
2633 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2634
2635 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2636 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2637 * doc/bison.texinfo (Decl Summary): Fix.
2638 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2639 * tests/input.at (Boolean %define variables): Update output.
2640 * tests/skeletons.at (%define boolean variables: invalid skeleton
2641 defaults): Rename to...
2642 (%define Boolean variables: invalid skeleton defaults): ... this and
2643 update output.
2644
2645 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2646
2647 In impure push mode, don't allow more than one yypstate to be allocated
2648 since multiple impure parsers would corrupt yynerrs.
2649 * data/push.c (yypstate_allocated): New static global variable
2650 initialized to 0.
2651 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2652 exhaustion if yypstate_allocated is 1, but still return 2.
2653 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2654 already 1. Otherwise, set it to 1.
2655 (yypstate_delete): Set it to 0.
2656 * tests/push.at (Push Parsing: Multiple impure instances): New test
2657 case.
2658
2659 2007-08-17 Bob Rossi <bob@brasko.net>
2660
2661 * doc/bison.texinfo (Push Decl): Document the push parser.
2662 (Table of Symbols): Ditto.
2663 (Pure Decl): Ditto.
2664 (Decl Summary): Ditto.
2665 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2666 Parser Create Function, Parser Delete Function):
2667 Add new push parser symbols.
2668 (Table of Symbols): Document push-parser, push-pull-parser,
2669 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2670
2671 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2672
2673 Update to GPLv3.
2674 * doc/gpl-3.0.texi: New file.
2675 * doc/gpl.texi: Remove.
2676 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2677 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2678 * README-hacking, TODO, bootstrap, bootstrap.conf:
2679 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2680 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2681 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2682 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2683 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2684 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2685 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2686 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2687 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2688 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2689 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2690 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2691 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2692 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2693 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2694 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2695 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2696 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2697 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2698 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2699 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2700 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2701 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2702 * src/complain.c, src/complain.h, src/conflicts.c:
2703 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2704 * src/files.h, src/flex-scanner.h, src/getargs.c:
2705 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2706 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2707 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2708 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2709 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2710 * src/print.c, src/print.h, src/print_graph.c:
2711 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2712 * src/reduce.h, src/relation.c, src/relation.h:
2713 * src/revision.h, src/scan-code.h, src/scan-code.l:
2714 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2715 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2716 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2717 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2718 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2719 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2720 * tests/existing.at, tests/glr-regression.at:
2721 * tests/headers.at, tests/input.at, tests/java.at:
2722 * tests/local.at, tests/output.at, tests/push.at:
2723 * tests/reduce.at, tests/regression.at, tests/sets.at:
2724 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2725 * tests/torture.at:
2726 Update to GPLv3.
2727
2728 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2729
2730 Get rid of broken %no-parser, -n, and --no-parser implementation and
2731 documentation.
2732 * TODO: Don't mention them.
2733 * doc/bison.1: Likewise.
2734 * doc/bison.texinfo (Decl Summary): Likewise.
2735 (Bison Options): Likewise.
2736 (Option Cross Key): Likewise.
2737 * src/getargs.c (no_parser_flag): Remove global variable.
2738 (usage): Don't print description of -n and --no-parser.
2739 (long_options): Remove --no-parser entry here.
2740 (getargs): Remove -n case in the switch here.
2741 * src/getargs.h (no_parser_flag): Remove extern.
2742 * tests/regression.at (Web2c Actions): Remove comment that mentions
2743 --no-parser.
2744
2745 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2746
2747 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2748 name user variables starting with `yy'. Just pass NULL instead of a
2749 dummy local &yylval to yypush_parse.
2750 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2751 starting with `yy'.
2752
2753 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2754
2755 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2756 true since it's then always used regardless of whether yyoverflow is
2757 defined. Reported by Christian Burger at
2758 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2759 * THANKS: Add Christian Burger.
2760
2761 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2762 node names: say "Decl Summary" not "Bison Declaration Summary".
2763
2764 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2765
2766 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2767 determine whether this function has already complained about an invalid
2768 value for a %define boolean variable, don't check whether Bison has
2769 ever examined the value. As written, the check was a tautology.
2770 Instead, record and check for this complaint using a separate muscle.
2771
2772 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2773
2774 Fix push parsing memory leak reported by Brandon Lucia at
2775 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2776 * THANKS: Add Brandon Lucia.
2777 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2778 but the parse never completed and thus freed it.
2779 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2780 * tests/testsuite.at: Include push.at.
2781 * test/push.at: New.
2782 (Push Parsing: Memory Leak for Early Deletion): New test case.
2783
2784 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2785
2786 Improve handling of multiple S/R conflicts in the same state and of S/R
2787 conflicts involving multiple reductions.
2788 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2789 set for a state here or Bison will abort if it is reassigned on a
2790 later conflicted reduction in the same state.
2791 Similarly, don't finalize and assign the solved conflicts report here
2792 or it will be lost if it is reassigned on a later conflicted reduction
2793 in the same state.
2794 (set_conflicts): Instead, assign them both here after all S/R conflicts
2795 in the state have been fully examined.
2796 * src/print.c (shift_set): Rename to...
2797 (no_reduce_set): ... this.
2798 (print_reductions): Update for rename, and add %nonassoc error action
2799 tokens to no_reduce_set so that, when printing the first remaining
2800 reduction on an error action token, the reduction is enclosed in
2801 brackets.
2802 (print_results): Update for rename.
2803 * tests/conflicts.at (Solved conflicts report for multiple reductions
2804 in a state): New test case.
2805 (%nonassoc error actions for multiple reductions in a state): New test
2806 case.
2807
2808 * src/main.c (main): Don't depend on C99 features.
2809
2810 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2811
2812 * build-aux/.cvsignore: Add compile.
2813 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2814 uniwidth.
2815
2816 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2817
2818 * bootstrap (slurp): Create target directories that don't exist.
2819 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2820
2821 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2822
2823 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2824 than item number.
2825 * closure.c (closure): Likewise.
2826 * state.h (reductions): Comment sorting of rules.
2827 (state): Comment sorting of items.
2828
2829 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2830
2831 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2832 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2833 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2834 definition in order to avoid Gnulib headers since we don't use config.h
2835 here.
2836 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2837 rather than AT_DATA so that config.h is included.
2838
2839 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2840
2841 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2842 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2843 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2844 and so that YYFPRINTF is guaranteed to be defined here.
2845
2846 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2847
2848 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2849 with...
2850 (muscle_percent_define_check_values): ... this more helpful function.
2851 Again, it's not used yet, but it will be.
2852 * src/muscle_tab.h: Likewise.
2853
2854 Improve some comments in parser table construction.
2855 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2856 (generate_states): Don't mention ruleset, which is internal to closure.
2857 * src/closure.c (closure): Explain sorting of core and itemset, which
2858 is required for this function to behave correctly.
2859 * src/closure.h (closure): Mention sorting.
2860
2861 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2862
2863 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2864 move the check for disabled transitions to an aver since conflict
2865 resolution hasn't happened yet.
2866
2867 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2868 labels a state as inconsistent just because it has error transitions.
2869 The original form of this check appeared in revision 1.1 of lalr.c,
2870 which was committed on 1991-12-21. Now (at least), changing the
2871 consistency label on such a state appears to have no useful effect in
2872 any of the places it is examined, which I enumerate below. The key
2873 point to understanding each item in this enumeration is that a state
2874 with an error transition is labelled consistent in the first place only
2875 if it has no rules, so the check cannot matter for states that have
2876 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2877 to try to identify its conflicts, and a state must have *rules* to have
2878 conflicts. (2) Labelling a state as inconsistent will affect how
2879 action_row sets the default *rule* for the state. (3) Labelling a
2880 state as inconsistent will cause build_relations to add lookback edges
2881 to *rules* in that state.
2882 * src/state.h (struct state): Word the comment for member consistent
2883 more carefully.
2884
2885 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2886
2887 Don't depend on C99 features.
2888 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2889 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2890 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2891 * src/state.c (state_mark_reachable_states): Fix for-loop.
2892 (state_remove_unreachable_states): Fix for-loop.
2893
2894 Don't widen struct state with member reachable just to temporarily
2895 record reachability. Instead, use a local bitset.
2896 * src/state.h (struct state): Remove member.
2897 * src/state.c (state_new): Don't initialize it.
2898 (state_mark_reachable_states): Rename to...
2899 (state_record_reachable_states): ... this, and use bitset.
2900 (state_remove_unreachable_states): Use bitset.
2901
2902 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2903
2904 * src/Makefile.am (yacc): Quote target action commands properly so
2905 that the yacc script isn't corrupt. Reported by Hans Aberg at
2906 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
2907
2908 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
2909 the case of pure parsers. Reported by Frans Englich at
2910 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
2911 * THANKS: Add Frans Englich.
2912
2913 * NEWS (2.3a+): In the %code entry, reference section `Bison
2914 Declaration Summary' from the manual now since the %code summary has
2915 moved there.
2916 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
2917 in the rules section must be terminated by semicolons.
2918
2919 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2920
2921 Extend the front-end API for %define variables to more completely
2922 mirror the back-end. This will be useful in the future.
2923 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
2924 Update comments to mention the new front-end counterparts of these
2925 macros.
2926 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
2927 for muscle_string_decode and muscle_location_decode.
2928 (muscle_string_decode): New static function.
2929 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
2930 (muscle_percent_define_get, muscle_percent_define_ifdef): New
2931 functions.
2932 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
2933 muscle_percent_define_get to mimic the b4_percent_define_flag_if
2934 implementation more closely.
2935 (muscle_percent_define_invalid_value): New function.
2936 * src/muscle_tab.h (muscle_percent_define_get,
2937 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
2938 Prototype.
2939
2940 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2941
2942 * NEWS (2.3a+): Mention yesterday's state-removal change.
2943 (2.3a): Remove the %language entry, which was added after 2.3a.
2944 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
2945 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
2946 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
2947 tests/existing.at: Update copyright date.
2948
2949 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2950
2951 If conflict resolution makes states unreachable, remove those states,
2952 report rules that are then unused, and don't report conflicts in those
2953 states.
2954 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
2955 New global function.
2956 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
2957 function.
2958 * src/main.c (main): After conflict resolution, remove the unreachable
2959 states and update all data structures that reference states by number.
2960 * src/state.c (state_new): Initialize each state's reachable member to
2961 false.
2962 (state_mark_reachable_states): New static function.
2963 (state_remove_unreachable_states): New global function.
2964 * src/state.h (struct state): Add member bool reachable.
2965 (state_remove_unreachable_states): Prototype.
2966 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2967 New test case.
2968 * tests/existing.at (GNU pic Grammar): Update test case output now that
2969 an unused rule is discovered.
2970
2971 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2972
2973 Minor code cleanup in parser table construction.
2974 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
2975 (new_itemsets, save_reductions): Update for rename to nitemset.
2976 * src/closure.c (nritemset): Rename to...
2977 (nitemset): ... this since the "r" appears to meaningless and isn't
2978 used in the comments.
2979 (closure): Update for rename.
2980 * src/closure.h (nritemset): Update extern to...
2981 (nitemset): ... this.
2982 * src/lalr.c (LA): Fix a typo in comments.
2983 * src/print.c (print_core): Update for rename to nitemset.
2984 * src/print_graph.c (print_graph): Likewise.
2985 * src/state.h: Fix some typos in header comments.
2986
2987 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
2988
2989 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
2990 still sticks to ASCII. Sorry!
2991
2992 * README-hacking: New file, taken mostly from coreutils, with changes
2993 for Bison. Contains much of the contents of:
2994 * README-cvs: Remove.
2995 * bootstrap: Sync from gnulib.
2996 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
2997 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
2998
2999 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3000
3001 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3002 Setzer.
3003 (Java Differences): Fix some typos.
3004 * THANKS: Add Sebastian Setzer.
3005
3006 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
3007
3008 * data/java.m4 (b4_single_class_if): Remove.
3009 (b4_abstract_if): Look at "%define abstract".
3010 (b4_lexer_if): New.
3011 (b4_union_name): Rename...
3012 (b4_yystype): ... to this. Map to "%define stype".
3013 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3014 b4_maybe_throws): Fix quoting.
3015 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3016 * data/lalr1.java (Lexer interface): Always define.
3017 (Lexer interface within parser class): Remove.
3018 (YYLexer class): New, used when "%code lexer" is present.
3019 (constructor): When "%code lexer" is used, pass %lex-param
3020 to the lexer constructor.
3021 (yylex, yyparse): Remove %lex-param from method invocations
3022 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3023
3024 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3025 abstract". Rename "%define union_name" to "%define stype".
3026 Rename method names according to previous patch.
3027 (Java Scanner Interface): Describe "%code lexer" instead of
3028 "%pure-parser" and "%define single_class".
3029 (Java Differences): Mention "%code lexer".
3030
3031 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3032 Include scanner here, using macros from tests/local.at.
3033 (AT_DATA_CALC_Y): Remove final argument.
3034 (_AT_CHECK_JAVA_CALC): Likewise.
3035 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3036 of %locations and %error-verbose.
3037 (main): Test with and without %lex-param.
3038 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3039 (AT_BISON_OPTION_POPDEFS): Pop it.
3040
3041 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3042
3043 DJGPP spefic issue. Inhibit the use of disallowed characters for
3044 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3045 and concern testsuite case 46.
3046 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3047 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3048 * djgpp/config.bat: Inhibit the use of disallowed characters.
3049
3050 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3051
3052 Miscellaneous %define and %code cleanup.
3053 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3054 values are interpreted.
3055 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3056 documentation a little more.
3057 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3058 muscle_percent_define_insert, muscle_percent_code_grow): New
3059 functions/macros.
3060 * src/muscle_tab.h (muscle_percent_define_insert,
3061 muscle_percent_code_grow): Prototype.
3062 * src/parse-gram.y (prologue_declaration): Use
3063 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3064 %define and %code directives.
3065
3066 Make it easy to share %define boolean variables between the front-end
3067 and back-end. Though not used yet, this will be useful in the future.
3068 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3069 Bison uses of names rather than just skeleton uses of names.
3070 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3071 b4_percent_define_skeleton_variables(VARIABLE) to
3072 b4_percent_define_bison_variables(VARIABLE).
3073 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3074 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3075 b4_percent_code_bison_qualifiers(QUALIFIER).
3076 (b4_check_user_names_wrap): Update for renames.
3077 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3078 muscle_percent_define_default): New functions mimicking
3079 b4_percent_define_flag_if and b4_percent_define_default.
3080
3081 For %define variables, report locations for invalid values and
3082 redefinitions.
3083 * data/bison.m4 (b4_percent_define_flag_if): Read
3084 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3085 value for VARIABLE.
3086 (b4_percent_define_default): Save a special location in
3087 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3088 must later be reported as invalid.
3089 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3090 functions.
3091 (muscle_percent_define_insert): Record the location of VARIABLE in
3092 muscle percent_define_loc(VARIABLE), and use it to report the previous
3093 location for a redefinition.
3094 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3095 (muscle_percent_define_default): Update like b4_percent_define_default.
3096 (muscle_grow_user_name_list): Rename to...
3097 (muscle_user_name_list_grow): ... this for consistency and use
3098 muscle_location_grow.
3099 * src/muscle_tab.h (muscle_location_grow): Prototype.
3100 * tests/input.at (%define errors): Update expected output.
3101 * tests/skeletons.at (%define boolean variables: invalid skeleton
3102 defaults): New test case.
3103
3104 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3105
3106 * src/print.c (lookahead_set, state_default_rule): Remove.
3107 (print_reductions): Replace state_default_rule invocation with
3108 equivalent use of yydefact, which was computed in token_actions in
3109 tables.c.
3110 (print_results): Don't allocate lookahead_set.
3111
3112 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
3113
3114 * data/lalr1.java: Prefix all private members with yy.
3115
3116 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3117
3118 Use YYFPRINTF instead of fprintf where appropriate. Reported by
3119 Sebastien Fricker at
3120 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
3121 * THANKS: Add Sebastien Fricker.
3122 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3123 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3124 accept a variable number of arguments.
3125
3126 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3127
3128 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3129
3130 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3131
3132 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3133 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3134 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3135
3136 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3137
3138 Undo my 2007-02-07 change, switching back to the c-strcase module
3139 introduced in the 2007-02-03 change. Bruno Haible reported that
3140 the 2007-02-07 change would be dangerous in Turkish if we add a
3141 language whose name contains "i", since "i" is not lowercase "I"
3142 in Turkish.
3143 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3144 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3145 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3146 * m4/.cvsignore: Remove strcase.m4.
3147 * src/getargs.c: Revert 2007-02-07 change, as follows.
3148 Include c-strcase.h.
3149 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3150
3151 2007-02-11 Bruno Haible <bruno@clisp.org>
3152
3153 Enable the Java related testsuite tests when the only Java compiler
3154 found is a gcj < 4.3. Discussed at
3155 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3156 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3157
3158 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3159
3160 * data/Makefile.am: Update copyright date.
3161 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3162 yypstate_new returns NULL.
3163 (yypstate_new): Return NULL if malloc does.
3164 * src/reader.c (packgram): Move translation of rule actions from the
3165 beginning of packgram to...
3166 (check_and_convert_grammar): ... here right before packgram is invoked
3167 so it's easier to write more complete comments, and remove redundant
3168 code.
3169
3170 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3171
3172 As in semantic actions, make @$ in %initial-action, %destructor, and
3173 %printer imply %locations.
3174 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3175 scanning @$.
3176 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3177 (@$ in %initial-action implies %locations,
3178 @$ in %destructor implies %locations,
3179 @$ in %printer implies %locations): ... these new test cases.
3180
3181 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3182
3183 Undo most of the 2007-02-03 change, switching to the strcase module
3184 now that gnulib strcase has been fixed.
3185 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3186 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3187 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3188 * m4/.cvsignore: Add strcase.m4.
3189 * src/getargs.c: Revert 2007-02-03 change, as follows.
3190 Don't include c-strcase.h.
3191 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3192 strcasecmp has "unspecified behavior" outside the POSIX locale,
3193 but it works fine in practice if at least one argument is ASCII,
3194 as is the case in Bison.
3195
3196 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
3197
3198 * tests/java.at: Skip tests if only one of javac/java is present.
3199 Reported by Joel E. Denny.
3200 * tests/atlocal.in: Adjust copyright years.
3201
3202 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
3203
3204 * data/lalr1.java (Stack): Work around old verifiers that disallow
3205 access to the private fields of an inner class, from the outer class.
3206 We can make Stack's fields public because user code doesn't have access
3207 to the instance of Stack used by parse(). Reported by Paul Eggert.
3208
3209 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3210
3211 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3212 the right spot for these files?
3213 * bootstrap.conf (gnulib_modules): Add c-strcase.
3214 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3215 c-strncasecmp.c.
3216 * src/getargs.c: Include c-strcase.h.
3217 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3218 to avoid unspecified behavior.
3219
3220 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3221
3222 * doc/bison.texinfo (Decl Summary): Correct typo.
3223
3224 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
3225
3226 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3227 Complain if the value does not match empty, "true" or "false".
3228 * data/c++.m4: Adjust default definitions of %define variables.
3229 * data/java.m4: Adjust default definitions of %define variables.
3230 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3231 to above behavior.
3232 * tests/input.at (Boolean %define variables): Test new behavior.
3233
3234 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
3235
3236 * NEWS: Mention java.
3237 * TODO: Remove things that are done.
3238 * bootstrap.conf: Add javacomp-script and javaexec-script.
3239 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3240
3241 * data/Makefile.am: Add new files.
3242 * data/java-skel.m4: New.
3243 * data/java.m4: New.
3244 * data/lalr1.java: New.
3245
3246 * doc/bison.texinfo: Put "A Complete C++ Example" under
3247 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3248 under Other Languages.
3249
3250 * src/getargs.c (valid_languages): Add Java.
3251 * src/getargs.h (struct bison_language): Update size of string fields.
3252
3253 * tests/Makefile.am: Add java.at.
3254 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3255 * tests/java.at: New.
3256 * tests/testsuite.at: Include it.
3257
3258 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3259
3260 Clean up.
3261 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3262 at_directive_argv arguments so these no longer have to be global
3263 variables. Also, update the implementation for the following changes.
3264 (fail_for_at_directive_too_many_args,
3265 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3266 (at_directive_name): Remove as at_directive_argv[0] will be used for
3267 this now.
3268 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3269 for the directive name.
3270 (at_directive_argc, at_directive_argv): Make these local within
3271 skel_lex instead of global.
3272 (INITIAL): Update directive start action for above changes.
3273 (SC_AT_DIRECTIVE_ARG): Rename to...
3274 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3275 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3276 (scan_skel): Move yylex_destroy to...
3277 (skel_scanner_free): ... here.
3278 * tests/skeletons.at (installed skeleton file name): Rename to...
3279 (installed skeleton file names): ... this.
3280
3281 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3282
3283 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3284 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3285 Summary" not "Directives".
3286 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3287 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3288 since the former is now the more complete one.
3289 (Prologue Alternatives): Likewise and do the same for %defines.
3290 (Table of Symbols): Add summary of %code, add summary of %define, and
3291 move full %code documentation to...
3292 (Decl Summary): ... here for consistency with other entries in these
3293 sections.
3294 Move %define entry in order to keep this list alphabetized.
3295 Reword %define entry a little to put less emphasis on the skeleton
3296 concept, which most users shouldn't have to think about.
3297
3298 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3299
3300 Adjust to recent gnulib changes.
3301 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3302 Add string.h, string_.h, unistd_.h, wchar_.h.
3303 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3304 * src/system.h: Don't include <stpcpy.h>; this is now done by
3305 <string.h>.
3306
3307 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
3308
3309 Simplify implementation of unqualified %code, implement macros for
3310 uniform treatment of boolean %define flags. Document %define.
3311 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3312 b4_percent_code_ifdef): New.
3313 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3314 * data/c++.m4: Define default value for global_tokens_and_yystype.
3315 * data/glr.cc: Likewise.
3316 * data/location.cc: Use b4_percent_define_flag_if.
3317
3318 * doc/bison.texinfo (Decl Summary): Document %define.
3319
3320 * src/parse-gram.y (Unqualified %code): Change muscle name to
3321 b4_percent_code().
3322 (content.opt): Default to empty.
3323
3324 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3325
3326 Implement support for relative and absolute skeleton file names.
3327 Discussed starting at
3328 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3329 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3330 (Bison Options): Document in --skeleton entry.
3331 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3332 full_skeleton can't necessarily hold all of pkgdatadir.
3333 If the specified skeleton file name contains a `/', don't prepend
3334 pkgdatadir.
3335 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3336 file name contains a `/', prepend the grammar file directory.
3337 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3338 * skeletons.at: New file.
3339 (relative skeleton file names): New test case.
3340 (installed skeleton file names): New test case.
3341 * tests/testsuite.at: Include skeletons.at.
3342
3343 * bootstrap: Update copyright to 2007.
3344
3345 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
3346
3347 * bootstrap: Remove occurrences of .#bootmp from the files.
3348
3349 2007-01-17 Akim Demaille <akim@epita.fr>
3350
3351 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3352 nonterminals.
3353 Use per-type %printer.
3354
3355 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3356
3357 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3358 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3359 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3360 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3361 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3362 tests/glr-regression.at, tests/input.at, tests/local.at,
3363 tests/output.at, tests/torture.at: Update copyright to 2007.
3364
3365 2007-01-16 Akim Demaille <akim@epita.fr>
3366
3367 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3368 error code.
3369 (Calc++ Scanner): Exit with failure if we can't open the input
3370 file.
3371 Accept "-" standing for stdin.
3372 (Calc++ Top Level): Print the result only if the parsing was
3373 successful.
3374
3375 2007-01-16 Akim Demaille <akim@epita.fr>
3376
3377 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3378
3379 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
3380 and Joel E. Denny <jdenny@ces.clemson.edu>
3381
3382 Clean up %define and %code implementation in M4 some. Most
3383 importantly, rename all related macros to be in the b4_percent_define
3384 and b4_percent_code namespaces. Also, complete support for `.' in
3385 %define variable names and %code qualifiers.
3386 * data/bison.m4 (b4_check_user_names): Check for special
3387 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3388 m4_foreach loops.
3389 (b4_get_percent_define, b4_get_percent_code): Rename to...
3390 (b4_percent_define_get, b4_percent_code_get): ... these.
3391 Extend documentation with examples.
3392 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3393 b4_percent_define_skeleton_variables and
3394 b4_percent_code_skeleton_qualifiers.
3395 Expect any value for the %define variable `foo' to be stored in the
3396 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3397 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3398 expect any unqualified %code blocks to be stored in a macro named
3399 `b4_percent_code_unqualified'.
3400 Use m4_indir so that %define variable names and %code qualifiers can
3401 contain `.', which is allowed by the grammar parser.
3402 (b4_percent_define_default): New macro to set a default value for a
3403 %define variable.
3404 (m4_wrap): Update wrapped code, and fix some underquoting.
3405 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3406 Expect grammar uses of %define variables and %code qualifiers to be
3407 defined in b4_percent_define_user_variables and
3408 b4_percent_code_user_qualifiers.
3409 * data/c++.m4: Use b4_percent_define_default rather than
3410 m4_define_default. Fix some underquoting. Skeleton usage of %define
3411 variable define_location_comparison now implies skeleton usage of
3412 %define variable filename_type.
3413 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3414 data/push.c, data/yacc.c: Update macro names.
3415 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3416 muscle names.
3417
3418 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3419
3420 DJGPP specific issues.
3421
3422 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3423 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3424
3425 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3426
3427 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3428 run parsers in all tests so that Valgrind is invoked during
3429 maintainer-check-valgrind.
3430 (Duplicate representation of merged trees): Free all semantic values.
3431 (Duplicated user destructor for lookahead): Likewise.
3432
3433 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3434
3435 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3436 command-line prefix.
3437 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3438 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3439 miss Valgrind messages.
3440 (Exploding the Stack Size with Malloc): Likewise.
3441
3442 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3443
3444 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3445 locals. Reported by Juan Manuel Guerrero at
3446 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3447 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3448 Fix some indentation also.
3449 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3450 explaining this issue.
3451
3452 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
3453 and Joel E. Denny <jdenny@ces.clemson.edu>
3454
3455 Simplify union and prologue handling, and escape union and lex/parse
3456 params with digraphs.
3457 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3458 values to the empty string since these are no longer guaranteed
3459 initialized by the front-end.
3460 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3461 braces around b4_user_stype since this is no longer done by the
3462 front-end.
3463 * src/files.c, src/files.h (pre_prologue_obstack,
3464 post_prologue_obstack): Remove.
3465 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3466 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3467 with digraphs. This fixes lex params and parse params.
3468 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3469 * src/output.c (prepare): Remove muscle insertion of the prologues.
3470 (output): Remove freeing of pre_prologue_obstack and
3471 post_prologue_obstack.
3472 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3473 than prologue_augment for prologue parsing so you don't need prologue
3474 obstacks.
3475 (grammar_declaration): For %union RHS, use `braceless' instead of
3476 "{...}" so that braces are already stripped and code is escaped with
3477 digraphs.
3478 * src/reader.c (prologue_augment): Remove.
3479 (reader): Remove initialization of pre_prologue_obstack and
3480 post_prologue_obstack.
3481 * src/reader.h (prologue_augment): Remove.
3482
3483 * data/c.m4: Remove stray parenthesis.
3484
3485 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3486
3487 Remove quotes from variables names in %define directives and from
3488 qualifiers in %code directives, and restrict the characters that are
3489 allowed in them to M4-friendly ones. For %define, continue to support
3490 the quoted form as a deprecated feature. Discussed starting at
3491 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3492 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3493 %code.
3494 * doc/bison.texinfo (Prologue Alternatives): Update.
3495 (Decl Summary): In %defines entry, update mention of `%code requires'
3496 and `%code provides'.
3497 (C++ Location Values): Update %define uses.
3498 (Calc++ Parser Interface): Likewise.
3499 (Calc++ Parser): Likewise, and update `%code requires' uses.
3500 (Table of Symbols): Update %code documentation.
3501 * src/parse-gram.y (prologue_declaration): For %define variables, use
3502 `variable' instead of `STRING'.
3503 (grammar_declaration): For %code qualifiers, use `ID' instead of
3504 `STRING'.
3505 (variable): New nonterminal that takes an `ID' or a `STRING'.
3506 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3507 and %define uses.
3508 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3509 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3510 (%define errors): Update %define uses.
3511
3512 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3513
3514 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3515 instead of muscle_insert for %define values so that M4-special
3516 characters are replaced with digraphs.
3517 * tests/input.at (%define errors): Extend to check weird values.
3518
3519 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3520
3521 Instead of having skeletons declare all valid %define variables and
3522 %code qualifiers, provide macros that retrieve the associated values
3523 and build these lists automatically. Thus Bison will now warn when a
3524 variable or qualifier is not used by the skeleton in the current
3525 invocation regardless of whether it might sometimes be used by that
3526 skeleton in other invocations. Also, move all %define value macros to
3527 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3528 form, which is replaced by %code.
3529 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3530 (b4_check_user_names): ... this, and change the series of valid name
3531 arguments to a single list argument for names used in the skeleton
3532 similar to the existing list argument for names used in the grammar.
3533 Warn instead of complaining.
3534 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3535 values and %code code, to format %code code properly, and to build
3536 lists of all %define variables and %code qualifiers used in the
3537 skeleton: b4_skeleton_percent_define_variables and
3538 b4_skeleton_percent_code_qualifiers.
3539 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3540 Remove, and...
3541 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3542 the skeleton names lists can finish building first. In place of
3543 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3544 expect the lists b4_user_percent_define_variables and
3545 b4_user_percent_code_qualifiers.
3546 * data/c++.m4: Where setting default values for b4_parser_class_name,
3547 b4_location_type, b4_filename_type, b4_namespace, and
3548 b4_define_location_comparison, update their names to the
3549 b4_percent_define_ namespace.
3550 * data/glr.c: Don't use b4_check_percent_define_variables and
3551 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3552 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3553 (b4_parser_class_name, b4_namespace): Define these using
3554 b4_get_percent_define for parser_class_name and namespace.
3555 * data/location.cc: Use b4_get_percent_define.
3556 * data/push.c: Don't use b4_check_percent_define_variables and
3557 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3558 * data/yacc.c: Likewise, and don't call m4_exit in
3559 b4_use_push_for_pull_if or m4_wrap code will never execute.
3560 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3561 Rename to...
3562 (muscle_grow_user_name_list): ... this for consistency with the
3563 terminology used in bison.m4.
3564 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3565 %define variable names, and rename muscle used_percent_define_variables
3566 to user_percent_define_variables.
3567 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3568 user_percent_code_qualifiers.
3569 (content): Remove.
3570 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3571 {CODE} form is no longer accepted.
3572 * tests/input.at (Reject bad %code qualifiers): Rename to...
3573 (Reject unused %code qualifiers): ... this, and update test output.
3574 (%define error): Update test output.
3575
3576 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3577
3578 Check for unrecognized %define variables similar to checking for
3579 unrecognized %code qualifiers. Check for redefined %define variables.
3580 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3581 generalizes...
3582 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3583 (b4_check_percent_define_variables): New, also wraps it.
3584 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3585 variables using b4_check_percent_define_variables.
3586 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3587 all those exercised in the test suite and all those listed in the
3588 `Default values' section of c++.m4. Are there others?
3589 * data/push.c, data/yacc.c: Declare no valid %define variables.
3590 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3591 similar to muscle_find, but it works even when the muscle stores a
3592 const value.
3593 (muscle_grow_used_name_list): New function for constructing the used
3594 name list muscles that b4_check_for_unrecognized_names requires.
3595 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3596 %define'd more than once. Define the b4_used_percent_define_variables
3597 muscle with muscle_grow_used_name_list.
3598 (grammar_declaration): Abbreviate %code code with
3599 muscle_grow_used_name_list.
3600 * tests/input.at (%define errors): New.
3601
3602 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3603
3604 Provide warn_at, complain_at, and fatal_at function callbacks to the
3605 skeletons, and use this for %code qualifier complaints.
3606 * data/bison.m4 (b4_error_at): New, invoked by...
3607 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3608 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3609 @fatal_at(...@) directives.
3610 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3611 qualifiers in b4_used_percent_code_qualifiers and to use
3612 b4_complain_at.
3613 * src/location.c, src/location.h (boundary_set_from_string): New global
3614 function.
3615 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3616 function.
3617 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3618 to b4_used_percent_code_qualifiers.
3619 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3620 function.
3621 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3622 (lineno): Rename to...
3623 (out_lineno): ... this so I don't misunderstand it again.
3624 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3625 here; these newlines are in the input but not the output file.
3626 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3627 (at_directive_perform): ... this new static function, and add handling
3628 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3629 directives.
3630 * tests/input.at (Reject bad %code qualifiers): Update test output with
3631 locations and extend.
3632
3633 * tests/output.at (Output file name: [, Output file name: ]): Remove
3634 bogus comment about these tests failing.
3635
3636 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3637
3638 Clean up b4_check_percent_code_qualifiers a little.
3639 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3640 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3641 documentation and add examples.
3642 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3643 qualifiers here.
3644
3645 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3646
3647 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3648 unreliable -- especially when they're hidden inside another macro.
3649 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3650 data/c.m4: Remove m4_divert(-1).
3651 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3652 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3653 m4_divert_push(0) and m4_divert_pop(0).
3654 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
3655 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3656 pushed and popped by m4sugar, should be first on the stack.
3657
3658 Provide warn, complain, and fatal function callbacks to the skeletons.
3659 This provides more flexibility than m4_fatal, improves the error
3660 message format, and captures messages for translation. Discussed
3661 starting at
3662 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3663 * data/bison.m4 (b4_error): New, invoked by...
3664 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3665 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3666 directives. Because these M4 macros might be called when the current
3667 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3668 the previous removal of uses of m4_divert, which caused trouble.
3669 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3670 m4_fatal to report unrecognized %code qualifiers.
3671 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3672 push parser requests.
3673 * data/glr.c: Use b4_complain instead of m4_fatal to report
3674 non-deterministic push parser requests.
3675 Update @output usage to @output(...@) form.
3676 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3677 report missing %defines. Update @output usage to @output(...@) form.
3678 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3679 @output(...@) form.
3680 * src/main.c (main): Invoke skel_scanner_free.
3681 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3682 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3683 obstack_for_string from flex-scanner.h.
3684 (YY_DECL): Use to declare skel_lex static.
3685 (decode_at_digraphs): Remove; now handled in the new
3686 SC_AT_DIRECTIVE_ARG start condition.
3687 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3688 functions.
3689 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3690 at_directive_argv): New static globals.
3691 (INITIAL): Use fail_for_invalid_at.
3692 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3693 recognize the start of a generalized `@directive(...@)' form and
3694 start...
3695 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3696 directive args (using the new obstack_for_string), to decode the
3697 contained @ diagraphs, and to perform the directive. It recognizes
3698 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3699 @output(...@).
3700 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3701 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3702 `@,'.
3703 (scan_skel): Initialize obstack_for_string on the first call.
3704 (skel_scanner_free): New function to free obstack_for_string.
3705 * tests/input.at (Reject bad %code qualifiers): Update test output.
3706
3707 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3708
3709 Consolidate the 4 prologue alternative directives (%code, %requires,
3710 %provides, and %code-top) into a single %code directive with an
3711 optional qualifier field. Discussed at
3712 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3713 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3714 alternatives.
3715 * doc/bison.texinfo (Prologue Alternatives): Update.
3716 (Decl Summary): Update to %code "requires" and %code "provides".
3717 (Calc++ Parser): Update to %code "requires".
3718 (Table of Symbols): Remove entries for %requires, %provides, and
3719 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3720 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3721 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3722 which are skeleton-specific.
3723 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3724 declare what %code qualifiers it supports and to complain if any other
3725 qualifiers were used in the grammar.
3726 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3727 and b4_user_code([b4_percent_code_provides]) in place of
3728 b4_user_requires and b4_user_provides.
3729 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3730 Add b4_user_code([b4_percent_code_top]) and
3731 b4_user_code([b4_percent_code]).
3732 Invoke b4_check_percent_code_qualifiers.
3733 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3734 PERCENT_REQUIRES): Remove.
3735 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3736 %requires. Rewrite the %code RHS as the unqualified form defining the
3737 muscle b4_percent_code. Add another RHS for the qualified %code form,
3738 which defines muscles of the form b4_percent_code_QUALIFIER and the
3739 b4_used_percent_code_qualifiers muscle.
3740 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3741 PERCENT_REQUIRES): Remove.
3742 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3743 %code "requires" and %code "provides".
3744 * tests/input.at (Reject bad %code qualifiers): New.
3745
3746 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3747
3748 Use the new code_props interface for destructors and printers.
3749 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3750 printer_location members, and change the type of the destructor and
3751 printer members to code_props.
3752 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3753 symbol_printer_get, semantic_type_destructor_set,
3754 semantic_type_printer_set, default_tagged_destructor_set,
3755 default_tagless_destructor_set, default_tagged_printer_set,
3756 default_tagless_printer_set): Use code_props in arguments and return
3757 types in place of char const * and location.
3758 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3759 since the locations are now contained in the return of
3760 symbol_destructor_get and symbol_printer_get.
3761 * src/output.c (symbol_destructors_output, symbol_printers_output):
3762 Replace with...
3763 (symbol_code_props_output): ... this to eliminate duplicate code.
3764 (output_skeleton): Update to use symbol_code_props_output.
3765 * src/reader.c (symbol_should_be_used): Update use of
3766 symbol_destructor_get.
3767 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3768 Update uses of the various _destructor_set and _printer_set functions.
3769 * src/symtab.c: (default_tagged_destructor_location,
3770 default_tagless_destructor_location, default_tagged_printer_location,
3771 default_tagless_printer_location): Remove since we...
3772 (default_tagged_destructor, default_tagless_destructor,
3773 default_tagged_printer, default_tagless_printer): ... change the type
3774 of these to code_props.
3775 (symbol_new, semantic_type_new, symbol_destructor_set,
3776 semantic_type_destructor_set, symbol_destructor_get,
3777 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3778 symbol_check_alias_consistency, default_tagged_destructor_set,
3779 default_tagless_destructor_set, default_tagged_printer_set,
3780 default_tagless_printer_set): Update.
3781 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3782 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3783 code_props members.
3784 (symbol_print): Use SYMBOL_CODE_PRINT.
3785
3786 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3787
3788 Use the new code_props interface for rule actions.
3789 * src/symlist.h (symbol_list): Replace action, action_location, and
3790 used members with a code_props action_props member.
3791 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3792 grammar_midrule_action, grammar_current_rule_merge_set,
3793 grammar_current_rule_symbol_append, packgram): Update.
3794 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3795 * src/scan-code.l (handle_action_dollar): Update.
3796 (translate_rule_action): Remove, no longer used.
3797 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3798
3799 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3800
3801 Use the new code_props interface in parse-gram.y.
3802 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3803 Update all uses of translate_* functions to use the new code_props
3804 interface and to use gram_scanner_last_string_free and
3805 code_scanner_last_string_free where possible.
3806 (grammar_declaration): symbol_list_destructor_set and
3807 symbol_list_printer_set now perform the translation, so don't do it
3808 here. Use gram_scanner_last_string_free where possible.
3809 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3810 translate_code): Remove, no longer used.
3811 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3812 symbol_list_printer_set): Perform code translation here rather than
3813 depending on the caller to do so.
3814
3815 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3816 * src/scan-gram.h (gram_last_string): Remove declaration.
3817 * src/scan-gram.l (last_string): Declare it static.
3818
3819 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3820
3821 Encapsulate code properties and related functionality for the various
3822 destructors, printers, and actions into a code_props structure and
3823 interface. This patch merely implements code_props in scan-code.h and
3824 scan-code.l. Future patches will rewrite other modules to use it.
3825 Discussed starting at
3826 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3827 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3828 consistently initialize const structs that have an empty location
3829 field.
3830 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3831 to ensure consistency.
3832 * src/scan-code.h (code_props): New structure.
3833 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3834 function, macro, and const global variable for initializing a
3835 code_props with no code.
3836 (code_props_plain_init, code_props_symbol_action_init,
3837 code_props_rule_action_init, code_props_translate_code): The rest of
3838 the new code_props functional interface. Among other things, the init
3839 functions set the code_props kind field so that
3840 code_props_translate_code will know whether to behave like
3841 translate_symbol_action, translate_rule_action, or translate_code.
3842 These old translate functions must remain until all other modules are
3843 updated to use the new code_props interface.
3844 (code_scanner_last_string_free): New function similar to
3845 gram_scanner_last_string_free.
3846 (code_scanner_free): Add documentation.
3847 * src/scan-code.l: Implement the new interface.
3848 (code_lex): Make it static, add a code_props* argument, and remove the
3849 rule argument.
3850 (last_string): New static global similar to the one in scan-gram.l.
3851 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3852 instead of rule.
3853 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3854 code_props since Bison may one day use this information for destructors
3855 and printers.
3856 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3857 (handle_action_dollar): Use symbol_list_n_get and set used flag
3858 directly since symbol_list_n_used_set is removed.
3859 (translate_action): Add a code_props* argument and remove the rule,
3860 action, and location arguments. Pass the code_props* on to code_lex.
3861 (translate_rule_action, translate_symbol_action, translate_code):
3862 Rewrite as wrappers around the new code_props interface.
3863 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3864 it would eventually need to break the encapsulation of code_props.
3865
3866 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3867
3868 * etc/.cvsignore: New.
3869
3870 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3871
3872 Add maintainer-push-check to run maintainer-check using push parsing in
3873 place of pull parsing where available.
3874 * Makefile.am (maintainer-push-check): New.
3875 * data/bison.m4 (b4_use_push_for_pull_if): New.
3876 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3877 appropriately based on their existing values.
3878 (yypush_parse): Don't print push-parser-specific diagnostics if push
3879 parsing is being used in place of pull parsing.
3880 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3881 push.c.
3882 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3883 variable, and insert b4_use_push_for_pull_flag into muscles.
3884 * tests/Makefile.am (maintainer-push-check): New.
3885
3886 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3887
3888 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3889 (whether successful or failed) so that yypush_parse can be invoked
3890 again to start a new parse using the same yypstate.
3891 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3892 check multiple yypull_parse invocations on the same yypstate. For pull
3893 mode, extend to check multiple yyparse invocations.
3894 (Exploding the Stack Size with Alloca): Extend to try with
3895 %push-pull-parser.
3896 (Exploding the Stack Size with Malloc): Likewise.
3897
3898 * tests/calc.at (Simple LALR Calculator): Don't specify
3899 %skeleton "push.c" since %push-pull-parser implies that now.
3900 * tests/headers.at (export YYLTYPE): Don't check for the push
3901 declarations. Otherwise, this test case can't be used to see if push
3902 mode can truly emulate pull mode.
3903 * tests/input.at (Torturing the Scanner): Likewise.
3904 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
3905 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
3906 AT_YACC_IF, which now includes the case of push mode since %skeleton
3907 need not be used for push mode. This will be more intuitive once
3908 push.c is renamed to yacc.c.
3909
3910 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3911
3912 For push mode, convert yyparse from a macro to a function, invoke yylex
3913 instead of passing a yylexp argument to yypull_parse, and don't
3914 generate yypull_parse or yyparse unless %push-pull-parser is declared.
3915 Discussed starting at
3916 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
3917 * data/bison.m4 (b4_pull_if): New.
3918 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
3919 * data/push.c: Improve M4 quoting a little.
3920 (b4_generate_macro_args, b4_parenthesize): Remove.
3921 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
3922 any time a pull parser is requested.
3923 Don't #define this as a wrapper around yypull_parse. Instead, when
3924 both push and pull are requested, make it a function that does that
3925 same thing.
3926 (yypull_parse): If there's a b4_prefix, #define this to
3927 b4_prefix[pull_parse] when both push and pull are requested.
3928 Don't define this as a function unless both push and pull are
3929 requested.
3930 Remove the yylexp argument and hard-code yylex invocation instead.
3931 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
3932 %push-parser.
3933 * src/getargs.c (pull_parser): New global initialized to true.
3934 * getargs.h (pull_parser): extern it.
3935 * src/output.c (prepare): Insert pull_flag muscle.
3936 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
3937 (prologue_declaration): Set both push_parser and pull_parser = true for
3938 %push-pull-parser. Set push_parser = true and pull_parser = false for
3939 %push-parser.
3940 * src/scan-gram.l: Don't accept %push_parser as an alternative to
3941 %push-parser since there's no backward-compatibility concern here.
3942 Scan %push-pull-parser.
3943 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
3944 instead of %push-parser.
3945 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
3946 prototype it in the module that calls yyparse.
3947 * tests/input.at (Torturing the Scanner): Likewise.
3948 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
3949
3950 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
3951
3952 Update etc/bench.pl. Optimize push mode a little (the yyn change
3953 deserves most of the credit).
3954 * Makefile.am (SUBDIRS): Add etc subdirectory.
3955 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
3956 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
3957 yytoken, yyval, and yyloc declarations to...
3958 (yyparse or yypush_parse): ... here to improve performance. For
3959 yypush_parse invocations after the first, be sure to assign yyn its old
3960 value again.
3961 (yypstate_new): Don't bother initializing the yyresult field since the
3962 initial value isn't used.
3963 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
3964 remove the #define that, in push mode, set it to yyps->NAME.
3965 * etc/Makefile.am: New.
3966 * etc/bench.pl: Remove and build it instead from...
3967 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
3968 "tests/bison" from the build directory by default rather than just
3969 invoking "bison" from $PATH.
3970 (calc_grammar): Update push parser code: don't declare yylval globally,
3971 don't define yyparse_wrapper, and don't #define yyparse.
3972 (bench_grammar): Update to check all working combinations of yacc.c,
3973 push.c, impure, pure, pull, and push.
3974
3975 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3976
3977 For push mode, add pull wrappers around yypush_parse.
3978 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
3979 (yypull_parse): New function wrapping yypush_parse.
3980 (yyparse): New #define wrapping yypull_parse.
3981 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
3982 is declared.
3983 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
3984 prototype yylex in the module that calls yyparse, and don't prototype
3985 yyparse there. Otherwise, the yyparse expansion won't compile.
3986 * tests/input.at (Torturing the Scanner): Likewise.
3987
3988 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3989
3990 Enable push parsers to operate in impure mode. Thus, %push-parser no
3991 longer implies %pure-parser. The point of this change is to move
3992 towards being able to test the push parser code by running the entire
3993 test suite as if %push-parser had been declared.
3994 * data/push.c (yypush_parse): For impure mode, remove the
3995 yypushed_char, yypushed_val, and yypushed_loc arguments.
3996 Instead, declare these as local variables initialized to the global
3997 yychar, yylval, and yylloc.
3998 For the first yypush_parse invocation only, restore the initial values
3999 of these global variables when it's time to read a token since they
4000 have been overwritten.
4001 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4002 %push-parser.
4003 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4004 %pure-parser along with %push-parser since this test case was designed
4005 for pure push parsers.
4006 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4007 (AT_YACC_OR_PUSH_IF): New.
4008 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4009 add a note that it's still wrong for some cases (as it has been for a
4010 while).
4011 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4012 %push-parser no longer implies %pure-parser.
4013
4014 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4015
4016 Remove some unnecessary differences between the pull parser code and
4017 the push parser code. This patch enables yynerrs in push mode.
4018 * data/push.c: Reformat M4 a little.
4019 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4020 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4021 because push mode is on. Instead, if pure mode is on, move yynerrs
4022 to...
4023 (b4_declare_parser_state_variables): ... here.
4024 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4025 to yyps->NAME so it can be used in yypush_parse.
4026 (yypush_parse): Don't omit uses of yynerrs in push mode.
4027
4028 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4029
4030 Fix bug such that the first pushed token's value and location are
4031 sometimes overwritten (sometimes by %initial-action) before being used.
4032 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4033 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4034 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4035 more closely mimic the pull parser logic.
4036 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4037 time to read a token, which is after any initialization of yylval and
4038 yylloc.
4039 (gottoken): Rename label to...
4040 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4041 user namespace.
4042
4043 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4044
4045 Rearrange initialization of the parser state variables so that the
4046 skeleton doesn't have to have a copy for pull mode and another for push
4047 mode. This patch also fixes at least a bug such that yylloc was not
4048 initialized (with b4_location_initial_line and
4049 b4_location_initial_column) upon calling yypush_parse. However, that
4050 initialization now overwrites the first token's location;
4051 %initial-action assigning @$ already did the same thing, and both bugs
4052 will be fixed in a later patch.
4053 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4054 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4055 yyss, yyvs, yyls, and yystacksize.
4056 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4057 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4058 yylsp.
4059 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4060 yyps->NAME so it can be used in yypush_parse.
4061 (yyparse or yypush_parse): For yypush_parse, don't print the
4062 "Starting parse" diagnostic for invocations after the first.
4063 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4064 yypush_parse, only do it for the first invocation.
4065 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4066 initialization to occur in yypush_parse but only on the first
4067 invocation.
4068
4069 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4070
4071 * data/push.c: Add CPP guards around push parser declarations in both
4072 the header and the code file.
4073 In the code file, move the push parser declarations to the same place
4074 they appear in the header file.
4075 Clean up the M4 some, especially the inconsistent underquoting in
4076 some b4_c_function_def and b4_c_function_decl uses.
4077
4078 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4079
4080 Encapsulate the push parser state variables into an M4 macro so the
4081 push skeleton doesn't have to list them again for pull mode's yyparse.
4082 For push mode, remove yypush_parse's local equivalents of these
4083 variables to eliminate unnecessary copying between the two sets at
4084 run-time. This patch also fixes at least a bug related to multiple
4085 %initial-action invocations in push mode.
4086 * data/push.c (b4_declare_parser_variables): Rename to...
4087 (b4_declare_scanner_communication_variables): ... this for clarity and
4088 update both uses.
4089 (b4_declare_yyparse_variables): Remove and move its contents to the one
4090 spot where it was invoked.
4091 (b4_declare_parser_state_variables): New macro containing the parser
4092 state variables required by push mode.
4093 (struct yypstate): Replace all fields but yynew with
4094 b4_declare_parser_state_variables.
4095 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4096 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4097 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4098 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4099 parser state variable declarations with
4100 b4_declare_parser_state_variables.
4101 Don't initialize parser state variables when calling yypush_parse since
4102 yypstate_new already does that.
4103 Invoke the user's initial action only upon the first yypush_parse
4104 invocation.
4105 Remove all code that copies between the local parser state variables
4106 and the yypstate.
4107
4108 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4109
4110 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4111 prevent a name collision in a future patch where these names will
4112 sometimes be #define'd.
4113 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4114 since it no longer has the same name as the existing argument.
4115 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4116
4117 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
4118 and Joel E. Denny <jdenny@ces.clemson.edu>
4119
4120 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4121 that the argument is case-insensitive, and there's no `=' here.
4122 For the %skeleton entry, mention that %language is better.
4123 (Bison Options): Likewise for --language and --skeleton. Move the
4124 --skeleton entry so that the `Tuning the parser' section is sorted
4125 alphabetically on long options.
4126 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4127 %language directive in detail here; cross-reference the %language
4128 documentation instead.
4129 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4130 `%require "2.3b"' so that the example is always up-to-date.
4131 (Table of Symbols): Add entries for %language and %skeleton.
4132 * examples/extexi (normalize): Instead of replacing every %require
4133 argument with the current Bison version, just substitute for
4134 `@value{VERSION}'. This guarantees that we're testing what actually
4135 appears in the documentation.
4136 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4137 rather than `@VERSION@'.
4138
4139 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4140
4141 * NEWS: Reword the %language news a bit, and put it earlier.
4142
4143 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4144 Rewrite to simplify the logic.
4145 (language_argmatch): Likewise.
4146 (program_name): We now own this var.
4147 * src/getargs.h (struct bison_language): Use char[] rather than
4148 const char *.
4149
4150 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4151 Java is supported.
4152 * src/complain.c (program_name): Remove decl; no longer needed.
4153 * src/main.c (program_name): Remove; now belongs to getargs.
4154
4155 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
4156
4157 * NEWS: Document %language.
4158
4159 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4160
4161 * data/c-skel.m4, data/c++-skel.m4: New files.
4162 * data/glr.c: Complain on push parsers.
4163
4164 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4165 over %skeleton.
4166 (Decl Summary): Document %language and %skeleton.
4167 (Command line): Document -L.
4168
4169 * examples/extexi: Rewrite %require directive.
4170 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4171
4172 * src/files.c (compute_exts_from_gc): Look in language structure
4173 for .y extension.
4174 (compute_file_name_parts): Check whether .tab should be added.
4175 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4176 (language, skeleton_arg, language_argmatch): New.
4177 (long_options): Add --language.
4178 (getargs): Use skeleton_arg, add -L/--language.
4179 * src/getargs.h: Include location.h.
4180 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4181 * src/output.c (prepare): Pick default skeleton from struct language.
4182 Don't dispatch C skeletons here.
4183 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4184 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4185 * src/scan-gram.l ("%language"): New rule.
4186
4187 * tests/calc.at: Test %skeleton and %language.
4188 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4189 (AT_GLR_IF): Look for %skeleton "glr.cc".
4190 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4191 (AT_YACC_IF): Reject %language.
4192
4193 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4194
4195 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4196 since it wasn't used; only the typedef name 'semantic_type' is needed.
4197 Also, omit trailing white space.
4198
4199 * bootstrap: Sync from coreutils.
4200 (gnulib_extra_files): Add build-aux/announce.gen.
4201 (slurp): Adjust .gitignore files like .cvsignore files.
4202 * build-aux/announce-gen: Remove from CVS, since bootstrap
4203 now creates this.
4204
4205 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4206
4207 Make %push-parser imply %pure-parser. This fixes several bugs; see
4208 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4209 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4210 pure_parser = true.
4211 * data/push.c: Don't bother testing b4_push_if when deciding whether
4212 to expand b4_declare_parser_variables globally.
4213 (yypush_parse): Likewise in here.
4214
4215 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4216 (yy_reduce_print): Reformat M4 for readability.
4217
4218 2006-12-15 Bob Rossi <bob@brasko.net>
4219 and Joel Denny <jdenny@ces.clemson.edu>
4220
4221 * data/push.c (yypstate): Add typedef, and update all uses of
4222 struct yypstate to just yypstate.
4223 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4224
4225 2006-12-14 Bob Rossi <bob@brasko.net>
4226
4227 * data/push.c (yypush_parse): Declare prototype regardless of
4228 %locations option.
4229
4230 2006-12-14 Bob Rossi <bob@brasko.net>
4231
4232 * data/push.c (yyparse): Remove the prototype and the #define when in
4233 push-parser mode.
4234
4235 2006-12-13 Bob Rossi <bob@brasko.net>
4236
4237 * data/push.c (yypstate_init): Rename to...
4238 (yypstate_new): ... this and use b4_c_function_def.
4239 (yypstate_delete): New.
4240 (yypush_parse): Change parameters yynval and yynlloc to be const.
4241 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4242 yypstate_delete functions.
4243
4244 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4245
4246 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4247 strange test case titles. Reported by Bob Rossi.
4248
4249 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4250
4251 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4252 of potential ambiguities in GLR grammers.
4253
4254 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4255
4256 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4257 `bison ', use m4_index instead of m4_substr since chopping up a string
4258 containing M4-special characters causes problems here.
4259
4260 Fix a couple of bugs related to special characters in user-specified
4261 file names, and make it easier for skeletons to compute output file
4262 names with the same file name prefix as Bison-computed output file
4263 names.
4264 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4265 b4_parser_file_name and b4_spec_defines_file instead of
4266 @output_parser_name@ and @output_header_name@, which are now redundant.
4267 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4268 b4_parser_file_name, b4_spec_defines_file, and the new
4269 @basename(FILENAME@) instead of @output_parser_name@ and
4270 @output_header_name@, which inappropriately escaped the file names as
4271 C string literals.
4272 * src/files.c (all_but_ext): Remove static qualifier.
4273 (compute_output_file_names): Move `free (all_but_ext)' to...
4274 (output_file_names_free): ... here since all_but_ext is needed later.
4275 * src/files.h (all_but_ext): Extern.
4276 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4277 exactly what MUSCLE_INSERT_STRING used to do.
4278 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4279 characters are escaped properly.
4280 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4281 all_but_ext.
4282 For pkgdatadir muscle, maintain previous functionality by using
4283 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4284 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4285 digraphs would never be expanded. Hopefully no one has M4-special
4286 characters in his Bison installation path.
4287 * src/scan-skel.l: Don't parse @output_header_name@ and
4288 @output_parser_name@ anymore since they're now redundant.
4289 In @output, use decode_at_digraphs.
4290 Parse a new @basename command that invokes last_component.
4291 (decode_at_digraphs): New.
4292 (BASE_QPUTS): Remove unused.
4293 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4294 (Output file name): New tests.
4295
4296 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4297
4298 Warn about output files that are generated by the skeletons and that
4299 conflict with other output files.
4300 * data/glr.c: Don't generate the header file here when glr.cc does.
4301 * src/files.c (file_names, file_names_count): New static globals.
4302 (compute_output_file_names): Invoke output_file_name_check for files
4303 not generated by the skeletons and remove existing checks.
4304 (output_file_name_check): New function that warns about conflicting
4305 output file names.
4306 (output_file_names_free): Free file_names.
4307 * src/files.h (output_file_name_check): Declare.
4308 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4309 the skeletons.
4310 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4311 (Conflicting output files): New tests.
4312
4313 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4314
4315 * doc/bison.texinfo: Fix a couple of typos.
4316
4317 2006-12-08 Bob Rossi <bob@brasko.net>
4318
4319 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4320 Rename to...
4321 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4322 update all uses.
4323 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4324 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4325 local pv.
4326 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4327 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4328
4329 2006-12-07 Bob Rossi <bob@brasko.net>
4330 and Joel Denny <jdenny@ces.clemson.edu>
4331
4332 * data/push.c (yypvarsinit): Change return type from void* to struct
4333 yypvars*. No longer cast to void* on return.
4334 (struct yypvars): Remove yylen since it need not be remembered between
4335 yypushparse invocations.
4336 (yypushparse): Don't copy between yylen and pv->yylen.
4337
4338 2006-12-05 Bob Rossi <bob@brasko.net>
4339
4340 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4341 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4342 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4343 (struct yypvars): Remove b4_declare_parser_variables.
4344 (yypvarsinit): Remove init code for removed variables.
4345 (global scope): Do not declare b4_declare_parser_variables if
4346 push or pure mode.
4347 (yypushparse): Add b4_declare_parser_variables.
4348 Init new local variables, and remove init code for removed
4349 yypvars variables.
4350 (yyparse): Delete.
4351 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4352 and yyparse for other modes.
4353 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4354 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4355 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4356 (AT_PURE_LEX_IF): True if pure or push parser.
4357
4358 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4359
4360 Document Yacc prologue alternatives and default %destructor's and
4361 %printer's as experimental. Don't mention Java yet. Discussed at
4362 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4363 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4364 (2.3a): Annotate this entry to say the old forms of these features were
4365 also experimental.
4366 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
4367 Table of Symbols): Say they're experimental. Comment out any mention
4368 of Java (we'll want this back eventually).
4369
4370 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4371
4372 Support a file name argument to %defines. Deprecate `=' in
4373 %file-prefix, %name-prefix, and %output. Discussed at
4374 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4375 * NEWS (2.3a+): Mention.
4376 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
4377 form of %defines, and remove `=' from entries for %file-prefix,
4378 %name-prefix, and %output.
4379 * src/parse-gram.y (prologue_declaration): Implement.
4380 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4381 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4382 all but one occurrence of %name-prefix.
4383 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4384 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4385 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4386 occurrence of each of %file-prefix and %output. Add check for %defines
4387 with argument.
4388 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4389 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4390 Remove the `=' from %output.
4391
4392 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4393
4394 Don't escape $ in test case titles since Autoconf 2.61 now does that
4395 correctly.
4396 * tests/actions.at (Default %printer and %destructor are not for error
4397 or $undefined): Here.
4398 (Default %printer and %destructor are not for $accept): Here.
4399 * tests/input.at (Invalid $n and @n): Here.
4400
4401 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4402
4403 Rename <!> to <>. Discussed starting at
4404 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4405 * NEWS (2.3a+): Update.
4406 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
4407 Update.
4408 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4409 * src/scan-gram.l (INITIAL): Implement.
4410 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4411 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4412 comment.
4413 * tests/actions.at (Default tagless %printer and %destructor,
4414 Default tagged and per-type %printer and %destructor,
4415 Default %printer and %destructor are not for error or $undefined,
4416 Default %printer and %destructor are not for $accept,
4417 Default %printer and %destructor for mid-rule values): Update.
4418 * tests/input.at (Default %printer and %destructor redeclared,
4419 Unused values with default %destructor): Update.
4420
4421 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4422
4423 Don't let %prec take a nonterminal.
4424 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4425 token.
4426 * tests/input.at (%prec takes a token): New test checking that %prec
4427 won't take a nonterminal.
4428
4429 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4430
4431 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4432 it was double-quoted.
4433 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4434 grammar is maintained with Bison's highest standards.
4435 * src/getargs.c: Fix some typos in Doxygen comments.
4436
4437 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4438
4439 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4440 later. Reported by Paul Eggert in
4441 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4442 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4443 * src/scan-code.l (translate_action): Don't bother invoking
4444 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4445 (code_scanner_free): Instead of invoking
4446 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4447 which frees more.
4448 * src/scan-gram.l (gram_scanner_free): Likewise.
4449 * src/scan-skel.l (scan_skel): Likewise.
4450
4451 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4452
4453 * src/files.c (tr): Change return type to void.
4454 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4455 has been called previously for the same key.
4456 (muscle_find): Return storage instead of value so that
4457 --enable-gcc-warnings doesn't produce warnings that the return discards
4458 const. aver that the value and storage are the same since storage
4459 could potentially be NULL when value is not.
4460 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4461 same as 0.
4462
4463 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4464
4465 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4466 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4467 us a slightly cleaner distribution, and also works.
4468 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4469 gnulib changes.
4470
4471 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4472 and Paul Eggert <eggert@cs.ucla.edu>
4473
4474 Don't let Bison leak memory except when it complains.
4475 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4476 (spec_defines_file, dir_prefix): Now char *, not const char *,
4477 since they are freed.
4478 * src/files.c: Likewise.
4479 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4480 Likewise.
4481 (tr): Now operates in-place. All uses changed.
4482 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4483 values.
4484 (compute_file_name_parts, compute_output_file_names): Don't store
4485 read-only data in variables that will be freed.
4486 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4487 src_extension, and header_extension.
4488 (output_file_names_free): New public function to free
4489 spec_verbose_file, spec_graph_file, spec_defines_file,
4490 parser_file_name, and dir_prefix.
4491 * src/getargs.c (getargs): Don't store read-only data in variables that
4492 will be freed.
4493 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4494 (which previously existed but was unused), and quotearg_free.
4495 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4496 * src/muscle_tab.c: Likewise.
4497 (muscle_entry): Make the value char const *,
4498 and add a new storage member that is char * and can be freed.
4499 (muscle_entry_free): New private function.
4500 (muscle_init): Use it instead of free.
4501 (muscle_insert, muscle_grow): Update and use new storage member.
4502 (muscle_code_grow): Free the string passed to muscle_grow
4503 since it's not needed anymore.
4504 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4505 add a new `char *code' member.
4506 ("{...}"): Declare semantic type as code.
4507 * src/scan-code.h (translate_rule_action):
4508 (translate_symbol_action, translate_code, translate_action): Return
4509 `char const *' rather than `char *' since external code should not free
4510 these strings.
4511 * src/scan-code.l: Likewise.
4512 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4513 which is "{...}" in the parser.
4514 * tests/Makefile.am (maintainer-check-valgrind): Set
4515 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4516 Valgrind.
4517 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4518 complain.
4519 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4520 expecting a non-zero exit status sets --leak-check=summary and
4521 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4522 this case, and we don't want to hear about it.
4523
4524 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4525
4526 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4527 instead of from the template, to simplify configuration a bit.
4528 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4529 and m4/wint_t.m4, as they are needed with the latest gnulib.
4530
4531 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4532
4533 Disable unset/unused mid-rule value warnings by default, and recognize
4534 --warnings=midrule-values to enable them. Discussed starting at
4535 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4536 * NEWS (2.3a+): Mention.
4537 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4538 warnings): Add entry for midrule-values subargument.
4539 * src/reader.c (symbol_should_be_used): Don't return true just because
4540 the value is a set/used mid-rule value unless
4541 --warnings=midrule-values was specified.
4542 * tests/input.at (Unused values, Unused values before symbol
4543 declarations): Run tests with and without --warnings=midrule-values.
4544
4545 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4546 than LIST_FREE directly.
4547
4548 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4549
4550 Finish implementing --warnings=error, which should not be implied by
4551 --warnings=all (or by its synonyms -W and --warnings without
4552 subarguments).
4553 * src/complain.c (set_warning_issued): New function to report that
4554 warnings are being treated as errors and to record an error if so.
4555 Invoke...
4556 (warn_at, warn): ... here.
4557 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4558 "error - warnings are errors" does not appear above "all - all of the
4559 above".
4560 (getargs): For -W and --warnings without subarguments, don't let
4561 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4562 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4563
4564 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4565
4566 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4567 empty subargument list. For example: `bison --warnings= parser.y'.
4568
4569 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4570
4571 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4572 the parser header file so that gcc doesn't warn.
4573
4574 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4575
4576 Split the default %destructor/%printer into two kinds: <*> and <!>.
4577 Discussed starting at
4578 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4579 * NEWS (2.3a+): Mention.
4580 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4581 previous change today related to mid-rules.
4582 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
4583 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
4584 (TYPE_TAG_ANY): Add as <*>.
4585 (TYPE_TAG_NONE): Add as <!>.
4586 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4587 for <*> and <!>.
4588 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4589 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4590 * src/symlist.c (symbol_list_default_new): Split into tagged and
4591 tagless versions.
4592 (symbol_list_destructor_set, symbol_list_printer_set): Split
4593 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4594 SYMLIST_DEFAULT_TAGLESS.
4595 * src/symlist.h: Update symbol_list_default*_new prototypes.
4596 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4597 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4598 * src/symtab.c (default_destructor, default_destructor_location,
4599 default_printer, default_printer_location): Split each into tagged and
4600 tagless versions.
4601 (symbol_destructor_get, symbol_destructor_location_get,
4602 symbol_printer_get, symbol_printer_location_get): Implement tagged
4603 default and tagless default cases.
4604 (default_destructor_set, default_printer_set): Split each into tagged
4605 and tagless versions.
4606 * src/symtab.h: Update prototypes.
4607 * tests/actions.at (Default %printer and %destructor): Rename to...
4608 (Default tagless %printer and %destructor): ... this, and extend.
4609 (Per-type %printer and %destructor): Rename to...
4610 (Default tagged and per-type %printer and %destructor): ... this, and
4611 extend.
4612 (Default %printer and %destructor for user-defined end token): Extend.
4613 (Default %printer and %destructor are not for error or $undefined):
4614 Update.
4615 (Default %printer and %destructor are not for $accept): Update.
4616 (Default %printer and %destructor for mid-rule values): Extend.
4617 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4618 (Unused values with default %destructor): Extend.
4619
4620 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4621
4622 Don't apply the default %destructor/%printer to an unreferenced midrule
4623 value. Mentioned at
4624 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4625 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4626 like $@n instead of just @n so that the default %destructor/%printer
4627 logic doesn't see them as user-defined symbols.
4628 (symbol_is_dummy): Check for both forms of the name.
4629 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4630 name for which the midrule value is referenced in any action.
4631 * tests/actions.at (Default %printer and %destructor for mid-rule
4632 values): New test.
4633 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4634 for change to dummy symbol names.
4635
4636 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4637
4638 Warn about unset midrule $$ if the corresponding $n is used.
4639 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4640 $n usage.
4641 (packgram): Before invoking grammar_rule_check on any rule, make sure
4642 all actions have already been scanned in order to set `used' flags.
4643 Otherwise, checking that a midrule's $$ is set will not always work
4644 properly because the midrule check must forward-reference the midrule's
4645 parent rule.
4646 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4647 warning.
4648
4649 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4650
4651 More improvements to the documentation of the prologue alternatives:
4652 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4653 Bison manual.
4654 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4655 some text to clarify the relative importance of the new directives and
4656 to show how these directives may be viewed as code labels.
4657
4658 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4659
4660 Similar to the recently removed %before-header, add %code-top as the
4661 alternative to the pre-prologue. Mentioned at
4662 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4663 Also, let the prologue alternatives appear in the grammar section.
4664 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4665 (prologue_declaration): Move the existing prologue alternatives to...
4666 (grammar_declaration): ... here and add %code-top.
4667 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4668
4669 Clean up and extend documentation for the prologue alternatives.
4670 * NEWS (2.3a+): Describe prologue alternatives.
4671 * doc/bison.texinfo (Prologue): Move discussion of prologue
4672 alternatives to...
4673 (Prologue Alternatives): ... this new section, and extend it to discuss
4674 all 4 directives in detail.
4675 (Table of Symbols): Clean up discussion of prologue alternatives and
4676 add %code-top.
4677
4678 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4679
4680 DJGPP specific issues.
4681
4682 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4683 config.bat accordingly.
4684 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4685 * djgpp/config.site: Likewise.
4686
4687 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
4688
4689 Replace %*-header with %provides, %requires, %code. See discussion at
4690 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4691
4692 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4693 (b4_user_start_header): Remove.
4694 * data/glr.c: Use new macros instead of b4_*start_header
4695 and b4_*end_header.
4696 * data/glr.cc: Likewise.
4697 * data/lalr1.cc: Likewise.
4698 * data/push.c: Likewise.
4699 * data/yacc.c: Likewise.
4700
4701 * doc/bison.texinfo: Remove %before-header, rename
4702 %{start,end,after}-header to %requires, %provides, %code.
4703
4704 * src/parse-gram.y: Likewise (also rename token names accordingly).
4705 * src/scan-gram.l: Likewise.
4706 * tests/actions.at: Likewise.
4707
4708 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4709
4710 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4711 Problem reported by Joel E. Denny.
4712
4713 2006-10-14 Jim Meyering <jim@meyering.net>
4714
4715 (Sync from coreutils.)
4716 Work also when the working directory (with e.g. coreutils sources)
4717 is version controlled with git, rather than CVS.
4718 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4719 rather than CVS.
4720 In messages and comments, say e.g., "checked-out sources",
4721 rather than "CVS sources".
4722 (version_controlled_file): New function. Work for git as well as
4723 for CVS. Don't use grep's -q option.
4724 (slurp): Call it here, in place of CVS-specific code.
4725
4726 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4727
4728 Fix testsuite for ./configure --enable-gcc-warnings:
4729 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4730 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4731 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4732 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4733 * test/regression.at (Diagnostic that expects two alternatives):
4734 Likewise.
4735
4736 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4737
4738 * bootstrap.conf (gnulib_modules): Add config-h.
4739 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4740 worry about HAVE_CONFIG_H.
4741 * lib/abitset.c: Likewise.
4742 * lib/bitset.c: Likewise.
4743 * lib/bitset_stats.c: Likewise.
4744 * lib/bitsetv-print.c: Likewise.
4745 * lib/bitsetv.c: Likewise.
4746 * lib/ebitset.c: Likewise.
4747 * lib/get-errno.c: Likewise.
4748 * lib/lbitset.c: Likewise.
4749 * lib/subpipe.c: Likewise.
4750 * lib/timevar.c: Likewise.
4751 * lib/vbitset.c: Likewise.
4752 * lib/bitset.c: Include "bitset.h" first, to test interface.
4753 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4754 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4755 * lib/bitsetv.c: Include "bitsetv.h" first.
4756 * lib/get-errno.c: Include "get-errno.h" first.
4757 * m4/.cvsignore: Add config-h.m4.
4758 * tests/actions.at (Default %printer and %destructor for ...):
4759 Adjust expected line numbers in output to reflect removal of #if
4760 HAVE_CONFIG_H lines.
4761 * tests/glr-regression.at (Missed %merge type warnings when ...):
4762 Likewise.
4763 * tests/regression.at (Braced code in declaration in rules section):
4764 Likewise.
4765 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4766 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4767 Include <config.h> unconditionally.
4768
4769 * bootstrap: Sync from coreutils, as follows:
4770
4771 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4772
4773 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4774 variable was sometimes used without being initialized. This
4775 messed up the installation of the INSTALL file in some cases.
4776
4777 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4778
4779 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4780 --copy. Inspired by a suggestion from Bruno Haible.
4781
4782 2006-10-03 Jim Meyering <jim@meyering.net>
4783
4784 * bootstrap: Undo last change to this file, since now gnulib-tool
4785 sticks with the automake default in generating dependencies.
4786
4787 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4788
4789 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4790 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4791
4792 * doc/bison.1: Add copyright notice.
4793
4794 * data/glr.c: Don't include <stdarg.h>; not used.
4795
4796 * NEWS: The -g and --graph options now output graphs in Graphviz
4797 DOT format, not VCG format.
4798 * doc/bison.1: Likewise.
4799 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
4800 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4801 of this change in
4802 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
4803 * TODO: Remove Graphviz entry.
4804 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4805 remove vcg.c, vcg.h, vcg_defaults.h.
4806 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4807 * src/graphviz.c, src/graphviz.h: New files.
4808 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4809 * src/files.h: Make comment more generic.
4810 * src/main.c (main): Likewise.
4811 * src/print_graph.h: Likewise.
4812 * src/getargs.c (usage): Make usage description more generic.
4813 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4814 (static_graph, fgraph): Remove. All uses changed to pass
4815 arguments instead of sharing a static var.
4816 (print_core, print_actions, print_state, print_graph):
4817 Output graphviz format rather than VCG format.
4818 * tests/.cvsignore: Remove *.vcg; add *.dot.
4819 * tests/output.at: Expect *.dot files, not *.vcg files.
4820
4821 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4822 accommodates the 2006-10-08 change.
4823
4824 2006-10-11 Bob Rossi <bob@brasko.net>
4825
4826 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4827 (b4_yyssa, b4_yyerror_range): New macros.
4828 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4829 (yypvarsinit): Remove init of removed fields.
4830 (yypushparse): Remove use of removed fields; use new macros instead.
4831
4832 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4833
4834 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4835 in a push parser. Reindent slightly to match yacc.c better.
4836
4837 2006-10-11 Bob Rossi <bob@brasko.net>
4838
4839 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4840 yymsg_alloc fields.
4841 (yypvarsinit, yypushparse): Remove init of removed fields.
4842 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
4843
4844 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4845
4846 * THANKS: Add Paolo Bonzini and Bob Rossi.
4847
4848 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
4849
4850 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4851 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4852 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4853 b4_define_user_cde and uses): Remove.
4854 (b4_comment, b4_prefix, b4_sync_start): New.
4855 * data/bison.m4: New file, with most of the content removed from c.m4.
4856 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4857 * src/output.c (output_skeleton): Pass bison.m4.
4858 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4859 only if specified.
4860
4861 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4862
4863 Fix test failure reported by Tom Lane in
4864 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4865 and try to make such failures easier to catch in the future.
4866 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4867 that's now the caller's responsibility.
4868 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4869 Set yychar = YYEOF if it's negative.
4870 * tests/actions.at (yylex): Abort if asked to read past EOF.
4871 * tests/conflicts.at (yylex): Likewise.
4872 * tests/cxx-type.at (yylex): Likewise.
4873 * tests/glr-regression.at (yylex): Likewise.
4874 * tests/input.at (yylex): Likewise.
4875 * tests/regression.at (yylex): Likewise.
4876 * tests/torture.at (yylex): Likewise.
4877
4878 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4879
4880 Fix problems with translating English-language diagnostics.
4881 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4882 respect to bison-runtime pot generation. The YY_ stuff
4883 wasn't being captured.
4884 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4885 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4886 * runtime-po/POTFILES.in: Add data/push.c.
4887
4888 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4889
4890 Merge bootstrap changes from coreutils.
4891
4892 2006-09-28 Jim Meyering <jim@meyering.net>
4893
4894 Automatically generated dependencies are important even
4895 when all of the sources in a directory come from gnulib.
4896 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4897 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4898
4899 2006-09-23 Jim Meyering <jim@meyering.net>
4900
4901 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
4902
4903 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4904
4905 * bootstrap: Add support for --force.
4906 (usage): New function. Describe usage less tersely.
4907 (CVS_only_file): New var.
4908
4909 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
4910
4911 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4912 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
4913 Adjust white space and comments to match GNU style better.
4914
4915 2006-09-20 Bob Rossi <bob@brasko.net>
4916
4917 * data/push.c (yyresult_get): Remove function.
4918 (YYPUSH_MORE): Add #define.
4919 (yypushparse): Modify return value.
4920
4921 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4922
4923 * stamp-h.in: Remove; no longer needed.
4924 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
4925 Remove config.h, config.hin, intl (no longer created).
4926 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
4927 stamp-h1.
4928
4929 Sync bootstrap from coreutils, as follows:
4930
4931 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
4932
4933 * bootstrap (symlink_to_gnulib): New function.
4934 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
4935 to copies-of-gnulib.
4936 (cp_mark_as_generated, slurp, gnulib_files):
4937 Avoid making a copy if it's the same as the old version.
4938 (gnulib_files): Add support for this variable (used by Bison).
4939
4940 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4941
4942 * src/getargs.c (usage): Rework to use conventions similar to
4943 coreutils, to make translation a bit easier and the code a bit
4944 smaller. Problem reported by Tim Van Holder.
4945
4946 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
4947
4948 Use some of gnulib's new modules, taken from coreutils.
4949
4950 * bootstrap: Sync from coreutils, except add support for gnulib_files.
4951 * bootstrap.conf: New file.
4952 (gnulib_modules): Add configmake, inttypes, unistd.
4953 (XGETTEXT_OPTIONS): Add complain, complain_at,
4954 fatal, fatal_at, warn, warn_at, unexpected_end.
4955 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
4956 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
4957 (gl_EARLY): Add.
4958 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
4959 (gl_INIT): Add
4960 (GNULIB_AUTOCONF_SNIPPET): Remove.
4961 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
4962 the pickiest.
4963 * lib/.cvsignore: Add inttypes_.h.
4964 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
4965 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
4966 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
4967 no-longer-necessary initializations.
4968 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
4969 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
4970 use the unistd module.
4971 * src/system.h: Likewise.
4972 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
4973 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
4974 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
4975 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
4976 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
4977 * src/system.h: Include inttypes.h unconditionally, now that we
4978 use the inttypes module. Don't bother to include stdint.h, since
4979 inttypes.h now does that for us.
4980 (LOCALEDIR): Remove, now that we use the configmake module.
4981 * src/getargs.c: Include configmake.h.
4982 * src/main.c: Likewise.
4983 * src/output.c: Likewise.
4984 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
4985 not from $abs_top_builddir, since config.h moved.
4986
4987
4988 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
4989 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
4990
4991 * src/parse-gram.y (symbol_declaration): Don't put statements
4992 before declarations; it's not portable to C89.
4993 * src/scan-code.l (handle_action_at): Likewise.
4994
4995 * src/scan-code.l: Always initialize braces_level; the old code
4996 left it uninitialized and therefore had undefined behavior.
4997
4998 Don't attempt to redefine 'assert', since it runs afoul of
4999 systems where standard headers (mistakenly) include <assert.h>.
5000 Instead, define and use our own alternative, called 'aver'.
5001 * src/reader.c: Don't include assert.h, since we no longer
5002 use assert.
5003 * src/scan-code.l: Likewise.
5004 * src/system.h (assert): Remove, replacing with....
5005 (aver): New function, taking a bool arg. All uses changed.
5006 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5007 not merely an integer.
5008
5009 2006-09-15 Bob Rossi <bob@brasko.net>
5010
5011 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5012 * data/c.m4 (YYPUSH): New.
5013 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5014 * src/getargs.c (push_parser): New var.
5015 * src/getargs.h (push_parser): New declaration.
5016 * src/output.c (prepare): Add macro insertion of `push_flag'.
5017 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5018 (prologue_declaration): Parse %push-parser.
5019 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5020 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5021 list of removed lines from the traces observed.
5022 (AT_CHECK_CALC_LALR): Added push parser tests.
5023
5024 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5025
5026 * NEWS: Version 2.3a.
5027 * configure.ac (AC_INIT): Likewise.
5028
5029 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5030 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5031 due to header ordering dependencies. I don't know why the #define
5032 was there.
5033
5034 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5035 runtime cost when YYDEBUG is not defined, and so that some tests
5036 that used to fail now work. Problem and initial suggestion by
5037 Paolo Bonzini.
5038 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5039 * data/glr.cc (b4_parser_class_name):
5040 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5041 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5042 (yydebug_) [YYDEBUG]: New member.
5043 (yycdebug_): Now defined only if YYDEBUG.
5044 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5045 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5046 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5047 if YYYDEBUG.
5048 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5049 Define only if YYDEBUG.
5050 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5051 set_debug_level.
5052 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5053 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5054 AT_CHECK_CALC_GLR_CC that are working now.
5055
5056 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5057
5058 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5059 We don't need them in glr.cc, and glr.c defines them.
5060 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5061 assumes that defining it to anything is the same as defining
5062 it to 1. Problem reported by Paolo Bonzini.
5063
5064 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5065
5066 * data/c.m4 (b4_null, b4_case): Define.
5067 * src/output.c (prepare_symbols): Use b4_null.
5068 (user_actions_output): Use b4_case.
5069
5070 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5071
5072 * data/glr.c (b4_shared_declarations): Put start-header first,
5073 before any #includes that we generate, so that feature-test
5074 macros work. Problem reported by Michael Deutschmann in
5075 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5076 * data/lalr1.cc: Likewise.
5077 * doc/bison.texinfo (Prologue): Document that feature-test macros
5078 should be defined before any Bison declarations.
5079 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5080 that depend on location.hh after, not before, Bison decls, since
5081 we now include location.hh after the first user prologue.
5082
5083 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5084 Sander Brandenburg in
5085 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5086 Also, fix minor white space and comment issues.
5087 (Prologue): Mention that it's better to define feature-test macros
5088 before Bison declarations. Problem reported by Michael Deutschmann.
5089
5090 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5091 by Jim Meyering.
5092 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5093 This adjusts to recent gnulib changes.
5094
5095 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5096
5097 Finish implementation of per-type %destructor/%printer. Discussed
5098 starting at
5099 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5100 and
5101 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5102 * NEWS (2.3+): Add a description of this feature to the default
5103 %destructor/%printer description.
5104 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5105 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5106 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5107 list node contains a semantic type.
5108 * src/symtab.c, src/symtab.h: Extend with a table that associates
5109 semantic types with their %destructor's and %printer's.
5110 (semantic_type_from_uniqstr, semantic_type_get,
5111 semantic_type_destructor_set, semantic_type_printer_set): New functions
5112 composing the public interface of that table.
5113 (symbol_destructor_get, symbol_destructor_location_get,
5114 symbol_printer_get, symbol_printer_location_get): If there's no
5115 per-symbol %destructor/%printer, look up the per-type before trying
5116 the default.
5117 * tests/actions.at (Per-type %printer and %destructor): New test case.
5118 * tests/input.at (Default %printer and %destructor redeclared):
5119 Extend to check that multiple occurrences of %symbol-default in a
5120 single %destructor/%printer declaration is an error.
5121 (Per-type %printer and %destructor redeclared, Unused values with
5122 per-type %destructor): New test cases.
5123
5124 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5125
5126 Require default %destructor/%printer to be declared using
5127 %symbol-default instead of an empty symbol list, and start working on
5128 new per-type %destructor/%printer. Discussed at
5129 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5130 * NEWS (2.3+): Add %symbol-default to example.
5131 * bison.texinfo (Freeing Discarded Symbols): Likewise.
5132 (Table of Symbols): Add entry for %symbol-default.
5133 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5134 (generic_symlist, generic_symlist_item): New nonterminals for creating
5135 a list in which each item is a symbol, semantic type, or
5136 %symbol-default.
5137 (grammar_declaration): Use generic_symlist in %destructor and %printer
5138 declarations instead of symbols.1 or an empty list.
5139 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5140 for changes to symbol_list.
5141 * src/reader.c: Update for changes to symbol_list.
5142 * src/scan-code.l: Likewise.
5143 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5144 * src/symlist.c, src/symlist.h: Extend such that a list node may
5145 represent a semantic type or a %symbol-default in addition to just an
5146 ordinary symbol. Add switched functions for setting %destructor's and
5147 %printer's.
5148 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5149 %destructor/%printer declarations.
5150
5151 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5152
5153 Whether the default %destructor/%printer applies to a particular symbol
5154 isn't a question of whether the user *declares* that symbol (in %token,
5155 for example). It's a question of whether the user by any means
5156 *defines* the symbol at all (by simply using a char token, for
5157 example). $end is defined by Bison whereas any other token with token
5158 number 0 is defined by the user. The error token is always defined by
5159 Bison regardless of whether the user declares it with %token, but we
5160 may one day let the user define error as a nonterminal instead.
5161 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5162 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5163 the meaning of "user-defined".
5164 * tests/actions.at (Default %printer and %destructor for user-declared
5165 end token): Rename to...
5166 (Default %printer and %destructor for user-defined end token): ...
5167 this.
5168
5169 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5170 computation of whether to apply the default, don't maintain a list of
5171 every Bison-defined symbol. Instead, just check for a first character
5172 of '$', which a user symbol cannot have, and check for the error token.
5173
5174 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5175
5176 Don't apply the default %destructor or %printer to the error token,
5177 $undefined, or $accept. This change fits the general rule that the
5178 default %destructor and %printer are only for user-declared symbols,
5179 and it solves several difficulties that are described in the new test
5180 cases listed below.
5181 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5182 * tests/actions.at (Default %printer and %destructor are not for error
5183 or $undefined, Default %printer and %destructor are not for $accept):
5184 New test cases.
5185
5186 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5187
5188 Allow %start after the first rule.
5189 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5190 when parsing the first rule.
5191 (check_and_convert_grammar): Search for it here after all grammar
5192 declarations have been parsed. Skip midrules, which have dummy LHS
5193 nonterminals.
5194 * src/symtab.c (symbol_is_dummy): New function.
5195 * src/symtab.h (symbol_is_dummy): Declare it.
5196 * tests/input.at (%start after first rule): New test.
5197
5198 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5199
5200 Redo some of the previous commit: add back the ability to use
5201 non-aliased/undeclared string literals since it might be useful to
5202 those declaring %token-table.
5203 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5204 commit: don't worry about complaints from symbols_pack.
5205 * src/symtab.c (symbol_new, symbol_class_set,
5206 symbol_check_alias_consistency): Undo changes in previous commit: count
5207 each string literal as a new symbol and token, assign it a symbol
5208 number, and don't complain about non-aliased string literals.
5209 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5210 and token counts but does still set aliased tokens to the same number,
5211 symbol_pack_processor now leaves empty slots in the symbols array.
5212 Remove those slots.
5213 * tests/regression.at (Undeclared string literal): Remove test case
5214 added in previous commit since non-aliased string literals are allowed
5215 again.
5216 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5217 remove unnecessary string literal declarations.
5218 * tests/sets.at (Firsts): Likewise.
5219
5220 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5221
5222 Don't allow an undeclared string literal, but allow a string literal to
5223 be used before its declaration.
5224 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5225 symbols_pack complained.
5226 * src/symtab.c (symbol_new): Don't count a string literal as a new
5227 symbol.
5228 (symbol_class_set): Don't count a string literal as a new token, and
5229 don't assign it a symbol number since symbol_make_alias does that.
5230 (symbol_make_alias): It's not necessary to decrement the symbol and
5231 token counts anymore. Don't assume that an alias declaration occurs
5232 before any uses of the identifier or string, and thus don't assert that
5233 one of them has the highest symbol number so far.
5234 (symbol_check_alias_consistency): Complain if there's a string literal
5235 that wasn't declared as an alias.
5236 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5237 symbol_pack asserts that every token has been assigned a symbol number
5238 although undeclared string literals have not.
5239 * tests/regression.at (String alias declared after use, Undeclared
5240 string literal): New test cases.
5241 (Characters Escapes, Web2c Actions): Declare string literals as
5242 aliases.
5243 * tests/sets.at (Firsts): Likewise.
5244
5245 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5246
5247 In the grammar scanner, STRING_FINISH unclosed constructs and return
5248 them to the parser in order to improve error messages.
5249 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5250 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5251 * tests/input.at (Unclosed constructs): New test case.
5252 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5253 seen.
5254
5255 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5256 unused global.
5257
5258 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5259
5260 Handle string aliases for character tokens correctly.
5261 * src/symtab.c (symbol_user_token_number_set): If the token has an
5262 alias, check and set its alias's user token number instead of its own,
5263 which is set to indicate the alias. Previously, every occurrence of
5264 the character token in the grammar overwrote that alias indicator with
5265 the character code.
5266 * tests/input.at (String aliases for character tokens): New test.
5267
5268 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5269
5270 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5271
5272 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5273
5274 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5275 to prevent failures when building on older platforms.
5276 Check for autopoint failure.
5277 Set XGETTEXT_OPTIONS to values that check for C format strings,
5278 so that translators are warned about them (this also helps
5279 prevent core dumps).
5280
5281 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5282 function, since it simplifies our code a bit.
5283
5284 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5285 rather than -W, so we don't get bogus warnings about sign comparisons.
5286 Add -Wpointer-arith, since that warning is useful (it reports code
5287 that does not conform to C89 and that some compilers reject).
5288 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5289 since it's no longer needed.
5290
5291 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5292
5293 Clean up scanners a bit.
5294 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5295 definitions so gcc won't warn when obstack_for_string is unused.
5296 * src/scan-code.l: config.h and system.h are already #include'd by
5297 scan-code-c.c, so get rid of them here.
5298 * src/scan-gram.l: Likewise.
5299 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5300 definitions rather than duplicating the rest of it.
5301 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5302
5303 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5304
5305 Suppress signed/unsigned comparison warnings for yycheck.
5306 * data/c.m4 (b4_safest_int_type): New macro.
5307 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5308 a signed int type, cast it to b4_safest_int_type first.
5309 * data/yacc.c: Likewise.
5310 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5311 also overwritten.
5312
5313 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5314
5315 * doc/bison.texinfo: Fix some typos.
5316
5317 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5318
5319 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5320 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5321
5322 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5323 the latest gnulib does this a different way.
5324 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5325 translation was patched, so stop omitting it.
5326
5327 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5328
5329 Enable declaration of default %printer/%destructor. Make the parser
5330 use these for all user-declared grammar symbols for which the user does
5331 not declare a specific %printer/%destructor. Thus, the parser uses it
5332 for token 0 if the user declares it but not if Bison generates it as
5333 $end. Discussed starting at
5334 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5335 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5336 and
5337 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5338 * NEWS (2.3+): Mention.
5339 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5340 declare a %destructor for a mid-rule's semantic value. It's just
5341 impossible to declare one specific to it.
5342 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5343 code. Describe default %destructor form.
5344 * src/parse-gram.y (grammar_declaration): Parse default
5345 %printer/%destructor declarations.
5346 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5347 and symbol_destructor_location_get rather than accessing the destructor
5348 and destructor_location members of struct symbol.
5349 (symbol_printers_output): Likewise but for %printer's.
5350 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5351 again.
5352 * src/symtab.c (default_destructor, default_destructor_location,
5353 default_printer, default_printer_location): New static global
5354 variables to record the default %destructor and %printer.
5355 (symbol_destructor_get, symbol_destructor_location_get,
5356 symbol_printer_get, symbol_printer_location_get): New functions to
5357 compute the appropriate %destructor and %printer for a symbol.
5358 (default_destructor_set, default_printer_set): New functions to set the
5359 default %destructor and %printer.
5360 * src/symtab.h: Prototype all those new functions.
5361 * tests/actions.at (Default %printer and %destructor): New test to
5362 check that the right %printer and %destructor are called, that they're
5363 not called for $end, and that $$ and @$ work correctly.
5364 (Default %printer and %destructor for user-declared end token): New
5365 test to check that the default %printer and %destructor are called for
5366 a user-declared end token.
5367 * tests/input.at (Default %printer and %destructor redeclared, Unused
5368 values with default %destructor): New tests to check related grammar
5369 warnings and errors.
5370
5371 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5372
5373 Clean up handling of %destructor for the end token (token 0).
5374 Discussed starting at
5375 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5376 and
5377 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5378
5379 Make the skeletons consistent in how they pop the end token and invoke
5380 its %destructor.
5381 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5382 state, which has token number 0, since this would invoke the
5383 %destructor for the end token.
5384 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5385 until after shifting the end token, or else it won't be popped.
5386 * data/yacc.c (yyparse): Likewise.
5387
5388 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5389 it's the end token. Upon termination, destroy an unshifted lookahead
5390 even when it's the end token.
5391 * data/lalr1.cc (yy::parser::parse): Likewise.
5392 * data/yacc.c (yyparse): Likewise.
5393
5394 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5395 value warnings for the end token when the user gives the end token a
5396 %destructor.
5397
5398 * tests/actions.at (Printers and Destructors): Test all the above.
5399
5400 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5401
5402 Update to latest gnulib and gettext versions.
5403 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5404 Add fopen-safer.
5405 (gnulib_files): Add m4/warning.m4. Don't worry about files
5406 overwritten by autopoint.
5407 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5408 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5409 rejects them.
5410 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5411 so that we can remove the intl files at a better time.
5412 (intl_files_to_remove): Remove aclocal.m4, since it gets
5413 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5414 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5415 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5416 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5417 Remove datarootdir hack; no longer needed.
5418 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5419 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5420 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5421 strdup.h.
5422 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5423 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5424
5425 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5426
5427 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5428 it with --assume-autoconf='latest-stable'.
5429
5430 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5431
5432 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5433 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5434 YYSTYPE' and `{'.
5435 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5436 those from muscle_tab.c since the old ones are misleading.
5437
5438 2006-07-13 Akim Demaille <akim@epita.fr>
5439
5440 Support %define "KEY" {VALUE}.
5441 * src/scan-code.h, src/scan-code.l (translate_action)
5442 (translate_rule_action, translate_symbol_action, translate_code):
5443 Return char *, not const char *.
5444 * src/parse-gram.y (declaration): Rename as...
5445 (prologue_declaration): this.
5446 (string_content): Remove this nonterminal, use STRING.
5447 (braceless, content, content.opt): New nonterminal.
5448 Use them.
5449 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5450 as value.
5451 * src/scan-gram.l (getargs.h): Don't include it.
5452
5453 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5454
5455 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5456 rather than a for-loop that declares a local bool variable. This
5457 should work around a compatibility problem with a Cray x1e C++
5458 compiler reported by Hung Nguyen in
5459 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5460 The for-loop was introduced in the 2004-11-17 change but I don't
5461 know why it was needed.
5462
5463 2006-07-12 Akim Demaille <akim@epita.fr>
5464
5465 * data/c.m4: Comment changes.
5466
5467 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
5468
5469 * src/complain.c (error_message, ERROR_MESSAGE): New.
5470 To factor...
5471 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5472 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5473
5474 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5475
5476 * NEWS: Instead of %union, you can define and use your own union type
5477 YYSTYPE if your grammar contains at least one <type> tag.
5478 Your YYSTYPE need not be a macro; it can be a typedef.
5479 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5480 (Union Decl, Decl Summary): Document this.
5481 * data/glr.c (YYSTYPE): Implement this.
5482 * data/glr.cc (YYSTYPE): Likewise.
5483 * data/lalr1.cc (YYSTYPE): Likewise.
5484 * data/yacc.c (YYSTYPE): Likewise.
5485 * src/output.c (prepare): Output tag_seen_flag.
5486 * src/parse-gram.y (declaration, grammar_declaration):
5487 Use 'union_seen' rather than 'typed' to determine whether
5488 %union has been seen, since grammars can now be typed without
5489 %union.
5490 (symbol_declaration, type.opt, symbol_def):
5491 Keep track of whether a tag has been seen.
5492 * src/reader.c (union_seen, tag_seen): New vars.
5493 (typed): remove.
5494 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5495 * src/scan-code.l (untyped_var_seen): New variable.
5496 (handle_action_dollar): Adjust to above changes.
5497 (handle_action_dollar, handle_action_at):
5498 Improve overflow checking for outlandish numbers.
5499 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5500 avoid new diagnostics generated by above changes.
5501 * tests/regression.at (YYSTYPE typedef): Add test to check
5502 for type tags without %union.
5503
5504 * src/symlist.c (symbol_list_length): Return int, not unsigned
5505 int, since callers expect int. This may need to get revisited
5506 once we have proper integer overflow checking.
5507
5508 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5509 object is now static.
5510
5511 * src/getargs.c (flags_argmatch): Return void, not int,
5512 to pacify ./configure --enable-gcc-warnings.
5513
5514 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5515 since last_string is already defined to FLEX_PREFIX (last_string).
5516
5517 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
5518
5519 Implement --warnings/-W.
5520 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5521 replaced by...
5522 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5523 Adjust callers.
5524 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5525 (warnings_args, warnings_types): New.
5526 (getargs, short_options, long_options): Accept -W/--warnings.
5527 Sort the options by alphabetical order, upper case letter right
5528 before its lower case.
5529
5530 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5531
5532 Change %merge result type clash warnings to errors. Discussed at
5533 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5534 * src/reader.c (record_merge_function_type): Use complain_at.
5535 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5536 declared later): Update test case results.
5537
5538 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
5539
5540 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5541 to be in alphabetical order.
5542 (trace_args): Spelling fixes.
5543
5544 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5545
5546 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5547 so they don't collide with user-defined macros.
5548 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5549 this was never guaranteed, and now that we're using gnulib stdint,
5550 which defines int_fast16_t to long int, the problem is exposed.
5551
5552 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5553
5554 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5555 need the full POSIX semantics (and weren't implementing them
5556 anyway).
5557
5558 Adjust to Autoconf 2.60 and today's gnulib.
5559 * bootstrap (gnulib_modules): Add stdint.
5560 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5561 no longer copies it.
5562 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5563 since stdint needs the former and wcwidth (which is now required
5564 by mbswidth) needs the latter.
5565 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5566 work around a compatibility glitch between gettext 0.14.6 and
5567 Autoconf 2.60.
5568 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5569 Do not check for uintptr_t, since new stdint module does the right
5570 thing.
5571 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5572 Add stdint.h, stdint_.h, wcwidth.h.
5573 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5574 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5575 stdint.m4, wchar_t.m4, wcwidth.m4.
5576 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5577 usual order for ../lib/*.h files.
5578 (file_name_split): Use last_component, not base_name, to adjust
5579 to gnulib changes.
5580 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5581 for ../lib/*.h files.
5582 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5583 Define unconditionally, since we now assume the stdint module.
5584 * src/scan-skel.l: Include <dirname.h>.
5585 (BASE_QPUTS): Use last_component, not base_name.
5586 * src/system.h: Include <unlocked-io.h> in the usual order
5587 for ../lib/*.h files. Include <stdint.h> unconditionally,
5588 since we now use the stdint module.
5589 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5590 HAVE_UINTPTR_T, since we now use the stdint module.
5591 (base_name): Remove decl, since files now include <dirname.h>
5592 to get the decl.
5593
5594 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
5595
5596 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5597 New, default to 1.
5598 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5599 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5600 default.
5601 * tests/calc.at: Adjust.
5602
5603 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
5604
5605 * data/c.m4 (b4_basename): New.
5606 (b4_syncline): Also output the location of its invocation (from
5607 the skeleton).
5608 (b4_user_action, b4_define_user_action, b4_user_actions)
5609 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5610 (b4_user_stype): New.
5611 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5612
5613 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5614
5615 In the grammar file, the first column is 1 not 0 on the first line as
5616 on every other line.
5617 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5618 * tests/input.at (Torturing the Scanner): Update output.
5619
5620 * src/scan-gram.l (scanner_cursor): Declare it static.
5621
5622 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5623
5624 In warnings, say "previous declaration" rather than "first
5625 declaration".
5626 * src/symtab.c (redeclaration): Do that here.
5627 * src/reader.c (record_merge_function_type): In the case of a result
5628 type clash, report the previous declaration rather than the very first
5629 one in the grammar file.
5630 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5631 declared later): Add a third declaration to check this behavior.
5632 * tests/input.at (Incompatible Aliases): Update output.
5633
5634 2006-06-27 Akim Demaille <akim@epita.fr>
5635
5636 * doc/Doxyfile.in: New.
5637 * doc/Makefile.am: Use it.
5638 * src/lalr.h, src/symtab.h: Initial doxygenation.
5639
5640 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5641
5642 Don't miss %merge result type warnings just because the LHS types are
5643 declared after the %merge. This continues the effort of the previous
5644 patch.
5645 * src/reader.c (get_merge_function): Don't set the merger type yet.
5646 (record_merge_function_type): New function for setting the merger type
5647 and checking for clashes.
5648 (grammar_current_rule_merge_set): Set the location of the %merge for
5649 the current rule.
5650 (packgram): Invoke record_merge_function_type for each rule now that
5651 all symbol type declarations have been parsed.
5652 * src/reader.h (merger_list.type_declaration_location): New member
5653 storing the location of the first %merge from which the type for this
5654 merging function was derived.
5655 * src/symlist.h (symbol_list.merger_declaration_location): New member
5656 storing the location of a rule's %merge, if any.
5657 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5658 declared later): New test to catch the error fixed by the above patch.
5659
5660 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5661
5662 Get action warnings (grammar_rule_check) right even when symbol
5663 declarations appear after the rules. Discussed at
5664 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5665 and
5666 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5667 Don't mistake the type of $$ in a midrule to be that of its parent
5668 rule's $$.
5669 * src/reader.c (grammar_current_rule_end): Don't invoke
5670 grammar_rule_check yet since not all symbol declarations may have been
5671 parsed yet.
5672 (grammar_midrule_action): Likewise.
5673 Don't record whether the midrule's $$ has been used yet since actions
5674 haven't been translated yet.
5675 Record the midrule's parent rule and its RHS index within the parent
5676 rule.
5677 (grammar_current_rule_action_append): Don't translate the action yet
5678 since not all symbol declarations may have been parsed yet and, thus,
5679 warnings about types for $$, $n, @$, and @n can't be reported yet.
5680 (packgram): Translate the action and invoke grammar_rule_check now that
5681 all symbol declarations have been parsed.
5682 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5683 after parsing the entire grammar file, the symbol list here in the case
5684 of a midrule is actually the midrule's empty RHS, so reference its
5685 parent rule's RHS where necessary.
5686 On the other hand, now that you can already know it's a midrule, you
5687 aren't forced to think $$ has the same type as its parent rule's $$.
5688 (handle_action_at): In the case of a midrule, reference the parent rule
5689 where necessary.
5690 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5691 members.
5692 (symbol_list_length): Now that this is invoked after all rules have
5693 been parsed, a NULL symbol (rather than a NULL symbol list node)
5694 terminates a rule. symbol_list_print already does this correctly.
5695 * src/symlist.h (symbol_list.midrule_parent_rule,
5696 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5697 remember their relationships with their parents.
5698 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5699 fixed by the above patch.
5700 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5701 implementing...
5702 (Unused values): ... this old test case and...
5703 (Unused values before symbol declarations): ... this new test case.
5704 This one is the same as `Unused values' except that all symbol
5705 declarations appear after the rules in order to catch the rest of the
5706 errors fixed by the above patch.
5707
5708 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5709
5710 More cleanup.
5711 * src/reader.c (current_rule): Declare it static since it's no longer
5712 used outside this file.
5713 (grammar_current_rule_action_append): Remove redundant arguments from
5714 translate_rule_action invocation.
5715 * src/reader.h (current_rule): Remove this unused extern.
5716 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5717 * src/scan-code.l (translate_rule_action): Likewise.
5718
5719 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5720
5721 Clean up yesterday's patch.
5722 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5723 to...
5724 * src/reader.c (grammar_current_rule_action_append): ... here for
5725 consistency with grammar_current_rule_symbol_append.
5726 * tests/regression.at (Braced code in declaration in rules section):
5727 Make yyerror and yylex static as usual.
5728
5729 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5730
5731 Fix bug that mistakes braced code in a declaration in the rules section
5732 to be a rule action. Mentioned at
5733 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5734 * src/scan-gram.l: Move midrule action detection from the start of the
5735 scanning of any braced code to...
5736 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5737 action. For readability, use $2 and @2 rather than the equivalent
5738 global variables.
5739 * tests/regression.at (Braced code in declaration in rules section):
5740 New test to catch the error fixed by the above patch.
5741
5742 Work on code readability some.
5743 * src/scan-code.l (current_rule): Get rid of this misleading and
5744 redundant declaration: it's actually extern'ed in reader.h.
5745 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5746 translate_action): Add a rule argument and use it instead of the global
5747 current_rule.
5748 (translate_rule_action): This already receives current_rule through an
5749 argument, so pass it on to translate_action instead of assigning
5750 current_rule to current_rule.
5751 (translate_symbol_action, translate_code): Pass rule = NULL to
5752 translate_action.
5753
5754 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5755
5756 Rename %before-definitions to %start-header and %after-definitions to
5757 %end-header. Don't use these declarations to separate pre-prologue
5758 blocks from post-prologue blocks. Add new order-independent
5759 declarations %before-header and %after-header as alternatives to the
5760 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5761 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5762 * NEWS (2.3+): Update for these changes.
5763 * data/glr.c (b4_before_definitions): Update to...
5764 (b4_start_header): ... this.
5765 (b4_after_definitions): Update to...
5766 (b4_end_header): ... this.
5767 * data/glr.cc: Likewise.
5768 * data/lalr1.cc: Likewise.
5769 * data/yacc.c: Likewise.
5770 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5771 prologue blocks with %*-header declarations.
5772 (Calc++ Parser): Likewise.
5773 (Decl Summary): Update names.
5774 (Table of Symbols): Update description.
5775 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5776 (PERCENT_END_HEADER): ... this.
5777 (PERCENT_BEFORE_DEFINITIONS): Update to...
5778 (PERCENT_START_HEADER): ... this.
5779 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5780 (declaration): Update token names and m4 macro names.
5781 When parsing %end-header and %start-header, invoke translate_code
5782 before muscle_code_grow, and no longer set global booleans to remember
5783 whether these declarations have been seen.
5784 Parse new %after-header and %before-header.
5785 * src/reader.c (before_definitions, after_definitions): Remove.
5786 (prologue_augment): Accept a new bool argument to specify whether to
5787 augment the pre-prologue or post-prologue.
5788 * src/reader.h (before_definitions, after_definitions): Remove these
5789 extern's.
5790 (prologue_augment): Add new bool argument.
5791 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5792 (PERCENT_END_HEADER): ... this.
5793 (PERCENT_BEFORE_DEFINITIONS): Update to...
5794 (PERCENT_START_HEADER): ... this.
5795 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5796 * tests/actions.at (Printers and Destructors): Update names.
5797
5798 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5799
5800 Add comparison operators for C++ location classes. Discussed at
5801 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5802 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5803 declaration indicating whether filename_type has an operator==. If
5804 filename_type is `std::string', it defaults to `1', `0' otherwise.
5805 * data/location.cc: Iff b4_define_location_comparison is `1', add
5806 operator== and operator!= for class position and for class location.
5807
5808 Some minor fixes.
5809 * src/scan-action.l: Remove unused file.
5810 * src/symtab.c (symbol_printer_set): Use printer_location not
5811 destructor_location.
5812 * src/symtab.h (struct symbol): Replace incorrect source comment for
5813 printer members.
5814 * tests/input.at (Incompatible Aliases): Update output with correct
5815 printer location.
5816
5817 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5818
5819 Don't put the pre-prologue in the header file. For the yacc.c code
5820 file and the glr.c header and code files, move the pre-prologue before
5821 the token definitions. Add new %before-definitions and
5822 %after-definitions to declare code that will go in both the header file
5823 and code file. Discussed at
5824 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5825 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5826 and
5827 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5828 * NEWS (2.3+): Describe these changes.
5829 * data/glr.c (b4_pre_prologue): Move from within to before...
5830 (b4_shared_declarations): ... this.
5831 Add new b4_before_definitions before b4_token_enums.
5832 Add new b4_after_definitions at the end.
5833 * data/glr.cc (b4_pre_prologue): Replace with...
5834 (b4_before_definitions): ... this in the header file.
5835 (b4_after_definitions): New near the end of the header file.
5836 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5837 code file right before including the header file.
5838 (b4_before_definitions): New in the previous position of
5839 b4_pre_prologue in the header file.
5840 (b4_after_definitions): New near the end of the header file.
5841 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5842 (b4_token_enums_defines): In the code file, move to right before
5843 YYSTYPE for consistency with the header file.
5844 (b4_before_definitions): New right before b4_token_enums_defines in
5845 both the header and code file.
5846 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5847 header and code file.
5848 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5849 of prologues for %union dependencies.
5850 (Decl Summary): In %defines description, mention the effect of
5851 %before-definitions and %after-definitions on the header file.
5852 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5853 than in the pre-prologue so that make check succeeds.
5854 (Table of Symbols): Add entries for %before-definitions and
5855 %after-definitions.
5856 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5857 %before-definitions.
5858 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5859 (declaration): Parse those declarations and append to
5860 b4_before_definitions and b4_after_definitions, respectively.
5861 * src/reader.c (before_definitions, after_definitions): New bools to
5862 track whether those declarations have been seen.
5863 (prologue_augment): Add to the post-prologue if %union,
5864 %before-definitions, or %after-definitions has been seen.
5865 * src/reader.h (before_definitions, after_definitions): New extern's.
5866 * src/scan-gram.l: Scan the new declarations.
5867 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5868 prologue block in a %before-definitions or a %after-definitions based
5869 on whether the %union is declared.
5870 * tests/regression.at (Early token definitions with --yacc, Early token
5871 definitions without --yacc): Move tests for token definitions into the
5872 post-prologue since token names are no longer defined in the
5873 pre-prologue.
5874
5875 2006-06-20 Akim Demaille <akim@epita.fr>
5876
5877 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5878 (symbol_get): Use it.
5879 * src/parse-gram.y: Use it.
5880
5881 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5882
5883 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5884 build succeeds when configured with --enable-gcc-warnings.
5885
5886 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5887
5888 * src/parse-gram.y (char_name): New function.
5889 (CHAR, STRING, string_content): For %printer, properly escape.
5890 (ID): Prefer fputs to fprintf.
5891 (id): Reindent to be consistent with other rules.
5892 Properly quote char.
5893
5894 The Translation Project changed its way of publishing translations
5895 to maintainers. I haven't received any responses to my request
5896 for supporting the old way, or for documenting the new way. I
5897 have modified 'bootstrap' to use screen scraping
5898 (in this case, HTML scraping). This is unreliable and inelegant,
5899 but I don't see any better way. Yuck.
5900 * bootstrap (TP_URL, WGET_COMMAND): New vars.
5901 (get_translations): New function, which uses HTML scraping to
5902 deduce locations of latest translations.
5903 Use this function to grab both bison and bison-runtime .po files.
5904 Don't bother priming the pump for the runtime-po domain any more,
5905 as it's now translated better than bison is.
5906
5907 2006-06-19 Akim Demaille <akim@epita.fr>
5908
5909 * src/scan-gram.l: No longer "parse" things after `%union' until
5910 `{'. Rather, return a single "%union" token.
5911 No longer make symbols: return strings, and leave the conversion
5912 to symbols to the parser.
5913 (SC_PRE_CODE, token_type): Remove.
5914 * src/parse-gram.y (%union): New field `character'.
5915 Sort tokens.
5916 (CHAR): New token.
5917 (ID, ID_COLON): Now that the scanner no longer makes them
5918 identifiers, adjust all uses to invoke symbol_get.
5919 (id_colon): New, wraps the conversion from string to symbol.
5920 (%union): Accept a possible union_name.
5921 (symbol): Now can be a char.
5922 * data/c.m4 (b4_union_name): Leave a default value.
5923 * data/glr.c, data/yacc.c: Use it.
5924
5925 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
5926
5927 For associating token numbers with token names for "yacc.c", don't use
5928 #define statements unless `--yacc' is specified; always use enum
5929 yytokentype. Most important discussions start at:
5930 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
5931 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
5932 and
5933 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
5934 * NEWS (2.3+): Mention.
5935 * data/c.m4 (b4_yacc_if): New.
5936 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
5937 token #define's.
5938 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
5939 on token name definitions.
5940 * src/getargs.c (usage): Capitalize `Yacc' in English.
5941 * src/output.c (prepare): Define b4_yacc_flag.
5942 * tests/regression.at (Early token definitions): Test that tokens names
5943 are defined before the pre-prologue not just before the post-prologue.
5944 Remove this test case and copy to...
5945 (Early token definitions with --yacc): ... this to test #define's.
5946 (Early token definitions without --yacc): ... and this to test enums.
5947
5948 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
5949
5950 * NEWS: Reword the post-2.3 change to not be so optimistic about
5951 removing the old "look-ahead" spelling.
5952 Update previous look-ahead/lookahead change reports.
5953 * REFERENCES: look-ahead -> lookahead (since that's
5954 what he actually wrote).
5955 * doc/refcard.tex: look ahead -> lookahead,
5956 look-ahead -> lookahead
5957
5958 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
5959
5960 For consistency, use `lookahead' instead of `look-ahead' or
5961 `look_ahead'. Discussed starting at
5962 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
5963 and then at
5964 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
5965 * NEWS: For the next release, note the change to `--report'.
5966 * TODO, doc/bison.1: Update English.
5967 * doc/bison.texinfo: Update English.
5968 (Understanding Your Parser, Bison Options): Document as
5969 `--report=lookahead' rather than `--report=look-ahead'.
5970 * src/conflicts.c: Update English in comments.
5971 (lookahead_set): Rename from look_ahead_set.
5972 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
5973 (resolve_sr_conflict): Rename local look_ahead_tokens to
5974 lookahead_tokens, and update other uses.
5975 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
5976 count_rr_conflicts, conflicts_free): Update uses.
5977 * src/getargs.c (report_args): Move "lookahead" before alternate
5978 spellings.
5979 (report_types): Update uses.
5980 (usage): For `--report' usage description, state `lookahead' spelling
5981 rather than `look-ahead'.
5982 * src/getargs.h (report.report_lookahead_tokens): Rename from
5983 report_look_ahead_tokens.
5984 * src/lalr.c: Update English in comments.
5985 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
5986 (state_lookahead_tokens_count): Rename from
5987 state_look_ahead_tokens_count.
5988 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5989 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
5990 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5991 Update other uses.
5992 Update English in output.
5993 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
5994 * src/print.c: Update English in comments.
5995 (lookahead_set): Rename from look_ahead_set.
5996 (print_reduction): Rename argument lookahead_token from
5997 look_ahead_token.
5998 (print_core, state_default_rule, print_reductions, print_results):
5999 Update uses.
6000 * src/print_graph.c: Update English in comments.
6001 (print_core): Update uses.
6002 * src/state.c: Update English in comments.
6003 (reductions_new): Update uses.
6004 (state_rule_lookahead_tokens_print): Rename from
6005 state_rule_look_ahead_tokens_print, and update other uses.
6006 * src/state.h: Update English in comments.
6007 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6008 (state_rule_lookahead_tokens_print): Rename from
6009 state_rule_look_ahead_tokens_print.
6010 * src/tables.c: Update English in comments.
6011 (conflict_row, action_row): Update uses.
6012 * tests/glr-regression.at
6013 (Incorrect lookahead during deterministic GLR,
6014 Incorrect lookahead during nondeterministic GLR): Rename
6015 print_look_ahead to print_lookahead.
6016 * tests/torture.at: Update English in comments.
6017 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6018 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6019 (Many lookahead tokens): Update uses.
6020 * data/glr.c: Update English in comments.
6021 * lalr1.cc: Likewise.
6022 * yacc.c: Likewise.
6023 * src/conflicts.h: Likewise.
6024 * src/lalr.h: Likewise.
6025 * src/main.c: Likewise.
6026 * src/output.c: Likewise.
6027 * src/parse-gram.c: Likewise.
6028 * src/tables.h: Likewise.
6029 * tests/calc.at: Likewise.
6030
6031 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6032
6033 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6034
6035 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6036
6037 * TODO: Add request from Nelson H. F. Beebe to be able to install
6038 Bison without installing the yacc script.
6039
6040 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6041
6042 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6043 and yytext if they're already #define'd.
6044 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6045 * src/scan-code-c.c: ... here.
6046 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6047 <config.h>.
6048
6049 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6050
6051 Get Bison to build again when configured with --enable-gcc-warnings.
6052 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6053 missing #include's.
6054 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6055 loc argument as it shadows a global.
6056 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6057 invocation.
6058
6059 * src/.cvsignore: Add scan-code.c.
6060
6061 2006-06-07 Akim Demaille <akim@epita.fr>
6062
6063 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6064 to...
6065 * src/scan-code.l: here.
6066 * tests/input.at (Torturing the Scanner): Fix another location
6067 error.
6068
6069 2006-06-07 Akim Demaille <akim@epita.fr>
6070
6071 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6072
6073 2006-06-06 Akim Demaille <akim@epita.fr>
6074
6075 Extract the parsing of user actions from the grammar scanner.
6076 As a consequence, the relation between the grammar scanner and
6077 parser is much simpler. We can also split "composite tokens" back
6078 into simple tokens.
6079 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6080 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6081 rename as...
6082 * src/location.h, src/location.c (add_column_width)
6083 (location_compute): these.
6084 Fix the column count: the initial column is 0.
6085 (location_print): Be robust to ending column being 0.
6086 * src/location.h (boundary_set): New.
6087 * src/main.c: Adjust to scanner_free being renamed as
6088 gram_scanner_free.
6089 * src/output.c: Include scan-code.h.
6090 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6091 Use boundary_set.
6092 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6093 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6094 which is now, again, a separate token.
6095 Adjust all dependencies.
6096 Whereever actions with $ and @ are used, use translate_code.
6097 (action): Remove this nonterminal which is now useless.
6098 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6099 (grammar_current_rule_action_append): Use translate_code.
6100 (packgram): Bound check ruleno, itemno, and rule_length.
6101 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6102 (last_string, last_braced_code_loc, max_left_semantic_context)
6103 (scanner_initialize, scanner_free, scanner_last_string_free)
6104 (gram_out, gram_lineno, YY_DECL_): Move to...
6105 * src/scan-gram.h: this new file.
6106 (YY_DECL): Rename as...
6107 (GRAM_DECL): this.
6108 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6109 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6110 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6111 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6112 Move these declarations, and...
6113 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6114 these to...
6115 * src/flex-scanner.h: this new file.
6116 * src/scan-gram.l (rule_length, rule_length_overflow)
6117 (increment_rule_length): Remove.
6118 (last_braced_code_loc): Rename as...
6119 (gram_last_braced_code_loc): this.
6120 Adjust to the changes of the parser.
6121 Move all the handling of $ and @ into...
6122 * src/scan-code.l: here.
6123 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6124 (handle_action_dollar, handle_action_at): Move to...
6125 * src/scan-code.l: here.
6126 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6127 scan-code.h, scan-code-c.c, scan-gram.h.
6128 (EXTRA_bison_SOURCES): Add scan-code.l.
6129 (BUILT_SOURCES): Add scan-code.c.
6130 (yacc): Be robust to white spaces.
6131
6132 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6133 * tests/regression.at: Adjust the column numbers.
6134 * tests/regression.at: Adjust the error message.
6135
6136 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6137
6138 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6139 Use Akim's wording from
6140 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6141
6142 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6143
6144 Between Bison releases, manually append `+' to the previous Bison
6145 release number, and use that as a signal to automatically print the
6146 ChangeLog's CVS Id keyword from --version. Discussed starting at
6147 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6148 * ChangeLog: Add Id header.
6149 * configure.ac (AC_INIT): Append `+' to `2.3'.
6150 * src/.cvsignore: Add revision.c.
6151 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6152 (BUILT_SOURCES): Add revision.c.
6153 (revision.c): New target rule. This file defines a new global variable
6154 named revision. It initializes it with either the Id from ChangeLog
6155 or, if VERSION doesn't contain `+', with the empty string.
6156 * src/getargs.c (version): Print the value of revision.
6157 * src/revision.h: Extern revision.
6158
6159 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6160
6161 * NEWS: Version 2.3.
6162 * configure.ac (AC_INIT): Likewise.
6163
6164 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6165
6166 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6167 with no arguments, not as an object-like macro. This is for
6168 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6169 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6170 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6171 Document this.
6172
6173 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6174
6175 * src/getargs.c (usage): Back out yesterday's modification of the
6176 --help output so that we don't have to wait for translation before
6177 releasing 2.3.
6178
6179 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6180
6181 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6182 Problem reported by Akim Demaille.
6183
6184 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6185
6186 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6187
6188 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6189
6190 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6191 generated source code. Problem reported by Frans Englich in
6192 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6193
6194 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6195
6196 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6197 shell, not within 'make', so that 'make' by an ordinary builder
6198 (using GNU make) does not worry about configuring gzip. This also
6199 works around a bug reported independently by Keith Thompson and by
6200 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6201 stderr rather than stdout, messing up the build logs.
6202
6203 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6204
6205 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6206 to make sure that YYID will never be unused. This fixes a 'make
6207 maintainer-check' failure caused by the recent changes to the 'Trivial
6208 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6209 not used.
6210 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6211
6212 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6213
6214 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6215 state before an empty RHS is always resolved here. Only the location
6216 of that state is guaranteed to be resolved, and that's enough. This
6217 fixes the remaining bug reported by Derek M. Jones in
6218 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6219 * tests/glr-regression.at (Uninitialized location when reporting
6220 ambiguity): Test the above case.
6221 Also, the embedded comments in this test case claim it checks the case
6222 of an empty RHS that has inherited the initial location. However, the
6223 corresponding LHS was already resolved, so yyresolveLocations didn't
6224 actually have reason to modify it. Fix this by forcing
6225 nondeterministic operation at the beginning of the parse.
6226
6227 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6228
6229 * data/c.m4 (b4_yy_symbol_print_generate):
6230 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6231 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6232 of the bugs reported today by Derek M Jones in
6233 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6234 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6235 defined to be a type name without parens or brackets.
6236 (Location Type): Similarly for YYLTYPE.
6237 * tests/regression.at (Trivial grammars): Put in a test for this
6238 bug that will be caught by 'make maintainer-check' (though not,
6239 alas, by 'make check' unless your compiler is picky).
6240
6241 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6242
6243 * NEWS: Version 2.2.
6244 * configure.ac (AC_INIT): Likewise.
6245
6246 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6247
6248 * data/glr.c (yyreportTree): Make room in yystates for the state
6249 preceding the RHS. This fixes the segmentation fault reported by Derek
6250 M. Jones in
6251 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6252 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6253 to the user. Reported for yyreportTree by Derek M. Jones later in the
6254 same thread.
6255 * THANKS: Add Derek M. Jones.
6256 Update my email address.
6257 Fix typo in Steve Murphy's name.
6258
6259 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6260
6261 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6262 checking against YYLAST that caused the parser to miss a potential
6263 alternative in its diagnostic.
6264 Problem reported by Maria Jose Moron Fernandez in
6265 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6266 * data/lalr1.cc (yysyntax_error_): Likewise.
6267 * data/yacc.c (yysyntax_error): Likewise.
6268 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6269 tokens, in case we run into an older C compiler.
6270 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6271 Use them to check for the off-by-one error fixed above.
6272
6273 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6274 YYSIZE_T, not size_t.
6275 * tests/regression.at (Trivial grammars): New test, to catch
6276 the error fixed by the above patch.
6277
6278 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6279
6280 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6281 scheme.
6282 Reported by Steve Murphy.
6283
6284 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6285
6286 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6287 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6288
6289 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6290
6291 Implement --trace=m4.
6292 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6293 * src/output.c (output_skeleton): When set, pass -dV to m4.
6294
6295 Factor the handling of flags in m4.
6296 * src/output.c (prepare): Rename the muscle names debug, defines,
6297 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6298 * data/c.m4: Adjust.
6299 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6300 Use b4_define_flag_if to define other b4_FLAG_if macros.
6301 (b4_location_if): As a consequence, rename as...
6302 (b4_locations_if): this, for consistency.
6303 Adjust all the skeletons.
6304
6305 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6306
6307 * etc/bench.pm: Shorten bench names.
6308
6309 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6310
6311 * src/output.h, src/output.c (error_verbose): Move to...
6312 * src/getargs.h, src/getargs.c: here.
6313 Sort the flags.
6314 Adjust dependencies.
6315
6316 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6317
6318 * data/c.m4 (b4_copyright): Put the special exception for Bison
6319 skeletons here, so we don't have to put it in each skeleton. All
6320 uses changed. Suggested by Akim Demaille. Also, wrap the
6321 copyright notice, in case it is longer than 80 columns. Replace
6322 comma by newline after title.
6323
6324 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6325
6326 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6327 incompatibility, not a bug. Mention that it wasn't fixed as of
6328 flex 2.5.33.
6329
6330 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6331
6332 * examples/extexi: Enforce the precedence of concatenation over
6333 >>.
6334 Reported by Tommy Nordgren.
6335
6336 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6337
6338 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6339 with the member "token".
6340 Reported by Martin Nylin.
6341
6342 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6343
6344 * data/glr.c: Switch to Bison 2.2 special-exception language in
6345 the copyright notice. Use more-regular format for titles and
6346 copyright notices.
6347 * data/glr.cc: Likewise.
6348 * data/location.cc: Likewise.
6349 * data/yacc.cc: Likewise.
6350 * doc/bison.texinfo (Conditions): Document this.
6351 * NEWS: likewise. Upgrade version to 2.2.
6352
6353 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
6354
6355 * data/glr.cc: Remove dead code.
6356
6357 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6358
6359 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6360 that variable and the line breaks the bootstrap. Problem reported
6361 by Juan M. Guerrero.
6362
6363 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6364
6365 * doc/bison.texinfo (Multiple start-symbols): New.
6366
6367 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6368
6369 * etc/README, etc/bench.pl: New.
6370
6371 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
6372
6373 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6374 rule.
6375 Reported by Mickael Labau.
6376 * tests/input.at (Torturing the Scanner): Test it.
6377
6378 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6379
6380 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6381 Problem reported by Bob Rossi.
6382
6383 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6384
6385 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6386 and didn't really work.
6387 For the index, use @ifnotinfo, not @iftex.
6388 Minor cleanups of spacing and terminology.
6389
6390 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6391
6392 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6393 of AT_NAME_PREFIX when %name-prefix is not used.
6394
6395 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6396
6397 Apply --prefix to C++ skeletons too: they change the namespace.
6398 The test suite already exercize these cases.
6399 * data/c++.m4 (b4_namespace): New.
6400 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6401 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6402 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6403 * doc/bison.texinfo: Document it.
6404 (Option Cross Key): Use @multitable in all formats. It looks
6405 nicer, even in TeX outputs.
6406 (Rules): Use the same code whatever the output type is.
6407 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6408 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6409 * tests/calc.at: Use it, instead of hard coding `yy'.
6410
6411 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6412
6413 * TODO: Remove dead items.
6414
6415 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6416
6417 * doc/FAQ: Remove, merged into...
6418 * doc/bison.texinfo (FAQ): this.
6419 * doc/Makefile.am (EXTRA_DIST): Adjust.
6420
6421 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6422
6423 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6424 even if empty.
6425 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6426 * doc/bison.texinfo (Calc++ Scanner): Use it.
6427
6428 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6429
6430 Fix two nits reported by twlevo, plus one more that I discovered.
6431
6432 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6433 this is the usual Bison style.
6434 * src/location.h (location_print): Likewise.
6435
6436 * src/reader.h (token_name): Likewise.
6437
6438 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6439
6440 Fix some nits reported by twlevo.
6441 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6442 and "POSIX". Use more-modern syntax for URLs. Mention C++
6443 and ask for Java. Don't hardwire OS version numbers. Add
6444 copyright notice.
6445 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6446 * src/conflicts.c (solved_conflicts_obstack): Now static.
6447
6448 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6449
6450 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6451 page. Say "you can use it" not "you may use it" as on the web page;
6452 we're describing capabilities not granting permission.
6453
6454 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6455
6456 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6457 shadowing warnings. Use usual patter for iterating through RHS.
6458 * tests/glr-regression.at
6459 (Uninitialized location when reporting ambiguity):
6460 Modify yylex so that it uses its argument, rather than trying
6461 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6462 const char -> char const.
6463
6464 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6465 Don't use tabs inside commands; it messes up 'ps'.
6466 Problem reported by twlevo.
6467
6468 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6469
6470 * tests/glr-regression.at (Uninitialized location when reporting
6471 ambiguity): New test case.
6472 * data/glr.c (yyresolveLocations): New function, which uses
6473 YYLLOC_DEFAULT.
6474 (yyresolveValue): Invoke yyresolveLocations before reporting an
6475 ambiguity.
6476 * doc/bison.texinfo (Default Action for Locations): Note
6477 YYLLOC_DEFAULT's usage for ambiguity locations.
6478 (GLR Semantic Actions): Cross-reference those notes.
6479
6480 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6481
6482 * tests/glr-regression.at (Leaked semantic values when reporting
6483 ambiguity): Remove unnecessary union and type declarations.
6484 (Leaked lookahead after nondeterministic parse syntax error): New test
6485 case.
6486 * data/glr.c (yyparse): Check for zero stacks remaining before
6487 attempting to shift the lookahead so that you don't lose it.
6488
6489 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6490
6491 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6492 * tests/glr-regression.at (Leaked semantic values when reporting
6493 ambiguity): New test case.
6494 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6495 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6496 now unnecessary yystackp parameter.
6497 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6498 destructors can be called.
6499
6500 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6501 in existing testcases.
6502
6503 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6504
6505 Don't leak semantic values for parent RHS when a user action cuts the
6506 parser, and clean up related code a bit.
6507 * tests/glr-regression.at (Leaked merged semantic value if user action
6508 cuts parse): Rename to...
6509 (Leaked semantic values if user action cuts parse): ... this. Add check
6510 for leaked parent RHS values.
6511 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6512 between an unresolved state (non-empty chain of semantic options) and
6513 an incomplete one (signaled by an empty chain).
6514 (yyresolveStates): Document the interface. Move all manipulation of a
6515 successfully or unsuccessfully resolved yyGLRState to...
6516 (yyresolveValue): ... here so that yyresolveValue always leaves a
6517 yyGLRState with consistent data and thus is easier to understand.
6518 Remove the yyvalp and yylocp parameters since they are always just
6519 taken from the yys parameter. When reporting a discarded merged value
6520 in debugging output, note that it is incompletely merged. Document the
6521 interface.
6522 (yyresolveAction): If resolving any of the RHS states fails, destroy
6523 them all rather than leaking them. Thus, as long as user actions are
6524 written to clean up the RHS correctly, yyresolveAction always cleans up
6525 the RHS of a semantic option. Document the interface.
6526
6527 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6528
6529 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6530 led to a segmentation fault in GNU Pascal. Problem reported
6531 by Waldek Hebisch.
6532
6533 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6534
6535 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6536 mid-rule action inside a nonterminal symbol in order to declare a
6537 destructor for its semantic value.
6538
6539 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6540
6541 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6542 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6543 __cplusplus && ! defined _STDLIB_H && !
6544 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6545 defined free))]: Include <stdlib.h> rather than rolling our own
6546 declarations of malloc and free, to avoid problems with
6547 incompatible declarations (using 'throw') C++'s stdlib.h. This
6548 should fix Debian bug 340012
6549 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6550 reported by Guillaume Melquiond.
6551
6552 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6553
6554 * NEWS: Clarify symbols versus types in unused-value warnings.
6555
6556 * configure.ac (AC_INIT): Bump version number.
6557
6558 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6559
6560 * NEWS: Version 2.1a.
6561 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6562 since C99 requires this.
6563
6564 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6565
6566 * m4/c-working.m4: New file.
6567 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6568
6569 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6570
6571 * Makefile.maint: Merge from coreutils.
6572
6573 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6574
6575 More portability fixes for problems summarized by Nelson H. F. Beebe.
6576
6577 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6578 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6579 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6580 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6581 messes up because C++ code is compiled in 32-bit mode but linked
6582 in 64-bit mode.
6583
6584 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6585
6586 More portability fixes for problems summarized by Nelson H. F. Beebe.
6587
6588 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6589 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6590
6591 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6592 nodist_PROGRAMS, since we don't need to actually compile the
6593 example if we're just doing a plain 'make'. This avoids bothering
6594 the installer unnecessarily about problems due to weird C++
6595 compilers.
6596
6597 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6598
6599 More portability fixes for problems summarized by Nelson H. F. Beebe.
6600
6601 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6602 than #include "...", and compile with -I'.'. The old method was
6603 not portable, according to Posix and the C standard, and it does
6604 not work with Sun C 5.7, where previous #line directives affect
6605 the working directory used in later #include "..." directives.
6606
6607 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6608
6609 Various DJGGP specific issues in /djgpp
6610
6611 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6612
6613 More portability fixes for problems summarized by Nelson H. F. Beebe.
6614
6615 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6616 '#include <map>' works and that you can apply ++ to iterators.
6617
6618 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6619
6620 Work around portability problems summarized by Nelson H. F. Beebe in
6621 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6622
6623 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6624 that '#include <string>' works.
6625
6626 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6627 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6628 "warning: sorry: semantics of inline function static data `const
6629 unsigned char translate_table[262]' are wrong (you'll wind up with
6630 multiple copies)".
6631
6632 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6633 or, xor to not_, and_, or_, and xor_, respectively. This works
6634 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6635 random system header somewhere that includes the equivalent of
6636 <iso646.h>.
6637
6638 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6639 -E" works; it apparently doesn't work with PathScale EKO Compiler
6640 Suite Version 2.0.
6641
6642 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6643
6644 During deterministic GLR operation, user actions should be able to
6645 influence the parse by changing yychar. To make this easier to fix and
6646 to make glr.c easier to evolve in general, don't maintain yytoken in
6647 parallel with yychar; just compute yytoken when needed.
6648 * tests/glr-regression.at (Incorrect lookahead during deterministic
6649 GLR): Check that setting yychar in a user action has the intended
6650 effect.
6651 * data/glr.c (yyGLRStack): Remove yytokenp member.
6652 (yyclearin): Don't set *yytokenp.
6653 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6654 yychar rather than *yytokenp to determine the current lookahead.
6655 Compute yytoken locally when needed.
6656 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6657 point to.
6658
6659 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6660 after `--report' documentation.
6661
6662 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6663
6664 * src/parse-gram.y (grammar_declaration): Location of printer
6665 symbol is @1, not list->location. Bug reported by twlevo.
6666 * tests/input.at (Incompatible Aliases): Adjust to above change.
6667
6668 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6669
6670 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6671 all the test at once. This makes the output easier to read in the
6672 normal case.
6673
6674 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6675 got from <http://bro-ids.org/download.html>. The bug is that
6676 when two actions appeared in succession, the second one was
6677 scanned before the first one was added to the grammar rule
6678 as a midrule action. Bison then output the incorrect warning
6679 "parse.y:905.17-906.36: warning: unused value: $3".
6680 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6681 associated with a value.
6682 (rhs): Don't invoke grammar_current_rule_action_append.
6683 (action): Invoke it here instead.
6684 * src/reader.c (grammar_midrule_action): Now extern.
6685 (grammar_current_rule_action_append): Don't invoke
6686 grammar_midrule_action; that is now the scanner's job.
6687 * src/reader.h (last_string, last_braced_code_loc):
6688 (grammar_midrule_action): New decls.
6689 * src/scan-gram.l (last_string): Now extern, sigh.
6690 (last_braced_code_loc): New extern variable.
6691 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6692 rule already has an action.
6693 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6694 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6695 Add some tests to check that the above changes fixed the bug.
6696
6697 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6698
6699 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6700 All used changed. Check whether the symbol has a destructor,
6701 not whether it is typed.
6702 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6703 that the values are still reported as unused. All line numbers
6704 adjusted.
6705
6706 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6707
6708 Work around a bug in bro 0.8, which underparenthesizes its
6709 definition of YYLLOC_DEFAULT.
6710 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6711 their arguments.
6712 * data/lalr1.cc: Likewise.
6713 * data/yacc.cc: Likewise.
6714
6715 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6716
6717 Work around a bug in Pike 7.0, and give the Pike folks a
6718 better way to override the usual int widths.
6719 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6720 user can override the types.
6721 (short): #undef, to work around a bug in Pike 7.0.
6722 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6723 (union yyalloc.yyss): Use yytype_int16 rather than short.
6724 All uses changed.
6725 (yysigned_char): Remove.
6726 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6727 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6728 * tests/regression.at (Web2c Actions): Adjust to above changes.
6729
6730 * src/reader.c (check_and_convert_grammar): New function.
6731 (reader): Close the input file even if something went wrong during
6732 parsing. Minor file descriptor leak reported by twlevo.
6733
6734 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6735 to pacify gcc -Wswitch-default.
6736 * src/scan-gram.l (adjust_location): Use a default: break; case
6737 to pacify gcc -Wswitch-default.
6738 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6739 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6740 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6741 Move these decls to scan-skel.l, since they don't need to be
6742 visible elsewhere.
6743 * src/scan-skel.l: Accept the above decls.
6744 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6745 is used.
6746
6747 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6748
6749 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6750 since we don't want to insist on a version number at the start
6751 of the changelog every time.
6752 * Makefile.maint: Sync from coreutils a bit better.
6753 (sc_trailing_blank): Renamed from sc_trailing_space.
6754 All uses changed.
6755 (sc_no_if_have_config_h, sc_require_config_h):
6756 (sc_prohibit_assert_without_use): New rules.
6757 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6758 (sc_dd_max_sym_length): Fix leading spaces in rule.
6759 (sc_system_h_headers): Prefix with @.
6760 (sc_useless_cpp_parens, m4-check): Output line numbers.
6761 (changelog-check): Allow version only in head.
6762 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6763 satisfy new Makefile.maint rule.
6764 * data/glr.c: Likewise.
6765 * data/glr.cc: Likewise.
6766 * data/lalr1.cc: Likewise.
6767 * data/yacc.c: Likewise.
6768 * lib/ebitsetv.c: Likewise.
6769 * lib/lbitset.c: Likewise.
6770 * lib/subpipe.c: Likewise.
6771 * lib/timevar.c: Likewise.
6772 * src/system.h: Likewise.
6773 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6774 * djgpp/Makefile.maint: Add copyright notice.
6775 * djgpp/README.in: Likewise.
6776 * djgpp/config.bat: Likewise.
6777 * djgpp/config.site: Likewise.
6778 * djgpp/config_h.sed: Likewise.
6779 * djgpp/djunpack.bat: Likewise.
6780 * djgpp/config.sed: Fix copyright notice to match standard format.
6781 * djgpp/subpipe.h: Likewise.
6782 * lib/bitsetv-print.c: Likewise.
6783 * lib/bitsetv.c: Likewise.
6784 * lib/subpipe.h: Likewise.
6785 * lib/timevar.c: Likewise.
6786 * lib/timevar.h: Likewise.
6787 * djgpp/subpipe.c: Use standard recipe for config.h.
6788 * lib/abitset.c: Likewise.
6789 * lib/bitset.c: Likewise.
6790 * lib/bitset_stats.c: Likewise.
6791 * lib/bitsetv-print.c: Likewise.
6792 * lib/bitsetv.c: Likewise.
6793 * lib/ebitsetv.c: Likewise.
6794 * lib/get-errno.c: Likewise.
6795 * lib/lbitset.c: Likewise.
6796 * lib/subpipe.c: Likewise.
6797 * lib/timevar.c: Likewise.
6798 * lib/vbitset.c: Likewise.
6799 * tests/local.at: Likewise.
6800 * src/scan-gram.l: Don't include verify.h, since system.h does
6801 that for us.
6802 * .x-sc_require_config_h: New file.
6803 * .x-sc_unmarked_diagnostics: New file.
6804
6805 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6806
6807 Be a bit more systematic about using 'abort'.
6808 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6809 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6810 Put 'default: abort ();' before some other case, to satisfy older
6811 pedantic compilers.
6812 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6813 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6814 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6815 * src/conflicts.c (resolve_sr_conflict): Likewise.
6816 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6817 (get_decision_str, get_orientation_str, get_node_alignment_str):
6818 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6819 (get_linestyle_str, get_arrowstyle_str): Likewise.
6820 * src/conflicts.c (resolve_sr_conflict):
6821 Use a default case rather than one for the one remaining enum
6822 value, to catch invalid enum values as well.
6823 * src/lalr.c (set_goto_map, map_goto):
6824 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6825 * src/nullable.c (nullable_compute, token_definitions_output):
6826 Likewise.
6827 * src/reader.c (packgram, reader): Likewise.
6828 * src/state.c (transitions_to, state_new, state_reduction_find):
6829 Likewise.
6830 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6831 (symbol_pack): Likewise.
6832 * src/tables.c (conflict_row, pack_vector): Likewise.
6833 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6834 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
6835 * src/system.h: Don't include <assert.h>.
6836 (assert): New macro.
6837
6838 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6839 (Destructor Decl, Parser Function, Pure Calling):
6840 Describe rules for braces inside C code more carefully.
6841
6842 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6843
6844 Fix some porting glitches found by Nelson H. F. Beebe.
6845 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6846 compilers that don't understand that abort () does not return.
6847 * src/state.c (transitions_to): Likewise.
6848 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6849 that '#include <cstdlib>' works.
6850 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6851 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6852 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6853 for the benefit of some pre-C99 compilers.
6854
6855 * bootstrap: Undo changes to gnulib files that autoreconf made.
6856
6857 Minor fixups to get 'make maintainer-check' to work.
6858 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6859 with the new verify.h implementation.
6860 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6861 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6862 * data/yacc.c (YYUSE): Likewise.
6863 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6864 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6865 * src/parse-gram.y (declaration): Don't pass a string constant
6866 to a function that expects char *, since GCC might complain
6867 about the constant value.
6868 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6869 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6870 before #defining them.
6871 * tests/glr-regression.at
6872 (Incorrectly initialized location for empty right-hand side in GLR):
6873 In yyerror, use the msg arg.
6874 (Corrupted semantic options if user action cuts parse):
6875 (Incorrect lookahead during deterministic GLR):
6876 (Incorrect lookahead during nondeterministic GLR):
6877 Don't name a local var 'index'; it shadows string.h's 'index'.
6878
6879 2006-01-19 Akim Demaille <akim@epita.fr>
6880
6881 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6882 location, not just parts of it.
6883
6884 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6885
6886 * NEWS: Document the fact that multiple %unions are now allowed.
6887 * doc/bison.texinfo (Union Decl): Likewise.
6888 * TODO: This feature is now implemented, so remove it from
6889 the wishlist.
6890
6891 * Makefile.maint: Merge with coreutils Makefile.maint.
6892 (CVS_LIST): Use build-aux version if available.
6893 (VERSION_REGEXP): New macro.
6894 (syntax-check-rules): Add sc_no_if_have_config_h,
6895 sc_prohibit_assert_without_use, sc_require_config_h,
6896 sc_useless_cpp_parens.
6897 (sc_obsolete_symbols): Check for O_NDELAY.
6898 (sc_dd_max_sym_length): Track coreutils.
6899 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6900 (sc_useless_cpp_parens): New rule.
6901 (news-date-check): Look for version or today's date.
6902 (changelog-check): Don't require version number near head.
6903 (copyright-check): Use current year instead of hardwiring 2005.
6904 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
6905 (announcement): Add --gpg-key-ID.
6906
6907 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
6908 with "file system".
6909
6910 Avoid undefined behavior that addressed just before the start of an
6911 array. Problem reported by twlevo.
6912 * src/reader.c (packgram): Prepend a new sentinel before ritem.
6913 * src/lalr.c (build_relations): Rely on new sentinel.
6914 * src/gram.c (gram_free): Adjust to new sentinel.
6915
6916 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
6917
6918 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
6919 yylookaheadNeeds. All uses updated.
6920 (yysplitStack): Rename local yynewLookaheadStatuses to
6921 yynewLookaheadNeeds.
6922 * data/glr-regression.at (Incorrect lookahead during nondeterministic
6923 GLR): In comments, change `lookahead status' to `lookahead need'.
6924
6925 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6926
6927 * data/glr.c (yysplitStack): A little stylistic rewrite.
6928
6929 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6930
6931 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
6932
6933 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
6934
6935 * doc/bison.texinfo: Fix some typos.
6936 (GLR Semantic Actions): New subsection discussing special
6937 considerations because GLR semantic actions might be deferred.
6938 (Actions): Mention look-ahead usage of yylval.
6939 (Actions and Locations): Mention look-ahead usage of yylloc.
6940 (Special Features for Use in Actions): Add YYEOF entry and mention it
6941 in the yychar entry.
6942 In the yychar entry, remove mention of the local yychar case (pure
6943 parser) since this is irrelevant information when writing semantic
6944 actions and since it's already discussed in `Table of Symbols' where
6945 yychar is otherwise described as an external variable.
6946 In the yychar entry, don't call it the `current' look-ahead since it
6947 isn't when semantic actions are deferred.
6948 In the yychar and yyclearin entries, add note about deferred semantic
6949 actions.
6950 Add yylloc and yylval entries discussing look-ahead usage.
6951 (Look-Ahead Tokens): When discussing yychar, don't call it the
6952 `current' look-ahead, and do mention yylval and yylloc.
6953 (Error Recovery): Cross-reference `Action Features' when mentioning
6954 yyclearin.
6955 (Table of Symbols): In the yychar entry, don't call it the `current'
6956 look-ahead.
6957 In the yylloc and yylval entries, mention look-ahead usage.
6958
6959 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6960
6961 * tests/glr-regression.at: Update copyright year to 2006.
6962
6963 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6964
6965 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
6966 use during nondeterministic operation to track which stacks have
6967 actually needed the current lookahead.
6968 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
6969 Allocate, deallocate, resize, and otherwise shuffle space for
6970 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
6971 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
6972 appropriately during nondeterministic operation.
6973 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
6974 members to store the current lookahead to be used by the deferred
6975 user action.
6976 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
6977 from which the RHS is taken. Set the lookahead members of the new
6978 yySemanticOption according to the lookahead status for stack yyk.
6979 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
6980 yyaddDeferredAction.
6981 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
6982 members of yySemanticOption before invoking yyuserAction, and then set
6983 them back to their current values afterward.
6984 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
6985 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
6986 * tests/glr-regression.at: Remove `.' from the ends of recent test case
6987 titles for consistency.
6988 (Leaked merged semantic value if user action cuts parse): In order to
6989 suppress lint warnings, use arguments in merge function, and assign
6990 char value < 128 in main.
6991 (Incorrect lookahead during deterministic GLR): New test case.
6992 (Incorrect lookahead during nondeterministic GLR): New test case.
6993
6994 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6995
6996 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
6997 !yyvaluep as signal that no semantic value is available to print.
6998 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
6999 to print a semantic value.
7000
7001 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7002
7003 * tests/glr-regression.at: For consistency with my newer test cases,
7004 don't thank myself.
7005
7006 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7007
7008 * data/glr.c (yyresolveValue): When merging semantic options, if at
7009 least one user action succeeds but a later one cuts the parse, then
7010 destroy the semantic value before returning rather than leaking it.
7011 (yyresolveStates): If a user action cuts the parse and thus
7012 yyresolveValue fails, ignore the (unset) semantic value rather than
7013 corrupting the yyGLRState, and empty the semantic options list since
7014 the user actions should have called all necessary destructors.
7015 Simplify code with YYCHK.
7016 * tests/glr-regression.at (Corrupted semantic options if user action
7017 cuts parse): New test case.
7018 (Undesirable destructors if user action cuts parse): New test case.
7019 Before applying any of this patch, this test case never actually failed
7020 for me... but only because the corrupted semantic options usually
7021 masked this bug.
7022 (Leaked merged semantic value if user action cuts parse): New test
7023 case.
7024
7025 2006-01-05 Akim Demaille <akim@epita.fr>
7026
7027 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7028
7029 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7030
7031 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7032 _MSC_VER. Problem reported by Cenzato Marco.
7033 (b4_c_function_def): Use it.
7034 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7035 b4_c_modern.
7036 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7037 than rolling our own.
7038
7039 2006-01-04 Akim Demaille <akim@epita.fr>
7040
7041 Also warn about non-used mid-rule values.
7042 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7043 member.
7044 (symbol_list_new): Adjust.
7045 * src/reader.c (symbol_typed_p): New.
7046 (grammar_rule_check): Use it.
7047 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7048 Check its rule.
7049 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7050 Use it.
7051 * tests/actions.at (Exotic Dollars): Adjust.
7052
7053 2006-01-04 Akim Demaille <akim@epita.fr>
7054
7055 * src/reader.c (grammar_midrule_action): If $$ is set in a
7056 mid-rule, move the `used' bit to its lhs.
7057 * tests/input.at (Unused values): New.
7058 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7059
7060 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7061
7062 * doc/bison.texinfo (Bison Options): Say more accurately what
7063 --yacc does.
7064 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7065 about declarations in the grammar when in Yacc mode, as POSIX does
7066 not require a diagnostic when the grammar uses extensions.
7067
7068 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7069
7070 Warn about dubious constructions like "%token T T".
7071 Reported by twlevo.
7072 * src/symtab.h (struct symbol.declared): New member.
7073 * src/symtab.c (symbol_new): Initialize it to false.
7074 (symbol_class_set): New arg DECLARING, specifying whether
7075 this is a declaration that we want to warn about, if there
7076 is more than one of them. All uses changed.
7077
7078 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7079 Allow multiple %union directives, whose contents concatenate.
7080 * src/parse-gram.y (grammar_declaration): Likewise.
7081 Use muscle_code_grow, so that we don't need stype_line any more.
7082 All uses changed.
7083
7084 * src/muscle_tab.c (muscle_grow): Fix comment.
7085
7086 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7087 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7088 Update copyright year to 2006.
7089
7090 2006-01-03 Akim Demaille <akim@epita.fr>
7091
7092 Have glr.cc pass (some of) the calc.at tests.
7093 * data/glr.cc (b4_parse_param_orig): New.
7094 (b4_parse_param): Improve its definition, and bound it more
7095 clearly in the skeleton.
7096 (b4_epilogue): Append, instead of prepending, in order to keep
7097 #line consistency.
7098 Simplify the generation of auxiliary functions: locations and
7099 purity are mandated.
7100 (b4_global_tokens_and_yystype): Honor it.
7101 * data/location.cc (c++.m4): Don't include it.
7102 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7103 and AT_SKEL_CC_IF.
7104 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7105 AT_LALR1_CC_IF.
7106 Be sure to initialize the first position's filename.
7107 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7108 mandated anyway.
7109 (AT_CHECK_CALC_GLR_CC): New.
7110 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7111
7112 2006-01-02 Akim Demaille <akim@epita.fr>
7113
7114 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7115 c.m4.
7116 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
7117 * data/glr.cc: Do not include stack.hh.
7118
7119 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7120
7121 * data/glr.c: Reformat whitespace with tabs.
7122 (b4_lpure_formals): Remove this unused m4 macro.
7123 * tests/cxx-type.at: Reformat whitespace with tabs.
7124 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7125 since it's a member. Rename type to isNterm for clarity.
7126
7127 2005-12-29 Akim <akim@sulaco.local>
7128
7129 Let glr.cc catch up with symbol_value_print.
7130 * data/glr.cc (b4_yysymprint_generate): Replace by...
7131 (b4_yy_symbol_print_generate): this.
7132 (yy_symbol_print, yy_symbol_value_print): Declare them.
7133
7134 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7135
7136 * src/location.h (boundary): Note that a line or column equal
7137 to INT_MAX indicates an overflow.
7138 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7139 (rule_length_overflow, increment_rule_length, add_column_width):
7140 New functions.
7141 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7142 (<SC_BRACED_CODE>"}"):
7143 Use increment_rule_length rather than incrementing it by hand.
7144 (adjust_location, handle_syncline): Diagnose overflow.
7145 (handle_action_dollar, handle_action_at):
7146 Fix bug with monstrosities like $-2147483648.
7147 Remove now-unnecessary checks.
7148 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7149 (convert_ucn_to_byte): Verify assumptions.
7150 (handle_syncline): New arg LOC. All callers changed.
7151 Don't store through a value derived from char const * pointer.
7152
7153 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7154 GCC warnings.
7155
7156 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7157
7158 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7159 Remove unnecessary forward static decls.
7160
7161 2005-12-27 Akim Demaille <akim@epita.fr>
7162
7163 * src/reader.c (grammar_current_rule_check): Also check that $$
7164 is used.
7165 Take the rule to check as argument, hence rename as...
7166 (grammar_rule_check): this.
7167 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7168 Rename as...
7169 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7170 (grammar_midrule_action, grammar_symbol_append): Now static.
7171 * tests/torture.at (input): Don't rely on the default action
7172 being always performed.
7173 * tests/calc.at: "Set" $$ even when the action is "cut" with
7174 YYERROR or other.
7175 * tests/actions.at (Exotic Dollars): Instead of using unused
7176 values, check that the warning is issued.
7177
7178 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7179
7180 * NEWS: Improve wording for unused-value warnings.
7181
7182 2005-12-22 Akim Demaille <akim@epita.fr>
7183
7184 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7185 (b4_yysymprint_generate): Rename as...
7186 (b4_yy_symbol_print_generate): this.
7187 Generate yy_symbol_print instead of yysymprint.
7188 Generate also yy_symbol_value_print, and use it.
7189
7190 2005-12-22 Akim Demaille <akim@epita.fr>
7191
7192 * NEWS: Warn about unused values.
7193 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7194 a `used' member.
7195 (symbol_list_n_get, symbol_list_n_used_set): New.
7196 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7197 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7198 * src/reader.c (grammar_current_rule_check): Check that values are
7199 used.
7200 * src/symtab.c (symbol_print): Accept 0.
7201 * tests/existing.at: Remove the type information.
7202 Empty the actions.
7203 Remove useless actions (beware of mid-rule actions: perl -000
7204 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7205 * tests/actions.at (Exotic Dollars): Use unused values.
7206 * tests/calc.at: Likewise.
7207 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7208 Likewise.
7209
7210 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7211 rule_useful_p.
7212
7213 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7214
7215 Undo 2005-12-01 tentative license wording change. The wording is
7216 still being reviewed by the lawyers, and we don't want to wait for
7217 them before publishing a test release. For now, revert to the
7218 previous wording.
7219 * NEWS: Undo 2005-12-01 change.
7220 * data/glr.c: Revert to previous license wording.
7221 * data/glr.cc: Likewise.
7222 * data/lalr1.cc: Likewise.
7223 * data/location.cc: Likewise.
7224 * data/yacc.c: Likewise.
7225
7226 * NEWS: Reword %destructor vs YYABORT etc.
7227 * data/glr.c: Use American spacing, for consistency.
7228 * data/glr.cc: Likewise.
7229 * data/lalr1.cc: Likewise.
7230 * data/yacc.c: Likewise.
7231 * data/yacc.c: Reformat comments slightly.
7232 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7233 for consistency. Fix some spelling errors and reword recently-included
7234 text slightly.
7235 * tests/cxx-type.at: Cast results of malloc, for C++.
7236
7237 2005-12-21 Joel E. Denny <address@hidden>
7238
7239 * tests/cxx-type.at: Construct a tree, count the parents of shared
7240 nodes, and free each node once and only once. Previously, the memory
7241 for semantic values was leaked instead.
7242
7243 2005-12-21 Joel E. Denny <address@hidden>
7244
7245 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7246 (yylval, yylloc): If pure, #define to yystackp->yyval and
7247 yystackp->yyloc similar to yychar and yynerrs.
7248 (yyparse): If pure, remove local yylval and yylloc. Add local
7249 yystackp to accommodate pure definitions of yylval and yylloc.
7250 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7251 yylvalp and yyllocp to &yylval and &yylloc.
7252 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7253 namespace. Previously, nerrs and char were missing, but lval and lloc
7254 weren't necessary.
7255 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7256 yylvalp and yyllocp parameters since, if pure, these are now always
7257 accessible through yystackp. If not pure, they are still accessible
7258 globally.
7259 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7260 `if (YYID (N))' to pacify lint.
7261
7262 2005-12-21 Akim Demaille <akim@epita.fr>
7263
7264 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7265 destroy the RHS symbols of a rule.
7266 * data/yacc.c (yylen): Initialize to 0.
7267 Keep its value to the number of items to possibly shift.
7268 In particular, a regular successful parse that ends on YYFINAL by
7269 a (internal) YYACCEPT must not have yylen != 0.
7270 (yyerrorlab, yyreturn): Pop the RHS.
7271 Reorder a bit to emphasize the `shifting' bits of code.
7272 (YYPOPSTACK): Now accept a number of items to pop.
7273 * data/lalr1.cc: Likewise.
7274 * data/glr.c: Formatting changes.
7275 Use goto instead of fall through.
7276 * doc/bison.texinfo (Destructor Decl): Complete.
7277
7278 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7279
7280 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7281 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7282 * djgpp/config.bat: Replace every occurence of the file name
7283 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7284 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7285 * djgpp/config.sed: Replace every occurence of the file name
7286 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7287 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7288 * djgpp/djunpack.bat: DJGPP specific file.
7289 * djgpp/fnchange.lst: DJGPP specific file.
7290 * djgpp/README.in: Add new information about how to unpack the bison
7291 source on MSDOS and other systems which have 8.3 file name restrictions
7292 using djunpack.bat and fnchange.lst.
7293
7294 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7295
7296 * bootstrap (build_cvs_prefix): Remove; unused.
7297 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7298 when getting gnulib.
7299
7300 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7301
7302 * data/glr.c: Reorder typedef declarations for structs to match order
7303 of struct declarations.
7304 Rename yystack everywhere to yystackp except in yyparse where it's not
7305 a pointer.
7306 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7307 consistency.
7308 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7309 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7310 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7311 lint.
7312
7313 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7314
7315 * tests/sets.at (Accept): Fix typos in regular expression used to
7316 sed out the final state number.
7317
7318 Work around portability problem on Solaris 10: flex-generated
7319 files include <stdio.h> before <config.h>, which messes up
7320 because the latter defines __EXTENSIONS__. Address the problem
7321 by creating two new little files that include <config.h> first,
7322 then include the flex-generated files. Rewrite everyone else
7323 to include <config.h> first, as well.
7324 * lib/timevar.c: Always include "config.h".
7325 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7326 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7327 (EXTRA_bison_SOURCES): New macro.
7328 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7329 * src/system.h: Don't include config.h.
7330 * src/LR0.c: Include <config.h> first.
7331 * src/assoc.c: Likewise.
7332 * src/closure.c: Likewise.
7333 * src/complain.c: Likewise.
7334 * src/conflicts.c: Likewise.
7335 * src/derives.c: Likewise.
7336 * src/files.c: Likewise.
7337 * src/getargs.c: Likewise.
7338 * src/gram.c: Likewise.
7339 * src/lalr.c: Likewise.
7340 * src/location.c: Likewise.
7341 * src/main.c: Likewise.
7342 * src/muscle_tab.c: Likewise.
7343 * src/nullable.c: Likewise.
7344 * src/output.c: Likewise.
7345 * src/parse-gram.y: Likewise.
7346 * src/print.c: Likewise.
7347 * src/print_graph.c: Likewise.
7348 * src/reader.c: Likewise.
7349 * src/reduce.c: Likewise.
7350 * src/relation.c: Likewise.
7351 * src/state.c: Likewise.
7352 * src/symlist.c: Likewise.
7353 * src/symtab.c: Likewise.
7354 * src/tables.c: Likewise.
7355 * src/uniqstr.c: Likewise.
7356 * src/vcg.c: Likewise.
7357
7358 * src/parse-gram.y: Fix minor problems uncovered by lint.
7359 (current_lhs, current_lhs_location): Now static.
7360 (current_assoc): Remove unused variable.
7361
7362 Cleanups so that Bison-generated parsers have less lint.
7363 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7364 Prepend /*ARGSUSED*/, for lint's sake.
7365 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7366 definition if 'lint' is defined.
7367 (YYID): New macro (or function, if lint).
7368 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7369 * data/yacc.c: Likewise.
7370 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7371 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7372 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7373 is C++ only.
7374 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7375 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7376 Use YYID(0) rather than 0, for lint.
7377 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7378 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7379
7380 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7381
7382 * tests/glr-regression.at
7383 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7384 Close memory leak reported by twlevo.
7385
7386 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7387
7388 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7389 all stacks.
7390 (yyparse): Iterate another stack in order to call user destructors.
7391 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7392 New test case.
7393 (Duplicated user destructor for lookahead): This test now is expected
7394 to succeed.
7395
7396 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7397
7398 * NEWS: Document the following change.
7399 * data/yacc.c: Say "parser skeleton" rather than "file", since
7400 it's no longer just a file.
7401 * data/glr.c: Grant a special exception for C GLR parsers, that
7402 reads like the already-existing exception for C LALR(1) parsers.
7403 * data/glr.cc: Likewise.
7404 * data/lalr1.cc: Likewise.
7405 * data/location.cc: Likewise.
7406 * data/yacc.c: Reword the "written by" statement to clarify that
7407 it was the parser skeleton, not the entire output file.
7408 * data/glr.c: Written by Paul Hilfinger.
7409 * data/glr.cc: Written by Akim Demaille.
7410 * data/lalr1.cc: Likewise.
7411
7412 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7413
7414 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7415 Fix typos in previous change that broke 'make check'.
7416 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7417 supported in C.
7418 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7419 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7420 We can revert this once things settle down.
7421
7422 * src/conflicts.c (conflicts_print): Don't print file name twice
7423 when %expect fails because there were no conflicts.
7424 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7425 change.
7426 * tests/conflicts.at (%expect not enough, %expect too much):
7427 (%expect with reduce conflicts): Adjust to new behavior.
7428
7429 2005-11-18 Akim Demaille <akim@epita.fr>
7430
7431 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7432 errors.
7433 * NEWS: Document this.
7434 * doc/bison.texinfo (Expect Decl): Likewise.
7435
7436 2005-11-16 Akim Demaille <akim@epita.fr>
7437
7438 Generalize the display of semantic values and locations in traces.
7439 * data/glr.c (yy_reduce_print): Fix indices (again).
7440 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7441 literal integers.
7442 * data/lalr1.cc (yyreduce_print): Rename as...
7443 (yy_reduce_print): this.
7444 Display values and locations.
7445 * data/yacc.c (yy_reduce_print): Likewise.
7446 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7447 (yysymprint): Move higher to be visible from yy_reduce_print).
7448 (yyparse): Adjust.
7449 * tests/calc.at: Adjust the expected length of the traces.
7450
7451 2005-11-14 Akim Demaille <akim@epita.fr>
7452
7453 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7454 from 1 to N, while values and location start at 0.
7455 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7456
7457 2005-11-14 Akim Demaille <akim@epita.fr>
7458
7459 * data/glr.c (yy_reduce_print): Fix the $ number.
7460
7461 2005-11-14 Akim Demaille <akim@epita.fr>
7462
7463 "Use" parse parameters.
7464 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7465 * data/glr.c, data/glr.cc: Use them.
7466 * data/glr.c (YYUSE): Have a C++ definition that supports
7467 non-pointer types.
7468
7469 2005-11-14 Akim Demaille <akim@epita.fr>
7470
7471 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7472
7473 2005-11-14 Akim Demaille <akim@epita.fr>
7474
7475 * data/glr.cc: New.
7476 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
7477
7478 2005-11-12 Akim Demaille <akim@epita.fr>
7479
7480 Let position and location be PODs.
7481 * data/location.cc (position::initialize, location::initialize): New.
7482 (position::position, location::location): Define only if
7483 b4_location_constructors is defined.
7484 * data/lalr1.cc (b4_location_constructors): Define it for backward
7485 compatibility.
7486 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7487
7488 2005-11-12 Akim Demaille <akim@epita.fr>
7489
7490 * data/lalr1.cc: Move the body of the ctor and dtor into the
7491 parser file (instead of the header).
7492 Wrap the implementations in a "namespace yy".
7493
7494 2005-11-12 Akim Demaille <akim@epita.fr>
7495
7496 Have glr.c include its header file when created.
7497 * data/glr.c (b4_shared_declarations): New.
7498 Output them verbatim in the parser if !%defines, otherwise
7499 output then in the header file, and include it instead.
7500
7501 2005-11-11 Akim Demaille <akim@epita.fr>
7502
7503 * data/glr.c: Comment changes.
7504
7505 2005-11-11 Akim Demaille <akim@epita.fr>
7506
7507 When yydebug, report semantic and location values for reductions.
7508 * data/glr.c (yy_reduce_print): Report the semantic values and the
7509 locations.
7510 (YY_REDUCE_PRINT): Adjust.
7511 (yyglrReduce): Use them.
7512 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7513 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7514 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7515 traces.
7516
7517 2005-11-10 Akim Demaille <akim@epita.fr>
7518
7519 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7520 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7521 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7522
7523 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7524
7525 * m4/cxx.m4, examples/Makefile.am: Don't build
7526 examples/calc++ if no C++ compiler is available. (trivial change)
7527
7528 2005-11-09 Akim Demaille <akim@epita.fr>
7529
7530 * src/scan-skel.l: Use a couple of asserts.
7531
7532 2005-11-03 Akim Demaille <akim@epita.fr>
7533
7534 In some (weird) cases, the final state number is incorrect.
7535 Reported by Alexandre Duret-Lutz.
7536 * src/LR0.c (state_list_append): Remove the computation of
7537 final_state.
7538 (save_reductions): Do it here.
7539 (get_state): Alpha conversion.
7540 (generate_states): Use a for loop.
7541 * src/gram.h (item_number_is_rule_number)
7542 (item_number_is_symbol_number): New.
7543 * src/state.c: Use assert.
7544 * src/system.h: Include assert.h.
7545 * tests/sets.at (Accept): New.
7546
7547 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7548
7549 * data/glr.c (yyfill): Adjust comment.
7550 (yyresolveAction): Initialize default location properly
7551 for empty right-hand sides.
7552 (yydoAction): Ditto.
7553 Add comment explaining apparently dead code.
7554 * tests/glr-regression.at
7555 (Incorrectly initialized location for empty right-hand side in GLR):
7556 New test.
7557
7558 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7559
7560 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7561 gnulib when interrupted. This fixes some race conditions and
7562 works around some portability problems (one noted by Paul
7563 Hilfinger).
7564
7565 2005-10-22 Akim <akim@epita.fr>
7566
7567 * Makefile.cfg: Adjust to config -> build-aux.
7568 Reported by twledo.
7569
7570 2005-10-21 Akim Demaille <akim@epita.fr>
7571
7572 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7573 the %parse-params.
7574 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7575 * data/yacc.c (b4_Pure_if): Rename as...
7576 (b4_yacc_pure_if): this.
7577 (YY_SYMBOL_PRINT, yyparse): Adjust.
7578 * doc/bison.texinfo: Formatting changes.
7579
7580 2005-10-21 Akim Demaille <akim@epita.fr>
7581
7582 Finish the transition config -> build-aux.
7583 * configure.ac, Makefile.am: Use build-aux.
7584 * config/prev-version, config/announce-gen, config/Makefile.am:
7585 Move to...
7586 * build-aux/prev-version, build-aux/announce-gen,
7587 * build-aux/Makefile.am: here.
7588
7589 2005-10-14 Akim Demaille <akim@epita.fr>
7590
7591 * examples/calc++/test: Use set -x only when VERBOSE.
7592
7593 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7594
7595 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7596 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7597
7598 2005-10-13 Akim Demaille <akim@epita.fr>
7599
7600 * src/scan-skel.l: Output the base name parts of the parser and
7601 header file names.
7602 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7603 additional checks.
7604 Use this to exercise C++ outputs in subdirs.
7605 Reported by Oleg Smolsky.
7606
7607 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7608
7609 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7610 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7611 Problem reported by John P. Hartmann.
7612 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7613 already defined it.
7614
7615 2005-10-12 Akim Demaille <akim@epita.fr>
7616
7617 * src/parse-gram.y (version_check): Exit 63 to please missing
7618 (stands for "version mismatch).
7619 * tests/input.at, doc/bison.texinfo: Adjust.
7620
7621 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7622
7623 Work around portability problems with Visual Age C compiler
7624 (xlc and xlC_r) reported by John P. Hartmann.
7625 * data/location.cc (initial_column, initial_line): Remove.
7626 All uses replaced by 0 and 1.
7627 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7628 that xlc complains about.
7629 * src/scan-skel.l (skel_wrap): Likewise.
7630 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
7631 as __STDC__.
7632 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7633 __STDC_VERSION__. Use it everywhere instead of looking at
7634 __STDC__ and __cplusplus.
7635
7636 2005-10-10 Akim Demaille <akim@epita.fr>
7637
7638 * examples/calc++/test: Be quiet unless VERBOSE.
7639
7640 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7641
7642 * data/c.m4 (yydestruct, yysymprint):
7643 Use YYUSE instead of casting to void.
7644 * data/glr.c (YYUSE): New macro.
7645 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7646 Use it instead of rolling our own.
7647 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7648 (YYCHK1):
7649 Use /*CONSTCOND*/ to suppress lint warnings.
7650 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7651 (YY_STACK_PRINT): Use 'false' not '0'.
7652 (YYUSE): New macro.
7653 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7654 * data/yacc.c (YYUSE): New macro.
7655 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7656 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7657 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7658
7659
7660 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7661 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7662
7663 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7664
7665 Undo the parts of the unlocked-I/O change that substituted
7666 putc or puts for printf. This might hurt performance a bit,
7667 but some people prefer the printf style.
7668 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7669 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7670 All uses replaced by YYFPRINTF and YYDPRINTF.
7671 * data/yacc.c: Likewise.
7672 * lib/bitset.c (bitset_print): Likewise.
7673 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7674 putc and puts.
7675 * lib/lbitset.c (debug_lbitset): Likewise.
7676 * src/closure.c (print_firsts, print_fderives): Likewise.
7677 * src/gram.c (grammar_dump): Likewise.
7678 * src/lalr.c (look_ahead_tokens_print): Likewise.
7679 * src/output.c (escaped_output): Likewise.
7680 (user_actions_output): Break apart two printfs.
7681 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7682 * src/reduce.c (reduce_print): Likewise.
7683 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7684 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7685
7686 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7687 Use assignments rather than casts-to-void to suppress
7688 unused-variable warnings. This pacifies 'lint'.
7689 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7690 unused-variable warnings.
7691
7692 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7693
7694 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7695
7696 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7697
7698 Use unlocked I/O for a minor performance improvement on hosts like
7699 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7700 is to use the gnlib unlocked-io module, and to prefer putc and
7701 puts to printf when either will work (since the latter doesn't
7702 come in an unlocked flavor).
7703 * bootstrap (gnulib_modules): Add unlocked-io.
7704 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7705 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7706 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7707 and similarly for puts and putc and printf.
7708 * data/yacc.c: Likewise.
7709 * lib/bitset.c (bitset_print): Likewise.
7710 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7711 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7712 to printf.
7713 * lib/lbitset.c (debug_lbitset): Likewise.
7714 * src/closure.c (print_firsts, print_fderives): Likewise.
7715 * src/gram.c (grammar_dump): Likewise.
7716 * src/lalr.c (look_ahead_tokens_print): Likewise.
7717 * src/output.c (escaped_output): Likewise.
7718 (user_actions_output): Coalesce two printfs.
7719 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
7720 * src/reduce.c (reduce_print): Likewise.
7721 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7722 * src/system.h: Include unlocked-io.h rather than stdio.h.
7723
7724 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7725 this confuses xgettext.
7726
7727 2005-10-02 Akim Demaille <akim@epita.fr>
7728
7729 * bootstrap (gnulib_modules): Add strverscmp.
7730 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7731 * m4/.cvsignore: Add strverscmp.m4.
7732 * src/parse-gram.y (%require): New token, new rule.
7733 (version_check): New.
7734 * src/scan-gram.l (%require): Adjust.
7735 * tests/input.at (AT_REQUIRE): New.
7736 Use it.
7737 * doc/bison.texinfo (Require Decl): New.
7738 (Calc++ Parser): Use %require.
7739
7740 2005-10-02 Akim Demaille <akim@epita.fr>
7741
7742 * data/location.cc: New.
7743
7744 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7745 Akim Demaille <akim@epita.fr>
7746
7747 Make sure -odir/foo.cc creates dir/location.hh etc.
7748 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7749 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7750 (spec_defines_file): Now const.
7751 (dir_prefix): New.
7752 (short_base_name): Remove.
7753 * src/files.c: Adjust.
7754 (dirname.h): Include.
7755 (base_name): Don't prototype it.
7756 (finput): Remove, duplicates gram_in.
7757 (full_base_name, short_base_name): Replace by...
7758 (all_but_ext, all_but_tab_ext): these.
7759 (compute_base_names): Rename as...
7760 (compute_file_name_parts): this.
7761 Update to compute the new variables, including dir_prefix.
7762 Adjust dependencies.
7763 * src/output.c (prepare): Output them.
7764 * src/reader.c: Adjust to use gram_in, not finput.
7765 * src/scan-skel.l (@dir_prefix@): New.
7766
7767 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7768
7769 * lib/subpipe.c: New function end_of_output_subpipe() added
7770 to allow support for non-posix systems. This is a no-op function
7771 for posix systems.
7772
7773 * lib/subpipe.h: New function end_of_output_subpipe() added
7774 to allow support for non-posix systems. This is a no-op function
7775 for posix systems.
7776
7777 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7778 handle the lack of pipe/fork functionality on non-posix systems.
7779
7780 * djgpp/Makefile.maint: DJGPP specific file.
7781
7782 * djgpp/README.in: DJGPP specific file.
7783
7784 * djgpp/config.bat: DJGPP specific configuration file.
7785
7786 * djgpp/config.sed: DJGPP specific configuration file.
7787
7788 * djgpp/config.site: DJGPP specific configuration file.
7789
7790 * djgpp/config_h.sed: DJGPP specific configuration file.
7791
7792 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7793
7794 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7795
7796 2005-10-02 Akim Demaille <akim@epita.fr>
7797
7798 * data/location.cc: New, extract from...
7799 * data/lalr1.cc: here.
7800 (location.hh): Include it after the user prologue, in case the
7801 filename type is defined by the user.
7802 Forward declation location and position before the pre-prologue.
7803 (yyresult_): Rename as...
7804 (yyresult): this, it's a local variable, not an attribute.
7805 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7806
7807 2005-10-01 Akim Demaille <akim@epita.fr>
7808
7809 * examples/extexi: Restore the #line generation.
7810
7811 2005-09-30 Akim Demaille <akim@epita.fr>,
7812 Alexandre Duret-Lutz <adl@gnu.org>
7813
7814 Move the token type and YYSTYPE in the parser class.
7815 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7816 (parser::token): New, from the moved free definition of tokens.
7817 (parser::semantic_value): Now a full definition instead of an
7818 indirection to YYSTYPE.
7819 (b4_post_prologue): No longer included in the header file, but
7820 in the implementation file.
7821 * doc/bison.texi (C+ Language Interface): Update.
7822 * src/parse-gram.y: Support unary %define.
7823 * tests/actions.at: Define global_tokens_and_yystype for backward
7824 compatibility until we update the tests.
7825 * tests/calc.at: Idem.
7826 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7827 to simplify the code.
7828
7829 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7830
7831 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7832 Ah, the good old days! Problem reported by Peter Klein.
7833 * bootstrap (gnulib_modules): Add strerror, strtoul.
7834 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7835 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7836
7837 2005-09-29 Akim Demaille <akim@epita.fr>
7838
7839 * data/c.m4 (b4_error_verbose_if): New.
7840 * data/lalr1.cc: Use it.
7841 (YYERROR_VERBOSE_IF): Remove.
7842 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7843 parser members, replaced by...
7844 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7845 local variables.
7846 (yysyntax_error_): Takes the state number as argument.
7847 (yyreduce_print_): Use the argument yyrule, not the former
7848 attribute yyn_.
7849
7850 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7851
7852 * bootstrap (gnulib_modules): Add verify.
7853 * lib/.cvsignore: Add verify.h.
7854 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7855 * src/system.h (verify): Remove.
7856 Include verify.h instead.
7857 * src/tables.c (tables_generate): Use new API for 'verify'.
7858
7859 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7860
7861 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7862 local variables whose names begin with 'yy'.
7863 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7864 Trivial changes from Joel E. Denny.
7865
7866 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7867 it itself.
7868 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7869 don't use alloca any more.
7870
7871 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7872 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
7873 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
7874 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7875 to match yacc.c, to test more hosts.
7876
7877 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7878
7879 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7880 doesn't affect behavior.
7881 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7882 Solaris, AIX, MSC.
7883 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7884 This works a bit better with glibc, if user code has already included
7885 stdlib.h.
7886 * doc/bison.texinfo (Bison Parser): Document that users can't
7887 arbitrarily use malloc and free for other purposes. Document
7888 that <alloca.h> and <malloc.h> might be included.
7889 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7890 user must declare alloca.
7891
7892 * HACKING (release): Forwarn the Translation Project about
7893 stable releses.
7894
7895 2005-09-20 Akim Demaille <akim@epita.fr>
7896
7897 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7898
7899 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7900
7901 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
7902 (YYSTACK_ALLOC_MAXIMUM): Use it.
7903 (yysyntax_error): New function.
7904 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
7905 multiple syntax errors are reported, and alloca is being used.
7906 Instead, reallocate buffers twice as big each time, so that
7907 we waste at most half the allocated memory. Start with a small
7908 (128-byte) buffer that will suffice in most cases anyway.
7909 Use yysyntax_error to do most of the work.
7910
7911 * doc/bison.texinfo (Error Reporting, Table of Symbols):
7912 yynerrs is the number of errors reported, not the number of
7913 errors encountered.
7914
7915 * tests/glr-regression.at (Duplicated user destructor for lookahead):
7916 Mark it as expected to fail.
7917 Cast result of malloc; problem reported by twlevo@xs4all.nl.
7918 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
7919 Don't start user-code symbols with "yy", to avoid name space problems.
7920
7921 2005-09-19 Akim Demaille <akim@epita.fr>
7922
7923 Remove the traits, failed experiment.
7924 It never proved useful, and anyway because of the current
7925 definition, it was not possible to have several specialization of
7926 this traits, making it useless.
7927 * data/lalr1.cc (yy:traits): Remove.
7928 Inline its definitions in the parser class.
7929
7930 2005-09-19 Akim Demaille <akim@epita.fr>
7931
7932 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
7933 least Mac OSX with a /usr/local install of gettext.
7934
7935 2005-09-19 Akim Demaille <akim@epita.fr>
7936
7937 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
7938 and yytoken for similarity with the other skeletons.
7939
7940 2005-09-19 Akim Demaille <akim@epita.fr>
7941
7942 * NEWS, configure.ac: update version number to 2.1a.
7943
7944 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
7945
7946 * NEWS: Version 2.1.
7947
7948 * NEWS: Remove notice of yytname change, since it was never in an
7949 official release.
7950 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
7951 diagnostic.
7952 * src/output.c (prepare): Likewise.
7953 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
7954 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
7955 is not defined. This is an awful hack, but it's enough for now.
7956 All callers changed.
7957 * tests/glr-regression-at (make_value): Args are const pointers now,
7958 to avoid GCC warning.
7959 (Duplicated user destructor for lookahead): New test. Currently
7960 skipped. It fails on my host but I'm not sure it'll always fail.
7961
7962 2005-09-16 Akim Demaille <akim@epita.fr>
7963
7964 * src/symtab.h (struct symbol): Declare the printer and destructor
7965 as const, to avoid accidental calls to free.
7966 (symbol_destructor_set, symbol_printer_set): Adjust.
7967 * src/symtab.c: Adjust.
7968
7969 2005-09-16 Akim Demaille <akim@epita.fr>
7970
7971 * data/c.m4 (b4_token_enums): New.
7972 (b4_token_defines): Rename as...
7973 (b4_token_enums_defines): this.
7974 (b4_token_defines): New, output only the #defines.
7975 * data/yacc.c, data/glr.c: Adjust.
7976 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
7977 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
7978 as default values.
7979
7980 2005-09-16 Akim Demaille <akim@epita.fr>
7981
7982 * data/lalr1.cc (yylex_): Remove, inline its code.
7983 (yyreport_syntax_error_): Remove, replaced by...
7984 (yysyntax_error_): this which returns a string and leaves to the
7985 caller the call to the users' error function.
7986 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
7987 Move from members of the parser object...
7988 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
7989 to local variables of the parse function.
7990
7991 2005-09-16 Akim Demaille <akim@epita.fr>
7992
7993 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
7994 since it's in Bison's name space.
7995
7996 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
7997
7998 * data/glr.c (yyresolveValue): Add default case to pacify
7999 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8000
8001 * NEWS: Document when yyparse started to return 2.
8002 * doc/bison.texinfo (Parser Function): Document when yyparse
8003 returns 2.
8004
8005 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8006 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8007 changed.
8008 (class position): file_name -> filename (reverting). All uses changed.
8009
8010 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8011
8012 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8013 do anything if $@ exists. This reverts part of the 2005-07-07
8014 patch.
8015
8016 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8017
8018 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8019 contains obsolete information and isn't worth distributing as a
8020 separate file anyway.
8021 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8022 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8023 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8024 (yyparse): Abort if user code uses longjmp to throw an unexpected
8025 value.
8026
8027 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8028
8029 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8030 Suggested by twlevo@xs4all.nl.
8031
8032 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8033 This avoids a diagnostic from gcc -Wswitch-enum.
8034 Problem reported by twlevo@xs4all.nl.
8035
8036 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8037 standards. Use "file name" or "file" or "name", depending on
8038 the context.
8039 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8040 not to hack/foo.tab.c.
8041 (Calc++ Top Level): 2nd arg of main is not const.
8042 * data/glr.c: b4_filename -> b4_file_name.
8043 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8044 All uses changed.
8045 (class position): filename -> file_name. All uses changed.
8046 * data/yacc.c: b4_filename -> b4_file_name.
8047 * lib/bitset.h: filename -> file_name in local vars.
8048 * lib/bitset_stats.c: Likewise.
8049 * src/files.c: Likewise.
8050 * src/scan-skel.l ("@output ".*\n): Likewise.
8051 * src/files.c (file_name_split): Renamed from filename_split.
8052 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
8053
8054 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8055
8056 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8057 to accommodate latest gnulib.
8058
8059 * tests/glr-regression.at (Duplicate representation of merged trees):
8060 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8061
8062 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8063 needed.
8064
8065 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8066
8067 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8068 All uses changed. Invoke user destructor after an error during a
8069 split parse (trivial change from Joel E. Denny).
8070
8071 * tests/glr-regression.at
8072 (User destructor after an error during a split parse): New test case.
8073 Problem reported by Joel E. Denny in:
8074 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8075
8076 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8077
8078 * README-cvs: Give URLs for recommended tools.
8079 Mention Gzip version problem, and bootstrapping issues.
8080 Remove troubleshooting section, as it's somewhat obsolete.
8081
8082 * bootstrap (no_cache): New var, to accommodate different wget
8083 variants. Use it instead of '-C off'. Problem reported by
8084 twlevo@xs4all.nl.
8085
8086 * data/glr.c (yydestroyStackItem): New function.
8087 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8088 debugging information. Problem reported by Joel E. Denny.
8089
8090 2005-08-25 Akim Demaille <akim@epita.fr>
8091
8092 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8093
8094 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8095
8096 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8097 Don't invoke destructor on unresolved entries.
8098 * tests/glr-regression.at
8099 (User destructor for unresolved GLR semantic value): New test case.
8100 Problem reported by Joel E. Denny in:
8101 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8102
8103 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8104
8105 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8106 Add strnlen.c.
8107 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8108 lib-prefix.m4, po.m4.
8109
8110 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8111 in yydestruct diagnostic, since it might not be an error.
8112 Problem reported by Joel Denny near end of
8113 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8114 * data/lalr1.cc (yyerturn): Likewise.
8115 * data/yacc.c (yyreturn): Likewise.
8116 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8117
8118 * src/files.c: Remove obsolete FIXME comment.
8119
8120 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8121 with the other templates, and to fix bogus run-on messages such
8122 as the one reported at the end of
8123 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8124 All callers changed to avoid the newline.
8125 (yyprocessOneStack): Output two lines rather than one, to accommodate
8126 the above change. This changes the debug output format slightly.
8127
8128 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8129 reported by Joel E. Denny in
8130 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8131 (trivial change).
8132 * tests/glr-regression.at (Duplicate representation of merged trees):
8133 New test, from Joel E. Denny in:
8134 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8135 * THANKS: Add Joel E. Denny.
8136
8137 * configure.ac (AC_INIT): Bump to 2.0c.
8138
8139 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8140
8141 * NEWS: Version 2.0b.
8142
8143 * Makefile.am (SUBDIRS): Put examples before tests, so that
8144 "make check" doesn't finish with "All 1 tests passed".
8145
8146 * tests/regression.at (Token definitions): Don't rely on
8147 AT_PARSER_CHECK for data that contains backslashes. It currently
8148 uses 'echo', and 'echo' isn't portable if its argument contains
8149 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8150 that the byte '\0xff' is not printable in the C locale; it is,
8151 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8152 not printable, so use '\0x81' to test.
8153
8154 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8155 version of GCC, since the macro is used with non-GCC compilers.
8156
8157 Fix core dump reported by Pablo De Napoli in
8158 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8159 * tests/regression.at (Invalid inputs with {}): New test.
8160 * src/parse-gram.y (token_name): Translate type before using
8161 it as an index.
8162
8163 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8164 the user's name space. All uses changed to __attribute__
8165 ((__unused__)).
8166 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8167 Add __attribute__ ((__noreturn__)).
8168
8169 * etc/clcommit: Remove. We weren't using it, and it failed
8170 "make maintainer-distcheck".
8171 * Makefile.maint: Merge from coreutils.
8172 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8173 (syntax-check-rules): Change list of rules as described below.
8174 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8175 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8176 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8177 (sc_trailing_space): New rules.
8178 (sc_xalloc_h_in_src): Remove.
8179 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8180 (sc_space_tab, sc_error_exit_success, sc_changelog):
8181 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8182 (makefile-check, po-check, author_mark_check):
8183 (makefile_path_separator_check, copyright-check):
8184 Use grep -n, to make it easier to find violations.
8185 Use CVS_LIST and CVS_LIST_EXCEPT.
8186 (header_regexp, h_re): Remove.
8187 (dd_c): New macro.
8188 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8189 (my-distcheck): Use more-modern GCC flags.
8190 (signatures, %.asc): Remove.
8191 (rel-files, announcement): Remove signatures.
8192 Restore old updating code, even though we don't use it, so
8193 that we're the same as coreutils.
8194 (alpha, beta, major): Depend on news-date-check.
8195 Make the upload commands.
8196
8197 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8198 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8199 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8200 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8201 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8202 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8203 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8204 * tests/sets.at: Likewise.
8205
8206 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8207 we comment out the Autoconf version number.
8208 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8209 it's error-prone and "make maintainer-distcheck" rejects it.
8210
8211 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8212 Indent calls to "error" to pacify "make maintainer-distcheck",
8213 when the calls are not intended to be translated.
8214 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8215
8216 * src/Makefile.am (DEFS): Use +=, to pacify
8217 "make maintainer-distcheck".
8218 (bison_SOURCES): Add scan-skel.h.
8219 (sc_tight_scope): New rule, from coreutils.
8220
8221 * src/files.c (src_extension, header_extension):
8222 Now static, not extern.
8223 * src/getargs.c (short_options): Likewise.
8224 * src/muscle_tab.c (muscle_table): Likewise.
8225 * src/parse-gram.y (current_class, current_type, current_prec):
8226 Likewise.
8227 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8228 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8229 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8230 void, to avoid warning when NLS is disabled.
8231 * src/output.c: Include scan-skel.h.
8232 (scan_skel): Remove decl, since scan-skel.h does this.
8233 (output_skeleton):
8234 Indent calls to "error" to pacify "make maintainer-distcheck".
8235 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8236 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8237 "make maintainer-distcheck".
8238 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8239 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8240 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8241 (skel_lex_destroy, scan_skel): Move these decls to...
8242 * src/scan-skel.h: New file.
8243 * src/uniqstr.c (uniqstr_assert):
8244 Indent calls to "error" to pacify "make maintainer-distcheck".
8245
8246 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8247 not @VAR@.
8248
8249 * tests/torture.at: Revamp to avoid misuse of atoi that
8250 "make maintainer-distcheck" complained about.
8251
8252 * examples/extexi (message): Don't print a message more than once,
8253 and omit line-number decoration that makes Emacs compile think
8254 that informative messages are worth worrying about.
8255
8256 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8257
8258 * configure.ac: Update version number.
8259
8260 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8261 accidentally.
8262 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8263 autogenerated by the maintainer.
8264 * examples/calc++/.cvsignore: Add *.yy.
8265
8266 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8267 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8268 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8269
8270 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8271
8272 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8273 from maintainer-distcheck about casting the argument of 'free'.
8274
8275 * NEWS: Mention recent yytname changes.
8276 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8277
8278 * bootstrap: For translations that have not yet been upgraded to
8279 the new runtime-po domain, prime the pump by extracting the
8280 relevant strings from the obsolete translations. This code can be
8281 removed once the bison-runtime domain has been translated by each
8282 team.
8283
8284 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8285 now that token names are already quoted.
8286
8287 Fix problem reported by Anthony Heading.
8288 * data/glr.c (YYTOKEN_TABLE): New macro.
8289 (yytname): Define if YYTOKEN_TABLE.
8290 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8291 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8292 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8293 * src/output.c (prepare_symbols): Output token_table_flag.
8294
8295 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8296
8297 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8298 again if the first call fails.
8299
8300 * data/glr.c (yytnamerr): New function.
8301 (yyreportSyntaxError): Use it to dequote most string literals.
8302 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8303 with other skeletons. All uses changed.
8304 (yytnameerr_): New function.
8305 (yyreport_syntax_error): Use it to dequote most string literals.
8306 * data/yacc.c (yytnamerr): New function.
8307 (yyerrlab): Use it to decode most string literals.
8308 * doc/bison.texinfo (Decl Summary, Calling Convention):
8309 Clarify quoting convention of yytname.
8310 * src/output.c (prepare_symbols): Quote all names. This undoes
8311 the 2005-04-17 change, which is now accomplished (mostly) via
8312 changes in the parsers as described above.
8313 * tests/regression.at (Token definitions, Web2c Actions):
8314 Undo most 2005-04-17 change here, too.
8315
8316 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8317
8318 Fix more problems reported by twlevo@xs4all.nl.
8319 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8320 remove trailing spaces. This loses the exit status of ./types,
8321 and isn't needed since ./types shouldn't be emitting trailing
8322 spaces.
8323 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8324 as the stack isn't valid in that case.
8325
8326 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8327 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8328 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8329 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8330 is used.
8331 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8332 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8333 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8334 Likewise.
8335
8336 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8337 overly-picky compilers that reject 'char *foo = "bar";'.
8338
8339 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8340 to FILE * parameter, not to stderr. This fixes a typo introduced
8341 in the 2005-07-12 change.
8342
8343 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8344 warnings from GCC 4.
8345
8346 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8347 (yyglrShiftDefer, yysplitStack):
8348 Remove unused parameters b4_pure_formals. All uses changed.
8349 (yyglrShift): Remove unused parameters b4_user_formals.
8350 All uses changed.
8351 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8352
8353 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8354
8355 Destructor cleanups and regularization among the three skeletons.
8356 * NEWS: Document the behavior changes.
8357 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8358 stack before failing, as the cleanup code will do it for us now.
8359 * data/lalr1.cc (yyerrlab): Likewise.
8360 * data/glr.c (yyparse): Pop everything off the stack before
8361 freeing it, so that destructors get called properly.
8362 * data/lalr1.cc (yyreturn): Likewise.
8363 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8364 This is more consistent.
8365 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8366 why destructors might be called. 1.875 -> 2.1.
8367 (Destructor Decl, Decl Summary, Table of Symbols):
8368 Some English-language cleanups for %destructor.
8369 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8370 Add output line for destructor of start symbol.
8371 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8372 because of that same extra output line.
8373
8374 * NEWS: Document minor wording changes in diagnostics of
8375 Bison-generated parsers.
8376 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8377 Remove unused formals. All uses changed.
8378 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8379 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8380 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8381 Rename yyoverflowab to yyexhaustedlab.
8382 When memory exhaustion occurs during syntax-error reporting,
8383 report it separately rather than in a single diagnostic; this
8384 eases translation.
8385 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8386 (Memory Exhausted): Renamed from Parser Stack Overflow.
8387 Revamp wording slightly to prefer "memory exhaustion".
8388 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8389
8390 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8391
8392 Add i18n support to the GLR skeleton. Partially fix the C++
8393 skeleton; a C++ expert needs to finish this. Remove debugging
8394 msgids; there's little point to having them translated, since they
8395 can be understood only by someone who can read the
8396 (English-language) source code.
8397
8398 Generate runtime-po/bison-runtime.pot automatically, so that we
8399 don't have to worry about garbage getting in that file. We'll
8400 make sure after the next official release that old msgids don't
8401 get lost. See
8402 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8403
8404 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8405 Now auto-generated.
8406 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8407 Fix typos in explanations of the runtime file.
8408 * bootstrap: Change gettext keyword from YYI18N to YY_.
8409 Use standard Makefile.in.in in runtime-po, since we'll arrange
8410 for backward-compatible bison-runtime.po files in a different way.
8411 * data/glr.c (YY_): New macro, from yacc.c.
8412 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8413 Translate messages intended for users.
8414 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8415 the wording in the other skeletons. We don't know that the memory
8416 is virtual.
8417 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8418 Use same method that yacc.c uses.
8419 Don't translate debugging messages.
8420 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8421 it doesn't work (yet), and requires C++ expertise to fix.
8422 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8423 Move defn to a more logical place, to be consistent with other
8424 skeletons.
8425 Don't translate debugging messages.
8426 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8427 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8428 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8429 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8430
8431 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8432 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8433 void, not int.
8434 * tests/glr-regression.at (Badly Collapsed GLR States):
8435 Likewise.
8436 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8437 yylex should return 0 at EOF rather than aborting.
8438
8439 Improve tests for stack overflow in GLR parser.
8440 Problem reported by twlevo@xs4all.nl.
8441 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8442 All uses removed.
8443 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8444 can handle the problem.
8445 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8446 (yyparse): New local variable yyresult to record the result.
8447 Use result of setjmp to set it, rather than storing itinto
8448 struct.
8449 (yyDone): Remove label.
8450 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8451 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8452 if YYABORT is used).
8453 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8454 yyparse status; put status > 1 into diagnostic.
8455 Check that status==2 works.
8456 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8457 Use exit status 3 for failure to open (which shouldn't happen).
8458
8459 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8460
8461 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8462 1 on syntax error; just let yyparse do its thing.
8463 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8464 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8465 (Exploding the Stack Size with Alloca):
8466 (Exploding the Stack Size with Malloc):
8467 Expect exit status 2, not 1, since the parser is supposed to blow
8468 its stack. Problem reported by twlevo@xs4all.nl.
8469
8470 * data/glr.c (yyparse): Don't assume that the initial calls
8471 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8472 Print a stack-overflow message and fail instead.
8473 Initialize the line-number information before creating the stack,
8474 so that the stack-overflow message can report line zero safely.
8475
8476 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8477
8478 Fix problems reported by twlevo@xs4all.nl.
8479 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8480 (yyuserMerge): Provide a default case if b4_mergers is empty.
8481 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8482 * tests/glr-regression.at
8483 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8484 Add casts to pacify C++ compilers.
8485 * tests/glr-regression.at (Improper merging of GLR delayed action
8486 sets): Declare yylex before using it.
8487 * tests/Makefile.am (maintainer-check-g++): Fix a stray
8488 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8489 test for valgrind; valgrind is independent of g++.
8490 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8491 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8492 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8493 Use a destructor, so that we can expand the stack. Change
8494 YYSTYPE to char * so that we can free it. Cast result of malloc.
8495
8496 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8497
8498 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8499 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8500
8501 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8502
8503 * PACKAGING: New file, suggested by Bruno Haible and taken from
8504 similar wording in gettext's PACKAGING file.
8505 * NEWS: Mention PACKAGING.
8506 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8507
8508 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8509
8510 * NEWS: Document recent i18n improvements.
8511 * bootstrap: Get runtime translations into runtime-po.
8512 Create runtime-po files automatically, if possible.
8513 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8514 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8515 does not infringe on the user's name space.
8516 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8517 * doc/bison.texinfo (Internationalization): Revamp the English
8518 and Texinfo syntax a bit, to try to make it clearer.
8519 (Bison Options, Option Cross Key): Mention --print-localedir.
8520 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8521 YYENABLE_NLS. Quote a bit more.
8522 * runtime-po/.cvsignore: New file.
8523 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8524 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8525 * runtime-po/quot.sed: Likewise.
8526 * runtime-po/boldquot.sed: Likewise.
8527 * runtime-po/en@quot.header: Likewise.
8528 * runtime-po/en@boldquot.header: Likewise.
8529 * runtime-po/insert-header.sin: Likewise.
8530 * runtime-po/remove-potcdate.sin: Likewise.
8531 * runtime-po/Makevars: Likewise.
8532 * runtime-po/LINGUAS: Likewise.
8533 * runtime-po/de.po: Likewise; we will rely on the translation project
8534 to maintain this, so "bootstrap" should get it.
8535 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
8536 its value.
8537 * src/main.c (main): Bind the bison-runtime domain, too.
8538
8539 2005-07-12 Bruno Haible <bruno@clisp.org>
8540
8541 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8542 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8543 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8544 * runtime-po: New directory.
8545 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8546 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8547 * runtime-po/Rules-quot: New file, copied from po/.
8548 * runtime-po/quot.sed: Likewise.
8549 * runtime-po/boldquot.sed: Likewise.
8550 * runtime-po/en@quot.header: Likewise.
8551 * runtime-po/en@boldquot.header: Likewise.
8552 * runtime-po/insert-header.sin: Likewise.
8553 * runtime-po/remove-potcdate.sin: Likewise.
8554 * runtime-po/Makevars: New file.
8555 * runtime-po/POTFILES.in: New file.
8556 * runtime-po/LINGUAS: New file.
8557 * runtime-po/bison-runtime.pot: New file.
8558 * runtime-po/de.po: New file.
8559 * m4/bison.m4: New file.
8560 * Makefile.am (SUBDIRS): Add runtime-po.
8561 (aclocaldir, aclocal_DATA): New variables.
8562 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8563 Define aclocaldir.
8564 * src/getargs.c (usage): Document --print-localedir option.
8565 (PRINT_LOCALEDIR_OPTION): New enum item.
8566 (long_options): Add --print-localedir option.
8567 (getargs): Handle --print-localedir option.
8568 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8569 (Internationalization): New section.
8570
8571 2005-07-12 Akim Demaille <akim@epita.fr>
8572
8573 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8574 for consistency with the rest of the code.
8575 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8576 Add separators.
8577
8578 2005-07-12 Akim Demaille <akim@epita.fr>
8579
8580 * src/parse-gram.y: Use %printer instead of YYPRINT.
8581
8582 2005-07-12 Akim Demaille <akim@epita.fr>
8583
8584 * src/symtab.h, src/symtab.c (symbol_print): New.
8585 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8586 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8587
8588 2005-07-12 Akim Demaille <akim@epita.fr>
8589
8590 * data/glr.c (b4_syncline): Fix (swap) the definitions of
8591 b4_at_dollar and b4_dollar_dollar.
8592
8593 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8594
8595 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8596 and Pennello's paper.
8597
8598 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8599
8600 * data/yacc.c (yyparse): Undo previous patch. Instead,
8601 set yylsp[0] and yyvsp[0] only if the initial action
8602 sets yylloc and yylval, respectively.
8603
8604 * data/yacc.c (yyparse): In the initial action, set
8605 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8606 This avoids the use of undefined variables if the initial
8607 action does not set yylloc and/or yylval.
8608
8609 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8610
8611 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8612 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8613 Remove from CVS. These files are automatically generated.
8614 * examples/extexi: Clarify that this file is now part of Bison,
8615 not GNU M4, and that it works with any POSIX-compatible Awk.
8616 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8617 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8618 so that we also get calc++-parser.yy. Geneate it.
8619 Use $(AWK), not gawk, since any conforming Awk will do.
8620 Put comment before action, since older 'make' can't handle comment
8621 in action.
8622 $(BUILT_SOURCES): List all built sources, not just some of them.
8623 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8624 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8625 $($(calc_sources_generated)): Remove unnecessary test for existence
8626 of target. (This had a shell syntax error anyway; a stray "x".)
8627 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8628 calc++-parser.yy.
8629 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8630
8631 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8632 implied by the other modules.
8633
8634 2005-07-06 Akim Demaille <akim@epita.fr>
8635
8636 Bind examples/calc++ to the package.
8637 * examples/calc++/Makefile: Remove, replaced by...
8638 * examples/calc++/Makefile.am: ... this new file.
8639 * examples/calc++/test: Remove input.
8640 * examples/calc++/compile: Remove.
8641 * examples/Makefile.am: New.
8642 * configure.ac, Makefile.am: Adjust.
8643 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8644
8645 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8646
8647 * data/glr.c (yyFail): Drastically simplify; since the format argument
8648 never had any % directives, we can simply pass it to yyerror.
8649 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8650 be modified later, as that is the usual style in glr.c.
8651 Problems reported by Paul Hilfinger.
8652
8653 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8654 and size overflow errors.
8655 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8656 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8657 (YYSIZEMAX): New macro.
8658 (yystpcpy): New function, taken from yacc.c.
8659 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8660 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8661 so that we don't have to maintain their signatures.
8662 (yyFail): Check for buffer overflow, by using vsnprintf rather
8663 than vsprintf. Allocate a bigger buffer if possible.
8664 Report an error if buffer allocation fails.
8665 (yyStackOverflow): New function.
8666 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8667 the initialization was successful. It might fail if storage was
8668 exhausted.
8669 (yyexpandGLRStack): Add more checks for storage allocation failure.
8670 Use yyStackOverflow to report failures.
8671 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8672 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8673 Don't assume stack number fits in int.
8674 (yysplitStack): Check for storage allocation failure.
8675 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8676 can print diagnostics on storage allocation failure. All callers
8677 changed.
8678 (yyresolveValue): Use yybool for boolean.
8679 (yyreportSyntaxError): Check for size-calculation overflow.
8680 This code is taken from yacc.c.
8681 (yyparse): Check for storage allocation errors when allocating
8682 the initial stack.
8683
8684 2005-07-05 Akim Demaille <akim@epita.fr>
8685
8686 Extract calc++ from the documentation.
8687 * doc/bison.texinfo (Calc++): Add the extraction marks.
8688 * examples/extexi: New, from the aborted GNU Programming 2E.
8689 Separate the different paragraph of a file with empty lines.
8690 * examples/Makefile: Use it to extract the whole calc++ example.
8691
8692 2005-06-24 Akim Demaille <akim@epita.fr>
8693
8694 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8695 class typedefs.
8696
8697 2005-06-22 Akim Demaille <akim@epita.fr>
8698
8699 * doc/bison.texinfo (C++ Language Interface): First stab.
8700 (C++ Parsers): Remove.
8701
8702 2005-06-22 Akim Demaille <akim@epita.fr>
8703
8704 * data/lalr1.cc (yylex_): Honor %lex-param.
8705
8706 2005-06-22 Akim Demaille <akim@epita.fr>
8707
8708 Start a set of simple examples.
8709 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8710 * examples/calc++/calc++-driver.hh,
8711 * examples/calc++/calc++-parser.yy,
8712 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8713 * examples/calc++/compile, examples/calc++/test: New.
8714
8715 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8716
8717 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8718 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8719 which stems from the 2005-05-27 patch.
8720
8721 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8722
8723 * data/glr.c: Modify treatment of unused parameters to permit use
8724 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8725
8726 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8727
8728 Fix infringement on user name space reported by Janos Zoltan Szabo.
8729 * data/yacc.c (yyparse): strlen -> yystrlen.
8730
8731 2005-05-30 Akim Demaille <akim@epita.fr>
8732
8733 * data/lalr1.cc (_): New.
8734 Translate the various messages.
8735
8736 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8737
8738 Fix infringement on user name space reported by Bruno Haible.
8739 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8740 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8741 the user's name space.
8742 (alloca): Include <stdlib.h> to get it, if it's not built in.
8743 (YYMALLOC, YYFREE): Define only if needed.
8744 (malloc, free): Declare, but only if needed, as this infringes on
8745 the user name space.
8746
8747 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8748
8749 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8750 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8751 with %d format.
8752 * lib/ebitset.c (min, max): Undef before defining.
8753 * lib/vbitset.c (min, max): Likewise.
8754 * lib/subpipe.c (create_subpipe): Save local variables in case
8755 vfork clobbers them.
8756
8757 2005-05-24 Bruno Haible <bruno@clisp.org>
8758
8759 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8760 error message syntax used by gcc-4.0.
8761
8762 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8763
8764 * README: Mention m4 1.4.3. Remove obsolete advice about
8765 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8766
8767 * bootstrap: Remove workaround for problem I encountered with
8768 gettext 0.14.1; it seems to be fixed now.
8769
8770 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8771
8772 * NEWS: Version 2.0a.
8773
8774 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8775 the previous change.
8776
8777 Various maintainer cleanups.
8778 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8779 conftest*, for benefit of CVS commands run at the same time as
8780 "configure". Add build-aux, since "bootstrap" now creates it and
8781 its subfiles.
8782 * Makefile.cfg (move_if_change): Remove.
8783 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8784 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8785 (po_repo, do-po-update, po-update, wget_files, get-targets):
8786 (config.guess-url_prefix, config.sub-url_prefix):
8787 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8788 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8789 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8790 Remove.
8791 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8792 this is now the recommended name.
8793 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8794 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8795 ylwrap. These files now go into build-aux.
8796 * config/move-if-change: Remove.
8797 * config/prev-version.txt: Bump from 1.75 to 2.0.
8798
8799 * bootstrap: Add stdio-safer, unistd-safer modules.
8800 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8801 we don't need it).
8802 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8803 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8804 * lib/subpipe.c: Include "unistd-safer.h".
8805 (create_subpipe): Make sure all the newly-created
8806 file descriptors are > 2, so that diagnostics don't
8807 get sent down them (which might cause Bison to hang, in theory).
8808 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8809 * src/files.c (xfopen): Use fopen_safer, not fopen.
8810
8811 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8812 yesterday's yacc.c fix.
8813
8814 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8815
8816 * data/glr.c, data/lalr1.cc: Update copyright date.
8817
8818 Fix a destructor bug reported by Wolfgang Spraul in
8819 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8820 * data/yacc.c (yyabortlab): Don't call destructor, and
8821 don't set yychar to EMPTY.
8822 (yyoverflowlab): Don't call destructor.
8823 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8824 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8825 since we no longer output the message "discarding lookahead token
8826 end of input ()".
8827
8828 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8829
8830 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8831 fix a small glitch in debugging output.
8832 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8833 after YY_SYMBOL_PRINT where needed.
8834
8835 (struct yyGLRState): Add some comments.
8836 (struct yySemanticOption): Add some comments.
8837 (union yyGLRStackItem): Add comment.
8838
8839 (yymergeOptionSets): Correct this to properly perform the union,
8840 avoiding infinite reported by Michael Rosien.
8841 Update comment.
8842
8843 * tests/glr-regression.at: Add test for GLR merging error reported
8844 by M. Rosien.
8845
8846 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8847
8848 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8849 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8850 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8851 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8852 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8853 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8854 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8855 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8856 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8857 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8858 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8859 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8860 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8861 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8862 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8863 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8864 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8865 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8866 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8867 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8868 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8869 src/output.h, src/parse-gram.c, src/parse-gram.h,
8870 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8871 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8872 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8873 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8874 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8875 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8876 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8877 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8878 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8879 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8880 tests/reduce.at, tests/regression.at, tests/sets.at,
8881 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8882 Update FSF postal mail address.
8883
8884 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8885
8886 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8887 Problem reported by Ralf Menzel.
8888
8889 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8890
8891 * tests/actions.at: Test that stack overflow invokes destructors.
8892 From Marcus Holland-Moritz.
8893 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8894 from here....
8895 (yyreturn): to here. That way, destructors are called properly
8896 even if the stack overflows, or the user calls YYACCEPT or
8897 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8898 (yyoverflowlab): Destroy the lookahead.
8899
8900 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
8901
8902 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
8903
8904 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
8905
8906 * NEWS: Bison-generated C parsers no longer quote literal strings
8907 associated with tokens.
8908 * src/output.c (prepare_symbols): Don't escape strings,
8909 since users don't want to see C escapes.
8910 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
8911 in diagnostics.
8912 * tests/input.at (Torturing the Scanner): Likewise.
8913 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
8914
8915 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
8916
8917 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
8918 the data size is known to be too small and we can't increase it.
8919 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
8920
8921 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
8922
8923 * src/parse-gram.y: Include quotearg.h.
8924 (string_as_id): Quote $1 before using it as a key, since the
8925 lexer no longer quotes it for us.
8926 (string_content): Don't strip quotes, since lexer no longer
8927 quotes it for us.
8928 * src/scan-gram.l: Include quotearg.h.
8929 ("\""): Omit quote.
8930 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
8931 a key, since the rest of the lexer doesn't quote it.
8932 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
8933 * tests/regression.at (Token definitions): Check for backslashes
8934 in token strings.
8935
8936 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
8937 (YYSIZE_T): Define to unsigned long int when using an older compiler.
8938 (yyparse): Revamp code to generate long syntax error message, to
8939 make it easier to translate, and to avoid problems with arithmetic
8940 overflow. Change "virtual memory" to "memory" in diagnostic, since
8941 we don't know whether the memory is virtual.
8942
8943 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
8944
8945 * NEWS: Bison-generated C parsers now use the _ macro to
8946 translate strings.
8947 * data/yacc.c (_) [!defined _]: New macro.
8948 All English strings wrapped inside this macro.
8949 * doc/bison.texinfo (Bison Parser): Document _.
8950 * po/POTFILES.in: Include src/parse-gram.c, since it now
8951 includes translateable strings that parse-gram.y doesn't.
8952
8953 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
8954
8955 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
8956 reverting the 2004-10-11 change to this function.
8957 (symbol_check_alias_consistency): Don't call symbol_type_set
8958 if the type name is already correct.
8959 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
8960
8961 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
8962
8963 * tests/regression.at (Token definitions): Don't use a token named
8964 c, as that generates a "#define c ..." that runs afoul of buggy
8965 stdlib.h that uses the identifier c as a member of struct
8966 drand48_data. Problem reported by Horst Wente.
8967
8968 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
8969
8970 * bootstrap: Change translation URL from
8971 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
8972 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
8973 redirection glitches. Problem reported by twlevo@xs4all.nl.
8974
8975 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
8976
8977 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
8978 after operands; POSIX says this isn't portable for the c99 command.
8979
8980 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
8981
8982 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
8983 immediately if a data overrun has occurred; this may help us track
8984 down what may be a spurious failure on MacOS.
8985
8986 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
8987
8988 Respond to problems reported by twlevo@xs4all.nl.
8989
8990 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
8991
8992 * src/vcg.h: Comment fix.
8993 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
8994 (G_CMAX): Change to -1 instead of INT_MAX.
8995
8996 * data/yacc.c (yyparse): Omit spaces before #line.
8997
8998 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
8999
9000 * src/tables.c (state_number_to_vector_number): Put it inside an
9001 "#if 0", since it's not currently used. Problem reported by
9002 Roland McGrath.
9003
9004 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9005
9006 * src/output.c (escaped_output): Renamed from
9007 escaped_file_name_output, since we now use it for symbol tags as
9008 well. All uses changed.
9009 (symbol_destructors_output, symbol_printers_output):
9010 Escape symbol tags too.
9011 Problem reported by Matyas Forstner in
9012 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9013
9014 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9015 not needed.
9016 * src/output.c (user_actions_output, token_definitions_output,
9017 symbol_destructors_output, symbol_printers_output): Likewise.
9018 * src/reader.c (prologue_augment): Likewise.
9019 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9020
9021 * src/vcg.c (output_edge): Don't quote linestyle arg.
9022 Problem reported by twlevo@xs4all.nl.
9023
9024 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9025
9026 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9027 example, reported by Derek M Jones. Also, make the example even
9028 more outrageous, to better illustrate how bad the problem is.
9029
9030 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9031
9032 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9033 putsym. Typo reported by Sebastian Piping.
9034
9035 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9036
9037 * doc/bison.texinfo (Language and Grammar): some -> same
9038 (Epilogue): int he -> in the
9039 Typos reported by Sebastian Piping via Justin Pence.
9040
9041 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9042
9043 * tests/glr-regression.at (Improper handling of embedded actions
9044 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9045 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9046 with dollar signs in test names.
9047 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9048 for a similar reason.
9049
9050 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9051
9052 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9053 wants to redefine G_VIEW.
9054
9055 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9056
9057 * src/vcg.c (get_view_str): Remove case for normal_view.
9058 Problem reported by twlevo@xs4all.nl.
9059
9060 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9061
9062 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9063 Problem reported by twlevo@xs4all.nl.
9064
9065 * doc/bison.texinfo: Change @dircategory from "GNU programming
9066 tools" to "Software development". Requested by Richard Stallman
9067 via Karl Berry.
9068
9069 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9070
9071 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9072 Problem reported by twlevo@xs4all.nl.
9073
9074 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9075
9076 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9077 keyword; it's not needed with modern compilers, and it doesn't
9078 affect correctness with older compilers. Suggested by
9079 twlevo@xs4all.nl.
9080
9081 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9082
9083 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9084 gcc -Wswitch-default.
9085 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9086 * data/yacc.c (yyparse): Likewise.
9087
9088 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9089
9090 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9091 already. Let config.h define any nonstandard values.
9092
9093 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9094
9095 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9096 for the benefit of slower hosts. Problem reported by
9097 Nelson H. F. Beebe.
9098
9099 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9100
9101 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9102 being defined and not used.
9103 * data/lalr1.cc (yyparse): Likewise.
9104 Use "if (false)" rather than "if (0)".
9105
9106 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9107
9108 * TODO: Mention that we should allow NUL bytes in tokens.
9109
9110 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9111
9112 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9113 Problem reported by Hans Aberg.
9114
9115 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9116
9117 * src/getargs.c (version): Happy new year; update overall
9118 program copyright date from 2004 to 2005.
9119
9120 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9121 Problem reported by Hans Aberg.
9122 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9123 (Output file names.): Add a test for the case when standard output
9124 is closed.
9125
9126 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9127
9128 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9129 to fix an oversight in the Bison 2.0 manual.
9130
9131 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9132
9133 * NEWS: Version 2.0. Reformat the existing news items since
9134 1.875, so that related items are grouped together.
9135 * configure.ac (AC_INIT): Bump version to 2.0.
9136 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9137
9138 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9139 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9140 otherwise, we're not testing alloca. Unfortunately there's no
9141 simple way to consult HAVE_ALLOCA here.
9142
9143 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9144 for yymsg, too.
9145
9146 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9147 hand. This avoids a warning about comparing int to size_t when
9148 GCC warnings are enabled.
9149
9150 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9151
9152 * NEWS: Bison-generated parsers no longer default to using the
9153 alloca function (when available) to extend the parser stack, due
9154 to widespread problems in unchecked stack-overflow detection.
9155 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9156 responsibility to set it to a positive value. This lets the user
9157 specify a value that is not a preprocessor constant.
9158 * data/yacc.c (YYMAXDEPTH): Likewise.
9159 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9160 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9161 to be a compile-time constant. However, explain the constraints on it.
9162 Also, explain the constraints on YYINITDEPTH.
9163 (Table of Symbols): Explain that alloca is no longer the default.
9164 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9165 to 1.
9166
9167 * doc/bison.texinfo (Location Default Action): Mention that n must
9168 be zero when k is zero. Suggested by Frank Heckenbach.
9169
9170 2004-12-22 Akim Demaille <akim@epita.fr>
9171
9172 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9173 (parser::state_type, parser::semantic_type, parser::location_type):
9174 Private, not public.
9175 (parser::parse): Return ints, not bool.
9176 Returning a bool introduces a problem: 0 corresponds to false, and
9177 it seems weird to return false on success. Returning true changes
9178 the conventions for yyparse.
9179 Alternatively we could return void and send an exception.
9180 There is no clear consensus (yet?).
9181 (state_stack, semantic_stack, location_stack): Rename as...
9182 (state_stack_type, semantic_stack_type, location_stack_type): these.
9183 Private, not public.
9184 * tests/c++.at: New.
9185 * tests/testsuite.at, tests/Makefile.am: Adjust.
9186
9187 2004-12-21 Akim Demaille <akim@epita.fr>
9188
9189 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9190
9191 2004-12-21 Akim Demaille <akim@epita.fr>
9192
9193 Don't impose std::string for filenames.
9194
9195 * data/lalr1.cc (b4_filename_type): New.
9196 (position::filename): Use it.
9197 (parser.hh): Move the inclusion of stack.hh and location.hh below
9198 the user code, so that needed headers for the filename type can be
9199 included first.
9200 Forward declare them before the user code.
9201 * tests/Makefile.am (check-local, installcheck-local): Pass
9202 TESTSUITEFLAGS to the TESTSUITE.
9203
9204 2004-12-20 Akim Demaille <akim@epita.fr>
9205
9206 Use more STL like names: my_class instead of MyClass.
9207
9208 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9209 (SemanticStack, SemanticType, StateStack, StateType)
9210 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9211 (Parser::value): Rename as...
9212 (location_stack, location_type, rhs_number_type, semantic_stack)
9213 (semantic_type, state_stack, state_type, token_number_type, stack)
9214 (slice, traits, parser::yylloc, parser::yylval): these.
9215
9216 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9217
9218 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9219
9220 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9221 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9222
9223 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9224
9225 Remove uses of 'short int' and 'unsigned short int'. This raises
9226 some arbitrary limits. It uses more memory but nowadays that's
9227 not much of an issue.
9228
9229 This change does not affect the generated parsers; that's a different
9230 task, as some users will want to conserve memory there.
9231
9232 Ideally we should use size_t to represent all object counts, and
9233 something like ptrdiff_t to represent signed differences of object
9234 counts; but that will require more code-cleanup than I have the
9235 time to do right now.
9236
9237 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9238 Use size_t, not int or short int, to count objects.
9239 * src/closure.c (nritemset, closure): Likewise.
9240 * src/closure.h (nritemset, closure): Likewise.
9241 * src/nullable.c (nullable_compute): Likewise.
9242 * src/print.c (print_core): Likewise.
9243 * src/print_graph.c (print_core): Likewise.
9244 * src/state.c (state_compare, state_hash): Likewise.
9245 * src/state.h (struct state): Likewise.
9246 * src/tables.c (default_goto, goto_actions): Likewise.
9247
9248 * src/gram.h (rule_number, rule): Use int, not short int.
9249 * src/output.c (prepare_rules): Likewise.
9250 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9251 errs, reductions): Likewise.
9252 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9253 Likewise.
9254 * src/tables.c (vector_number, tally, action_number,
9255 ACTION_NUMBER_MINIMUM): Likewise.
9256 * src/output.c (muscle_insert_short_int_table): Remove.
9257
9258 2004-12-17 Akim Demaille <akim@epita.fr>
9259
9260 * data/lalr1.cc: Extensive Doxygenation.
9261 (error_): Rename as...
9262 (error): this, since it is visible to the user.
9263 Adjust callers.
9264 (Parser::message): Now an automatic variable from...
9265 (Parser::yyreport_syntax_error_): here.
9266 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9267 Parser::error.
9268 * tests/input.at: Escape $.
9269
9270 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9271
9272 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9273 Parenthesize rhs to avoid obscure problems with mistakes like
9274 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9275 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9276 b4_rhs_location): Likewise.
9277 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9278 b4_rhs_location): Likewise.
9279
9280 2004-12-16 Akim Demaille <akim@epita.fr>
9281
9282 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9283 yacc.c: be sure to stay within yycheck_.
9284 * tests/actions.at: Re-enable C++ tests.
9285
9286 2004-12-16 Akim Demaille <akim@epita.fr>
9287
9288 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9289 real.
9290
9291 2004-12-16 Akim Demaille <akim@epita.fr>
9292
9293 Use #define to handle the %name-prefix.
9294
9295 * data/glr.c, data/yacc.c: Comment changes.
9296 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9297 so that one can refer to yylex in the parser file, and have it
9298 renamed, as is the case with other skeletons.
9299
9300 2004-12-16 Akim Demaille <akim@epita.fr>
9301
9302 Move lalr1.cc internals into yy*.
9303
9304 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9305 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9306 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9307 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9308 (empty_, final_, terror_, errcode_, ntokens_)
9309 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9310 (looka_, ilooka_, error_range_, nerrs_):
9311 Rename as...
9312 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9313 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9314 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9315 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9316 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9317 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9318 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9319 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9320 these.
9321
9322 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9323
9324 Fix some problems reported by twlevo at xs4all.
9325 * src/symtab.c (symbol_new): Report an error if the input grammar
9326 contains too many symbols. This is better than calling abort() later.
9327 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9328 (struct node, struct graph):
9329 Rename member expand to stretch. All uses changed.
9330 (struct graph): Remove member layoutalgorithm. All uses removed.
9331 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9332 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9333 All uses changed.
9334 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9335
9336 2004-12-15 Akim Demaille <akim@epita.fr>
9337
9338 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9339 Add more Doxygen comments.
9340 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9341 (report_syntax_error_, translate_): Rename as...
9342 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9343 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9344
9345 2004-12-15 Akim Demaille <akim@epita.fr>
9346
9347 * data/lalr1.cc (lex_): Rename as...
9348 (yylex_): this.
9349 Move the trace here.
9350 Take the %name-prefix into account.
9351 Reported by Alexandre Duret-Lutz.
9352
9353 2004-12-15 Akim Demaille <akim@epita.fr>
9354
9355 Simplify the C++ parser constructor.
9356
9357 * data/lalr1.cc (debug_): Rename as...
9358 (yydebug_): so that the parser's internals are always in the yy*
9359 pseudo namespace.
9360 Adjust uses.
9361 (b4_parse_param_decl): Remove the leading comma as it is now only
9362 called as unique argument list.
9363 (Parser::Parser): Remove the constructor accepting a location and
9364 an initial debugging level.
9365 Remove from the other ctor the argument for the debugging level.
9366 (debug_level_type, debug_level, set_debug_level): New.
9367
9368 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9369 constructor calls.
9370
9371 2004-12-15 Akim Demaille <akim@epita.fr>
9372
9373 Remove b4_root related material: failure experiment
9374 (which goal was to allow to derive from a class).
9375
9376 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9377 definitions and uses.
9378
9379 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9380
9381 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9382 not 2, since it's not portable to subtract 1 from the start of an
9383 array. The new item 0 is never set or used. All uses changed.
9384
9385 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9386 the default definition of YYLLOC_DEFAULT. Problem reported
9387 by Frank Heckenbach.
9388
9389 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9390
9391 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9392 the normal case and one for the error case. Just use the
9393 first one uniformly. Problem reported by Frank Heckenbach.
9394 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9395 use exactly the same macro in both places.
9396 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9397 so that the normal-case YYRHSLOC works for the error case too.
9398 All uses changed.
9399 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9400 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9401 * doc/bison.texinfo (Location Default Action): Don't claim that
9402 we have an array of locations. Use the same macro for both glr
9403 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9404 the index is 0.
9405
9406 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9407
9408 * HACKING: Update email addresses to send announcements to.
9409
9410 * configure.ac (AC_INIT): Bump version to 1.875f.
9411
9412 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9413
9414 * NEWS: Version 1.875e.
9415 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9416
9417 * src/scan-skel.l: Include "complain.h", for "fatal".
9418
9419 * src/relation.h (relation_print, relation_digraph):
9420 Relation sizes are of type relation_node, not size_t (this is
9421 merely a doc fix, since the two types are equivalent).
9422 (relation_transpose): Relation sizes are of type relation_node,
9423 not int.
9424 * src/relation.c: Likewise.
9425 (top, infinity): Now of type relation_node, not int.
9426 (traverse, relation_transpose): Use relation_node, not int.
9427
9428 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9429 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9430 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9431
9432 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
9433 specifying whether the test should be skipped. Use it tp
9434 specify that the [%defines %skeleton "lalr1.cc"] tests currently
9435 fail on some hosts, and should be skipped.
9436
9437 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9438
9439 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9440 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9441 unless otherwise specified below.
9442
9443 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9444 to allocate kernel_base, kernel_items, kernel_size, since
9445 they needn't be initialized to 0.
9446 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9447 * src/closure.c (new_closure): Likewise, for itemset.
9448 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9449 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9450 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9451 (build_relations): Likewise for edge, states1, includes.
9452 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9453 * src/reader.c (packgram): Likewise, for ritem, rules.
9454 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9455 * src/relation.c (relation_digraph): Likewise for VERTICES.
9456 (relation_transpose): Likewise for new_R, end_R.
9457 * src/symtab.c (symbols_token_translations_init): Likewise for
9458 token_translations.
9459 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9460 (token_actions): Likewise for yydefact, actrow, conflrow,
9461 conflict_list.
9462 (save_column): Likewise for froms[symno], tos[symno].
9463 (goto_actions): Likewise for state_count.
9464 (pack_table): Likewise for base, pos, check.
9465 (tables_generate): Likewise for width.
9466
9467 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9468 for initial core. Just have a separate core, so we needn't worry
9469 about whether kernel_size and kernel_base are initialized.
9470
9471 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9472 kernel_size, kernel_items): Remove unnecessary initialization.
9473 * src/conflicts.c (conflicts): Likewise.
9474 * src/derives.c (derives): Likewise.
9475 * src/muscle_tablc (muscle_insert): Likewise.
9476 * src/relation.c (relation_digraph): Likewise.
9477 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9478 conflrow, conflict_table, conflict_list, table, check):
9479 Likewise.
9480
9481 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9482 This is because all callers pass unsigned int.
9483 * src/closure.h (new_closure): Likewise.
9484
9485 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9486 (build_relations): Initialize includes[i] in all cases.
9487 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9488 and rules[ruleno].precsym. Initialize members in order.
9489 * src/relation.c (relation_transpose): Always initialize new_R[i]
9490 and end_R[i].
9491 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9492
9493 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9494 conflict_list[0] was always 0, but now it isn't initialized.
9495
9496 * src/table.c (table_grow): When conflict_table grew, the grown
9497 area wasn't cleared. Fix this.
9498
9499 * lib/.cvsignore: Add strdup.c, strdup.h.
9500 * m4/.cvsignore: Add strdup.m4.
9501
9502 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9503
9504 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9505 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9506 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9507 ngotos + 1 without checking for overflow.
9508 (build_relations): Use END_NODE, not -1, to denote end of edges.
9509 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9510 build_relations): Use goto_number, not int, for goto numbers.
9511 * src/tables.c (save_column, default_goto): Likewise.
9512
9513 2004-11-23 Akim Demaille <akim@epita.fr>
9514
9515 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9516 of #defining from yystype.
9517 Don't typedef yystype, C++ does not need it.
9518 This lets it possible to forward declare it as union.
9519
9520 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9521
9522 * bootstrap (gnulib_modules): Add extensions.
9523 Problem reported by Jim Meyering.
9524
9525 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9526
9527 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9528 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9529 src/system.h, src/tables.c: XFREE -> free, to accommodate
9530 recent change to gnulib xalloc.h.
9531 Problem reported by Jim Meyering.
9532
9533 2004-11-17 Akim Demaille <akim@epita.fr>
9534
9535 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9536
9537 2004-11-17 Akim Demaille <akim@epita.fr>,
9538 Alexandre Duret-Lutz <adl@gnu.org>
9539
9540 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9541 changes.
9542 (YYCDEBUG): Adjust.
9543 Use it instead of cdebug_.
9544 (Parser::debug_stream, Parser::set_debug_stream): New.
9545 (Parser::symprint_): Define cdebug_ for temporary backward
9546 compatibility.
9547 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9548 debug_stream ().
9549
9550 2004-11-17 Akim Demaille <akim@epita.fr>
9551
9552 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9553 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9554 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9555 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9556
9557 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9558
9559 * data/glr.c (yyloc_default): Remove; not used.
9560 Problem reported by Frank Heckenbach.
9561
9562 2004-10-25 Akim Demaille <akim@epita.fr>
9563
9564 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9565 Introduce another definition to address simple location arrays.
9566 (yyGLRStack): New member: yyerror_range.
9567 (yyrecoverSyntaxError, yyparse): Update it.
9568 (yyrecoverSyntaxError): Use it when shifting the error token to
9569 have an accurate range, equivalent to the one computed by both
9570 yacc.c and lalr1.cc.
9571 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9572 that column numbers start at column 0, as per GNU Coding
9573 Standards, the others tests, and the doc.
9574 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9575 Adjust to the above change (first column is 0).
9576 And adjust the location of the "<error>", now covering the whole
9577 line.
9578
9579 2004-10-22 Akim Demaille <akim@epita.fr>
9580 and Paul Eggert <eggert@cs.ucla.edu>
9581
9582 Remove some arbitrary limits on goto numbers and relations.
9583 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9584 initial values, since they're never used.
9585 (set_goto_map): ngotos is now unsigned, so test for overflow
9586 by seeing whether it wraps around to zero.
9587 * src/lalr.h (goto_number): Now size_t, not short int.
9588 (GOTO_NUMBER_MAXIMUM): Remove.
9589 * src/relation.c (relation_print, traverse, relation_transpose):
9590 Check for END_NODE rather than looking at sign.
9591 * src/relation.h (END_NODE): New macro.
9592 (relation_node): Now size_t, not short int.
9593
9594 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9595
9596 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9597 keyword, not an identifier. Problem reported by Baron Schwartz in
9598 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9599
9600 2004-10-11 Akim Demaille <akim@epita.fr>
9601
9602 * src/symtab.c (symbol_check_alias_consistency): Also check
9603 type names, destructors, and printers.
9604 Reported by Alexandre Duret-Lutz.
9605 Recode the handling of associativity and precedence in terms
9606 of symbol_precedence_set.
9607 Accept no redeclaration at all, not even equal to the previous
9608 value.
9609 (redeclaration): New.
9610 Use it to factor redeclaration complaints.
9611 (symbol_make_alias): Don't set the type of the alias, let
9612 symbol_check_alias_consistency do it as for other features.
9613 * src/symtab.h (symbol): Add new member prec_location, and
9614 type_location.
9615 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9616 * tests/input.at (Incompatible Aliases): New.
9617
9618 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9619
9620 .cvsignore fixes to accommodate gnulib changes,
9621 and the practice of naming build directories "_build".
9622 * .cvsignore: Add "_*". Sort.
9623 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9624 * m4/.cvsignore: Add "*_gl.m4".
9625
9626 2004-10-06 Akim Demaille <akim@epita.fr>
9627
9628 * src/parse-gram.y (add_param): Fix the truncation of trailing
9629 spaces.
9630
9631 2004-10-05 Akim Demaille <akim@epita.fr>
9632
9633 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9634 whether the reducion was empty or not. This leaves room to
9635 improve the use of YYLLOC_DEFAULT in such a case.
9636 lalr1.cc is still experimental, so changing this is acceptable.
9637 And finally, there are probably not many users who changed the
9638 handling of locations in GLR, so changing is admissible too.
9639
9640 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9641 empty reduction, set @$ to an empty location ending the previously
9642 stacked symbol.
9643 Adjust uses to make sure the code is triggered on empty
9644 reductions.
9645 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9646 expected output: empty reductions have empty locations.
9647
9648 2004-09-29 Akim Demaille <akim@epita.fr>
9649
9650 * data/lalr1.cc: Move towards a more standard C++ coding style
9651 for templates: Class < T > -> Class<T>.
9652
9653 2004-09-29 Akim Demaille <akim@epita.fr>
9654
9655 * data/lalr1.cc: Reinstall the former ctor, for sake of
9656 compatibility, but warn it will be removed.
9657 Move towards a more standard C++ coding style (i.e., type *var ->
9658 type* var).
9659
9660 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9661
9662 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9663 since it's less likely to work if NULs are involved in the future.
9664
9665 2004-09-27 Akim Demaille <akim@epita.fr>
9666
9667 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9668
9669 2004-09-27 Akim Demaille <akim@epita.fr>
9670
9671 * data/lalr1.cc (b4_parse_param_decl_1): New.
9672 (b4_parse_param_decl): Use it to have different names between attribute
9673 and argument names.
9674 (b4_cc_constructor_call): Likewise.
9675
9676 2004-09-24 Akim Demaille <akim@epita.fr>
9677
9678 * src/parse-gram.y (add_param): Strip the leading and trailing
9679 blanks from a formal argument declaration.
9680 (YY_LOCATION_PRINT): New.
9681
9682 2004-09-24 Akim Demaille <akim@epita.fr>
9683
9684 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9685 after the location.
9686
9687 2004-09-24 Akim Demaille <akim@epita.fr>
9688
9689 * doc/bison.texinfo (Table of Symbols): Sort.
9690
9691 2004-09-21 Akim Demaille <akim@epita.fr>
9692
9693 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9694 the useless parentheses.
9695 Suggested by Paul Eggert.
9696
9697 2004-09-20 Akim Demaille <akim@epita.fr>
9698
9699 Let the initial-action act on the look-ahead, and use it for the
9700 "initial push" (corresponding to an hypothetical beginning-of-file).
9701 And let lalr1.cc honor %initial-action.
9702
9703 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9704 example.
9705 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9706 (Parser::Parser): Remove the ctor that used to initialize it.
9707 (Parser::parse): Like in the other skeletons, issue the "starting
9708 parse" message before any action.
9709 Honor %initial-action.
9710 Initialize the stacks with the lookahead.
9711 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9712 look-ahead.
9713 Push them in the stacks.
9714 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9715
9716 2004-09-20 Akim Demaille <akim@epita.fr>
9717
9718 * doc/bison.texinfo (Initial Action Decl): New.
9719
9720 2004-09-20 Akim Demaille <akim@epita.fr>
9721
9722 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9723 clearer criterion to define it.
9724 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9725 When reducing on an empty RHS, use the latest stacked location as
9726 location.
9727 yylloc is not always available.
9728 * data/glr.c: Likewise.
9729 Also, honor initial-actions.
9730
9731 2004-09-20 Akim Demaille <akim@epita.fr>
9732
9733 * data/yacc.c (YY_LOCATION_PRINT): New.
9734 Define when we know YYLTYPE's structure, i.e., when the default
9735 YYLLOC_DEFAULT is used.
9736 * data/c.m4 (b4_yysymprint_generate): Use it.
9737 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9738 value of the result.
9739 (error_start_): Replace with...
9740 (error_range_): this location array.
9741 This allows to replace code relying on the implementation of
9742 locations by portable code.
9743 * data/yacc.c (yylerrsp): Replace with...
9744 (yyerror_range): this.
9745 Every time a token is popped, update yyerror_range[0], to have an
9746 accurate location for the error token.
9747 * data/glr.c (YY_LOCATION_PRINT): New.
9748 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9749 deference a pointer.
9750 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9751 report the location in %printers.
9752
9753 * src/scan-skel.l: Instead of abort, report error messages to ease
9754 understanding skeleton scanning failures.
9755
9756 2004-09-16 Akim Demaille <akim@epita.fr>
9757
9758 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9759 (iterator, const_iterator): these, to be more in the C++ spirit.
9760 Also, return reverse iterators so that when displaying the stack
9761 we display its bottom first.
9762 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9763 from yacc.c.
9764 We should probably use vector here though.
9765
9766 2004-09-16 Akim Demaille <akim@epita.fr>
9767
9768 Have more complete shift traces.
9769
9770 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9771 to report Shifts instead of ad hoc YYDPRINTF invocations,
9772 including for the error token.
9773 * data/lalr1.cc (symprint_): Output the location.
9774 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9775 output the location within the %printer.
9776 Activate GLR tests, at least to make sure they compile properly.
9777 They still don't pass though.
9778 * tests/calc.at: Adjust expect verbose output, since now "Entering
9779 state..." is on a different line than the "Shifting" message.
9780
9781 2004-09-08 Akim Demaille <akim@epita.fr>
9782
9783 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9784 Bison directive from the Bison file to the invocation of this
9785 macro, so that these directives are passed to
9786 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9787 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9788 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9789 the extra Bison directives instead of the whole series.
9790 Change the grammar so that there are recoverable errors, and
9791 unrecoverable errors. Now we can have the parser give up before
9792 consuming the whole input. As a result we now can observe that
9793 the lookahead is freed when needed.
9794 Change the parser source to parse argv[1] instead of a hard coded
9795 string.
9796 Simplify yylex, and give a value and location to EOF.
9797 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9798 passed directives already coded in the file.
9799 Add some tests to check the location of "error".
9800 For some tests, the C++ parser is correct, and not yacc.c.
9801 For other tests, they provide different, but unsatisfying, values,
9802 so keep the C++ value so that at least one parser is "correct"
9803 according to the test suite.
9804 (Actions after errors): Remove, this is subsumed by the
9805 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9806
9807 2004-09-06 Akim Demaille <akim@epita.fr>
9808
9809 * data/lalr1.cc: Adjust the indentation of the labels.
9810 (Parser::pop): New.
9811 Use it.
9812
9813 2004-09-06 Akim Demaille <akim@epita.fr>
9814
9815 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9816 argument, an informative message.
9817 Call YY_SYMBOL_PRINT.
9818 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9819 * data/lalr1.cc (destruct_): Likewise.
9820 In addition, no longer depend on b4_yysymprint_generate and
9821 b4_yydestruct_generate to generate these functions, do it "by
9822 hand".
9823
9824 2004-09-03 Akim Demaille <akim@epita.fr>
9825
9826 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9827 invoked, yydestruct the lookahead.
9828 * tests/calc.at (Calculator $1): Update the expected lengths of
9829 traces: there is an added line for the discarded lookahead.
9830 * doc/bison.texinfo (Destructor Decl): Some rewording.
9831 Define "discarded" symbols.
9832
9833 2004-09-02 Akim Demaille <akim@epita.fr>
9834
9835 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9836
9837 2004-09-02 Akim Demaille <akim@epita.fr>
9838
9839 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9840 (YYDSYMPRINTF): Rename as...
9841 (YY_SYMBOL_PRINT): this.
9842 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9843 two.
9844 Use it instead of direct symprint_ calls.
9845 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9846 one.
9847
9848 2004-09-02 Akim Demaille <akim@epita.fr>
9849
9850 * data/lalr1.cc (b4_yysymprint_generate): New.
9851 (symprint_): New member function, defined when YYDEBUG.
9852 Use it consistently instead of token/nterm debugging output by
9853 hand.
9854 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9855 %printer calls to use cdebug_ when using lalr1.cc.
9856
9857 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9858
9859 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9860 with #ifdef YYDEBUG.
9861
9862 2004-08-26 Akim Demaille <akim@epita.fr>
9863
9864 * doc/bison.texinfo (Implementing Loops): Rename as...
9865 (Implementing Gotos/Loops): this.
9866
9867 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9868
9869 Adjust to latest gnulib.
9870 * bootstrap (gnulib_modules): Add xalloc-die.
9871 Set LC_ALL=C so that file names sort consistently.
9872 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9873 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9874 uintmax_t.m4, ulonglong.m4.
9875 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9876 po.m4 since we are now using _gl.m4 instead.
9877
9878 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9879
9880 * src/scan-action.l: Remove. Scanning of semantic actions is
9881 handled in scan-gram.l.
9882
9883 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9884
9885 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9886
9887 * src/location.h (struct): The file member is a uniqstr.
9888 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9889
9890 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9891
9892 Fix bug with non-%union parsers that have printers or destructors,
9893 which led to a Bison core dump. Reported by Peter Fales in
9894 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
9895
9896 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9897 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9898 not to our own type.
9899 * src/output.c (symbol_destructors_output, symbol_printers_output):
9900 Don't assume %union.
9901 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
9902 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
9903 UNION-FLAG. All callers changed.
9904 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
9905 Use type char, not unsigned int, when declaring an array of char;
9906 this lets us remove a cast.
9907 (Printers and Destructors): Add non-%union test cases.
9908
9909 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9910
9911 * doc/bison.texinfo: Minor editorial changes, mostly to the new
9912 GLR writeups. E.g., avoid frenchspacing and the future tense,
9913 change "lookahead" to "look-ahead", and change "wrt" to "with
9914 respect to".
9915
9916 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9917
9918 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
9919 New sections, split off from the GLR Parsers section. Put the new
9920 Simple GLR Parser near the start of the GLR section, for clarity.
9921 Rewrite connective text.
9922
9923 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
9924
9925 * doc/bison.texinfo (Simple GLR Parsers): New section.
9926
9927 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9928
9929 * NEWS, TODO, doc/bison.texinfo:
9930 Use "look-ahead" instead of "lookahead", to be consistent.
9931 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
9932 while we're fixing "look-ahead".
9933 * src/conflicts.c (shift_set): Renamed from shiftset.
9934 (look_ahead_set): Renamed from lookaheadset.
9935 * src/print.c: Likewise.
9936 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
9937 name for "lookahead".
9938 (report_types, usage): Likewise.
9939 * src/getargs.h (report_look_ahead_tokens): Renamed from
9940 report_lookaheads.
9941 * src/lalr.c (compute_look_ahead_tokens): Renamed from
9942 compute_lookaheads.
9943 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
9944 (look_ahead_tokens_print): Renamed from lookaheads_print.
9945 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
9946 state_rule_lookaheads_print.
9947 * src/state.h: Likewise.
9948 (reductions.look_ahead_tokens): Renamed from lookaheads.
9949 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
9950 AT_DATA_LOOKAHEADS_GRAMMAR.
9951
9952 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
9953
9954 * README: Update location of patched M4 distribution.
9955
9956 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
9957
9958 Don't assume the C++ compiler takes the same arguments as the C compiler
9959 (trivial change).
9960 * configure.ac (O0CXXFLAGS): New var.
9961 * tests/atlocal.in (CXXFLAGS): Use it.
9962
9963 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
9964
9965 Fix some "make check" problems with C++ reported by
9966 Albert Chin-A-Young for Tru64 C++ in this thread:
9967 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
9968
9969 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
9970 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9971 Output to a .cc file for C++, not to a .c file.
9972 * tests/calc.at (AT_CHECK_CALC): Likewise.
9973 * tests/regression.at (AT_CHECK_DANCER): Likewise.
9974 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
9975
9976 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
9977
9978 * tests/calc.at, tests/actions.at: Workaround for SGI
9979 C++ compiler. (trivial change)
9980
9981 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
9982
9983 Spent a few hours checking out which prerequisite versions the
9984 current sources actually require. I went all the way back to
9985 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
9986 a seemingly endless set of combinations of versions more recent
9987 than that. The bottom line is that the current sources require
9988 fairly recent versions of the build tools, and it'll be some work
9989 to change this.
9990 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
9991 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
9992 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
9993 Add comments explaining why those particular versions are
9994 currently needed.
9995
9996 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
9997 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
9998 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
9999
10000 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10001 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10002
10003 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10004
10005 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10006 0.11.5. Suggested by Bruno Haible.
10007 * bootstrap: Remove gettext version checking.
10008
10009 * doc/bison.texinfo (Decl Summary): Also mention that %union
10010 can depend on prerequisite types. Problem reported by Tim
10011 Van Holder.
10012
10013 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10014
10015 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10016 * README-alpha: Don't tell people not to package this.
10017
10018 * bootstrap: Don't assume $(...) works; use `...` instead.
10019 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10020 gettext better.
10021
10022 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10023 put into the -d output file, and mention what to do if YYSTYPE is
10024 defined as a macro.
10025
10026 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10027
10028 Undo change made earlier today: it caused autopoint to not bring
10029 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10030 autopoint's.
10031
10032 * bootstrap: Check that gettext version matches what's in
10033 configure.ac. Warn users to ignore robots.txt ERROR 404.
10034 * bootstrap: Undo today's earlier change (logged below).
10035 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
10036
10037 The gettext version checking is causing more trouble than it's
10038 curing; remove it. Problem reported by Paul Hilfinger.
10039
10040 * bootstrap: Issue a warning that one can expect a message
10041 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10042 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10043
10044 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10045
10046 Ensure that the C++ compiler used for testing actually works on a
10047 simple test program; if not, skip the C++-related tests. Problem
10048 reported by Vin Shelton in:
10049 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
10050
10051 * m4/cxx.m4: New file.
10052 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10053 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10054 * tests/local.at (AT_COMPILE_CXX): Use it.
10055
10056 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10057
10058 * data/glr.c (yylloc): Output this macro even if locations are not
10059 being generated, as the GLR parser needs it even in that case.
10060 Problem reported by Troy A. Johnson
10061 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10062
10063 * configure.ac (AC_INIT): Update to 1.875e.
10064
10065 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10066
10067 * NEWS: Version 1.875d.
10068 * configure.ac (AC_INIT): Likewise.
10069 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10070
10071 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10072 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10073 lalr1.cc runs afoul of the first, and the last two are no longer
10074 supported by GCC 3.4.0.
10075 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10076 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10077
10078 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10079
10080 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10081 unsigned int, for compatibility with latest gnulib hash module.
10082 * src/state.c (state_hash, state_hasher): Likewise.
10083 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10084 * src/uniqstr.c (hash_uniqstr): Likewise.
10085
10086 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10087
10088 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10089
10090 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10091 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10092 character and string literals.
10093 (unexpected_end): New function.
10094 (unexpected_eof): Use it.
10095 (unexpected_newline): New function.
10096 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10097 actions.
10098
10099 * NEWS: Document %expect-rr.
10100
10101 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10102 Fix typo by replacing $1 with $option.
10103 Remove more 'intl'-related files.
10104 Don't DEFUN AM_INTL_SUBDIR twice.
10105
10106 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10107 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10108 strtoul.c.
10109 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10110 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10111 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10112 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10113 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10114 * src/.cvsignore: Add *.output.
10115
10116 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10117 gets copied to the output file.
10118
10119 2004-04-28 Paul Eggert <eggert@twinsun.com>
10120
10121 Get files from the gnulib and po repositories, instead of relying
10122 on them being in our CVS. Upgrade to latest versions of gnulib
10123 and Automake.
10124
10125 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10126 * bootstrap: Bootstrap from gnulib and po repositories.
10127 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10128 * README-cvs: Document these changes. Remove version numbers from
10129 mentions of build tools, since they change so often. Mention Flex.
10130
10131 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10132 (gl_USE_SYSTEM_EXTENSIONS): Add.
10133 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10134 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
10135 does this for us.
10136 (AC_ISC_POSIX): Remove; we no longer support this
10137 ancient OS, as it gets in the way of latest Autoconf & gnulib.
10138 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10139 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10140 Do not check for C89 headers, except for locale.h which is used
10141 by the Yacc library and must port to K&R hosts.
10142 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10143 Do not check for C89 functions, except for setlocale which is
10144 used by the Yacc library.
10145 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10146 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10147 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10148 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10149 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10150 AM_GNU_GETTEXT): Remove; now done by:
10151 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10152 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10153 for us.
10154
10155 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10156 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10157 Define to empty, as gnulib.mk will do the rest for us.
10158 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10159 for us.
10160 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10161 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10162
10163 * src/files.c: Include gnulib's xstrndup.h.
10164
10165 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10166 (REALLOC): Use xnrealloc, for likewise.
10167 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10168 (strnlen, memrchr): Remove decls; functions no longer used.
10169 Include <stpcpy.h>.
10170
10171 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10172 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10173 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10174 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10175 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10176 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10177 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10178 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10179 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10180 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10181 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10182 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10183 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10184 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10185 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10186 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10187 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10188 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10189 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10190 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10191 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10192 Remove, as these files are now generated automatically
10193 by bootstrap or automake.
10194
10195 * po/ChangeLog: Remove: all but one entry was a duplicate
10196 of this file, and I moved that 2000-11-02 entry here.
10197
10198 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10199 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10200 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10201 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10202 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10203 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10204 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10205 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10206 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10207 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10208 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10209 xstrndup.h.
10210 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10211 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10212 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10213 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10214 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10215 * src/.cvsignore: Remove *_.c.
10216
10217
10218 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10219 support it. (The latest stable gzip doesn't.)
10220
10221 2004-04-27 Paul Eggert <eggert@twinsun.com>
10222
10223 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10224 case, as stos_ is now used by destructors due to the 2004-02-09
10225 change.
10226
10227 Remove more K&R C support.
10228 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10229 * lib/subpipe.c (errno): Remove decl.
10230 Include <stdlib.h> unconditionally.
10231 (EXIT_FAILURE): Remove macro.
10232 * src/complain.c (vfprintf, strerror): Remove.
10233 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10234 unconditionally.
10235 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10236 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10237 (strchr, strspn, memchr): Remove decls.
10238 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10239 unconditionally. Do not declare perror.
10240 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10241 unconditionally.
10242
10243 * src/complain.c (_): Remove useless defn, as system.h defines this.
10244
10245 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10246 with latest obstack.h.
10247 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10248 to procedure types, as obstack.h now does that for us.
10249 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10250
10251 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10252 so that this include file can stand alone.
10253 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10254 does this now. Include subpipe.h first after config.h, to
10255 test whether it can stand alone.
10256
10257 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10258 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10259 unused declaration.
10260
10261 * tests/synclines.at (%union synch line): Put a dummy member in
10262 the union, because empty unions aren't allowed in C. Caught
10263 by GCC 3.4.0.
10264
10265 2004-04-13 Jim Meyering <jim@meyering.net>
10266
10267 * src/conflicts.c (conflicts_print): Correct format string typo:
10268 use `%%' to produce literal `%'. (trivial change)
10269
10270 2004-03-30 Paul Eggert <eggert@twinsun.com>
10271
10272 * src/getargs.c (version): Update copyright year to 2004.
10273
10274 * data/c.m4 (b4_int_type): Use 'short int' rather than
10275 'short', and similarly for 'long', 'unsigned', etc.
10276 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10277 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10278 yy_yypstack, yydumpstack): Likewise.
10279 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10280 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10281 Likewise.
10282 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10283 yy_stack_print, yyparse): Likewise.
10284 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10285 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10286 * lib/bitset.c (bitset_print): Likewise.
10287 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10288 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10289 * lib/bitsetv.c (bitsetv_dump): Likewise.
10290 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10291 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10292 Likewise.
10293 * src/LR0.c (allocate_itemsets): Likewise.
10294 * src/gram.h (rule_number, rule): Likewise.
10295 * src/lalr.h (goto_number): Likewise.
10296 * src/nullable.c (nullable_compute): Likewise.
10297 * src/output.c (prepare_rules): Likewise.
10298 * src/relation.c (relation_print, relation_digraph): Likewise.
10299 * src/relation.h (relation_node): Likewise.
10300 * src/state.h (state_number, transitions, errs, reductions,
10301 struct state): Likewise.
10302 * src/symtab.h (symbol_number, struct symbol): Likewise.
10303 * src/tables.c (vector_number, tally, action_number,
10304 default_goto, goto_actions): Likewise.
10305 * tests/existing.at (GNU Cim Grammar): Likewise.
10306 * tests/regression.at (Web2c Actions): Likewise.
10307
10308 * src/output.c (muscle_insert_short_int_table): Renamed from
10309 muscle_insert_short_table. All uses changed.
10310
10311 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10312
10313 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10314 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10315 Add %expect-rr rule.
10316
10317 * src/scan-gram.l: Recognize %expect-rr.
10318
10319 * src/conflicts.h (expected_sr_conflicts): Rename from
10320 expected_conflicts.
10321 (expected_rr_conflicts): Declare.
10322
10323 * src/conflicts.c (expected_sr_conflicts): Rename from
10324 expected_conflicts.
10325 (expected_rr_conflicts): Define.
10326 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10327 for GLR parsers.
10328 Use expected_sr_conflicts in place of expected_conflicts.
10329 Warn if expected_rr_conflicts used in non-GLR parser.
10330
10331 * doc/bison.texinfo: Add documentation for %expect-rr.
10332
10333 2004-03-08 Paul Eggert <eggert@gnu.org>
10334
10335 Add support for hex token numbers. Suggested by Odd Arild Olsen in
10336 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
10337
10338 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10339 in lalr1.cc.
10340 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10341 * src/scan-gram.l (scan_integer): New function.
10342 ({int}): Use it.
10343 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10344 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10345 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10346 Say "long int", not "long", for uniformity with GNU style.
10347
10348 2004-02-25 Paul Eggert <eggert@twinsun.com>
10349
10350 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10351 compilers. This fixes a problem with Intel's C++ compiler being
10352 chatty, reported by Guido Trentalancia in
10353 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
10354
10355 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10356
10357 Support %destructor and merge error locations in lalr1.cc.
10358
10359 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10360 (Parser::stos_): Define unconditionally.
10361 (Parser::destruct_): New method. Generate its body with
10362 b4_yydestruct_generate.
10363 (Parser::error_start_): New attribute.
10364 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10365 token which are discarded.
10366 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10367 error_start_ when erroneous token are discarded.
10368 (Parser::parse) <yyerrlab1>: Compute the location of the error
10369 token so that it covers all the discarded tokens.
10370 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10371 it can be called with `%skeleton "lalr1.cc"', and do that.
10372
10373 2004-02-02 Paul Eggert <eggert@twinsun.com>
10374
10375 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10376 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10377 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10378 There's no need to mention top_builddir since Automake does that
10379 for us.
10380 (INCLUDES): Remove, as Automake says it's obsolescent.
10381 Contents migrated into AM_CPPFLAGS as described above.
10382 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10383
10384 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10385
10386 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10387 (yyreportSyntaxError): Handle case where lookahead token is
10388 YYEMPTY.
10389
10390 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10391
10392 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10393 resulting parsers are compilable with C++.
10394
10395 2003-12-23 Paul Eggert <eggert@twinsun.com>
10396
10397 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10398 * src/output.c (output_skeleton): Rename local var.
10399 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10400 Bison tokens, as this runs afoul of the 2003-10-07 change that
10401 disallowed NUL bytes in character constants or string literals.
10402
10403 * tests/local.at: Require Autoconf 2.59's Autotest.
10404 * tests/testsuite.at: Don't include local.at, since we now assume
10405 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10406 including it.
10407 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10408 multiple inclusion warnings.
10409
10410 2003-12-02 Akim Demaille <akim@epita.fr>
10411
10412 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10413 conditions.
10414 From Bruno Haible.
10415
10416 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10417
10418 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10419
10420 2003-10-07 Paul Eggert <eggert@twinsun.com>
10421
10422 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10423 if testsuite doesn't exist.
10424
10425 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10426 literals, unfortunately.
10427 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10428 Complain about NUL bytes in character constants or string literals.
10429
10430 2003-10-05 Paul Eggert <eggert@twinsun.com>
10431
10432 * NEWS: Don't document %no-default-prec, as it's still
10433 too experimental.
10434 * doc/bison.texinfo: Document %no-default-prec only if
10435 the defaultprec flag is set. Normally it's not.
10436
10437 2003-10-04 Paul Eggert <eggert@twinsun.com>
10438
10439 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10440 non-modifiable lvalue, instead of a modifiable one.
10441 * doc/bison.texinfo (Actions): Document that $$ can
10442 be assigned to. Do not claim that $$ and $N are
10443 array element references: user code should not rely on this.
10444
10445 2003-10-01 Paul Eggert <eggert@twinsun.com>
10446
10447 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10448 (grammar_declaration): Use it.
10449 * src/scan-gram.l: New token %no-default-prec.
10450 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10451 * NEWS, doc/bison.texinfo: Document the above.
10452
10453 2003-10-01 Akim Demaille <akim@epita.fr>
10454
10455 VCG no longer supports long_straight_phase.
10456
10457 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10458 * src/print_graph.c (print_graph): Adjust.
10459
10460 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
10461 and Paul Eggert <eggert@twinsun.com>
10462
10463 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10464 Table of Symbols): Document %default-prec.
10465 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10466 (grammar_declaration): Set default_prec on %default-prec.
10467 * src/scan-gram.l (%default-prec): New token.
10468 * src/reader.h (default_prec): New flag.
10469 * src/reader.c: Likewise.
10470 (packgram): Handle it.
10471 * tests/conflicts.at (%default-prec without %prec,
10472 %default-prec with %prec, %default-prec 1): New tests.
10473
10474 2003-09-30 Paul Eggert <eggert@twinsun.com>
10475
10476 * tests/testsuite.at: Include local.at, not input.at, fixing
10477 a typo in the 2003-08-25 patch.
10478
10479 2003-08-27 Akim Demaille <akim@epita.fr>
10480
10481 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10482 GCC warnings.
10483
10484 2003-08-26 Akim Demaille <akim@epita.fr>
10485
10486 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10487 "<\#" to avoid magic from Gnus when posting parts of this script.
10488
10489 2003-08-26 Akim Demaille <akim@epita.fr>
10490
10491 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10492 (Parser::parse): here.
10493 Adjust: nerrs and errstatus is now replaced by...
10494 (Parser::nerrs_, Parser::errstatus_): New.
10495
10496 2003-08-25 Akim Demaille <akim@epita.fr>
10497
10498 * config/announce-gen, Makefile.cfg: New.
10499 * Makefile.am: Adjust.
10500 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10501 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10502
10503 2003-08-25 Akim Demaille <akim@epita.fr>
10504
10505 When reducing initial empty rules, Bison parser read an initial
10506 location that is not defined. This results in garbage, and that
10507 affects Bison's own parser. Therefore we need (i) to extend Bison
10508 to support a means to initialize this location, and (ii) to use
10509 this CVS Bison to fix CVS Bison's parser.
10510
10511 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10512 with...
10513 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10514 * src/parse-gram.y: Adjust.
10515 (%initial-action): New.
10516 (%error-verbose): Since we require CVS Bison, there is no reason
10517 not to use it.
10518 * src/scan-gram.l: Adjust.
10519 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10520 * data/yacc.c (yyparse): Use b4_initial_action.
10521
10522 2003-08-25 Akim Demaille <akim@epita.fr>
10523
10524 * doc/bison.texinfo: Don't promote stdout for error messages.
10525
10526 2003-08-25 Akim Demaille <akim@epita.fr>
10527
10528 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10529 From Alexandre Duret-Lutz.
10530
10531 2003-08-25 Akim Demaille <akim@epita.fr>
10532
10533 Version 1.875c.
10534
10535 2003-08-25 Akim Demaille <akim@epita.fr>
10536
10537 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10538 Use them.
10539
10540 2003-08-25 Akim Demaille <akim@epita.fr>
10541
10542 * data/lalr1.cc (Parser::reduce_print_): New.
10543 Use it.
10544
10545 2003-08-25 Akim Demaille <akim@epita.fr>
10546
10547 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10548 error recovery loops. This patch is based on
10549 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
10550 Also, augment the similarity between lalr1.cc and yacc.c.
10551 Note: the locations of error recovery rules are not correct yet.
10552
10553 * data/lalr1.cc: Comment changes to augment the similarity between
10554 lalr1.cc and yacc.c.
10555 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10556 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10557 yyerrlab), when hitting EOF, pop the whole stack here instead of
10558 merely falling thru the default error handling mechanism.
10559 (yyerrorlab): New label, with the old contents of YYERROR,
10560 plus the following change: pop the stack of rhs corresponding
10561 to the production that invoked YYERROR. That is how Yacc
10562 behaves (required by POSIX).
10563 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10564 fail.
10565
10566 2003-08-25 Akim Demaille <akim@epita.fr>
10567
10568 Tune local.at so that people can "autom4te -l autotest calc.at -o
10569 calc" for instance, to extract a sub test suite.
10570
10571 * tests/testsuite.at: Move the initialization, Autotest version
10572 requirement, and AT_TESTED invocation into...
10573 * tests/local.at: here.
10574 * tests/testsuite.at: Include it for compatibility with Autoconf
10575 2.57.
10576 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10577 be ignore.
10578
10579 2003-08-04 Paul Eggert <eggert@twinsun.com>
10580
10581 Rework code slightly to avoid gcc -Wtraditional warnings.
10582 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10583 The returned value is now stored in *YY0. All callers changed.
10584 * src/output.c (merge_output): Adjust to the above change.
10585
10586 2003-07-26 Paul Eggert <eggert@twinsun.com>
10587
10588 * data/glr.c (YYASSERT): New macro.
10589 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10590 yyresolveStates, yyprocessOneStack):
10591 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10592 Derived from a suggestion by Frank Heckenbach.
10593
10594 2003-07-25 Paul Eggert <eggert@twinsun.com>
10595
10596 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10597 for portability to K&R C (after ansi2knr, presumably). See
10598 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
10599 by Frank Heckenbach, though I have omitted the structure-initialization
10600 part of his glr-knr.diff patch since I recall that the Portable
10601 C Compiler didn't require that change.
10602
10603 Let the user specify how to allocate and free memory.
10604 Derived from a suggestion by Frank Heckenbach in
10605 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
10606 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10607 All uses of free, malloc, realloc changed to use these macros,
10608 and unnecessary casts removed.
10609 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10610
10611 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10612
10613 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10614 use s.empty() rather than s == "" to test for empty string; see
10615 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
10616 (trivial change)
10617
10618 2003-06-25 Akim Demaille <akim@epita.fr>
10619
10620 * config/depcomp, config/install-sh: Update from masters.
10621
10622 2003-06-20 Paul Eggert <eggert@twinsun.com>
10623
10624 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10625 and return properly parenthesized result.
10626 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10627 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10628 Remove unnecessary parentheses from uses.
10629 * doc/bison.texinfo (Location Default Action): Describe the
10630 conventions for parentheses.
10631
10632 2003-06-19 Paul Eggert <eggert@twinsun.com>
10633
10634 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10635 yyreportTree): Do not assume that size_t is the same width as int,
10636 when printing sizes. Print sizes using an unsigned format.
10637 Problem reported by Frank Heckenbach in
10638 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
10639
10640 Port to Forte Developer 7 C compiler.
10641 * data/glr.c (struct YYLTYPE): If locations are not being used,
10642 declare a single dummy member, as empty structs do not conform
10643 to the C standard.
10644 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10645 the Forte Developer 7 C compiler complains that end-of-loop
10646 code is not reached.
10647
10648 2003-06-17 Paul Eggert <eggert@twinsun.com>
10649
10650 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10651 avoid warnings from picky compilers about redefinition of PARAMS.
10652
10653 2003-06-17 Paul Eggert <eggert@twinsun.com>
10654
10655 Version 1.875b.
10656
10657 * NEWS: Document 1.875b.
10658
10659 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10660 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10661 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10662 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10663 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10664 per recent gettext manual's suggestion.
10665 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10666 Use prototypes, not old-style definitions.
10667 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10668 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10669 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10670 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10671 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10672 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10673 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10674 vbitset_or_and_cmp, vbitset_copy): Likewise.
10675
10676 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10677 Do not include <stdlib.h>.
10678 (PARAMS): Define unconditionally for C89.
10679 (ATTRIBUTE_NORETURN): Remove.
10680 (ATTRIBUTE_UNUSED): Define unconditionally.
10681
10682 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
10683 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
10684 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10685 * lib/vbitset.c, lib/vbitset.h: New files.
10686 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10687 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10688 from libbitset.
10689
10690 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10691 `How Can I Reset @code{yyparse}', since texinfo does not allow
10692 arbitrary @ in node names.
10693
10694 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10695 shouldn't be needed according to the gettext 0.12.1 documentation
10696 but which seem to be needed anyway: codeset.m4 glibc21.m4
10697 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
10698 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
10699 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
10700
10701 * lib/.cvsignore: Add stdbool.h.
10702 * m4/.cvsignore: Add nls.m4, po.m4.
10703
10704 Upgrade to CVS gnulib.
10705 * stdbool_.h: File renamed from stdbool.h.in.
10706 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10707 AC_HEADER_STDBOOL.
10708 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10709 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10710 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10711 (MOSTLYCLEANFILES): New var.
10712 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10713 (stdbool.h): New rule.
10714 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10715 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10716 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10717 m4/quote.m4: Upgrade to today's gnulib.
10718
10719 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10720 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10721 the tests right now.
10722 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10723 yyerror are declared before use; C99 requires this.
10724
10725 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10726
10727 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10728 first.
10729 (yyrecoverSyntaxError): Correct the logic for setting and testing
10730 yyerrState.
10731 Correct comment on handling EOF.
10732 Allow states with only a default reduction, rather than failing
10733 (I can't quite reconstruct why these were not allowed before).
10734
10735 Fixes to avoid problem that $-N rules in GLR parsers can cause
10736 buffer overruns, corrupting state.
10737
10738 * src/output.c (prepare_rules): Output max_left_semantic_context
10739 definition.
10740 * src/reader.h (max_left_semantic_context): New variable declaration.
10741 * src/scan-gram.l (max_left_semantic_context): Define.
10742 (handle_action_dollar): Update max_left_semantic_context.
10743 * data/glr.c (YYMAXLEFT): New definition.
10744 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10745 (yyresolveAction): Ditto.
10746
10747 Fixes to problems with location handling in GLR parsers reported by
10748 Frank Heckenbach (2003/06/05).
10749
10750 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10751 (YYRHSLOC): Add parentheses, and define only if locations used.
10752 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10753 locations not used.
10754 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10755 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
10756
10757 * tests/cxx-type.at: Exercise location information; update tests
10758 to differentiate output with and without locations.
10759 Remove forward declarations of yylex and yyerror---caused errors
10760 because default YYLTYPE not yet defined.
10761 Change semantic actions to compute strings, rather than printing
10762 them directly (to test proper passing of semantics values). Change
10763 output to prefix notation and update test data and expected results.
10764 (yylex): Track locations.
10765 (stmtMerge): Return value rather than printing, and include arguments
10766 in value.
10767
10768 2003-06-03 Paul Eggert <eggert@twinsun.com>
10769
10770 Avoid warnings generated by GCC 2.95.4 when Bison is
10771 configured with --enable-gcc-warnings.
10772 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10773 yy::]b4_parser_class_name[::translate_,
10774 yy::Stack::operator[] (unsigned),
10775 yy::Stack::operator[] (unsigned) const,
10776 yy::Slice::operator[] (unsigned),
10777 yy::Slice::operator[] (unsigned) const):
10778 Rename local vars to avoid warnings.
10779 * tests/glr-regression.at (Improper handling of embedded actions
10780 and $-N in GLR parsers): Remove unused local variable from yylex.
10781 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10782 (void) as arg when not pure, since we now assume C89 when building
10783 Bison. Pacify GCC by using parameter.
10784
10785 2003-06-02 Paul Eggert <eggert@twinsun.com>
10786
10787 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10788 yy::Location::lines, yy::Location::columns): Rename arguments
10789 to avoid shadowing; this removes a warning generated by GCC 3.3.
10790
10791 2003-06-01 Paul Eggert <eggert@twinsun.com>
10792
10793 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10794 to g++, as GCC 3.3 complains if you do it.
10795 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10796 everything that WARNING_CFLAGS has, except omit warnings
10797 not suitable for C++.
10798 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10799 * tests/atlocal.in (CXXFLAGS): New var.
10800 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10801
10802 Fix a GLR parser bug I reported in February; see
10803 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
10804 The problem was that GLR parsers did not conform to the C standard,
10805 because actions like { $1 = $2 + $3; } expanded to expressions
10806 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10807 to a local variable. The C standard says that expressions
10808 like (var = f ()) + (var = f ()) have undefined behavior.
10809 Another problem was that GCC sometimes issues warnings that
10810 yyfill and its parameters are unused.
10811
10812 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10813 as possibly unused.
10814 (yyfill): New function.
10815 (YYFILL): Use it.
10816 (yyuserAction): Change type of yynormal to bool, so that it matches
10817 the new yyfill signature. Mark it as possibly unused.
10818
10819
10820 Follow up on a bug I reported in February, where a Bison-generated
10821 parser can loop. Provide a test case and a fix for yacc.c. I
10822 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10823 The original bug report is in:
10824 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
10825
10826 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10827 macro's size was becoming unwieldy.
10828 (yyerrlab): Do not discard an empty lookahead symbol, as this
10829 might destroy garbage.
10830 (yyerrorlab): New label, with the old contents of YYERROR,
10831 plus the following change: pop the stack of rhs corresponding
10832 to the production that invoked YYERROR. That is how Yacc
10833 behaves, and POSIX requires this behavior.
10834 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10835 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10836 Define 'alarm' to do nothing if unistd.h is not available.
10837 Add a new rule "exp: '-' error;" to test the above change to
10838 data/yacc.c. Use 'alarm' to abort any test taking longer than
10839 10 seconds, as it's probably looping.
10840 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10841 Also, the new yacc.c generates two fewer diagnostics for an
10842 existing test.
10843
10844 2003-05-24 Paul Eggert <eggert@twinsun.com>
10845
10846 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10847 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10848 This fixes a problem reported by John Bowman when the Compaq/HP
10849 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10850 -ansi -Wall -gall).
10851 * data/yacc.c (union yyalloc): Likewise.
10852 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
10853
10854 Switch from 'int' to 'bool' where that makes sense.
10855
10856 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10857 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10858 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10859 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10860 Return or accept bool, not int. All callers changed.
10861 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10862 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10863 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10864 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10865 bitset_or_and_cmp_): Likewise.
10866 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10867 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10868 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10869 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10870 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10871 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10872 bitset_stats_or_and_cmp): Likewise.
10873 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10874 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10875 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10876 ebitset_xor_cmp): Likewise.
10877 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10878 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10879 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10880 lbitset_xor_cmp): Likewise.
10881 * lib/bbitset.h: Include <stdbool.h>.
10882 (struct bitset_vtable): The following members now return bool, not
10883 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10884 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10885 or_and_cmp).
10886 * src/conflicts.c (count_rr_conflicts): Likewise.
10887 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10888 All uses changed.
10889 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10890 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10891 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10892 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10893 graph_flag): Likewise.
10894 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10895 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10896 graph_flag): Likewise.
10897 * src/output.c (error_verbose): Likewise.
10898 * src/output.h (error_verbose): Likewise.
10899 * src/reader.c (start_flag, typed): Likewise.
10900 * src/reader.h (typed): Likewise.
10901 * src/getargs.c (LOCATIONS_OPTION): New constant.
10902 (long_options, getargs): Use it.
10903 * src/lalr.c (build_relations): Use bool, not int.
10904 * src/nullable.c (nullable_compute): Likewise.
10905 * src/print.c (print_reductions): Likewise.
10906 * src/tables.c (action_row, pack_vector): Likewise.
10907 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
10908 * src/output.c (prepare): Use it.
10909 * src/output.c (token_definitions_output,
10910 symbol_destructors_output, symbol_destructors_output): Use string,
10911 not boolean integer, to keep track of whether to output separator.
10912 * src/print_graph.c (print_core): Likewise.
10913 * src/state.c (state_rule_lookaheads_print): Likewise.
10914
10915 * config/install-sh: Sync from automake 1.7.5.
10916
10917 2003-05-14 Paul Eggert <eggert@twinsun.com>
10918
10919 * src/parse-gram.y (rules_or_grammar_declaration): Require a
10920 semicolon after a grammar declaration, in the interest of possible
10921 future changes to the Bison input language.
10922 Do not allow a stray semicolon at the start of the grammar.
10923 (rhses.1): Allow one or more semicolons after any rule, including
10924 just before "|" as required by POSIX.
10925 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
10926 grammar.
10927
10928 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
10929
10930 %parse-param support for lalr1.cc.
10931
10932 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
10933 b4_cc_constructor_calls, b4_cc_constructor_call,
10934 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
10935 definitions.
10936 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
10937 parse-param arguments.
10938 (yy::b4_parser_class_name): Declare instance variables to
10939 hold parse-param arguments.
10940 * tests/calc.at: s/value/semantic_value/ because value clashes
10941 with a member of yy::b4_parser_class_name. Adjust C++ code
10942 to handle %parse-param. Enable %parse-param test in C++.
10943
10944 2003-05-12 Paul Eggert <eggert@twinsun.com>
10945
10946 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
10947 English a bit. Fix fclose typo. Change "const char" to "char
10948 const", and use ANSI C rather than K&R for "main". Suggest
10949 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
10950 and suggest yy_switch_to_buffer.
10951
10952 2003-05-05 Paul Eggert <eggert@twinsun.com>
10953
10954 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
10955 C89. This avoids a diagnostic on compilers that define __STDC__
10956 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
10957 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
10958
10959 2003-05-03 Paul Eggert <eggert@twinsun.com>
10960
10961 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
10962 Do not overrun array bounds.
10963 This should fix a bug reported today by Olatunji Oluwabukunmi in
10964 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
10965
10966 2003-04-29 Akim Demaille <akim@epita.fr>
10967
10968 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
10969 * src/getargs.c, src/getargs.h: here, as bool, not int.
10970 (nondeterministic_parser): New.
10971 * src/parse-gram.y, src/scan-gram.l: Support
10972 %nondeterministic-parser.
10973 * src/output.c (prepare): Use nondeterministic_parser instead
10974 of glr_parser where appropriate.
10975 * src/tables.c (conflict_row, action_row, save_row)
10976 (token_actions, token_actions, pack_vector): Ditto.
10977
10978 2003-04-29 Akim Demaille <akim@epita.fr>
10979
10980 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
10981
10982 2003-04-29 Akim Demaille <akim@epita.fr>
10983
10984 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
10985 with %pure-parser and %locations to exercise the patch from Yakov
10986 Markovitch below.
10987
10988 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
10989
10990 * data/yacc.c: (b4_lex_param): Corrected for the case where
10991 %lex-param is provided and %pure-parser isn't.
10992
10993 2003-04-27 Paul Eggert <eggert@twinsun.com>
10994
10995 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
10996 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
10997 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
10998 if it is not defined.
10999 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11000
11001 2003-04-26 Paul Eggert <eggert@twinsun.com>
11002
11003 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11004 Declare to be of type suitable for the ninf value itself, not of
11005 type suitable for the corresponding table, since the latter might
11006 be unsigned but the ninf value might be negative. This fixes a
11007 bug reported by Alexandre Duret-Lutz in
11008 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
11009
11010 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11011 invokes it. We shouldn't invoke it twice because it will attempt
11012 to put error.o in the archive twice. This fixes a glitch reported
11013 by Martin Mokrejs in
11014 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11015
11016 2003-04-21 Paul Eggert <eggert@twinsun.com>
11017
11018 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11019 to gnulib.
11020
11021 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11022
11023 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11024 Fix obvious typo that results in uncompilable GLR parsers
11025 when both %pure-parser and %locations are used. (trivial change)
11026
11027 2003-04-17 Paul Eggert <eggert@twinsun.com>
11028
11029 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11030 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11031 Do not insert the expected token via unput, as this runs afoul
11032 of a POSIX-compatibility bug in flex 2.5.31.
11033 All uses changed to BEGIN the parent state,
11034 since we no longer insert the expected token via unput.
11035 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11036 that is no longer emitted after the above change.
11037
11038 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11039 the first one. This change is from Paul Hilfinger, and it fixes
11040 regression reported by Werner Lemberg in
11041 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
11042
11043 (resolve_sr_conflict): Don't invoke state_errs_set
11044 unless one or more tokens have been explicitly made errors.
11045 Otherwise, the above change causes Bison to abort.
11046
11047 * tests/existing.at (GNU pic Grammar): New test case, taken from
11048 Lemberg's email.
11049
11050 2003-03-31 Akim Demaille <akim@epita.fr>
11051
11052 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11053
11054 2003-03-31 Akim Demaille <akim@epita.fr>
11055
11056 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11057 output.
11058
11059 2003-03-31 Akim Demaille <akim@epita.fr>
11060
11061 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11062 From Paul Hilfinger.
11063
11064 2003-03-29 Akim Demaille <akim@epita.fr>
11065
11066 * m4/error.m4: Do not put under dynamic conditions some code which
11067 expansion is under static control.
11068
11069 2003-03-29 Akim Demaille <akim@epita.fr>
11070
11071 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11072
11073 2003-03-29 Akim Demaille <akim@epita.fr>
11074
11075 * doc/bison.texinfo (Strings are Destroyed): New.
11076
11077 2003-03-13 Paul Eggert <eggert@twinsun.com>
11078
11079 * .cvsignore: Add configure.lineno.
11080 * src/.cvsignore: Add yacc.
11081 * tests/.cvsignore: Add testsuite.log.
11082 * doc/fdl.texi: Sync with latest FSF version.
11083
11084 2003-03-12 Paul Eggert <eggert@twinsun.com>
11085
11086 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11087 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11088 cursor, instead of leaving it undefined. This fixes a bug
11089 reported by Tim Van Holder in
11090 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
11091 * tests/input.at (Torturing the Scanner): Test the scanner on
11092 an empty input file, which was Tim Van Holder's test case.
11093
11094 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11095 <sys/resource.h> can be included, include sys/time.h and
11096 sys/times.h first, if available. This works around the SunOS
11097 4.1.4 porting bug reported by Bruce Becker in
11098 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
11099
11100 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11101 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11102 AC_HEADER_SYS_WAIT.
11103
11104 Merge changes from gnulib. This was prompted because the CVS
11105 snapshot didn't build on Solaris 7 due to strnlen problems.
11106
11107 These changes need to be merged back into gnulib:
11108 * lib/hash.c: Include <stdbool.h> unconditionally.
11109 * m4/onceonly.m4 (m4_quote): New macro.
11110 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11111 Quote AC_FOREACH variable-expansions properly.
11112 The 2003-01-03 obstack.h change also needs merging.
11113 {end of changes requiring merging}
11114
11115 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11116 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11117 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11118 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11119 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11120 New files, imported from gnulib.
11121 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11122 above.
11123
11124 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11125 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11126 gnulib sources.
11127
11128 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11129 Add.
11130 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11131 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11132 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11133 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11134 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11135 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11136 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11137 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11138 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11139 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11140 (jm_PREREQ_ARGMATCH): Remove.
11141 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11142 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11143
11144 * src/system.h: Include <stdbool.h> unconditionally.
11145
11146 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11147 assuming at least C89 in the bitset code for some time now.
11148
11149 2003-03-03 Akim Demaille <akim@epita.fr>
11150
11151 * ro.po: New.
11152
11153 2003-03-02 Akim Demaille <akim@epita.fr>
11154
11155 * doc/bison.texinfo (Table of Symbols): Reactivate the
11156 documentation for %lex-param, and %parse-param.
11157
11158 2003-03-02 Akim Demaille <akim@epita.fr>
11159
11160 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11161 generate verbose error messages.
11162 Use the number of tokens as an upper bound in yytname, as it
11163 cannot be a non terminal.
11164
11165 2003-03-02 Akim Demaille <akim@epita.fr>
11166
11167 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11168 message.
11169
11170 2003-03-02 Akim Demaille <akim@epita.fr>
11171
11172 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11173 Use them to exercise yycheck overrun.
11174 Based on Andrew Suffield's grammar.
11175
11176 2003-03-02 Akim Demaille <akim@epita.fr>
11177
11178 Create tests/local.at for Bison generic testing macros.
11179
11180 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11181 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11182 This new file.
11183 * tests/calc.at (AT_CHECK_CALC): Adjust.
11184 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11185 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11186 * tests/local.at: here.
11187 (AT_COMPILE_CXX): Tags the tests using it as c++.
11188 Ignore the test if CXX is not functional.
11189
11190 2003-03-01 Paul Eggert <eggert@twinsun.com>
11191
11192 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11193 not loc->end, since loc->end might contain garbage and this leads
11194 to undefined behavior on some platforms.
11195 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11196 depend on *loc, so that the reader doesn't give the the false
11197 impression that *loc is initialized.
11198 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11199 does not survive the return.
11200
11201 2003-03-01 Akim Demaille <akim@epita.fr>
11202
11203 * src/scan-gram.l (code_start): Always initialize it when entering
11204 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11205 yylex invocation. An alternative would be making it static, but
11206 then it starts with the second %%'s beginning, instead of its end.
11207
11208 2003-02-28 Paul Eggert <eggert@twinsun.com>
11209
11210 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11211 around a UnixWare 7.1.1 porting bug reported by John Hughes in
11212 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
11213
11214 2003-02-26 Paul Eggert <eggert@twinsun.com>
11215
11216 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11217 Remove Sequent/Pyramid discussion (nobody uses them any more).
11218 Merge VMS and MS-DOS discussion; these ports may well be dead
11219 but let's keep mentioning them for now. Put <> around email
11220 addresses. Add copyright notice.
11221
11222 2003-02-24 Paul Eggert <eggert@twinsun.com>
11223
11224 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11225 to avoid collision with flex use of yylineno.
11226 Problem reported by Bruce Lilly in
11227 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
11228 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11229 * data/yacc.c (yy_reduce_print): Likewise.
11230
11231 * config/depcomp: Sync with Automake 1.7.3.
11232
11233 2003-02-21 Akim Demaille <akim@epita.fr>
11234
11235 * data/lalr1.cc: Use temporary variables instead of casts to
11236 change integer types.
11237 Suggested by Paul Eggert.
11238
11239 2003-02-21 Akim Demaille <akim@epita.fr>
11240
11241 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11242 to avoid confusions with lalr1.cc's notion of Position.
11243 Suggested by Paul Eggert.
11244
11245 2003-02-20 Akim Demaille <akim@epita.fr>
11246
11247 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11248 before initial_columns.
11249 (location.hh): Use consistent variable names when defining the
11250 operator<<.
11251 Use "last" so that we subtract from Positions, not from unsigned.
11252
11253 2003-02-20 Akim Demaille <akim@epita.fr>
11254
11255 * data/lalr1.cc (position.hh): New subfile, including the extended
11256 and Doxygen'ed documentation of class Position.
11257 (location.hh): Use it.
11258 Document a` la Doxygen.
11259 With the help of Benoit Perrot.
11260
11261 2003-02-20 Akim Demaille <akim@epita.fr>
11262
11263 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11264 AT_YACC_IF.
11265 Redefine AT_YYERROR_SEES_LOC_IF using it.
11266 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11267 not defined.
11268 Don't use the location in yy::Parser::error_ and
11269 yy::Parser::print_ when not %locations.
11270 Activate more lalr1.cc tests.
11271
11272 2003-02-19 Akim Demaille <akim@epita.fr>
11273
11274 * data/lalr1.cc: When displaying a line number, be sure to make it
11275 an int.
11276
11277 2003-02-19 Akim Demaille <akim@epita.fr>
11278
11279 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11280 Remove, useless.
11281 (YYABORT, YYACCEPT, YYERROR): New.
11282 * tests/calc.at: Renable the lalr1.cc test.
11283
11284 2003-02-19 Akim Demaille <akim@epita.fr>
11285
11286 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11287 error recovery, mixing with/without pops and discarding of the
11288 lookahead.
11289 Exercise YYERROR.
11290 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11291
11292 2003-02-17 Paul Eggert <eggert@twinsun.com>
11293
11294 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11295 * tests/testsuite.at (AT_COMPILE): Use them.
11296 This fixes the testsuite problem reported by Robert Lentz in
11297 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
11298
11299 2003-02-12 Paul Eggert <eggert@twinsun.com>
11300
11301 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11302 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
11303 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
11304 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11305 Check for malloc failure, for consistency with yacc.c.
11306 (yytname_size): Remove, for consistency with yacc.c.
11307
11308 The bug still remains in data/lalr1.cc, as I didn't have time
11309 to fix it there.
11310
11311 2003-02-06 Akim Demaille <akim@epita.fr>
11312
11313 * configure.ac (GXX): Rename as...
11314 (CXX): this, to keep the original Autoconf semantics.
11315 Require 2.57.
11316 * data/lalr1.cc: Fix b4_copyright invocations.
11317 If YYDEBUG is not defined, don't depend upon name_ being defined.
11318 (location.hh): Include string and iostream.
11319 (Position::filename): New member.
11320 (Position::Position ()): New.
11321 (operator<< (Position)): New.
11322 (operator- (Position, int)): New.
11323 (Location::first, Location::last): Rename as...
11324 (Location::begin, Location::end): these, to mock the conventional
11325 iterator names.
11326 (operator<< (Location)): New.
11327 * tests/atlocal.in (CXX): New.
11328 * tests/testsuite.at (AT_COMPILE_CXX): New.
11329 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11330 locations in a more synthetic way.
11331 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11332 lalr1.cc is used.
11333 Adjust the C locations to match those from Emacs: first column is
11334 column 0.
11335 Change all the expected results.
11336 Conform to the GCS: simplify the locations when applicable.
11337 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11338 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11339 these CPP macros with the m4 macros new defined by...
11340 (AT_CHECK_PUSHDEFS): this, i.e.:
11341 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
11342 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
11343 New macros.
11344 (AT_CHECK_POPDEFS): Undefine them.
11345 (AT_CHECK_CALC_LALR1_CC): New.
11346 Use it for the first lalr1.cc test.
11347
11348 2003-02-04 Akim Demaille <akim@epita.fr>
11349
11350 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11351 Location as is defined.
11352
11353 2003-02-04 Akim Demaille <akim@epita.fr>
11354
11355 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11356 name_ being defined.
11357
11358 2003-02-03 Paul Eggert <eggert@twinsun.com>
11359
11360 * src/gram.h (start_symbol): Remove unused decl.
11361
11362 Use more-consistent naming conventions for local vars.
11363
11364 * src/derives.c (derives_compute): Change type of local var from
11365 int to rule_number.
11366 * src/gram.c (grammar_rules_partial_print): Likewise.
11367 * src/print.c (print_core): Likewise.
11368 * src/reduce.c (reduce_grammar_tables): Likewise.
11369
11370 * src/gram.c (grammar_dump): Change name of item_number *
11371 local var from r to rp.
11372 * src/nullable.c (nullable_compute): Likewise.
11373
11374 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11375
11376 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11377 for symbol or symbol_number var.
11378 * src/reader.c (grammar_start_symbol_set): Likewise.
11379 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11380 Likewise.
11381 * src/state.c (transitions_to): Likewise.
11382 * src/state.h: Likewise.
11383 * src/tables.c (symbol_number_to_vector_number): Likewise.
11384
11385 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11386 char * var.
11387
11388 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11389 var.
11390
11391 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11392 var.
11393
11394 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11395 Use str, not s, for char * var. Use ch, not c, for character var.
11396 Use size for size var.
11397
11398 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11399 char * var.
11400 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11401 uniqstr var.
11402 * src/uniqstr.h: Likewise.
11403
11404 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11405 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11406 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11407 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11408 param to have same name as that of enum, so that we don't use
11409 "s" to stand for a non-state.
11410
11411 2003-02-02 Akim Demaille <akim@epita.fr>
11412
11413 * src/scan-skel.l: Scan more than one inert character per yylex
11414 invocation.
11415
11416 2003-02-01 Paul Eggert <eggert@twinsun.com>
11417
11418 Version 1.875a.
11419
11420 * po/LINGUAS: Add ms.
11421
11422 2003-01-30 Akim Demaille <akim@epita.fr>
11423
11424 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11425
11426 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11427
11428 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11429 of $1.
11430
11431 Changes in response to error report by S. Eken: GLR mode does not
11432 handle negative $ indices or $ indices in embedded rules correctly.
11433 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
11434
11435 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11436 (b4_rhs_location): Ditto.
11437 (yyfill): New function to copy from stack tree into array
11438 incrementally.
11439 (yyuserAction): Modify to allow incremental move of semantic values
11440 to rhs array when in GLR mode.
11441 Define YYFILL to use in user-defined actions to fill semantic array
11442 as needed.
11443 Remove dummy use of yystack, as there is now a guaranteed use.
11444 (yydoAction): Modify to allow incremental move of semantic values
11445 to rhs array when in GLR mode.
11446 (yyresolveAction): Ditto.
11447 (yyglrShiftDefer): Update comment.
11448 (yyresolveStates): Use X == NULL for pointers, not !X.
11449 (yyglrReduce): Ditto.
11450 (yydoAction): Ditto
11451
11452 * tests/glr-regr1.at: Rename to ...
11453 * tests/glr-regression.at: Add new regression test for the problems
11454 described above (adapted from S. Eken).
11455 Update copyright notice.
11456 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11457 * tests/Makefile.am: Ditto.
11458
11459 2003-01-28 Paul Eggert <eggert@twinsun.com>
11460
11461 * data/lalr1.cc: Do not use @output_header_name@ unless
11462 b4_defines_flag is set. This fixes two bugs reported by
11463 Tim Van Holder in
11464 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11465 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
11466
11467 2003-01-21 Paul Eggert <eggert@twinsun.com>
11468
11469 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11470 we don't need to worry about yyerrlab1 being reported as an
11471 "unused label" by non-GCC C compilers. The downside is that if
11472 locations are used then a couple of statements are duplicated each
11473 time YYERROR is invoked, but the upside is that the warnings
11474 should vanish.
11475 (yyerrlab1): Move code to YERROR.
11476 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11477 This reverts some of the 2002-12-27 change.
11478
11479 2003-01-17 Paul Eggert <eggert@twinsun.com>
11480
11481 * src/output.c (symbol_printers_output): Fix typo that led
11482 to core dump. Problem reported by Antonio Rus in
11483 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
11484
11485 2003-01-13 Akim Demaille <akim@epita.fr>,
11486 Quoc Peyrot <chojin@lrde.epita.fr>,
11487 Robert Anisko <anisko_r@lrde.epita.fr>
11488
11489 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11490 when the stacks contain one element, as the loop would otherwise
11491 free the last state, and then use the top state (the one we just
11492 popped). This means that the initial elements will not be freed
11493 explicitly, as is the case in yacc.c; it is not a problem, as
11494 these elements have fake values.
11495
11496 2003-01-11 Paul Eggert <eggert@twinsun.com>
11497
11498 * NEWS: %expect-violations are now just warnings, reverting
11499 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11500 bootstrapping problem reported by Matthias Klose; see
11501 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
11502 * src/conflicts.c (conflicts_print): Likewise.
11503 * tests/conflicts.at (%expect not enough, %expect too much,
11504 %expect with reduce conflicts): Likewise.
11505 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11506 that the warning is enabled if the number of conflicts changes
11507 (not necessarily increases).
11508
11509 * src/getargs.c (version): Update copyright year.
11510
11511 2003-01-09 Akim Demaille <akim@epita.fr>
11512
11513 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11514
11515 2003-01-08 Paul Eggert <eggert@twinsun.com>
11516
11517 * Makefile.maint (WGETFLAGS):
11518 New macro, containing "-C off" to disable proxy caches.
11519 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11520 (rel-check): Use $(WGET) instead of wget.
11521
11522 2003-01-06 Paul Eggert <eggert@twinsun.com>
11523
11524 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11525 the GLR paper of Scott, Johnstone and Hussain.
11526
11527 2003-01-04 Paul Eggert <eggert@twinsun.com>
11528
11529 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11530 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11531 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11532 (EXTRA_LIBRARIES): New var, for liby.a.
11533 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11534 (EXTRA_SCRIPTS): New var, for yacc.
11535
11536 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11537 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11538 Problem reported by Nelson H. F. Beebe.
11539
11540 2003-01-03 Paul Eggert <eggert@twinsun.com>
11541
11542 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11543 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11544 when compiling Bison 1.875's `bitset bset = obstack_alloc
11545 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11546
11547 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11548 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11549 grow to a huge size with typical invocation.
11550
11551 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11552 Use the pattern recommended by Autoconf 2.57, except also protect
11553 against double-definition.
11554 * src/system.h: Likewise.
11555 Portability issues reported by Nelson H. F. Beebe.
11556
11557 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11558 All uses changed. Provide a definition in both C and C++.
11559 (yytrue, yyfalse): Define even if defined (__cplusplus).
11560
11561 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11562 Reported by Nelson H. F. Beebe.
11563
11564 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11565
11566 2003-01-02 Paul Eggert <eggert@twinsun.com>
11567
11568 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11569 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11570 Bug reported by Nelson H. F. Beebe.
11571
11572 2003-01-01 Paul Eggert <eggert@twinsun.com>
11573
11574 * Version 1.875.
11575
11576 2002-12-30 Paul Eggert <eggert@twinsun.com>
11577
11578 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11579 Moved here from...
11580 (<INITIAL>","): Here. This causes stray "," to be treated
11581 more uniformly.
11582
11583 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
11584 last brace in braced code when not in Yacc mode, for compatibility
11585 with Bison 1.35. This resurrects the 2001-12-15 patch to
11586 src/reader.c.
11587
11588 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11589 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11590
11591 2002-12-28 Paul Eggert <eggert@twinsun.com>
11592
11593 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11594 that of SYM's type. This fixes Debian bug 168069, reported by
11595 Thomas Olsson.
11596
11597 2002-12-28 Paul Eggert <eggert@twinsun.com>
11598
11599 Version 1.75f.
11600
11601 Switch back to the Yacc style of conflict reports, undoing some
11602 of the 2002-07-30 change.
11603 * doc/bison.texinfo (Understanding): Use Yacc style for
11604 conflict reports. Also, use new way of locating rules.
11605 * src/conflicts.c (conflict_report):
11606 Renamed from conflict_report_yacc, removing the old
11607 'conflict_report'. Translate the entire conflict report at once,
11608 so that we don't assume that "," has the same interpretation in
11609 all languages.
11610 (conflicts_output): Use Yacc-style conflict report for each state,
11611 instead of our more-complicated style.
11612 (conflicts_print): Use Yacc-style conflict report, except print
11613 the input file name when not emulating Yacc.
11614 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11615 Conflicted Reduction, %expect not enough, %expect too much,
11616 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11617 * tests/existing.at (GNU Cim Grammar): Likewise.
11618 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11619
11620 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11621 fatal): Don't invoke fflush; it's not needed and it might even be
11622 harmful for stdout, as stdout might not be open.
11623 * src/reduce.c (reduce_print): Likewise.
11624
11625 2002-12-27 Paul Eggert <eggert@twinsun.com>
11626
11627 Fix a bug where error locations were not being recorded correctly.
11628 This problem was originally reported by Paul Hilfinger in
11629 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
11630
11631 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11632 top of the location stack's error locations.
11633 (yyerrlab): Set it. When discarding a token, push its location
11634 onto yylerrsp so that we don't lose track of the error's end.
11635 (yyerrlab1): Now is only the target of YYERROR, so that we can
11636 properly record the location of the action that failed. For GCC
11637 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11638 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11639 (yyerrlab2): New label, which yyerrlab now falls through to.
11640 Compute the error's location by applying YYLLOC_DEFAULT to
11641 the locations of all the symbols that went into the error.
11642 * doc/bison.texinfo (Location Default Action): Mention that
11643 YYLLOC_DEFAULT is also invoked for syntax errors.
11644 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11645 Error locations include the locations of all the tokens that were
11646 discarded, not just the last token.
11647
11648 2002-12-26 Paul Eggert <eggert@twinsun.com>
11649
11650 * src/files.c: Include quote.h.
11651 (compute_output_file_names): Warn if we detect conflicting
11652 outputs to the same file. This should catch the misunderstanding
11653 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11654
11655 * src/conflicts.c (conflicts_print): If the user specifies
11656 "%expect N", report an error if there are any reduce/reduce
11657 conflicts. This is what the manual says should happen.
11658 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11659 * tests/conflicts.at (%expect with reduce conflicts): New test.
11660
11661 Don't use m4_include on relative file names, as it doesn't work as
11662 desired if there happens to be a file with that name under ".".
11663
11664 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11665 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11666 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11667 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11668 * src/output.c (output_skeleton): Use full path names when
11669 specifying a file to include; don't rely on include path, as
11670 it's unreliable when the working file contains a file with
11671 that name.
11672
11673 2002-12-25 Paul Eggert <eggert@twinsun.com>
11674
11675 Remove obsolete references to bison.simple and bison.hairy.
11676 Problem mentioned by Aubin Mahe in
11677 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
11678 * data/glr.c: Comment fix.
11679 * doc/bison.1: Remove references. Also, mention "yacc".
11680
11681 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11682 with -g option.
11683
11684 * src/parse-gram.y (declaration): Use enum "report_states" rather
11685 than its numeric value 1.
11686
11687 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11688 opening a new one. This fixes Debian bug 165349, reported by
11689 Bruce Stephens.
11690
11691 2002-12-24 Paul Eggert <eggert@twinsun.com>
11692
11693 Version 1.75e.
11694
11695 * Makefile.maint (cvs-update): Don't assume that the shell
11696 supports $(...), as Solaris sh doesn't.
11697
11698 * src/parse-gram.y (lloc_default): Remove test for empty
11699 nonterminals at the end, since it didn't change the result.
11700
11701 2002-12-24 Paul Eggert <eggert@twinsun.com>
11702
11703 If the user does not define YYSTYPE as a macro, Bison now declares it
11704 using typedef instead of defining it as a macro. POSIX requires this.
11705 For consistency, YYLTYPE is also declared instead of defined.
11706
11707 %union directives can now have a tag before the `{', e.g., the
11708 directive `%union foo {...}' now generates the C code
11709 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11710 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11711 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11712 instead of `yyltype'.
11713
11714 `yystype' and `yyltype' are now obsolescent macros instead of being
11715 typedefs or tags; they are no longer documented and will be
11716 withdrawn in a future release.
11717
11718 * data/glr.c (b4_location_type): Remove.
11719 (YYSTYPE): Renamed from yystype.
11720 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11721 (struct YYLTYPE): Renamed from struct yyltype.
11722 (YYLTYPE): Renamed from yyltype.
11723 (yyltype, yystype): New (and obsolescent) macros,
11724 for backward compatibility.
11725 * data/yacc.c: Likewise.
11726
11727 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11728 does not specify a union tag. This is for compatibility with
11729 Solaris 9 yacc.
11730
11731 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11732 const *, since it is now modified by stripping surrounding { }.
11733 (current_braced_code): Remove.
11734 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11735 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11736 trailing " {...}". Now of type <chars>.
11737 (grammar_declaration): Adjust to bundled tokens.
11738 (code_content): Remove; stripping is now done by add_param.
11739 (print_token_value): Print contents of bundled tokens.
11740 (token_name): New function.
11741
11742 * src/reader.h (braced_code, current_braced_code): Remove.
11743 (token_name): New decl.
11744
11745 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11746 token_type, not braced_code code_kind. All uses changed.
11747 (SC_PRE_CODE): New state, for scanning after a keyword that
11748 has (or usually has) an immediately-following braced code.
11749 (token_type): New local var, to keep track of which token type
11750 to return when scanning braced code.
11751 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
11752 <INITIAL>"%parse-param", <INITIAL>"%printer",
11753 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11754 instead of returning a token type immediately.
11755 (<INITIAL>"{"): Set token type.
11756 (<SC_BRACED_CODE>"}"): Use it.
11757 (handle_action_dollar, handle_action_at): Now returns bool
11758 indicating success. Fail if ! current_rule; this prevents a core dump.
11759 (handle_symbol_code_dollar, handle_symbol_code_at):
11760 Remove; merge body into caller.
11761 (handle_dollar, handle_at): Complain in invalid contexts.
11762
11763 * NEWS, doc/bison.texinfo: Document the above.
11764 * NEWS: Fix years and program names in copyright notice.
11765
11766 2002-12-17 Paul Eggert <eggert@twinsun.com>
11767
11768 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11769 Reporting, Table of Symbols): Omit mentions of %lex-param and
11770 %parse-param from the documentation for now.
11771
11772 2002-12-15 Paul Eggert <eggert@twinsun.com>
11773
11774 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11775 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11776 lookahead symbol, and which sets yychar in parser actions) and it
11777 disagreed with the Bison documentation. Bug
11778 reported by Andrew Walrond.
11779
11780 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11781 as the caller now does that.
11782 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11783 (YYEMPTY): Parenthesize right hand side, since others use it.
11784 (yyparse): Don't assume that our generated code is the only code
11785 that sets yychar.
11786
11787 2002-12-13 Paul Eggert <eggert@twinsun.com>
11788
11789 Version 1.75d.
11790
11791 POSIX requires a "yacc" command.
11792 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11793 (MOSTLYCLEANFILES): Add yacc.
11794 (yacc): New rule.
11795 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
11796 as an alias for bison y.
11797
11798 * po/LINGUAS: Add da.
11799
11800 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11801 problem with latest <getopt.h>.
11802 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11803
11804 * doc/fdl.texi: Upgrade to 1.2.
11805 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11806 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11807 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11808 gnulib.
11809 * config/install-sh: Sync with autotools.
11810
11811 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
11812 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
11813 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11814 locations are requested.
11815 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11816 locations are requested.
11817
11818 2002-12-12 Paul Eggert <eggert@twinsun.com>
11819
11820 Remove unportable casts and storage allocation tricks.
11821 While we're at it, remove almost all casts, since they
11822 usually aren't needed and are a sign of trouble.
11823
11824 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11825
11826 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11827 the pointer DSET returned by malloc; this isn't portable.
11828 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11829 Similarly for DERIVES.
11830 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11831 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11832 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11833
11834 * src/derives.c (derives_compute): Do not bother invoking
11835 int_of_rule_number, since rule numbers are integers.
11836
11837 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11838 rather than XMALLOC (char, N).
11839
11840 * src/files.c (filename_split): Rewrite to avoid cast.
11841
11842 * src/gram.h (symbol_number_as_item_number,
11843 item_number_as_symbol_number, rule_number_as_item_number,
11844 item_number_as_rule_number):
11845 Now inline functions rather than macros, to avoid casts.
11846 * src/state.h (state_number_as_int): Likewise.
11847 * src/tables.c (state_number_to_vector_number,
11848 symbol_number_to_vector_number): Likewise.
11849
11850 * src/gram.h (int_of_rule_number): Remove; no longer used.
11851
11852 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11853 since the resulting storage is always stored into.
11854
11855 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11856 where it's needed.
11857
11858 * src/muscle_tab.c (muscle_m4_output):
11859 Now inline. Return bool, not int.
11860 * src/state.c (state_compare): Likewise.
11861 * src/symtab.c (symbol_check_defined,
11862 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11863 hash_compare_symbol, hash_symbol):
11864 Likewise.
11865 * src/uniqstr.c (uniqstr_print): Likewise.
11866 * src/muscle_tab.c (muscle_m4_output_processor):
11867 New function, to avoid casts.
11868 * src/state.c (state_comparator, stage_hasher): Likewise.
11869 * src/symtab.c (symbol_check_defined_processor,
11870 symbol_check_alias_consistency_processor, symbol_pack_processor,
11871 symbol_translation_processor, hash_symbol_comparator,
11872 hash_symbol_hasher): Likewise.
11873 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11874 * src/muscle_tab.c (muscles_m4_output):
11875 Use new functions instead of casting old functions unportably.
11876 * src/state.c (state_hash_new): Likewise.
11877 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11878 symbols_token_translations_init):
11879 Likewise.
11880 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11881
11882 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11883 var instead of casting to long, to avoid casts.
11884 (prepare_states): Use MALLOC rather than alloca, so that we don't
11885 have to worry about alloca.
11886 * src/state.c (state_hash_lookup): Likewise.
11887
11888 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11889 local var instead of casting to unsigned char, to avoid casts.
11890
11891 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11892 STATE_ALLOC): Remove.
11893 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11894 rather than calloc, and use offsetof to avoid allocating slightly
11895 too much storage.
11896 (state_new): Initialize all members.
11897
11898 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11899
11900 * src/symtab.c (symbol_free): Remove; unused.
11901 (symbol_get): Remove cast in lhs of assignment.
11902 (symbols_do): Now static. Accept generic arguments, not
11903 hashing-related ones.
11904
11905 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
11906 (symbol_processor): Remove.
11907 (symbols_do): Remove decl; now static.
11908
11909 * src/system.h (alloca): Remove; decl no longer needed.
11910 (<stddef.h>): Include, for offsetof.
11911 (<inttypes.>, <stdint.h>): Include if available.
11912 (uintptr_t): New type, if system lacks it.
11913 (CALLOC, MALLOC, REALLOC): New macros.
11914 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
11915 new macros.
11916
11917 * src/tables.c (table_size): Now int, to pacify GCC.
11918 (table_grow, table_ninf_remap): Use signed table size.
11919 (save_row): Don't bother initializing locals when not needed.
11920 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
11921 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
11922
11923 * src/vcg.h: Correct misspellings.
11924
11925 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
11926
11927
11928 * src/getargs.c (getargs): Don't assume EOF == -1.
11929
11930 2002-12-09 Paul Eggert <eggert@twinsun.com>
11931
11932 Change identifier spellings to avoid collisions with names
11933 that are reserved by POSIX.
11934
11935 Don't use names ending in _t, since POSIX reserves them.
11936 For consistency, remove _e and _s endings -- they're weren't
11937 needed to remove ambiguity. All uses changed.
11938 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
11939 turn was just renamed from struniq_t.
11940 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
11941 which in turn was just renamed from struniq_processor_t.
11942 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
11943 in turn was renamed from hash_compare_struniq_t.
11944 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
11945 (state_list): Renamed from state_list_t.
11946 * src/assoc.h (assoc): Renamed from assoc_t.
11947 * src/conflicts.c (enum conflict_resolution): Renamed from
11948 enum conflict_resolution_e.
11949 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
11950 (rule_list): Renamed from rule_list_t.
11951 * src/getargs.h (enum trace): Renamed from enum trace_e.
11952 (enum report): Renamed from enum report_e.
11953 * src/gram.h (item_number): Renamed from item_number_t.
11954 (rule_number): Renamed from rule_number_t.
11955 (struct rule_s): Remove the "rule_s" part; not used.
11956 (rule): Renamed from rule_t.
11957 (rule_filter): Renamed from rule_filter_t.
11958 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
11959 (goto_list): Renamed from goto_list_t.
11960 * src/lalr.h (goto_number): Renamed from goto_number_t.
11961 * src/location.h (location): Renamed from location_t.
11962 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
11963 and moved here from:
11964 * src/muscle_tab.h (muscle_entry_t): here.
11965 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
11966 (rule_list): Renamed from rule_list_t.
11967 * src/print_graph.c (static_graph): Renamed from graph.
11968 * src/reader.h (braced_code): Renamed from braced_code_t.
11969 Remove brace_code_e tag.
11970 * src/relation.h (relation_node): Renamed from relation_node_t.
11971 (relation_nodes): Renamed from relation_nodes_t.
11972 (relation): Renamed from relation_t.
11973 * src/state.h (state_number): Renamed from state_number_t.
11974 (struct state): Renamed from struct state_s.
11975 (state): Renamed from state_t.
11976 (transitions): Renamed from transitions_t. Unused (and
11977 misspelled) transtion_s tag removed.
11978 (errs): Renamed from errs_t. Unused errs_s tag removed.
11979 (reductions): Renamed from reductions_t. Unused tag
11980 reductions_s removed.
11981 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
11982 (struct symbol_list): Renamed from struct symbol_list_s.
11983 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
11984 (struct symbol): Renamed from struct symbol_s.
11985 (symbol): Renamed from symbol_t.
11986 * src/tables.c (vector_number): Renamed from vector_number_t.
11987 (action_number): Renamed from action_t.
11988 * src/tables.h (base_number): Renamed from base_t.
11989 * src/vcg.h (enum color): Renamed from enum color_e.
11990 (enum textmode): Renamed from enum textmode_e.
11991 (enum shape): Renamed from enum shape_e.
11992 (struct colorentry): Renamed from struct colorentry_s.
11993 (struct classname): Renamed from struct classname_s.
11994 (struct infoname): Renamed from struct infoname_s.
11995 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
11996 (enum decision): Renamed from enum decision_e.
11997 (enum orientation): Renamed from enum orientation_e.
11998 (enum alignment): Renamed from enum alignment_e.
11999 (enum arrow_mode): Renamed from enum arrow_mode_e.
12000 (enum crossing_type): Renamed from enum crossing_type_e.
12001 (enum view): Renamed from enum view_e.
12002 (struct node): Renamed from struct node_s.
12003 (node): Renamed from node_t.
12004 (enum linestyle): Renamed from enum linestyle_e.
12005 (enum arrowstyle): Renamed from enum arrowstyle_e.
12006 (struct edge): Renamed from struct edge.
12007 (edge): Renamed from edge_t.
12008 (struct graph): Renamed from struct graph_s.
12009 (graph): Renamed from graph_t.
12010 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12011 Rename value_t -> value.
12012 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12013 value_t_as_yystype -> value_as_yystype.
12014
12015 Don't include <errno.h> in the mainstream code, since it
12016 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12017 * lib/get-errno.c, lib/get-errno.h: New files.
12018 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12019 get-errno.c.
12020 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12021 * src/output.c (output_skeleton): Likewise.
12022 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12023 instead of errno.
12024 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12025 Likewise.
12026 (handle_action_dollar, handle_action_at): Likewise.
12027 * src/system.h: Do not include <errno.h>.
12028 (TAB_EXT): Renamed from EXT_TAB.
12029 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12030
12031 Avoid str[a-z]*, since <string.h> reserves that name space.
12032 Change all instances of "struniq" in names to "uniqstr", and
12033 likewise for "STRUNIQ" and "UNIQSTR".
12034 * src/uniqstr.c: Renamed from src/struniq.c.
12035 * src/uniqstr.h: Renamed from src/struniq.h.
12036 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12037 * src/files.c (strsuffix): Remove; unused.
12038 (concat2): Renamed from stringappend. Now static.
12039 * src/files.h (strsuffix, stringappend): Remove; unused.
12040 * src/parse-gram.y (<chars>): Renamed from <string>.
12041 (<uniqstr>): Renamed from <struniq>.
12042 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12043 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12044 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12045 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12046 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12047 (N_EXPAND): Renamed from N_STRETCH.
12048
12049 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12050 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12051 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12052 Remove; unused.
12053 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12054 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12055 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12056 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12057 (BASE_MAXIMUM): Renamed from BASE_MAX.
12058 (BASE_MINIMUM): Renamed from BASE_MIN.
12059 (ACTION_MAX): Remove; unused.
12060 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12061 Unnecessary casts removed from above defines.
12062
12063
12064 Fix misspelling in names.
12065 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12066 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12067 G_NODE_ALIGNEMENT.
12068
12069
12070 * lib/timevar.c (timevar_report): Renamed from time_report,
12071 for consistency with other names.
12072 * lib/timevar.h (timevar_report): New decl.
12073 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12074
12075
12076 Sort include-file uses.
12077
12078 Reorder all include files under src to be in the order "system.h".
12079 then the ../lib include files in angle brackets (alphabetized),
12080 then the . include files in double-quotes (alphabetized). Fix
12081 dependency breakages encountered in this process, as follows:
12082 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12083 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12084 * src/state.h: Include "symtab.h".
12085
12086 2002-12-08 Paul Eggert <eggert@twinsun.com>
12087
12088 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12089 since this causes problems when __file__ contains character
12090 sequences like "@" that are treated specially by src/scan-skel.l.
12091 Instead, just use the file's basename. This fixes the bug
12092 reported by Martin Mokrejs in
12093 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
12094
12095 2002-12-06 Paul Eggert <eggert@twinsun.com>
12096
12097 Add support for rules that do not have trailing semicolons, as
12098 POSIX requires. Improve the quality of locations in Bison
12099 diagnostics.
12100
12101 * src/location.c: Include <quotearg.h>.
12102 (empty_location): Now const.
12103 (location_print): New function. Follow the recommendation of the
12104 GNU Coding Standards for locations that span file boundaries.
12105 * src/location.h: Do not include <quotearg.h>; no longer needed.
12106 (boundary): New type.
12107 (location_t): Use it. This allows locations to span file boundaries.
12108 All member uses changed: file -> start.file or end.file (as needed),
12109 first_line -> start.line, first_column -> start.column,
12110 last_line -> end.line, last_column -> end.column.
12111 (equal_boundaries): New function.
12112 (LOCATION_RESET, LOCATION_STEP): Remove.
12113 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12114 (empty_location): Now const.
12115 (location_print): New decl.
12116 * src/parse-gram.y (lloc_default): New function, which handles
12117 empty locations more accurately.
12118 (YYLLOC_DEFAULT): Use it.
12119 (%token COLON): Remove.
12120 (%token ID_COLON): New token.
12121 (rules): Use it.
12122 (declarations, rules): Remove trailing semicolon.
12123 (declaration, rules_or_grammar_declaration):
12124 Allow empty (";") declaration.
12125 (symbol_def): Remove empty actions; no longer needed.
12126 (rules_or_grammar_declaration): Remove trailing semicolon.
12127 (semi_colon.opt): Remove.
12128 * src/reader.h: Include location.h.
12129 (scanner_cursor): New decl.
12130 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12131 rolling our own.
12132 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12133 of *loc.
12134 (STEP): Remove. No longer needed, now that adjust_location does
12135 the work. All uses removed.
12136 (scanner_cursor): New var.
12137 (adjust_location): Renamed from extend_location. It now sets
12138 *loc and adjusts the scanner cursor. All uses changed.
12139 Don't bother testing for CR.
12140 (handle_syncline): Remove location arg; now updates scanner cursor.
12141 All callers changed.
12142 (unexpected_end_of_file): Now accepts start boundary of token or
12143 comment, not location. All callers changed. Update scanner cursor,
12144 not the location.
12145 (SC_AFTER_IDENTIFIER): New state.
12146 (context_state): Renamed from c_context. All uses changed.
12147 (id_loc, code_start, token_start): New local vars.
12148 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12149 processing of Yacc white space and equivalents here.
12150 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12151 instead of returning ID immediately, since we need to search for
12152 a subsequent colon.
12153 (<INITIAL>"'", "\""): Save token_start.
12154 (<INITIAL>"%{", "{", "%%"): Save code_start.
12155 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12156 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12157 BEGIN context_state at end, not INITIAL.
12158 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12159 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12160 Return correct token start.
12161 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12162 the start of a character, string or multiline comment is found.
12163 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12164 Reduction): Adjust reported locations to match the more-precise
12165 results now expected.
12166 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12167 * tests/reduce.at (Useless Rules, Reduced Automaton,
12168 Underivable Rules): Likewise.
12169 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12170 or "|"' now that so many other tokens are allowed by the new grammar.
12171
12172 * src/complain.h (current_file): Remove duplicate decl;
12173 current_file is now owned by files.h.
12174 * src/complain.c, src/scan-gram.l: Include files.h.
12175
12176 2002-12-06 Paul Eggert <eggert@twinsun.com>
12177
12178 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12179 promotes to int; it might be unsigned int.
12180 * data/yacc.c (yy_reduce_print): Likewise.
12181
12182 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12183 be #defined in the prologue, not in the Bison declarations.
12184 This fixes Debian Bug 102878, reported by Shaul Karl.
12185
12186 2002-12-02 Paul Eggert <eggert@twinsun.com>
12187
12188 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12189 * lib/strtoul.c: New file, from gnulib.
12190 This fixes a porting bug reported by Peter Klein in
12191 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
12192
12193 2002-11-30 Paul Eggert <eggert@twinsun.com>
12194
12195 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12196 and put only a forward declaration in the prologue. This is for
12197 consistency with the other scanner helper functions.
12198
12199 Type clashes now generate warnings, not errors, since it
12200 appears that POSIX may allow some grammars with type clashes.
12201 * src/reader.c (grammar_current_rule_check): Warn about
12202 type clashes instead of complaining.
12203 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12204
12205 Add Yacc library, since POSIX requires it.
12206 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12207 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12208 * lib/main.c, lib/yyerror.c: New files.
12209
12210 gram_error can be static; it need not be extern.
12211 * src/reader.h (gram_error): Remove decl.
12212 * src/parse-gram.y (gram_error): Now static. Add static decl.
12213 (print_token_value): Omit parameter names from forward decl,
12214 for consistency.
12215
12216 2002-11-29 Paul Eggert <eggert@twinsun.com>
12217
12218 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12219 be declared before being used. E.g., one should typically
12220 declare them in the prologue. Use GNU coding style in examples.
12221 Put "const" consistently after the type it modifies. Mention
12222 that C99 supports "inline". Mention that yyerror traditionally
12223 returns "int".
12224
12225 %parse-param and %lex-param now take just one argument, the
12226 declaration; the argument name is deduced from the declaration.
12227
12228 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12229 Reporting, Table of Symbols): Document this.
12230 * src/parse-gram.y (add_param): New function.
12231 (COMMA): Remove.
12232 (declaration): Implement new rule for %parse-param and %lex-param.
12233 * src/scan-gram.l: "," now elicits a warning, rather than being
12234 a token; this is more compatible with byacc.
12235 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12236
12237 2002-11-27 Paul Eggert <eggert@twinsun.com>
12238
12239 Rename identifiers to avoid real and potential collisions.
12240
12241 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12242 to avoid collision with lex macro described by Bruce Lilly in
12243 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12244 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12245 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12246 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12247 All uses changed.
12248 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12249 The name "yycontrol" violates the name space rules, and this stuff
12250 wasn't being used anyway.
12251 (input): Remove action; this stuff wasn't being used.
12252 (gram_error): Rename local variable yylloc -> loc.
12253 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12254 (YY_DECL): Don't use "yy" at start of local variables.
12255 All uses changed, e.g., yylloc -> loc.
12256 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12257 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12258 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12259 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12260
12261 * src/parse-gram.y (gram_error): loc is now const *.
12262 * src/reader.h (gram_error): Likewise.
12263
12264 2002-11-24 Paul Eggert <eggert@twinsun.com>
12265
12266 Version 1.75c.
12267
12268 * tests/actions.at (Actions after errors): Use an output format
12269 more similar to that of the Printers and Destructors test.
12270 Test the position of the ';' token too.
12271 (Printers and Destructors): Likewise.
12272 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12273 unnecessarily alarming people when the test fails.
12274
12275 * data/yacc.c (yyerrlab1): Move this label down, so that the
12276 parser does not discard the lookahead token if the user code
12277 invokes YYERROR. This change is required for POSIX conformance.
12278
12279 * lib/error.c: Sync with gnulib.
12280
12281 2002-11-22 Paul Eggert <eggert@twinsun.com>
12282
12283 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12284 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12285 * lib/xmalloc.c: Likewise.
12286
12287 2002-11-20 Paul Eggert <eggert@twinsun.com>
12288
12289 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12290
12291 2002-11-20 Paul Eggert <eggert@twinsun.com>
12292
12293 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12294 should use `if (! x) abort ();' rather than `assert (x);', and
12295 anyway it's one less thing to worry about configuring.
12296
12297 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12298 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12299 and replace all instances of assert with abort.
12300 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12301 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12302
12303 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12304 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12305 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12306 hash_find_entry, hash_rehash, hash_insert): Likewise.
12307 * src/conflicts.c (resolve_sr_conflict): Likewise.
12308 * src/lalr.c (set_goto_map, map_goto): Likewise.
12309 * src/nullable.c (nullable_compute): Likewise.
12310 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12311 * src/reader.c (packgram, reader): Likewise.
12312 * src/state.c (state_new, state_free, state_transitions_set,
12313 state_reduction_find): Likewise.
12314 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12315 symbol_pack): Likewise.
12316 * src/tables.c (conflict_row, pack_vector): Likewise.
12317 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12318 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12319 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12320 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12321
12322 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12323 (ARGMATCH_CONSTRAINT): New macro.
12324 (ARGMATCH_ASSERT): Use it.
12325
12326 * src/system.h (verify): New macro.
12327 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12328 rather than assert.
12329 * src/tables.c (tables_generate): Likewise.
12330
12331 * src/struniq.c (struniq_assert): Now returns void, and aborts
12332 if the assertion is false.
12333 (struniq_assert_p): Remove.
12334 * src/struniq.h: Likewise.
12335
12336 2002-11-18 Paul Eggert <eggert@twinsun.com>
12337
12338 * data/glr.c (yygetLRActions): Replace `yyindex' with
12339 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12340 This fixes the regression with Sun ONE Studio 7 cc that I reported in
12341 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
12342
12343 2002-11-18 Akim Demaille <akim@epita.fr>
12344
12345 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12346 space.
12347 From Tim Van Holder.
12348
12349 2002-11-17 Paul Eggert <eggert@twinsun.com>
12350
12351 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12352 to "SyntaxError" for consistency with my 2002-11-15 change.
12353
12354 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12355 not define to {}, since this breaks the common use of `YYDPRINTF
12356 ((...));' if a single statement is desired (e.g. before `else').
12357 Work around GCC warnings by surrounding corresponding calls with
12358 {} if needed.
12359 (yyhasResolvedValue): Remove unused function.
12360 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12361 loop body.
12362 (yyreportSyntaxError): Renamed from yyreportParseError.
12363 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12364 All uses changed.
12365 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12366 extern when possible. Remove unused initializations.
12367
12368 2002-11-16 Akim Demaille <akim@epita.fr>
12369
12370 Augment the similarity between GLR and LALR traces.
12371
12372 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12373 (YY_REDUCE_PRINT): New.
12374 (yyparse): Use them.
12375 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12376 YYDPRINT here.
12377 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12378 state reached after the reduction/recovery, since...
12379 (yyparse, yyprocessOneStack): Report the state we are entering in.
12380
12381 2002-11-16 Akim Demaille <akim@epita.fr>
12382
12383 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12384 Add support for --trace=skeleton.
12385 * src/scan-skel.l: %option debug.
12386 Scan strings of non-@ or \n instead of character by character.
12387 (scan_skel): Handle trace_skeleton.
12388 (QPUTS): New.
12389 (@output_parser_name@, @output_header_name@): ``Restore'' their
12390 support (used to be M4 macros).
12391 * data/yacc.c: Quote larger chunks, a la glr.c.
12392 * data/lalr1.cc: Likewise.
12393 The header guards are no longer available, so use some other
12394 string than `YYLSP_NEEDED'.
12395
12396 2002-11-16 Akim Demaille <akim@epita.fr>
12397
12398 Make the ``Printers and Destructors'' test more verbose, taking
12399 `yacc.c''s behavior as (possibly wrong) reference.
12400
12401 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12402 instead of fprint on stdout.
12403 Set and report the last_line of the symbols.
12404 Consistently display values and locations.
12405
12406 2002-11-16 Paul Eggert <eggert@twinsun.com>
12407
12408 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12409
12410 2002-11-15 Paul Eggert <eggert@twinsun.com>
12411
12412 * tests/actions.at (Actions after errors): New test case.
12413
12414 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12415 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12416 tests/action.at, tests/calc.at, tests/conflicts.at,
12417 tests/cxx-type.at, tests/regression.at:
12418 "parse error" -> "syntax error" for POSIX compatibility.
12419 "parsing stack overflow..." -> "parser stack overflow" so
12420 that code matches Bison documentation.
12421
12422 2002-11-15 Akim Demaille <akim@epita.fr>
12423
12424 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12425 take two BRACED_CODE, not two string_content.
12426 Free the scanner's obstack when we are done.
12427 (code_content): New.
12428 * tests/calc.at: Adjust.
12429 * doc/bison.texinfo: Adjust.
12430 Also, make sure to include the `,' for these declarations.
12431
12432 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12433
12434 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12435 definition; avoids potential autoreconf problems.
12436
12437 2002-11-15 Akim Demaille <akim@epita.fr>
12438
12439 Always check the value returned by yyparse.
12440
12441 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12442 returned by yyparse.
12443 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12444 Adjust calls.
12445 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12446 returned by yyparse.
12447
12448 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12449
12450 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12451 on input.at test.
12452
12453 2002-11-14 Paul Eggert <eggert@twinsun.com>
12454
12455 * src/output.c (output_skeleton): Call xfopen instead of
12456 duplicating xfopen's body.
12457
12458 Fix bugs reported by Nelson H. F. Beebe in
12459 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
12460
12461 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12462 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12463 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12464 file twice in the grammar, as an extra check.
12465
12466 * tests/input.at (Torturing the Scanner): Surround the
12467 backslash-newline tests with "#if 0", to make it less likely that
12468 we'll run into compiler bugs. Bring back solitary \ inside
12469 comment, but add a closing comment to work around HP C bug. Don't
12470 test backslash-newline in C character constant.
12471
12472 2002-11-14 Akim Demaille <akim@epita.fr>
12473
12474 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12475 status of the compiler.
12476 Calling `exit 1' is no longer needed.
12477 Reported by Nelson H. F. Beebe.
12478
12479 2002-11-14 Akim Demaille <akim@epita.fr>
12480
12481 * tests/atlocal.in (CPPFLAGS): We have config.h.
12482 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12483 New.
12484 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12485 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12486 * tests/regression.at, tests/torture.at: Use them for all the
12487 grammars that are to be compiled.
12488 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12489 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12490 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12491
12492 2002-11-14 Akim Demaille <akim@epita.fr>
12493
12494 * doc/bison.texinfo: Various formatting changes (alignments in
12495 samples, additional @group/@end group, GCS in samples.
12496 Use @deffn instead of simple @table to define the directives,
12497 macros, variables etc.
12498
12499 2002-11-13 Paul Eggert <eggert@twinsun.com>
12500
12501 Fix some bugs reported by Albert Chin-A-Young in
12502 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
12503
12504 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
12505 -o c"; the HP C compiler chatters during compilation.
12506 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12507 * tests/headers.at (export YYLTYPE): Likewise.
12508
12509 * tests/input.at (Torturing the Scanner): Remove lines containing
12510 solitary backslashes, as they tickle a bug in the HP C compiler.
12511
12512 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12513 comments, since they're not portable. Use GNU coding style.
12514
12515 2002-11-13 Akim Demaille <akim@epita.fr>
12516
12517 * data/yacc.c: Leave bigger chunks of quoted text.
12518 (YYDSYMPRINTF): New.
12519 Use it to report symbol activities.
12520 * data/glr.c (YYDSYMPRINTF): New.
12521 Use it.
12522
12523 2002-11-12 Paul Eggert <eggert@twinsun.com>
12524
12525 Version 1.75b.
12526
12527 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12528 (yyglrReduce): Return yyok, not 0.
12529 This should avoid the enumerated-type warnings reported
12530 by Nelson H. F. Beebe in
12531 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
12532
12533 * lib/bbitset.h (BITSET_INLINE): Remove.
12534 * lib/bitset.h [! BITSET_INLINE]: Remove.
12535 (bitset_set, bitset_reset, bitset_test): Rename local vars
12536 to avoid shadowing warnings by GCC.
12537
12538 * data/glr.c (inline): Remove #define. It's the user's
12539 responsibility to #define it away, just like 'const'.
12540 This fixes one of the bugs reported by Nelson H. F. Beebe in
12541 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
12542
12543 * Makefile.maint (po-check): Scan .l and .y files instead of the
12544 .c and the .h files that they generate. This fixes the bug
12545 reported by Tim Van Holder in:
12546 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
12547 Look for N_ as well as for _. Try to avoid matching #define for
12548 N_ and _.
12549 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12550 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12551 * src/scan-gram.l: Revamp regular expressions so that " and '
12552 do not confuse xgettext.
12553
12554 * src/struniq.h (struniq_new): Do not declare the return type
12555 to be 'const'; this violates the C standard.
12556 * src/struniq.c (struniq_new): Likewise.
12557
12558 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12559
12560 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12561 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12562 linker.
12563
12564 2002-11-12 Akim Demaille <akim@epita.fr>
12565
12566 * Makefile.maint: Sync with Autoconf:
12567 (local_updates): New.
12568
12569 2002-11-12 Akim Demaille <akim@epita.fr>
12570
12571 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12572
12573 2002-11-12 Akim Demaille <akim@epita.fr>
12574
12575 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12576 locations.
12577
12578 2002-11-12 Akim Demaille <akim@epita.fr>
12579
12580 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12581 not yyvalue.
12582
12583 2002-11-12 Akim Demaille <akim@epita.fr>
12584
12585 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12586 Use it to test the GLR parser.
12587
12588 2002-11-12 Akim Demaille <akim@epita.fr>
12589
12590 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12591 defines it.
12592 * data/glr.c (yystos): New.
12593 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12594 (YYDSYMPRINT): New.
12595 (yyval): Don't define it, it is handled via M4.
12596 (yyrecoverParseError): Free verbosely the discarded symbols.
12597 * data/yacc.c (yysymprint): Remove, rather...
12598 (b4_yysymprint_generate): invoke.
12599 * data/c.m4 (b4_yysymprint_generate): New.
12600 Accept pointers as arguments, as opposed to the version from
12601 yacc.c.
12602 (b4_yydestruct_generate): Likewise.
12603 * tests/cations.at (Printers and Destructors): Use Bison directives
12604 instead of CPP macros.
12605 Don't rely on internal details.
12606
12607 2002-11-12 Akim Demaille <akim@epita.fr>
12608
12609 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12610 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12611 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12612 it against YYEMPTY and so forth), work on yytoken (i.e., set
12613 it to YYEMPTY etc.).
12614 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12615 (b4_symbol_actions): Remove.
12616 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12617 for 0, end-of-input.
12618
12619 2002-11-12 Akim Demaille <akim@epita.fr>
12620
12621 * doc/bison.texinfo (Destructor Decl): New.
12622
12623 2002-11-12 Akim Demaille <akim@epita.fr>
12624
12625 * src/tables.c (tables_generate): Use free for pointers that
12626 cannot be NULL, not XFREE.
12627 (pack_vector): Use assert, not fatal, for bound violations.
12628 * src/state.c (state_new): Likewise.
12629 * src/reader.c (reader): Likewise.
12630 * src/lalr.c (set_goto_map): Likewise.
12631 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
12632 the file name.
12633
12634 2002-11-12 Akim Demaille <akim@epita.fr>
12635
12636 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12637 Restore.
12638 * src/scan-gram.l (last_string): Is global to the file, not to
12639 yylex.
12640 * src/parse-gram.y (input): Don't append the epilogue here,
12641 (epilogue.opt): do it here, and free the scanner's obstack.
12642 * src/reader.c (epilogue_set): Rename as...
12643 (epilogue_augment): this.
12644 * data/c.m4 (b4_epilogue): Defaults to empty.
12645
12646 2002-11-12 Akim Demaille <akim@epita.fr>
12647
12648 * src/getargs.c (long_options): Remove duplicates.
12649 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12650 Remove.
12651 * doc/bison.rnh: Remove.
12652 * doc/bison.texinfo (VMS Invocation): Remove.
12653
12654 2002-11-12 Akim Demaille <akim@epita.fr>
12655
12656 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12657 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12658
12659 Use struniq for symbols.
12660
12661 * src/symtab.h (symbol_t): The tag member is a struniq.
12662 (symbol_type_set): Adjust.
12663 * src/symtab.c (symbol_new): Takes a struniq.
12664 (symbol_free): Don't free the tag member.
12665 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12666 (hash_compare_symbol, hash_symbol): these.
12667 Use the fact that tags as struniqs.
12668 (symbol_get): Use struniq_new.
12669 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12670 Returns a strniq.
12671 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12672 and type members are struniqs.
12673 * src/reader.c (get_merge_function)
12674 (grammar_current_rule_merge_set): Adjust.
12675 (TYPE, current_type): Are struniq.
12676
12677 Use struniq for file names.
12678
12679 * src/files.h, src/files.c (infile): Split into...
12680 (grammar_file, current_file): these.
12681 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12682 * src/reduce.c (reduce_print): Likewise.
12683 * src/getargs.c (getargs): Likewise.
12684 * src/complain.h, src/complain.c: Likewise.
12685 * src/main.c (main): Call struniqs_new early enough to use it for
12686 file names.
12687 Don't free the input file name.
12688
12689 2002-11-12 Akim Demaille <akim@epita.fr>
12690
12691 * src/symtab.c (symbol_free): Remove dead deactivated code:
12692 type_name are properly removed.
12693 Don't use XFREE to free items that cannot be NULL.
12694 * src/struniq.h, src/struniq.c: New.
12695 * src/main.c (main): Initialize/free struniqs.
12696 * src/parse-gram.y (%union): Add astruniq member.
12697 (yyprint): Adjust.
12698 * src/scan-gram.l (<{tag}>): Return a struniq.
12699 Free the obstack bit that used to store it.
12700 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12701
12702 2002-11-11 Paul Eggert <eggert@twinsun.com>
12703
12704 Revamp to fix many (but not all) of the C- and M4-related quoting
12705 problems. Among other things, this fixes the Bison bug reported
12706 by Jan Hubicka when processing the Bash grammar; see:
12707 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
12708
12709 Use new @ escapes consistently. Represent brackets with @{ and @}
12710 rather than @<:@ and @:>@, since this works a bit better with dumb
12711 editors like vi. Represent @ with @@, since @ is now consistently
12712 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12713 __ofile__, to avoid unexpected expansions. Similarly, use @output
12714 rather than #output.
12715
12716 * data/c.m4 (b4_copyright): Omit file name from comment, since
12717 the file name could contain "*/".
12718 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12719 be quoted. All uses changed.
12720
12721 * data/glr.c: Use new @ escapes consistently.
12722 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12723 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12724 Remove, since they couldn't handle arbitrary characters in file
12725 names.
12726 * data/lalr1.cc: Likewise.
12727 * data/yacc.c: Likewise.
12728
12729 * src/files.c (output_infix): Remove; all uses removed.
12730 * src/files.h: Likewise.
12731
12732 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12733 mishandled funny characters in file names, and anyway it isn't
12734 needed any more.
12735 * data/yacc.c: Likewise.
12736 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12737
12738 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12739 * data/yacc.c: Likewise.
12740
12741 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12742 strings now.
12743 (muscle_init): Quote filename as a C string.
12744 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12745 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12746 * src/output.c (escaped_file_name_output): New function.
12747 (prepare_symbols): Quote tokens for M4.
12748 (prepare): Don't insert output_infix, output_prefix,
12749 output_parser_name, output_header_name; this is now down by scan-skel.
12750 Insert skeleton as a C string.
12751
12752 * src/output.c (user_actions_output, symbol_destructors_output,
12753 symbol_printers_output): Quote filenames for C and M4.
12754 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12755
12756 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12757 escapes other than \\ and \'; this simplifies the code.
12758 (<SC_STRING>): Likewise, for \\ and \".
12759 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12760 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12761 Use new escapes @{ and @} for [ and ].
12762
12763 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12764 them with auto vars.
12765 Switch to new escape scheme, where @ is the escape character uniformly.
12766 Abort if a stray escape character is found. Avoid unbounded input
12767 buffer when parsing non-escaped text.
12768
12769 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12770 __oline__, #output, $@, and @{ do not have unintended meanings.
12771
12772 2002-11-09 Paul Eggert <eggert@twinsun.com>
12773
12774 Fix the test failure due to GCC warnings described in
12775 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
12776 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12777 evaluate to 0 if it's impossible for NINF to be in the respective
12778 table.
12779 (yygetLRActions, yyrecoverParseError): Use them.
12780
12781 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12782 counted in the token inserted at end of file. Now takes
12783 location_t *, not location_t, so that the location can be
12784 adjusted. All uses changed.
12785
12786 * tests/regression.at (Invalid inputs): Adjust wording in
12787 diagnostic to match the new behavior.
12788
12789 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12790 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12791 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12792 abort ();'. This reduces the runtime of the "Many lookaheads"
12793 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12794 GCC 3.2.
12795
12796 2002-11-07 Paul Eggert <eggert@twinsun.com>
12797
12798 * src/parse-gram.y (CHARACTER): Remove unused token.
12799 All uses removed.
12800
12801 * src/scan-gram.l: Remove stack option. We no longer use the
12802 stack, since the stack was never deeper than 1; instead, use the
12803 new auto var c_context to record the stacked value.
12804
12805 Remove nounput option. At an unexpected end of file, we now unput
12806 the minimal input necessary to end cleanly; this simplifies the
12807 code.
12808
12809 Avoid unbounded token sizes where this is easy.
12810
12811 (unexpected_end_of_file): New function.
12812 Use it to systematize the error message on unexpected EOF.
12813 (last-string): Now auto, not static.
12814 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12815 (scanner_last_string_free): Remove; not used.
12816 (percent_percent_count): Move decl to just before use.
12817 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12818 not the (never otherwised-used) CHARACTER.
12819
12820 2002-11-07 Akim Demaille <akim@epita.fr>
12821
12822 Let yyerror always receive the msg as last argument, so that
12823 yyerror can be variadic.
12824
12825 * data/yacc.c (b4_yyerror_args): New.
12826 Use it when calling yyerror.
12827 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12828 Use it when calling yyerror.
12829 * doc/bison.texinfo (Error Reporting): Adjust.
12830 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12831 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12832
12833 2002-11-06 Akim Demaille <akim@epita.fr>
12834
12835 #line should have quoted strings.
12836 Ideally, this should be done by m4_quotearg.
12837
12838 * src/scan-skel.l: Include quotearg.h.
12839 Quote __ofile__.
12840 * src/output.c (symbol_printers_output)
12841 (symbol_destructors_output): Quote the file name.
12842
12843 2002-11-06 Akim Demaille <akim@epita.fr>
12844
12845 * tests/regression.at (Invalid inputs): Adjust to the recent
12846 messages.
12847
12848 2002-11-06 Akim Demaille <akim@epita.fr>
12849
12850 Restore --no-lines.
12851 Reported by Jim Kent.
12852
12853 * data/c.m4 (b4_syncline): New.
12854 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12855 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12856 * src/output.c (user_actions_output): Likewise.
12857 (prepare): Define 'b4_synclines_flag'.
12858 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
12859
12860 2002-11-06 Akim Demaille <akim@epita.fr>
12861
12862 * src/main.c (main): Free `infile'.
12863 * src/scan-gram.l (handle_syncline): New.
12864 Recognize `#line'.
12865 * src/output.c (user_actions_output, symbol_destructors_output)
12866 (symbol_printers_output): Use the location's file name, not
12867 infile.
12868 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12869
12870 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12871
12872 * src/tables.c (matching_state): Don't allow states to match if
12873 either has GLR conflict entries.
12874
12875 2002-11-05 Paul Eggert <eggert@twinsun.com>
12876
12877 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12878 "integer out of range" rather than "invalid value".
12879 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12880 accordingly.
12881
12882 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12883 Also, remove one static variable in the scanner.
12884
12885 * src/scan-gram.l (braces_level): Now auto, not static.
12886 Initialize to zero if the compiler is being picky.
12887 (INITIAL): Clear braces_level instead of incrementing it.
12888 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12889 as POSIX 1003.1-2001 requires.
12890 * src/system.h (IF_LINT): New macro, taken from coreutils.
12891 * configure.ac: Define "lint" if --enable-gcc-warnings.
12892
12893 2002-11-05 Akim Demaille <akim@epita.fr>
12894
12895 * src/scan-gram.l: When it starts with `%', complain about the
12896 whole directive, not just that `invalid character: %'.
12897
12898 2002-11-04 Akim Demaille <akim@epita.fr>
12899
12900 * Makefile.maint: Update from Autoconf.
12901 (update, cvs-update, po-update, do-po-update): New.
12902
12903 2002-11-04 Akim Demaille <akim@epita.fr>
12904
12905 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
12906 and yyerror.
12907 Have yyerror `use' its arguments.
12908 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
12909 returns true when location & yacc & pure & parse-param.
12910 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
12911
12912 2002-11-04 Akim Demaille <akim@epita.fr>
12913
12914 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
12915 clashes.
12916 * src/scan-gram.l: Use [\'] instead of ['] to pacify
12917 font-lock-mode.
12918 Use complain_at.
12919 Use quote, not quote_n since LOCATION_PRINT no longer uses the
12920 slot 0.
12921
12922 2002-11-03 Paul Eggert <eggert@twinsun.com>
12923
12924 * src/reader.c (get_merge_function, grammar_current_rule_check):
12925 Use consistent diagnostics for reporting type name clashes.
12926 Quote the types with <>, for consistency with Yacc.
12927 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
12928
12929 2002-11-03 Akim Demaille <akim@epita.fr>
12930
12931 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
12932 New.
12933 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
12934 (b4_parse_param): Remove.
12935 Use b4_identification.
12936 Propagate b4_pure_args where needed to pass them to yyerror.
12937 * data/glr.m4 (b4_parse_param): Remove.
12938 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
12939 (b4_lpure_formals): New.
12940 Use b4_identification.
12941 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
12942 b4_user_formals and b4_user_args.
12943 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
12944 (yyreportAmbiguity): When using a pure parser, also need
12945 the location, and the parse-params.
12946 Adjust callers.
12947 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
12948 When using a pure parser, also need the parse-params.
12949 Adjust callers.
12950 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
12951 (%pure-parser + %parse-param) LALR and GLR parsers.
12952 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
12953 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
12954 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
12955 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
12956 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
12957 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
12958 * doc/bison.texinfo: Untabify the whole file.
12959 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
12960 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
12961 (Error Reporting): Adjust to these new directives.
12962 Document %error-verbose, deprecate YYERROR_VERBOSE.
12963
12964 2002-11-03 Akim Demaille <akim@epita.fr>
12965
12966 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
12967 AT_CHECK_CALC_GLR invocations to use % directives, instead of
12968 command line options.
12969 * tests/cxx-type.at: Formatting changes.
12970
12971 2002-11-03 Paul Eggert <eggert@twinsun.com>
12972
12973 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
12974 to count columns correctly, and to check for invalid inputs.
12975
12976 Use mbsnwidth to count columns correctly. Account for tabs, too.
12977 Include mbswidth.h.
12978 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
12979 (extend_location): New function.
12980 (YY_LINES): Remove.
12981
12982 Handle CRLF in C code rather than in Lex code.
12983 (YY_INPUT): New macro.
12984 (no_cr_read): New function.
12985
12986 Scan UCNs, even though we don't fully handle them yet.
12987 (convert_ucn_to_byte): New function.
12988
12989 Handle backslash-newline correctly in C code.
12990 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
12991 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
12992 all uses changed.
12993 (tag, splice): New EREs. Do not allow NUL or newline in tags.
12994 Use {splice} wherever C allows backslash-newline.
12995 YY_STEP after space, newline, vertical-tab.
12996 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
12997
12998 (letter, id): Don't assume ASCII; e.g., spell out a-z.
12999
13000 ({int}, handle_action_dollar, handle_action_at): Check for integer
13001 overflow.
13002
13003 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13004
13005 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13006 as well as \000. Check for UCHAR_MAX, not 255.
13007 Allow \x with an arbitrary positive number of digits, as in C.
13008 Check for overflow here.
13009 Allow \? and UCNs, for compatibility with C.
13010
13011 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13012 with quote slot used by complain_at.
13013
13014 * tests/input.at: Add tests for backslash-newline, m4 quotes
13015 in symbols, long literals, and funny escapes in strings.
13016
13017 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13018 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13019 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13020 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13021 * m4/mbswidth.m4: New file, from GNU coreutils.
13022
13023 * doc/bison.texinfo (Grammar Outline): Document // comments.
13024 (Symbols): Document that trigraphs have no special meaning in Bison,
13025 nor is backslash-newline allowed.
13026 (Actions): Document that trigraphs have no special meaning.
13027
13028 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13029 no longer used.
13030
13031 2002-11-02 Paul Eggert <eggert@twinsun.com>
13032
13033 * src/reader.c: Don't include quote.h; not needed.
13034 (get_merge_function): Reword warning to be consistent with
13035 type clash diagnostic in grammar_current_rule_check.
13036
13037 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13038 bug in trigraph handling.
13039
13040 * src/output.c (prepare_symbols): When printing token names,
13041 escape "[" as "@<:@" and likewise for "]".
13042
13043 * src/system.h (errno): Remove declaration, as we are now
13044 assuming C89 or better, and C89 guarantees errno.
13045
13046 2002-10-30 Paul Eggert <eggert@twinsun.com>
13047
13048 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13049 Check for close failures.
13050 * src/files.h (xfclose): Return void, not int, since it always
13051 returned zero.
13052 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13053 indicates one.
13054 * src/output.c (output_skeleton): Use xfclose rather than fclose
13055 and ferror. xfclose now checks ferror.
13056
13057 * data/glr.c (YYLEFTMOST_STATE): Remove.
13058 (yyreportTree): Use a stack-based leftmost state. This avoids
13059 our continuing battles with bogus warnings about initializers.
13060
13061 2002-10-30 Akim Demaille <akim@epita.fr>
13062
13063 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13064 #if.
13065
13066 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13067
13068 * tests/glr-regr1.at: New test for reported regressions.
13069 * tests/testsuite.at: Add glr-regr1.at test.
13070 * tests/Makefile.am: Add glr-regr1.at test.
13071
13072 2002-10-24 Paul Eggert <eggert@twinsun.com>
13073
13074 Version 1.75a.
13075
13076 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13077 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13078 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13079 Don't assume strdup exists; POSIX says its an XSI extension.
13080 Check for buffer overflow on input.
13081
13082 2002-10-24 Akim Demaille <akim@epita.fr>
13083
13084 * src/output.c (output_skeleton): Don't disable M4sugar comments
13085 too soon: it results in comments being expanded.
13086 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13087 first output.
13088
13089 2002-10-24 Akim Demaille <akim@epita.fr>
13090
13091 * data/yacc.c (m4_int_type): New.
13092 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13093 char' as only yacc.c wants K&R portability.
13094 * data/glr.c (yysigned_char): Remove.
13095 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13096 Reported by Quoc Peyrot.
13097
13098 2002-10-23 Paul Eggert <eggert@twinsun.com>
13099
13100 * src/main.c (main): With --trace=time, report times even if a
13101 non-fatal error occurs. Formerly, the times were reported in some
13102 such cases but not in others.
13103 * src/reader.c (reader): Just return if a complaint has been issued,
13104 instead of exiting, so that 'main' can report times.
13105
13106 2002-10-22 Akim Demaille <akim@epita.fr>
13107
13108 * src/system.h: Include sys/types.
13109 Reported by Bert Deknuydt.
13110
13111 2002-10-23 Paul Eggert <eggert@twinsun.com>
13112
13113 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13114 Suggested by Art Haas.
13115
13116 2002-10-22 Paul Eggert <eggert@twinsun.com>
13117
13118 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13119 decl; not needed any more.
13120 * src/main.c (main): Use return to exit, undoing yesterday's change.
13121 The last OS that we could find where this wouldn't work is
13122 SunOS 3.5, and that's too old to worry about now.
13123
13124 * data/glr.c (struct yyltype): Define members even when not
13125 doing locations. This is more consistent with yacc.c, and it
13126 works around the following bug reports:
13127 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13128 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
13129
13130 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13131 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13132 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13133
13134 2002-10-22 Akim Demaille <akim@epita.fr>
13135
13136 * data/README: New.
13137
13138 2002-10-21 Paul Eggert <eggert@twinsun.com>
13139
13140 Be consistent about 'bool'; the old code used an enum in one
13141 module and an int in another, and this violates the C standard.
13142 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13143 * configure.ac (AC_HEADER_STDBOOL): Add.
13144 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13145 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13146 * src/symtab.c (hash_compare_symbol_t): Likewise.
13147 * src/system.h (bool, false, true): Use a definition consistent
13148 with ../lib/hash.c. All uses changed.
13149
13150 * src/complain.c (warning_issued): Renamed from warn_message_count,
13151 so that we needn't worry about integer overflow (!).
13152 Now of type bool. All uses changed.
13153 (complaint_issued): Renamed from complain_message_count; likewise.
13154
13155 * src/main.c (main): Use exit to exit with failure.
13156
13157 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13158 rather than 1 and 0.
13159 * src/main.c (main): Likewise.
13160 * src/getargs.c (getargs): Likewise.
13161 * src/reader.c (reader): Likewise.
13162
13163 * src/getarg.c (getargs): Remove duplicate code for
13164 "Try `bison --help'".
13165
13166 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13167 What was that "2" for?
13168
13169 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13170 * src/getargs.c (usage): Likewise.
13171
13172 * src/getargs.c (getargs): When there are too few operands, report
13173 the last one. When there are too many, report the first extra
13174 one. This is how diffutils does it.
13175
13176 2002-10-20 Paul Eggert <eggert@twinsun.com>
13177
13178 Remove K&R vestiges.
13179 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13180 * src/complain.c (VA_START): Remove. Assume prototypes.
13181 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13182 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13183 fatal): Assume prototypes.
13184 * src/complain.h: Assume prototypes.
13185 * src/system.h (PARAMS): Remove.
13186 Include <limits.h> unconditionally, since it's guaranteeed even
13187 for a freestanding C89 compiler.
13188 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13189 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
13190
13191 2002-10-20 Akim Demaille <akim@epita.fr>
13192
13193 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13194 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13195 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13196 (yyresolveStates, yyresolveAction, yyresolveStack)
13197 (yyprocessOneStack): Use them.
13198 (yy_reduce_print): New.
13199 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13200
13201 2002-10-20 Akim Demaille <akim@epita.fr>
13202
13203 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13204 arguments and output `void'.
13205 (b4_c_function): Rename as...
13206 (b4_c_function_def): this.
13207 (b4_c_function_decl, b4_c_ansi_function_def)
13208 (b4_c_ansi_function_decl): New.
13209 Change the interpretation of the arguments: before `int, foo', now
13210 `int foo, foo'.
13211 * data/yacc.c (yyparse): Prototype and define thanks to these.
13212 Adjust b4_c_function_def uses.
13213 * data/glr.c (yyparse): Likewise, but ANSI only.
13214
13215 2002-10-20 Akim Demaille <akim@epita.fr>
13216
13217 * src/output.c (prepare): Move the definition of `tokens_number',
13218 `nterms_number', `undef_token_number', `user_token_number_max'
13219 to...
13220 (prepare_tokens): Here.
13221 (prepare_tokens): Rename as...
13222 (prepare_symbols): this.
13223 (prepare): Move the definition of `rules_number' to...
13224 (prepare_rules): here.
13225 (prepare): Move the definition of `last', `final_state_number',
13226 `states_number' to...
13227 (prepare_states): here.
13228 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13229
13230 2002-10-20 Akim Demaille <akim@epita.fr>
13231
13232 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13233
13234 2002-10-20 Akim Demaille <akim@epita.fr>
13235
13236 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13237 * data/c.m4: here.
13238
13239 2002-10-20 Akim Demaille <akim@epita.fr>
13240
13241 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13242 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13243 `pair'.
13244 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13245 `name' to...
13246 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13247 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13248 These.
13249
13250 2002-10-19 Paul Eggert <eggert@twinsun.com>
13251
13252 Do not create a temporary file, as that involves security and
13253 cleanup headaches. Instead, use a pair of pipes.
13254 Derived from a suggestion by Florian Krohm.
13255 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13256 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13257 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13258 (BISON_PREREQ_SUBPIPE): Add.
13259 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13260 Add subpipe.h, subpipe.c.
13261 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13262 * po/POTFILES.in: Add lib/subpipe.c.
13263 * src/output.c: Include "subpipe.h".
13264 (m4_invoke): Remove decl.
13265 (scan_skel): New decl.
13266 (output_skeleton): Use pipe rather than temporary file for m4 input.
13267 Check that m4sugar.m4 is readable, to avoid deadlock.
13268 Check for pipe I/O error.
13269 * src/scan-skel.l (readpipe): Remove decl.
13270 (scan_skel): New function, to be used in place of m4_invoke.
13271 Read from stream rather than file.
13272
13273 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13274 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13275 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13276 this generates a more-accurate value anyway.
13277
13278 * lib/timevar.c (timervar_accumulate): Rename locals to
13279 avoid confusion with similarly-named more-global.
13280 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13281
13282 * src/output.c (prepare): Use xstrdup to convert char const *
13283 to char *, to avoid GCC warning.
13284
13285 2002-10-19 Akim Demaille <akim@epita.fr>
13286
13287 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13288 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13289 Use them to have `calc.y' ready for %pure-parser.
13290 * data/yacc.c (YYLEX): Pass a yylex return type to
13291 b4_c_function_call.
13292
13293 2002-10-19 Akim Demaille <akim@epita.fr>
13294
13295 Prototype support of %lex-param and %parse-param.
13296
13297 * src/parse-gram.y: Add the definition of the %lex-param and
13298 %parse-param tokens, plus their rules.
13299 Drop the `_' version of %glr-parser.
13300 Add the "," token.
13301 * src/scan-gram.l (INITIAL): Scan them.
13302 * src/muscle_tab.c: Comment changes.
13303 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13304 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13305 (muscle_entry_s): The `value' member is no longer const.
13306 Adjust all dependencies.
13307 * src/muscle_tab.c (muscle_init): Adjust: use
13308 MUSCLE_INSERT_STRING.
13309 Initialize the obstack earlier.
13310 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13311 (muscle_pair_list_grow): New.
13312 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13313 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13314 * tests/calc.at: Use %locations, not --locations.
13315 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13316
13317 2002-10-19 Akim Demaille <akim@epita.fr>
13318
13319 * src/getargs.c (usage): Take status as argument and exit
13320 accordingly.
13321 Report the traditional `Try ... --help' message when status != 0.
13322 (usage, version): Don't take a FILE * as arg, it is pointless.
13323 (getargs): When there is an incorrect number of arguments, make it
13324 an error, and report it GNUlically thanks to `usage ()'.
13325
13326 2002-10-18 Paul Eggert <eggert@twinsun.com>
13327
13328 * data/glr.c (yyreportParseError): Don't assume that sprintf
13329 yields the length of the printed string, as this is not true
13330 on SunOS 4.1.4. Reported by Peter Klein.
13331
13332 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13333 * tests/conflicts.at (%nonassoc and eof): Likewise.
13334 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13335
13336 2002-10-17 Akim Demaille <akim@epita.fr>
13337
13338 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13339 * src/getargs.c (trace_types, trace_args): Adjust.
13340 * src/reader.c (grammar_current_rule_prec_set)
13341 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13342 Standardize error messages.
13343 And s/@prec/%prec/!
13344 (reader): Use trace_flag to enable scanner/parser debugging,
13345 instead of an adhoc scheme.
13346 * src/scan-gram.l: Remove trailing debugging code.
13347
13348 2002-10-16 Paul Eggert <eggert@twinsun.com>
13349
13350 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13351 MUSCLE_TAB_H.
13352
13353 * NEWS: Officially drop support for building Bison with K&R C,
13354 since it didn't work anyway and it's not worth worrying about.
13355 * Makefile.maint (wget_files): Remove ansi2knr.c.
13356 (ansi2knr.c-url_prefix): Remove.
13357 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13358 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13359 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13360
13361 2002-10-15 Paul Eggert <eggert@twinsun.com>
13362
13363 Stop using the "enum_" trick for K&R-style function definitions;
13364 it confused me, and I was the author! Instead, assume that people
13365 who want to use K&R C compilers (when using these modules in GCC,
13366 perhaps?) will run ansi2knr.
13367
13368 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13369 All uses of "enum_" changed to "enum ".
13370 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13371 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13372
13373 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13374 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13375 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13376 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13377 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13378 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13379 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13380 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13381 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13382 Use function prototypes; this removes the need for declaring
13383 static functions simply to provide their prototypes.
13384 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13385 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13386 bitset_count_, bitset_create, bitset_dump, bitset_first,
13387 bitset_free, bitset_init, bitset_last, bitset_next,
13388 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13389 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13390 bitset_print, bitset_release_memory, bitset_toggle_,
13391 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13392 debug_bitset): Likewise.
13393 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13394 * lib/bitset_stats.c (bitset_log_histogram_print,
13395 bitset_percent_histogram_print, bitset_stats_and,
13396 bitset_stats_and_cmp, bitset_stats_and_or,
13397 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13398 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13399 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13400 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13401 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13402 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13403 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13404 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13405 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13406 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13407 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13408 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13409 bitset_stats_zero): Likewise.
13410 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13411 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13412 bitsetv_dump, debug_bitsetv): Likewise.
13413 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13414 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13415 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13416 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13417 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13418 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13419 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13420 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13421 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13422 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13423 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13424 Likewise.
13425 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13426 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13427 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13428 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13429 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13430 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13431 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13432 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13433 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13434 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13435 lbitset_xor_cmp, lbitset_zero): Likewise.
13436
13437 2002-10-14 Akim Demaille <akim@epita.fr>
13438
13439 Version 1.75.
13440
13441 2002-10-14 Akim Demaille <akim@epita.fr>
13442
13443 * tests/Makefile.am (maintainer-check-posix): New.
13444
13445 2002-10-14 Akim Demaille <akim@epita.fr>
13446
13447 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13448 member.
13449
13450 2002-10-14 Akim Demaille <akim@epita.fr>
13451
13452 * src/tables.c (table_ninf_remap): base -> tab.
13453 Reported by Matt Rosing.
13454
13455 2002-10-14 Paul Eggert <eggert@twinsun.com>
13456
13457 * tests/action.at, tests/calc.at, tests/conflicts.at,
13458 tests/cxx-type.at, tests/headers.at, tests/input.at,
13459 tests/regression.at, tests/synclines.at, tests/torture.at:
13460 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13461 so that the tests still work even if POSIXLY_CORRECT is set.
13462 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
13463
13464 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13465 for portability to K&R hosts. Fix typo: signed char is guaranteed
13466 only to 127, not to 128.
13467 * data/glr.c (yysigned_char): New type.
13468 * data/yacc.c (yysigned_char): Likewise.
13469 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13470
13471 2002-10-13 Paul Eggert <eggert@twinsun.com>
13472
13473 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13474 true due to limited range of data type" warning from GCC.
13475
13476 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13477 by wrapping enum yytokentype's definition inside #ifndef
13478 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13479
13480 2002-10-13 Akim Demaille <akim@epita.fr>
13481
13482 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13483 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13484
13485 2002-10-13 Akim Demaille <akim@epita.fr>
13486
13487 * Makefile.maint: Update from Autoconf 2.54.
13488 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13489
13490 2002-10-13 Akim Demaille <akim@epita.fr>
13491
13492 * src/print.c (print_state): Separate the list of solved conflicts
13493 from the other items.
13494 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13495
13496 2002-10-13 Akim Demaille <akim@epita.fr>
13497
13498 Let nondeterministic skeletons be usable with deterministic
13499 tables.
13500
13501 With the patch, GAWK compiled by GCC without -O2 passes its test
13502 suite using a GLR parser driven by LALR tables. It fails with -O2
13503 because `struct stat' gives two different answers on my machine:
13504 88 (definition of an auto var) and later 96 (memset on this var).
13505 Hence the stack is badly corrumpted. The headers inclusion is to
13506 blame: if I move the awk.h inclusion before GLR's system header
13507 inclusion, the two struct stat have the same size.
13508
13509 * src/tables.c (pack_table): Always create conflict_table.
13510 (token_actions): Always create conflict_list.
13511 * data/glr.c (YYFLAG): Remove, unused.
13512
13513 2002-10-13 Akim Demaille <akim@epita.fr>
13514
13515 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13516 (O0FLAGS): New.
13517 (VALGRIND, GXX): New.
13518 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13519 * tests/bison.in: Run $PREBISON a pre-command.
13520 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13521 (maintainer-check-g++): New.
13522 * Makefile.am (maintainer-check): New.
13523
13524 2002-10-13 Akim Demaille <akim@epita.fr>
13525
13526 * data/glr.c: Formatting changes.
13527 Tweak some trace messages to match yacc.c's.
13528
13529 2002-10-13 Akim Demaille <akim@epita.fr>
13530
13531 GLR parsers sometimes raise parse errors instead of performing the
13532 default reduction.
13533 Reported by Charles-Henry de Boysson.
13534
13535 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
13536 check the length of the traces when %glr.
13537 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13538 GLR's traces.
13539 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13540 Test GLR parsers.
13541 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13542 (yyltype): Remove the yy prefix from the member names.
13543 (yytable): Complete its comment.
13544 (yygetLRActions): Map error action number from YYTABLE from
13545 YYTABLE_NINF to 0.
13546 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13547 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13548 not satisfying as we could compare an YYACTION computed from
13549 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13550 only value for error actions.
13551 (yyreportParseError): In verbose parse error messages, don't issue
13552 `error' in the list of expected tokens.
13553 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13554 next action to perform to match glr.c's decoding.
13555 (yytable): Complete its comment.
13556
13557 2002-10-13 Paul Eggert <eggert@twinsun.com>
13558
13559 Fix problem reported by Henrik Grubbstroem in
13560 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
13561 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13562 because the Bison parser reads the second action before reducing
13563 the first one.
13564 * src/scan-gram.l (rule_length): New static var.
13565 Use it to keep track of the rule length in the scanner, since
13566 we can't expect the parser to be in lock-step sync with the scanner.
13567 (handle_action_dollar, handle_action_at): Use this var.
13568 * tests/actions.at (Exotic Dollars): Test for the problem.
13569
13570 2002-10-12 Paul Eggert <eggert@twinsun.com>
13571
13572 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13573 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13574 Include <sys/time.h> when checking for clock_t and struct tms.
13575 Use same include order as source.
13576 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
13577 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
13578
13579 * lib/timevar.c: Update copyright date and clarify comments.
13580 (get_time) [IN_GCC]: Keep the GCC version for reference.
13581
13582 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13583 GCC version as of today, then merge Bison's changes.
13584 Change "GCC" to "Bison" in copyright notice. timevar.def's
13585 author is Akim, so change that too.
13586
13587 * src/reader.c (grammar_current_rule_check):
13588 Don't worry about the default action if $$ is untyped.
13589 Prevents bogus warnings reported by Jim Gifford in
13590 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
13591
13592 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13593 * data/glr.c, data/lalr1.cc, data/yacc.c:
13594 Output token definitions before the first part of user declarations.
13595 Fixes compatibility problem reported by Jim Gifford for kbd in
13596 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
13597
13598 2002-10-11 Paul Eggert <eggert@twinsun.com>
13599
13600 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13601 (yyparse): here. This undoes some of the 2002-07-25 change.
13602 Compatibility problem reported by Ralf S. Engelschall with
13603 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13604
13605 2002-10-11 Akim Demaille <akim@epita.fr>
13606
13607 * tests/regression.at Characters Escapes): New.
13608 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13609 characters.
13610 Reported by Jan Nieuwenhuizen.
13611
13612 2002-10-11 Akim Demaille <akim@epita.fr>
13613
13614 * po/id.po: New.
13615
13616 2002-10-10 Paul Eggert <eggert@twinsun.com>
13617
13618 Portability fixes for bitsets; this also avoids several GCC
13619 warnings.
13620
13621 * lib/abitset.c: Include <stddef.h>, for offsetof.
13622 * lib/lbitset.c: Likewise.
13623
13624 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13625 properly for vectors of objects. Do not assume that adding a
13626 header size to a multiple of a word size yields a value that is
13627 properly aligned for the whole union.
13628 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13629
13630 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13631 unique names for structures.
13632 * lib/ebitset.c (ebitset_bytes): Likewise.
13633 * lib/lbitset.c (lbitset_bytes): Likewise.
13634
13635 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13636 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13637 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13638 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13639 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13640 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13641 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13642 to improve the type-checking that GCC can do.
13643 * lib/bitset.c (bitset_op4_cmp): Likewise.
13644 * lib/bitset_stats.c (bitset_stats_count,
13645 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13646 bitset_stats_copy, bitset_stats_disjoint_p,
13647 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13648 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13649 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13650 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13651 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13652 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13653 bitset_stats_or_and_cmp): Likewise.
13654 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13655 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13656 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13657 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13658
13659 * lib/abitset.h: Include bitset.h, not bbitset.h.
13660 * lib/ebitset.h: Likewise.
13661 * lib/lbitset.h: Likewise.
13662
13663 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13664 All instances of parameters of type enum bitset_opts are now of
13665 type enum_bitset_opts, to conform to the C Standard, and similarly
13666 for enum_bitset_type.
13667 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13668 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13669
13670 Do not use "struct bitset_struct" to mean different things in
13671 different modules. Not only is this confusing, it violates
13672 the C Standard, which requires that structure types in different
13673 modules must be compatible if one is to be passed to the other.
13674 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13675 All instances of "struct bitset_struct *" replaced with "bitset".
13676 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13677 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13678 struct lbitset_struct, struct bitset_stats_struct): New types.
13679 All uses of struct bitset_struct changed to union bitset_union,
13680 etc.
13681 * lib/abitset.c (struct abitset_struct, abitset,
13682 struct bitset_struct): Remove.
13683 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13684 struct bitset_struct): Remove.
13685 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13686 bitset_struct): Remove.
13687 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13688 Likewise.
13689
13690 Do not call a function of type T using a call that assumes the
13691 function is of a different type U. Standard C requires that a
13692 function must be called with a type that is compatible with its
13693 definition.
13694 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13695 New decls.
13696 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13697 New functions.
13698 * lib/ebitset.c (PFV): Remove.
13699 * lib/lbitset.c (PFV): Likewise.
13700 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13701 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13702 decls.
13703 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13704 (ebitset_vtable): Use them.
13705 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13706 lbitset_xor): New functions.
13707 (lbitset_vtable): Use them.
13708
13709 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13710 Declare.
13711
13712 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13713 GCC warning.
13714 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13715 Use offsetof, for simplicity.
13716
13717 2002-10-06 Paul Eggert <eggert@twinsun.com>
13718
13719 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13720 the same width as int. This reapplies a hunk of the 2002-08-12 patch
13721 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
13722 which was inadvertently undone by the 2002-09-30 patch.
13723 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13724 the same width as int.
13725
13726 2002-10-04 Paul Eggert <eggert@twinsun.com>
13727
13728 Version 1.50.
13729
13730 * configure.ac (AC_INIT), NEWS: Increment version number.
13731
13732 * doc/bison.texinfo: Minor spelling, grammar, and white space
13733 fixes.
13734 (Symbols): Mention that any negative value returned from yylex
13735 signifies end-of-input. Warn about negative chars. Mention
13736 the portable Standard C character set.
13737
13738 The GNU coding standard says CFLAGS and YFLAGS are reserved
13739 for the installer to set.
13740 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13741 * src/Makefile.am (AM_CFLAGS): Likewise.
13742 (AM_YFLAGS): Renamed from YFLAGS.
13743
13744 Fix some MAX and MIN problems.
13745 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13746 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13747 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13748 * src/reader.c (reader): Use it.
13749
13750 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13751 POSIX 1003.1-2001 has removed fgrep.
13752
13753 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13754
13755 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13756 interpreted as signed.
13757 * lib/ebitset.c (ebitset_list): Fix bug.
13758
13759 2002-10-01 Paul Eggert <eggert@twinsun.com>
13760
13761 More fixes for 64-bit hosts and large bitsets.
13762
13763 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13764 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13765 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13766 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13767 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13768 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13769 bitset_count_): Likewise.
13770 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13771 bitset_first, bitset_last): Likewise.
13772 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13773 bitset_stats_list_reverse, bitset_stats_size,
13774 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13775 Likewise.
13776 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13777 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13778 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13779 bitsetv_reflexive_transitive_closure): Likewise.
13780 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13781 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13782 Likewise.
13783 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13784 Likewise.
13785
13786 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13787 Use size_t, not unsigned int, to count bytes.
13788 * lib/abitset.h (abitset_bytes): Likewise.
13789 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13790 Likewise.
13791 * lib/bitset.h (bitset_bytes): Likewise.
13792 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13793 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13794 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13795 * lib/ebitset.c (ebitset_bytes): Likewise.
13796 * lib/ebitset.h (ebitset_bytes): Likewise.
13797 * lib/lbitset.c (lbitset_bytes): Likewise.
13798 * lib/lbitset.h (lbitset_bytes): Likewise.
13799
13800 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13801 abitset_subset_p, abitset_disjoint_p, abitset_and,
13802 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13803 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13804 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13805 abitset_or_and, abitset_or_and_cmp):
13806 Use bitset_windex instead of unsigned int.
13807 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13808 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13809 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13810 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13811 Likewise.
13812 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
13813
13814 * lib/bitset.c (bitset_print):
13815 Use proper printf formats for widths of integer types.
13816 * lib/bitset_stats.c (bitset_percent_histogram_print,
13817 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13818 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13819 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13820 * lib/lbitset.c (lbitset_bytes): Likewise.
13821
13822 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13823 BITSET_SIZE_MAX): New macros.
13824 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13825 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13826 to BITSET_WINDEX_MAX.
13827
13828 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13829 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13830 since we now return the bitset_bindex type (not int).
13831
13832 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13833 when computing sizes.
13834 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13835
13836 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13837 and avoid cast to unsigned.
13838
13839 2002-09-30 Akim Demaille <akim@epita.fr>
13840
13841 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13842 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13843 Updates from Michael Hayes.
13844
13845 2002-09-30 Art Haas <ahaas@neosoft.com>
13846
13847 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13848 invocations.
13849 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13850 defined.
13851
13852 2002-09-27 Akim Demaille <akim@epita.fr>
13853
13854 Version 1.49c.
13855
13856 2002-09-27 Akim Demaille <akim@epita.fr>
13857
13858 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13859 (Because of AC_LIBSOURCE).
13860
13861 2002-09-27 Akim Demaille <akim@epita.fr>
13862
13863 Playing with Autoscan.
13864
13865 * configure.ac: Remove the old LIBOBJ tweaks.
13866 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13867 * lib/strrchr.c: New.
13868 * lib/strtol.c: New, from the Coreutils 4.5.1.
13869
13870 2002-09-27 Akim Demaille <akim@epita.fr>
13871
13872 Playing with Autoscan.
13873
13874 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13875 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13876 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13877 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13878 Coreutils 4.5.1.
13879
13880 2002-09-24 Akim Demaille <akim@epita.fr>
13881
13882 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13883 (Frequently Asked Questions, Parser Stack Overflow): New.
13884
13885 2002-09-13 Akim Demaille <akim@epita.fr>
13886
13887 Playing with autoscan.
13888
13889 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13890 * src/files.c (skeleton_find): Remove, unused.
13891 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13892 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13893
13894 2002-09-13 Akim Demaille <akim@epita.fr>
13895
13896 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13897 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13898
13899 2002-09-13 Akim Demaille <akim@epita.fr>
13900
13901 * configure.ac: Require 2.54.
13902 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
13903 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
13904 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
13905 Remove, provided by Autoconf macros.
13906
13907 2002-09-12 Akim Demaille <akim@epita.fr>
13908
13909 * m4/prereq.m4: Update, from Coreutils 4.5.1.
13910
13911 2002-09-12 Akim Demaille <akim@epita.fr>
13912
13913 * m4/prereq.m4: Update, from Fileutils 4.1.5.
13914 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
13915 Reported by Martin Mokrejs.
13916
13917 2002-09-10 Akim Demaille <akim@epita.fr>
13918
13919 * src/parse-gram.y: Associate a human readable string to each
13920 token type.
13921 * tests/regression.at (Invalid inputs): Adjust.
13922
13923 2002-09-10 Gary V. Vaughan <gary@gnu.org>
13924
13925 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
13926 with an Autoconf-2.5x style configure.ac.
13927
13928 2002-09-06 Paul Eggert <eggert@twinsun.com>
13929
13930 * doc/bison.texinfo (Conditions): Make explicit that the GPL
13931 exception applies only to yacc.c. This is a modification of a
13932 patch originally suggested by Akim Demaille.
13933
13934 2002-09-06 Akim Demaille <akim@epita.fr>
13935
13936 * data/c.m4 (b4_copyright): Move the GPL exception comment from
13937 here to...
13938 * data/yacc.c: here.
13939
13940 * data/lalr1.cc (struct yyltype): Don't define it, since we use
13941 LocationType.
13942 (b4_ltype): Default to yy::Location from location.hh.
13943
13944 2002-09-04 Jim Meyering <jim@meyering.net>
13945
13946 * data/yacc.c: Guard the declaration of yytoknum also with
13947 `#ifdef YYPRINT', so it is declared only when used.
13948
13949 2002-09-04 Akim Demaille <akim@epita.fr>
13950
13951 * configure.in: Rename as...
13952 * configure.ac: this.
13953 Bump to 1.49c.
13954
13955 2002-09-04 Akim Demaille <akim@epita.fr>
13956
13957 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
13958 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
13959 translate maintainer only messages.
13960
13961 2002-08-12 Paul Eggert <eggert@twinsun.com>
13962
13963 Version 1.49b.
13964
13965 * Makefile.am (SUBDIRS): Remove intl.
13966 (DISTCLEANFILES): Remove.
13967 * NEWS: Mention that GNU M4 is now required. Clarify what is
13968 meant by "larger grammars". Mention the pt_BR translation.
13969 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
13970 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
13971 Bump version from 0.11.2 to 0.11.5.
13972 (BISON_PREREQ_STAGE): Remove.
13973 (AM_GNU_GETTEXT): Use external gettext.
13974 (AC_OUTPUT): Remove intl/Makefile.
13975
13976 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
13977
13978 * data/glr.c: Include string.h, for strlen.
13979 (yyreportParseError): Use size_t for yysize.
13980 (yy_yypstack): No longer nested inside yypstates, as nested
13981 functions are not portable. Do not assume size_t is the
13982 same width as int.
13983 (yypstates): Do not assume that ptrdiff_t is the same width
13984 as int, and similarly for yyposn and YYINDEX.
13985
13986 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
13987
13988 * lib/Makefile.am (INCLUDES): Do not include from the intl
13989 directory, which has been removed.
13990 * src/Makefile.am (INCLUDES): Likewise.
13991
13992 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
13993 (bitsets_sources, additional_bitsets_sources, timevars_sources):
13994 New vars.
13995
13996 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
13997 * tests/Makefile.am (EXTRA_DIST): Likewise.
13998
13999 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14000 Do not assume that bitset_windex is the same width as unsigned.
14001
14002 * lib/abitset.c (abitset_unused_clear): Do not assume that
14003 bitset_word is the same width as int.
14004 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14005 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14006 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14007 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14008 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14009
14010 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14011 portability to one's complement hosts!).
14012 * lib/ebitset.c (ebitset_op1): Likewise.
14013 * lib/lbitset.c (lbitset_op1): Likewise.
14014
14015 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14016 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14017 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14018 Sync with fileutils.
14019 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14020 lib/gettext.h: Sync with diffutils.
14021
14022 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14023 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14024
14025 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14026 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14027 check for void *.
14028
14029 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14030 size_t; the old version tried to do this but casted improperly.
14031 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14032 (bitset_test): Now returns int, not unsigned long.
14033
14034 * lib/bitset_stats.c: Include "gettext.h".
14035 (_): New macro.
14036 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14037 name locals "index", as it generates unnecessary warnings on some
14038 hosts that have an "index" function.
14039
14040 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14041 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14042 they need translation.
14043 * src/LR0.c (state_list_append, new_itemsets, get_state,
14044 append_states, generate_states): Likewise.
14045 * src/assoc.c (assoc_to_string): Likewise.
14046 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14047 * src/gram.c (grammar_dump): Likewise.
14048 * src/injections.c (injections_compute): Likewise.
14049 * src/lalr.c (lookaheads_print): Likewise.
14050 * src/relation.c (relation_transpose): Likewise.
14051 * src/scan-gram.l: Likewise.
14052 * src/tables.c (table_grow, pack_vector): Likewise.
14053
14054 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14055 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14056 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14057 * m4/mbstate_t.m4: Sync with fileutils.
14058 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14059
14060 * po/LINGUAS: Add pt_BR.
14061 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14062 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14063 lib/timevar.c.
14064 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14065 manual recommends.
14066 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14067
14068 * src/complain.c (strerror_r): Remove decl; not needed.
14069 (strerror): Use same pattern as ../lib/error.c.
14070
14071 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14072
14073 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14074
14075 * src/main.c (main): Cast result of bindtextdomain and textdomain
14076 to void, to avoid a GCC warning when --disable-nls is in effect.
14077
14078 * src/scan-gram.l: Use strings rather than escapes when possible,
14079 to minimize the number of warnings from xgettext.
14080 (handle_action_dollar, handle_action_at): Don't use isdigit,
14081 as it mishandles negative chars and it may not work as expected
14082 outside the C locale.
14083
14084 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14085 this is a GCC extension and is not portable to other compilers.
14086
14087 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14088 Do not include <ctype.h>; no longer needed.
14089 Do not include <malloc.h>; no longer needed (and generates
14090 warnings on OpenBSD 3.0).
14091
14092 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14093 it's not portable.
14094
14095 * tests/regression.at: Do not use 'cc -c input.c -o input';
14096 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14097
14098 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14099 exit status as failure, not just exit status 1. Sun C exits
14100 with status 2 sometimes.
14101
14102 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14103 Use it for the two large tests.
14104
14105 2002-08-02 Akim Demaille <akim@epita.fr>
14106
14107 * src/conflicts.c (conflicts_output): Don't output rules never
14108 reduced here, since anyway that computation doesn't work.
14109 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14110 (rule_useless_p, rule_never_reduced_p): New.
14111 (grammar_rules_partial_print): Use a filter instead of a range.
14112 Display the title only if needed.
14113 (grammar_rules_print): Adjust.
14114 (grammar_rules_never_reduced_report): New.
14115 * src/tables.c (action_row): Move the computation of rules never
14116 reduced to...
14117 (token_actions): here.
14118 * src/main.c (main): Make the parser before making the report, so
14119 that rules never reduced are computed.
14120 Call grammar_rules_never_reduced_report.
14121 * src/print.c (print_results): Report rules never reduced.
14122 * tests/conflicts.at, tests/reduce.at: Adjust.
14123
14124 2002-08-01 Akim Demaille <akim@epita.fr>
14125
14126 Instead of attaching lookaheads and duplicating the rules being
14127 reduced by a state, attach the lookaheads to the reductions.
14128
14129 * src/state.h (state_t): Remove the `lookaheads',
14130 `lookaheads_rule' member.
14131 (reductions_t): Add a `lookaheads' member.
14132 Use a regular array for the `rules'.
14133 * src/state.c (reductions_new): Initialize the lookaheads member
14134 to 0.
14135 (state_rule_lookaheads_print): Adjust.
14136 * src/state.h, src/state.c (state_reductions_find): New.
14137 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14138 (count_rr_conflicts): Adjust.
14139 * src/lalr.c (LArule): Remove.
14140 (add_lookback_edge): Adjust.
14141 (state_lookaheads_count): New.
14142 (states_lookaheads_initialize): Merge into...
14143 (initialize_LA): this.
14144 (lalr_free): Adjust.
14145 * src/main.c (main): Don't free nullable and derives too early: it
14146 is used by --verbose.
14147 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14148
14149 2002-08-01 Akim Demaille <akim@epita.fr>
14150
14151 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14152 `rule_number_t**'.
14153 (set_derives, free_derives): Rename as...
14154 (derives_compute, derives_free): this.
14155 Adjust all dependencies.
14156 * src/nullable.c (set_nullable, free_nullable): Rename as...
14157 (nullable_compute, nullable_free): these.
14158 (rule_list_t): Store rule_t *, not rule_number_t.
14159 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14160 pointers, instead of their numbers.
14161 * src/main.c (main): Call nullable_free, and derives_free earlier,
14162 as they were lo longer used.
14163
14164 2002-08-01 Akim Demaille <akim@epita.fr>
14165
14166 * lib/timevar.c (get_time): Include children time.
14167 * src/lalr.h (LA, LArule): Don't export them: used with the
14168 state_t.
14169 * src/lalr.c (LA, LArule): Static.
14170 * src/lalr.h, src/lalr.c (lalr_free): New.
14171 * src/main.c (main): Call it.
14172 * src/tables.c (pack_vector): Check whether loc is >= to the
14173 table_size, not >.
14174 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14175 (tables_generate): do it, since that's also it which allocates
14176 them.
14177 Don't free LA and LArule, main does.
14178
14179 2002-07-31 Akim Demaille <akim@epita.fr>
14180
14181 Separate parser tables computation and output.
14182
14183 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14184 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14185 (yydefgoto, yydefact, high): Move to...
14186 * src/tables.h, src/tables.c: here.
14187 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14188 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14189 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14190 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14191 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14192 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14193 (action_row, save_row, token_actions, save_column, default_goto)
14194 (goto_actions, sort_actions, matching_state, pack_vector)
14195 (table_ninf_remap, pack_table, prepare_actions): Move to...
14196 * src/tables.c: here.
14197 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14198 * src/output.c (token_actions, output_base, output_conflicts)
14199 (output_check): Merge into...
14200 (prepare_actions): this.
14201 (actions_output): Rename as...
14202 (user_actions_output): this.
14203 * src/main.c (main): Call tables_generate and tables_free.
14204
14205 2002-07-31 Akim Demaille <akim@epita.fr>
14206
14207 Steal GCC's --time-report support.
14208
14209 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14210 stolen/adjusted from GCC.
14211 * m4/stage.m4: Remove time related checks.
14212 * m4/timevar.m4: New.
14213 * configure.in: Adjust.
14214 * src/system.h: Adjust to using timevar.h.
14215 * src/getargs.h, src/getargs.c: Support trace_time for
14216 --trace=time.
14217 * src/main.c (stage): Remove.
14218 (main): Replace `stage' invocations with timevar calls.
14219 * src/output.c: Insert pertinent timevar calls.
14220
14221 2002-07-31 Akim Demaille <akim@epita.fr>
14222
14223 Let --trace have arguments.
14224
14225 * src/getargs.h (enum trace_e): New.
14226 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14227 (long_options, short_options): --trace/-T takes an optional
14228 argument.
14229 Change all the uses of trace_flag to reflect the new flags.
14230 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14231
14232 Strengthen `stage' portability.
14233
14234 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14235 * configure.in: Use it.
14236 Don't check for malloc.h and sys/times.h.
14237 * src/system.h: Include them when appropriate.
14238 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14239 times and struct tms are available.
14240
14241 2002-07-30 Akim Demaille <akim@epita.fr>
14242
14243 In verbose parse error message, don't report `error' as an
14244 expected token.
14245 * tests/actions.at (Printers and Destructors): Adjust.
14246 * tests/calc.at (Calculator $1): Adjust.
14247 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14248 error message, do not report the parser accepts the error token in
14249 that state.
14250
14251 2002-07-30 Akim Demaille <akim@epita.fr>
14252
14253 Normalize conflict related messages.
14254
14255 * src/complain.h, src/complain.c (warn, complain): New.
14256 * src/conflicts.c (conflicts_print): Use them.
14257 (conflict_report_yacc): New, extracted from...
14258 (conflicts_print): here.
14259 * tests/conflicts.at, tests/existing.at: Adjust.
14260
14261 2002-07-30 Akim Demaille <akim@epita.fr>
14262
14263 Report rules which are never reduced by the parser: those hidden
14264 by conflicts.
14265
14266 * src/LR0.c (save_reductions): Don't make the final state too
14267 different: save its reduction (accept) instead of having a state
14268 without any action (no shift or goto, no reduce).
14269 Note: the final state is now a ``regular'' state, i.e., the
14270 parsers now contain `reduce 0' as default reduction.
14271 Nevertheless, since they decide to `accept' when yystate =
14272 final_state, they still will not reduce rule 0.
14273 * src/print.c (print_actions, print_reduction): Adjust.
14274 * src/output.c (action_row): Track reduced rules.
14275 (token_actions): Report rules never reduced.
14276 * tests/conflicts.at, tests/regression.at: Adjust.
14277
14278 2002-07-30 Akim Demaille <akim@epita.fr>
14279
14280 `stage' was accidently included in a previous patch.
14281 Initiate its autoconfiscation.
14282
14283 * configure.in: Look for malloc.h and sys/times.h.
14284 * src/main.c (stage): Adjust.
14285 Report only when trace_flag.
14286
14287 2002-07-29 Akim Demaille <akim@epita.fr>
14288
14289 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14290 state_number_t.
14291 (errs_t): symbol_t*, not symbol_number_t.
14292 (reductions_t): rule_t*, not rule_number_t.
14293 (FOR_EACH_SHIFT): New.
14294 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14295 * src/print.c, src/print_graph.c: Adjust.
14296
14297 2002-07-29 Akim Demaille <akim@epita.fr>
14298
14299 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14300
14301 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14302 (endtoken, accept): these.
14303 * src/reader.c (reader): Set endtoken's default tag to "$end".
14304 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14305 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14306 Adjust.
14307
14308 2002-07-29 Akim Demaille <akim@epita.fr>
14309
14310 * src/reduce.c (reduce_grammar): When the language is empty,
14311 complain about the start symbol, not the axiom.
14312 Use its location.
14313 * tests/reduce.at (Empty Language): New.
14314
14315 2002-07-26 Akim Demaille <akim@epita.fr>
14316
14317 * src/reader.h, src/reader.c (gram_error): ... can't get
14318 yycontrol without making too strong assumptions on the parser
14319 itself.
14320 * src/output.c (prepare_tokens): Use the real 0th value of
14321 token_translations instead of `0'.
14322 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14323 visible here.
14324 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14325 for the time being: %locations ought to provide it to yyerror.
14326
14327 2002-07-25 Akim Demaille <akim@epita.fr>
14328
14329 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14330 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14331 * tests/regression.at (Web2c Actions): Adjust.
14332
14333 2002-07-25 Akim Demaille <akim@epita.fr>
14334
14335 Stop storing rules from 1 to nrules + 1.
14336
14337 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14338 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14339 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14340 Iterate from 0 to nrules.
14341 Use rule_number_as_item_number and item_number_as_rule_number.
14342 Adjust to `derive' now containing possibly 0.
14343 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14344 Handle the `- 1' part in rule numbers from/to item numbers.
14345 * src/conflicts.c (log_resolution): Fix the message which reversed
14346 shift and reduce.
14347 * src/output.c (action_row): Initialize default_rule to -1.
14348 (token_actions): Adjust.
14349 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14350 expected output.
14351 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14352
14353 2002-07-25 Akim Demaille <akim@epita.fr>
14354
14355 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14356 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14357 (b4_c_knr_arg_decl): New.
14358 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14359 yyreport_parse_error.
14360
14361 2002-07-25 Akim Demaille <akim@epita.fr>
14362
14363 * data/yacc.c (yyreport_parse_error): New, extracted from...
14364 (yyparse): here.
14365 (yydestruct, yysymprint): Move above yyparse.
14366 Be K&R compliant.
14367
14368 2002-07-25 Akim Demaille <akim@epita.fr>
14369
14370 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14371 replace...
14372 (b4_sint_type, b4_uint_type): these.
14373 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14374 * tests/regression.at (Web2c Actions): Adjust.
14375
14376 2002-07-25 Akim Demaille <akim@epita.fr>
14377
14378 * src/gram.h (TIEM_NUMBER_MAX): New.
14379 (item_number_of_rule_number, rule_number_of_item_number): Rename
14380 as...
14381 (rule_number_as_item_number, item_number_as_rule_number): these.
14382 Adjust dependencies.
14383 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14384 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14385 (symbol_number_to_vector_number): New.
14386 (order): Of vector_number_t* type.
14387 (base_t, BASE_MAX, BASE_MIN): New.
14388 (froms, tos, width, pos, check): Of base_t type.
14389 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14390 (actrow): Of action_number_t type.
14391 (conflrow): Of unsigned int type.
14392 (table_ninf, base_ninf): New.
14393 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14394 (muscle_insert_int_table, muscle_insert_base_table)
14395 (muscle_insert_rule_number_table): New.
14396 (prepare_tokens): Output `toknum' as int_table.
14397 (action_row): Returns a rule_number_t.
14398 Use ACTION_MIN, not SHRT_MIN.
14399 (token_actions): yydefact is rule_number_t*.
14400 (table_ninf_remap): New.
14401 (pack_table): Use it for `base' and `table'.
14402 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14403 replaced with...
14404 (YYPACT_NINF, YYTABLE_NINF): these.
14405 (yypact, yytable): Compute their types instead of hard-coded
14406 `short'.
14407 * tests/regression.at (Web2c Actions): Adjust.
14408
14409 2002-07-19 Akim Demaille <akim@epita.fr>
14410
14411 * src/scan-gram.l (id): Can start with an underscore.
14412
14413 2002-07-16 Akim Demaille <akim@epita.fr>
14414
14415 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14416 Adjust all former `associativity' dependencies.
14417 * src/symtab.c (symbol_new): Default associativity is `undef', not
14418 `right'.
14419 (symbol_check_alias_consistence): Adjust.
14420
14421 2002-07-09 Akim Demaille <akim@epita.fr>
14422
14423 * doc/bison.texinfo: Properly set the ``header'' part.
14424 Use @dircategory ``GNU programming tools'' as per Texinfo's
14425 documentation.
14426 Use @copying.
14427
14428 2002-07-09 Akim Demaille <akim@epita.fr>
14429
14430 * lib/quotearg.h: Protect against multiple inclusions.
14431 * src/location.h (location_t): Add a `file' member.
14432 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14433 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14434 `error_one_per_line' support.
14435
14436 2002-07-09 Akim Demaille <akim@epita.fr>
14437
14438 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14439 * src/reader.c (lineno): Remove.
14440 Adjust all dependencies.
14441 (get_merge_function): Take a location and use complain_at.
14442 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14443 * tests/regression.at (Invalid inputs, Mixing %token styles):
14444 Adjust.
14445
14446 2002-07-09 Akim Demaille <akim@epita.fr>
14447
14448 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14449 recovery rule, and forbid extensions when --yacc.
14450 (gram_error): Use complain_at.
14451 * src/reader.c (reader): Exit if there were parse errors.
14452
14453 2002-07-09 Akim Demaille <akim@epita.fr>
14454
14455 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14456 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14457 Reported by R Blake <blakers@mac.com>.
14458
14459 2002-07-09 Akim Demaille <akim@epita.fr>
14460
14461 * data/yacc.c: Output the copyright notive in the header.
14462
14463 2002-07-03 Akim Demaille <akim@epita.fr>
14464
14465 * src/output.c (froms, tos): Are state_number_t.
14466 (save_column): sp, sp1, and sp2 are state_number_t.
14467 (prepare): Rename `final' as `final_state_number', `nnts' as
14468 `nterms_number', `nrules' as `rules_number', `nstates' as
14469 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14470 unused.
14471 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14472 * data/lalr1.cc (nsym_): Remove, unused.
14473
14474 2002-07-03 Akim Demaille <akim@epita.fr>
14475
14476 * src/lalr.h, src/lalr.c (goto_number_t): New.
14477 * src/lalr.c (goto_list_t): New.
14478 Propagate them.
14479 * src/nullable.c (rule_list_t): New.
14480 Propagate.
14481 * src/types.h: Remove.
14482
14483 2002-07-03 Akim Demaille <akim@epita.fr>
14484
14485 * src/closure.c (print_fderives): Use rule_rhs_print.
14486 * src/derives.c (print_derives): Use rule_rhs_print.
14487 (rule_list_t): New, replaces `shorts'.
14488 (set_derives): Add comments.
14489 * tests/sets.at (Nullable, Firsts): Adjust.
14490
14491 2002-07-03 Akim Demaille <akim@epita.fr>
14492
14493 * src/output.c (prepare_actions): Free `tally' and `width'.
14494 (prepare_actions): Allocate and free `order'.
14495 * src/symtab.c (symbols_free): Free `symbols'.
14496 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14497 * src/output.c (m4_invoke): Move to...
14498 * src/scan-skel.l: here.
14499 (<<EOF>>): Close yyout, and free its name.
14500
14501 2002-07-03 Akim Demaille <akim@epita.fr>
14502
14503 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14504
14505 * src/LR0.c (new_state): Merge into...
14506 (state_list_append): this.
14507 (new_states): Merge into...
14508 (generate_states): here.
14509 (set_states): Don't ensure a proper `errs' state member here, do it...
14510 * src/conflicts.c (conflicts_solve): here.
14511 * src/state.h, src/state.c: Comment changes.
14512 (state_t): Rename member `shifts' as `transitions'.
14513 Adjust all dependencies.
14514 (errs_new): For consistency, also take the values as argument.
14515 (errs_dup): Remove.
14516 (state_errs_set): New.
14517 (state_reductions_set, state_transitions_set): Assert that no
14518 previous value was assigned.
14519 (state_free): New.
14520 (states_free): Use it.
14521 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14522 temporary storage: use `errs' and `nerrs' as elsewhere.
14523 (set_conflicts): Allocate and free this `errs'.
14524
14525 2002-07-02 Akim Demaille <akim@epita.fr>
14526
14527 * lib/libiberty.h: New.
14528 * lib: Update the bitset implementation from upstream.
14529 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14530 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14531 * src/main.c: Adjust bitset stats calls.
14532
14533 2002-07-01 Paul Eggert <eggert@twinsun.com>
14534
14535 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14536 char, so that negative chars don't collide with $.
14537
14538 2002-06-30 Akim Demaille <akim@epita.fr>
14539
14540 Have the GLR tests be `warning' checked, and fix the warnings.
14541
14542 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14543 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14544 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14545 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14546 (yyaddDeferredAction): static.
14547 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14548 (yyreportParseError): yyprefix is const.
14549 yytokenp is used only when verbose.
14550 (yy__GNUC__): Replace with __GNUC__.
14551 (yypdumpstack): yyi is size_t.
14552 (yypreference): Un-yy local variables and arguments, to avoid
14553 clashes with `yyr1'. Anyway, we are not in the user name space.
14554 (yytname_size): be an int, as is compared with ints.
14555 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14556 Use them.
14557 * tests/cxx-gram.at: Use quotation to protect $1.
14558 Use AT_COMPILE to enable warnings hunts.
14559 Prototype yylex and yyerror.
14560 `Use' argc.
14561 Include `string.h', not `strings.h'.
14562 Produce and prototype stmtMerge only when used.
14563 yylex takes a location.
14564
14565 2002-06-30 Akim Demaille <akim@epita.fr>
14566
14567 We spend a lot of time in quotearg, in particular when --verbose.
14568
14569 * src/symtab.c (symbol_get): Store a quoted version of the key.
14570 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14571 Adjust all callers.
14572
14573 2002-06-30 Akim Demaille <akim@epita.fr>
14574
14575 * src/state.h (reductions_t): Rename member `nreds' as num.
14576 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14577 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14578
14579 2002-06-30 Akim Demaille <akim@epita.fr>
14580
14581 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14582 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14583 (shifts_to): Rename as...
14584 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14585 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14586 (TRANSITION_IS_DISABLED, transitions_to): these.
14587
14588 2002-06-30 Akim Demaille <akim@epita.fr>
14589
14590 * src/print.c (print_shifts, print_gotos): Merge into...
14591 (print_transitions): this.
14592 (print_transitions, print_errs, print_reductions): Align the
14593 lookaheads columns.
14594 (print_core, print_transitions, print_errs, print_state,
14595 print_grammar): Output empty lines separator before, not after.
14596 (state_default_rule_compute): Rename as...
14597 (state_default_rule): this.
14598 * tests/conflicts.at (Defaulted Conflicted Reduction),
14599 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14600 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14601
14602 2002-06-30 Akim Demaille <akim@epita.fr>
14603
14604 Display items as we display rules.
14605
14606 * src/gram.h, src/gram.c (rule_lhs_print): New.
14607 * src/gram.c (grammar_rules_partial_print): Use it.
14608 * src/print.c (print_core): Likewise.
14609 * tests/conflicts.at (Defaulted Conflicted Reduction),
14610 (Unresolved SR Conflicts): Adjust.
14611 (Unresolved SR Conflicts): Adjust and rename as...
14612 (Resolved SR Conflicts): this, as was meant.
14613 * tests/regression.at (Web2c Report): Adjust.
14614
14615 2002-06-30 Akim Demaille <akim@epita.fr>
14616
14617 * src/print.c (state_default_rule_compute): New, extracted from...
14618 (print_reductions): here.
14619 Pessimize, but clarify the code.
14620 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14621
14622 2002-06-30 Akim Demaille <akim@epita.fr>
14623
14624 * src/output.c (action_row): Let default_rule be always a rule
14625 number.
14626
14627 2002-06-30 Akim Demaille <akim@epita.fr>
14628
14629 * src/closure.c (print_firsts, print_fderives, closure):
14630 Use BITSET_EXECUTE.
14631 * src/lalr.c (lookaheads_print): Likewise.
14632 * src/state.c (state_rule_lookaheads_print): Likewise.
14633 * src/print_graph.c (print_core): Likewise.
14634 * src/print.c (print_reductions): Likewise.
14635 * src/output.c (action_row): Likewise.
14636 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14637
14638 2002-06-30 Akim Demaille <akim@epita.fr>
14639
14640 * src/print_graph.c: Use report_flag.
14641
14642 2002-06-30 Akim Demaille <akim@epita.fr>
14643
14644 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14645 to...
14646 * src/relation.h, src/relation.c (traverse, relation_digraph)
14647 (relation_print, relation_transpose): New.
14648
14649 2002-06-30 Akim Demaille <akim@epita.fr>
14650
14651 * src/state.h, src/state.c (shifts_to): New.
14652 * src/lalr.c (build_relations): Use it.
14653
14654 2002-06-30 Akim Demaille <akim@epita.fr>
14655
14656 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14657 (item_number_of_rule_number, rule_number_of_item_number): New.
14658 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14659 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14660 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14661 Propagate their use.
14662 Much remains to be done, in particular wrt `shorts' from types.h.
14663
14664 2002-06-30 Akim Demaille <akim@epita.fr>
14665
14666 * src/symtab.c (symbol_new): Initialize the `printer' member.
14667
14668 2002-06-30 Akim Demaille <akim@epita.fr>
14669
14670 * src/LR0.c (save_reductions): Remove, replaced by...
14671 * src/state.h, src/state.c (state_reductions_set): New.
14672 (reductions, errs): Rename as...
14673 (reductions_t, errs_t): these.
14674 Adjust all dependencies.
14675
14676 2002-06-30 Akim Demaille <akim@epita.fr>
14677
14678 * src/LR0.c (state_list_t, state_list_append): New.
14679 (first_state, last_state): Now symbol_list_t.
14680 (this_state): Remove.
14681 (new_itemsets, append_states, save_reductions): Take a state_t as
14682 argument.
14683 (set_states, generate_states): Adjust.
14684 (save_shifts): Remove, replaced by...
14685 * src/state.h, src/state.c (state_shifts_set): New.
14686 (shifts): Rename as...
14687 (shifts_t): this.
14688 Adjust all dependencies.
14689 * src/state.h (state_t): Remove the `next' member.
14690
14691 2002-06-30 Akim Demaille <akim@epita.fr>
14692
14693 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14694 escaped in slot 0.
14695
14696 2002-06-30 Akim Demaille <akim@epita.fr>
14697
14698 Use hash.h for the state hash table.
14699
14700 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14701 (allocate_storage): Use state_hash_new.
14702 (free_storage): Use state_hash_free.
14703 (new_state, get_state): Adjust.
14704 * src/lalr.h, src/lalr.c (states): Move to...
14705 * src/states.h (state_t): Remove the `link' member, no longer
14706 used.
14707 * src/states.h, src/states.c: here.
14708 (state_hash_new, state_hash_free, state_hash_lookup)
14709 (state_hash_insert, states_free): New.
14710 * src/states.c (state_table, state_compare, state_hash): New.
14711 * src/output.c (output_actions): Do not free states now, since we
14712 still need to know the final_state number in `prepare', called
14713 afterwards. Do it...
14714 * src/main.c (main): here: call states_free after `output'.
14715
14716 2002-06-30 Akim Demaille <akim@epita.fr>
14717
14718 * src/state.h, src/state.c (state_new): New, extracted from...
14719 * src/LR0.c (new_state): here.
14720 * src/state.h (STATE_ALLOC): Move to...
14721 * src/state.c: here.
14722 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14723 * src/state.h, src/state.c: here.
14724
14725 2002-06-30 Akim Demaille <akim@epita.fr>
14726
14727 * src/reader.c (gensym): Rename as...
14728 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14729 (getsym): Rename as...
14730 (symbol_get): this.
14731
14732 2002-06-30 Akim Demaille <akim@epita.fr>
14733
14734 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14735 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14736 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14737 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14738
14739 2002-06-30 Akim Demaille <akim@epita.fr>
14740
14741 Make the test suite pass with warnings checked.
14742
14743 * tests/actions.at (Printers and Destructors): Improve.
14744 Avoid unsigned vs. signed issues.
14745 * tests/calc.at: Don't exercise the scanner here, do it...
14746 * tests/input.at (Torturing the Scanner): here.
14747
14748 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14749
14750 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
14751 reorganize first lines parallel to yacc.c.
14752
14753 2002-06-28 Akim Demaille <akim@epita.fr>
14754
14755 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14756 (b4_token_enum, b4_token_defines): New, factored from...
14757 * data/lalr1.cc, data/yacc.c, glr.c: here.
14758
14759 2002-06-28 Akim Demaille <akim@epita.fr>
14760
14761 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14762 unused variables.
14763 * src/output.c (merger_output): static.
14764
14765 2002-06-28 Akim Demaille <akim@epita.fr>
14766
14767 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
14768 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14769 pacify GCC.
14770 * src/output.c (save_row): Initialize all the variables to pacify GCC.
14771
14772 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14773
14774 Accumulated changelog for new GLR parsing features.
14775
14776 * src/conflicts.c (count_total_conflicts): Change name to
14777 conflicts_total_count.
14778 * src/conflicts.h: Ditto.
14779 * src/output.c (token_actions): Use the new name.
14780 (output_conflicts): Change conflp => conflict_list_heads, and
14781 confl => conflict_list for better readability.
14782 * data/glr.c: Use the new names.
14783 * NEWS: Add self to GLR announcement.
14784
14785 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14786
14787 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14788 Akim Demaille.
14789
14790 * data/bison.glr: Change name to glr.c
14791 * data/glr.c: Renamed from bison.glr.
14792 * data/Makefile.am: Add glr.c
14793
14794 * src/getargs.c:
14795
14796 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
14797 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
14798
14799 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14800
14801 * data/bison.glr: Be sure to restore the
14802 current #line when returning to the skeleton contents after having
14803 exposed the input file's #line.
14804
14805 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14806
14807 * data/bison.glr: Bring up to date with changes to bison.simple.
14808
14809 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14810
14811 * data/bison.glr: Correct definitions that use b4_prefix.
14812 Various reformatting.
14813 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14814 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14815 yytokenp argument; now part of stack.
14816 (yychar): Define to behave as documented.
14817 (yyclearin): Ditto.
14818
14819 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14820
14821 * src/reader.h: Add declaration for free_merger_functions.
14822
14823 * src/reader.c (merge_functions): New variable.
14824 (get_merge_function): New function.
14825 (free_merger_functions): New function.
14826 (readgram): Check for %prec that is not followed by a symbol.
14827 Handle %dprec and %merge declarations.
14828 (packgram): Initialize dprec and merger fields in rules array.
14829
14830 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14831 conflict_list_cnt, conflict_list_free): New variables.
14832 (table_grow): Also grow conflict_table.
14833 (prepare_rules): Output dprec and merger tables.
14834 (conflict_row): New function.
14835 (action_row): Output conflict lists for GLR parser. Don't use
14836 default reduction in conflicted states for GLR parser so that there
14837 are spaces for the conflict lists.
14838 (save_row): Also save conflict information.
14839 (token_actions): Allocate conflict list.
14840 (merger_output): New function.
14841 (pack_vector): Pack conflict table, too.
14842 (output_conflicts): New function to output yyconflp and yyconfl.
14843 (output_check): Allocate conflict_tos.
14844 (output_actions): Output conflict tables, also.
14845 (output_skeleton): Output b4_mergers definition.
14846 (prepare): Output b4_max_rhs_length definition.
14847 Use 'bison.glr' as default skeleton for GLR parsers.
14848
14849 * src/gram.c (glr_parser): New flag.
14850 (grammar_free): Call free_merger_functions.
14851
14852 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14853 all pairs of conflicting reductions, rather than just all tokens
14854 causing conflicts. Needed to size conflict tables.
14855 (conflicts_output): Modify call to count_rr_conflicts for new
14856 interface.
14857 (conflicts_print): Ditto.
14858 (count_total_conflicts): New function.
14859
14860 * src/reader.h (merger_list): New type.
14861 (merge_functions): New variable.
14862
14863 * src/lex.h (tok_dprec, tok_merge): New token types.
14864
14865 * src/gram.h (rule_s): Add dprec and merger fields.
14866 (glr_parser): New flag.
14867
14868 * src/conflicts.h (count_total_conflicts): New function.
14869
14870 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14871
14872 * doc/bison.texinfo (Generalized LR Parsing): New section.
14873 (GLR Parsers): New section.
14874 (Language and Grammar): Mention GLR parsing.
14875 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14876 Correct typo ("tge" -> "the").
14877
14878 * data/bison.glr: New skeleton for GLR parsing.
14879
14880 * tests/cxx-gram.at: New tests for GLR parsing.
14881
14882 * tests/testsuite.at: Include cxx-gram.at.
14883
14884 * tests/Makefile.am: Add cxx-gram.at.
14885
14886 * src/parse-gram.y:
14887
14888 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14889
14890 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
14891
14892 2002-06-27 Akim Demaille <akim@epita.fr>
14893
14894 * src/options.h, src/options.c: Remove.
14895 * src/getargs.c (short_options, long_options): New.
14896
14897 2002-06-27 Akim Demaille <akim@epita.fr>
14898
14899 * data/bison.simple, data/bison.c++: Rename as...
14900 * data/yacc.c, data/lalr1.cc: these.
14901 * doc/bison.texinfo (Environment Variables): Remove.
14902
14903 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
14904
14905 * src/getargs.c (report_argmatch): Initialize strtok().
14906
14907 2002-06-20 Akim Demaille <akim@epita.fr>
14908
14909 * data/bison.simple (b4_symbol_actions): New, replaces...
14910 (b4_symbol_destructor, b4_symbol_printer): these.
14911 (yysymprint): Be sure to call YYPRINT only for tokens, and using
14912 user token numbers.
14913
14914 2002-06-20 Akim Demaille <akim@epita.fr>
14915
14916 * data/bison.simple (yydestructor): Rename as...
14917 (yydestruct): this.
14918
14919 2002-06-20 Akim Demaille <akim@epita.fr>
14920
14921 * src/symtab.h, src/symtab.c (symbol_type_set)
14922 (symbol_destructor_set, symbol_precedence_set): The location is
14923 the last argument.
14924 Adjust all callers.
14925
14926 2002-06-20 Akim Demaille <akim@epita.fr>
14927
14928 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
14929 internals.
14930 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
14931 Takes a location.
14932 * src/symtab.h, src/symtab.c (symbol_class_set)
14933 (symbol_user_token_number_set): Likewise.
14934 Adjust all callers.
14935 Promote complain_at.
14936 * tests/input.at (Type Clashes): Adjust.
14937
14938 2002-06-20 Akim Demaille <akim@epita.fr>
14939
14940 * data/bison.simple (YYLEX): Fix the declaration when
14941 %pure-parser.
14942
14943 2002-06-20 Akim Demaille <akim@epita.fr>
14944
14945 * data/bison.simple (yysymprint): Don't print the token number,
14946 just its name.
14947 * tests/actions.at (Destructors): Rename as...
14948 (Printers and Destructors): this.
14949 Also exercise %printer.
14950
14951 2002-06-20 Akim Demaille <akim@epita.fr>
14952
14953 * data/bison.simple (YYDSYMPRINT): New.
14954 Use it to remove many of the #if YYDEBUG/if (yydebug).
14955
14956 2002-06-20 Akim Demaille <akim@epita.fr>
14957
14958 * src/symtab.h, src/symtab.c (symbol_t): printer and
14959 printer_location are new members.
14960 (symbol_printer_set): New.
14961 * src/parse-gram.y (PERCENT_PRINTER): New token.
14962 Handle its associated rule.
14963 * src/scan-gram.l: Adjust.
14964 (handle_destructor_at, handle_destructor_dollar): Rename as...
14965 (handle_symbol_code_at, handle_symbol_code_dollar): these.
14966 * src/output.c (symbol_printers_output): New.
14967 (output_skeleton): Call it.
14968 * data/bison.simple (yysymprint): New. Cannot be named yyprint
14969 since there are already many grammar files with a user `yyprint'.
14970 Replace the calls to YYPRINT to calls to yysymprint.
14971 * tests/calc.at: Adjust.
14972 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
14973 taking advantage of parser very internal details (stack size!).
14974
14975 2002-06-20 Akim Demaille <akim@epita.fr>
14976
14977 * src/scan-gram.l: Complete the scanner with the missing patterns
14978 to pacify Flex.
14979 Use `quote' and `symbol_tag_get' where appropriate.
14980
14981 2002-06-19 Akim Demaille <akim@epita.fr>
14982
14983 * tests/actions.at (Destructors): Augment to test locations.
14984 * data/bison.simple (yydestructor): Pass it the current location
14985 if locations are enabled.
14986 Prototype only when __STDC__ or C++.
14987 Change the argument names to move into the yy name space: there is
14988 user code here.
14989
14990 2002-06-19 Akim Demaille <akim@epita.fr>
14991
14992 * data/bison.simple (b4_pure_if): New.
14993 Use it instead of #ifdef YYPURE.
14994
14995 2002-06-19 Akim Demaille <akim@epita.fr>
14996
14997 * data/bison.simple (b4_location_if): New.
14998 Use it instead of #ifdef YYLSP_NEEDED.
14999
15000 2002-06-19 Akim Demaille <akim@epita.fr>
15001
15002 Prepare @$ in %destructor, but currently don't bind it in the
15003 skeleton, as %location use is not cleaned up yet.
15004
15005 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15006 (handle_action_at): New.
15007 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15008 a braced_code_t and a location as additional arguments.
15009 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15010 unquote one when outputting `b4_dollar_dollar'.
15011 Adjust callers.
15012 * data/bison.simple (b4_eval): Remove.
15013 (b4_symbol_destructor): Adjust.
15014 * tests/input.at (Invalid @n): Adjust.
15015
15016 2002-06-19 Zack Weinberg <zack@codesourcery.com>
15017
15018 * doc/bison.texinfo: Document ability to have multiple
15019 prologue sections.
15020
15021 2002-06-18 Akim Demaille <akim@epita.fr>
15022
15023 * src/files.c (compute_base_names): When computing the output file
15024 names from the input file name, strip the directory part.
15025
15026 2002-06-18 Akim Demaille <akim@epita.fr>
15027
15028 * data/bison.simple.new: Comment changes.
15029 Reported by Andreas Schwab.
15030
15031 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15032
15033 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15034 there are no `label `yyoverflowlab' defined but not used' warnings
15035 when yyoverflow is defined.
15036
15037 2002-06-18 Akim Demaille <akim@epita.fr>
15038
15039 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15040 new member.
15041 (symbol_destructor_set): Adjust.
15042 * src/output.c (symbol_destructors_output): Output the destructor
15043 locations.
15044 Output the symbol name.
15045 * data/bison.simple (b4_symbol_destructor): Adjust.
15046
15047 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15048 and Akim Demaille <akim@epita.fr>
15049
15050 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15051 what's left on the stack when the error recovery hits EOF.
15052 * tests/actions.at (Destructors): Complete to exercise this case.
15053
15054 2002-06-17 Akim Demaille <akim@epita.fr>
15055
15056 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15057 arguments is really empty, not only equal to `[]'.
15058 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15059 member.
15060 (symbol_destructor_set): New.
15061 * src/output.c (symbol_destructors_output): New.
15062 * src/reader.h (brace_code_t, current_braced_code): New.
15063 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15064 (handle_dollar): Rename as...
15065 (handle_action_dollar): this.
15066 (handle_destructor_dollar): New.
15067 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15068 (grammar_declaration): Use it.
15069 * data/bison.simple (yystos): Is always defined.
15070 (yydestructor): New.
15071 * tests/actions.at (Destructors): New.
15072 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15073
15074 2002-06-17 Akim Demaille <akim@epita.fr>
15075
15076 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15077 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15078 rule_length only when needed.
15079 * src/output.c (actions_output, token_definitions_output): Output
15080 the full M4 block.
15081 * src/symtab.c: Don't access directly to the symbol tag, use
15082 symbol_tag_get.
15083 * src/parse-gram.y: Use symbol_list_free.
15084
15085 2002-06-17 Akim Demaille <akim@epita.fr>
15086
15087 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15088 (symbol_list_prepend, get_type_name): Move to...
15089 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15090 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15091 Adjust all callers.
15092 (symbol_list_free): New.
15093 * src/scan-gram.l (handle_dollar): Takes a location.
15094 * tests/input.at (Invalid $n): Adjust.
15095
15096 2002-06-17 Akim Demaille <akim@epita.fr>
15097
15098 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15099 (symbol_list_prepend): New.
15100 * src/parse-gram.y (%union): `list' is a new member.
15101 (symbols.1): New, replaces...
15102 (terms_to_prec.1, nterms_to_type.1): these.
15103 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15104 Take a location as additional argument.
15105 Adjust all callers.
15106
15107 2002-06-15 Akim Demaille <akim@epita.fr>
15108
15109 * src/parse-gram.y: Move %token in the declaration section so that
15110 we don't depend upon CVS Bison.
15111
15112 2002-06-15 Akim Demaille <akim@epita.fr>
15113
15114 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15115 * src/print.c (print_core): Use it.
15116
15117 2002-06-15 Akim Demaille <akim@epita.fr>
15118
15119 * src/conflicts.c (log_resolution): Accept the rule involved in
15120 the sr conflicts instead of the lookahead number that points to
15121 that rule.
15122 (flush_reduce): Accept the current lookahead vector as argument,
15123 instead of the index in LA.
15124 (resolve_sr_conflict): Accept the current number of lookahead
15125 bitset to consider for the STATE, instead of the index in LA.
15126 (set_conflicts): Adjust.
15127 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15128
15129 2002-06-15 Akim Demaille <akim@epita.fr>
15130
15131 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15132 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15133 Adjust all dependencies.
15134 * src/lalr.c (initialize_lookaheads): Split into...
15135 (states_lookaheads_count, states_lookaheads_initialize): these.
15136 (lalr): Adjust.
15137
15138 2002-06-15 Akim Demaille <akim@epita.fr>
15139
15140 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15141 out of...
15142 (grammar_rules_print): here.
15143 * src/reduce.c (reduce_output): Use it.
15144 * tests/reduce.at (Useless Rules, Reduced Automaton)
15145 (Underivable Rules): Adjust.
15146
15147 2002-06-15 Akim Demaille <akim@epita.fr>
15148
15149 Copy BYacc's nice way to report the grammar.
15150
15151 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15152 New.
15153 Don't print the rules' location, it is confusing and useless.
15154 (rule_print): Use grammar_rhs_print.
15155 * src/print.c (print_grammar): Use grammar_rules_print.
15156
15157 2002-06-15 Akim Demaille <akim@epita.fr>
15158
15159 Complete and rationalize `useless thing' warnings.
15160
15161 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15162 (symbol_tag_print): New.
15163 Use them everywhere in place of accessing directly the tag member.
15164 * src/gram.h, src/gram.c (rule_print): New.
15165 Use it where a rule used to be printed `by hand'.
15166 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15167 (reduce_grammar_tables): Report the useless rules.
15168 (reduce_print): Useless things are a warning, not an error.
15169 Report it as such.
15170 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15171 (Reduced Automaton, Underivable Rules): Adjust.
15172 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15173 * tests/conflicts.at (Unresolved SR Conflicts)
15174 (Solved SR Conflicts): Adjust.
15175
15176 2002-06-15 Akim Demaille <akim@epita.fr>
15177
15178 Let symbols have a location.
15179
15180 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15181 (getsym): Adjust.
15182 Adjust all callers.
15183 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15184 Use location_t, not int.
15185 * src/symtab.c (symbol_check_defined): Take advantage of the
15186 location.
15187 * tests/regression.at (Invalid inputs): Adjust.
15188
15189 2002-06-15 Akim Demaille <akim@epita.fr>
15190
15191 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15192 (input): Don't try to initialize yylloc here, do it in the
15193 scanner.
15194 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15195 * src/gram.h (rule_t): Change line and action_line into location
15196 and action_location, of location_t type.
15197 Adjust all dependencies.
15198 * src/location.h, src/location.c (empty_location): New.
15199 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15200 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15201 (grammar_current_rule_symbol_append)
15202 (grammar_current_rule_action_append): Expect a location as argument.
15203 * src/reader.c (grammar_midrule_action): Adjust to attach an
15204 action's location as dummy symbol location.
15205 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15206 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15207 the line numbers.
15208
15209 2002-06-14 Akim Demaille <akim@epita.fr>
15210
15211 Grammar declarations may be found in the grammar section.
15212
15213 * src/parse-gram.y (rules_or_grammar_declaration): New.
15214 (declarations): Each declaration may end with a semicolon, not
15215 just...
15216 (grammar_declaration): `"%union"'.
15217 (grammar): Branch to rules_or_grammar_declaration.
15218
15219 2002-06-14 Akim Demaille <akim@epita.fr>
15220
15221 * src/main.c (main): Invoke scanner_free.
15222
15223 2002-06-14 Akim Demaille <akim@epita.fr>
15224
15225 * src/output.c (m4_invoke): Extracted from...
15226 (output_skeleton): here.
15227 Free tempfile.
15228
15229 2002-06-14 Akim Demaille <akim@epita.fr>
15230
15231 * src/parse-gram.y (directives, directive, gram)
15232 (grammar_directives, precedence_directives, precedence_directive):
15233 Rename as...
15234 (declarations, declaration, grammar, grammar_declaration)
15235 (precedence_declaration, precedence_declarator): these.
15236 (symbol_declaration): New.
15237
15238 2002-06-14 Akim Demaille <akim@epita.fr>
15239
15240 * src/files.c (action_obstack): Remove, unused.
15241 (output_obstack): Remove it, and all its dependencies, as it is no
15242 longer needed.
15243 * src/reader.c (epilogue_set): Build the epilogue in the
15244 muscle_obstack.
15245 * src/output.h, src/output.c (muscle_obstack): Move to...
15246 * src/muscle_tab.h, src/muscle_tab.h: here.
15247 (muscle_init): Initialize muscle_obstack.
15248 (muscle_free): New.
15249 * src/main.c (main): Call it.
15250
15251 2002-06-14 Akim Demaille <akim@epita.fr>
15252
15253 * src/location.h: New, extracted from...
15254 * src/reader.h: here.
15255 * src/Makefile.am (noinst_HEADERS): Merge into
15256 (bison_SOURCES): this.
15257 Add location.h.
15258 * src/parse-gram.y: Use location_t instead of Bison's.
15259 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15260 Use location_t instead of ints.
15261
15262 2002-06-14 Akim Demaille <akim@epita.fr>
15263
15264 * data/bison.simple, data/bison.c++: Be sure to restore the
15265 current #line when returning to the skeleton contents after having
15266 exposed the input file's #line.
15267
15268 2002-06-12 Akim Demaille <akim@epita.fr>
15269
15270 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15271 eager.
15272 * tests/actions.at (Exotic Dollars): New.
15273
15274 2002-06-12 Akim Demaille <akim@epita.fr>
15275
15276 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15277 ['"/] too eagerly.
15278 * tests/input.at (Torturing the Scanner): New.
15279
15280 2002-06-11 Akim Demaille <akim@epita.fr>
15281
15282 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15283 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15284 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15285 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15286 * src/reader.c (reader): Use it.
15287
15288 2002-06-11 Akim Demaille <akim@epita.fr>
15289
15290 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15291 Adjust all callers.
15292 (scanner_last_string_free): New.
15293
15294 2002-06-11 Akim Demaille <akim@epita.fr>
15295
15296 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15297 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15298 (last_string, YY_OBS_FREE): New.
15299 Use them when returning an ID.
15300
15301 2002-06-11 Akim Demaille <akim@epita.fr>
15302
15303 Have Bison grammars parsed by a Bison grammar.
15304
15305 * src/reader.c, src/reader.h (prologue_augment): New.
15306 * src/reader.c (copy_definition): Remove.
15307
15308 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15309 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15310 (grammar_current_rule_prec_set, grammar_current_rule_check)
15311 (grammar_current_rule_symbol_append)
15312 (grammar_current_rule_action_append): Export.
15313 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15314 (symbol_list_action_append): Remove.
15315 Hook the routines from reader.
15316 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15317 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15318
15319 * src/reader.c (read_declarations): Remove, unused.
15320
15321 * src/parse-gram.y: Handle the epilogue.
15322 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15323 (grammar_start_symbol_set): this.
15324 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15325 * src/reader.c (readgram): Remove, unused.
15326 (reader): Adjust to insert eoftoken and axiom where appropriate.
15327
15328 * src/reader.c (copy_dollar): Replace with...
15329 * src/scan-gram.h (handle_dollar): this.
15330 * src/parse-gram.y: Remove `%thong'.
15331
15332 * src/reader.c (copy_at): Replace with...
15333 * src/scan-gram.h (handle_at): this.
15334
15335 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15336 New.
15337
15338 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15339 time being.
15340
15341 * src/reader.h, src/reader.c (grammar_rule_end): New.
15342
15343 * src/parse.y (current_type, current_class): New.
15344 Implement `%nterm', `%token' support.
15345 Merge `%term' into `%token'.
15346 (string_as_id): New.
15347 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15348 type name.
15349
15350 * src/parse-gram.y: Be sure to handle properly the beginning of
15351 rules.
15352
15353 * src/parse-gram.y: Handle %type.
15354 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15355
15356 * src/parse-gram.y: More directives support.
15357 * src/options.c: No longer handle source directives.
15358
15359 * src/parse-gram.y: Fix %output.
15360
15361 * src/parse-gram.y: Handle %union.
15362 Use the prologue locations.
15363 * src/reader.c (parse_union_decl): Remove.
15364
15365 * src/reader.h, src/reader.c (epilogue_set): New.
15366 * src/parse-gram.y: Use it.
15367
15368 * data/bison.simple, data/bison.c++: b4_stype is now either not
15369 defined, then default to int, or to the contents of %union,
15370 without `union' itself.
15371 Adjust.
15372 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15373
15374 * src/output.c (actions_output): Don't output braces, as they are
15375 already handled by the scanner.
15376
15377 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15378 characters to themselves.
15379
15380 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15381 that the epilogue has a proper #line.
15382
15383 * src/parse-gram.y: Handle precedence/associativity.
15384
15385 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15386 a terminal.
15387 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15388 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15389 at all to define terminals that cannot be emitted.
15390
15391 * src/scan-gram.l: Escape M4 characters.
15392
15393 * src/scan-gram.l: Working properly with escapes in user
15394 strings/characters.
15395
15396 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15397 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15398 grammar.
15399 Use more modest sizes, as for the time being the parser does not
15400 release memory, and therefore the process swallows a huge amount
15401 of memory.
15402
15403 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15404 stricter %token grammar.
15405
15406 * src/symtab.h (associativity): Add `undef_assoc'.
15407 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15408 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15409
15410 * tests/regression.at (Invalid %directive): Remove, as it is now
15411 meaningless.
15412 (Invalid inputs): Adjust to the new error messages.
15413 (Token definitions): The new grammar doesn't allow too many
15414 eccentricities.
15415
15416 * src/lex.h, src/lex.c: Remove.
15417 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15418 (copy_character, copy_string2, copy_string, copy_identifier)
15419 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15420 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15421 (parse_action): Remove.
15422 * po/POTFILES.in: Adjust.
15423
15424 2002-06-11 Akim Demaille <akim@epita.fr>
15425
15426 * src/reader.c (parse_action): Don't store directly into the
15427 rule's action member: return the action as a string.
15428 Don't require `rule_length' as an argument: compute it.
15429 (grammar_current_rule_symbol_append)
15430 (grammar_current_rule_action_append): New, eved out from
15431 (readgram): here.
15432 Remove `action_flag', `rulelength', unused now.
15433
15434 2002-06-11 Akim Demaille <akim@epita.fr>
15435
15436 * src/reader.c (grammar_current_rule_prec_set).
15437 (grammar_current_rule_check): New, eved out from...
15438 (readgram): here.
15439 Remove `xaction', `first_rhs': useless.
15440 * tests/input.at (Type clashes): New.
15441 * tests/existing.at (GNU Cim Grammar): Adjust.
15442
15443 2002-06-11 Akim Demaille <akim@epita.fr>
15444
15445 * src/reader.c (grammar_midrule_action): New, Eved out from
15446 (readgram): here.
15447
15448 2002-06-11 Akim Demaille <akim@epita.fr>
15449
15450 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15451 New.
15452 (readgram): Use them as replacement of inlined code, crule and
15453 crule1.
15454
15455 2002-06-11 Akim Demaille <akim@epita.fr>
15456
15457 * src/reader.c (grammar_end, grammar_symbol_append): New.
15458 (readgram): Use them.
15459 Make the use of `p' as local as possible.
15460
15461 2002-06-10 Akim Demaille <akim@epita.fr>
15462
15463 GCJ's parser requires the tokens to be defined before the prologue.
15464
15465 * data/bison.simple: Output the token definition before the user's
15466 prologue.
15467 * tests/regression.at (Braces parsing, Duplicate string)
15468 (Mixing %token styles): Check the output from bison.
15469 (Early token definitions): New.
15470
15471 2002-06-10 Akim Demaille <akim@epita.fr>
15472
15473 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15474 assigning twice the same user number to a token, so that we can
15475 use it in...
15476 * src/lex.c (lex): here.
15477 Also use `symbol_class_set' instead of hand written code.
15478 * src/reader.c (parse_assoc_decl): Likewise.
15479
15480 2002-06-10 Akim Demaille <akim@epita.fr>
15481
15482 * src/symtab.c, src/symtab.c (symbol_class_set)
15483 (symbol_user_token_number_set): New.
15484 * src/reader.c (parse_token_decl): Use them.
15485 Use a switch instead of ifs.
15486 Use a single argument.
15487
15488 2002-06-10 Akim Demaille <akim@epita.fr>
15489
15490 Remove `%thong' support as it is undocumented, unused, duplicates
15491 `%token's job, and creates useless e-mail traffic with people who
15492 want to know what it is, why it is undocumented, unused, and
15493 duplicates `%token's job.
15494
15495 * src/reader.c (parse_thong_decl): Remove.
15496 * src/options.c (option_table): Remove "thong".
15497 * src/lex.h (tok_thong): Remove.
15498
15499 2002-06-10 Akim Demaille <akim@epita.fr>
15500
15501 * src/symtab.c, src/symtab.c (symbol_type_set)
15502 (symbol_precedence_set): New.
15503 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15504 (value_components_used): Remove, unused.
15505
15506 2002-06-09 Akim Demaille <akim@epita.fr>
15507
15508 Move symbols handling code out of the reader.
15509
15510 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15511 (axiom): Move to...
15512 * src/symtab.h, src/symtab.c: here.
15513
15514 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15515 * src/reader.c (startval): Rename as...
15516 * src/symtab.h, src/symtab.c (startsymbol): this.
15517 * src/reader.c: Adjust.
15518
15519 * src/reader.c (symbol_check_defined, symbol_make_alias)
15520 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15521 (token_translations_init)
15522 Move to...
15523 * src/symtab.c: here.
15524 * src/reader.c (packsymbols): Move to...
15525 * src/symtab.h, src/symtab.c (symbols_pack): here.
15526 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15527 argument.
15528
15529 2002-06-03 Akim Demaille <akim@epita.fr>
15530
15531 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15532 then statements.
15533
15534 2002-06-03 Akim Demaille <akim@epita.fr>
15535
15536 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15537 structs with non literals.
15538 * src/scan-skel.l: never-interactive.
15539 * src/conflicts.c (enum conflict_resolution_e): No trailing
15540 comma.
15541 * src/getargs.c (usage): Split long literal strings.
15542 Reported by Hans Aberg.
15543
15544 2002-05-28 Akim Demaille <akim@epita.fr>
15545
15546 * data/bison.c++: Use C++ ostreams.
15547 (cdebug_): New member.
15548
15549 2002-05-28 Akim Demaille <akim@epita.fr>
15550
15551 * src/output.c (output_skeleton): Be sure to allocate enough room
15552 for `/' _and_ for `\0' in full_skeleton.
15553
15554 2002-05-28 Akim Demaille <akim@epita.fr>
15555
15556 * data/bison.c++: Catch up with bison.simple:
15557 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15558 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15559 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15560 and popping traces.
15561
15562 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15563
15564 * src/output.c (output_skeleton): Put an explicit path in front of
15565 the skeleton file name, rather than relying on the -I directory,
15566 to partially alleviate effects of having a skeleton file lying around
15567 in the current directory.
15568
15569 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15570
15571 * src/conflicts.c (log_resolution): Correct typo:
15572 obstack_printf should be obstack_fgrow1.
15573
15574 2002-05-26 Akim Demaille <akim@epita.fr>
15575
15576 * src/state.h (state_t): `solved_conflicts' is a new member.
15577 * src/LR0.c (new_state): Set it to 0.
15578 * src/conflicts.h, src/conflicts.c (print_conflicts)
15579 (free_conflicts, solve_conflicts): Rename as...
15580 (conflicts_print, conflicts_free, conflicts_solve): these.
15581 Adjust callers.
15582 * src/conflicts.c (enum conflict_resolution_e)
15583 (solved_conflicts_obstack): New, used by...
15584 (log_resolution): this.
15585 Adjust to attach the conflict resolution to each state.
15586 Complete the description with the precedence/associativity
15587 information.
15588 (resolve_sr_conflict): Adjust.
15589 * src/print.c (print_state): Output its solved_conflicts.
15590 * tests/conflicts.at (Unresolved SR Conflicts)
15591 (Solved SR Conflicts): Exercise --report=all.
15592
15593 2002-05-26 Akim Demaille <akim@epita.fr>
15594
15595 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15596 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15597 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15598 (token_number_t, item_number_as_token_number)
15599 (token_number_as_item_number, muscle_insert_token_number_table):
15600 Rename as...
15601 (symbol_number_t, item_number_as_symbol_number)
15602 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15603 these, since it is more appropriate.
15604
15605 2002-05-26 Akim Demaille <akim@epita.fr>
15606
15607 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15608 `Error:' lines.
15609 * data/bison.simple (yystos) [YYDEBUG]: New.
15610 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15611 error recovery.
15612 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15613
15614 2002-05-25 Akim Demaille <akim@epita.fr>
15615
15616 * doc/bison.texinfo (Debugging): Split into...
15617 (Tracing): this new section, its former contents, and...
15618 (Understanding): this new section.
15619 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15620 by...
15621 (report_flag): this.
15622 Adjust all dependencies.
15623 (report_args, report_types, report_argmatch): New.
15624 (usage, getargs): Report/support -r, --report.
15625 * src/options.h
15626 (struct option_table_struct): Rename as..,
15627 (struct option_table_s): this.
15628 Rename the `set_flag' member to `flag' to match with getopt_long's
15629 struct.
15630 * src/options.c (option_table): Split verbose into an entry for
15631 %verbose, and another for --verbose.
15632 Support --report/-r, so remove -r from the obsolete --raw.
15633 * src/print.c: Attach full item sets and lookaheads reports to
15634 report_flag instead of trace_flag.
15635 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15636
15637 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15638 and Paul Eggert <eggert@twinsun.com>
15639
15640 * data/bison.simple (yyparse): Correct error handling to conform to
15641 POSIX and yacc. Specifically, after syntax error is discovered,
15642 do not reduce further before shifting the error token.
15643 Clean up the code a bit by removing the labels yyerrdefault,
15644 yyerrhandle, yyerrpop.
15645 * NEWS: Document the above.
15646
15647 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15648
15649 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15650 type; it isn't always big enough, since it doesn't necessarily
15651 include non-terminals.
15652 (yytranslate): Expand definition of yy_token_number_type, so that
15653 the latter can be removed.
15654 (yy_token_number_type): Remove, only one use.
15655 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15656 don't use TokenNumberType as element type.
15657
15658 * tests/regression.at: Modify expected output to agree with change
15659 to yyr1 and yytranslate.
15660
15661 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15662
15663 * src/reader.c (parse_action): Use copy_character instead of
15664 obstack_1grow.
15665
15666 2002-05-13 Akim Demaille <akim@epita.fr>
15667
15668 * tests/regression.at (Token definitions): Prototype yylex and
15669 yyerror.
15670
15671 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15672
15673 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
15674 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15675 32-bit arithmetic.
15676 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15677
15678 2002-05-07 Akim Demaille <akim@epita.fr>
15679
15680 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15681 avoid GCC warnings.
15682
15683 2002-05-07 Akim Demaille <akim@epita.fr>
15684
15685 Kill GCC warnings.
15686
15687 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15688 over the RHS of each rule.
15689 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15690 * src/state.h (state_t): Member `nitems' is unsigned short.
15691 * src/LR0.c (get_state): Adjust.
15692 * src/reader.c (packgram): Likewise.
15693 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15694 `Type'.
15695 (muscle_insert_int_table): Remove, unused.
15696 (prepare_rules): Remove `max'.
15697
15698 2002-05-06 Akim Demaille <akim@epita.fr>
15699
15700 * src/closure.c (print_firsts): Display of the symbol tags.
15701 (bitmatrix_print): Move to...
15702 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15703 here.
15704 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15705
15706 2002-05-06 Akim Demaille <akim@epita.fr>
15707
15708 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15709 hash_do_for_each.
15710
15711 2002-05-06 Akim Demaille <akim@epita.fr>
15712
15713 * src/LR0.c (new_state, get_state): Instead of using the global
15714 `kernel_size' and `kernel_base', have two new arguments:
15715 `core_size' and `core'.
15716 Adjust callers.
15717
15718 2002-05-06 Akim Demaille <akim@epita.fr>
15719
15720 * src/reader.c (packgram): No longer end `ritem' with a 0
15721 sentinel: it is not used.
15722
15723 2002-05-05 Akim Demaille <akim@epita.fr>
15724
15725 New experimental feature: display the lookaheads in the report and
15726 graph.
15727
15728 * src/print (print_core): When --trace-flag, display the rules
15729 lookaheads.
15730 * src/print_graph.c (print_core): Likewise.
15731 Swap the arguments.
15732 Adjust caller.
15733
15734 2002-05-05 Akim Demaille <akim@epita.fr>
15735
15736 * tests/torture.at (Many lookaheads): New test.
15737
15738 2002-05-05 Akim Demaille <akim@epita.fr>
15739
15740 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15741 (GENERATE_MUSCLE_INSERT_TABLE): this.
15742 (output_int_table, output_unsigned_int_table, output_short_table)
15743 (output_token_number_table, output_item_number_table): Replace with...
15744 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15745 (muscle_insert_short_table, muscle_insert_token_number_table)
15746 (muscle_insert_item_number_table): these.
15747 Adjust all callers.
15748 (prepare_tokens): Don't free `translations', since...
15749 * src/reader.h, src/reader.c (grammar_free): do it.
15750 Move to...
15751 * src/gram.h, src/gram.c (grammar_free): here.
15752 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15753 b4_translate_max.
15754
15755 2002-05-05 Akim Demaille <akim@epita.fr>
15756
15757 * src/output.c (output_unsigned_int_table): New.
15758 (prepare_rules): `i' is unsigned.
15759 `prhs', `rline', `r2' are unsigned int.
15760 Rename muscle `rhs_number_max' as `rhs_max'.
15761 Output muscles `prhs_max', `rline_max', and `r2_max'.
15762 Free rline and r1.
15763 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15764 to compute types instead of constant types.
15765 * tests/regression.at (Web2c Actions): Adjust.
15766
15767 2002-05-04 Akim Demaille <akim@epita.fr>
15768
15769 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15770 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15771 Adjust dependencies.
15772 * src/output.c (token_definitions_output): Be sure not to output a
15773 `#define 'a'' when fed with `%token 'a' "a"'.
15774 * tests/regression.at (Token definitions): New.
15775
15776 2002-05-03 Paul Eggert <eggert@twinsun.com>
15777
15778 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15779 for K&R C.
15780
15781 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15782
15783 * Makefile.am (SUBDIRS): Remove intl.
15784 (EXTRA_DIST): Add config/config.rpath.
15785
15786 2002-05-03 Akim Demaille <akim@epita.fr>
15787
15788 * data/bison.simple (m4_if): Don't output empty enums.
15789 And actually, output valid enum definitions :(.
15790
15791 2002-05-03 Akim Demaille <akim@epita.fr>
15792
15793 * configure.bat: Remove, completely obsolete.
15794 * Makefile.am (EXTRA_DIST): Adjust.
15795 Don't distribute config.rpath...
15796 * config/Makefile.am (EXTRA_DIST): Do it.
15797
15798 2002-05-03 Akim Demaille <akim@epita.fr>
15799
15800 * configure.in (GETTEXT_VERSION): New.
15801 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15802
15803 2002-05-03 Akim Demaille <akim@epita.fr>
15804
15805 * data/bison.simple (b4_token_enum): New.
15806 (b4_token_defines): Use it to output tokens both as #define and
15807 enums.
15808 Suggested by Paul Eggert.
15809 * src/output.c (token_definitions_output): Don't output spurious
15810 white spaces.
15811
15812 2002-05-03 Akim Demaille <akim@epita.fr>
15813
15814 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15815
15816 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
15817
15818 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15819 Update the stack class, give a try to deque as the default container.
15820
15821 2002-05-02 Akim Demaille <akim@epita.fr>
15822
15823 * data/bison.simple (yyparse): Do not implement @$ = @1.
15824 (YYLLOC_DEFAULT): Adjust to do it.
15825 * doc/bison.texinfo (Location Default Action): Fix.
15826
15827 2002-05-02 Akim Demaille <akim@epita.fr>
15828
15829 * src/reader.c (parse_braces): Merge into...
15830 (parse_action): this.
15831
15832 2002-05-02 Akim Demaille <akim@epita.fr>
15833
15834 * configure.in (ALL_LINGUAS): Remove.
15835 * po/LINGUAS, hr.po: New.
15836
15837 2002-05-02 Akim Demaille <akim@epita.fr>
15838
15839 Remove the so called hairy (semantic) parsers.
15840
15841 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15842 * src/gram.h, src/gram.c (semantic_parser): Remove.
15843 (rule_t): Remove the guard and guard_line members.
15844 * src/lex.h (token_t): remove tok_guard.
15845 * src/options.c (option_table): Remove %guard and %semantic_parser
15846 support.
15847 * src/output.c, src/output.h (guards_output): Remove.
15848 (prepare): Adjust.
15849 (token_definitions_output): Don't output the `T'
15850 tokens (???).
15851 (output_skeleton): Don't output the guards.
15852 * src/files.c, src/files.c (attrsfile): Remove.
15853 * src/reader.c (symbol_list): Remove the guard and guard_line
15854 members.
15855 Adjust dependencies.
15856 (parse_guard): Remove.
15857 * data/bison.hairy: Remove.
15858 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15859 BISON_HAIRY.
15860
15861 2002-05-02 Akim Demaille <akim@epita.fr>
15862
15863 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15864 (parse_guard): Rename the formal argument `stack_offset' as
15865 `rule_length', which is more readable.
15866 Adjust callers.
15867 (copy_at, copy_dollar): Instead of outputting the hard coded
15868 values of $$, $n and so forth, output invocation to b4_lhs_value,
15869 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
15870 Note: this patch partially drops `semantic-parser' support: it
15871 always does `rule_length - n', where semantic parsers ought to
15872 always use `-n'.
15873 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15874 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15875
15876 2002-05-02 Akim Demaille <akim@epita.fr>
15877
15878 * configure.in (AC_INIT): Bump to 1.49b.
15879 (AM_INIT_AUTOMAKE): Short invocation.
15880
15881 2002-05-02 Akim Demaille <akim@epita.fr>
15882
15883 Version 1.49a.
15884
15885 2002-05-01 Akim Demaille <akim@epita.fr>
15886
15887 * src/skeleton.h: Remove.
15888
15889 2002-05-01 Akim Demaille <akim@epita.fr>
15890
15891 * src/skeleton.h: Fix the #endif.
15892 Reported by Magnus Fromreide.
15893
15894 2002-04-26 Paul Eggert <eggert@twinsun.com>
15895
15896 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15897 Define if we define YYSTYPE and YYLTYPE, respectively.
15898 (YYCOPY): Fix [] quoting problem in the non-GCC case.
15899
15900 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
15901
15902 * src/scan-skel.l: Postprocess quadrigraphs.
15903
15904 * src/reader.c (copy_character): New function, used to output
15905 single characters while replacing `[' and `]' with quadrigraphs, to
15906 avoid troubles with M4 quotes.
15907 (copy_comment): Output characters with copy_character.
15908 (read_additionnal_code): Likewise.
15909 (copy_string2): Likewise.
15910 (copy_definition): Likewise.
15911
15912 * tests/calc.at: Exercise M4 quoting.
15913
15914 2002-04-25 Akim Demaille <akim@epita.fr>
15915
15916 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
15917 between `!' and the command.
15918 Reported by Paul Eggert.
15919
15920 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
15921
15922 * tests/calc.at: Exercise prologue splitting.
15923
15924 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
15925 `b4_post_prologue' instead of `b4_prologue'.
15926
15927 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
15928 muscles.
15929 (output): Free pre_prologue_obstack and post_prologue_obstack.
15930 * src/files.h, src/files.c (attrs_obstack): Remove.
15931 (pre_prologue_obstack, post_prologue_obstack): New.
15932 * src/reader.c (copy_definition): Add a parameter to specify the
15933 obstack to fill, instead of using attrs_obstack unconditionally.
15934 (read_declarations): Pass pre_prologue_obstack to copy_definition if
15935 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
15936
15937 2002-04-23 Paul Eggert <eggert@twinsun.com>
15938
15939 * data/bison.simple: Remove unnecessary commentary and white
15940 space differences from 1_29-branch.
15941 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
15942
15943 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
15944 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
15945 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
15946 constructors or destructors.
15947
15948 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
15949
15950 2002-04-23 Akim Demaille <akim@epita.fr>
15951
15952 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
15953 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
15954 location with columns.
15955 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
15956 All reported by Paul Eggert.
15957
15958 2002-04-22 Akim Demaille <akim@epita.fr>
15959
15960 * src/reduce.c (dump_grammar): Move to...
15961 * src/gram.h, src/gram.c (grammar_dump): here.
15962 Be sure to separate long item numbers.
15963 Don't read the members of a rule's prec if its nil.
15964
15965 2002-04-22 Akim Demaille <akim@epita.fr>
15966
15967 * src/output.c (table_size, table_grow): New.
15968 (MAXTABLE): Remove, replace uses with table_size.
15969 (pack_vector): Instead of dying when the table is too big, grow it.
15970
15971 2002-04-22 Akim Demaille <akim@epita.fr>
15972
15973 * data/bison.simple (yyr1): Its type is that of a token number.
15974 * data/bison.c++ (r1_): Likewise.
15975 * tests/regression.at (Web2c Actions): Adjust.
15976
15977 2002-04-22 Akim Demaille <akim@epita.fr>
15978
15979 * src/reader.c (token_translations_init): 256 is now the default
15980 value for the error token, i.e., it will be assigned another
15981 number if the user assigned 256 to one of her tokens.
15982 (reader): Don't force 256 to error.
15983 * doc/bison.texinfo (Symbols): Adjust.
15984 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
15985 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
15986 etc. instead of 10, 20, 30 (which was used to `jump' over error
15987 (256) and undefined (2)).
15988
15989 2002-04-22 Akim Demaille <akim@epita.fr>
15990
15991 Propagate more token_number_t.
15992
15993 * src/gram.h (token_number_as_item_number)
15994 (item_number_as_token_number): New.
15995 * src/output.c (GENERATE_OUTPUT_TABLE): New.
15996 Use it to create output_item_number_table and
15997 output_token_number_table.
15998 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15999 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16000 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16001 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16002
16003 2002-04-22 Akim Demaille <akim@epita.fr>
16004
16005 * src/output.h, src/output.c (get_lines_number): Remove.
16006
16007 2002-04-19 Akim Demaille <akim@epita.fr>
16008
16009 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16010 as Lex/Flex'.
16011 (Debugging): More details about enabling the debugging features.
16012 (Table of Symbols): Describe $$, $n, @$, and @n.
16013 Suggested by Tim Josling.
16014
16015 2002-04-19 Akim Demaille <akim@epita.fr>
16016
16017 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16018
16019 2002-04-10 Akim Demaille <akim@epita.fr>
16020
16021 * src/system.h: Rely on HAVE_LIMITS_H.
16022 Suggested by Paul Eggert.
16023
16024 2002-04-09 Akim Demaille <akim@epita.fr>
16025
16026 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16027 full stderr, and strip it according to the bison options, instead
16028 of composing the error message from different bits.
16029 This makes it easier to check for several error messages.
16030 Adjust all the invocations.
16031 Add an invocation exercising the error token.
16032 Add an invocation demonstrating a stupid error message.
16033 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16034 Adjust the tests.
16035 Error message are for stderr, not stdout.
16036
16037 2002-04-09 Akim Demaille <akim@epita.fr>
16038
16039 * src/gram.h, src/gram.c (error_token_number): Remove, use
16040 errtoken->number.
16041 * src/reader.c (reader): Don't specify the user token number (2)
16042 for $undefined, as it uselessly prevents using it.
16043 * src/gram.h (token_number_t): Move to...
16044 * src/symtab.h: here.
16045 (state_t.number): Is a token_number_t.
16046 * src/print.c, src/reader.c: Use undeftoken->number instead of
16047 hard coded 2.
16048 (Even though this 2 is not the same as above: the number of the
16049 undeftoken remains being 2, it is its user token number which
16050 might not be 2).
16051 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16052 `user_token_number_max'.
16053 Output `undef_token_number'.
16054 * data/bison.simple, data/bison.c++: Use them.
16055 Be sure to map invalid yylex return values to
16056 `undef_token_number'. This saves us from gratuitous SEGV.
16057
16058 * tests/conflicts.at (Solved SR Conflicts)
16059 (Unresolved SR Conflicts): Adjust.
16060 * tests/regression.at (Web2c Actions): Adjust.
16061
16062 2002-04-08 Akim Demaille <akim@epita.fr>
16063
16064 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16065 Adding #line.
16066 Remove the duplicate `typedefs'.
16067 (RhsNumberType): Fix the declaration and various other typos.
16068 Use __ofile__.
16069 * data/bison.simple: Use __ofile__.
16070 * src/scan-skel.l: Handle __ofile__.
16071
16072 2002-04-08 Akim Demaille <akim@epita.fr>
16073
16074 * src/gram.h (item_number_t): New, the type of item numbers in
16075 RITEM. Note that it must be able to code symbol numbers as
16076 positive number, and the negation of rule numbers as negative
16077 numbers.
16078 Adjust all dependencies (pretty many).
16079 * src/reduce.c (rule): Remove this `short *' pointer: use
16080 item_number_t.
16081 * src/system.h (MINSHORT, MAXSHORT): Remove.
16082 Include `limits.h'.
16083 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16084 (shortcpy): Remove.
16085 (MAXTABLE): Move to...
16086 * src/output.c (MAXTABLE): here.
16087 (prepare_rules): Use output_int_table to output rhs.
16088 * data/bison.simple, data/bison.c++: Adjust.
16089 * tests/torture.at (Big triangle): Move the limit from 254 to
16090 500.
16091 * tests/regression.at (Web2c Actions): Ajust.
16092
16093 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16094 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16095 passes, but produces negative #line number, once fixed, GCC is
16096 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16097 C), it passes.
16098 * src/state.h (state_h): Code input lines on ints, not shorts.
16099
16100 2002-04-08 Akim Demaille <akim@epita.fr>
16101
16102 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16103 and then the grammar.
16104
16105 2002-04-08 Akim Demaille <akim@epita.fr>
16106
16107 * src/system.h: No longer using strndup.
16108
16109 2002-04-07 Akim Demaille <akim@epita.fr>
16110
16111 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16112 * src/output.c (output_table_data): Return the longest number.
16113 (prepare_tokens): Output `token_number_max').
16114 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16115 New.
16116 Use them to define yy_token_number_type/TokenNumberType.
16117 Use this type for yytranslate.
16118 * tests/torture.at (Big triangle): Push the limit from 124 to
16119 253.
16120 * tests/regression.at (Web2c Actions): Adjust.
16121
16122 2002-04-07 Akim Demaille <akim@epita.fr>
16123
16124 * tests/torture.at (Big triangle): New.
16125 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16126 * tests/existing.at: here.
16127
16128 2002-04-07 Akim Demaille <akim@epita.fr>
16129
16130 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16131 nritems.
16132 Adjust dependencies.
16133
16134 2002-04-07 Akim Demaille <akim@epita.fr>
16135
16136 * src/reader.c: Normalize increments to prefix form.
16137
16138 2002-04-07 Akim Demaille <akim@epita.fr>
16139
16140 * src/reader.c, symtab.c: Remove debugging code.
16141
16142 2002-04-07 Akim Demaille <akim@epita.fr>
16143
16144 Rename all the `bucket's as `symbol_t'.
16145
16146 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16147 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16148 * src/symtab.c, src/symtab.h (bucket): Rename as...
16149 (symbol_t): this.
16150 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16151 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16152 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16153 (buckets_new, buckets_free, buckets_do): Rename as...
16154 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16155 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16156 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16157 (symbols_new, symbols_free, symbols_do): these.
16158
16159 2002-04-07 Akim Demaille <akim@epita.fr>
16160
16161 Use lib/hash for the symbol table.
16162
16163 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16164 EOF.
16165 * src/lex.c (lex): Set the `number' member of new terminals.
16166 * src/reader.c (bucket_check_defined, bucket_make_alias)
16167 (bucket_check_alias_consistence, bucket_translation): New.
16168 (reader, grammar_free, readgram, token_translations_init)
16169 (packsymbols): Adjust.
16170 (reader): Number the predefined tokens.
16171 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16172 for predefined tokens.
16173 * src/symtab.h (bucket): Remove all the hash table related
16174 members.
16175 * src/symtab.c (symtab): Replace by...
16176 (bucket_table): this.
16177 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16178 (buckets_new, buckets_do): New.
16179
16180 2002-04-07 Akim Demaille <akim@epita.fr>
16181
16182 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16183 (start_symbol, max_user_token_number, semantic_parser)
16184 (error_token_number): Initialize.
16185 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16186 Initialize.
16187 (reader): Don't.
16188 (errtoken, eoftoken, undeftoken, axiom): Extern.
16189
16190 2002-04-07 Akim Demaille <akim@epita.fr>
16191
16192 * src/gram.h (rule_s): prec and precsym are now pointers
16193 to the bucket giving the priority/associativity.
16194 Member `associativity' removed: useless.
16195 * src/reduce.c, src/conflicts.c: Adjust.
16196
16197 2002-04-07 Akim Demaille <akim@epita.fr>
16198
16199 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16200 Properly escape the symbols' TAG when outputting them.
16201
16202 2002-04-07 Akim Demaille <akim@epita.fr>
16203
16204 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16205
16206 2002-04-07 Akim Demaille <akim@epita.fr>
16207
16208 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16209 (LArule): this, which is an array to rule_t*.
16210 * src/print.c, src/conflicts.c: Adjust.
16211
16212 2002-04-07 Akim Demaille <akim@epita.fr>
16213
16214 * src/gram.h (rule_t): Rename `number' as `user_number'.
16215 `number' is a new member.
16216 Adjust dependencies.
16217 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16218
16219 2002-04-07 Akim Demaille <akim@epita.fr>
16220
16221 As a result of the previous patch, it is no longer needed
16222 to reorder ritem itself.
16223
16224 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16225
16226 2002-04-07 Akim Demaille <akim@epita.fr>
16227
16228 Be sure never to walk through RITEMS, but use only data related to
16229 the rules themselves. RITEMS should be banished.
16230
16231 * src/output.c (output_token_translations): Rename as...
16232 (prepare_tokens): this.
16233 In addition to `translate', prepare the muscles `tname' and
16234 `toknum', which were handled by...
16235 (output_rule_data): this.
16236 Remove, and move the remainder of its outputs into...
16237 (prepare_rules): this new routines, which also merges content from
16238 (output_gram): this.
16239 (prepare_rules): Be sure never to walk through RITEMS.
16240 (output_stos): Rename as...
16241 (prepare_stos): this.
16242 (output): Always invoke prepare_states, after all, just don't use it
16243 in the output if you don't need it.
16244
16245 2002-04-07 Akim Demaille <akim@epita.fr>
16246
16247 * src/LR0.c (new_state): Display `nstates' as the name of the
16248 newly created state.
16249 Adjust to initialize first_state and last_state if needed.
16250 Be sure to distinguish the initial from the final state.
16251 (new_states): Create the itemset of the initial state, and use
16252 new_state.
16253 * src/closure.c (closure): Now that the initial state has its
16254 items properly set, there is no need for a special case when
16255 creating `ruleset'.
16256
16257 As a result, now the rule 0, reducing to $axiom, is visible in the
16258 outputs. Adjust the test suite.
16259
16260 * tests/conflicts.at (Solved SR Conflicts)
16261 (Unresolved SR Conflicts): Adjust.
16262 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16263 * tests/conflicts.at (S/R in initial): New.
16264
16265 2002-04-07 Akim Demaille <akim@epita.fr>
16266
16267 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16268 the RHS of the rules.
16269 * src/output.c (output_gram): Likewise.
16270
16271 2002-04-07 Akim Demaille <akim@epita.fr>
16272
16273 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16274 bucket.
16275 Adjust all dependencies.
16276 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16277 `number' of the buckets too.
16278 * src/gram.h: Include `symtab.h'.
16279 (associativity): Move to...
16280 * src/symtab.h: here.
16281 No longer include `gram.h'.
16282
16283 2002-04-07 Akim Demaille <akim@epita.fr>
16284
16285 * src/gram.h, src/gram.c (rules_rhs_length): New.
16286 (ritem_longest_rhs): Use it.
16287 * src/gram.h (rule_t): `number' is a new member.
16288 * src/reader.c (packgram): Set it.
16289 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16290 the end of `rules', and count them out of `nrules'.
16291 (reduce_output, dump_grammar): Adjust.
16292 * src/print.c (print_grammar): It is no longer needed to check for
16293 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16294 * tests/reduce.at (Reduced Automaton): New test.
16295
16296 2002-04-07 Akim Demaille <akim@epita.fr>
16297
16298 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16299 lacking `+ 1' to nrules, Bison reported as useless a token if it
16300 was used solely to set the precedence of the last rule...
16301
16302 2002-04-07 Akim Demaille <akim@epita.fr>
16303
16304 * data/bison.c++, data/bison.simple: Don't output the current file
16305 name in #line, to avoid useless diffs between two identical
16306 outputs under different names.
16307
16308 2002-04-07 Akim Demaille <akim@epita.fr>
16309
16310 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16311 Normalize loops to using `< nrules + 1', not `<= nrules'.
16312
16313 2002-04-07 Akim Demaille <akim@epita.fr>
16314
16315 * TODO: Update.
16316
16317 2002-04-07 Akim Demaille <akim@epita.fr>
16318
16319 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16320 bucket.value as bucket.number.
16321
16322 2002-04-07 Akim Demaille <akim@epita.fr>
16323
16324 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16325 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16326 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16327 RHS, instead of being an index in RITEMS.
16328
16329 2002-04-04 Paul Eggert <eggert@twinsun.com>
16330
16331 * doc/bison.texinfo: Update copyright date.
16332 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16333 (Symbols): Warn about running Bison in one character set,
16334 but compiling and/or running in an incompatible one.
16335 Warn about character code 256, too.
16336
16337 2002-04-03 Paul Eggert <eggert@twinsun.com>
16338
16339 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16340 YYERROR_VERBOSE is nonzero, not whether it is defined.
16341
16342 Merge changes from bison-1_29-branch.
16343
16344 2002-03-20 Paul Eggert <eggert@twinsun.com>
16345
16346 Merge fixes from Debian bison_1.34-1.diff.
16347
16348 * configure.in (AC_PREREQ): 2.53.
16349
16350 2002-03-20 Akim Demaille <akim@epita.fr>
16351
16352 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16353
16354 2002-03-19 Paul Eggert <eggert@twinsun.com>
16355
16356 * src/bison.simple (YYCOPY): New macro.
16357 (YYSTACK_RELOCATE): Use it.
16358 Remove Type arg; no longer needed. All callers changed.
16359 (yymemcpy): Remove; no longer needed.
16360
16361 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16362 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16363
16364 2002-03-19 Akim Demaille <akim@epita.fr>
16365
16366 Test and fix the #line outputs.
16367
16368 * tests/atlocal.at (GCC): New.
16369 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
16370 (Prologue synch line, %union synch line, Postprologue synch line)
16371 (Action synch line, Epilogue synch line): New tests.
16372 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16373 * data/bison.simple, data/bison.c++: Use it.
16374
16375 2002-03-19 Akim Demaille <akim@epita.fr>
16376
16377 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16378 (Solved SR Conflicts, %expect not enough, %expect right)
16379 (%expect too much): Move to...
16380 * tests/conflicts.at: this new file.
16381
16382 2002-03-19 Akim Demaille <akim@epita.fr>
16383
16384 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16385 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16386 that we can move to enums for instance.
16387 * src/output.c (token_definitions_output): Output a list of
16388 `token-name, token-number' instead of the #define.
16389 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16390
16391 2002-03-14 Akim Demaille <akim@epita.fr>
16392
16393 Use Gettext 0.11.1.
16394
16395 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
16396
16397 * data/bison.c++: Make the user able to add members to the generated
16398 parser by subclassing.
16399
16400 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
16401
16402 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16403 a character.
16404 Reported by Nicolas Tisserand and Nicolas Burrus.
16405
16406 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16407
16408 * src/reader.c: Warn about lacking semi-colons, do not complain.
16409
16410 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16411
16412 * data/bison.c++: Remove a debug line.
16413
16414 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16415
16416 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16417 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16418 provide a default implementation.
16419
16420 2002-03-04 Akim Demaille <akim@epita.fr>
16421
16422 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16423 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16424 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16425 * tests/semantic.at (Parsing Guards): Similarly.
16426 * src/reader.at (readgram): Complain if the last rule is not ended
16427 with a semi-colon.
16428
16429 2002-03-04 Akim Demaille <akim@epita.fr>
16430
16431 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16432 * src/closure.c: here.
16433 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16434 RTC.
16435 * src/warshall.h, src/warshall.c: Remove.
16436 * tests/sets.at (Broken Closure): Adjust.
16437
16438 2002-03-04 Akim Demaille <akim@epita.fr>
16439
16440 * src/output.c (output_skeleton): tempdir is const.
16441 bytes_read is unused.
16442
16443 2002-03-04 Akim Demaille <akim@epita.fr>
16444
16445 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16446 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16447 Update.
16448 From Michael Hayes.
16449
16450 2002-03-04 Akim Demaille <akim@epita.fr>
16451
16452 * src/closure.c (closure): `r' is unused.
16453
16454 2002-03-04 Akim Demaille <akim@epita.fr>
16455
16456 * tests/sets.at (Broken Closure): Add the ending `;'.
16457 * src/reader.at (readgram): Complain if a rule is not ended with a
16458 semi-colon.
16459
16460 2002-03-04 Akim Demaille <akim@epita.fr>
16461
16462 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16463 (count_sr_conflicts): Use bitset_count.
16464 * src/reduce.c (inaccessable_symbols): Ditto.
16465 (bits_size): Remove.
16466 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16467
16468 2002-03-04 Akim Demaille <akim@epita.fr>
16469
16470 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16471 * src/reduce.c: Remove the `bitset_zero's following the
16472 `bitset_create's, as now it is performed by the latter.
16473
16474 2002-03-04 Akim Demaille <akim@epita.fr>
16475
16476 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16477 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16478 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16479 latest sources from Michael.
16480
16481 2002-03-04 Akim Demaille <akim@epita.fr>
16482
16483 * src/output.c (output): Don't free the grammar.
16484 * src/reader.c (grammar_free): New.
16485 * src/main.c (main): Call it and don't free symtab here.
16486
16487 2002-03-04 Akim Demaille <akim@epita.fr>
16488
16489 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16490 before returning.
16491 Reported by Benoit Perrot.
16492
16493 2002-03-04 Akim Demaille <akim@epita.fr>
16494
16495 Use bitset operations when possible, not loops over bits.
16496
16497 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16498 bitset_or.
16499 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16500 * src/reduce.c (useless_nonterminals): Formatting changes.
16501 * src/warshall.c (TC): Use bitset_or.
16502
16503 2002-03-04 Akim Demaille <akim@epita.fr>
16504
16505 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16506 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16507 Ditto.
16508
16509 2002-03-04 Akim Demaille <akim@epita.fr>
16510
16511 * src/lalr.c (F): Now a bitset*.
16512 Adjust all dependencies.
16513
16514 2002-03-04 Akim Demaille <akim@epita.fr>
16515
16516 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16517 Adjust all dependencies.
16518
16519 2002-03-04 Akim Demaille <akim@epita.fr>
16520
16521 * src/L0.c, src/LR0.h (nstates): Be size_t.
16522 Adjust comparisons (signed vs unsigned).
16523 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16524 bitset*.
16525 Adjust all dependencies.
16526
16527 2002-03-04 Akim Demaille <akim@epita.fr>
16528
16529 * src/closure.c (firsts): Now, also a bitset.
16530 Adjust all dependencies.
16531 (varsetsize): Remove, now unused.
16532 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16533
16534 2002-03-04 Akim Demaille <akim@epita.fr>
16535
16536 * src/print.c: Convert to use bitset.h, not hand coded iterations
16537 over ints.
16538
16539 2002-03-04 Akim Demaille <akim@epita.fr>
16540
16541 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16542
16543 2002-03-04 Akim Demaille <akim@epita.fr>
16544
16545 * src/closure.c (ruleset): Be a bitset.
16546 (rulesetsize): Remove.
16547
16548 2002-03-04 Akim Demaille <akim@epita.fr>
16549
16550 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16551 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16552 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16553 * src/closure.c (fderives): Be an array of bitsets.
16554
16555 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
16556
16557 * data/bison.c++: Merge the two generated headers. Insert a copyright
16558 notice in each output file.
16559
16560 2002-02-28 Akim Demaille <akim@epita.fr>
16561
16562 * data/bison.c++: Copy the prologue of bison.simple to fetch
16563 useful M4 definitions, such as b4_header_guard.
16564
16565 2002-02-25 Akim Demaille <akim@epita.fr>
16566
16567 * src/getargs.c (version): Give the name of the authors, and use a
16568 translator friendly scheme for the bgr
16569 copyright notice.
16570
16571 2002-02-25 Akim Demaille <akim@epita.fr>
16572
16573 * src/output.c (header_output): Remove, now handled completely via
16574 M4.
16575
16576 2002-02-25 Akim Demaille <akim@epita.fr>
16577
16578 * m4/m4.m4: New, from CVS Autoconf.
16579 * configure.in: Invoke it.
16580 * src/output.c (output_skeleton): Use its result instead of the
16581 hard coded name.
16582
16583 2002-02-25 Akim Demaille <akim@epita.fr>
16584
16585 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16586 Fileutils 4.1.5.
16587 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16588 * src/output.c (output_skeleton): Use mkstemp to create a real
16589 temporary file.
16590 Move the filling of `skeleton' and its muscle to...
16591 (prepare): here.
16592 (output): Move the definition of the prologue muscle to...
16593 (prepare): here.
16594 * src/system.h (DEFAULT_TMPDIR): New.
16595
16596 2002-02-14 Paul Eggert <eggert@twinsun.com>
16597
16598 Remove the support for C++ namespace cleanliness; it was
16599 causing more problems than it was curing, since it didn't work
16600 properly on some nonstandard C++ compilers. This can wait
16601 for a proper C++ parser.
16602
16603 * NEWS: Document this.
16604 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16605 of C++, as it's treated like C now.
16606 * src/bison.simple (YYSTD): Remove.
16607 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16608 Treat C++ just like Standard C instead of trying to support
16609 namespace cleanliness.
16610
16611 2002-02-14 Akim Demaille <akim@epita.fr>
16612
16613 * tests/regression.at (else): Adjust to Andreas' change.
16614
16615 2002-02-14 Akim Demaille <akim@epita.fr>
16616
16617 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16618
16619 2002-02-13 Andreas Schwab <schwab@suse.de>
16620
16621 * src/output.c (output_rule_data): Don't output NULL, it might
16622 not be defined yet.
16623
16624 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
16625
16626 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16627 (Copyright notice): Update.
16628
16629 2002-02-11 Akim Demaille <akim@epita.fr>
16630
16631 * tests/regression.at (%nonassoc and eof): Don't include
16632 nonportable headers.
16633
16634 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
16635
16636 * data/bison.c++: Correct error recovery. Make the user able to
16637 initialize the starting location.
16638
16639 2002-02-07 Akim Demaille <akim@epita.fr>
16640
16641 * tests/input.at: New.
16642
16643 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16644
16645 * data/bison.c++: Replace some direct m4 expansions by constants. Be
16646 more consistent when naming methods and variables. Put preprocessor
16647 directives around tables only needed for debugging.
16648
16649 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16650
16651 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16652 C++ parsers.
16653 (yy::b4_name::parse): Use print_.
16654
16655 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16656
16657 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16658
16659 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16660
16661 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16662 C++ parsers.
16663 (yy::b4_name::parse): Build verbose error messages, and use error_.
16664
16665 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
16666
16667 * data/bison.c++: Fix m4 quoting in comments.
16668
16669 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
16670
16671 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16672 not expanded by m4.
16673
16674 2002-02-05 Akim Demaille <akim@epita.fr>
16675
16676 * data/bison.c++: Adjust to the M4 back end.
16677 More is certainly needed.
16678
16679 2002-02-05 Akim Demaille <akim@epita.fr>
16680
16681 Give a try to M4 as a back end.
16682
16683 * lib/readpipe.c: New, from wdiff.
16684 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16685 BISON_HAIRY.
16686 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16687 specific values. Now it is m4 that performs the lookup.
16688 * src/parse-skel.y: Remove.
16689 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16690 * src/output.c (actions_output, guards_output)
16691 (token_definitions_output): No longer keeps track of the output
16692 line number, hence remove the second argument.
16693 (guards_output): Check against the guard member of a rule, not the
16694 action member.
16695 Adjust callers.
16696 (output_skeleton): Don't look for the skeleton location, let m4 do
16697 that.
16698 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16699 file will be used.
16700 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16701 (prepare): Given that for the time being changesyntax is not
16702 usable in M4, rename the muscles using `-' to `_'.
16703 Define `defines_flag', `output_parser_name' and `output_header_name'.
16704 * src/output.h (actions_output, guards_output)
16705 (token_definitions_output): Adjust prototypes.
16706 * src/scan-skel.l: Instead of scanning the skeletons, it now
16707 processes the output of m4: `__oline__' and `#output'.
16708 * data/bison.simple: Adjust to be used by M4(sugar).
16709 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16710 to date.
16711 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16712 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16713 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16714 shamelessly stolen from CVS Autoconf.
16715
16716 2002-02-05 Akim Demaille <akim@epita.fr>
16717
16718 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16719 * configure.in: Check for the declarations of free and malloc.
16720 * src/muscle_tab.c: Adjust.
16721
16722 2002-02-05 Akim Demaille <akim@epita.fr>
16723
16724 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16725 which have no values.
16726
16727 2002-02-05 Akim Demaille <akim@epita.fr>
16728
16729 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16730 * data/: here.
16731
16732 2002-01-29 Paul Eggert <eggert@twinsun.com>
16733
16734 * src/bison.simple (YYSIZE_T): Do not define merely because
16735 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16736 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16737
16738 2002-01-27 Akim Demaille <akim@epita.fr>
16739
16740 Fix `%nonassoc and eof'.
16741
16742 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16743 which were not properly copied! Replace
16744 memcpy (res->errs, src->errs, src->nerrs);
16745 with
16746 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16747 !!!
16748 * tests/regression.at (%nonassoc and eof): Adjust to newest
16749 Autotest: `.' is not in the PATH.
16750
16751 2002-01-27 Akim Demaille <akim@epita.fr>
16752
16753 * tests/sets.at (AT_EXTRACT_SETS): New.
16754 (Nullable): Use it.
16755 (Firsts): New.
16756
16757 2002-01-26 Akim Demaille <akim@epita.fr>
16758
16759 * tests/actions.at, tests/calc.at, tests/headers.at,
16760 * tests/torture.at: Adjust to the newest Autotest which no longer
16761 forces `.' in the PATH.
16762
16763 2002-01-25 Akim Demaille <akim@epita.fr>
16764
16765 * tests/regression.at (%nonassoc and eof): New.
16766 Suggested by Robert Anisko.
16767
16768 2002-01-24 Akim Demaille <akim@epita.fr>
16769
16770 Bison dumps core when trying to complain about broken input files.
16771 Reported by Cris van Pelt.
16772
16773 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16774 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16775 into...
16776 (Invalid inputs): Strengthen: exercise parse_percent_token.
16777
16778 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
16779
16780 * src/Makefile.am: Add bison.c++.
16781 * src/bison.c++: New skeleton.
16782
16783 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
16784
16785 * po/it.po: New.
16786
16787 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16788
16789 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16790
16791 2002-01-20 Marc Autret <marc@gnu.org>
16792
16793 * src/files.c (compute_output_file_names): Fix
16794
16795 2002-01-20 Marc Autret <marc@gnu.org>
16796
16797 * tests/output.at: New test.
16798 * src/files.c (compute_base_names): Don't map extensions when
16799 the YACC flag is set, use defaults.
16800 Reported by Evgeny Stambulchik.
16801
16802 2002-01-20 Marc Autret <marc@gnu.org>
16803
16804 * src/system.h: Need to define __attribute__ away for non-GCC
16805 compilers as well (i.e., the vendor C compiler).
16806 Suggested by Albert Chin-A-Young.
16807
16808 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16809
16810 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16811 canonical definition.
16812 * src/system.h: Use the canonical definition for PARAMS (avoids
16813 a conflict with the macro from lib/hash.h).
16814
16815 2002-01-11 Akim Demaille <akim@epita.fr>
16816
16817 * configure.in: Use AC_FUNC_STRNLEN.
16818 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
16819
16820 2002-01-09 Akim Demaille <akim@epita.fr>
16821
16822 * src/files.c, src/files.h (output_infix): New.
16823 (tab_extension): Remove.
16824 (compute_base_names): Compute the former, drop the latter.
16825 * src/output.c (prepare): Insert the muscles `output-infix', and
16826 `output-suffix'.
16827 * src/parse-skel.y (string, string.1): New.
16828 (section.header): Use it.
16829 (section.yacc): Remove.
16830 (prefix): Remove too.
16831 * src/scan-skel.l: Adjust.
16832 * src/bison.simple, src/bison.hairy: Adjust.
16833
16834 2002-01-09 Akim Demaille <akim@epita.fr>
16835
16836 * configure.in (WERROR_CFLAGS): Compute it.
16837 * src/Makefile.am (CFLAGS): Pass it.
16838 * tests/atlocal.in (CFLAGS): Idem.
16839 * src/files.c: Fix a few warnings.
16840 (get_extension_index): Remove, unused.
16841
16842 2002-01-08 Akim Demaille <akim@epita.fr>
16843
16844 * src/getargs.c (AS_FILE_NAME): New.
16845 (getargs): Use it to convert DOSish file names.
16846 * src/files.c (base_name): Rename as full_base_name to avoid
16847 clashes with `base_name ()'.
16848 (filename_split): New.
16849 (compute_base_names): N-th rewrite, using filename_split.
16850
16851 2002-01-08 Akim Demaille <akim@epita.fr>
16852
16853 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16854 New, stolen from the Fileutils 4.1.
16855 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16856 * configure.in: Check for the presence of memrchr, and of its
16857 prototype.
16858
16859 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16860
16861 * lib/hash.h (__P): Added definition for this macro.
16862 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16863 BUILT_SOURCES, to ensure they are generated first.
16864 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16865 %error-verbose to allow bootstrapping with bison 1.30x.
16866
16867 2002-01-06 Akim Demaille <akim@epita.fr>
16868
16869 * src/reader.c (parse_braces): Don't fetch the next char, the
16870 convention is to fetch on entry.
16871 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16872 'switch' without a following semicolon.
16873 * tests/regression.at (braces parsing): New.
16874
16875 2002-01-06 Akim Demaille <akim@epita.fr>
16876
16877 Bison is dead wrong in its RR conflict reports.
16878
16879 * tests/torture.at (GNU Cim Grammar): New.
16880 * src/conflicts.c (count_rr_conflicts): Fix.
16881
16882 2002-01-06 Akim Demaille <akim@epita.fr>
16883
16884 Creating package.m4 from configure.ac causes too many problems.
16885
16886 * tests/Makefile.am (package.m4): Create it by hand,
16887 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16888
16889 2002-01-06 Akim Demaille <akim@epita.fr>
16890
16891 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16892 skeleton.h.
16893
16894 2002-01-04 Paul Eggert <eggert@twinsun.com>
16895
16896 * doc/bison.texinfo (Debugging):
16897 Remove YYSTDERR; it's no longer defined or used.
16898 Also, s/cstdio.h/cstdio/.
16899
16900 2002-01-03 Akim Demaille <akim@epita.fr>
16901
16902 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
16903
16904 2002-01-03 Akim Demaille <akim@epita.fr>
16905
16906 * src/parse-skel.y (process_skeleton): Don't bind the parser's
16907 tracing code to --trace, wait for a better --trace option, with
16908 args.
16909
16910 2002-01-03 Akim Demaille <akim@epita.fr>
16911
16912 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
16913 The ISO C++ standard is extremely clear about it: stderr is
16914 considered a macro, not a regular symbol (see table 94 `Header
16915 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
16916 Therefore std:: does not apply to it. It still does with fprintf.
16917 Also, s/cstdio.h/cstdio/.
16918
16919 2002-01-03 Akim Demaille <akim@epita.fr>
16920
16921 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
16922 for non system headers.
16923
16924 2002-01-02 Akim Demaille <akim@epita.fr>
16925
16926 Equip the skeleton chain with location tracking, runtime trace,
16927 pure parser and scanner.
16928
16929 * src/parse-skel.y: Request a pure parser, locations, and prefix
16930 renaming.
16931 (%union): Having several members with the same type does not help
16932 type mismatches, simplify.
16933 (YYPRINT, yyprint): New.
16934 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
16935 (skel_error): this.
16936 Handle locations.
16937 * src/scan-skel.l: Adjust to these changes.
16938 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
16939 (LOCATION_PRINT, skel_control_t): New.
16940
16941 2001-12-30 Akim Demaille <akim@epita.fr>
16942
16943 * src/parse-skel.y: Get rid of the shift/reduce conflict:
16944 replace `gb' with BLANKS.
16945 * src/scan-skel.l: Adjust.
16946
16947 2001-12-30 Akim Demaille <akim@epita.fr>
16948
16949 * src/system.h: We don't need nor want bcopy.
16950 Throw away MS-DOS crap: we don't need getpid.
16951 * configure.in: We don't need strndup. It was even causing
16952 problems: because Flex includes the headers *before* us,
16953 _GNU_SOURCE is not defined by config.h, and therefore strndup was
16954 not visible.
16955 * lib/xstrndup.c: New.
16956 * src/scan-skel.l: Use it.
16957 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
16958 * src/parse-skel.y: Use %directives instead of #defines.
16959
16960 2001-12-30 Akim Demaille <akim@epita.fr>
16961
16962 * src/skeleton.h: New.
16963 * src/output.c (output_parser, output_master_parser): Remove, dead
16964 code.
16965 * src/output.h (get_lines_number, actions_output, guards_output)
16966 (token_definitions_output): Prototype them.
16967 * src/parse-skel.y: Add the license notice.
16968 Include output.h and skeleton.h.
16969 (process_skeleton): Returns void, and takes a single parameter.
16970 * src/scan-skel.l: Add the license notice.
16971 Include skeleton.h.
16972 Don't use %option yylineno: it seems that then Flex imagines
16973 REJECT has been used, and therefore it won't reallocate its
16974 buffers (which makes no other sense to me than a bug). It results
16975 in warnings for `unused: yy_flex_realloc'.
16976
16977 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
16978
16979 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16980 (MUSCLE_INSERT_PREFIX): ...to there.
16981 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16982 (MUSCLE_INSERT_PREFIX): Move from here...
16983
16984 * src/bison.hairy: Add a section directive. Put braces around muscle
16985 names. This parser skeleton is still broken, but Bison should not
16986 choke on a bad muscle 'syntax'.
16987 * src/bison.simple: Add a section directive. Put braces around muscle
16988 names.
16989
16990 * src/files.h (strsuffix, stringappend): Add declarations.
16991 (tab_extension): Add declaration.
16992 (short_base_name): Add declaration.
16993
16994 * src/files.c (strsuffix, stringappend): No longer static. These
16995 functions are used in the skeleton parser.
16996 (tab_extension): New.
16997 (compute_base_names): Use the computations done in this function
16998 to guess if the generated parsers should have '.tab' in their
16999 names.
17000 (short_base_name): No longer static.
17001
17002 * src/output.c (output_skeleton): New.
17003 (output): Disable call to output_master_parser, and give a try to
17004 a new skeleton handling system.
17005 (guards_output, actions_output): No longer static.
17006 (token_definitions_output, get_lines_number): No longer static.
17007
17008 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17009
17010 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
17011 parse-skel.y.
17012
17013 * src/parse-skel.y: New file.
17014 * src/scan-skel.l: New file.
17015
17016 2001-12-29 Akim Demaille <akim@epita.fr>
17017
17018 %name-prefix is broken.
17019
17020 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17021 Adjust all dependencies.
17022 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17023 %name-prefix.
17024
17025 Renaming yylval but not yylloc is not consistent. Now we do.
17026
17027 * src/bison.simple: Prefix yylloc if used.
17028 * doc/bison.texinfo (Decl Summary): Document that.
17029
17030 2001-12-29 Akim Demaille <akim@epita.fr>
17031
17032 * doc/bison.texinfo: Promote `%long-directive' over
17033 `%long_directive'.
17034 Remove all references to fixed-output-files, yacc is enough.
17035
17036 2001-12-29 Akim Demaille <akim@epita.fr>
17037
17038 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17039 user prologue. These are defaults.
17040 * tests/actions.at (Mid-rule actions): Make sure the user can
17041 define YYDEBUG and YYERROR_VERBOSE.
17042
17043 2001-12-29 Akim Demaille <akim@epita.fr>
17044
17045 * src/output.c (header_output): Don't forget to export YYLTYPE and
17046 yylloc.
17047 * tests/headers.at (export YYLTYPE): New, make sure it does.
17048 * tests/regression.at (%union and --defines, Invalid CPP headers):
17049 Move to...
17050 * tests/headers.at: here.
17051
17052 2001-12-29 Akim Demaille <akim@epita.fr>
17053
17054 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17055
17056 2001-12-29 Akim Demaille <akim@epita.fr>
17057
17058 * tests/actions.at (Mid-rule actions): Output on a single line
17059 instead of several.
17060
17061 2001-12-29 Akim Demaille <akim@epita.fr>
17062
17063 * doc/bison.texinfo: Formatting changes.
17064
17065 2001-12-29 Akim Demaille <akim@epita.fr>
17066
17067 Don't store the token defs in a muscle, just be ready to output it
17068 on command. Now possible via `symbols'. Fixes a memory leak.
17069
17070 * src/output.c (token_definitions_output): New.
17071 (output_parser, header_output): Use it.
17072 * src/reader.c (symbols_save): Remove.
17073
17074 2001-12-29 Akim Demaille <akim@epita.fr>
17075
17076 * src/bison.simple: Do not provide a default for YYSTYPE and
17077 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17078 default.
17079
17080 2001-12-29 Akim Demaille <akim@epita.fr>
17081
17082 Mid-rule actions are simply... ignored!
17083
17084 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17085 the empty-rule associated to the dummy symbol, not to the host
17086 rule.
17087 * tests/actions.at (Mid-rule actions): New.
17088
17089 2001-12-29 Akim Demaille <akim@epita.fr>
17090
17091 Memory leak.
17092
17093 * src/reader.c (reader): Free grammar.
17094
17095 2001-12-29 Akim Demaille <akim@epita.fr>
17096
17097 Memory leak.
17098
17099 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17100 since it allocates it for each state, although only one is needed.
17101 (allocate_storage): Do it here.
17102
17103 2001-12-29 Akim Demaille <akim@epita.fr>
17104
17105 * src/options.h, src/options.c (create_long_option_table): Rename
17106 as...
17107 (long_option_table_new): this, with a clearer prototype.
17108 (percent_table): Remove, unused,
17109 * src/getargs.c (getargs): Adjust.
17110
17111 2001-12-29 Akim Demaille <akim@epita.fr>
17112
17113 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17114 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17115 as states.
17116
17117 2001-12-29 Akim Demaille <akim@epita.fr>
17118
17119 * src/lalr.c (build_relations): Rename `states' as `states1'.
17120 Sorry, I don't understand exactly what it is, no better name...
17121
17122 2001-12-29 Akim Demaille <akim@epita.fr>
17123
17124 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17125 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17126 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17127 as rules.
17128
17129 2001-12-29 Akim Demaille <akim@epita.fr>
17130
17131 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17132 ago.
17133
17134 2001-12-29 Akim Demaille <akim@epita.fr>
17135
17136 * src/reader.c, src/reader.h (user_toknums): Remove.
17137 Adjust all users to use symbols[i]->user_token_number.
17138
17139 2001-12-29 Akim Demaille <akim@epita.fr>
17140
17141 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17142 Adjust all users to use symbols[i]->prec or ->assoc.
17143
17144 2001-12-29 Akim Demaille <akim@epita.fr>
17145
17146 * src/reader.c, src/reader.h (tags): Remove.
17147 Adjust all users to use symbols[i]->tag.
17148
17149 2001-12-29 Akim Demaille <akim@epita.fr>
17150
17151 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17152 and rule_table.
17153 * src/reader.c (packsymbols): Fill this table.
17154 Drop sprec.
17155 * src/conflicts.c (resolve_sr_conflict): Adjust.
17156 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17157 single table.
17158 Use symbols[i]->tag instead of tags[i].
17159
17160 2001-12-29 Akim Demaille <akim@epita.fr>
17161
17162 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17163 In addition, put a comment in there, to replace...
17164 * tests/regression.at (%union and C comments): Remove.
17165
17166 2001-12-29 Akim Demaille <akim@epita.fr>
17167
17168 * tests/regression.at (Web2c Actions): Blindly move the actual
17169 output as expected output. The contents *seem* right to me, but I
17170 can't pretend reading perfectly parser tables... Nonetheless, all
17171 the other tests pass correctly, the table look OK, even though the
17172 presence of `$axiom' is to be noted: AFAICS it is useless (but
17173 harmless).
17174
17175 2001-12-29 Akim Demaille <akim@epita.fr>
17176
17177 * src/reader.c (readgram): Don't add the rule 0 if there were no
17178 rules read. In other words, add it _after_ having performed
17179 grammar sanity checks.
17180 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17181
17182 2001-12-29 Akim Demaille <akim@epita.fr>
17183
17184 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17185 visible, and some states have now a different number.
17186
17187 2001-12-29 Akim Demaille <akim@epita.fr>
17188
17189 * src/reader.c (readgram): Bind the initial rule's lineno to that
17190 of the first rule.
17191 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17192 (Solved SR Conflicts): Adjust rule 0's line number.
17193
17194 2001-12-29 Akim Demaille <akim@epita.fr>
17195
17196 Fix the `GAWK Grammar' failure.
17197
17198 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17199 the reductions of the first state which was mistakenly confused
17200 with the final state because precisely final_state was initialized
17201 to 0.
17202 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17203 now noticed by Bison.
17204 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17205 have a reduction on $default.
17206
17207 2001-12-29 Akim Demaille <akim@epita.fr>
17208
17209 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17210 rule line numbers.
17211 * src/closure.c (print_closure): Likewise.
17212 * src/derives.c (print_derives): Likewise.
17213 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17214 now.
17215
17216 2001-12-29 Akim Demaille <akim@epita.fr>
17217
17218 * src/lalr.c (lookaheads_print): New.
17219 (lalr): Call it when --trace-flag.
17220 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17221 are dumped.
17222
17223 2001-12-29 Akim Demaille <akim@epita.fr>
17224
17225 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17226 when walking through ritem, even via rule->rhs.
17227 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17228 (useful_production, useless_nonterminals): Likewise.
17229 (reduce_grammar_tables): Likewise, plus update nritems.
17230 * src/nullable.c (set_nullable): Likewise.
17231 * src/lalr.c (build_relations): Likewise.
17232 * tests/sets.at (Nullable): Adjust.
17233 Fortunately, now, the $axiom is no longer nullable.
17234
17235 2001-12-29 Akim Demaille <akim@epita.fr>
17236
17237 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17238 the 0-sentinel.
17239 * src/gram.c (ritem_longest_rhs): Likewise.
17240 * src/reduce.c (nonterminals_reduce): Likewise.
17241 * src/print_graph.c (print_graph): Likewise.
17242 * src/output.c (output_rule_data): Likewise.
17243 * src/nullable.c (set_nullable): Likewise.
17244
17245 2001-12-29 Akim Demaille <akim@epita.fr>
17246
17247 * src/output.c: Comment changes.
17248
17249 2001-12-27 Paul Eggert <eggert@twinsun.com>
17250
17251 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17252 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17253 Sparc, as they were causing more porting problems than the
17254 (minor) performance improvement was worth.
17255
17256 Also, catch up with 1.31's YYSTD.
17257
17258 2001-12-27 Akim Demaille <akim@epita.fr>
17259
17260 * src/output.c (output_gram): Rely on nritems, not the
17261 0-sentinel. See below.
17262 Use -1 as separator, not 0.
17263 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17264 Rely on -1 as separator in yyrhs, instead of 0.
17265 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17266 twice `Now at end of input', therefore there are two lines less to
17267 expect.
17268
17269 2001-12-27 Akim Demaille <akim@epita.fr>
17270
17271 * tests/regression.at (Unresolved SR Conflicts):
17272 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17273 below.
17274
17275 2001-12-27 Akim Demaille <akim@epita.fr>
17276
17277 * src/LR0.c (new_state): Recognize the final state by the fact it
17278 is reached by eoftoken.
17279 (insert_start_shifting_state, insert_eof_shifting_state)
17280 (insert_accepting_state, augment_automaton): Remove, since now
17281 these states are automatically computed from the initial state.
17282 (generate_states): Adjust.
17283 * src/print.c: When reporting a rule number to the user, substract
17284 1, so that the axiom rule is rule 0, and the first user rule is 1.
17285 * src/reduce.c: Likewise.
17286 * src/print_graph.c (print_core): For the time being, just as for
17287 the report, depend upon --trace-flags to dump the full set of
17288 items.
17289 * src/reader.c (readgram): Once the grammar read, insert the rule
17290 0: `$axiom: START-SYMBOL $'.
17291 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17292 number of the states has changed (the final state is no longer
17293 necessarily the last), catch up.
17294
17295 2001-12-27 Akim Demaille <akim@epita.fr>
17296
17297 Try to make the use of the eoftoken valid. Given that its value
17298 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17299 is used instead of > 0 where appropriate, (ii), depend upon nritems
17300 instead of the 0-sentinel.
17301
17302 * src/gram.h, src/gram.c (nritems): New.
17303 Expected to be duplication of nitems, but for the time being...
17304 * src/reader.c (packgram): Assert nritems and nitems are equal.
17305 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17306 * src/closure.c (print_closure, print_fderives): Likewise.
17307 * src/gram.c (ritem_print): Likewise.
17308 * src/print.c (print_core, print_grammar): Likewise.
17309 * src/print_graph.c: Likewise.
17310
17311 2001-12-27 Akim Demaille <akim@epita.fr>
17312
17313 * src/main.c (main): If there are complains after grammar
17314 reductions, then output the report anyway if requested, then die.
17315 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17316 * src/reader.c (eoftoken): New.
17317 (parse_token_decl): If the token being defined has value `0', it
17318 is the eoftoken.
17319 (packsymbols): No longer hack `tags' to insert `$' by hand.
17320 Be sure to preserve the value of the eoftoken.
17321 (reader): Make sure eoftoken is defined.
17322 Initialize nsyms to 0: now eoftoken is created just like the others.
17323 * src/print.c (print_grammar): Don't special case the eof token.
17324 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17325 lie anyway, albeit pleasant.
17326 * tests/calc.at: Exercise error messages with eoftoken.
17327 Change the grammar so that empty input is invalid.
17328 Adjust expectations.
17329 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17330
17331 2001-12-27 Akim Demaille <akim@epita.fr>
17332
17333 * configure.in: Check the protos of strchr ans strspn.
17334 Replace strchr if needed.
17335 * src/system.h: Provide the protos of strchr, strspn and memchr if
17336 missing.
17337 * lib/strchr.c: New.
17338 * src/reader.c (symbols_save): Use strchr.
17339
17340 2001-12-27 Akim Demaille <akim@epita.fr>
17341
17342 * src/print.c, src/print_graph.c (escape): New.
17343 Use it to quote the TAGS outputs.
17344 * src/print_graph.c (print_state): Now errors are in red, and
17345 reductions in green.
17346 Prefer high to wide: output the state number on a line of its own.
17347
17348 2001-12-27 Akim Demaille <akim@epita.fr>
17349
17350 * src/state.h, src/state.c (reductions_new): New.
17351 * src/LR0.c (set_state_table): Let all the states have a
17352 `reductions', even if reduced to 0.
17353 (save_reductions): Adjust.
17354 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17355 * src/print.c (print_reductions, print_actions): Adjust.
17356 * src/output.c (action_row): Adjust.
17357
17358 2001-12-27 Akim Demaille <akim@epita.fr>
17359
17360 * src/state.h, src/state.c (errs_new, errs_dup): New.
17361 * src/LR0.c (set_state_table): Let all the states have an errs,
17362 even if reduced to 0.
17363 * src/print.c (print_errs, print_reductions): Adjust.
17364 * src/output.c (output_actions, action_row): Adjust.
17365 * src/conflicts.c (resolve_sr_conflict): Adjust.
17366
17367 2001-12-27 Akim Demaille <akim@epita.fr>
17368
17369 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17370
17371 2001-12-27 Akim Demaille <akim@epita.fr>
17372
17373 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17374 * src/print.c: here.
17375 (lookaheadset, shiftset): New, used as additional storage by
17376 print_reductions.
17377 (print_results): Adjust.
17378 (print_shifts, print_gotos, print_errs): New, extracted from...
17379 (print_actions): here.
17380 * src/print_graph.c (print_actions): Remove dead code.
17381
17382 2001-12-27 Akim Demaille <akim@epita.fr>
17383
17384 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17385 `$n' and `@n'.
17386
17387 2001-12-27 Akim Demaille <akim@epita.fr>
17388
17389 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17390 (build_relations): Adjust.
17391
17392 2001-12-27 Akim Demaille <akim@epita.fr>
17393
17394 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17395 duplication.
17396
17397 2001-12-27 Akim Demaille <akim@epita.fr>
17398
17399 * src/reader.c (packgram): Catch nitems overflows.
17400
17401 2001-12-27 Akim Demaille <akim@epita.fr>
17402
17403 * src/files.c, src/files.h (guard_obstack): Remove.
17404 * src/output.c (output): Adjust.
17405 * src/reader.c (parse_braces): New, factoring...
17406 (copy_action, copy_guard): these two which are renamed as...
17407 (parse_action, parse_guard): these.
17408 As a voluntary consequence, using braces around guards is now
17409 mandatory.
17410
17411 2001-12-27 Akim Demaille <akim@epita.fr>
17412
17413 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17414 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17415 members.
17416 (symbol_list_new): Adjust.
17417 (copy_action): action_line is the first line, not the last.
17418 (copy_guard): Just as for actions, store the `action' only, not
17419 the switch/case/break flesh.
17420 Don't parse the user action that might follow the guard, let...
17421 (readgram): do it, i.e., now, there can be an action after a
17422 guard.
17423 In other words the guard is just explicitly optional.
17424 (packgram): Adjust.
17425 * src/output.c (guards_output): New.
17426 (output_parser): Call it when needed.
17427 (output): Also free the guard and attrs obstacks.
17428 * src/files.c, src/files.h (obstack_save): Remove.
17429 (output_files): Remove.
17430 As a result, if one needs the former `.act' file, using an
17431 appropriate skeleton which requires actions and guards is now
17432 required.
17433 * src/main.c (main): Adjust.
17434 * tests/semantic.at: New.
17435 * tests/regression.at: Use `input.y' as input file name.
17436 Avoid 8+3 problems by requiring input.c when the test needs the
17437 parser.
17438
17439 2001-12-27 Akim Demaille <akim@epita.fr>
17440
17441 * src/reader.c (symbol_list_new): Be sure to initialize all the
17442 fields.
17443
17444 2001-12-27 Akim Demaille <akim@epita.fr>
17445
17446 All the hacks using a final pseudo state are now useless.
17447
17448 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17449 * src/lalr.c (nLA): New.
17450 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17451 instead of lookaheadsp from the pseudo state (nstate + 1).
17452
17453 2001-12-27 Akim Demaille <akim@epita.fr>
17454
17455 * src/output.c (action_row, token_actions): Use a state_t instead
17456 of a integer, and nlookaheads instead of the following state's
17457 lookaheadsp.
17458
17459 2001-12-27 Akim Demaille <akim@epita.fr>
17460
17461 * src/conflicts.c (log_resolution, flush_shift)
17462 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17463 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17464 (conflicts_print, print_reductions): Use a state_t instead of an
17465 integer when referring to a state.
17466 As much as possible, depend upon nlookaheads, instead of the
17467 `lookaheadsp' member of the following state (since lookaheads of
17468 successive states are successive, the difference between state n + 1
17469 and n served as the number of lookaheads for state n).
17470 * src/lalr.c (add_lookback_edge): Likewise.
17471 * src/print.c (print_core, print_actions, print_state)
17472 (print_results): Likewise.
17473 * src/print_graph.c (print_core, print_actions, print_state)
17474 (print_graph): Likewise.
17475 * src/conflicts.h: Adjust.
17476
17477 2001-12-27 Akim Demaille <akim@epita.fr>
17478
17479 * src/bison.hairy: Formatting/comment changes.
17480 ANSIfy.
17481 Remove `register' indications.
17482 Add plenty of `static'.
17483
17484 2001-12-27 Akim Demaille <akim@epita.fr>
17485
17486 * src/output.c (prepare): Drop the muscle `ntbase' which
17487 duplicates ntokens.
17488 * src/bison.simple: Formatting/comment changes.
17489 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17490 is an undocumented synonym.
17491
17492 2001-12-22 Akim Demaille <akim@epita.fr>
17493
17494 * src/output.c (output_table_data): Change the prototype to use
17495 `int' for array ranges: some invocations do pass an int, not a
17496 short.
17497 Reported by Wayne Green.
17498
17499 2001-12-22 Akim Demaille <akim@epita.fr>
17500
17501 Some actions of web2c.y are improperly triggered.
17502 Reported by Mike Castle.
17503
17504 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17505 * tests/regression.at (Web2c): Rename as...
17506 (Web2c Report): this.
17507 (Web2c Actions): New.
17508
17509 2001-12-22 Akim Demaille <akim@epita.fr>
17510
17511 Reductions in web2c.y are improperly reported.
17512 Reported by Mike Castle.
17513
17514 * src/conflicts.c (print_reductions): Fix.
17515 * tests/regression.at (Web2c): New.
17516
17517 2001-12-18 Akim Demaille <akim@epita.fr>
17518
17519 Some host fail on `assert (!"foo")', which expands to
17520 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17521 Reported by Nelson Beebee.
17522
17523 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17524 `#define it_succeeded 0' and `assert (it_succeeded)'.
17525
17526 2001-12-17 Marc Autret <autret_m@epita.fr>
17527
17528 * src/bison.simple: Don't hard code the skeleton line and filename.
17529 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17530 New line counter 'skeleton_line' (skeleton-line muscle).
17531
17532 2001-12-17 Paul Eggert <eggert@twinsun.com>
17533
17534 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17535 YYDEBUG must be defined to a nonzero value.
17536
17537 * src/bison.simple (yytname): Do not assume that the user defines
17538 YYDEBUG to a properly parenthesized expression.
17539
17540 2001-12-17 Akim Demaille <akim@epita.fr>
17541
17542 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17543 nlookaheads is a new member.
17544 Adjust all users.
17545 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17546 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17547 state.
17548
17549 2001-12-17 Akim Demaille <akim@epita.fr>
17550
17551 * src/files.h, src/files.c (open_files, close_files): Remove.
17552 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17553 let...
17554 * src/reader.c (reader): Do it.
17555
17556 2001-12-17 Akim Demaille <akim@epita.fr>
17557
17558 * src/conflicts.c (print_reductions): Formatting changes.
17559
17560 2001-12-17 Akim Demaille <akim@epita.fr>
17561
17562 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17563 (flush_reduce): New.
17564 (resolve_sr_conflict): Adjust.
17565
17566 2001-12-17 Akim Demaille <akim@epita.fr>
17567
17568 * src/output.c (output_obstack): Be static and rename as...
17569 (format_obstack): this, to avoid any confusion with files.c's
17570 output_obstack.
17571 * src/reader.h (muscle_obstack): Move to...
17572 * src/output.h: here, since it's defined in output.c.
17573
17574 2001-12-17 Akim Demaille <akim@epita.fr>
17575
17576 * src/output.c (action_row, save_column, default_goto)
17577 (sort_actions, matching_state, pack_vector): Better variable
17578 locality.
17579
17580 2001-12-17 Akim Demaille <akim@epita.fr>
17581
17582 * src/output.c: Various formatting changes.
17583
17584 2001-12-17 Akim Demaille <akim@epita.fr>
17585
17586 * src/files.c (output_files): Free the output_obstack.
17587 * src/main.c (main): Call print and print_graph conditionally.
17588 * src/print.c (print): Work unconditionally.
17589 * src/print_graph.c (print_graph): Work unconditionally.
17590 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17591
17592 2001-12-16 Marc Autret <autret_m@epita.fr>
17593
17594 * src/output.c (actions_output): Fix. When we use %no-lines,
17595 there is one less line per action.
17596
17597 2001-12-16 Marc Autret <autret_m@epita.fr>
17598
17599 * src/bison.simple: Remove a useless #line directive.
17600 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17601 * src/output.c (get_lines_number): New.
17602 (output_parser): Adjust, now takes care about the lines of a
17603 output muscles.
17604 Fix line numbering.
17605 (actions_output): Computes the number of lines taken by actions.
17606 (output_master_parser): Insert new skeleton which is the name of
17607 the output parser file name.
17608
17609 2001-12-15 Marc Autret <autret_m@epita.fr>
17610
17611 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17612
17613 2001-12-15 Marc Autret <autret_m@epita.fr>
17614
17615 * src/output.c (output_gram): Keep track of the hairy one.
17616
17617 2001-12-15 Akim Demaille <akim@epita.fr>
17618
17619 Make `make distcheck' work.
17620
17621 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17622 system.h which uses libgettext.h.
17623
17624 2001-12-15 Akim Demaille <akim@epita.fr>
17625
17626 * src/nullable.c (set_nullable): Useless rules must be skipped,
17627 otherwise, since we range over their symbols, we might look at a
17628 nonterminal which no longer ``exists'', i.e., it is not counted in
17629 `nvars', hence we overflow our arrays.
17630
17631 2001-12-15 Akim Demaille <akim@epita.fr>
17632
17633 The header can also be produced directly, without any obstack!
17634 Yahoo!
17635
17636 * src/files.c, src/files.h (defines_obstack): Remove.
17637 (compute_header_macro): Global.
17638 (defines_obstack_save): Remove.
17639 * src/reader.c (parse_union_decl): No longer output to
17640 defines_obstack: its content can be found in the `stype' muscle
17641 anyway.
17642 (output_token_translations): Merge into...
17643 (symbols_output): this.
17644 Rename as...
17645 (symbols_save): this.
17646 (reader): Adjust.
17647 * src/output.c (header_output): New.
17648 (output): Call it.
17649
17650 2001-12-15 Akim Demaille <akim@epita.fr>
17651
17652 * src/reader.c (parse_union_decl): Instead of handling two obstack
17653 simultaneously, use one to define the `stype' muscle, and use the
17654 value of the latter to fill defines_obstack.
17655 (copy_comment): Remove.
17656 (copy_comment2): Work for a single obstack.
17657 Rename as...
17658 (copy_comment): this.
17659
17660 2001-12-15 Akim Demaille <akim@epita.fr>
17661
17662 * src/lex.c, src/lex.h (xgetc): No longer static.
17663 * src/reader.c (parse_union_decl): Revamp.
17664
17665 2001-12-15 Akim Demaille <akim@epita.fr>
17666
17667 Still making progress in separating Bison into (i) input, (ii)
17668 process, (iii) output: now we can directly output the parser file
17669 without using table_obstack at all.
17670
17671 * src/files.c, src/files.h (table_obstack): Bye bye.
17672 (parser_file_name): New.
17673 * src/files.c (compute_output_file_names): Compute it.
17674 * src/output.c (actions_output, output_parser)
17675 (output_master_parser): To a file instead of an obstack.
17676
17677 2001-12-15 Akim Demaille <akim@epita.fr>
17678
17679 Attach actions to rules, instead of pre-outputting them to
17680 actions_obstack.
17681
17682 * src/gram.h (rule_t): action and action_line are new members.
17683 * src/reader.c (symbol_list): Likewise.
17684 (copy_action): Save the actions within the rule.
17685 (packgram): Save them in rule_table.
17686 * src/output.c (actions_output): New.
17687 (output_parser): Use it on `%%actions'.
17688 (output_rule_data): Don't free rule_table.
17689 (output): Do it.
17690 (prepare): Don't save the `action' muscle.
17691 * src/bison.simple: s/%%action/%%actions/.
17692
17693 2001-12-15 Akim Demaille <akim@epita.fr>
17694
17695 * src/reader.c (copy_action): When --yacc, don't append a `;'
17696 to the user action: let it fail if lacking.
17697 Suggested by Arnold Robbins and Tom Tromey.
17698
17699 2001-12-14 Akim Demaille <akim@epita.fr>
17700
17701 * src/lex.c (literalchar): Simply return the char you decoded, non
17702 longer mess around with obstacks and int pointers.
17703 Adjust all callers.
17704
17705 2001-12-14 Akim Demaille <akim@epita.fr>
17706
17707 * src/lex.c (literalchar): Don't escape the special characters,
17708 just decode them, and keep them as char (before, eol was output as
17709 the 2 char string `\n' etc.).
17710 * src/output.c (output_rule_data): Use quotearg to output the
17711 token strings.
17712
17713 2001-12-13 Paul Eggert <eggert@twinsun.com>
17714
17715 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17716 Do not infringe on the global user namespace when using C++.
17717 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17718 All uses of `fprintf' and `stderr' changed.
17719
17720 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17721
17722 2001-12-13 Akim Demaille <akim@epita.fr>
17723
17724 The computation of nullable is broken: it doesn't handle empty
17725 RHS's properly.
17726
17727 * tests/torture.at (GNU AWK Grammar): New.
17728 * tests/sets.at (Nullable): New.
17729 * src/nullable.c (set_nullable): Instead of blindly looping over
17730 `ritems', loop over the rules, and then over their rhs's.
17731
17732 Work around Autotest bugs.
17733
17734 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17735 frame, because Autotest understand lines starting with a `+' as
17736 traces from the shell. Then, they are not processed properly.
17737 Admittedly an Autotest bug, but we don't have time to wait for
17738 Autotest to catch up.
17739 * tests/regression.at (Broken Closure): Adjust to the new table
17740 frames.
17741 Move to...
17742 * tests/sets.at: here.
17743
17744 2001-12-13 Akim Demaille <akim@epita.fr>
17745
17746 * src/closure.c (closure): Use nrules instead of playing tricks
17747 with BITS_PER_WORD.
17748
17749 2001-12-13 Akim Demaille <akim@epita.fr>
17750
17751 * src/print.c (print_actions): Output the handling of `$' as the
17752 traces do: shifting the token EOF. Before EOF was treated as a
17753 nonterminal.
17754 * tests/regression.at: Adjust some tests.
17755 * src/print_graph.c (print_core): Complete the set of items via
17756 closure. The next-to-final and final states are still unsatisfying,
17757 but that's to be addressed elsewhere.
17758 No longer output the rule numbers, but do output the state number.
17759 A single loop for the shifts + gotos is enough, but picked a
17760 distinct color for each.
17761 (print_graph): Initialize and finalize closure.
17762
17763 2001-12-13 Akim Demaille <akim@epita.fr>
17764
17765 * src/reader.c (readgram): Remove dead code, an strip useless
17766 braces.
17767 (get_type): Remove, unused.
17768
17769 2001-12-12 Akim Demaille <akim@epita.fr>
17770
17771 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17772 on that of lib/error.c.
17773
17774 2001-12-12 Akim Demaille <akim@epita.fr>
17775
17776 Some hosts don't like `/' in includes.
17777
17778 * src/system.h: Include libgettext.h without qualifying the path.
17779 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17780 $(top_srcdir).
17781
17782 2001-12-11 Marc Autret <autret_m@epita.fr>
17783
17784 * src/output.c (output_parser): Remove useless muscle.
17785
17786 2001-12-11 Marc Autret <autret_m@epita.fr>
17787
17788 * src/bison.simple: Remove #line just before %%epilogue. It
17789 is now handled in ...
17790 * src/reader.c (read_additionnal_code): Add the output of a
17791 #line for the epilogue.
17792
17793 2001-12-10 Marc Autret <autret_m@epita.fr>
17794
17795 * src/reader.c (copy_definition): Re-use CPP-outed code which
17796 replace precedent remove.
17797 * src/bison.simple: Remove #line before %%prologue because
17798 %%input-line is wrong at this time.
17799
17800 2001-12-10 Marc Autret <autret_m@epita.fr>
17801
17802 * src/reader.c (symbols_output): Clean up.
17803 * src/output.c (output_gram, output): Clean up.
17804
17805 2001-12-10 Akim Demaille <akim@epita.fr>
17806
17807 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17808 * src/LR0.c (set_state_table): here.
17809 * src/lalr.c (lalr): Call it.
17810
17811 2001-12-10 Akim Demaille <akim@epita.fr>
17812
17813 * src/state.h (shifts): Remove the `number' member: shifts are
17814 attached to state, hence no longer need to be labelled with a
17815 state number.
17816
17817 2001-12-10 Akim Demaille <akim@epita.fr>
17818
17819 Now that states have a complete set of members, the linked list of
17820 shifts is useless: just fill directly the state's shifts member.
17821
17822 * src/state.h (shifts): Remove the `next' member.
17823 * src/LR0.c (first_state, last_state): Remove.
17824 Adjust the callers.
17825 (augment_automaton): Don't look for the shifts that must be added
17826 a shift on EOF: it is those of the state we looked for! But now,
17827 since shifts are attached, it is no longer needed to looking
17828 merely by its id: its number.
17829
17830 2001-12-10 Akim Demaille <akim@epita.fr>
17831
17832 * src/LR0.c (augment_automaton): Better variable locality.
17833 Remove an impossible branch: if there is a state corresponding to
17834 the start symbol being shifted, then there is shift for the start
17835 symbol from the initial state.
17836
17837 2001-12-10 Akim Demaille <akim@epita.fr>
17838
17839 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17840 only when appropriate: when insert_start_shifting_state' is not
17841 invoked.
17842 * tests/regression.at (Rule Line Numbers): Adjust.
17843
17844 2001-12-10 Akim Demaille <akim@epita.fr>
17845
17846 * src/LR0.c (augment_automaton): Now that all states have shifts,
17847 merge the two cases addition shifts to the initial state.
17848
17849 2001-12-10 Akim Demaille <akim@epita.fr>
17850
17851 * src/lalr.c (set_state_table): Move to...
17852 * src/LR0.c: here.
17853 * src/lalr.c (lalr): Don't call it...
17854 * src/LR0.c (generate_states): do it.
17855 * src/LR0.h (first_state): Remove, only the table is used.
17856
17857 2001-12-10 Akim Demaille <akim@epita.fr>
17858
17859 * src/LR0.h (first_shift, first_reduction): Remove.
17860 * src/lalr.c: Don't use first_shift: find shifts through the
17861 states.
17862
17863 2001-12-10 Akim Demaille <akim@epita.fr>
17864
17865 * src/LR0.c: Attach shifts to states as soon as they are
17866 computed.
17867 * src/lalr.c (set_state_table): Instead of assigning shifts to
17868 state, just assert that the mapping was properly done.
17869
17870 2001-12-10 Akim Demaille <akim@epita.fr>
17871
17872 * src/LR0.c (insert_start_shift): Rename as...
17873 (insert_start_shifting_state): this.
17874 (insert_eof_shifting_state, insert_accepting_state): New.
17875 (augment_automaton): Adjust.
17876 Better locality of the variables.
17877 When looking if the start_symbol is shifted from the initial
17878 state, using `while (... symbol != start_symbol ...)' sounds
17879 better than `while (... symbol < start_symbol ...)': If fail
17880 to see how the order between symbols could be relevant!
17881
17882 2001-12-10 Akim Demaille <akim@epita.fr>
17883
17884 * src/getargs.h: Don't declare `spec_name_prefix' and
17885 `spec_file_prefix', declared by src/files.h.
17886 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17887 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17888 * src/output.c (prepare): Adjust.
17889 * src/reader.c (symbols_output): Likewise.
17890 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17891
17892 2001-12-10 Akim Demaille <akim@epita.fr>
17893
17894 * src/muscle_tab.c (muscle_init): NULL is a better default than
17895 `"0"'.
17896
17897 2001-12-10 Akim Demaille <akim@epita.fr>
17898
17899 * src/reader.c (reader): Calling symbols_output once is enough.
17900
17901 2001-12-10 Akim Demaille <akim@epita.fr>
17902
17903 Now that states have a complete set of members, the linked list of
17904 reductions is useless: just fill directly the state's reductions
17905 member.
17906
17907 * src/state.h (struct reductions): Remove member `number' and
17908 `next'.
17909 * src/LR0.c (first_reduction, last_reduction): Remove.
17910 (save_reductions): Don't link the new reductions, store them in
17911 this_state.
17912 * src/lalr.c (set_state_table): No need to attach reductions to
17913 states, it's already done.
17914 * src/output.c (output_actions): No longer free the shifts, then
17915 the reductions, then the states: free all the states and their
17916 members.
17917
17918 2001-12-10 Akim Demaille <akim@epita.fr>
17919
17920 * src/options.c (OPTN, DRTV, BOTH): New.
17921 (option_table): Use them.
17922
17923 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
17924 the job of system.h.
17925 * src/options.c: Don't include stdio.h and xalloc.h for the same
17926 reasons.
17927
17928 2001-12-10 Akim Demaille <akim@epita.fr>
17929
17930 * src/output.c (output, prepare): Make sure the values of the
17931 muscles `action' and `prologue' are 0-terminated.
17932
17933 2001-12-10 Akim Demaille <akim@epita.fr>
17934
17935 Clean up GCC warnings.
17936
17937 * src/reader.c (copy_action): `buf' is not used.
17938 (parse_skel_decl): Be static.
17939 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
17940 * src/options.h (create_long_option_table): Have a real prototype.
17941 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
17942 (hash_delete_at): Return const void *.
17943 Adjust casts to preserve the const.
17944
17945 2001-12-10 Akim Demaille <akim@epita.fr>
17946
17947 * configure.in: Require 2.52g.
17948 M4 is not needed, but AUTOM4TE is.
17949 * m4/m4.m4: Remove.
17950 * tests/Makefile.am: Adjust.
17951
17952 2001-12-10 Akim Demaille <akim@epita.fr>
17953
17954 One structure for states is enough, even though theoretically
17955 there are LR(0) states and LALR(1) states.
17956
17957 * src/lalr.h (state_t): Remove.
17958 (state_table): Be state_t **, not state_t *.
17959 * src/state.h (core, CORE_ALLOC): Rename as...
17960 (state_t, STATE_ALLOC): this.
17961 Add the LALR(1) members: shifts, reductions, errs.
17962 * src/LR0.c (state_table): Rename as...
17963 (state_hash): this, to avoid name clashes with the global
17964 `state_table'.
17965 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
17966 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
17967
17968 2001-12-10 Akim Demaille <akim@epita.fr>
17969
17970 Bison dumps core on bash.y.
17971 Reported by Pascal Bart.
17972
17973 * src/warshall.c (bitmatrix_print): New.
17974 (TC): Use it.
17975 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
17976 j must be the outer loop.
17977 * tests/regression.at (Broken Closure): New.
17978
17979 2001-12-05 Akim Demaille <akim@epita.fr>
17980
17981 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
17982 its argument.
17983 Reported by Peter Hamorsky.
17984
17985 2001-12-05 Akim Demaille <akim@epita.fr>
17986
17987 * src/conflicts.c (err_table): Remove.
17988 (resolve_sr_conflict): Adjust.
17989 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
17990 Rename as...
17991 (state_t.reductions, state_t.shifts): this.
17992
17993 2001-12-05 Akim Demaille <akim@epita.fr>
17994
17995 * src/reduce.c (reduce_grammar_tables): No longer disable the
17996 removal of useless rules via CPP but via `if (0)', so that the
17997 compiler still check the code is valid.
17998 For instance, it should have noticed `rline' no longer exists: use
17999 the `line' member of rule_t.
18000 * src/gram.c (dummy, rline): Remove, unused.
18001
18002 2001-12-05 Akim Demaille <akim@epita.fr>
18003
18004 * src/output.c (pack_vector): Use assert, not berror.
18005 * src/main.c (berror): Remove, unused.
18006
18007 2001-12-05 Akim Demaille <akim@epita.fr>
18008
18009 New experimental feature: if --verbose --trace output all the
18010 items of a state, not only its kernel.
18011
18012 * src/print.c (print_core): If `trace_flag', then invoke closure
18013 before outputting the items of the state (print_core is no longer
18014 a correct name them).
18015 (print_results): Invoke new_closure/free_closure if needed.
18016
18017 2001-12-05 Akim Demaille <akim@epita.fr>
18018
18019 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18020 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18021 (nitemset): for consistency with the rest of the project.
18022
18023 2001-12-05 Akim Demaille <akim@epita.fr>
18024
18025 * src/closure.c (print_closure): Improve.
18026 (closure): Use it for printing input and output.
18027
18028 2001-12-05 Akim Demaille <akim@epita.fr>
18029
18030 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18031 indexed by nonterminals.
18032
18033 2001-12-05 Akim Demaille <akim@epita.fr>
18034
18035 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18036 what it was!).
18037 * src/warshall.h: Remove accidental duplication of the content.
18038
18039 2001-12-05 Akim Demaille <akim@epita.fr>
18040
18041 * src/closure.c (set_fderives): De-obfuscate.
18042
18043 2001-12-05 Akim Demaille <akim@epita.fr>
18044
18045 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18046
18047 2001-12-05 Akim Demaille <akim@epita.fr>
18048
18049 * src/closure.c (set_firsts): De-obfuscate.
18050
18051 2001-12-05 Akim Demaille <akim@epita.fr>
18052
18053 * src/output.c (action_row): De-obfuscate
18054 using the good o' techniques: arrays not pointers, variable
18055 locality, BITISSET, RESETBIT etc.
18056
18057 2001-12-05 Akim Demaille <akim@epita.fr>
18058
18059 Pessimize the code to simplify it: from now on, all the states
18060 have a valid SHIFTS, which NSHIFTS is possibly 0.
18061
18062 * src/LR0.c (shifts_new): Be global and move to..
18063 * src/state.c, src/state.h: here.
18064 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18065 * src/print_graph: Adjust.
18066
18067 2001-12-05 Akim Demaille <akim@epita.fr>
18068
18069 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18070 * src/conflicts.c: Use it.
18071 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18072 incorrectly ``simplified''.
18073
18074 2001-12-05 Akim Demaille <akim@epita.fr>
18075
18076 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18077 using the good o' techniques: arrays not pointers, variable
18078 locality, BITISSET, RESETBIT etc.
18079
18080 2001-12-05 Akim Demaille <akim@epita.fr>
18081
18082 * src/state.h (SHIFT_SYMBOL): New.
18083 * src/conflicts.c: Use it to deobfuscate.
18084
18085 2001-12-05 Akim Demaille <akim@epita.fr>
18086
18087 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18088 (print_reductions): De-obfuscate using the good o' techniques:
18089 arrays not pointers, variable locality, BITISSET.
18090
18091 2001-12-05 Akim Demaille <akim@epita.fr>
18092
18093 * src/conflicts.c (print_reductions): Arrays, not pointers.
18094 Use BITISSET.
18095
18096 2001-12-05 Akim Demaille <akim@epita.fr>
18097
18098 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18099
18100 2001-12-05 Akim Demaille <akim@epita.fr>
18101
18102 * src/conflicts.c (print_reductions): Improve variable locality.
18103
18104 2001-12-05 Akim Demaille <akim@epita.fr>
18105
18106 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18107
18108 2001-12-05 Akim Demaille <akim@epita.fr>
18109
18110 * src/conflicts.c (print_reductions): Improve variable locality.
18111
18112 2001-12-05 Akim Demaille <akim@epita.fr>
18113
18114 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18115 * src/lalr.c: Use them.
18116
18117 2001-12-05 Akim Demaille <akim@epita.fr>
18118
18119 * src/LR0.c (augment_automaton): Formatting changes.
18120 Better variable locality.
18121
18122 2001-12-05 Akim Demaille <akim@epita.fr>
18123
18124 * src/lalr.c (matrix_print): New.
18125 (transpose): Use it.
18126 Use arrays instead of pointers.
18127
18128 2001-12-05 Akim Demaille <akim@epita.fr>
18129
18130 * src/lalr.c (maxrhs): Move to...
18131 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18132 * src/lalr.c (build_relations): Adjust.
18133
18134 2001-12-05 Akim Demaille <akim@epita.fr>
18135
18136 * src/lalr.c (transpose): Free the memory allocated to the
18137 argument, as it is replaced by the results by the unique caller.
18138 (build_relations): Merely invoke transpose: it handles the memory
18139 deallocation.
18140 Improve variable locality.
18141 Avoid variables used as mere abbreviations.
18142 (compute_lookaheads): Use arrays instead of pointers.
18143
18144 2001-12-05 Akim Demaille <akim@epita.fr>
18145
18146 * src/lalr.c (initialize_F): Improve variable locality.
18147 Avoid variables used as mere abbreviations.
18148
18149 2001-12-05 Akim Demaille <akim@epita.fr>
18150
18151 * src/derives.c (print_derives): Display the ruleno.
18152 * src/lalr.c (initialize_F, transpose): Better variable locality
18153 to improve readability.
18154 Avoid variables used as mere abbreviations.
18155
18156 2001-12-05 Akim Demaille <akim@epita.fr>
18157
18158 * src/lalr.c (traverse): Use arrays instead of pointers.
18159
18160 2001-12-05 Akim Demaille <akim@epita.fr>
18161
18162 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18163 the handling of squeue.
18164 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18165
18166 2001-12-05 Akim Demaille <akim@epita.fr>
18167
18168 Because useless nonterminals are now kept alive (instead of being
18169 `destroyed'), we now sometimes examine them, and store information
18170 related to them. Hence we need to know their number, and adjust
18171 memory allocations.
18172
18173 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18174 static.
18175 * src/LR0.c (allocate_itemsets): The memory allocated to
18176 `symbol_count' was used for two different purpose: once to count
18177 the number of occurrences of each symbol, and later reassigned to
18178 `shift_symbol', containing the symbol that can be shifted from a
18179 given state.
18180 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18181 only, and...
18182 (new_itemsets): Allocate `shift_symbol' here.
18183 (allocate_itemsets): symbol_count includes useless nonterminals.
18184 Make room for them.
18185 (free_storage): Use `free', not `XFREE', for pointers that cannot
18186 be null.
18187
18188 2001-12-05 Akim Demaille <akim@epita.fr>
18189
18190 * src/nullable.c (set_nullable): Deobfuscate the handling of
18191 ritem.
18192 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18193
18194 2001-12-05 Akim Demaille <akim@epita.fr>
18195
18196 * src/gram.c, src/gram.h (ritem_print): New.
18197 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18198 (This useless function was defined only to work around VMS linkers
18199 that can't handle compilation units with variables only).
18200 * src/reduce.c (dump_grammar): Use it to trace the construction of
18201 ritem.
18202
18203 2001-12-04 Paul Eggert <eggert@twinsun.com>
18204
18205 * src/bison.simple (union yyalloc): Change member names
18206 to be the same as the stack names.
18207 (yyparse): yyptr is now union yyalloc *, not char *.
18208 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18209 and may generate better code on some machines.
18210 (yystpcpy): Use prototype if __STDC__ is defined, not just
18211 if __cplusplus is defined.
18212
18213 2001-11-30 Akim Demaille <akim@epita.fr>
18214
18215 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18216 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18217 Gettext doesn't compile cleanly, and dies with -Werror.
18218 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18219 Include WARNING_CFLAGS here.
18220 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18221 before being defined.
18222
18223 2001-11-27 Paul Eggert <eggert@twinsun.com>
18224
18225 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18226 First arg is int, not unsigned.
18227 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18228 (SIZE_MAX, UINT_MAX): New macros.
18229 (quotearg_n_options): Abort if N is negative.
18230 Avoid overflow check on hosts where size_t is 64 bits and int
18231 is 32 bits, as overflow is impossible there.
18232 Fix off-by-one typo that caused unnecessary reallocation.
18233
18234 2001-11-29 Paul Eggert <eggert@twinsun.com>
18235
18236 Name space cleanup in generated parser.
18237
18238 * doc/bison.texinfo (Bison Parser): Discuss system headers
18239 and their effect on the user name space.
18240
18241 * src/bison.simple:
18242 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18243 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18244 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18245
18246 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18247 on user names when possible.
18248
18249 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18250 Simplify test for whather <alloca.h> exists.
18251
18252 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18253
18254 (<stdio.h>): Include if YYDEBUG.
18255
18256 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18257 ! defined (yyoverflow) && ! defined (yymemcpy).
18258
18259 (yymemcpy, yyparse): Rename local variables as needed so that
18260 they all begin with 'yy'.
18261
18262 (yystrlen, yystpcpy): New functions.
18263
18264 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18265 All uses changed.
18266
18267 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18268 instead of relying on string.h functions. Use YYSTACK_ALLOC
18269 and YYSTACK_FREE instead of malloc and free.
18270
18271 2001-11-30 Akim Demaille <akim@epita.fr>
18272
18273 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18274 before their first uses.
18275 (YYBISON, YYPURE): Move to the top of the output.
18276
18277 2001-11-30 Akim Demaille <akim@epita.fr>
18278
18279 * tests/reduce.at (Useless Nonterminals): Fix.
18280
18281 2001-11-30 Akim Demaille <akim@epita.fr>
18282
18283 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18284 if body instead of `;' to pacify GCC's warnings.
18285
18286 2001-11-30 Akim Demaille <akim@epita.fr>
18287
18288 Instead of mapping the LHS of unused rules to -1, keep the LHS
18289 valid, but flag the rules as invalid.
18290
18291 * src/gram.h (rule_t): `useful' is a new member.
18292 * src/print.c (print_grammar): Adjust.
18293 * src/derives.c (set_derives): Likewise.
18294 * src/reader.c (packgram, reduce_output): Likewise.
18295 * src/reduce.c (reduce_grammar_tables): Likewise.
18296 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18297
18298 2001-11-30 Akim Demaille <akim@epita.fr>
18299
18300 * src/reduce.c (reduce_output): Formatting changes.
18301 * src/print.c (print_results, print_grammar): Likewise.
18302 * tests/regression.at (Rule Line Numbers)
18303 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18304
18305 2001-11-30 Akim Demaille <akim@epita.fr>
18306
18307 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18308 useless nonterminals, move them at the end of the symbol arrays.
18309 (reduce_output): Adjust.
18310 * tests/reduce.at (Useless Nonterminals): Adjust.
18311
18312 2001-11-30 Akim Demaille <akim@epita.fr>
18313
18314 * src/reduce.c: Various comment/formatting changes.
18315 (nonterminals_reduce): New, extracted from...
18316 (reduce_grammar_tables): here.
18317 (reduce_grammar): Call nonterminals_reduce.
18318
18319 2001-11-29 Paul Eggert <eggert@twinsun.com>
18320
18321 * src/bison.simple (YYSTACK_REALLOC): Remove.
18322 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18323 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18324 New macros.
18325 (union yyalloc): New type.
18326 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18327 an arbitrary restriction on hosts where size_t is wider than int.
18328
18329 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18330 a parser stack overflow. Allocate just one block of memory for all
18331 three stacks, instead of allocating three blocks; this typically is
18332 faster and reduces fragmentation.
18333
18334 Do not limit the number of items in the stack to a value that fits
18335 in 'int', as this is an arbitrary limit on hosts with 64-bit
18336 size_t and 32-bit int.
18337
18338 2001-11-29 Marc Autret <autret_m@epita.fr>
18339
18340 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18341 of defining YYERROR_VERBOSE.
18342 [AT_DATA]: $4 is now out of C declarations in the prologue.
18343
18344 2001-11-28 Marc Autret <autret_m@epita.fr>
18345
18346 * src/reader.c (parse_dquoted_param): New.
18347 (parse_skel_decl): Use it.
18348 * src/lex.h: Add its prototype.
18349 * src/lex.c (literalchar): Become not static.
18350
18351 2001-11-28 Marc Autret <autret_m@epita.fr>
18352
18353 * src/output.h: And put its extern declaration here.
18354 * src/output.c (error_verbose): Define here.
18355 (prepare): Echo name modification.
18356 * src/getargs.h: Clean its extern declaration.
18357 * src/getargs.c (error_verbose_flag): Remove.
18358 (getargs): Remove case 'e'.
18359 * src/options.c (option_table): 'error-verbose' is now seen as simple
18360 percent option.
18361 Include output.h.
18362
18363 * src/reader.c (read_declarations): Remove case tok_include.
18364 (parse_include_decl): Remove.
18365 * src/lex.h (token_t): Remove tok_include.
18366 * src/options.c (option_table): 'include' is now a simple command line
18367 option.
18368
18369 2001-11-28 Marc Autret <autret_m@epita.fr>
18370
18371 * src/bison.simple: Adjust muscle names.
18372 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18373 * src/output.c (prepare): s/_/-/ for the muscles names.
18374 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18375
18376 2001-11-28 Marc Autret <autret_m@epita.fr>
18377
18378 * src/bison.simple: Fix debug.
18379 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18380
18381 2001-11-28 Akim Demaille <akim@epita.fr>
18382
18383 * src/LR0.c (shifts_new): New.
18384 (save_shifts, insert_start_shift, augment_automaton): Use it.
18385
18386 2001-11-28 Akim Demaille <akim@epita.fr>
18387
18388 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18389 keep ruleno only.
18390
18391 2001-11-28 Akim Demaille <akim@epita.fr>
18392
18393 * src/closure.c (closure): Instead of looping over word in array
18394 then bits in words, loop over bits in array.
18395
18396 2001-11-28 Akim Demaille <akim@epita.fr>
18397
18398 * src/closure.c (closure): No longer optimize the special case
18399 where all the bits of `ruleset[r]' are set to 0, to make the code
18400 clearer.
18401
18402 2001-11-28 Akim Demaille <akim@epita.fr>
18403
18404 * src/closure.c (closure): `r' and `c' are new variables, used to
18405 de-obfuscate accesses to RULESET and CORE.
18406
18407 2001-11-28 Akim Demaille <akim@epita.fr>
18408
18409 * src/reduce.c (reduce_print): Use ngettext.
18410 (dump_grammar): Improve the trace accuracy.
18411
18412 2001-11-28 Akim Demaille <akim@epita.fr>
18413
18414 * src/reduce.c (dump_grammar): Don't translate trace messages.
18415
18416 2001-11-28 Akim Demaille <akim@epita.fr>
18417
18418 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18419 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18420 as all tags are free'ed afterwards.
18421 From Enrico Scholz.
18422
18423 2001-11-27 Paul Eggert <eggert@twinsun.com>
18424
18425 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18426 use alloca when we didn't want to, and vice versa.
18427
18428 2001-11-27 Marc Autret <autret_m@epita.fr>
18429
18430 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18431 initialization.
18432 * src/output.c (prepare): Remove its update.
18433
18434 2001-11-27 Marc Autret <autret_m@epita.fr>
18435
18436 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18437 Use %error-verbose.
18438
18439 2001-11-27 Marc Autret <autret_m@epita.fr>
18440
18441 * src/bison.simple: Remove YYERROR_VERBOSE using.
18442 Use %%error_verbose.
18443 (yyparse): Likewise.
18444 * src/output.c (prepare): Give its final value.
18445 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18446 * src/getargs.h: Add its extern declaration.
18447 * src/getargs.c (error_verbose_flag): New int.
18448 (getargs): Update to catch new case.
18449 * src/options.c (option_table): 'error-verbose' is a new option.
18450 (shortopts): Update.
18451
18452 2001-11-27 Akim Demaille <akim@epita.fr>
18453
18454 * src/system.h: Use intl/libgettext.h.
18455 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18456
18457 2001-11-27 Akim Demaille <akim@epita.fr>
18458
18459 * tests/torture.at (Exploding the Stack Size with Malloc):
18460 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18461
18462 2001-11-27 Akim Demaille <akim@epita.fr>
18463
18464 * src/files.c: Include error.h.
18465 Reported by Hans Aberg.
18466
18467 2001-11-26 Marc Autret <autret_m@epita.fr>
18468
18469 * src/reader.c (parse_include_decl): New, not yet implemented.
18470 (read_declarations): Add case tok_include.
18471 * src/getargs.h (include): Add its extern definition.
18472 * src/getargs.c (include): New const char *.
18473 (getargs): Add case '-I'.
18474 * src/options.c (option_table): Add include as command line and
18475 percent option.
18476 * src/lex.h (token_t): Add tok_include.
18477
18478 2001-11-26 Akim Demaille <akim@epita.fr>
18479
18480 * src/reader.c (readgram): Make sure rules for mid-rule actions
18481 have a lineno equal to that of their host rule.
18482 Reported by Hans Aberg.
18483 * tests/regression.at (Rule Line Numbers): New.
18484
18485 2001-11-26 Akim Demaille <akim@epita.fr>
18486
18487 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18488 size_ts.
18489
18490 2001-11-26 Akim Demaille <akim@epita.fr>
18491
18492 * src/complain.c, src/complain.h (error): Remove, provided by
18493 lib/error.[ch].
18494
18495 2001-11-26 Akim Demaille <akim@epita.fr>
18496
18497 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18498 issue an error message.
18499 * tests/regression.at (Invalid %directive): New.
18500 Reported by Hans Aberg.
18501
18502 2001-11-26 Akim Demaille <akim@epita.fr>
18503
18504 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18505 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18506
18507 2001-11-26 Akim Demaille <akim@epita.fr>
18508
18509 * src/conflicts.c (conflicts_print): Don't complain at all when
18510 there are no reduce/reduce conflicts, and as many shift/reduce
18511 conflicts as expected.
18512 * tests/regression.at (%expect right): Adjust.
18513
18514 2001-11-23 Akim Demaille <akim@epita.fr>
18515
18516 * lib/alloca.c: Update, from fileutils.
18517
18518 2001-11-23 Akim Demaille <akim@epita.fr>
18519
18520 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18521
18522 2001-11-23 Akim Demaille <akim@epita.fr>
18523
18524 * src/system.h: Include alloca.h.
18525 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18526
18527 2001-11-23 Akim Demaille <akim@epita.fr>
18528
18529 * src/print_graph.c (print_actions): Remove `rule', unused.
18530 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18531 pacify GCC's signed < unsigned warnings.
18532 * src/closure.c (itemsetsize): Likewise.
18533 * src/reader.c (symbol_list_new): Static.
18534
18535 2001-11-23 Akim Demaille <akim@epita.fr>
18536
18537 Attaching lineno to buckets is stupid, since only one copy of each
18538 symbol is kept, only the line of the first occurrence is kept too.
18539
18540 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18541 * src/reader.c (rline_allocated): Remove, unused.
18542 (symbol_list): Have a `line' member.
18543 (symbol_list_new): New.
18544 (readgram): Use it.
18545 * src/print.c (print_grammar): Output the rule line numbers.
18546 * tests/regression.at (Solved SR Conflicts)
18547 (Unresolved SR Conflicts): Adjust.
18548 Reported by Hans Aberg.
18549
18550 2001-11-22 Marc Autret <autret_m@epita.fr>
18551
18552 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18553
18554 2001-11-22 Marc Autret <autret_m@epita.fr>
18555
18556 * src/muscle_tab.c (muscle_init): Remove initialization of
18557 skeleton muscle.
18558 * src/output.c (output_master_parser): Do it here.
18559
18560 2001-11-20 Akim Demaille <akim@epita.fr>
18561
18562 * po/sv.po: New.
18563 * configure.in (ALL_LINGUAS): Adjust.
18564 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18565 longer contains strings to translate.
18566
18567 2001-11-19 Akim Demaille <akim@epita.fr>
18568
18569 * src/conflicts.c (conflicts_print): Add a missing \n.
18570
18571 2001-11-19 Akim Demaille <akim@epita.fr>
18572
18573 * src/nullable.c (nullable_print): New.
18574 (set_nullable): Call it when tracing.
18575 Better locality of variables.
18576
18577 2001-11-19 Akim Demaille <akim@epita.fr>
18578
18579 * src/print.c (print_actions): Better locality of variables.
18580
18581 2001-11-19 Akim Demaille <akim@epita.fr>
18582
18583 * src/derives.c (print_derives): Fix and enrich.
18584 * src/closure.c (print_fderives): Likewise.
18585
18586 2001-11-19 Akim Demaille <akim@epita.fr>
18587
18588 * src/closure.c (itemsetend): Remove, replaced with...
18589 (itemsetsize): new.
18590
18591 2001-11-19 Akim Demaille <akim@epita.fr>
18592
18593 * src/LR0.c (kernel_end): Remove, replaced with...
18594 (kernel_size): new.
18595
18596 2001-11-19 Akim Demaille <akim@epita.fr>
18597
18598 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18599 to clarify.
18600
18601 2001-11-19 Akim Demaille <akim@epita.fr>
18602
18603 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18604
18605 2001-11-19 Akim Demaille <akim@epita.fr>
18606
18607 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18608 trace messages.
18609 * src/LR0.c: Likewise.
18610 (allocate_itemsets): Use arrays instead of pointers to clarify.
18611
18612 2001-11-19 Akim Demaille <akim@epita.fr>
18613
18614 * src/getargs.c (statistics_flag): Replace with...
18615 (trace_flag): New.
18616 (longopts): Accept --trace instead of --statistics.
18617 * src/getargs.h, src/options.c: Adjust.
18618 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18619 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18620
18621 2001-11-19 Akim Demaille <akim@epita.fr>
18622
18623 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
18624 pointers to clarify the code.
18625 (save_reductions, save_shifts): Factor common parts of alternatives.
18626
18627 2001-11-19 Akim Demaille <akim@epita.fr>
18628
18629 * src/LR0.c (new_state, get_state): Complete TRACE code.
18630 * src/closure.c: Include `reader.h' to get `tags', needed by the
18631 trace code.
18632 Rename the conditional DEBUG as TRACE.
18633 Output consistently TRACEs to stderr, not stdout.
18634 * src/derives.c: Likewise.
18635 * src/reduce.c: (inaccessable_symbols): Using if is better style
18636 than goto.
18637 Use `#if TRACE' instead of `#if 0' for tracing code.
18638
18639 2001-11-19 Akim Demaille <akim@epita.fr>
18640
18641 * src/system.h (LIST_FREE, shortcpy): New.
18642 * src/LR0.c: Use them.
18643 * src/output.c (free_itemsets, free_reductions, free_shifts):
18644 Remove, replaced by LIST_FREE.
18645
18646 2001-11-19 Akim Demaille <akim@epita.fr>
18647
18648 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18649 (REDUCTIONS_ALLOC): New.
18650 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18651 allocation.
18652
18653 2001-11-19 Akim Demaille <akim@epita.fr>
18654
18655 * src/LR0.c (new_state): Complete trace code.
18656 * src/nullable.c (set_nullable): Don't translate traces.
18657
18658 2001-11-19 Akim Demaille <akim@epita.fr>
18659
18660 * src/print_graph.c (print_core): Better locality of variables.
18661 * src/print.c (print_core): Likewise.
18662
18663 2001-11-19 Akim Demaille <akim@epita.fr>
18664
18665 * src/vcg.c: You do the output, so you are responsible of the
18666 handling of VCG syntax, in particular: use quotearg.
18667 * src/print_graph.c: Don't.
18668 (print_actions): Don't output the actions as part of the nodes,
18669 since that's the job of the edges.
18670 (print_state): Don't output by hand: fill the node description,
18671 and ask for its output.
18672
18673 2001-11-19 Akim Demaille <akim@epita.fr>
18674
18675 * src/bison.simple (yyparse): When verbosely reporting an error,
18676 no longer put additional quotes around token names.
18677 * tests/calc.at: Adjust.
18678
18679 2001-11-19 Akim Demaille <akim@epita.fr>
18680
18681 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18682 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18683 * src/output.c: Adjust.
18684
18685 2001-11-19 Akim Demaille <akim@epita.fr>
18686
18687 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18688 (rule_t): this.
18689 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18690
18691 2001-11-19 Akim Demaille <akim@epita.fr>
18692
18693 * src/gram.h (rule_t): New.
18694 (rule_table): New.
18695 (rrhs, rlhs): Remove, part of state_t.
18696 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18697 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18698 * src/reader.c, src/reduce.c: Adjust.
18699
18700 2001-11-19 Akim Demaille <akim@epita.fr>
18701
18702 * src/reader.c (symbols_output): New, extracted from...
18703 (packsymbols): Here.
18704 (reader): Call it.
18705
18706 2001-11-19 Akim Demaille <akim@epita.fr>
18707
18708 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18709 (maxrhs): this new function.
18710
18711 2001-11-19 Akim Demaille <akim@epita.fr>
18712
18713 * src/lalr.c (F): New macro to access the variable F.
18714 Adjust.
18715
18716 2001-11-19 Akim Demaille <akim@epita.fr>
18717
18718 * src/lalr.h (LA): New macro to access the variable LA.
18719 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18720 * src/lalr.c: Adjust.
18721
18722 2001-11-19 Akim Demaille <akim@epita.fr>
18723
18724 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18725 (set_state_table): handle the `lookaheads' members.
18726
18727 2001-11-19 Akim Demaille <akim@epita.fr>
18728
18729 * src/lalr.h (lookaheads): Removed array, whose contents is now
18730 a member of...
18731 (state_t): this structure.
18732 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18733 Adjust.
18734
18735 2001-11-19 Akim Demaille <akim@epita.fr>
18736
18737 * src/lalr.h (consistent): Removed array, whose contents is now
18738 a member of...
18739 (state_t): this structure.
18740 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18741 Adjust.
18742
18743 2001-11-19 Akim Demaille <akim@epita.fr>
18744
18745 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18746 contents are now members of...
18747 (state_t): this structure.
18748 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18749 Adjust.
18750
18751 2001-11-19 Akim Demaille <akim@epita.fr>
18752
18753 * src/lalr.h (state_t): New.
18754 (state_table): Be a state_t * instead of a core **.
18755 (accessing_symbol): Remove, part of state_t.
18756 * src/lalr.c: Adjust.
18757 (set_accessing_symbol): Merge into...
18758 (set_state_table): this.
18759 * src/print_graph.c, src/conflicts.c: Adjust.
18760
18761 2001-11-14 Akim Demaille <akim@epita.fr>
18762
18763 * tests/calc.at, tests/output.at, tests/regression.at,
18764 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18765 now the tests are run in private dirs, therefore AC_CLEANUP and
18766 family can be simplified to 0-ary.
18767 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18768 use abs. path to find config.h.
18769 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18770 stderr, there can be way too much random noise.
18771 Instead pass -Werror to GCC and rely on the exit status.
18772 Reported by Wolfram Wagner.
18773
18774 2001-11-14 Akim Demaille <akim@epita.fr>
18775
18776 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18777 defined only if yyoverflow is defined, to avoid `warning: unused
18778 variable `yyvs1''.
18779 Reported by The Test Suite.
18780
18781 2001-11-14 Akim Demaille <akim@epita.fr>
18782
18783 * src/print.c: Include reduce.h.
18784 Reported by Hans Aberg.
18785
18786 2001-11-14 Akim Demaille <akim@epita.fr>
18787
18788 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18789 Revert a previous patch: these are really const.
18790 * src/conflicts.c (conflict_report): Additional useless pair of
18791 braces to pacify GCC's warnings for `if () if () {} else {}'.
18792 * src/lex.c (parse_percent_token): Replace equal_offset with
18793 arg_offset.
18794 arg is const.
18795 Be sure to strdup `arg' when used, since there is no reason for
18796 token_buffer not to change.
18797
18798 2001-11-14 Akim Demaille <akim@epita.fr>
18799
18800 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18801 definition.
18802 * src/main.c (main): Use them.
18803 Suggested by Hans Aberg.
18804
18805 2001-11-12 Akim Demaille <akim@epita.fr>
18806
18807 * src/system.h (ngettext): Now that we use ngettext, be sure to
18808 provide a default definition when NLS are not used.
18809
18810 2001-11-12 Akim Demaille <akim@epita.fr>
18811
18812 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18813 Use @kbd to denote user input.
18814 (Language and Grammar): ANSIfy the example.
18815 Adjust its layout for info/notinfo.
18816 (Location Tracking Calc): Output error messages to stderr.
18817 Output locations in a more GNUtically correct way.
18818 Fix a couple of Englishos.
18819 Adjust @group/@end group pairs.
18820
18821 2001-11-12 Akim Demaille <akim@epita.fr>
18822
18823 %expect was not functioning at all.
18824
18825 * src/conflicts.c (expected_conflicts): Set to -1.
18826 (conflict_report): Use ngettext.
18827 (conflicts_print): Check %expect and make its violation an error.
18828 * doc/bison.texinfo (Expect Decl): Adjust.
18829 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18830 * tests/regression.at (%expect not enough, %expect right)
18831 (%expect too much): New.
18832
18833 2001-11-12 Akim Demaille <akim@epita.fr>
18834
18835 * tests/regression.at (Conflicts): Rename as...
18836 (Unresolved SR Conflicts): this.
18837 (Solved SR Conflicts): New.
18838
18839 2001-11-12 Akim Demaille <akim@epita.fr>
18840
18841 * src/reduce.c (print_results): Rename as...
18842 (reduce_output): This.
18843 Output to OUT, passed as argument, instead of output_obstack.
18844 (dump_grammar): Likewise.
18845 (reduce_free): New.
18846 Also free V1.
18847 (reduce_grammar): No longer call reduce_output, since...
18848 * src/print.c (print_results): do it.
18849 * src/main.c (main): Call reduce_free;
18850
18851 2001-11-12 Akim Demaille <akim@epita.fr>
18852
18853 * src/conflicts.c (print_reductions): Accept OUT as argument.
18854 Output to it, not to output_obstack.
18855 * src/print.c (print_actions): Adjust.
18856
18857 2001-11-12 Akim Demaille <akim@epita.fr>
18858
18859 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18860 the result instead of using...
18861 (src_total, rrc_total, src_count, rrc_count): Remove.
18862 (any_conflicts): Remove.
18863 (print_conflicts): Split into...
18864 (conflicts_print, conflicts_output): New.
18865 * src/conflicts.h: Adjust.
18866 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
18867 * src/print.c (print_grammar): Issue `\n' between two rules.
18868 * tests/regression.at (Conflicts): New.
18869 Reported by Tom Lane.
18870
18871 2001-11-12 Akim Demaille <akim@epita.fr>
18872
18873 * tests/regression.at (Invalid input): Remove, duplicate with
18874 ``Invalid input: 1''.
18875
18876 2001-11-12 Akim Demaille <akim@epita.fr>
18877
18878 * tests/torture.at (AT_DATA_STACK_TORTURE)
18879 (Exploding the Stack Size with Alloca)
18880 (Exploding the Stack Size with Malloc): New.
18881
18882 2001-11-12 Akim Demaille <akim@epita.fr>
18883
18884 * src/bison.simple (YYSTACK_REALLOC): New.
18885 (yyparse) [!yyoverflow]: Use it and free the old stack.
18886 Reported by Per Allansson.
18887
18888 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
18889
18890 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18891 define CPP macro, which substitute YYSTYPE by yystype.
18892 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18893 with yyltype/YYLTYPE. This allows inclusion of the generated
18894 header within the parser if the compiler, such as GGC, accepts
18895 multiple equivalent #defines.
18896 From Akim.
18897
18898 2001-11-05 Akim Demaille <akim@epita.fr>
18899
18900 * src/reader.c (symbols_output): New, extracted from...
18901 (packsymbols): here.
18902 (reader): Adjust.
18903
18904 2001-11-05 Akim Demaille <akim@epita.fr>
18905
18906 * src/lex.c (parse_percent_token): s/quotearg/quote/.
18907
18908 2001-11-05 Akim Demaille <akim@epita.fr>
18909
18910 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
18911 pattern.
18912
18913 2001-11-05 Akim Demaille <akim@epita.fr>
18914
18915 * src/options.h (struct option_table_struct): set_flags is void*.
18916 * src/options.c (longopts): Support `--output' and `%output'.
18917 (usage): Adjust.
18918 * src/lex.h (tok_setopt): Remove, replaced with...
18919 (tok_intopt, tok_stropt): these new guys.
18920 * src/lex.c (getopt.h): Not needed.
18921 (token_buffer, unlexed_token_buffer): Not const.
18922 (percent_table): Promote `-' over `_' in directive names.
18923 Active `%name-prefix', `file-prefix', and `output'.
18924 (parse_percent_token): Accept possible arguments to directives.
18925 Promote `-' over `_' in directive names.
18926
18927 2001-11-04 Akim Demaille <akim@epita.fr>
18928
18929 * doc/bison.texinfo (Decl Summary): Split the list into
18930 `directives for grammars' and `directives for bison'.
18931 Sort'em.
18932 Add description of `%name-prefix', `file-prefix', and `output'.
18933 Promote `-' over `_' in directive names.
18934 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
18935 Simplify the description of `--name-prefix'.
18936 Promote `-' over `_' in directive names.
18937 Promote `--output' over `--output-file'.
18938 Fix the description of `--defines'.
18939 * tests/output.at: Exercise %file-prefix and %output.
18940
18941 2001-11-02 Akim Demaille <akim@epita.fr>
18942
18943 * doc/refcard.tex: Update.
18944
18945 2001-11-02 Akim Demaille <akim@epita.fr>
18946
18947 * src/symtab.h (SUNDEF): New.
18948 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
18949 stand for `uninitialized', instead of 0.
18950 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
18951 * src/lex.c (lex): Adjust.
18952
18953 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
18954 Number it 0.
18955 Let yylex return it instead of a plain 0.
18956 Reported by Dick Streefland.
18957
18958 2001-11-02 Akim Demaille <akim@epita.fr>
18959
18960 * tests/regression.at (Mixing %token styles): New test.
18961
18962 2001-11-02 Akim Demaille <akim@epita.fr>
18963
18964 * src/reader.c (parse_thong_decl): Formatting changes.
18965 (token_translations_init): New, extracted from...
18966 (packsymbols): Here.
18967 Adjust.
18968
18969 2001-11-01 Akim Demaille <akim@epita.fr>
18970
18971 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
18972 Check that `9foo.y' produces correct cpp guards.
18973 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
18974 guards.
18975 Reported by Wwp.
18976
18977 2001-11-01 Akim Demaille <akim@epita.fr>
18978
18979 * tests/regression.at (Invalid input: 2): New.
18980 * src/lex.c (unlexed_token_buffer): New.
18981 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
18982 too.
18983 Reported by Wwp.
18984
18985 2001-11-01 Akim Demaille <akim@epita.fr>
18986
18987 * tests/calc.at: Catch up with 1.30.
18988 * configure.in: Bump to 1.49a.
18989 Adjust to newer Autotest.
18990
18991 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
18992
18993 * src/conflicts.c: Move global variables rrc_total and src_total ...
18994 (print_conflicts): here.
18995 * src/output.c (output): Free global variable user_toknums.
18996 * src/lex.c (token_obstack): Become static.
18997
18998 2001-10-18 Akim Demaille <akim@epita.fr>
18999
19000 * tests/atlocal.in (GCC): Add.
19001 * tests/calc.at: s/m4_match/m4_bmatch/.
19002 s/m4_patsubst/m4_bpatsubst/.
19003 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19004 * configure.in: AC_SUBST(GCC).
19005
19006 2001-10-14 Marc Autret <autret_m@epita.fr>
19007
19008 * src/options.c (create_long_option_table): Fix.
19009
19010 2001-10-10 Akim Demaille <akim@epita.fr>
19011
19012 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19013
19014 2001-10-04 Akim Demaille <akim@epita.fr>
19015
19016 * src/reader.c (parse_union_decl): Push the caracters in
19017 union_obstack, not attrs_obstack.
19018
19019 2001-10-04 Akim Demaille <akim@epita.fr>
19020
19021 Merge in the branch 1.29.
19022
19023 * src/reader.c (packsymbols): Use a temporary obstack for
19024 `%%tokendef', since output_stack is already used elsewhere.
19025
19026 2001-10-02 Akim Demaille <akim@epita.fr>
19027
19028 Bump 1.29d.
19029
19030 2001-10-02 Akim Demaille <akim@epita.fr>
19031
19032 Version 1.29c.
19033
19034 2001-10-02 Akim Demaille <akim@epita.fr>
19035
19036 * tests/regression.at (Invalid CPP headers): New.
19037 From Alexander Belopolsky.
19038 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19039
19040 2001-10-02 Akim Demaille <akim@epita.fr>
19041
19042 * tests/regression.at (Invalid input): New.
19043 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19044 Reported by Shura.
19045
19046 2001-10-02 Akim Demaille <akim@epita.fr>
19047
19048 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19049
19050 2001-10-02 Akim Demaille <akim@epita.fr>
19051
19052 * src/output.c (output_parser): Assert `skeleton'.
19053 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19054 systems.
19055 From Shura.
19056
19057 2001-10-01 Marc Autret <autret_m@epita.fr>
19058
19059 * src/lex.h: Echo modifications.
19060 * src/lex.c (unlex): Parameter is now token_t.
19061 From Hans Aberg.
19062
19063 2001-10-01 Marc Autret <autret_m@epita.fr>
19064
19065 * src/main.c: Include lex.h.
19066 From Hans Aberg.
19067
19068 2001-09-29 Akim Demaille <akim@epita.fr>
19069
19070 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19071
19072 2001-09-28 Akim Demaille <akim@epita.fr>
19073
19074 * tests/testsuite.at: Update to newer Autotest.
19075 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19076
19077 2001-09-27 Akim Demaille <akim@epita.fr>
19078
19079 Position independent wrapper.
19080
19081 * tests/bison: Remove.
19082 * tests/bison.in: New.
19083 * configure.in: Adjust.
19084
19085 2001-09-27 Paul Eggert <eggert@twinsun.com>
19086
19087 Port quotearg fixes from tar 1.13.24.
19088
19089 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19090 tm to be declared.
19091 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19092 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19093
19094 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19095 * m4/mbrtowc.m4: New file.
19096 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19097 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19098
19099 2001-09-27 Akim Demaille <akim@epita.fr>
19100
19101 Bump to 1.29c.
19102
19103 2001-09-27 Akim Demaille <akim@epita.fr>
19104
19105 Version 1.29b.
19106
19107 2001-09-25 Akim Demaille <akim@epita.fr>
19108
19109 * src/system.h: Include `xalloc.h'.
19110 Remove it from the C files.
19111 * src/files.c (output_files): Free the obstacks.
19112 * src/lex.c (init_lex): Rename as...
19113 (lex_init): this.
19114 (lex_free): New.
19115 * src/main.c (main): Use it.
19116
19117 2001-09-24 Marc Autret <autret_m@epita.fr>
19118
19119 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19120 to output informations in fout (FILE*).
19121 (open_graph, close_graph): Likewise.
19122 (output_graph, output_edge, output_node): Likewise.
19123 * src/vcg.h: Update function prototypes.
19124 * src/print_graph.c (print_graph): Open output graph file.
19125 (print_actions): Adjust.
19126 * src/files.h: Remove extern declaration.
19127 * src/files.c: Remove graph_obstack declaration.
19128 (open_files): Remove graph_obstack initialization.
19129 (output_files): Remove graph_obstack saving.
19130
19131 2001-09-24 Marc Autret <autret_m@epita.fr>
19132
19133 * src/files.c (compute_output_file_names): Fix.
19134
19135 2001-09-24 Marc Autret <autret_m@epita.fr>,
19136 Akim Demaille <akim@epita.fr>
19137
19138 * src/reader.c (reader): Remove call to free_symtab ().
19139 * src/main.c (main): Call it here.
19140 Include symtab.h.
19141 * src/conflicts.c (initialize_conflicts): Rename as...
19142 (solve_conflicts): this.
19143 * src/print.c (print_core, print_actions, print_state)
19144 (print_grammar): Dump to a file instead a `output_obstack'.
19145 (print_results): Dump `output_obstack', and then proceed with the
19146 FILE *.
19147 * src/files.c (compute_output_file_names, close_files): New.
19148 (output_files): Adjust.
19149 * src/main.c (main): Adjust.
19150
19151 2001-09-23 Marc Autret <autret_m@epita.fr>
19152
19153 * src/files.c (compute_header_macro): Computes header macro name
19154 from spec_defines_file when given.
19155
19156 2001-09-23 Marc Autret <autret_m@epita.fr>
19157
19158 * src/files.c (output_files): Add default extensions.
19159
19160 2001-09-22 Akim Demaille <akim@epita.fr>
19161
19162 * src/conflicts.c (finalize_conflicts): Rename as...
19163 (free_conflicts): this.
19164
19165 2001-09-22 Akim Demaille <akim@epita.fr>
19166
19167 * src/gram.c (gram_free): Rename back as...
19168 (dummy): this.
19169 (output_token_translations): Free `token_translations'.
19170 * src/symtab.c (free_symtab): Free the tag field.
19171
19172 2001-09-22 Akim Demaille <akim@epita.fr>
19173
19174 Remove `translations' as it is always set to true.
19175
19176 * src/gram.h: Adjust.
19177 * src/reader.c (packsymbols, parse_token_decl): Adjust
19178 * src/print.c (print_grammar): Adjust.
19179 * src/output.c (output_token_translations): Adjust.
19180 * src/lex.c (lex): Adjust.
19181 * src/gram.c: Be sure the set pointers to NULL.
19182 (dummy): Rename as...
19183 (gram_free): this.
19184
19185 2001-09-22 Akim Demaille <akim@epita.fr>
19186
19187 * configure.in: Invoke AM_LIB_DMALLOC.
19188 * src/system.h: Use dmalloc.
19189 * src/LR0.c: Be sure to have pointers initialized to NULL.
19190 (allocate_itemsets): Allocate kernel_items only if needed.
19191
19192 2001-09-22 Akim Demaille <akim@epita.fr>
19193
19194 * configure.in: Bump to 1.29b.
19195 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19196 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19197 need xmalloc.c in calc.y.
19198 From Pascal Bart.
19199
19200 2001-09-21 Akim Demaille <akim@epita.fr>
19201
19202 Version 1.29a.
19203 * Makefile.maint, config/config.guess, config/config.sub,
19204 * config/missing: Update from masters.
19205 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19206 upon package.m4.
19207 * configure.in (ALL_LINGUAS): Add `tr'.
19208
19209 2001-09-21 Akim Demaille <akim@epita.fr>
19210
19211 * tests/Makefile.am (package.m4): Move to...
19212 ($(srcdir)/$(TESTSUITE)): here.
19213
19214 2001-09-20 Akim Demaille <akim@epita.fr>
19215
19216 * src/complain.c: No longer try to be standalone: use system.h.
19217 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19218 * src/complain.h: Likewise.
19219 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19220 Remove the unused variable `n'.
19221 From Albert Chin-A-Young.
19222
19223 2001-09-18 Marc Autret <autret_m@epita.fr>
19224
19225 * doc/bison.1: Update.
19226 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19227 descriptions.
19228 (Option Cross Key): Update.
19229 Add --graph.
19230
19231 2001-09-18 Marc Autret <autret_m@epita.fr>
19232
19233 * tests/regression.at: New test (comment in %union).
19234
19235 2001-09-18 Marc Autret <autret_m@epita.fr>
19236
19237 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19238 do that.
19239 Reported by Keith Browne.
19240
19241 2001-09-18 Marc Autret <autret_m@epita.fr>
19242
19243 * tests/output.at: Add tests for --defines and --graph.
19244
19245 2001-09-18 Marc Autret <autret_m@epita.fr>
19246
19247 * tests/output.at: Removes tests of %{header,src}_extension features.
19248
19249 2001-09-18 Akim Demaille <akim@epita.fr>
19250
19251 * tests/Makefile.am (package.m4): New.
19252 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19253 (_AT_CHECK_CALC_ERROR): Likewise.
19254 Factor the `, ' part of verbose error messages.
19255
19256 2001-09-18 Marc Autret <autret_m@epita.fr>
19257
19258 * src/getargs.c (longopts): Declare --defines and --graph as options
19259 with optional arguments.
19260 * src/files.h: Add extern declarations.
19261 * src/files.c (spec_graph_file, spec_defines_file): New.
19262 (output_files): Update.
19263 Remove CPP-outed code.
19264
19265 2001-09-18 Marc Autret <autret_m@epita.fr>
19266
19267 Turn off %{source,header}_extension feature.
19268
19269 * src/files.c (compute_exts_from_gf): Update.
19270 (compute_exts_from_src): Update.
19271 (output_files): CPP-out useless code.
19272 * src/files.h: Remove {header,source}_extension extern declarations.
19273 * src/reader.c (parse_dquoted_param): CPP-out.
19274 (parse_header_extension_decl): Remove.
19275 (parse_source_extension_decl): Remove.
19276 (read_declarations): Remove cases tok_{hdrext,srcext}.
19277 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19278 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19279
19280 2001-09-10 Akim Demaille <akim@epita.fr>
19281
19282 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19283 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19284 (AT_CHECK_OUTPUT): this.
19285 Merely check ls' exit status, its output is useless.
19286
19287 2001-09-10 Akim Demaille <akim@epita.fr>
19288
19289 * tests/calc.at: Use m4_match.
19290 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19291
19292 2001-09-10 Marc Autret <autret_m@epita.fr>,
19293 Akim Demaille <akim@epita.fr>
19294
19295 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19296 enum color_e.
19297 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19298 to `normal'.
19299 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19300 * src/lex.h: Adjust prototype.
19301 (token_t): Add `tok_undef'.
19302 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19303 (parse_percent_token): Now returns token_t.
19304 Add default statement in switch.
19305 (lex): Separate `c' as an input variable, from the token_t result
19306 part.
19307 (unlexed): Is a token_t.
19308
19309 2001-09-10 Akim Demaille <akim@epita.fr>
19310
19311 * configure.in: Bump to 1.29a.
19312
19313 2001-09-07 Akim Demaille <akim@epita.fr>
19314
19315 Version 1.29.
19316
19317 2001-08-30 Akim Demaille <akim@epita.fr>
19318
19319 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19320 * m4/atconfig.m4: Remove.
19321 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19322 * tests/bison: New.
19323 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19324 m4_if, m4_patsubst, and m4_regexp.
19325 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19326 `input' file instead of echo.
19327
19328 2001-08-29 Akim Demaille <akim@epita.fr>
19329
19330 Bump to 1.28e.
19331
19332 2001-08-29 Akim Demaille <akim@epita.fr>
19333
19334 Version 1.28d.
19335
19336 2001-08-29 Paul Eggert <eggert@twinsun.com>
19337
19338 * src/bison.simple (yyparse): Don't take the address of an
19339 item before the start of an array, as that doesn't conform to
19340 the C Standard.
19341
19342 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19343
19344 * doc/bison.texinfo (Location Tracking Calc): New node.
19345
19346 2001-08-29 Paul Eggert <eggert@twinsun.com>
19347
19348 * src/output.c (output): Do not define const, as this now
19349 causes more problems than it cures.
19350
19351 2001-08-29 Akim Demaille <akim@epita.fr>
19352
19353 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19354 the nodes.
19355 Be sure to tag the `detailmenu'.
19356
19357 2001-08-29 Akim Demaille <akim@epita.fr>
19358
19359 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19360 download in a tmp dir.
19361
19362 2001-08-28 Marc Autret <autret_m@epita.fr>
19363
19364 * config/depcomp: New file.
19365
19366 2001-08-28 Marc Autret <autret_m@epita.fr>
19367
19368 * doc/bison.1 (mandoc): Adjust.
19369 From Juan Manuel Guerrero.
19370
19371 2001-08-28 Marc Autret <autret_m@epita.fr>
19372
19373 * src/print_graph.c (print_state): Fix.
19374
19375 2001-08-27 Marc Autret <autret_m@epita.fr>
19376
19377 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19378 char * members.
19379 Echo modifications to the functions prototypes.
19380 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19381
19382 2001-08-27 Marc Autret <autret_m@epita.fr>
19383
19384 * src/vcg.c: Include `xalloc.h'.
19385 (add_colorentry): New.
19386 (add_classname): New.
19387 (add_infoname): New.
19388 * src/vcg.h: Add new prototypes.
19389
19390 2001-08-27 Akim Demaille <akim@epita.fr>
19391
19392 * Makefile.maint: Sync. again with CVS Autoconf.
19393
19394 2001-08-27 Akim Demaille <akim@epita.fr>
19395
19396 * Makefile.maint: Formatting changes.
19397 (po-update, cvs-update, update): New targets.
19398 (AMTAR): Remove.
19399
19400 2001-08-27 Akim Demaille <akim@epita.fr>
19401
19402 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19403 * Makefile.maint: Sync. with CVS Autoconf.
19404
19405 2001-08-27 Marc Autret <autret_m@epita.fr>
19406
19407 * src/vcg.h (struct infoname_s): New.
19408 (struct colorentry_s): New.
19409 (graph_s): New fields {vertical,horizontal}_order in structure.
19410 Add `infoname' field.
19411 Add `colorentry' field;
19412 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19413 (G_HORIZONTAL_ORDER): New.
19414 (G_INFONAME): New.
19415 (G_COLORENTRY): New.
19416 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19417 Add output of `infoname'.
19418 Add output of `colorentry'.
19419
19420 2001-08-27 Marc Autret <autret_m@epita.fr>
19421
19422 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19423 This one shadowed a global parameter.
19424
19425 2001-08-24 Marc Autret <autret_m@epita.fr>
19426
19427 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19428 instead of `unsigned'.
19429 (print_state): Do not call obstack_object_size () in obstack_grow ()
19430 to avoid macro variables shadowing.
19431
19432 2001-08-23 Marc Autret <autret_m@epita.fr>
19433
19434 * src/lex.c (percent_table): Typo: s/naem/name/.
19435 Add graph option.
19436 Normalize new options declarations.
19437
19438 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19439
19440 * tests/suite.at: Exercise %header_extension and %source_extension.
19441
19442 2001-08-16 Marc Autret <autret_m@epita.fr>
19443
19444 * src/reader.c (parse_dquoted_param): New.
19445 (parse_header_extension_decl): Use it.
19446 (parse_source_extension_decl): Likewise.
19447
19448 2001-08-16 Marc Autret <autret_m@epita.fr>
19449
19450 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19451 (get_xxxx_str): Use assert () instead of complain ().
19452 Remove return invokations in default cases.
19453 (get_decision_str): Modify default behaviour. Remove second argument.
19454 Echo modifications on calls.
19455 (output_graph): Fix.
19456
19457 2001-08-16 Marc Autret <autret_m@epita.fr>
19458
19459 * src/getargs.c (usage): Update with ``-g, --graph''.
19460
19461 2001-08-16 Marc Autret <autret_m@epita.fr>
19462
19463 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19464 (Option Cross Key): Likewise.
19465 * doc/bison.1: Update.
19466
19467 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
19468
19469 * src/output.c (output_master_parser): Don't finish action_obstack.
19470 (output_parser): Don't care about the muscle action, here.
19471 (prepare): Copy the action_obstack in the action muscle.
19472 (output): Free action_obstack.
19473
19474 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
19475
19476 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19477 will contain `%union' declaration.
19478 (parse_union_decl): Delete #line directive output.
19479 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19480 informations about %union.
19481 (parse_union_decl): Copy the union_obstack in the muscle stype.
19482 * src/bison.simple: Add new #line directive.
19483 Add typdef %%stype YYSTYPE.
19484
19485 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
19486
19487 * src/bison.simple: Add new `#line' directive.
19488
19489 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
19490
19491 * src/bison.simple: New `#line' directive.
19492 * src/output.c (output_parser): Support new dynamic muscle input_line.
19493
19494 2001-09-22 Marc Autret <autret_m@epita.fr>
19495
19496 * src/output.c (output_master_parser): New.
19497 (output_parser): Be more re-entrant.
19498
19499 2001-09-21 Marc Autret <autret_m@epita.fr>
19500
19501 * src/reader.c (copy_definition, parse_union_decl): Update and use
19502 `linef' muscle.
19503 (copy_action): Likewise.
19504 Use obstack_1grow ().
19505 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19506
19507 2001-09-21 Marc Autret <autret_m@epita.fr>
19508
19509 * src/options.c (option_table): Adjust.
19510 * src/lex.c (parse_percent_token): Fix.
19511
19512 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
19513
19514 * src/options.c (symtab.h): Include it, need by lex.h.
19515
19516 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
19517
19518 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19519 is now an option_table_struct*.
19520 (option_strcmp): New function option_strcmp.
19521 (parse_percent_token): Call option_strcmp.
19522 * src/getargs.c (xalloc.h, options.h): Include it.
19523 (getargs): Call create_long_option_table.
19524 (getargs): Free longopts at the end of the function.
19525 (shortopts): Move in options.c.
19526 * src/options.c (create_long_option_table): New function. Convert
19527 information from option_table to option structure.
19528 * src/reader.c (options.h): Include it.
19529
19530 * src/Makefile.am: Adjust.
19531 * src/options.c (option_table): Create from longopts and percent_table.
19532 * src/getargs.c (longopts): Delete.
19533 * src/lex.c (struct percent_table_struct): Delete.
19534 (percent_table): Delete.
19535 (options.h): Include it.
19536 * src/options.c: Create.
19537 * src/options.h: Create.
19538 Declare enum opt_access_e.
19539 Define struct option_table_struct.
19540
19541 2001-09-20 Marc Autret <autret_m@epita.fr>
19542
19543 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19544 sections of Bison.
19545
19546 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
19547
19548 * src/bison.simple: s/%%filename/%%skeleton.
19549 * src/muscle_tab.c (getargs.h): Include it.
19550 (muscle_init): Insert new muscle skeleton.
19551
19552 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
19553
19554 * src/output.c (output_parser): Delete unused variable actions_dumped.
19555
19556 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
19557
19558 * src/output.c (output): Delete call to reader_output_yylsp.
19559 * src/reader.c (reader): Likewise.
19560 * src/reader.h: Delete declaration of reader_output_yylsp.
19561
19562 2001-09-02 Marc Autret <autret_m@epita.fr>
19563
19564 * src/reader.c: Include muscle_tab.h.
19565 (parse_union_decl): Update.
19566 (parse_macro_decl): Rename parse_muscle_decl.
19567 Update to use renamed functions and variable.
19568 (read_declarations, copy_action, read_additionnal_code, : Updated
19569 with correct variables and functions names.
19570 (packsymbols, reader): Likewise.
19571
19572 * src/reader.h (muscle_obstack): Extern declaration update.
19573
19574 * src/output.c: Include muscle_tab.h
19575 In all functions using macro_insert, change by using muscle_insert ().
19576 (macro_obstack): Rename muscle_obstack.
19577 Echo modifications in the whole file.
19578 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19579 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19580 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19581
19582 * src/muscle_tab.h: Update double inclusion macros.
19583 (macro_entry_s): Rename muscle_entry_s.
19584 Update prototypes.
19585
19586 * src/muscle_tab.c: Include muscle_tab.h.
19587 Rename macro_tabble to muscle_table.
19588 (mhash1, mhash2, mcmp): Use muscle_entry.
19589 (macro_init): Rename muscle_init. Update.
19590 (macro_insert): Rename muscle_insert. Update.
19591 (macro_find): Rename muscle_find. Update.
19592
19593 * src/main.c: Include muscle_tab.h.
19594 (main): Call muscle_init ().
19595 * src/Makefile.am (bison_SOURCES): Echo modifications.
19596
19597 2001-09-02 Marc Autret <autret_m@epita.fr>
19598
19599 Now the files macro_tab.[ch] are named muscle_tab.[ch].
19600
19601 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19602
19603 2001-09-02 Marc Autret <autret_m@epita.fr>
19604
19605 * src/macrotab.c, src/macrotab.h: Remove.
19606
19607 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
19608
19609 * src/reader.c (copy_guard): Use muscle to specify the `#line'
19610 filename.
19611
19612 2001-09-01 Marc Autret <autret_m@epita.fr>
19613
19614 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19615 to an explicit value to activate the feature. We do it here.
19616
19617 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19618
19619 * src/output.c (prepare): Delete the `filename' muscule insertion.
19620 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19621 (parse_union_decl): Likewise.
19622 * src/macrotab.c (macro_init): Initialize filename by infile.
19623
19624 2001-08-31 Marc Autret <autret_m@epita.fr>
19625
19626 * src/bison.simple (YYLSP_NEEDED): New definition.
19627 * src/output.c (prepare): Add macro insertion of `locations_flag'
19628
19629 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19630
19631 * src/output.c (prepare): Delete insertion of previous muscles,
19632 and insert the `prefix' muscles.
19633 * src/macrotab.c (macro_init): Likewise.
19634 (macro_init): Initialization prefix directive by `yy'.
19635 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
19636 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19637 yylval, yydebug, yyerror, yynerrs and yyparse.
19638 New directive `#define' to substitute yydebug, ... with option
19639 name_prefix.
19640
19641 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19642
19643 * src/main.c (main): Standardize.
19644 * src/output.c (output_table_data, output_parser): Likewise.
19645 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19646
19647 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19648
19649 * src/reader.c (read_additionnal_code): Rename %%user_code to
19650 %%epilogue.
19651 * src/output.c (output): Rename %%declarations to %%prologue.
19652 * src/bison.simple: Echo modifications.
19653
19654 2001-08-31 Marc Autret <autret_m@epita.fr>
19655
19656 * src/reader.c (readgram): CleanUp.
19657 (output_token_defines): Likewise.
19658 (packsymbols): Likewise.
19659 (reader): Likewise.
19660 * src/output.c (output): CPP-out useless code.
19661
19662 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19663
19664 * src/reader.c (reader): Delete obsolete call to function
19665 output_trailers and output_headers.
19666 * src/output.h: Remove obsolete functions prototypes of output_headers
19667 and output_trailers.
19668
19669 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
19670
19671 * src/main.c: Include macrotab.h.
19672 * src/macrotab.h (macro_entry_s): Constify fields.
19673 Adjust functions prototypes.
19674 * src/macrotab.c (macro_insert): Constify key and value.
19675 (macro_find): Constify key.
19676 (macro_insert): Include 'xalloc.h'
19677 (macro_insert): Use XMALLOC.
19678 (macro_find): Constify return value.
19679 * src/output.c (output_table_data): Rename table to table_data.
19680 (output_parser): Constify macro_key, macro_value.
19681
19682 2001-08-30 Marc Autret <autret_m@epita.fr>
19683
19684 * src/reader.c (parse_skel_decl): New.
19685 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
19686 * src/lex.h (token_t): New token `tok_skel'.
19687 * src/lex.c (percent_table): Add skeleton option entry.
19688 Standardize.
19689
19690 2001-08-29 Marc Autret <autret_m@epita.fr>
19691
19692 * src/bison.simple: Add %%user_code directive at the end.
19693 * src/reader.c (read_additionnal_code): New.
19694 (reader): Use it.
19695 * src/output.c (output_program): Remove.
19696 (output): Update.
19697
19698 2001-08-28 Marc Autret <autret_m@epita.fr>
19699
19700 * src/output.c (output_actions): Clean up.
19701 (output_gram): CPP-out useless code.
19702 * src/reader.c (reader): Clean up, CPP-out useless code.
19703
19704 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
19705
19706 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
19707 directive.
19708 * src/bison.simple: Add `%%definitions'.
19709
19710 2001-08-28 Marc Autret <autret_m@epita.fr>
19711
19712 * config/depcomp: New file.
19713
19714 2001-08-27 Paul Eggert <eggert@twinsun.com>
19715
19716 * src/bison.simple (yyparse): Don't take the address of an
19717 item before the start of an array, as that doesn't conform to
19718 the C Standard.
19719
19720 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
19721
19722 * src/output.c (output): Remove the initialization of the macro
19723 obstack. It was done too late here.
19724
19725 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19726 completely wrong.
19727 (reader): Initialize the macro obstack here, since we need it to grow
19728 '%define' directives.
19729
19730 * src/reader.h: Declare the macro obstack as extern.
19731
19732 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
19733
19734 * src/output.c (output_parser): Fix. Store single '%' characters in
19735 the output obstack instead of throwing them away.
19736
19737 2001-08-27 Akim Demaille <akim@epita.fr>
19738
19739 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19740
19741 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19742
19743 * lib/Makefile.am: Adjust.
19744
19745 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19746
19747 * src/bison.simple: Update and add '%%' directives.
19748
19749 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19750
19751 * src/reader.c (reader): Remove calls to 'output_headers' and
19752 'output_trailers'. Remove some C output.
19753 (readgram): Disable a piece of code that was writing a default
19754 definition for 'YYSTYPE'.
19755 (reader_output_yylsp): Remove.
19756 (packsymbols): Output token defintions to a macro.
19757 (copy_definition): Disable C output.
19758
19759 * src/reader.c (parse_macro_decl): New function used to parse macro
19760 declarations.
19761 (copy_string2): Put the body of copy_string into this new function.
19762 Add a parameter to let the caller choose whether he wants to copy the
19763 string delimiters or not.
19764 (copy_string): Be a simple call to copy_string2 with the last argument
19765 bound to true.
19766 (read_declarations): Add case for macro definition.
19767 (copy_identifier): New.
19768 (parse_macro_decl): Read macro identifiers using copy_identifier
19769 rather than lex.
19770
19771 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19772
19773 * src/output.c (prepare): Add prefixed names.
19774 (output_parser): Output semantic actions.
19775 (output_parser): Fix bug on '%%line' directives.
19776
19777 * src/output.c (output_headers): Remove. The C code printed by this
19778 function should now be in the skeletons.
19779 (output_trailers): Remove.
19780 (output): Disable call to 'reader_output_yylsp'.
19781 (output_rule_data): Do not output tables to the table obstack.
19782
19783 * src/output.c: Remove some C dedicated output.
19784 Improve the use of macro and output obstacks.
19785 (output_defines): Remove.
19786
19787 * src/output.c (output_token_translations): Associate 'translate'
19788 table with a macro. No output to the table obstack.
19789 (output_gram): Same for 'rhs' and 'prhs'.
19790 (output_stos): Same for 'stos'.
19791 (output_rule_data): Same for 'r1' and 'r2'.
19792 (token_actions): Same for 'defact'.
19793 (goto_actions): Same for 'defgoto'.
19794 (output_base): Same for 'pact' and 'pgoto'.
19795 (output_table): Same for 'table'.
19796 (output_check): Same for 'check'.
19797
19798 * src/output.c (output_table_data): New function.
19799 (output_short_table): Remove.
19800 (output_short_or_char_table): Remove.
19801
19802 * src/output.c (output_parser): Replace most of the skeleton copy code
19803 with something new. Skeletons are now processed character by character
19804 rather than line by line, and Bison looks for '%%' macros. This is the
19805 first step in making Bison's output process (a lot) more flexible.
19806 (output_parser): Use the macro table.
19807
19808 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19809
19810 * src/main.c (main): Initialize the macro table.
19811
19812 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19813
19814 * src/lex.c (percent_table): Add tok_define.
19815 * src/lex.h: Add tok_define.
19816
19817 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19818
19819 * src/macrotab.c: New file.
19820 * src/macrotab.h: New file.
19821 * src/Makefile.am: Update.
19822
19823 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19824
19825 * lib/hash.c: New file.
19826 * lib/hash.h: New file.
19827 * lib/Makefile.am: Update.
19828
19829 2001-08-15 Akim Demaille <akim@epita.fr>
19830
19831 Version 1.28c.
19832
19833 2001-08-15 Marc Autret <autret_m@epita.fr>
19834
19835 * src/reader.c (readgram): Indent output macro YYSTYPE.
19836 (packsymbols): Likewise.
19837 (output_token_defines): Likewise.
19838 * src/files.c: Standardize.
19839 (compute_header_macro): New.
19840 (defines_obstack_save): New. Use compute_header_macro.
19841 (output_files): Update. Use defines_obstack_save.
19842
19843 2001-08-15 Akim Demaille <akim@epita.fr>
19844
19845 * doc/bison.texinfo (Table of Symbols): Document
19846 YYSTACK_USE_ALLOCA.
19847
19848 2001-08-15 Akim Demaille <akim@epita.fr>
19849
19850 * missing: Update from CVS Automake.
19851 * config/config.guess, config/config.sub, config/texinfo.tex:
19852 Update from gnu.org.
19853
19854 2001-08-15 Akim Demaille <akim@epita.fr>
19855
19856 * Makefile.maint: Sync with CVS Autoconf.
19857
19858 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
19859
19860 * doc/bison.texinfo: Include GNU Free Documentation License from
19861 `fdl.texi'.
19862 * doc/fdl.texi: Add to package.
19863
19864 2001-08-14 Marc Autret <autret_m@epita.fr>
19865
19866 Turn on %{source,header}_extension features.
19867
19868 * src/lex.c (percent_table): Un-CPP out header_extension and
19869 source_extension.
19870 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
19871 (compute_exts_from_src): Remove conditions. It restores priorities
19872 between options.
19873
19874 2001-08-14 Marc Autret <autret_m@epita.fr>
19875
19876 * src/files.c (compute_base_names): Add extensions computing when
19877 `--file-prefix' used.
19878 Standardize function calls.
19879
19880 2001-08-13 Marc Autret <autret_m@epita.fr>
19881
19882 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
19883 defining it (defined but null disables alloca).
19884
19885 2001-08-13 Marc Autret <autret_m@epita.fr>
19886
19887 * src/bison.simple (_yy_memcpy): CPP reformat.
19888
19889 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
19890
19891 * tests/atconfig.in (CPPFLAGS): Fix.
19892
19893 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
19894
19895 * doc/bison.texinfo: Include GNU General Public License from
19896 `gpl.texi'.
19897 * doc/gpl.texi: Add to package.
19898
19899 2001-08-10 Marc Autret <autret_m@epita.fr>
19900
19901 * src/print_graph.h: Fix.
19902 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
19903
19904 2001-08-10 Akim Demaille <akim@epita.fr>
19905
19906 * src/system.h: Provide default declarations for stpcpy, strndup,
19907 and strnlen.
19908
19909 2001-08-10 Robert Anisko <anisko_r@epita.fr>
19910
19911 * doc/bison.texinfo (Locations): Update @$ stuff.
19912
19913 2001-08-09 Robert Anisko <anisko_r@epita.fr>
19914
19915 * src/bison.simple (YYLLOC_DEFAULT): Update.
19916 (yyparse): Adjust.
19917
19918 2001-08-08 Marc Autret <autret_m@epita.fr>
19919
19920 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
19921 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
19922 Reported by Fabrice Bauzac.
19923
19924 2001-08-08 Marc Autret <autret_m@epita.fr>
19925
19926 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
19927 * src/vcg.c (output_node): Fix.
19928 * src/vcg.h: Cleanup.
19929 * src/print_graph.c: Add comments.
19930 (node_output_size): New global variable. Simplify the formatting of
19931 the VCG graph output.
19932 (print_actions): Unused code is now used. It notifies the final state
19933 and no action states in the VCG graph. It also give the reduce actions.
19934 The `shift and goto' edges are red and the `go to state' edges are
19935 blue.
19936 Get the current node name and node_obstack by argument.
19937 (node_obstack): New variable.
19938 (print_state): Manage node_obstack.
19939 (print_core): Use node_obstack given by argument.
19940 A node is not only computed here but in print_actions also.
19941 (print_graph): CPP out useless code instead of commenting it.
19942
19943 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
19944
19945 * tests/atconfig.in (CPPFLAGS): Fix.
19946
19947 2001-08-07 Akim Demaille <akim@epita.fr>
19948
19949 * src/print_graph.c (quote): New.
19950 (print_core): Use it.
19951
19952 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
19953
19954 * src/vcg.c (complain.h): Include it.
19955 Unepitaize `return' invocations.
19956 [NDEBUG] (main): Remove.
19957 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
19958 * src/files.c (open_files): Initialize graph_obstack.
19959 * src/print_graph.c (print_actions): CPP out useless code.
19960 (print_core): Don't output the last `\n' in labels.
19961 Use `quote'.
19962 * src/files.c (output_files): Output the VCG file.
19963 * src/main.c (main): Invoke print_graph ();
19964
19965 2001-08-06 Marc Autret <autret_m@epita.fr>
19966
19967 Automaton VCG graph output.
19968 Using option ``-g'' or long option ``--graph'', you can generate
19969 a gram_filename.vcg file containing a VCG description of the LALR (1)
19970 automaton of your grammar.
19971
19972 * src/main.c: Call to print_graph() function.
19973 * src/getargs.h: Update.
19974 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
19975 (graph_flag): New flag.
19976 (longopts): Update.
19977 (getargs): Add case `g'.
19978 * src/files.c (graph_obstack): New obstack struct.
19979 (open_files): Initialize new obstack.
19980 (output_files): Saves graph_obstack if required.
19981 * src/files.h (graph_obstack): New extern declaration.
19982 * src/Makefile.am: Add new source files.
19983
19984 2001-08-06 Marc Autret <autret_m@epita.fr>
19985
19986 * src/print_graph.c, src/print_graph.h (graph): New.
19987 * src/vcg.h: New file.
19988 * src/vcg.c: New file, VCG graph handling.
19989
19990 2001-08-06 Marc Autret <autret_m@epita.fr>
19991
19992 Add of %source_extension and %header_extension which specify
19993 the source or/and the header output file extension.
19994
19995 * src/files.c (compute_base_names): Remove initialisation of
19996 src_extension and header_extension.
19997 (compute_exts_from_gf): Update.
19998 (compute_exts_from_src): Update.
19999 (output_files): Update.
20000 * src/reader.c (parse_header_extension_decl): New.
20001 (parse_source_extension_decl): New.
20002 (read_declarations): New case statements for the new tokens.
20003 * src/lex.c (percent_table): Add entries for %source_extension
20004 and %header_extension.
20005 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20006
20007 2001-08-06 Marc Autret <autret_m@epita.fr>
20008
20009 * configure.in: Bump to 1.28c.
20010 * doc/bison.texinfo: Texinfo thingies.
20011
20012 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
20013
20014 * tests/atconfig.in (CPPFLAGS): Add.
20015 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20016
20017 2001-08-03 Akim Demaille <akim@epita.fr>
20018
20019 Version 1.28b.
20020
20021 2001-08-03 Akim Demaille <akim@epita.fr>
20022
20023 * tests/Makefile.am (check-local): Ship testsuite.
20024 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20025 Include `string.h'.
20026
20027 2001-08-03 Akim Demaille <akim@epita.fr>
20028
20029 * configure.in: Try using -Wformat when compiling.
20030
20031 2001-08-03 Akim Demaille <akim@epita.fr>
20032
20033 * configure.in: Bump to 1.28b.
20034
20035 2001-08-03 Akim Demaille <akim@epita.fr>
20036
20037 * src/complain.c: Adjust strerror_r portability issues.
20038
20039 2001-08-03 Akim Demaille <akim@epita.fr>
20040
20041 Version 1.28a.
20042
20043 2001-08-03 Akim Demaille <akim@epita.fr>
20044
20045 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20046 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20047 * src/getargs.c: Include complain.h.
20048 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20049 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20050
20051 2001-08-03 Akim Demaille <akim@epita.fr>
20052
20053 * src/reader.c (readgram): Display hidden chars in error messages.
20054
20055 2001-08-03 Akim Demaille <akim@epita.fr>
20056
20057 Update to gettext 0.10.39.
20058
20059 2001-08-03 Akim Demaille <akim@epita.fr>
20060
20061 * lib/strspn.c: New.
20062
20063 2001-08-01 Marc Autret <autret_m@epita.fr>
20064
20065 * doc/bison.texinfo: Update.
20066 * doc/bison.1 (mandoc): Update.
20067 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20068 * src/files.c: Support output files extensions computing.
20069 (src_extension): New static variable.
20070 (header_extension): New static variable.
20071 (tr): New function.
20072 (get_extension_index): New function, gets the index of an extension
20073 filename in a string.
20074 (compute_exts_from_gf): New function, computes extensions from the
20075 grammar file extension.
20076 (compute_exts_from_src): New functions, computes extensions from the
20077 C source file extension, file given by ``-o'' option.
20078 (compute_base_names): Update.
20079 (output_files): Update.
20080
20081 2001-08-01 Robert Anisko <anisko_r@epita.fr>
20082
20083 * doc/bison.texi: Document @$.
20084 (Locations): New section.
20085
20086 2001-07-18 Akim Demaille <akim@epita.fr>
20087
20088 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20089 * config/prev-version.txt, config/move-if-change: New.
20090 * Makefile.am: Adjust.
20091
20092 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
20093
20094 * src/bison.simple (yyparse): Suppress warning `comparaison
20095 between signed and unsigned'.
20096
20097 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
20098
20099 * src/getargs.h (raw_flag): Remove.
20100 * src/getargs.c: Die on `-r'/`--raw'.
20101 * src/lex.c (parse_percent_token): Die on `%raw'.
20102 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20103 * tests/calc.at: Suppress test with option `--raw'.
20104
20105 2001-07-14 Akim Demaille <akim@epita.fr>
20106
20107 * config/: New.
20108 * configure.in: Require Autoconf 2.50.
20109 Update to gettext 0.10.38.
20110
20111 2001-03-16 Akim Demaille <akim@epita.fr>
20112
20113 * doc/bison.texinfo: ANSIfy the examples.
20114
20115 2001-03-16 Akim Demaille <akim@epita.fr>
20116
20117 * getargs.c (skeleton): New variable.
20118 (longopts): --skeleton is a new option.
20119 (shortopts, getargs): -S is a new option.
20120 * getargs.h: Declare skeleton.
20121 * output.c (output_parser): Use it.
20122
20123 2001-03-16 Akim Demaille <akim@epita.fr>
20124
20125 * m4/strerror_r.m4: New.
20126 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20127 * lib/error.h, lib/error.c: Update.
20128
20129 2001-03-16 Akim Demaille <akim@epita.fr>
20130
20131 * src/getargs.c (longopts): Clean up.
20132
20133 2001-02-21 Akim Demaille <akim@epita.fr>
20134
20135 * src/reader.c (gensym): `gensym_count' is your own.
20136 Use a static buf to create the symbol name, as token_buffer is no
20137 longer a buffer.
20138
20139 2001-02-08 Akim Demaille <akim@epita.fr>
20140
20141 * src/conflicts.c (conflict_report): Be sure not to append to res
20142 between two calls, which could happen if both first sprintf were
20143 skipped, but not the first cp += strlen.
20144
20145 2001-02-08 Akim Demaille <akim@epita.fr>
20146
20147 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20148 New, from fileutils 4.0.37.
20149 * configure.in: Require Autoconf 2.49c. I took some time before
20150 making this decision. This is the only way out for portability
20151 issues in Bison, it would mean way too much duplicate effort to
20152 import in Bison features implemented in 2.49c since 2.13.
20153 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20154
20155 2001-02-02 Akim Demaille <akim@epita.fr>
20156
20157 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
20158 * lib/xalloc.h, lib/xmalloc.c: Update.
20159
20160 2001-01-19 Akim Demaille <akim@epita.fr>
20161
20162 Get rid of the ad hoc handling of token_buffer in the scanner: use
20163 the obstacks.
20164
20165 * src/lex.c (token_obstack): New.
20166 (init_lex): Initialize it. No longer call...
20167 (grow_token_buffer): this. Remove it.
20168 Adjust all the places which used it to use the obstack.
20169
20170 2001-01-19 Akim Demaille <akim@epita.fr>
20171
20172 * src/lex.h: Rename all the tokens:
20173 s/\bENDFILE\b/tok_eof/g;
20174 s/\bIDENTIFIER\b/tok_identifier/g;
20175 etc.
20176 Let them be enums, not #define, to ease debugging.
20177 Adjust all the code.
20178
20179 2001-01-18 Akim Demaille <akim@epita.fr>
20180
20181 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20182 * src/lex.c (maxtoken, grow_token_buffer): Static.
20183
20184 2001-01-18 Akim Demaille <akim@epita.fr>
20185
20186 Since we now use obstacks, more % directives can be enabled.
20187
20188 * src/lex.c (percent_table): Also accept `%yacc',
20189 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20190 `%debug'.
20191 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20192 instead of returning a token.
20193 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20194 * src/reader.c (read_declarations): Adjust.
20195 * src/files.c (open_files): Don't call `compute_base_names', don't
20196 compute `attrsfile' since they depend upon data which might be
20197 *in* the input file now.
20198 (output_files): Do it here.
20199 * src/output.c (output_headers): Document the fact that this patch
20200 introduces a guaranteed SEGV for semantic parsers.
20201 * doc/bison.texinfo: Document them.
20202 * tests/suite.at: Exercise these %options.
20203
20204 2000-12-20 Akim Demaille <akim@epita.fr>
20205
20206 Also handle the output file (--verbose) with obstacks.
20207
20208 * files.c (foutput): Remove.
20209 (output_obstack): New.
20210 Adjust all dependencies.
20211 * src/conflicts.c: Return a string.
20212 * src/system.h (obstack_grow_string): Rename as...
20213 (obstack_sgrow): this. Be ready to work with non literals.
20214 (obstack_fgrow4): New.
20215
20216 2000-12-20 Akim Demaille <akim@epita.fr>
20217
20218 * src/files.c (open_files): Fix the computation of short_base_name
20219 in the case of `-o foo.tab.c'.
20220
20221 2000-12-20 Akim Demaille <akim@epita.fr>
20222
20223 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20224 (copy_dollar): Now that everything uses obstacks, get rid of the
20225 FILE * parameters.
20226
20227 2000-12-20 Akim Demaille <akim@epita.fr>
20228
20229 * src/files.c (open_files): Actually the `.output' file is based
20230 on the short_base_name, not base_name.
20231 * tests/suite.at (Checking output file names): Adjust.
20232
20233 2000-12-20 Akim Demaille <akim@epita.fr>
20234
20235 * src/bison.s1: Remove, we now use directly...
20236 * src/bison.simple: this.
20237 * src/Makefile.am: Use pkgdata instead of data.
20238
20239 2000-12-20 Akim Demaille <akim@epita.fr>
20240
20241 * src/files.c (guard_obstack): New.
20242 (open_files): Initialize it.
20243 (output_files): Dump it...
20244 * src/files.h: Export it.
20245 * src/reader.c (copy_guard): Use it.
20246
20247 2000-12-19 Akim Demaille <akim@epita.fr>
20248
20249 * src/files.c (outfile, defsfile, actfile): Removed as global
20250 vars.
20251 (open_files): Don't compute them.
20252 (output_files): Adjust.
20253 (base_name, short_base_name): Be global.
20254 Adjust dependencies.
20255
20256 2000-12-19 Akim Demaille <akim@epita.fr>
20257
20258 * src/files.c (strsuffix): New.
20259 (stringappend): Be just like strcat but allocate.
20260 (base_names): Eve out from open_files.
20261 Try to simplify the rather hairy computation of base_name and
20262 short_base_name.
20263 (open_files): Use it.
20264 * tests/suite.at (Checking output file names): New test.
20265
20266 2000-12-19 Akim Demaille <akim@epita.fr>
20267
20268 * src/system.h (obstack_grow_literal_string): Rename as...
20269 (obstack_grow_string): this.
20270 * src/output.c (output_parser): Recognize `%% actions' instead of
20271 `$'.
20272 * src/bison.s1: s/$/%% actions/.
20273 * src/bison.hairy: Likewise.
20274
20275 2000-12-19 Akim Demaille <akim@epita.fr>
20276
20277 * src/output.c (output_parser): Compute the `#line' lines when
20278 there are.
20279 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20280 Suggested by Hans Aberg.
20281
20282 2000-12-19 Akim Demaille <akim@epita.fr>
20283
20284 Let the handling of the skeleton files be local to the procedures
20285 that use it.
20286
20287 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20288 longer static.
20289 (fparser, open_extra_files): Remove.
20290 (open_files, output_files): Don't take care of fparser.
20291 * src/files.h: Adjust.
20292 * src/output.c (output_parser): Open and close the file to the
20293 skeleton.
20294 * src/reader.c (read_declarations): When %semantic_parser, open
20295 fguard.
20296
20297 2000-12-19 Akim Demaille <akim@epita.fr>
20298
20299 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20300 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20301
20302 2000-12-19 Akim Demaille <akim@epita.fr>
20303
20304 * src/files.c (open_files): Yipee! We no longer need all the code
20305 looking for `/tmp' since we have no tmp file.
20306
20307 2000-12-19 Akim Demaille <akim@epita.fr>
20308
20309 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20310 New macros.
20311 * src/files.c (open_files): Less dependency on MSDOS etc.
20312
20313 2000-12-14 Akim Demaille <akim@epita.fr>
20314
20315 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20316 Provide a default definition.
20317 Use it when executing the default @ action.
20318 * src/reader.c (reader_output_yylsp): No longer include
20319 `timestamp' and `text' in the default YYLTYPE.
20320
20321 2000-12-12 Akim Demaille <akim@epita.fr>
20322
20323 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20324 (copy_guard): Quote the file names.
20325 Reported by Laurent Mascherpa.
20326
20327 2000-12-12 Akim Demaille <akim@epita.fr>
20328
20329 * src/output.c (output_headers, output_program, output): Be sure
20330 to escape special characters when outputting filenames.
20331 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20332 (output_headers): Don't depend on them, Use ACTSTR.
20333
20334 2000-11-17 Akim Demaille <akim@epita.fr>
20335
20336 * lib/obstack.h: Formatting changes.
20337 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20338 prevents type checking.
20339 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20340 cast the value to (void *): assigning a `foo *' to a `void *'
20341 variable is valid.
20342 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20343 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20344 append characters.
20345
20346 2000-11-17 Akim Demaille <akim@epita.fr>
20347
20348 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20349 as...
20350 (suite.m4, regression.m4, calc.m4): these.
20351 * tests/atgeneral.m4: Update from CVS Autoconf.
20352
20353 2000-11-17 Akim Demaille <akim@epita.fr>
20354
20355 * tests/regression.m4 (%union and --defines): New test,
20356 demonstrating a current bug in the obstack implementation.
20357
20358 2000-11-17 Akim Demaille <akim@epita.fr>
20359
20360 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20361 macros.
20362 Use them to declare the variables which are global or local to
20363 `yyparse'.
20364
20365 2000-11-17 Akim Demaille <akim@epita.fr>
20366
20367 * acconfig.h: Remove, no longer used.
20368
20369 2000-11-07 Akim Demaille <akim@epita.fr>
20370
20371 * src: s/Copyright (C)/Copyright/g.
20372
20373 2000-11-07 Akim Demaille <akim@epita.fr>
20374
20375 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20376 defining.
20377 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20378
20379 2000-11-07 Akim Demaille <akim@epita.fr>
20380
20381 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20382 Merge in a single CPP if/else.
20383
20384 2000-11-07 Akim Demaille <akim@epita.fr>
20385
20386 * src/output.c (output): Remove useless variables.
20387 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20388 argument `data' for consistency with the prototypes.
20389 Qualify it `const'.
20390 (obstack_copy, obstack_copy0): Rename the second argument as
20391 `address' for consistency. Qualify it `const'.
20392 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20393 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20394 `const' their input argument (`data' or `address').
20395 Adjust the corresponding macros to include `const' in casts.
20396
20397 2000-11-03 Akim Demaille <akim@epita.fr>
20398
20399 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20400 s/PFILE1/BISON_HAIRY/.
20401 Adjust dependencies.
20402
20403 2000-11-03 Akim Demaille <akim@epita.fr>
20404
20405 For some reason, this was not applied.
20406
20407 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20408 `unlink': it's no longer used.
20409
20410 2000-11-03 Akim Demaille <akim@epita.fr>
20411
20412 * src/files.c (skeleton_find): New function, eved out of...
20413 (open_files, open_extra_files): here.
20414
20415 2000-11-03 Akim Demaille <akim@epita.fr>
20416
20417 Don't use `atexit'.
20418
20419 * src/files.c (obstack_save): New function.
20420 (done): Rename as...
20421 (output_files): this.
20422 Use `obstack_save'.
20423 * src/main.c (main): Don't use `atexit' to register `done', since
20424 it no longer has to remove tmp files, just call `output_files'
20425 when there are no errors.
20426
20427 2000-11-02 Akim Demaille <akim@epita.fr>
20428
20429 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20430 `unlink': it's no longer used.
20431 * src/files.h: Formatting changes.
20432
20433 2000-11-02 Akim Demaille <akim@epita.fr>
20434
20435 Remove the last uses of mktemp and unlink/delete.
20436
20437 * src/files.c (fdefines, ftable): Removed.
20438 (defines_ostack, table_obstack): New.
20439 Adjust dependencies of the former into uses of the latter.
20440 * src/output.c (output_short_or_char_table, output_short_table):
20441 Convert to using obstacks.
20442 * src/reader.c (copy_comment2): Accept one FILE * and two
20443 obstacks.
20444 (output_token_defines, reader_output_yylsp): Use obstacks.
20445 * src/system.h (obstack_fgrow3): New.
20446 * po/POTFILES.in: Adjust.
20447
20448 2000-11-01 Akim Demaille <akim@epita.fr>
20449
20450 Change each use of `fattrs' into a use of `attrs_obstack'.
20451
20452 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20453 * src/files.c (fattrs): Remove.
20454 (attrs_obstack): New.
20455 Adjust all dependencies.
20456 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20457
20458 2000-11-01 Akim Demaille <akim@epita.fr>
20459
20460 Introduce obstacks.
20461 Change each use of `faction' into a use of `action_obstack'.
20462
20463 * lib/obstack.h, lib/obstack.c: New files.
20464 * src/files.c (faction): Remove.
20465 (action_obstack): New.
20466 Adjust all dependencies.
20467
20468 2000-10-20 Akim Demaille <akim@epita.fr>
20469
20470 * lib/quote.h (PARAMS): New macro. Use it.
20471
20472 2000-10-16 Akim Demaille <akim@epita.fr>
20473
20474 * src/output.c (output_short_or_char_table): New function.
20475 (output_short_table, output_token_translations): Use it.
20476 (goto_actions): Use output_short_table.
20477
20478 2000-10-16 Akim Demaille <akim@epita.fr>
20479
20480 * src/symtab.c (bucket_new): New function.
20481 (getsym): Use it.
20482
20483 * src/output.c (output_short_table): New argument to display the
20484 comment associated with the table.
20485 Adjust dependencies.
20486 (output_gram): Use it.
20487 (output_rule_data): Nicer output layout for YYTNAME.
20488
20489 2000-10-16 Akim Demaille <akim@epita.fr>
20490
20491 * src/lex.c (read_typename): New function.
20492 (lex): Use it.
20493 * src/reader.c (copy_dollar): Likewise.
20494
20495 2000-10-16 Akim Demaille <akim@epita.fr>
20496
20497 * src/reader.c (copy_comment2): Expect the input stream to be on
20498 the `/' which is suspected to open a comment, instead of being
20499 called after `//' or `/*' was read.
20500 (copy_comment, copy_definition, parse_union_decl, copy_action)
20501 (copy_guard): Adjust.
20502
20503 2000-10-16 Akim Demaille <akim@epita.fr>
20504
20505 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20506 `read_signed_integer'.
20507
20508 2000-10-16 Akim Demaille <akim@epita.fr>
20509
20510 * src/reader.c (copy_dollar): New function.
20511 (copy_guard, copy_action): Use it.
20512
20513 2000-10-16 Akim Demaille <akim@epita.fr>
20514
20515 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20516 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20517 New files, from Fileutils 4.0.27.
20518 * src/main.c (printable_version): Remove.
20519 * src/lex.c, src/reader.c: Use `quote'.
20520
20521 2000-10-04 Akim Demaille <akim@epita.fr>
20522
20523 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20524
20525 2000-10-04 Akim Demaille <akim@epita.fr>
20526
20527 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20528
20529 2000-10-04 Akim Demaille <akim@epita.fr>
20530
20531 When a literal string is used to define two different tokens,
20532 `bison -v' segfaults.
20533 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20534
20535 * tests/regression.m4: New file.
20536 Include the core of the sample provided by Piotr Gackiewicz.
20537 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20538 properly.
20539
20540 2000-10-04 Akim Demaille <akim@epita.fr>
20541
20542 * src/reader.c (parse_expect_decl): Keep `count' within the size
20543 of `buffer'.
20544 From Neil Booth.
20545
20546 2000-10-02 Paul Eggert <eggert@twinsun.com>
20547
20548 * bison.s1 (yyparse): Assign the default value
20549 unconditionally, to avoid a GCC warning and make the parser a
20550 tad smaller.
20551
20552 2000-10-02 Akim Demaille <akim@epita.fr>
20553
20554 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20555 options.
20556
20557 2000-10-02 Akim Demaille <akim@epita.fr>
20558
20559 * src/derives.c, src/print.c, src/reduce.c: To ease the
20560 translation, move some `\n' out of the translated strings.
20561
20562 2000-10-02 Akim Demaille <akim@epita.fr>
20563
20564 The location tracking mechanism is precious for parse error
20565 messages. Nevertheless, it is enabled only when `@n' is used in
20566 the grammar, which is a different issue (you can use it in error
20567 message, but not in the grammar per se). Therefore, there should
20568 be another means to enable it.
20569
20570 * src/getargs.c (getargs): Support `--locations'.
20571 (usage): Report it.
20572 * src/getargs.h (locationsflag): Export it.
20573 * src/lex.c (percent_table): Support `%locations'.
20574 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20575 with `locationsflag'.
20576 * doc/bison.texinfo: Document `--locations' and `%locations'.
20577 Sort the options.
20578 * tests/calc.m4: Test it.
20579
20580 For regularity of the names, replace each
20581 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20582 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20583 In addition replace each `flag' with `_flag'.
20584
20585 2000-10-02 Akim Demaille <akim@epita.fr>
20586
20587 Also test parse error messages, including with YYERROR_VERBOSE.
20588
20589 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20590 associative).
20591 Use it to check the computations.
20592 Use it to check `nonassoc' is honored.
20593 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20594 `--yyerror-verbose'.
20595 (_AT_CHECK_CALC): Adjust to this option.
20596 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20597
20598 2000-10-02 Akim Demaille <akim@epita.fr>
20599
20600 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20601 the latter demonstrates a flaw in the handling of non debugging
20602 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20603 was used in order to simplify:
20604
20605 #if YYDEBUG
20606 if (yydebug)
20607 {
20608 ...
20609 }
20610 #endif
20611
20612 into
20613
20614 if (yydebug)
20615 {
20616 ...
20617 }
20618
20619 unfortunately this leads to a CPP conflict when
20620 `--name-prefix=foo' is used since it produces `#define yydebug
20621 foodebug'.
20622
20623 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20624 (YYDPRINTF): New macro.
20625 Spread its use.
20626 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20627 the bison options.
20628 Also test `--verbose', `--defines' and `--name-prefix'.
20629
20630 2000-10-02 Akim Demaille <akim@epita.fr>
20631
20632 Improve the readability of the produced parsers.
20633
20634 * src/bison.s1: Formatting changes.
20635 Improve the comment related to the `$' mark.
20636 (yydefault): Don't fall through to `yyresume': `goto' there.
20637 * src/output.c (output_parser): When the `$' is met, skip the end
20638 of its line.
20639 New variable, `number_of_dollar_signs', to check there's exactly
20640 one `$' in the parser skeleton.
20641
20642 2000-10-02 Akim Demaille <akim@epita.fr>
20643
20644 * lib/xstrdup.c: New file, from the fileutils.
20645 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20646 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20647 instead of strlen + xmalloc + strcpy.
20648 * src/symtab.c (copys): Remove, use xstrdup instead.
20649
20650 2000-10-02 Akim Demaille <akim@epita.fr>
20651
20652 * src/gram.h (associativity): New enum type which replaces the
20653 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20654 `right_assoc', `left_assoc' and `non_assoc'.
20655 Adjust all dependencies.
20656 * src/reader.c: Formatting changes.
20657 (LTYPESTR): Don't define it, use it as a literal in
20658 `reader_output_yylsp'.
20659 * src/symtab.h (symbol_class): New enum type which replaces the
20660 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20661 `sunknown', `stoken and `snterm'.
20662
20663 2000-10-02 Akim Demaille <akim@epita.fr>
20664
20665 * src/getargs.c (fixed_outfiles): Rename as...
20666 (yaccflag): for consistency and accuracy.
20667 Adjust dependencies.
20668
20669 2000-10-02 Akim Demaille <akim@epita.fr>
20670
20671 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20672 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20673 difficult and introduced a lot of core dump. It turns out that
20674 Bison used an implementation of `xmalloc' based on `calloc', and
20675 at various places it does depend upon the initialization to 0. I
20676 have not tried to isolate the pertinent places, and all the former
20677 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20678 someone should address this issue.
20679
20680 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20681 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20682 files.
20683 Adjust dependencies.
20684 * src/warshall.h: New file.
20685 Propagate.
20686
20687 2000-10-02 Akim Demaille <akim@epita.fr>
20688
20689 Various anti-`extern in *.c' changes.
20690
20691 * src/system.h: Include `assert.h'.
20692
20693 2000-10-02 Akim Demaille <akim@epita.fr>
20694
20695 * src/state.h (nstates, final_state, first_state, first_shift)
20696 (first_reduction): Move their exportation from here...
20697 * src/LR0.h: to here.
20698 Adjust dependencies.
20699 * src/getargs.c (statisticsflag): New variable.
20700 Add support for `--statistics'.
20701 Adjust dependencies.
20702
20703 Remove a lot of now useless `extern' statements in most files.
20704
20705 2000-10-02 Akim Demaille <akim@epita.fr>
20706
20707 * src/LR0.h: New file.
20708 Propagate its use.
20709
20710 2000-10-02 Akim Demaille <akim@epita.fr>
20711
20712 * src/print.h: New file.
20713 Propagate its use.
20714 * src/print.c: Formatting and ordering changes.
20715 (verbose, terse): Replace with...
20716 (print_results): this new function.
20717 Adjust dependencies.
20718
20719 2000-10-02 Akim Demaille <akim@epita.fr>
20720
20721 * src/conflicts.c (conflict_report): New function.
20722 (conflict_log, verbose_conflict_log): Replace with...
20723 (print_conflicts): this function.
20724 Adjust dependencies.
20725 * src/conflicts.h: New file.
20726 Propagate its inclusion.
20727
20728 2000-10-02 Akim Demaille <akim@epita.fr>
20729
20730 * src/nullable.h: New file.
20731 Propagate its inclusion.
20732 * src/nullable.c: Formatting changes.
20733
20734 2000-10-02 Akim Demaille <akim@epita.fr>
20735
20736 * src/reduce.h: New file.
20737 Propagate its inclusion.
20738 * src/reduce.c: Topological sort and other formatting changes.
20739 (bool, TRUE, FALSE): Move their definition to...
20740 * src/system.h: here.
20741
20742 2000-10-02 Akim Demaille <akim@epita.fr>
20743
20744 * src/files.c: Formatting changes.
20745 (tryopen, tryclose, openfiles): Rename as...
20746 (xfopen, xfclose, open_files): this.
20747 (stringappend): static.
20748 * src/files.h: Complete the list of exported symbols.
20749 Propagate its use.
20750
20751 2000-10-02 Akim Demaille <akim@epita.fr>
20752
20753 * src/reader.h: New file.
20754 Propagate its use instead of tedious list of `extern' and
20755 prototypes.
20756 * src/reader.c: Formatting changes, topological sort,
20757 s/register//.
20758
20759 2000-10-02 Akim Demaille <akim@epita.fr>
20760
20761 * src/lex.h: Prototype `lex.c' exported functions.
20762 * src/reader.c: Adjust.
20763 * src/lex.c: Formatting changes.
20764 (safegetc): Rename as...
20765 (xgetc): this.
20766
20767 2000-10-02 Akim Demaille <akim@epita.fr>
20768
20769 * src/lalr.h: New file.
20770 Propagate its inclusion instead of prototypes and `extern'.
20771 * src/lalr.c: Formatting changes, topological sorting etc.
20772
20773 2000-10-02 Akim Demaille <akim@epita.fr>
20774
20775 * src/output.c (token_actions): Introduce a temporary array,
20776 YYDEFACT, that makes it possible for this function to use
20777 output_short_table.
20778
20779 2000-10-02 Akim Demaille <akim@epita.fr>
20780
20781 `user_toknums' is output as a `short[]' in `output.c', while it is
20782 defined as a `int[]' in `reader.c'. For consistency with the
20783 other output tables, `user_toknums' is now defined as a table of
20784 shorts.
20785
20786 * src/reader.c (user_toknums): Be a short table instead of an int
20787 table.
20788 Adjust dependencies.
20789
20790 Factor the short table outputs.
20791
20792 * src/output.c (output_short_table): New function.
20793 * src/output.c (output_gram, output_stos, output_rule_data)
20794 (output_base, output_table, output_check): Use it.
20795
20796 2000-10-02 Akim Demaille <akim@epita.fr>
20797
20798 * src/output.c (output): Topological sort of the functions, in
20799 order to get rid of the `static' prototypes.
20800 No longer use `register'.
20801 * src/output.h: New file.
20802 Propagate its inclusion in files explicitly prototyping functions
20803 from output.c.
20804
20805 2000-09-21 Akim Demaille <akim@epita.fr>
20806
20807 * src/atgeneral.m4: Update from Autoconf.
20808
20809 2000-09-21 Akim Demaille <akim@epita.fr>
20810
20811 * src/closure.h: New file.
20812 * src/closure.c: Formatting changes, topological sort over the
20813 functions, use of closure.h.
20814 (initialize_closure, finalize_closure): Rename as...
20815 (new_closure, free_closure): these. Adjust dependencies.
20816 * src/LR0.c: Formatting changes, topological sort, use of
20817 cloture.h.
20818 (initialize_states): Rename as...
20819 (new_states): this.
20820 * src/Makefile.am (noinst_HEADERS): Adjust.
20821
20822 2000-09-20 Akim Demaille <akim@epita.fr>
20823
20824 * src/acconfig.h: Don't protect config.h against multiple
20825 inclusion.
20826 Don't define PARAMS.
20827 * src/system.h: Define PARAMS.
20828 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20829 purpose of config.h. system.h must not try to fix wrong
20830 definitions in config.h.
20831
20832 2000-09-20 Akim Demaille <akim@epita.fr>
20833
20834 * src/derives.h: New file.
20835 * src/main.c, src/derives.h: Use it.
20836 Formatting changes.
20837 * src/Makefile.am (noinst_HEADERS): Adjust.
20838
20839 2000-09-20 Akim Demaille <akim@epita.fr>
20840
20841 * tests/atgeneral.m4: Update from Autoconf.
20842 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20843 (AT_CHECK_CALC): New macros.
20844 Use these macros to test bison with options `', `--raw',
20845 `--debug', `--yacc', `--yacc --debug'.
20846
20847 2000-09-19 Akim Demaille <akim@epita.fr>
20848
20849 * src/output.c: Formatting changes.
20850 * src/machine.h: Remove, leaving its contents in...
20851 * src/system.h: here.
20852 Include stdio.h.
20853 Adjust all dependencies on stdio.h and machine.h.
20854 * src/getargs.h: New file.
20855 Let all `extern' declarations about getargs.c be replaced with
20856 inclusion of `getargs.h'.
20857 * src/Makefile.am (noinst_HEADERS): Adjust.
20858
20859 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20860 scope.
20861 (yyerror): Returns void, not int.
20862 * doc/bison.texinfo: Formatting changes.
20863
20864 2000-09-19 Akim Demaille <akim@epita.fr>
20865
20866 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20867 portable.
20868
20869 2000-09-18 Akim Demaille <akim@epita.fr>
20870
20871 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20872 * src/Makefile.am (INCLUDES): Don't.
20873 Be ready to fetch headers in lib/.
20874
20875 2000-09-18 Akim Demaille <akim@epita.fr>
20876
20877 * doc/bison.texinfo: Update the copyright.
20878 ANSIfy and GNUify the examples.
20879 Remove the old menu.
20880
20881 2000-09-18 Akim Demaille <akim@epita.fr>
20882
20883 First set of tests: use the `calc' example from the documentation.
20884
20885 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20886 is defined only when YYDEBUG is.
20887 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20888 * src/files.c (tryopen, tryclose): Formatting changes.
20889 Move to the top and be static.
20890 * src/reader.c (read_signed_integer): Likewise.
20891 * tests/calc.m4: New file.
20892 * Makefile.am, suite.m4: Adjust.
20893 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20894
20895 2000-09-18 Akim Demaille <akim@epita.fr>
20896
20897 Add support for an Autotest test suite for Bison.
20898
20899 * m4/m4.m4, m4/atconfig.m4: New files.
20900 * m4/Makefile.am (EXTRA_DIST): Adjust.
20901 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
20902 files.
20903 * src/getargs.c: Display a more standard --version message.
20904 * src/reader.c (reader): Formatting changes.
20905 No longer depend upon VERSION_STRING.
20906 * configure.in: No longer use `dnl'.
20907 Set up the test suite and the new directory `tests/.
20908 (VERSION_STRING): Remove.
20909
20910 2000-04-14 Akim Demaille <akim@epita.fr>
20911
20912 * src/reader.c (copy_comment2): New function, same as former
20913 `copy_comment', but outputs into two FILE *.
20914 (copy_comment): Use it.
20915 (parse_union_decl): Use it.
20916 (get_type, parse_start_decl): Use the same `invalid' message.
20917 (parse_start_decl, parse_union_decl): Use the same `multiple'
20918 message.
20919 (parse_union_decl, copy_guard, copy_action): Use the same
20920 `unmatched' message.
20921 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
20922
20923 2000-03-31 Akim Demaille <akim@epita.fr>
20924
20925 * src/files.c (tryopen, tryclose): Move to the top.
20926 Be static.
20927
20928 2000-03-31 Akim Demaille <akim@epita.fr>
20929
20930 * src/main.c (main): Don't call `done', exit does it.
20931
20932 2000-03-31 Akim Demaille <akim@epita.fr>
20933
20934 * allocate.c: s/return (foo)/return foo/.
20935 * lalr.c: Likewise.
20936 * LR0.c: Likewise.
20937 * output.c: Likewise.
20938 * reader.c: Likewise.
20939 * symtab.c: Likewise.
20940 * vmsgetargs.c: Likewise.
20941
20942 2000-03-31 Akim Demaille <akim@epita.fr>
20943
20944 Clean up the error reporting functions.
20945
20946 * src/report.c: New file.
20947 * src/report.h: Likewise.
20948 * src/Makefile.am: Adjust.
20949 * m4/error.m4: New file.
20950 * m4/Makefile.am: Adjust.
20951 * configure.in (jm_PREREQ_ERROR): Call it.
20952 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
20953 Remove.
20954 (fatal, fatals): Remove. All callers use complain.c::fatal.
20955 (warn, warni, warns, warnss, warnss): Remove. All callers use
20956 complain.c::complain.
20957 (toomany): Remove, use fatal instead.
20958 * src/files.c (done): No argument, use complain_message_count.
20959 * src/main.c (main): Register `done' to `atexit'.
20960
20961 * src/getargs.c (usage): More `fputs', less `fprintf'.
20962
20963 2000-03-28 Akim Demaille <akim@epita.fr>
20964
20965 * lib/: New directory.
20966 * Makefile.am (SUBDIRS): Adjust.
20967 * configure.in: Adjust.
20968 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
20969 useless.
20970 * src/alloca.c: Moved to lib/.
20971 * src/getopt.c: Likewise.
20972 * src/getopt1.c: Likewise.
20973 * src/getopt.h: Likewise.
20974 * src/ansi2knr.c: Likewise.
20975 * src/ansi2knr.1: Likewise.
20976 * src/Makefile.am: Adjust.
20977 * lib/Makefile.am: New file.
20978
20979 2000-03-28 Akim Demaille <akim@epita.fr>
20980
20981 * src/getargs.c (usage): Refresh the help message.
20982
20983 2000-03-17 Akim Demaille <akim@epita.fr>
20984
20985 * src/getopt1.c: Updated from textutils 2.0e
20986 * src/getopt.c: Likewise.
20987 * src/getopt.h: Likewise.
20988
20989 2000-03-17 Akim Demaille <akim@epita.fr>
20990
20991 * src/Makefile.am (bison.simple): Fix the awk program: quote only
20992 the file name, not the whole `#line LINE FILE'.
20993
20994 2000-03-17 Akim Demaille <akim@epita.fr>
20995
20996 On syntax errors, report the token on which we choked.
20997
20998 * src/bison.s1 (yyparse): In the label yyerrlab, when
20999 YYERROR_VERBOSE, add yychar in msg.
21000
21001 2000-03-17 Akim Demaille <akim@epita.fr>
21002
21003 * src/reader.c (copy_at): New function.
21004 (copy_guard): Use it.
21005 (copy_action): Use it.
21006
21007 2000-03-17 Akim Demaille <akim@epita.fr>
21008
21009 Be kind to translators, save some useless translations.
21010
21011 * src/main.c (banner): New function.
21012 (fatal_banner): Use it.
21013 (warn_banner): Use it.
21014
21015 2000-03-17 Akim Demaille <akim@epita.fr>
21016
21017 * src/reader.c (copy_definition): Use copy_string and
21018 copy_comment. Removed now unused `match', `ended',
21019 `cplus_comment'.
21020 (copy_comment, copy_string): Moved, to be visible from
21021 copy_definition.
21022
21023 2000-03-17 Akim Demaille <akim@epita.fr>
21024
21025 * src/reader.c (copy_string): Declare `static inline'. No
21026 problems with inline, since it is checked by configure.
21027 (copy_comment): Likewise.
21028
21029 2000-03-17 Akim Demaille <akim@epita.fr>
21030
21031 * src/reader.c (packsymbols): Formatting changes.
21032
21033 2000-03-17 Akim Demaille <akim@epita.fr>
21034
21035 * src/reader.c (copy_comment): New function, factored out from:
21036 (copy_action): Use it. Removed now unused `match', `ended',
21037 `cplus_comment'.
21038 (copy_guard): Likewise.
21039
21040 2000-03-17 Akim Demaille <akim@epita.fr>
21041
21042 * src/reader.c (copy_string): New function, factored out from:
21043 (copy_action): Use it.
21044 (copy_guard): Likewise.
21045
21046 2000-03-17 Akim Demaille <akim@epita.fr>
21047
21048 Change the handling of @s so that they behave exactly like $s.
21049 There is now a pseudo variable @$ (readble and writable), location
21050 of the lhs of the rule (by default ranging from the location of
21051 the first symbol of the rhs, to the location of the last symbol,
21052 or, if the rhs is empty, YYLLOC).
21053
21054 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21055 yyval.
21056 (yyparse): When providing a default semantic action, provide a
21057 default location action.
21058 (after the $): No longer change `*YYLSP', just stack YYLOC the
21059 same way you stack YYVAL.
21060 * src/reader.c (read_declarations): Use warns.
21061 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21062 (copy_action, case '@'): Likewise.
21063 Use a standard error message, to save useless work from
21064 translators.
21065
21066 2000-03-17 Akim Demaille <akim@epita.fr>
21067
21068 * src/bison.s1: Formatting and cosmetics changes.
21069 * src/reader.c: Likewise.
21070 Update the Copyright notice.
21071
21072 2000-03-17 Akim Demaille <akim@epita.fr>
21073
21074 * src/bison.s1 (#line): All set to `#line' only, since the
21075 Makefile now handles them.
21076
21077 2000-03-16 Akim Demaille <akim@epita.fr>
21078
21079 * src/output.c (output_rule_data): Output the documentation of
21080 some of the tables.
21081 (Copyright notice): Update.
21082 Formatting changes.
21083
21084 2000-03-16 Akim Demaille <akim@epita.fr>
21085
21086 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21087 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21088 One `#if YYDEBUG' remains, since it uses variables which are
21089 defined only if `YYDEBUG != 0'.
21090
21091 2000-03-16 Akim Demaille <akim@epita.fr>
21092
21093 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21094 and related variables so that the similarities are highlighted.
21095
21096 2000-03-16 Akim Demaille <akim@epita.fr>
21097
21098 * src/bison.s1: Properly indent CPP directives.
21099
21100 2000-03-16 Akim Demaille <akim@epita.fr>
21101
21102 * src/bison.s1: Properly indent the `alloca' CPP section.
21103
21104 2000-03-16 Akim Demaille <akim@epita.fr>
21105
21106 Do not hard code values of directories in `configure.in'.
21107 Update the `configure' tool chain.
21108
21109 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21110 src/makefile.am.
21111 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21112 (AC_OUTPUT): Add m4/Makefile.
21113 Bump to bison 1.28a, 1.29 has never been released.
21114 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21115 handled via src/Makefile.am.
21116 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21117 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21118 autoheader.
21119 * Makefile.am (SUBDIRS): Add m4.
21120 (ACLOCAL_AM_FLAGS): New variable.
21121 (AUTOMAKE_OPTIONS): Add check-news.
21122 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21123 the proper line number and file name.
21124 (DEFS): Propagate the location of bison library files and of the
21125 locale files.
21126 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21127 builddir.
21128 * acinclude.m4: Remove, replaced by the directory m4.
21129 * m4/Makefile.am (EXTRA_DIST): New variable.
21130 * m4/gettext.m4: New file, from the fileutils.
21131 * m4/lcmessage.m4: Likewise
21132 * m4/progtest.m4: Likewise.
21133 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21134
21135 2000-03-10 Akim Demaille <akim@epita.fr>
21136
21137 * src/closure.c:
21138 Formatting changes of various comments.
21139 Respect the GNU coding standards at various places.
21140 Don't use `_()' when no translation is needed.
21141
21142 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21143
21144 * src/files.c:
21145 OS/2 honors TMPDIR environment variable.
21146
21147 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21148
21149 * doc/bison.texinfo: Tweaked spelling and grammar.
21150 Updated ISBN.
21151 Removed reference to price of printed copy.
21152 Mention BISON_SIMPLE and BISON_HAIRY.
21153
21154 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21155
21156 * configure.in, NEWS:
21157 Bison 1.29 released.
21158
21159 1999-10-27 Jesse Thilo <jthilo@gnu.org>
21160
21161 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21162 Added reference card.
21163
21164 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21165
21166 * po/ru.po: Added Russian translation.
21167
21168 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21169
21170 * configure.in: Added Russian translation.
21171
21172 1999-07-06 Jesse Thilo <jthilo@gnu.org>
21173
21174 * configure.in, NEWS, README:
21175 Released version 1.28.
21176
21177 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21178
21179 * src/system.h:
21180 Squashed redefinition warning on some systems.
21181
21182 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21183 Have configure build version string instead of relying on ANSI string
21184 concatentation.
21185
21186 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21187
21188 * po/POTFILES.in: Got rid of version.c.
21189
21190 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21191
21192 * acconfig.h, configure.in:
21193 Have configure build version string instead of relying on ANSI string
21194 concatentation.
21195
21196 1999-06-08 Jesse Thilo <jthilo@gnu.org>
21197
21198 * doc/bison.1:
21199 Dropped mention of `+' for long-named options.
21200
21201 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21202
21203 * src/files.c: Added <unistd.h> for unlink().
21204
21205 * src/Makefile.am, src/system.h:
21206 I18n fixes.
21207
21208 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21209
21210 * README: Added a FAQ list.
21211
21212 * configure.in, acconfig.h:
21213 I18n fixes.
21214
21215 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21216
21217 * doc/FAQ, doc/Makefile.am:
21218 Added a FAQ list.
21219
21220 1999-05-19 Jesse Thilo <jthilo@gnu.org>
21221
21222 * src/alloc.h, src/symtab.h, src/version.c:
21223 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21224
21225 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21226
21227 * src/.cvsignore, src/Makefile.am:
21228 Reorganized: sources in `src', documentation in `doc'.
21229
21230 * src/lex.c (literalchar):
21231 fixed the code for escaping double quotes (thanks
21232 Jonathan Czisny.)
21233
21234 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21235
21236 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21237 Adjusted paths to reflect directory reorganization.
21238
21239 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21240
21241 * doc/.cvsignore, doc/Makefile.am:
21242 Reorganized: sources in `src', documentation in `doc'.
21243
21244 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21245
21246 * configure.in:
21247 Updated AC_INIT file to reflect directory reorganization.
21248
21249 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21250 Reorganized: sources in `src', documentation in `doc'.
21251
21252 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21253
21254 * src/allocate.c:
21255 Don't declare calloc() and realloc() if not necessary.
21256
21257 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21258
21259 * configure.in, acconfig.h, acinclude.m4:
21260 Don't declare calloc() and realloc() if not necessary.
21261
21262 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21263
21264 * po/.cvsignore: Added i18n support.
21265
21266 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21267
21268 * acconfig.h, configure.in, Makefile.am:
21269 Added i18n support.
21270
21271 1999-03-22 Jesse Thilo <jthilo@gnu.org>
21272
21273 * src/bison.s1: Fixed #line numbers.
21274
21275 1999-03-15 Jesse Thilo <jthilo@gnu.org>
21276
21277 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21278 Added PO files from Translation Project.
21279
21280 1999-03-03 Jesse Thilo <jthilo@gnu.org>
21281
21282 * Makefile.am:
21283 Added support for non-ANSI compilers (ansi2knr).
21284
21285 1999-02-16 Jesse Thilo <jthilo@gnu.org>
21286
21287 * configure.in: Bumped version number to 1.27.
21288
21289 * Makefile.am:
21290 Added `bison.simple' to list of files removed by `make distclean'.
21291
21292 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21293
21294 * src/files.c, src/files.h:
21295 Defined locations of parser files in config.h instead of Makefile.
21296
21297 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21298
21299 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21300 Defined locations of parser files in config.h instead of Makefile.
21301
21302 1999-02-09 Jesse Thilo <jthilo@gnu.org>
21303
21304 * Makefile.am:
21305 Removed inappropriate use of $< macro.
21306
21307 1999-02-05 Jesse Thilo <jthilo@gnu.org>
21308
21309 * po/Makefile.in.in, po/POTFILES.in:
21310 Add `po' directory skeleton.
21311
21312 1999-01-27 Jesse Thilo <jthilo@gnu.org>
21313
21314 * README: Document help-bison list.
21315
21316 * configure.in: Add check for mkstemp().
21317
21318 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21319
21320 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21321 Hush a few compiler warnings.
21322
21323 * src/files.c:
21324 Add tryclose(), which verifies that fclose was successful.
21325 Hush a couple of compiler warnings.
21326
21327 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21328
21329 * Makefile.am, OChangeLog:
21330 ChangeLog is now automatically generated. Include the old version as
21331 OChangeLog.
21332
21333 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21334
21335 * 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:
21336 Update FSF address.
21337
21338 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21339
21340 * doc/bison.texinfo: Fix formatting glitch.
21341
21342 * doc/bison.texinfo: Update FSF address.
21343
21344 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21345
21346 * acconfig.h: Update FSF address.
21347
21348 1999-01-08 Jesse Thilo <jthilo@gnu.org>
21349
21350 * src/system.h:
21351 Don't define PACKAGE here, since config.h defines it.
21352
21353 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21354
21355 * src/reader.c: Update copyright date.
21356
21357 * src/main.c:
21358 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21359 favor of output directly to stderr (avoids buffer overruns).
21360
21361 * src/reader.c: Some checks for premature EOF.
21362
21363 * 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:
21364 Use prototypes if the compiler understands them.
21365
21366 * src/files.c: Honor TMPDIR on Unix hosts.
21367 Use prototypes if the compiler understands them.
21368
21369 * src/reader.c:
21370 Fix a couple of buffer overrun bugs.
21371 Use prototypes if the compiler understands them.
21372
21373 * src/system.h: Include unistd.h and ctype.h.
21374 Use #ifdef instead of #if for NLS symbols.
21375
21376 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21377
21378 * doc/bison.texinfo:
21379 Delete comment "consider using @set for edition number, etc..." since
21380 we now are doing so.
21381
21382 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21383
21384 * configure.in:
21385 Use prototypes if the compiler understands them.
21386
21387 * NEWS: Document 1.26 highlights.
21388
21389 * Makefile.am: Require Automake 1.3 or later.
21390
21391 * acconfig.h:
21392 Use prototypes if the compiler understands them.
21393
21394 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21395
21396 * src/version.c:
21397 Use VERSION symbol from automake for version number.
21398
21399 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21400
21401 * acconfig.h, configure.in, version.cin:
21402 Use VERSION symbol from automake for version number.
21403
21404 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21405
21406 * Makefile.am:
21407 Distribute original version of simple parser (bison.s1), not built
21408 version (bison.simple).
21409
21410 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21411
21412 * doc/bison.texinfo: Add info dir entry.
21413
21414 * doc/bison.texinfo:
21415 Let automake put version number into documentation.
21416
21417 1998-11-26 Jesse Thilo <jthilo@gnu.org>
21418
21419 * src/bison.cld, src/build.com, src/vmshlp.mar:
21420 Add non-RCS files from /gd/gnu/bison.
21421
21422 1998-11-26 Jesse Thilo <jthilo@gnu.org>
21423
21424 * doc/bison.1:
21425 Document the BISON_HAIRY and BISON_SIMPLE variables.
21426
21427 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21428
21429 * src/version.c: Build version.c automatically.
21430
21431 * src/reader.c:
21432 Fix token numbering (used to start at 258, not 257).
21433
21434 * src/system.h: Include config.h.
21435
21436 * src/getargs.c: Update bug report address.
21437
21438 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21439 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21440
21441 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21442
21443 * Makefile.am:
21444 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21445
21446 * configure.in, version.cin:
21447 Build version.c automatically.
21448
21449 * AUTHORS: Add AUTHORS file.
21450
21451 * README: Update bug report address.
21452
21453 * bison.simple:
21454 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21455
21456 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21457 Add automake stuff.
21458
21459 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21460
21461 * doc/bison.texinfo: Clean up some formatting.
21462
21463 1998-05-05 Richard Stallman <rms@gnu.org>
21464
21465 * doc/bison.texinfo:
21466 Explain better why to make a pure parser.
21467
21468 1998-01-05 Richard Stallman <rms@gnu.org>
21469
21470 * src/files.c (openfiles):
21471 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21472 find a temporary directory, if possible. Do not unlink files while
21473 they are open.
21474
21475 1997-08-25 Richard Stallman <rms@gnu.org>
21476
21477 * src/reader.c (stack_offset;):
21478 Change some warni to warns.
21479
21480 * src/lex.c (literalchar): Use warns, not warni.
21481
21482 1997-06-28 Richard Stallman <rms@gnu.org>
21483
21484 * src/bison.s1: Add a Bison version comment.
21485
21486 * src/main.c (fatal, warn, berror):
21487 Use program_name.
21488
21489 1997-06-28 Richard Stallman <rms@gnu.org>
21490
21491 * Makefile.in (bison_version): New variable.
21492 (dist): Use that variable.
21493 (bison.s1): Substitute the Bison version into bison.simple.
21494
21495 * bison.simple: Add a Bison version comment.
21496
21497 1997-06-18 Richard Stallman <rms@gnu.org>
21498
21499 * src/main.c (fatal, warn, berror):
21500 Make error messages standard.
21501 (toomany): Improve error message text.
21502
21503 * 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:
21504 new.h renamed to alloc.h.
21505
21506 1997-06-18 Richard Stallman <rms@gnu.org>
21507
21508 * Makefile.in: new.h renamed to alloc.h.
21509
21510 1997-05-24 Richard Stallman <rms@gnu.org>
21511
21512 * src/lex.c (literalchar):
21513 Fix the code for escaping \, " and '.
21514
21515 (lex): Avoid trouble when there are many chars
21516 to discard in a char literal with just several chars in it.
21517
21518 1997-05-17 Richard Stallman <rms@gnu.org>
21519
21520 * src/bison.s1:
21521 Use malloc, if using alloca is troublesome.
21522 (YYSTACK_USE_ALLOCA): New flag macro.
21523 Define it for some systems and compilers.
21524 (YYSTACK_ALLOC): New macro.
21525 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21526 If it was malloc'd, free it.
21527
21528 1997-05-17 Richard Stallman <rms@gnu.org>
21529
21530 * bison.simple:
21531 Use malloc, if using alloca is troublesome.
21532 (YYSTACK_USE_ALLOCA): New flag macro.
21533 Define it for some systems and compilers.
21534 (YYSTACK_ALLOC): New macro.
21535 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21536 If it was malloc'd, free it.
21537
21538 1997-04-23 Richard Stallman <rms@gnu.org>
21539
21540 * src/bison.s1:
21541 (alloca) [__hpux]: Always define as __builtin_alloca.
21542
21543 1997-04-23 Richard Stallman <rms@gnu.org>
21544
21545 * bison.simple:
21546 (alloca) [__hpux]: Always define as __builtin_alloca.
21547
21548 1997-04-22 Richard Stallman <rms@gnu.org>
21549
21550 * src/bison.s1:
21551 [__hpux]: Include alloca.h (right for HPUX 10)
21552 instead of declaring alloca (right for HPUX 9).
21553
21554 * src/bison.s1 (__yy_memcpy):
21555 Declare arg `count' as unsigned int.
21556 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21557
21558 1997-04-22 Richard Stallman <rms@gnu.org>
21559
21560 * bison.simple:
21561 [__hpux]: Include alloca.h (right for HPUX 10)
21562 instead of declaring alloca (right for HPUX 9).
21563
21564 * bison.simple (__yy_memcpy):
21565 Declare arg `count' as unsigned int.
21566 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21567
21568 1997-01-03 Richard Stallman <rms@gnu.org>
21569
21570 * src/allocate.c: [__STDC__ or _MSC_VER]:
21571 Declare calloc and realloc to return void *.
21572
21573 1997-01-02 Richard Stallman <rms@gnu.org>
21574
21575 * src/system.h:
21576 [_MSC_VER]: Include stdlib.h and process.h.
21577 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21578
21579 * src/main.c (main): Return FAILURE as a value.
21580 (printable_version): Declare arg as int, not char.
21581
21582 1997-01-02 Richard Stallman <rms@gnu.org>
21583
21584 * Makefile.in (dist):
21585 Explicitly check for symlinks, and copy them.
21586
21587 1996-12-19 Richard Stallman <rms@gnu.org>
21588
21589 * src/files.c:
21590 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21591
21592 1996-12-18 Paul Eggert <eggert@gnu.org>
21593
21594 * src/bison.s1 (yyparse):
21595 If __GNUC__ and YYPARSE_PARAM are both defined,
21596 declare yyparse to have a void * argument.
21597
21598 1996-12-18 Paul Eggert <eggert@gnu.org>
21599
21600 * bison.simple (yyparse):
21601 If __GNUC__ and YYPARSE_PARAM are both defined,
21602 declare yyparse to have a void * argument.
21603
21604 1996-12-17 Richard Stallman <rms@gnu.org>
21605
21606 * src/reduce.c (nbits): Add some casts.
21607
21608 1996-08-12 Richard Stallman <rms@gnu.org>
21609
21610 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21611
21612 1996-08-12 Richard Stallman <rms@gnu.org>
21613
21614 * bison.simple: Test _MSDOS as well as _MSDOS_.
21615
21616 1996-07-31 Richard Stallman <rms@gnu.org>
21617
21618 * src/bison.s1:
21619 [__sun && __i386]: Include alloca.h.
21620
21621 1996-07-31 Richard Stallman <rms@gnu.org>
21622
21623 * bison.simple:
21624 [__sun && __i386]: Include alloca.h.
21625
21626 1996-07-30 Richard Stallman <rms@gnu.org>
21627
21628 * src/bison.s1: Comment change.
21629
21630 * src/bison.s1: Test _MSDOS_, not MSDOS.
21631
21632 1996-07-30 Richard Stallman <rms@gnu.org>
21633
21634 * bison.simple: Comment change.
21635
21636 * bison.simple: Test _MSDOS_, not MSDOS.
21637
21638 1996-06-01 Richard Stallman <rms@gnu.org>
21639
21640 * 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:
21641 Insert `_' macro around many string constants.
21642
21643 * src/main.c:
21644 Insert `_' macro around many string constants.
21645
21646 (main): Call setlocale, bindtextdomain and textdomain.
21647
21648 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21649 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21650 [ENABLE_NLS]: Include libintl.h.
21651 [ENABLE_NLS] (gettext): Define.
21652 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21653 (N_, PACKAGE, LOCALEDIR): New macros.
21654
21655 1996-06-01 Richard Stallman <rms@gnu.org>
21656
21657 * POTFILES.in: New file.
21658
21659 * Makefile.in (allocate.o):
21660 Define target explicitly.
21661
21662 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21663 (LDFLAGS): Set to @LDFLAGS@.
21664 (configure): Run autoconf only if preceding `cd' succeeds.
21665 (bison.s1): Redirect output to temporary file then move the
21666 temporary to the target, rather than redirecting directly to bison.s1.
21667 (clean): Remove config.status and config.log.
21668 (distclean): Don't remove config.status here.
21669
21670 1996-05-12 Richard Stallman <rms@gnu.org>
21671
21672 * src/bison.s1:
21673 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21674
21675 1996-05-12 Richard Stallman <rms@gnu.org>
21676
21677 * bison.simple:
21678 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21679
21680 1996-05-11 Richard Stallman <rms@gnu.org>
21681
21682 * src/bison.s1 (__yy_memcpy):
21683 Really reorder the args, as was supposedly done on Feb 14 1995.
21684 (yyparse): Calls changed accordingly.
21685
21686 1996-05-11 Richard Stallman <rms@gnu.org>
21687
21688 * Makefile.in (dist): Don't use $(srcdir).
21689
21690 * bison.simple (__yy_memcpy):
21691 Really reorder the args, as was supposedly done on Feb 14 1995.
21692 (yyparse): Calls changed accordingly.
21693
21694 1996-01-27 Richard Stallman <rms@gnu.org>
21695
21696 * src/output.c (output_rule_data):
21697 Test YYERROR_VERBOSE in the conditional
21698 around the definition of ttyname.
21699
21700 1995-12-29 Richard Stallman <rms@gnu.org>
21701
21702 * src/bison.s1:
21703 Fix line numbers in #line commands.
21704
21705 1995-12-29 Richard Stallman <rms@gnu.org>
21706
21707 * bison.simple:
21708 Fix line numbers in #line commands.
21709
21710 1995-12-27 Richard Stallman <rms@gnu.org>
21711
21712 * src/bison.s1 (YYPARSE_PARAM_DECL):
21713 In C++, make it always null.
21714 (YYPARSE_PARAM_ARG): New macro.
21715 (yyparse): Use YYPARSE_PARAM_ARG.
21716
21717 1995-12-27 Richard Stallman <rms@gnu.org>
21718
21719 * bison.simple (YYPARSE_PARAM_DECL):
21720 In C++, make it always null.
21721 (YYPARSE_PARAM_ARG): New macro.
21722 (yyparse): Use YYPARSE_PARAM_ARG.
21723
21724 1995-11-29 Richard Stallman <rms@gnu.org>
21725
21726 * doc/bison.texinfo:
21727 Describe literal string tokens, %raw, %no_lines, %token_table.
21728
21729 1995-11-29 Daniel Hagerty <hag@gnu.org>
21730
21731 * doc/bison.texinfo: Fixed update date
21732
21733 1995-10-16 Richard Stallman <rms@gnu.org>
21734
21735 * src/version.c: Version 1.25.
21736
21737 1995-10-16 Richard Stallman <rms@gnu.org>
21738
21739 * NEWS: *** empty log message ***
21740
21741 1995-10-16 Richard Stallman <rms@gnu.org>
21742
21743 * doc/bison.1, doc/bison.rnh:
21744 Add new options.
21745
21746 1995-10-15 Richard Stallman <rms@gnu.org>
21747
21748 * src/vmsgetargs.c, src/getargs.c:
21749 Added -n, -k, and -raw switches.
21750 (noparserflag, toknumflag, rawtoknumflag): New variables.
21751
21752 * src/symtab.h (SALIAS):
21753 New #define for adding aliases to %token.
21754 (struct bucket): Added `alias' field.
21755
21756 * src/reduce.c (reduce_grammar):
21757 Revise error message.
21758 (print_notices): Remove final `.' from error message.
21759
21760 * src/reader.c (reader_output_yylsp):
21761 New function.
21762 (readgram): Use `#if 0' around code that accepted %command
21763 inside grammar rules: The documentation doesn't allow it,
21764 and it will fail since the %command processors scan for the next %.
21765 (parse_token_decl): Extended the %token
21766 declaration to allow a multi-character symbol as an alias.
21767 (parse_thong_decl): New function.
21768 (read_declarations): Added %thong declarations.
21769 (read_declarations): Handle NOOP to deal with allowing
21770 % declarations as another means to specify the flags.
21771 (readgram): Allow %prec prior to semantics embedded in a rule.
21772 (skip_to_char, read_declarations, copy_definition)
21773 (parse_token_decl, parse_start_decl, parse_type_decl)
21774 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21775 (get_type_name, copy_guard, copy_action, readgram)
21776 (get_type, packsymbols): Revised most error messages.
21777 Changed `fatal' to `warnxxx' to avoid aborting for error.
21778 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21779 (read_declarations): Improve the error message for
21780 an invalid character. Do not abort.
21781 (read_declarations, copy_guard, copy_action): Use
21782 printable_version to avoid unprintable characters in printed output.
21783 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21784 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21785 Allow the type of a non-terminal can be given
21786 more than once, as long as all specifications give the same type.
21787
21788 * src/output.c:
21789 (output_headers, output_trailers, output, output_gram)
21790 (output_rule_data): Implement noparserflag variable.
21791 Implement toknumflag variable.
21792 (output): Call reader_output_yylsp to output LTYPESTR.
21793
21794 * src/main.c (main):
21795 If reader sees an error, don't process the grammar.
21796 (fatals): Updated to not use VARARGS1.
21797 (printable_version, int_to_string, warn, warni, warns, warnss)
21798 (warnsss): New error reporting functions. Avoid abort for error.
21799
21800 * src/lex.h:
21801 Added THONG and NOOP for alias processing.
21802 Added SETOPT for the new code that allows setting options with %flags.
21803
21804 * src/lex.c:
21805 Include getopt.h. Add some extern decls.
21806 (safegetc): New function to deal with EOF gracefully.
21807 (literalchar); new function to deal with reading \ escapes.
21808 (lex): Use literalchar.
21809 (lex): Implemented "..." tokens.
21810 (literalchar, lex, parse_percent_token): Made tokenbuffer
21811 always contain the token. This includes growing the token
21812 buffer while reading an integer.
21813 (parse_percent_token): Replaced if-else statement with percent_table.
21814 (parse_percent_token): Added % declarations as another
21815 way to specify the flags -n, -l, and -r. Also added hooks for
21816 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21817 major changes to files.c.
21818 (lex) Retain in the incoming stream a character following
21819 an incorrect '/'.
21820 (skip_white_space, lex): Revised most error messages
21821 and changed fatal to warn to avoid aborting.
21822 (percent_table): Added %thong declarations.
21823
21824 * src/gram.h: Comment changes.
21825
21826 * src/files.c (openfiles, open_extra_files, done):
21827 Add faction flag
21828 and actfile file. Handle noparserflag. Both for -n switch.
21829
21830 * src/conflicts.c (resolve_sr_conflict):
21831 Remove use of alloca.
21832
21833 1995-06-01 Jim Meyering <meyering@gnu.org>
21834
21835 * doc/bison.texinfo: *** empty log message ***
21836
21837 1995-05-06 Richard Stallman <rms@gnu.org>
21838
21839 * src/bison.s1: Comment change.
21840
21841 1995-05-06 Richard Stallman <rms@gnu.org>
21842
21843 * bison.simple: Comment change.
21844
21845 1995-05-03 Richard Stallman <rms@gnu.org>
21846
21847 * src/version.c: Version now 1.24.
21848
21849 * src/bison.s1: Change distribution terms.
21850
21851 * src/version.c: Version now 1.23.
21852
21853 1995-05-03 Richard Stallman <rms@gnu.org>
21854
21855 * doc/bison.texinfo:
21856 Rewrite "Conditions for Using Bison".
21857 Update version to 1.24.
21858
21859 1995-05-03 Richard Stallman <rms@gnu.org>
21860
21861 * bison.simple: Change distribution terms.
21862
21863 1995-02-23 Richard Stallman <rms@gnu.org>
21864
21865 * src/files.c: Test __VMS_POSIX as well as VMS.
21866
21867 1995-02-14 Jim Meyering <meyering@gnu.org>
21868
21869 * src/bison.s1 (__yy_memcpy):
21870 Renamed from __yy_bcopy to avoid
21871 confusion. Reverse FROM and TO arguments to be consistent with
21872 those of memcpy.
21873
21874 1995-02-14 Jim Meyering <meyering@gnu.org>
21875
21876 * bison.simple (__yy_memcpy):
21877 Renamed from __yy_bcopy to avoid
21878 confusion. Reverse FROM and TO arguments to be consistent with
21879 those of memcpy.
21880
21881 1994-11-10 David J. MacKenzie <djm@gnu.org>
21882
21883 * NEWS: reformat
21884
21885 * NEWS: New file.
21886
21887 * Makefile.in (DISTFILES): Include NEWS.
21888
21889 * Makefile.in (DISTFILES):
21890 Include install-sh, not install.sh.
21891
21892 * configure.in: Update to Autoconf v2 macro names.
21893
21894 1994-10-05 David J. MacKenzie <djm@gnu.org>
21895
21896 * Makefile.in: fix typo
21897
21898 * Makefile.in (prefix, exec_prefix):
21899 Let configure set them.
21900
21901 1994-09-28 David J. MacKenzie <djm@gnu.org>
21902
21903 * Makefile.in: Set datadir to $(prefix)/share.
21904
21905 1994-09-15 Richard Stallman <rms@gnu.org>
21906
21907 * src/bison.s1:
21908 Update copyright notice and GPL version.
21909
21910 1994-09-15 Richard Stallman <rms@gnu.org>
21911
21912 * bison.simple:
21913 Update copyright notice and GPL version.
21914
21915 1994-07-12 Richard Stallman <rms@gnu.org>
21916
21917 * src/reduce.c, src/reader.c:
21918 entered into RCS
21919
21920 1994-05-05 David J. MacKenzie <djm@gnu.org>
21921
21922 * Makefile.in: entered into RCS
21923
21924 1994-03-26 Richard Stallman <rms@gnu.org>
21925
21926 * src/bison.s1: entered into RCS
21927
21928 1994-03-26 Richard Stallman <rms@gnu.org>
21929
21930 * bison.simple: entered into RCS
21931
21932 1994-03-25 Richard Stallman <rms@gnu.org>
21933
21934 * src/main.c: entered into RCS
21935
21936 1994-03-24 Richard Stallman <rms@gnu.org>
21937
21938 * src/conflicts.c: entered into RCS
21939
21940 1994-01-02 Richard Stallman <rms@gnu.org>
21941
21942 * Makefile.in: *** empty log message ***
21943
21944 1993-11-21 Richard Stallman <rms@gnu.org>
21945
21946 * src/bison.s1: *** empty log message ***
21947
21948 1993-11-21 Richard Stallman <rms@gnu.org>
21949
21950 * doc/bison.texinfo: entered into RCS
21951
21952 * doc/bison.texinfo: *** empty log message ***
21953
21954 1993-11-21 Richard Stallman <rms@gnu.org>
21955
21956 * bison.simple: *** empty log message ***
21957
21958 1993-10-25 David J. MacKenzie <djm@gnu.org>
21959
21960 * doc/bison.texinfo: *** empty log message ***
21961
21962 1993-10-19 Richard Stallman <rms@gnu.org>
21963
21964 * src/bison.s1: *** empty log message ***
21965
21966 1993-10-19 Richard Stallman <rms@gnu.org>
21967
21968 * bison.simple: *** empty log message ***
21969
21970 1993-10-14 Richard Stallman <rms@gnu.org>
21971
21972 * src/bison.s1: *** empty log message ***
21973
21974 1993-10-14 Richard Stallman <rms@gnu.org>
21975
21976 * bison.simple: *** empty log message ***
21977
21978 1993-09-14 David J. MacKenzie <djm@gnu.org>
21979
21980 * doc/bison.texinfo: *** empty log message ***
21981
21982 1993-09-13 Noah Friedman <friedman@gnu.org>
21983
21984 * Makefile.in: *** empty log message ***
21985
21986 1993-09-10 Richard Stallman <rms@gnu.org>
21987
21988 * src/conflicts.c: *** empty log message ***
21989
21990 * src/system.h: entered into RCS
21991
21992 1993-09-10 Richard Stallman <rms@gnu.org>
21993
21994 * doc/bison.1: entered into RCS
21995
21996 1993-09-06 Noah Friedman <friedman@gnu.org>
21997
21998 * src/version.c: entered into RCS
21999
22000 1993-09-06 Noah Friedman <friedman@gnu.org>
22001
22002 * Makefile.in: *** empty log message ***
22003
22004 1993-07-30 David J. MacKenzie <djm@gnu.org>
22005
22006 * Makefile.in: *** empty log message ***
22007
22008 1993-07-24 Richard Stallman <rms@gnu.org>
22009
22010 * src/bison.s1: *** empty log message ***
22011
22012 1993-07-24 Richard Stallman <rms@gnu.org>
22013
22014 * bison.simple: *** empty log message ***
22015
22016 1993-07-08 David J. MacKenzie <djm@gnu.org>
22017
22018 * Makefile.in: *** empty log message ***
22019
22020 1993-07-04 Richard Stallman <rms@gnu.org>
22021
22022 * src/bison.s1: *** empty log message ***
22023
22024 1993-07-04 Richard Stallman <rms@gnu.org>
22025
22026 * bison.simple: *** empty log message ***
22027
22028 1993-06-26 David J. MacKenzie <djm@gnu.org>
22029
22030 * src/getargs.c: entered into RCS
22031
22032 1993-06-26 David J. MacKenzie <djm@gnu.org>
22033
22034 * doc/bison.texinfo: *** empty log message ***
22035
22036 * doc/bison.1: New file.
22037
22038 1993-06-25 Richard Stallman <rms@gnu.org>
22039
22040 * src/getargs.c: New file.
22041
22042 1993-06-16 Richard Stallman <rms@gnu.org>
22043
22044 * src/bison.s1: *** empty log message ***
22045
22046 1993-06-16 Richard Stallman <rms@gnu.org>
22047
22048 * bison.simple: *** empty log message ***
22049
22050 1993-06-03 Richard Stallman <rms@gnu.org>
22051
22052 * src/bison.s1: New file.
22053
22054 1993-06-03 Richard Stallman <rms@gnu.org>
22055
22056 * doc/bison.texinfo: *** empty log message ***
22057
22058 1993-06-03 Richard Stallman <rms@gnu.org>
22059
22060 * bison.simple: New file.
22061
22062 1993-05-19 Richard Stallman <rms@gnu.org>
22063
22064 * doc/bison.texinfo: New file.
22065
22066 1993-05-07 Noah Friedman <friedman@gnu.org>
22067
22068 * Makefile.in: *** empty log message ***
22069
22070 1993-04-28 Noah Friedman <friedman@gnu.org>
22071
22072 * src/reader.c: *** empty log message ***
22073
22074 1993-04-23 Noah Friedman <friedman@gnu.org>
22075
22076 * src/alloc.h: entered into RCS
22077
22078 1993-04-20 David J. MacKenzie <djm@gnu.org>
22079
22080 * src/version.c: *** empty log message ***
22081
22082 * src/files.c, src/allocate.c:
22083 entered into RCS
22084
22085 * src/reader.c: *** empty log message ***
22086
22087 * src/lex.c: entered into RCS
22088
22089 * src/conflicts.c: New file.
22090
22091 * src/symtab.c: entered into RCS
22092
22093 * src/alloc.h: New file.
22094
22095 * src/LR0.c: entered into RCS
22096
22097 1993-04-18 Noah Friedman <friedman@gnu.org>
22098
22099 * src/reader.c: New file.
22100
22101 * src/version.c: *** empty log message ***
22102
22103 1993-04-18 Noah Friedman <friedman@gnu.org>
22104
22105 * Makefile.in: *** empty log message ***
22106
22107 1993-04-17 Noah Friedman <friedman@gnu.org>
22108
22109 * Makefile.in: *** empty log message ***
22110
22111 1993-04-15 Richard Stallman <rms@gnu.org>
22112
22113 * src/main.c, src/files.c:
22114 New file.
22115
22116 1993-04-15 Noah Friedman <friedman@gnu.org>
22117
22118 * configure.in: entered into RCS
22119
22120 * configure.in: *** empty log message ***
22121
22122 * configure.in: New file.
22123
22124 1993-04-14 Richard Stallman <rms@gnu.org>
22125
22126 * Makefile.in: New file.
22127
22128 1993-04-13 Richard Stallman <rms@gnu.org>
22129
22130 * src/version.c: New file.
22131
22132 1993-03-25 Richard Stallman <rms@gnu.org>
22133
22134 * src/output.c: entered into RCS
22135
22136 1992-09-25 Richard Stallman <rms@gnu.org>
22137
22138 * configure.bat: entered into RCS
22139
22140 1992-06-22 Richard Stallman <rms@gnu.org>
22141
22142 * src/vmsgetargs.c: entered into RCS
22143
22144 1992-06-22 Richard Stallman <rms@gnu.org>
22145
22146 * doc/bison.rnh: entered into RCS
22147
22148 1992-04-20 David J. MacKenzie <djm@gnu.org>
22149
22150 * README: entered into RCS
22151
22152 1992-01-22 Richard Stallman <rms@gnu.org>
22153
22154 * src/machine.h: entered into RCS
22155
22156 1991-12-21 Richard Stallman <rms@gnu.org>
22157
22158 * src/lalr.c, src/closure.c:
22159 entered into RCS
22160
22161 1991-12-20 Richard Stallman <rms@gnu.org>
22162
22163 * src/state.h: entered into RCS
22164
22165 1991-12-18 Richard Stallman <rms@gnu.org>
22166
22167 * src/print.c, src/nullable.c, src/derives.c:
22168 entered into RCS
22169
22170 1991-11-03 David J. MacKenzie <djm@gnu.org>
22171
22172 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22173 entered into RCS
22174
22175 1988-09-09 Richard Stallman <rms@gnu.org>
22176
22177 * src/bison.hairy: entered into RCS
22178
22179 1987-12-16 Richard Stallman <rms@gnu.org>
22180
22181 * REFERENCES: entered into RCS
22182
22183
22184 -----
22185
22186 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
22187 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
22188 Free Software Foundation, Inc.
22189
22190 Copying and distribution of this file, with or without
22191 modification, are permitted provided the copyright notice and this
22192 notice are preserved.