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