Hi,
I have found several bugs in PLDoc parser, version 1.5.17.
I prepared patches for these bugs and they work well for me.
Could you please include the fixes in the next release?
If the -user option is passed to PLDoc to supply the default schema name when parsing files, this is ignored for views, which are always generated into "Undefined" directory. The patch view-schema-name.patch fixes this.
If a view definition is terminated by semicolon, PLDoc failed to parse it: the semicolon is consumed by statement non-terminal, and PLDoc then expects either another semicolon or a slash. If a view definition is terminated using BOTH a semicolon and a slash, then PLDoc is able to parse it, but it is quite unnecessary, because when the SQL script with the definition is run by sqlplus, the view is created twice. So I have made the terminating slash optional, see view-terminator.patch.
This is closely related to the previous bug; if a view definition is terminated only by slash, then there is an infinite loop in skip2NextTerminator as it tries to find a semicolon. The patch skip2nextTerminator-infinite-loop.patch fixes this.
The generalized expression / generalized invocation was not supported by PLDoc (parse errors were generated), the patch generalized-expression.patch adds support for it.
Example: The following code should be parsed by PLDoc successfully:
-- This procedure is supposed to be located in an object type that has a parent called myParentType OVERRIDING MEMBER PROCEDURE someProcedure IS meAsParent myParentType; BEGIN (SELF AS myParentType).someProcedure(); meAsParent := (SELF AS myParentType); END;
The "IS OF type condition" was not supported by PLDoc (parse errors were generated); the patch is-of-expression.patch adds support for it.
Example: The following code should be parsed by PLDoc successfully:
DECLARE myObj myType := myType(); isNotOf BOOLEAN; BEGIN IF myObj IS OF TYPE (myType) THEN dbms_output.put_line("OK"); END IF; isNotOf := myObj IS NOT OF (myType); END; /
Feel free to send me any question if you need more information.
Thanks for the patches - I have just started in a PL/SQL project after a couple of years in middleware and so I will try to incorporate these changes.
The view and table code is very old and I cannot remember anyone touching the code since I started working on this ptoject - I use SchemaSpy in a Maven Site report. I will see what I can do without breaking PL/SQL parsing