public Object findNode(Object ast, int offset) { if (ast instanceof ITree) { return TreeAdapter.locateLexical((ITree) ast, offset); } else if (ast instanceof AbstractAST) { return ((AbstractAST) ast).findNode(offset); } else if (ast instanceof ModelTreeNode) { return findNode(((ModelTreeNode) ast).getASTNode(), offset); } return null; }