Search in sources :

Example 1 with AstBeThen

use of com.developmentontheedge.sql.model.AstBeThen in project be5 by DevelopmentOnTheEdge.

the class ContextApplier method setIfResult.

private int setIfResult(SimpleNode newTree, int i, SimpleNode condNode, boolean correct) {
    SimpleNode child;
    for (int j = condNode.jjtGetNumChildren() - 1; j >= 0; j--) {
        child = condNode.child(j);
        if (child instanceof AstBeThen && correct || child instanceof AstBeElse && !correct) {
            if (child.jjtGetNumChildren() != 0)
                setChildren(newTree, i, child);
            else {
                newTree.removeChild(condNode);
                i--;
            }
            break;
        } else if (child instanceof AstBeThen && !correct) {
            newTree.removeChild(condNode);
            i--;
        }
    }
    return i;
}
Also used : AstBeThen(com.developmentontheedge.sql.model.AstBeThen) AstBeElse(com.developmentontheedge.sql.model.AstBeElse) SimpleNode(com.developmentontheedge.sql.model.SimpleNode)

Aggregations

AstBeElse (com.developmentontheedge.sql.model.AstBeElse)1 AstBeThen (com.developmentontheedge.sql.model.AstBeThen)1 SimpleNode (com.developmentontheedge.sql.model.SimpleNode)1