Search in sources :

Example 16 with UnorderedGroupState

use of org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState in project xtext-core by eclipse.

the class InternalSimpleBeeLangTestLanguageParser method entryRuleProvidedCapability.

// $ANTLR end "ruleUnit"
// $ANTLR start "entryRuleProvidedCapability"
// InternalSimpleBeeLangTestLanguage.g:578:1: entryRuleProvidedCapability returns [EObject current=null] : iv_ruleProvidedCapability= ruleProvidedCapability EOF ;
public final EObject entryRuleProvidedCapability() throws RecognitionException {
    EObject current = null;
    int entryRuleProvidedCapability_StartIndex = input.index();
    EObject iv_ruleProvidedCapability = null;
    UnorderedGroupState myUnorderedGroupState = getUnorderedGroupHelper().snapShot(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1());
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 7)) {
            return current;
        }
        // InternalSimpleBeeLangTestLanguage.g:582:2: (iv_ruleProvidedCapability= ruleProvidedCapability EOF )
        // InternalSimpleBeeLangTestLanguage.g:583:2: iv_ruleProvidedCapability= ruleProvidedCapability EOF
        {
            if (state.backtracking == 0) {
                newCompositeNode(grammarAccess.getProvidedCapabilityRule());
            }
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleProvidedCapability = ruleProvidedCapability();
            state._fsp--;
            if (state.failed)
                return current;
            if (state.backtracking == 0) {
                current = iv_ruleProvidedCapability;
            }
            match(input, EOF, FollowSets000.FOLLOW_2);
            if (state.failed)
                return current;
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 7, entryRuleProvidedCapability_StartIndex);
        }
        myUnorderedGroupState.restore();
    }
    return current;
}
Also used : UnorderedGroupState(org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState) EObject(org.eclipse.emf.ecore.EObject)

Example 17 with UnorderedGroupState

use of org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState in project xtext-core by eclipse.

the class InternalBeeLangTestLanguageParser method ruleAliasedRequiredCapability.

// $ANTLR end "entryRuleAliasedRequiredCapability"
// $ANTLR start "ruleAliasedRequiredCapability"
// InternalBeeLangTestLanguage.g:780:1: ruleAliasedRequiredCapability returns [EObject current=null] : ( ( ( (lv_nameSpace_0_0= RULE_ID ) ) | otherlv_1= 'unit' ) ( (lv_name_2_0= RULE_ID ) ) (otherlv_3= 'as' ( (lv_alias_4_0= RULE_ID ) ) )? (otherlv_5= '{' ( ( ( ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )* ) ) ) otherlv_25= '}' ) ) ;
public final EObject ruleAliasedRequiredCapability() throws RecognitionException {
    EObject current = null;
    int ruleAliasedRequiredCapability_StartIndex = input.index();
    Token lv_nameSpace_0_0 = null;
    Token otherlv_1 = null;
    Token lv_name_2_0 = null;
    Token otherlv_3 = null;
    Token lv_alias_4_0 = null;
    Token otherlv_5 = null;
    Token otherlv_7 = null;
    Token otherlv_8 = null;
    Token otherlv_10 = null;
    Token lv_greedy_11_0 = null;
    Token otherlv_12 = null;
    Token otherlv_13 = null;
    Token otherlv_14 = null;
    Token lv_min_15_0 = null;
    Token otherlv_16 = null;
    Token otherlv_17 = null;
    Token otherlv_18 = null;
    Token lv_max_19_0 = null;
    Token otherlv_20 = null;
    Token otherlv_21 = null;
    Token otherlv_22 = null;
    Token lv_versionRange_23_0 = null;
    Token otherlv_24 = null;
    Token otherlv_25 = null;
    EObject lv_condExpr_9_0 = null;
    enterRule();
    UnorderedGroupState myUnorderedGroupState = getUnorderedGroupHelper().snapShot(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1());
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 8)) {
            return current;
        }
        // InternalBeeLangTestLanguage.g:789:2: ( ( ( ( (lv_nameSpace_0_0= RULE_ID ) ) | otherlv_1= 'unit' ) ( (lv_name_2_0= RULE_ID ) ) (otherlv_3= 'as' ( (lv_alias_4_0= RULE_ID ) ) )? (otherlv_5= '{' ( ( ( ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )* ) ) ) otherlv_25= '}' ) ) )
        // InternalBeeLangTestLanguage.g:790:2: ( ( ( (lv_nameSpace_0_0= RULE_ID ) ) | otherlv_1= 'unit' ) ( (lv_name_2_0= RULE_ID ) ) (otherlv_3= 'as' ( (lv_alias_4_0= RULE_ID ) ) )? (otherlv_5= '{' ( ( ( ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )* ) ) ) otherlv_25= '}' ) )
        {
            // InternalBeeLangTestLanguage.g:790:2: ( ( ( (lv_nameSpace_0_0= RULE_ID ) ) | otherlv_1= 'unit' ) ( (lv_name_2_0= RULE_ID ) ) (otherlv_3= 'as' ( (lv_alias_4_0= RULE_ID ) ) )? (otherlv_5= '{' ( ( ( ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )* ) ) ) otherlv_25= '}' ) )
            // InternalBeeLangTestLanguage.g:791:3: ( ( (lv_nameSpace_0_0= RULE_ID ) ) | otherlv_1= 'unit' ) ( (lv_name_2_0= RULE_ID ) ) (otherlv_3= 'as' ( (lv_alias_4_0= RULE_ID ) ) )? (otherlv_5= '{' ( ( ( ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )* ) ) ) otherlv_25= '}' )
            {
                // InternalBeeLangTestLanguage.g:791:3: ( ( (lv_nameSpace_0_0= RULE_ID ) ) | otherlv_1= 'unit' )
                int alt17 = 2;
                int LA17_0 = input.LA(1);
                if ((LA17_0 == RULE_ID)) {
                    alt17 = 1;
                } else if ((LA17_0 == 13)) {
                    alt17 = 2;
                } else {
                    if (state.backtracking > 0) {
                        state.failed = true;
                        return current;
                    }
                    NoViableAltException nvae = new NoViableAltException("", 17, 0, input);
                    throw nvae;
                }
                switch(alt17) {
                    case 1:
                        // InternalBeeLangTestLanguage.g:792:4: ( (lv_nameSpace_0_0= RULE_ID ) )
                        {
                            // InternalBeeLangTestLanguage.g:792:4: ( (lv_nameSpace_0_0= RULE_ID ) )
                            // InternalBeeLangTestLanguage.g:793:5: (lv_nameSpace_0_0= RULE_ID )
                            {
                                // InternalBeeLangTestLanguage.g:793:5: (lv_nameSpace_0_0= RULE_ID )
                                // InternalBeeLangTestLanguage.g:794:6: lv_nameSpace_0_0= RULE_ID
                                {
                                    lv_nameSpace_0_0 = (Token) match(input, RULE_ID, FOLLOW_8);
                                    if (state.failed)
                                        return current;
                                    if (state.backtracking == 0) {
                                        newLeafNode(lv_nameSpace_0_0, grammarAccess.getAliasedRequiredCapabilityAccess().getNameSpaceIDTerminalRuleCall_0_0_0());
                                    }
                                    if (state.backtracking == 0) {
                                        if (current == null) {
                                            current = createModelElement(grammarAccess.getAliasedRequiredCapabilityRule());
                                        }
                                        setWithLastConsumed(current, "nameSpace", lv_nameSpace_0_0, "org.eclipse.xtext.common.Terminals.ID");
                                    }
                                }
                            }
                        }
                        break;
                    case 2:
                        // InternalBeeLangTestLanguage.g:811:4: otherlv_1= 'unit'
                        {
                            otherlv_1 = (Token) match(input, 13, FOLLOW_8);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                newLeafNode(otherlv_1, grammarAccess.getAliasedRequiredCapabilityAccess().getUnitKeyword_0_1());
                            }
                        }
                        break;
                }
                // InternalBeeLangTestLanguage.g:816:3: ( (lv_name_2_0= RULE_ID ) )
                // InternalBeeLangTestLanguage.g:817:4: (lv_name_2_0= RULE_ID )
                {
                    // InternalBeeLangTestLanguage.g:817:4: (lv_name_2_0= RULE_ID )
                    // InternalBeeLangTestLanguage.g:818:5: lv_name_2_0= RULE_ID
                    {
                        lv_name_2_0 = (Token) match(input, RULE_ID, FOLLOW_21);
                        if (state.failed)
                            return current;
                        if (state.backtracking == 0) {
                            newLeafNode(lv_name_2_0, grammarAccess.getAliasedRequiredCapabilityAccess().getNameIDTerminalRuleCall_1_0());
                        }
                        if (state.backtracking == 0) {
                            if (current == null) {
                                current = createModelElement(grammarAccess.getAliasedRequiredCapabilityRule());
                            }
                            setWithLastConsumed(current, "name", lv_name_2_0, "org.eclipse.xtext.common.Terminals.ID");
                        }
                    }
                }
                // InternalBeeLangTestLanguage.g:834:3: (otherlv_3= 'as' ( (lv_alias_4_0= RULE_ID ) ) )?
                int alt18 = 2;
                int LA18_0 = input.LA(1);
                if ((LA18_0 == 28)) {
                    alt18 = 1;
                }
                switch(alt18) {
                    case 1:
                        // InternalBeeLangTestLanguage.g:835:4: otherlv_3= 'as' ( (lv_alias_4_0= RULE_ID ) )
                        {
                            otherlv_3 = (Token) match(input, 28, FOLLOW_8);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                newLeafNode(otherlv_3, grammarAccess.getAliasedRequiredCapabilityAccess().getAsKeyword_2_0());
                            }
                            // InternalBeeLangTestLanguage.g:839:4: ( (lv_alias_4_0= RULE_ID ) )
                            // InternalBeeLangTestLanguage.g:840:5: (lv_alias_4_0= RULE_ID )
                            {
                                // InternalBeeLangTestLanguage.g:840:5: (lv_alias_4_0= RULE_ID )
                                // InternalBeeLangTestLanguage.g:841:6: lv_alias_4_0= RULE_ID
                                {
                                    lv_alias_4_0 = (Token) match(input, RULE_ID, FOLLOW_22);
                                    if (state.failed)
                                        return current;
                                    if (state.backtracking == 0) {
                                        newLeafNode(lv_alias_4_0, grammarAccess.getAliasedRequiredCapabilityAccess().getAliasIDTerminalRuleCall_2_1_0());
                                    }
                                    if (state.backtracking == 0) {
                                        if (current == null) {
                                            current = createModelElement(grammarAccess.getAliasedRequiredCapabilityRule());
                                        }
                                        setWithLastConsumed(current, "alias", lv_alias_4_0, "org.eclipse.xtext.common.Terminals.ID");
                                    }
                                }
                            }
                        }
                        break;
                }
                // InternalBeeLangTestLanguage.g:858:3: (otherlv_5= '{' ( ( ( ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )* ) ) ) otherlv_25= '}' )
                // InternalBeeLangTestLanguage.g:859:4: otherlv_5= '{' ( ( ( ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )* ) ) ) otherlv_25= '}'
                {
                    otherlv_5 = (Token) match(input, 17, FOLLOW_23);
                    if (state.failed)
                        return current;
                    if (state.backtracking == 0) {
                        newLeafNode(otherlv_5, grammarAccess.getAliasedRequiredCapabilityAccess().getLeftCurlyBracketKeyword_3_0());
                    }
                    // InternalBeeLangTestLanguage.g:863:4: ( ( ( ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )* ) ) )
                    // InternalBeeLangTestLanguage.g:864:5: ( ( ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )* ) )
                    {
                        // InternalBeeLangTestLanguage.g:864:5: ( ( ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )* ) )
                        // InternalBeeLangTestLanguage.g:865:6: ( ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )* )
                        {
                            getUnorderedGroupHelper().enter(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1());
                            // InternalBeeLangTestLanguage.g:868:6: ( ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )* )
                            // InternalBeeLangTestLanguage.g:869:7: ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )*
                            {
                                // InternalBeeLangTestLanguage.g:869:7: ( ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) ) | ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) ) | ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) ) )*
                                loop19: do {
                                    int alt19 = 6;
                                    int LA19_0 = input.LA(1);
                                    if (LA19_0 == 26 && getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 0)) {
                                        alt19 = 1;
                                    } else if (LA19_0 == 29 && getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 1)) {
                                        alt19 = 2;
                                    } else if (LA19_0 == 30 && getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 2)) {
                                        alt19 = 3;
                                    } else if (LA19_0 == 31 && getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 3)) {
                                        alt19 = 4;
                                    } else if (LA19_0 == 14 && getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 4)) {
                                        alt19 = 5;
                                    }
                                    switch(alt19) {
                                        case 1:
                                            // InternalBeeLangTestLanguage.g:870:5: ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) )
                                            {
                                                // InternalBeeLangTestLanguage.g:870:5: ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) )
                                                // InternalBeeLangTestLanguage.g:871:6: {...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) )
                                                {
                                                    if (!getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 0)) {
                                                        if (state.backtracking > 0) {
                                                            state.failed = true;
                                                            return current;
                                                        }
                                                        throw new FailedPredicateException(input, "ruleAliasedRequiredCapability", "getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 0)");
                                                    }
                                                    // InternalBeeLangTestLanguage.g:871:125: ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) )
                                                    // InternalBeeLangTestLanguage.g:872:7: ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) )
                                                    {
                                                        getUnorderedGroupHelper().select(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 0);
                                                        // InternalBeeLangTestLanguage.g:875:10: ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) )
                                                        // InternalBeeLangTestLanguage.g:875:11: {...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' )
                                                        {
                                                            if (!((true))) {
                                                                if (state.backtracking > 0) {
                                                                    state.failed = true;
                                                                    return current;
                                                                }
                                                                throw new FailedPredicateException(input, "ruleAliasedRequiredCapability", "true");
                                                            }
                                                            // InternalBeeLangTestLanguage.g:875:20: (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' )
                                                            // InternalBeeLangTestLanguage.g:875:21: otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';'
                                                            {
                                                                otherlv_7 = (Token) match(input, 26, FOLLOW_12);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_7, grammarAccess.getAliasedRequiredCapabilityAccess().getWhenKeyword_3_1_0_0());
                                                                }
                                                                otherlv_8 = (Token) match(input, 19, FOLLOW_19);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_8, grammarAccess.getAliasedRequiredCapabilityAccess().getColonKeyword_3_1_0_1());
                                                                }
                                                                // InternalBeeLangTestLanguage.g:883:10: ( (lv_condExpr_9_0= ruleExpression ) )
                                                                // InternalBeeLangTestLanguage.g:884:11: (lv_condExpr_9_0= ruleExpression )
                                                                {
                                                                    // InternalBeeLangTestLanguage.g:884:11: (lv_condExpr_9_0= ruleExpression )
                                                                    // InternalBeeLangTestLanguage.g:885:12: lv_condExpr_9_0= ruleExpression
                                                                    {
                                                                        if (state.backtracking == 0) {
                                                                            newCompositeNode(grammarAccess.getAliasedRequiredCapabilityAccess().getCondExprExpressionParserRuleCall_3_1_0_2_0());
                                                                        }
                                                                        pushFollow(FOLLOW_14);
                                                                        lv_condExpr_9_0 = ruleExpression();
                                                                        state._fsp--;
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            if (current == null) {
                                                                                current = createModelElementForParent(grammarAccess.getAliasedRequiredCapabilityRule());
                                                                            }
                                                                            set(current, "condExpr", lv_condExpr_9_0, "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.Expression");
                                                                            afterParserOrEnumRuleCall();
                                                                        }
                                                                    }
                                                                }
                                                                otherlv_10 = (Token) match(input, 20, FOLLOW_23);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_10, grammarAccess.getAliasedRequiredCapabilityAccess().getSemicolonKeyword_3_1_0_3());
                                                                }
                                                            }
                                                        }
                                                        getUnorderedGroupHelper().returnFromSelection(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1());
                                                    }
                                                }
                                            }
                                            break;
                                        case 2:
                                            // InternalBeeLangTestLanguage.g:912:5: ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) )
                                            {
                                                // InternalBeeLangTestLanguage.g:912:5: ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) )
                                                // InternalBeeLangTestLanguage.g:913:6: {...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) )
                                                {
                                                    if (!getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 1)) {
                                                        if (state.backtracking > 0) {
                                                            state.failed = true;
                                                            return current;
                                                        }
                                                        throw new FailedPredicateException(input, "ruleAliasedRequiredCapability", "getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 1)");
                                                    }
                                                    // InternalBeeLangTestLanguage.g:913:125: ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) )
                                                    // InternalBeeLangTestLanguage.g:914:7: ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) )
                                                    {
                                                        getUnorderedGroupHelper().select(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 1);
                                                        // InternalBeeLangTestLanguage.g:917:10: ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) )
                                                        // InternalBeeLangTestLanguage.g:917:11: {...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' )
                                                        {
                                                            if (!((true))) {
                                                                if (state.backtracking > 0) {
                                                                    state.failed = true;
                                                                    return current;
                                                                }
                                                                throw new FailedPredicateException(input, "ruleAliasedRequiredCapability", "true");
                                                            }
                                                            // InternalBeeLangTestLanguage.g:917:20: ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' )
                                                            // InternalBeeLangTestLanguage.g:917:21: ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';'
                                                            {
                                                                // InternalBeeLangTestLanguage.g:917:21: ( (lv_greedy_11_0= 'greedy' ) )
                                                                // InternalBeeLangTestLanguage.g:918:11: (lv_greedy_11_0= 'greedy' )
                                                                {
                                                                    // InternalBeeLangTestLanguage.g:918:11: (lv_greedy_11_0= 'greedy' )
                                                                    // InternalBeeLangTestLanguage.g:919:12: lv_greedy_11_0= 'greedy'
                                                                    {
                                                                        lv_greedy_11_0 = (Token) match(input, 29, FOLLOW_14);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(lv_greedy_11_0, grammarAccess.getAliasedRequiredCapabilityAccess().getGreedyGreedyKeyword_3_1_1_0_0());
                                                                        }
                                                                        if (state.backtracking == 0) {
                                                                            if (current == null) {
                                                                                current = createModelElement(grammarAccess.getAliasedRequiredCapabilityRule());
                                                                            }
                                                                            setWithLastConsumed(current, "greedy", true, "greedy");
                                                                        }
                                                                    }
                                                                }
                                                                otherlv_12 = (Token) match(input, 20, FOLLOW_23);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_12, grammarAccess.getAliasedRequiredCapabilityAccess().getSemicolonKeyword_3_1_1_1());
                                                                }
                                                            }
                                                        }
                                                        getUnorderedGroupHelper().returnFromSelection(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1());
                                                    }
                                                }
                                            }
                                            break;
                                        case 3:
                                            // InternalBeeLangTestLanguage.g:941:5: ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) )
                                            {
                                                // InternalBeeLangTestLanguage.g:941:5: ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) )
                                                // InternalBeeLangTestLanguage.g:942:6: {...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) )
                                                {
                                                    if (!getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 2)) {
                                                        if (state.backtracking > 0) {
                                                            state.failed = true;
                                                            return current;
                                                        }
                                                        throw new FailedPredicateException(input, "ruleAliasedRequiredCapability", "getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 2)");
                                                    }
                                                    // InternalBeeLangTestLanguage.g:942:125: ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) )
                                                    // InternalBeeLangTestLanguage.g:943:7: ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) )
                                                    {
                                                        getUnorderedGroupHelper().select(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 2);
                                                        // InternalBeeLangTestLanguage.g:946:10: ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) )
                                                        // InternalBeeLangTestLanguage.g:946:11: {...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' )
                                                        {
                                                            if (!((true))) {
                                                                if (state.backtracking > 0) {
                                                                    state.failed = true;
                                                                    return current;
                                                                }
                                                                throw new FailedPredicateException(input, "ruleAliasedRequiredCapability", "true");
                                                            }
                                                            // InternalBeeLangTestLanguage.g:946:20: (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' )
                                                            // InternalBeeLangTestLanguage.g:946:21: otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';'
                                                            {
                                                                otherlv_13 = (Token) match(input, 30, FOLLOW_12);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_13, grammarAccess.getAliasedRequiredCapabilityAccess().getRequiresMinKeyword_3_1_2_0());
                                                                }
                                                                otherlv_14 = (Token) match(input, 19, FOLLOW_24);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_14, grammarAccess.getAliasedRequiredCapabilityAccess().getColonKeyword_3_1_2_1());
                                                                }
                                                                // InternalBeeLangTestLanguage.g:954:10: ( (lv_min_15_0= RULE_INT ) )
                                                                // InternalBeeLangTestLanguage.g:955:11: (lv_min_15_0= RULE_INT )
                                                                {
                                                                    // InternalBeeLangTestLanguage.g:955:11: (lv_min_15_0= RULE_INT )
                                                                    // InternalBeeLangTestLanguage.g:956:12: lv_min_15_0= RULE_INT
                                                                    {
                                                                        lv_min_15_0 = (Token) match(input, RULE_INT, FOLLOW_14);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(lv_min_15_0, grammarAccess.getAliasedRequiredCapabilityAccess().getMinINTTerminalRuleCall_3_1_2_2_0());
                                                                        }
                                                                        if (state.backtracking == 0) {
                                                                            if (current == null) {
                                                                                current = createModelElement(grammarAccess.getAliasedRequiredCapabilityRule());
                                                                            }
                                                                            setWithLastConsumed(current, "min", lv_min_15_0, "org.eclipse.xtext.common.Terminals.INT");
                                                                        }
                                                                    }
                                                                }
                                                                otherlv_16 = (Token) match(input, 20, FOLLOW_23);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_16, grammarAccess.getAliasedRequiredCapabilityAccess().getSemicolonKeyword_3_1_2_3());
                                                                }
                                                            }
                                                        }
                                                        getUnorderedGroupHelper().returnFromSelection(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1());
                                                    }
                                                }
                                            }
                                            break;
                                        case 4:
                                            // InternalBeeLangTestLanguage.g:982:5: ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) )
                                            {
                                                // InternalBeeLangTestLanguage.g:982:5: ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) )
                                                // InternalBeeLangTestLanguage.g:983:6: {...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) )
                                                {
                                                    if (!getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 3)) {
                                                        if (state.backtracking > 0) {
                                                            state.failed = true;
                                                            return current;
                                                        }
                                                        throw new FailedPredicateException(input, "ruleAliasedRequiredCapability", "getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 3)");
                                                    }
                                                    // InternalBeeLangTestLanguage.g:983:125: ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) )
                                                    // InternalBeeLangTestLanguage.g:984:7: ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) )
                                                    {
                                                        getUnorderedGroupHelper().select(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 3);
                                                        // InternalBeeLangTestLanguage.g:987:10: ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) )
                                                        // InternalBeeLangTestLanguage.g:987:11: {...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' )
                                                        {
                                                            if (!((true))) {
                                                                if (state.backtracking > 0) {
                                                                    state.failed = true;
                                                                    return current;
                                                                }
                                                                throw new FailedPredicateException(input, "ruleAliasedRequiredCapability", "true");
                                                            }
                                                            // InternalBeeLangTestLanguage.g:987:20: (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' )
                                                            // InternalBeeLangTestLanguage.g:987:21: otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';'
                                                            {
                                                                otherlv_17 = (Token) match(input, 31, FOLLOW_12);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_17, grammarAccess.getAliasedRequiredCapabilityAccess().getRequiresMaxKeyword_3_1_3_0());
                                                                }
                                                                otherlv_18 = (Token) match(input, 19, FOLLOW_24);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_18, grammarAccess.getAliasedRequiredCapabilityAccess().getColonKeyword_3_1_3_1());
                                                                }
                                                                // InternalBeeLangTestLanguage.g:995:10: ( (lv_max_19_0= RULE_INT ) )
                                                                // InternalBeeLangTestLanguage.g:996:11: (lv_max_19_0= RULE_INT )
                                                                {
                                                                    // InternalBeeLangTestLanguage.g:996:11: (lv_max_19_0= RULE_INT )
                                                                    // InternalBeeLangTestLanguage.g:997:12: lv_max_19_0= RULE_INT
                                                                    {
                                                                        lv_max_19_0 = (Token) match(input, RULE_INT, FOLLOW_14);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(lv_max_19_0, grammarAccess.getAliasedRequiredCapabilityAccess().getMaxINTTerminalRuleCall_3_1_3_2_0());
                                                                        }
                                                                        if (state.backtracking == 0) {
                                                                            if (current == null) {
                                                                                current = createModelElement(grammarAccess.getAliasedRequiredCapabilityRule());
                                                                            }
                                                                            setWithLastConsumed(current, "max", lv_max_19_0, "org.eclipse.xtext.common.Terminals.INT");
                                                                        }
                                                                    }
                                                                }
                                                                otherlv_20 = (Token) match(input, 20, FOLLOW_23);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_20, grammarAccess.getAliasedRequiredCapabilityAccess().getSemicolonKeyword_3_1_3_3());
                                                                }
                                                            }
                                                        }
                                                        getUnorderedGroupHelper().returnFromSelection(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1());
                                                    }
                                                }
                                            }
                                            break;
                                        case 5:
                                            // InternalBeeLangTestLanguage.g:1023:5: ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) )
                                            {
                                                // InternalBeeLangTestLanguage.g:1023:5: ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) )
                                                // InternalBeeLangTestLanguage.g:1024:6: {...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) )
                                                {
                                                    if (!getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 4)) {
                                                        if (state.backtracking > 0) {
                                                            state.failed = true;
                                                            return current;
                                                        }
                                                        throw new FailedPredicateException(input, "ruleAliasedRequiredCapability", "getUnorderedGroupHelper().canSelect(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 4)");
                                                    }
                                                    // InternalBeeLangTestLanguage.g:1024:125: ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) )
                                                    // InternalBeeLangTestLanguage.g:1025:7: ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) )
                                                    {
                                                        getUnorderedGroupHelper().select(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 4);
                                                        // InternalBeeLangTestLanguage.g:1028:10: ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) )
                                                        // InternalBeeLangTestLanguage.g:1028:11: {...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' )
                                                        {
                                                            if (!((true))) {
                                                                if (state.backtracking > 0) {
                                                                    state.failed = true;
                                                                    return current;
                                                                }
                                                                throw new FailedPredicateException(input, "ruleAliasedRequiredCapability", "true");
                                                            }
                                                            // InternalBeeLangTestLanguage.g:1028:20: (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' )
                                                            // InternalBeeLangTestLanguage.g:1028:21: otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';'
                                                            {
                                                                otherlv_21 = (Token) match(input, 14, FOLLOW_12);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_21, grammarAccess.getAliasedRequiredCapabilityAccess().getVersionKeyword_3_1_4_0());
                                                                }
                                                                otherlv_22 = (Token) match(input, 19, FOLLOW_8);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_22, grammarAccess.getAliasedRequiredCapabilityAccess().getColonKeyword_3_1_4_1());
                                                                }
                                                                // InternalBeeLangTestLanguage.g:1036:10: ( (lv_versionRange_23_0= RULE_ID ) )
                                                                // InternalBeeLangTestLanguage.g:1037:11: (lv_versionRange_23_0= RULE_ID )
                                                                {
                                                                    // InternalBeeLangTestLanguage.g:1037:11: (lv_versionRange_23_0= RULE_ID )
                                                                    // InternalBeeLangTestLanguage.g:1038:12: lv_versionRange_23_0= RULE_ID
                                                                    {
                                                                        lv_versionRange_23_0 = (Token) match(input, RULE_ID, FOLLOW_14);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(lv_versionRange_23_0, grammarAccess.getAliasedRequiredCapabilityAccess().getVersionRangeIDTerminalRuleCall_3_1_4_2_0());
                                                                        }
                                                                        if (state.backtracking == 0) {
                                                                            if (current == null) {
                                                                                current = createModelElement(grammarAccess.getAliasedRequiredCapabilityRule());
                                                                            }
                                                                            setWithLastConsumed(current, "versionRange", lv_versionRange_23_0, "org.eclipse.xtext.common.Terminals.ID");
                                                                        }
                                                                    }
                                                                }
                                                                otherlv_24 = (Token) match(input, 20, FOLLOW_23);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_24, grammarAccess.getAliasedRequiredCapabilityAccess().getSemicolonKeyword_3_1_4_3());
                                                                }
                                                            }
                                                        }
                                                        getUnorderedGroupHelper().returnFromSelection(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1());
                                                    }
                                                }
                                            }
                                            break;
                                        default:
                                            break loop19;
                                    }
                                } while (true);
                            }
                        }
                        getUnorderedGroupHelper().leave(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1());
                    }
                    otherlv_25 = (Token) match(input, 25, FOLLOW_2);
                    if (state.failed)
                        return current;
                    if (state.backtracking == 0) {
                        newLeafNode(otherlv_25, grammarAccess.getAliasedRequiredCapabilityAccess().getRightCurlyBracketKeyword_3_2());
                    }
                }
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 8, ruleAliasedRequiredCapability_StartIndex);
        }
        myUnorderedGroupState.restore();
    }
    return current;
}
Also used : UnorderedGroupState(org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState) EObject(org.eclipse.emf.ecore.EObject) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Example 18 with UnorderedGroupState

use of org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState in project xtext-core by eclipse.

the class InternalSimpleBacktrackingBug325745TestLanguageParser method entryRuleExpression.

// $ANTLR end "ruleDataType"
// $ANTLR start "entryRuleExpression"
// InternalSimpleBacktrackingBug325745TestLanguage.g:287:1: entryRuleExpression returns [EObject current=null] : iv_ruleExpression= ruleExpression EOF ;
public final EObject entryRuleExpression() throws RecognitionException {
    EObject current = null;
    EObject iv_ruleExpression = null;
    UnorderedGroupState myUnorderedGroupState = getUnorderedGroupHelper().snapShot(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), grammarAccess.getExpressionAccess().getUnorderedGroup_3());
    try {
        // InternalSimpleBacktrackingBug325745TestLanguage.g:292:2: (iv_ruleExpression= ruleExpression EOF )
        // InternalSimpleBacktrackingBug325745TestLanguage.g:293:2: iv_ruleExpression= ruleExpression EOF
        {
            if (state.backtracking == 0) {
                newCompositeNode(grammarAccess.getExpressionRule());
            }
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleExpression = ruleExpression();
            state._fsp--;
            if (state.failed)
                return current;
            if (state.backtracking == 0) {
                current = iv_ruleExpression;
            }
            match(input, EOF, FollowSets000.FOLLOW_2);
            if (state.failed)
                return current;
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        myUnorderedGroupState.restore();
    }
    return current;
}
Also used : UnorderedGroupState(org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState) EObject(org.eclipse.emf.ecore.EObject)

Example 19 with UnorderedGroupState

use of org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState in project xtext-core by eclipse.

the class InternalSimpleBacktrackingBug325745TestLanguageParser method ruleExpression.

// $ANTLR end "entryRuleExpression"
// $ANTLR start "ruleExpression"
// InternalSimpleBacktrackingBug325745TestLanguage.g:302:1: ruleExpression returns [EObject current=null] : ( () ( ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) ) ) ( (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )? )* ( ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) ) ) ) ;
public final EObject ruleExpression() throws RecognitionException {
    EObject current = null;
    Token otherlv_2 = null;
    Token lv_prefix_3_0 = null;
    Token otherlv_4 = null;
    Token otherlv_6 = null;
    Token otherlv_8 = null;
    Token lv_postfix_9_0 = null;
    EObject lv_terms_5_0 = null;
    enterRule();
    UnorderedGroupState myUnorderedGroupState = getUnorderedGroupHelper().snapShot(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), grammarAccess.getExpressionAccess().getUnorderedGroup_3());
    try {
        // InternalSimpleBacktrackingBug325745TestLanguage.g:312:2: ( ( () ( ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) ) ) ( (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )? )* ( ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) ) ) ) )
        // InternalSimpleBacktrackingBug325745TestLanguage.g:313:2: ( () ( ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) ) ) ( (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )? )* ( ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) ) ) )
        {
            // InternalSimpleBacktrackingBug325745TestLanguage.g:313:2: ( () ( ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) ) ) ( (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )? )* ( ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) ) ) )
            // InternalSimpleBacktrackingBug325745TestLanguage.g:314:3: () ( ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) ) ) ( (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )? )* ( ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) ) )
            {
                // InternalSimpleBacktrackingBug325745TestLanguage.g:314:3: ()
                // InternalSimpleBacktrackingBug325745TestLanguage.g:315:4:
                {
                    if (state.backtracking == 0) {
                    /* */
                    }
                    if (state.backtracking == 0) {
                        current = forceCreateModelElement(grammarAccess.getExpressionAccess().getExpressionAction_0(), current);
                    }
                }
                // InternalSimpleBacktrackingBug325745TestLanguage.g:324:3: ( ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) ) )
                // InternalSimpleBacktrackingBug325745TestLanguage.g:325:4: ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) )
                {
                    // InternalSimpleBacktrackingBug325745TestLanguage.g:325:4: ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) )
                    // InternalSimpleBacktrackingBug325745TestLanguage.g:326:5: ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* )
                    {
                        getUnorderedGroupHelper().enter(grammarAccess.getExpressionAccess().getUnorderedGroup_1());
                        // InternalSimpleBacktrackingBug325745TestLanguage.g:329:5: ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* )
                        // InternalSimpleBacktrackingBug325745TestLanguage.g:330:6: ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )*
                        {
                            // InternalSimpleBacktrackingBug325745TestLanguage.g:330:6: ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )*
                            loop4: do {
                                int alt4 = 3;
                                int LA4_0 = input.LA(1);
                                if ((LA4_0 == 13)) {
                                    int LA4_1 = input.LA(2);
                                    if (synpred4_InternalSimpleBacktrackingBug325745TestLanguage() && getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 0)) {
                                        alt4 = 1;
                                    }
                                } else if ((LA4_0 == RULE_STRING)) {
                                    int LA4_3 = input.LA(2);
                                    if (synpred5_InternalSimpleBacktrackingBug325745TestLanguage() && getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 1)) {
                                        alt4 = 2;
                                    }
                                }
                                switch(alt4) {
                                    case 1:
                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:331:4: ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) )
                                        {
                                            // InternalSimpleBacktrackingBug325745TestLanguage.g:331:4: ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) )
                                            // InternalSimpleBacktrackingBug325745TestLanguage.g:332:5: {...}? => ( ({...}? => (otherlv_2= '[' ) ) )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 0)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleExpression", "getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 0)");
                                                }
                                                // InternalSimpleBacktrackingBug325745TestLanguage.g:332:107: ( ({...}? => (otherlv_2= '[' ) ) )
                                                // InternalSimpleBacktrackingBug325745TestLanguage.g:333:6: ({...}? => (otherlv_2= '[' ) )
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 0);
                                                    // InternalSimpleBacktrackingBug325745TestLanguage.g:336:9: ({...}? => (otherlv_2= '[' ) )
                                                    // InternalSimpleBacktrackingBug325745TestLanguage.g:336:10: {...}? => (otherlv_2= '[' )
                                                    {
                                                        if (!((true))) {
                                                            if (state.backtracking > 0) {
                                                                state.failed = true;
                                                                return current;
                                                            }
                                                            throw new FailedPredicateException(input, "ruleExpression", "true");
                                                        }
                                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:336:19: (otherlv_2= '[' )
                                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:336:20: otherlv_2= '['
                                                        {
                                                            otherlv_2 = (Token) match(input, 13, FollowSets000.FOLLOW_8);
                                                            if (state.failed)
                                                                return current;
                                                            if (state.backtracking == 0) {
                                                                newLeafNode(otherlv_2, grammarAccess.getExpressionAccess().getLeftSquareBracketKeyword_1_0());
                                                            }
                                                        }
                                                    }
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getExpressionAccess().getUnorderedGroup_1());
                                                }
                                            }
                                        }
                                        break;
                                    case 2:
                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:346:4: ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) )
                                        {
                                            // InternalSimpleBacktrackingBug325745TestLanguage.g:346:4: ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) )
                                            // InternalSimpleBacktrackingBug325745TestLanguage.g:347:5: {...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 1)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleExpression", "getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 1)");
                                                }
                                                // InternalSimpleBacktrackingBug325745TestLanguage.g:347:107: ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) )
                                                // InternalSimpleBacktrackingBug325745TestLanguage.g:348:6: ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) )
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 1);
                                                    // InternalSimpleBacktrackingBug325745TestLanguage.g:351:9: ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) )
                                                    // InternalSimpleBacktrackingBug325745TestLanguage.g:351:10: {...}? => ( (lv_prefix_3_0= RULE_STRING ) )
                                                    {
                                                        if (!((true))) {
                                                            if (state.backtracking > 0) {
                                                                state.failed = true;
                                                                return current;
                                                            }
                                                            throw new FailedPredicateException(input, "ruleExpression", "true");
                                                        }
                                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:351:19: ( (lv_prefix_3_0= RULE_STRING ) )
                                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:351:20: (lv_prefix_3_0= RULE_STRING )
                                                        {
                                                            // InternalSimpleBacktrackingBug325745TestLanguage.g:351:20: (lv_prefix_3_0= RULE_STRING )
                                                            // InternalSimpleBacktrackingBug325745TestLanguage.g:352:10: lv_prefix_3_0= RULE_STRING
                                                            {
                                                                lv_prefix_3_0 = (Token) match(input, RULE_STRING, FollowSets000.FOLLOW_8);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(lv_prefix_3_0, grammarAccess.getExpressionAccess().getPrefixSTRINGTerminalRuleCall_1_1_0());
                                                                }
                                                                if (state.backtracking == 0) {
                                                                    if (current == null) {
                                                                        current = createModelElement(grammarAccess.getExpressionRule());
                                                                    }
                                                                    setWithLastConsumed(current, "prefix", lv_prefix_3_0, "org.eclipse.xtext.common.Terminals.STRING");
                                                                }
                                                            }
                                                        }
                                                    }
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getExpressionAccess().getUnorderedGroup_1());
                                                }
                                            }
                                        }
                                        break;
                                    default:
                                        break loop4;
                                }
                            } while (true);
                        }
                    }
                    getUnorderedGroupHelper().leave(grammarAccess.getExpressionAccess().getUnorderedGroup_1());
                }
                // InternalSimpleBacktrackingBug325745TestLanguage.g:380:3: ( (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )? )*
                loop7: do {
                    int alt7 = 2;
                    int LA7_0 = input.LA(1);
                    if ((LA7_0 == RULE_ID || LA7_0 == RULE_INT || LA7_0 == 13)) {
                        alt7 = 1;
                    }
                    switch(alt7) {
                        case 1:
                            // InternalSimpleBacktrackingBug325745TestLanguage.g:381:4: (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )?
                            {
                                // InternalSimpleBacktrackingBug325745TestLanguage.g:381:4: (otherlv_4= '[' )?
                                int alt5 = 2;
                                int LA5_0 = input.LA(1);
                                if ((LA5_0 == 13)) {
                                    alt5 = 1;
                                }
                                switch(alt5) {
                                    case 1:
                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:382:5: otherlv_4= '['
                                        {
                                            otherlv_4 = (Token) match(input, 13, FollowSets000.FOLLOW_9);
                                            if (state.failed)
                                                return current;
                                            if (state.backtracking == 0) {
                                                newLeafNode(otherlv_4, grammarAccess.getExpressionAccess().getLeftSquareBracketKeyword_2_0());
                                            }
                                        }
                                        break;
                                }
                                // InternalSimpleBacktrackingBug325745TestLanguage.g:387:4: ( (lv_terms_5_0= ruleSimpleTerm ) )
                                // InternalSimpleBacktrackingBug325745TestLanguage.g:388:5: (lv_terms_5_0= ruleSimpleTerm )
                                {
                                    // InternalSimpleBacktrackingBug325745TestLanguage.g:388:5: (lv_terms_5_0= ruleSimpleTerm )
                                    // InternalSimpleBacktrackingBug325745TestLanguage.g:389:6: lv_terms_5_0= ruleSimpleTerm
                                    {
                                        if (state.backtracking == 0) {
                                            newCompositeNode(grammarAccess.getExpressionAccess().getTermsSimpleTermParserRuleCall_2_1_0());
                                        }
                                        pushFollow(FollowSets000.FOLLOW_8);
                                        lv_terms_5_0 = ruleSimpleTerm();
                                        state._fsp--;
                                        if (state.failed)
                                            return current;
                                        if (state.backtracking == 0) {
                                            if (current == null) {
                                                current = createModelElementForParent(grammarAccess.getExpressionRule());
                                            }
                                            add(current, "terms", lv_terms_5_0, "org.eclipse.xtext.parser.unorderedGroups.BacktrackingBug325745TestLanguage.SimpleTerm");
                                            afterParserOrEnumRuleCall();
                                        }
                                    }
                                }
                                // InternalSimpleBacktrackingBug325745TestLanguage.g:406:4: (otherlv_6= ']' )?
                                int alt6 = 2;
                                int LA6_0 = input.LA(1);
                                if ((LA6_0 == 14)) {
                                    int LA6_1 = input.LA(2);
                                    if ((synpred7_InternalSimpleBacktrackingBug325745TestLanguage())) {
                                        alt6 = 1;
                                    }
                                }
                                switch(alt6) {
                                    case 1:
                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:407:5: otherlv_6= ']'
                                        {
                                            otherlv_6 = (Token) match(input, 14, FollowSets000.FOLLOW_8);
                                            if (state.failed)
                                                return current;
                                            if (state.backtracking == 0) {
                                                newLeafNode(otherlv_6, grammarAccess.getExpressionAccess().getRightSquareBracketKeyword_2_2());
                                            }
                                        }
                                        break;
                                }
                            }
                            break;
                        default:
                            break loop7;
                    }
                } while (true);
                // InternalSimpleBacktrackingBug325745TestLanguage.g:413:3: ( ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) ) )
                // InternalSimpleBacktrackingBug325745TestLanguage.g:414:4: ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) )
                {
                    // InternalSimpleBacktrackingBug325745TestLanguage.g:414:4: ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) )
                    // InternalSimpleBacktrackingBug325745TestLanguage.g:415:5: ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* )
                    {
                        getUnorderedGroupHelper().enter(grammarAccess.getExpressionAccess().getUnorderedGroup_3());
                        // InternalSimpleBacktrackingBug325745TestLanguage.g:418:5: ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* )
                        // InternalSimpleBacktrackingBug325745TestLanguage.g:419:6: ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )*
                        {
                            // InternalSimpleBacktrackingBug325745TestLanguage.g:419:6: ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )*
                            loop8: do {
                                int alt8 = 3;
                                int LA8_0 = input.LA(1);
                                if (LA8_0 == 14 && getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 0)) {
                                    alt8 = 1;
                                } else if (LA8_0 == RULE_STRING && getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 1)) {
                                    alt8 = 2;
                                }
                                switch(alt8) {
                                    case 1:
                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:420:4: ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) )
                                        {
                                            // InternalSimpleBacktrackingBug325745TestLanguage.g:420:4: ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) )
                                            // InternalSimpleBacktrackingBug325745TestLanguage.g:421:5: {...}? => ( ({...}? => (otherlv_8= ']' ) ) )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 0)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleExpression", "getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 0)");
                                                }
                                                // InternalSimpleBacktrackingBug325745TestLanguage.g:421:107: ( ({...}? => (otherlv_8= ']' ) ) )
                                                // InternalSimpleBacktrackingBug325745TestLanguage.g:422:6: ({...}? => (otherlv_8= ']' ) )
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 0);
                                                    // InternalSimpleBacktrackingBug325745TestLanguage.g:425:9: ({...}? => (otherlv_8= ']' ) )
                                                    // InternalSimpleBacktrackingBug325745TestLanguage.g:425:10: {...}? => (otherlv_8= ']' )
                                                    {
                                                        if (!((true))) {
                                                            if (state.backtracking > 0) {
                                                                state.failed = true;
                                                                return current;
                                                            }
                                                            throw new FailedPredicateException(input, "ruleExpression", "true");
                                                        }
                                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:425:19: (otherlv_8= ']' )
                                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:425:20: otherlv_8= ']'
                                                        {
                                                            otherlv_8 = (Token) match(input, 14, FollowSets000.FOLLOW_10);
                                                            if (state.failed)
                                                                return current;
                                                            if (state.backtracking == 0) {
                                                                newLeafNode(otherlv_8, grammarAccess.getExpressionAccess().getRightSquareBracketKeyword_3_0());
                                                            }
                                                        }
                                                    }
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getExpressionAccess().getUnorderedGroup_3());
                                                }
                                            }
                                        }
                                        break;
                                    case 2:
                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:435:4: ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) )
                                        {
                                            // InternalSimpleBacktrackingBug325745TestLanguage.g:435:4: ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) )
                                            // InternalSimpleBacktrackingBug325745TestLanguage.g:436:5: {...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 1)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleExpression", "getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 1)");
                                                }
                                                // InternalSimpleBacktrackingBug325745TestLanguage.g:436:107: ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) )
                                                // InternalSimpleBacktrackingBug325745TestLanguage.g:437:6: ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) )
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 1);
                                                    // InternalSimpleBacktrackingBug325745TestLanguage.g:440:9: ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) )
                                                    // InternalSimpleBacktrackingBug325745TestLanguage.g:440:10: {...}? => ( (lv_postfix_9_0= RULE_STRING ) )
                                                    {
                                                        if (!((true))) {
                                                            if (state.backtracking > 0) {
                                                                state.failed = true;
                                                                return current;
                                                            }
                                                            throw new FailedPredicateException(input, "ruleExpression", "true");
                                                        }
                                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:440:19: ( (lv_postfix_9_0= RULE_STRING ) )
                                                        // InternalSimpleBacktrackingBug325745TestLanguage.g:440:20: (lv_postfix_9_0= RULE_STRING )
                                                        {
                                                            // InternalSimpleBacktrackingBug325745TestLanguage.g:440:20: (lv_postfix_9_0= RULE_STRING )
                                                            // InternalSimpleBacktrackingBug325745TestLanguage.g:441:10: lv_postfix_9_0= RULE_STRING
                                                            {
                                                                lv_postfix_9_0 = (Token) match(input, RULE_STRING, FollowSets000.FOLLOW_10);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(lv_postfix_9_0, grammarAccess.getExpressionAccess().getPostfixSTRINGTerminalRuleCall_3_1_0());
                                                                }
                                                                if (state.backtracking == 0) {
                                                                    if (current == null) {
                                                                        current = createModelElement(grammarAccess.getExpressionRule());
                                                                    }
                                                                    setWithLastConsumed(current, "postfix", lv_postfix_9_0, "org.eclipse.xtext.common.Terminals.STRING");
                                                                }
                                                            }
                                                        }
                                                    }
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getExpressionAccess().getUnorderedGroup_3());
                                                }
                                            }
                                        }
                                        break;
                                    default:
                                        break loop8;
                                }
                            } while (true);
                        }
                    }
                    getUnorderedGroupHelper().leave(grammarAccess.getExpressionAccess().getUnorderedGroup_3());
                }
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        myUnorderedGroupState.restore();
    }
    return current;
}
Also used : UnorderedGroupState(org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState) EObject(org.eclipse.emf.ecore.EObject) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Example 20 with UnorderedGroupState

use of org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState in project xtext-core by eclipse.

the class InternalExBacktrackingBug325745TestLanguageParser method ruleExpression.

// $ANTLR end "entryRuleExpression"
// $ANTLR start "ruleExpression"
// InternalExBacktrackingBug325745TestLanguage.g:302:1: ruleExpression returns [EObject current=null] : ( () ( ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) ) ) ( (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )? )* ( ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) ) ) ) ;
public final EObject ruleExpression() throws RecognitionException {
    EObject current = null;
    Token otherlv_2 = null;
    Token lv_prefix_3_0 = null;
    Token otherlv_4 = null;
    Token otherlv_6 = null;
    Token otherlv_8 = null;
    Token lv_postfix_9_0 = null;
    EObject lv_terms_5_0 = null;
    enterRule();
    UnorderedGroupState myUnorderedGroupState = getUnorderedGroupHelper().snapShot(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), grammarAccess.getExpressionAccess().getUnorderedGroup_3());
    try {
        // InternalExBacktrackingBug325745TestLanguage.g:312:2: ( ( () ( ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) ) ) ( (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )? )* ( ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) ) ) ) )
        // InternalExBacktrackingBug325745TestLanguage.g:313:2: ( () ( ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) ) ) ( (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )? )* ( ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) ) ) )
        {
            // InternalExBacktrackingBug325745TestLanguage.g:313:2: ( () ( ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) ) ) ( (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )? )* ( ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) ) ) )
            // InternalExBacktrackingBug325745TestLanguage.g:314:3: () ( ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) ) ) ( (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )? )* ( ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) ) )
            {
                // InternalExBacktrackingBug325745TestLanguage.g:314:3: ()
                // InternalExBacktrackingBug325745TestLanguage.g:315:4:
                {
                    if (state.backtracking == 0) {
                    /* */
                    }
                    if (state.backtracking == 0) {
                        current = forceCreateModelElement(grammarAccess.getExpressionAccess().getExpressionAction_0(), current);
                    }
                }
                // InternalExBacktrackingBug325745TestLanguage.g:324:3: ( ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) ) )
                // InternalExBacktrackingBug325745TestLanguage.g:325:4: ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) )
                {
                    // InternalExBacktrackingBug325745TestLanguage.g:325:4: ( ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* ) )
                    // InternalExBacktrackingBug325745TestLanguage.g:326:5: ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* )
                    {
                        getUnorderedGroupHelper().enter(grammarAccess.getExpressionAccess().getUnorderedGroup_1());
                        // InternalExBacktrackingBug325745TestLanguage.g:329:5: ( ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )* )
                        // InternalExBacktrackingBug325745TestLanguage.g:330:6: ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )*
                        {
                            // InternalExBacktrackingBug325745TestLanguage.g:330:6: ( ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) ) )*
                            loop4: do {
                                int alt4 = 3;
                                int LA4_0 = input.LA(1);
                                if ((LA4_0 == 13)) {
                                    int LA4_1 = input.LA(2);
                                    if (synpred4_InternalExBacktrackingBug325745TestLanguage() && getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 0)) {
                                        alt4 = 1;
                                    }
                                } else if ((LA4_0 == RULE_STRING)) {
                                    int LA4_3 = input.LA(2);
                                    if (synpred5_InternalExBacktrackingBug325745TestLanguage() && getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 1)) {
                                        alt4 = 2;
                                    }
                                }
                                switch(alt4) {
                                    case 1:
                                        // InternalExBacktrackingBug325745TestLanguage.g:331:4: ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) )
                                        {
                                            // InternalExBacktrackingBug325745TestLanguage.g:331:4: ({...}? => ( ({...}? => (otherlv_2= '[' ) ) ) )
                                            // InternalExBacktrackingBug325745TestLanguage.g:332:5: {...}? => ( ({...}? => (otherlv_2= '[' ) ) )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 0)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleExpression", "getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 0)");
                                                }
                                                // InternalExBacktrackingBug325745TestLanguage.g:332:107: ( ({...}? => (otherlv_2= '[' ) ) )
                                                // InternalExBacktrackingBug325745TestLanguage.g:333:6: ({...}? => (otherlv_2= '[' ) )
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 0);
                                                    // InternalExBacktrackingBug325745TestLanguage.g:336:9: ({...}? => (otherlv_2= '[' ) )
                                                    // InternalExBacktrackingBug325745TestLanguage.g:336:10: {...}? => (otherlv_2= '[' )
                                                    {
                                                        if (!((true))) {
                                                            if (state.backtracking > 0) {
                                                                state.failed = true;
                                                                return current;
                                                            }
                                                            throw new FailedPredicateException(input, "ruleExpression", "true");
                                                        }
                                                        // InternalExBacktrackingBug325745TestLanguage.g:336:19: (otherlv_2= '[' )
                                                        // InternalExBacktrackingBug325745TestLanguage.g:336:20: otherlv_2= '['
                                                        {
                                                            otherlv_2 = (Token) match(input, 13, FollowSets000.FOLLOW_8);
                                                            if (state.failed)
                                                                return current;
                                                            if (state.backtracking == 0) {
                                                                newLeafNode(otherlv_2, grammarAccess.getExpressionAccess().getLeftSquareBracketKeyword_1_0());
                                                            }
                                                        }
                                                    }
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getExpressionAccess().getUnorderedGroup_1());
                                                }
                                            }
                                        }
                                        break;
                                    case 2:
                                        // InternalExBacktrackingBug325745TestLanguage.g:346:4: ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) )
                                        {
                                            // InternalExBacktrackingBug325745TestLanguage.g:346:4: ({...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) ) )
                                            // InternalExBacktrackingBug325745TestLanguage.g:347:5: {...}? => ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 1)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleExpression", "getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 1)");
                                                }
                                                // InternalExBacktrackingBug325745TestLanguage.g:347:107: ( ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) ) )
                                                // InternalExBacktrackingBug325745TestLanguage.g:348:6: ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) )
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getExpressionAccess().getUnorderedGroup_1(), 1);
                                                    // InternalExBacktrackingBug325745TestLanguage.g:351:9: ({...}? => ( (lv_prefix_3_0= RULE_STRING ) ) )
                                                    // InternalExBacktrackingBug325745TestLanguage.g:351:10: {...}? => ( (lv_prefix_3_0= RULE_STRING ) )
                                                    {
                                                        if (!((true))) {
                                                            if (state.backtracking > 0) {
                                                                state.failed = true;
                                                                return current;
                                                            }
                                                            throw new FailedPredicateException(input, "ruleExpression", "true");
                                                        }
                                                        // InternalExBacktrackingBug325745TestLanguage.g:351:19: ( (lv_prefix_3_0= RULE_STRING ) )
                                                        // InternalExBacktrackingBug325745TestLanguage.g:351:20: (lv_prefix_3_0= RULE_STRING )
                                                        {
                                                            // InternalExBacktrackingBug325745TestLanguage.g:351:20: (lv_prefix_3_0= RULE_STRING )
                                                            // InternalExBacktrackingBug325745TestLanguage.g:352:10: lv_prefix_3_0= RULE_STRING
                                                            {
                                                                lv_prefix_3_0 = (Token) match(input, RULE_STRING, FollowSets000.FOLLOW_8);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(lv_prefix_3_0, grammarAccess.getExpressionAccess().getPrefixSTRINGTerminalRuleCall_1_1_0());
                                                                }
                                                                if (state.backtracking == 0) {
                                                                    if (current == null) {
                                                                        current = createModelElement(grammarAccess.getExpressionRule());
                                                                    }
                                                                    setWithLastConsumed(current, "prefix", lv_prefix_3_0, "org.eclipse.xtext.common.Terminals.STRING");
                                                                }
                                                            }
                                                        }
                                                    }
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getExpressionAccess().getUnorderedGroup_1());
                                                }
                                            }
                                        }
                                        break;
                                    default:
                                        break loop4;
                                }
                            } while (true);
                        }
                    }
                    getUnorderedGroupHelper().leave(grammarAccess.getExpressionAccess().getUnorderedGroup_1());
                }
                // InternalExBacktrackingBug325745TestLanguage.g:380:3: ( (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )? )*
                loop7: do {
                    int alt7 = 2;
                    int LA7_0 = input.LA(1);
                    if ((LA7_0 == RULE_ID || LA7_0 == RULE_INT || LA7_0 == 13)) {
                        alt7 = 1;
                    }
                    switch(alt7) {
                        case 1:
                            // InternalExBacktrackingBug325745TestLanguage.g:381:4: (otherlv_4= '[' )? ( (lv_terms_5_0= ruleSimpleTerm ) ) (otherlv_6= ']' )?
                            {
                                // InternalExBacktrackingBug325745TestLanguage.g:381:4: (otherlv_4= '[' )?
                                int alt5 = 2;
                                int LA5_0 = input.LA(1);
                                if ((LA5_0 == 13)) {
                                    alt5 = 1;
                                }
                                switch(alt5) {
                                    case 1:
                                        // InternalExBacktrackingBug325745TestLanguage.g:382:5: otherlv_4= '['
                                        {
                                            otherlv_4 = (Token) match(input, 13, FollowSets000.FOLLOW_9);
                                            if (state.failed)
                                                return current;
                                            if (state.backtracking == 0) {
                                                newLeafNode(otherlv_4, grammarAccess.getExpressionAccess().getLeftSquareBracketKeyword_2_0());
                                            }
                                        }
                                        break;
                                }
                                // InternalExBacktrackingBug325745TestLanguage.g:387:4: ( (lv_terms_5_0= ruleSimpleTerm ) )
                                // InternalExBacktrackingBug325745TestLanguage.g:388:5: (lv_terms_5_0= ruleSimpleTerm )
                                {
                                    // InternalExBacktrackingBug325745TestLanguage.g:388:5: (lv_terms_5_0= ruleSimpleTerm )
                                    // InternalExBacktrackingBug325745TestLanguage.g:389:6: lv_terms_5_0= ruleSimpleTerm
                                    {
                                        if (state.backtracking == 0) {
                                            newCompositeNode(grammarAccess.getExpressionAccess().getTermsSimpleTermParserRuleCall_2_1_0());
                                        }
                                        pushFollow(FollowSets000.FOLLOW_8);
                                        lv_terms_5_0 = ruleSimpleTerm();
                                        state._fsp--;
                                        if (state.failed)
                                            return current;
                                        if (state.backtracking == 0) {
                                            if (current == null) {
                                                current = createModelElementForParent(grammarAccess.getExpressionRule());
                                            }
                                            add(current, "terms", lv_terms_5_0, "org.eclipse.xtext.parser.unorderedGroups.BacktrackingBug325745TestLanguage.SimpleTerm");
                                            afterParserOrEnumRuleCall();
                                        }
                                    }
                                }
                                // InternalExBacktrackingBug325745TestLanguage.g:406:4: (otherlv_6= ']' )?
                                int alt6 = 2;
                                int LA6_0 = input.LA(1);
                                if ((LA6_0 == 14)) {
                                    int LA6_1 = input.LA(2);
                                    if ((synpred7_InternalExBacktrackingBug325745TestLanguage())) {
                                        alt6 = 1;
                                    }
                                }
                                switch(alt6) {
                                    case 1:
                                        // InternalExBacktrackingBug325745TestLanguage.g:407:5: otherlv_6= ']'
                                        {
                                            otherlv_6 = (Token) match(input, 14, FollowSets000.FOLLOW_8);
                                            if (state.failed)
                                                return current;
                                            if (state.backtracking == 0) {
                                                newLeafNode(otherlv_6, grammarAccess.getExpressionAccess().getRightSquareBracketKeyword_2_2());
                                            }
                                        }
                                        break;
                                }
                            }
                            break;
                        default:
                            break loop7;
                    }
                } while (true);
                // InternalExBacktrackingBug325745TestLanguage.g:413:3: ( ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) ) )
                // InternalExBacktrackingBug325745TestLanguage.g:414:4: ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) )
                {
                    // InternalExBacktrackingBug325745TestLanguage.g:414:4: ( ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* ) )
                    // InternalExBacktrackingBug325745TestLanguage.g:415:5: ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* )
                    {
                        getUnorderedGroupHelper().enter(grammarAccess.getExpressionAccess().getUnorderedGroup_3());
                        // InternalExBacktrackingBug325745TestLanguage.g:418:5: ( ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )* )
                        // InternalExBacktrackingBug325745TestLanguage.g:419:6: ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )*
                        {
                            // InternalExBacktrackingBug325745TestLanguage.g:419:6: ( ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) ) | ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) ) )*
                            loop8: do {
                                int alt8 = 3;
                                int LA8_0 = input.LA(1);
                                if (LA8_0 == 14 && getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 0)) {
                                    alt8 = 1;
                                } else if (LA8_0 == RULE_STRING && getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 1)) {
                                    alt8 = 2;
                                }
                                switch(alt8) {
                                    case 1:
                                        // InternalExBacktrackingBug325745TestLanguage.g:420:4: ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) )
                                        {
                                            // InternalExBacktrackingBug325745TestLanguage.g:420:4: ({...}? => ( ({...}? => (otherlv_8= ']' ) ) ) )
                                            // InternalExBacktrackingBug325745TestLanguage.g:421:5: {...}? => ( ({...}? => (otherlv_8= ']' ) ) )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 0)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleExpression", "getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 0)");
                                                }
                                                // InternalExBacktrackingBug325745TestLanguage.g:421:107: ( ({...}? => (otherlv_8= ']' ) ) )
                                                // InternalExBacktrackingBug325745TestLanguage.g:422:6: ({...}? => (otherlv_8= ']' ) )
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 0);
                                                    // InternalExBacktrackingBug325745TestLanguage.g:425:9: ({...}? => (otherlv_8= ']' ) )
                                                    // InternalExBacktrackingBug325745TestLanguage.g:425:10: {...}? => (otherlv_8= ']' )
                                                    {
                                                        if (!((true))) {
                                                            if (state.backtracking > 0) {
                                                                state.failed = true;
                                                                return current;
                                                            }
                                                            throw new FailedPredicateException(input, "ruleExpression", "true");
                                                        }
                                                        // InternalExBacktrackingBug325745TestLanguage.g:425:19: (otherlv_8= ']' )
                                                        // InternalExBacktrackingBug325745TestLanguage.g:425:20: otherlv_8= ']'
                                                        {
                                                            otherlv_8 = (Token) match(input, 14, FollowSets000.FOLLOW_10);
                                                            if (state.failed)
                                                                return current;
                                                            if (state.backtracking == 0) {
                                                                newLeafNode(otherlv_8, grammarAccess.getExpressionAccess().getRightSquareBracketKeyword_3_0());
                                                            }
                                                        }
                                                    }
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getExpressionAccess().getUnorderedGroup_3());
                                                }
                                            }
                                        }
                                        break;
                                    case 2:
                                        // InternalExBacktrackingBug325745TestLanguage.g:435:4: ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) )
                                        {
                                            // InternalExBacktrackingBug325745TestLanguage.g:435:4: ({...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) ) )
                                            // InternalExBacktrackingBug325745TestLanguage.g:436:5: {...}? => ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 1)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleExpression", "getUnorderedGroupHelper().canSelect(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 1)");
                                                }
                                                // InternalExBacktrackingBug325745TestLanguage.g:436:107: ( ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) ) )
                                                // InternalExBacktrackingBug325745TestLanguage.g:437:6: ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) )
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getExpressionAccess().getUnorderedGroup_3(), 1);
                                                    // InternalExBacktrackingBug325745TestLanguage.g:440:9: ({...}? => ( (lv_postfix_9_0= RULE_STRING ) ) )
                                                    // InternalExBacktrackingBug325745TestLanguage.g:440:10: {...}? => ( (lv_postfix_9_0= RULE_STRING ) )
                                                    {
                                                        if (!((true))) {
                                                            if (state.backtracking > 0) {
                                                                state.failed = true;
                                                                return current;
                                                            }
                                                            throw new FailedPredicateException(input, "ruleExpression", "true");
                                                        }
                                                        // InternalExBacktrackingBug325745TestLanguage.g:440:19: ( (lv_postfix_9_0= RULE_STRING ) )
                                                        // InternalExBacktrackingBug325745TestLanguage.g:440:20: (lv_postfix_9_0= RULE_STRING )
                                                        {
                                                            // InternalExBacktrackingBug325745TestLanguage.g:440:20: (lv_postfix_9_0= RULE_STRING )
                                                            // InternalExBacktrackingBug325745TestLanguage.g:441:10: lv_postfix_9_0= RULE_STRING
                                                            {
                                                                lv_postfix_9_0 = (Token) match(input, RULE_STRING, FollowSets000.FOLLOW_10);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(lv_postfix_9_0, grammarAccess.getExpressionAccess().getPostfixSTRINGTerminalRuleCall_3_1_0());
                                                                }
                                                                if (state.backtracking == 0) {
                                                                    if (current == null) {
                                                                        current = createModelElement(grammarAccess.getExpressionRule());
                                                                    }
                                                                    setWithLastConsumed(current, "postfix", lv_postfix_9_0, "org.eclipse.xtext.common.Terminals.STRING");
                                                                }
                                                            }
                                                        }
                                                    }
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getExpressionAccess().getUnorderedGroup_3());
                                                }
                                            }
                                        }
                                        break;
                                    default:
                                        break loop8;
                                }
                            } while (true);
                        }
                    }
                    getUnorderedGroupHelper().leave(grammarAccess.getExpressionAccess().getUnorderedGroup_3());
                }
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        myUnorderedGroupState.restore();
    }
    return current;
}
Also used : UnorderedGroupState(org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState) EObject(org.eclipse.emf.ecore.EObject) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)30 UnorderedGroupState (org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState)30 AntlrDatatypeRuleToken (org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)15