Class JavadocCommentsAstVisitor
- All Implemented Interfaces:
JavadocCommentsParserVisitor<JavadocNodeImpl>, org.antlr.v4.runtime.tree.ParseTreeVisitor<JavadocNodeImpl>
JavadocCommentsParser. Each overridden visit...
method visits children of a parse tree node (subrules) or creates terminal
nodes (tokens), and returns a JavadocNodeImpl subtree as the result.
The order of visit... methods in JavaAstVisitor.java and production rules in
JavaLanguageParser.g4 should be consistent to ease maintenance.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classA small utility to accumulate consecutive TEXT tokens into one node, preserving the starting token for accurate location metadata. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JavadocCommentsAstVisitor.TextAccumulatorAccumulator for consecutive TEXT tokens.private final intLine number of the Block comment AST that is being parsed.private DetailNodeThe first non-tight HTML tag encountered in the Javadoc comment, if any.All Javadoc tag token types.private final intJavadoc Ident.A set of token indices used to track which tokens have already had their hidden tokens added to the AST.private final org.antlr.v4.runtime.BufferedTokenStreamToken stream to check for hidden tokens. -
Constructor Summary
ConstructorsConstructorDescriptionJavadocCommentsAstVisitor(org.antlr.v4.runtime.CommonTokenStream tokens, int blockCommentLineNumber, int javadocColumnNumber) Constructs a JavaAstVisitor with given token stream, line number, and column number. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddHiddenTokensToTheLeft(org.antlr.v4.runtime.Token token, JavadocNodeImpl parent) Adds hidden tokens to the left of the given token to the parent node.private JavadocNodeImplbuildImaginaryNode(int tokenType, org.antlr.v4.runtime.ParserRuleContext ctx) Creates an imaginary JavadocNodeImpl of the given token type and processes all children of the given ParserRuleContext.private JavadocNodeImplcreate(org.antlr.v4.runtime.Token token) Creates a JavadocNodeImpl from the given token.private JavadocNodeImplcreateImaginary(int tokenType) Create a JavadocNodeImpl from a given token and token type.private JavadocNodeImplflattenedTree(org.antlr.v4.runtime.ParserRuleContext ctx) Builds the AST for a particular node, then returns a "flattened" tree of siblings.Returns the first non-tight HTML tag encountered in the Javadoc comment, if any.private static booleanisJavadocTag(int type) Checks if the given token type is a Javadoc tag.private static booleanisTextToken(org.antlr.v4.runtime.Token token) Checks whether a token is a Javadoc text token.private voidprocessChildren(JavadocNodeImpl parent, List<? extends org.antlr.v4.runtime.tree.ParseTree> children) Adds all the children from the given ParseTree or ParserRuleContext list to the parent JavadocNodeImpl.Visit a parse tree produced byJavadocCommentsParser.authorTag().Visit a parse tree produced byJavadocCommentsParser.blockTag().Visit a parse tree produced byJavadocCommentsParser.codeInlineTag().Visit a parse tree produced byJavadocCommentsParser.customBlockTag().Visit a parse tree produced byJavadocCommentsParser.customInlineTag().Visit a parse tree produced byJavadocCommentsParser.deprecatedTag().Visit a parse tree produced byJavadocCommentsParser.description().Visit a parse tree produced byJavadocCommentsParser.exceptionTag().Visit a parse tree produced byJavadocCommentsParser.hiddenTag().Visit a parse tree produced byJavadocCommentsParser.htmlAttribute().Visit a parse tree produced byJavadocCommentsParser.htmlComment().Visit a parse tree produced byJavadocCommentsParser.htmlCommentContent().Visit a parse tree produced byJavadocCommentsParser.htmlContent().Visit a parse tree produced byJavadocCommentsParser.htmlElement().Visit a parse tree produced byJavadocCommentsParser.htmlTagEnd().Visit a parse tree produced byJavadocCommentsParser.htmlTagStart().Visit a parse tree produced byJavadocCommentsParser.indexInlineTag().Visit a parse tree produced byJavadocCommentsParser.inheritDocInlineTag().Visit a parse tree produced byJavadocCommentsParser.inlineTag().Visit a parse tree produced byJavadocCommentsParser.inlineTagContent().Visit a parse tree produced byJavadocCommentsParser.javadoc().Visit a parse tree produced byJavadocCommentsParser.linkInlineTag().Visit a parse tree produced byJavadocCommentsParser.linkPlainInlineTag().Visit a parse tree produced byJavadocCommentsParser.literalInlineTag().Visit a parse tree produced byJavadocCommentsParser.mainDescription().Visit a parse tree produced byJavadocCommentsParser.memberReference().Visit a parse tree produced byJavadocCommentsParser.nonTightElement().Visit a parse tree produced byJavadocCommentsParser.nonTightHtmlContent().Visit a parse tree produced byJavadocCommentsParser.parameterTag().Visit a parse tree produced byJavadocCommentsParser.parameterTypeList().Visit a parse tree produced byJavadocCommentsParser.providesTag().Visit a parse tree produced byJavadocCommentsParser.qualifiedName().Visit a parse tree produced byJavadocCommentsParser.reference().Visit a parse tree produced byJavadocCommentsParser.returnInlineTag().Visit a parse tree produced byJavadocCommentsParser.returnTag().Visit a parse tree produced byJavadocCommentsParser.seeTag().Visit a parse tree produced byJavadocCommentsParser.selfClosingElement().Visit a parse tree produced byJavadocCommentsParser.serialDataTag().Visit a parse tree produced byJavadocCommentsParser.serialFieldTag().Visit a parse tree produced byJavadocCommentsParser.serialTag().Visit a parse tree produced byJavadocCommentsParser.sinceTag().Visit a parse tree produced byJavadocCommentsParser.snippetAttribute().Visit a parse tree produced byJavadocCommentsParser.snippetBody().Visit a parse tree produced byJavadocCommentsParser.snippetInlineTag().Visit a parse tree produced byJavadocCommentsParser.summaryInlineTag().Visit a parse tree produced byJavadocCommentsParser.systemPropertyInlineTag().Visit a parse tree produced byJavadocCommentsParser.throwsTag().Visit a parse tree produced byJavadocCommentsParser.tightElement().Visit a parse tree produced byJavadocCommentsParser.typeArgument().Visit a parse tree produced byJavadocCommentsParser.typeArguments().Visit a parse tree produced byJavadocCommentsParser.typeName().Visit a parse tree produced byJavadocCommentsParser.usesTag().Visit a parse tree produced byJavadocCommentsParser.valueInlineTag().Visit a parse tree produced byJavadocCommentsParser.versionTag().Visit a parse tree produced byJavadocCommentsParser.voidElement().Methods inherited from class org.antlr.v4.runtime.tree.AbstractParseTreeVisitor
aggregateResult, defaultResult, shouldVisitNextChild, visit, visitChildren, visitErrorNode, visitTerminalMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.antlr.v4.runtime.tree.ParseTreeVisitor
visit, visitChildren, visitErrorNode, visitTerminal
-
Field Details
-
JAVADOC_TAG_TYPES
-
blockCommentLineNumber
private final int blockCommentLineNumberLine number of the Block comment AST that is being parsed. -
javadocColumnNumber
private final int javadocColumnNumberJavadoc Ident. -
tokens
private final org.antlr.v4.runtime.BufferedTokenStream tokensToken stream to check for hidden tokens. -
processedTokenIndices
-
accumulator
Accumulator for consecutive TEXT tokens. This is used to merge multiple TEXT tokens into a single node. -
firstNonTightHtmlTag
The first non-tight HTML tag encountered in the Javadoc comment, if any.
-
-
Constructor Details
-
JavadocCommentsAstVisitor
public JavadocCommentsAstVisitor(org.antlr.v4.runtime.CommonTokenStream tokens, int blockCommentLineNumber, int javadocColumnNumber) Constructs a JavaAstVisitor with given token stream, line number, and column number.- Parameters:
tokens- the token stream to check for hidden tokensblockCommentLineNumber- the line number of the block comment being parsedjavadocColumnNumber- the column number of the javadoc indent
-
-
Method Details
-
visitJavadoc
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.javadoc().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitJavadocin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitJavadocin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitMainDescription
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.mainDescription().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitMainDescriptionin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitMainDescriptionin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitBlockTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.blockTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitBlockTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitBlockTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitAuthorTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.authorTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitAuthorTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitAuthorTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitDeprecatedTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.deprecatedTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitDeprecatedTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitDeprecatedTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitReturnTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.returnTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitReturnTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitReturnTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitParameterTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.parameterTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitParameterTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitParameterTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitThrowsTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.throwsTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitThrowsTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitThrowsTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitExceptionTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.exceptionTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitExceptionTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitExceptionTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitSinceTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.sinceTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitSinceTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitSinceTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitVersionTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.versionTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitVersionTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitVersionTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitSeeTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.seeTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitSeeTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitSeeTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitHiddenTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.hiddenTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitHiddenTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitHiddenTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitUsesTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.usesTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitUsesTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitUsesTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitProvidesTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.providesTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitProvidesTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitProvidesTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitSerialTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.serialTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitSerialTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitSerialTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitSerialDataTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.serialDataTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitSerialDataTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitSerialDataTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitSerialFieldTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.serialFieldTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitSerialFieldTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitSerialFieldTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitCustomBlockTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.customBlockTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitCustomBlockTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitCustomBlockTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitInlineTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.inlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitInlineTagContent
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.inlineTagContent().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitInlineTagContentin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitInlineTagContentin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitCodeInlineTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.codeInlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitCodeInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitCodeInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitLinkPlainInlineTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.linkPlainInlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitLinkPlainInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitLinkPlainInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitLinkInlineTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.linkInlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitLinkInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitLinkInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitValueInlineTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.valueInlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitValueInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitValueInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitInheritDocInlineTag
public JavadocNodeImpl visitInheritDocInlineTag(JavadocCommentsParser.InheritDocInlineTagContext ctx) Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.inheritDocInlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitInheritDocInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitInheritDocInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitSummaryInlineTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.summaryInlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitSummaryInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitSummaryInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitSystemPropertyInlineTag
public JavadocNodeImpl visitSystemPropertyInlineTag(JavadocCommentsParser.SystemPropertyInlineTagContext ctx) Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.systemPropertyInlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitSystemPropertyInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitSystemPropertyInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitIndexInlineTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.indexInlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitIndexInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitIndexInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitReturnInlineTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.returnInlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitReturnInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitReturnInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitLiteralInlineTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.literalInlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitLiteralInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitLiteralInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitSnippetInlineTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.snippetInlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitSnippetInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitSnippetInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitCustomInlineTag
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.customInlineTag().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitCustomInlineTagin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitCustomInlineTagin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitReference
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.reference().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitReferencein interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitReferencein classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitTypeName
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.typeName().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitTypeNamein interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitTypeNamein classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitQualifiedName
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.qualifiedName().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitQualifiedNamein interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitQualifiedNamein classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitTypeArguments
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.typeArguments().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitTypeArgumentsin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitTypeArgumentsin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitTypeArgument
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.typeArgument().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitTypeArgumentin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitTypeArgumentin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitMemberReference
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.memberReference().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitMemberReferencein interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitMemberReferencein classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitParameterTypeList
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.parameterTypeList().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitParameterTypeListin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitParameterTypeListin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitDescription
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.description().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitDescriptionin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitDescriptionin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitSnippetAttribute
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.snippetAttribute().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitSnippetAttributein interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitSnippetAttributein classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitSnippetBody
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.snippetBody().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitSnippetBodyin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitSnippetBodyin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitHtmlElement
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.htmlElement().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitHtmlElementin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitHtmlElementin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitVoidElement
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.voidElement().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitVoidElementin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitVoidElementin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitTightElement
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.tightElement().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitTightElementin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitTightElementin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitNonTightElement
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.nonTightElement().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitNonTightElementin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitNonTightElementin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitSelfClosingElement
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.selfClosingElement().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitSelfClosingElementin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitSelfClosingElementin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitHtmlTagStart
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.htmlTagStart().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitHtmlTagStartin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitHtmlTagStartin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitHtmlTagEnd
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.htmlTagEnd().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitHtmlTagEndin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitHtmlTagEndin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitHtmlAttribute
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.htmlAttribute().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitHtmlAttributein interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitHtmlAttributein classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitHtmlContent
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.htmlContent().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitHtmlContentin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitHtmlContentin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitNonTightHtmlContent
public JavadocNodeImpl visitNonTightHtmlContent(JavadocCommentsParser.NonTightHtmlContentContext ctx) Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.nonTightHtmlContent().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitNonTightHtmlContentin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitNonTightHtmlContentin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitHtmlComment
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.htmlComment().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitHtmlCommentin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitHtmlCommentin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
visitHtmlCommentContent
Description copied from class:JavadocCommentsParserBaseVisitorVisit a parse tree produced byJavadocCommentsParser.htmlCommentContent().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(RuleNode)onctx.- Specified by:
visitHtmlCommentContentin interfaceJavadocCommentsParserVisitor<JavadocNodeImpl>- Overrides:
visitHtmlCommentContentin classJavadocCommentsParserBaseVisitor<JavadocNodeImpl>- Parameters:
ctx- the parse tree- Returns:
- the visitor result
-
buildImaginaryNode
private JavadocNodeImpl buildImaginaryNode(int tokenType, org.antlr.v4.runtime.ParserRuleContext ctx) Creates an imaginary JavadocNodeImpl of the given token type and processes all children of the given ParserRuleContext.- Parameters:
tokenType- the token type of this JavadocNodeImplctx- the ParserRuleContext whose children are to be processed- Returns:
- new JavadocNodeImpl of given type with processed children
-
flattenedTree
Builds the AST for a particular node, then returns a "flattened" tree of siblings.- Parameters:
ctx- the ParserRuleContext to base tree on- Returns:
- flattened DetailAstImpl
-
processChildren
private void processChildren(JavadocNodeImpl parent, List<? extends org.antlr.v4.runtime.tree.ParseTree> children) Adds all the children from the given ParseTree or ParserRuleContext list to the parent JavadocNodeImpl.- Parameters:
parent- the JavadocNodeImpl to add children tochildren- the list of children to add
-
isTextToken
private static boolean isTextToken(org.antlr.v4.runtime.Token token) Checks whether a token is a Javadoc text token.- Parameters:
token- the token to check- Returns:
- true if the token is a text token, false otherwise
-
addHiddenTokensToTheLeft
Adds hidden tokens to the left of the given token to the parent node. Ensures text accumulation is flushed before adding hidden tokens. Hidden tokens are only added once per unique token index.- Parameters:
token- the token whose hidden tokens should be addedparent- the parent node to which hidden tokens are added
-
create
Creates a JavadocNodeImpl from the given token.- Parameters:
token- the token to create the JavadocNodeImpl from- Returns:
- a new JavadocNodeImpl initialized with the token
-
isJavadocTag
private static boolean isJavadocTag(int type) Checks if the given token type is a Javadoc tag.- Parameters:
type- the token type to check- Returns:
- true if the token type is a Javadoc tag, false otherwise
-
createImaginary
Create a JavadocNodeImpl from a given token and token type. This method should be used for imaginary nodes only, i.e. 'JAVADOC_INLINE_TAG -> JAVADOC_INLINE_TAG', where the text on the RHS matches the text on the LHS.- Parameters:
tokenType- the token type of this JavadocNodeImpl- Returns:
- new JavadocNodeImpl of given type
-
getFirstNonTightHtmlTag
Returns the first non-tight HTML tag encountered in the Javadoc comment, if any.- Returns:
- the first non-tight HTML tag, or null if none was found
-