1

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.

1
  • You need more than a parser to compute "dependencies". See my essay on Life After Parsing (www.semanticdesigns.com/Products/DMS/LifeAfterParsing.html). Commented Aug 23, 2012 at 21:36

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

"Surely"? PL/SQL is a huge language. Don't expect this grammar to be complete. Do expect real code to contain every bit of the language.
2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.