diff --git a/javacc-wrapper.xml b/javacc-wrapper.xml index 6addedec11..b303e31e6d 100644 --- a/javacc-wrapper.xml +++ b/javacc-wrapper.xml @@ -59,7 +59,7 @@ - + diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractTokenManager.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/AbstractTokenManager.java similarity index 83% rename from pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractTokenManager.java rename to pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/AbstractTokenManager.java index 8bb6bf0469..9635ccc94e 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractTokenManager.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/AbstractTokenManager.java @@ -2,19 +2,16 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.ast; +package net.sourceforge.pmd.lang.ast.impl.javacc; import java.util.HashMap; import java.util.Map; import net.sourceforge.pmd.PMD; import net.sourceforge.pmd.lang.TokenManager; -import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; /** * A base class for the token managers generated by JavaCC. - * - * TODO move to impl.javacc package */ public abstract class AbstractTokenManager implements TokenManager { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/io/CharStream.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/io/CharStream.java index 64421a3bbf..69677dd963 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/io/CharStream.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/io/CharStream.java @@ -11,7 +11,7 @@ import java.io.IOException; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument; import net.sourceforge.pmd.util.document.Chars; import net.sourceforge.pmd.util.document.FileLocation; -import net.sourceforge.pmd.util.document.TextDocument; +import net.sourceforge.pmd.util.document.TextRegion; /** * PMD flavour of character streams used by JavaCC parsers. @@ -130,8 +130,7 @@ public final class CharStream { private FileLocation endLocation() { - TextDocument textDoc = tokenDoc.getTextDocument(); - return textDoc.toLocation(textDoc.createRegion(getEndOffset(), 0)); + return tokenDoc.getTextDocument().toLocation(TextRegion.fromOffsetLength(getEndOffset(), 0)); } diff --git a/pmd-plsql/src/main/ant/alljavacc.xml b/pmd-plsql/src/main/ant/alljavacc.xml index 180c2bbedf..e33aef3418 100644 --- a/pmd-plsql/src/main/ant/alljavacc.xml +++ b/pmd-plsql/src/main/ant/alljavacc.xml @@ -82,7 +82,7 @@ value="PLSQLNode" /> + value="class PLSQLParserTokenManager extends net.sourceforge.pmd.lang.ast.impl.javacc.AbstractTokenManager" /> public class