use of org.drools.compiler.lang.descr.AnnotationDescr in project drools by kiegroup.
the class DRL5Expressions method andRestriction.
// $ANTLR end "orRestriction"
// $ANTLR start "andRestriction"
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:405:1: andRestriction returns [BaseDescr result] : left= singleRestriction ( ( DOUBLE_AMPER ( fullAnnotation[null] )? operator )=>lop= DOUBLE_AMPER (args= fullAnnotation[null] )? right= singleRestriction )* ;
public final BaseDescr andRestriction() 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/DRL5Expressions.g:406:3: (left= singleRestriction ( ( DOUBLE_AMPER ( fullAnnotation[null] )? operator )=>lop= DOUBLE_AMPER (args= fullAnnotation[null] )? right= singleRestriction )* )
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:406:5: left= singleRestriction ( ( DOUBLE_AMPER ( fullAnnotation[null] )? operator )=>lop= DOUBLE_AMPER (args= fullAnnotation[null] )? right= singleRestriction )*
{
pushFollow(FOLLOW_singleRestriction_in_andRestriction1881);
left = singleRestriction();
state._fsp--;
if (state.failed)
return result;
if (state.backtracking == 0) {
if (buildDescr) {
result = left;
}
}
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:407:3: ( ( DOUBLE_AMPER ( fullAnnotation[null] )? operator )=>lop= DOUBLE_AMPER (args= fullAnnotation[null] )? right= singleRestriction )*
loop42: while (true) {
int alt42 = 2;
int LA42_0 = input.LA(1);
if ((LA42_0 == DOUBLE_AMPER)) {
int LA42_9 = input.LA(2);
if ((synpred10_DRL5Expressions())) {
alt42 = 1;
}
}
switch(alt42) {
case 1:
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:407:5: ( DOUBLE_AMPER ( fullAnnotation[null] )? operator )=>lop= DOUBLE_AMPER (args= fullAnnotation[null] )? right= singleRestriction
{
lop = (Token) match(input, DOUBLE_AMPER, FOLLOW_DOUBLE_AMPER_in_andRestriction1901);
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/DRL5Expressions.g:409:13: (args= fullAnnotation[null] )?
int alt41 = 2;
int LA41_0 = input.LA(1);
if ((LA41_0 == AT)) {
alt41 = 1;
}
switch(alt41) {
case 1:
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:409:13: args= fullAnnotation[null]
{
pushFollow(FOLLOW_fullAnnotation_in_andRestriction1922);
args = fullAnnotation(null);
state._fsp--;
if (state.failed)
return result;
}
break;
}
pushFollow(FOLLOW_singleRestriction_in_andRestriction1927);
right = singleRestriction();
state._fsp--;
if (state.failed)
return result;
if (state.backtracking == 0) {
if (buildDescr) {
ConstraintConnectiveDescr descr = ConstraintConnectiveDescr.newAnd();
descr.addOrMerge(result);
descr.addOrMerge(right);
if (args != null) {
descr.addAnnotation(args);
}
result = descr;
}
}
}
break;
default:
break loop42;
}
}
}
} catch (RecognitionException re) {
throw re;
} finally {
// do for sure before leaving
}
return result;
}
use of org.drools.compiler.lang.descr.AnnotationDescr in project drools by kiegroup.
the class DRL5Expressions method orRestriction.
// $ANTLR end "relationalExpression"
// $ANTLR start "orRestriction"
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:391: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/DRL5Expressions.g:392:3: (left= andRestriction ( ( DOUBLE_PIPE ( fullAnnotation[null] )? andRestriction )=>lop= DOUBLE_PIPE (args= fullAnnotation[null] )? right= andRestriction )* ( EOF )? )
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:392:5: left= andRestriction ( ( DOUBLE_PIPE ( fullAnnotation[null] )? andRestriction )=>lop= DOUBLE_PIPE (args= fullAnnotation[null] )? right= andRestriction )* ( EOF )?
{
pushFollow(FOLLOW_andRestriction_in_orRestriction1810);
left = andRestriction();
state._fsp--;
if (state.failed)
return result;
if (state.backtracking == 0) {
if (buildDescr) {
result = left;
}
}
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:393: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 ((synpred9_DRL5Expressions())) {
alt39 = 1;
}
}
switch(alt39) {
case 1:
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:393:7: ( DOUBLE_PIPE ( fullAnnotation[null] )? andRestriction )=>lop= DOUBLE_PIPE (args= fullAnnotation[null] )? right= andRestriction
{
lop = (Token) match(input, DOUBLE_PIPE, FOLLOW_DOUBLE_PIPE_in_orRestriction1832);
if (state.failed)
return result;
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:393: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/DRL5Expressions.g:393:79: args= fullAnnotation[null]
{
pushFollow(FOLLOW_fullAnnotation_in_orRestriction1836);
args = fullAnnotation(null);
state._fsp--;
if (state.failed)
return result;
}
break;
}
pushFollow(FOLLOW_andRestriction_in_orRestriction1842);
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/DRL5Expressions.g:402: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 <= SEMICOLON) || LA40_1 == TILDE || (LA40_1 >= XOR && LA40_1 <= XOR_ASSIGN))) {
alt40 = 1;
}
}
switch(alt40) {
case 1:
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:402:7: EOF
{
match(input, EOF, FOLLOW_EOF_in_orRestriction1861);
if (state.failed)
return result;
}
break;
}
}
} catch (RecognitionException re) {
throw re;
} finally {
// do for sure before leaving
}
return result;
}
Aggregations