tip
Class Util

java.lang.Object
  extended by tip.Util

public class Util
extends Object

A number of convenient enums and intertype methods for switching on and extracting information from various AST nodes.

Author:
Poul Hansen, Johnni Winther

Constructor Summary
Util()
           
 
Method Summary
static
<T> T
findNode(Node start, Class<T> cl)
          Search up the AST for an ancestor node of a specific type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

findNode

public static <T> T findNode(Node start,
                             Class<T> cl)
Search up the AST for an ancestor node of a specific type.

Parameters:
start - the node at which to start the search
cl - the class of the node to search for
Returns:
the closest ancestor (including the start node itself) of the specified type, or null if no ancestor of the start node has the specified type.