| 1 19 20 package soot.dava.internal.SET; 21 22 import soot.*; 23 import java.util.*; 24 import soot.util.*; 25 import soot.jimple.*; 26 import soot.dava.internal.asg.*; 27 import soot.dava.internal.AST.*; 28 import soot.dava.internal.javaRep.*; 29 import soot.dava.toolkits.base.finders.*; 30 31 public class SETSwitchNode extends SETDagNode 32 { 33 private List switchNodeList; 34 private Value key; 35 private IterableSet junkBody; 36 37 public SETSwitchNode( AugmentedStmt characterizingStmt, Value key, IterableSet body, List switchNodeList, IterableSet junkBody) 38 { 39 super( characterizingStmt, body); 40 41 this.key = key; 42 this.switchNodeList = switchNodeList; 43 this.junkBody = junkBody; 44 45 Iterator it = switchNodeList.iterator(); 46 while (it.hasNext()) 47 add_SubBody( ((SwitchNode) it.next()).get_Body()); 48 49 add_SubBody( junkBody); 50 } 51 52 53 public IterableSet get_NaturalExits() 54 { 55 return new IterableSet(); 56 } 57 58 public ASTNode emit_AST() 59 { 60 LinkedList indexList = new LinkedList(); 61 Map index2ASTBody = new HashMap(); 62 63 Iterator it = switchNodeList.iterator(); 64 while (it.hasNext()) { 65 SwitchNode sn = (SwitchNode) it.next(); 66 67 Object lastIndex = sn.get_IndexSet().last(); 68 Iterator iit = sn.get_IndexSet().iterator(); 69 while (iit.hasNext()) { 70 Object index = iit.next(); 71 72 indexList.addLast( index); 73 74 if (index != lastIndex) 75 index2ASTBody.put( index, null); 76 else 77 index2ASTBody.put( index, emit_ASTBody( (IterableSet) get_Body2ChildChain().get( sn.get_Body()))); 78 } 79 } 80 81 return new ASTSwitchNode( get_Label(), key, indexList, index2ASTBody); 82 } 83 84 public AugmentedStmt get_EntryStmt() 85 { 86 return get_CharacterizingStmt(); 87 } 88 } 89 | Popular Tags |