KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > soot > dava > toolkits > base > AST > traversals > AllDefinitionsFinder


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2005 Nomair A. Naeem
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */

19
20 /*
21  * Maintained by: Nomair A. Naeem
22  */

23
24 /*
25  * CHANGE LOG: 24th November Created Class since the newinitialFlow of reachingDefs need a universal set of defs
26  *
27  *
28  *
29  */

30
31
32 package soot.dava.toolkits.base.AST.traversals;
33
34 import soot.*;
35 import java.util.*;
36 import soot.jimple.*;
37 import soot.dava.internal.asg.*;
38 import soot.dava.internal.AST.*;
39 import soot.dava.internal.javaRep.*;
40 import soot.dava.toolkits.base.AST.analysis.*;
41 import soot.dava.toolkits.base.AST.structuredAnalysis.*;
42
43
44 /*
45  * DefinitionStmts can occur in either ASTStatementSequenceNode or the for init and for update
46  * These are needed for the newinitialFlow method of reachingDefs which needs a universal set of definitions
47  */

48
49
50 public class AllDefinitionsFinder extends DepthFirstAdapter{
51     ArrayList allDefs = new ArrayList();
52
53     public AllDefinitionsFinder(){
54
55     }
56
57     public AllDefinitionsFinder(boolean verbose){
58     super(verbose);
59     }
60
61     public void inDefinitionStmt(DefinitionStmt s){
62     allDefs.add(s);
63     }
64
65
66     public List getAllDefs(){
67     return allDefs;
68     }
69
70 }
71
72
73
74
Popular Tags