fork download
  1.  
  2. %{
  3. #include <stdio.h>
  4. %}
  5.  
  6. %%
  7. [0-9]+ { printf("the number is a constant\n"); }
  8. [0-9]*\.[0-9]+ { printf("the number is a constant\n"); }
  9. . { printf("thee number is not a constant\n"); }
  10. %%
  11.  
  12. int yywrap() {
  13. return 1;
  14. }
  15. int main() {
  16. printf("Enter a string: ");
  17. yylex();
  18. return 0;
  19. }
  20.  
Success #stdin #stdout #stderr 0.02s 6864KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/0tkuSF/prog:3:1: Syntax error: Operator expected
ERROR: /home/0tkuSF/prog:19:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit