Search in sources :

Example 1 with If

use of org.eclipse.rdf4j.query.algebra.If in project rdf4j by eclipse.

the class TupleExprBuilder method visit.

@Override
public If visit(ASTIf node, Object data) throws VisitorException {
    If result = null;
    if (node.jjtGetNumChildren() < 3) {
        throw new VisitorException("IF construction missing required number of arguments");
    }
    ValueExpr condition = (ValueExpr) node.jjtGetChild(0).jjtAccept(this, null);
    ValueExpr resultExpr = (ValueExpr) node.jjtGetChild(1).jjtAccept(this, null);
    ValueExpr alternative = (ValueExpr) node.jjtGetChild(2).jjtAccept(this, null);
    result = new If(condition, resultExpr, alternative);
    return result;
}
Also used : ValueExpr(org.eclipse.rdf4j.query.algebra.ValueExpr) If(org.eclipse.rdf4j.query.algebra.If)

Aggregations

If (org.eclipse.rdf4j.query.algebra.If)1 ValueExpr (org.eclipse.rdf4j.query.algebra.ValueExpr)1