use of org.eclipse.ceylon.compiler.java.codegen.recovery.TransformationPlan in project ceylon by eclipse.
the class CeylonVisitor method visit.
public void visit(Tree.AttributeDeclaration decl) {
TransformationPlan plan = gen.errors().hasDeclarationAndMarkBrokenness(decl);
if (plan instanceof Drop) {
return;
}
// To accept this method it is either not native, native for this
// backend or it's a native header with an implementation and there
// is no native implementation specifically for this backend
boolean accept = acceptDeclaration(decl);
if (!accept)
return;
int annots = gen.checkCompilerAnnotations(decl, defs);
Value dec = decl.getDeclarationModel();
if (dec.isClassOrInterfaceMember() && !ModelUtil.isLocalToInitializer(dec) || dec.isStatic()) {
// Class attributes
gen.classGen().transform(decl, classBuilder);
} else if (dec.isToplevel()) {
topattrBuilder.add(decl);
} else if (Decl.isLocal(dec) && (ModelUtil.isCaptured(dec) && Decl.isVariable(dec) || dec.isTransient() || Decl.hasSetter(dec))) {
// Captured local attributes get turned into an inner getter/setter class
appendList(gen.transform(decl));
} else {
// All other local attributes
appendList(gen.statementGen().transform(decl));
}
gen.resetCompilerAnnotations(annots);
}
Aggregations