diff --git a/pmd/xdocs/howtowritearule.xml b/pmd/xdocs/howtowritearule.xml index cb68b62675..b8908de3d7 100644 --- a/pmd/xdocs/howtowritearule.xml +++ b/pmd/xdocs/howtowritearule.xml @@ -9,15 +9,20 @@

Writing PMD rules is cool because you don't have to wait for us to get around to implementing feature requests.

- + +

+ In order to do rules, it'll help if you can modify the PMD source. + So download the latest source release (i.e., pmd-src-0.7.zip or something) and unzip it somewhere on your computer. +

+

- First, figure out what you're looking for. Let's use "While loops must use braces" as an example. + Now lets's figure out what problem you want to spot. Let's use "While loops must use braces" as an example. You've seen this before a thousand times so you know what it looks like:

+

+ So we know what an example in source code looks like, which is half the battle. +

- PMD uses a JJTree/JavaCC generated parser to parse the source code and produce an AST (Abstract Syntax Tree). - This means that the code above looks like this: + PMD doesn't use the source code directly; it uses a JJTree/JavaCC generated parser to parse the source code and + produce an AST (Abstract Syntax Tree). The AST for the code above looks like this:

+

+ You can generate this yourself by: +

+