Make the generated *.tab.hh include all the headers needed to define the union.
authorHenner Zeller <h.zeller@acm.org>
Wed, 15 May 2019 04:07:26 +0000 (21:07 -0700)
committerHenner Zeller <h.zeller@acm.org>
Wed, 15 May 2019 04:07:26 +0000 (21:07 -0700)
frontends/ilang/ilang_parser.y
frontends/verilog/verilog_parser.y

index 0df7929975b10f11733157f80d051b61e6b0ac90..44c99906a0a5188fbfca2f069f42879bdc301f7b 100644 (file)
@@ -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;
        };
-
index d23009e60f41dd32fd5a28b39b5175a7be22d8e7..e82c2781cca42bd928ea658d6adc9a5a6c21e8ab 100644 (file)
@@ -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);
        };
-