|Flex/Bison: Unable to parse multiple SQL commands from a file. email@example.com (Sumeet) (2008-01-12)|
|Date:||Sat, 12 Jan 2008 14:00:31 -0800 (PST)|
|Keywords:||parse, question, comment|
|Posted-Date:||13 Jan 2008 00:55:20 EST|
I have created an SQL parser, which works fine when I enter commands
from the terminal. When I enter multiple commands, it parses and
executes each one of them. No problems with grammar, etc. But when I
try to read them from a file, it just parses the first command and
ignores the rest of them, an ftell on yyin after the yyparse()
indicates that it has read the entire file.
In the flex file, I'm switching to another state when I encounter a
';' In that state, if I get a '\n', I switch to the default state and
return 0. In the default state, all \n's are ignored.
I have tried a lot of things, but I'm unable to parse all the commands
from the file. Any suggestions to solve this problem?? Please help!
[Does your parser handle one SQL statement or a series of them? -John]
Return to the
Search the comp.compilers archives again.