1 Star 0 Fork 0

hongcez/verilog-parser

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.c 1.47 KB
一键复制 编辑 原始数据 按行查看 历史
/*!
@file main.c
@brief A simple test program for the C library code.
*/
#include "stdio.h"
#include <verilogparser/verilog_parser.h>
#include <verilogparser/verilog_ast_common.h>
#include <verilogparser/verilog_preprocessor.h>
#include <verilogparser/verilog_ast_util.h>
int main(int argc, char ** argv)
{
if(argc < 2)
{
printf("ERROR. Please supply at least one file path argument.\n");
return 1;
}
else
{
int F = 0;
// Initialise the parser.
verilog_parser_init();
// Setup the preprocessor to look in ./tests/ for include files.
ast_list_append(yy_preproc -> search_dirs, "./tests/");
ast_list_append(yy_preproc -> search_dirs, "./");
for(F = 1; F < argc; F++)
{
printf("%s ", argv[F]);fflush(stdout);
// Load the file.
FILE * fh = fopen(argv[F], "r");
verilog_preprocessor_set_file(yy_preproc, argv[F]);
// Parse the file and store the result.
int result = verilog_parse_file(fh);
// Close the file handle
fclose(fh);
if(result == 0)
{
printf(" - Parse successful\n");
}
else
{
printf(" - Parse failed\n");
if(argc<=2) return 1;
}
}
}
verilog_resolve_modules(yy_verilog_source_tree);
ast_free_all();
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hongcez/verilog-parser.git
git@gitee.com:hongcez/verilog-parser.git
hongcez
verilog-parser
verilog-parser
master

搜索帮助