fork download
  1. %{
  2. #include<stdio.h>
  3. int key_word=0;
  4. %}
  5. %%
  6. "include"|"for"|"define" {key_word++;}
  7. %%
  8. int main()
  9. {
  10. printf("enter the sentence");
  11. yylex();
  12. printf("keyword are: %d\n ",key_word);
  13. }
  14. int yywrap() { return 1; }
Success #stdin #stdout #stderr 0.02s 6964KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/x63Mvw/prog:14:25: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit