public static boolean hasActions(Node<?> root) {
        Node<?> node = root;
        for (;;) {
            if (node instanceof ActionNode)
                return true;

            if (node instanceof UnaryNode) {
                node = ((UnaryNode) node).sibling;
                continue;
            }

            if (node instanceof BinaryNode) {
                BinaryNode n = (BinaryNode) node;
                if (hasActions(n))
                    return true;

                node = n.secondSibling;
                continue;
            }

            return false;
        }
    }