fork download
  1. %{
  2. #include <stdio.h>
  3. %}
  4.  
  5. %%
  6. "=="|"<="|">="|"!=" { printf("%s : Relational Operator\n", yytext); }
  7. "<"|">" { printf("%s : Relational Operator\n", yytext); }
  8.  
  9. "&&"|"||"|"!" { printf("%s : Logical Operator\n", yytext); }
  10.  
  11. "+"|"-"|"*"|"/"|"%" { printf("%s : Arithmetic Operator\n", yytext); }
  12.  
  13. [ \t\n]+ ; /* ignore whitespace */
  14. . ; /* ignore other characters */
  15. %%
  16.  
  17. int yywrap()
  18. {
  19. return 1;
  20. }
  21.  
  22. int main()
  23. {
  24. yylex();
  25. return 0;
  26. }
Success #stdin #stdout #stderr 0.02s 6824KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/LkjIRX/prog:2:1: Syntax error: Operator expected
ERROR: /home/LkjIRX/prog:26:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit