|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.prorefactor.core.JPUtil
public class JPUtil
Joanju Proparse Utility Pack
Method Summary | |
---|---|
boolean |
findDirectChild(int parent,
int intoHandle,
int nodeType)
Find the first direct child of a given node type |
void |
findFieldRefIdNode(int parent,
int idNode)
Find the ID node for a Field_ref |
int |
findFirstDescendant(int rootNode,
int intoHandle,
java.lang.String tokenTypeName)
Find the first descendant of a given type. |
int |
findFirstHiddenAfterLastDescendant(int node)
Find the first hidden token after the current node's last descendant. |
ProToken |
findFirstHiddenAfterLastDescendant(JPNode node)
Find the first hidden token after the current node's last descendant. |
int |
firstNaturalChild(int h1,
int h2)
First Natural Child is found by repeating firstChild() until a natural node is found. |
java.lang.String |
getFilename(int astHandle)
Get a node's filename - even for a synthetic node. |
static JPUtil |
getInstance()
This class implements the "Singleton" design pattern. |
int[] |
getPosition(int astHandle)
Get a node's fileIndex/line/col position - even for a synthetic node. |
java.lang.String |
getPositionString(int node)
Get a string representation of a node's position, ex: "mydir/myfile.p:12:13". |
java.lang.String |
getPositionString(int[] pos)
Get a string representation of an int[3] position, ex: "mydir/myfile.p:12:13". |
java.lang.String |
handleToString(int h1)
Return a simple string representation of a node. |
boolean |
isDefineShared(int node)
Convenience method just to tell if a DEFINE node is DEFINE--SHARED. |
int |
lastChild(int h1,
int h2)
Finds the last immediate child of a node (no grandchildren). |
int |
numSiblings(int theNode)
Number of Siblings - Count the number of "next siblings". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static JPUtil getInstance()
public boolean isDefineShared(int node)
node
- The AST node handle.
public boolean findDirectChild(int parent, int intoHandle, int nodeType)
parent
- The parent node handleintoHandle
- If found, this handle will point to the desired nodenodeType
- Integer token type
public void findFieldRefIdNode(int parent, int idNode)
parent
- intoHandle
- public int findFirstDescendant(int rootNode, int intoHandle, java.lang.String tokenTypeName)
public int findFirstHiddenAfterLastDescendant(int node)
public ProToken findFirstHiddenAfterLastDescendant(JPNode node)
public int firstNaturalChild(int h1, int h2)
public java.lang.String getFilename(int astHandle)
Handle
- to a node.
public int[] getPosition(int astHandle)
Handle
- to a node.
public java.lang.String getPositionString(int node)
public java.lang.String getPositionString(int[] pos)
public java.lang.String handleToString(int h1)
public int lastChild(int h1, int h2)
public int numSiblings(int theNode)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |