1 20 21 package soot.dava.internal.AST; 22 23 import soot.*; 24 import java.util.*; 25 import soot.jimple.*; 26 import soot.dava.internal.asg.*; 27 import soot.dava.toolkits.base.AST.*; 28 import soot.dava.toolkits.base.AST.analysis.*; 29 30 public class ASTStatementSequenceNode extends ASTNode 31 { 32 private List statementSequence; 33 34 public ASTStatementSequenceNode( List statementSequence) 35 { 36 super(); 37 38 this.statementSequence = statementSequence; 39 } 40 41 public Object clone() 42 { 43 return new ASTStatementSequenceNode( statementSequence); 44 } 45 46 public void perform_Analysis( ASTAnalysis a) 47 { 48 if (a.getAnalysisDepth() > ASTAnalysis.ANALYSE_AST) { 49 50 Iterator it = statementSequence.iterator(); 51 while (it.hasNext()) 52 ASTWalker.v().walk_stmt( a, ((AugmentedStmt) it.next()).get_Stmt()); 53 } 54 55 if (a instanceof TryContentsFinder) { 56 TryContentsFinder tcf = (TryContentsFinder) a; 57 tcf.v().add_ExceptionSet( this, tcf.v().remove_CurExceptionSet()); 58 } 59 } 60 61 public void toString( UnitPrinter up ) { 62 Iterator it = statementSequence.iterator(); 63 while (it.hasNext()) { 64 AugmentedStmt as = (AugmentedStmt) it.next(); 65 Unit u = as.get_Stmt(); 67 up.startUnit( u ); 68 u.toString( up ); 69 up.literal(";"); 70 up.endUnit( u ); 71 up.newline(); 72 } 73 } 74 75 public String toString() 76 { 77 StringBuffer b = new StringBuffer (); 78 79 Iterator it = statementSequence.iterator(); 80 while (it.hasNext()) { 81 b.append( ((Unit) ((AugmentedStmt) it.next()).get_Stmt()).toString()); 82 b.append( ";"); 83 b.append( NEWLINE); 84 } 85 86 return b.toString(); 87 } 88 89 90 95 public List getStatements(){ 96 return statementSequence; 97 } 98 99 public void apply(Analysis a){ 100 a.caseASTStatementSequenceNode(this); 101 } 102 103 104 105 106 109 public void setStatements(List statementSequence){ 110 this.statementSequence=statementSequence; 111 } 112 } 113 | Popular Tags |