EOS 2  1.1.0
Einfache Objektbasierte Sprache
DebugPoint.java
gehe zur Dokumentation dieser Datei
1 package de.lathanda.eos.vm;
2 
14 public class DebugPoint extends Command {
15  private final Marker marker;
16  private boolean activeBreakpoint;
17 
18  public DebugPoint() {
19  this.marker = new Marker();
20  activeBreakpoint = false;
21  }
22 
23  public DebugPoint(Marker marker) {
24  this.marker = marker;
25  activeBreakpoint = false;
26  }
27 
28  @Override
29  public boolean execute(Machine m) throws Exception {
30  m.debugStop(marker);
31  if (activeBreakpoint) {
32  m.pause();
33  }
34  return true;
35  }
36 
37  public boolean isActiveBreakpoint() {
38  return activeBreakpoint;
39  }
40 
41  public void setActiveBreakpoint(boolean activeBreakpoint) {
42  this.activeBreakpoint = activeBreakpoint;
43  }
44 
45  public void toggleActiveBreakpoint() {
46  activeBreakpoint = !activeBreakpoint;
47  }
48 
49  @Override
50  public String toString() {
51  return "DebugPoint{" + marker + '}';
52  }
53 
54  @Override
55  public void prepare(Machine m) {
56  m.addPossibleBreakpoint(this, marker.getBeginLine());
57  }
58 
59  public Marker getMarker() {
60  return marker;
61  }
62 }
void setActiveBreakpoint(boolean activeBreakpoint)
Definition: DebugPoint.java:41
boolean execute(Machine m)
Definition: DebugPoint.java:29
void addPossibleBreakpoint(DebugPoint debugPoint, int linenumber)
Definition: Machine.java:76
Impressum