Package org.eclipse.dltk.ast

Examples of org.eclipse.dltk.ast.ASTNode


  public String toString() {
    String value = "";
    if (this.expressions != null) {
      Iterator i = this.expressions.iterator();
      while (i.hasNext()) {
        ASTNode node = (ASTNode) i.next();
        value += node.toString();
        value += " ";
      }
    }

    return value;
View Full Code Here


    // in parser
    filterNullObjects(res);
    filterNullObjects(q);
    filterNullObjects(c);
    filterNullObjects(a);
    ASTNode quantifierPart = null;
    if (q != null && !q.isEmpty()) {
      quantifierPart = q.get(q.size() - 1);
    }
    if (quantifierPart != null) {
      bounds[1] = Math.max(bounds[1], quantifierPart.sourceEnd());
    }
    if (c != null && !c.isEmpty()) {
      bounds[1] = Math.max(bounds[1], c.get(c.size() - 1).sourceEnd());
    }
    if (a != null && !a.isEmpty()) {
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(), RutaPreferenceConstants.EDITOR_VARIABLE_COLOR);
    }
View Full Code Here

      // print type token
      appendIntoNewLine(document.get(decls.getTypeTokenStart(), decls.getTypeTokenEnd()) + " ");
      // print parent if available
      if (s instanceof RutaDeclareDeclarationsStatement) {
        RutaDeclareDeclarationsStatement dds = (RutaDeclareDeclarationsStatement) s;
        ASTNode p = dds.getParent();
        if (p != null) {
          append(p);
          append(" ");
        }
      }
View Full Code Here

            && ((RutaExpression) s).getExpression() != null) {
      RutaStringExpression tmse = (RutaStringExpression) s;
      List<?> childs = tmse.getExpression().getChilds();
      Object object2 = childs.get(0);
      if (object2 instanceof ASTNode) {
        ASTNode astnode = (ASTNode) object2;
        List<?> childs2 = astnode.getChilds();
        for (Object object : childs2) {
          if (object instanceof RutaExpression) {
            RutaExpression expr = (RutaExpression) object;
            // if (expr.isInParantheses()) {
            // append(PAR_OPEN);
View Full Code Here

    // print Quantifiers
    List<? extends ASTNode> quantifierExpressions = ruleEl.getQuantifierExpressions();
    if (quantifierExpressions != null && !quantifierExpressions.isEmpty()) {
      if (quantifierExpressions.size() == 1) {
        ASTNode astNode = quantifierExpressions.get(0);
        if (astNode instanceof RutaQuantifierLiteralExpression) {
          append(astNode);
        } else {
          append(BRACK_OPEN);
          append(astNode);
View Full Code Here

    if (astnodes == null) {
      return;
    }
    Iterator iterator2 = astnodes.iterator();
    while (iterator2.hasNext()) {
      ASTNode node = (ASTNode) iterator2.next();
      try {
        node.traverse(this);
      } catch (Exception e) {
        e.printStackTrace();
      }
      if (iterator2.hasNext()) {
        appendSeparator(separator);
View Full Code Here

        this.packageName = ((RutaPackageDeclaration) s).getName();
        return false;
      }
      if (s instanceof RutaDeclareDeclarationsStatement) {
        RutaDeclareDeclarationsStatement dds = (RutaDeclareDeclarationsStatement) s;
        ASTNode parent = dds.getParent();
        if (parent != null && parent instanceof RutaVariableReference) {
          RutaVariableReference p = (RutaVariableReference) parent;
          String name = p.getName();
          if (finalTypes.contains(name)) {
            IProblem problem = problemFactory.createInheritenceFinalProblem(p);
View Full Code Here

  private boolean isParameter(IField field) {
    ISourceModule sourceModule = field.getSourceModule();
    ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(sourceModule);
    ASTNode fieldDeclaration = null;
    try {
      fieldDeclaration = PHPModelUtils.getNodeByField(moduleDeclaration,
          field);
    } catch (ModelException e) {
View Full Code Here

    }
    ISourceModule sourceModule = field.getSourceModule();

    ModuleDeclaration module = SourceParserUtil
        .getModuleDeclaration(sourceModule);
    ASTNode node = PHPModelUtils.getNodeByField(module, field);

    if (node == null) {// define constant
      PHPCallExpression callExpression = DefineMethodUtils
          .getDefineNodeByField(module, field);
      if (callExpression != null) {
        CallArgumentsList args = callExpression.getArgs();
        if (args != null && args.getChilds() != null
            && args.getChilds().size() >= 2) {
          ASTNode argument = (ASTNode) args.getChilds().get(1);
          if (argument instanceof Scalar) {
            String value = ASTUtils.stripQuotes(((Scalar) argument)
                .getValue());
            return value;
          }
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.