Search in sources :

Example 31 with ParseTree

use of org.antlr.v4.runtime.tree.ParseTree in project checkstyle by checkstyle.

the class ParseTreeBuilder method treeDocRootInheritDoc.

public static ParseTree treeDocRootInheritDoc() {
    JavadocContext javadocContext0 = new JavadocContext(null, 0);
    CommonToken newline0 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline0);
    CommonToken leadingAsterisk0 = new CommonToken(JavadocTokenTypes.LEADING_ASTERISK, " *");
    javadocContext0.addChild(leadingAsterisk0);
    TextContext textContext0 = new TextContext(javadocContext0, 0);
    CommonToken ws0 = new CommonToken(JavadocTokenTypes.WS, " ");
    textContext0.addChild(ws0);
    javadocContext0.addChild(textContext0);
    JavadocInlineTagContext javadocInlineTagContext0 = new JavadocInlineTagContext(javadocContext0, 0);
    CommonToken javadocInlineTagStart0 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_START, "{");
    javadocInlineTagContext0.addChild(javadocInlineTagStart0);
    CommonToken docRootLiteral0 = new CommonToken(JavadocTokenTypes.DOC_ROOT_LITERAL, "@docRoot");
    javadocInlineTagContext0.addChild(docRootLiteral0);
    CommonToken javadocInlineTagEnd0 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_END, "}");
    javadocInlineTagContext0.addChild(javadocInlineTagEnd0);
    javadocContext0.addChild(javadocInlineTagContext0);
    CommonToken newline1 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline1);
    CommonToken leadingAsterisk1 = new CommonToken(JavadocTokenTypes.LEADING_ASTERISK, " *");
    javadocContext0.addChild(leadingAsterisk1);
    TextContext textContext1 = new TextContext(javadocContext0, 0);
    CommonToken ws1 = new CommonToken(JavadocTokenTypes.WS, " ");
    textContext1.addChild(ws1);
    javadocContext0.addChild(textContext1);
    JavadocInlineTagContext javadocInlineTagContext1 = new JavadocInlineTagContext(javadocContext0, 0);
    CommonToken javadocInlineTagStart1 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_START, "{");
    javadocInlineTagContext1.addChild(javadocInlineTagStart1);
    CommonToken docRootLiteral1 = new CommonToken(JavadocTokenTypes.DOC_ROOT_LITERAL, "@docRoot");
    javadocInlineTagContext1.addChild(docRootLiteral1);
    CommonToken ws2 = new CommonToken(JavadocTokenTypes.WS, " ");
    javadocInlineTagContext1.addChild(ws2);
    CommonToken javadocInlineTagEnd1 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_END, "}");
    javadocInlineTagContext1.addChild(javadocInlineTagEnd1);
    javadocContext0.addChild(javadocInlineTagContext1);
    CommonToken newline2 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline2);
    CommonToken leadingAsterisk2 = new CommonToken(JavadocTokenTypes.LEADING_ASTERISK, " *");
    javadocContext0.addChild(leadingAsterisk2);
    TextContext textContext2 = new TextContext(javadocContext0, 0);
    CommonToken ws3 = new CommonToken(JavadocTokenTypes.WS, " ");
    textContext2.addChild(ws3);
    javadocContext0.addChild(textContext2);
    JavadocInlineTagContext javadocInlineTagContext2 = new JavadocInlineTagContext(javadocContext0, 0);
    CommonToken javadocInlineTagStart2 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_START, "{");
    javadocInlineTagContext2.addChild(javadocInlineTagStart2);
    CommonToken docRootLiteral2 = new CommonToken(JavadocTokenTypes.DOC_ROOT_LITERAL, "@docRoot");
    javadocInlineTagContext2.addChild(docRootLiteral2);
    CommonToken newline3 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocInlineTagContext2.addChild(newline3);
    CommonToken leadingAsterisk3 = new CommonToken(JavadocTokenTypes.LEADING_ASTERISK, " *");
    javadocInlineTagContext2.addChild(leadingAsterisk3);
    CommonToken ws4 = new CommonToken(JavadocTokenTypes.WS, " ");
    javadocInlineTagContext2.addChild(ws4);
    CommonToken javadocInlineTagEnd2 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_END, "}");
    javadocInlineTagContext2.addChild(javadocInlineTagEnd2);
    javadocContext0.addChild(javadocInlineTagContext2);
    CommonToken newline4 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline4);
    CommonToken leadingAsterisk4 = new CommonToken(JavadocTokenTypes.LEADING_ASTERISK, " *");
    javadocContext0.addChild(leadingAsterisk4);
    TextContext textContext3 = new TextContext(javadocContext0, 0);
    CommonToken ws5 = new CommonToken(JavadocTokenTypes.WS, " ");
    textContext3.addChild(ws5);
    javadocContext0.addChild(textContext3);
    JavadocInlineTagContext javadocInlineTagContext3 = new JavadocInlineTagContext(javadocContext0, 0);
    CommonToken javadocInlineTagStart3 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_START, "{");
    javadocInlineTagContext3.addChild(javadocInlineTagStart3);
    CommonToken inheritDocLiteral0 = new CommonToken(JavadocTokenTypes.INHERIT_DOC_LITERAL, "@inheritDoc");
    javadocInlineTagContext3.addChild(inheritDocLiteral0);
    CommonToken javadocInlineTagEnd3 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_END, "}");
    javadocInlineTagContext3.addChild(javadocInlineTagEnd3);
    javadocContext0.addChild(javadocInlineTagContext3);
    CommonToken newline5 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline5);
    CommonToken leadingAsterisk5 = new CommonToken(JavadocTokenTypes.LEADING_ASTERISK, " *");
    javadocContext0.addChild(leadingAsterisk5);
    TextContext textContext4 = new TextContext(javadocContext0, 0);
    CommonToken ws6 = new CommonToken(JavadocTokenTypes.WS, " ");
    textContext4.addChild(ws6);
    javadocContext0.addChild(textContext4);
    JavadocInlineTagContext javadocInlineTagContext4 = new JavadocInlineTagContext(javadocContext0, 0);
    CommonToken javadocInlineTagStart4 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_START, "{");
    javadocInlineTagContext4.addChild(javadocInlineTagStart4);
    CommonToken inheritDocLiteral1 = new CommonToken(JavadocTokenTypes.INHERIT_DOC_LITERAL, "@inheritDoc");
    javadocInlineTagContext4.addChild(inheritDocLiteral1);
    CommonToken ws7 = new CommonToken(JavadocTokenTypes.WS, " ");
    javadocInlineTagContext4.addChild(ws7);
    CommonToken javadocInlineTagEnd4 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_END, "}");
    javadocInlineTagContext4.addChild(javadocInlineTagEnd4);
    javadocContext0.addChild(javadocInlineTagContext4);
    CommonToken newline6 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline6);
    CommonToken leadingAsterisk6 = new CommonToken(JavadocTokenTypes.LEADING_ASTERISK, " *");
    javadocContext0.addChild(leadingAsterisk6);
    TextContext textContext5 = new TextContext(javadocContext0, 0);
    CommonToken ws8 = new CommonToken(JavadocTokenTypes.WS, " ");
    textContext5.addChild(ws8);
    javadocContext0.addChild(textContext5);
    JavadocInlineTagContext javadocInlineTagContext5 = new JavadocInlineTagContext(javadocContext0, 0);
    CommonToken javadocInlineTagStart5 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_START, "{");
    javadocInlineTagContext5.addChild(javadocInlineTagStart5);
    CommonToken inheritDocLiteral2 = new CommonToken(JavadocTokenTypes.INHERIT_DOC_LITERAL, "@inheritDoc");
    javadocInlineTagContext5.addChild(inheritDocLiteral2);
    CommonToken newline7 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocInlineTagContext5.addChild(newline7);
    CommonToken leadingAsterisk7 = new CommonToken(JavadocTokenTypes.LEADING_ASTERISK, " *");
    javadocInlineTagContext5.addChild(leadingAsterisk7);
    CommonToken ws9 = new CommonToken(JavadocTokenTypes.WS, " ");
    javadocInlineTagContext5.addChild(ws9);
    CommonToken javadocInlineTagEnd5 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_END, "}");
    javadocInlineTagContext5.addChild(javadocInlineTagEnd5);
    javadocContext0.addChild(javadocInlineTagContext5);
    CommonToken newline8 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline8);
    TextContext textContext6 = new TextContext(javadocContext0, 0);
    CommonToken ws10 = new CommonToken(JavadocTokenTypes.WS, " ");
    textContext6.addChild(ws10);
    javadocContext0.addChild(textContext6);
    CommonToken eof0 = new CommonToken(JavadocTokenTypes.EOF, "<EOF>");
    javadocContext0.addChild(eof0);
    return javadocContext0;
}
Also used : TextContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.TextContext) JavadocContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.JavadocContext) JavadocInlineTagContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.JavadocInlineTagContext) CommonToken(org.antlr.v4.runtime.CommonToken)

Example 32 with ParseTree

use of org.antlr.v4.runtime.tree.ParseTree in project checkstyle by checkstyle.

the class ParseTreeBuilder method treeDollarInLink.

public static ParseTree treeDollarInLink() {
    JavadocContext javadocContext0 = new JavadocContext(null, 0);
    JavadocInlineTagContext javadocInlineTagContext0 = new JavadocInlineTagContext(javadocContext0, 0);
    CommonToken javadocInlineTagStart0 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_START, "{");
    javadocInlineTagContext0.addChild(javadocInlineTagStart0);
    CommonToken linkLiteral0 = new CommonToken(JavadocTokenTypes.LINK_LITERAL, "@link");
    javadocInlineTagContext0.addChild(linkLiteral0);
    CommonToken ws0 = new CommonToken(JavadocTokenTypes.WS, " ");
    javadocInlineTagContext0.addChild(ws0);
    ReferenceContext referenceContext0 = new ReferenceContext(javadocInlineTagContext0, 0);
    CommonToken class0 = new CommonToken(JavadocTokenTypes.CLASS, "My$Class");
    referenceContext0.addChild(class0);
    CommonToken hash0 = new CommonToken(JavadocTokenTypes.HASH, "#");
    referenceContext0.addChild(hash0);
    CommonToken member0 = new CommonToken(JavadocTokenTypes.MEMBER, "$$simple_$Method");
    referenceContext0.addChild(member0);
    ParametersContext parametersContext0 = new ParametersContext(referenceContext0, 0);
    CommonToken leftBrace0 = new CommonToken(JavadocTokenTypes.LEFT_BRACE, "(");
    parametersContext0.addChild(leftBrace0);
    CommonToken argument0 = new CommonToken(JavadocTokenTypes.ARGUMENT, "_A78");
    parametersContext0.addChild(argument0);
    CommonToken comma0 = new CommonToken(JavadocTokenTypes.COMMA, ",");
    parametersContext0.addChild(comma0);
    CommonToken ws1 = new CommonToken(JavadocTokenTypes.WS, " ");
    parametersContext0.addChild(ws1);
    CommonToken argument1 = new CommonToken(JavadocTokenTypes.ARGUMENT, "$8$");
    parametersContext0.addChild(argument1);
    CommonToken rightBrace0 = new CommonToken(JavadocTokenTypes.RIGHT_BRACE, ")");
    parametersContext0.addChild(rightBrace0);
    referenceContext0.addChild(parametersContext0);
    javadocInlineTagContext0.addChild(referenceContext0);
    CommonToken javadocInlineTagEnd0 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_END, "}");
    javadocInlineTagContext0.addChild(javadocInlineTagEnd0);
    javadocContext0.addChild(javadocInlineTagContext0);
    CommonToken eof0 = new CommonToken(JavadocTokenTypes.EOF, "<EOF>");
    javadocContext0.addChild(eof0);
    return javadocContext0;
}
Also used : ParametersContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.ParametersContext) JavadocContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.JavadocContext) JavadocInlineTagContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.JavadocInlineTagContext) ReferenceContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.ReferenceContext) CommonToken(org.antlr.v4.runtime.CommonToken)

Example 33 with ParseTree

use of org.antlr.v4.runtime.tree.ParseTree in project checkstyle by checkstyle.

the class ParseTreeBuilder method treeMixedCaseOfHtmlTags.

public static ParseTree treeMixedCaseOfHtmlTags() {
    JavadocContext javadocContext0 = new JavadocContext(null, 0);
    HtmlElementContext htmlElementContext0 = new HtmlElementContext(javadocContext0, 0);
    PTagOpenContext pTagOpenContext0 = new PTagOpenContext(htmlElementContext0, 0);
    CommonToken open0 = new CommonToken(JavadocTokenTypes.OPEN, "<");
    pTagOpenContext0.addChild(open0);
    CommonToken pHtmlTagName0 = new CommonToken(JavadocTokenTypes.P_HTML_TAG_NAME, "P");
    pTagOpenContext0.addChild(pHtmlTagName0);
    CommonToken close0 = new CommonToken(JavadocTokenTypes.CLOSE, ">");
    pTagOpenContext0.addChild(close0);
    htmlElementContext0.addChild(pTagOpenContext0);
    javadocContext0.addChild(htmlElementContext0);
    CommonToken newline0 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline0);
    HtmlElementContext htmlElementContext1 = new HtmlElementContext(javadocContext0, 0);
    SingletonElementContext singletonElementContext0 = new SingletonElementContext(htmlElementContext1, 0);
    BrTagContext brTagContext0 = new BrTagContext(singletonElementContext0, 0);
    CommonToken open1 = new CommonToken(JavadocTokenTypes.OPEN, "<");
    brTagContext0.addChild(open1);
    CommonToken brHtmlTagName0 = new CommonToken(JavadocTokenTypes.BR_HTML_TAG_NAME, "br");
    brTagContext0.addChild(brHtmlTagName0);
    CommonToken close1 = new CommonToken(JavadocTokenTypes.CLOSE, ">");
    brTagContext0.addChild(close1);
    singletonElementContext0.addChild(brTagContext0);
    htmlElementContext1.addChild(singletonElementContext0);
    javadocContext0.addChild(htmlElementContext1);
    CommonToken newline1 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline1);
    HtmlElementContext htmlElementContext2 = new HtmlElementContext(javadocContext0, 0);
    SingletonElementContext singletonElementContext1 = new SingletonElementContext(htmlElementContext2, 0);
    BrTagContext brTagContext1 = new BrTagContext(singletonElementContext1, 0);
    CommonToken open2 = new CommonToken(JavadocTokenTypes.OPEN, "<");
    brTagContext1.addChild(open2);
    CommonToken brHtmlTagName1 = new CommonToken(JavadocTokenTypes.BR_HTML_TAG_NAME, "br");
    brTagContext1.addChild(brHtmlTagName1);
    CommonToken slashClose0 = new CommonToken(JavadocTokenTypes.SLASH_CLOSE, "/>");
    brTagContext1.addChild(slashClose0);
    singletonElementContext1.addChild(brTagContext1);
    htmlElementContext2.addChild(singletonElementContext1);
    javadocContext0.addChild(htmlElementContext2);
    CommonToken newline2 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline2);
    HtmlElementContext htmlElementContext3 = new HtmlElementContext(javadocContext0, 0);
    SingletonElementContext singletonElementContext2 = new SingletonElementContext(htmlElementContext3, 0);
    BrTagContext brTagContext2 = new BrTagContext(singletonElementContext2, 0);
    CommonToken open3 = new CommonToken(JavadocTokenTypes.OPEN, "<");
    brTagContext2.addChild(open3);
    CommonToken brHtmlTagName2 = new CommonToken(JavadocTokenTypes.BR_HTML_TAG_NAME, "BR");
    brTagContext2.addChild(brHtmlTagName2);
    CommonToken close2 = new CommonToken(JavadocTokenTypes.CLOSE, ">");
    brTagContext2.addChild(close2);
    singletonElementContext2.addChild(brTagContext2);
    htmlElementContext3.addChild(singletonElementContext2);
    javadocContext0.addChild(htmlElementContext3);
    CommonToken newline3 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline3);
    HtmlElementContext htmlElementContext4 = new HtmlElementContext(javadocContext0, 0);
    SingletonElementContext singletonElementContext3 = new SingletonElementContext(htmlElementContext4, 0);
    BrTagContext brTagContext3 = new BrTagContext(singletonElementContext3, 0);
    CommonToken open4 = new CommonToken(JavadocTokenTypes.OPEN, "<");
    brTagContext3.addChild(open4);
    CommonToken brHtmlTagName3 = new CommonToken(JavadocTokenTypes.BR_HTML_TAG_NAME, "BR");
    brTagContext3.addChild(brHtmlTagName3);
    CommonToken slashClose1 = new CommonToken(JavadocTokenTypes.SLASH_CLOSE, "/>");
    brTagContext3.addChild(slashClose1);
    singletonElementContext3.addChild(brTagContext3);
    htmlElementContext4.addChild(singletonElementContext3);
    javadocContext0.addChild(htmlElementContext4);
    CommonToken newline4 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline4);
    HtmlElementContext htmlElementContext5 = new HtmlElementContext(javadocContext0, 0);
    HtmlTagContext htmlTagContext0 = new HtmlTagContext(htmlElementContext5, 0);
    HtmlElementOpenContext htmlElementOpenContext0 = new HtmlElementOpenContext(htmlTagContext0, 0);
    CommonToken open5 = new CommonToken(JavadocTokenTypes.OPEN, "<");
    htmlElementOpenContext0.addChild(open5);
    CommonToken htmlTagName0 = new CommonToken(JavadocTokenTypes.HTML_TAG_NAME, "TABLE");
    htmlElementOpenContext0.addChild(htmlTagName0);
    CommonToken close3 = new CommonToken(JavadocTokenTypes.CLOSE, ">");
    htmlElementOpenContext0.addChild(close3);
    htmlTagContext0.addChild(htmlElementOpenContext0);
    CommonToken newline5 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    htmlTagContext0.addChild(newline5);
    TextContext textContext0 = new TextContext(htmlTagContext0, 0);
    CommonToken ws0 = new CommonToken(JavadocTokenTypes.WS, "\t");
    textContext0.addChild(ws0);
    htmlTagContext0.addChild(textContext0);
    HtmlElementContext htmlElementContext6 = new HtmlElementContext(htmlTagContext0, 0);
    TrContext trContext0 = new TrContext(htmlElementContext6, 0);
    TrTagOpenContext trTagOpenContext0 = new TrTagOpenContext(trContext0, 0);
    CommonToken open6 = new CommonToken(JavadocTokenTypes.OPEN, "<");
    trTagOpenContext0.addChild(open6);
    CommonToken trHtmlTagName0 = new CommonToken(JavadocTokenTypes.TR_HTML_TAG_NAME, "tr");
    trTagOpenContext0.addChild(trHtmlTagName0);
    CommonToken close4 = new CommonToken(JavadocTokenTypes.CLOSE, ">");
    trTagOpenContext0.addChild(close4);
    trContext0.addChild(trTagOpenContext0);
    TrTagCloseContext trTagCloseContext0 = new TrTagCloseContext(trContext0, 0);
    CommonToken open7 = new CommonToken(JavadocTokenTypes.OPEN, "<");
    trTagCloseContext0.addChild(open7);
    CommonToken slash0 = new CommonToken(JavadocTokenTypes.SLASH, "/");
    trTagCloseContext0.addChild(slash0);
    CommonToken trHtmlTagName1 = new CommonToken(JavadocTokenTypes.TR_HTML_TAG_NAME, "TR");
    trTagCloseContext0.addChild(trHtmlTagName1);
    CommonToken close5 = new CommonToken(JavadocTokenTypes.CLOSE, ">");
    trTagCloseContext0.addChild(close5);
    trContext0.addChild(trTagCloseContext0);
    htmlElementContext6.addChild(trContext0);
    htmlTagContext0.addChild(htmlElementContext6);
    CommonToken newline6 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    htmlTagContext0.addChild(newline6);
    TextContext textContext1 = new TextContext(htmlTagContext0, 0);
    CommonToken ws1 = new CommonToken(JavadocTokenTypes.WS, "\t");
    textContext1.addChild(ws1);
    htmlTagContext0.addChild(textContext1);
    HtmlElementContext htmlElementContext7 = new HtmlElementContext(htmlTagContext0, 0);
    TrContext trContext1 = new TrContext(htmlElementContext7, 0);
    TrTagOpenContext trTagOpenContext1 = new TrTagOpenContext(trContext1, 0);
    CommonToken open8 = new CommonToken(JavadocTokenTypes.OPEN, "<");
    trTagOpenContext1.addChild(open8);
    CommonToken trHtmlTagName2 = new CommonToken(JavadocTokenTypes.TR_HTML_TAG_NAME, "TR");
    trTagOpenContext1.addChild(trHtmlTagName2);
    CommonToken close6 = new CommonToken(JavadocTokenTypes.CLOSE, ">");
    trTagOpenContext1.addChild(close6);
    trContext1.addChild(trTagOpenContext1);
    TrTagCloseContext trTagCloseContext1 = new TrTagCloseContext(trContext1, 0);
    CommonToken open9 = new CommonToken(JavadocTokenTypes.OPEN, "<");
    trTagCloseContext1.addChild(open9);
    CommonToken slash1 = new CommonToken(JavadocTokenTypes.SLASH, "/");
    trTagCloseContext1.addChild(slash1);
    CommonToken trHtmlTagName3 = new CommonToken(JavadocTokenTypes.TR_HTML_TAG_NAME, "tr");
    trTagCloseContext1.addChild(trHtmlTagName3);
    CommonToken close7 = new CommonToken(JavadocTokenTypes.CLOSE, ">");
    trTagCloseContext1.addChild(close7);
    trContext1.addChild(trTagCloseContext1);
    htmlElementContext7.addChild(trContext1);
    htmlTagContext0.addChild(htmlElementContext7);
    CommonToken newline7 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    htmlTagContext0.addChild(newline7);
    HtmlElementCloseContext htmlElementCloseContext0 = new HtmlElementCloseContext(htmlTagContext0, 0);
    CommonToken open10 = new CommonToken(JavadocTokenTypes.OPEN, "<");
    htmlElementCloseContext0.addChild(open10);
    CommonToken slash2 = new CommonToken(JavadocTokenTypes.SLASH, "/");
    htmlElementCloseContext0.addChild(slash2);
    CommonToken htmlTagName1 = new CommonToken(JavadocTokenTypes.HTML_TAG_NAME, "table");
    htmlElementCloseContext0.addChild(htmlTagName1);
    CommonToken close8 = new CommonToken(JavadocTokenTypes.CLOSE, ">");
    htmlElementCloseContext0.addChild(close8);
    htmlTagContext0.addChild(htmlElementCloseContext0);
    htmlElementContext5.addChild(htmlTagContext0);
    javadocContext0.addChild(htmlElementContext5);
    CommonToken newline8 = new CommonToken(JavadocTokenTypes.NEWLINE, LINE_SEPARATOR);
    javadocContext0.addChild(newline8);
    HtmlElementContext htmlElementContext8 = new HtmlElementContext(javadocContext0, 0);
    PTagCloseContext pTagCloseContext0 = new PTagCloseContext(htmlElementContext8, 0);
    CommonToken open11 = new CommonToken(JavadocTokenTypes.OPEN, "<");
    pTagCloseContext0.addChild(open11);
    CommonToken slash3 = new CommonToken(JavadocTokenTypes.SLASH, "/");
    pTagCloseContext0.addChild(slash3);
    CommonToken pHtmlTagName1 = new CommonToken(JavadocTokenTypes.P_HTML_TAG_NAME, "p");
    pTagCloseContext0.addChild(pHtmlTagName1);
    CommonToken close9 = new CommonToken(JavadocTokenTypes.CLOSE, ">");
    pTagCloseContext0.addChild(close9);
    htmlElementContext8.addChild(pTagCloseContext0);
    javadocContext0.addChild(htmlElementContext8);
    CommonToken eof0 = new CommonToken(JavadocTokenTypes.EOF, "<EOF>");
    javadocContext0.addChild(eof0);
    return javadocContext0;
}
Also used : PTagOpenContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.PTagOpenContext) PTagCloseContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.PTagCloseContext) HtmlTagContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.HtmlTagContext) SingletonElementContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.SingletonElementContext) HtmlElementOpenContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.HtmlElementOpenContext) BrTagContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.BrTagContext) TextContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.TextContext) HtmlElementContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.HtmlElementContext) TrTagCloseContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.TrTagCloseContext) JavadocContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.JavadocContext) TrTagOpenContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.TrTagOpenContext) HtmlElementCloseContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.HtmlElementCloseContext) TrContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.TrContext) CommonToken(org.antlr.v4.runtime.CommonToken)

Example 34 with ParseTree

use of org.antlr.v4.runtime.tree.ParseTree in project checkstyle by checkstyle.

the class ParseTreeBuilder method treeJavadocTagDescriptionWithInlineTags.

public static ParseTree treeJavadocTagDescriptionWithInlineTags() {
    JavadocContext javadocContext0 = new JavadocContext(null, 0);
    JavadocTagContext javadocTagContext0 = new JavadocTagContext(javadocContext0, 0);
    CommonToken deprecatedLiteral0 = new CommonToken(JavadocTokenTypes.DEPRECATED_LITERAL, "@deprecated");
    javadocTagContext0.addChild(deprecatedLiteral0);
    CommonToken ws0 = new CommonToken(JavadocTokenTypes.WS, " ");
    javadocTagContext0.addChild(ws0);
    DescriptionContext descriptionContext0 = new DescriptionContext(javadocTagContext0, 0);
    TextContext textContext0 = new TextContext(descriptionContext0, 0);
    CommonToken char0 = new CommonToken(JavadocTokenTypes.CHAR, "u");
    textContext0.addChild(char0);
    CommonToken char1 = new CommonToken(JavadocTokenTypes.CHAR, "s");
    textContext0.addChild(char1);
    CommonToken char2 = new CommonToken(JavadocTokenTypes.CHAR, "e");
    textContext0.addChild(char2);
    CommonToken ws1 = new CommonToken(JavadocTokenTypes.WS, " ");
    textContext0.addChild(ws1);
    descriptionContext0.addChild(textContext0);
    JavadocInlineTagContext javadocInlineTagContext0 = new JavadocInlineTagContext(descriptionContext0, 0);
    CommonToken javadocInlineTagStart0 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_START, "{");
    javadocInlineTagContext0.addChild(javadocInlineTagStart0);
    CommonToken linkLiteral0 = new CommonToken(JavadocTokenTypes.LINK_LITERAL, "@link");
    javadocInlineTagContext0.addChild(linkLiteral0);
    CommonToken ws2 = new CommonToken(JavadocTokenTypes.WS, " ");
    javadocInlineTagContext0.addChild(ws2);
    ReferenceContext referenceContext0 = new ReferenceContext(javadocInlineTagContext0, 0);
    CommonToken package0 = new CommonToken(JavadocTokenTypes.PACKAGE, "java.lang");
    referenceContext0.addChild(package0);
    CommonToken dot0 = new CommonToken(JavadocTokenTypes.DOT, ".");
    referenceContext0.addChild(dot0);
    CommonToken class0 = new CommonToken(JavadocTokenTypes.CLASS, "Integer");
    referenceContext0.addChild(class0);
    javadocInlineTagContext0.addChild(referenceContext0);
    DescriptionContext descriptionContext1 = new DescriptionContext(javadocInlineTagContext0, 0);
    TextContext textContext1 = new TextContext(descriptionContext1, 0);
    CommonToken ws3 = new CommonToken(JavadocTokenTypes.WS, " ");
    textContext1.addChild(ws3);
    CommonToken char3 = new CommonToken(JavadocTokenTypes.CHAR, "I");
    textContext1.addChild(char3);
    CommonToken char4 = new CommonToken(JavadocTokenTypes.CHAR, "n");
    textContext1.addChild(char4);
    CommonToken char5 = new CommonToken(JavadocTokenTypes.CHAR, "t");
    textContext1.addChild(char5);
    CommonToken char6 = new CommonToken(JavadocTokenTypes.CHAR, "e");
    textContext1.addChild(char6);
    CommonToken char7 = new CommonToken(JavadocTokenTypes.CHAR, "g");
    textContext1.addChild(char7);
    CommonToken char8 = new CommonToken(JavadocTokenTypes.CHAR, "e");
    textContext1.addChild(char8);
    CommonToken char9 = new CommonToken(JavadocTokenTypes.CHAR, "r");
    textContext1.addChild(char9);
    descriptionContext1.addChild(textContext1);
    JavadocInlineTagContext javadocInlineTagContext1 = new JavadocInlineTagContext(descriptionContext1, 0);
    CommonToken javadocInlineTagStart1 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_START, "{");
    javadocInlineTagContext1.addChild(javadocInlineTagStart1);
    CommonToken codeLiteral0 = new CommonToken(JavadocTokenTypes.CODE_LITERAL, "@code");
    javadocInlineTagContext1.addChild(codeLiteral0);
    CommonToken ws4 = new CommonToken(JavadocTokenTypes.WS, " ");
    javadocInlineTagContext1.addChild(ws4);
    TextContext textContext2 = new TextContext(javadocInlineTagContext1, 0);
    CommonToken char10 = new CommonToken(JavadocTokenTypes.CHAR, "<");
    textContext2.addChild(char10);
    CommonToken char11 = new CommonToken(JavadocTokenTypes.CHAR, "a");
    textContext2.addChild(char11);
    CommonToken char12 = new CommonToken(JavadocTokenTypes.CHAR, ">");
    textContext2.addChild(char12);
    CommonToken char13 = new CommonToken(JavadocTokenTypes.CHAR, "W");
    textContext2.addChild(char13);
    CommonToken char14 = new CommonToken(JavadocTokenTypes.CHAR, "a");
    textContext2.addChild(char14);
    CommonToken char15 = new CommonToken(JavadocTokenTypes.CHAR, "t");
    textContext2.addChild(char15);
    CommonToken char16 = new CommonToken(JavadocTokenTypes.CHAR, "<");
    textContext2.addChild(char16);
    CommonToken char17 = new CommonToken(JavadocTokenTypes.CHAR, "/");
    textContext2.addChild(char17);
    CommonToken char18 = new CommonToken(JavadocTokenTypes.CHAR, "a");
    textContext2.addChild(char18);
    CommonToken char19 = new CommonToken(JavadocTokenTypes.CHAR, ">");
    textContext2.addChild(char19);
    javadocInlineTagContext1.addChild(textContext2);
    CommonToken javadocInlineTagEnd0 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_END, "}");
    javadocInlineTagContext1.addChild(javadocInlineTagEnd0);
    descriptionContext1.addChild(javadocInlineTagContext1);
    javadocInlineTagContext0.addChild(descriptionContext1);
    CommonToken javadocInlineTagEnd1 = new CommonToken(JavadocTokenTypes.JAVADOC_INLINE_TAG_END, "}");
    javadocInlineTagContext0.addChild(javadocInlineTagEnd1);
    descriptionContext0.addChild(javadocInlineTagContext0);
    TextContext textContext3 = new TextContext(descriptionContext0, 0);
    CommonToken ws5 = new CommonToken(JavadocTokenTypes.WS, " ");
    textContext3.addChild(ws5);
    CommonToken char20 = new CommonToken(JavadocTokenTypes.CHAR, "i");
    textContext3.addChild(char20);
    CommonToken char21 = new CommonToken(JavadocTokenTypes.CHAR, "n");
    textContext3.addChild(char21);
    CommonToken char22 = new CommonToken(JavadocTokenTypes.CHAR, "s");
    textContext3.addChild(char22);
    CommonToken char23 = new CommonToken(JavadocTokenTypes.CHAR, "t");
    textContext3.addChild(char23);
    CommonToken char24 = new CommonToken(JavadocTokenTypes.CHAR, "e");
    textContext3.addChild(char24);
    CommonToken char25 = new CommonToken(JavadocTokenTypes.CHAR, "a");
    textContext3.addChild(char25);
    CommonToken char26 = new CommonToken(JavadocTokenTypes.CHAR, "d");
    textContext3.addChild(char26);
    descriptionContext0.addChild(textContext3);
    javadocTagContext0.addChild(descriptionContext0);
    javadocContext0.addChild(javadocTagContext0);
    CommonToken eof0 = new CommonToken(JavadocTokenTypes.EOF, "<EOF>");
    javadocContext0.addChild(eof0);
    return javadocContext0;
}
Also used : TextContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.TextContext) JavadocContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.JavadocContext) JavadocInlineTagContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.JavadocInlineTagContext) ReferenceContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.ReferenceContext) JavadocTagContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.JavadocTagContext) CommonToken(org.antlr.v4.runtime.CommonToken) DescriptionContext(com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.DescriptionContext)

Example 35 with ParseTree

use of org.antlr.v4.runtime.tree.ParseTree in project checkstyle by checkstyle.

the class JavadocParseTreeTest method paramWithGeneric.

@Test
public void paramWithGeneric() throws IOException {
    final String filename = getDocPath("InputParamWithGeneric.txt");
    final ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
    final ParseTree expectedTree = ParseTreeBuilder.treeParamWithGeneric();
    compareTrees(expectedTree, generatedTree);
}
Also used : File(java.io.File) ParseTree(org.antlr.v4.runtime.tree.ParseTree) Test(org.junit.Test)

Aggregations

ParseTree (org.antlr.v4.runtime.tree.ParseTree)102 CommonToken (org.antlr.v4.runtime.CommonToken)32 Test (org.junit.Test)32 JavadocContext (com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.JavadocContext)31 TextContext (com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.TextContext)29 File (java.io.File)24 CommonTokenStream (org.antlr.v4.runtime.CommonTokenStream)24 ANTLRInputStream (org.antlr.v4.runtime.ANTLRInputStream)20 DescriptionContext (com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.DescriptionContext)15 HtmlElementContext (com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.HtmlElementContext)12 JavadocTagContext (com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.JavadocTagContext)12 JavadocInlineTagContext (com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.JavadocInlineTagContext)10 ReferenceContext (com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.ReferenceContext)10 Grammar (org.antlr.v4.tool.Grammar)10 HtmlElementCloseContext (com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.HtmlElementCloseContext)9 HtmlElementOpenContext (com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.HtmlElementOpenContext)9 HtmlTagContext (com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser.HtmlTagContext)9 ParseTreeWalker (org.antlr.v4.runtime.tree.ParseTreeWalker)8 LexerGrammar (org.antlr.v4.tool.LexerGrammar)8 BailErrorStrategy (org.antlr.v4.runtime.BailErrorStrategy)7