I am looking at converting plsql procedures / packages to java classes. I just came across the “ANTLR PL/SQL 11g parser” (link). Still trying to understand what it does and how to use it. Assuming that I have mapping between plsql constructs and java constructs,is it possible to use this plsql parser to generate java code ?
Share
Another poster says “a parser isn’t enough”.
I agree, but want to make the case that a parser is a long way from making this practical (even assuming it builds a complete AST).
You also need name and type resolution as a minimum so you know which types and operators in Java to use when you encounter a PLSQL operator. To do a good job, you might need various kinds of flow analysis (control and data flow).
See What kinds of patterns could I enforce on the code to make it easier to translate to another programming language? for some discussion about the difficulties.