lhsNot := NOT
( (LEFT_PAREN (or_key|and_key))=> lhsOr  // prevents '((' for prefixed and/or
| LEFT_PAREN lhsOr RIGHT_PAREN
| lhsPatternBind
)

@param ce
@return
@throws org.antlr.runtime.RecognitionException
336267
protected BaseDescr lhsNot(CEDescrBuilder<?, ?> ce,
            boolean allowOr) throws RecognitionException {
        CEDescrBuilder<?, NotDescr> not = null;

        if (state.backtracking == 0) {
            not = ce.not();
            helper.start(not,
                    CEDescrBuilder.class,
                    null);
        }

        try {
            match(input,
                    DRL6Lexer.ID,
                    DroolsSoftKeywords.NOT,
                    null,
                    DroolsEditorType.KEYWORD);
            if (state.failed)
                return null;

            if (state.backtracking == 0) {
                helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION_NOT);
            }
            if (input.LA(1) == DRL6Lexer.LEFT_PAREN) {
                boolean prefixed = helper.validateLT(2,
                        DroolsSoftKeywords.AND) || helper.validateLT(2,
                        DroolsSoftKeywords.OR);

                if (!prefixed) {
                    match(input,
                            DRL6Lexer.LEFT_PAREN,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    if (state.failed)
                        return null;
                }
                if (state.backtracking == 0 && input.LA(1) != DRL6Lexer.EOF) {
                    helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION);
                }

                lhsOr(not,
                        allowOr);
                if (state.failed)
                    return null;

                if (!prefixed) {
                    match(input,
                            DRL6Lexer.RIGHT_PAREN,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    if (state.failed)
                        return null;
                }
            } else if (input.LA(1) != DRL6Lexer.EOF) {

                lhsPatternBind(not,
                        true);
                if (state.failed)
                    return null;
            }

        } finally {
            if (state.backtracking == 0) {
                helper.end(CEDescrBuilder.class,
                        not);
            }
        }
        return not != null ? not.getDescr() : null;
    }
972138
void rhs( RuleDescrBuilder rule ) {
        defaultConsequence(rule);
        while (input.LA(1) != DRL6Lexer.EOF && helper.validateIdentifierKey(DroolsSoftKeywords.THEN)) {
            namedConsequence(rule);
        }
    }
199069
public final void ruleNegatedToken() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXtext.g:1283:2: ( ( ( rule__NegatedToken__Group__0 ) ) )
            // InternalXtext.g:1284:2: ( ( rule__NegatedToken__Group__0 ) )
            {
            // InternalXtext.g:1284:2: ( ( rule__NegatedToken__Group__0 ) )
            // InternalXtext.g:1285:3: ( rule__NegatedToken__Group__0 )
            {
             before(grammarAccess.getNegatedTokenAccess().getGroup()); 
            // InternalXtext.g:1286:3: ( rule__NegatedToken__Group__0 )
            // InternalXtext.g:1286:4: rule__NegatedToken__Group__0
            {
            pushFollow(FollowSets000.FOLLOW_2);
            rule__NegatedToken__Group__0();

            state._fsp--;


            }

             after(grammarAccess.getNegatedTokenAccess().getGroup()); 

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
737535
public final AntlrDatatypeRuleToken ruleOpUnary() throws RecognitionException {
        AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();

        Token kw=null;


        	enterRule();

        try {
            // InternalPureXbase.g:2089:2: ( (kw= '!' | kw= '-' | kw= '+' ) )
            // InternalPureXbase.g:2090:2: (kw= '!' | kw= '-' | kw= '+' )
            {
            // InternalPureXbase.g:2090:2: (kw= '!' | kw= '-' | kw= '+' )
            int alt37=3;
            switch ( input.LA(1) ) {
            case 50:
                {
                alt37=1;
                }
                break;
            case 45:
                {
                alt37=2;
                }
                break;
            case 44:
                {
                alt37=3;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return current;}
                NoViableAltException nvae =
                    new NoViableAltException("", 37, 0, input);

                throw nvae;
            }

            switch (alt37) {
                case 1 :
                    // InternalPureXbase.g:2091:3: kw= '!'
                    {
                    kw=(Token)match(input,50,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getOpUnaryAccess().getExclamationMarkKeyword_0());
                      		
                    }

                    }
                    break;
                case 2 :
                    // InternalPureXbase.g:2097:3: kw= '-'
                    {
                    kw=(Token)match(input,45,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getOpUnaryAccess().getHyphenMinusKeyword_1());
                      		
                    }

                    }
                    break;
                case 3 :
                    // InternalPureXbase.g:2103:3: kw= '+'
                    {
                    kw=(Token)match(input,44,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getOpUnaryAccess().getPlusSignKeyword_2());
                      		
                    }

                    }
                    break;

            }


            }

            if ( state.backtracking==0 ) {

              	leaveRule();

            }
        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
390284
protected BaseDescr lhsForall(CEDescrBuilder<?, ?> ce) throws RecognitionException {
        ForallDescrBuilder<?> forall = helper.start(ce,
                ForallDescrBuilder.class,
                null);

        try {
            match(input,
                    DRL6Lexer.ID,
                    DroolsSoftKeywords.FORALL,
                    null,
                    DroolsEditorType.KEYWORD);
            if (state.failed)
                return null;

            match(input,
                    DRL6Lexer.LEFT_PAREN,
                    null,
                    null,
                    DroolsEditorType.SYMBOL);
            if (state.failed)
                return null;

            do {
                lhsPatternBind(forall,
                        false);
                if (state.failed)
                    return null;

                if (input.LA(1) == DRL6Lexer.COMMA) {
                    match(input,
                            DRL6Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    if (state.failed)
                        return null;
                }
            } while (input.LA(1) != DRL6Lexer.EOF && input.LA(1) != DRL6Lexer.RIGHT_PAREN);

            match(input,
                    DRL6Lexer.RIGHT_PAREN,
                    null,
                    null,
                    DroolsEditorType.SYMBOL);
            if (state.failed)
                return null;
        } finally {
            helper.end(ForallDescrBuilder.class,
                    forall);
        }

        return forall != null ? forall.getDescr() : null;
    }
452064
public final EObject ruleEnumLiteralDeclaration() throws RecognitionException {
        EObject current = null;

        Token otherlv_0=null;
        Token otherlv_1=null;
        EObject lv_literal_2_0 = null;



        	enterRule();

        try {
            // InternalXtext.g:3713:2: ( ( ( (otherlv_0= RULE_ID ) ) (otherlv_1= '=' ( (lv_literal_2_0= ruleKeyword ) ) )? ) )
            // InternalXtext.g:3714:2: ( ( (otherlv_0= RULE_ID ) ) (otherlv_1= '=' ( (lv_literal_2_0= ruleKeyword ) ) )? )
            {
            // InternalXtext.g:3714:2: ( ( (otherlv_0= RULE_ID ) ) (otherlv_1= '=' ( (lv_literal_2_0= ruleKeyword ) ) )? )
            // InternalXtext.g:3715:3: ( (otherlv_0= RULE_ID ) ) (otherlv_1= '=' ( (lv_literal_2_0= ruleKeyword ) ) )?
            {
            // InternalXtext.g:3715:3: ( (otherlv_0= RULE_ID ) )
            // InternalXtext.g:3716:4: (otherlv_0= RULE_ID )
            {
            // InternalXtext.g:3716:4: (otherlv_0= RULE_ID )
            // InternalXtext.g:3717:5: otherlv_0= RULE_ID
            {

            					if (current==null) {
            						current = createModelElement(grammarAccess.getEnumLiteralDeclarationRule());
            					}
            				
            otherlv_0=(Token)match(input,RULE_ID,FollowSets000.FOLLOW_51); 

            					newLeafNode(otherlv_0, grammarAccess.getEnumLiteralDeclarationAccess().getEnumLiteralEEnumLiteralCrossReference_0_0());
            				

            }


            }

            // InternalXtext.g:3728:3: (otherlv_1= '=' ( (lv_literal_2_0= ruleKeyword ) ) )?
            int alt78=2;
            int LA78_0 = input.LA(1);

            if ( (LA78_0==35) ) {
                alt78=1;
            }
            switch (alt78) {
                case 1 :
                    // InternalXtext.g:3729:4: otherlv_1= '=' ( (lv_literal_2_0= ruleKeyword ) )
                    {
                    otherlv_1=(Token)match(input,35,FollowSets000.FOLLOW_11); 

                    				newLeafNode(otherlv_1, grammarAccess.getEnumLiteralDeclarationAccess().getEqualsSignKeyword_1_0());
                    			
                    // InternalXtext.g:3733:4: ( (lv_literal_2_0= ruleKeyword ) )
                    // InternalXtext.g:3734:5: (lv_literal_2_0= ruleKeyword )
                    {
                    // InternalXtext.g:3734:5: (lv_literal_2_0= ruleKeyword )
                    // InternalXtext.g:3735:6: lv_literal_2_0= ruleKeyword
                    {

                    						newCompositeNode(grammarAccess.getEnumLiteralDeclarationAccess().getLiteralKeywordParserRuleCall_1_1_0());
                    					
                    pushFollow(FollowSets000.FOLLOW_2);
                    lv_literal_2_0=ruleKeyword();

                    state._fsp--;


                    						if (current==null) {
                    							current = createModelElementForParent(grammarAccess.getEnumLiteralDeclarationRule());
                    						}
                    						set(
                    							current,
                    							"literal",
                    							lv_literal_2_0,
                    							"org.eclipse.xtext.Xtext.Keyword");
                    						afterParserOrEnumRuleCall();
                    					

                    }


                    }


                    }
                    break;

            }


            }


            }


            	leaveRule();

        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
1020441
int encodeCEs(long ces[], int cesLength) {
        if(cesLength < 0 || cesLength > Collation.MAX_EXPANSION_LENGTH) {
            throw new IllegalArgumentException("mapping to too many CEs");
        }
        if(!isMutable()) {
            throw new IllegalStateException("attempt to add mappings after build()");
        }
        if(cesLength == 0) {
            // Convenience: We cannot map to nothing, but we can map to a completely ignorable CE.
            // Do this here so that callers need not do it.
            return encodeOneCEAsCE32(0);
        } else if(cesLength == 1) {
            return encodeOneCE(ces[0]);
        } else if(cesLength == 2) {
            // Try to encode two CEs as one CE32.
            long ce0 = ces[0];
            long ce1 = ces[1];
            long p0 = ce0 >>> 32;
            if((ce0 & 0xffffffffff00ffL) == Collation.COMMON_SECONDARY_CE &&
                    (ce1 & 0xffffffff00ffffffL) == Collation.COMMON_TERTIARY_CE &&
                    p0 != 0) {
                // Latin mini expansion
                return
                    (int)p0 |
                    (((int)ce0 & 0xff00) << 8) |
                    (((int)ce1 >> 16) & 0xff00) |
                    Collation.SPECIAL_CE32_LOW_BYTE |
                    Collation.LATIN_EXPANSION_TAG;
            }
        }
        // Try to encode two or more CEs as CE32s.
        int[] newCE32s = new int[Collation.MAX_EXPANSION_LENGTH];  // TODO: instance field?
        for(int i = 0;; ++i) {
            if(i == cesLength) {
                return encodeExpansion32(newCE32s, 0, cesLength);
            }
            int ce32 = encodeOneCEAsCE32(ces[i]);
            if(ce32 == Collation.NO_CE32) { break; }
            newCE32s[i] = ce32;
        }
        return encodeExpansion(ces, 0, cesLength);
    }
1173442
public static <D> Predicate notIn(Expression<D> left, Collection<? extends D> right) {
        if (right.size() == 1) {
            return neConst(left, right.iterator().next());
        } else {
            return predicate(Ops.NOT_IN, left, ConstantImpl.create(right));
        }
    }
1042450
public final void mEXPONENT() throws RecognitionException {
		try {
			// hql.g:871:2: ( ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+ )
			// hql.g:871:4: ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+
			{
			// hql.g:871:4: ( 'e' )
			// hql.g:871:5: 'e'
			{
			match('e'); if (state.failed) return;
			}

			// hql.g:871:10: ( '+' | '-' )?
			int alt21=2;
			int LA21_0 = input.LA(1);
			if ( (LA21_0=='+'||LA21_0=='-') ) {
				alt21=1;
			}
			switch (alt21) {
				case 1 :
					// hql.g:
					{
					if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
						input.consume();
						state.failed=false;
					}
					else {
						if (state.backtracking>0) {state.failed=true; return;}
						MismatchedSetException mse = new MismatchedSetException(null,input);
						recover(mse);
						throw mse;
					}
					}
					break;

			}

			// hql.g:871:21: ( '0' .. '9' )+
			int cnt22=0;
			loop22:
			while (true) {
				int alt22=2;
				int LA22_0 = input.LA(1);
				if ( ((LA22_0 >= '0' && LA22_0 <= '9')) ) {
					alt22=1;
				}

				switch (alt22) {
				case 1 :
					// hql.g:
					{
					if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
						input.consume();
						state.failed=false;
					}
					else {
						if (state.backtracking>0) {state.failed=true; return;}
						MismatchedSetException mse = new MismatchedSetException(null,input);
						recover(mse);
						throw mse;
					}
					}
					break;

				default :
					if ( cnt22 >= 1 ) break loop22;
					if (state.backtracking>0) {state.failed=true; return;}
					EarlyExitException eee = new EarlyExitException(22, input);
					throw eee;
				}
				cnt22++;
			}

			}

		}
		finally {
			// do for sure before leaving
		}
	}
426181
protected function Neg()
	{
	    throw XPath2Exception::withErrorCodeAndParams( "XPTY0004", Resources::UnaryOperatorNotDefined,
			array(
				"fn:unary-minus",
				SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $this->_value ), XmlTypeCardinality::One )
			)
		);
	}
379945
public final hqlParser.negatedExpression_return negatedExpression() throws RecognitionException {
		hqlParser.negatedExpression_return retval = new hqlParser.negatedExpression_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token NOT161=null;
		ParserRuleReturnScope x =null;
		ParserRuleReturnScope equalityExpression162 =null;

		CommonTree NOT161_tree=null;
		RewriteRuleTokenStream stream_NOT=new RewriteRuleTokenStream(adaptor,"token NOT");
		RewriteRuleSubtreeStream stream_equalityExpression=new RewriteRuleSubtreeStream(adaptor,"rule equalityExpression");
		RewriteRuleSubtreeStream stream_negatedExpression=new RewriteRuleSubtreeStream(adaptor,"rule negatedExpression");

		 WeakKeywords();
		try {
			// hql.g:427:2: ( NOT x= negatedExpression -> ^() | equalityExpression -> ^( equalityExpression ) )
			int alt53=2;
			int LA53_0 = input.LA(1);
			if ( (LA53_0==NOT) ) {
				alt53=1;
			}
			else if ( (LA53_0==ALL||LA53_0==ANY||LA53_0==AVG||LA53_0==BNOT||LA53_0==CASE||LA53_0==COLON||LA53_0==COUNT||LA53_0==ELEMENTS||LA53_0==EMPTY||LA53_0==EXISTS||LA53_0==FALSE||LA53_0==IDENT||LA53_0==INDICES||LA53_0==MAX||(LA53_0 >= MIN && LA53_0 <= MINUS)||(LA53_0 >= NULL && LA53_0 <= NUM_LONG)||LA53_0==OPEN||(LA53_0 >= PARAM && LA53_0 <= PLUS)||LA53_0==QUOTED_String||LA53_0==SOME||LA53_0==SUM||LA53_0==TRUE) ) {
				alt53=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 53, 0, input);
				throw nvae;
			}

			switch (alt53) {
				case 1 :
					// hql.g:427:4: NOT x= negatedExpression
					{
					NOT161=(Token)match(input,NOT,FOLLOW_NOT_in_negatedExpression1940);
					stream_NOT.add(NOT161);

					pushFollow(FOLLOW_negatedExpression_in_negatedExpression1944);
					x=negatedExpression();
					state._fsp--;

					stream_negatedExpression.add(x.getTree());
					// AST REWRITE
					// elements:
					// token labels:
					// rule labels: retval
					// token list labels:
					// rule list labels:
					// wildcard labels:
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (CommonTree)adaptor.nil();
					// 428:3: -> ^()
					{
						// hql.g:428:6: ^()
						{
						CommonTree root_1 = (CommonTree)adaptor.nil();
						root_1 = (CommonTree)adaptor.becomeRoot(NegateNode((x!=null?((CommonTree)x.getTree()):null)), root_1);
						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;
				case 2 :
					// hql.g:429:4: equalityExpression
					{
					pushFollow(FOLLOW_equalityExpression_in_negatedExpression1957);
					equalityExpression162=equalityExpression();
					state._fsp--;

					stream_equalityExpression.add(equalityExpression162.getTree());
					// AST REWRITE
					// elements: equalityExpression
					// token labels:
					// rule labels: retval
					// token list labels:
					// rule list labels:
					// wildcard labels:
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (CommonTree)adaptor.nil();
					// 430:3: -> ^( equalityExpression )
					{
						// hql.g:430:6: ^( equalityExpression )
						{
						CommonTree root_1 = (CommonTree)adaptor.nil();
						root_1 = (CommonTree)adaptor.becomeRoot(stream_equalityExpression.nextNode(), root_1);
						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;

			}
			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
610722
@Override
	public boolean startsWithCurrentPrefix(final String key) {
		lock.readLock().lock();
		try {
			if (getPrefix() != null && key != null) {
				return key.startsWith(getPrefix() + getPrefixDelimiter());
			}
		} finally {
			lock.readLock().unlock();
		}
		return false;
	}
520084
public final AntlrDatatypeRuleToken ruleOpEquality() throws RecognitionException {
        AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();

        Token kw=null;


        	enterRule();

        try {
            // InternalPureXbase.g:1326:2: ( (kw= '==' | kw= '!=' | kw= '===' | kw= '!==' ) )
            // InternalPureXbase.g:1327:2: (kw= '==' | kw= '!=' | kw= '===' | kw= '!==' )
            {
            // InternalPureXbase.g:1327:2: (kw= '==' | kw= '!=' | kw= '===' | kw= '!==' )
            int alt25=4;
            switch ( input.LA(1) ) {
            case 33:
                {
                alt25=1;
                }
                break;
            case 34:
                {
                alt25=2;
                }
                break;
            case 35:
                {
                alt25=3;
                }
                break;
            case 36:
                {
                alt25=4;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return current;}
                NoViableAltException nvae =
                    new NoViableAltException("", 25, 0, input);

                throw nvae;
            }

            switch (alt25) {
                case 1 :
                    // InternalPureXbase.g:1328:3: kw= '=='
                    {
                    kw=(Token)match(input,33,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getOpEqualityAccess().getEqualsSignEqualsSignKeyword_0());
                      		
                    }

                    }
                    break;
                case 2 :
                    // InternalPureXbase.g:1334:3: kw= '!='
                    {
                    kw=(Token)match(input,34,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getOpEqualityAccess().getExclamationMarkEqualsSignKeyword_1());
                      		
                    }

                    }
                    break;
                case 3 :
                    // InternalPureXbase.g:1340:3: kw= '==='
                    {
                    kw=(Token)match(input,35,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getOpEqualityAccess().getEqualsSignEqualsSignEqualsSignKeyword_2());
                      		
                    }

                    }
                    break;
                case 4 :
                    // InternalPureXbase.g:1346:3: kw= '!=='
                    {
                    kw=(Token)match(input,36,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getOpEqualityAccess().getExclamationMarkEqualsSignEqualsSignKeyword_3());
                      		
                    }

                    }
                    break;

            }


            }

            if ( state.backtracking==0 ) {

              	leaveRule();

            }
        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
619820
@SuppressWarnings("unchecked")
    private BaseDescr lhsPatternBind(PatternContainerDescrBuilder<?, ?> ce,
            final boolean allowOr) throws RecognitionException {
        PatternDescrBuilder<?> pattern = null;
        CEDescrBuilder<?, OrDescr> or = null;
        BaseDescr result = null;

        Token first = input.LT(1);
        pattern = helper.start((DescrBuilder<?, ?>) ce,
                PatternDescrBuilder.class,
                null);
        if (pattern != null) {
            result = pattern.getDescr();
        }

        String label = null;
        boolean isUnification = false;
        if (input.LA(1) == DRL6Lexer.ID && input.LA(2) == DRL6Lexer.COLON && !helper.validateCEKeyword(1)) {
            label = label(DroolsEditorType.IDENTIFIER_PATTERN);
            if (state.failed)
                return null;
        } else if (input.LA(1) == DRL6Lexer.ID && input.LA(2) == DRL6Lexer.UNIFY && !helper.validateCEKeyword(1)) {
            label = unif(DroolsEditorType.IDENTIFIER_PATTERN);
            if (state.failed)
                return null;
            isUnification = true;
        }

        if (input.LA(1) == DRL6Lexer.LEFT_PAREN) {
            try {
                match(input,
                        DRL6Lexer.LEFT_PAREN,
                        null,
                        null,
                        DroolsEditorType.SYMBOL);
                if (state.failed)
                    return null;

                if (helper.validateCEKeyword(1)) {
                    failMismatchedTokenException();
                    return null; // in case it is backtracking
                }

                lhsPattern(pattern,
                        label,
                        isUnification);
                if (state.failed)
                    return null;

                if (allowOr && helper.validateIdentifierKey(DroolsSoftKeywords.OR) && ce instanceof CEDescrBuilder) {
                    if (state.backtracking == 0) {
                        // this is necessary because of the crappy bind with multi-pattern OR syntax
                        or = ((CEDescrBuilder<DescrBuilder<?, ?>, OrDescr>) ce).or();
                        result = or.getDescr();

                        helper.end(PatternDescrBuilder.class,
                                pattern);
                        helper.start(or,
                                CEDescrBuilder.class,
                                null);
                        // adjust real or starting token:
                        helper.setStart(or,
                                first);

                        // remove original pattern from the parent CE child list:
                        ((ConditionalElementDescr) ce.getDescr()).getDescrs().remove(pattern.getDescr());
                        // add pattern to the OR instead
                        or.getDescr().addDescr(pattern.getDescr());
                    }

                    while (helper.validateIdentifierKey(DroolsSoftKeywords.OR)) {
                        match(input,
                                DRL6Lexer.ID,
                                DroolsSoftKeywords.OR,
                                null,
                                DroolsEditorType.KEYWORD);
                        if (state.failed)
                            return null;

                        pattern = helper.start(or,
                                PatternDescrBuilder.class,
                                null);
                        // new pattern, same binding
                        lhsPattern(pattern,
                                label,
                                isUnification);
                        if (state.failed)
                            return null;

                        helper.end(PatternDescrBuilder.class,
                                pattern);
                    }
                }

                match(input,
                        DRL6Lexer.RIGHT_PAREN,
                        null,
                        null,
                        DroolsEditorType.SYMBOL);
                if (state.failed)
                    return null;

            } finally {
                if (or != null) {
                    helper.end(CEDescrBuilder.class,
                            or);
                } else {
                    helper.end(PatternDescrBuilder.class,
                            pattern);
                }
            }

        } else {
            try {
                lhsPattern(pattern,
                        label,
                        isUnification);
                if (state.failed)
                    return null;

            } finally {
                helper.end(PatternDescrBuilder.class,
                        pattern);
            }
        }

        return result;
    }
177413
public final EObject ruleXSetLiteral() throws RecognitionException {
        EObject current = null;

        Token otherlv_1=null;
        Token otherlv_2=null;
        Token otherlv_4=null;
        Token otherlv_6=null;
        EObject lv_elements_3_0 = null;

        EObject lv_elements_5_0 = null;



        	enterRule();

        try {
            // InternalSARL.g:13785:2: ( ( () otherlv_1= '#' otherlv_2= '{' ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )? otherlv_6= '}' ) )
            // InternalSARL.g:13786:2: ( () otherlv_1= '#' otherlv_2= '{' ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )? otherlv_6= '}' )
            {
            // InternalSARL.g:13786:2: ( () otherlv_1= '#' otherlv_2= '{' ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )? otherlv_6= '}' )
            // InternalSARL.g:13787:3: () otherlv_1= '#' otherlv_2= '{' ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )? otherlv_6= '}'
            {
            // InternalSARL.g:13787:3: ()
            // InternalSARL.g:13788:4: 
            {
            if ( state.backtracking==0 ) {

              				current = forceCreateModelElement(
              					grammarAccess.getXSetLiteralAccess().getXSetLiteralAction_0(),
              					current);
              			
            }

            }

            otherlv_1=(Token)match(input,106,FOLLOW_17); if (state.failed) return current;
            if ( state.backtracking==0 ) {

              			newLeafNode(otherlv_1, grammarAccess.getXSetLiteralAccess().getNumberSignKeyword_1());
              		
            }
            otherlv_2=(Token)match(input,29,FOLLOW_130); if (state.failed) return current;
            if ( state.backtracking==0 ) {

              			newLeafNode(otherlv_2, grammarAccess.getXSetLiteralAccess().getLeftCurlyBracketKeyword_2());
              		
            }
            // InternalSARL.g:13802:3: ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )?
            int alt328=2;
            int LA328_0 = input.LA(1);

            if ( ((LA328_0>=RULE_STRING && LA328_0<=RULE_RICH_TEXT_START)||(LA328_0>=RULE_HEX && LA328_0<=RULE_DECIMAL)||LA328_0==25||(LA328_0>=28 && LA328_0<=29)||LA328_0==36||(LA328_0>=39 && LA328_0<=40)||(LA328_0>=42 && LA328_0<=45)||(LA328_0>=48 && LA328_0<=49)||LA328_0==51||LA328_0==55||(LA328_0>=60 && LA328_0<=63)||(LA328_0>=67 && LA328_0<=68)||(LA328_0>=73 && LA328_0<=75)||(LA328_0>=78 && LA328_0<=96)||LA328_0==106||LA328_0==129||(LA328_0>=131 && LA328_0<=140)) ) {
                alt328=1;
            }
            switch (alt328) {
                case 1 :
                    // InternalSARL.g:13803:4: ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )*
                    {
                    // InternalSARL.g:13803:4: ( (lv_elements_3_0= ruleXExpression ) )
                    // InternalSARL.g:13804:5: (lv_elements_3_0= ruleXExpression )
                    {
                    // InternalSARL.g:13804:5: (lv_elements_3_0= ruleXExpression )
                    // InternalSARL.g:13805:6: lv_elements_3_0= ruleXExpression
                    {
                    if ( state.backtracking==0 ) {

                      						newCompositeNode(grammarAccess.getXSetLiteralAccess().getElementsXExpressionParserRuleCall_3_0_0());
                      					
                    }
                    pushFollow(FOLLOW_131);
                    lv_elements_3_0=ruleXExpression();

                    state._fsp--;
                    if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      						if (current==null) {
                      							current = createModelElementForParent(grammarAccess.getXSetLiteralRule());
                      						}
                      						add(
                      							current,
                      							"elements",
                      							lv_elements_3_0,
                      							"org.eclipse.xtext.xbase.Xbase.XExpression");
                      						afterParserOrEnumRuleCall();
                      					
                    }

                    }


                    }

                    // InternalSARL.g:13822:4: (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )*
                    loop327:
                    do {
                        int alt327=2;
                        int LA327_0 = input.LA(1);

                        if ( (LA327_0==32) ) {
                            alt327=1;
                        }


                        switch (alt327) {
                    	case 1 :
                    	    // InternalSARL.g:13823:5: otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) )
                    	    {
                    	    otherlv_4=(Token)match(input,32,FOLLOW_45); if (state.failed) return current;
                    	    if ( state.backtracking==0 ) {

                    	      					newLeafNode(otherlv_4, grammarAccess.getXSetLiteralAccess().getCommaKeyword_3_1_0());
                    	      				
                    	    }
                    	    // InternalSARL.g:13827:5: ( (lv_elements_5_0= ruleXExpression ) )
                    	    // InternalSARL.g:13828:6: (lv_elements_5_0= ruleXExpression )
                    	    {
                    	    // InternalSARL.g:13828:6: (lv_elements_5_0= ruleXExpression )
                    	    // InternalSARL.g:13829:7: lv_elements_5_0= ruleXExpression
                    	    {
                    	    if ( state.backtracking==0 ) {

                    	      							newCompositeNode(grammarAccess.getXSetLiteralAccess().getElementsXExpressionParserRuleCall_3_1_1_0());
                    	      						
                    	    }
                    	    pushFollow(FOLLOW_131);
                    	    lv_elements_5_0=ruleXExpression();

                    	    state._fsp--;
                    	    if (state.failed) return current;
                    	    if ( state.backtracking==0 ) {

                    	      							if (current==null) {
                    	      								current = createModelElementForParent(grammarAccess.getXSetLiteralRule());
                    	      							}
                    	      							add(
                    	      								current,
                    	      								"elements",
                    	      								lv_elements_5_0,
                    	      								"org.eclipse.xtext.xbase.Xbase.XExpression");
                    	      							afterParserOrEnumRuleCall();
                    	      						
                    	    }

                    	    }


                    	    }


                    	    }
                    	    break;

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


                    }
                    break;

            }

            otherlv_6=(Token)match(input,30,FOLLOW_2); if (state.failed) return current;
            if ( state.backtracking==0 ) {

              			newLeafNode(otherlv_6, grammarAccess.getXSetLiteralAccess().getRightCurlyBracketKeyword_4());
              		
            }

            }


            }

            if ( state.backtracking==0 ) {

              	leaveRule();

            }
        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
1234587
public static <S> Matcher<S> not(Matcher<S> matcher) {
        return Matchers.not(matcher);
    }
223861
private void lhs( RuleDescrBuilder rule ) throws RecognitionException {
        match( input,
               DRL5Lexer.ID,
               DroolsSoftKeywords.WHEN,
               null,
               DroolsEditorType.KEYWORD );
        if ( state.failed ) return;

        if ( input.LA( 1 ) == DRL5Lexer.COLON ) {
            match( input,
                   DRL5Lexer.COLON,
                   null,
                   null,
                   DroolsEditorType.SYMBOL );
            if ( state.failed ) return;
        }

        lhsExpression( rule != null ? rule.lhs() : null );

    }