EOS 2
1.1.0
Einfache Objektbasierte Sprache
EosVM
src
de
lathanda
eos
vm
commands
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
}
de.lathanda.eos.vm.Command
Definition:
Command.java:9
de.lathanda.eos.vm.Machine
Definition:
Machine.java:19
de.lathanda.eos.vm.commands.JumpIf
Definition:
JumpIf.java:12
de.lathanda.eos.vm.commands.JumpIf.execute
boolean execute(Machine m)
Definition:
JumpIf.java:20
de.lathanda.eos.vm.commands.JumpIf.toString
String toString()
Definition:
JumpIf.java:30
de.lathanda.eos.vm.commands.JumpIf.JumpIf
JumpIf(int relativ)
Definition:
JumpIf.java:15
Impressum