Commit Graph

997 Commits

Author SHA1 Message Date
Paul Eggert
93b8c255e8 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
Avoid subscript error in yycheck.  Bug reported by Andrew Suffield in
<http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
* data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
Check for malloc failure, for consistency with yacc.c.
(yytname_size): Remove, for consistency with yacc.c.

The bug still remains in data/lalr1.cc, as I didn't have time
to fix it there.
2003-02-13 07:15:52 +00:00
Akim Demaille
7548fed236 * configure.ac (GXX): Rename as...
(CXX): this, to keep the original Autoconf semantics.
Require 2.57.
* data/lalr1.cc: Fix b4_copyright invocations.
If YYDEBUG is not defined, don't depend upon name_ being defined.
(location.hh): Include string and iostream.
(Position::filename): New member.
(Position::Position ()): New.
(operator<< (Position)): New.
(operator- (Position, int)): New.
(Location::first, Location::last): Rename as...
(Location::begin, Location::end): these, to mock the conventional
iterator names.
(operator<< (Location)): New.
* tests/atlocal.in (CXX): New.
* tests/testsuite.at (AT_COMPILE_CXX): New.
* tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
locations in a more synthetic way.
(AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
lalr1.cc is used.
Adjust the C locations to match those from Emacs: first column is
column 0.
Change all the expected results.
Conform to the GCS: simplify the locations when applicable.
(LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
(LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
these CPP macros with the m4 macros new defined by...
(AT_CHECK_PUSHDEFS): this, i.e.:
(AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
(AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALSm AT_LEX_PRE_ARGS)
New macros.
(AT_CHECK_POPDEFS): Undefine them.
(AT_CHECK_CALC_LALR1_CC): New.
Use it for the first lalr1.cc test.
2003-02-06 10:04:29 +00:00
Akim Demaille
43a176ef35 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
Location as is defined.
2003-02-04 21:05:03 +00:00
Akim Demaille
fc049e9caf * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
name_ being defined.
2003-02-04 20:57:46 +00:00
Paul Eggert
a737b2163c Use more-consistent naming conventions for local vars. 2003-02-03 15:35:57 +00:00
Akim Demaille
68e93ad549 * src/scan-skel.l: Scan more than one inert character per yylex
invocation.
2003-02-02 10:55:20 +00:00
Paul Eggert
1d9d5d7159 po/LINGUAS: Add ms. 2003-02-01 08:35:07 +00:00
Paul Eggert
9289898605 Version 1.875a, dated today. 2003-02-01 08:23:32 +00:00
Akim Demaille
0435d061f2 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
Changes in response to error report by S. Eken: GLR mode does not

(yyfill): New function to copy from stack tree into array
(yyuserAction): Modify to allow incremental move of semantic values
to rhs array when in GLR mode.
Define YYFILL to use in user-defined actions to fill semantic array
(yyresolveStates): Use X == NULL for pointers, not !X.
2003-01-30 08:03:10 +00:00
Paul Hilfinger
6029a57f53 Modifications to fix GLR bug reported by S. Eken. 2003-01-29 23:39:59 +00:00
Paul Eggert
6cee62971e * data/lalr1.cc: Do not use @output_header_name@ unless
b4_defines_flag is set.
2003-01-29 06:31:41 +00:00
Paul Eggert
b2a836b51e * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
we don't need to worry about yyerrlab1 being reported as an
"unused label" by non-GCC C compilers.
2003-01-22 06:39:16 +00:00
Paul Eggert
4196b9316c * src/output.c (symbol_printers_output): Fix typo that led
to core dump.
2003-01-17 08:43:31 +00:00
Akim Demaille
3ae831b413 Quoc Peyrot <chojin@lrde.epita.fr>,
Robert Anisko <anisko_r@lrde.epita.fr>
* data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
when the stacks contain one element, as the loop would otherwise
free the last state, and then use the top state (the one we just
popped).  This means that the initial elements will not be freed
explicitly, as is the case in yacc.c; it is not a problem, as
these elements have fake values.
2003-01-13 15:42:31 +00:00
Paul Eggert
e3aa65c502 %expect-violations are now just warnings, reverting to old behavior.
Update copyright year.
2003-01-13 07:19:17 +00:00
Akim Demaille
f0057011f7 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@. 2003-01-09 12:45:08 +00:00
Paul Eggert
1ee6d2a02e Invoke wget with -C off, to disable proxy caches. 2003-01-09 07:44:26 +00:00
Paul Eggert
d4fd77c450 Add a reference to the GLR paper of Scott, Johnstone and Hussain. 2003-01-07 06:38:40 +00:00
Paul Eggert
d600ee67ee Add --disable-yacc. 2003-01-05 06:32:12 +00:00
Paul Eggert
464c692789 Do not let the scan-skel token buffer grow unboundedly in the usual case.
Fix off-by-one error in scan-skel calculation of output line.
Fix some portability problems noted by Nelson H. F. Beebe.
2003-01-05 01:07:13 +00:00
Paul Eggert
0f42c7d501 Pacify the buggy "smart preprocessor" in MacOS 10.2.3. 2003-01-02 23:59:12 +00:00
Paul Eggert
dc546b0f6e Bison 1.875. 2003-01-01 09:04:56 +00:00
Paul Eggert
2c09b6a7ea Treat stray "," more uniformly.
Append ";" before last brace in braced code.
Don't use "yystype", which is deprecated.
2002-12-30 23:47:56 +00:00
Paul Eggert
535c0f6328 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
that of SYM's type.  This fixes Debian bug 168069, reported by
Thomas Olsson.
2002-12-29 04:31:58 +00:00
Paul Eggert
963fcc1705 Version 1.75f. 2002-12-29 03:17:12 +00:00
Paul Eggert
b1efe548af Fix a bug where error locations were not being recorded correctly.
Warn if we detect conflicting outputs to the same file.

If the user specifies "%expect N", report an error if there are any
reduce/reduce conflicts.
2002-12-28 09:02:18 +00:00
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