db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: SQL Parser Code in Apache Derby Source Code
Date Wed, 17 Feb 2010 13:58:50 GMT
AKA_DERBY wrote:
> Hello,
>
> We are currently working on extracting the SQL Parser code from Apache Derby
> Source Code. Can you please tell us in what form the parse tree is stored?
> Where are the entry and exit points (file names) to the parser logic with
> respect to the rest of the database.
>
> Thanks in advance,
> AKA
>
>   
Hi AKA,

The Derby parser, sqlgrammar.jj, is written in javacc, which is then 
generated into Java classes. For an example of how to run the Derby 
parser standalone to just turn out an Abstract Syntax Tree, see 
https://issues.apache.org/jira/browse/DERBY-3946 . Derby's parser 
creates an AST composed of nodes from the 
org.apache.derby.impl.sql.compile package. The best documentation on the 
AST is the javadoc for that package. If you need to look deeper under 
the hood, I recommend moving this discussion to the derby developer list.

Hope this helps,
-Rick

Mime
View raw message