小编use*_*785的帖子

flex中的早期EOF错误

当我在flex中运行以下代码时,我在最后一行得到过早的EOF作为错误.如果删除了定义部分,则不会产生错误.为什么会这样?

%{
     #include <stdio.h>
       int x = 0;
}%

%%
"a"  {x=x+1; printf("id %d",x); }
%%

int yywrap(void)
{
    return 0;
}

int main(void)
{
int x = 0;
    yylex();
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

apache-flex eof

2
推荐指数
1
解决办法
7607
查看次数

标签 统计

apache-flex ×1

eof ×1