[stringtemplate-interest] SQL generation based on SQL grammer.

Jose San Leandro jose.sanleandro at ventura24.es
Wed Feb 14 04:33:25 PST 2007


I guess you'd have to customize ANTLR grammar itself to generate stuff based 
on the SQL grammar instead of the custom lexer/parser code ANTLR grammar 
generates.

And in such case, the task is far from easy, in my opinion....

The standard ANTLR flow would be: 
sql.g + antlr.Tool => SQL parser/lexer. SQL parser/lexer + sql input => output

And what you are interested in is, however:
sql.g + customAntlrBasedTool => valid sql input.

To get the "customAntlrBasedTool" I would take ANTLR grammar, removing all 
logic but leaving the rules unchanged. And then, maybe I would try to 
generate just an AST associated to the sql.g itself, and write a tool that 
based on that tree is able to generate valid inputs.

This is not StringTemplate-related, or I did misunderstood the whole question?
You should ask it to antlr-interest instead.

On Wednesday 14 February 2007 12:36, Ashish Malik wrote:
> Hi,
>
>
>
> Is it possible to generate a list of SQL statements using the SQL grammar?
> Say I wanted to generate random SQL queries to test a database server.
>
>
>
> Thanks,
>
> Ashish
>
>
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is
> the property of Persistent Systems Pvt. Ltd. It is intended only for the
> use of the individual or entity to which it is addressed. If you are not
> the intended recipient, you are not authorized to read, retain, copy,
> print, distribute or use this message. If you have received this
> communication in error, please notify the sender and delete all copies of
> this message. Persistent Systems Pvt. Ltd. does not accept any liability
> for virus infected mails.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20070214/56deace9/attachment.bin 


More information about the stringtemplate-interest mailing list