1 20 21 package soot.dava.internal.AST; 22 23 import soot.*; 24 import java.util.*; 25 import soot.dava.internal.SET.*; 26 import soot.dava.toolkits.base.AST.*; 27 import soot.dava.toolkits.base.AST.analysis.*; 28 29 public class ASTLabeledBlockNode extends ASTLabeledNode 30 { 31 private List body; 32 private SETNodeLabel label; 33 34 public ASTLabeledBlockNode( SETNodeLabel label, List body){ 35 super( label); 36 this.body = body; 37 38 subBodies.add( body); 39 } 40 41 45 public void replaceBody(List body){ 46 this.body=body; 47 subBodies=new ArrayList(); 48 subBodies.add(body); 49 } 50 51 public int size() 52 { 53 return body.size(); 54 } 55 56 public Object clone() 57 { 58 return new ASTLabeledBlockNode( get_Label(), body); 59 } 60 61 public void toString( UnitPrinter up ) 62 { 63 label_toString( up ); 64 65 up.literal( "{" ); 66 up.newline(); 67 68 up.incIndent(); 69 body_toString( up, body ); 70 up.decIndent(); 71 72 up.literal( "} //end " ); 73 label_toString( up ); 74 75 76 77 78 up.newline(); 79 } 80 81 public String toString() 82 { 83 StringBuffer b = new StringBuffer (); 84 85 b.append( label_toString()); 86 87 b.append( "{"); 88 b.append( NEWLINE); 89 90 b.append( body_toString(body)); 91 92 b.append( "} //"); 93 b.append( label_toString()); 94 95 96 97 b.append( NEWLINE); 98 99 return b.toString(); 100 } 101 102 103 108 public void apply(Analysis a){ 109 a.caseASTLabeledBlockNode(this); 110 } 111 } 112 | Popular Tags |