Related articles |
---|
Flex/Bison: Unable to parse multiple SQL commands from a file. sumeet.sl@gmail.com (Sumeet) (2008-01-12) |
From: | Sumeet <sumeet.sl@gmail.com> |
Newsgroups: | comp.compilers |
Date: | Sat, 12 Jan 2008 14:00:31 -0800 (PST) |
Organization: | Compilers Central |
Keywords: | parse, question, comment |
Posted-Date: | 13 Jan 2008 00:55:20 EST |
Hi,
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!
Thanks,
Sumeet
[Does your parser handle one SQL statement or a series of them? -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.