Commit f00309bf authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ updated TO scoping

parent 668842b7
......@@ -52,13 +52,13 @@ public class TPLan2ScopeProvider extends AbstractDeclarativeScopeProvider {
} else if (Parameter.class.isAssignableFrom(reference.getEType().getInstanceClass())) {
if (context instanceof MemberAssignment) {
if (context.eContainer() instanceof StructuredDataInstance) {
IScope scope = Scopes.scopeFor(((StructuredDataType)((StructuredDataInstance)context.eContainer()).getDataType()).getMember());
IScope scope = Scopes.scopeFor(((StructuredDataType)((StructuredDataInstance)context.eContainer()).getDataType()).allMembers());
return scope;
}
} else if (context instanceof ParameterBinding) {
if (context.eContainer() instanceof DataInstanceUse) {
if (((DataInstanceUse)context.eContainer()).getDataInstance() instanceof StructuredDataInstance) {
IScope scope = Scopes.scopeFor(((StructuredDataType)((StructuredDataInstance)((DataInstanceUse)context.eContainer()).getDataInstance()).getDataType()).getMember());
IScope scope = Scopes.scopeFor(((StructuredDataType)((StructuredDataInstance)((DataInstanceUse)context.eContainer()).getDataInstance()).getDataType()).allMembers());
return scope;
}
}
......@@ -67,26 +67,26 @@ public class TPLan2ScopeProvider extends AbstractDeclarativeScopeProvider {
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()).getMember());
IScope scope = Scopes.scopeFor(((StructuredDataType)((MemberReference)targetContext).getMember().getDataType()).allMembers());
return scope;
}
}
}
if (context.eContainer() instanceof DataInstanceUse) {
if (((DataInstanceUse)context.eContainer()).getDataInstance() instanceof StructuredDataInstance) {
IScope scope = Scopes.scopeFor(((StructuredDataType)((StructuredDataInstance)((DataInstanceUse)context.eContainer()).getDataInstance()).getDataType()).getMember());
IScope scope = Scopes.scopeFor(((StructuredDataType)((StructuredDataInstance)((DataInstanceUse)context.eContainer()).getDataInstance()).getDataType()).allMembers());
return scope;
}
}
} else if (context instanceof Content) {
if (context.eContainer() instanceof LiteralValue) {
if (((LiteralValue)context.eContainer()).getDataType() instanceof StructuredDataType) {
IScope scope = Scopes.scopeFor(((StructuredDataType)((LiteralValue)context.eContainer()).getDataType()).getMember());
IScope scope = Scopes.scopeFor(((StructuredDataType)((LiteralValue)context.eContainer()).getDataType()).allMembers());
return scope;
}
} else if (context.eContainer() instanceof Content) {
if (((Content)context.eContainer()).getMember().getDataType() instanceof StructuredDataType) {
IScope scope = Scopes.scopeFor(((StructuredDataType)((Content)context.eContainer()).getMember().getDataType()).getMember());
IScope scope = Scopes.scopeFor(((StructuredDataType)((Content)context.eContainer()).getMember().getDataType()).allMembers());
return scope;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment