Search in sources :

Example 1 with GenericType

use of dyvilx.tools.compiler.ast.type.generic.GenericType in project Dyvil by Dyvil.

the class ClassFormat method readReferenceType.

@NonNull
private static IType readReferenceType(String desc, int start, int end) {
    int index = desc.indexOf('<', start);
    if (index >= 0 && index < end) {
        final GenericType type = new InternalGenericType(desc.substring(start, index));
        final TypeList arguments = type.getArguments();
        index++;
        while (desc.charAt(index) != '>') {
            index = readTyped(desc, index, arguments, true);
        }
        return type;
    }
    return new InternalType(desc.substring(start, end));
}
Also used : InternalType(dyvilx.tools.compiler.ast.type.raw.InternalType) GenericType(dyvilx.tools.compiler.ast.type.generic.GenericType) InternalGenericType(dyvilx.tools.compiler.ast.type.generic.InternalGenericType) InternalGenericType(dyvilx.tools.compiler.ast.type.generic.InternalGenericType) TypeList(dyvilx.tools.compiler.ast.type.TypeList) NonNull(dyvil.annotation.internal.NonNull)

Aggregations

NonNull (dyvil.annotation.internal.NonNull)1 TypeList (dyvilx.tools.compiler.ast.type.TypeList)1 GenericType (dyvilx.tools.compiler.ast.type.generic.GenericType)1 InternalGenericType (dyvilx.tools.compiler.ast.type.generic.InternalGenericType)1 InternalType (dyvilx.tools.compiler.ast.type.raw.InternalType)1