fork download
  1. %{
  2. #include<stdio.h>
  3. int length;
  4. %}
  5. %%
  6. total fruits=5 apples+3 peaches-2 cherries;
  7. [a-z A-Z 0-9]+ {length=yyleng; }
  8. %%
  9. int main()
  10. {
  11. yylex();
  12. printf("length of given string is : %d", length);
  13. return 0;
  14. }
Success #stdin #stdout #stderr 0.03s 6896KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/g8H94J/prog:14:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit