From a11f45e511e6c36b98254d4af017d6fc910b2598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Wed, 2 Sep 2020 06:07:39 +0200 Subject: [PATCH] Cleanup spec --- javacc-wrapper.xml | 2 +- .../pmd/cpd/internal/AntlrTokenizer.java | 2 +- .../pmd/cpd/internal/JavaCCTokenizer.java | 2 +- .../ast/impl/javacc/AbstractJjtreeNode.java | 2 +- .../pmd/lang/ast/impl/javacc/CharStream.java | 15 ++++--- .../ast/impl/javacc/JavaccTokenDocument.java | 6 +++ .../impl/javacc/io/FragmentedDocBuilder.java | 41 +++++++++++-------- .../pmd/util/document/RootTextDocument.java | 10 +++++ .../pmd/util/document/TextDocument.java | 38 +++++++++++++++-- .../pmd/util/document/TextFileBuilder.java | 1 + .../impl/javacc/io/CharStreamImplTest.java | 7 ++-- .../pmd/util/document/TextDocumentTest.java | 6 +-- pmd-cpp/etc/grammar/Cpp.jj | 2 +- .../pmd/lang/java/ast/ASTCompilationUnit.java | 7 ++-- .../pmd/lang/java/ast/JavaParser.java | 2 +- pmd-javascript/etc/grammar/Ecmascript5.jj | 2 +- pmd-jsp/etc/grammar/Jsp.jjt | 2 +- pmd-matlab/etc/grammar/Matlab.jj | 2 +- pmd-modelica/etc/grammar/Modelica.jjt | 2 +- pmd-objectivec/etc/grammar/ObjectiveC.jj | 2 +- pmd-plsql/etc/grammar/PLSQL.jjt | 2 +- pmd-python/etc/grammar/Python.jj | 2 +- pmd-visualforce/etc/grammar/Vf.jjt | 2 +- pmd-vm/etc/grammar/Vm.jjt | 2 +- 24 files changed, 110 insertions(+), 51 deletions(-) diff --git a/javacc-wrapper.xml b/javacc-wrapper.xml index b303e31e6d..60d4d70158 100644 --- a/javacc-wrapper.xml +++ b/javacc-wrapper.xml @@ -407,7 +407,7 @@ public final class ${token-constants-name} \{${line.separator} * be used as a basis for a CPD Tokenizer. */ @net.sourceforge.pmd.annotation.InternalApi - public static net.sourceforge.pmd.lang.TokenManager<%%%API_PACK%%%.impl.javacc.JavaccToken> newTokenManager(%%%API_PACK%%%.impl.javacc.io.CharStream cs) { + public static net.sourceforge.pmd.lang.TokenManager<%%%API_PACK%%%.impl.javacc.JavaccToken> newTokenManager(%%%API_PACK%%%.impl.javacc.CharStream cs) { return new %%%TOKEN_MGR_NAME%%%(cs); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/internal/AntlrTokenizer.java b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/internal/AntlrTokenizer.java index f0659b952b..427cb26325 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/internal/AntlrTokenizer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/internal/AntlrTokenizer.java @@ -18,8 +18,8 @@ import net.sourceforge.pmd.cpd.Tokens; import net.sourceforge.pmd.cpd.token.AntlrTokenFilter; import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrToken; import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrTokenManager; -import net.sourceforge.pmd.util.document.TextDocument; import net.sourceforge.pmd.util.document.CpdCompat; +import net.sourceforge.pmd.util.document.TextDocument; /** * Generic implementation of a {@link Tokenizer} useful to any Antlr grammar. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/internal/JavaCCTokenizer.java b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/internal/JavaCCTokenizer.java index b88f267dfa..f4711d20a6 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/internal/JavaCCTokenizer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/internal/JavaCCTokenizer.java @@ -14,9 +14,9 @@ import net.sourceforge.pmd.cpd.token.JavaCCTokenFilter; import net.sourceforge.pmd.cpd.token.TokenFilter; import net.sourceforge.pmd.lang.TokenManager; import net.sourceforge.pmd.lang.ast.FileAnalysisException; +import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument; -import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.impl.javacc.io.MalformedSourceException; import net.sourceforge.pmd.util.document.CpdCompat; import net.sourceforge.pmd.util.document.TextDocument; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/AbstractJjtreeNode.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/AbstractJjtreeNode.java index 6b3dddbe9e..a2a5035948 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/AbstractJjtreeNode.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/AbstractJjtreeNode.java @@ -51,7 +51,7 @@ public abstract class AbstractJjtreeNode, N e @Override public Chars getText() { - return getTextDocument().sliceText(getTextRegion()); + return getTextDocument().sliceOriginalText(getTextRegion()); } @Override diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/CharStream.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/CharStream.java index 084a82ac31..040f3887f1 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/CharStream.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/CharStream.java @@ -26,7 +26,7 @@ public final class CharStream { private final Chars chars; private final boolean useMarkSuffix; private int curOffset; - private int markOffset = -1; + private int markOffset; private CharStream(JavaccTokenDocument tokenDoc) { this.tokenDoc = tokenDoc; @@ -120,9 +120,12 @@ public final class CharStream { * be used again as the prefix of the next token. * * @throws AssertionError If the requested amount is greater than the - * number of read chars + * length of the mark */ public void backup(int amount) { + if (amount > markLen()) { + throw new IllegalArgumentException(); + } curOffset -= amount; } @@ -149,15 +152,15 @@ public final class CharStream { } - /** Returns the start offset of the current token (in the original source), inclusive. */ + /** Returns the start offset of the current token (in the translated source), inclusive. */ public int getStartOffset() { - return textDoc.translateOffset(markOffset); + return markOffset; } - /** Returns the end offset of the current token (in the original source), exclusive. */ + /** Returns the end offset of the current token (in the translated source), exclusive. */ public int getEndOffset() { - return textDoc.translateOffset(curOffset); + return curOffset; } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaccTokenDocument.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaccTokenDocument.java index 6e72604602..8d482f3340 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaccTokenDocument.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaccTokenDocument.java @@ -50,6 +50,12 @@ public class JavaccTokenDocument extends TokenDocument { return new EscapeAwareReader(text); } + @Override + public TextDocument getTextDocument() { + return translatedDocument == null ? super.getTextDocument() + : translatedDocument; + } + final void translate() throws IOException, MalformedSourceException { try (EscapeAwareReader reader = newReader(getTextDocument().getText())) { translatedDocument = reader.translate(getTextDocument()); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/io/FragmentedDocBuilder.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/io/FragmentedDocBuilder.java index 91e7254672..68516ad79c 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/io/FragmentedDocBuilder.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/io/FragmentedDocBuilder.java @@ -7,6 +7,7 @@ package net.sourceforge.pmd.lang.ast.impl.javacc.io; import java.io.IOException; +import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import net.sourceforge.pmd.lang.LanguageVersion; @@ -80,49 +81,44 @@ final class FragmentedDocBuilder { return inputOffsetAt(outputOffset, firstFragment); } - static int inputOffsetAt(int outputOffset, Fragment firstFragment) { + static int inputOffsetAt(int outputOffset, @Nullable Fragment firstFragment) { Fragment f = firstFragment; if (f == null) { return outputOffset; } - int sum = outputOffset; - while (f != null && f.inStart() < sum) { - sum += f.inLen(); + while (f.next != null && f.inEnd() < outputOffset) { f = f.next; } - return sum; + return f.outToIn(outputOffset); } - static class FragmentedTextDocument implements TextDocument { + static final class FragmentedTextDocument implements TextDocument { private final Fragment firstFragment; private final Chars text; private final TextDocument base; FragmentedTextDocument(TextDocument base, Fragment firstFragment, Fragment lastFragment) { + assert firstFragment != lastFragment; // NOPMD this.firstFragment = firstFragment; this.text = toChars(firstFragment, lastFragment); this.base = base; } private static Chars toChars(Fragment firstFragment, Fragment lastFragment) { - if (firstFragment == lastFragment) { - return firstFragment.getChars(); - } StringBuilder sb = new StringBuilder(lastFragment.outEnd()); Fragment f = firstFragment; - while (f.next != null) { + while (f != null) { f.getChars().appendChars(sb); f = f.next; } - return Chars.wrap(sb); } @Override public int translateOffset(int outputOffset) { - // todo this would be pretty slow when there are many escapes - // we could check save the fragment last accessed and + // todo this would be pretty slow when we're in the middle of some escapes + // we could check save the fragment last accessed to speed it up, and look forwards & backwards return base.translateOffset(inputOffsetAt(outputOffset, firstFragment)); } @@ -156,10 +152,20 @@ final class FragmentedDocBuilder { return base.createLineRange(startLineInclusive, endLineInclusive); } + @Override + public Chars sliceOriginalText(TextRegion region) { + return base.sliceOriginalText(translateRegion(region)); + } + @Override public FileLocation toLocation(TextRegion region) { - return base.toLocation(TextRegion.fromBothOffsets(translateOffset(region.getStartOffset()), - translateOffset(region.getEndOffset()))); + return base.toLocation(translateRegion(region)); + } + + @Override + public @NonNull TextRegion translateRegion(TextRegion region) { + return TextRegion.fromBothOffsets(translateOffset(region.getStartOffset()), + translateOffset(region.getEndOffset())); } @Override @@ -168,7 +174,10 @@ final class FragmentedDocBuilder { } } - + /** + * A delta from the original text to the translated text. This maps + * a region of the original document to some new characters. + */ static final class Fragment { private final Chars chars; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/document/RootTextDocument.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/document/RootTextDocument.java index da3a3f9f92..a48a62ad47 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/document/RootTextDocument.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/document/RootTextDocument.java @@ -116,6 +116,16 @@ final class RootTextDocument extends BaseCloseable implements TextDocument { return outOffset; } + @Override + public TextRegion translateRegion(TextRegion region) { + return region; + } + + @Override + public Chars sliceOriginalText(TextRegion region) { + return getText().subSequence(region.getStartOffset(), region.getEndOffset()); + } + private static final String NOT_IN_RANGE = "Region [start=%d, end=%d[ is not in range of this document (length %d)"; private static final String INVALID_LINE_RANGE = "Line range %d..%d is not in range of this document (%d lines) (line numbers are 1-based)"; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/document/TextDocument.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/document/TextDocument.java index 4c8bf577fb..b0ecdf7344 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/document/TextDocument.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/document/TextDocument.java @@ -57,11 +57,17 @@ public interface TextDocument extends Closeable { Chars getText(); /** - * Returns a region of the {@linkplain #getText() text} as a character sequence. + * Returns a slice of the original text. Note that this is not the + * same as {@code getText().subsequence}, as if this document has + * translated escapes, the returned char slice will contain the + * untranslated escapes, whereas {@link #getText()} would return + * the translated characters. + * + * @param region A region, in the coordinate system of this document + * + * @return The slice of the original text that corresponds to the region */ - default Chars sliceText(TextRegion region) { - return getText().subSequence(region.getStartOffset(), region.getEndOffset()); - } + Chars sliceOriginalText(TextRegion region); /** @@ -71,8 +77,31 @@ public interface TextDocument extends Closeable { */ long getChecksum(); + + /** + * Returns the input offset for the given output offset. This maps + * back an offset in the coordinate system of this document, to the + * coordinate system of the original document. + * + * @param outOffset Output offset + * + * @return Input offset + */ int translateOffset(int outOffset); + /** + * Translate a region given in the the coordinate system of this + * document, to the coordinate system of the original document. + * This works as if creating a new region with both start and end + * offsets translated through {@link #translateOffset(int)}. The + * returned region may have a different length. + * + * @param region Output region + * + * @return Input region + */ + TextRegion translateRegion(TextRegion region); + /** * Returns the length in characters of the {@linkplain #getText() text}. @@ -152,6 +181,7 @@ public interface TextDocument extends Closeable { * * @see TextFile#forCharSeq(CharSequence, String, LanguageVersion) */ + @SuppressWarnings("PMD.CloseResource") static TextDocument readOnlyString(@NonNull CharSequence source, @NonNull String filename, @NonNull LanguageVersion lv) { TextFile textFile = TextFile.forCharSeq(source, filename, lv); try { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/document/TextFileBuilder.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/document/TextFileBuilder.java index ea887e6ff4..a30c1dce5f 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/document/TextFileBuilder.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/document/TextFileBuilder.java @@ -16,6 +16,7 @@ import net.sourceforge.pmd.lang.LanguageVersion; /** * A builder for a new text file. */ +@SuppressWarnings("PMD.MissingStaticMethodInNonInstantiatableClass") public abstract class TextFileBuilder { protected final LanguageVersion languageVersion; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/io/CharStreamImplTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/io/CharStreamImplTest.java index ab69c2320d..f26f6fd7d1 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/io/CharStreamImplTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/io/CharStreamImplTest.java @@ -53,8 +53,8 @@ public class CharStreamImplTest { try { stream.readChar(); } catch (Exception e) { - assertEquals(stream.getStartOffset(), 0); - assertEquals(stream.getEndOffset(), 0); + assertEquals(0, stream.getStartOffset()); + assertEquals(0, stream.getEndOffset()); throw e; } } @@ -162,8 +162,9 @@ public class CharStreamImplTest { assertEquals('c', stream.markTokenStart()); assertEquals('d', stream.readChar()); + stream.backup(2); // ok expect.expect(IllegalArgumentException.class); - stream.backup(10); + stream.backup(1); } @Test diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/util/document/TextDocumentTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/util/document/TextDocumentTest.java index fab67f41e4..242687bc14 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/util/document/TextDocumentTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/util/document/TextDocumentTest.java @@ -43,7 +43,7 @@ public class TextDocumentTest { TextDocument doc = TextDocument.readOnlyString("bonjour\ntristesse", dummyVersion); TextRegion region = TextRegion.fromOffsetLength(0, "bonjour\n".length()); - assertEquals("bonjour\n", doc.sliceText(region).toString()); + assertEquals("bonjour\n", doc.sliceOriginalText(region).toString()); FileLocation withLines = doc.toLocation(region); assertEquals(1, withLines.getBeginLine()); @@ -60,7 +60,7 @@ public class TextDocumentTest { // We consider it's part of the next line TextRegion region = TextRegion.fromOffsetLength("bonjour\n".length(), 0); - assertEquals("", doc.sliceText(region).toString()); + assertEquals("", doc.sliceOriginalText(region).toString()); FileLocation withLines = doc.toLocation(region); @@ -78,7 +78,7 @@ public class TextDocumentTest { TextRegion region = TextRegion.fromOffsetLength("bonjour".length(), 1); - assertEquals("\n", doc.sliceText(region).toString()); + assertEquals("\n", doc.sliceOriginalText(region).toString()); FileLocation withLines = doc.toLocation(region); diff --git a/pmd-cpp/etc/grammar/Cpp.jj b/pmd-cpp/etc/grammar/Cpp.jj index f292dd019c..eed7cc58cf 100644 --- a/pmd-cpp/etc/grammar/Cpp.jj +++ b/pmd-cpp/etc/grammar/Cpp.jj @@ -32,7 +32,7 @@ options { PARSER_BEGIN(CppParserImpl) package net.sourceforge.pmd.lang.cpp.ast; -import net.sourceforge.pmd.lang.ast.impl.javacc.io.CharStream; +import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.TokenMgrError; public final class CppParserImpl { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java index 9caac9c173..2f049916cf 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java @@ -12,7 +12,6 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import net.sourceforge.pmd.annotation.InternalApi; -import net.sourceforge.pmd.lang.Parser.ParserTask; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.lang.ast.impl.GenericNode; @@ -42,11 +41,11 @@ public final class ASTCompilationUnit extends AbstractJavaTypeNode implements Ja return doc; } - void addTaskInfo(ParserTask task) { - this.doc = task.getTextDocument(); + void addTaskInfo(TextDocument translatedDoc) { + this.doc = translatedDoc; } - void setComments(List comments) { + void setComments(List comments) { this.comments = comments; } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParser.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParser.java index 716e625b2f..fc3e890532 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParser.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParser.java @@ -40,7 +40,7 @@ public class JavaParser extends JjtreeParserAdapter { ASTCompilationUnit acu = parser.CompilationUnit(); acu.setNoPmdComments(parser.getSuppressMap()); - acu.addTaskInfo(task); + acu.addTaskInfo(cs.getTokenDocument().getTextDocument()); // this is the translated document != task.getTextDocument() checker.check(acu); return acu; } diff --git a/pmd-javascript/etc/grammar/Ecmascript5.jj b/pmd-javascript/etc/grammar/Ecmascript5.jj index a1b77891ce..a9cf14bcbb 100644 --- a/pmd-javascript/etc/grammar/Ecmascript5.jj +++ b/pmd-javascript/etc/grammar/Ecmascript5.jj @@ -15,7 +15,7 @@ options { PARSER_BEGIN(Ecmascript5ParserImpl) package net.sourceforge.pmd.lang.ecmascript5.ast; -import net.sourceforge.pmd.lang.ast.impl.javacc.io.CharStream; +import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.TokenMgrError; public class Ecmascript5ParserImpl { diff --git a/pmd-jsp/etc/grammar/Jsp.jjt b/pmd-jsp/etc/grammar/Jsp.jjt index ca66ff9571..9e4483a441 100644 --- a/pmd-jsp/etc/grammar/Jsp.jjt +++ b/pmd-jsp/etc/grammar/Jsp.jjt @@ -30,7 +30,7 @@ options { PARSER_BEGIN(JspParserImpl) package net.sourceforge.pmd.lang.jsp.ast; -import net.sourceforge.pmd.lang.ast.impl.javacc.io.CharStream; +import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.TokenMgrError; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; diff --git a/pmd-matlab/etc/grammar/Matlab.jj b/pmd-matlab/etc/grammar/Matlab.jj index 6220de48c8..3ff1c8b27c 100644 --- a/pmd-matlab/etc/grammar/Matlab.jj +++ b/pmd-matlab/etc/grammar/Matlab.jj @@ -21,7 +21,7 @@ options { PARSER_BEGIN(MatlabParserImpl) package net.sourceforge.pmd.lang.matlab.ast; -import net.sourceforge.pmd.lang.ast.impl.javacc.io.CharStream; +import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.TokenMgrError; public class MatlabParserImpl { diff --git a/pmd-modelica/etc/grammar/Modelica.jjt b/pmd-modelica/etc/grammar/Modelica.jjt index 9d2cdfa526..e2e7d63121 100644 --- a/pmd-modelica/etc/grammar/Modelica.jjt +++ b/pmd-modelica/etc/grammar/Modelica.jjt @@ -49,7 +49,7 @@ options { PARSER_BEGIN(ModelicaParserImpl) package net.sourceforge.pmd.lang.modelica.ast; -import net.sourceforge.pmd.lang.ast.impl.javacc.io.CharStream; +import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.TokenMgrError; class ModelicaParserImpl { diff --git a/pmd-objectivec/etc/grammar/ObjectiveC.jj b/pmd-objectivec/etc/grammar/ObjectiveC.jj index c4679634a1..171ca581fa 100644 --- a/pmd-objectivec/etc/grammar/ObjectiveC.jj +++ b/pmd-objectivec/etc/grammar/ObjectiveC.jj @@ -21,7 +21,7 @@ package net.sourceforge.pmd.lang.objectivec.ast; import java.io.*; import java.util.*; -import net.sourceforge.pmd.lang.ast.impl.javacc.io.CharStream; +import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.TokenMgrError; /** diff --git a/pmd-plsql/etc/grammar/PLSQL.jjt b/pmd-plsql/etc/grammar/PLSQL.jjt index a44efb486a..090f90e235 100644 --- a/pmd-plsql/etc/grammar/PLSQL.jjt +++ b/pmd-plsql/etc/grammar/PLSQL.jjt @@ -154,7 +154,7 @@ package net.sourceforge.pmd.lang.plsql.ast; import java.io.*; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.lang.ast.impl.javacc.io.CharStream; +import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.TokenMgrError; public class PLSQLParserImpl { diff --git a/pmd-python/etc/grammar/Python.jj b/pmd-python/etc/grammar/Python.jj index cba9a4fce6..8087042e7c 100644 --- a/pmd-python/etc/grammar/Python.jj +++ b/pmd-python/etc/grammar/Python.jj @@ -17,7 +17,7 @@ PARSER_BEGIN(PythonParserImpl) package net.sourceforge.pmd.lang.python.ast; -import net.sourceforge.pmd.lang.ast.impl.javacc.io.CharStream; +import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.TokenMgrError; public class PythonParserImpl { diff --git a/pmd-visualforce/etc/grammar/Vf.jjt b/pmd-visualforce/etc/grammar/Vf.jjt index b123075211..2af403e0cb 100644 --- a/pmd-visualforce/etc/grammar/Vf.jjt +++ b/pmd-visualforce/etc/grammar/Vf.jjt @@ -13,7 +13,7 @@ options { PARSER_BEGIN(VfParserImpl) package net.sourceforge.pmd.lang.vf.ast; -import net.sourceforge.pmd.lang.ast.impl.javacc.io.CharStream; +import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.TokenMgrError; public class VfParserImpl { diff --git a/pmd-vm/etc/grammar/Vm.jjt b/pmd-vm/etc/grammar/Vm.jjt index 5dc623deb7..678ed8de31 100644 --- a/pmd-vm/etc/grammar/Vm.jjt +++ b/pmd-vm/etc/grammar/Vm.jjt @@ -46,7 +46,7 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; import net.sourceforge.pmd.lang.ast.TokenMgrError; -import net.sourceforge.pmd.lang.ast.impl.javacc.io.CharStream; +import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken;