use of org.wso2.ballerinalang.compiler.semantics.model.types.BAnnotationType in project ballerina by ballerina-lang.
the class SymbolEnter method visit.
public void visit(BLangAnnotation annotationNode) {
BSymbol annotationSymbol = Symbols.createAnnotationSymbol(Flags.asMask(annotationNode.flagSet), names.fromIdNode(annotationNode.name), env.enclPkg.symbol.pkgID, null, env.scope.owner);
annotationSymbol.type = new BAnnotationType((BAnnotationSymbol) annotationSymbol);
annotationNode.attachmentPoints.forEach(point -> ((BAnnotationSymbol) annotationSymbol).attachmentPoints.add(point));
annotationNode.symbol = annotationSymbol;
defineSymbol(annotationNode.pos, annotationSymbol);
SymbolEnv annotationEnv = SymbolEnv.createAnnotationEnv(annotationNode, annotationSymbol.scope, env);
annotationNode.attributes.forEach(att -> this.defineNode(att, annotationEnv));
if (annotationNode.typeNode != null) {
BType structType = this.symResolver.resolveTypeNode(annotationNode.typeNode, annotationEnv);
((BAnnotationSymbol) annotationSymbol).attachedType = structType.tsymbol;
}
}
Aggregations