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

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


      }
      return false;
      // return true;
    }
    if (s instanceof RutaTypeDeclaration) {
      RutaTypeDeclaration rtd = (RutaTypeDeclaration) s;
      append(document.get(rtd.getNameStart(), rtd.getNameEnd()));
      List<RutaFeatureDeclaration> features = ((RutaTypeDeclaration) s).getFeatures();
      if (features != null && !features.isEmpty()) {
        append(PAR_OPEN);
        for (RutaFeatureDeclaration each : features) {
          append(each.getType());
View Full Code Here


        }
      }
      return true;
    }
    if (s instanceof RutaTypeDeclaration) {
      RutaTypeDeclaration newType = (RutaTypeDeclaration) s;
      String shortName = newType.getName();
      String longName = getLongNameOfNewType(shortName);

      if (namespaces.values().contains(longName)) {
        IProblem problem = problemFactory.createIdConflictsWithTypeProblem(newType);
        pr.reportProblem(problem);
        return false;
      }

      if (reportWarningOnShortNames && namespaces.containsKey(shortName)) {
        IProblem problem = problemFactory
                .createDuplicateShortName(newType, ProblemSeverity.WARNING);
        pr.reportProblem(problem);
        return false;
      }
      if (knowsVariable(shortName)) {
        IProblem problem = problemFactory.createIdConflictsWithVariableProblem(newType);
        pr.reportProblem(problem);
        return false;
      }
      List<RutaFeatureDeclaration> features = newType.getFeatures();
      Set<FeatureDescription> feats = new HashSet<FeatureDescription>();
      if (parentTypeInDeclaration != null) {
        Set<FeatureDescription> set = featureDescriptionMap.get(parentTypeInDeclaration);
        if (set != null) {
          feats.addAll(set);
View Full Code Here

      }
      // 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("[.]");
        String shortName = nameSplit[nameSplit.length - 1];

        completeTypes.add(longName);
        shortTypes.add(shortName);
        return false;
View Full Code Here

TOP

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

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.