public int getIndexOfChild(Object parent, Object child) {
		if (parent == null || child == null)
			return -1;
		CommonTree cp = ((CommonTree) parent);
		CommonTree cc = ((CommonTree) child);
		for (int i = 0; i < cp.getChildCount(); i++) {
			if (cp.getChild(i).equals(cc))
				return i;
		}
		return -1;
	}