public DCDocComment getCommentTree(JCTree tree) { Entry e = table.get(tree); if (e == null) return null; if (e.tree == null) e.tree = new DocCommentParser(fac, diagSource, e.comment).parse(); return e.tree; }
skipWhitespace(); int pos = bp; int depth = 1; nextChar(); break; entity(trees); break; addPendingText(trees, bp - 1); trees.add(html()); break; newline = false; depth++; nextChar(); break; newline = false; if (--depth == 0) { addPendingText(trees, bp - 1); nextChar(); return trees.toList(); nextChar(); break; if (textStart == -1)
public DCTree parse(int pos) throws ParseException { skipWhitespace(); DCIdentifier name = identifier(); skipWhitespace(); DCReference type = reference(false); List<DCTree> description = null; if (isWhitespace(ch)) { skipWhitespace(); description = blockContent(); } return m.at(pos).SerialField(name, type, description); } },
skipWhitespace(); while (isIdentifierStart(ch)) { int namePos = bp; Name name = readIdentifier(); skipWhitespace(); List<DCTree> value = null; ValueKind vkind = ValueKind.EMPTY; if (ch == '=') { ListBuffer<DCTree> v = new ListBuffer<DCTree>(); nextChar(); skipWhitespace(); if (ch == '\'' || ch == '"') { vkind = (ch == '\'') ? ValueKind.SINGLE : ValueKind.DOUBLE; char quote = ch; nextChar(); textStart = bp; while (bp < buflen && ch != quote) { if (newline && ch == '@') { attrs.add(erroneous("dc.unterminated.string", namePos)); attrValueChar(v); addPendingText(v, bp - 1); nextChar(); } else { vkind = ValueKind.UNQUOTED; textStart = bp; while (bp < buflen && !isUnquotedAttrValueTerminator(ch)) {
buflen = buf.length - 1; bp = -1; nextChar(); List<DCTree> body = blockContent(); List<DCTree> tags = blockTags(); case TEXT: String s = ((DCText) t).getBody(); int i = getSentenceBreak(s); if (i > 0) { int i0 = i; while (i0 > 0 && isWhitespace(s.charAt(i0 - 1))) i0--; fs.add(m.at(t.pos).Text(s.substring(0, i0))); int i1 = i; while (i1 < s.length() && isWhitespace(s.charAt(i1))) i1++; body = body.tail; break loop; } else if (body.tail.nonEmpty()) { if (isSentenceBreak(body.tail.head)) { int i0 = s.length() - 1; while (i0 > 0 && isWhitespace(s.charAt(i0))) i0--; fs.add(m.at(t.pos).Text(s.substring(0, i0 + 1))); if (isSentenceBreak(t))
nextChar(); if (isIdentifierStart(ch)) { Name name = readIdentifier(); List<DCTree> attrs = htmlAttrs(); if (attrs != null) { boolean selfClosing = false; if (ch == '/') { nextChar(); selfClosing = true; nextChar(); return m.at(p).StartElement(name, attrs, selfClosing).setEndPos(bp); nextChar(); if (isIdentifierStart(ch)) { Name name = readIdentifier(); skipWhitespace(); if (ch == '>') { nextChar(); return m.at(p).EndElement(name); nextChar(); if (ch == '-') { nextChar(); if (ch == '-') { nextChar(); while (bp < buflen) { int dash = 0; while (ch == '-') {
nextChar(); Name name = null; boolean checkSemi = false; if (ch == '#') { int namep = bp; nextChar(); if (isDecimalDigit(ch)) { nextChar(); while (isDecimalDigit(ch)) nextChar(); name = names.fromChars(buf, namep, bp - namep); } else if (ch == 'x' || ch == 'X') { nextChar(); if (isHexDigit(ch)) { nextChar(); while (isHexDigit(ch)) nextChar(); name = names.fromChars(buf, namep, bp - namep); } else if (isIdentifierStart(ch)) { name = readIdentifier(); return erroneous("dc.bad.entity", p); else { if (ch != ';') return erroneous("dc.missing.semicolon", p); nextChar(); return m.at(p).Entity(name);
int p = bp - 1; try { nextChar(); if (isIdentifierStart(ch)) { Name name = readTagName(); skipWhitespace(); DCTree text = inlineText(); if (text != null) { nextChar(); return m.at(p).UnknownInlineTag(name, List.of(text)).setEndPos(bp); inlineText(); // skip content nextChar(); return erroneous("dc.no.tag.name", p); } catch (ParseException e) { return erroneous(e.getMessage(), p);
nextChar(); break; entity(trees); break; addPendingText(trees, bp - 1); trees.add(html()); if (textStart == -1) { textStart = bp; addPendingText(trees, bp - 1); trees.add(m.at(bp).Erroneous(newString(bp, bp+1), diagSource, "dc.bad.gt")); nextChar(); if (textStart == -1) { textStart = bp; inlineTag(trees); break; addPendingText(trees, lastNonWhite); break loop; textStart = bp; lastNonWhite = bp; nextChar(); addPendingText(trees, lastNonWhite);
int p = bp; try { nextChar(); if (isIdentifierStart(ch)) { Name name = readTagName(); TagParser tp = tagParsers.get(name); if (tp == null) { List<DCTree> content = blockContent(); return m.at(p).UnknownBlockTag(name, content); } else { return tp.parse(p); case INLINE: return erroneous("dc.bad.inline.tag", p); blockContent(); return erroneous("dc.no.tag.name", p); } catch (ParseException e) { blockContent(); return erroneous(e.getMessage(), p);
public DCTree parse(int pos) throws ParseException { skipWhitespace(); switch (ch) { case '"': DCText string = quotedString(); if (string != null) { skipWhitespace(); if (ch == '@') return m.at(pos).See(List.<DCTree>of(string)); List<DCTree> html = blockContent(); if (html != null) return m.at(pos).See(html); if (isJavaIdentifierStart(ch) || ch == '#') { DCReference ref = reference(true); List<DCTree> description = blockContent(); return m.at(pos).See(description.prepend(ref));
public DCTree parse(int pos) throws ParseException { skipWhitespace(); DCReference ref = reference(false); List<DCTree> description = blockContent(); return m.at(pos).Exception(ref, description); } },
public DCTree parse(int pos) throws ParseException { skipWhitespace(); boolean typaram = false; if (ch == '<') { typaram = true; nextChar(); } DCIdentifier id = identifier(); if (typaram) { if (ch != '>') throw new ParseException("dc.gt.expected"); nextChar(); } skipWhitespace(); List<DCTree> desc = blockContent(); return m.at(pos).Param(typaram, id, desc); } },
protected void inlineTag(ListBuffer<DCTree> list) { newline = false; nextChar(); if (ch == '@') { addPendingText(list, bp - 2); list.add(inlineTag()); textStart = bp; lastNonWhite = -1; } else { if (textStart == -1) textStart = bp - 1; lastNonWhite = bp; } }
public DCTree parse(int pos) { List<DCTree> reason = blockContent(); return m.at(pos).Deprecated(reason); } },
protected void entity(ListBuffer<DCTree> list) { newline = false; addPendingText(list, bp - 1); list.add(entity()); if (textStart == -1) { textStart = bp; lastNonWhite = -1; } }
/** * Read a series of block tags, including their content. * Standard tags parse their content appropriately. * Non-standard tags are represented by {@link UnknownBlockTag}. */ protected List<DCTree> blockTags() { ListBuffer<DCTree> tags = new ListBuffer<DCTree>(); while (ch == '@') tags.add(blockTag()); return tags.toList(); }
skipWhitespace(); while (isIdentifierStart(ch)) { int namePos = bp; Name name = readIdentifier(); skipWhitespace(); List<DCTree> value = null; ValueKind vkind = ValueKind.EMPTY; if (ch == '=') { ListBuffer<DCTree> v = new ListBuffer<DCTree>(); nextChar(); skipWhitespace(); if (ch == '\'' || ch == '"') { vkind = (ch == '\'') ? ValueKind.SINGLE : ValueKind.DOUBLE; char quote = ch; nextChar(); textStart = bp; while (bp < buflen && ch != quote) { if (newline && ch == '@') { attrs.add(erroneous("dc.unterminated.string", namePos)); attrValueChar(v); addPendingText(v, bp - 1); nextChar(); } else { vkind = ValueKind.UNQUOTED; textStart = bp; while (bp < buflen && !isUnquotedAttrValueTerminator(ch)) {
buflen = buf.length - 1; bp = -1; nextChar(); List<DCTree> body = blockContent(); List<DCTree> tags = blockTags(); case TEXT: String s = ((DCText) t).getBody(); int i = getSentenceBreak(s); if (i > 0) { int i0 = i; while (i0 > 0 && isWhitespace(s.charAt(i0 - 1))) i0--; fs.add(m.at(t.pos).Text(s.substring(0, i0))); int i1 = i; while (i1 < s.length() && isWhitespace(s.charAt(i1))) i1++; body = body.tail; break loop; } else if (body.tail.nonEmpty()) { if (isSentenceBreak(body.tail.head)) { int i0 = s.length() - 1; while (i0 > 0 && isWhitespace(s.charAt(i0))) i0--; fs.add(m.at(t.pos).Text(s.substring(0, i0 + 1))); if (isSentenceBreak(t))