Java Code Examples for com.sun.tools.javac.util.Name#append()

The following examples show how to use com.sun.tools.javac.util.Name#append() . 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: Lower.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/** Create a fresh synthetic name within a given scope - the unique name is
 *  obtained by appending '$' chars at the end of the name until no match
 *  is found.
 *
 * @param name base name
 * @param s scope in which the name has to be unique
 * @return fresh synthetic name
 */
private Name makeSyntheticName(Name name, Scope s) {
    do {
        name = name.append(
                target.syntheticNameChar(),
                names.empty);
    } while (lookupSynthetic(name, s) != null);
    return name;
}
 
Example 2
Source File: Symbol.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner
 */
static public Name formFullName(Name name, Symbol owner) {
    if (owner == null) return name;
    if (((owner.kind != ERR)) &&
        ((owner.kind & (VAR | MTH)) != 0
         || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
         )) return name;
    Name prefix = owner.getQualifiedName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append('.', name);
}
 
Example 3
Source File: Symbol.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner
 */
static public Name formFullName(Name name, Symbol owner) {
    if (owner == null) return name;
    if (((owner.kind != ERR)) &&
        ((owner.kind & (VAR | MTH)) != 0
         || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
         )) return name;
    Name prefix = owner.getQualifiedName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append('.', name);
}
 
Example 4
Source File: Symbol.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner, after
 *  converting to flat representation
 */
static public Name formFlatName(Name name, Symbol owner) {
    if (owner == null || owner.kind.matches(KindSelector.VAL_MTH) ||
        (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
        ) return name;
    char sep = owner.kind == TYP ? '$' : '.';
    Name prefix = owner.flatName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append(sep, name);
}
 
Example 5
Source File: Symbol.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner
 */
static public Name formFullName(Name name, Symbol owner) {
    if (owner == null) return name;
    if ((owner.kind != ERR) &&
        (owner.kind.matches(KindSelector.VAL_MTH) ||
         (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
         )) return name;
    Name prefix = owner.getQualifiedName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append('.', name);
}
 
Example 6
Source File: Symbol.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner, after
 *  converting to flat representation
 */
static public Name formFlatName(Name name, Symbol owner) {
    if (owner == null ||
        (owner.kind & (VAR | MTH)) != 0
        || (owner.kind == TYP && owner.type.tag == TYPEVAR)
        ) return name;
    char sep = owner.kind == TYP ? '$' : '.';
    Name prefix = owner.flatName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append(sep, name);
}
 
Example 7
Source File: Symbol.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner
 */
static public Name formFullName(Name name, Symbol owner) {
    if (owner == null) return name;
    if (((owner.kind != ERR)) &&
        ((owner.kind & (VAR | MTH)) != 0
         || (owner.kind == TYP && owner.type.tag == TYPEVAR)
         )) return name;
    Name prefix = owner.getQualifiedName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append('.', name);
}
 
Example 8
Source File: Symbol.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner, after
 *  converting to flat representation
 */
static public Name formFlatName(Name name, Symbol owner) {
    if (owner == null ||
        (owner.kind & (VAR | MTH)) != 0
        || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
        ) return name;
    char sep = owner.kind == TYP ? '$' : '.';
    Name prefix = owner.flatName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append(sep, name);
}
 
Example 9
Source File: Symbol.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner
 */
static public Name formFullName(Name name, Symbol owner) {
    if (owner == null) return name;
    if (((owner.kind != ERR)) &&
        ((owner.kind & (VAR | MTH)) != 0
         || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
         )) return name;
    Name prefix = owner.getQualifiedName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append('.', name);
}
 
Example 10
Source File: VeryPretty.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Name fullName(JCTree tree) {
switch (tree.getTag()) {
case IDENT:
    return ((JCIdent) tree).name;
case SELECT:
           JCFieldAccess sel = (JCFieldAccess)tree;
    Name sname = fullName(sel.selected);
    return sname != null && sname.getByteLength() > 0 ? sname.append('.', sel.name) : sel.name;
default:
    return null;
}
   }
 
Example 11
Source File: Symbol.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner
 */
static public Name formFullName(Name name, Symbol owner) {
    if (owner == null) return name;
    if (((owner.kind != ERR)) &&
        ((owner.kind & (VAR | MTH)) != 0
         || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
         )) return name;
    Name prefix = owner.getQualifiedName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append('.', name);
}
 
Example 12
Source File: Symbol.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner, after
 *  converting to flat representation
 */
static public Name formFlatName(Name name, Symbol owner) {
    if (owner == null ||
        (owner.kind & (VAR | MTH)) != 0
        || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
        ) return name;
    char sep = owner.kind == TYP ? '$' : '.';
    Name prefix = owner.flatName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append(sep, name);
}
 
Example 13
Source File: Symbol.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner, after
 *  converting to flat representation
 */
static public Name formFlatName(Name name, Symbol owner) {
    if (owner == null ||
        (owner.kind & (VAR | MTH)) != 0
        || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
        ) return name;
    char sep = owner.kind == TYP ? '$' : '.';
    Name prefix = owner.flatName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append(sep, name);
}
 
Example 14
Source File: Symbol.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner, after
 *  converting to flat representation
 */
static public Name formFlatName(Name name, Symbol owner) {
    if (owner == null ||
        (owner.kind & (VAR | MTH)) != 0
        || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
        ) return name;
    char sep = owner.kind == TYP ? '$' : '.';
    Name prefix = owner.flatName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append(sep, name);
}
 
Example 15
Source File: Symbol.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner
 */
static public Name formFullName(Name name, Symbol owner) {
    if (owner == null) return name;
    if (((owner.kind != ERR)) &&
        ((owner.kind & (VAR | MTH)) != 0
         || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
         )) return name;
    Name prefix = owner.getQualifiedName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append('.', name);
}
 
Example 16
Source File: Symbol.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner, after
 *  converting to flat representation
 */
static public Name formFlatName(Name name, Symbol owner) {
    if (owner == null ||
        (owner.kind & (VAR | MTH)) != 0
        || (owner.kind == TYP && owner.type.tag == TYPEVAR)
        ) return name;
    char sep = owner.kind == TYP ? '$' : '.';
    Name prefix = owner.flatName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append(sep, name);
}
 
Example 17
Source File: Symbol.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner
 */
static public Name formFullName(Name name, Symbol owner) {
    if (owner == null) return name;
    if (((owner.kind != ERR)) &&
        ((owner.kind & (VAR | MTH)) != 0
         || (owner.kind == TYP && owner.type.tag == TYPEVAR)
         )) return name;
    Name prefix = owner.getQualifiedName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append('.', name);
}
 
Example 18
Source File: Symbol.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner, after
 *  converting to flat representation
 */
static public Name formFlatName(Name name, Symbol owner) {
    if (owner == null ||
        (owner.kind & (VAR | MTH)) != 0
        || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
        ) return name;
    char sep = owner.kind == TYP ? '$' : '.';
    Name prefix = owner.flatName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append(sep, name);
}
 
Example 19
Source File: Symbol.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner
 */
static public Name formFullName(Name name, Symbol owner) {
    if (owner == null) return name;
    if (((owner.kind != ERR)) &&
        ((owner.kind & (VAR | MTH)) != 0
         || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
         )) return name;
    Name prefix = owner.getQualifiedName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append('.', name);
}
 
Example 20
Source File: Symbol.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** form a fully qualified name from a name and an owner, after
 *  converting to flat representation
 */
static public Name formFlatName(Name name, Symbol owner) {
    if (owner == null ||
        (owner.kind & (VAR | MTH)) != 0
        || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
        ) return name;
    char sep = owner.kind == TYP ? '$' : '.';
    Name prefix = owner.flatName();
    if (prefix == null || prefix == prefix.table.names.empty)
        return name;
    else return prefix.append(sep, name);
}