Commit Graph
36 Commits
Author SHA1 Message Date
Paul Eggert 70bcf94ae8 * src/bison.simple (YYCOPY): New macro.
(YYSTACK_RELOCATE): Use it.
	Remove Type arg; no longer needed.  All callers changed.
	(yymemcpy): Remove; no longer needed.
2002-03-20 07:20:15 +00:00
Paul Eggert 41ee433e39 (YYCOPY): New macro.
(YYSTACK_RELOCATE): Use it.
Remove Type arg; no longer needed.  All callers changed.
(yymemcpy): Remove; no longer needed.
2002-03-20 07:18:54 +00:00
Paul Eggert 9bd1a920de * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
* doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
* Makefile.in, aclocal.m4, config.hin, configure,
config/Makefile.in, config/depcomp, config/install-sh,
doc/Makefile.am, lib/Makefile.in, m4/Makefile.in, src/Makefile.in,
tests/Makefile.in: Regenerate using Automake 1.6.
2002-03-19 10:55:47 +00:00
Paul Eggert 334414e7f8 Regenerate using Automake 1.6. 2002-03-19 10:54:32 +00:00
Paul Eggert 7bbd91208c (AUTOMAKE_OPTIONS): Remove. 2002-03-19 10:50:32 +00:00
Paul Eggert 078493afa4 (AUTOMAKE_OPTIONS): 1.6. 2002-03-19 10:49:23 +00:00
Paul Eggert 897c1dd9a9 Fix the problem with union yyalloc and C++.
* src/bison.simple (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES,
YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or if
this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
constructors or destructors.
(yymemcpy) [! defined YYSTACK_RELOCATE]: Do not define; not needed.
(yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.

* src/reader.c (parse_union_decl): Define YYSTYPE_IS_TRIVIAL if we
use our YYSTYPE.  It must be trivial, or our own union wouldn't be
valid C++ anyway.
(readgram): Define YYSTYPE_IS_TRIVIAL if it is int.
(reader_output_yylsp): Define YYLTYPE_IS_TRIVIAL if we use our
YYLTYPE.
2002-03-18 21:53:39 +00:00
Paul Eggert a6624adaee (parse_union_decl): Define YYSTYPE_IS_TRIVIAL if we use our YYSTYPE.
It must be trivial, or our own union wouldn't be valid C++ anyway.
(readgram): Define YYSTYPE_IS_TRIVIAL if it is int.
(reader_output_yylsp): Define YYLTYPE_IS_TRIVIAL if we use our YYLTYPE.
2002-03-18 21:53:05 +00:00
Paul Eggert 8afe2396ab (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
Do not define if yyoverflow is defined, or if this is a C++ parser and
either YYSTYPE or YYLTYPE has nontrivial constructors or destructors.
(yymemcpy) [! defined YYSTACK_RELOCATE]: Do not define; not needed.
(yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
2002-03-18 21:48:47 +00:00
Paul Eggert 039e51a37c Remove the support for C++ namespace cleanliness; it was
causing more problems than it was curing, since it didn't work
properly on some nonstandard C++ compilers.  This can wait
for a proper C++ parser.

* NEWS: Document this.
* doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
of C++, as it's treated like C now.
* src/bison.simple (YYSTD): Remove.
(YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
Treat C++ just like Standard C instead of trying to support
namespace cleanliness.
2002-02-14 20:17:53 +00:00
Paul Eggert 20b9de21c7 Revert the C++ namespace changes introduced in 1.31. 2002-02-14 20:16:29 +00:00
Paul Eggert 26ae304aa6 (YYSTD): Remove.
(YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
Treat C++ just like Standard C instead of trying to support
namespace cleanliness.
2002-02-14 20:10:54 +00:00
Paul Eggert 2d0bf7bdd5 (Bison Parser, Debugging): Remove special mention of C++, as it's
treated like C now.
2002-02-14 20:09:29 +00:00
Paul Eggert 4f55c2577d * src/bison.simple (YYSIZE_T): Do not define merely because
YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
On some platforms, <alloca.h> does not declare YYSTD (size_t).
2002-01-29 13:52:05 +00:00
Paul Eggert 62a21d52ce (YYSIZE_T): Do not define merely because YYSTACK_USE_ALLOCA is nonzero
or alloca or _ALLOCA_H are defined.  On some platforms, <alloca.h>
does not declare YYSTD (size_t).
2002-01-29 13:50:11 +00:00
Paul Eggert a22d7bd8d6 * doc/bison.texinfo (Debugging):
Remove YYSTDERR; it's no longer defined or used.
Also, s/cstdio.h/cstdio/.
2002-01-05 01:20:57 +00:00
Paul Eggert f36280e16e (Debugging): Remove YYSTDERR; it's no longer defined or used.
Also, s/cstdio.h/cstdio/.
2002-01-05 01:18:26 +00:00
Paul Eggert 6b1ec1fb33 * src/bison.simple (YYSTD): New macro.
(YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE, YYFPRINTF, YYSTDERR): Use
it to simplify macros, and fix some C++ porting problems reported
by Hans Aberg.
2001-12-17 23:51:46 +00:00
Paul Eggert bfb74f79b8 (YYSTD): New macro.
(YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE, YYFPRINTF, YYSTDERR): Use it to
simplify macros, and fix some C++ porting problems reported by Hans Aberg.
2001-12-17 23:50:16 +00:00
Paul Eggert c520f816b1 * src/output.c (output): Define YYDEBUG to 0 if it is not defined
and if we are not debugging.  POSIX requires this.
* NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document this.

* src/output.c (output_gram, output_rule_data): Do not assume that
the user defines YYDEBUG to a properly parenthesized expression.
2001-12-17 18:49:14 +00:00
Paul Eggert cc6ed5f7f1 Define YYDEBUG to 0 if it is not defined and if we are not debugging.
POSIX requires this.
2001-12-17 18:48:43 +00:00
Paul Eggert ac28f67c0b (output): Define YYDEBUG to 0 if it is not defined and if we are not
debugging.  POSIX requires this.

(output_gram, output_rule_data): Do not assume that
the user defines YYDEBUG to a properly parenthesized expression.
2001-12-17 18:45:59 +00:00
Paul Eggert d1210d1d6e Document YYPRINTF, YYSTDERR. 2001-12-13 02:45:14 +00:00
Paul Eggert d5c2eff246 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
Do not infringe on the global user namespace when using C++.
	(YYFPRINTF, YYSTDERR): New macros, needed for the above.
	All uses of `fprintf' and `stderr' changed.

	* src/output.c (output): Do not output "#include <stdio.h>"; that
	is bison.simple's job.  stdio.h should be included only if
	necessary, to avoid infringing on the user name space when
	possible.
2001-12-13 02:22:05 +00:00
Paul Eggert b59b91bb6e (output): Do not output "#include <stdio.h>"; that is bison.simple's
job.  stdio.h should be included only if necessary, to avoid
infringing on the user name space when possible.
2001-12-13 02:21:12 +00:00
Paul Eggert 63e75f2e38 (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
Do not infringe on the global user namespace when using C++.
(YYFPRINTF, YYSTDERR): New macros, needed for the above.
All uses of `fprintf' and `stderr' changed.
2001-12-13 02:20:28 +00:00
Paul Eggert cc904af579 * src/bison.simple (union yyalloc): Change member names
to be the same as the stack names.
(yyparse): yyptr is now union yyalloc *, not char *.
(YYSTACK_RELOCATE): Likewise.  This avoids a GCC warning,
and may generate better code on some machines.
2001-12-04 14:06:43 +00:00
Paul Eggert 716c50b877 * src/bison.simple (union yyalloc): Change member names
to be the same as the stack names.
(YYPOINTER): Remove.
(yyparse): yyptr is now union yyalloc *, not char *.
(YYSTACK_RELOCATE): Likewise.  This avoids a GCC warning,
and may generate better code on some machines.
2001-12-04 14:06:06 +00:00
Paul Eggert 9f41bcaae8 * src/bison.simple (YYPOINTER): New macro.
(YYSTACK_RELOCATE): Use it to avoid a GCC warning.
(yystpcpy): Use prototype if __STDC__ is defined, not just
if __cplusplus is defined.
2001-12-04 13:28:51 +00:00
Paul Eggert 1ccbf4bb8b (YYPOINTER): New macro.
(YYSTACK_RELOCATE): Use it to avoid a GCC warning.
(yystpcpy): Use prototype if __STDC__ is defined, not just
if __cplusplus is defined.
2001-12-04 13:28:18 +00:00
Paul Eggert 7ad28769d6 (YYSTACK_REALLOC): Remove.
(YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
(YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
New macros.
(union yyalloc): New type.
(__yy_memcpy): Last arg is size_t, not unsigned int, to remove
an arbitrary restriction on hosts where size_t is wider than int.

(yyparse): Don't dump core if alloca or malloc fails; instead, report
a parser stack overflow.  Allocate just one block of memory for all
three stacks, instead of allocating three blocks; this typically is
faster and reduces fragmentation.

Do not limit the number of items in the stack to a value that fits
in 'int', as this is an arbitrary limit on hosts with 64-bit
size_t and 32-bit int.
2001-11-30 02:47:56 +00:00
Paul Eggert 57d4ee2b82 * src/bison.simple (YYSTACK_REALLOC): Remove.
(YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
(YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
New macros.
(union yyalloc): New type.
(__yy_memcpy): Last arg is size_t, not unsigned int, to remove
an arbitrary restriction on hosts where size_t is wider than int.

(yyparse): Don't dump core if alloca or malloc fails; instead, report
a parser stack overflow.  Allocate just one block of memory for all
three stacks, instead of allocating three blocks; this typically is
faster and reduces fragmentation.

Do not limit the number of items in the stack to a value that fits
in 'int', as this is an arbitrary limit on hosts with 64-bit
size_t and 32-bit int.
2001-11-30 02:45:34 +00:00
Paul Eggert eb4a4d73bc * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
use alloca when we didn't want to, and vice versa.
2001-11-27 23:31:47 +00:00
Paul Eggert 1306676ce3 Sync with fileutils 4.1.1. 2001-10-26 07:04:29 +00:00
Paul Eggert f2c7ab2c1f Explain better why the output file no longer defines 'const', and
explain what to do about it if this still matters to you.
2001-10-02 18:09:13 +00:00
Paul Eggert 1b1816515e (yyparse): If __GNUC__ and YYPARSE_PARAM are both defined,
declare yyparse to have a void * argument.
1996-12-18 02:18:10 +00:00