[xml] Have pmd-xml Lexer in line with other antlr grammars (#5296)

Merge pull request #5296 from Monits:align-xml-antlr
This commit is contained in:
Andreas Dangel 2024-10-31 12:27:11 +01:00
commit a709be1dcb
No known key found for this signature in database
GPG Key ID: 93450DF2DF9A3FA3
5 changed files with 49 additions and 1 deletions

View File

@ -18,6 +18,11 @@ This is a {{ site.pmd.release_type }} release.
### 🚨 API Changes
#### Deprecations
* pmd-xml
* {%jdoc xml::lang.xml.antlr4.XMLLexer %} is deprecated for removal. Use {%jdoc !!xml::lang.xml.ast.XMLLexer %}
instead (note different package `ast` instead of `antlr4`).
### ✨ External Contributions
{% endtocmaker %}

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,21 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
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 since 7.8.0. Use {@link net.sourceforge.pmd.lang.xml.ast.XMLLexer} directly instead.
*/
@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>.