fork download
  1. %{
  2. #include<math.h>
  3. %}
  4. digit[0-9]
  5. id[A-Za-Z][A-Za-Z0-9]*
  6. %%
  7. void|main|int|printf{printf("\nA Keyword:%s\n",yytext);}
  8. {id}{printf("\n An identifier : %s\n",yytext);}%%
  9. int main(argc,argv)
  10. {
  11. int arg c;
  12. char** argv;
  13. yyin=fopen("sha.c","r");
  14. yylex();
  15. }
Success #stdin #stdout #stderr 0.02s 6768KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/Zb3LUF/prog:15:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit