Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

It seems to me that it should be possible to parse existing PL/SQL with the packages sys.diana and sys.pidl, but I have found nothing on the internet with the exception of a few scripts that seem to unwrap a wrapped package (and that is useless for my purposes).

Like you, I've only heard of the concept in regards to reverse-engineering a wrapped package. In that line, maybe a post to Pete Finnigan's security forum might find someone who has done some work in that area.
–
GaryJan 28 '11 at 20:40

What is your goal in parsing the PL/SQL?
–
Leigh RiffelFeb 1 '11 at 5:20

I have no specific goal in mind, I just thought it'd be nice to be able to read an already parsed syntax tree. It might be handy at some time in the future for something I don't no yet.
–
René NyffeneggerFeb 1 '11 at 21:14

1 Answer
1

The official documentation covering unusual errors describes DIANA:
PL/SQL is based on the programming language Ada. As a result, PL/SQL uses a variant of Descriptive Intermediate Attributed Notation for Ada (DIANA), a tree-structured intermediate language. It is defined using a meta-notation called Interface Definition Language (IDL). DIANA is used internally by compilers and other tools.

At compile time, PL/SQL source code is translated into machine-readable m-code. Both the DIANA and m-code for a procedure or package are stored in the database. At run time, they are loaded into the shared memory pool. The DIANA is used to compile dependent procedures; the m-code is simply executed.

I see why you are interested. Access to the compiler underlying PL/SQL is tantalizing if you like looking under the hood. Nonetheless I would be reluctant to invest a lot of time
when the same goal can be accomplished by parsing with PL/SQL.

As someone who has used your site many times I can only thank you for having an inquiring mind.