use of org.eclipse.n4js.jsdoc.tokenizers.TagTitleTokenizer in project n4js by eclipse.
the class DocletParser method parse.
/**
* @param commentString
* Input string that will be parsed. Multiline comment expected.
* @return Instance of Doclet (not null, but may have no contents).
*/
public Doclet parse(String commentString) {
JSDocCharScanner scanner = new JSDocCharScanner(commentString);
// parse main description
Doclet doclet = parseMainDescription(scanner);
TagTitleTokenizer tagTitleTokenizer = new TagTitleTokenizer();
JSDocToken token;
// TODO error handling
while (null != (token = tagTitleTokenizer.nextToken(scanner))) {
ITagDefinition tagDefinition = lineTagDictionary.getDefinition(token.token);
int lineTagEnd = scanner.findLineTagEnd();
scanner.fence(lineTagEnd);
if (tagDefinition != null) {
TagTitle tagTitle = createTagTitle(token, tagDefinition);
LineTag tag = (LineTag) tagDefinition.parse(tagTitle, scanner, descriptionParser);
tag.setRange(token.start, scanner.offset());
doclet.getLineTags().add(tag);
}
scanner.unfence();
scanner.setNextOffset(lineTagEnd);
}
doclet.setEnd(scanner.offset());
return doclet;
}
Aggregations