fork download
  1. %option noyywrap
  2. %{
  3. #include<stdio.h>
  4. int i;
  5. %}
  6.  
  7.  
  8. %%
  9. [0-9]+ {i=atoi(yytext);
  10. if(i%2==0)
  11. printf("even no");
  12. else
  13. printf("odd no");
  14. };
  15. %%
  16. int main()
  17. {
  18. yylex();
  19. return 0;
  20. }
  21.  
Success #stdin #stdout #stderr 0.02s 6804KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/N8w8R4/prog:20:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit