use of org.eclipse.titan.designer.AST.IReferenceableElement in project titan.EclipsePlug-ins by eclipse.
the class ASN1_Set_Seq_Choice_BaseType method resolveReference.
@Override
public /**
* {@inheritDoc}
*/
Declaration resolveReference(final Reference reference, final int subRefIdx, final ISubReference lastSubreference) {
final List<ISubReference> subreferences = reference.getSubreferences();
int actualIndex = subRefIdx;
while (actualIndex < subreferences.size() && subreferences.get(actualIndex) instanceof ArraySubReference) {
++actualIndex;
}
if (actualIndex == subreferences.size()) {
return null;
}
final Identifier fieldID = subreferences.get(actualIndex).getId();
if (subreferences.get(actualIndex) == lastSubreference) {
return Declaration.createInstance(getDefiningAssignment(), fieldID);
}
final CompField compField = getComponentByName(fieldID);
final IType compFieldType = compField.getType().getTypeRefdLast(CompilationTimeStamp.getBaseTimestamp());
if (compFieldType instanceof IReferenceableElement) {
final Declaration decl = ((IReferenceableElement) compFieldType).resolveReference(reference, actualIndex + 1, lastSubreference);
return decl != null ? decl : Declaration.createInstance(getDefiningAssignment(), compField.getIdentifier());
}
return null;
}
use of org.eclipse.titan.designer.AST.IReferenceableElement in project titan.EclipsePlug-ins by eclipse.
the class TTCN3_Set_Seq_Choice_BaseType method resolveReference.
@Override
public /**
* {@inheritDoc}
*/
Declaration resolveReference(final Reference reference, final int subRefIdx, final ISubReference lastSubreference) {
final List<ISubReference> subreferences = reference.getSubreferences();
int localIndex = subRefIdx;
while (localIndex < subreferences.size() && subreferences.get(localIndex) instanceof ArraySubReference) {
++localIndex;
}
if (localIndex == subreferences.size()) {
return null;
}
final CompField compField = getComponentByName(subreferences.get(localIndex).getId().getName());
if (compField == null) {
return null;
}
if (subreferences.get(localIndex) == lastSubreference) {
return Declaration.createInstance(getDefiningAssignment(), compField.getIdentifier());
}
final IType compFieldType = compField.getType().getTypeRefdLast(CompilationTimeStamp.getBaseTimestamp());
if (compFieldType instanceof IReferenceableElement) {
final Declaration decl = ((IReferenceableElement) compFieldType).resolveReference(reference, localIndex + 1, lastSubreference);
return decl != null ? decl : Declaration.createInstance(getDefiningAssignment(), compField.getIdentifier());
}
return null;
}
Aggregations