use of dyvilx.tools.compiler.ast.classes.IClass in project Dyvil by Dyvil.
the class SingleImport method resolveTypes.
@Override
public void resolveTypes(MarkerList markers, IContext context, IImportContext parentContext, int mask) {
if (this.parent != null) {
this.parent.resolveTypes(markers, context, parentContext, KindedImport.PARENT);
parentContext = this.parent.asParentContext();
}
boolean resolved = false;
this.resolver = parentContext;
this.mask = mask;
if ((mask & KindedImport.CLASS) != 0) {
final IClass theClass = parentContext.resolveClass(this.name);
if (theClass != null) {
this.asParentContext = theClass;
resolved = true;
}
}
if ((mask & KindedImport.HEADER) != 0) {
final IHeaderUnit header = parentContext.resolveHeader(this.name);
if (header != null) {
if ((mask & KindedImport.INLINE) != 0 && this.checkInline(markers, context, header)) {
this.asContext = new CombiningContext(this, header.getContext());
}
this.asParentContext = !resolved ? header : new CombiningContext(header, this.asParentContext);
resolved = true;
}
}
if ((mask & KindedImport.PACKAGE) != 0) {
final Package thePackage = parentContext.resolvePackage(this.name);
if (thePackage != null) {
this.asParentContext = !resolved ? thePackage : new CombiningContext(thePackage, this.asParentContext);
resolved = true;
}
}
if (!resolved) {
this.asParentContext = IDefaultContext.DEFAULT;
if (mask == KindedImport.PARENT) {
// when resolving as a parent import, the resolve method is never called,
// so we need the error reporting to happen here.
this.reportResolve(markers);
}
}
// otherwise error later
}
use of dyvilx.tools.compiler.ast.classes.IClass in project Dyvil by Dyvil.
the class CompleteCommand method findMembers.
private static void findMembers(IType type, Set<IField> fields, Set<IProperty> properties, Set<IMethod> methods, String start, boolean statics) {
final IClass theClass = type.getTheClass();
if (theClass == null) {
return;
}
final ClassBody body = theClass.getBody();
if (body == null) {
return;
}
for (int i = 0, count = body.fieldCount(); i < count; i++) {
checkMember(fields, body.getField(i), start, statics);
}
for (int i = 0, count = body.propertyCount(); i < count; i++) {
checkMember(properties, body.getProperty(i), start, statics);
}
for (int i = 0, count = body.methodCount(); i < count; i++) {
checkMember(methods, body.getMethod(i), start, statics);
}
}
Aggregations