protected DCTree entity() {
        int p = bp;
        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();
        }

        if (name == null)
            return erroneous("dc.bad.entity", p);
        else {
            if (ch != ';')
                return erroneous("dc.missing.semicolon", p);
            nextChar();
            return m.at(p).Entity(name);
        }
    }
protected DCTree entity ( ) { int p = bp ; 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 ( ) ; } if ( name == null ) return erroneous ( "dc.bad.entity" , p ) ; else { if ( ch != ';' ) return erroneous ( "dc.missing.semicolon" , p ) ; nextChar ( ) ; return m . at ( p ) . Entity ( name ) ; } }
Read an HTML entity.
{@literal &identifier; } or {@literal &#digits; } or {@literal &#xhex-digits; }