Move AbstractTokenManager

This commit is contained in:
Clément Fournier 2020-04-29 00:48:57 +02:00
parent 7f65b1f910
commit b8af0dda6e
4 changed files with 5 additions and 9 deletions

View File

@ -59,7 +59,7 @@
<property name="base-class-name" value="Abstract${lang-name}Node" />
<!-- This will be moved to impl package when all language modules have been ported -->
<property name="base-tokenmgr" value="${ast-api-package}.AbstractTokenManager"/>
<property name="base-tokenmgr" value="${ast-impl-package}.AbstractTokenManager"/>
<property name="charstream-itf" value="${ast-impl-package}.io.CharStream"/>

View File

@ -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<JavaccToken> {

View File

@ -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));
}

View File

@ -82,7 +82,7 @@
value="PLSQLNode" />
<replace file="${target}/net/sourceforge/pmd/lang/plsql/ast/PLSQLParserTokenManager.java"
token="class PLSQLParserTokenManager"
value="class PLSQLParserTokenManager extends net.sourceforge.pmd.lang.ast.AbstractTokenManager" />
value="class PLSQLParserTokenManager extends net.sourceforge.pmd.lang.ast.impl.javacc.AbstractTokenManager" />
<replace file="${target}/net/sourceforge/pmd/lang/plsql/ast/JJTPLSQLParserState.java">
<replacetoken>public class</replacetoken>
<replacevalue><![CDATA[import net.sourceforge.pmd.lang.ast.Node;