Instantly share code, notes, and snippets.

Embed
What would you like to do?
grammar newEmptyCombinedGrammar;
javadoc : START_JAVADOC NEW_LINE javadocLine*? END_JAVA_BLOCK_COMMENT;
javadocLine: STAR (tag | text | htmlTag)* NEW_LINE;
tag: TAG_AUTHOR
| TAG_VERSION
| TAG_SINCE
| TAG_SEE
| TAG_PARAM
| TAG_RETURN
| TAG_EXCEPTION
| TAG_THROWS
| TAG_DEPRECATED
| TAG_INHERIT_DOC
| TAG_LINK
| TAG_VALUE
| TAG_CUSTOM
;
text: (TEXT)+;
htmlTag: (openHtmlTag (TEXT|htmlTag) closeHtmlTag)
| singleHtmlTag;
openHtmlTag: '<' TEXT '>';
closeHtmlTag: '</' TEXT '>';
singleHtmlTag: '<' TEXT '/>';
//GT: '>' | '&gt;';
//LT: '<' | '&lt;';
START_JAVADOC: '/**';
END_JAVA_BLOCK_COMMENT: '*/';
NEW_LINE: '\n';
STAR: '*';
TEXT: [ a-zA-Z0-9.,:/_(){}#=-]+;
//STRING: [a-zA-Z0-9_-]+;
TAG_AUTHOR: '@author';
TAG_VERSION: '@version';
TAG_SINCE: '@since';
TAG_SEE: '@see';
TAG_PARAM: '@param';
TAG_RETURN: '@return';
TAG_EXCEPTION: '@exception';
TAG_THROWS: '@throws';
TAG_DEPRECATED: '@deprecated';
TAG_INHERIT_DOC: '@InheritDoc';
TAG_LINK: '@link';
TAG_VALUE: '@value';
TAG_CUSTOM: '@' TEXT;
WS : [ \t\r]+ -> skip ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment