fork download
  1. /*Definition Section*/
  2.  
  3. %{
  4. #include<stdio.h>
  5. %}
  6.  
  7.  
  8. /*Rule Section*/
  9.  
  10. %%
  11.  
  12. /*Check the token, if token is match with
  13. pattern then it will print Decimal Number.*/
  14. [0-9]+"."[0-9]+ {ECHO; printf("\nDecimal Number\n");}
  15. /*Check the token, if token is match with
  16. pattern then it will print Integer Number.*/
  17. [0-9]+ {ECHO; printf("\nInteger Number\n");}
  18.  
  19. %%
  20. /*call the yywrap function*/
  21. int yywrap()
  22. {return 1;}
  23.  
  24.  
  25. /*Auxiliary function*/
  26. /*Driver function*/
  27.  
  28. int main(void)
  29. {
  30. /*call the yylex function.*/
  31. yylex();
  32. return 0;
  33. }
  34.  
Success #stdin #stdout #stderr 0.03s 6924KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/mrOxEd/prog:33:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit