YYLEX_PARAM is removed in bison 3.0, so we need to pass the scanner
param directly through yyparse (rather than referencing
parser->scanner). Unfortunately, we don't have the lexer header
available at the time we declare yyparse, so we need to pass a void *
here.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
#include <talloc/talloc.h>
#include <url/url.h>
#include <talloc/talloc.h>
#include <url/url.h>
#include <discover/parser-utils.h>
#include "grub2.h"
#include <discover/parser-utils.h>
#include "grub2.h"
-#include "parser.h"
-#include "lexer.h"
static const char *const grub2_conf_files[] = {
"/grub.cfg",
static const char *const grub2_conf_files[] = {
"/grub.cfg",
%pure-parser
%lex-param { yyscan_t scanner }
%parse-param { struct grub2_parser *parser }
%pure-parser
%lex-param { yyscan_t scanner }
%parse-param { struct grub2_parser *parser }
+%parse-param { void *scanner }
#include <log/log.h>
#include "grub2.h"
#include <log/log.h>
#include "grub2.h"
-#include "parser.h"
-#include "lexer.h"
-
-#define YYLEX_PARAM parser->scanner
void yyerror(struct grub2_parser *parser, const char *fmt, ...);
%}
void yyerror(struct grub2_parser *parser, const char *fmt, ...);
%}
+%{
+#include "lexer.h"
+%}
+
bufstate = yy_scan_bytes(buf, len - 1, parser->scanner);
yyset_lineno(1, parser->scanner);
bufstate = yy_scan_bytes(buf, len - 1, parser->scanner);
yyset_lineno(1, parser->scanner);
+ rc = yyparse(parser, parser->scanner);
yy_delete_buffer(bufstate, parser->scanner);
yy_delete_buffer(bufstate, parser->scanner);