Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /* Soot - a J*va Optimization Framework
   * Copyright (C) 2004 John Jorgensen
   *
   * This library is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either
   * version 2.1 of the License, or (at your option) any later version.
   *
   * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
 
 /*
  * Modified by the Sable Research Group and others 1997-2004.  
  * See the 'credits' file distributed with Soot for the complete list of
  * contributors.  (Soot is distributed at http://www.sable.mcgill.ca/soot)
  */
 
 
  
 
 
 
 package soot.toolkits.graph;
 
 import soot.Body;
 import soot.Trap;
 
 import java.util.List;

Defines the interface for navigating a control flow graph which distinguishes exceptional control flow.

Parameters:
N node type
 
 public interface ExceptionalGraph<N> extends DirectedGraph<N>
 {
    

Data structure to represent the fact that a given soot.Trap will catch some subset of the exceptions which may be thrown by a given graph node.

Note that these ``destinations'' are different from the edges in the CFG proper which are returned by getSuccsOf() and getPredsOf(). An edge from a to b in the CFG represents the fact that after node a executes (perhaps only partially, if it throws an exception after producing a side effect), execution may proceed to node b. An ExceptionDest from a to b, on the other hand, says that when a fails to execute, execution may proceed to b instead.

 
     public interface ExceptionDest<N> {

Returns the trap corresponding to this destination.

Returns:
either a soot.Trap representing the handler that catches the exceptions, if there is such a handler within the method, or null if there is no such handler and the exceptions cause the method to terminate abruptly.
 
 	public Trap getTrap();

Returns the exceptions thrown to this destination.

Returns:
a soot.toolkits.exceptions.ThrowableSet representing the exceptions which may be caught by this ExceptionDest's trap.
 
Returns the CFG node corresponding to the beginning of the exception handler that catches the exceptions (that is, the node that includes trap().getBeginUnit()).

Returns:
the node in this graph which represents the beginning of the handler which catches these exceptions, or null if there is no such handler and the exceptions cause the method to terminate abruptly.
 
 	// Maybe we should define an interface for Unit and Block to
 	// implement, and return an instance of that, rather than
	// an Object.  We chose Object because that's what DirectedGraph
	// deals in.
	public N getHandlerNode();
    }


    
Returns the soot.Body from which this graph was built.

Returns:
the Body from which this graph was built.
    public Body getBody();


    
Returns a list of nodes which are predecessors of a given node when only unexceptional control flow is considered.

Parameters:
n The node whose predecessors are to be returned.
Returns:
a java.util.List of the nodes in this graph from which there is an unexceptional edge to n.
    public List<N> getUnexceptionalPredsOf(N n);


    
Returns a list of nodes which are successors of a given node when only unexceptional control flow is considered.

Parameters:
n The node whose successors are to be returned.
Returns:
a java.util.List of nodes in this graph to which there is an unexceptional edge from n.
    public List<N> getUnexceptionalSuccsOf(N n);


    
Returns a list of nodes which are predecessors of a given node when only exceptional control flow is considered.

Parameters:
n The node whose predecessors are to be returned.
Returns:
a java.util.List of nodes in this graph from which there is an exceptional edge to n.
    public List<N> getExceptionalPredsOf(N n);


    
Returns a list of nodes which are successors of a given node when only exceptional control flow is considered.

Parameters:
n The node whose successors are to be returned.
Returns:
a java.util.List of nodes in this graph to which there is an exceptional edge from n.
    public List<N> getExceptionalSuccsOf(N n);


    
Returns a collection of ExceptionDest objects which represent how exceptions thrown by a specified node will be handled.

Parameters:
n The node for which to provide exception information.
Returns:
a collection of ExceptionDest objects describing the traps and handlers, if any, which catch the exceptions which may be thrown by n.
    public Collection<? extends ExceptionDest<N>> getExceptionDests(N n);
New to GrepCode? Check out our FAQ X