fork download
  1.  
  2. %{
  3. int count=0;
  4. %}
  5. %%
  6. /* match identifier */
  7. [A-Za-z]([A-Za-z]|[0-9])* {count++;}
  8. %%
  9. int yywrap()
  10. {
  11. return 1;
  12. }
  13.  
  14. int main(void) {
  15. yylex();
  16.  
  17. printf("number of identifiers = %d\n", count);
  18. return 0;
  19. }
Success #stdin #stdout #stderr 0.02s 6988KB
stdin
abc
stdout
Standard output is empty
stderr
ERROR: /home/PJ2WSU/prog:19:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit