Search in sources :

Example 1 with InternalType

use of dyvilx.tools.compiler.ast.type.raw.InternalType in project Dyvil by Dyvil.

the class IParameter method visitAnnotation.

default AnnotationVisitor visitAnnotation(String internalType) {
    if (this.skipAnnotation(internalType, null)) {
        return null;
    }
    IType type = new InternalType(internalType);
    Annotation annotation = new ExternalAnnotation(type);
    return new AnnotationReader(this, annotation);
}
Also used : InternalType(dyvilx.tools.compiler.ast.type.raw.InternalType) ExternalAnnotation(dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation) AnnotationReader(dyvilx.tools.compiler.backend.visitor.AnnotationReader) Annotation(dyvilx.tools.compiler.ast.attribute.annotation.Annotation) ExternalAnnotation(dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation) IType(dyvilx.tools.compiler.ast.type.IType)

Example 2 with InternalType

use of dyvilx.tools.compiler.ast.type.raw.InternalType 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

InternalType (dyvilx.tools.compiler.ast.type.raw.InternalType)2 NonNull (dyvil.annotation.internal.NonNull)1 Annotation (dyvilx.tools.compiler.ast.attribute.annotation.Annotation)1 ExternalAnnotation (dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation)1 IType (dyvilx.tools.compiler.ast.type.IType)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 AnnotationReader (dyvilx.tools.compiler.backend.visitor.AnnotationReader)1