Examples of SimpleReference


Examples of org.eclipse.dltk.ast.references.SimpleReference

    @Override
    public boolean visit(Statement s) throws Exception {
      if (s instanceof RutaImportStatement) {
        // handle engine imports
        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);
          }
        }
        if (((RutaImportStatement) s).getType() == RutaStatementConstants.S_IMPORT_UIMAFIT_ENGINE) {
          SimpleReference sRef = (SimpleReference) ((RutaImportStatement) s).getExpression();
          if (RutaCheckerUtils.checkEngineOnClasspath(sRef.getName(), project, classloader)) {
            importEngine(sRef.getName());
          } else {
            IProblem problem = problemFactory.createFileNotFoundProblem(sRef);
            rep.reportProblem(problem);
          }
        }
        // handle script imports
        if (((RutaImportStatement) s).getType() == RutaStatementConstants.S_IMPORT_SCRIPT) {
          SimpleReference stRef = (SimpleReference) ((RutaImportStatement) s).getExpression();
          String sRefName = stRef.getName();
          try {
            Set<String> blocks = RutaCheckerUtils.importScript(sRefName, IModelElement.METHOD,
                    project);
            scripts.add(sRefName);
            if (!blocks.isEmpty()) {
View Full Code Here

Examples of org.eclipse.dltk.ast.references.SimpleReference

      if (s instanceof RutaAction) {
        RutaAction action = (RutaAction) s;
        if (action.getKind() == RutaActionConstants.A_CALL || action.getKind() == RutaActionConstants.A_EXEC) {
          // TODO see antlr grammar: no viable child defined!
          if (action.getChilds().size() > 0) {
            SimpleReference ref = (SimpleReference) action.getChilds().get(0);
            if (ref != null && !engines.contains(ref.getName())) {
              String required = ref.getName();
              for (String script : scripts) {
                // check direct script-call
                boolean a = script.endsWith(required);
                if (a) {
                  return false;
View Full Code Here

Examples of org.eclipse.dltk.ast.references.SimpleReference

      this.packageName = ((RutaPackageDeclaration) s).getName();
      return false;
    }
    if (s instanceof RutaImportTypesStatement) {
      RutaImportTypesStatement stmt = (RutaImportTypesStatement) s;
      SimpleReference tsExpr = (SimpleReference) stmt.getExpression();
      Token typeToken = stmt.getTypeToken();
      Token pkgToken = stmt.getPkgToken();
      Token aliasToken = stmt.getAliasToken();
      if (tsExpr != null) {
        String localPath = tsExpr.getName();
        processCompleteTypeSystemImport(tsExpr, localPath, typeToken, pkgToken, aliasToken);
      } else {
        // TODO package import not supported in Workbench
      }

    } else if (s instanceof RutaImportStatement) {
      // handle type system imports
      if (((RutaImportStatement) s).getType() == RutaStatementConstants.S_IMPORT_TYPESYSTEM) {
        SimpleReference sRef = (SimpleReference) ((RutaImportStatement) s).getExpression();
        String localPath = sRef.getName();
        processCompleteTypeSystemImport(sRef, localPath);
        return false;
      }
      // handle script-imports
      if (((RutaImportStatement) s).getType() == RutaStatementConstants.S_IMPORT_SCRIPT) {
        SimpleReference sRef = (SimpleReference) ((RutaImportStatement) s).getExpression();
        String localPath = sRef.getName();

        // HOTFIX Peter add also the imported types of the imported type system!
        try {
          URL url = null;
          IFile file = RutaCheckerUtils.checkScriptImport(localPath,
View Full Code Here

Examples of org.eclipse.dltk.ast.references.SimpleReference

    int bounds[] = getBounds(pString, dottedId);
    int nameBounds[] = new int[2];
    if (dottedId != null) {
      nameBounds = getBounds(dottedId);
    }
    SimpleReference ref = new SimpleReference(nameBounds[0], nameBounds[1], dottedId == null ? ""
            : dottedId.getText());
    return new RutaPackageDeclaration(bounds[0], bounds[1], ref);
  }
View Full Code Here

Examples of org.eclipse.dltk.ast.references.SimpleReference

  private static RutaVariableDeclaration createVariable(Token id, Token typeToken, int type,
          Expression expr) {
    int declBounds[] = getBounds(typeToken, id);
    int nameBounds[] = getBounds(id);
    // FieldDeclaration
    SimpleReference ref = new RutaVariableReference(nameBounds[0], nameBounds[1], id.getText(),
            type);
    return new RutaVariableDeclaration(id.getText(), nameBounds[0], nameBounds[1], declBounds[0],
            declBounds[1], ref, type, expr);
  }
View Full Code Here

Examples of org.eclipse.dltk.ast.references.SimpleReference

      declBounds = getBounds(declareToken, features.get(features.size() - 1));
    }
    int nameBounds[] = getBounds(id);
    // FieldDeclarartion

    SimpleReference ref = new RutaVariableReference(nameBounds[0], nameBounds[1], id.getText(),
            RutaTypeConstants.RUTA_TYPE_AT);
    return new RutaTypeDeclaration(id.getText(), nameBounds[0], nameBounds[1], declBounds[0],
            declBounds[1], ref, features);
  }
View Full Code Here

Examples of org.eclipse.dltk.ast.references.SimpleReference

  public static Declaration createAnnotationType(Token id, Token declareToken) {
    int declBounds[] = getBounds(declareToken, id);
    int nameBounds[] = getBounds(id);

    SimpleReference ref = new RutaVariableReference(nameBounds[0], nameBounds[1], id.getText(),
            RutaTypeConstants.RUTA_TYPE_AT);
    return new RutaTypeDeclaration(id.getText(), nameBounds[0], nameBounds[1], declBounds[0],
            declBounds[1], ref);
  }
View Full Code Here

Examples of org.eclipse.dltk.ast.references.SimpleReference

      Token token = (Token) eachTO;
      type = token.getText();
      declBounds = getBounds(eachName, token);
    }
    int nameBounds[] = getBounds(eachName);
    SimpleReference ref = new SimpleReference(nameBounds[0], nameBounds[1], eachName.getText());
    return new RutaFeatureDeclaration(eachName.getText(), type, nameBounds[0], nameBounds[1],
            declBounds[0], declBounds[1], ref, eachTO);
  }
View Full Code Here

Examples of org.eclipse.dltk.ast.references.SimpleReference

      } catch (ModelException e) {
        if (DLTKCore.DEBUG) {
          e.printStackTrace();
        }
      }
      SimpleReference ref = new SimpleReference(off + sourcePosition, off + sourceEndPosition, name);
      IMethod[] methods = findMethods(name, argCount, off + sourcePosition);
      fSearchResults.put(ref, methods);
    }
View Full Code Here

Examples of org.eclipse.dltk.ast.references.SimpleReference

        }

        if (match.getElement() != null && match.getElement() instanceof IModelElement) {
          IModelElement member = (IModelElement) match.getElement();
          ISourceModule module = (ISourceModule) member.getAncestor(IModelElement.SOURCE_MODULE);
          SimpleReference ref = new SimpleReference(match.getOffset(), match.getOffset()
                  + match.getLength(), "");
          try {
            IModelElement[] e = module.codeSelect(match.getOffset(), 1);
            for (int j = 0; j < e.length; ++j) {
              if (e[j].equals(parent)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.