聘我网

新概念招聘3.0

lex从char *输入的套路是什么?

vote up0vote downstar

默认的lex需要输入是FILE *

如何该让它从char *读取输入?

 

1 个答复

vote up0vote downcheck
YY_BUFFER_STATE tLexerBuffer = yy_scan_buffer ( buf, buf_len );
if ( !tLexerBuffer )
{
    ...
}
int iRes = yyparse ( &tParser );
yy_delete_buffer ( tLexerBuffer );
链接

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.