Package org.eclipse.dltk.compiler.problem

Examples of org.eclipse.dltk.compiler.problem.IProblem


        // declared as type?
        if (knownLocalTypeNames.contains(ref.getName())) {
          String errMsg = "\"" + ref.getName()
                  + "\" declared as a ANNOTATION_TYPE. Variable of type "
                  + RutaTypeConstants.typeStringOfInt.get(ref.getType()) + " required.";
          IProblem problem = new RutaCheckerDefaultProblem(currentFile.getElementName(),
                  errMsg, ref, linetracker.getLineNumberOfOffset(ref.sourceStart()));
          rep.reportProblem(problem);
          return false;
        }
        // not found
        String errMsg = errMsgHead + ref.getName() + "\" not" + errMsgTailDefault;
        IProblem problem = new RutaCheckerDefaultProblem(currentFile.getElementName(),
                errMsg, ref, linetracker.getLineNumberOfOffset(ref.sourceStart()));
        rep.reportProblem(problem);
        return false;
      }
      return true;
View Full Code Here


          IProblemReporter rep) throws RecognitionException {
    if (element instanceof RutaAction) {
      RutaAction a = (RutaAction) element;
      String name = a.getName();
      if (!name.equals(strings[0])) {
        IProblem problem = problemFactory.createUnknownActionProblem(a);
        rep.reportProblem(problem);
        return false;
      }
      boolean ok = true;
      List<Expression> childs = a.getChilds();
      for (Expression expression : childs) {
        if (expression.getKind() != RutaTypeConstants.RUTA_TYPE_N) {
          IProblem problem = problemFactory.createWrongArgumentTypeProblem(expression, "NumberExpression");
          rep.reportProblem(problem);
          ok = false;
        }
      }
      return ok;
View Full Code Here

          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<Expression> childs = f.getChilds();
      if(childs.size() != 1) {
        IProblem problem = problemFactory.createWrongNumberOfArgumentsProblem(name, element, 1);
        rep.reportProblem(problem);
        ok = false;
      }
      Expression expr = childs.get(0);
      if(expr.getKind() != RutaTypeConstants.RUTA_TYPE_AT) {
        IProblem problem = problemFactory.createWrongArgumentTypeProblem(expr, "TypeExpression");
        rep.reportProblem(problem);
        ok = false;
      }
      return ok;
    }
View Full Code Here

          IProblemReporter rep) throws RecognitionException {
    if (element instanceof RutaCondition) {
      RutaCondition a = (RutaCondition) element;
      String name = a.getName();
      if (!name.equals(strings[0])) {
        IProblem problem = problemFactory.createUnknownConditionProblem(a);
        rep.reportProblem(problem);
        return false;
      }
      boolean ok = true;
      List<Expression> childs = a.getChilds();
      if(childs.size() != 2) {
        IProblem problem = problemFactory.createWrongNumberOfArgumentsProblem(name, element, 2);
        rep.reportProblem(problem);
        ok = false;
      }
      for (Expression expression : childs) {
        if (expression.getKind() != RutaTypeConstants.RUTA_TYPE_S) {
          IProblem problem = problemFactory.createWrongArgumentTypeProblem(expression, "StringExpression");
          rep.reportProblem(problem);
          ok = false;
        }
      }
      return ok;
View Full Code Here

      if (RutaCheckerUtils.checkRessourceExistence(resRef.getValue(), project)) {
        return false;
      }
      // ressource not valid
      String errMsg = errMsgHead + resRef.getValue() + errMsgTailDefault;
      IProblem problem = new RutaCheckerDefaultProblem(currentFile, errMsg, resRef,
              linetracker.getLineNumberOfOffset(resRef.sourceStart()));
      rep.reportProblem(problem);
      return false;
    }
View Full Code Here

    String errMsgHead = "Type \"";

    String errMsgTailDefault = " \" not defined in this script/block!";
    String errMsg = errMsgHead + ref.getName() + errMsgTailDefault;
    IProblem problem = new RutaCheckerDefaultProblem(currentFile.getElementName(), errMsg,
            ref, linetracker.getLineNumberOfOffset(ref.sourceStart()));
    return problem;
  }
View Full Code Here

        if (((RutaImportStatement) s).getType() == RutaStatementConstants.S_IMPORT_ENGINE) {
          SimpleReference sRef = (SimpleReference) ((RutaImportStatement) s).getExpression();
          if (RutaCheckerUtils.checkEngineImport(sRef.getName(), project)) {
            importEngine(sRef.getName());
          } else {
            IProblem problem = problemFactory.createFileNotFoundProblem(sRef);
            rep.reportProblem(problem);
          }
        }
        // handle script imports
        if (((RutaImportStatement) s).getType() == RutaStatementConstants.S_IMPORT_SCRIPT) {
View Full Code Here

          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<Expression> childs = f.getChilds();
      if(childs.size() != 1) {
        IProblem problem = problemFactory.createWrongNumberOfArgumentsProblem(name, element, 1);
        rep.reportProblem(problem);
        ok = false;
      }
      Expression expr = childs.get(0);
      if(expr.getKind() != RutaTypeConstants.RUTA_TYPE_AT) {
        IProblem problem = problemFactory.createWrongArgumentTypeProblem(expr, "TypeExpression");
        rep.reportProblem(problem);
        ok = false;
      }
      return ok;
    }
View Full Code Here

          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<Expression> childs = f.getChilds();
      if(childs.size() != 1) {
        IProblem problem = problemFactory.createWrongNumberOfArgumentsProblem(name, element, 1);
        rep.reportProblem(problem);
        ok = false;
      }
      Expression expr = childs.get(0);
      if(expr.getKind() != RutaTypeConstants.RUTA_TYPE_S) {
        IProblem problem = problemFactory.createWrongArgumentTypeProblem(expr, "NumberExpression");
        rep.reportProblem(problem);
        ok = false;
      }
      return ok;
    }
View Full Code Here

          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<Expression> childs = f.getChilds();
      if(childs.size() != 1) {
        IProblem problem = problemFactory.createWrongNumberOfArgumentsProblem(name, element, 1);
        rep.reportProblem(problem);
        ok = false;
      }
      Expression expr = childs.get(0);
      if(expr.getKind() != RutaTypeConstants.RUTA_TYPE_AT) {
        IProblem problem = problemFactory.createWrongArgumentTypeProblem(expr, "TypeExpression");
        rep.reportProblem(problem);
        ok = false;
      }
      return ok;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.compiler.problem.IProblem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.