Package org.eclipse.jdt.internal.debug.eval.ast.instructions

Examples of org.eclipse.jdt.internal.debug.eval.ast.instructions.NoOp


    }
    if (!isActive()) {
      return true;
    }

    push(new NoOp(fCounter));

    return true;
  }
View Full Code Here


  public boolean visit(ConditionalExpression node) {
    if (!isActive()) {
      return true;
    }

    push(new NoOp(fCounter));

    return true;
  }
View Full Code Here

  public boolean visit(DoStatement node) {
    if (!isActive()) {
      return false;
    }

    push(new NoOp(fCounter));
    return true;
  }
View Full Code Here

  @Override
  public boolean visit(EmptyStatement node) {
    if (!isActive()) {
      return false;
    }
    push(new NoOp(fCounter));
    return true;
  }
View Full Code Here

  public boolean visit(EnhancedForStatement node) {
    if (!isActive()) {
      return false;
    }

    push(new NoOp(fCounter));

    ITypeBinding typeBinding = resolveTypeBinding(node.getExpression());
    if (typeBinding == null) {
      return false;
    }
    Type paramType = node.getParameter().getType();
    ITypeBinding paramBinding = resolveTypeBinding(paramType);
    if (paramBinding == null) {
      return false;
    }
    String typeSignature = getTypeSignature(paramBinding);
    int paramTypeId = getTypeId(paramType);
    boolean isParamPrimitiveType = paramTypeId != Instruction.T_Object
        && paramTypeId != Instruction.T_String;
    String paramIdentifier = node.getParameter().getName().getIdentifier();

    if (typeBinding.isArray()) {
      // the expression returns an array
      int idIndex = fUniqueIdIndex++;
      String arrayIdentifier = "#a" + idIndex; //$NON-NLS-1$
      String varIdentifier = "#i" + idIndex; //$NON-NLS-1$
      push(new LocalVariableCreation(arrayIdentifier, typeSignature, 1,
          isParamPrimitiveType, true, fCounter));
      node.getExpression().accept(this);
      storeInstruction();
      push(new LocalVariableCreation(varIdentifier,
          "I", 0, true, true, fCounter)); //$NON-NLS-1$
      push(new PushInt(0));
      storeInstruction();
      storeInstruction();
      push(new LocalVariableCreation(paramIdentifier, typeSignature, 0,
          isParamPrimitiveType, false, fCounter));
      storeInstruction();

      push(new LessOperator(Instruction.T_int, Instruction.T_int,
          fCounter));
      push(new PushLocalVariable(varIdentifier));
      storeInstruction();
      push(new PushArrayLength(fCounter));
      push(new PushLocalVariable(arrayIdentifier));
      storeInstruction();
      storeInstruction();
      storeInstruction();

      // conditional jump will be added here

      push(new NoOp(fCounter));
      push(new AssignmentOperator(paramTypeId, paramTypeId, fCounter));
      push(new PushLocalVariable(paramIdentifier));
      storeInstruction();
      push(new org.eclipse.jdt.internal.debug.eval.ast.instructions.ArrayAccess(
          fCounter));
      push(new PushLocalVariable(arrayIdentifier));
      storeInstruction();
      push(new PostfixPlusPlusOperator(Instruction.T_int, fCounter));
      push(new PushLocalVariable(varIdentifier));
      storeInstruction();
      storeInstruction();
      storeInstruction();
      if (checkAutoBoxing(typeBinding.getElementType(), paramBinding)) {
        storeInstruction();
      }
      storeInstruction();
      addPopInstruction();
      node.getBody().accept(this);
      storeInstruction();

      // jump will be added here

    } else {
      // the expression returns a collection
      String iteratorIdentifier = "#i" + fUniqueIdIndex++; //$NON-NLS-1$
      push(new LocalVariableCreation(iteratorIdentifier,
          "Ljava/util/Iterator;", 0, false, true, fCounter)); //$NON-NLS-1$
      push(new SendMessage(
          "iterator", "()Ljava/util/Iterator;", 0, null, fCounter)); //$NON-NLS-1$//$NON-NLS-2$
      node.getExpression().accept(this);
      storeInstruction();
      storeInstruction();
      push(new LocalVariableCreation(paramIdentifier, typeSignature, 0,
          isParamPrimitiveType, false, fCounter));
      storeInstruction();

      push(new SendMessage("hasNext", "()Z", 0, null, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
      push(new PushLocalVariable(iteratorIdentifier));
      storeInstruction();
      storeInstruction();

      // conditional jump will be added here

      push(new NoOp(fCounter));
      push(new AssignmentOperator(paramTypeId, paramTypeId, fCounter));
      push(new PushLocalVariable(paramIdentifier));
      storeInstruction();
      push(new SendMessage(
          "next", "()Ljava/lang/Object;", 0, null, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

  public boolean visit(ForStatement node) {
    if (!isActive()) {
      return false;
    }

    push(new NoOp(fCounter));

    push(new NoOp(fCounter));
    for (Iterator<Expression> iter = node.initializers().iterator(); iter.hasNext();) {
      Expression expr = iter.next();
      expr.accept(this);
      addPopInstructionIfNeeded(expr);
    }
    storeInstruction();

    Expression condition = node.getExpression();
    if (condition != null) {
      condition.accept(this);
    }

    node.getBody().accept(this);

    push(new NoOp(fCounter));
    for (Iterator<Expression> iter = node.updaters().iterator(); iter.hasNext();) {
      Expression expr = iter.next();
      expr.accept(this);
      addPopInstructionIfNeeded(expr);
    }
View Full Code Here

  public boolean visit(IfStatement node) {
    if (!isActive()) {
      return false;
    }

    push(new NoOp(fCounter));

    return true;
  }
View Full Code Here

              fCounter));
        }
        break;
      case '|': // or or
        for (int i = operatorNumber - 1; i >= 0; i--) {
          push(new NoOp(fCounter));
        }
        break;
      default:
        unrecognized = true;
        break;
      }
      break;
    case '&': // and or and and
      switch (char1) {
      case '\0': // and
        for (int i = operatorNumber - 1; i >= 0; i--) {
          push(new AndOperator(types[i][0], types[i][1], types[i][2],
              fCounter));
        }
        break;
      case '&': // and and
        for (int i = operatorNumber - 1; i >= 0; i--) {
          push(new NoOp(fCounter));
        }
        break;
      default:
        unrecognized = true;
        break;
View Full Code Here

  @Override
  public boolean visit(SwitchStatement node) {
    if (!isActive()) {
      return false;
    }
    push(new NoOp(fCounter));
    int switchStart = fCounter;
    node.getExpression().accept(this);

    ArrayList<Statement> statementsDefault = null;
    Jump jumpDefault = null;
View Full Code Here

  public boolean visit(WhileStatement node) {
    if (!isActive()) {
      return false;
    }

    push(new NoOp(fCounter));
    return true;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.debug.eval.ast.instructions.NoOp

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.