[Flex-help] Multiple file processing
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Gautier DI F. <gau...@gm...> - 2013-04-10 22:29:10
|
Hi all, I want to process many files, so I add this at the end of my xml.l: int ParseXml(char *s) { int err = 0; XMLin = fopen(s, "r"); if (!XMLin) { puts("Error on XML file opening\n"); } else { XML_switch_to_buffer( XML_create_buffer( XMLin, YY_BUF_SIZE ) ); err = XMLparse(); XML_delete_buffer( YY_CURRENT_BUFFER ); fclose(XMLin); } return err; } On the first execution it works (it returns 0), but on the second call it fails (it returns 1). According to http://flex.sourceforge.net/manual/Multiple-Input-Buffers.htmlit should works! What do I do wrong? For your help, Thanks by advance. |