class PushdownNegationVisitor extends BaseVisitor {

    public static JexlNode pushdownNegations(JexlNode tree) {
        // flatten the input
        JexlNode flattened = TreeFlatteningRebuildingVisitor.flatten(tree);
        
        flattened.jjtAccept(new PushdownNegationVisitor(), new NegationState(false));
        
        // flatten the result
        return TreeFlatteningRebuildingVisitor.flatten(flattened);
    }

}