fork download
  1. %{
  2. #include<stdio.h>
  3. #include<stdlib.h>
  4. int i;
  5. %}
  6. %%
  7. [0-9]+ {i=atoi(yytext); if(i%2==0) printf("Even !"); else printf("Odd !");};
  8. %%
  9. int main()
  10. {
  11. yylex();
  12. }
Success #stdin #stdout #stderr 0.02s 6888KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/7RlNUs/prog:12:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit