diff options
-rw-r--r-- | discover/grub2/grub2.c | 3 | ||||
-rw-r--r-- | discover/grub2/parser.y | 11 |
2 files changed, 7 insertions, 7 deletions
diff --git a/discover/grub2/grub2.c b/discover/grub2/grub2.c index 7f63c35..5b3009a 100644 --- a/discover/grub2/grub2.c +++ b/discover/grub2/grub2.c @@ -1,5 +1,6 @@ #include <assert.h> +#include <string.h> #include <talloc/talloc.h> #include <url/url.h> @@ -9,8 +10,6 @@ #include <discover/parser-utils.h> #include "grub2.h" -#include "parser.h" -#include "lexer.h" static const char *const grub2_conf_files[] = { "/grub.cfg", diff --git a/discover/grub2/parser.y b/discover/grub2/parser.y index 5a4d4f8..0beddd6 100644 --- a/discover/grub2/parser.y +++ b/discover/grub2/parser.y @@ -2,6 +2,7 @@ %pure-parser %lex-param { yyscan_t scanner } %parse-param { struct grub2_parser *parser } +%parse-param { void *scanner } %error-verbose %{ @@ -9,10 +10,6 @@ #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, ...); %} @@ -63,6 +60,10 @@ void yyerror(struct grub2_parser *parser, const char *fmt, ...); %start script %debug +%{ +#include "lexer.h" +%} + %% script: statements { @@ -314,7 +315,7 @@ void grub2_parser_parse(struct grub2_parser *parser, const char *filename, bufstate = yy_scan_bytes(buf, len - 1, parser->scanner); yyset_lineno(1, parser->scanner); - rc = yyparse(parser); + rc = yyparse(parser, parser->scanner); yy_delete_buffer(bufstate, parser->scanner); |