@Override public Expr copy(Expr e1, Expr e2) { return new E_LogicalOr(e1 , e2 ) ; } }
newExpr = new E_LogicalOr(eval(new E_LogicalNot(child.getArg(1))), eval(new E_LogicalNot(child.getArg(2)))); return new E_LogicalOr(eval(expr.getArg(1)), eval(expr.getArg(2))); return new E_LogicalAnd(aa, bb); } else { return new E_LogicalOr(eval(new E_LogicalAnd(a.getArg(1), b)), eval(new E_LogicalAnd(a.getArg(2), b)));
public static Expr orifyBalanced(Iterable<Expr> exprs) { Expr result = opifyBalanced(exprs, (a, b) -> new E_LogicalOr(a, b)); return result; }
/** * implements logical or as per SPARQL 1.1 spec * * https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#OperatorMapping * * Converts expr to an Expr object via expr() * * @see #asExpr(Object) * @see org.apache.jena.sparql.expr.E_LogicalOr * * @param expr1 * the first expression. * @param expr2 * the second expression. * @return E_LogicalOr instance */ public final E_LogicalOr or(Object expr1, Object expr2) { return new E_LogicalOr(asExpr(expr1), asExpr(expr2)); }
/** Explode a expr into a list of disjunctions */ private static List<Expr> explodeDisjunction(List<Expr> exprList, Expr expr) { if ( !( expr instanceof E_LogicalOr ) ) { exprList.add(expr) ; return exprList ; } E_LogicalOr exprOr = (E_LogicalOr)expr ; Expr e1 = exprOr.getArg1() ; Expr e2 = exprOr.getArg2() ; explodeDisjunction(exprList, e1) ; explodeDisjunction(exprList, e2) ; return exprList ; } }
/** * implements logical or as per SPARQL 1.1 spec * * https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#OperatorMapping * * Converts expr to an Expr object via expr() * * @see #asExpr(Object) * @see org.apache.jena.sparql.expr.E_LogicalOr * * @param expr1 * the first expression. * @param expr2 * the second expression. * @return E_LogicalOr instance */ public final E_LogicalOr or(Object expr1, Object expr2) { return new E_LogicalOr(asExpr(expr1), asExpr(expr2)); }
eOther = e ; else eOther = new E_LogicalOr(eOther, e) ;
final public Expr ConditionalOrExpression() throws ParseException { Expr expr1, expr2 ; expr1 = ConditionalAndExpression(); label_31: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SC_OR: ; break; default: jj_la1[125] = jj_gen; break label_31; } jj_consume_token(SC_OR); expr2 = ConditionalAndExpression(); expr1 = new E_LogicalOr(expr1, expr2) ; } {if (true) return expr1 ;} throw new Error("Missing return statement in function"); }
@Override public Expr make(ItemList list) { BuilderLib.checkLength(3, list, "||: wanted 2 arguments: got :"+numArgs(list)) ; Expr left = buildExpr(list.get(1)) ; Expr right = buildExpr(list.get(2)) ; return new E_LogicalOr(left, right) ; } };
public static void collectOr(Expr expr, List<ExprList> list) { if(expr instanceof E_LogicalOr) { E_LogicalOr e = (E_LogicalOr)expr; collectOr(e.getArg1(), list); collectOr(e.getArg2(), list); } else if(expr instanceof E_LogicalAnd) { //List<Expr> ors = new ArrayList<Expr>(); ExprList ors = new ExprList(); collectAnd(expr, ors); list.add(ors); } else { ExprList tmp = new ExprList(); // Turn true into empty clause if(!NodeValue.TRUE.equals(expr)) { tmp.add(expr); } list.add(tmp); } }
final public Expr ConditionalOrExpression() throws ParseException { Expr expr1, expr2 ; expr1 = ConditionalAndExpression(); label_16: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SC_OR: ; break; default: jj_la1[54] = jj_gen; break label_16; } jj_consume_token(SC_OR); expr2 = ConditionalAndExpression(); expr1 = new E_LogicalOr(expr1, expr2) ; } {if (true) return expr1 ;} throw new Error("Missing return statement in function"); }
final public Expr ConditionalOrExpression() throws ParseException { Expr expr1, expr2 ; expr1 = ConditionalAndExpression(); label_37: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SC_OR: ; break; default: jj_la1[136] = jj_gen; break label_37; } jj_consume_token(SC_OR); expr2 = ConditionalAndExpression(); expr1 = new E_LogicalOr(expr1, expr2) ; } {if (true) return expr1 ;} throw new Error("Missing return statement in function"); }
public final Expr conditionalOrExpression() throws RecognitionException { Expr e = null; Expr a =null; Expr b =null; try { // openllet/query/sparqlowl/parser/antlr/SparqlOwlTreeARQ.g:1218:2: ( ^( CONDITIONAL_EXPRESSION_OR a= expression b= expression ) ) // openllet/query/sparqlowl/parser/antlr/SparqlOwlTreeARQ.g:1218:4: ^( CONDITIONAL_EXPRESSION_OR a= expression b= expression ) { match(input,CONDITIONAL_EXPRESSION_OR,FOLLOW_CONDITIONAL_EXPRESSION_OR_in_conditionalOrExpression2814); match(input, Token.DOWN, null); pushFollow(FOLLOW_expression_in_conditionalOrExpression2818); a=expression(); state._fsp--; pushFollow(FOLLOW_expression_in_conditionalOrExpression2822); b=expression(); state._fsp--; match(input, Token.UP, null); e = new E_LogicalOr( a, b ); } } catch( RecognitionException rce ) { throw rce; } finally { // do for sure before leaving } return e; } // $ANTLR end "conditionalOrExpression"
public final Expr conditionalOrExpression() throws RecognitionException { Expr e = null; Expr a =null; Expr b =null; try { // openllet/query/sparqlowl/parser/antlr/SparqlOwlTreeARQ.g:1218:2: ( ^( CONDITIONAL_EXPRESSION_OR a= expression b= expression ) ) // openllet/query/sparqlowl/parser/antlr/SparqlOwlTreeARQ.g:1218:4: ^( CONDITIONAL_EXPRESSION_OR a= expression b= expression ) { match(input,CONDITIONAL_EXPRESSION_OR,FOLLOW_CONDITIONAL_EXPRESSION_OR_in_conditionalOrExpression2814); match(input, Token.DOWN, null); pushFollow(FOLLOW_expression_in_conditionalOrExpression2818); a=expression(); state._fsp--; pushFollow(FOLLOW_expression_in_conditionalOrExpression2822); b=expression(); state._fsp--; match(input, Token.UP, null); e = new E_LogicalOr( a, b ); } } catch( RecognitionException rce ) { throw rce; } finally { // do for sure before leaving } return e; } // $ANTLR end "conditionalOrExpression"
new E_LogicalOr( new E_Equals(a.getType(), NodeValue.makeDecimal(2)), new E_Equals(a.getType(), NodeValue.makeDecimal(3)) ), new E_LogicalOr( new E_Equals(b.getType(), NodeValue.makeDecimal(2)), new E_Equals(b.getType(), NodeValue.makeDecimal(3)) result = new E_LogicalOr(eqTmpA, e);