// data is a pointer to a 'SParserParam' structure
//#define YYPARSE_PARAM parser_ctx
-// the argument for the 'yylex' function
-#define YYLEX_PARAM ((struct filter_parser_ctx *) parser_ctx)->scanner
-
#ifndef YY_TYPEDEF_YY_SCANNER_T
#define YY_TYPEDEF_YY_SCANNER_T
typedef void* yyscan_t;
int filter_parser_debug = 0;
LTTNG_HIDDEN
-int yyparse(struct filter_parser_ctx *parser_ctx);
+int yyparse(struct filter_parser_ctx *parser_ctx, yyscan_t scanner);
LTTNG_HIDDEN
-int yylex(union YYSTYPE *yyval, struct filter_parser_ctx *parser_ctx);
+int yylex(union YYSTYPE *yyval, yyscan_t scanner);
LTTNG_HIDDEN
int yylex_init_extra(struct filter_parser_ctx *parser_ctx, yyscan_t * ptr_yy_globals);
LTTNG_HIDDEN
}
LTTNG_HIDDEN
-void yyerror(struct filter_parser_ctx *parser_ctx, const char *str)
+void yyerror(struct filter_parser_ctx *parser_ctx, yyscan_t scanner, const char *str)
{
fprintf(stderr, "error %s\n", str);
}
#define parse_error(parser_ctx, str) \
do { \
- yyerror(parser_ctx, YY_("parse error: " str "\n")); \
+ yyerror(parser_ctx, parser_ctx->scanner, YY_("parse error: " str "\n")); \
YYERROR; \
} while (0)
LTTNG_HIDDEN
int filter_parser_ctx_append_ast(struct filter_parser_ctx *parser_ctx)
{
- return yyparse(parser_ctx);
+ return yyparse(parser_ctx, parser_ctx->scanner);
}
LTTNG_HIDDEN
%define api.pure
/* %locations */
%parse-param {struct filter_parser_ctx *parser_ctx}
-%lex-param {struct filter_parser_ctx *parser_ctx}
+%parse-param {yyscan_t scanner}
+%lex-param {yyscan_t scanner}
%start translation_unit
%token CHARACTER_CONSTANT_START SQUOTE STRING_LITERAL_START DQUOTE
%token ESCSEQ CHAR_STRING_TOKEN