return (ISourceModule) element.getAncestor(IModelElement.SOURCE_MODULE);
}
public static ArrayList<Integer> getNodeTreePath(ASTNode node) {
ASTNode parent = node.getParent();
if(parent == null) {
return new ArrayList<Integer>();
}
ArrayList<Integer> parentPath = getNodeTreePath(parent);
ASTNode[] children = parent.getChildren();
for (int ix = 0; ix < children.length; ix++) {
ASTNode child = children[ix];
if(node == child) {
parentPath.add(ix);
assertTrue(getNodeFromPath(node.getModuleNode(), parentPath) == node);
return parentPath;
}