Skip to content
Snippets Groups Projects
Commit 26274c7b authored by Philip Makedonski's avatar Philip Makedonski
Browse files

* white spaces?

parent d73f4c2b
No related branches found
No related tags found
No related merge requests found
......@@ -495,46 +495,46 @@ public class TDLScopeProvider extends AbstractDeclarativeScopeProvider {
}
}
if (context.eContainer() instanceof DataUse) {
if (((DataUse)context.eContainer()).getReduction().indexOf(context)>0) {
EObject targetContext = ((DataUse)context.eContainer()).getReduction().get(((DataUse)context.eContainer()).getReduction().indexOf(context)-1);
if (((MemberReference)targetContext).getMember()!=null) {
if (((MemberReference)targetContext).getMember().getDataType() instanceof StructuredDataType) {
IScope scope = Scopes.scopeFor(((StructuredDataType)((MemberReference)targetContext).getMember().getDataType()).allMembers());
return scope;
}
} else if (((MemberReference)targetContext).getCollectionIndex()!=null) {
if (targetContext.eContainer() instanceof DataInstanceUse) {
DataInstanceUse dataInstanceUse = (DataInstanceUse)targetContext.eContainer();
if (dataInstanceUse.getDataType()!=null) {
//TODO:?
} else if (dataInstanceUse.getDataInstance()!=null) {
//TODO: check type
DataType itemType = ((CollectionDataType)dataInstanceUse.getDataInstance().getDataType()).getItemType();
if (itemType instanceof StructuredDataType) {
IScope scope = Scopes.scopeFor(((StructuredDataType)itemType).allMembers());
return scope;
}
}
} else if (targetContext.eContainer() instanceof DataElementUse) {
DataElementUse dataElementUse = (DataElementUse)targetContext.eContainer();
DataType resolvedDataType = dataElementUse.resolveDataType();
if (resolvedDataType instanceof StructuredDataType) {
IScope scope = Scopes.scopeFor(((StructuredDataType)resolvedDataType).allMembers());
if (((DataUse)context.eContainer()).getReduction().indexOf(context)>0) {
EObject targetContext = ((DataUse)context.eContainer()).getReduction().get(((DataUse)context.eContainer()).getReduction().indexOf(context)-1);
if (((MemberReference)targetContext).getMember()!=null) {
if (((MemberReference)targetContext).getMember().getDataType() instanceof StructuredDataType) {
IScope scope = Scopes.scopeFor(((StructuredDataType)((MemberReference)targetContext).getMember().getDataType()).allMembers());
return scope;
} else if (resolvedDataType instanceof CollectionDataType) {
DataType itemType = ((CollectionDataType)resolvedDataType).getItemType();
if (itemType instanceof StructuredDataType) {
IScope scope = Scopes.scopeFor(((StructuredDataType) itemType).allMembers());
}
} else if (((MemberReference)targetContext).getCollectionIndex()!=null) {
if (targetContext.eContainer() instanceof DataInstanceUse) {
DataInstanceUse dataInstanceUse = (DataInstanceUse)targetContext.eContainer();
if (dataInstanceUse.getDataType()!=null) {
//TODO:?
} else if (dataInstanceUse.getDataInstance()!=null) {
//TODO: check type
DataType itemType = ((CollectionDataType)dataInstanceUse.getDataInstance().getDataType()).getItemType();
if (itemType instanceof StructuredDataType) {
IScope scope = Scopes.scopeFor(((StructuredDataType)itemType).allMembers());
return scope;
}
}
} else if (targetContext.eContainer() instanceof DataElementUse) {
DataElementUse dataElementUse = (DataElementUse)targetContext.eContainer();
DataType resolvedDataType = dataElementUse.resolveDataType();
if (resolvedDataType instanceof StructuredDataType) {
IScope scope = Scopes.scopeFor(((StructuredDataType)resolvedDataType).allMembers());
return scope;
} else if (resolvedDataType instanceof CollectionDataType) {
DataType itemType = ((CollectionDataType)resolvedDataType).getItemType();
if (itemType instanceof StructuredDataType) {
IScope scope = Scopes.scopeFor(((StructuredDataType) itemType).allMembers());
return scope;
}
}
}
//TODO: handle other scenarios?
}
//TODO: handle other scenarios?
}
}
}
}
if (context.eContainer() instanceof DataInstanceUse) {
if (((DataInstanceUse)context.eContainer()).getDataInstance() instanceof StructuredDataInstance) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment