Commit Graph
22 Commits
Author SHA1 Message Date
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