Package org.eclipse.dltk.ast.references

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


      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);
  }
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());
        }
        // 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.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();
      String sRefName = sRef.getName();

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

    }
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();
          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) {
          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

      if (s instanceof RutaAction) {
        RutaAction action = (RutaAction) s;
        if (action.getKind() == RutaActionConstants.A_CALL) {
          // 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

      } 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

        }

        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

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.