public static Or or(ValueExpr theLeft, ValueExpr theRight) { return new Or(theLeft, theRight); }
public GroupBuilder<T, E> or(ValueExpr theLeft, ValueExpr theRight) { return filter(new Or(theLeft, theRight)); }
@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; }
@Override public Or visit(ASTOr node, Object data) throws VisitorException { ValueExpr leftArg = (ValueExpr)node.jjtGetChild(0).jjtAccept(this, null); ValueExpr rightArg = (ValueExpr)node.jjtGetChild(1).jjtAccept(this, null); return new Or(leftArg, rightArg); }
@Override public ValueExpr visit(ASTInList node, Object data) throws VisitorException { ValueExpr leftArg = (ValueExpr)node.getValueExpr().jjtAccept(this, null); ValueExpr result = null; for (ASTValueExpr argExpr : node.getArgList().getElements()) { ValueExpr rightArg = (ValueExpr)argExpr.jjtAccept(this, null); if (result == null) { // First argument result = new SameTerm(leftArg, rightArg); } else { SameTerm sameTerm = new SameTerm(leftArg.clone(), rightArg); result = new Or(result, sameTerm); } } assert result != null; return result; }
String.format("Invalid number of arguments for function: %s", func)); expr = new Or(args.get(0), args.get(1));
protected TupleExpr createTuplePattern(Var subjVar, Var predVar, Var objVar, String contextName, Resource... contexts) { if (contexts.length > 1) { StatementPattern sp; ValueExpr condition = null; Scope scope = Scope.NAMED_CONTEXTS; Var ctxVar = new Var(contextName); sp = new StatementPattern(scope, subjVar, predVar, objVar, ctxVar); for (Resource ctx : contexts) { ValueConstant val = new ValueConstant(ctx); SameTerm eq = new SameTerm(ctxVar, val); if (condition == null) { condition = eq; } else { condition = new Or(condition, eq); } } return new Filter(sp, condition); } else if (contexts.length == 1) { Scope scope = Scope.NAMED_CONTEXTS; Var ctxVar = new Var(contextName, contexts[0]); return new StatementPattern(scope, subjVar, predVar, objVar, ctxVar); } else { Scope scope = Scope.DEFAULT_CONTEXTS; return new StatementPattern(scope, subjVar, predVar, objVar, new Var(contextName)); } }
return new And(toValue(expr.getArg(0), md), toValue(expr.getArg(1), md)); } else if (op == Ops.OR) { return new Or(toValue(expr.getArg(0), md), toValue(expr.getArg(1), md)); } else if (op == Ops.IN) {
return new And(toValue(expr.getArg(0), md), toValue(expr.getArg(1), md)); }else if (op == Ops.OR){ return new Or(toValue(expr.getArg(0), md), toValue(expr.getArg(1), md)); }else if (op == Ops.IN){
return new And(toValue(expr.getArg(0), md), toValue(expr.getArg(1), md)); } else if (op == Ops.OR) { return new Or(toValue(expr.getArg(0), md), toValue(expr.getArg(1), md)); } else if (op == Ops.IN) {