Search in sources :

Example 1 with ASTBooleanExpr

use of org.eclipse.rdf4j.query.parser.serql.ast.ASTBooleanExpr in project rdf4j by eclipse.

the class QueryModelBuilder method visit.

@Override
public ValueExpr visit(ASTAnd node, Object data) throws VisitorException {
    Iterator<ASTBooleanExpr> iter = node.getOperandList().iterator();
    ValueExpr result = (ValueExpr) iter.next().jjtAccept(this, null);
    while (iter.hasNext()) {
        ValueExpr operand = (ValueExpr) iter.next().jjtAccept(this, null);
        result = new And(result, operand);
    }
    return result;
}
Also used : ValueExpr(org.eclipse.rdf4j.query.algebra.ValueExpr) ASTValueExpr(org.eclipse.rdf4j.query.parser.serql.ast.ASTValueExpr) ASTBooleanExpr(org.eclipse.rdf4j.query.parser.serql.ast.ASTBooleanExpr) ASTAnd(org.eclipse.rdf4j.query.parser.serql.ast.ASTAnd) And(org.eclipse.rdf4j.query.algebra.And)

Example 2 with ASTBooleanExpr

use of org.eclipse.rdf4j.query.parser.serql.ast.ASTBooleanExpr in project rdf4j by eclipse.

the class QueryModelBuilder method visit.

@Override
public ValueExpr visit(ASTOr node, Object data) throws VisitorException {
    Iterator<ASTBooleanExpr> iter = node.getOperandList().iterator();
    ValueExpr result = (ValueExpr) iter.next().jjtAccept(this, null);
    while (iter.hasNext()) {
        ValueExpr operand = (ValueExpr) iter.next().jjtAccept(this, null);
        result = new Or(result, operand);
    }
    return result;
}
Also used : ValueExpr(org.eclipse.rdf4j.query.algebra.ValueExpr) ASTValueExpr(org.eclipse.rdf4j.query.parser.serql.ast.ASTValueExpr) ASTBooleanExpr(org.eclipse.rdf4j.query.parser.serql.ast.ASTBooleanExpr) Or(org.eclipse.rdf4j.query.algebra.Or) ASTOr(org.eclipse.rdf4j.query.parser.serql.ast.ASTOr)

Aggregations

ValueExpr (org.eclipse.rdf4j.query.algebra.ValueExpr)2 ASTBooleanExpr (org.eclipse.rdf4j.query.parser.serql.ast.ASTBooleanExpr)2 ASTValueExpr (org.eclipse.rdf4j.query.parser.serql.ast.ASTValueExpr)2 And (org.eclipse.rdf4j.query.algebra.And)1 Or (org.eclipse.rdf4j.query.algebra.Or)1 ASTAnd (org.eclipse.rdf4j.query.parser.serql.ast.ASTAnd)1 ASTOr (org.eclipse.rdf4j.query.parser.serql.ast.ASTOr)1