Add supertype to swift nodes

This commit is contained in:
Clément Fournier
2020-04-23 21:24:54 +02:00
parent e61f03aafa
commit 164c1361a6
3 changed files with 40 additions and 10 deletions

View File

@@ -54,7 +54,7 @@ import net.sourceforge.pmd.lang.ast.impl.antlr4.*;
}
options {
contextSuperClass = AntlrBaseNode;
contextSuperClass = SwiftNode;
superClass = PmdAntlrParserBase;
}

View File

@@ -0,0 +1,29 @@
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.swift.ast;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.tree.ParseTree;
import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrBaseNode;
/**
* Supertype of all swift nodes.
*/
public abstract class SwiftNode extends AntlrBaseNode<SwiftNode> {
protected SwiftNode() {
super();
}
protected SwiftNode(final ParserRuleContext parent, final int invokingStateNumber) {
super(parent, invokingStateNumber);
}
@Override
protected SwiftNode cast(ParseTree o) {
return (SwiftNode) o;
}
}