{"action":"created","issue":{"url":"https://api.github.com/repos/checkstyle/checkstyle/issues/3170","repository_url":"https://api.github.com/repos/checkstyle/checkstyle","labels_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/3170/labels{/name}","comments_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/3170/comments","events_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/3170/events","html_url":"https://github.com/checkstyle/checkstyle/issues/3170","id":154594843,"number":3170,"title":"Javadoc grammar: Delete child nodes in Javadoc TEXT node","user":{"login":"baratali","id":3431491,"avatar_url":"https://avatars.githubusercontent.com/u/3431491?v=3","gravatar_id":"","url":"https://api.github.com/users/baratali","html_url":"https://github.com/baratali","followers_url":"https://api.github.com/users/baratali/followers","following_url":"https://api.github.com/users/baratali/following{/other_user}","gists_url":"https://api.github.com/users/baratali/gists{/gist_id}","starred_url":"https://api.github.com/users/baratali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baratali/subscriptions","organizations_url":"https://api.github.com/users/baratali/orgs","repos_url":"https://api.github.com/users/baratali/repos","events_url":"https://api.github.com/users/baratali/events{/privacy}","received_events_url":"https://api.github.com/users/baratali/received_events","type":"User","site_admin":false},"labels":[{"id":92694823,"url":"https://api.github.com/repos/checkstyle/checkstyle/labels/antlr","name":"antlr","color":"000000","default":false},{"id":59160289,"url":"https://api.github.com/repos/checkstyle/checkstyle/labels/approved","name":"approved","color":"009800","default":false}],"state":"open","locked":false,"assignee":{"login":"rnveach","id":5427943,"avatar_url":"https://avatars.githubusercontent.com/u/5427943?v=3","gravatar_id":"","url":"https://api.github.com/users/rnveach","html_url":"https://github.com/rnveach","followers_url":"https://api.github.com/users/rnveach/followers","following_url":"https://api.github.com/users/rnveach/following{/other_user}","gists_url":"https://api.github.com/users/rnveach/gists{/gist_id}","starred_url":"https://api.github.com/users/rnveach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnveach/subscriptions","organizations_url":"https://api.github.com/users/rnveach/orgs","repos_url":"https://api.github.com/users/rnveach/repos","events_url":"https://api.github.com/users/rnveach/events{/privacy}","received_events_url":"https://api.github.com/users/rnveach/received_events","type":"User","site_admin":false},"assignees":[{"login":"rnveach","id":5427943,"avatar_url":"https://avatars.githubusercontent.com/u/5427943?v=3","gravatar_id":"","url":"https://api.github.com/users/rnveach","html_url":"https://github.com/rnveach","followers_url":"https://api.github.com/users/rnveach/followers","following_url":"https://api.github.com/users/rnveach/following{/other_user}","gists_url":"https://api.github.com/users/rnveach/gists{/gist_id}","starred_url":"https://api.github.com/users/rnveach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnveach/subscriptions","organizations_url":"https://api.github.com/users/rnveach/orgs","repos_url":"https://api.github.com/users/rnveach/repos","events_url":"https://api.github.com/users/rnveach/events{/privacy}","received_events_url":"https://api.github.com/users/rnveach/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-05-12T22:22:01Z","updated_at":"2016-11-15T14:05:33Z","closed_at":null,"body":"TEXT node has children of CHAR and WS types. Those children are redundant and make AST more complicated. I don't see any cases when such nodes can be useful.\n\nThere are two ways to solve this:\n- edit ANTLR grammar for Javadoc comments\n- OR do post-processing of the Javadoc parse tree and clear all TEXT nodes\n\n**Example**\nJavadoc comment:\n\n```\nRepresents a Javadoc tag. Provides methods to query what type of tag it is.\n@author Oliver Burn\n```\n\nAST:\n\n```\nJAVADOC -> Represents a Javadoc tag. Provides methods to query what type of tag it is.\\r\\n@author Oliver Burn<EOF> [0:0]\n|--TEXT -> Represents a Javadoc tag. Provides methods to query what type of tag it is. [0:0]\n|   |--CHAR -> R [0:0]\n|   |--CHAR -> e [0:1]\n|   |--CHAR -> p [0:2]\n|   |--CHAR -> r [0:3]\n|   |--CHAR -> e [0:4]\n|   |--CHAR -> s [0:5]\n|   |--CHAR -> e [0:6]\n|   |--CHAR -> n [0:7]\n|   |--CHAR -> t [0:8]\n|   |--CHAR -> s [0:9]\n|   |--WS ->   [0:10]\n|   |--CHAR -> a [0:11]\n|   |--WS ->   [0:12]\n|   |--CHAR -> J [0:13]\n|   |--CHAR -> a [0:14]\n|   |--CHAR -> v [0:15]\n|   |--CHAR -> a [0:16]\n|   |--CHAR -> d [0:17]\n|   |--CHAR -> o [0:18]\n|   |--CHAR -> c [0:19]\n|   |--WS ->   [0:20]\n|   |--CHAR -> t [0:21]\n|   |--CHAR -> a [0:22]\n|   |--CHAR -> g [0:23]\n|   |--CHAR -> . [0:24]\n|   |--WS ->   [0:25]\n|   |--CHAR -> P [0:26]\n|   |--CHAR -> r [0:27]\n|   |--CHAR -> o [0:28]\n|   |--CHAR -> v [0:29]\n|   |--CHAR -> i [0:30]\n|   |--CHAR -> d [0:31]\n|   |--CHAR -> e [0:32]\n|   |--CHAR -> s [0:33]\n|   |--WS ->   [0:34]\n|   |--CHAR -> m [0:35]\n|   |--CHAR -> e [0:36]\n|   |--CHAR -> t [0:37]\n|   |--CHAR -> h [0:38]\n|   |--CHAR -> o [0:39]\n|   |--CHAR -> d [0:40]\n|   |--CHAR -> s [0:41]\n|   |--WS ->   [0:42]\n|   |--CHAR -> t [0:43]\n|   |--CHAR -> o [0:44]\n|   |--WS ->   [0:45]\n|   |--CHAR -> q [0:46]\n|   |--CHAR -> u [0:47]\n|   |--CHAR -> e [0:48]\n|   |--CHAR -> r [0:49]\n|   |--CHAR -> y [0:50]\n|   |--WS ->   [0:51]\n|   |--CHAR -> w [0:52]\n|   |--CHAR -> h [0:53]\n|   |--CHAR -> a [0:54]\n|   |--CHAR -> t [0:55]\n|   |--WS ->   [0:56]\n|   |--CHAR -> t [0:57]\n|   |--CHAR -> y [0:58]\n|   |--CHAR -> p [0:59]\n|   |--CHAR -> e [0:60]\n|   |--WS ->   [0:61]\n|   |--CHAR -> o [0:62]\n|   |--CHAR -> f [0:63]\n|   |--WS ->   [0:64]\n|   |--CHAR -> t [0:65]\n|   |--CHAR -> a [0:66]\n|   |--CHAR -> g [0:67]\n|   |--WS ->   [0:68]\n|   |--CHAR -> i [0:69]\n|   |--CHAR -> t [0:70]\n|   |--WS ->   [0:71]\n|   |--CHAR -> i [0:72]\n|   |--CHAR -> s [0:73]\n|   `--CHAR -> . [0:74]\n|--NEWLINE -> \\r\\n [0:75]\n|--JAVADOC_TAG -> @author Oliver Burn [1:0]\n|   |--AUTHOR_LITERAL -> @author [1:0]\n|   |--WS ->   [1:7]\n|   `--DESCRIPTION -> Oliver Burn [1:8]\n|       `--TEXT -> Oliver Burn [1:8]\n|           |--CHAR -> O [1:8]\n|           |--CHAR -> l [1:9]\n|           |--CHAR -> i [1:10]\n|           |--CHAR -> v [1:11]\n|           |--CHAR -> e [1:12]\n|           |--CHAR -> r [1:13]\n|           |--WS ->   [1:14]\n|           |--CHAR -> B [1:15]\n|           |--CHAR -> u [1:16]\n|           |--CHAR -> r [1:17]\n|           `--CHAR -> n [1:18]\n`--EOF -> <EOF> [1:19]\n```\n## \n\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/34179393-javadoc-grammar-delete-child-nodes-in-javadoc-text-node?utm_campaign=plugin&utm_content=tracker%2F500528&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F500528&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/checkstyle/checkstyle/issues/comments/260649555","html_url":"https://github.com/checkstyle/checkstyle/issues/3170#issuecomment-260649555","issue_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/3170","id":260649555,"user":{"login":"romani","id":812984,"avatar_url":"https://avatars.githubusercontent.com/u/812984?v=3","gravatar_id":"","url":"https://api.github.com/users/romani","html_url":"https://github.com/romani","followers_url":"https://api.github.com/users/romani/followers","following_url":"https://api.github.com/users/romani/following{/other_user}","gists_url":"https://api.github.com/users/romani/gists{/gist_id}","starred_url":"https://api.github.com/users/romani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romani/subscriptions","organizations_url":"https://api.github.com/users/romani/orgs","repos_url":"https://api.github.com/users/romani/repos","events_url":"https://api.github.com/users/romani/events{/privacy}","received_events_url":"https://api.github.com/users/romani/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T14:05:33Z","updated_at":"2016-11-15T14:05:33Z","body":"@rnveach ,\r\n\r\nAttribute values we do not split into CHAR+WS.\r\nCan we do the same for javadoc text ?\r\n\r\n```\r\n/var/tmp$ cat Filter.java \r\n/**\r\n * An interface  <i htr=\"value\" />.\r\n */\r\npublic interface Filter {\r\n}\r\n\r\n/var/tmp$ java -jar checkstyle-7.2-SNAPSHOT-all.jar -J Filter.java\r\nINTERFACE_DEF -> INTERFACE_DEF [4:0]\r\n|--MODIFIERS -> MODIFIERS [4:0]\r\n|   |--BLOCK_COMMENT_BEGIN -> /* [1:0]\r\n|   |   |--COMMENT_CONTENT -> *\\n * An interface  <i htr=\"value\" />.\\n  [1:2]\r\n|   |   |   `--JAVADOC -> \\n * An interface  <i htr=\"value\" />.\\n <EOF> [1:0]\r\n|   |   |       |--NEWLINE -> \\n [1:0]\r\n|   |   |       |--LEADING_ASTERISK ->  * [2:0]\r\n|   |   |       |--TEXT ->  An interface   [2:2]\r\n|   |   |       |   |--WS ->   [2:2]\r\n|   |   |       |   |--CHAR -> A [2:3]\r\n|   |   |       |   |--CHAR -> n [2:4]\r\n|   |   |       |   |--WS ->   [2:5]\r\n|   |   |       |   |--CHAR -> i [2:6]\r\n|   |   |       |   |--CHAR -> n [2:7]\r\n|   |   |       |   |--CHAR -> t [2:8]\r\n|   |   |       |   |--CHAR -> e [2:9]\r\n|   |   |       |   |--CHAR -> r [2:10]\r\n|   |   |       |   |--CHAR -> f [2:11]\r\n|   |   |       |   |--CHAR -> a [2:12]\r\n|   |   |       |   |--CHAR -> c [2:13]\r\n|   |   |       |   |--CHAR -> e [2:14]\r\n|   |   |       |   `--WS ->    [2:15]\r\n|   |   |       |--HTML_ELEMENT -> <i htr=\"value\" /> [2:17]\r\n|   |   |       |   `--SINGLETON_ELEMENT -> <i htr=\"value\" /> [2:17]\r\n|   |   |       |       `--SINGLETON_TAG -> <i htr=\"value\" /> [2:17]\r\n|   |   |       |           |--OPEN -> < [2:17]\r\n|   |   |       |           |--HTML_TAG_NAME -> i [2:18]\r\n|   |   |       |           |--WS ->   [2:19]\r\n|   |   |       |           |--ATTRIBUTE -> htr=\"value\" [2:20]\r\n|   |   |       |           |   |--HTML_TAG_NAME -> htr [2:20]\r\n|   |   |       |           |   |--EQUALS -> = [2:23]\r\n|   |   |       |           |   `--ATTR_VALUE -> \"value\" [2:24]\r\n|   |   |       |           |--WS ->   [2:32]\r\n|   |   |       |           `--SLASH_CLOSE -> /> [2:33]\r\n|   |   |       |--TEXT -> . [2:35]\r\n|   |   |       |   `--CHAR -> . [2:35]\r\n|   |   |       |--NEWLINE -> \\n [2:36]\r\n|   |   |       |--TEXT ->   [3:0]\r\n|   |   |       |   `--WS ->   [3:0]\r\n|   |   |       `--EOF -> <EOF> [3:1]\r\n|   |   `--BLOCK_COMMENT_END -> */ [3:1]\r\n|   `--LITERAL_PUBLIC -> public [4:0]\r\n|--LITERAL_INTERFACE -> interface [4:7]\r\n|--IDENT -> Filter [4:17]\r\n`--OBJBLOCK -> OBJBLOCK [4:24]\r\n    |--LCURLY -> { [4:24]\r\n    `--RCURLY -> } [5:0]\r\n```\r\nSome links:\r\nhttps://github.com/checkstyle/checkstyle/blob/master/src/main/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/JavadocLexer.g4#L380\r\n"}}
{"actor":{"display_login":"romani"}}