Search in sources :

Example 81 with BaseDescr

use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.

the class DRL6Expressions method conditionalOrExpression.

// $ANTLR end "annotationArray"
// $ANTLR start "conditionalOrExpression"
// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:228:1: conditionalOrExpression returns [BaseDescr result] : left= conditionalAndExpression ( DOUBLE_PIPE (args= fullAnnotation[null] )? right= conditionalAndExpression )* ;
public final BaseDescr conditionalOrExpression() throws RecognitionException {
    BaseDescr result = null;
    BaseDescr left = null;
    AnnotationDescr args = null;
    BaseDescr right = null;
    try {
        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:229:3: (left= conditionalAndExpression ( DOUBLE_PIPE (args= fullAnnotation[null] )? right= conditionalAndExpression )* )
        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:229:5: left= conditionalAndExpression ( DOUBLE_PIPE (args= fullAnnotation[null] )? right= conditionalAndExpression )*
        {
            pushFollow(FOLLOW_conditionalAndExpression_in_conditionalOrExpression1192);
            left = conditionalAndExpression();
            state._fsp--;
            if (state.failed)
                return result;
            if (state.backtracking == 0) {
                if (buildDescr) {
                    result = left;
                }
            }
            // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:230:3: ( DOUBLE_PIPE (args= fullAnnotation[null] )? right= conditionalAndExpression )*
            loop25: while (true) {
                int alt25 = 2;
                int LA25_0 = input.LA(1);
                if ((LA25_0 == DOUBLE_PIPE)) {
                    alt25 = 1;
                }
                switch(alt25) {
                    case 1:
                        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:230:5: DOUBLE_PIPE (args= fullAnnotation[null] )? right= conditionalAndExpression
                        {
                            match(input, DOUBLE_PIPE, FOLLOW_DOUBLE_PIPE_in_conditionalOrExpression1201);
                            if (state.failed)
                                return result;
                            if (state.backtracking == 0) {
                                if (isNotEOF())
                                    helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
                            }
                            // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:232:13: (args= fullAnnotation[null] )?
                            int alt24 = 2;
                            int LA24_0 = input.LA(1);
                            if ((LA24_0 == AT)) {
                                alt24 = 1;
                            }
                            switch(alt24) {
                                case 1:
                                    // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:232:13: args= fullAnnotation[null]
                                    {
                                        pushFollow(FOLLOW_fullAnnotation_in_conditionalOrExpression1223);
                                        args = fullAnnotation(null);
                                        state._fsp--;
                                        if (state.failed)
                                            return result;
                                    }
                                    break;
                            }
                            pushFollow(FOLLOW_conditionalAndExpression_in_conditionalOrExpression1229);
                            right = conditionalAndExpression();
                            state._fsp--;
                            if (state.failed)
                                return result;
                            if (state.backtracking == 0) {
                                if (buildDescr) {
                                    ConstraintConnectiveDescr descr = ConstraintConnectiveDescr.newOr();
                                    descr.addOrMerge(result);
                                    descr.addOrMerge(right);
                                    if (args != null) {
                                        descr.addAnnotation(args);
                                    }
                                    result = descr;
                                }
                            }
                        }
                        break;
                    default:
                        break loop25;
                }
            }
        }
    } catch (RecognitionException re) {
        throw re;
    } finally {
    // do for sure before leaving
    }
    return result;
}
Also used : BaseDescr(org.drools.compiler.lang.descr.BaseDescr) AnnotatedBaseDescr(org.drools.compiler.lang.descr.AnnotatedBaseDescr) ConstraintConnectiveDescr(org.drools.compiler.lang.descr.ConstraintConnectiveDescr) AnnotationDescr(org.drools.compiler.lang.descr.AnnotationDescr)

Example 82 with BaseDescr

use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.

the class DRL6Expressions method multiplicativeExpression.

// $ANTLR end "additiveExpression"
// $ANTLR start "multiplicativeExpression"
// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:475:1: multiplicativeExpression returns [BaseDescr result] : left= unaryExpression ( ( STAR | DIV | MOD ) unaryExpression )* ;
public final BaseDescr multiplicativeExpression() throws RecognitionException {
    BaseDescr result = null;
    BaseDescr left = null;
    try {
        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:476:5: (left= unaryExpression ( ( STAR | DIV | MOD ) unaryExpression )* )
        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:476:9: left= unaryExpression ( ( STAR | DIV | MOD ) unaryExpression )*
        {
            pushFollow(FOLLOW_unaryExpression_in_multiplicativeExpression2299);
            left = unaryExpression();
            state._fsp--;
            if (state.failed)
                return result;
            if (state.backtracking == 0) {
                if (buildDescr) {
                    result = left;
                }
            }
            // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:477:7: ( ( STAR | DIV | MOD ) unaryExpression )*
            loop48: while (true) {
                int alt48 = 2;
                int LA48_0 = input.LA(1);
                if ((LA48_0 == DIV || LA48_0 == MOD || LA48_0 == STAR)) {
                    alt48 = 1;
                }
                switch(alt48) {
                    case 1:
                        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:477:9: ( STAR | DIV | MOD ) unaryExpression
                        {
                            if (input.LA(1) == DIV || input.LA(1) == MOD || input.LA(1) == STAR) {
                                input.consume();
                                state.errorRecovery = false;
                                state.failed = false;
                            } else {
                                if (state.backtracking > 0) {
                                    state.failed = true;
                                    return result;
                                }
                                MismatchedSetException mse = new MismatchedSetException(null, input);
                                throw mse;
                            }
                            pushFollow(FOLLOW_unaryExpression_in_multiplicativeExpression2325);
                            unaryExpression();
                            state._fsp--;
                            if (state.failed)
                                return result;
                        }
                        break;
                    default:
                        break loop48;
                }
            }
        }
    } catch (RecognitionException re) {
        throw re;
    } finally {
    // do for sure before leaving
    }
    return result;
}
Also used : BaseDescr(org.drools.compiler.lang.descr.BaseDescr) AnnotatedBaseDescr(org.drools.compiler.lang.descr.AnnotatedBaseDescr)

Example 83 with BaseDescr

use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.

the class DRL6Expressions method shiftExpression.

// $ANTLR start "shiftExpression"
// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:459:1: shiftExpression returns [BaseDescr result] : left= additiveExpression ( ( shiftOp )=> shiftOp additiveExpression )* ;
public final DRL6Expressions.shiftExpression_return shiftExpression() throws RecognitionException {
    DRL6Expressions.shiftExpression_return retval = new DRL6Expressions.shiftExpression_return();
    retval.start = input.LT(1);
    BaseDescr left = null;
    try {
        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:460:3: (left= additiveExpression ( ( shiftOp )=> shiftOp additiveExpression )* )
        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:460:5: left= additiveExpression ( ( shiftOp )=> shiftOp additiveExpression )*
        {
            pushFollow(FOLLOW_additiveExpression_in_shiftExpression2146);
            left = additiveExpression();
            state._fsp--;
            if (state.failed)
                return retval;
            if (state.backtracking == 0) {
                if (buildDescr) {
                    retval.result = left;
                }
            }
            // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:461:5: ( ( shiftOp )=> shiftOp additiveExpression )*
            loop45: while (true) {
                int alt45 = 2;
                int LA45_0 = input.LA(1);
                if ((LA45_0 == LESS)) {
                    int LA45_6 = input.LA(2);
                    if ((synpred13_DRL6Expressions())) {
                        alt45 = 1;
                    }
                } else if ((LA45_0 == GREATER)) {
                    int LA45_7 = input.LA(2);
                    if ((synpred13_DRL6Expressions())) {
                        alt45 = 1;
                    }
                }
                switch(alt45) {
                    case 1:
                        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:461:7: ( shiftOp )=> shiftOp additiveExpression
                        {
                            pushFollow(FOLLOW_shiftOp_in_shiftExpression2160);
                            shiftOp();
                            state._fsp--;
                            if (state.failed)
                                return retval;
                            pushFollow(FOLLOW_additiveExpression_in_shiftExpression2162);
                            additiveExpression();
                            state._fsp--;
                            if (state.failed)
                                return retval;
                        }
                        break;
                    default:
                        break loop45;
                }
            }
        }
        retval.stop = input.LT(-1);
    } catch (RecognitionException re) {
        throw re;
    } finally {
    // do for sure before leaving
    }
    return retval;
}
Also used : BaseDescr(org.drools.compiler.lang.descr.BaseDescr) AnnotatedBaseDescr(org.drools.compiler.lang.descr.AnnotatedBaseDescr)

Example 84 with BaseDescr

use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.

the class DRL6Expressions method orRestriction.

// $ANTLR end "relationalExpression"
// $ANTLR start "orRestriction"
// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:405:1: orRestriction returns [BaseDescr result] : left= andRestriction ( ( DOUBLE_PIPE ( fullAnnotation[null] )? andRestriction )=>lop= DOUBLE_PIPE (args= fullAnnotation[null] )? right= andRestriction )* ( EOF )? ;
public final BaseDescr orRestriction() throws RecognitionException {
    BaseDescr result = null;
    Token lop = null;
    BaseDescr left = null;
    AnnotationDescr args = null;
    BaseDescr right = null;
    try {
        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:406:3: (left= andRestriction ( ( DOUBLE_PIPE ( fullAnnotation[null] )? andRestriction )=>lop= DOUBLE_PIPE (args= fullAnnotation[null] )? right= andRestriction )* ( EOF )? )
        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:406:5: left= andRestriction ( ( DOUBLE_PIPE ( fullAnnotation[null] )? andRestriction )=>lop= DOUBLE_PIPE (args= fullAnnotation[null] )? right= andRestriction )* ( EOF )?
        {
            pushFollow(FOLLOW_andRestriction_in_orRestriction1892);
            left = andRestriction();
            state._fsp--;
            if (state.failed)
                return result;
            if (state.backtracking == 0) {
                if (buildDescr) {
                    result = left;
                }
            }
            // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:407:5: ( ( DOUBLE_PIPE ( fullAnnotation[null] )? andRestriction )=>lop= DOUBLE_PIPE (args= fullAnnotation[null] )? right= andRestriction )*
            loop39: while (true) {
                int alt39 = 2;
                int LA39_0 = input.LA(1);
                if ((LA39_0 == DOUBLE_PIPE)) {
                    int LA39_9 = input.LA(2);
                    if ((synpred10_DRL6Expressions())) {
                        alt39 = 1;
                    }
                }
                switch(alt39) {
                    case 1:
                        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:407:7: ( DOUBLE_PIPE ( fullAnnotation[null] )? andRestriction )=>lop= DOUBLE_PIPE (args= fullAnnotation[null] )? right= andRestriction
                        {
                            lop = (Token) match(input, DOUBLE_PIPE, FOLLOW_DOUBLE_PIPE_in_orRestriction1914);
                            if (state.failed)
                                return result;
                            // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:407:79: (args= fullAnnotation[null] )?
                            int alt38 = 2;
                            int LA38_0 = input.LA(1);
                            if ((LA38_0 == AT)) {
                                alt38 = 1;
                            }
                            switch(alt38) {
                                case 1:
                                    // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:407:79: args= fullAnnotation[null]
                                    {
                                        pushFollow(FOLLOW_fullAnnotation_in_orRestriction1918);
                                        args = fullAnnotation(null);
                                        state._fsp--;
                                        if (state.failed)
                                            return result;
                                    }
                                    break;
                            }
                            pushFollow(FOLLOW_andRestriction_in_orRestriction1924);
                            right = andRestriction();
                            state._fsp--;
                            if (state.failed)
                                return result;
                            if (state.backtracking == 0) {
                                if (buildDescr) {
                                    ConstraintConnectiveDescr descr = ConstraintConnectiveDescr.newOr();
                                    descr.addOrMerge(result);
                                    descr.addOrMerge(right);
                                    if (args != null) {
                                        descr.addAnnotation(args);
                                    }
                                    result = descr;
                                }
                            }
                        }
                        break;
                    default:
                        break loop39;
                }
            }
            // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:416:7: ( EOF )?
            int alt40 = 2;
            int LA40_0 = input.LA(1);
            if ((LA40_0 == EOF)) {
                int LA40_1 = input.LA(2);
                if ((LA40_1 == EOF)) {
                    int LA40_3 = input.LA(3);
                    if ((LA40_3 == EOF)) {
                        alt40 = 1;
                    }
                } else if (((LA40_1 >= AMPER && LA40_1 <= AND_ASSIGN) || LA40_1 == AT || (LA40_1 >= COLON && LA40_1 <= COMMA) || LA40_1 == DIV_ASSIGN || (LA40_1 >= DOUBLE_AMPER && LA40_1 <= DOUBLE_PIPE) || (LA40_1 >= EQUALS && LA40_1 <= EQUALS_ASSIGN) || (LA40_1 >= GREATER && LA40_1 <= GREATER_EQUALS) || LA40_1 == ID || LA40_1 == LEFT_PAREN || (LA40_1 >= LESS && LA40_1 <= LESS_EQUALS) || LA40_1 == MINUS_ASSIGN || LA40_1 == MOD_ASSIGN || LA40_1 == MULT_ASSIGN || LA40_1 == NOT_EQUALS || LA40_1 == OR_ASSIGN || LA40_1 == PIPE || (LA40_1 >= PLUS_ASSIGN && LA40_1 <= QUESTION) || (LA40_1 >= RIGHT_CURLY && LA40_1 <= SEMICOLON) || LA40_1 == TILDE || (LA40_1 >= XOR && LA40_1 <= XOR_ASSIGN))) {
                    alt40 = 1;
                }
            }
            switch(alt40) {
                case 1:
                    // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:416:7: EOF
                    {
                        match(input, EOF, FOLLOW_EOF_in_orRestriction1943);
                        if (state.failed)
                            return result;
                    }
                    break;
            }
        }
    } catch (RecognitionException re) {
        throw re;
    } finally {
    // do for sure before leaving
    }
    return result;
}
Also used : BaseDescr(org.drools.compiler.lang.descr.BaseDescr) AnnotatedBaseDescr(org.drools.compiler.lang.descr.AnnotatedBaseDescr) ConstraintConnectiveDescr(org.drools.compiler.lang.descr.ConstraintConnectiveDescr) AnnotationDescr(org.drools.compiler.lang.descr.AnnotationDescr)

Example 85 with BaseDescr

use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.

the class DRL6Expressions method inclusiveOrExpression.

// $ANTLR end "conditionalAndExpression"
// $ANTLR start "inclusiveOrExpression"
// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:260:1: inclusiveOrExpression returns [BaseDescr result] : left= exclusiveOrExpression ( PIPE right= exclusiveOrExpression )* ;
public final BaseDescr inclusiveOrExpression() throws RecognitionException {
    BaseDescr result = null;
    BaseDescr left = null;
    BaseDescr right = null;
    try {
        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:261:3: (left= exclusiveOrExpression ( PIPE right= exclusiveOrExpression )* )
        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:261:5: left= exclusiveOrExpression ( PIPE right= exclusiveOrExpression )*
        {
            pushFollow(FOLLOW_exclusiveOrExpression_in_inclusiveOrExpression1336);
            left = exclusiveOrExpression();
            state._fsp--;
            if (state.failed)
                return result;
            if (state.backtracking == 0) {
                if (buildDescr) {
                    result = left;
                }
            }
            // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:262:3: ( PIPE right= exclusiveOrExpression )*
            loop28: while (true) {
                int alt28 = 2;
                int LA28_0 = input.LA(1);
                if ((LA28_0 == PIPE)) {
                    alt28 = 1;
                }
                switch(alt28) {
                    case 1:
                        // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:262:5: PIPE right= exclusiveOrExpression
                        {
                            match(input, PIPE, FOLLOW_PIPE_in_inclusiveOrExpression1344);
                            if (state.failed)
                                return result;
                            pushFollow(FOLLOW_exclusiveOrExpression_in_inclusiveOrExpression1348);
                            right = exclusiveOrExpression();
                            state._fsp--;
                            if (state.failed)
                                return result;
                            if (state.backtracking == 0) {
                                if (buildDescr) {
                                    ConstraintConnectiveDescr descr = ConstraintConnectiveDescr.newIncOr();
                                    descr.addOrMerge(result);
                                    descr.addOrMerge(right);
                                    result = descr;
                                }
                            }
                        }
                        break;
                    default:
                        break loop28;
                }
            }
        }
    } catch (RecognitionException re) {
        throw re;
    } finally {
    // do for sure before leaving
    }
    return result;
}
Also used : BaseDescr(org.drools.compiler.lang.descr.BaseDescr) AnnotatedBaseDescr(org.drools.compiler.lang.descr.AnnotatedBaseDescr) ConstraintConnectiveDescr(org.drools.compiler.lang.descr.ConstraintConnectiveDescr)

Aggregations

BaseDescr (org.drools.compiler.lang.descr.BaseDescr)109 AnnotatedBaseDescr (org.drools.compiler.lang.descr.AnnotatedBaseDescr)60 ConstraintConnectiveDescr (org.drools.compiler.lang.descr.ConstraintConnectiveDescr)23 AtomicExprDescr (org.drools.compiler.lang.descr.AtomicExprDescr)17 ConditionalElementDescr (org.drools.compiler.lang.descr.ConditionalElementDescr)16 BindingDescr (org.drools.compiler.lang.descr.BindingDescr)12 AndDescr (org.drools.compiler.lang.descr.AndDescr)11 RelationalExprDescr (org.drools.compiler.lang.descr.RelationalExprDescr)11 DeclareDescrBuilder (org.drools.compiler.lang.api.DeclareDescrBuilder)9 PatternDescr (org.drools.compiler.lang.descr.PatternDescr)8 OrDescr (org.drools.compiler.lang.descr.OrDescr)7 ArrayList (java.util.ArrayList)6 AccumulateDescrBuilder (org.drools.compiler.lang.api.AccumulateDescrBuilder)6 AnnotatedDescrBuilder (org.drools.compiler.lang.api.AnnotatedDescrBuilder)6 AnnotationDescrBuilder (org.drools.compiler.lang.api.AnnotationDescrBuilder)6 AttributeDescrBuilder (org.drools.compiler.lang.api.AttributeDescrBuilder)6 BehaviorDescrBuilder (org.drools.compiler.lang.api.BehaviorDescrBuilder)6 CEDescrBuilder (org.drools.compiler.lang.api.CEDescrBuilder)6 CollectDescrBuilder (org.drools.compiler.lang.api.CollectDescrBuilder)6 ConditionalBranchDescrBuilder (org.drools.compiler.lang.api.ConditionalBranchDescrBuilder)6