tip
Class Util
java.lang.Object
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
|
findNode(Node start,
Class<T> cl)
Search up the AST for an ancestor node of a specific type. |
Util
public Util()
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 searchcl
- 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.