fork download
  1. %option noyywrap
  2. %{
  3. #include<stdio.h>
  4. %}
  5. %%
  6. . ; // This is a dummy rule that matches any single character and does nothing
  7. %%
  8. int main(int argc, char* argv[])
  9. {
  10. if(argc > 1)
  11. {
  12. FILE *fp = fopen(argv[1], "r");
  13. if(fp)
  14. {
  15. yyin = fp;
  16. yylex();
  17. }
  18. }
  19. return 1;
  20. }
  21.  
Success #stdin #stdout #stderr 0.02s 6848KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/KKQlgB/prog:3:1: Syntax error: Operator expected
ERROR: /home/KKQlgB/prog:20:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit