fork download
  1.  
  2. %%
  3.  
  4. #.* {printf("\n %s is a Preprocessor", yytext);}
  5.  
  6. int |
  7.  
  8. char |
  9.  
  10. void |
  11.  
  12. main {printf("\n %s is a key word",yytext);}
  13.  
  14. {identifier} {printf("\n %s is identifier",yytext);}
  15.  
  16. [0-9]+ {printf("\n %s is a NNUMBER",yytext);}
  17.  
  18. = {printf("\n%s is a Assignment operator",yytext);}
  19.  
  20. \+ {printf("\n%s is a arthematic operator",yytext);}
  21.  
  22. %%
  23.  
  24. int main(int argc, char **argv){
  25.  
  26. if(argc>1){
  27.  
  28. FILE *f1;
  29.  
  30. f1 = fopen(argv[1],"r");
  31.  
  32. if(f1){
  33.  
  34. yyin=f1;
  35.  
  36. }
  37.  
  38. }
  39.  
  40. yylex();
  41.  
  42. return 0;
  43.  
  44. }
  45.  
  46. int yywrap(){
  47.  
  48. return 0;
  49.  
  50. }
  51.  
  52.  
Success #stdin #stdout #stderr 0.02s 6892KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/0Pzh1i/prog:51:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit