Package org.eclipse.dltk.ast.references

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


    @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();
          importEngine(sRef.getName());
        }
        if (((RutaImportStatement) s).getType() == RutaStatementConstants.S_IMPORT_ENGINE) {
          SimpleReference sRef = (SimpleReference) ((RutaImportStatement) s).getExpression();
          importEngine(sRef.getName());
        }
        // handle script imports
        if (((RutaImportStatement) s).getType() == RutaStatementConstants.S_IMPORT_SCRIPT) {
          importScript(s);
        }
View Full Code Here

          if (impFields.containsKey(name)) {
            results.add(impFields.get(name));
          }
        }
        if (s != null && s.getKind() == RutaActionConstants.A_CALL) {
          SimpleReference sr = (SimpleReference) s.getChilds().get(0);
          if (sr != null) {
            String name = sr.getName();
            if (engines.contains(name)) {
              // referenceEngineCall(name);
            } else if (scripts.containsKey(name)) {
              findImportedDeclaration(name, results, IMethod.class);
            } else {
View Full Code Here

    /**
     * @param s
     * @throws ModelException
     */
    private void importScript(Statement s) throws ModelException {
      SimpleReference sRef = (SimpleReference) ((RutaImportStatement) s).getExpression();
      String sRefName = sRef.getName();
      importScript(sRefName);
    }
View Full Code Here

      String sRefName = sRef.getName();
      importScript(sRefName);
    }

    private void importTypesystem(Statement s) {
      SimpleReference sRef = (SimpleReference) ((RutaImportStatement) s).getExpression();

      // TODO not working yet
      // importTypesystem(sRefName);

    }
View Full Code Here

    if (node != null && node.sourceStart() <= position && position <= node.sourceEnd()) {
      // this is empty module case
      if (node instanceof ModuleDeclaration) {
        ModuleDeclaration unit = (ModuleDeclaration) node;
        List exprs = new ArrayList();
        exprs.add(new SimpleReference(position, position, ""));
        RutaEmptyCompleteStatement statement = new RutaEmptyCompleteStatement(exprs);
        unit.addStatement(statement);
        this.parseBlockStatements(statement, unit, position);
      } else if (node instanceof MethodDeclaration) {
        // empty keyword like completion.
        MethodDeclaration method = (MethodDeclaration) node;
        List exprs = new ArrayList();
        exprs.add(new SimpleReference(position, position, ""));
        RutaEmptyCompleteStatement statement = new RutaEmptyCompleteStatement(exprs);
        method.getStatements().add(statement);
        this.parseBlockStatements(statement, method, position);
      } else if (node instanceof TypeDeclaration) {
        // empty keyword like completion.
        TypeDeclaration type = (TypeDeclaration) node;
        List exprs = new ArrayList();
        exprs.add(new SimpleReference(position, position, ""));
        RutaEmptyCompleteStatement statement = new RutaEmptyCompleteStatement(exprs);
        type.getStatements().add(statement);
        // this.assistNodeParent = node;
        this.parseBlockStatements(statement, type, position);
        // } else if (node instanceof RutaExecuteExpression) {
View Full Code Here

  private boolean checkVariableWithoutDollarCompletion(RutaStatement statement, int position) {
    // TODO: Add more compecated check.
    Expression e = statement.getAt(0);
    if (e instanceof SimpleReference) {
      SimpleReference ref = (SimpleReference) e;
      String name = ref.getName();
      if (name.equals("set")) {
        return true;
      }
    }
    return false;
View Full Code Here

    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

  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

      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

TOP

Related Classes of org.eclipse.dltk.ast.references.SimpleReference

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.