[core] Improve Parser interface#3085
Conversation
Generated by 🚫 Danger |
| * | ||
| * @author Pieter_Van_Raemdonck - Application Engineers NV/SA - www.ae.be | ||
| */ | ||
| public interface Parser { |
There was a problem hiding this comment.
We could keep a interface at the old package to make it easier to transition:
package net.sourceforge.pmd.lang;
@Deprecated
@DeprecatedUntil700
public interface Parser extends net.sourceforge.pmd.lang.ast.Parser {
}Not sure, if that's worth. Regarding these @DeprecatedUntil700 - we could move these files into a own module called "pmd-compat6". When moving from pmd6 to pmd7, this could be added as an additional dependency to help getting adjusting the code to pmd7. We could move this module later out of pmd7 (before we release it) and maintain it for a while a separately. I don't know, whether this is feasible (that you can take a rule/language impl for pmd6, add this pmd-compat6 dependency, and run it with pmd7) or whether that's worth at all...
| * An error thrown during lexical analysis of a file. | ||
| */ | ||
| public final class TokenMgrError extends RuntimeException { | ||
| public final class TokenMgrError extends FileAnalysisException { |
There was a problem hiding this comment.
At some point, we should probably rename that from Error to Exception...
| import net.sourceforge.pmd.lang.swift.ast.SwiftParser.SwTopLevel; | ||
|
|
||
| // package private base class | ||
| abstract class SwiftRootNode extends SwiftInnerNode implements RootNode { |
There was a problem hiding this comment.
I was wondering, how/when this new class is actually used. But figured out -> antlr4-wrapper.xml
Describe the PR
This is the next step for pmd 7.
nspmd.lang.astpackage instead of justlang, AbstractParser is removed as it's now uselessSo, most of this has holes that need to be filled-in later, but I think it's necessary groundwork.
Related issues
Ready?
./mvnw clean verifypasses (checked automatically by travis)