fork download
  1. %{
  2. #include <stdio.h>
  3. %}
  4.  
  5. %%
  6.  
  7. [0-9]+\.[0-9]+ {
  8. printf("Given input is a float constant\n");
  9. }
  10.  
  11. [0-9]+ {
  12. printf("Given input is an integer constant\n");
  13. }
  14.  
  15. [a-zA-Z]+ {
  16. printf("Given input is not a constant\n");
  17. }
  18.  
  19. .|\n { }
  20.  
  21. %%
  22.  
  23. int main(void) {
  24. yylex();
  25. return 0;
  26. }
  27.  
Success #stdin #stdout #stderr 0.04s 6972KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/8PEqRP/prog:21:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit