fork download
  1. %{
  2. #include<stdio.h>
  3. %}
  4.  
  5. %%
  6. [\n] {printf("\n\nPls give the input: ");}
  7.  
  8. auto|double|int|struct|break|else|long|switch|case|enum|register|typedef|char|extern|return|union|continue|for|signed|void|do|if|static|while|default|goto|sizeof|volatile|const|float|short {printf("This is Keywords");}
  9.  
  10. [a-z A-Z _][a-z A_Z 0-9 _]* {printf("This is Identifier");}
  11.  
  12. [0-9]* {printf("This is Number");}
  13.  
  14. [+-/*%=] {printf("This is Operator");}
  15.  
  16. .* {printf("Invalid");}
  17.  
  18. %%
  19.  
  20. main()
  21. {
  22.  printf("\nPls give the input: ");
  23.  yylex();
  24.  return 0;
  25. }
Success #stdin #stdout #stderr 0.02s 6900KB
stdin
double
stdout
Standard output is empty
stderr
ERROR: /home/7U7ApA/prog:25:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit