fork download
  1. %{
  2. #include <stdio.h>
  3. %}
  4.  
  5. /* Flex options: read line by line interactively */
  6. %option noyywrap
  7.  
  8. %%
  9. ^[ \t]*$ { /* ignore blank lines */ }
  10. ^a+b+$ { printf("ACCEPTED\n"); }
  11. ^[ab]+$ { printf("REJECTED\n"); }
  12. .*/? { printf("REJECTED\n"); }
  13. %%
  14.  
  15. int main(void) {
  16. yylex(); /* Type strings; press Ctrl+D (Linux/macOS) or Ctrl+Z+Enter (Windows) to end */
  17. return 0;
  18. }
Success #stdin #stdout #stderr 0.02s 6928KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/VCH1zH/prog:18:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit