Commit Graph

2603 Commits

Author SHA1 Message Date
Paul Eggert
2abdfeefce Regenerate. 2005-09-20 06:07:30 +00:00
Paul Eggert
a702593e05 Add yysyntax_error to data/yacc.c. 2005-09-20 06:07:07 +00:00
Paul Eggert
b4c1f9d2b6 (YYSIZE_MAXIMUM): New macro.
(YYSTACK_ALLOC_MAXIMUM): Use it.
(yysyntax_error): New function.
(yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
multiple syntax errors are reported, and alloca is being used.
Instead, reallocate buffers twice as big each time, so that
we waste at most half the allocated memory.  Start with a small
(128-byte) buffer that will suffice in most cases anyway.
Use yysyntax_error to do most of the work.
2005-09-20 06:06:42 +00:00
Paul Eggert
8a2800e787 (Error Reporting, Table of Symbols):
yynerrs is the number of errors reported, not the number of
errors encountered.
2005-09-20 06:01:50 +00:00
Paul Eggert
a9739e7c4c * tests/glr-regression.at (Duplicated user destructor for lookahead):
Mark it as expected to fail.
Cast result of malloc; problem reported by twlevo@xs4all.nl.
* tests/actions.at, tests/calc.at, tests/glr-regression.at:
Don't start user-code symbols with "yy", to avoid name space problems.
2005-09-19 21:08:21 +00:00
Paul Eggert
c7e8607f6b Add bison.html. 2005-09-19 21:04:40 +00:00
Akim Demaille
f479c6c61e Remove the traits, failed experiment.
It never proved useful, and anyway because of the current
definition, it was not possible to have several specialization of
this traits, making it useless.
* data/lalr1.cc (yy:traits): Remove.
Inline its definitions in the parser class.
2005-09-19 07:34:38 +00:00
Akim Demaille
e2586f82b0 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
least Mac OSX with a /usr/local install of gettext.
2005-09-19 07:22:17 +00:00
Akim Demaille
2e8cf949a5 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
and yytoken for similarity with the other skeletons.
2005-09-19 07:21:39 +00:00
Akim Demaille
c7fb0b9079 * NEWS, configure.ac: Bump to 2.1a. 2005-09-19 07:08:00 +00:00
Paul Eggert
f5109f5af0 Regenerate. 2005-09-16 22:55:33 +00:00
Paul Eggert
1bd0dedaaa * NEWS: Version 2.1.
* NEWS: Remove notice of yytname change, since it was never in an
official release.
* data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
diagnostic.
* src/output.c (prepare): Likewise.
* data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
(yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
is not defined.  This is an awful hack, but it's enough for now.
All callers changed.
* tests/glr-regression-at (make_value): Args are const pointers now,
to avoid GCC warning.
(Duplicated user destructor for lookahead): New test.  Currently
skipped.  It fails on my host but I'm not sure it'll always fail.
2005-09-16 22:54:21 +00:00
Akim Demaille
c1432f6538 * src/symtab.h (struct symbol): Declare the printer and destructor
as const, to avoid accidental calls to free.
(symbol_destructor_set, symbol_printer_set): Adjust.
* src/symtab.c: Adjust.
2005-09-16 19:50:08 +00:00
Akim Demaille
cf147260d2 * data/c.m4 (b4_token_enums): New.
(b4_token_defines): Rename as...
(b4_token_enums_defines): this.
(b4_token_defines): New, output only the #defines.
* data/yacc.c, data/glr.c: Adjust.
* data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
* data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
as default values.
2005-09-16 19:26:40 +00:00
Akim Demaille
3a73c9ae44 * data/c.m4 (b4_token_enums): New.
(b4_token_defines): Rename as...
(b4_token_enums_defines): this.
(b4_token_defines): New, output only the #defines.
* data/yacc.c, data/glr.c: Adjust.
* data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
* data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
as default values.
2005-09-16 19:03:54 +00:00
Akim Demaille
dbcdae2d04 * data/lalr1.cc (yylex_): Remove, inline its code.
(yyreport_syntax_error_): Remove, replaced by...
(yysyntax_error_): this which returns a string and leaves to the
caller the call to the users' error function.
(yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
Move from members of the parser object...
(yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
to local variables of the parse function.
2005-09-16 12:12:36 +00:00
Akim Demaille
70d8f2910e * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
since it's in Bison's name space.
2005-09-16 11:26:43 +00:00
Paul Eggert
d110145422 false -> yyfalse 2005-09-15 18:02:03 +00:00
Paul Eggert
ae199bf10f * data/glr.c (yyresolveValue): Add default case to pacify
gcc -Wswitch-default.  Problem reported by twlevo@xs4all.nl.
2005-09-15 14:16:54 +00:00
Paul Eggert
b47dbebee5 * NEWS: Document when yyparse started to return 2.
* doc/bison.texinfo (Parser Function): Document when yyparse
returns 2.

* data/lalr1.cc: Revert part of previous change, as it's incompatible.
(b4_filename_type): Renamed back from b4_file_name_type.  All uses
changed.
(class position): file_name -> filename (reverting).  All uses changed.
2005-09-15 14:06:52 +00:00
Paul Eggert
94306d5282 ($(calc_sources_generated)): Don't do anything if $@ exists. This
reverts part of the 2005-07-07 patch.
2005-09-14 22:10:50 +00:00
Paul Eggert
00292f6611 *** empty log message *** 2005-09-12 05:51:20 +00:00
Paul Eggert
c89b4c032c [defined YYSETJMP]: Don't include <setjmp.h>.
(YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
All uses of jmp_buf, setjmp, longjmp changed to use these instead.
(yyparse): Abort if user code uses longjmp to throw an unexpected
value.
2005-09-12 05:50:44 +00:00
Paul Eggert
d83a9c402c (EXTRA_DIST): Do not distribute REFERENCES; it
contains obsolete information and isn't worth distributing as a
separate file anyway.
2005-09-12 05:50:10 +00:00
Paul Eggert
55f64b82cd * data/c.m4 (b4_identification): Define YYBISON_VERSION.
Suggested by twlevo@xs4all.nl.
2005-09-09 23:12:09 +00:00
Paul Eggert
127287e9c4 * data/glr.c (YYCHK1): Do not assume YYE is in range.
This avoids a diagnostic from gcc -Wswitch-enum.
Problem reported by twlevo@xs4all.nl.
2005-09-09 22:59:46 +00:00
Paul Eggert
48b16bbc04 * doc/bison.texinfo: Correct typos in previous fix.
* data/glr.c: b4_filename -> b4_file_name.
* data/lalr1.cc: Likewise.  Also, b4_filename_type -> b4_file_name_type.
All uses changed.
(class position): filename -> file_name.  All uses changed.
* data/yacc.c: b4_filename -> b4_file_name.
* lib/bitset.h: filename -> file_name in local vars.
* lib/bitset_stats.c: Likewise.
* src/files.c: Likewise.
* src/scan-skel.l ("@output ".*\n): Likewise.
* src/files.c (file_name_split): Renamed from filename_split.
* src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
2005-09-09 22:42:15 +00:00
Paul Eggert
a420f9620e Log recent changes. 2005-09-09 22:14:44 +00:00
Paul Eggert
fa4d969f11 Don't use "filename", as per GNU coding standards. Use "file name" or
"file" or "name", depending on the context.
(Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
not to hack/foo.tab.c.
(Calc++ Top Level): 2nd arg of main is not const.
2005-09-09 22:14:28 +00:00
Paul Eggert
326eb46f40 Add pipe-safer.c, stdio--.h, unistd--.h,
to accommodate latest gnulib.
2005-09-08 21:49:23 +00:00
Paul Eggert
7812f29985 (Duplicate representation of merged trees): Add casts to pacify g++. 2005-09-08 18:41:46 +00:00
Paul Eggert
7e7b77c138 Undo previous change, then add comment as to why the
AM_LANGINFO_CODESET hack is needed.
2005-09-08 18:26:43 +00:00
Paul Eggert
9d5b26c682 Remove AM_INTL_SUBDIR hack; no longer needed with recent versions of
Automake.
2005-09-08 18:01:54 +00:00
Paul Eggert
42a6501d1a * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
All uses changed.  Invoke user destructor after an error during a
split parse (trivial change from Joel E. Denny).

* tests/glr-regression.at
(User destructor after an error during a split parse):  New test case.
Problem reported by Joel E. Denny in:
http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
2005-08-26 20:16:16 +00:00
Paul Eggert
5b4aaf787b * README-cvs: Give URLs for recommended tools.
Mention Gzip version problem, and bootstrapping issues.
Remove troubleshooting section, as it's somewhat obsolete.
2005-08-25 19:06:24 +00:00
Paul Eggert
b5240ba555 * bootstrap (no_cache): New var, to accommodate different wget
variants.  Use it instead of '-C off'.  Problem reported by
twlevo@xs4all.nl.
2005-08-25 18:49:57 +00:00
Paul Eggert
ef9a1fafaf yydestroyStackItem. 2005-08-25 17:58:19 +00:00
Paul Eggert
a4cf101a98 (yydestroyStackItem): New function.
(yyrecoverSyntaxError, yyreturn): Use it to improve quality of
debugging information.  Problem reported by Joel E. Denny.
2005-08-25 17:57:23 +00:00
Akim Demaille
e6efa9dacc * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too. 2005-08-25 08:53:33 +00:00
Paul Eggert
adc90f13ab * data/glr.c (yyrecoverSyntaxError, yyreturn):
Don't invoke destructor on unresolved entries.
* tests/glr-regression.at
(User destructor for unresolved GLR semantic value): New test case.
Problem reported by Joel E. Denny in:
http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
2005-08-25 06:11:35 +00:00
Paul Eggert
15d29c1ffe * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
Add strnlen.c.
* m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
lib-prefix.m4, po.m4.
2005-08-22 06:38:59 +00:00
Paul Eggert
6250acbdb1 Fix typo in name of lalr1.cc. 2005-08-22 06:33:38 +00:00
Paul Eggert
ec5d1a8a24 Regenerate. 2005-08-22 02:33:18 +00:00
Paul Eggert
dd5f2af2bd * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
in yydestruct diagnostic, since it might not be an error.
Problem reported by Joel Denny near end of
<http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
* data/lalr1cc (yyerturn): Likewise.
* data/yacc.c (yyreturn): Likewise.
* tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
2005-08-22 02:31:10 +00:00
Paul Eggert
eab522e49a Remove obsolete FIXME. 2005-08-22 01:28:07 +00:00
Paul Eggert
fe3816515c (YY_SYMBOL_PRINT): Append a newline, for consistency
with the other templates, and to fix bogus run-on messages such
as the one reported at the end of
<http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
All callers changed to avoid the newline.
(yyprocessOneStack): Output two lines rather than one, to accommodate
the above change.  This changes the debug output format slightly.
2005-08-22 01:05:52 +00:00
Paul Eggert
19e251af0f Regenerate. 2005-08-22 00:11:30 +00:00
Paul Eggert
f9315de5a4 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
reported by Joel E. Denny in
<http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
(trivial change).
* tests/glr-regression.at (Duplicate representation of merged trees):
New test, from Joel E. Denny in:
<http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
* THANKS: Add Joel E. Denny.
2005-08-21 23:43:56 +00:00
Paul Eggert
1fb38e78c2 (AC_INIT): Bump to 2.0c. 2005-08-21 22:39:21 +00:00
Paul Eggert
ca5d201376 * Makefile.am (SUBDIRS): Put examples before tests, so that
"make check" doesn't finish with "All 1 tests passed".
2005-07-25 06:45:32 +00:00