]> git.draconx.ca Git - cdecl99.git/blobdiff - src/parse.y
Use the reentrant scanner API.
[cdecl99.git] / src / parse.y
index 63d5fa927dc4ec48e1289321798bcb68183a3acf..2b02a5e7d6eb7ad4d6226d09e265bb4f5252219a 100644 (file)
@@ -18,7 +18,9 @@
  */
 }
 
+%parse-param {yyscan_t scanner}
 %parse-param {struct cdecl **out}
+%lex-param {yyscan_t scanner}
 %define api.pure
 %error-verbose
 %locations
@@ -31,7 +33,7 @@
 #include "cdecl.h"
 
 #define FAIL(msg) do { \
-       yyerror(&yylloc, NULL, msg); \
+       yyerror(&yylloc, NULL, NULL, msg); \
        YYERROR; \
 } while (0)
 
@@ -52,8 +54,8 @@
 }
 
 %code provides {
-void yyerror(YYLTYPE *, struct cdecl **, const char *);
-int yyparse(struct cdecl **out);
+void yyerror(YYLTYPE *, struct cdecl **, void *, const char *);
+int yyparse(void *scanner, struct cdecl **out);
 }
 
 %union {
@@ -381,7 +383,8 @@ direct_declarator: {
 }
 
 %%
-void yyerror(YYLTYPE *loc, struct cdecl **out, const char *err)
+void
+yyerror(YYLTYPE *loc, struct cdecl **out, yyscan_t scanner, const char *err)
 {
        if (strstr(err, "T_LEX_ERROR"))
                return;