Examples of RelationalExprDescr


Examples of org.drools.compiler.lang.descr.RelationalExprDescr

                                  final Pattern pattern,
                                  final BaseDescr d,
                                  final String expr,
                                  final Map<String, OperatorDescr> aliases ) {

        RelationalExprDescr relDescr = d instanceof RelationalExprDescr ? (RelationalExprDescr) d : null;
        boolean simple = isSimpleExpr( relDescr );

        if ( simple && // simple means also relDescr is != null
                !ClassObjectType.Map_ObjectType.isAssignableFrom( pattern.getObjectType() ) &&
                !ClassObjectType.Match_ObjectType.isAssignableFrom( pattern.getObjectType() ) ) {
View Full Code Here

Examples of org.drools.compiler.lang.descr.RelationalExprDescr

        }

        int i = 0;
        StringBuilder sb = new StringBuilder();
        for (BaseDescr subDescr : subDescrs) {
            RelationalExprDescr relDescr = (RelationalExprDescr)subDescr;
            String[] values = new String[2];
            findExpressionValues(relDescr, values);
            String normalizedExpr;

            if (!getExprBindings(context, pattern, values[1]).isConstant()) {
                normalizedExpr = subExprs[i++];
            } else {
                InternalReadAccessor extractor = getFieldReadAccessor( context, relDescr, pattern.getObjectType(), values[0], null, true );
                if (extractor == null) {
                    normalizedExpr = subExprs[i++];
                } else {
                    ValueType vtype = extractor.getValueType();
                    LiteralRestrictionDescr restrictionDescr = new LiteralRestrictionDescr( relDescr.getOperator(),
                                                                                            relDescr.isNegated(),
                                                                                            relDescr.getParameters(),
                                                                                            values[1],
                                                                                            LiteralRestrictionDescr.TYPE_STRING );
                    normalizedExpr = normalizeMVELLiteralExpression( vtype,
                                                                     getFieldValue(context, vtype, restrictionDescr),
                                                                     subExprs[i++],
                                                                     values[0],
                                                                     relDescr.getOperator(),
                                                                     values[1],
                                                                     restrictionDescr );
                }
            }
View Full Code Here

Examples of org.drools.compiler.lang.descr.RelationalExprDescr

                                  final Pattern pattern,
                                  final BaseDescr d,
                                  final String expr,
                                  final Map<String, OperatorDescr> aliases ) {

        RelationalExprDescr relDescr = d instanceof RelationalExprDescr ? (RelationalExprDescr) d : null;
        boolean simple = isSimpleExpr( relDescr );

        if ( simple && // simple means also relDescr is != null
                !ClassObjectType.Map_ObjectType.isAssignableFrom( pattern.getObjectType() ) &&
                !ClassObjectType.Match_ObjectType.isAssignableFrom( pattern.getObjectType() ) ) {
View Full Code Here

Examples of org.drools.compiler.lang.descr.RelationalExprDescr

        }

        int i = 0;
        StringBuilder sb = new StringBuilder();
        for (BaseDescr subDescr : subDescrs) {
            RelationalExprDescr relDescr = (RelationalExprDescr)subDescr;
            String[] values = new String[2];
            findExpressionValues(relDescr, values);
            String normalizedExpr;

            if (!getExprBindings(context, pattern, values[1]).isConstant()) {
                normalizedExpr = subExprs[i++];
            } else {
                InternalReadAccessor extractor = getFieldReadAccessor( context, relDescr, pattern.getObjectType(), values[0], null, true );
                if (extractor == null) {
                    normalizedExpr = subExprs[i++];
                } else {
                    ValueType vtype = extractor.getValueType();
                    LiteralRestrictionDescr restrictionDescr = new LiteralRestrictionDescr( relDescr.getOperator(),
                                                                                            relDescr.isNegated(),
                                                                                            relDescr.getParameters(),
                                                                                            values[1],
                                                                                            LiteralRestrictionDescr.TYPE_STRING );
                    normalizedExpr = normalizeMVELLiteralExpression( vtype,
                                                                     getFieldValue(context, vtype, restrictionDescr),
                                                                     subExprs[i++],
                                                                     values[0],
                                                                     relDescr.getOperator(),
                                                                     values[1],
                                                                     restrictionDescr );
                }
            }
View Full Code Here

Examples of org.drools.compiler.lang.descr.RelationalExprDescr

                  state._fsp--;
                  if (state.failed) return result;
                  if ( state.backtracking==0 ) {
                     if( buildDescr  ) {
                                   result = new RelationalExprDescr( (op!=null?op.getText():null), false, null, left, right );
                               }
                            
                  }

                  }
View Full Code Here

Examples of org.drools.compiler.lang.descr.RelationalExprDescr

                    state._fsp--;
                    if (state.failed) return result;
                    if ( state.backtracking==0 ) {
                       if( buildDescr  ) {
                                     result = new RelationalExprDescr( (op!=null?input.toString(op.start,op.stop):null), false, null, left, new AtomicExprDescr((right!=null?input.toString(right.start,right.stop):null)) );
                                 }
                              
                    }

                    }
View Full Code Here

Examples of org.drools.compiler.lang.descr.RelationalExprDescr

                    state._fsp--;
                    if (state.failed) return result;
                    if ( state.backtracking==0 ) {
                         descr = ConstraintConnectiveDescr.newAnd();
                                  RelationalExprDescr rel = new RelationalExprDescr( "!=", false, null, leftDescr, (e1!=null?e1.result:null) );
                                  descr.addOrMerge( rel );
                                  result = descr;
                             
                    }
                    // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:330:7: ( COMMA e2= expression )*
                    loop32:
                    do {
                        int alt32=2;
                        int LA32_0 = input.LA(1);

                        if ( (LA32_0==COMMA) ) {
                            alt32=1;
                        }


                        switch (alt32) {
                      case 1 :
                          // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:330:8: COMMA e2= expression
                          {
                          match(input,COMMA,FOLLOW_COMMA_in_inExpression1568); if (state.failed) return result;
                          pushFollow(FOLLOW_expression_in_inExpression1572);
                          e2=expression();

                          state._fsp--;
                          if (state.failed) return result;
                          if ( state.backtracking==0 ) {
                               RelationalExprDescr rel = new RelationalExprDescr( "!=", false, null, leftDescr, (e2!=null?e2.result:null) );
                                        descr.addOrMerge( rel );
                                   
                          }

                          }
                          break;

                      default :
                          break loop32;
                        }
                    } while (true);

                    match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_inExpression1593); if (state.failed) return result;
                    if ( state.backtracking==0 ) {
                       helper.emit( Location.LOCATION_LHS_INSIDE_CONDITION_END );
                    }

                    }
                    break;
                case 2 :
                    // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:336:7: in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN
                    {
                    pushFollow(FOLLOW_in_key_in_inExpression1609);
                    in_key();

                    state._fsp--;
                    if (state.failed) return result;
                    match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_inExpression1611); if (state.failed) return result;
                    if ( state.backtracking==0 ) {
                         helper.emit( Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT );
                    }
                    pushFollow(FOLLOW_expression_in_inExpression1633);
                    e1=expression();

                    state._fsp--;
                    if (state.failed) return result;
                    if ( state.backtracking==0 ) {
                         descr = ConstraintConnectiveDescr.newOr();
                                  RelationalExprDescr rel = new RelationalExprDescr( "==", false, null, leftDescr, (e1!=null?e1.result:null) );
                                  descr.addOrMerge( rel );
                                  result = descr;
                             
                    }
                    // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:344:7: ( COMMA e2= expression )*
                    loop33:
                    do {
                        int alt33=2;
                        int LA33_0 = input.LA(1);

                        if ( (LA33_0==COMMA) ) {
                            alt33=1;
                        }


                        switch (alt33) {
                      case 1 :
                          // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:344:8: COMMA e2= expression
                          {
                          match(input,COMMA,FOLLOW_COMMA_in_inExpression1652); if (state.failed) return result;
                          pushFollow(FOLLOW_expression_in_inExpression1656);
                          e2=expression();

                          state._fsp--;
                          if (state.failed) return result;
                          if ( state.backtracking==0 ) {
                               RelationalExprDescr rel = new RelationalExprDescr( "==", false, null, leftDescr, (e2!=null?e2.result:null) );
                                        descr.addOrMerge( rel );
                                   
                          }

                          }
View Full Code Here

Examples of org.drools.compiler.lang.descr.RelationalExprDescr

                                     BaseDescr descr = ( (value!=null?value.result:null) != null &&
                                                       ( (!((value!=null?value.result:null) instanceof AtomicExprDescr)) ||
                                                         ((value!=null?input.toString(value.start,value.stop):null).equals(((AtomicExprDescr)(value!=null?value.result:null)).getExpression())) )) ?
                                              (value!=null?value.result:null) :
                                              new AtomicExprDescr( (value!=null?input.toString(value.start,value.stop):null) ) ;
                                     result = new RelationalExprDescr( (op!=null?op.opr:null), (op!=null?op.negated:false), sa, ((relationalExpression_scope)relationalExpression_stack.peek()).lsd, descr );
                               if( ((relationalExpression_scope)relationalExpression_stack.peek()).lsd instanceof BindingDescr ) {
                                   ((relationalExpression_scope)relationalExpression_stack.peek()).lsd = new AtomicExprDescr( ((BindingDescr)((relationalExpression_scope)relationalExpression_stack.peek()).lsd).getExpression() );
                               }
                                 }
                                 helper.emit( Location.LOCATION_LHS_INSIDE_CONDITION_END );
View Full Code Here

Examples of org.drools.compiler.lang.descr.RelationalExprDescr

          pushFollow(FOLLOW_instanceOfExpression_in_equalityExpression1429);
          right=instanceOfExpression();
          state._fsp--;
          if (state.failed) return result;
          if ( state.backtracking==0 ) { if( buildDescr  ) {
                         result = new RelationalExprDescr( (op!=null?op.getText():null), false, null, left, right );
                     }
                   }
          }
          break;
View Full Code Here

Examples of org.drools.compiler.lang.descr.RelationalExprDescr

          pushFollow(FOLLOW_type_in_instanceOfExpression1488);
          right=type();
          state._fsp--;
          if (state.failed) return result;
          if ( state.backtracking==0 ) { if( buildDescr  ) {
                         result = new RelationalExprDescr( (op!=null?input.toString(op.start,op.stop):null), false, null, left, new AtomicExprDescr((right!=null?input.toString(right.start,right.stop):null)) );
                     }
                   }
          }
          break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.