How to run lex file?

拟墨画扇 提交于 2019-12-11 13:26:57

问题


Here is my lex file

 %%
 .|\n    ECHO;
 %%

How to run this program in windows? How to compile this?

Please help me


回答1:


Use this procedure to compile:

How to compile LEX/YACC files on Windows?

Basically:

flex olex.l
gcc lex.yy.c -o olex.exe

And this modified file:

%%

.|"\n"  { ECHO; }

%%

int yywrap(void)
{
    return 0;
}

int main(void)
{
    yylex();
    return 0;
}

I hope this works for you.



来源:https://stackoverflow.com/questions/8373821/how-to-run-lex-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!