Package org.eclipse.dltk.ast.declarations

Examples of org.eclipse.dltk.ast.declarations.MethodDeclaration


    return null;
  }

  public static String getNodeChildName(ASTNode node) {
    if (node instanceof MethodDeclaration) {
      MethodDeclaration method = (MethodDeclaration) node;
      String name = method.getName();
      if (name.indexOf("::") != -1) {
        return name.substring(name.lastIndexOf("::") + 2);
      }
      return name;
    } else if (node instanceof TypeDeclaration) {
View Full Code Here


    return null;
  }

  public void searchInMethod(final ASTNode node, IParent element, ASTNode nde,
          List selectionElements) {
    MethodDeclaration method = (MethodDeclaration) nde;
    String methodName = method.getName();
    if (methodName.indexOf("::") != -1) {
      String pName = methodName.substring(0, methodName.lastIndexOf("::"));
      pName = pName.replaceAll("::", "\\$");
      if (pName.equals("$")) {
        element = sourceModule;
View Full Code Here

        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();
View Full Code Here

  public HighlightedPosition[] calculatePositions(ASTNode node,
          ISemanticHighlightingRequestor requestor) {

    // Check Ruta procedures
    if (node instanceof MethodDeclaration) {
      MethodDeclaration m = (MethodDeclaration) node;
      requestor.addPosition(m.getNameStart(), m.getNameEnd(),
              RutaPreferenceConstants.EDITOR_FUNCTION_COLOR);

    }

    if (node instanceof Argument) {
      Argument m = (Argument) node;
      requestor.addPosition(m.getNameStart(), m.getNameEnd(),
              RutaPreferenceConstants.EDITOR_VARIABLE_COLOR);
    }

    if (node instanceof TypeDeclaration) {
View Full Code Here

        TypeDeclaration statement = (TypeDeclaration) node;
        result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
                .sourceEnd() - statement.sourceStart())));
        traverse(result, statement.getStatements(), offset, code);
      } else if (node instanceof MethodDeclaration) {
        MethodDeclaration statement = (MethodDeclaration) node;
        result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
                .sourceEnd() - statement.sourceStart())));
        traverse(result, statement.getStatements(), offset, code);
      }
    }
  }
View Full Code Here

        TypeDeclaration statement = (TypeDeclaration) node;
        result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
                .sourceEnd() - statement.sourceStart())));
        traverse(result, statement.getStatements(), offset, code);
      } else if (node instanceof MethodDeclaration) {
        MethodDeclaration statement = (MethodDeclaration) node;
        result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
                .sourceEnd() - statement.sourceStart())));
        traverse(result, statement.getStatements(), offset, code);
      }
    }
  }
View Full Code Here

    return null;
  }

  public static String getNodeChildName(ASTNode node) {
    if (node instanceof MethodDeclaration) {
      MethodDeclaration method = (MethodDeclaration) node;
      String name = method.getName();
      if (name.indexOf("::") != -1) {
        return name.substring(name.lastIndexOf("::") + 2);
      }
      return name;
    } else if (node instanceof TypeDeclaration) {
View Full Code Here

    return null;
  }

  public void searchInMethod(final ASTNode node, IParent element, ASTNode nde,
          List selectionElements) {
    MethodDeclaration method = (MethodDeclaration) nde;
    String methodName = method.getName();
    if (methodName.indexOf("::") != -1) {
      String pName = methodName.substring(0, methodName.lastIndexOf("::"));
      pName = pName.replaceAll("::", "\\$");
      if (pName.equals("$")) {
        element = sourceModule;
View Full Code Here

  public HighlightedPosition[] calculatePositions(ASTNode node,
          ISemanticHighlightingRequestor requestor) {

    // Check Ruta procedures
    if (node instanceof MethodDeclaration) {
      MethodDeclaration m = (MethodDeclaration) node;
      requestor.addPosition(m.getNameStart(), m.getNameEnd(), RutaPreferenceConstants.EDITOR_FUNCTION_COLOR);

    }

    if (node instanceof Argument) {
      Argument m = (Argument) node;
      requestor.addPosition(m.getNameStart(), m.getNameEnd(), RutaPreferenceConstants.EDITOR_VARIABLE_COLOR);
    }

    if (node instanceof TypeDeclaration) {

      TypeDeclaration t = (TypeDeclaration) node;
View Full Code Here

  protected String buildPathForMethod(IMethod method) {

    ISourceModule sourceModule = method.getSourceModule();
    ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(sourceModule);
    MethodDeclaration methodDeclaration;
    try {
      methodDeclaration = PHPModelUtils.getNodeByMethod(
          moduleDeclaration, method);
    } catch (ModelException e) {
      return null;
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.ast.declarations.MethodDeclaration

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.