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