db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-3946) Provide support for using the Derby parser to generate Abstract Syntax Trees
Date Wed, 12 Nov 2008 21:31:44 GMT

     [ https://issues.apache.org/jira/browse/DERBY-3946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Rick Hillegas updated DERBY-3946:
---------------------------------

    Attachment: derby-3946-01-aa-standaloneParser.diff
                ASTParser.java

Attaching derby-3946-01-aa-standaloneParser.diff and ASTParser.java. To test-drive these changes,
you need to do the following:

A) Apply the patch to the Derby trunk and build Derby.

B) Compile ASTParser

C) Run ASTParser. The program takes one argument, which is a query string which you would
like to parse. The program then retrieves the parsed query tree and prints it out. For example:

  java ASTParser "select a from t, s where t.a = s.a"

  
Note that this technique for using the parser standalone involves invoking non-public APIs
which are subject to change from release to release. Note, however, that these APIs have remained
stable since Derby was open-sourced.


The patch touches the following files. I will run tests. I am inclined to check in these changes
if the tests pass.


M      java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
M      java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java

Adds some accessors to the compiler's state variable so that query trees can be stored and
retrieved.


M      java/engine/org/apache/derby/impl/sql/GenericStatement.java

Pokes the query tree into the state variable when the user sets the StopAfterParsing tracepoint.


> Provide support for using the Derby parser to generate Abstract Syntax Trees
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-3946
>                 URL: https://issues.apache.org/jira/browse/DERBY-3946
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>            Reporter: Rick Hillegas
>         Attachments: ASTParser.java, derby-3946-01-aa-standaloneParser.diff
>
>
> Users would like to be able to use the Derby parser to produce query trees without actually
running the queries on Derby.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message