I'm looking for general purpose source parser in Java. Library which can help me to parser PL/SQL code. Extract functions, procedures, packages and show dependencies between them.
2 Answers
Consider looking at ANTLR tool. There exist already PL/SQL grammar. Please spend some time for reading about this tool. It should surely solve your problem.
1 Comment
There is a plsql-parser on GitHub, quote:
This is a [almost] full parser for PL/SQL language that includes a Lexer, Parser (that optionally generates an Abstract Syntax Tree) and a TreeWalker. Current version is target for Java language, but may be easy to port it to any other target.
I am interested in porting PL/SQL data structures to Java and will try it the next weeks.
Another option could be https://stackoverflow.com/a/6631453/734687, but note that you have to port the target language from C to Java.