fork download
  1. %{
  2. #include <stdio.h>
  3. int flag=0;
  4. %}
  5.  
  6. %%
  7. [^a-zA-Z\n] { flag=1; }
  8. .|\n ;
  9. %%
  10.  
  11. int yywrap(){ return 1; }
  12.  
  13. int main(){
  14. printf("Enter a string: ");
  15. yylex();
  16. if(flag)
  17. printf("String contains non-alphabet characters.\n");
  18. else
  19. printf("String contains only alphabets.\n");
  20. return 0;
  21. }
  22.  
Success #stdin #stdout #stderr 0.04s 6908KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/ufxXuz/prog:21:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit