ASTNode parent = dds.getParent();
if (parent != null && parent instanceof RutaVariableReference) {
RutaVariableReference p = (RutaVariableReference) parent;
String name = p.getName();
if (finalTypes.contains(name)) {
IProblem problem = problemFactory.createInheritenceFinalProblem(p);
rep.reportProblem(problem);
}
}
return true;
}
if (s instanceof RutaVariableDeclaration) {
RutaVariableDeclaration newVar = (RutaVariableDeclaration) s;
// if (otherVariables.contains(newVar.getName())) {
// IProblem problem = problemFactory
// .createVarAlreadyDeclaredProblem(newVar);
// rep.reportProblem(problem);
// return false;
// }
if (shortTypes.contains(newVar.getName())) {
IProblem problem = problemFactory.createIdConflictsWithTypeProblem(newVar);
rep.reportProblem(problem);
return false;
}
if ((newVar.getKind() & RutaTypeConstants.RUTA_TYPE_AT) != 0) {
typeVariables.add(newVar.getName());
return false;
}
otherVariables.add(newVar.getName());
return false;
}
// if (s instanceof RutaFeatureDeclaration) {
// RutaFeatureDeclaration fd = (RutaFeatureDeclaration) s;
// }
if (s instanceof RutaTypeDeclaration) {
RutaTypeDeclaration newType = (RutaTypeDeclaration) s;
if (reportWarningOnShortNames && shortTypes.contains(newType.getName())) {
IProblem problem = problemFactory.createDuplicateShortName(newType,
ProblemSeverity.WARNING);
rep.reportProblem(problem);
return false;
}
String longName = getLongLocalName(newType.getName());
if (completeTypes.contains(longName)) {
IProblem problem = problemFactory.createIdConflictsWithTypeProblem(newType);
rep.reportProblem(problem);
return false;
}
if (typeVariables.contains(newType.getName()) || otherVariables.contains(newType.getName())) {
IProblem problem = problemFactory.createIdConflictsWithVariableProblem(newType);
rep.reportProblem(problem);
return false;
}
List<RutaFeatureDeclaration> features = newType.getFeatures();
if (features != null) {
for (RutaFeatureDeclaration each : features) {
String type = each.getType();
if (type.equals("INT") || type.equals("STRING") || type.equals("DOUBLE")
|| type.equals("FLOAT") || type.equals("BOOLEAN")) {
continue;
}
if (!shortTypes.contains(type) && !completeTypes.contains(type)
&& !otherTypes.contains(type)) {
IProblem problem = problemFactory.createUnknownFeatureTypeProblem(each);
rep.reportProblem(problem);
}
}
}
String[] nameSplit = newType.getName().split("[.]");