[antlr-interest] Very weird SQL parser failures - look-ahead?
anatoli_krassavine
toly at intellidos.com
Tue Jun 1 08:47:13 PDT 2004
Hello,
I tried to use Oracle 7 SQL grammar in anger. It works great for very
complex SQL statements, but I suddenly stumbled on an unexpected
issues with what I consider to be a very simple SQL. Could someone
please advice.
The following statement fails with
Exception in thread "main" line 10:2: expecting CLOSE_PAREN,
found 'null'
------------
SELECT *
FROM
c.abcd
WHERE
cr.no IN
(
SELECT cr.no FROM c.cr cr
union
SELECT a FROM abc where a=b
)
------------
On the other hand this works fine (note that "where a=b" was removed)
SELECT *
FROM
c.abcd
WHERE
cr.no IN
(
SELECT cr.no FROM c.cr cr
union
SELECT a FROM abc
)
------------
AFAICC, it is not a problem with syntax, but a problem with a look-
ahead, but I do not understand how to fix this.
Any help or pointing in the right direction will be greatly
appreciated.
Details:
Oracle 7 SQL grammar from /grammar/ORACLE-7-SQL
No changes, conventional lexer/parser generated
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list