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.Term;
14:
15: /**
16: * This execution tree node is used to represent a node referring to a return
17: * step of a method. FIXME: the copy method creates insane trees (I do currently
18: * no understand what ITNodes are, but most probably the copy method brings
19: * ETNodes and ITNodes out of sync), up to now I am not sure which behaviour of
20: * copy has been wanted. This bug applies to all subclasses as well.
21: */
22: public class ETMethodReturnNode extends ETNode {
23:
24: /**
25: * represents the symbolic return value of the method
26: */
27: private final Term result;
28:
29: /**
30: * creates an instance of the ETNode
31: *
32: * @param bc
33: * @param itNodes
34: * @param result
35: * @param parent
36: */
37: public ETMethodReturnNode(ListOfTerm bc, LinkedList itNodes,
38: Term result, ETNode parent) {
39: super (bc, itNodes, parent);
40: this .result = result;
41:
42: }
43:
44: public ETMethodReturnNode(ListOfTerm bc, Term result, ETNode parent) {
45: super (bc, parent);
46: this .result = result;
47:
48: }
49:
50: /**
51: * creates a shallow copy of this node and attaches it to node <tt>p</tt>
52: * FIXME: FIX this method as it creates not well linked trees Problems: 1)
53: * the children of this node are not linked to their new parent -->
54: * malformed tree 2) the children are not copied themselves and linking
55: * would destroy the old tree
56: *
57: */
58: public ETNode copy(ETNode p) {
59: ETNode copy = new ETMethodReturnNode(getBC(),
60: (LinkedList) getITNodes().clone(), result, p);
61: copy.setChildren((LinkedList) getChildrenList().clone());
62: return copy;
63: }
64:
65: /**
66: * the symbolic value of the method result
67: *
68: * @return the symbolic value of the method result
69: */
70: public Term getResult() {
71: return result;
72: }
73:
74: }
|