예제 #1
0
  public StoreRegisterOperation(ExecutionContext context, StoreRegister action) {
    super(context.getExecStack().peek());
    this.registerNumber = action.getNumber();

    logger.debug("Register number = " + this.registerNumber);
    logger.debug("Adding register " + this.registerNumber + " = " + op);
    this.registerHandle = new RegisterHandle(this.registerNumber, op, this);
    context.getRegisters().set(this.registerNumber, this.registerHandle);
    String regInfo = "REGS:";
    int i = 1;
    for (Operation op : context.getRegisters()) {
      regInfo += (i++) + "=>" + op + ",";
    }
    logger.debug(regInfo);

    handleIncrementDecrement();

    // If operation under Enumerate/Enumerate2 and NullStackValue is assigned to register,
    // set this RegisterHandle as variable in for..in statement and skip this statement.
    if (!context.getOperationStack().isEmpty()
        && (context.getOperationStack().peek() instanceof ForInOperation)
        && op instanceof NullStackValue) {

      ((ForInOperation) context.getOperationStack().peek()).setVariable(registerHandle);
      //			((ForInOperation)context.getOperationStack().peek()).setVariable(op);
      skipOperation = true;
    }
  }
예제 #2
0
 private static Element writeStoreRegister(Element parentElement, StoreRegister storeRegister) {
   Element element = parentElement.addElement("storeregister");
   element.addAttribute("number", Short.toString(storeRegister.getNumber()));
   return element;
 }