use of org.eclipse.titan.designer.AST.CachedReferenceChain in project titan.EclipsePlug-ins by eclipse.
the class TTCN3_Choice_Type method checkRecursions.
@Override
public /**
* {@inheritDoc}
*/
void checkRecursions(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain) {
if (!referenceChain.add(this) || compFieldMap.isEmpty()) {
return;
}
// FIXME there should be a better way than checking for all possible IReferenceChain implementation
CachedReferenceChain cachedChain;
if (referenceChain instanceof CachedReferenceChain) {
cachedChain = (CachedReferenceChain) referenceChain;
} else {
if (!(referenceChain instanceof ReferenceChain)) {
return;
}
cachedChain = ((ReferenceChain) referenceChain).toCachedReferenceChain();
}
final Map<String, CompField> map = compFieldMap.getComponentFieldMap(timestamp);
cachedChain.markErrorState();
int i = 1;
for (final CompField compField : map.values()) {
final IType type = compField.getType();
if (type != null) {
cachedChain.markState();
type.checkRecursions(timestamp, cachedChain);
cachedChain.previousState();
}
if (cachedChain.getNofErrors() < i) {
break;
}
++i;
}
if (cachedChain.getNofErrors() == map.size()) {
cachedChain.reportAllTheErrors();
}
cachedChain.prevErrorState();
}
Aggregations