From 9af343b2a3f275058cf6b774afe56b4fa956d64c Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Fri, 26 Jul 2002 16:19:43 +0000 Subject: [PATCH] tweak git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@524 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/xdocs/howtowritearule.xml | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) 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: +

+