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

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


    ConditionalJump conditionalJump = new ConditionalJump(false);
    fInstructions.insert(conditionalJump, conditionalAddress + 1);

    // Insert the jump
    int jumpAddress = ifTrueAddress + 2;
    Jump jump = new Jump();
    fInstructions.insert(jump, jumpAddress);

    // Set the jump offsets
    conditionalJump.setOffset(ifTrue.getSize() + 1);
    jump.setOffset(ifFalse.getSize() + 1);

    fCounter += 2;
    storeInstruction();

  }
View Full Code Here


    // for each pending break or continue instruction which are related to
    // this loop, set the offset of the corresponding jump.
    for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
      CompleteInstruction instruction = iter.next();
      Jump jumpInstruction = instruction.fInstruction;
      int instructionAddress = fInstructions.indexOf(jumpInstruction);
      if (instructionAddress > bodyStartAddress
          && (instruction.fLabel == null || instruction.fLabel
              .equals(label))) {
        iter.remove();
        if (instruction.fIsBreak) {
          // jump to the instruction after the last jump
          jumpInstruction
              .setOffset((conditionAddress - instructionAddress) + 1);
        } else {
          // jump to the first instruction of the condition
          jumpInstruction.setOffset(bodyAddress - instructionAddress);
        }
      }
    }

    storeInstruction();
View Full Code Here

    bodyAddress++;
    fCounter++;
    condJump.setOffset(body.getSize() + 1);

    // add jump
    Jump jump = new Jump();
    fInstructions.add(jump);
    fCounter++;
    jump.setOffset(initAddress - (bodyAddress + 1));

    // for each pending break or continue instruction which are related to
    // this loop, set the offset of the corresponding jump.
    String label = getLabel(node);
    for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
      CompleteInstruction instruction = iter.next();
      Jump jumpInstruction = instruction.fInstruction;
      int instructionAddress = fInstructions.indexOf(jumpInstruction);
      if (instructionAddress > conditionAddress
          && (instruction.fLabel == null || instruction.fLabel
              .equals(label))) {
        iter.remove();
        if (instruction.fIsBreak) {
          // jump to the instruction after the last jump
          jumpInstruction
              .setOffset((bodyAddress - instructionAddress) + 1);
        } else {
          // jump to the first instruction of the condition
          jumpInstruction.setOffset(initAddress - instructionAddress);
        }
      }
    }

    storeInstruction();
View Full Code Here

      conditionAddress = 0;
      condition = null;
    }

    // add jump
    Jump jump = new Jump();
    fInstructions.add(jump);
    fCounter++;

    if (hasCondition) {
      // add conditional jump
      ConditionalJump condJump = new ConditionalJump(false);
      fInstructions.insert(condJump, conditionAddress + 1);
      bodyAddress++;
      bodyStartAddress++;
      updatersAddress++;
      fCounter++;
      // set conditional jump offset
      condJump.setOffset(body.getSize() + updaters.getSize() + 1);
    }

    // set jump offset
    jump.setOffset(-((hasCondition && (condition != null) ? condition
        .getSize() : 0) + body.getSize() + updaters.getSize() + 2));

    // for each pending break or continue instruction which are related to
    // this loop, set the offset of the corresponding jump.
    for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
      CompleteInstruction instruction = iter.next();
      Jump jumpInstruction = instruction.fInstruction;
      int instructionAddress = fInstructions.indexOf(jumpInstruction);
      if (instructionAddress > bodyStartAddress
          && (instruction.fLabel == null || instruction.fLabel
              .equals(label))) {
        iter.remove();
        if (instruction.fIsBreak) {
          // jump to the instruction after the last jump
          jumpInstruction
              .setOffset((updatersAddress - instructionAddress) + 1);
        } else {
          // jump to the first instruction of the condition
          jumpInstruction.setOffset(bodyAddress - instructionAddress);
        }
      }
    }

    storeInstruction();
View Full Code Here

    fCounter++;

    if (hasElseStatement) {
      // Insert the jump
      int jumpAddress = ifTrueAddress + 2;
      Jump jump = new Jump();
      fInstructions.insert(jump, jumpAddress);
      // Set the jump offset
      jump.setOffset(ifFalse.getSize() + 1);
      fCounter++;
    }

    storeInstruction();
View Full Code Here

    // this statement, set the offset of the corresponding jump.
    for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
      CompleteInstruction instruction = iter.next();
      if (instruction.fLabel != null && instruction.fLabel.equals(label)) {
        iter.remove();
        Jump jumpInstruction = instruction.fInstruction;
        int instructionAddress = fInstructions.indexOf(jumpInstruction);
        if (instruction.fIsBreak) {
          // jump to the instruction after the statement
          jumpInstruction.setOffset(fInstructions.getEnd()
              - instructionAddress);
        }
      }
    }
  }
View Full Code Here

    // add the conditionnalJump
    ConditionalJump conditionalJump = new ConditionalJump(false);
    fInstructions.insert(conditionalJump, conditionAddress + 1);

    // add the jump
    Jump jump = new Jump();
    fInstructions.add(jump);

    // set jump offsets
    conditionalJump.setOffset(body.getSize() + 1);
    jump.setOffset(-(condition.getSize() + body.getSize() + 2));

    // for each pending break or continue instruction which are related to
    // this loop, set the offset of the corresponding jump.
    for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
      CompleteInstruction instruction = iter.next();
      Jump jumpInstruction = instruction.fInstruction;
      int instructionAddress = fInstructions.indexOf(jumpInstruction);
      if (instructionAddress > conditionAddress
          && (instruction.fLabel == null || instruction.fLabel
              .equals(label))) {
        iter.remove();
        if (instruction.fIsBreak) {
          // jump to the instruction after the last jump
          jumpInstruction
              .setOffset((bodyAddress - instructionAddress) + 2);
        } else {
          // jump to the first instruction of the condition
          jumpInstruction.setOffset((conditionAddress - condition
              .getSize()) - instructionAddress);
        }
      }
    }
View Full Code Here

      return false;
    }
    // create the equivalent jump instruction in the instruction
    // and add an element in the list of pending break and continue
    // instructions
    Jump instruction = new Jump();
    SimpleName labelName = node.getLabel();
    String label = null;
    if (labelName != null) {
      label = labelName.getIdentifier();
    }
View Full Code Here

      return false;
    }
    // create the equivalent jump instruction in the instruction
    // and add an element in the list of pending break and continue
    // instructions
    Jump instruction = new Jump();
    SimpleName labelName = node.getLabel();
    String label = null;
    if (labelName != null) {
      label = labelName.getIdentifier();
    }
View Full Code Here

        if (storeRequired) {
          storeInstruction();
        }
      }

      Jump jump = new Jump();
      jump.setOffset(1);
      push(jump);
      storeInstruction();

      for (int i = 0; i < operatorNumber; i++) {
        conditionalJumps[i].setOffset(fCounter
View Full Code Here

TOP

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

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.