Search in sources :

Example 1 with ExternalAnnotation

use of dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation 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 ExternalAnnotation

use of dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation in project Dyvil by Dyvil.

the class AttributeList method read.

public static AttributeList read(DataInput in) throws IOException {
    final int flags = in.readInt();
    final int annotations = in.readShort();
    final AttributeList list = new AttributeList(annotations);
    list.flags = flags;
    list.size = annotations;
    for (int i = 0; i < annotations; i++) {
        final Annotation annotation = new ExternalAnnotation();
        list.data[i] = annotation;
        annotation.read(in);
    }
    return list;
}
Also used : ExternalAnnotation(dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation) Annotation(dyvilx.tools.compiler.ast.attribute.annotation.Annotation) ExternalAnnotation(dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation)

Example 3 with ExternalAnnotation

use of dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation in project Dyvil by Dyvil.

the class AnnotationReader method visitAnnotation.

@Override
public AnnotationVisitor visitAnnotation(String key, String desc) {
    Annotation annotation = new ExternalAnnotation(ClassFormat.extendedToType(desc));
    AnnotationExpr value = new AnnotationExpr(annotation);
    this.arguments.add(Name.fromRaw(key), value);
    return new AnnotationReader(value, annotation);
}
Also used : ExternalAnnotation(dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation) AnnotationExpr(dyvilx.tools.compiler.ast.expression.AnnotationExpr) Annotation(dyvilx.tools.compiler.ast.attribute.annotation.Annotation) ExternalAnnotation(dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation)

Example 4 with ExternalAnnotation

use of dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation in project Dyvil by Dyvil.

the class AnnotationValueReader method visitAnnotation.

@Override
public AnnotationVisitor visitAnnotation(String key, String desc) {
    Annotation annotation = new ExternalAnnotation(ClassFormat.extendedToType(desc));
    AnnotationExpr value = new AnnotationExpr(annotation);
    this.consumer.setValue(value);
    return new AnnotationReader(value, annotation);
}
Also used : ExternalAnnotation(dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation) AnnotationExpr(dyvilx.tools.compiler.ast.expression.AnnotationExpr) Annotation(dyvilx.tools.compiler.ast.attribute.annotation.Annotation) ExternalAnnotation(dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation)

Example 5 with ExternalAnnotation

use of dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation in project Dyvil by Dyvil.

the class ValueAnnotationVisitor method visitAnnotation.

@Override
public AnnotationVisitor visitAnnotation(String name, String desc) {
    Annotation annotation = new ExternalAnnotation(ClassFormat.extendedToType(desc));
    AnnotationExpr value = new AnnotationExpr(annotation);
    this.consumer.setValue(value);
    return new AnnotationReader(value, annotation);
}
Also used : ExternalAnnotation(dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation) AnnotationExpr(dyvilx.tools.compiler.ast.expression.AnnotationExpr) Annotation(dyvilx.tools.compiler.ast.attribute.annotation.Annotation) ExternalAnnotation(dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation)

Aggregations

Annotation (dyvilx.tools.compiler.ast.attribute.annotation.Annotation)6 ExternalAnnotation (dyvilx.tools.compiler.ast.attribute.annotation.ExternalAnnotation)6 AnnotationExpr (dyvilx.tools.compiler.ast.expression.AnnotationExpr)3 Reason (dyvil.annotation.Deprecated.Reason)1 MarkerLevel (dyvil.util.MarkerLevel)1 ArgumentList (dyvilx.tools.compiler.ast.parameter.ArgumentList)1 IType (dyvilx.tools.compiler.ast.type.IType)1 InternalType (dyvilx.tools.compiler.ast.type.raw.InternalType)1 AnnotationReader (dyvilx.tools.compiler.backend.visitor.AnnotationReader)1 Marker (dyvilx.tools.parsing.marker.Marker)1