Merge pull request #1010 from hzeller/yacc-self-contained

Make the generated *.tab.hh include all the headers needed
This commit is contained in:
Clifford Wolf 2019-05-15 13:29:55 +02:00 committed by GitHub
commit 64b604207d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -47,6 +47,15 @@ USING_YOSYS_NAMESPACE
%define api.prefix {rtlil_frontend_ilang_yy} %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 { %union {
char *string; char *string;
int integer; int integer;
@ -451,4 +460,3 @@ conn_stmt:
delete $2; delete $2;
delete $3; delete $3;
}; };

View File

@ -112,6 +112,15 @@ struct specify_rise_fall {
%define api.prefix {frontend_verilog_yy} %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 { %union {
std::string *string; std::string *string;
struct YOSYS_NAMESPACE_PREFIX AST::AstNode *ast; struct YOSYS_NAMESPACE_PREFIX AST::AstNode *ast;
@ -2418,4 +2427,3 @@ concat_list:
$$ = $3; $$ = $3;
$$->children.push_back($1); $$->children.push_back($1);
}; };