example-projects/ruta-ep-example-extensions/src/main/java/org/apache/uima/ruta/example/extensions/ExampleTypeFunctionIDEExtension.java [41:67]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public boolean checkSyntax(Expression element, IRutaCheckerProblemFactory problemFactory,
          IProblemReporter rep) throws RecognitionException {
    if (element instanceof RutaFunction) {
      RutaFunction f = (RutaFunction) element;
      String name = f.getName();
      if (!name.equals(strings[0])) {
        IProblem problem = problemFactory.createUnknownFunctionProblem(f);
        rep.reportProblem(problem);
        return false;
      }
      boolean ok = true;
      List<ASTNode> childs = f.getChilds();
      if (childs.size() != 1) {
        IProblem problem = problemFactory.createWrongNumberOfArgumentsProblem(name, element, 1);
        rep.reportProblem(problem);
        ok = false;
      }
      ASTNode expr = childs.get(0);
      if (expr instanceof Expression &&  ((Expression)expr).getKind() != RutaTypeConstants.RUTA_TYPE_S) {
        IProblem problem = problemFactory.createWrongArgumentTypeProblem((Expression) expr, "NumberExpression");
        rep.reportProblem(problem);
        ok = false;
      }
      return ok;
    }
    return false;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ruta-ep-core-ext/src/main/java/org/apache/uima/ruta/type/TypeFromStringFunctionIDEExtension.java [41:67]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public boolean checkSyntax(Expression element, IRutaCheckerProblemFactory problemFactory,
          IProblemReporter rep) throws RecognitionException {
    if (element instanceof RutaFunction) {
      RutaFunction f = (RutaFunction) element;
      String name = f.getName();
      if (!name.equals(strings[0])) {
        IProblem problem = problemFactory.createUnknownFunctionProblem(f);
        rep.reportProblem(problem);
        return false;
      }
      boolean ok = true;
      List<ASTNode> childs = f.getChilds();
      if (childs.size() != 1) {
        IProblem problem = problemFactory.createWrongNumberOfArgumentsProblem(name, element, 1);
        rep.reportProblem(problem);
        ok = false;
      }
      ASTNode expr = childs.get(0);
      if (expr instanceof Expression &&  ((Expression)expr).getKind() != RutaTypeConstants.RUTA_TYPE_S) {
        IProblem problem = problemFactory.createWrongArgumentTypeProblem((Expression) expr, "StringExpression");
        rep.reportProblem(problem);
        ok = false;
      }
      return ok;
    }
    return false;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



