Skip to content

Commit

Permalink
Issue checkstyle#3810: Replaced singletonTag in nested html rules in …
Browse files Browse the repository at this point in the history
…javadoc grammar with singletonElement
  • Loading branch information
voidfist committed Jul 20, 2017
1 parent 538e7a6 commit 4c932dc
Show file tree
Hide file tree
Showing 5 changed files with 574 additions and 93 deletions.
Expand Up @@ -135,7 +135,7 @@ pTagOpen: OPEN P_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK | WS)* CL
pTagClose: OPEN SLASH P_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
paragraph: pTagOpen
(htmlTag
| singletonTag
| singletonElement
| li
| tr
| td
Expand Down Expand Up @@ -177,7 +177,7 @@ liTagOpen: OPEN LI_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK | WS)*
liTagClose: OPEN SLASH LI_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
li: liTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| tr
| td
Expand Down Expand Up @@ -219,7 +219,7 @@ trTagOpen: OPEN TR_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK | WS)*
trTagClose: OPEN SLASH TR_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
tr: trTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| td
Expand Down Expand Up @@ -261,7 +261,7 @@ tdTagOpen: OPEN TD_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK | WS)*
tdTagClose: OPEN SLASH TD_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
td: tdTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| tr
Expand Down Expand Up @@ -303,7 +303,7 @@ thTagOpen: OPEN TH_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK | WS)*
thTagClose: OPEN SLASH TH_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
th: thTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| tr
Expand Down Expand Up @@ -345,7 +345,7 @@ bodyTagOpen: OPEN BODY_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK | W
bodyTagClose: OPEN SLASH BODY_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
body: bodyTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| tr
Expand Down Expand Up @@ -387,7 +387,7 @@ colgroupTagOpen: OPEN COLGROUP_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTE
colgroupTagClose: OPEN SLASH COLGROUP_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
colgroup: colgroupTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| tr
Expand Down Expand Up @@ -429,7 +429,7 @@ ddTagOpen: OPEN DD_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK | WS)*
ddTagClose: OPEN SLASH DD_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
dd: ddTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| tr
Expand Down Expand Up @@ -471,7 +471,7 @@ dtTagOpen: OPEN DT_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK | WS)*
dtTagClose: OPEN SLASH DT_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
dt: dtTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| tr
Expand Down Expand Up @@ -513,7 +513,7 @@ headTagOpen: OPEN HEAD_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK | W
headTagClose: OPEN SLASH HEAD_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
head: headTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| tr
Expand Down Expand Up @@ -555,7 +555,7 @@ htmlTagOpen: OPEN HTML_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK | W
htmlTagClose: OPEN SLASH HTML_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
html: htmlTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| tr
Expand Down Expand Up @@ -597,7 +597,7 @@ optionTagOpen: OPEN OPTION_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK
optionTagClose: OPEN SLASH OPTION_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
option: optionTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| tr
Expand Down Expand Up @@ -639,7 +639,7 @@ tbodyTagOpen: OPEN TBODY_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK |
tbodyTagClose: OPEN SLASH TBODY_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
tbody: tbodyTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| tr
Expand Down Expand Up @@ -681,7 +681,7 @@ tfootTagOpen: OPEN TFOOT_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK |
tfootTagClose: OPEN SLASH TFOOT_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
tfoot: tfootTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| tr
Expand Down Expand Up @@ -723,7 +723,7 @@ theadTagOpen: OPEN THEAD_HTML_TAG_NAME (attribute | NEWLINE | LEADING_ASTERISK |
theadTagClose: OPEN SLASH THEAD_HTML_TAG_NAME (NEWLINE | LEADING_ASTERISK | WS)* CLOSE;
thead: theadTagOpen
(htmlTag
| singletonTag
| singletonElement
| paragraph
| li
| tr
Expand Down
Expand Up @@ -250,4 +250,10 @@ public void testJavadocWithCrAsNewline() throws Exception {
verifyJavadocTree(getPath("expectedJavadocWithCrAsNewlineAst.txt"),
getPath("InputJavadocWithCrAsNewline.javadoc"));
}

@Test
public void testNestingWithSingletonElement() throws Exception {
verifyJavadocTree(getHtmlPath("expectedNestingWithSingletonElementAst.txt"),
getHtmlPath("InputNestingWithSingletonElement.javadoc"));
}
}
@@ -0,0 +1,19 @@
* <p> paragraph with a <br>singletonElement. <hr> And it contains another one. </p>
* <li> List with singletonElement
* <param name=movie value="~/imitation game.mp4"> <param name=allowfullscreen value=true> </li>
*
* <tr> tr with <base href="www.something.com"> singletonElement </tr>
* <td> td with singletonElement <br/> </td>
* <th> th with <base/> singletonElement </th>
* <body> body with <br/> singletonElement </body>
* <colgroup><col><col><col></colgroup>
* <dd> dd with <hr> singletonElement </dd>
* <dt> dt with <img src="~/singletonElement.jpg" alt="" width="100" height="150"/> singletonElement </dt>
* <head> head with <img src="~/singletonElement.jpg" alt="" width="100" height="150">
* singletonElement </head>
*
* <html> <bR> <Br> <BR> <Br/> <BR/> <bR/> </html>
* <option> <INPut/> </option>
* <tbody> <input/> <br> </tbody>
* <thead> <br> </thead>
* <tfoot> <AREA ALT="alt" COORDS="100,0,200,50" HREF="/href/"> </tfoot>
@@ -1,81 +1,76 @@
JAVADOC -> JAVADOC [0:0]
|--HTML_ELEMENT -> HTML_ELEMENT [0:0]
| `--P_TAG_OPEN -> P_TAG_OPEN [0:0]
| |--OPEN -> < [0:0]
| |--P_HTML_TAG_NAME -> P [0:1]
| `--CLOSE -> > [0:2]
|--NEWLINE -> \r\n [0:3]
|--HTML_ELEMENT -> HTML_ELEMENT [1:0]
| `--SINGLETON_ELEMENT -> SINGLETON_ELEMENT [1:0]
| `--BR_TAG -> BR_TAG [1:0]
| |--OPEN -> < [1:0]
| |--BR_HTML_TAG_NAME -> br [1:1]
| `--CLOSE -> > [1:3]
|--NEWLINE -> \r\n [1:4]
|--HTML_ELEMENT -> HTML_ELEMENT [2:0]
| `--SINGLETON_ELEMENT -> SINGLETON_ELEMENT [2:0]
| `--BR_TAG -> BR_TAG [2:0]
| |--OPEN -> < [2:0]
| |--BR_HTML_TAG_NAME -> br [2:1]
| `--SLASH_CLOSE -> /> [2:3]
|--NEWLINE -> \r\n [2:5]
|--HTML_ELEMENT -> HTML_ELEMENT [3:0]
| `--SINGLETON_ELEMENT -> SINGLETON_ELEMENT [3:0]
| `--BR_TAG -> BR_TAG [3:0]
| |--OPEN -> < [3:0]
| |--BR_HTML_TAG_NAME -> BR [3:1]
| `--CLOSE -> > [3:3]
|--NEWLINE -> \r\n [3:4]
|--HTML_ELEMENT -> HTML_ELEMENT [4:0]
| `--SINGLETON_ELEMENT -> SINGLETON_ELEMENT [4:0]
| `--BR_TAG -> BR_TAG [4:0]
| |--OPEN -> < [4:0]
| |--BR_HTML_TAG_NAME -> BR [4:1]
| `--SLASH_CLOSE -> /> [4:3]
|--NEWLINE -> \r\n [4:5]
|--HTML_ELEMENT -> HTML_ELEMENT [5:0]
| `--HTML_TAG -> HTML_TAG [5:0]
| |--HTML_ELEMENT_OPEN -> HTML_ELEMENT_OPEN [5:0]
| | |--OPEN -> < [5:0]
| | |--HTML_TAG_NAME -> TABLE [5:1]
| | `--CLOSE -> > [5:6]
| |--NEWLINE -> \r\n [5:7]
| |--TEXT -> \t [6:0]
| |--HTML_ELEMENT -> HTML_ELEMENT [6:1]
| | `--TR -> TR [6:1]
| | |--TR_TAG_OPEN -> TR_TAG_OPEN [6:1]
| | | |--OPEN -> < [6:1]
| | | |--TR_HTML_TAG_NAME -> tr [6:2]
| | | `--CLOSE -> > [6:4]
| | `--TR_TAG_CLOSE -> TR_TAG_CLOSE [6:5]
| | |--OPEN -> < [6:5]
| | |--SLASH -> / [6:6]
| | |--TR_HTML_TAG_NAME -> TR [6:7]
| | `--CLOSE -> > [6:9]
| |--NEWLINE -> \r\n [6:10]
| |--TEXT -> \t [7:0]
| |--HTML_ELEMENT -> HTML_ELEMENT [7:1]
| | `--TR -> TR [7:1]
| | |--TR_TAG_OPEN -> TR_TAG_OPEN [7:1]
| | | |--OPEN -> < [7:1]
| | | |--TR_HTML_TAG_NAME -> TR [7:2]
| | | `--CLOSE -> > [7:4]
| | `--TR_TAG_CLOSE -> TR_TAG_CLOSE [7:5]
| | |--OPEN -> < [7:5]
| | |--SLASH -> / [7:6]
| | |--TR_HTML_TAG_NAME -> tr [7:7]
| | `--CLOSE -> > [7:9]
| |--NEWLINE -> \r\n [7:10]
| `--HTML_ELEMENT_CLOSE -> HTML_ELEMENT_CLOSE [8:0]
| |--OPEN -> < [8:0]
| |--SLASH -> / [8:1]
| |--HTML_TAG_NAME -> table [8:2]
| `--CLOSE -> > [8:7]
|--NEWLINE -> \r\n [8:8]
|--HTML_ELEMENT -> HTML_ELEMENT [9:0]
| `--P_TAG_CLOSE -> P_TAG_CLOSE [9:0]
| |--OPEN -> < [9:0]
| |--SLASH -> / [9:1]
| |--P_HTML_TAG_NAME -> p [9:2]
| `--CLOSE -> > [9:3]
| `--PARAGRAPH -> PARAGRAPH [0:0]
| |--P_TAG_OPEN -> P_TAG_OPEN [0:0]
| | |--OPEN -> < [0:0]
| | |--P_HTML_TAG_NAME -> P [0:1]
| | `--CLOSE -> > [0:2]
| |--NEWLINE -> \r\n [0:3]
| |--SINGLETON_ELEMENT -> SINGLETON_ELEMENT [1:0]
| | `--BR_TAG -> BR_TAG [1:0]
| | |--OPEN -> < [1:0]
| | |--BR_HTML_TAG_NAME -> br [1:1]
| | `--CLOSE -> > [1:3]
| |--NEWLINE -> \r\n [1:4]
| |--SINGLETON_ELEMENT -> SINGLETON_ELEMENT [2:0]
| | `--BR_TAG -> BR_TAG [2:0]
| | |--OPEN -> < [2:0]
| | |--BR_HTML_TAG_NAME -> br [2:1]
| | `--SLASH_CLOSE -> /> [2:3]
| |--NEWLINE -> \r\n [2:5]
| |--SINGLETON_ELEMENT -> SINGLETON_ELEMENT [3:0]
| | `--BR_TAG -> BR_TAG [3:0]
| | |--OPEN -> < [3:0]
| | |--BR_HTML_TAG_NAME -> BR [3:1]
| | `--CLOSE -> > [3:3]
| |--NEWLINE -> \r\n [3:4]
| |--SINGLETON_ELEMENT -> SINGLETON_ELEMENT [4:0]
| | `--BR_TAG -> BR_TAG [4:0]
| | |--OPEN -> < [4:0]
| | |--BR_HTML_TAG_NAME -> BR [4:1]
| | `--SLASH_CLOSE -> /> [4:3]
| |--NEWLINE -> \r\n [4:5]
| |--HTML_TAG -> HTML_TAG [5:0]
| | |--HTML_ELEMENT_OPEN -> HTML_ELEMENT_OPEN [5:0]
| | | |--OPEN -> < [5:0]
| | | |--HTML_TAG_NAME -> TABLE [5:1]
| | | `--CLOSE -> > [5:6]
| | |--NEWLINE -> \r\n [5:7]
| | |--TEXT -> \t [6:0]
| | |--HTML_ELEMENT -> HTML_ELEMENT [6:1]
| | | `--TR -> TR [6:1]
| | | |--TR_TAG_OPEN -> TR_TAG_OPEN [6:1]
| | | | |--OPEN -> < [6:1]
| | | | |--TR_HTML_TAG_NAME -> tr [6:2]
| | | | `--CLOSE -> > [6:4]
| | | `--TR_TAG_CLOSE -> TR_TAG_CLOSE [6:5]
| | | |--OPEN -> < [6:5]
| | | |--SLASH -> / [6:6]
| | | |--TR_HTML_TAG_NAME -> TR [6:7]
| | | `--CLOSE -> > [6:9]
| | |--NEWLINE -> \r\n [6:10]
| | |--TEXT -> \t [7:0]
| | |--HTML_ELEMENT -> HTML_ELEMENT [7:1]
| | | `--TR -> TR [7:1]
| | | |--TR_TAG_OPEN -> TR_TAG_OPEN [7:1]
| | | | |--OPEN -> < [7:1]
| | | | |--TR_HTML_TAG_NAME -> TR [7:2]
| | | | `--CLOSE -> > [7:4]
| | | `--TR_TAG_CLOSE -> TR_TAG_CLOSE [7:5]
| | | |--OPEN -> < [7:5]
| | | |--SLASH -> / [7:6]
| | | |--TR_HTML_TAG_NAME -> tr [7:7]
| | | `--CLOSE -> > [7:9]
| | |--NEWLINE -> \r\n [7:10]
| | `--HTML_ELEMENT_CLOSE -> HTML_ELEMENT_CLOSE [8:0]
| | |--OPEN -> < [8:0]
| | |--SLASH -> / [8:1]
| | |--HTML_TAG_NAME -> table [8:2]
| | `--CLOSE -> > [8:7]
| |--NEWLINE -> \r\n [8:8]
| `--P_TAG_CLOSE -> P_TAG_CLOSE [9:0]
| |--OPEN -> < [9:0]
| |--SLASH -> / [9:1]
| |--P_HTML_TAG_NAME -> p [9:2]
| `--CLOSE -> > [9:3]
`--EOF -> <EOF> [9:4]

0 comments on commit 4c932dc

Please sign in to comment.