diff --git a/include/picrin/parse.h b/include/picrin/parse.h new file mode 100644 index 00000000..6eff8d62 --- /dev/null +++ b/include/picrin/parse.h @@ -0,0 +1,14 @@ +#ifndef PARSE_H__ +#define PARSE_H__ + +struct parser_control { + pic_state *pic; + void *yyscanner; + pic_value value; + bool incomp; + int yynerrs; + struct pic_vector *yy_arena; + int yy_arena_idx; +}; + +#endif diff --git a/src/parse.y b/src/parse.y index b14f5626..00bf58a2 100644 --- a/src/parse.y +++ b/src/parse.y @@ -6,6 +6,7 @@ #include "picrin.h" #include "picrin/pair.h" #include "picrin/blob.h" +#include "picrin/parse.h" #define YYERROR_VERBOSE 1 @@ -17,16 +18,6 @@ void yyset_in(); void yy_scan_string(); void yylex_destroy(); -struct parser_control { - pic_state *pic; - void *yyscanner; - pic_value value; - bool incomp; - int yynerrs; - struct pic_vector *yy_arena; - int yy_arena_idx; -}; - #define YY_ARENA_SIZE 50 struct parser_control * diff --git a/src/scan.l b/src/scan.l index 7e7e4700..a24da8ab 100644 --- a/src/scan.l +++ b/src/scan.l @@ -3,10 +3,7 @@ #include #include "picrin.h" - -/* Guts! bison3 seems emit prototype declaration of yyparse in y.tab.h... */ -struct parser_control; - +#include "picrin/parse.h" #include "y.tab.h" #define YY_DECL int yylex_(YYSTYPE *yylvalp, yyscan_t yyscanner)