%{
#include <stdio.h>
%}

%%

<[^>]+> { printf("%s\n", yytext); }

.|
\n { /* Ignore other characters */ }

%%

int main(int argc, char **argv) {
    if (argc > 1) {
        FILE *file = fopen(argv[1], "r");
        if (!file) {
            perror("Error opening file");
            return 1;
        }
        yyin = file;
    }
    yylex();
    return 0;
}

int yywrap() {
    return 1;
}
