fork download
  1.  
  2. %{
  3. #include <stdio.h>
  4.  
  5. extern FILE *yyin;
  6. %}
  7.  
  8. %%
  9.  
  10. "<"[^>]+> { printf("%s\n", yytext); } /* Print any text enclosed in < >
  11. */
  12. . ;
  13.  
  14. %%
  15.  
  16. int yywrap() {
  17. return 1;
  18. }
  19.  
  20. int main(int argc, char *argv[]) { // Open tags.txt in read mode FILE *file = fopen("tags.txt", "r"); if (!file) {
  21. perror("Error opening file");
  22. return 1;
  23. }
  24. yyin = file;
  25.  
  26. yylex();
  27.  
  28. fclose(file);
  29. return 0;
  30. }
  31.  
  32.  
  33.  
  34.  
Success #stdin #stdout #stderr 0.02s 6904KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/eYBF0j/prog:3:1: Syntax error: Operator expected
ERROR: /home/eYBF0j/prog:33:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit