com.sun.tools.javac.tree.DCTree.DCEndPosTree Java Examples

The following examples show how to use com.sun.tools.javac.tree.DCTree.DCEndPosTree. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DocCommentParser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Read a single inline tag, including its content.
 * Standard tags parse their content appropriately.
 * Non-standard tags are represented by {@link UnknownBlockTag}.
 * Malformed tags may be returned as {@link Erroneous}.
 */
protected DCTree inlineTag() {
    int p = bp - 1;
    try {
        nextChar();
        if (isIdentifierStart(ch)) {
            Name name = readTagName();
            skipWhitespace();

            TagParser tp = tagParsers.get(name);
            if (tp == null) {
                DCTree text = inlineText();
                if (text != null) {
                    nextChar();
                    return m.at(p).UnknownInlineTag(name, List.of(text)).setEndPos(bp);
                }
            } else if (tp.getKind() == TagParser.Kind.INLINE) {
                DCEndPosTree<?> tree = (DCEndPosTree<?>) tp.parse(p);
                if (tree != null) {
                    return tree.setEndPos(bp);
                }
            } else {
                inlineText(); // skip content
                nextChar();
            }
        }
        return erroneous("dc.no.tag.name", p);
    } catch (ParseException e) {
        return erroneous(e.getMessage(), p);
    }
}
 
Example #2
Source File: DocCommentParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Read a single inline tag, including its content.
 * Standard tags parse their content appropriately.
 * Non-standard tags are represented by {@link UnknownBlockTag}.
 * Malformed tags may be returned as {@link Erroneous}.
 */
protected DCTree inlineTag() {
    int p = bp - 1;
    try {
        nextChar();
        if (isIdentifierStart(ch)) {
            Name name = readTagName();
            skipWhitespace();

            TagParser tp = tagParsers.get(name);
            if (tp == null) {
                DCTree text = inlineText();
                if (text != null) {
                    nextChar();
                    return m.at(p).UnknownInlineTag(name, List.of(text)).setEndPos(bp);
                }
            } else if (tp.getKind() == TagParser.Kind.INLINE) {
                DCEndPosTree<?> tree = (DCEndPosTree<?>) tp.parse(p);
                if (tree != null) {
                    return tree.setEndPos(bp);
                }
            } else {
                inlineText(); // skip content
                nextChar();
            }
        }
        return erroneous("dc.no.tag.name", p);
    } catch (ParseException e) {
        return erroneous(e.getMessage(), p);
    }
}
 
Example #3
Source File: DocCommentParser.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Read a single inline tag, including its content.
 * Standard tags parse their content appropriately.
 * Non-standard tags are represented by {@link UnknownBlockTag}.
 * Malformed tags may be returned as {@link Erroneous}.
 */
protected DCTree inlineTag() {
    int p = bp - 1;
    try {
        nextChar();
        if (isIdentifierStart(ch)) {
            Name name = readTagName();
            skipWhitespace();

            TagParser tp = tagParsers.get(name);
            if (tp == null) {
                DCTree text = inlineText();
                if (text != null) {
                    nextChar();
                    return m.at(p).UnknownInlineTag(name, List.of(text)).setEndPos(bp);
                }
            } else if (tp.getKind() == TagParser.Kind.INLINE) {
                DCEndPosTree<?> tree = (DCEndPosTree<?>) tp.parse(p);
                if (tree != null) {
                    return tree.setEndPos(bp);
                }
            } else {
                inlineText(); // skip content
                nextChar();
            }
        }
        return erroneous("dc.no.tag.name", p);
    } catch (ParseException e) {
        return erroneous(e.getMessage(), p);
    }
}
 
Example #4
Source File: DocCommentParser.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Read a single inline tag, including its content.
 * Standard tags parse their content appropriately.
 * Non-standard tags are represented by {@link UnknownBlockTag}.
 * Malformed tags may be returned as {@link Erroneous}.
 */
protected DCTree inlineTag() {
    int p = bp - 1;
    try {
        nextChar();
        if (isIdentifierStart(ch)) {
            Name name = readTagName();
            TagParser tp = tagParsers.get(name);

            if (tp == null) {
                skipWhitespace();
                DCTree text = inlineText(WhitespaceRetentionPolicy.REMOVE_ALL);
                if (text != null) {
                    nextChar();
                    return m.at(p).newUnknownInlineTagTree(name, List.of(text)).setEndPos(bp);
                }
            } else {
                if (!tp.retainWhiteSpace) {
                    skipWhitespace();
                }
                if (tp.getKind() == TagParser.Kind.INLINE) {
                    DCEndPosTree<?> tree = (DCEndPosTree<?>) tp.parse(p);
                    if (tree != null) {
                        return tree.setEndPos(bp);
                    }
                } else { // handle block tags (ex: @see) in inline content
                    inlineText(WhitespaceRetentionPolicy.REMOVE_ALL); // skip content
                    nextChar();
                }
            }
        }
        return erroneous("dc.no.tag.name", p);
    } catch (ParseException e) {
        return erroneous(e.getMessage(), p);
    }
}
 
Example #5
Source File: DocCommentParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Read a single inline tag, including its content.
 * Standard tags parse their content appropriately.
 * Non-standard tags are represented by {@link UnknownBlockTag}.
 * Malformed tags may be returned as {@link Erroneous}.
 */
protected DCTree inlineTag() {
    int p = bp - 1;
    try {
        nextChar();
        if (isIdentifierStart(ch)) {
            Name name = readTagName();
            skipWhitespace();

            TagParser tp = tagParsers.get(name);
            if (tp == null) {
                DCTree text = inlineText();
                if (text != null) {
                    nextChar();
                    return m.at(p).UnknownInlineTag(name, List.of(text)).setEndPos(bp);
                }
            } else if (tp.getKind() == TagParser.Kind.INLINE) {
                DCEndPosTree<?> tree = (DCEndPosTree<?>) tp.parse(p);
                if (tree != null) {
                    return tree.setEndPos(bp);
                }
            } else {
                inlineText(); // skip content
                nextChar();
            }
        }
        return erroneous("dc.no.tag.name", p);
    } catch (ParseException e) {
        return erroneous(e.getMessage(), p);
    }
}
 
Example #6
Source File: DocCommentParser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Read a single inline tag, including its content.
 * Standard tags parse their content appropriately.
 * Non-standard tags are represented by {@link UnknownBlockTag}.
 * Malformed tags may be returned as {@link Erroneous}.
 */
protected DCTree inlineTag() {
    int p = bp - 1;
    try {
        nextChar();
        if (isIdentifierStart(ch)) {
            Name name = readTagName();
            TagParser tp = tagParsers.get(name);

            if (tp == null) {
                skipWhitespace();
                DCTree text = inlineText(WhitespaceRetentionPolicy.REMOVE_ALL);
                if (text != null) {
                    nextChar();
                    return m.at(p).newUnknownInlineTagTree(name, List.of(text)).setEndPos(bp);
                }
            } else {
                if (!tp.retainWhiteSpace) {
                    skipWhitespace();
                }
                if (tp.getKind() == TagParser.Kind.INLINE) {
                    DCEndPosTree<?> tree = (DCEndPosTree<?>) tp.parse(p);
                    if (tree != null) {
                        return tree.setEndPos(bp);
                    }
                } else { // handle block tags (ex: @see) in inline content
                    inlineText(WhitespaceRetentionPolicy.REMOVE_ALL); // skip content
                    nextChar();
                }
            }
        }
        return erroneous("dc.no.tag.name", p);
    } catch (ParseException e) {
        return erroneous(e.getMessage(), p);
    }
}
 
Example #7
Source File: DocCommentParser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Read a single inline tag, including its content.
 * Standard tags parse their content appropriately.
 * Non-standard tags are represented by {@link UnknownBlockTag}.
 * Malformed tags may be returned as {@link Erroneous}.
 */
protected DCTree inlineTag() {
    int p = bp - 1;
    try {
        nextChar();
        if (isIdentifierStart(ch)) {
            Name name = readTagName();
            skipWhitespace();

            TagParser tp = tagParsers.get(name);
            if (tp == null) {
                DCTree text = inlineText();
                if (text != null) {
                    nextChar();
                    return m.at(p).UnknownInlineTag(name, List.of(text)).setEndPos(bp);
                }
            } else if (tp.getKind() == TagParser.Kind.INLINE) {
                DCEndPosTree<?> tree = (DCEndPosTree<?>) tp.parse(p);
                if (tree != null) {
                    return tree.setEndPos(bp);
                }
            } else {
                inlineText(); // skip content
                nextChar();
            }
        }
        return erroneous("dc.no.tag.name", p);
    } catch (ParseException e) {
        return erroneous(e.getMessage(), p);
    }
}
 
Example #8
Source File: DocCommentParser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Read a single inline tag, including its content.
 * Standard tags parse their content appropriately.
 * Non-standard tags are represented by {@link UnknownBlockTag}.
 * Malformed tags may be returned as {@link Erroneous}.
 */
protected DCTree inlineTag() {
    int p = bp - 1;
    try {
        nextChar();
        if (isIdentifierStart(ch)) {
            Name name = readTagName();
            skipWhitespace();

            TagParser tp = tagParsers.get(name);
            if (tp == null) {
                DCTree text = inlineText();
                if (text != null) {
                    nextChar();
                    return m.at(p).UnknownInlineTag(name, List.of(text)).setEndPos(bp);
                }
            } else if (tp.getKind() == TagParser.Kind.INLINE) {
                DCEndPosTree<?> tree = (DCEndPosTree<?>) tp.parse(p);
                if (tree != null) {
                    return tree.setEndPos(bp);
                }
            } else {
                inlineText(); // skip content
                nextChar();
            }
        }
        return erroneous("dc.no.tag.name", p);
    } catch (ParseException e) {
        return erroneous(e.getMessage(), p);
    }
}
 
Example #9
Source File: DocCommentParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Read a single inline tag, including its content.
 * Standard tags parse their content appropriately.
 * Non-standard tags are represented by {@link UnknownBlockTag}.
 * Malformed tags may be returned as {@link Erroneous}.
 */
protected DCTree inlineTag() {
    int p = bp - 1;
    try {
        nextChar();
        if (isIdentifierStart(ch)) {
            Name name = readTagName();
            skipWhitespace();

            TagParser tp = tagParsers.get(name);
            if (tp == null) {
                DCTree text = inlineText();
                if (text != null) {
                    nextChar();
                    return m.at(p).UnknownInlineTag(name, List.of(text)).setEndPos(bp);
                }
            } else if (tp.getKind() == TagParser.Kind.INLINE) {
                DCEndPosTree<?> tree = (DCEndPosTree<?>) tp.parse(p);
                if (tree != null) {
                    return tree.setEndPos(bp);
                }
            } else {
                inlineText(); // skip content
                nextChar();
            }
        }
        return erroneous("dc.no.tag.name", p);
    } catch (ParseException e) {
        return erroneous(e.getMessage(), p);
    }
}