String featText = fme.getFeature().getText();
checkTypeOfFeatureMatch(featText, fme);
return true;
}
if (s instanceof RutaVariableReference) {
RutaVariableReference ref = (RutaVariableReference) s;
if ((ref.getType() & RutaTypeConstants.RUTA_TYPE_AT) != 0) {
// types
String name = ref.getName();
if (name.equals("Document")) {
return false;
}
Set<String> set = ambiguousTypeAlias.get(name);
if (set != null && !set.isEmpty()) {
pr.reportProblem(problemFactory.createAmbiguousShortName(ref, set, ProblemSeverity.ERROR));
return false;
}
if (namespaces.keySet().contains(name) || namespaces.values().contains(name)
|| allLongTypeNames.contains(name)
|| getVariableType(name) == RutaTypeConstants.RUTA_TYPE_AT) {
return false;
}
if (isFeatureMatch(ref.getName()) != null) {
return false;
}
pr.reportProblem(problemFactory.createTypeProblem(ref, sourceModule));
return false;
}
if (!isVariableDeclared(ref)) {
return false;
}
checkTypeOfVariable(ref);
return false;
}
// check assign types
if (s instanceof RutaAction) {
RutaAction tma = (RutaAction) s;
String actionName = sourceModule.getSource().substring(tma.getNameStart(), tma.getNameEnd());
String[] keywords = RutaKeywordsManager.getKeywords(IRutaKeywords.ACTION);
List<String> asList = Arrays.asList(keywords);
if (!StringUtils.isEmpty(actionName) && !"-".equals(actionName)
&& !asList.contains(actionName) && !implicitString.equals(tma.getName())) {
IProblem problem = problemFactory.createUnknownActionProblem(tma);
pr.reportProblem(problem);
}
IRutaExtension extension = actionExtensions.get(actionName);
if (extension != null) {
extension.checkSyntax(tma, problemFactory, pr);
}
if (tma.getName().equals("GETFEATURE") || tma.getName().equals("SETFEATURE")) {
List<?> childs = tma.getChilds();
RutaStringExpression stringExpr = (RutaStringExpression) childs.get(0);
String feat = stringExpr.toString();
feat = getFeatureName(stringExpr, feat);
boolean featureFound = findFeature(matchedType, feat, -1);
if (!featureFound) {
IProblem problem = problemFactory.createUnknownFeatureProblem(stringExpr, matchedType);
pr.reportProblem(problem);
}
}
if (tma.getKind() == RutaActionConstants.A_ASSIGN) {
List<?> childs = tma.getChilds();
try {
RutaVariableReference ref = (RutaVariableReference) childs.get(0);
RutaExpression expr = (RutaExpression) childs.get(1);
int type = expr.getKind();
if (ref.getType() == RutaTypeConstants.RUTA_TYPE_G) {
ref.setType(type);
}
} catch (IndexOutOfBoundsException e) {
// exception should have been recognized and reported in
// parser
return false;