AT_KEYWORDS([report])
AT_DATA([input.y],
-[[%token undef_id_tok const_id_tok
+[[%token undef_id_tok const_id_tok
%start CONST_DEC_PART
\f
;
CONST_DEC_LIST:
- CONST_DEC
+ CONST_DEC
| CONST_DEC_LIST CONST_DEC
;
CONST_DEC:
- { } undef_id_tok '=' const_id_tok ';'
+ { } undef_id_tok '=' const_id_tok ';'
;
%%
]])
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6
};
-static const yytype_uint8 yyprhs[] =
-{
- 0, 0, 3, 5, 6, 9, 14
-};
-static const yytype_int8 yyrhs[] =
-{
- 8, 0, -1, 9, -1, -1, 10, 11, -1, 3,
- 4, 5, 8, -1, 6, 8, -1
-};
static const yytype_uint8 yyrline[] =
{
0, 2, 2, 3, 3, 4, 5
static const char *const yytname[] =
{
"$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"",
- "\"else\"", "$accept", "statement", "struct_stat", "if", "else", 0
+ "\"else\"", "$accept", "statement", "struct_stat", "if", "else", YY_NULL
};
static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261
};
-static const yytype_uint8 yyr1[] =
-{
- 0, 7, 8, 9, 9, 10, 11
-};
-static const yytype_uint8 yyr2[] =
+static const yytype_int8 yypact[] =
{
- 0, 2, 1, 0, 2, 4, 2
+ -2, -1, 4, -8, 0, 2, -8, -2, -8, -2,
+ -8, -8
};
static const yytype_uint8 yydefact[] =
{
3, 0, 0, 2, 0, 0, 1, 3, 4, 3,
6, 5
};
-static const yytype_int8 yydefgoto[] =
-{
- -1, 2, 3, 4, 8
-};
-static const yytype_int8 yypact[] =
-{
- -2, -1, 4, -8, 0, 2, -8, -2, -8, -2,
- -8, -8
-};
static const yytype_int8 yypgoto[] =
{
-8, -7, -8, -8, -8
};
+static const yytype_int8 yydefgoto[] =
+{
+ -1, 2, 3, 4, 8
+};
static const yytype_uint8 yytable[] =
{
10, 1, 11, 5, 6, 0, 7, 9
0, 3, 8, 9, 10, 4, 0, 6, 11, 5,
8, 8
};
+static const yytype_uint8 yyr1[] =
+{
+ 0, 7, 8, 9, 9, 10, 11
+};
+static const yytype_uint8 yyr2[] =
+{
+ 0, 2, 1, 0, 2, 4, 2
+};
]])
AT_CLEANUP
[AT_DATA_GRAMMAR([dancer.y],
[%{
static int yylex (AT_LALR1_CC_IF([int *], [void]));
-AT_LALR1_CC_IF([],
+AT_LALR1_CC_IF([#include <cstdlib>],
[#include <stdlib.h>
#include <stdio.h>
static void yyerror (const char *);])
AT_LALR1_CC_IF(
[/* A C++ error reporting function. */
void
-yy::parser::error (const location&, const std::string& m)
+yy::parser::error (const std::string& m)
{
std::cerr << m << std::endl;
}
[AT_DATA_GRAMMAR([expect2.y],
[%{
static int yylex (AT_LALR1_CC_IF([int *], [void]));
-AT_LALR1_CC_IF([],
+AT_LALR1_CC_IF([#include <cstdlib>],
[#include <stdio.h>
#include <stdlib.h>
static void yyerror (const char *);])
AT_LALR1_CC_IF(
[/* A C++ error reporting function. */
void
-yy::parser::error (const location&, const std::string& m)
+yy::parser::error (const std::string& m)
{
std::cerr << m << std::endl;
}
start:
{
printf ("Bison would once convert this action to a midrule because of the"
- " subsequent braced code.\n");
+ " subsequent braced code.\n");
}
;
AT_SETUP([[parse-gram.y: LALR = IELR]])
-# Avoid differences in synclines by telling bison that the output files
-# have the same name.
+# Avoid tests/bison's dark magic by processing a local copy of the
+# grammar. Avoid differences in synclines by telling bison that the
+# output files have the same name.
[cp $abs_top_srcdir/src/parse-gram.y input.y]
AT_BISON_CHECK([[-o input.c -Dlr.type=lalr input.y]])
[mv input.c expout]
-## --------------------------------------- ##
-## %error-verbose and YYSTACK_USE_ALLOCA. ##
-## --------------------------------------- ##
+## -------------------------------------------- ##
+## parse.error=verbose and YYSTACK_USE_ALLOCA. ##
+## -------------------------------------------- ##
-AT_SETUP([[%error-verbose and YYSTACK_USE_ALLOCA]])
+AT_SETUP([[parse.error=verbose and YYSTACK_USE_ALLOCA]])
AT_DATA_GRAMMAR([input.y],
[[%code {
#define YYSTACK_USE_ALLOCA 1
}
-%error-verbose
+%define parse.error verbose
%%
-## ------------------------- ##
-## %error-verbose overflow. ##
-## ------------------------- ##
+## ------------------------------ ##
+## parse.error=verbose overflow. ##
+## ------------------------------ ##
# Imagine the case where YYSTACK_ALLOC_MAXIMUM = YYSIZE_MAXIMUM and an
# invocation of yysyntax_error has caused yymsg_alloc to grow to exactly
# size calculation would return YYSIZE_MAXIMUM to yyparse. Then,
# yyparse would invoke yyerror using the old contents of yymsg.
-AT_SETUP([[%error-verbose overflow]])
+AT_SETUP([[parse.error=verbose overflow]])
AT_DATA_GRAMMAR([input.y],
[[%code {
#define YYMAXDEPTH 100
}
-%error-verbose
+%define parse.error verbose
%%
}
]$1[
-%error-verbose
+%define parse.error verbose
%token 'c'
%%