ANTLR parser for PL / SQL with target language like Java

Do we have another PL / SQL grammar for Java target? I got one for C #, but you need a Java target.

I would like to use this with ANTLR to generate Java using StringTemplates. I looked through the documentation and have a decent idea of ​​how to achieve this, I just wanted to check whether someone had already done this.

+4
source share
1 answer

Well, the ANTLR website has a grammar: http://antlr.org/grammar/1279318813752/PLSQL.g

The author says that he does not parse the SQL part.

I do not know what you expect to generate reading only syntax. You usually need a lot more. See my answer here why not: antlr generates ast for c and parses ast

EDIT: OP says he wants to translate PL / SQL code into Java. See My answer to the question of what it takes to create a translator in a language: What patterns can I use for code to simplify translation into another programming language?

+3
source

Source: https://habr.com/ru/post/1380691/


All Articles