EOS 2  1.1.0
Einfache Objektbasierte Sprache
DefineVariable.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.MType;
5 import de.lathanda.eos.vm.Machine;
6 
13 public class DefineVariable extends Command {
14  private final String name;
15  private final MType type;
16 
17  public DefineVariable(String name, MType type) {
18  this.name = name;
19  this.type = type;
20  }
21 
22  @Override
23  public boolean execute(Machine m) throws Exception {
24  m.define(name, type);
25  return true;
26  }
27 
28  @Override
29  public String toString() {
30  return "ReserveMemory{" + name + ":" + type + '}';
31  }
32 
33 }
Impressum