/** The name of a free variable proxy. */ Name proxyName(Name name) { return names.fromString("val" + target.syntheticNameChar() + name); }
/** The name of the access method with number `anum' and access code `acode'. */ Name accessName(int anum, int acode) { return names.fromString( "access" + target.syntheticNameChar() + anum + acode / 10 + acode % 10); }
/** The name of a free variable proxy. */ Name proxyName(Name name) { return names.fromString("val" + target.syntheticNameChar() + name); }
/** The name of a free variable proxy. */ Name proxyName(Name name) { return names.fromString("val" + target.syntheticNameChar() + name); }
/** The name of the access method with number `anum' and access code `acode'. */ Name accessName(int anum, int acode) { return names.fromString( "access" + target.syntheticNameChar() + anum + acode / 10 + acode % 10); }
/** The name of the access method with number `anum' and access code `acode'. */ Name accessName(int anum, int acode) { return names.fromString( "access" + target.syntheticNameChar() + anum + acode / 10 + acode % 10); }
/** The name of a free variable proxy. */ Name proxyName(Name name) { return names.fromString("val" + target.syntheticNameChar() + name); }
/** The name of the access method with number `anum' and access code `acode'. */ Name accessName(int anum, int acode) { return names.fromString( "access" + target.syntheticNameChar() + anum + acode / 10 + acode % 10); }
/** Return name of local class. * This is of the form <enclClass> $ n <classname> * where * enclClass is the flat name of the enclosing class, * classname is the simple name of the local class */ Name localClassName(ClassSymbol c) { for (int i=1; ; i++) { Name flatname = names. fromString("" + c.owner.enclClass().flatname + target.syntheticNameChar() + i + c.name); if (compiled.get(flatname) == null) return flatname; } }
/** Return name of local class. * This is of the form <enclClass> $ n <classname> * where * enclClass is the flat name of the enclosing class, * classname is the simple name of the local class */ Name localClassName(ClassSymbol c) { for (int i=1; ; i++) { Name flatname = names. fromString("" + c.owner.enclClass().flatname + target.syntheticNameChar() + i + c.name); if (compiled.get(flatname) == null) return flatname; } }
/** 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; }
/** 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; }
/** Return an anonymous class nested in this toplevel class. */ ClassSymbol accessConstructorTag() { ClassSymbol topClass = currentClass.outermostClass(); Name flatname = names.fromString("" + topClass.getQualifiedName() + target.syntheticNameChar() + "1"); ClassSymbol ctag = chk.compiled.get(flatname); if (ctag == null) ctag = makeEmptyClass(STATIC | SYNTHETIC, topClass); return ctag; }
/** Return an anonymous class nested in this toplevel class. */ ClassSymbol accessConstructorTag() { ClassSymbol topClass = currentClass.outermostClass(); Name flatname = names.fromString("" + topClass.getQualifiedName() + target.syntheticNameChar() + "1"); ClassSymbol ctag = chk.compiled.get(flatname); if (ctag == null) ctag = makeEmptyClass(STATIC | SYNTHETIC, topClass); return ctag; }
/** The name of a this$n field * @param type The class referenced by the this$n field */ Name outerThisName(Type type, Symbol owner) { Type t = type.getEnclosingType(); int nestingLevel = 0; while (t.tag == CLASS) { t = t.getEnclosingType(); nestingLevel++; } Name result = names.fromString("this" + target.syntheticNameChar() + nestingLevel); while (owner.kind == TYP && ((ClassSymbol)owner).members().lookup(result).scope != null) result = names.fromString(result.toString() + target.syntheticNameChar()); return result; }
/** Return an anonymous class nested in this toplevel class. */ ClassSymbol accessConstructorTag() { ClassSymbol topClass = currentClass.outermostClass(); Name flatname = names.fromString("" + topClass.getQualifiedName() + target.syntheticNameChar() + "1"); ClassSymbol ctag = chk.compiled.get(flatname); if (ctag == null) ctag = makeEmptyClass(STATIC | SYNTHETIC, topClass).sym; // keep a record of all tags, to verify that all are generated as required accessConstrTags = accessConstrTags.prepend(ctag); return ctag; }
/** The name of a this$n field * @param type The class referenced by the this$n field */ Name outerThisName(Type type, Symbol owner) { Type t = type.getEnclosingType(); int nestingLevel = 0; while (t.tag == CLASS) { t = t.getEnclosingType(); nestingLevel++; } Name result = names.fromString("this" + target.syntheticNameChar() + nestingLevel); while (owner.kind == TYP && ((ClassSymbol)owner).members().lookup(result).scope != null) result = names.fromString(result.toString() + target.syntheticNameChar()); return result; }
/** Return an anonymous class nested in this toplevel class. */ ClassSymbol accessConstructorTag() { ClassSymbol topClass = currentClass.outermostClass(); Name flatname = names.fromString("" + topClass.getQualifiedName() + target.syntheticNameChar() + "1"); ClassSymbol ctag = chk.compiled.get(flatname); if (ctag == null) ctag = makeEmptyClass(STATIC | SYNTHETIC, topClass).sym; // keep a record of all tags, to verify that all are generated as required accessConstrTags = accessConstrTags.prepend(ctag); return ctag; }
/** The name of a this$n field * @param type The class referenced by the this$n field */ Name outerThisName(Type type, Symbol owner) { Type t = type.getEnclosingType(); int nestingLevel = 0; while (t.hasTag(CLASS)) { t = t.getEnclosingType(); nestingLevel++; } Name result = names.fromString("this" + target.syntheticNameChar() + nestingLevel); while (owner.kind == TYP && ((ClassSymbol)owner).members().lookup(result).scope != null) result = names.fromString(result.toString() + target.syntheticNameChar()); return result; }
/** The name of a this$n field * @param type The class referenced by the this$n field */ Name outerThisName(Type type, Symbol owner) { Type t = type.getEnclosingType(); int nestingLevel = 0; while (t.hasTag(CLASS)) { t = t.getEnclosingType(); nestingLevel++; } Name result = names.fromString("this" + target.syntheticNameChar() + nestingLevel); while (owner.kind == TYP && ((ClassSymbol)owner).members().lookup(result).scope != null) result = names.fromString(result.toString() + target.syntheticNameChar()); return result; }