I do as you said，but program is gridlocked, no continue to run
–
sinoryJun 4 '13 at 9:38

exactly this can't be an absolute result to recover the syntactic tree it may be not recoverable, but am not sure that your manner to call yyparse is good, make all your input in test.txt than in your main do yyin = fopen(test.txt); then call yyparse only one time
–
AymanadouJun 4 '13 at 9:53

I have found the problem,there are tow public variables in lex file: int bracket_flag = 0;int blank_close_flag = 0; When encounters an error need to he is set to 0,otherwise the parse a second time would not be expected,thank you very much.
–
sinoryJun 4 '13 at 12:31