01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: package de.uka.ilkd.key.visualdebugger.executiontree;
09:
10: import java.util.LinkedList;
11:
12: import de.uka.ilkd.key.logic.ListOfTerm;
13: import de.uka.ilkd.key.logic.SLListOfTerm;
14: import de.uka.ilkd.key.visualdebugger.SourceElementId;
15:
16: public class ETLeafNode extends ETNode {
17: private int state;
18:
19: private String exceptionName = null;
20:
21: private SourceElementId programCounter = null;
22:
23: private SourceElementId expression = null;
24:
25: // surround with try catch
26:
27: public static int TERMINATED = 1;
28:
29: public static int INFEASIBLE = 2;
30:
31: public static int SUSPENDED = 3;// depr
32:
33: // public ETLeafNode(ListOfTerm bc, int st){
34: // super(bc);
35: // this.state = st;
36: // assert(st==TERMINATED || st==INFEASIBLE|| st== SUSPENDED) ;
37: // }
38:
39: public ETLeafNode(ListOfTerm bc, int st, ETNode parent) {
40: super (bc, parent);
41: this .state = st;
42: assert (st == TERMINATED || st == INFEASIBLE || st == SUSPENDED);
43: }
44:
45: public ETLeafNode(ListOfTerm bc, int st, LinkedList nodes,
46: ETNode parent) {
47: super (bc, nodes, parent);
48: this .state = st;
49: assert (st == TERMINATED || st == INFEASIBLE || st == SUSPENDED);
50:
51: }
52:
53: public ETLeafNode(int st, ETLeafNode parent) {
54: this (SLListOfTerm.EMPTY_LIST, st, parent);
55: }
56:
57: public String getExceptionName() {
58: return exceptionName;
59: }
60:
61: public SourceElementId getExpression() {
62: return expression;
63: }
64:
65: public void setExceptionName(String exc) {
66:
67: if (exc != null) {
68: this .expression = ((ITNode) this .getITNodes().getFirst())
69: .getLastExpressionId().getExprId();
70: }
71: exceptionName = exc;
72: }
73:
74: public SourceElementId getProgramCounter() {
75: return programCounter;
76: }
77:
78: public void setProgramCounter(SourceElementId pc) {
79: programCounter = pc;
80: }
81:
82: public int getState() {
83: return state;
84: }
85:
86: public ETNode copy(ETNode p) {
87: ETLeafNode copy = new ETLeafNode(getBC(), state,
88: (LinkedList) this .getITNodes().clone(), p);
89: copy.setChildren((LinkedList) this.getChildrenList().clone());
90: copy.setExceptionName(this.exceptionName);
91: return copy;
92: }
93: }
|