Dear Hackers

I am interested in implementing my own Domain Specific Language (DSL) using 
PostgreSQL internals. Originally, the plan was not to use PostgreSQL and I had 
developed a grammar and used ANTLRv4 for parser work and general early 
development.

Initially, I was hoping for a scenario where I could have PostgreSQL's parser 
to change grammar (e.g. SET parser_language=SQL vs. SET parser_language=myDSL) 
in which case my ANTLRv4 project would override the PostgreSQL parser module. I 
guess another direction that my project could take is to extend PostgreSQL's 
SQL parser to factor in my DSL keywords and requirements.

To make matters more complicated, this version of ANTLR does not support code 
generation to C, but it does support generation to C++. Integrating the 
generated C++ code requires making it friendly to PostgreSQL e.g. using Plain 
Old Data Structures as described here 
https://www.postgresql.org/docs/9.0/extend-cpp.html, which seems to be 
suggesting to me that I may be using the wrong approach towards my goal.

I would be grateful if anyone could provide any general advice or pointers 
regarding my approach, for example regarding development effort, so that the 
development with PostgreSQL internals can be smooth and of a high quality. 
Maybe somebody has come across another DSL attempt which used PostgreSQL and 
that I could follow as a reference?

Thanks in advance.

Best,
Tom


[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png]<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-4885-a>
  Virus-free. 
www.avg.com<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-4885-a>

Reply via email to