// $ANTLR start "singleRestriction"
// src/main/resources/org/drools/lang/DRLExpressions.g:331:1: singleRestriction returns [BaseDescr result] : (op= operator value= shiftExpression | LEFT_PAREN or= orRestriction RIGHT_PAREN );
public final BaseDescr singleRestriction() throws RecognitionException {
BaseDescr result = null;
DRLExpressions.operator_return op = null;
DRLExpressions.shiftExpression_return value = null;
BaseDescr or = null;
try {
// src/main/resources/org/drools/lang/DRLExpressions.g:332:3: (op= operator value= shiftExpression | LEFT_PAREN or= orRestriction RIGHT_PAREN )
int alt34=2;
int LA34_0 = input.LA(1);
if ( ((LA34_0>=EQUALS && LA34_0<=LESS)) ) {
alt34=1;
}
else if ( (LA34_0==ID) && ((((helper.validateIdentifierKey(DroolsSoftKeywords.NOT)))||((helper.isPluggableEvaluator(false)))))) {
alt34=1;
}
else if ( (LA34_0==LEFT_PAREN) ) {
alt34=2;
}
else {
if (state.backtracking>0) {state.failed=true; return result;}
NoViableAltException nvae =
new NoViableAltException("", 34, 0, input);
throw nvae;
}
switch (alt34) {
case 1 :
// src/main/resources/org/drools/lang/DRLExpressions.g:332:6: op= operator value= shiftExpression
{
pushFollow(FOLLOW_operator_in_singleRestriction1637);
op=operator();
state._fsp--;
if (state.failed) return result;
pushFollow(FOLLOW_shiftExpression_in_singleRestriction1641);
value=shiftExpression();
state._fsp--;
if (state.failed) return result;
if ( state.backtracking==0 ) {
if( buildDescr ) {
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), (op!=null?op.params:null), ((relationalExpression_scope)relationalExpression_stack.peek()).lsd, descr );