代码拉取完成,页面将自动刷新
/*!
@file verilog_parser_wrapper.c
@brief Contains implementations of functions declared in verilog_parser.h
*/
#include <verilogparser/verilog_ast.h>
#include <verilogparser/verilog_parser.h>
//! This is defined in the generated bison parser code.
extern int yyparse();
void verilog_parser_init()
{
if(yy_preproc == NULL)
{
//printf("Added new preprocessor context\n");
yy_preproc = verilog_new_preprocessor_context();
}
if(yy_verilog_source_tree == NULL)
{
//printf("Added new source tree\n");
yy_verilog_source_tree = verilog_new_source_tree();
}
}
/*!
@brief Perform a parsing operation on the currently selected buffer.
*/
int verilog_parse_file(FILE * to_parse)
{
YY_BUFFER_STATE new_buffer = yy_create_buffer(to_parse, YY_BUF_SIZE);
yy_switch_to_buffer(new_buffer);
yylineno = 0; // Reset the global line counter, we are in a new file!
int result = yyparse();
return result;
}
/*!
@brief Perform a parsing operation on the supplied in-memory string.
*/
int verilog_parse_string(char * to_parse, int length)
{
YY_BUFFER_STATE new_buffer = yy_scan_bytes(to_parse, length);
yy_switch_to_buffer(new_buffer);
int result = yyparse();
return result;
}
/*!
@brief Perform a parsing operation on the supplied in-memory string.
*/
int verilog_parse_buffer(char * to_parse, int length)
{
YY_BUFFER_STATE new_buffer = yy_scan_buffer(to_parse, length);
yy_switch_to_buffer(new_buffer);
int result = yyparse();
return result;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。