diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-05-15 13:29:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-15 13:29:55 +0200 |
commit | 64b604207deefb87faa1aaf158012b7063526c6f (patch) | |
tree | 37161d07918b9719af57218d886e63b94c4cd8b1 | |
parent | 36841f39119ed94cbe1157e7e13b6aa07e693caf (diff) | |
parent | 8eb2798776ef83afd187d65b8eb471a4b2f3c219 (diff) | |
download | yosys-64b604207deefb87faa1aaf158012b7063526c6f.tar.gz yosys-64b604207deefb87faa1aaf158012b7063526c6f.tar.bz2 yosys-64b604207deefb87faa1aaf158012b7063526c6f.zip |
Merge pull request #1010 from hzeller/yacc-self-contained
Make the generated *.tab.hh include all the headers needed
-rw-r--r-- | frontends/ilang/ilang_parser.y | 10 | ||||
-rw-r--r-- | frontends/verilog/verilog_parser.y | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/frontends/ilang/ilang_parser.y b/frontends/ilang/ilang_parser.y index 0df792997..44c99906a 100644 --- a/frontends/ilang/ilang_parser.y +++ b/frontends/ilang/ilang_parser.y @@ -47,6 +47,15 @@ USING_YOSYS_NAMESPACE %define api.prefix {rtlil_frontend_ilang_yy} +/* The union is defined in the header, so we need to provide all the + * includes it requires + */ +%code requires { +#include <string> +#include <vector> +#include "frontends/ilang/ilang_frontend.h" +} + %union { char *string; int integer; @@ -451,4 +460,3 @@ conn_stmt: delete $2; delete $3; }; - diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y index d23009e60..e82c2781c 100644 --- a/frontends/verilog/verilog_parser.y +++ b/frontends/verilog/verilog_parser.y @@ -112,6 +112,15 @@ struct specify_rise_fall { %define api.prefix {frontend_verilog_yy} +/* The union is defined in the header, so we need to provide all the + * includes it requires + */ +%code requires { +#include <map> +#include <string> +#include "frontends/verilog/verilog_frontend.h" +} + %union { std::string *string; struct YOSYS_NAMESPACE_PREFIX AST::AstNode *ast; @@ -2418,4 +2427,3 @@ concat_list: $$ = $3; $$->children.push_back($1); }; - |