1 package spoon.reflect.eval; 2 3 8 public class SymbolicEvaluationStep { 9 10 SymbolicStackFrame frame; 11 12 SymbolicHeap heap; 13 14 StepKind kind; 15 16 26 public SymbolicEvaluationStep(StepKind kind, SymbolicStackFrame frame, 27 SymbolicHeap heap) { 28 super(); 29 this.frame = frame; 30 this.heap = heap; 31 this.kind = kind; 32 } 33 34 37 public SymbolicStackFrame getFrame() { 38 return frame; 39 } 40 41 44 public SymbolicHeap getHeap() { 45 return heap; 46 } 47 48 51 @Override 52 public String toString() { 53 return kind.toString() + " " + frame.toString() + " heap=" 54 + heap.toString(); 55 } 56 57 60 public StepKind getKind() { 61 return kind; 62 } 63 64 69 public SymbolicInstance get(String id) { 70 SymbolicInstance res = heap.get(id); 71 if (res != null) 72 return res; 73 for (SymbolicInstance i : frame.getVariables().values()) { 74 if (i != null && i.getId().equals(id)) { 75 return i; 76 } 77 } 78 return null; 79 } 80 81 } 82 | Popular Tags |