Using the JavaCC CACHE_TOKENS option to optimize the parser slightly. This option makes the parser slightly smaller (about 2KB) and very slightly faster

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4448 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2006-07-06 12:13:31 +00:00
parent e85ed94ce5
commit 8dd1122290
4 changed files with 163 additions and 161 deletions

View File

@ -53,13 +53,14 @@
options {
JAVA_UNICODE_ESCAPE = true;
CACHE_TOKENS = true;
STATIC = false;
USER_CHAR_STREAM = true;
MULTI=true;
VISITOR=true;
NODE_USES_PARSER=true;
MULTI = true;
VISITOR = true;
NODE_USES_PARSER = true;
NODE_PACKAGE="net.sourceforge.pmd.ast";
DEBUG_TOKEN_MANAGER = false;
STATIC=false;
}
PARSER_BEGIN(JavaParser)

View File

@ -26,6 +26,7 @@
options {
STATIC=false;
BUILD_PARSER=false;
CACHE_TOKENS=true;
}
PARSER_BEGIN(CPPParser)

View File

@ -10,13 +10,22 @@ These are new rules that are still in progress
</description>
<rule name="RowSetClose"
message="Avoid invoking the ''close'' method on the RowSet object ''{0}''"
class="net.sourceforge.pmd.rules.RowSetClose">
<rule name="TryWithoutCatch"
message="Try stmt w/o catch block"
class="net.sourceforge.pmd.rules.XPathRule">
<description>
Avoid invoking the 'close' method on a RowSet object
Try stmt w/o catch block
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
//TryStatement[count(CatchStatement)=0]
]]>
</value>
</property>
</properties>
<example>
<![CDATA[
public class Foo {

File diff suppressed because it is too large Load Diff