KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 1999 Patrice Pominville, Raja Vallee-Rai
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  * Modified by the Sable Research Group and others 1997-2003.
22  * See the 'credits' file distributed with Soot for the complete list of
23  * contributors. (Soot is distributed at http://www.sable.mcgill.ca/soot)
24  */

25
26
27 package soot.toolkits.graph;
28
29 import java.util.*;
30 import java.io.*;
31 import soot.*;
32
33
34 /**
35  * <p>Represents a CFG for a {@link Body} where the nodes are {@link
36  * Block}s and edges are derived from control flow. Control flow
37  * associated with exceptions is ignored, so the graph will be a
38  * forest where each exception handler constitutes a disjoint
39  * subgraph.</p>
40  */

41 public class BriefBlockGraph extends BlockGraph
42 {
43     /**
44      * Constructs a {@link BriefBlockGraph} from a given {@link Body}.
45      *
46      * <p> Note that this constructor builds a {@link
47      * BriefUnitGraph} internally when splitting <tt>body</tt>'s
48      * {@link Unit}s into {@link Block}s. Callers who already have
49      * a {@link BriefUnitGraph} to hand can use the constructor
50      * taking a <tt>CompleteUnitGraph</tt> as a parameter, as a
51      * minor optimization.
52      *
53      * @param body the {@link Body} for which to build a graph.
54      */

55     public BriefBlockGraph(Body body) {
56         this(new BriefUnitGraph(body));
57     }
58
59
60     /**
61      * Constructs a {@link BriefBlockGraph} representing the
62      * <tt>Unit</tt>-level control flow represented by the passed
63      * {@link BriefUnitGraph}.
64      *
65      * @param unitGraph the {@link Body} for which to build a graph.
66      */

67     public BriefBlockGraph(BriefUnitGraph unitGraph) {
68         super(unitGraph);
69
70     soot.util.PhaseDumper.v().dumpGraph(this, mBody);
71     }
72 }
73
74
75
Popular Tags