Package org.eclipse.dltk.ast

Examples of org.eclipse.dltk.ast.ASTNode


    @Override
    public boolean endvisit(Expression s) throws Exception {
      if (s instanceof Block && s.sourceStart() <= position && s.sourceEnd() >= position) {
        // We are in block, and no in node completion are done.
        String[] keywords = checkKeywords("", MODULE);
        ASTNode inNode = RutaParseUtils.getScopeParent(module, s);
        ASTNode nde = new CompletionOnKeywordOrFunction("", inNode, s, keywords);
        assistNodeParent = inNode;
        throw new CompletionNodeFound(nde, null);
      }
      return super.endvisit(s);
    }
View Full Code Here


        RutaSelectionParser parser = new RutaSelectionParser();
        ModuleDeclaration moduleDeclaration = parser.parse(sm);
        String word = document.get(wordRegion.getOffset(), wordRegion.getLength());
        RutaReferenceVisitor referenceVisitor = new RutaReferenceVisitor(wordRegion.getOffset());
        moduleDeclaration.traverse(referenceVisitor);
        ASTNode node = referenceVisitor.getResult();
        if (node instanceof RutaVariableReference
                && moduleDeclaration instanceof RutaModuleDeclaration) {
          RutaVariableReference vr = (RutaVariableReference) node;
          RutaModuleDeclaration parsed = (RutaModuleDeclaration) moduleDeclaration;
          if (vr.getType() == RutaTypeConstants.RUTA_TYPE_AT) {
View Full Code Here

    } else {
      int offset = sourceViewer.getVisibleRegion().getOffset();
      caret = offset + styledText.getCaretOffset();
    }
    RutaReferenceVisitor visitor1 = new RutaReferenceVisitor(caret);
    ASTNode node = null;
    try {
      parsed.traverse(visitor1);
    } catch (Exception e) {
    }
    node = visitor1.getResult();
View Full Code Here

      if (s != null && s.getChilds() != null) {
        children = s.getChilds();
        Iterator it = children.iterator();
        while (it.hasNext()) {
          ASTNode n = (ASTNode) it.next();
          requestor.addPosition(n.sourceStart(), n.sourceEnd(),
                  RutaPreferenceConstants.EDITOR_DECLARATION_DEFINITION_COLOR);
        }
      }

      requestor.addPosition(t.getNameStart(), t.getNameEnd(),
View Full Code Here

    }
  }

  private void traverse(List result, List statements, int offset, String code) {
    for (Iterator iterator = statements.iterator(); iterator.hasNext();) {
      ASTNode node = (ASTNode) iterator.next();
      if (node instanceof RutaStatement) {
        checkStatement(code, offset, result, (Statement) node);
      } else if (node instanceof TypeDeclaration) {
        TypeDeclaration statement = (TypeDeclaration) node;
        result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
View Full Code Here

    }
  }

  private void traverse(List result, List statements, int offset, String code) {
    for (Iterator iterator = statements.iterator(); iterator.hasNext();) {
      ASTNode node = (ASTNode) iterator.next();
      if (node instanceof RutaStatement) {
        checkStatement(code, offset, result, (Statement) node);
      } else if (node instanceof TypeDeclaration) {
        TypeDeclaration statement = (TypeDeclaration) node;
        result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
View Full Code Here

    List statements = getStatements(node);

    if (statements != null) {
      int len = statements.size();
      for (int i = 0; i < len; ++i) {
        ASTNode nde = (ASTNode) statements.get(i);

        extendStatement(nde, content);
        extendStatements(nde, content);
      }
    }
View Full Code Here

    if (statements == null) {
      return;
    }
    Iterator i = statements.iterator();
    while (i.hasNext()) {
      ASTNode n = (ASTNode) i.next();
      if (n.equals(node)) {
        elements.add(n);
        return;
      }
      if (n.sourceStart() <= node.sourceStart() && node.sourceEnd() <= n.sourceEnd()) {
        elements.add(n);
        findElementsTo(RutaASTUtil.getStatements(n), node, elements);
        return;
      }
    }
View Full Code Here

    // taking care of null statements - errors should have been recognized
    // in parser
    filterNullObjects(quantifierPartExpressions);
    filterNullObjects(conditions);
    filterNullObjects(actions);
    ASTNode quantifierPart = null;
    if (quantifierPartExpressions != null && !quantifierPartExpressions.isEmpty()) {
      quantifierPart = quantifierPartExpressions.get(quantifierPartExpressions.size() - 1);
    }
    if (quantifierPart != null) {
      bounds[1] = Math.max(bounds[1], quantifierPart.sourceEnd());
    }
    return new RutaRuleElement(bounds[0], bounds[1], head, quantifierPartExpressions,
            conditions, actions);
  }
View Full Code Here

    } else {
      int offset = sourceViewer.getVisibleRegion().getOffset();
      caret = offset + styledText.getCaretOffset();
    }
    RutaReferenceVisitor visitor1 = new RutaReferenceVisitor(caret);
    ASTNode node = null;
    try {
      parsed.traverse(visitor1);
    } catch (Exception e) {
    }
    node = visitor1.getResult();
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.ast.ASTNode

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.