mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-08 10:15:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ac1584946 | ||
|
|
40a1cd37f3 | ||
|
|
468455e12b | ||
|
|
a4eb820f17 | ||
|
|
6eb8f74f8f | ||
|
|
cc5a986ce4 | ||
|
|
ae2199381e | ||
|
|
7b70847e58 | ||
|
|
19d9b60787 | ||
|
|
8f8439cee1 | ||
|
|
fa5303b8ff | ||
|
|
39845e8e40 | ||
|
|
5b34bb3110 | ||
|
|
c955769a75 | ||
|
|
82443642d2 | ||
|
|
e272d9dc80 | ||
|
|
9a50c55af7 | ||
|
|
e28ce5def0 | ||
|
|
7aa15a0026 | ||
|
|
90b1335aed | ||
|
|
ddbd0c40dc | ||
|
|
c473e022d9 | ||
|
|
6192d2c6de | ||
|
|
3746fc33c4 | ||
|
|
36cdaaac53 | ||
|
|
63fec1eeba | ||
|
|
6b4cb804b5 | ||
|
|
53425dbfaa | ||
|
|
403ddfb7e0 | ||
|
|
76e5017732 | ||
|
|
592bdad15e | ||
|
|
457bf91968 | ||
|
|
2e350a617f | ||
|
|
d740d2b541 | ||
|
|
e411069eee | ||
|
|
ae62d0fc4f | ||
|
|
e3f8c4ef69 | ||
|
|
933ec5449f |
+1
-1
@@ -1 +1 @@
|
||||
2.6.1
|
||||
2.6.3
|
||||
|
||||
@@ -1,5 +1,53 @@
|
||||
GNU Bison NEWS
|
||||
|
||||
* Noteworthy changes in release 2.6.4 (2012-10-23) [stable]
|
||||
|
||||
Bison 2.6.3's --version was incorrect. This release fixes this issue.
|
||||
|
||||
* Noteworthy changes in release 2.6.3 (2012-10-22) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
Bugs and portability issues in the test suite have been fixed.
|
||||
|
||||
Some errors in translations have been addressed, and --help now directs
|
||||
users to the appropriate place to report them.
|
||||
|
||||
Stray Info files shipped by accident are removed.
|
||||
|
||||
Incorrect definitions of YY_, issued by yacc.c when no parser header is
|
||||
generated, are removed.
|
||||
|
||||
All the generated headers are self-contained.
|
||||
|
||||
** Header guards (yacc.c, glr.c, glr.cc)
|
||||
|
||||
In order to avoid collisions, the header guards are now
|
||||
YY_<PREFIX>_<FILE>_INCLUDED, instead of merely <PREFIX>_<FILE>.
|
||||
For instance the header generated from
|
||||
|
||||
%define api.prefix "calc"
|
||||
%defines "lib/parse.h"
|
||||
|
||||
will use YY_CALC_LIB_PARSE_H_INCLUDED as guard.
|
||||
|
||||
** Fix compiler warnings in the generated parser (yacc.c, glr.c)
|
||||
|
||||
The compilation of pure parsers (%define api.pure) can trigger GCC
|
||||
warnings such as:
|
||||
|
||||
input.c: In function 'yyparse':
|
||||
input.c:1503:12: warning: 'yylval' may be used uninitialized in this
|
||||
function [-Wmaybe-uninitialized]
|
||||
*++yyvsp = yylval;
|
||||
^
|
||||
|
||||
This is now fixed; pragmas to avoid these warnings are no longer needed.
|
||||
|
||||
Warnings from clang ("equality comparison with extraneous parentheses" and
|
||||
"function declared 'noreturn' should not return") have also been
|
||||
addressed.
|
||||
|
||||
* Noteworthy changes in release 2.6.2 (2012-08-03) [stable]
|
||||
|
||||
** Bug fixes
|
||||
@@ -1857,7 +1905,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
LocalWords: namespaces strerror const autoconfiguration Dconst Autoconf's FDL
|
||||
LocalWords: Automake TMPDIR LESSEQ ylwrap endif yydebug YYTOKEN YYLSP ival hh
|
||||
LocalWords: extern YYTOKENTYPE TOKENTYPE yytokentype tokentype STYPE lval pdf
|
||||
LocalWords: lang yyoutput dvi html ps POSIX lvalp llocp
|
||||
LocalWords: lang yyoutput dvi html ps POSIX lvalp llocp calc yyo fval
|
||||
|
||||
Local Variables:
|
||||
mode: outline
|
||||
|
||||
@@ -168,6 +168,19 @@ decide whether to update.
|
||||
** make check
|
||||
Use liberally.
|
||||
|
||||
** Typical errors
|
||||
If the test suite shows failures such as the following one
|
||||
|
||||
.../bison/lib/getopt.h:196:8: error: redefinition of 'struct option'
|
||||
/usr/include/getopt.h:54:8: error: previous definition of 'struct option'
|
||||
|
||||
it probably means that some file was compiled without
|
||||
AT_DATA_SOURCE_PROLOGUE. This error is due to the fact that our -I options
|
||||
pick up gnulib's replacement headers, such as getopt.h, and this will go
|
||||
wrong if config.h was not included first.
|
||||
|
||||
See tests/local.at for details.
|
||||
|
||||
** make maintainer-check-valgrind
|
||||
This target uses valgrind both to check bison, and the generated parsers.
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Airy Andre [email protected]
|
||||
Akim Demaille [email protected]
|
||||
Albert Chin-A-Young [email protected]
|
||||
Alexander Belopolsky [email protected]
|
||||
Alexandre Duret-Lutz adl@src.lip6.fr
|
||||
Alexandre Duret-Lutz adl@lrde.epita.fr
|
||||
Andreas Schwab [email protected]
|
||||
Andrew Suffield [email protected]
|
||||
Angelo Borsotti [email protected]
|
||||
@@ -93,6 +93,7 @@ R Blake [email protected]
|
||||
Raja R Harinath [email protected]
|
||||
Ralf Wildenhues [email protected]
|
||||
Richard Stallman [email protected]
|
||||
Rob Vermaas [email protected]
|
||||
Robert Anisko [email protected]
|
||||
Satya Kiran Popuri [email protected]
|
||||
Sebastian Setzer [email protected]
|
||||
|
||||
@@ -123,6 +123,10 @@ AC_PROG_GNU_M4
|
||||
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
|
||||
AC_DEFINE_UNQUOTED([M4_GNU_OPTION], ["$M4_GNU"], [Define to "-g" if GNU M4
|
||||
supports -g, otherwise to "".])
|
||||
AC_PATH_PROG([PERL], [perl])
|
||||
if test -z "$PERL"; then
|
||||
AC_MSG_ERROR([perl not found])
|
||||
fi
|
||||
AM_MISSING_PROG([HELP2MAN], [help2man])
|
||||
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||
AC_SUBST([XSLTPROC])
|
||||
|
||||
@@ -30,19 +30,21 @@ m4_define([b4_tocpp],
|
||||
# ------------------
|
||||
# A valid C macro name to use as a CPP header guard for FILE.
|
||||
m4_define([b4_cpp_guard],
|
||||
[b4_tocpp(m4_defn([b4_prefix])/[$1])])
|
||||
[[YY_]b4_tocpp(m4_defn([b4_prefix])/[$1])[_INCLUDED]])
|
||||
|
||||
|
||||
# b4_cpp_guard_open(FILE)
|
||||
# b4_cpp_guard_close(FILE)
|
||||
# ------------------------
|
||||
# Open/close CPP inclusion guards for FILE.
|
||||
# If FILE does not expand to nothing, open/close CPP inclusion guards for FILE.
|
||||
m4_define([b4_cpp_guard_open],
|
||||
[m4_ifval(m4_quote($1),
|
||||
[#ifndef b4_cpp_guard([$1])
|
||||
# define b4_cpp_guard([$1])])
|
||||
# define b4_cpp_guard([$1])])])
|
||||
|
||||
m4_define([b4_cpp_guard_close],
|
||||
[#endif b4_comment([!b4_cpp_guard([$1])])])
|
||||
[m4_ifval(m4_quote($1),
|
||||
[#endif b4_comment([!b4_cpp_guard([$1])])])])
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
@@ -182,7 +184,7 @@ m4_define([b4_table_value_equals],
|
||||
[m4_if(m4_eval($3 < m4_indir([b4_]$1[_min])
|
||||
|| m4_indir([b4_]$1[_max]) < $3), [1],
|
||||
[[YYID (0)]],
|
||||
[[((]$2[) == (]$3[))]])])
|
||||
[(!!(($2) == ($3)))])])
|
||||
|
||||
|
||||
## ---------##
|
||||
|
||||
+13
-12
@@ -241,24 +241,24 @@ b4_percent_code_get[]dnl
|
||||
# if defined YYENABLE_NLS && YYENABLE_NLS
|
||||
# if ENABLE_NLS
|
||||
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
||||
# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
|
||||
# endif
|
||||
# endif
|
||||
# ifndef YY_
|
||||
# define YY_(msgid) msgid
|
||||
# define YY_(Msgid) Msgid
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Suppress unused-variable warnings by "using" E. */
|
||||
#if ! defined lint || defined __GNUC__
|
||||
# define YYUSE(e) ((void) (e))
|
||||
# define YYUSE(E) ((void) (E))
|
||||
#else
|
||||
# define YYUSE(e) /* empty */
|
||||
# define YYUSE(E) /* empty */
|
||||
#endif
|
||||
|
||||
/* Identity function, used to suppress warnings about constant conditions. */
|
||||
#ifndef lint
|
||||
# define YYID(n) (n)
|
||||
# define YYID(N) (N)
|
||||
#else
|
||||
]b4_c_function_def([YYID], [static int], [[int i], [i]])[
|
||||
{
|
||||
@@ -289,8 +289,9 @@ b4_percent_code_get[]dnl
|
||||
#ifndef YYSETJMP
|
||||
# include <setjmp.h>
|
||||
# define YYJMP_BUF jmp_buf
|
||||
# define YYSETJMP(env) setjmp (env)
|
||||
# define YYLONGJMP(env, val) longjmp (env, val)
|
||||
# define YYSETJMP(Env) setjmp (Env)
|
||||
// Pacify clang.
|
||||
# define YYLONGJMP(Env, Val) (longjmp (Env, Val), YYASSERT (0))
|
||||
#endif
|
||||
|
||||
/*-----------------.
|
||||
@@ -313,7 +314,7 @@ b4_percent_code_get[]dnl
|
||||
#endif])[
|
||||
|
||||
#ifndef YYASSERT
|
||||
# define YYASSERT(condition) ((void) ((condition) || (abort (), 0)))
|
||||
# define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0)))
|
||||
#endif
|
||||
|
||||
/* YYFINAL -- State number of the termination state. */
|
||||
@@ -972,8 +973,8 @@ yylhsNonterm (yyRuleNum yyrule)
|
||||
return yyr1[yyrule];
|
||||
}
|
||||
|
||||
#define yypact_value_is_default(yystate) \
|
||||
]b4_table_value_equals([[pact]], [[yystate]], [b4_pact_ninf])[
|
||||
#define yypact_value_is_default(Yystate) \
|
||||
]b4_table_value_equals([[pact]], [[Yystate]], [b4_pact_ninf])[
|
||||
|
||||
/** True iff LR state STATE has only a default reduction (regardless
|
||||
* of token). */
|
||||
@@ -990,8 +991,8 @@ yydefaultAction (yyStateNum yystate)
|
||||
return yydefact[yystate];
|
||||
}
|
||||
|
||||
#define yytable_value_is_error(yytable_value) \
|
||||
]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[
|
||||
#define yytable_value_is_error(Yytable_value) \
|
||||
]b4_table_value_equals([[table]], [[Yytable_value]], [b4_table_ninf])[
|
||||
|
||||
/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN.
|
||||
* Result R means
|
||||
|
||||
+1
-3
@@ -30,7 +30,7 @@ b4_copyright([Positions for Bison parsers in C++],
|
||||
]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[
|
||||
|
||||
# include <algorithm> // std::max
|
||||
# include <iosfwd>
|
||||
# include <iostream>
|
||||
# include <string>
|
||||
|
||||
]b4_null_define[
|
||||
@@ -159,8 +159,6 @@ b4_copyright([Locations for Bison parsers in C++],
|
||||
|
||||
]b4_cpp_guard_open([b4_dir_prefix[]location.hh])[
|
||||
|
||||
# include <iostream>
|
||||
# include <string>
|
||||
# include "position.hh"
|
||||
|
||||
]b4_namespace_open[
|
||||
|
||||
+42
-14
@@ -170,6 +170,28 @@ m4_define([b4_declare_scanner_communication_variables], [[
|
||||
/* The lookahead symbol. */
|
||||
int yychar;
|
||||
|
||||
]b4_pure_if([[
|
||||
#if defined __GNUC__ && (4 < __GNUC__ + (6 <= __GNUC_MINOR__))
|
||||
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
|
||||
_Pragma ("GCC diagnostic pop")
|
||||
#else
|
||||
/* Default value used for initialization, for pacifying older GCCs
|
||||
or non-GCC compilers. */
|
||||
static YYSTYPE yyval_default;
|
||||
# define YYLVAL_INITIALIZE() (yylval = yyval_default)
|
||||
#endif]])[
|
||||
#ifndef YYLVAL_INITIALIZE
|
||||
# define YYLVAL_INITIALIZE()
|
||||
#endif
|
||||
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
#endif
|
||||
|
||||
/* The semantic value of the lookahead symbol. */
|
||||
YYSTYPE yylval;]b4_locations_if([[
|
||||
|
||||
@@ -345,9 +367,11 @@ m4_if(b4_api_prefix, [yy], [],
|
||||
# define YYERROR_VERBOSE ]b4_error_verbose_flag[
|
||||
#endif
|
||||
|
||||
/* In a future release of Bison, this section will be replaced
|
||||
]m4_ifval(m4_quote(b4_spec_defines_file),
|
||||
[[/* In a future release of Bison, this section will be replaced
|
||||
by #include "@basename(]b4_spec_defines_file[@)". */
|
||||
]b4_shared_declarations[
|
||||
]])dnl
|
||||
b4_shared_declarations[
|
||||
|
||||
/* Copy the second part of user declarations. */
|
||||
]b4_user_post_prologue
|
||||
@@ -402,24 +426,24 @@ typedef short int yytype_int16;
|
||||
# if defined YYENABLE_NLS && YYENABLE_NLS
|
||||
# if ENABLE_NLS
|
||||
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
||||
# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
|
||||
# endif
|
||||
# endif
|
||||
# ifndef YY_
|
||||
# define YY_(msgid) msgid
|
||||
# define YY_(Msgid) Msgid
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Suppress unused-variable warnings by "using" E. */
|
||||
#if ! defined lint || defined __GNUC__
|
||||
# define YYUSE(e) ((void) (e))
|
||||
# define YYUSE(E) ((void) (E))
|
||||
#else
|
||||
# define YYUSE(e) /* empty */
|
||||
# define YYUSE(E) /* empty */
|
||||
#endif
|
||||
|
||||
/* Identity function, used to suppress warnings about constant conditions. */
|
||||
#ifndef lint
|
||||
# define YYID(n) (n)
|
||||
# define YYID(N) (N)
|
||||
#else
|
||||
]b4_c_function_def([YYID], [static int], [[int yyi], [yyi]])[
|
||||
{
|
||||
@@ -678,11 +702,11 @@ static const ]b4_int_type_for([b4_table])[ yytable[] =
|
||||
]b4_table[
|
||||
};
|
||||
|
||||
#define yypact_value_is_default(yystate) \
|
||||
]b4_table_value_equals([[pact]], [[yystate]], [b4_pact_ninf])[
|
||||
#define yypact_value_is_default(Yystate) \
|
||||
]b4_table_value_equals([[pact]], [[Yystate]], [b4_pact_ninf])[
|
||||
|
||||
#define yytable_value_is_error(yytable_value) \
|
||||
]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[
|
||||
#define yytable_value_is_error(Yytable_value) \
|
||||
]b4_table_value_equals([[table]], [[Yytable_value]], [b4_table_ninf])[
|
||||
|
||||
static const ]b4_int_type_for([b4_check])[ yycheck[] =
|
||||
{
|
||||
@@ -1513,7 +1537,7 @@ b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[
|
||||
int yyn;
|
||||
int yyresult;
|
||||
/* Lookahead token as an internal (translated) token number. */
|
||||
int yytoken;
|
||||
int yytoken = 0;
|
||||
/* The variables used to return semantic value and location from the
|
||||
action routines. */
|
||||
YYSTYPE yyval;]b4_locations_if([[
|
||||
@@ -1538,7 +1562,6 @@ b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[
|
||||
goto yyread_pushed_token;
|
||||
}]])[
|
||||
|
||||
yytoken = 0;
|
||||
yyss = yyssa;
|
||||
yyvs = yyvsa;]b4_locations_if([[
|
||||
yyls = yylsa;]])[
|
||||
@@ -1562,8 +1585,9 @@ b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[
|
||||
The wasted elements are never initialized. */
|
||||
yyssp = yyss;
|
||||
yyvsp = yyvs;]b4_locations_if([[
|
||||
yylsp = yyls;
|
||||
yylsp = yyls;]])[
|
||||
|
||||
YYLVAL_INITIALIZE ();]b4_locations_if([[
|
||||
#if defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL
|
||||
/* Initialize the default location before parsing starts. */
|
||||
yylloc.first_line = yylloc.last_line = ]b4_location_initial_line[;
|
||||
@@ -1749,7 +1773,9 @@ yyread_pushed_token:]])[
|
||||
YY_LAC_DISCARD ("shift");]])[
|
||||
|
||||
yystate = yyn;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
*++yyvsp = yylval;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
]b4_locations_if([ *++yylsp = yylloc;])[
|
||||
goto yynewstate;
|
||||
|
||||
@@ -1969,7 +1995,9 @@ yyerrlab1:
|
||||
current lookahead token, the shift below will for sure. */
|
||||
YY_LAC_DISCARD ("error recovery");]])[
|
||||
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
*++yyvsp = yylval;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
]b4_locations_if([[
|
||||
yyerror_range[2] = yylloc;
|
||||
/* Using YYLLOC is tempting, but would change the location of
|
||||
|
||||
+1
-1
@@ -1,4 +1,3 @@
|
||||
/*.info*
|
||||
/*~
|
||||
/.dirstamp
|
||||
/Makefile
|
||||
@@ -10,6 +9,7 @@
|
||||
/bison.dvi
|
||||
/bison.fn
|
||||
/bison.html
|
||||
/bison.info
|
||||
/bison.ky
|
||||
/bison.log
|
||||
/bison.pdf
|
||||
|
||||
+1
-1
@@ -940,7 +940,7 @@ EXTERNAL_GROUPS = YES
|
||||
# The PERL_PATH should be the absolute path and name of the perl script
|
||||
# interpreter (i.e. the result of `which perl').
|
||||
|
||||
PERL_PATH = /usr/bin/perl
|
||||
PERL_PATH = @PERL@
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ $(srcdir)/cross-options.texi: $(top_srcdir)/src/getargs.c $(CROSS_OPTIONS_PL)
|
||||
$(AM_V_at)rm -f $@.tmp
|
||||
$(AM_V_at)cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) bison
|
||||
$(AM_V_at)$(top_builddir)/src/bison --help \
|
||||
| perl $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp
|
||||
| $(PERL) $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp
|
||||
$(AM_V_at)diff -u $@~ $@.tmp || true
|
||||
$(AM_V_at)mv $@.tmp $@
|
||||
MAINTAINERCLEANFILES = $(srcdir)/cross-options.texi
|
||||
|
||||
+37
-9
@@ -5076,7 +5076,7 @@ default location or at the location specified by @var{qualifier}.
|
||||
|
||||
@deffn {Directive} %debug
|
||||
In the parser implementation file, define the macro @code{YYDEBUG} (or
|
||||
@code{@var{prefix}DEBUG} with @samp{%define api.prefix @var{prefix}}), see
|
||||
@code{@var{prefix}DEBUG} with @samp{%define api.prefix @var{prefix}}, see
|
||||
@ref{Multiple Parsers, ,Multiple Parsers in the Same Program}) to 1 if it is
|
||||
not already defined, so that the debugging facilities are compiled.
|
||||
@xref{Tracing, ,Tracing Your Parser}.
|
||||
@@ -5124,6 +5124,23 @@ Values, ,Semantic Values of Tokens}.
|
||||
If you have declared @code{%code requires} or @code{%code provides}, the output
|
||||
header also contains their code.
|
||||
@xref{%code Summary}.
|
||||
|
||||
@cindex Header guard
|
||||
The generated header is protected against multiple inclusions with a C
|
||||
preprocessor guard: @samp{YY_@var{PREFIX}_@var{FILE}_INCLUDED}, where
|
||||
@var{PREFIX} and @var{FILE} are the prefix (@pxref{Multiple Parsers,
|
||||
,Multiple Parsers in the Same Program}) and generated file name turned
|
||||
uppercase, with each series of non alphanumerical characters converted to a
|
||||
single underscore.
|
||||
|
||||
For instance with @samp{%define api.prefix "calc"} and @samp{%defines
|
||||
"lib/parse.h"}, the header will be guarded as follows.
|
||||
@example
|
||||
#ifndef YY_CALC_LIB_PARSE_H_INCLUDED
|
||||
# define YY_CALC_LIB_PARSE_H_INCLUDED
|
||||
...
|
||||
#endif /* ! YY_CALC_LIB_PARSE_H_INCLUDED */
|
||||
@end example
|
||||
@end deffn
|
||||
|
||||
@deffn {Directive} %defines @var{defines-file}
|
||||
@@ -8502,8 +8519,8 @@ Prologue}).
|
||||
If the @code{%define} variable @code{api.prefix} is used (@pxref{Multiple
|
||||
Parsers, ,Multiple Parsers in the Same Program}), for instance @samp{%define
|
||||
api.prefix x}, then if @code{CDEBUG} is defined, its value controls the
|
||||
tracing feature (enabled iff nonzero); otherwise tracing is enabled iff
|
||||
@code{YYDEBUG} is nonzero.
|
||||
tracing feature (enabled if and only if nonzero); otherwise tracing is
|
||||
enabled if and only if @code{YYDEBUG} is nonzero.
|
||||
|
||||
@item the option @option{-t} (POSIX Yacc compliant)
|
||||
@itemx the option @option{--debug} (Bison extension)
|
||||
@@ -9055,13 +9072,23 @@ separated list of @var{things} among:
|
||||
Description of the grammar, conflicts (resolved and unresolved), and
|
||||
parser's automaton.
|
||||
|
||||
@item itemset
|
||||
Implies @code{state} and augments the description of the automaton with
|
||||
the full set of items for each state, instead of its core only.
|
||||
|
||||
@item lookahead
|
||||
Implies @code{state} and augments the description of the automaton with
|
||||
each rule's lookahead set.
|
||||
|
||||
@item itemset
|
||||
Implies @code{state} and augments the description of the automaton with
|
||||
the full set of items for each state, instead of its core only.
|
||||
@item solved
|
||||
Implies @code{state}. Explain how conflicts were solved thanks to
|
||||
precedence and associativity directives.
|
||||
|
||||
@item all
|
||||
Enable all the items.
|
||||
|
||||
@item none
|
||||
Do not generate the report.
|
||||
@end table
|
||||
|
||||
@item --report-file=@var{file}
|
||||
@@ -11761,10 +11788,11 @@ London, Department of Computer Science, TR-00-12 (December 2000).
|
||||
@c LocalWords: toString deftypeivar deftypeivarx deftypeop YYParser strictfp
|
||||
@c LocalWords: superclasses boolean getErrorVerbose setErrorVerbose deftypecv
|
||||
@c LocalWords: getDebugStream setDebugStream getDebugLevel setDebugLevel url
|
||||
@c LocalWords: bisonVersion deftypecvx bisonSkeleton getStartPos getEndPos
|
||||
@c LocalWords: bisonVersion deftypecvx bisonSkeleton getStartPos getEndPos uint
|
||||
@c LocalWords: getLVal defvar deftypefn deftypefnx gotos msgfmt Corbett LALR's
|
||||
@c LocalWords: subdirectory Solaris nonassociativity perror schemas Malloy
|
||||
@c LocalWords: Scannerless ispell american
|
||||
@c LocalWords: subdirectory Solaris nonassociativity perror schemas Malloy ints
|
||||
@c LocalWords: Scannerless ispell american ChangeLog smallexample CSTYPE CLTYPE
|
||||
@c LocalWords: clval CDEBUG cdebug deftypeopx yyterminate
|
||||
|
||||
@c Local Variables:
|
||||
@c ispell-dictionary: "american"
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
external: gnulib
|
||||
+1
-1
Submodule gnulib updated: bd54a45e6e...d245e6ddd6
@@ -269,3 +269,6 @@
|
||||
/xmemdup0.h
|
||||
/sys_types.in.h
|
||||
/obstack_printf.c
|
||||
/binary-io.c
|
||||
/mbuiter.c
|
||||
/xsize.c
|
||||
|
||||
@@ -180,3 +180,4 @@
|
||||
/xsize.m4
|
||||
/xstrndup.m4
|
||||
/obstack-printf.m4
|
||||
/extern-inline.m4
|
||||
|
||||
+19
-1
@@ -361,7 +361,25 @@ THINGS is a list of comma separated words that can include:\n\
|
||||
`none' disable the report\n\
|
||||
"), stdout);
|
||||
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
putc ('\n', stdout);
|
||||
printf (_("Report bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
printf (_("%s home page: <%s>.\n"), PACKAGE_NAME, PACKAGE_URL);
|
||||
fputs (_("General help using GNU software: "
|
||||
"<http://www.gnu.org/gethelp/>.\n"),
|
||||
stdout);
|
||||
/* Don't output this redundant message for English locales.
|
||||
Note we still output for 'C' so that it gets included in the
|
||||
man page. */
|
||||
const char *lc_messages = setlocale (LC_MESSAGES, NULL);
|
||||
if (lc_messages && strcmp (lc_messages, "en_"))
|
||||
/* TRANSLATORS: Replace LANG_CODE in this URL with your language
|
||||
code <http://translationproject.org/team/LANG_CODE.html> to
|
||||
form one of the URLs at http://translationproject.org/team/.
|
||||
Otherwise, replace the entire URL with your translation team's
|
||||
email address. */
|
||||
fputs (_("Report translation bugs to "
|
||||
"<http://translationproject.org/team/>.\n"), stdout);
|
||||
fputs (_("For complete documentation, run: info bison.\n"), stdout);
|
||||
}
|
||||
|
||||
exit (status);
|
||||
|
||||
+320
-293
File diff suppressed because it is too large
Load Diff
+7
-7
@@ -1,4 +1,4 @@
|
||||
/* A Bison parser, made by GNU Bison 2.6.1.12-3153-dirty. */
|
||||
/* A Bison parser, made by GNU Bison 2.6.3.3-b10d3. */
|
||||
|
||||
/* Bison interface for Yacc-like parsers in C
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
#ifndef GRAM__________SRC_PARSE_GRAM_H
|
||||
# define GRAM__________SRC_PARSE_GRAM_H
|
||||
#ifndef YY_GRAM__________SRC_PARSE_GRAM_H_INCLUDED
|
||||
# define YY_GRAM__________SRC_PARSE_GRAM_H_INCLUDED
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 1
|
||||
@@ -167,8 +167,8 @@ extern int gram_debug;
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
{
|
||||
/* Line 2049 of yacc.c */
|
||||
#line 114 "parse-gram.y"
|
||||
/* Line 2077 of yacc.c */
|
||||
#line 115 "parse-gram.y"
|
||||
|
||||
symbol *symbol;
|
||||
symbol_list *list;
|
||||
@@ -181,7 +181,7 @@ typedef union YYSTYPE
|
||||
named_ref *named_ref;
|
||||
|
||||
|
||||
/* Line 2049 of yacc.c */
|
||||
/* Line 2077 of yacc.c */
|
||||
#line 186 "parse-gram.h"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
@@ -217,4 +217,4 @@ int gram_parse ();
|
||||
#endif
|
||||
#endif /* ! YYPARSE_PARAM */
|
||||
|
||||
#endif /* !GRAM__________SRC_PARSE_GRAM_H */
|
||||
#endif /* !YY_GRAM__________SRC_PARSE_GRAM_H_INCLUDED */
|
||||
|
||||
+3
-2
@@ -20,6 +20,7 @@
|
||||
#include <config.h>
|
||||
#include "system.h"
|
||||
|
||||
#include "c-ctype.h"
|
||||
#include "complain.h"
|
||||
#include "conflicts.h"
|
||||
#include "files.h"
|
||||
@@ -735,11 +736,11 @@ add_param (char const *type, char *decl, location loc)
|
||||
/* Strip the surrounding '{' and '}', and any blanks just inside
|
||||
the braces. */
|
||||
--p;
|
||||
while (isspace ((unsigned char) *p))
|
||||
while (c_isspace ((unsigned char) *p))
|
||||
--p;
|
||||
p[1] = '\0';
|
||||
++decl;
|
||||
while (isspace ((unsigned char) *decl))
|
||||
while (c_isspace ((unsigned char) *decl))
|
||||
++decl;
|
||||
|
||||
if (! name_start)
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@
|
||||
#include "reader.h"
|
||||
#include "uniqstr.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <c-ctype.h>
|
||||
#include <mbswidth.h>
|
||||
#include <quote.h>
|
||||
|
||||
@@ -560,7 +560,7 @@ splice (\\[ \f\t\v]*\n)*
|
||||
\\(.|\n) {
|
||||
char const *p = yytext + 1;
|
||||
/* Quote only if escaping won't make the character visible. */
|
||||
if (isspace ((unsigned char) *p) && isprint ((unsigned char) *p))
|
||||
if (c_isspace ((unsigned char) *p) && c_isprint ((unsigned char) *p))
|
||||
p = quote (p);
|
||||
else
|
||||
p = quotearg_style_mem (escape_quoting_style, p, 1);
|
||||
|
||||
@@ -38,11 +38,6 @@
|
||||
# include <stddef.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
|
||||
# if HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
# endif
|
||||
|
||||
# include <unistd.h>
|
||||
# include <inttypes.h>
|
||||
|
||||
@@ -105,7 +100,6 @@ typedef size_t uintptr_t;
|
||||
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
|
||||
# endif
|
||||
|
||||
# define FUNCTION_PRINT() fprintf (stderr, "%s: ", __func__)
|
||||
|
||||
/*------.
|
||||
| NLS. |
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ uniqstr uniqstr_vsprintf (char const *format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 1, 2)));
|
||||
|
||||
/* Two uniqstr values have the same value iff they are the same. */
|
||||
#define UNIQSTR_EQ(USTR1, USTR2) ((USTR1) == (USTR2))
|
||||
#define UNIQSTR_EQ(USTR1, USTR2) (!!((USTR1) == (USTR2)))
|
||||
|
||||
/* Compare two uniqstr a la strcmp: negative for <, nul for =, and
|
||||
positive for >. Undefined order, relies on addresses. */
|
||||
|
||||
+13
-18
@@ -29,16 +29,10 @@ CPPFLAGS="-I$abs_top_builddir/lib @CPPFLAGS@"
|
||||
# Is the compiler GCC?
|
||||
GCC='@GCC@'
|
||||
|
||||
# We want no optimization, as they uncover warnings (therefore,
|
||||
# failures) about uninitialized variables in the test suite. FIXME:
|
||||
# fix the warnings, not the flags.
|
||||
O0CFLAGS=`echo '@CFLAGS@' | sed 's/-O[0-9s] *//g'`
|
||||
O0CXXFLAGS=`echo '@CXXFLAGS@' | sed 's/-O[0-9s] *//g'`
|
||||
|
||||
# Sometimes a test group needs to ignore gcc warnings, so it locally
|
||||
# sets CFLAGS to this.
|
||||
NO_WERROR_CFLAGS="$O0CFLAGS @WARN_CFLAGS@ @WARN_CFLAGS_TEST@"
|
||||
NO_WERROR_CXXFLAGS="$O0CXXFLAGS @WARN_CXXFLAGS@ @WARN_CXXFLAGS_TEST@"
|
||||
NO_WERROR_CFLAGS='@CFLAGS@ @WARN_CFLAGS@ @WARN_CFLAGS_TEST@'
|
||||
NO_WERROR_CXXFLAGS='@CXXFLAGS@ @WARN_CXXFLAGS@ @WARN_CXXFLAGS_TEST@'
|
||||
|
||||
# But most of the time, we want -Werror.
|
||||
CFLAGS="$NO_WERROR_CFLAGS @WERROR_CFLAGS@"
|
||||
@@ -51,7 +45,6 @@ BISON_CXX_WORKS='@BISON_CXX_WORKS@'
|
||||
if "$at_arg_compile_c_with_cxx"; then
|
||||
CC_IS_CXX=1
|
||||
CC=$CXX
|
||||
O0CFLAGS=$O0CXXFLAGS
|
||||
NO_WERROR_CFLAGS=$NO_WERROR_CXXFLAGS
|
||||
CFLAGS=$CXXFLAGS
|
||||
else
|
||||
@@ -63,24 +56,26 @@ fi
|
||||
## Other. ##
|
||||
## ------- ##
|
||||
|
||||
# Are special link options needed?
|
||||
LDFLAGS='@LDFLAGS@'
|
||||
|
||||
# Are special libraries needed?
|
||||
LIBS="$abs_top_builddir/lib/libbison.a @LIBS@ @INTLLIBS@"
|
||||
|
||||
# Empty if no javac was found
|
||||
CONF_JAVAC='@CONF_JAVAC@'
|
||||
|
||||
# Empty if no Java VM was found
|
||||
CONF_JAVA='@CONF_JAVA@'
|
||||
|
||||
# Empty if no xsltproc was found
|
||||
: ${XSLTPROC='@XSLTPROC@'}
|
||||
|
||||
# We need egrep.
|
||||
: ${EGREP='@EGREP@'}
|
||||
|
||||
# Use simple quotes (lib/quote.c).
|
||||
LC_CTYPE=C
|
||||
export LC_CTYPE
|
||||
|
||||
# Are special link options needed?
|
||||
LDFLAGS='@LDFLAGS@'
|
||||
|
||||
# Are special libraries needed?
|
||||
LIBS="$abs_top_builddir/lib/libbison.a @LIBS@ @INTLLIBS@"
|
||||
|
||||
# Empty if no xsltproc was found
|
||||
: ${XSLTPROC='@XSLTPROC@'}
|
||||
|
||||
: ${PERL='@PERL@'}
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
|
||||
abs_top_srcdir='@abs_top_srcdir@'
|
||||
abs_top_builddir='@abs_top_builddir@'
|
||||
: ${PERL=perl}
|
||||
: ${PERL='@PERL@'}
|
||||
|
||||
# Use the shipped files, not those installed.
|
||||
BISON_PKGDATADIR=$abs_top_srcdir/data
|
||||
|
||||
+4
-5
@@ -1,4 +1,4 @@
|
||||
# Checking the output filenames. -*- Autotest -*-
|
||||
# Checking the C++ Features. -*- Autotest -*-
|
||||
|
||||
# Copyright (C) 2004-2005, 2007, 2009-2012 Free Software Foundation,
|
||||
# Inc.
|
||||
@@ -30,6 +30,7 @@ m4_define([AT_CHECK_DOXYGEN],
|
||||
[m4_fatal([invalid argument: $1])])
|
||||
AT_SETUP([Doxygen $1 Documentation])
|
||||
|
||||
AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc"])
|
||||
AT_DATA([input.yy],
|
||||
[[%skeleton "lalr1.cc"
|
||||
%locations
|
||||
@@ -38,10 +39,7 @@ AT_DATA([input.yy],
|
||||
%%
|
||||
exp:;
|
||||
%%
|
||||
yy::parser::error (const location& l, const std::string& m)
|
||||
{
|
||||
std::cerr << l << s << std::endl;
|
||||
}
|
||||
]AT_YYERROR_DEFINE[
|
||||
]])
|
||||
|
||||
AT_BISON_CHECK([-o input.cc input.yy], 0)
|
||||
@@ -94,6 +92,7 @@ EXTRACT_STATIC = AT_DOXYGEN_PRIVATE
|
||||
AT_CHECK([doxygen --version || exit 77], 0, ignore)
|
||||
AT_CHECK([doxygen], 0, [], [ignore])
|
||||
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
AT_CLEANUP
|
||||
|
||||
m4_popdef([AT_DOXYGEN_PRIVATE])
|
||||
|
||||
+9
-6
@@ -503,12 +503,15 @@ AT_CHECK([cat stderr], 0, [expout])
|
||||
# Make sure we did not introduce bad spaces. Checked here because all
|
||||
# the skeletons are (or should be) exercized here.
|
||||
m4_define([AT_CHECK_SPACES],
|
||||
[# No initial empty lines.
|
||||
AT_CHECK([sed -ne '/./q;=;p;' $1])
|
||||
# No trailing spaces.
|
||||
# FIXME: For 2.7: AT_CHECK([sed -ne '/[ ]$/{=;p;}' $1])
|
||||
# No final empty lines.
|
||||
AT_CHECK([sed -ne '${/^$/{=;p;};}' $1])
|
||||
[AT_CHECK([$PERL -ne '
|
||||
chomp;
|
||||
print "$.: {$_}\n"
|
||||
if (# No starting/ending empty lines.
|
||||
(eof || $. == 1) && /^\s*$/
|
||||
# No trailing space. FIXME: not ready for "maint".
|
||||
# || /\s$/
|
||||
)' $1
|
||||
])dnl
|
||||
])
|
||||
|
||||
|
||||
|
||||
+4
-1
@@ -35,7 +35,10 @@ dnl time comes, just use sed to drop the line numbers. For now, as LR(1)
|
||||
dnl support is rapidly evolving, let's keep that information to be careful.
|
||||
dnl However, we don't do diffs for canonical LR(1) because the diff is huge.
|
||||
m4_pushdef([AT_LALR1_DIFF_CHECK],
|
||||
[AT_CHECK([[sed 's/^%define lr.type .*$//' input.y > input-lalr.y]])
|
||||
[dnl We need diff -u, which is not portable.
|
||||
AT_CHECK([diff -u /dev/null /dev/null || exit 77], [0], [ignore])
|
||||
|
||||
AT_CHECK([[sed 's/^%define lr.type .*$//' input.y > input-lalr.y]])
|
||||
AT_BISON_CHECK([[--report=all input-lalr.y]], [[0]], [ignore], [ignore])
|
||||
AT_CHECK([[diff -u input-lalr.output input.output \
|
||||
| sed -n '/^@@/,$p' | sed 's/^ $//']],
|
||||
|
||||
+23
-6
@@ -126,8 +126,9 @@ AT_SETUP([Several parsers])
|
||||
|
||||
# AT_TEST([PREFIX], [DIRECTIVES])
|
||||
# -------------------------------
|
||||
# Generate and compile to *.o. Make sure there is no YY* nor yy* in
|
||||
# the header (but YYDEBUG and YYPARSE_PARAM).
|
||||
# Generate and compile to *.o. Make sure there is no (allowed) YY*
|
||||
# nor yy* identifiers in the header. Check that headers are
|
||||
# self-contained, and can be compiled by a C++ compiler.
|
||||
m4_pushdef([AT_TEST],
|
||||
[AT_BISON_OPTION_PUSHDEFS([%define api.prefix "$1_" $2])
|
||||
AT_DATA_GRAMMAR([$1.AT_SKEL_CC_IF([yy], [y])],
|
||||
@@ -161,20 +162,23 @@ exp:
|
||||
]])
|
||||
|
||||
AT_BISON_CHECK([-d -o AT_SKEL_CC_IF([$1.cc $1.yy], [$1.c $1.y])])
|
||||
|
||||
# Check there is no 'yy' left.
|
||||
# C++ output relies on namespaces and still uses yy a lot.
|
||||
AT_SKEL_CC_IF([],
|
||||
[AT_CHECK([$EGREP yy $1.h], [1])])
|
||||
|
||||
# Ignore comments. Ignore YYPARSE_PARAM (obsolete) and
|
||||
# YYPUSH_MORE(_DEFINED)? (whose definition is constant).
|
||||
# Check there is not 'YY' left.
|
||||
# Ignore comments, YYPARSE_PARAM (obsolete), YYPUSH_MORE(_DEFINED)?
|
||||
# (constant definition), YY_\w+_INCLUDED (header guards).
|
||||
#
|
||||
# YYDEBUG (not renamed) can be read, but not changed.
|
||||
AT_CHECK([[sed -ne 's,/\*[^*]*\*/,,g;s,//.*,,' \
|
||||
-e '/YY/p' ]$1.AT_SKEL_CC_IF([hh], [h])[ |
|
||||
$EGREP -wv 'YY(PARSE_PARAM|PUSH_MORE(_DEFINED)?)|(defined|if) YYDEBUG']],
|
||||
$EGREP -wv 'YY(PARSE_PARAM|PUSH_MORE(_DEFINED)?|_[0-9A-Z_]+_INCLUDED)|(defined|if) YYDEBUG']],
|
||||
[1])
|
||||
AT_LANG_COMPILE([$1.o])
|
||||
|
||||
AT_LANG_COMPILE([$1.o])
|
||||
AT_CHECK([[echo "$1" >>expout]])
|
||||
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
@@ -239,6 +243,19 @@ AT_TEST([x8], [%define api.pure %define api.push-pull both])
|
||||
AT_COMPILE_CXX([parser], [[x[1-8].o -DCC_IS_CXX=$CC_IS_CXX main.cc]])
|
||||
AT_CHECK([./parser], [0], [[expout]])
|
||||
|
||||
# Check that the headers are self-contained, and protected against
|
||||
# multiple inclusions. While at it, check they are sane for C++.
|
||||
for h in *.h *.hh
|
||||
do
|
||||
# No shell expansion with AT_DATA.
|
||||
cat >$h.cc <<EOF
|
||||
AT_DATA_SOURCE_PROLOGUE
|
||||
#include "$h"
|
||||
#include "$h"
|
||||
EOF
|
||||
AT_COMPILE_CXX([$h.o])
|
||||
done
|
||||
|
||||
m4_popdef([AT_TEST])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
+4
-4
@@ -1194,7 +1194,7 @@ AT_DATA([empty.y],
|
||||
start: '';
|
||||
start: '
|
||||
]])
|
||||
AT_CHECK([[perl -e "print 'start: \'';" >> empty.y || exit 77]])
|
||||
AT_CHECK([[$PERL -e "print 'start: \'';" >> empty.y || exit 77]])
|
||||
|
||||
AT_BISON_CHECK([empty.y], [1], [],
|
||||
[[empty.y:2.8-9: warning: empty character literal
|
||||
@@ -1209,7 +1209,7 @@ AT_DATA([two.y],
|
||||
start: 'ab';
|
||||
start: 'ab
|
||||
]])
|
||||
AT_CHECK([[perl -e "print 'start: \'ab';" >> two.y || exit 77]])
|
||||
AT_CHECK([[$PERL -e "print 'start: \'ab';" >> two.y || exit 77]])
|
||||
|
||||
AT_BISON_CHECK([two.y], [1], [],
|
||||
[[two.y:2.8-11: warning: extra characters in character literal
|
||||
@@ -1224,7 +1224,7 @@ AT_DATA([three.y],
|
||||
start: 'abc';
|
||||
start: 'abc
|
||||
]])
|
||||
AT_CHECK([[perl -e "print 'start: \'abc';" >> three.y || exit 77]])
|
||||
AT_CHECK([[$PERL -e "print 'start: \'abc';" >> three.y || exit 77]])
|
||||
|
||||
AT_BISON_CHECK([three.y], [1], [],
|
||||
[[three.y:2.8-12: warning: extra characters in character literal
|
||||
@@ -1253,7 +1253,7 @@ start: '\777' '\0' '\xfff' '\x0'
|
||||
# Beside we cannot even expect "echo '\0'" to output two characters
|
||||
# (well three with \n): at least Bash 3.2 converts the two-character
|
||||
# sequence "\0" into a single NUL character.
|
||||
AT_CHECK([[perl -e 'print "start: \"\\\t\\\f\\\0\\\1\" ;";' >> input.y \
|
||||
AT_CHECK([[$PERL -e 'print "start: \"\\\t\\\f\\\0\\\1\" ;";' >> input.y \
|
||||
|| exit 77]])
|
||||
|
||||
AT_BISON_CHECK([input.y], [1], [],
|
||||
|
||||
+3
-2
@@ -38,7 +38,7 @@ m4_define([m4_null_if],
|
||||
# Expect COUNT matches of the PERL-REGEXP in FILE. The file is
|
||||
# taken in "slurp" mode, i.e., one can match end-of-lines.
|
||||
m4_define([AT_MATCHES_CHECK],
|
||||
[AT_CHECK([perl -0777 -ne '
|
||||
[AT_CHECK([$PERL -0777 -ne '
|
||||
my $count = 0;
|
||||
s{$2}{ ++$count; "" }gem;
|
||||
printf "$count\n";' $1], [0], [$3
|
||||
@@ -405,7 +405,8 @@ void
|
||||
public void yyerror (String s)
|
||||
{
|
||||
System.err.println (s);
|
||||
}]])])dnl
|
||||
}]])],
|
||||
[m4_fatal([$0: invalid language: ]AT_LANG)])dnl
|
||||
])
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -1481,17 +1481,17 @@ AT_CHECK([[grep 'syntax error,' stderr.txt]], [[0]],
|
||||
|
||||
# Check number of default reductions in inconsistent states to be sure
|
||||
# syntax error is detected before unnecessary reductions are performed.
|
||||
AT_CHECK([[perl -0777 -ne 'print s/inconsistent default reduction//g;' \
|
||||
AT_CHECK([[$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \
|
||||
< stdout.txt || exit 77]], [[0]], [[14]])
|
||||
|
||||
# Check number of default reductions in consistent states to be sure
|
||||
# it is performed before the syntax error is detected.
|
||||
AT_CHECK([[perl -0777 -ne 'print s/\bconsistent default reduction//g;' \
|
||||
AT_CHECK([[$PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \
|
||||
< stdout.txt || exit 77]], [[0]], [[2]])
|
||||
|
||||
# Check number of reallocs to be sure reallocated memory isn't somehow
|
||||
# lost between LAC invocations.
|
||||
AT_CHECK([[perl -0777 -ne 'print s/\(realloc//g;' < stderr.txt \
|
||||
AT_CHECK([[$PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \
|
||||
|| exit 77]], [[0]], [[3]])
|
||||
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
|
||||
+1
-1
@@ -315,7 +315,7 @@ print '@output(@,@)', "\n";
|
||||
(print "garbage"x10, "\n") for (1..1000);
|
||||
print "${M4}_divert_pop(0)\n";
|
||||
]])
|
||||
AT_CHECK([[perl gen-skel.pl > skel.c || exit 77]])
|
||||
AT_CHECK([[$PERL gen-skel.pl > skel.c || exit 77]])
|
||||
|
||||
AT_DATA([[input.y]],
|
||||
[[%skeleton "./skel.c"
|
||||
|
||||
+51
-1
@@ -64,7 +64,7 @@ m4_define([AT_SYNCLINES_COMPILE],
|
||||
# distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
|
||||
# distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
|
||||
|
||||
AT_CHECK([[perl -p -0777 - stderr <<\EOF
|
||||
AT_CHECK([[$PERL -p -0777 - stderr <<\EOF
|
||||
s/^distcc\[\d+\] .*\n//gm;
|
||||
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$][1:$][2/gm;
|
||||
s/^([^:]+:\d+):[^#]*( #error)/$][1:$][2/gm;
|
||||
@@ -216,4 +216,54 @@ exp: '0';
|
||||
[input.y:8: #error "8"
|
||||
])
|
||||
|
||||
## -------------------- ##
|
||||
## %code top syncline. ##
|
||||
## -------------------- ##
|
||||
|
||||
AT_TEST([%code top syncline],
|
||||
[[%code top {
|
||||
#error "2"
|
||||
}
|
||||
%{
|
||||
]AT_YYERROR_DECLARE_EXTERN[
|
||||
]AT_YYLEX_DECLARE_EXTERN[
|
||||
%}
|
||||
%%
|
||||
exp: '0';
|
||||
%%
|
||||
]],
|
||||
[input.y:2: #error "2"
|
||||
])
|
||||
|
||||
m4_popdef([AT_TEST])
|
||||
|
||||
## ----------- ##
|
||||
## %no-lines. ##
|
||||
## ----------- ##
|
||||
|
||||
m4_pushdef([AT_TEST],
|
||||
[AT_SETUP([%no-lines])
|
||||
|
||||
AT_BISON_OPTION_PUSHDEFS([%skeleton "$1" %defines])
|
||||
AT_DATA_GRAMMAR([input.y],
|
||||
[%skeleton "$1" %defines
|
||||
%{
|
||||
]AT_YYERROR_DECLARE_EXTERN[
|
||||
]AT_YYLEX_DECLARE_EXTERN[
|
||||
%}
|
||||
%%
|
||||
exp: '0'
|
||||
])
|
||||
AT_BISON_CHECK([--no-lines -o input.AT_SKEL_CC_IF([cc], [c]) -d input.y])
|
||||
AT_CHECK([[grep '#line' ]AT_SKEL_CC_IF([*.cc *.hh], [*.c *.h])], 1)
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
|
||||
AT_CLEANUP
|
||||
])
|
||||
|
||||
AT_TEST([yacc.c])
|
||||
AT_TEST([glr.c])
|
||||
AT_TEST([lalr1.cc])
|
||||
AT_TEST([glr.cc])
|
||||
|
||||
m4_popdef([AT_TEST])
|
||||
|
||||
+37
-31
@@ -125,7 +125,7 @@ EOF
|
||||
]])
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
|
||||
AT_CHECK([perl -w ./gengram.pl $2 || exit 77], 0, [stdout])
|
||||
AT_CHECK([$PERL -w ./gengram.pl $2 || exit 77], 0, [stdout])
|
||||
mv stdout $1
|
||||
])
|
||||
|
||||
@@ -214,7 +214,7 @@ main (void)
|
||||
EOF
|
||||
]])
|
||||
|
||||
AT_CHECK([perl -w ./gengram.pl $2 || exit 77], 0, [stdout])
|
||||
AT_CHECK([$PERL -w ./gengram.pl $2 || exit 77], 0, [stdout])
|
||||
mv stdout $1
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
])
|
||||
@@ -350,7 +350,7 @@ main (void)
|
||||
EOF
|
||||
]])
|
||||
|
||||
AT_CHECK([perl -w ./gengram.pl $2 || exit 77], 0, [stdout])
|
||||
AT_CHECK([$PERL -w ./gengram.pl $2 || exit 77], 0, [stdout])
|
||||
mv stdout $1
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
])
|
||||
@@ -412,38 +412,44 @@ yylex (void)
|
||||
return EOF;
|
||||
}
|
||||
|
||||
/* Return argv[1] as an int. */
|
||||
static int
|
||||
get_args (int argc, const char **argv)
|
||||
{
|
||||
int res;
|
||||
char *endp;
|
||||
assert (argc == 2);
|
||||
res = strtol (argv[1], &endp, 10);
|
||||
assert (argv[1] != endp);
|
||||
assert (0 <= res);
|
||||
assert (res <= INT_MAX);
|
||||
assert (errno != ERANGE);
|
||||
return res;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, const char **argv)
|
||||
{
|
||||
char *endp;
|
||||
YYSTYPE yylval_init;
|
||||
assert (argc == 2);
|
||||
yylval_init = strtol (argv[1], &endp, 10);
|
||||
assert (argv[1] != endp);
|
||||
assert (0 <= yylval_init);
|
||||
assert (yylval_init <= INT_MAX);
|
||||
assert (errno != ERANGE);
|
||||
yydebug = 1;
|
||||
{
|
||||
int count;
|
||||
int status;
|
||||
]m4_bmatch([$2], [%push-],
|
||||
[[ yypstate *ps = yypstate_new ();
|
||||
]])[ for (count = 0; count < 2; ++count)
|
||||
{
|
||||
int new_status;
|
||||
yylval = yylval_init;
|
||||
]m4_bmatch([$2], [%push-],
|
||||
[[ new_status = yypull_parse (ps);
|
||||
]],
|
||||
[[ new_status = yyparse ();
|
||||
]])[ assert (0 <= count || new_status == status);
|
||||
YYSTYPE yylval_init = get_args (argc, argv);
|
||||
int status;
|
||||
int count;
|
||||
]m4_bmatch([$2], [api.push-pull both],
|
||||
[[ yypstate *ps = yypstate_new ();
|
||||
]])[ yydebug = 1;
|
||||
for (count = 0; count < 2; ++count)
|
||||
{
|
||||
int new_status;
|
||||
yylval = yylval_init;
|
||||
new_status = ]m4_bmatch([$2], [api.push-pull both],
|
||||
[[yypull_parse (ps)]],
|
||||
[[yyparse ()]])[;
|
||||
if (count == 0)
|
||||
status = new_status;
|
||||
}
|
||||
]m4_bmatch([$2], [%push-],
|
||||
[[ yypstate_delete (ps);
|
||||
]])[ return status;
|
||||
}
|
||||
else
|
||||
assert (new_status == status);
|
||||
}]m4_bmatch([$2], [api.push-pull both],[[
|
||||
yypstate_delete (ps);]])[
|
||||
return status;
|
||||
}
|
||||
]])
|
||||
AT_BISON_OPTION_POPDEFS([$2])
|
||||
|
||||
Reference in New Issue
Block a user