Esempio n. 1
0
  public void execute(VirtualMachine vm) {

    for (int j = 0; j < i; j++) {
      vm.popRunStack();
    }

    if (vm.isDumpOn()) {
      print();
      vm.dumpRunStack();
    }
  }
Esempio n. 2
0
  public void execute(VirtualMachine vm) {

    // get an integer from the user
    System.out.print("Please enter in an integer: ");
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      String line = in.readLine();
      s = Integer.parseInt(line);
    } catch (java.io.IOException ex) {
    }

    vm.pushRunStack(s);

    if (vm.isDumpOn()) {
      print();
      vm.dumpRunStack();
    }
  }