EOS 2  1.1.0
Einfache Objektbasierte Sprache
JumpIf.java
gehe zur Dokumentation dieser Datei
1 package de.lathanda.eos.vm.commands;
2 
3 import de.lathanda.eos.vm.Command;
4 import de.lathanda.eos.vm.Machine;
5 
12 public class JumpIf extends Command {
13  int relativ;
14 
15  public JumpIf(int relativ) {
16  this.relativ = relativ;
17  }
18 
19  @Override
20  public boolean execute(Machine m) throws Exception {
21  Object obj = m.pop();
22  if ((Boolean) obj) {
23  m.jump(relativ);
24  return false;
25  }
26  return true;
27  }
28 
29  @Override
30  public String toString() {
31  return "JumpIf{" + relativ + '}';
32  }
33 
34 }
boolean execute(Machine m)
Definition: JumpIf.java:20
Impressum