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