Commit Graph

1071 Commits

Author SHA1 Message Date
Paul Eggert
983c5c2c2a Don't use m4_include on relative file names, as it doesn't work.
Remove obsolete references to bison.simple and bison.hairy.
* src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL.
* src/parse-gram.y (declaration): Use enum "report_states".
* src/scan-skel.l ("@output ".*\n): Close any old yyout before new one.
2002-12-26 09:12:05 +00:00
Paul Eggert
7ea9026a59 Remove broken URL. 2002-12-24 09:03:23 +00:00
Paul Eggert
23f2d9dc0f Version 1.75e. 2002-12-24 08:35:23 +00:00
Paul Eggert
33167b8b05 If the user does not define YYSTYPE as a macro, Bison now declares it
using typedef instead of defining it as a macro.  POSIX requires this.
For consistency, YYLTYPE is also declared instead of defined.

%union directives can now have a tag before the `{', e.g., the
directive `%union foo {...}' now generates the C code
`typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
The default union tag is `YYSTYPE', for compatibility with Solaris 9
Yacc.  For consistency, YYLTYPE's struct tag is now `YYLTYPE'
instead of `yyltype'.

`yystype' and `yyltype' are now obsolescent macros instead of being
typedefs or tags; they are no longer documented and will be
withdrawn in a future release.
2002-12-24 07:47:36 +00:00
Paul Eggert
879ca4f81b Omit mentions of %lex-param and %parse-param for now. 2002-12-18 00:10:11 +00:00
Paul Eggert
1c5fe69d46 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke GCC 3.2.1. 2002-12-15 09:21:13 +00:00
Paul Eggert
d1de53722b Version 1.75d. 2002-12-13 12:21:57 +00:00
Paul Eggert
d0f3fe233d Remove unportable casts and storage allocation tricks. 2002-12-13 08:54:41 +00:00
Paul Eggert
26b4a96981 Change identifier spellings to avoid collisions with names
that are reserved by POSIX.
Fix misspelling in names.
Sort include-file uses.
2002-12-11 07:17:47 +00:00
Paul Eggert
996b1c7e8c * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
since this causes problems when __file__ contains character
sequences like "@" that are treated specially by src/scan-skel.l.
Instead, just use the file's basename.  This fixes the bug
reported by Martin Mokrejs in
<http://mail.gnu.org/pipermail/bug-bison/2002-December/001949.html>.
2002-12-09 04:48:38 +00:00
Paul Eggert
e19c4e5d1c Add support for rules that do not have trailing semicolons, as
POSIX requires.  Improve the quality of locations in Bison
diagnostics.

Remove duplicate decl of current_file.
Fix minor promotion problem in templates.
Fix Debian Bug 102878.
2002-12-07 08:09:17 +00:00
Paul Eggert
b64755e391 Add strtoul.c
In src/scan-gram.l, move helper function definitions to epilogue.
2002-12-02 18:20:30 +00:00
Paul Eggert
6ba5559289 Type clashes now generate warnings, not errors, since it
appears that POSIX may allow some grammars with type clashes.
2002-11-30 09:52:42 +00:00
Paul Eggert
6e746484fc Add Yacc Library.
gram_error is static.
yylex and yyerror must be declared.
2002-11-30 09:20:52 +00:00
Paul Eggert
88510f9c07 %parse-param and %lex-param now take just one argument, the
declaration; the argument name is deduced from the declaration.
2002-11-29 08:45:33 +00:00
Paul Eggert
bb92250c78 Rename identifiers to avoid real and potential collisions. 2002-11-27 18:36:41 +00:00
Paul Eggert
3af4feb22f Version 1.75c. 2002-11-25 07:56:44 +00:00
Paul Eggert
580043087e * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
Avoid use of <assert.h>, as the GNU Coding Standards hint that one
should use `if (! x) abort ();' rather than `assert (x);', and
anyway it's one less thing to worry about configuring.
2002-11-21 07:37:24 +00:00
Paul Eggert
76ae81983c * data/glr.c (yygetLRActions): Replace `yyindex' with
`yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
This fixes the regression with Sun ONE Studio 7 cc that I reported in
<http://mail.gnu.org/pipermail/bug-bison/2002-November/001892.html>.
2002-11-19 09:33:21 +00:00
Paul Eggert
8d8a7238ee Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
to "SyntaxError" for consistency with my 2002-11-15 change.
2002-11-18 20:08:57 +00:00
Akim Demaille
d3c4e709ff * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
space.
From Tim Van Holder.
2002-11-18 09:33:22 +00:00
Akim Demaille
b0937b2259 Augment the similarity between GLR and LALR traces.
* data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
(YY_REDUCE_PRINT): New.
(yyparse): Use them.
* data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
YYDPRINT here.
(yyglrReduce, yyrecoverParseError, yyparse): Don't report the
state reached after the reduction/recovery, since...
(yyparse, yyprocessOneStack): Report the state we are entering in.
2002-11-16 12:32:27 +00:00
Akim Demaille
c5e3e51055 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
Add support for --trace=skeleton.
* src/scan-skel.l: %option debug.
Scan strings of non-@ or n instead of character by character.
(scan_skel): Handle trace_skeleton.
(QPUTS): New.
(@output_parser_name@, @output_header_name@): ``Restore'' their
support (used to be M4 macros).
* data/yacc.c: Quote larger chunks, a la glr.c.
* data/lalr1.cc: Likewise.
The header guards are no longer available, so use some other
string than `YYLSP_NEEDED'.
2002-11-16 12:31:36 +00:00
Akim Demaille
4c6cc1db75 Make the ``Printers and Destructors'' test more verbose, taking
`yacc.c''s behavior as (possibly wrong) reference.
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
instead of fprint on stdout.
Set and report the last_line of the symbols.
Consistently display values and locations.
2002-11-16 12:30:23 +00:00
Paul Eggert
6d9e8019e1 * data/yacc.c: Avoid over-quoting of __line__ and __file__. 2002-11-16 08:14:23 +00:00
Paul Eggert
b25d88f6d2 * tests/actions.at (Actions after errors): New test case. 2002-11-16 07:32:09 +00:00
Paul Eggert
6e649e659e * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
tests/action.at, tests/calc.at, tests/conflicts.at,
tests/cxx-type.at, tests/regression.at:
"parse error" -> "syntax error" for POSIX compatibility.
"parsing stack overflow..." -> "parser stack overflow" so
that code matches Bison documentation.
2002-11-15 20:32:21 +00:00
Akim Demaille
0f39aab92a * src/parse-gram.y (declaration): Have %parse-param and %lex-param
take two BRACED_CODE, not two string_content.
Free the scanner's obstack when we are done.
(code_content): New.
* tests/calc.at: Adjust.
* doc/bison.texinfo: Adjust.
Also, make sure to include the `,' for these declarations.
2002-11-15 16:42:16 +00:00
Akim Demaille
761c1926a1 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
definition; avoids potential autoreconf problems.
2002-11-15 16:30:37 +00:00
Akim Demaille
b0f98b1016 Always check the value returned by yyparse.
* tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
returned by yyparse.
(_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
Adjust calls.
* tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
returned by yyparse.
2002-11-15 08:56:40 +00:00
Paul Eggert
7ec1b48eb8 * src/output.c (output_skeleton): Call xfopen instead of
duplicating xfopen's body.
2002-11-15 01:29:53 +00:00
Paul Hilfinger
970785f1a0 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
on input.at test.
2002-11-14 23:18:55 +00:00
Paul Eggert
cfff7583d2 Mention the bugs fixed by the latest change. 2002-11-14 23:11:11 +00:00
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
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
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
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
87f721cc87 Version 1.75b. 2002-11-13 08:32:08 +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
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
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