AT_BISON_OPTION_POPDEFS
AT_BISON_CHECK([-o input.c input.y])
-AT_COMPILE([input.o], [-c input.c])
+AT_COMPILE([input.o])
AT_COMPILE([input.o], [-DYYDEBUG -c input.c])
AT_CLEANUP
AT_BISON_OPTION_POPDEFS
AT_BISON_CHECK([-o input.c input.y])
-AT_COMPILE([input.o], [-c input.c])
+AT_COMPILE([input.o])
AT_CLEANUP
AT_BISON_OPTION_POPDEFS
AT_BISON_CHECK([-y -o input.c input.y])
-AT_COMPILE([input.o], [-c input.c])
+AT_COMPILE([input.o])
AT_CLEANUP
AT_BISON_OPTION_POPDEFS
AT_BISON_CHECK([-o input.c input.y])
-AT_COMPILE([input.o], [-c input.c])
+AT_COMPILE([input.o])
AT_CLEANUP
%%
exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!";
%%
-void
-yyerror (char const *s)
-{
- fprintf (stderr, "%s\n", s);
-}
+]AT_YYERROR_DEFINE[
int
yylex (void)
AT_BISON_OPTION_POPDEFS
AT_BISON_CHECK([-o input.c input.y])
-AT_COMPILE([input.o], [-c input.c])
+AT_COMPILE([input.o])
AT_CLEANUP
| INVALID
;
%%
-AT_LALR1_CC_IF(
-[/* A C++ error reporting function. */
-void
-yy::parser::error (const location&, const std::string& m)
-{
- std::cerr << m << std::endl;
-}
-
-int
+AT_YYERROR_DEFINE[
+]AT_LALR1_CC_IF(
+[int
yyparse ()
{
yy::parser parser;
#endif
return parser.parse ();
}
-],
-[static void
-yyerror (const char *s)
-{
- fprintf (stderr, "%s\n", s);
-}])
+])
+#include <assert.h>
static int
yylex (AT_LALR1_CC_IF([int *lval], [void]))
[{
};
static size_t toknum;
]AT_LALR1_CC_IF([*lval = 0; /* Pacify GCC. */])[
- if (! (toknum < sizeof tokens / sizeof *tokens))
- abort ();
+ assert (toknum < sizeof tokens / sizeof *tokens);
return tokens[toknum++];
}]
}
])[
+#include <assert.h>
static int
yylex (]AT_LALR1_CC_IF([int *lval], [void])[)
{
};
static size_t toknum;
]AT_LALR1_CC_IF([*lval = 0; /* Pacify GCC. */])[
- if (! (toknum < sizeof tokens / sizeof *tokens))
- abort ();
+ assert (toknum < sizeof tokens / sizeof *tokens);
return tokens[toknum++];
}
/* Induce two syntax error messages (which requires full error
recovery by shifting 3 tokens) in order to detect any loss of the
reallocated buffer. */
-]AT_YYLEX_DEFINE([abc])[
+]AT_YYLEX_DEFINE(["abc"])[
int
main (void)
{
]AT_YYERROR_DEFINE[
/* Induce two syntax error messages (which requires full error
recovery by shifting 3 tokens). */
-]AT_YYLEX_DEFINE([abc])[
+]AT_YYLEX_DEFINE(["abc"])[
int
main (void)
{
%%
]AT_YYERROR_DEFINE[
-]AT_YYLEX_DEFINE([$1])[
+]AT_YYLEX_DEFINE(["$1"])[
int
main (void)
{