Package org.apache.uima.ruta.ide.parser.ast

Examples of org.apache.uima.ruta.ide.parser.ast.RutaAction


        checkTypeOfReference(ref);
        return false;
      }
      // check assign types
      if (s instanceof RutaAction) {
        RutaAction tma = (RutaAction) s;

        String actionName = currentFile.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)) {
          IProblem problem = problemFactory.createUnknownActionProblem(tma);
          rep.reportProblem(problem);
        }

        IRutaExtension extension = actionExtensions.get(actionName);
        if (extension != null) {
          // boolean checkSyntax =
          extension.checkSyntax(tma, problemFactory, rep);
        }

        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);
          if (!featureFound) {
            IProblem problem = problemFactory.createUnknownFeatureProblem(stringExpr, matchedType);
            rep.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) {
View Full Code Here


        Annotation annotation = new Annotation(SearchPlugin.SEARCH_ANNOTATION_TYPE, true, null);
        Position position = null;
        int sourceStart = each.sourceStart();
        int sourceEnd = each.sourceEnd();
        if (each instanceof RutaAction) {
          RutaAction e = (RutaAction) each;
          sourceStart = e.getNameStart();
          sourceEnd = e.getNameEnd();
        } else if (each instanceof RutaCondition) {
          RutaCondition e = (RutaCondition) each;
          sourceStart = e.getNameStart();
          sourceEnd = e.getNameEnd();
        }
        position = new Position(sourceStart, sourceEnd - sourceStart);
        myAnnotations.put(annotation, position);
      }
      addAnnotations(myAnnotations);
View Full Code Here

      appendRuleElement(ruleEl);
      return false;
    }
    // special format for actions
    if (s instanceof RutaAction) {
      RutaAction a = (RutaAction) s;
      String name = document.get(a.getNameStart(), a.getNameEnd());
      append(name);
      List<? extends ASTNode> childs = a.getChilds();
      if (childs != null && !childs.isEmpty()) {
        append(PAR_OPEN);
        // special format for create
        if (a instanceof RutaStructureAction) {
          if (name.equals("TRIE")) {
View Full Code Here

TOP

Related Classes of org.apache.uima.ruta.ide.parser.ast.RutaAction

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.