fork download
  1. // Online C compiler to run C program online
  2. /*Definition Section*/
  3. %{
  4. #include<stdio.h>
  5. %}
  6.  
  7.  
  8.  
  9.  
  10.  
  11. ([a-zA-Z][0-9])+|[a-zA-Z]* {printf("Identifier\n");}
  12.  
  13. ^[0-9]+ {printf("Not a Identifier\n");}
  14.  
  15. .|\n;
  16. %%
  17.  
  18. /*call the yywrap function*/
  19. int yywrap()
  20. {
  21. return 1;
  22. }
  23.  
  24. /*Auxiliary function*/
  25. /*Driver function*/
  26. int main(void)
  27. {
  28. /*call the yylex function.*/
  29. yylex();
  30. return 0;
  31. }
Success #stdin #stdout #stderr 0.03s 6852KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/PsSe7H/prog:31:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit