KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > soot > toolkits > graph > DominatorsFinder


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2004 Navindra Umanee <navindra@cs.mcgill.ca>
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 package soot.toolkits.graph;
21
22 import soot.*;
23 import soot.util.*;
24 import java.util.*;
25 import soot.jimple.*;
26 import soot.options.*;
27 import soot.toolkits.graph.*;
28 import soot.toolkits.scalar.*;
29
30 /**
31  * General interface for a dominators analysis.
32  *
33  * @author Navindra Umanee
34  **/

35 public interface DominatorsFinder
36 {
37     /**
38      * Returns the graph to which the analysis pertains.
39      **/

40     public DirectedGraph getGraph();
41     
42     /**
43      * Returns a list of dominators for the given node in the graph.
44      **/

45     public List getDominators(Object JavaDoc node);
46
47     /**
48      * Returns the immediate dominator of node or null if the node has
49      * no immediate dominator.
50      **/

51     public Object JavaDoc getImmediateDominator(Object JavaDoc node);
52
53     /**
54      * True if "node" is dominated by "dominator" in the graph.
55      **/

56     public boolean isDominatedBy(Object JavaDoc node, Object JavaDoc dominator);
57
58     /**
59      * True if "node" is dominated by all nodes in "dominators" in the graph.
60      **/

61     public boolean isDominatedByAll(Object JavaDoc node, Collection dominators);
62 }
63
Popular Tags