Commit Graph

1657 Commits

Author SHA1 Message Date
Paul Eggert
8fcc7db138 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
"$CC -E foo.h" is allowed, as this doesn't work with the Portland
Group compiler.  Instead, use "$CC -E bar.c".  Include the .h
file twice in the grammar, as an extra check.

* tests/input.at (Torturing the Scanner): Surround the
backslash-newline tests with "#if 0", to make it less likely that
we'll run into compiler bugs.  Bring back solitary \ inside
comment, but add a closing comment to work around HP C bug.  Don't
test backslash-newline in C character constant.  This should fix
the input.at bug reported by Nelson H. F. Beebe in
<http://mail.gnu.org/pipermail/bug-bison/2002-November/001893.html>.
2002-11-14 23:08:27 +00:00
Paul Eggert
1d39f854cf (AT_TEST_CPP_GUARD_H): Don't assume that "$CC -E foo.h" is allowed, as
this doesn't work with the Portland Group compiler.  Instead, use "$CC
-E bar.c".  Include the .h file twice in the grammar, as an extra
check.
2002-11-14 23:08:01 +00:00
Paul Eggert
dda7a53e4d (Torturing the Scanner): Surround the backslash-newline tests with
"#if 0", to make it less likely that we'll run into compiler bugs.
Bring back solitary \ inside comment, but add a closing comment to
work around HP C bug.  Don't test backslash-newline in C character
constant.  This should fix the input.at bug reported by Nelson
H. F. Beebe in
<http://mail.gnu.org/pipermail/bug-bison/2002-November/001893.html>.
2002-11-14 22:53:47 +00:00
Akim Demaille
f32b346d84 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
status of the compiler.
Calling `exit 1' is no longer needed.
Reported by Nelson H. F. Beebe.
2002-11-14 11:09:51 +00:00
Akim Demaille
4e8d992c7d * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
status of the compiler.
Reported by Nelson H. F. Beebe.
2002-11-14 11:07:00 +00:00
Akim Demaille
9501dc6e69 * tests/atlocal.in (CPPFLAGS): We have config.h.
* tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
New.
* tests/actions.at, tests/calc.at, tests/conflicts.at,
* tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
* tests/regression.at, tests/torture.at: Use them for all the
grammars that are to be compiled.
* tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
* tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
* doc/bison.texinfo (GLR Parsers): Document `inline'.
2002-11-14 09:58:01 +00:00
Akim Demaille
18b519c0d6 * doc/bison.texinfo: Various formatting changes (alignments in
samples, additional @group/@end group, GCS in samples.
Use @deffn instead of simple @table to define the directives,
macros, variables etc.
2002-11-14 08:32:10 +00:00
Paul Eggert
daa33def28 Fix some bugs reported by Albert Chin-A-Young in
<http://mail.gnu.org/pipermail/bug-bison/2002-November/001881.html>.
2002-11-14 01:24:12 +00:00
Paul Eggert
2b42986e75 (export YYLTYPE): Don't invoke "cc a.c b.c -o c"; the HP-UX 11i C
compiler chatters during compilation.  Instead, invoke "cc -c a.c -o
a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
2002-11-14 00:36:03 +00:00
Paul Eggert
efc6bf1b94 (Torturing the Scanner): Don't invoke "cc a.c b.c
-o c"; the HP-UX 11i C compiler chatters during compilation.
Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
2002-11-14 00:35:27 +00:00
Paul Eggert
149365be01 (Torturing the Scanner): Remove lines containing
solitary backslashes, as they tickle a bug in the HP-UX 11i C
compiler.
2002-11-14 00:26:45 +00:00
Paul Eggert
9a86cdb99b * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
comments, since they're not portable.  Use GNU coding style.
2002-11-14 00:04:57 +00:00
Paul Eggert
c240826c06 (Badly Collapsed GLR States): Avoid //
comments, since they're not portable.  Use GNU coding style.
2002-11-13 23:20:52 +00:00
Akim Demaille
caf52fdfab Bump to 1.75c. 2002-11-13 15:17:35 +00:00
Akim Demaille
9c1e26bd3b * data/yacc.c: Leave bigger chunks of quoted text.
(YYDSYMPRINTF): New.
Use it to report symbol activities.
* data/glr.c (YYDSYMPRINTF): New.
Use it.
2002-11-13 09:49:49 +00:00
Paul Eggert
f7e096fee3 (AC_INIT): Bump version to 1.75c. 2002-11-13 09:06:47 +00:00
Paul Eggert
73dbb6420e Regenerate. 2002-11-13 08:34:23 +00:00
Paul Eggert
87f721cc87 Version 1.75b. 2002-11-13 08:32:08 +00:00
Paul Eggert
ff03259279 (yydoAction): Return YYRESULTTAG, not int.
(yyglrReduce): Return yyok, not 0.
This should avoid the enumerated-type warnings reported
by Nelson H. F. Beebe in
<http://mail.gnu.org/pipermail/bug-bison/2002-November/001872.html>.
2002-11-13 07:46:19 +00:00
Paul Eggert
dbba6a3be7 [! BITSET_INLINE]: Remove.
(bitset_set, bitset_reset, bitset_test): Rename local vars
to avoid shadowing warnings by GCC.
2002-11-13 07:02:51 +00:00
Paul Eggert
e84e65da40 (BITSET_INLINE): Remove. 2002-11-13 07:02:13 +00:00
Paul Eggert
53b7799056 (inline): Remove #define. It's the user's responsibility to #define
it away, just like 'const'.  This fixes one of the bugs reported by
Nelson H.F. Beebe in
<http://mail.gnu.org/pipermail/bug-bison/2002-November/001873.html>.
2002-11-13 06:48:18 +00:00
Paul Eggert
412f8a5975 Revamp regular expressions so that " and '
do not confuse xgettext.
2002-11-13 06:40:35 +00:00
Paul Eggert
322c501d89 Remove src/parse-gram.c, src/scan-gram.c,
src/system.h.  Add src/parsegram.y, src/scan-gram.l.
2002-11-13 06:40:06 +00:00
Paul Eggert
8a1dd2fe05 (po-check): Scan .l and .y files instead
of the .c and the .h files that they generate.  Look for N_
as well as for _.  Try to avoid matching #define for N_ and _.
2002-11-13 06:39:26 +00:00
Paul Eggert
0eae1c91c8 (struniq_new): Do not declare the return type
to be 'const'; this violates the C standard.
2002-11-13 06:27:18 +00:00
Akim Demaille
be14ade55e * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
linker.
2002-11-12 17:51:38 +00:00
Akim Demaille
cc13ba4dc0 * Makefile.maint: Sync with Autoconf:
(local_updates): New.
2002-11-12 17:50:21 +00:00
Akim Demaille
05291fbc74 * Makefile.maint: Sync with Autoconf:
(local_updates): New.
2002-11-12 16:11:49 +00:00
Akim Demaille
1f5fd52e9b * po/POTFILES.in (src/lalr.c, src/state.c): Remove 2002-11-12 16:09:38 +00:00
Akim Demaille
43a91d61eb com.compilers. 2002-11-12 15:15:21 +00:00
Akim Demaille
283f1e6482 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
locations.
2002-11-12 10:18:05 +00:00
Akim Demaille
886b69d197 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
not yyvalue.
2002-11-12 09:44:41 +00:00
Akim Demaille
3df374151b * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
Use it to test the GLR parser.
2002-11-12 09:07:38 +00:00
Akim Demaille
7bd6c77e5e * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
defines it.
* data/glr.c (yystos): New.
(b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
(YYDSYMPRINT): New.
(yyval): Don't define it, it is handled via M4.
(yyrecoverParseError): Free verbosely the discarded symbols.
* data/yacc.c (yysymprint): Remove, rather...
(b4_yysymprint_generate): invoke.
* data/c.m4 (b4_yysymprint_generate): New.
Accept pointers as arguments, as opposed to the version from
yacc.c.
(b4_yydestruct_generate): Likewise.
* tests/cations.at (Printers and Destructors): Use Bison directives
instead of CPP macros.
Don't rely on internal details.
2002-11-12 09:03:13 +00:00
Akim Demaille
b0400cc6ef * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
* data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
Don't work on yychar (i.e., do set it to YYEMPTY, don't match
it against YYEMPTY and so forth), work on yytoken (i.e., set
it to YYEMPTY etc.).
(yydestruct): Replace with a b4_yydestruct_generate invocation.
(b4_symbol_actions): Remove.
* data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
for 0, end-of-input.
2002-11-12 08:45:40 +00:00
Akim Demaille
72f889cca3 * doc/bison.texinfo (Destructor Decl): New. 2002-11-12 08:35:00 +00:00
Akim Demaille
b1ae9233bc * src/tables.c (tables_generate): Use free for pointers that
cannot be NULL, not XFREE.
(pack_vector): Use assert, not fatal, for bound violations.
* src/state.c (state_new): Likewise.
* src/reader.c (reader): Likewise.
* src/lalr.c (set_goto_map): Likewise.
* src/location.h (LOCATION_PRINT): If first_line is 0, just issue
the file name.
2002-11-12 08:30:47 +00:00
Akim Demaille
7ec2d4cd39 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
Restore.
* src/scan-gram.l (last_string): Is global to the file, not to
yylex.
* src/parse-gram.y (input): Don't append the epilogue here,
(epilogue.opt): do it here, and free the scanner's obstack.
* src/reader.c (epilogue_set): Rename as...
(epilogue_augment): this.
* data/c.m4 (b4_epilogue): Defaults to empty.
2002-11-12 08:26:38 +00:00
Akim Demaille
573a6cd356 * src/getargs.c (long_options): Remove duplicates.
* src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
Remove.
* doc/bison.rnh: Remove.
* doc/bison.texinfo (VMS Invocation): Remove.
2002-11-12 08:13:10 +00:00
Akim Demaille
95612cfa60 * src/struniq.h, src/struniq.c (struniq_t): Is const.
(STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
Use struniq for symbols.
* src/symtab.h (symbol_t): The tag member is a struniq.
(symbol_type_set): Adjust.
* src/symtab.c (symbol_new): Takes a struniq.
(symbol_free): Don't free the tag member.
(hash_compare_symbol_t, hash_symbol_t): Rename as...
(hash_compare_symbol, hash_symbol): these.
Use the fact that tags as struniqs.
(symbol_get): Use struniq_new.
* src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
Returns a strniq.
* src/reader.h (merger_list, grammar_currentmerge_set): The name
and type members are struniqs.
* src/reader.c (get_merge_function)
(grammar_current_rule_merge_set): Adjust.
(TYPE, current_type): Are struniq.
Use struniq for file names.
* src/files.h, src/files.c (infile): Split into...
(grammar_file, current_file): these.
* src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
* src/reduce.c (reduce_print): Likewise.
* src/getargs.c (getargs): Likewise.
* src/complain.h, src/complain.c: Likewise.
* src/main.c (main): Call struniqs_new early enough to use it for
file names.
Don't free the input file name.
2002-11-12 08:05:59 +00:00
Akim Demaille
3e6656f9ab * src/symtab.c (symbol_free): Remove dead deactivated code:
type_name are properly removed.
Don't use XFREE to free items that cannot be NULL.
* src/struniq.h, src/struniq.c: New.
* src/main.c (main): Initialize/free struniqs.
* src/parse-gram.y (%union): Add astruniq member.
(yyprint): Adjust.
* src/scan-gram.l (<{tag}>): Return a struniq.
Free the obstack bit that used to store it.
* src/symtab.h (symbol_t): The 'type_name' member is a struniq.
2002-11-12 07:55:55 +00:00
Paul Eggert
ccdb39e0a6 Add src/system.h; this isn't really needed, but it keeps "make update"
happy.
2002-11-12 07:51:44 +00:00
Paul Eggert
62ddaef6a7 Regenerate. 2002-11-12 07:44:22 +00:00
Paul Eggert
ea44c25efc No need to keep this file in CVS, since it's automatically generated. 2002-11-12 07:40:11 +00:00
Paul Eggert
7672019c42 Revamp to fix many (but not all) of the C- and M4-related quoting
problems.  Among other things, this fixes the Bison bug reported
by Jan Hubicka when processing the Bash grammar.
2002-11-12 07:33:36 +00:00
Paul Eggert
5b7f88c7f2 (Torturing the Scanner): Add tests that @oline@,
__oline__, #output, $@, and @{ do not have unintended meanings.
2002-11-12 07:28:25 +00:00
Paul Eggert
e9683cfd3d (yylineno, yyoutname): Remove static vars, replacing
them with auto vars.
Switch to new escape scheme, where @ is the escape character uniformly.
Abort if a stray escape character is found.  Avoid unbounded input
buffer when parsing non-escaped text.
2002-11-12 07:27:51 +00:00
Paul Eggert
ac060e78a3 (<SC_CHARACTER>): Don't worry about any backslash
escapes other than \\ and \'; this simplifies the code.
(<SC_STRING>): Likewise, for \\ and \".
(<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
Use new escapes @{ and @} for [ and ].
2002-11-12 07:27:04 +00:00
Paul Eggert
6c239755dc (prologue_augment, epilogue_set):
Quote filenames for C and M4.
2002-11-12 07:26:27 +00:00