Commit Graph

1046 Commits

Author SHA1 Message Date
Paul Eggert
c6ae27df0b * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
This fixes a problem reported by John Bowman when the Compaq/HP
Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
-ansi -Wall -gall).
* data/yacc.c (union yyalloc): Likewise.
(YYCOPY): Do not evaluate __GNUC__ unless it is defined.
2003-05-25 06:44:31 +00:00
Paul Eggert
d08290769c Switch from 'int' to 'bool' where that makes sense. 2003-05-24 19:16:02 +00:00
Paul Eggert
6b2584b7a2 Require a semicolon after a grammar declaration, in the interest of
possible future changes to the Bison input language.
Do not allow a stray semicolon at the start of the grammar.
Allow one or more semicolons after any rule, including
just before "|" as required by POSIX.
2003-05-14 19:30:22 +00:00
Alexandre Duret-Lutz
caf37a3666 %parse-param support for lalr1.cc.
* data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
b4_cc_constructor_calls, b4_cc_constructor_call,
b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
definitions.
(yy::b4_parser_class_name::b4_parser_class_name): Take extra
parse-param arguments.
(yy::b4_parser_class_name): Declare instance variables to
hold parse-param arguments.
* tests/calc.at: s/value/semantic_value/ because value clashes
with a member of yy::b4_parser_class_name.  Adjust C++ code
to handle %parse-param.  Enable %parse-param test in C++.
2003-05-14 18:41:48 +00:00
Paul Eggert
3ab370773d * doc/bison.texinfo (How Can I Reset @code{yyparse}):
Minor English and technical fixups.
2003-05-12 19:35:13 +00:00
Paul Eggert
163ab32161 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes C89. 2003-05-05 20:39:42 +00:00
Paul Eggert
e743727fcd * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
Do not overrun array bounds.
2003-05-04 06:30:14 +00:00
Akim Demaille
916708d59e * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
* src/getargs.c, src/getargs.h: here, as bool, not int.
(nondeterministic_parser): New.
* src/parse-gram.y, src/scan-gram.l: Support
%nondeterministic-parser.
* src/output.c (prepare): Use nondeterministic_parser instead
of glr_parser where appropriate.
* src/tables.c (conflict_row, action_row, save_row)
(token_actions, token_actions, pack_vector): Ditto.
2003-04-29 12:57:36 +00:00
Akim Demaille
a06ea4aa98 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New. 2003-04-29 09:57:34 +00:00
Akim Demaille
211074caca * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
with %pure-parser and %locations to exercise the patch from Yakov
Markovitch below.
2003-04-29 08:41:13 +00:00
Paul Eggert
6175ffe321 * data/yacc.c: (b4_lex_param): Corrected for the case where
%lex-param is provided and %pure-parser isn't.
2003-04-29 06:04:56 +00:00
Paul Eggert
b1e9585744 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
<http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
2003-04-28 06:04:39 +00:00
Paul Eggert
3470c57bea * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
Declare to be of type suitable for the ninf value itself.
2003-04-27 05:57:13 +00:00
Paul Eggert
acda9df6f9 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR invokes it. 2003-04-27 05:28:21 +00:00
Paul Eggert
b5250f2635 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch to gnulib. 2003-04-22 03:33:29 +00:00
Paul Eggert
089ac0f11c * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
Fix obvious typo that results in uncompilable GLR parsers
when both %pure-parser and %locations are used.  (trivial change)
2003-04-21 19:37:40 +00:00
Paul Eggert
1b8f2fff2a Don't invoke unput from scan-gram.l; it ran into a POSIX-compatibility
bug in flex 2.5.31.
2003-04-18 07:27:15 +00:00
Paul Eggert
5ededac618 Fix regression reported by Werner Lemberg in
<http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2003-04-18 05:11:25 +00:00
Akim Demaille
b8be913233 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file. 2003-03-31 09:46:21 +00:00
Akim Demaille
d423d46080 * src/output.c (prepare_symbols): Avoid trailing spaces in the
output.
2003-03-31 09:17:40 +00:00
Akim Demaille
c7e441b49c * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
From Paul Hilfinger.
2003-03-31 07:10:44 +00:00
Akim Demaille
231897ad21 * m4/error.m4: Do not put under dynamic conditions some code which
expansion is under static control.
2003-03-29 13:50:44 +00:00
Akim Demaille
22a74fece3 Restore a missing ChangeLog entry. 2003-03-29 13:30:15 +00:00
Akim Demaille
5b06606339 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New. 2003-03-29 13:29:41 +00:00
Paul Eggert
0eee27e7b7 Update .cvsignore files. 2003-03-14 01:35:43 +00:00
Paul Eggert
537636c7e5 Fix "Bison blows chunks on empty file" bug.
Work around SunOS 4.1.4 porting problem with <sys/resource.h>.
Don't check for sys/wait.h twice, with two different algorithms.
2003-03-13 07:13:05 +00:00
Paul Eggert
f61aad9399 Merge changes from gnulib. This was prompted because the CVS
snapshot of Bison didn't build on Solaris 7 due to strnlen problems.
2003-03-12 23:08:11 +00:00
Akim Demaille
d2ffe11637 * ro.po: New. 2003-03-03 08:59:34 +00:00
Akim Demaille
052826fdd1 * doc/bison.texinfo (Table of Symbols): Reactivate the
documentation for %lex-param, and %parse-param.
2003-03-02 15:11:43 +00:00
Akim Demaille
c47495657b * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
generate verbose error messages.
Use the number of tokens as an upper bound in yytname, as it
cannot be a non terminal.
2003-03-02 13:39:44 +00:00
Akim Demaille
d5286af19b * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
message.
2003-03-02 13:36:55 +00:00
Akim Demaille
95b52400d5 Typo. 2003-03-02 11:27:59 +00:00
Akim Demaille
22e304a6da Write a test the yycheck overrun reported by Andrew Suffield.
* tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
Use them to exercise yycheck overrun.
Based on Andrew Suffield's grammar.
2003-03-02 11:22:19 +00:00
Akim Demaille
67a25fed4c Create tests/local.at for Bison generic testing macros.
* tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
* tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
This new file.
* tests/calc.at (AT_CHECK_CALC): Adjust.
* tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
(AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
* tests/local.at: here.
(AT_COMPILE_CXX): Tags the tests using it as c++.
Ignore the test if CXX is not functional.
2003-03-02 11:14:07 +00:00
Paul Eggert
9c2b381f79 Minor improvements to today's scan-gram.l bugfix. 2003-03-02 06:56:06 +00:00
Akim Demaille
0433ba88f9 * src/scan-gram.l (code_start): Always initialize it when entering
into yylex, as SC_EPILOGUE is activated *before* the corresponding
yylex invocation.  An alternative would be making it static, but
then it starts with the second %%'s beginning, instead of its end.
2003-03-01 10:55:31 +00:00
Paul Eggert
b305ea6918 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
around a UnixWare 7.1.1 porting bug reported by John Hughes in
<http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
2003-02-28 09:02:12 +00:00
Paul Eggert
c3d25e01e8 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
Remove Sequent/Pyramid discussion (nobody uses them any more).
Merge VMS and MS-DOS discussion; these ports may well be dead
but let's keep mentioning them for now.  Put <> around email
addresses.  Add copyright notice.
2003-02-26 21:27:11 +00:00
Paul Eggert
c267ffbced yylineno -> yylno to avoid collision with flex.
Sync depcomp with Automake 1.7.3.
2003-02-25 07:58:42 +00:00
Paul Eggert
ba1ecc079b Stick to ASCII for now. 2003-02-24 21:06:17 +00:00
Akim Demaille
f939fc12fe * data/lalr1.cc: Use temporary variables instead of casts to
change integer types.
Suggested by Paul Eggert.
2003-02-21 08:13:37 +00:00
Akim Demaille
95923bd6a6 * doc/bison.texinfo: Use "location" consistently to refer to @n,
to avoid confusions with lalr1.cc's notion of Position.
Suggested by Paul Eggert.
2003-02-21 08:07:57 +00:00
Akim Demaille
2cdc240eeb * data/lalr1.cc (position.hh): Make sure "columns" never pushes
before initial_columns.
(location.hh): Use consistent variable names when defining the
operator<<.
Use "last" so that we subtract from Positions, not from unsigned.
2003-02-20 14:42:43 +00:00
Akim Demaille
5d00311619 * data/lalr1.cc (position.hh): New subfile, including the extended
and Doxygen'ed documentation of class Position.
(location.hh): Use it.
Document a` la Doxygen.
With the help of Benoît Perrot.
2003-02-20 13:36:08 +00:00
Akim Demaille
d02b25f99b * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
AT_YACC_IF.
Redefine AT_YYERROR_SEES_LOC_IF using it.
(_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
not defined.
Don't use the location in yy::Parser::error_ and
yy::Parser::print_ when not %locations.
Activate more lalr1.cc tests.
2003-02-20 08:14:27 +00:00
Akim Demaille
0d1c3a04b7 * data/lalr1.cc: When displaying a line number, be sure to make it
an int.
2003-02-19 14:55:14 +00:00
Akim Demaille
60a777aa24 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
Remove, useless.
(YYABORT, YYACCEPT, YYERROR): New.
* tests/calc.at: Renable the lalr1.cc test.
2003-02-19 14:33:27 +00:00
Akim Demaille
0b86fc416c * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
error recovery, mixing with/without pops and discarding of the
lookahead.
Exercise YYERROR.
Disable the lalr1.cc tests as currently it doesn't support YYERROR.
2003-02-19 13:40:53 +00:00
Paul Eggert
da99a5dc03 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
* tests/testsuite.at (AT_COMPILE): Use them.
This fixes the testsuite problem reported by Robert Lentz in
<http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
2003-02-18 05:10:12 +00:00
Paul Eggert
93b8c255e8 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
Avoid subscript error in yycheck.  Bug reported by Andrew Suffield in
<http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
* data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
Check for malloc failure, for consistency with yacc.c.
(yytname_size): Remove, for consistency with yacc.c.

The bug still remains in data/lalr1.cc, as I didn't have time
to fix it there.
2003-02-13 07:15:52 +00:00