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

Reply via email to