Have pmd-xml Lexer in line with other antlr grammars

- The package is no longer antlr4, but ast, as is in all other modules
 - We keep a deprecated proxy for backwards compatibility
 - We annotate the generated classes as such to ignore them from
   coverage reports
This commit is contained in:
Juan Martín Sotuyo Dodero 2024-10-28 22:10:21 -03:00
parent 97fe389dcc
commit 69a92de52d
4 changed files with 40 additions and 1 deletions

View File

@ -45,6 +45,28 @@
</parameter>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>antlr-cleanup</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<ant antfile="${antlr4.ant.wrapper}" target="cpd-language">
<property name="lang-name" value="XML" />
<property name="lang-id" value="xml" />
</ant>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -0,0 +1,17 @@
package net.sourceforge.pmd.lang.xml.antlr4;
import org.antlr.v4.runtime.CharStream;
/**
* Backwards compatible bridge. The XMLLexer was moved to align it with other PMD modules.
* This class will be removed in PMD 8.0.0.
* Use {@link net.sourceforge.pmd.lang.xml.ast.XMLLexer} directly instead.
*
* @deprecated
*/
@Deprecated
public class XMLLexer extends net.sourceforge.pmd.lang.xml.ast.XMLLexer {
public XMLLexer(CharStream input) {
super(input);
}
}

View File

@ -8,7 +8,7 @@ import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Lexer;
import net.sourceforge.pmd.cpd.impl.AntlrCpdLexer;
import net.sourceforge.pmd.lang.xml.antlr4.XMLLexer;
import net.sourceforge.pmd.lang.xml.ast.XMLLexer;
/**
* <p>Note: This class has been called XmlTokenizer in PMD 6</p>.