Examples of BindingDescr


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

        Token COLON9=null;
        Token UNIFY10=null;
        BaseDescr left = null;


         boolean isLeft = false; BindingDescr bind = null;
        try {
            // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:472:5: ( TILDE unaryExpression | NEGATION unaryExpression | ( castExpression )=> castExpression | ( ({...}? (var= ID COLON ) ) | ({...}? (var= ID UNIFY ) ) )? left= primary ( ( selector )=> selector )* ( ( INCR | DECR )=> ( INCR | DECR ) )? )
            int alt51=4;
            alt51 = dfa51.predict(input);
            switch (alt51) {
                case 1 :
                    // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:472:9: TILDE unaryExpression
                    {
                    match(input,TILDE,FOLLOW_TILDE_in_unaryExpressionNotPlusMinus2339); if (state.failed) return retval;
                    pushFollow(FOLLOW_unaryExpression_in_unaryExpressionNotPlusMinus2341);
                    unaryExpression();

                    state._fsp--;
                    if (state.failed) return retval;

                    }
                    break;
                case 2 :
                    // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:473:8: NEGATION unaryExpression
                    {
                    match(input,NEGATION,FOLLOW_NEGATION_in_unaryExpressionNotPlusMinus2350); if (state.failed) return retval;
                    pushFollow(FOLLOW_unaryExpression_in_unaryExpressionNotPlusMinus2352);
                    unaryExpression();

                    state._fsp--;
                    if (state.failed) return retval;

                    }
                    break;
                case 3 :
                    // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:474:9: ( castExpression )=> castExpression
                    {
                    pushFollow(FOLLOW_castExpression_in_unaryExpressionNotPlusMinus2366);
                    castExpression();

                    state._fsp--;
                    if (state.failed) return retval;

                    }
                    break;
                case 4 :
                    // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:475:9: ( ({...}? (var= ID COLON ) ) | ({...}? (var= ID UNIFY ) ) )? left= primary ( ( selector )=> selector )* ( ( INCR | DECR )=> ( INCR | DECR ) )?
                    {
                    if ( state.backtracking==0 ) {
                       isLeft = helper.getLeftMostExpr() == null;
                    }
                    // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:476:9: ( ({...}? (var= ID COLON ) ) | ({...}? (var= ID UNIFY ) ) )?
                    int alt48=3;
                    int LA48_0 = input.LA(1);

                    if ( (LA48_0==ID) ) {
                        int LA48_1 = input.LA(2);

                        if ( (LA48_1==COLON) ) {
                            int LA48_3 = input.LA(3);

                            if ( ((inMap == 0 && ternOp == 0 && input.LA(2) == DRL5Lexer.COLON)) ) {
                                alt48=1;
                            }
                        }
                        else if ( (LA48_1==UNIFY) ) {
                            alt48=2;
                        }
                    }
                    switch (alt48) {
                        case 1 :
                            // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:476:11: ({...}? (var= ID COLON ) )
                            {
                            // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:476:11: ({...}? (var= ID COLON ) )
                            // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:476:12: {...}? (var= ID COLON )
                            {
                            if ( !((inMap == 0 && ternOp == 0 && input.LA(2) == DRL5Lexer.COLON)) ) {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                throw new FailedPredicateException(input, "unaryExpressionNotPlusMinus", "inMap == 0 && ternOp == 0 && input.LA(2) == DRL5Lexer.COLON");
                            }
                            // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:476:75: (var= ID COLON )
                            // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:476:76: var= ID COLON
                            {
                            var=(Token)match(input,ID,FOLLOW_ID_in_unaryExpressionNotPlusMinus2394); if (state.failed) return retval;
                            COLON9=(Token)match(input,COLON,FOLLOW_COLON_in_unaryExpressionNotPlusMinus2396); if (state.failed) return retval;
                            if ( state.backtracking==0 ) {
                               hasBindings = true; helper.emit(var, DroolsEditorType.IDENTIFIER_VARIABLE); helper.emit(COLON9, DroolsEditorType.SYMBOL); if( buildDescr ) { bind = new BindingDescr((var!=null?var.getText():null), null, false); helper.setStart( bind, var ); }
                            }

                            }


                            }


                            }
                            break;
                        case 2 :
                            // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:478:11: ({...}? (var= ID UNIFY ) )
                            {
                            // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:478:11: ({...}? (var= ID UNIFY ) )
                            // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:478:12: {...}? (var= ID UNIFY )
                            {
                            if ( !((inMap == 0 && ternOp == 0 && input.LA(2) == DRL5Lexer.UNIFY)) ) {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                throw new FailedPredicateException(input, "unaryExpressionNotPlusMinus", "inMap == 0 && ternOp == 0 && input.LA(2) == DRL5Lexer.UNIFY");
                            }
                            // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:478:75: (var= ID UNIFY )
                            // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:478:76: var= ID UNIFY
                            {
                            var=(Token)match(input,ID,FOLLOW_ID_in_unaryExpressionNotPlusMinus2435); if (state.failed) return retval;
                            UNIFY10=(Token)match(input,UNIFY,FOLLOW_UNIFY_in_unaryExpressionNotPlusMinus2437); if (state.failed) return retval;
                            if ( state.backtracking==0 ) {
                               hasBindings = true; helper.emit(var, DroolsEditorType.IDENTIFIER_VARIABLE); helper.emit(UNIFY10, DroolsEditorType.SYMBOL); if( buildDescr ) { bind = new BindingDescr((var!=null?var.getText():null), null, true); helper.setStart( bind, var ); }
                            }

                            }


                            }


                            }
                            break;

                    }

                    pushFollow(FOLLOW_primary_in_unaryExpressionNotPlusMinus2482);
                    left=primary();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                       if( buildDescr ) { retval.result = left; }
                    }
                    // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:482:9: ( ( selector )=> selector )*
                    loop49:
                    do {
                        int alt49=2;
                        int LA49_0 = input.LA(1);

                        if ( (LA49_0==DOT) && (synpred15_DRL5Expressions())) {
                            alt49=1;
                        }
                        else if ( (LA49_0==LEFT_SQUARE) && (synpred15_DRL5Expressions())) {
                            alt49=1;
                        }


                        switch (alt49) {
                      case 1 :
                          // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:482:10: ( selector )=> selector
                          {
                          pushFollow(FOLLOW_selector_in_unaryExpressionNotPlusMinus2499);
                          selector();

                          state._fsp--;
                          if (state.failed) return retval;

                          }
                          break;

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

                    if ( state.backtracking==0 ) {

                                  if( buildDescr ) {
                                      String expr = input.toString(retval.start,input.LT(-1));
                                      if( isLeft ) {
                                          helper.setLeftMostExpr( expr );
                                      }
                                      if( bind != null ) {
                                          if( bind.isUnification() ) {
                                              expr = expr.substring( expr.indexOf( ":=" ) + 2 ).trim();
                                          } else {
                                              expr = expr.substring( expr.indexOf( ":" ) + 1 ).trim();
                                          }
                                          bind.setExpression( expr );
                                          helper.setEnd( bind );
                                          retval.result = bind;
                                      }
                                  }
                             
View Full Code Here

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

    BaseDescr left =null;
    ParserRuleReturnScope e1 =null;
    ParserRuleReturnScope e2 =null;

     ConstraintConnectiveDescr descr = null; BaseDescr leftDescr = null; BindingDescr binding = null;
    try {
      // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:314:3: (left= relationalExpression ( ( not_key in_key )=> not_key in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN |in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN )? )
      // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:314:5: left= relationalExpression ( ( not_key in_key )=> not_key in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN |in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN )?
      {
      pushFollow(FOLLOW_relationalExpression_in_inExpression1533);
      left=relationalExpression();
      state._fsp--;
      if (state.failed) return result;
      if ( state.backtracking==0 ) { if( buildDescr  ) { result = left; }
            if( left instanceof BindingDescr ) {
                binding = (BindingDescr)left;
                leftDescr = new AtomicExprDescr( binding.getExpression() );
            } else {
                leftDescr = left;
            }
          }
      // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:323:5: ( ( not_key in_key )=> not_key in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN |in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN )?
View Full Code Here

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

                  }
                } else if ( (left!=null?((DRL5Expressions.shiftExpression_return)left).result:null) instanceof BindingDescr ) {
                    if ( (left!=null?input.toString(left.start,left.stop):null).equals(((BindingDescr)(left!=null?((DRL5Expressions.shiftExpression_return)left).result:null)).getExpression()) ) {
                      result = (left!=null?((DRL5Expressions.shiftExpression_return)left).result:null);
                    } else {
                      BindingDescr bind = (BindingDescr) (left!=null?((DRL5Expressions.shiftExpression_return)left).result:null);
                      int offset = bind.isUnification() ? 2 : 1;
                      String fullExpression = (left!=null?input.toString(left.start,left.stop):null).substring( (left!=null?input.toString(left.start,left.stop):null).indexOf( ":" ) + offset ).trim();
                      result = new BindingDescr( bind.getVariable(), bind.getExpression(), fullExpression, bind.isUnification() );
                    }
                } else {
                    result = (left!=null?((DRL5Expressions.shiftExpression_return)left).result:null);
                }
                relationalExpression_stack.peek().lsd = result;
View Full Code Here

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

    Token var=null;
    Token COLON9=null;
    Token UNIFY10=null;
    BaseDescr left =null;

     boolean isLeft = false; BindingDescr bind = null;
    try {
      // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:488:5: ( TILDE unaryExpression | NEGATION unaryExpression | ( castExpression )=> castExpression | ( ({...}? (var= ID COLON ) ) | ({...}? (var= ID UNIFY ) ) )? left= primary ( ( selector )=> selector )* ( ( INCR | DECR )=> ( INCR | DECR ) )? )
      int alt53=4;
      switch ( input.LA(1) ) {
      case TILDE:
        {
        alt53=1;
        }
        break;
      case NEGATION:
        {
        alt53=2;
        }
        break;
      case LEFT_PAREN:
        {
        int LA53_3 = input.LA(2);
        if ( (synpred14_DRL5Expressions()) ) {
          alt53=3;
        }
        else if ( (true) ) {
          alt53=4;
        }

        }
        break;
      case BOOL:
      case DECIMAL:
      case FLOAT:
      case HEX:
      case ID:
      case LEFT_SQUARE:
      case LESS:
      case NULL:
      case STAR:
      case STRING:
      case TIME_INTERVAL:
        {
        alt53=4;
        }
        break;
      default:
        if (state.backtracking>0) {state.failed=true; return retval;}
        NoViableAltException nvae =
          new NoViableAltException("", 53, 0, input);
        throw nvae;
      }
      switch (alt53) {
        case 1 :
          // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:488:9: TILDE unaryExpression
          {
          match(input,TILDE,FOLLOW_TILDE_in_unaryExpressionNotPlusMinus2371); if (state.failed) return retval;
          pushFollow(FOLLOW_unaryExpression_in_unaryExpressionNotPlusMinus2373);
          unaryExpression();
          state._fsp--;
          if (state.failed) return retval;
          }
          break;
        case 2 :
          // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:489:8: NEGATION unaryExpression
          {
          match(input,NEGATION,FOLLOW_NEGATION_in_unaryExpressionNotPlusMinus2382); if (state.failed) return retval;
          pushFollow(FOLLOW_unaryExpression_in_unaryExpressionNotPlusMinus2384);
          unaryExpression();
          state._fsp--;
          if (state.failed) return retval;
          }
          break;
        case 3 :
          // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:490:9: ( castExpression )=> castExpression
          {
          pushFollow(FOLLOW_castExpression_in_unaryExpressionNotPlusMinus2398);
          castExpression();
          state._fsp--;
          if (state.failed) return retval;
          }
          break;
        case 4 :
          // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:491:9: ( ({...}? (var= ID COLON ) ) | ({...}? (var= ID UNIFY ) ) )? left= primary ( ( selector )=> selector )* ( ( INCR | DECR )=> ( INCR | DECR ) )?
          {
          if ( state.backtracking==0 ) { isLeft = helper.getLeftMostExpr() == null;}
          // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:492:9: ( ({...}? (var= ID COLON ) ) | ({...}? (var= ID UNIFY ) ) )?
          int alt50=3;
          int LA50_0 = input.LA(1);
          if ( (LA50_0==ID) ) {
            int LA50_1 = input.LA(2);
            if ( (LA50_1==COLON) ) {
              int LA50_3 = input.LA(3);
              if ( ((inMap == 0 && ternOp == 0 && input.LA(2) == DRL5Lexer.COLON)) ) {
                alt50=1;
              }
            }
            else if ( (LA50_1==UNIFY) ) {
              alt50=2;
            }
          }
          switch (alt50) {
            case 1 :
              // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:492:11: ({...}? (var= ID COLON ) )
              {
              // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:492:11: ({...}? (var= ID COLON ) )
              // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:492:12: {...}? (var= ID COLON )
              {
              if ( !((inMap == 0 && ternOp == 0 && input.LA(2) == DRL5Lexer.COLON)) ) {
                if (state.backtracking>0) {state.failed=true; return retval;}
                throw new FailedPredicateException(input, "unaryExpressionNotPlusMinus", "inMap == 0 && ternOp == 0 && input.LA(2) == DRL5Lexer.COLON");
              }
              // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:492:75: (var= ID COLON )
              // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:492:76: var= ID COLON
              {
              var=(Token)match(input,ID,FOLLOW_ID_in_unaryExpressionNotPlusMinus2426); if (state.failed) return retval;
              COLON9=(Token)match(input,COLON,FOLLOW_COLON_in_unaryExpressionNotPlusMinus2428); if (state.failed) return retval;
              if ( state.backtracking==0 ) { hasBindings = true; helper.emit(var, DroolsEditorType.IDENTIFIER_VARIABLE); helper.emit(COLON9, DroolsEditorType.SYMBOL); if( buildDescr ) { bind = new BindingDescr((var!=null?var.getText():null), null, false); helper.setStart( bind, var ); } }
              }

              }

              }
              break;
            case 2 :
              // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:494:11: ({...}? (var= ID UNIFY ) )
              {
              // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:494:11: ({...}? (var= ID UNIFY ) )
              // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:494:12: {...}? (var= ID UNIFY )
              {
              if ( !((inMap == 0 && ternOp == 0 && input.LA(2) == DRL5Lexer.UNIFY)) ) {
                if (state.backtracking>0) {state.failed=true; return retval;}
                throw new FailedPredicateException(input, "unaryExpressionNotPlusMinus", "inMap == 0 && ternOp == 0 && input.LA(2) == DRL5Lexer.UNIFY");
              }
              // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:494:75: (var= ID UNIFY )
              // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:494:76: var= ID UNIFY
              {
              var=(Token)match(input,ID,FOLLOW_ID_in_unaryExpressionNotPlusMinus2467); if (state.failed) return retval;
              UNIFY10=(Token)match(input,UNIFY,FOLLOW_UNIFY_in_unaryExpressionNotPlusMinus2469); if (state.failed) return retval;
              if ( state.backtracking==0 ) { hasBindings = true; helper.emit(var, DroolsEditorType.IDENTIFIER_VARIABLE); helper.emit(UNIFY10, DroolsEditorType.SYMBOL); if( buildDescr ) { bind = new BindingDescr((var!=null?var.getText():null), null, true); helper.setStart( bind, var ); } }
              }

              }

              }
              break;

          }

          pushFollow(FOLLOW_primary_in_unaryExpressionNotPlusMinus2514);
          left=primary();
          state._fsp--;
          if (state.failed) return retval;
          if ( state.backtracking==0 ) { if( buildDescr ) { retval.result = left; } }
          // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:498:9: ( ( selector )=> selector )*
          loop51:
          while (true) {
            int alt51=2;
            int LA51_0 = input.LA(1);
            if ( (LA51_0==DOT) && (synpred15_DRL5Expressions())) {
              alt51=1;
            }
            else if ( (LA51_0==LEFT_SQUARE) && (synpred15_DRL5Expressions())) {
              alt51=1;
            }

            switch (alt51) {
            case 1 :
              // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:498:10: ( selector )=> selector
              {
              pushFollow(FOLLOW_selector_in_unaryExpressionNotPlusMinus2531);
              selector();
              state._fsp--;
              if (state.failed) return retval;
              }
              break;

            default :
              break loop51;
            }
          }

          if ( state.backtracking==0 ) {
                      if( buildDescr ) {
                          String expr = input.toString(retval.start,input.LT(-1));
                          if( isLeft ) {
                              helper.setLeftMostExpr( expr );
                          }
                          if( bind != null ) {
                              if( bind.isUnification() ) {
                                  expr = expr.substring( expr.indexOf( ":=" ) + 2 ).trim();
                              } else {
                                  expr = expr.substring( expr.indexOf( ":" ) + 1 ).trim();
                              }
                              bind.setExpressionAndBindingField( expr );
                              helper.setEnd( bind );
                              retval.result = bind;
                          }
                      }
                  }
View Full Code Here

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

    BaseDescr left =null;
    ParserRuleReturnScope e1 =null;
    ParserRuleReturnScope e2 =null;

     ConstraintConnectiveDescr descr = null; BaseDescr leftDescr = null; BindingDescr binding = null;
    try {
      // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:328:3: (left= relationalExpression ( ( not_key in_key )=> not_key in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN |in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN )? )
      // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:328:5: left= relationalExpression ( ( not_key in_key )=> not_key in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN |in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN )?
      {
      pushFollow(FOLLOW_relationalExpression_in_inExpression1615);
      left=relationalExpression();
      state._fsp--;
      if (state.failed) return result;
      if ( state.backtracking==0 ) { if( buildDescr  ) { result = left; }
            if( left instanceof BindingDescr ) {
                binding = (BindingDescr)left;
                leftDescr = new AtomicExprDescr( binding.getExpression() );
            } else {
                leftDescr = left;
            }
          }
      // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:337:5: ( ( not_key in_key )=> not_key in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN |in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN )?
View Full Code Here

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

                  }
                } else if ( (left!=null?((DRL6Expressions.shiftExpression_return)left).result:null) instanceof BindingDescr ) {
                    if ( (left!=null?input.toString(left.start,left.stop):null).equals(((BindingDescr)(left!=null?((DRL6Expressions.shiftExpression_return)left).result:null)).getExpression()) ) {
                      result = (left!=null?((DRL6Expressions.shiftExpression_return)left).result:null);
                    } else {
                      BindingDescr bind = (BindingDescr) (left!=null?((DRL6Expressions.shiftExpression_return)left).result:null);
                      int offset = bind.isUnification() ? 2 : 1;
                      String fullExpression = (left!=null?input.toString(left.start,left.stop):null).substring( (left!=null?input.toString(left.start,left.stop):null).indexOf( ":" ) + offset ).trim();
                      result = new BindingDescr( bind.getVariable(), bind.getExpression(), fullExpression, bind.isUnification() );
                    }
                } else {
                    result = (left!=null?((DRL6Expressions.shiftExpression_return)left).result:null);
                }
                relationalExpression_stack.peek().lsd = result;
View Full Code Here

Examples of org.drools.lang.descr.BindingDescr

        DRLExpressions.expression_return e1 = null;

        DRLExpressions.expression_return e2 = null;


         ConstraintConnectiveDescr descr = null; BaseDescr leftDescr = null; BindingDescr binding = null;
        try {
            // src/main/resources/org/drools/lang/DRLExpressions.g:250:3: (left= relationalExpression ( ( not_key in_key )=> not_key in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN | in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN )? )
            // src/main/resources/org/drools/lang/DRLExpressions.g:250:5: left= relationalExpression ( ( not_key in_key )=> not_key in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN | in= in_key LEFT_PAREN e1= expression ( COMMA e2= expression )* RIGHT_PAREN )?
            {
            pushFollow(FOLLOW_relationalExpression_in_inExpression1280);
            left=relationalExpression();

            state._fsp--;
            if (state.failed) return result;
            if ( state.backtracking==0 ) {
               if( buildDescr  ) { result = left; }
                    if( left instanceof BindingDescr ) {
                        binding = (BindingDescr)left;
                        leftDescr = new AtomicExprDescr( binding.getExpression() );
                    } else {
                        leftDescr = left;
                    }
                 
            }
View Full Code Here

Examples of org.drools.lang.descr.BindingDescr

        Token var=null;
        BaseDescr left = null;


         boolean isLeft = false; BindingDescr bind = null;
        try {
            // src/main/resources/org/drools/lang/DRLExpressions.g:393:5: ( TILDE unaryExpression | NEGATION unaryExpression | ( castExpression )=> castExpression | ( ({...}? (var= ID COLON ) ) | ({...}? (var= ID UNIFY ) ) )? left= primary ( ( selector )=> selector )* ( ( INCR | DECR )=> ( INCR | DECR ) )? )
            int alt43=4;
            alt43 = dfa43.predict(input);
            switch (alt43) {
                case 1 :
                    // src/main/resources/org/drools/lang/DRLExpressions.g:393:9: TILDE unaryExpression
                    {
                    match(input,TILDE,FOLLOW_TILDE_in_unaryExpressionNotPlusMinus2012); if (state.failed) return retval;
                    pushFollow(FOLLOW_unaryExpression_in_unaryExpressionNotPlusMinus2014);
                    unaryExpression();

                    state._fsp--;
                    if (state.failed) return retval;

                    }
                    break;
                case 2 :
                    // src/main/resources/org/drools/lang/DRLExpressions.g:394:8: NEGATION unaryExpression
                    {
                    match(input,NEGATION,FOLLOW_NEGATION_in_unaryExpressionNotPlusMinus2023); if (state.failed) return retval;
                    pushFollow(FOLLOW_unaryExpression_in_unaryExpressionNotPlusMinus2025);
                    unaryExpression();

                    state._fsp--;
                    if (state.failed) return retval;

                    }
                    break;
                case 3 :
                    // src/main/resources/org/drools/lang/DRLExpressions.g:395:9: ( castExpression )=> castExpression
                    {
                    pushFollow(FOLLOW_castExpression_in_unaryExpressionNotPlusMinus2039);
                    castExpression();

                    state._fsp--;
                    if (state.failed) return retval;

                    }
                    break;
                case 4 :
                    // src/main/resources/org/drools/lang/DRLExpressions.g:396:9: ( ({...}? (var= ID COLON ) ) | ({...}? (var= ID UNIFY ) ) )? left= primary ( ( selector )=> selector )* ( ( INCR | DECR )=> ( INCR | DECR ) )?
                    {
                    if ( state.backtracking==0 ) {
                       isLeft = helper.getLeftMostExpr() == null;
                    }
                    // src/main/resources/org/drools/lang/DRLExpressions.g:397:9: ( ({...}? (var= ID COLON ) ) | ({...}? (var= ID UNIFY ) ) )?
                    int alt40=3;
                    int LA40_0 = input.LA(1);

                    if ( (LA40_0==ID) ) {
                        int LA40_1 = input.LA(2);

                        if ( (LA40_1==COLON) ) {
                            int LA40_3 = input.LA(3);

                            if ( ((inMap == 0 && ternOp == 0 && input.LA(2) == DRLLexer.COLON)) ) {
                                alt40=1;
                            }
                        }
                        else if ( (LA40_1==UNIFY) ) {
                            alt40=2;
                        }
                    }
                    switch (alt40) {
                        case 1 :
                            // src/main/resources/org/drools/lang/DRLExpressions.g:397:11: ({...}? (var= ID COLON ) )
                            {
                            // src/main/resources/org/drools/lang/DRLExpressions.g:397:11: ({...}? (var= ID COLON ) )
                            // src/main/resources/org/drools/lang/DRLExpressions.g:397:12: {...}? (var= ID COLON )
                            {
                            if ( !((inMap == 0 && ternOp == 0 && input.LA(2) == DRLLexer.COLON)) ) {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                throw new FailedPredicateException(input, "unaryExpressionNotPlusMinus", "inMap == 0 && ternOp == 0 && input.LA(2) == DRLLexer.COLON");
                            }
                            // src/main/resources/org/drools/lang/DRLExpressions.g:397:74: (var= ID COLON )
                            // src/main/resources/org/drools/lang/DRLExpressions.g:397:75: var= ID COLON
                            {
                            var=(Token)match(input,ID,FOLLOW_ID_in_unaryExpressionNotPlusMinus2067); if (state.failed) return retval;
                            match(input,COLON,FOLLOW_COLON_in_unaryExpressionNotPlusMinus2069); if (state.failed) return retval;
                            if ( state.backtracking==0 ) {
                               hasBindings = true; if( buildDescr ) { bind = new BindingDescr((var!=null?var.getText():null), null, false); helper.setStart( bind, var ); }
                            }

                            }


                            }


                            }
                            break;
                        case 2 :
                            // src/main/resources/org/drools/lang/DRLExpressions.g:399:11: ({...}? (var= ID UNIFY ) )
                            {
                            // src/main/resources/org/drools/lang/DRLExpressions.g:399:11: ({...}? (var= ID UNIFY ) )
                            // src/main/resources/org/drools/lang/DRLExpressions.g:399:12: {...}? (var= ID UNIFY )
                            {
                            if ( !((inMap == 0 && ternOp == 0 && input.LA(2) == DRLLexer.UNIFY)) ) {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                throw new FailedPredicateException(input, "unaryExpressionNotPlusMinus", "inMap == 0 && ternOp == 0 && input.LA(2) == DRLLexer.UNIFY");
                            }
                            // src/main/resources/org/drools/lang/DRLExpressions.g:399:74: (var= ID UNIFY )
                            // src/main/resources/org/drools/lang/DRLExpressions.g:399:75: var= ID UNIFY
                            {
                            var=(Token)match(input,ID,FOLLOW_ID_in_unaryExpressionNotPlusMinus2109); if (state.failed) return retval;
                            match(input,UNIFY,FOLLOW_UNIFY_in_unaryExpressionNotPlusMinus2111); if (state.failed) return retval;
                            if ( state.backtracking==0 ) {
                               hasBindings = true; if( buildDescr ) { bind = new BindingDescr((var!=null?var.getText():null), null, true); helper.setStart( bind, var ); }
                            }

                            }


                            }


                            }
                            break;

                    }

                    pushFollow(FOLLOW_primary_in_unaryExpressionNotPlusMinus2156);
                    left=primary();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                       if( buildDescr ) { retval.result = left; }
                    }
                    // src/main/resources/org/drools/lang/DRLExpressions.g:403:9: ( ( selector )=> selector )*
                    loop41:
                    do {
                        int alt41=2;
                        int LA41_0 = input.LA(1);

                        if ( (LA41_0==DOT) && (synpred16_DRLExpressions())) {
                            alt41=1;
                        }
                        else if ( (LA41_0==LEFT_SQUARE) && (synpred16_DRLExpressions())) {
                            alt41=1;
                        }


                        switch (alt41) {
                      case 1 :
                          // src/main/resources/org/drools/lang/DRLExpressions.g:403:10: ( selector )=> selector
                          {
                          pushFollow(FOLLOW_selector_in_unaryExpressionNotPlusMinus2173);
                          selector();

                          state._fsp--;
                          if (state.failed) return retval;

                          }
                          break;

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

                    if ( state.backtracking==0 ) {
                          
                                  if( buildDescr ) {
                                      String expr = input.toString(retval.start,input.LT(-1));
                                      if( isLeft ) {
                                          helper.setLeftMostExpr( expr );
                                      }
                                      if( bind != null ) {
                                          if( bind.isUnification() ) {
                                              expr = expr.substring( expr.indexOf( ":=" ) + 2 ).trim();
                                          } else {
                                              expr = expr.substring( expr.indexOf( ":" ) + 1 ).trim();
                                          }
                                          bind.setExpression( expr );
                                          helper.setEnd( bind );
                                          retval.result = bind;
                                      }
                                  }
                             
View Full Code Here

Examples of org.drools.lang.descr.BindingDescr

        emptyAttributeCheck( localName,
                             "fieldName",
                             fieldName,
                             parser );

        final BindingDescr fieldBindingDescr = new BindingDescr( identifier,
                                                                 fieldName);
        return fieldBindingDescr;
    }
View Full Code Here

Examples of org.drools.lang.descr.BindingDescr

    public Object end( final String uri,
                       final String localName,
                       final ExtensibleXmlParser parser ) throws SAXException {
        final Element element = parser.endElementBuilder();

        final BindingDescr fieldBindingDescr = (BindingDescr) parser.getCurrent();

        final PatternDescr patternDescr = (PatternDescr) parser.getParent();

        patternDescr.addConstraint( fieldBindingDescr );
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.