Hi I created a parser using Bison v 2.1 calling a scanner written using Flex v 2.5.4a. The problem is that my parser is used for two purposes:
1- Parse to identify file format (only first line). 2- Parse to generate intermediate files from that file. I have no problem with (1). However when the parser is called again (2) to parse the same file, I got a syntax error. I read Bison doc and I deduced that is a known problem ($ 11.2 How Can I Reset the Parser). Below is a part of my parser code: ... %parse-param {int xIdentification} ... %start S %% S : /* empty */ | S Tag ; Tag : { if ( xIdentification == 0 ) { ... } ID_TAG { if ( xIdentification == 1 ) if ( strcmp ( $2, "<ID_TAG>" ) == 0 ) { YYACCEPT; } Id_Tag SLASH_ID_TAG Loop_Die_Id ; ... My question is: how can I reset the scanner input buffer from the parser before calling YYACCEPT. Best regards, AnL. _______________________________________________ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison