From e49ddbd13b8b5ff012fcb7b1510d206ec45f07b8 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 18 Nov 2013 20:47:20 +0900 Subject: [PATCH] [bugfix] makeing a shared library failure under the version 3 of bison --- include/picrin/parse.h | 14 ++++++++++++++ src/parse.y | 11 +---------- src/scan.l | 5 +---- 3 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 include/picrin/parse.h 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)