Paul Eggert [Mon, 27 Sep 2004 22:06:45 +0000 (22:06 +0000)]
Fix comment in latest checkin; there wasn't a bug.
Paul Eggert [Mon, 27 Sep 2004 22:04:13 +0000 (22:04 +0000)]
* src/parse-gram.y (add_param): Fix bug where NUL was mishandled.
Paul Eggert [Mon, 27 Sep 2004 22:03:42 +0000 (22:03 +0000)]
(add_param): Fix bug where NUL was mishandled.
Avoid the use of strchr to avoid future recurrences.
Akim Demaille [Mon, 27 Sep 2004 07:47:47 +0000 (07:47 +0000)]
* data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
Akim Demaille [Mon, 27 Sep 2004 07:45:09 +0000 (07:45 +0000)]
* data/lalr1.cc (b4_parse_param_decl_1): New.
(b4_parse_param_decl): Use it to have different names bw attribute
and argument names.
(b4_cc_constructor_call): Likewise.
Akim Demaille [Mon, 27 Sep 2004 07:42:04 +0000 (07:42 +0000)]
* src/parse-gram.y (add_param): Strip the leading and trailing
blanks from a formal argument declaration.
(YY_LOCATION_PRINT): New.
Akim Demaille [Fri, 24 Sep 2004 14:14:58 +0000 (14:14 +0000)]
* data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
after the location.
Akim Demaille [Fri, 24 Sep 2004 11:55:40 +0000 (11:55 +0000)]
* doc/bison.texinfo (Table of Symbols): Sort.
Akim Demaille [Tue, 21 Sep 2004 06:59:19 +0000 (06:59 +0000)]
* data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
the useless parentheses.
Suggested by Paul Eggert.
Akim Demaille [Mon, 20 Sep 2004 15:25:25 +0000 (15:25 +0000)]
Let the initial-action act on the look-ahead, and use it for the
"initial push" (corresponding to an hypothetical beginning-of-file).
And let lalr1.cc honor %initial-action.
* doc/bison.texinfo (Initial Action Decl): Clarify, and add an
example.
* data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
(Parser::Parser): Remove the ctor that used to initialize it.
(Parser::parse): Like in the other skeletons, issue the "starting
parse" message before any action.
Honor %initial-action.
Initialize the stacks with the lookahead.
* data/yacc.c: Let $$ and @$ in %initial-action designate the
look-ahead.
Push them in the stacks.
* tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
Akim Demaille [Mon, 20 Sep 2004 14:29:31 +0000 (14:29 +0000)]
* doc/bison.texinfo (Initial Action Decl): New.
Akim Demaille [Mon, 20 Sep 2004 12:24:45 +0000 (12:24 +0000)]
* data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
clearer criterion to define it.
(parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
When reducing on an empty RHS, use the latest stacked location as
location.
yylloc is not always available.
* data/glr.c: Likewise.
Also, honor initial-actions.
Akim Demaille [Mon, 20 Sep 2004 09:32:55 +0000 (09:32 +0000)]
* data/yacc.c (YY_LOCATION_PRINT): New.
Define when we know YYLTYPE's structure, i.e., when the default
YYLLOC_DEFAULT is used.
* data/c.m4 (b4_yysymprint_generate): Use it.
* data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
value of the result.
(error_start_): Replace with...
(error_range_): this location array.
This allows to replace code relying on the implementation of
locations by portable code.
* data/yacc.c (yylerrsp): Replace with...
(yyerror_range): this.
Every time a token is popped, update yyerror_range[0], to have an
accurate location for the error token.
* data/glr.c (YY_LOCATION_PRINT): New.
(yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
deference a pointer.
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
report the location in %printers.
* src/scan-skel.l: Instead of abort, report error messages to ease
understanding skeleton scanning failures.
Akim Demaille [Thu, 16 Sep 2004 14:41:18 +0000 (14:41 +0000)]
* data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
(iterator, const_iterator): these, to be more in the C++ spirit.
Also, return reverse iterators so that when displaying the stack
we display its bottom first.
(Parser::stack_print_, Parser::reduce_print_): Match the messages
from yacc.c.
We should probably use vector here though.
Akim Demaille [Thu, 16 Sep 2004 14:14:27 +0000 (14:14 +0000)]
Have more complete shift traces.
* data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
to report Shifts instead of ad hoc YYDPRINTF invocations,
including for the error token.
* data/lalr1.cc (symprint_): Output the location.
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
output the location within the %printer.
Activate GLR tests, at least to make sure they compile properly.
They still don't pass though.
* tests/calc.at: Adjust expect verbose output, since now "Entering
state..." is on a different line than the "Shifting" message.
Akim Demaille [Wed, 8 Sep 2004 14:36:25 +0000 (14:36 +0000)]
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
Bison directive from the Bison file to the invocation of this
macro, so that these directives are passed to
AT_BISON_OPTION_PUSHDEFS to get correct help macros.
Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
Move the AT_SETUP/AT_CLEANUP outside, to report as test title
the extra Bison directives instead of the whole series.
Change the grammar so that there are recoverable errors, and
unrecoverable errors. Now we can have the parser give up before
consuming the whole input. As a result we now can observe that
the lookahead is freed when needed.
Change the parser source to parse argv[1] instead of a hard coded
string.
Simplify yylex, and give a value and location to EOF.
Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
passed directives already coded in the file.
Add some tests to check the location of "error".
For some tests, the C++ parser is correct, and not yacc.c.
For other tests, they provide different, but unsatisfying, values,
so keep the C++ value so that at least one parser is "correct"
according to the test suite.
(Actions after errors): Remove, this is subsumed by the
AT_CHECK_PRINTER_AND_DESTRUCTOR series.
Akim Demaille [Mon, 6 Sep 2004 14:32:05 +0000 (14:32 +0000)]
* data/lalr1.cc: Adjust the indentation of the labels.
Use it.
Akim Demaille [Mon, 6 Sep 2004 10:29:52 +0000 (10:29 +0000)]
* data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
argument, an informative message.
Call YY_SYMBOL_PRINT.
Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
* data/lalr1.cc (destruct_): Likewise.
In addition, no longer depend on b4_yysymprint_generate and
b4_yydestruct_generate to generate these functions, do it "by
hand".
Akim Demaille [Mon, 6 Sep 2004 07:48:20 +0000 (07:48 +0000)]
* data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
invoked, yydestruct the lookahead.
* tests/calc.at (Calculator $1): Update the expected lengths of
traces: there is an added line for the discarded lookahead.
* doc/bison.texinfo (Destructor Decl): Some rewording.
Define "discarded" symbols.
Akim Demaille [Thu, 2 Sep 2004 14:30:55 +0000 (14:30 +0000)]
* data/lalr1.cc (translate_, destruct_): No reason to be static.
Akim Demaille [Thu, 2 Sep 2004 14:27:02 +0000 (14:27 +0000)]
* data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
(YYDSYMPRINTF): Rename as...
(YY_SYMBOL_PRINT): this.
* data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
two.
Use it instead of direct symprint_ calls.
(yybackup): Tweak the "Now at end of input" case to match yacc.c's
one.
Akim Demaille [Thu, 2 Sep 2004 13:25:23 +0000 (13:25 +0000)]
Fix ChangeLog.
Akim Demaille [Thu, 2 Sep 2004 13:04:11 +0000 (13:04 +0000)]
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
%printer calls to use cdebug_ when using lalr1.cc.
* data/lalr1.cc (b4_yysymprint_generate): New.
Akim Demaille [Mon, 30 Aug 2004 07:50:08 +0000 (07:50 +0000)]
* data/glr.c: Guard the declarations of yypstack and yypdumpstack
with #ifdef YYDEBUG.
Akim Demaille [Thu, 26 Aug 2004 13:05:41 +0000 (13:05 +0000)]
* doc/bison.texinfo (Implementing Loops): Rename as...
(Implementing Gotos/Loops): this.
Paul Eggert [Wed, 18 Aug 2004 20:35:31 +0000 (20:35 +0000)]
Regenerate.
Paul Eggert [Fri, 13 Aug 2004 14:29:05 +0000 (14:29 +0000)]
Adjust to latest gnulib.
Paul Eggert [Fri, 13 Aug 2004 14:28:43 +0000 (14:28 +0000)]
Adjust to latest gnulib.
(gnulib_modules): Add xalloc-die.
Set LC_ALL=C so that file names sort consistently.
Prefer the gnulib copies of gettext.m4, glibc21.m4,
inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
uintmax_t.m4, ulonglong.m4.
(intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
po.m4 since we are now using _gl.m4 instead.
Paul Eggert [Wed, 11 Aug 2004 04:19:14 +0000 (04:19 +0000)]
Remove src/scan-action.l.
Paul Eggert [Sun, 8 Aug 2004 04:57:06 +0000 (04:57 +0000)]
uniqstr wasn't being used for handle_syncline like it should.
Paul Eggert [Thu, 22 Jul 2004 14:42:11 +0000 (14:42 +0000)]
Fix bug with non-%union parsers that have printers or destructors,
which led to a Bison core dump.
Paul Eggert [Thu, 22 Jul 2004 14:40:21 +0000 (14:40 +0000)]
(_AT_CHECK_PRINTER_AND_DESTRUCTOR,
AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
UNION-FLAG. All callers changed.
(_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
Use type char, not unsigned int, when declaring an array of char;
this lets us remove a cast.
(Printers and Destructors): Add non-%union test cases.
Paul Eggert [Thu, 22 Jul 2004 14:39:58 +0000 (14:39 +0000)]
(symbol_destructors_output, symbol_printers_output):
Don't assume %union.
Paul Eggert [Thu, 22 Jul 2004 14:39:34 +0000 (14:39 +0000)]
(yystype) [defined YYSTYPE]: Define to YYSTYPE, not to our own type.
Paul Eggert [Thu, 22 Jul 2004 14:39:03 +0000 (14:39 +0000)]
(b4_symbol_actions): Don't assume %union was used.
Paul Eggert [Tue, 22 Jun 2004 06:50:29 +0000 (06:50 +0000)]
Reorganize GLR section a bit.
Paul Eggert [Mon, 21 Jun 2004 21:01:42 +0000 (21:01 +0000)]
One more "lookahead" -> "look-ahead" change.
Paul Eggert [Mon, 21 Jun 2004 20:55:20 +0000 (20:55 +0000)]
New section "Simple GLR Parsers".
Paul Eggert [Mon, 21 Jun 2004 20:51:32 +0000 (20:51 +0000)]
Regenerate.
Paul Eggert [Mon, 21 Jun 2004 20:20:31 +0000 (20:20 +0000)]
Use "look-ahead" instead of "lookahead", consistently.
Paul Eggert [Thu, 3 Jun 2004 22:38:23 +0000 (22:38 +0000)]
Update location of patched M4 distribution.
Paul Eggert [Thu, 3 Jun 2004 22:28:57 +0000 (22:28 +0000)]
Update location of patched M4 version.
Paul Eggert [Sun, 30 May 2004 18:58:00 +0000 (18:58 +0000)]
Don't assume the C++ compiler takes the same arguments as the C compiler.
Paul Eggert [Sun, 30 May 2004 00:56:57 +0000 (00:56 +0000)]
Fix some "make check" problems with Tru64 C++.
Paul Eggert [Sat, 29 May 2004 07:16:29 +0000 (07:16 +0000)]
Workaround for SGI C++ compiler.
Paul Eggert [Thu, 27 May 2004 20:51:16 +0000 (20:51 +0000)]
Increase prerequisite version numbers to match what the code really needs.
Paul Eggert [Thu, 27 May 2004 07:40:12 +0000 (07:40 +0000)]
Regenerate.
Paul Eggert [Thu, 27 May 2004 07:38:17 +0000 (07:38 +0000)]
* src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug.
* configure.ac (AC_PREREQ): Bump to 2.58.
Paul Eggert [Wed, 26 May 2004 19:25:21 +0000 (19:25 +0000)]
* configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to 0.11.5.
* bootstrap: Remove gettext version checking.
Paul Eggert [Wed, 26 May 2004 17:45:45 +0000 (17:45 +0000)]
Also mention that %union can depend on prerequisite types.
Paul Eggert [Wed, 26 May 2004 07:20:06 +0000 (07:20 +0000)]
* README: Mention GNU m4 1.4 bugs and Akim's patched version.
* README-alpha: Don't tell people not to package this.
Paul Eggert [Wed, 26 May 2004 06:46:02 +0000 (06:46 +0000)]
* bootstrap: Don't assume $(...) works; use `...` instead.
Paul Eggert [Tue, 25 May 2004 19:09:01 +0000 (19:09 +0000)]
* doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's put into
the -d output file.
Paul Eggert [Tue, 25 May 2004 05:43:14 +0000 (05:43 +0000)]
Undo change made earlier today: it caused autopoint to not bring
in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
autopoint's.
Paul Eggert [Mon, 24 May 2004 20:08:54 +0000 (20:08 +0000)]
The gettext version checking is causing more trouble than it's curing;
remove it.
Paul Eggert [Mon, 24 May 2004 06:58:02 +0000 (06:58 +0000)]
Ensure that the C++ compiler used for testing actually works on a
simple test program; if not, skip the C++-related tests.
Paul Eggert [Fri, 21 May 2004 22:23:04 +0000 (22:23 +0000)]
Output yylloc macro defn in glr.c even if locations are not being generated.
Paul Eggert [Fri, 21 May 2004 22:12:21 +0000 (22:12 +0000)]
* configure.ac (AC_INIT): Update to 1.875e.
Paul Eggert [Fri, 21 May 2004 21:03:41 +0000 (21:03 +0000)]
Version 1.875d.
Paul Eggert [Fri, 7 May 2004 07:35:10 +0000 (07:35 +0000)]
Use size_t (not unsigned int) for hashes, since the gnulib hash module
now uses size_t.
Paul Eggert [Mon, 3 May 2004 23:10:25 +0000 (23:10 +0000)]
Don't DEFUN AM_INTL_SUBDIR twice.
Paul Eggert [Mon, 3 May 2004 07:58:53 +0000 (07:58 +0000)]
Regenerate.
Paul Eggert [Mon, 3 May 2004 07:57:06 +0000 (07:57 +0000)]
* src/parse-gram.y: Put copyright notice inside %{ %} so it
gets copied to the output file.
Paul Eggert [Mon, 3 May 2004 07:42:52 +0000 (07:42 +0000)]
Reject unescaped newlines in strings.
Paul Eggert [Mon, 3 May 2004 07:36:12 +0000 (07:36 +0000)]
Remove more 'intl'-related files while bootstrapping.
Paul Eggert [Wed, 28 Apr 2004 20:00:56 +0000 (20:00 +0000)]
Get files from the gnulib and po repositories, instead of relying
on them being in our CVS. Upgrade to latest versions of gnulib and Automake.
Paul Eggert [Wed, 28 Apr 2004 19:52:27 +0000 (19:52 +0000)]
(GZIP_ENV): Don't use --rsyncable if gzip doesn't
support it. (The latest stable gzip doesn't.)
Paul Eggert [Wed, 28 Apr 2004 06:52:51 +0000 (06:52 +0000)]
Remove more K&R C support.
Paul Eggert [Wed, 28 Apr 2004 06:30:05 +0000 (06:30 +0000)]
Rewrite so that subpipe.h can stand alone. Assume C89 or better.
Paul Eggert [Wed, 28 Apr 2004 06:22:58 +0000 (06:22 +0000)]
Remove PARAMS.
Paul Eggert [Wed, 28 Apr 2004 06:15:34 +0000 (06:15 +0000)]
Remove PARAMS and upgrade to latest obstack.h.
Paul Eggert [Wed, 28 Apr 2004 06:06:31 +0000 (06:06 +0000)]
(_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
unused declaration.
Paul Eggert [Wed, 28 Apr 2004 06:03:54 +0000 (06:03 +0000)]
(%union synch line): Put a dummy member in
the union, because empty unions aren't allowed in C.
Caught by GCC 3.4.0.
Paul Eggert [Wed, 28 Apr 2004 05:48:39 +0000 (05:48 +0000)]
(Parser::stos_) [! YYDEBUG]: Define even in this
case, as stos_ is now used by destructors due to the 2004-02-09
change.
Paul Eggert [Tue, 13 Apr 2004 17:43:15 +0000 (17:43 +0000)]
Update copyright to 2004.
Paul Eggert [Tue, 13 Apr 2004 17:42:59 +0000 (17:42 +0000)]
* src/conflicts.c (conflicts_print): Correct format string typo:
use `%%' to produce literal `%'. (trivial change)
Paul Eggert [Wed, 31 Mar 2004 00:41:30 +0000 (00:41 +0000)]
Regenerate.
Paul Eggert [Wed, 31 Mar 2004 00:37:21 +0000 (00:37 +0000)]
Use 'short int' rather than 'short', and similarly for 'long', 'unsigned', etc.
Paul Eggert [Tue, 30 Mar 2004 08:11:20 +0000 (08:11 +0000)]
(version): Update copyright year to 2004.
Paul Hilfinger [Fri, 26 Mar 2004 22:41:16 +0000 (22:41 +0000)]
* src/parse-gram.y: Define PERCENT_EXPECT_RR.
(declaration): Replace expected_conflicts with expected_sr_conflicts.
Add %expect-rr rule.
* src/scan-gram.l: Recognize %expect-rr.
* src/conflicts.h (expected_sr_conflicts): Rename from
expected_conflicts.
(expected_rr_conflicts): Declare.
* src/conflicts.c (expected_sr_conflicts): Rename from
expected_conflicts.
(expected_rr_conflicts): Define.
(conflicts_print): Check r/r conflicts against expected_rr_conflicts
for GLR parsers.
Use expected_sr_conflicts in place of expected_conflicts.
Warn if expected_rr_conflicts used in non-GLR parser.
* doc/bison.texinfo: Add documentation for %expect-rr.
Paul Eggert [Mon, 8 Mar 2004 20:49:34 +0000 (20:49 +0000)]
Add support for hex token numbers.
Paul Eggert [Wed, 25 Feb 2004 21:13:00 +0000 (21:13 +0000)]
(AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from compilers.
Paul Eggert [Wed, 25 Feb 2004 20:23:33 +0000 (20:23 +0000)]
Add a marker for when 1.875c was published.
Alexandre Duret-Lutz [Mon, 9 Feb 2004 21:31:42 +0000 (21:31 +0000)]
Support %destructor and merge error locations in lalr1.cc.
* data/lalr1.cc (b4_cxx_destruct_def): New macro.
(Parser::stos_): Define unconditionally.
(Parser::destruct_): New method. Generate its body with
b4_yydestruct_generate.
(Parser::error_start_): New attribute.
(Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
token which are discarded.
(Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
error_start_ when erroneous token are discarded.
(Parser::parse) <yyerrlab1>: Compute the location of the error
token so that it covers all the discarded tokens.
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
it can be called with `%skeleton "lalr1.cc"', and do that.
Paul Eggert [Mon, 2 Feb 2004 22:52:54 +0000 (22:52 +0000)]
Regenerate.
Paul Eggert [Mon, 2 Feb 2004 22:36:49 +0000 (22:36 +0000)]
Replace INCLUDES with AM_CPPFLAGS, fixing a bug in src/Makefile.am
reported by Paul Hilfinger.
Paul Eggert [Mon, 2 Feb 2004 22:35:53 +0000 (22:35 +0000)]
(yytokenName): Bullet-proof against YYEMPTY token.
(yyreportSyntaxError): Handle case where lookahead token is
YYEMPTY.
Paul Hilfinger [Wed, 14 Jan 2004 01:40:12 +0000 (01:40 +0000)]
data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
resulting parsers are compilable with C++.
Paul Eggert [Wed, 24 Dec 2003 08:33:39 +0000 (08:33 +0000)]
Log today's changes.
Paul Eggert [Wed, 24 Dec 2003 08:32:43 +0000 (08:32 +0000)]
Add Makevars.template, stamp-po.
Remove stamp-cat-id.
Paul Eggert [Wed, 24 Dec 2003 08:30:45 +0000 (08:30 +0000)]
($(TESTSUITE)): Remove warning about ignoring
multiple inclusion warnings.
Paul Eggert [Wed, 24 Dec 2003 08:26:02 +0000 (08:26 +0000)]
Require Autoconf 2.59, and don't include local.at twice since
Autoconf 2.59 yells about it for some reason.
Paul Eggert [Wed, 24 Dec 2003 08:17:05 +0000 (08:17 +0000)]
(Torturing the Scanner): Don't use \x0 or \0 in
Bison tokens, as this runs afoul of the 2003-10-07 change that
disallowed NUL bytes in character constants or string literals.
Paul Eggert [Wed, 24 Dec 2003 07:55:25 +0000 (07:55 +0000)]
(output_skeleton): Rename local var.
Paul Eggert [Wed, 24 Dec 2003 07:52:17 +0000 (07:52 +0000)]
Sync with Automake 1.8.
Akim Demaille [Tue, 2 Dec 2003 17:08:31 +0000 (17:08 +0000)]
* doc/bison.texinfo (How Can I Reset the Parser): More about start
conditions.
From Bruno Haible.
Alexandre Duret-Lutz [Tue, 18 Nov 2003 19:14:05 +0000 (19:14 +0000)]
* doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
Paul Eggert [Tue, 21 Oct 2003 17:42:48 +0000 (17:42 +0000)]
a -> an (minor typo fix)
Paul Eggert [Tue, 7 Oct 2003 23:34:20 +0000 (23:34 +0000)]
Don't run 'testsuite --clean' if testsuite doesn't exist.
Paul Eggert [Tue, 7 Oct 2003 07:32:57 +0000 (07:32 +0000)]
Do not allow NUL bytes in string literals or character constants.