suppress warnings around parser/scanner

This commit is contained in:
Yuichi Nishiwaki 2013-10-20 03:11:08 +09:00
parent daac4dd7f3
commit 9bb3c4f4db
2 changed files with 19 additions and 2 deletions

View File

@ -12,6 +12,11 @@ struct parser_control {
bool incomp; bool incomp;
}; };
void init_scanner(const char *);
void final_scanner(void);
void yyerror(struct parser_control *, const char *);
int yylex(struct parser_control *);
%} %}
%parse-param {struct parser_control *p} %parse-param {struct parser_control *p}
@ -125,9 +130,9 @@ pic_parse(pic_state *pic, const char *str, pic_value *v)
p.pic = pic; p.pic = pic;
p.incomp = false; p.incomp = false;
yy_scan_string(str); init_scanner(str);
yyparse(&p); yyparse(&p);
yylex_destroy(); final_scanner();
if (yynerrs > 0) { if (yynerrs > 0) {
p.value = pic_undef_value(); p.value = pic_undef_value();

View File

@ -46,3 +46,15 @@ yywrap()
{ {
return 1; return 1;
} }
void
init_scanner(const char *str)
{
yy_scan_string(str);
}
void
final_scanner()
{
yylex_destroy();
}