Class BaseAntlrTerminalNode<N extends AntlrNode<N>>
java.lang.Object
net.sourceforge.pmd.lang.ast.impl.antlr4.BaseAntlrNode<BaseAntlrTerminalNode.AntlrTerminalPmdAdapter<N>,N>
net.sourceforge.pmd.lang.ast.impl.antlr4.BaseAntlrTerminalNode<N>
- All Implemented Interfaces:
AntlrNode<N>,GenericNode<N>,Node,Reportable
- Direct Known Subclasses:
BaseAntlrErrorNode
public abstract class BaseAntlrTerminalNode<N extends AntlrNode<N>>
extends BaseAntlrNode<BaseAntlrTerminalNode.AntlrTerminalPmdAdapter<N>,N>
Base class for terminal nodes (they wrap a
TerminalNode).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classNested classes/interfaces inherited from class net.sourceforge.pmd.lang.ast.impl.antlr4.BaseAntlrNode
BaseAntlrNode.AntlrToPmdParseTreeAdapter<N extends AntlrNode<N>> -
Field Summary
Fields inherited from interface net.sourceforge.pmd.lang.ast.Node
COORDS_COMPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BaseAntlrTerminalNode.AntlrTerminalPmdAdapter<N>getChild(int index) Returns the child of this node at the given index.org.antlr.v4.runtime.Tokenorg.antlr.v4.runtime.TokenintReturns the number of children of this node.abstract @NonNull StringgetText()Returns the text of the token.protected intMethods inherited from class net.sourceforge.pmd.lang.ast.impl.antlr4.BaseAntlrNode
getBeginColumn, getBeginLine, getEndColumn, getEndLine, getIndexInParent, getParent, getTextRegion, getUserMapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sourceforge.pmd.lang.ast.impl.GenericNode
ancestors, ancestorsOrSelf, asStream, children, descendants, descendantsOrSelf, getFirstChild, getLastChild, getNextSibling, getPreviousSiblingMethods inherited from interface net.sourceforge.pmd.lang.ast.Node
acceptVisitor, ancestors, children, compareLocation, descendants, firstChild, getAstInfo, getImage, getLanguageVersion, getReportLocation, getRoot, getTextDocument, getXPathAttributesIterator, getXPathNodeName, hasImageEqualTo, isFindBoundary
-
Constructor Details
-
BaseAntlrTerminalNode
protected BaseAntlrTerminalNode(org.antlr.v4.runtime.Token symbol)
-
-
Method Details
-
getText
Returns the text of the token.- Implementation Note:
- This should use
AntlrNameDictionary.getConstantImageOfToken(Token), or default toToken.getText()
-
asAntlrNode
- Specified by:
asAntlrNodein classBaseAntlrNode<BaseAntlrTerminalNode.AntlrTerminalPmdAdapter<N extends AntlrNode<N>>,N extends AntlrNode<N>>
-
getFirstAntlrToken
public org.antlr.v4.runtime.Token getFirstAntlrToken()- Specified by:
getFirstAntlrTokenin classBaseAntlrNode<BaseAntlrTerminalNode.AntlrTerminalPmdAdapter<N extends AntlrNode<N>>,N extends AntlrNode<N>>
-
getLastAntlrToken
public org.antlr.v4.runtime.Token getLastAntlrToken()- Specified by:
getLastAntlrTokenin classBaseAntlrNode<BaseAntlrTerminalNode.AntlrTerminalPmdAdapter<N extends AntlrNode<N>>,N extends AntlrNode<N>>
-
getNumChildren
public int getNumChildren()Description copied from interface:NodeReturns the number of children of this node. -
getTokenKind
protected int getTokenKind() -
getChild
Description copied from interface:NodeReturns the child of this node at the given index.
-