fork download
  1. %{
  2. #include<stdio.h>
  3. %}
  4.  
  5. sign[+-]?
  6. digit[0-9]+
  7. exp([eE]{sign}{digit})
  8.  
  9. %%
  10. @ printf("\n Enter the number: ");
  11. \+?{digit} printf("\n Number is positive\n");
  12. \-{digit} printf("\n Number is megative\n");
  13. {sign}{digit}?\.{digit}? printf("\n Number is real\n");
  14. {sign}{digit}(?\.{digit}?){exp} printf("\n Number is exponential\n");
  15. %%
  16.  
  17. int yywrap()
  18. {
  19. return 1;
  20. }
  21.  
  22. int main()
  23. {
  24. yylex();
  25. }
Success #stdin #stdout #stderr 0.02s 7008KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/Tj6RP0/prog:25:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit