fork download
  1. %{
  2. #include <stdio.h>
  3. int flag = 0;
  4.  
  5. // Required to avoid linker error on macOS
  6. int yywrap() {
  7. return 1;
  8. }
  9. %}
  10.  
  11. %%
  12.  
  13. [a-z0-9_]+@[a-z]+\.com { flag = 1; }
  14.  
  15. %%
  16.  
  17. int main() {
  18. yylex();
  19. if (flag == 1)
  20. printf("This email is accepted\n");
  21. else
  22. printf("This email is not accepted\n");
  23. return 0;
  24. }
  25.  
Success #stdin #stdout #stderr 0.03s 6916KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/ozy81k/prog:24:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit