From 4cae55cf0fab4dc022a2dccc8405e2478eba6ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 3 Nov 2020 10:06:11 +0100 Subject: [PATCH] Remove deprecated tokenizers --- .../sourceforge/pmd/cpd/FortranTokenizer.java | 42 ------------------- .../sourceforge/pmd/cpd/PerlTokenizer.java | 25 ----------- .../sourceforge/pmd/cpd/RubyTokenizer.java | 41 ------------------ 3 files changed, 108 deletions(-) delete mode 100644 pmd-fortran/src/main/java/net/sourceforge/pmd/cpd/FortranTokenizer.java delete mode 100644 pmd-perl/src/main/java/net/sourceforge/pmd/cpd/PerlTokenizer.java delete mode 100644 pmd-ruby/src/main/java/net/sourceforge/pmd/cpd/RubyTokenizer.java diff --git a/pmd-fortran/src/main/java/net/sourceforge/pmd/cpd/FortranTokenizer.java b/pmd-fortran/src/main/java/net/sourceforge/pmd/cpd/FortranTokenizer.java deleted file mode 100644 index 4422a17d0c..0000000000 --- a/pmd-fortran/src/main/java/net/sourceforge/pmd/cpd/FortranTokenizer.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.cpd; - -import java.util.ArrayList; - -/** - * Tokenizer implementation for Fortran - * - * @author Romain PELISSE - romain.pelisse@atosorigin.com - * - * @deprecated Was replaced by an {@link AnyTokenizer}. Use {@link FortranLanguage#getTokenizer()} anyway - */ -@Deprecated -public class FortranTokenizer extends AbstractTokenizer implements Tokenizer { - - /** - * Creates a new instance of {@link FortranTokenizer}. - */ - public FortranTokenizer() { - this.spanMultipleLinesString = false; // No such thing in Fortran ! - // setting markers for "string" in Fortran - this.stringToken = new ArrayList<>(); - this.stringToken.add("\'"); - // setting markers for 'ignorable character' in Fortran - this.ignorableCharacter = new ArrayList<>(); - this.ignorableCharacter.add("("); - this.ignorableCharacter.add(")"); - this.ignorableCharacter.add(","); - - // setting markers for 'ignorable string' in Fortran - this.ignorableStmt = new ArrayList<>(); - this.ignorableStmt.add("do"); - this.ignorableStmt.add("while"); - this.ignorableStmt.add("end"); - this.ignorableStmt.add("if"); - // Fortran comment start with an ! - this.oneLineCommentChar = '!'; - } -} diff --git a/pmd-perl/src/main/java/net/sourceforge/pmd/cpd/PerlTokenizer.java b/pmd-perl/src/main/java/net/sourceforge/pmd/cpd/PerlTokenizer.java deleted file mode 100644 index 910d1bb1dd..0000000000 --- a/pmd-perl/src/main/java/net/sourceforge/pmd/cpd/PerlTokenizer.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.cpd; - -import java.util.ArrayList; - -/** - * @deprecated Replaced by an {@link AnyTokenizer}. Use {@link PerlLanguage#getTokenizer()} anyway - */ -@Deprecated -public class PerlTokenizer extends AbstractTokenizer { - public PerlTokenizer() { - this.stringToken = new ArrayList<>(); - this.stringToken.add("\'"); - this.stringToken.add("\""); - - this.ignorableCharacter = new ArrayList<>(); - - this.ignorableStmt = new ArrayList<>(); - - this.spanMultipleLinesString = true; - } -} diff --git a/pmd-ruby/src/main/java/net/sourceforge/pmd/cpd/RubyTokenizer.java b/pmd-ruby/src/main/java/net/sourceforge/pmd/cpd/RubyTokenizer.java deleted file mode 100644 index 40fceef583..0000000000 --- a/pmd-ruby/src/main/java/net/sourceforge/pmd/cpd/RubyTokenizer.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.cpd; - -import java.util.ArrayList; - -/** - * Tokenizer for Ruby. - * - * @author Zev Blut zb@ubit.com - * @deprecated Was replaced by an {@link AnyTokenizer}. Use {@link RubyLanguage#getTokenizer()} anyway - */ -@Deprecated -public class RubyTokenizer extends AbstractTokenizer { - - /** - * Creates a new Ruby tokenizer. - */ - public RubyTokenizer() { - // setting markers for "string" in ruby - this.stringToken = new ArrayList<>(); - this.stringToken.add("\'"); - this.stringToken.add("\""); - // setting markers for 'ignorable character' in Ruby - this.ignorableCharacter = new ArrayList<>(); - this.ignorableCharacter.add("{"); - this.ignorableCharacter.add("}"); - this.ignorableCharacter.add("("); - this.ignorableCharacter.add(")"); - this.ignorableCharacter.add(";"); - this.ignorableCharacter.add(","); - - // setting markers for 'ignorable string' in Ruby - this.ignorableStmt = new ArrayList<>(); - this.ignorableStmt.add("while"); - this.ignorableStmt.add("do"); - this.ignorableStmt.add("end"); - } -}