Paul Eggert [Sat, 16 Apr 2005 06:32:51 +0000 (06:32 +0000)]
* src/parse-gram.y: Include quotearg.h.
(string_as_id): Quote $1 before using it as a key, since the
lexer no longer quotes it for us.
(string_content): Don't strip quotes, since lexer no longer
quotes it for us.
* src/scan-gram.l: Include quotearg.h.
("\""): Omit quote.
("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
a key, since the rest of the lexer doesn't quote it.
* src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
* tests/regression.at (Token definitions): Check for backslashes
in token strings.
Paul Eggert [Sat, 16 Apr 2005 06:25:03 +0000 (06:25 +0000)]
(YYSTACK_ALLOC_MAXIMUM): New macro.
(YYSIZE_T): Define to unsigned long int when using an older compiler.
(yyparse): Revamp code to generate long syntax error message, to
make it easier to translate, and to avoid problems with arithmetic
overflow. Change "virtual memory" to "memory" in diagnostic, since
we don't know whether the memory is virtual.
Paul Eggert [Thu, 14 Apr 2005 00:08:56 +0000 (00:08 +0000)]
* NEWS: Bison-generated C parsers now use the _ macro to
translate strings.
* data/yacc.c (_) [!defined _]: New macro.
All English strings wrapped inside this macro.
* doc/bison.texinfo (Bison Parser): Document _.
* po/POTFILES.in: Include src/parse-gram.c, since it now
includes translateable strings that parse-gram.y doesn't.
Paul Eggert [Tue, 12 Apr 2005 22:38:20 +0000 (22:38 +0000)]
(symbol_make_alias): Call symbol_type_set,
reverting the 2004-10-11 change to this function.
(symbol_check_alias_consistency): Don't call symbol_type_set
if the type name is already correct.
Paul Eggert [Sat, 26 Mar 2005 01:12:59 +0000 (01:12 +0000)]
(Token definitions): Don't use a token named c, as that generates a
"#define c ..." that runs afoul of buggy stdlib.h that uses the
identifier c as a member of struct drand48_data.
Paul Eggert [Mon, 7 Mar 2005 06:41:39 +0000 (06:41 +0000)]
* src/output.c (escaped_output): Renamed from
escaped_file_name_output, since we now use it for symbol tags as
well. All uses changed.
(symbol_destructors_output, symbol_printers_output):
Escape symbol tags too.
Problem reported by Matyas Forstner in
<http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
Paul Eggert [Tue, 1 Mar 2005 00:41:33 +0000 (00:41 +0000)]
(Semantic Tokens): Fix scoping problem in
example, reported by Derek M Jones. Also, make the example even
more outrageous, to better illustrate how bad the problem is.
Paul Eggert [Mon, 7 Feb 2005 23:14:22 +0000 (23:14 +0000)]
(Improper handling of embedded actions and dollar(-N) in GLR parsers):
Renamed from "Improper handling of embedded actions and $-N in GLR
parsers", work around an Autoconf bug with dollar signs in test names.
Paul Eggert [Sat, 8 Jan 2005 05:22:36 +0000 (05:22 +0000)]
* data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
being defined and not used.
* data/lalr1.cc (yyparse): Likewise.
Use "if (false)" rather than "if (0)".
Paul Eggert [Sun, 26 Dec 2004 06:13:31 +0000 (06:13 +0000)]
* tests/torture.at (Exploding the Stack Size with Alloca): Set
YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
otherwise, we're not testing alloca. Unfortunately there's no
simple way to consult HAVE_ALLOCA here.
Paul Eggert [Sun, 26 Dec 2004 06:12:18 +0000 (06:12 +0000)]
(Exploding the Stack Size with Alloca): Set
YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
otherwise, we're not testing alloca. Unfortunately there's no
simple way to consult HAVE_ALLOCA here.
Paul Eggert [Wed, 22 Dec 2004 21:19:47 +0000 (21:19 +0000)]
* NEWS: Bison-generated parsers no longer default to using the
alloca function (when available) to extend the parser stack, due
to widespread problems in unchecked stack-overflow detection.
* data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
responsibility to set it to a positive value. This lets the user
specify a value that is not a preprocessor constant.
* data/yacc.c (YYMAXDEPTH): Likewise.
(YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
* doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
to be a compile-time constant. However, explain the constraints on it.
Also, explain the constraints on YYINITDEPTH.
(Table of Symbols): Explain that alloca is no longer the default.
Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
to 1.
Akim Demaille [Wed, 22 Dec 2004 10:06:15 +0000 (10:06 +0000)]
* data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
(parser::state_type, parser::semantic_type, parser::location_type):
Private, not public.
(parser::parse): Return ints, not bool.
Returning a bool introduces a problem: 0 corresponds to false, and
it seems weird to return false on success. Returning true changes
the conventions for yyparse.
Alternatively we could return void and send an exception.
There is no clear consensus (yet?).
(state_stack, semantic_stack, location_stack): Rename as...
(state_stack_type, semantic_stack_type, location_stack_type): these.
Private, not public.
* tests/c++.at: New.
* tests/testsuite.at, tests/Makefile.am: Adjust.
Akim Demaille [Tue, 21 Dec 2004 12:26:56 +0000 (12:26 +0000)]
Don't impose std::string for filenames.
* data/lalr1.cc (b4_filename_type): New.
(position::filename): Use it.
(parser.hh): Move the inclusion of stack.hh and location.hh below
the user code, so that needed headers for the filename type can be
included first.
Forward declare them before the user code.
* tests/Makefile.am (check-local, installcheck-local): Pass
TESTSUITEFLAGS to the TESTSUITE.
Akim Demaille [Tue, 21 Dec 2004 12:03:47 +0000 (12:03 +0000)]
Don't impose std::string for filenames.
* data/lalr1.cc (b4_filename_type): New.
(position::filename): Use it.
(parser.hh): Move the inclusion of stack.hh and location.hh below
the user code, so that needed headers for the filename type can be
included first.
Akim Demaille [Fri, 17 Dec 2004 15:24:32 +0000 (15:24 +0000)]
* data/lalr1.cc: Extensive Doxygenation.
(error_): Rename as...
(error): this, since it is visible to the user.
Adjust callers.
(Parser::message): Now an automatic variable from...
(Parser::yyreport_syntax_error_): here.
* tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
Parser::error.
* tests/input.at: Escape $.
Akim Demaille [Thu, 16 Dec 2004 09:06:08 +0000 (09:06 +0000)]
Use #define to handle the %name-prefix.
* data/glr.c, data/yacc.c: Comment changes.
* data/lalr1.cc (yylex): Use #define to select the name of yylex,
so that one can refer to yylex in the parser file, and have it
renamed, as is the case with other skeletons.
Paul Eggert [Thu, 16 Dec 2004 00:09:08 +0000 (00:09 +0000)]
* src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
(struct node, struct graph):
Rename member expand to stretch. All uses changed.
(struct graph): Remove member layoutalgorithm. All uses removed.
* src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
* src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
All uses changed.
(N_STRETCH): Rename from N_EXPAND. All uses changed.