fork download
  1. %{
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5. char re[100];
  6.  
  7. %}
  8.  
  9. %%
  10. . { ECHO; } // Echo each character (mock DFA behavior)
  11. %%
  12.  
  13. int main() {
  14. printf("Enter a regular expression: ");
  15. scanf("%s", re);
  16.  
  17. printf("Input a string to test against RE \"%s\":\n", re);
  18. yylex();
  19.  
  20. return 0;
  21. }
  22.  
  23.  
Success #stdin #stdout #stderr 0.03s 6912KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/7zI10k/prog:2:1: Syntax error: Operator expected
ERROR: /home/7zI10k/prog:22:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit