Generic parser API [message #597338] |
Sun, 28 February 2010 13:54  |
Eclipse User |
|
|
|
I just figured out that DTP uses two different kinds of SQL parsers: JavaCC and LPG based.
I have the following problem: I only have a database specific extended JavaCC-parser (extension of org.eclipse.datatools.sqltools.sql.parser.SQLParser). And my aim is to analyze a SQL query in order to print out all columns used in this query. I would easily solve this task using SQL query model, but JavaCC-parser doesn't support this...
I found the following statements in a mail thread from the Eclipse project: "a common parser API (for callers to work with any parser) is planned in the next release of DTP (post DTP 0.9)..." and "...The generic sql parser API will help us to achieve this goal. DTP will only interact with the parser using the generic parser API, no matter what the underlying parser it is".
These mails were written on the June 1, 2006. Now DTP 1.7 is there. Is generic parser API already implemented? Or is there any chance to use the existing AST (parsing tree) from JavaCC-based parser for the recognition of QueryStatement?
|
|
|
Re: Generic parser API [message #597400 is a reply to message #597338] |
Wed, 07 April 2010 21:46  |
Eclipse User |
|
|
|
Unfortunately the common parser API was never implemented.
What database type are you using? Are you analyzing SQL Select
statements only? If so, and your SQL dialect is not too non-standard,
you might be able to use the SQL Query parser and model to do the analysis.
Slavik Taubkin wrote:
> I just figured out that DTP uses two different kinds of SQL parsers:
> JavaCC and LPG based.
>
> I have the following problem: I only have a database specific extended
> JavaCC-parser (extension of
> org.eclipse.datatools.sqltools.sql.parser.SQLParser). And my aim is to
> analyze a SQL query in order to print out all columns used in this
> query. I would easily solve this task using SQL query model, but
> JavaCC-parser doesn't support this...
>
> I found the following statements in a mail thread from the Eclipse
> project: "a common parser API (for callers to work with any parser) is
> planned in the next release of DTP (post DTP 0.9)..." and "...The
> generic sql parser API will help us to achieve this goal. DTP will only
> interact with the parser using the generic parser API, no matter what
> the underlying parser it is".
>
> These mails were written on the June 1, 2006. Now DTP 1.7 is there. Is
> generic parser API already implemented? Or is there any chance to use
> the existing AST (parsing tree) from JavaCC-based parser for the
> recognition of QueryStatement?
|
|
|
Powered by
FUDForum. Page generated in 0.04116 seconds