%{ #include "y.tab.h" char texto[1000]: int itxt; %} ID [a-zA-Z][a-zA-Z0-9_]* VAL \"[^"]*\" %x sta %% \> {BEGIN sta; itxt=0; return('>'); } [\< {yylval.string = strdup(texto); unput(yytext[0]); BEGIN INITIAL; return(pcdata); } .|\n {texto[itxt++] = yytext[0]; } %%