Movatterモバイル変換


[0]ホーム

URL:


 
» PL/SQL Support Edit on GitHub

PL/SQL Support

PL/SQL-specific features and guidance
Table of Contents

Oracle Database PL/SQL Language Referencedescribes and explains how to use PL/SQL, the Oracle procedural extension of SQL.

Language Info for PLSQL

Grammar

PL/SQL support started out using the grammar fromPlDoc, an open-source utility forgenerating HTML documentation of PL/SQL code. But the grammar has been changed significantly.

Parsing Exclusions

The grammar for PL/SQL used in PMD has several bugs and might not parse all DDL scriptswithout errors. However, it should be best practice to call PMD forevery DDL script.Thus, we introduce the following workaround to cope with the situation.

We introduce two special commentsPMD-EXCLUDE-BEGIN andPMD-EXCLUDE-ENDwhich cause PMD to treat the source in between these comments more or lesslike a multi-line comment, or in other words, just not try to parse them.

It is good practice to include a reason for excluding inside the-- PMD-EXCLUDE-BEGIN comment separated by a colon.

ThePMD-EXCLUDE-BEGIN andPMD-EXCLUDE-END comment lines must not containother statements, e.g.do_xy(); -- PMD-EXCLUDE-BEGIN is invalid.

Example:

begin  do_something();  -- PMD-EXCLUDE-BEGIN: PMD does not like dbms_lob.trim (clash with TrimExpression)  dbms_lob.trim(the_blob, 1000);  -- PMD-EXCLUDE-END  do_something_else();end;

The existence of exclusions can be detected with the attributesExcludedRangesCount andExcludedLinesCount of the top-level ASTInput node.If nothing is excluded, both values are 0 (zero).Otherwise,ExcludedRangesCount contains the number of excluded line-rangesandExcludedLinesCount is the total number of excluded lines.A future version of PMD might pass the line excluded line ranges,source fragments and the corresponding reason commentsas child nodes of the top-level ASTInput node.

In order to keep track where such parse exclusions are used, you could createa custom XPath rule with the following expression:

/Input[@ExcludedRangesCount > 0]

This will find all files with at least one excluded range.


This documentation is written in markdown.
If there is something missing or can be improved, edit this page on github and create a PR: Edit on GitHub

©2026 PMD Open Source Project. All rights reserved.
Page last updated: September 2023 (7.0.0)
Site last generated: Jan 30, 2026

PMD                logo


[8]ページ先頭

©2009-2026 Movatter.jp