]> git.ozlabs.org Git - petitboot/blobdiff - discover/grub2/lexer.l
automake: silence make output
[petitboot] / discover / grub2 / lexer.l
index 0558ed9d791c38c12b852e1eba95389aa65b0915..e557146c24c51fa50892de9dca7c3d89cdd30068 100644 (file)
@@ -3,6 +3,8 @@
 #include "grub2.h"
 #include "parser.h"
 #include <talloc/talloc.h>
+
+void yyerror(struct grub2_parser *parser, const char *fmt, ...);
 %}
 
 %option nounput noinput
@@ -15,8 +17,6 @@
 %option yylineno
 %option noyyalloc noyyfree noyyrealloc
 %option extra-type="struct grub2_parser *"
-%option header-file="lexer.h"
-%option outfile="lexer.c"
 
 %x sqstring
 %x dqstring
@@ -118,7 +118,10 @@ VARNAME ([[:alpha:]][_[:alnum:]]*|[0-9]|[\?@\*#])
  /* strip comments */
 #.*    ;
 
-.      printf("unknown token '%s'\n", yytext); exit(1);
+.      {
+               yyerror(yyget_extra(yyscanner), "unknown token '%s'\n", yytext);
+               yyterminate();
+       }
 
 %%