return blocks;
}
private static JavadocBlockInfo fetchStandAloneBlock(JavadocScanner scanner, List<JavadocToken> tokens) {
JavadocToken first = scanner.lookahead(0);
JavadocTokenKind kind = first.getKind();
if (kind == JavadocTokenKind.EOF) {
return null;
}
if (kind != JavadocTokenKind.AT) {
throw new AssertionError(MessageFormat.format(
"AT <-> {0}({1})@{2}", //$NON-NLS-1$
first,
first.getKind(),
first.getLocation()));
}
scanner.consume(1);
// タグ名を解析
int tagCount = JavadocBlockParserUtil.countWhileTagName(scanner, 0);
List<JavadocToken> tagNames = new ArrayList<JavadocToken>(tagCount);
for (int i = 0; i < tagCount; i++) {
tagNames.add(scanner.nextToken());
}
String tagName = JavadocBlockParserUtil.buildString(tagNames);
// 本体を解析
int bodyStart = scanner.getIndex();
int count = JavadocScannerUtil.countUntilBlockEnd(scanner, 0);
// 情報として作成
int success = scanner.lookahead(count).getStartPosition();
DefaultJavadocScanner bs = new DefaultJavadocScanner(
new ArrayList<JavadocToken>(tokens.subList(bodyStart, bodyStart + count)),
success);
int init = first.getStartPosition();
IrLocation location = new IrLocation(init, success - init);
JavadocBlockInfo info = new JavadocBlockInfo(tagName, bs, location);
scanner.consume(count);
return info;