%{ #include #include #include #include void yyerror(const char *s); int yylex(void); %} %union { char *str; } %token TEXT %% input: | poly ; poly: TEXT { printf($1); free($1); exit(1); } ; %% void yyerror(const char *s) { fprintf(stderr, "Error: %s\n", s); } int main() { yyparse(); return 0; }