Related articles |
---|
Weird mood Bison+Flex davide.rizzo78@tin.it (Davide Rizzo) (2003-03-17) |
From: | "Davide Rizzo" <davide.rizzo78@tin.it> |
Newsgroups: | comp.compilers |
Date: | 17 Mar 2003 00:09:53 -0500 |
Organization: | TIN |
Keywords: | yacc, lex, Windows, question |
Posted-Date: | 17 Mar 2003 00:09:53 EST |
I finally integrated my language in a Visual C++ project. My last problem is
that, while everything went right while working on a single dos executable
(representing the language), I got weird mood while using it under my app.
After parsing something, sometimes happen that new inputs are not
recognized, while if I close the app and start it again, the parsing finish
well. I think I forgot something, but I don't know what!
Before calling yyparse() i do the following:
yy_delete_buffer(YY_CURRENT_BUFFER); // delete previous buffer
myInfo.resetAll();
// reset all data structures used in rule actions
my_buffer_state=yy_scan_string(input.c_str()); // load the input to
parse
yyparse();
in Flex, I use the following to reset to initial start condition
#define YY_USER_INIT BEGIN(INITIAL)
What else should I do to be sure everything could work well?
Return to the
comp.compilers page.
Search the
comp.compilers archives again.