Search in sources :

Example 6 with UnorderedGroupState

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

the class InternalSimpleBeeLangTestLanguageParser method ruleAliasedRequiredCapability.

// $ANTLR end "entryRuleAliasedRequiredCapability"
// $ANTLR start "ruleAliasedRequiredCapability"
// InternalSimpleBeeLangTestLanguage.g:808: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, 10)) {
            return current;
        }
        // InternalSimpleBeeLangTestLanguage.g:817: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= '}' ) ) )
        // InternalSimpleBeeLangTestLanguage.g:818: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= '}' ) )
        {
            // InternalSimpleBeeLangTestLanguage.g:818: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= '}' ) )
            // InternalSimpleBeeLangTestLanguage.g:819: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= '}' )
            {
                // InternalSimpleBeeLangTestLanguage.g:819: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:
                        // InternalSimpleBeeLangTestLanguage.g:820:4: ( (lv_nameSpace_0_0= RULE_ID ) )
                        {
                            // InternalSimpleBeeLangTestLanguage.g:820:4: ( (lv_nameSpace_0_0= RULE_ID ) )
                            // InternalSimpleBeeLangTestLanguage.g:821:5: (lv_nameSpace_0_0= RULE_ID )
                            {
                                // InternalSimpleBeeLangTestLanguage.g:821:5: (lv_nameSpace_0_0= RULE_ID )
                                // InternalSimpleBeeLangTestLanguage.g:822:6: lv_nameSpace_0_0= RULE_ID
                                {
                                    lv_nameSpace_0_0 = (Token) match(input, RULE_ID, FollowSets000.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:
                        // InternalSimpleBeeLangTestLanguage.g:839:4: otherlv_1= 'unit'
                        {
                            otherlv_1 = (Token) match(input, 13, FollowSets000.FOLLOW_8);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                newLeafNode(otherlv_1, grammarAccess.getAliasedRequiredCapabilityAccess().getUnitKeyword_0_1());
                            }
                        }
                        break;
                }
                // InternalSimpleBeeLangTestLanguage.g:844:3: ( (lv_name_2_0= RULE_ID ) )
                // InternalSimpleBeeLangTestLanguage.g:845:4: (lv_name_2_0= RULE_ID )
                {
                    // InternalSimpleBeeLangTestLanguage.g:845:4: (lv_name_2_0= RULE_ID )
                    // InternalSimpleBeeLangTestLanguage.g:846:5: lv_name_2_0= RULE_ID
                    {
                        lv_name_2_0 = (Token) match(input, RULE_ID, FollowSets000.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");
                        }
                    }
                }
                // InternalSimpleBeeLangTestLanguage.g:862: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:
                        // InternalSimpleBeeLangTestLanguage.g:863:4: otherlv_3= 'as' ( (lv_alias_4_0= RULE_ID ) )
                        {
                            otherlv_3 = (Token) match(input, 28, FollowSets000.FOLLOW_8);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                newLeafNode(otherlv_3, grammarAccess.getAliasedRequiredCapabilityAccess().getAsKeyword_2_0());
                            }
                            // InternalSimpleBeeLangTestLanguage.g:867:4: ( (lv_alias_4_0= RULE_ID ) )
                            // InternalSimpleBeeLangTestLanguage.g:868:5: (lv_alias_4_0= RULE_ID )
                            {
                                // InternalSimpleBeeLangTestLanguage.g:868:5: (lv_alias_4_0= RULE_ID )
                                // InternalSimpleBeeLangTestLanguage.g:869:6: lv_alias_4_0= RULE_ID
                                {
                                    lv_alias_4_0 = (Token) match(input, RULE_ID, FollowSets000.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;
                }
                // InternalSimpleBeeLangTestLanguage.g:886: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= '}' )
                // InternalSimpleBeeLangTestLanguage.g:887: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, FollowSets000.FOLLOW_23);
                    if (state.failed)
                        return current;
                    if (state.backtracking == 0) {
                        newLeafNode(otherlv_5, grammarAccess.getAliasedRequiredCapabilityAccess().getLeftCurlyBracketKeyword_3_0());
                    }
                    // InternalSimpleBeeLangTestLanguage.g:891: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= ';' ) ) ) ) )* ) ) )
                    // InternalSimpleBeeLangTestLanguage.g:892: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= ';' ) ) ) ) )* ) )
                    {
                        // InternalSimpleBeeLangTestLanguage.g:892: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= ';' ) ) ) ) )* ) )
                        // InternalSimpleBeeLangTestLanguage.g:893: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());
                            // InternalSimpleBeeLangTestLanguage.g:896: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= ';' ) ) ) ) )* )
                            // InternalSimpleBeeLangTestLanguage.g:897: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= ';' ) ) ) ) )*
                            {
                                // InternalSimpleBeeLangTestLanguage.g:897: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:
                                            // InternalSimpleBeeLangTestLanguage.g:898:5: ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) )
                                            {
                                                // InternalSimpleBeeLangTestLanguage.g:898:5: ({...}? => ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) ) )
                                                // InternalSimpleBeeLangTestLanguage.g:899: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)");
                                                    }
                                                    // InternalSimpleBeeLangTestLanguage.g:899:125: ( ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) ) )
                                                    // InternalSimpleBeeLangTestLanguage.g:900:7: ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) )
                                                    {
                                                        getUnorderedGroupHelper().select(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 0);
                                                        // InternalSimpleBeeLangTestLanguage.g:903:10: ({...}? => (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' ) )
                                                        // InternalSimpleBeeLangTestLanguage.g:903: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");
                                                            }
                                                            // InternalSimpleBeeLangTestLanguage.g:903:20: (otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';' )
                                                            // InternalSimpleBeeLangTestLanguage.g:903:21: otherlv_7= 'when' otherlv_8= ':' ( (lv_condExpr_9_0= ruleExpression ) ) otherlv_10= ';'
                                                            {
                                                                otherlv_7 = (Token) match(input, 26, FollowSets000.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, FollowSets000.FOLLOW_19);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_8, grammarAccess.getAliasedRequiredCapabilityAccess().getColonKeyword_3_1_0_1());
                                                                }
                                                                // InternalSimpleBeeLangTestLanguage.g:911:10: ( (lv_condExpr_9_0= ruleExpression ) )
                                                                // InternalSimpleBeeLangTestLanguage.g:912:11: (lv_condExpr_9_0= ruleExpression )
                                                                {
                                                                    // InternalSimpleBeeLangTestLanguage.g:912:11: (lv_condExpr_9_0= ruleExpression )
                                                                    // InternalSimpleBeeLangTestLanguage.g:913:12: lv_condExpr_9_0= ruleExpression
                                                                    {
                                                                        if (state.backtracking == 0) {
                                                                            newCompositeNode(grammarAccess.getAliasedRequiredCapabilityAccess().getCondExprExpressionParserRuleCall_3_1_0_2_0());
                                                                        }
                                                                        pushFollow(FollowSets000.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, FollowSets000.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:
                                            // InternalSimpleBeeLangTestLanguage.g:940:5: ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) )
                                            {
                                                // InternalSimpleBeeLangTestLanguage.g:940:5: ({...}? => ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) ) )
                                                // InternalSimpleBeeLangTestLanguage.g:941: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)");
                                                    }
                                                    // InternalSimpleBeeLangTestLanguage.g:941:125: ( ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) ) )
                                                    // InternalSimpleBeeLangTestLanguage.g:942:7: ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) )
                                                    {
                                                        getUnorderedGroupHelper().select(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 1);
                                                        // InternalSimpleBeeLangTestLanguage.g:945:10: ({...}? => ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' ) )
                                                        // InternalSimpleBeeLangTestLanguage.g:945: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");
                                                            }
                                                            // InternalSimpleBeeLangTestLanguage.g:945:20: ( ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';' )
                                                            // InternalSimpleBeeLangTestLanguage.g:945:21: ( (lv_greedy_11_0= 'greedy' ) ) otherlv_12= ';'
                                                            {
                                                                // InternalSimpleBeeLangTestLanguage.g:945:21: ( (lv_greedy_11_0= 'greedy' ) )
                                                                // InternalSimpleBeeLangTestLanguage.g:946:11: (lv_greedy_11_0= 'greedy' )
                                                                {
                                                                    // InternalSimpleBeeLangTestLanguage.g:946:11: (lv_greedy_11_0= 'greedy' )
                                                                    // InternalSimpleBeeLangTestLanguage.g:947:12: lv_greedy_11_0= 'greedy'
                                                                    {
                                                                        lv_greedy_11_0 = (Token) match(input, 29, FollowSets000.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, FollowSets000.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:
                                            // InternalSimpleBeeLangTestLanguage.g:969:5: ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) )
                                            {
                                                // InternalSimpleBeeLangTestLanguage.g:969:5: ({...}? => ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) ) )
                                                // InternalSimpleBeeLangTestLanguage.g:970: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)");
                                                    }
                                                    // InternalSimpleBeeLangTestLanguage.g:970:125: ( ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) ) )
                                                    // InternalSimpleBeeLangTestLanguage.g:971:7: ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) )
                                                    {
                                                        getUnorderedGroupHelper().select(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 2);
                                                        // InternalSimpleBeeLangTestLanguage.g:974:10: ({...}? => (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' ) )
                                                        // InternalSimpleBeeLangTestLanguage.g:974: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");
                                                            }
                                                            // InternalSimpleBeeLangTestLanguage.g:974:20: (otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';' )
                                                            // InternalSimpleBeeLangTestLanguage.g:974:21: otherlv_13= 'requires-min' otherlv_14= ':' ( (lv_min_15_0= RULE_INT ) ) otherlv_16= ';'
                                                            {
                                                                otherlv_13 = (Token) match(input, 30, FollowSets000.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, FollowSets000.FOLLOW_24);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_14, grammarAccess.getAliasedRequiredCapabilityAccess().getColonKeyword_3_1_2_1());
                                                                }
                                                                // InternalSimpleBeeLangTestLanguage.g:982:10: ( (lv_min_15_0= RULE_INT ) )
                                                                // InternalSimpleBeeLangTestLanguage.g:983:11: (lv_min_15_0= RULE_INT )
                                                                {
                                                                    // InternalSimpleBeeLangTestLanguage.g:983:11: (lv_min_15_0= RULE_INT )
                                                                    // InternalSimpleBeeLangTestLanguage.g:984:12: lv_min_15_0= RULE_INT
                                                                    {
                                                                        lv_min_15_0 = (Token) match(input, RULE_INT, FollowSets000.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, FollowSets000.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:
                                            // InternalSimpleBeeLangTestLanguage.g:1010:5: ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) )
                                            {
                                                // InternalSimpleBeeLangTestLanguage.g:1010:5: ({...}? => ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) ) )
                                                // InternalSimpleBeeLangTestLanguage.g:1011: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)");
                                                    }
                                                    // InternalSimpleBeeLangTestLanguage.g:1011:125: ( ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) ) )
                                                    // InternalSimpleBeeLangTestLanguage.g:1012:7: ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) )
                                                    {
                                                        getUnorderedGroupHelper().select(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 3);
                                                        // InternalSimpleBeeLangTestLanguage.g:1015:10: ({...}? => (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' ) )
                                                        // InternalSimpleBeeLangTestLanguage.g:1015: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");
                                                            }
                                                            // InternalSimpleBeeLangTestLanguage.g:1015:20: (otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';' )
                                                            // InternalSimpleBeeLangTestLanguage.g:1015:21: otherlv_17= 'requires-max' otherlv_18= ':' ( (lv_max_19_0= RULE_INT ) ) otherlv_20= ';'
                                                            {
                                                                otherlv_17 = (Token) match(input, 31, FollowSets000.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, FollowSets000.FOLLOW_24);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_18, grammarAccess.getAliasedRequiredCapabilityAccess().getColonKeyword_3_1_3_1());
                                                                }
                                                                // InternalSimpleBeeLangTestLanguage.g:1023:10: ( (lv_max_19_0= RULE_INT ) )
                                                                // InternalSimpleBeeLangTestLanguage.g:1024:11: (lv_max_19_0= RULE_INT )
                                                                {
                                                                    // InternalSimpleBeeLangTestLanguage.g:1024:11: (lv_max_19_0= RULE_INT )
                                                                    // InternalSimpleBeeLangTestLanguage.g:1025:12: lv_max_19_0= RULE_INT
                                                                    {
                                                                        lv_max_19_0 = (Token) match(input, RULE_INT, FollowSets000.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, FollowSets000.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:
                                            // InternalSimpleBeeLangTestLanguage.g:1051:5: ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) )
                                            {
                                                // InternalSimpleBeeLangTestLanguage.g:1051:5: ({...}? => ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) ) )
                                                // InternalSimpleBeeLangTestLanguage.g:1052: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)");
                                                    }
                                                    // InternalSimpleBeeLangTestLanguage.g:1052:125: ( ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) ) )
                                                    // InternalSimpleBeeLangTestLanguage.g:1053:7: ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) )
                                                    {
                                                        getUnorderedGroupHelper().select(grammarAccess.getAliasedRequiredCapabilityAccess().getUnorderedGroup_3_1(), 4);
                                                        // InternalSimpleBeeLangTestLanguage.g:1056:10: ({...}? => (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' ) )
                                                        // InternalSimpleBeeLangTestLanguage.g:1056: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");
                                                            }
                                                            // InternalSimpleBeeLangTestLanguage.g:1056:20: (otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';' )
                                                            // InternalSimpleBeeLangTestLanguage.g:1056:21: otherlv_21= 'version' otherlv_22= ':' ( (lv_versionRange_23_0= RULE_ID ) ) otherlv_24= ';'
                                                            {
                                                                otherlv_21 = (Token) match(input, 14, FollowSets000.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, FollowSets000.FOLLOW_8);
                                                                if (state.failed)
                                                                    return current;
                                                                if (state.backtracking == 0) {
                                                                    newLeafNode(otherlv_22, grammarAccess.getAliasedRequiredCapabilityAccess().getColonKeyword_3_1_4_1());
                                                                }
                                                                // InternalSimpleBeeLangTestLanguage.g:1064:10: ( (lv_versionRange_23_0= RULE_ID ) )
                                                                // InternalSimpleBeeLangTestLanguage.g:1065:11: (lv_versionRange_23_0= RULE_ID )
                                                                {
                                                                    // InternalSimpleBeeLangTestLanguage.g:1065:11: (lv_versionRange_23_0= RULE_ID )
                                                                    // InternalSimpleBeeLangTestLanguage.g:1066:12: lv_versionRange_23_0= RULE_ID
                                                                    {
                                                                        lv_versionRange_23_0 = (Token) match(input, RULE_ID, FollowSets000.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, FollowSets000.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, FollowSets000.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, 10, 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 7 with UnorderedGroupState

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

the class InternalExBeeLangTestLanguageParser method ruleUnit.

// $ANTLR end "entryRuleUnit"
// $ANTLR start "ruleUnit"
// InternalExBeeLangTestLanguageParser.g:165:1: ruleUnit returns [EObject current=null] : ( () ( (lv_documentation_1_0= RULE_DOCUMENTATION ) )? otherlv_2= Unit ( (lv_name_3_0= RULE_ID ) )? (otherlv_4= Version ( (lv_version_5_0= RULE_ID ) ) )? (otherlv_6= Implements ( (lv_implements_7_0= ruleSimpleTypeRef ) ) (otherlv_8= Comma ( (lv_implements_9_0= ruleSimpleTypeRef ) ) )* )? otherlv_10= LeftCurlyBracket ( ( ( ( ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) ) )* ) ) ) otherlv_34= RightCurlyBracket ) ;
public final EObject ruleUnit() throws RecognitionException {
    EObject current = null;
    int ruleUnit_StartIndex = input.index();
    Token lv_documentation_1_0 = null;
    Token otherlv_2 = null;
    Token lv_name_3_0 = null;
    Token otherlv_4 = null;
    Token lv_version_5_0 = null;
    Token otherlv_6 = null;
    Token otherlv_8 = null;
    Token otherlv_10 = null;
    Token otherlv_12 = null;
    Token otherlv_13 = null;
    Token otherlv_15 = null;
    Token otherlv_16 = null;
    Token otherlv_17 = null;
    Token otherlv_19 = null;
    Token otherlv_20 = null;
    Token otherlv_21 = null;
    Token otherlv_23 = null;
    Token otherlv_24 = null;
    Token otherlv_25 = null;
    Token otherlv_27 = null;
    Token otherlv_28 = null;
    Token otherlv_29 = null;
    Token otherlv_30 = null;
    Token otherlv_32 = null;
    Token otherlv_34 = null;
    EObject lv_implements_7_0 = null;
    EObject lv_implements_9_0 = null;
    AntlrDatatypeRuleToken lv_sourceLocation_14_0 = null;
    AntlrDatatypeRuleToken lv_outputLocation_18_0 = null;
    EObject lv_providedCapabilities_22_0 = null;
    EObject lv_requiredCapabilities_26_0 = null;
    EObject lv_metaRequiredCapabilities_31_0 = null;
    EObject lv_functions_33_0 = null;
    enterRule();
    UnorderedGroupState myUnorderedGroupState = getUnorderedGroupHelper().snapShot(grammarAccess.getUnitAccess().getUnorderedGroup_7());
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 6)) {
            return current;
        }
        // InternalExBeeLangTestLanguageParser.g:174:2: ( ( () ( (lv_documentation_1_0= RULE_DOCUMENTATION ) )? otherlv_2= Unit ( (lv_name_3_0= RULE_ID ) )? (otherlv_4= Version ( (lv_version_5_0= RULE_ID ) ) )? (otherlv_6= Implements ( (lv_implements_7_0= ruleSimpleTypeRef ) ) (otherlv_8= Comma ( (lv_implements_9_0= ruleSimpleTypeRef ) ) )* )? otherlv_10= LeftCurlyBracket ( ( ( ( ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) ) )* ) ) ) otherlv_34= RightCurlyBracket ) )
        // InternalExBeeLangTestLanguageParser.g:175:2: ( () ( (lv_documentation_1_0= RULE_DOCUMENTATION ) )? otherlv_2= Unit ( (lv_name_3_0= RULE_ID ) )? (otherlv_4= Version ( (lv_version_5_0= RULE_ID ) ) )? (otherlv_6= Implements ( (lv_implements_7_0= ruleSimpleTypeRef ) ) (otherlv_8= Comma ( (lv_implements_9_0= ruleSimpleTypeRef ) ) )* )? otherlv_10= LeftCurlyBracket ( ( ( ( ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) ) )* ) ) ) otherlv_34= RightCurlyBracket )
        {
            // InternalExBeeLangTestLanguageParser.g:175:2: ( () ( (lv_documentation_1_0= RULE_DOCUMENTATION ) )? otherlv_2= Unit ( (lv_name_3_0= RULE_ID ) )? (otherlv_4= Version ( (lv_version_5_0= RULE_ID ) ) )? (otherlv_6= Implements ( (lv_implements_7_0= ruleSimpleTypeRef ) ) (otherlv_8= Comma ( (lv_implements_9_0= ruleSimpleTypeRef ) ) )* )? otherlv_10= LeftCurlyBracket ( ( ( ( ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) ) )* ) ) ) otherlv_34= RightCurlyBracket )
            // InternalExBeeLangTestLanguageParser.g:176:3: () ( (lv_documentation_1_0= RULE_DOCUMENTATION ) )? otherlv_2= Unit ( (lv_name_3_0= RULE_ID ) )? (otherlv_4= Version ( (lv_version_5_0= RULE_ID ) ) )? (otherlv_6= Implements ( (lv_implements_7_0= ruleSimpleTypeRef ) ) (otherlv_8= Comma ( (lv_implements_9_0= ruleSimpleTypeRef ) ) )* )? otherlv_10= LeftCurlyBracket ( ( ( ( ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) ) )* ) ) ) otherlv_34= RightCurlyBracket
            {
                // InternalExBeeLangTestLanguageParser.g:176:3: ()
                // InternalExBeeLangTestLanguageParser.g:177:4:
                {
                    if (state.backtracking == 0) {
                    /* */
                    }
                    if (state.backtracking == 0) {
                        current = forceCreateModelElement(grammarAccess.getUnitAccess().getUnitAction_0(), current);
                    }
                }
                // InternalExBeeLangTestLanguageParser.g:186:3: ( (lv_documentation_1_0= RULE_DOCUMENTATION ) )?
                int alt4 = 2;
                int LA4_0 = input.LA(1);
                if ((LA4_0 == RULE_DOCUMENTATION)) {
                    alt4 = 1;
                }
                switch(alt4) {
                    case 1:
                        // InternalExBeeLangTestLanguageParser.g:187:4: (lv_documentation_1_0= RULE_DOCUMENTATION )
                        {
                            // InternalExBeeLangTestLanguageParser.g:187:4: (lv_documentation_1_0= RULE_DOCUMENTATION )
                            // InternalExBeeLangTestLanguageParser.g:188:5: lv_documentation_1_0= RULE_DOCUMENTATION
                            {
                                lv_documentation_1_0 = (Token) match(input, RULE_DOCUMENTATION, FollowSets000.FOLLOW_5);
                                if (state.failed)
                                    return current;
                                if (state.backtracking == 0) {
                                    newLeafNode(lv_documentation_1_0, grammarAccess.getUnitAccess().getDocumentationDOCUMENTATIONTerminalRuleCall_1_0());
                                }
                                if (state.backtracking == 0) {
                                    if (current == null) {
                                        current = createModelElement(grammarAccess.getUnitRule());
                                    }
                                    setWithLastConsumed(current, "documentation", lv_documentation_1_0, "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.DOCUMENTATION");
                                }
                            }
                        }
                        break;
                }
                otherlv_2 = (Token) match(input, Unit, FollowSets000.FOLLOW_6);
                if (state.failed)
                    return current;
                if (state.backtracking == 0) {
                    newLeafNode(otherlv_2, grammarAccess.getUnitAccess().getUnitKeyword_2());
                }
                // InternalExBeeLangTestLanguageParser.g:208:3: ( (lv_name_3_0= RULE_ID ) )?
                int alt5 = 2;
                int LA5_0 = input.LA(1);
                if ((LA5_0 == RULE_ID)) {
                    alt5 = 1;
                }
                switch(alt5) {
                    case 1:
                        // InternalExBeeLangTestLanguageParser.g:209:4: (lv_name_3_0= RULE_ID )
                        {
                            // InternalExBeeLangTestLanguageParser.g:209:4: (lv_name_3_0= RULE_ID )
                            // InternalExBeeLangTestLanguageParser.g:210:5: lv_name_3_0= RULE_ID
                            {
                                lv_name_3_0 = (Token) match(input, RULE_ID, FollowSets000.FOLLOW_7);
                                if (state.failed)
                                    return current;
                                if (state.backtracking == 0) {
                                    newLeafNode(lv_name_3_0, grammarAccess.getUnitAccess().getNameIDTerminalRuleCall_3_0());
                                }
                                if (state.backtracking == 0) {
                                    if (current == null) {
                                        current = createModelElement(grammarAccess.getUnitRule());
                                    }
                                    setWithLastConsumed(current, "name", lv_name_3_0, "org.eclipse.xtext.common.Terminals.ID");
                                }
                            }
                        }
                        break;
                }
                // InternalExBeeLangTestLanguageParser.g:226:3: (otherlv_4= Version ( (lv_version_5_0= RULE_ID ) ) )?
                int alt6 = 2;
                int LA6_0 = input.LA(1);
                if ((LA6_0 == Version)) {
                    alt6 = 1;
                }
                switch(alt6) {
                    case 1:
                        // InternalExBeeLangTestLanguageParser.g:227:4: otherlv_4= Version ( (lv_version_5_0= RULE_ID ) )
                        {
                            otherlv_4 = (Token) match(input, Version, FollowSets000.FOLLOW_8);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                newLeafNode(otherlv_4, grammarAccess.getUnitAccess().getVersionKeyword_4_0());
                            }
                            // InternalExBeeLangTestLanguageParser.g:231:4: ( (lv_version_5_0= RULE_ID ) )
                            // InternalExBeeLangTestLanguageParser.g:232:5: (lv_version_5_0= RULE_ID )
                            {
                                // InternalExBeeLangTestLanguageParser.g:232:5: (lv_version_5_0= RULE_ID )
                                // InternalExBeeLangTestLanguageParser.g:233:6: lv_version_5_0= RULE_ID
                                {
                                    lv_version_5_0 = (Token) match(input, RULE_ID, FollowSets000.FOLLOW_9);
                                    if (state.failed)
                                        return current;
                                    if (state.backtracking == 0) {
                                        newLeafNode(lv_version_5_0, grammarAccess.getUnitAccess().getVersionIDTerminalRuleCall_4_1_0());
                                    }
                                    if (state.backtracking == 0) {
                                        if (current == null) {
                                            current = createModelElement(grammarAccess.getUnitRule());
                                        }
                                        setWithLastConsumed(current, "version", lv_version_5_0, "org.eclipse.xtext.common.Terminals.ID");
                                    }
                                }
                            }
                        }
                        break;
                }
                // InternalExBeeLangTestLanguageParser.g:250:3: (otherlv_6= Implements ( (lv_implements_7_0= ruleSimpleTypeRef ) ) (otherlv_8= Comma ( (lv_implements_9_0= ruleSimpleTypeRef ) ) )* )?
                int alt8 = 2;
                int LA8_0 = input.LA(1);
                if ((LA8_0 == Implements)) {
                    alt8 = 1;
                }
                switch(alt8) {
                    case 1:
                        // InternalExBeeLangTestLanguageParser.g:251:4: otherlv_6= Implements ( (lv_implements_7_0= ruleSimpleTypeRef ) ) (otherlv_8= Comma ( (lv_implements_9_0= ruleSimpleTypeRef ) ) )*
                        {
                            otherlv_6 = (Token) match(input, Implements, FollowSets000.FOLLOW_8);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                newLeafNode(otherlv_6, grammarAccess.getUnitAccess().getImplementsKeyword_5_0());
                            }
                            // InternalExBeeLangTestLanguageParser.g:255:4: ( (lv_implements_7_0= ruleSimpleTypeRef ) )
                            // InternalExBeeLangTestLanguageParser.g:256:5: (lv_implements_7_0= ruleSimpleTypeRef )
                            {
                                // InternalExBeeLangTestLanguageParser.g:256:5: (lv_implements_7_0= ruleSimpleTypeRef )
                                // InternalExBeeLangTestLanguageParser.g:257:6: lv_implements_7_0= ruleSimpleTypeRef
                                {
                                    if (state.backtracking == 0) {
                                        newCompositeNode(grammarAccess.getUnitAccess().getImplementsSimpleTypeRefParserRuleCall_5_1_0());
                                    }
                                    pushFollow(FollowSets000.FOLLOW_10);
                                    lv_implements_7_0 = ruleSimpleTypeRef();
                                    state._fsp--;
                                    if (state.failed)
                                        return current;
                                    if (state.backtracking == 0) {
                                        if (current == null) {
                                            current = createModelElementForParent(grammarAccess.getUnitRule());
                                        }
                                        add(current, "implements", lv_implements_7_0, "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.SimpleTypeRef");
                                        afterParserOrEnumRuleCall();
                                    }
                                }
                            }
                            // InternalExBeeLangTestLanguageParser.g:274:4: (otherlv_8= Comma ( (lv_implements_9_0= ruleSimpleTypeRef ) ) )*
                            loop7: do {
                                int alt7 = 2;
                                int LA7_0 = input.LA(1);
                                if ((LA7_0 == Comma)) {
                                    alt7 = 1;
                                }
                                switch(alt7) {
                                    case 1:
                                        // InternalExBeeLangTestLanguageParser.g:275:5: otherlv_8= Comma ( (lv_implements_9_0= ruleSimpleTypeRef ) )
                                        {
                                            otherlv_8 = (Token) match(input, Comma, FollowSets000.FOLLOW_8);
                                            if (state.failed)
                                                return current;
                                            if (state.backtracking == 0) {
                                                newLeafNode(otherlv_8, grammarAccess.getUnitAccess().getCommaKeyword_5_2_0());
                                            }
                                            // InternalExBeeLangTestLanguageParser.g:279:5: ( (lv_implements_9_0= ruleSimpleTypeRef ) )
                                            // InternalExBeeLangTestLanguageParser.g:280:6: (lv_implements_9_0= ruleSimpleTypeRef )
                                            {
                                                // InternalExBeeLangTestLanguageParser.g:280:6: (lv_implements_9_0= ruleSimpleTypeRef )
                                                // InternalExBeeLangTestLanguageParser.g:281:7: lv_implements_9_0= ruleSimpleTypeRef
                                                {
                                                    if (state.backtracking == 0) {
                                                        newCompositeNode(grammarAccess.getUnitAccess().getImplementsSimpleTypeRefParserRuleCall_5_2_1_0());
                                                    }
                                                    pushFollow(FollowSets000.FOLLOW_10);
                                                    lv_implements_9_0 = ruleSimpleTypeRef();
                                                    state._fsp--;
                                                    if (state.failed)
                                                        return current;
                                                    if (state.backtracking == 0) {
                                                        if (current == null) {
                                                            current = createModelElementForParent(grammarAccess.getUnitRule());
                                                        }
                                                        add(current, "implements", lv_implements_9_0, "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.SimpleTypeRef");
                                                        afterParserOrEnumRuleCall();
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    default:
                                        break loop7;
                                }
                            } while (true);
                        }
                        break;
                }
                otherlv_10 = (Token) match(input, LeftCurlyBracket, FollowSets000.FOLLOW_11);
                if (state.failed)
                    return current;
                if (state.backtracking == 0) {
                    newLeafNode(otherlv_10, grammarAccess.getUnitAccess().getLeftCurlyBracketKeyword_6());
                }
                // InternalExBeeLangTestLanguageParser.g:304:3: ( ( ( ( ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) ) )* ) ) )
                // InternalExBeeLangTestLanguageParser.g:305:4: ( ( ( ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) ) )* ) )
                {
                    // InternalExBeeLangTestLanguageParser.g:305:4: ( ( ( ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) ) )* ) )
                    // InternalExBeeLangTestLanguageParser.g:306:5: ( ( ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) ) )* )
                    {
                        getUnorderedGroupHelper().enter(grammarAccess.getUnitAccess().getUnorderedGroup_7());
                        // InternalExBeeLangTestLanguageParser.g:309:5: ( ( ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) ) )* )
                        // InternalExBeeLangTestLanguageParser.g:310:6: ( ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) ) )*
                        {
                            // InternalExBeeLangTestLanguageParser.g:310:6: ( ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) ) | ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) ) )*
                            loop13: do {
                                int alt13 = 7;
                                alt13 = dfa13.predict(input);
                                switch(alt13) {
                                    case 1:
                                        // InternalExBeeLangTestLanguageParser.g:311:4: ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) )
                                        {
                                            // InternalExBeeLangTestLanguageParser.g:311:4: ({...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) ) )
                                            // InternalExBeeLangTestLanguageParser.g:312:5: {...}? => ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 0)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleUnit", "getUnorderedGroupHelper().canSelect(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 0)");
                                                }
                                                // InternalExBeeLangTestLanguageParser.g:312:101: ( ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) ) )
                                                // InternalExBeeLangTestLanguageParser.g:313:6: ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) )
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 0);
                                                    // InternalExBeeLangTestLanguageParser.g:316:9: ({...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon ) )
                                                    // InternalExBeeLangTestLanguageParser.g:316:10: {...}? => (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon )
                                                    {
                                                        if (!((true))) {
                                                            if (state.backtracking > 0) {
                                                                state.failed = true;
                                                                return current;
                                                            }
                                                            throw new FailedPredicateException(input, "ruleUnit", "true");
                                                        }
                                                        // InternalExBeeLangTestLanguageParser.g:316:19: (otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon )
                                                        // InternalExBeeLangTestLanguageParser.g:316:20: otherlv_12= Source otherlv_13= Colon ( (lv_sourceLocation_14_0= rulePath ) ) otherlv_15= Semicolon
                                                        {
                                                            otherlv_12 = (Token) match(input, Source, FollowSets000.FOLLOW_12);
                                                            if (state.failed)
                                                                return current;
                                                            if (state.backtracking == 0) {
                                                                newLeafNode(otherlv_12, grammarAccess.getUnitAccess().getSourceKeyword_7_0_0());
                                                            }
                                                            otherlv_13 = (Token) match(input, Colon, FollowSets000.FOLLOW_13);
                                                            if (state.failed)
                                                                return current;
                                                            if (state.backtracking == 0) {
                                                                newLeafNode(otherlv_13, grammarAccess.getUnitAccess().getColonKeyword_7_0_1());
                                                            }
                                                            // InternalExBeeLangTestLanguageParser.g:324:9: ( (lv_sourceLocation_14_0= rulePath ) )
                                                            // InternalExBeeLangTestLanguageParser.g:325:10: (lv_sourceLocation_14_0= rulePath )
                                                            {
                                                                // InternalExBeeLangTestLanguageParser.g:325:10: (lv_sourceLocation_14_0= rulePath )
                                                                // InternalExBeeLangTestLanguageParser.g:326:11: lv_sourceLocation_14_0= rulePath
                                                                {
                                                                    if (state.backtracking == 0) {
                                                                        newCompositeNode(grammarAccess.getUnitAccess().getSourceLocationPathParserRuleCall_7_0_2_0());
                                                                    }
                                                                    pushFollow(FollowSets000.FOLLOW_14);
                                                                    lv_sourceLocation_14_0 = rulePath();
                                                                    state._fsp--;
                                                                    if (state.failed)
                                                                        return current;
                                                                    if (state.backtracking == 0) {
                                                                        if (current == null) {
                                                                            current = createModelElementForParent(grammarAccess.getUnitRule());
                                                                        }
                                                                        set(current, "sourceLocation", lv_sourceLocation_14_0, "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.Path");
                                                                        afterParserOrEnumRuleCall();
                                                                    }
                                                                }
                                                            }
                                                            otherlv_15 = (Token) match(input, Semicolon, FollowSets000.FOLLOW_11);
                                                            if (state.failed)
                                                                return current;
                                                            if (state.backtracking == 0) {
                                                                newLeafNode(otherlv_15, grammarAccess.getUnitAccess().getSemicolonKeyword_7_0_3());
                                                            }
                                                        }
                                                    }
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getUnitAccess().getUnorderedGroup_7());
                                                }
                                            }
                                        }
                                        break;
                                    case 2:
                                        // InternalExBeeLangTestLanguageParser.g:353:4: ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) )
                                        {
                                            // InternalExBeeLangTestLanguageParser.g:353:4: ({...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) ) )
                                            // InternalExBeeLangTestLanguageParser.g:354:5: {...}? => ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 1)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleUnit", "getUnorderedGroupHelper().canSelect(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 1)");
                                                }
                                                // InternalExBeeLangTestLanguageParser.g:354:101: ( ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) ) )
                                                // InternalExBeeLangTestLanguageParser.g:355:6: ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) )
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 1);
                                                    // InternalExBeeLangTestLanguageParser.g:358:9: ({...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon ) )
                                                    // InternalExBeeLangTestLanguageParser.g:358:10: {...}? => (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon )
                                                    {
                                                        if (!((true))) {
                                                            if (state.backtracking > 0) {
                                                                state.failed = true;
                                                                return current;
                                                            }
                                                            throw new FailedPredicateException(input, "ruleUnit", "true");
                                                        }
                                                        // InternalExBeeLangTestLanguageParser.g:358:19: (otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon )
                                                        // InternalExBeeLangTestLanguageParser.g:358:20: otherlv_16= Output otherlv_17= Colon ( (lv_outputLocation_18_0= rulePath ) ) otherlv_19= Semicolon
                                                        {
                                                            otherlv_16 = (Token) match(input, Output, FollowSets000.FOLLOW_12);
                                                            if (state.failed)
                                                                return current;
                                                            if (state.backtracking == 0) {
                                                                newLeafNode(otherlv_16, grammarAccess.getUnitAccess().getOutputKeyword_7_1_0());
                                                            }
                                                            otherlv_17 = (Token) match(input, Colon, FollowSets000.FOLLOW_13);
                                                            if (state.failed)
                                                                return current;
                                                            if (state.backtracking == 0) {
                                                                newLeafNode(otherlv_17, grammarAccess.getUnitAccess().getColonKeyword_7_1_1());
                                                            }
                                                            // InternalExBeeLangTestLanguageParser.g:366:9: ( (lv_outputLocation_18_0= rulePath ) )
                                                            // InternalExBeeLangTestLanguageParser.g:367:10: (lv_outputLocation_18_0= rulePath )
                                                            {
                                                                // InternalExBeeLangTestLanguageParser.g:367:10: (lv_outputLocation_18_0= rulePath )
                                                                // InternalExBeeLangTestLanguageParser.g:368:11: lv_outputLocation_18_0= rulePath
                                                                {
                                                                    if (state.backtracking == 0) {
                                                                        newCompositeNode(grammarAccess.getUnitAccess().getOutputLocationPathParserRuleCall_7_1_2_0());
                                                                    }
                                                                    pushFollow(FollowSets000.FOLLOW_14);
                                                                    lv_outputLocation_18_0 = rulePath();
                                                                    state._fsp--;
                                                                    if (state.failed)
                                                                        return current;
                                                                    if (state.backtracking == 0) {
                                                                        if (current == null) {
                                                                            current = createModelElementForParent(grammarAccess.getUnitRule());
                                                                        }
                                                                        set(current, "outputLocation", lv_outputLocation_18_0, "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.Path");
                                                                        afterParserOrEnumRuleCall();
                                                                    }
                                                                }
                                                            }
                                                            otherlv_19 = (Token) match(input, Semicolon, FollowSets000.FOLLOW_11);
                                                            if (state.failed)
                                                                return current;
                                                            if (state.backtracking == 0) {
                                                                newLeafNode(otherlv_19, grammarAccess.getUnitAccess().getSemicolonKeyword_7_1_3());
                                                            }
                                                        }
                                                    }
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getUnitAccess().getUnorderedGroup_7());
                                                }
                                            }
                                        }
                                        break;
                                    case 3:
                                        // InternalExBeeLangTestLanguageParser.g:395:4: ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) )
                                        {
                                            // InternalExBeeLangTestLanguageParser.g:395:4: ({...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ ) )
                                            // InternalExBeeLangTestLanguageParser.g:396:5: {...}? => ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 2)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleUnit", "getUnorderedGroupHelper().canSelect(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 2)");
                                                }
                                                // InternalExBeeLangTestLanguageParser.g:396:101: ( ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+ )
                                                // InternalExBeeLangTestLanguageParser.g:397:6: ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 2);
                                                    // InternalExBeeLangTestLanguageParser.g:400:9: ({...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon ) )+
                                                    int cnt9 = 0;
                                                    loop9: do {
                                                        int alt9 = 2;
                                                        int LA9_0 = input.LA(1);
                                                        if ((LA9_0 == Provides)) {
                                                            int LA9_2 = input.LA(2);
                                                            if (((synpred11_InternalExBeeLangTestLanguageParser() && (true)))) {
                                                                alt9 = 1;
                                                            }
                                                        }
                                                        switch(alt9) {
                                                            case 1:
                                                                // InternalExBeeLangTestLanguageParser.g:400:10: {...}? => (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon )
                                                                {
                                                                    if (!((true))) {
                                                                        if (state.backtracking > 0) {
                                                                            state.failed = true;
                                                                            return current;
                                                                        }
                                                                        throw new FailedPredicateException(input, "ruleUnit", "true");
                                                                    }
                                                                    // InternalExBeeLangTestLanguageParser.g:400:19: (otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon )
                                                                    // InternalExBeeLangTestLanguageParser.g:400:20: otherlv_20= Provides otherlv_21= Colon ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) ) otherlv_23= Semicolon
                                                                    {
                                                                        otherlv_20 = (Token) match(input, Provides, FollowSets000.FOLLOW_12);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_20, grammarAccess.getUnitAccess().getProvidesKeyword_7_2_0());
                                                                        }
                                                                        otherlv_21 = (Token) match(input, Colon, FollowSets000.FOLLOW_15);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_21, grammarAccess.getUnitAccess().getColonKeyword_7_2_1());
                                                                        }
                                                                        // InternalExBeeLangTestLanguageParser.g:408:9: ( (lv_providedCapabilities_22_0= ruleProvidedCapability ) )
                                                                        // InternalExBeeLangTestLanguageParser.g:409:10: (lv_providedCapabilities_22_0= ruleProvidedCapability )
                                                                        {
                                                                            // InternalExBeeLangTestLanguageParser.g:409:10: (lv_providedCapabilities_22_0= ruleProvidedCapability )
                                                                            // InternalExBeeLangTestLanguageParser.g:410:11: lv_providedCapabilities_22_0= ruleProvidedCapability
                                                                            {
                                                                                if (state.backtracking == 0) {
                                                                                    newCompositeNode(grammarAccess.getUnitAccess().getProvidedCapabilitiesProvidedCapabilityParserRuleCall_7_2_2_0());
                                                                                }
                                                                                pushFollow(FollowSets000.FOLLOW_14);
                                                                                lv_providedCapabilities_22_0 = ruleProvidedCapability();
                                                                                state._fsp--;
                                                                                if (state.failed)
                                                                                    return current;
                                                                                if (state.backtracking == 0) {
                                                                                    if (current == null) {
                                                                                        current = createModelElementForParent(grammarAccess.getUnitRule());
                                                                                    }
                                                                                    add(current, "providedCapabilities", lv_providedCapabilities_22_0, "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.ProvidedCapability");
                                                                                    afterParserOrEnumRuleCall();
                                                                                }
                                                                            }
                                                                        }
                                                                        otherlv_23 = (Token) match(input, Semicolon, FollowSets000.FOLLOW_11);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_23, grammarAccess.getUnitAccess().getSemicolonKeyword_7_2_3());
                                                                        }
                                                                    }
                                                                }
                                                                break;
                                                            default:
                                                                if (cnt9 >= 1)
                                                                    break loop9;
                                                                if (state.backtracking > 0) {
                                                                    state.failed = true;
                                                                    return current;
                                                                }
                                                                EarlyExitException eee = new EarlyExitException(9, input);
                                                                throw eee;
                                                        }
                                                        cnt9++;
                                                    } while (true);
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getUnitAccess().getUnorderedGroup_7());
                                                }
                                            }
                                        }
                                        break;
                                    case 4:
                                        // InternalExBeeLangTestLanguageParser.g:437:4: ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) )
                                        {
                                            // InternalExBeeLangTestLanguageParser.g:437:4: ({...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ ) )
                                            // InternalExBeeLangTestLanguageParser.g:438:5: {...}? => ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 3)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleUnit", "getUnorderedGroupHelper().canSelect(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 3)");
                                                }
                                                // InternalExBeeLangTestLanguageParser.g:438:101: ( ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+ )
                                                // InternalExBeeLangTestLanguageParser.g:439:6: ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 3);
                                                    // InternalExBeeLangTestLanguageParser.g:442:9: ({...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon ) )+
                                                    int cnt10 = 0;
                                                    loop10: do {
                                                        int alt10 = 2;
                                                        int LA10_0 = input.LA(1);
                                                        if ((LA10_0 == Requires)) {
                                                            int LA10_2 = input.LA(2);
                                                            if (((synpred13_InternalExBeeLangTestLanguageParser() && (true)))) {
                                                                alt10 = 1;
                                                            }
                                                        }
                                                        switch(alt10) {
                                                            case 1:
                                                                // InternalExBeeLangTestLanguageParser.g:442:10: {...}? => (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon )
                                                                {
                                                                    if (!((true))) {
                                                                        if (state.backtracking > 0) {
                                                                            state.failed = true;
                                                                            return current;
                                                                        }
                                                                        throw new FailedPredicateException(input, "ruleUnit", "true");
                                                                    }
                                                                    // InternalExBeeLangTestLanguageParser.g:442:19: (otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon )
                                                                    // InternalExBeeLangTestLanguageParser.g:442:20: otherlv_24= Requires otherlv_25= Colon ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) ) otherlv_27= Semicolon
                                                                    {
                                                                        otherlv_24 = (Token) match(input, Requires, FollowSets000.FOLLOW_12);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_24, grammarAccess.getUnitAccess().getRequiresKeyword_7_3_0());
                                                                        }
                                                                        otherlv_25 = (Token) match(input, Colon, FollowSets000.FOLLOW_15);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_25, grammarAccess.getUnitAccess().getColonKeyword_7_3_1());
                                                                        }
                                                                        // InternalExBeeLangTestLanguageParser.g:450:9: ( (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability ) )
                                                                        // InternalExBeeLangTestLanguageParser.g:451:10: (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability )
                                                                        {
                                                                            // InternalExBeeLangTestLanguageParser.g:451:10: (lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability )
                                                                            // InternalExBeeLangTestLanguageParser.g:452:11: lv_requiredCapabilities_26_0= ruleAliasedRequiredCapability
                                                                            {
                                                                                if (state.backtracking == 0) {
                                                                                    newCompositeNode(grammarAccess.getUnitAccess().getRequiredCapabilitiesAliasedRequiredCapabilityParserRuleCall_7_3_2_0());
                                                                                }
                                                                                pushFollow(FollowSets000.FOLLOW_14);
                                                                                lv_requiredCapabilities_26_0 = ruleAliasedRequiredCapability();
                                                                                state._fsp--;
                                                                                if (state.failed)
                                                                                    return current;
                                                                                if (state.backtracking == 0) {
                                                                                    if (current == null) {
                                                                                        current = createModelElementForParent(grammarAccess.getUnitRule());
                                                                                    }
                                                                                    add(current, "requiredCapabilities", lv_requiredCapabilities_26_0, "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.AliasedRequiredCapability");
                                                                                    afterParserOrEnumRuleCall();
                                                                                }
                                                                            }
                                                                        }
                                                                        otherlv_27 = (Token) match(input, Semicolon, FollowSets000.FOLLOW_11);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_27, grammarAccess.getUnitAccess().getSemicolonKeyword_7_3_3());
                                                                        }
                                                                    }
                                                                }
                                                                break;
                                                            default:
                                                                if (cnt10 >= 1)
                                                                    break loop10;
                                                                if (state.backtracking > 0) {
                                                                    state.failed = true;
                                                                    return current;
                                                                }
                                                                EarlyExitException eee = new EarlyExitException(10, input);
                                                                throw eee;
                                                        }
                                                        cnt10++;
                                                    } while (true);
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getUnitAccess().getUnorderedGroup_7());
                                                }
                                            }
                                        }
                                        break;
                                    case 5:
                                        // InternalExBeeLangTestLanguageParser.g:479:4: ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) )
                                        {
                                            // InternalExBeeLangTestLanguageParser.g:479:4: ({...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ ) )
                                            // InternalExBeeLangTestLanguageParser.g:480:5: {...}? => ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 4)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleUnit", "getUnorderedGroupHelper().canSelect(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 4)");
                                                }
                                                // InternalExBeeLangTestLanguageParser.g:480:101: ( ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+ )
                                                // InternalExBeeLangTestLanguageParser.g:481:6: ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 4);
                                                    // InternalExBeeLangTestLanguageParser.g:484:9: ({...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon ) )+
                                                    int cnt11 = 0;
                                                    loop11: do {
                                                        int alt11 = 2;
                                                        int LA11_0 = input.LA(1);
                                                        if ((LA11_0 == Requires)) {
                                                            int LA11_2 = input.LA(2);
                                                            if (((synpred15_InternalExBeeLangTestLanguageParser() && (true)))) {
                                                                alt11 = 1;
                                                            }
                                                        }
                                                        switch(alt11) {
                                                            case 1:
                                                                // InternalExBeeLangTestLanguageParser.g:484:10: {...}? => (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon )
                                                                {
                                                                    if (!((true))) {
                                                                        if (state.backtracking > 0) {
                                                                            state.failed = true;
                                                                            return current;
                                                                        }
                                                                        throw new FailedPredicateException(input, "ruleUnit", "true");
                                                                    }
                                                                    // InternalExBeeLangTestLanguageParser.g:484:19: (otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon )
                                                                    // InternalExBeeLangTestLanguageParser.g:484:20: otherlv_28= Requires otherlv_29= Env otherlv_30= Colon ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) ) otherlv_32= Semicolon
                                                                    {
                                                                        otherlv_28 = (Token) match(input, Requires, FollowSets000.FOLLOW_16);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_28, grammarAccess.getUnitAccess().getRequiresKeyword_7_4_0());
                                                                        }
                                                                        otherlv_29 = (Token) match(input, Env, FollowSets000.FOLLOW_12);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_29, grammarAccess.getUnitAccess().getEnvKeyword_7_4_1());
                                                                        }
                                                                        otherlv_30 = (Token) match(input, Colon, FollowSets000.FOLLOW_15);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_30, grammarAccess.getUnitAccess().getColonKeyword_7_4_2());
                                                                        }
                                                                        // InternalExBeeLangTestLanguageParser.g:496:9: ( (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability ) )
                                                                        // InternalExBeeLangTestLanguageParser.g:497:10: (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability )
                                                                        {
                                                                            // InternalExBeeLangTestLanguageParser.g:497:10: (lv_metaRequiredCapabilities_31_0= ruleRequiredCapability )
                                                                            // InternalExBeeLangTestLanguageParser.g:498:11: lv_metaRequiredCapabilities_31_0= ruleRequiredCapability
                                                                            {
                                                                                if (state.backtracking == 0) {
                                                                                    newCompositeNode(grammarAccess.getUnitAccess().getMetaRequiredCapabilitiesRequiredCapabilityParserRuleCall_7_4_3_0());
                                                                                }
                                                                                pushFollow(FollowSets000.FOLLOW_14);
                                                                                lv_metaRequiredCapabilities_31_0 = ruleRequiredCapability();
                                                                                state._fsp--;
                                                                                if (state.failed)
                                                                                    return current;
                                                                                if (state.backtracking == 0) {
                                                                                    if (current == null) {
                                                                                        current = createModelElementForParent(grammarAccess.getUnitRule());
                                                                                    }
                                                                                    add(current, "metaRequiredCapabilities", lv_metaRequiredCapabilities_31_0, "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.RequiredCapability");
                                                                                    afterParserOrEnumRuleCall();
                                                                                }
                                                                            }
                                                                        }
                                                                        otherlv_32 = (Token) match(input, Semicolon, FollowSets000.FOLLOW_11);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_32, grammarAccess.getUnitAccess().getSemicolonKeyword_7_4_4());
                                                                        }
                                                                    }
                                                                }
                                                                break;
                                                            default:
                                                                if (cnt11 >= 1)
                                                                    break loop11;
                                                                if (state.backtracking > 0) {
                                                                    state.failed = true;
                                                                    return current;
                                                                }
                                                                EarlyExitException eee = new EarlyExitException(11, input);
                                                                throw eee;
                                                        }
                                                        cnt11++;
                                                    } while (true);
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getUnitAccess().getUnorderedGroup_7());
                                                }
                                            }
                                        }
                                        break;
                                    case 6:
                                        // InternalExBeeLangTestLanguageParser.g:525:4: ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) )
                                        {
                                            // InternalExBeeLangTestLanguageParser.g:525:4: ({...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ ) )
                                            // InternalExBeeLangTestLanguageParser.g:526:5: {...}? => ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ )
                                            {
                                                if (!getUnorderedGroupHelper().canSelect(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 5)) {
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    throw new FailedPredicateException(input, "ruleUnit", "getUnorderedGroupHelper().canSelect(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 5)");
                                                }
                                                // InternalExBeeLangTestLanguageParser.g:526:101: ( ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+ )
                                                // InternalExBeeLangTestLanguageParser.g:527:6: ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+
                                                {
                                                    getUnorderedGroupHelper().select(grammarAccess.getUnitAccess().getUnorderedGroup_7(), 5);
                                                    // InternalExBeeLangTestLanguageParser.g:530:9: ({...}? => ( (lv_functions_33_0= ruleFunction ) ) )+
                                                    int cnt12 = 0;
                                                    loop12: do {
                                                        int alt12 = 2;
                                                        switch(input.LA(1)) {
                                                            case RULE_DOCUMENTATION:
                                                                {
                                                                    int LA12_2 = input.LA(2);
                                                                    if (((synpred17_InternalExBeeLangTestLanguageParser() && (true)))) {
                                                                        alt12 = 1;
                                                                    }
                                                                }
                                                                break;
                                                            case RULE_ID:
                                                                {
                                                                    int LA12_3 = input.LA(2);
                                                                    if (((synpred17_InternalExBeeLangTestLanguageParser() && (true)))) {
                                                                        alt12 = 1;
                                                                    }
                                                                }
                                                                break;
                                                            case Final:
                                                                {
                                                                    int LA12_4 = input.LA(2);
                                                                    if (((synpred17_InternalExBeeLangTestLanguageParser() && (true)))) {
                                                                        alt12 = 1;
                                                                    }
                                                                }
                                                                break;
                                                            case Function:
                                                                {
                                                                    int LA12_5 = input.LA(2);
                                                                    if (((synpred17_InternalExBeeLangTestLanguageParser() && (true)))) {
                                                                        alt12 = 1;
                                                                    }
                                                                }
                                                                break;
                                                        }
                                                        switch(alt12) {
                                                            case 1:
                                                                // InternalExBeeLangTestLanguageParser.g:530:10: {...}? => ( (lv_functions_33_0= ruleFunction ) )
                                                                {
                                                                    if (!((true))) {
                                                                        if (state.backtracking > 0) {
                                                                            state.failed = true;
                                                                            return current;
                                                                        }
                                                                        throw new FailedPredicateException(input, "ruleUnit", "true");
                                                                    }
                                                                    // InternalExBeeLangTestLanguageParser.g:530:19: ( (lv_functions_33_0= ruleFunction ) )
                                                                    // InternalExBeeLangTestLanguageParser.g:530:20: (lv_functions_33_0= ruleFunction )
                                                                    {
                                                                        // InternalExBeeLangTestLanguageParser.g:530:20: (lv_functions_33_0= ruleFunction )
                                                                        // InternalExBeeLangTestLanguageParser.g:531:10: lv_functions_33_0= ruleFunction
                                                                        {
                                                                            if (state.backtracking == 0) {
                                                                                newCompositeNode(grammarAccess.getUnitAccess().getFunctionsFunctionParserRuleCall_7_5_0());
                                                                            }
                                                                            pushFollow(FollowSets000.FOLLOW_11);
                                                                            lv_functions_33_0 = ruleFunction();
                                                                            state._fsp--;
                                                                            if (state.failed)
                                                                                return current;
                                                                            if (state.backtracking == 0) {
                                                                                if (current == null) {
                                                                                    current = createModelElementForParent(grammarAccess.getUnitRule());
                                                                                }
                                                                                add(current, "functions", lv_functions_33_0, "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.Function");
                                                                                afterParserOrEnumRuleCall();
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                                break;
                                                            default:
                                                                if (cnt12 >= 1)
                                                                    break loop12;
                                                                if (state.backtracking > 0) {
                                                                    state.failed = true;
                                                                    return current;
                                                                }
                                                                EarlyExitException eee = new EarlyExitException(12, input);
                                                                throw eee;
                                                        }
                                                        cnt12++;
                                                    } while (true);
                                                    getUnorderedGroupHelper().returnFromSelection(grammarAccess.getUnitAccess().getUnorderedGroup_7());
                                                }
                                            }
                                        }
                                        break;
                                    default:
                                        break loop13;
                                }
                            } while (true);
                        }
                    }
                    getUnorderedGroupHelper().leave(grammarAccess.getUnitAccess().getUnorderedGroup_7());
                }
                otherlv_34 = (Token) match(input, RightCurlyBracket, FollowSets000.FOLLOW_2);
                if (state.failed)
                    return current;
                if (state.backtracking == 0) {
                    newLeafNode(otherlv_34, grammarAccess.getUnitAccess().getRightCurlyBracketKeyword_8());
                }
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 6, ruleUnit_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) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Example 8 with UnorderedGroupState

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

the class InternalExBeeLangTestLanguageParser method entryRuleProvidedCapability.

// $ANTLR end "ruleUnit"
// $ANTLR start "entryRuleProvidedCapability"
// InternalExBeeLangTestLanguageParser.g:571: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;
        }
        // InternalExBeeLangTestLanguageParser.g:575:2: (iv_ruleProvidedCapability= ruleProvidedCapability EOF )
        // InternalExBeeLangTestLanguageParser.g:576: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 9 with UnorderedGroupState

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

the class InternalExBeeLangTestLanguageParser method ruleProvidedCapability.

// $ANTLR end "entryRuleProvidedCapability"
// $ANTLR start "ruleProvidedCapability"
// InternalExBeeLangTestLanguageParser.g:585:1: ruleProvidedCapability returns [EObject current=null] : ( () ( ( (lv_nameSpace_1_0= RULE_ID ) ) | otherlv_2= Unit ) (otherlv_3= LeftCurlyBracket ( ( ( ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?) ) ) otherlv_17= RightCurlyBracket )? ) ;
public final EObject ruleProvidedCapability() throws RecognitionException {
    EObject current = null;
    int ruleProvidedCapability_StartIndex = input.index();
    Token lv_nameSpace_1_0 = null;
    Token otherlv_2 = null;
    Token otherlv_3 = null;
    Token otherlv_5 = null;
    Token otherlv_6 = null;
    Token otherlv_8 = null;
    Token otherlv_9 = null;
    Token otherlv_10 = null;
    Token lv_name_11_0 = null;
    Token otherlv_12 = null;
    Token otherlv_13 = null;
    Token otherlv_14 = null;
    Token lv_version_15_0 = null;
    Token otherlv_16 = null;
    Token otherlv_17 = null;
    EObject lv_condExpr_7_0 = null;
    enterRule();
    UnorderedGroupState myUnorderedGroupState = getUnorderedGroupHelper().snapShot(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1());
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 8)) {
            return current;
        }
        // InternalExBeeLangTestLanguageParser.g:594:2: ( ( () ( ( (lv_nameSpace_1_0= RULE_ID ) ) | otherlv_2= Unit ) (otherlv_3= LeftCurlyBracket ( ( ( ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?) ) ) otherlv_17= RightCurlyBracket )? ) )
        // InternalExBeeLangTestLanguageParser.g:595:2: ( () ( ( (lv_nameSpace_1_0= RULE_ID ) ) | otherlv_2= Unit ) (otherlv_3= LeftCurlyBracket ( ( ( ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?) ) ) otherlv_17= RightCurlyBracket )? )
        {
            // InternalExBeeLangTestLanguageParser.g:595:2: ( () ( ( (lv_nameSpace_1_0= RULE_ID ) ) | otherlv_2= Unit ) (otherlv_3= LeftCurlyBracket ( ( ( ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?) ) ) otherlv_17= RightCurlyBracket )? )
            // InternalExBeeLangTestLanguageParser.g:596:3: () ( ( (lv_nameSpace_1_0= RULE_ID ) ) | otherlv_2= Unit ) (otherlv_3= LeftCurlyBracket ( ( ( ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?) ) ) otherlv_17= RightCurlyBracket )?
            {
                // InternalExBeeLangTestLanguageParser.g:596:3: ()
                // InternalExBeeLangTestLanguageParser.g:597:4:
                {
                    if (state.backtracking == 0) {
                    /* */
                    }
                    if (state.backtracking == 0) {
                        current = forceCreateModelElement(grammarAccess.getProvidedCapabilityAccess().getProvidedCapabilityAction_0(), current);
                    }
                }
                // InternalExBeeLangTestLanguageParser.g:606:3: ( ( (lv_nameSpace_1_0= RULE_ID ) ) | otherlv_2= Unit )
                int alt14 = 2;
                int LA14_0 = input.LA(1);
                if ((LA14_0 == RULE_ID)) {
                    alt14 = 1;
                } else if ((LA14_0 == Unit)) {
                    alt14 = 2;
                } else {
                    if (state.backtracking > 0) {
                        state.failed = true;
                        return current;
                    }
                    NoViableAltException nvae = new NoViableAltException("", 14, 0, input);
                    throw nvae;
                }
                switch(alt14) {
                    case 1:
                        // InternalExBeeLangTestLanguageParser.g:607:4: ( (lv_nameSpace_1_0= RULE_ID ) )
                        {
                            // InternalExBeeLangTestLanguageParser.g:607:4: ( (lv_nameSpace_1_0= RULE_ID ) )
                            // InternalExBeeLangTestLanguageParser.g:608:5: (lv_nameSpace_1_0= RULE_ID )
                            {
                                // InternalExBeeLangTestLanguageParser.g:608:5: (lv_nameSpace_1_0= RULE_ID )
                                // InternalExBeeLangTestLanguageParser.g:609:6: lv_nameSpace_1_0= RULE_ID
                                {
                                    lv_nameSpace_1_0 = (Token) match(input, RULE_ID, FollowSets000.FOLLOW_17);
                                    if (state.failed)
                                        return current;
                                    if (state.backtracking == 0) {
                                        newLeafNode(lv_nameSpace_1_0, grammarAccess.getProvidedCapabilityAccess().getNameSpaceIDTerminalRuleCall_1_0_0());
                                    }
                                    if (state.backtracking == 0) {
                                        if (current == null) {
                                            current = createModelElement(grammarAccess.getProvidedCapabilityRule());
                                        }
                                        setWithLastConsumed(current, "nameSpace", lv_nameSpace_1_0, "org.eclipse.xtext.common.Terminals.ID");
                                    }
                                }
                            }
                        }
                        break;
                    case 2:
                        // InternalExBeeLangTestLanguageParser.g:626:4: otherlv_2= Unit
                        {
                            otherlv_2 = (Token) match(input, Unit, FollowSets000.FOLLOW_17);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                newLeafNode(otherlv_2, grammarAccess.getProvidedCapabilityAccess().getUnitKeyword_1_1());
                            }
                        }
                        break;
                }
                // InternalExBeeLangTestLanguageParser.g:631:3: (otherlv_3= LeftCurlyBracket ( ( ( ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?) ) ) otherlv_17= RightCurlyBracket )?
                int alt16 = 2;
                int LA16_0 = input.LA(1);
                if ((LA16_0 == LeftCurlyBracket)) {
                    alt16 = 1;
                }
                switch(alt16) {
                    case 1:
                        // InternalExBeeLangTestLanguageParser.g:632:4: otherlv_3= LeftCurlyBracket ( ( ( ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?) ) ) otherlv_17= RightCurlyBracket
                        {
                            otherlv_3 = (Token) match(input, LeftCurlyBracket, FollowSets000.FOLLOW_18);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                newLeafNode(otherlv_3, grammarAccess.getProvidedCapabilityAccess().getLeftCurlyBracketKeyword_2_0());
                            }
                            // InternalExBeeLangTestLanguageParser.g:636:4: ( ( ( ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?) ) )
                            // InternalExBeeLangTestLanguageParser.g:637:5: ( ( ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?) )
                            {
                                // InternalExBeeLangTestLanguageParser.g:637:5: ( ( ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?) )
                                // InternalExBeeLangTestLanguageParser.g:638:6: ( ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?)
                                {
                                    getUnorderedGroupHelper().enter(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1());
                                    // InternalExBeeLangTestLanguageParser.g:641:6: ( ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?)
                                    // InternalExBeeLangTestLanguageParser.g:642:7: ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+ {...}?
                                    {
                                        // InternalExBeeLangTestLanguageParser.g:642:7: ( ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) ) | ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) ) )+
                                        int cnt15 = 0;
                                        loop15: do {
                                            int alt15 = 4;
                                            int LA15_0 = input.LA(1);
                                            if (LA15_0 == When && getUnorderedGroupHelper().canSelect(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1(), 0)) {
                                                alt15 = 1;
                                            } else if (LA15_0 == Name && getUnorderedGroupHelper().canSelect(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1(), 1)) {
                                                alt15 = 2;
                                            } else if (LA15_0 == Version && getUnorderedGroupHelper().canSelect(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1(), 2)) {
                                                alt15 = 3;
                                            }
                                            switch(alt15) {
                                                case 1:
                                                    // InternalExBeeLangTestLanguageParser.g:643:5: ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) )
                                                    {
                                                        // InternalExBeeLangTestLanguageParser.g:643:5: ({...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) ) )
                                                        // InternalExBeeLangTestLanguageParser.g:644:6: {...}? => ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) )
                                                        {
                                                            if (!getUnorderedGroupHelper().canSelect(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1(), 0)) {
                                                                if (state.backtracking > 0) {
                                                                    state.failed = true;
                                                                    return current;
                                                                }
                                                                throw new FailedPredicateException(input, "ruleProvidedCapability", "getUnorderedGroupHelper().canSelect(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1(), 0)");
                                                            }
                                                            // InternalExBeeLangTestLanguageParser.g:644:118: ( ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) ) )
                                                            // InternalExBeeLangTestLanguageParser.g:645:7: ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) )
                                                            {
                                                                getUnorderedGroupHelper().select(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1(), 0);
                                                                // InternalExBeeLangTestLanguageParser.g:648:10: ({...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon ) )
                                                                // InternalExBeeLangTestLanguageParser.g:648:11: {...}? => (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon )
                                                                {
                                                                    if (!((true))) {
                                                                        if (state.backtracking > 0) {
                                                                            state.failed = true;
                                                                            return current;
                                                                        }
                                                                        throw new FailedPredicateException(input, "ruleProvidedCapability", "true");
                                                                    }
                                                                    // InternalExBeeLangTestLanguageParser.g:648:20: (otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon )
                                                                    // InternalExBeeLangTestLanguageParser.g:648:21: otherlv_5= When otherlv_6= Colon ( (lv_condExpr_7_0= ruleExpression ) ) otherlv_8= Semicolon
                                                                    {
                                                                        otherlv_5 = (Token) match(input, When, FollowSets000.FOLLOW_12);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_5, grammarAccess.getProvidedCapabilityAccess().getWhenKeyword_2_1_0_0());
                                                                        }
                                                                        otherlv_6 = (Token) match(input, Colon, FollowSets000.FOLLOW_19);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_6, grammarAccess.getProvidedCapabilityAccess().getColonKeyword_2_1_0_1());
                                                                        }
                                                                        // InternalExBeeLangTestLanguageParser.g:656:10: ( (lv_condExpr_7_0= ruleExpression ) )
                                                                        // InternalExBeeLangTestLanguageParser.g:657:11: (lv_condExpr_7_0= ruleExpression )
                                                                        {
                                                                            // InternalExBeeLangTestLanguageParser.g:657:11: (lv_condExpr_7_0= ruleExpression )
                                                                            // InternalExBeeLangTestLanguageParser.g:658:12: lv_condExpr_7_0= ruleExpression
                                                                            {
                                                                                if (state.backtracking == 0) {
                                                                                    newCompositeNode(grammarAccess.getProvidedCapabilityAccess().getCondExprExpressionParserRuleCall_2_1_0_2_0());
                                                                                }
                                                                                pushFollow(FollowSets000.FOLLOW_14);
                                                                                lv_condExpr_7_0 = ruleExpression();
                                                                                state._fsp--;
                                                                                if (state.failed)
                                                                                    return current;
                                                                                if (state.backtracking == 0) {
                                                                                    if (current == null) {
                                                                                        current = createModelElementForParent(grammarAccess.getProvidedCapabilityRule());
                                                                                    }
                                                                                    set(current, "condExpr", lv_condExpr_7_0, "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.Expression");
                                                                                    afterParserOrEnumRuleCall();
                                                                                }
                                                                            }
                                                                        }
                                                                        otherlv_8 = (Token) match(input, Semicolon, FollowSets000.FOLLOW_20);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_8, grammarAccess.getProvidedCapabilityAccess().getSemicolonKeyword_2_1_0_3());
                                                                        }
                                                                    }
                                                                }
                                                                getUnorderedGroupHelper().returnFromSelection(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1());
                                                            }
                                                        }
                                                    }
                                                    break;
                                                case 2:
                                                    // InternalExBeeLangTestLanguageParser.g:685:5: ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) )
                                                    {
                                                        // InternalExBeeLangTestLanguageParser.g:685:5: ({...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) ) )
                                                        // InternalExBeeLangTestLanguageParser.g:686:6: {...}? => ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) )
                                                        {
                                                            if (!getUnorderedGroupHelper().canSelect(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1(), 1)) {
                                                                if (state.backtracking > 0) {
                                                                    state.failed = true;
                                                                    return current;
                                                                }
                                                                throw new FailedPredicateException(input, "ruleProvidedCapability", "getUnorderedGroupHelper().canSelect(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1(), 1)");
                                                            }
                                                            // InternalExBeeLangTestLanguageParser.g:686:118: ( ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) ) )
                                                            // InternalExBeeLangTestLanguageParser.g:687:7: ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) )
                                                            {
                                                                getUnorderedGroupHelper().select(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1(), 1);
                                                                // InternalExBeeLangTestLanguageParser.g:690:10: ({...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon ) )
                                                                // InternalExBeeLangTestLanguageParser.g:690:11: {...}? => (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon )
                                                                {
                                                                    if (!((true))) {
                                                                        if (state.backtracking > 0) {
                                                                            state.failed = true;
                                                                            return current;
                                                                        }
                                                                        throw new FailedPredicateException(input, "ruleProvidedCapability", "true");
                                                                    }
                                                                    // InternalExBeeLangTestLanguageParser.g:690:20: (otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon )
                                                                    // InternalExBeeLangTestLanguageParser.g:690:21: otherlv_9= Name otherlv_10= Colon ( (lv_name_11_0= RULE_ID ) ) otherlv_12= Semicolon
                                                                    {
                                                                        otherlv_9 = (Token) match(input, Name, FollowSets000.FOLLOW_12);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_9, grammarAccess.getProvidedCapabilityAccess().getNameKeyword_2_1_1_0());
                                                                        }
                                                                        otherlv_10 = (Token) match(input, Colon, FollowSets000.FOLLOW_8);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_10, grammarAccess.getProvidedCapabilityAccess().getColonKeyword_2_1_1_1());
                                                                        }
                                                                        // InternalExBeeLangTestLanguageParser.g:698:10: ( (lv_name_11_0= RULE_ID ) )
                                                                        // InternalExBeeLangTestLanguageParser.g:699:11: (lv_name_11_0= RULE_ID )
                                                                        {
                                                                            // InternalExBeeLangTestLanguageParser.g:699:11: (lv_name_11_0= RULE_ID )
                                                                            // InternalExBeeLangTestLanguageParser.g:700:12: lv_name_11_0= RULE_ID
                                                                            {
                                                                                lv_name_11_0 = (Token) match(input, RULE_ID, FollowSets000.FOLLOW_14);
                                                                                if (state.failed)
                                                                                    return current;
                                                                                if (state.backtracking == 0) {
                                                                                    newLeafNode(lv_name_11_0, grammarAccess.getProvidedCapabilityAccess().getNameIDTerminalRuleCall_2_1_1_2_0());
                                                                                }
                                                                                if (state.backtracking == 0) {
                                                                                    if (current == null) {
                                                                                        current = createModelElement(grammarAccess.getProvidedCapabilityRule());
                                                                                    }
                                                                                    setWithLastConsumed(current, "name", lv_name_11_0, "org.eclipse.xtext.common.Terminals.ID");
                                                                                }
                                                                            }
                                                                        }
                                                                        otherlv_12 = (Token) match(input, Semicolon, FollowSets000.FOLLOW_20);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_12, grammarAccess.getProvidedCapabilityAccess().getSemicolonKeyword_2_1_1_3());
                                                                        }
                                                                    }
                                                                }
                                                                getUnorderedGroupHelper().returnFromSelection(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1());
                                                            }
                                                        }
                                                    }
                                                    break;
                                                case 3:
                                                    // InternalExBeeLangTestLanguageParser.g:726:5: ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) )
                                                    {
                                                        // InternalExBeeLangTestLanguageParser.g:726:5: ({...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) ) )
                                                        // InternalExBeeLangTestLanguageParser.g:727:6: {...}? => ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) )
                                                        {
                                                            if (!getUnorderedGroupHelper().canSelect(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1(), 2)) {
                                                                if (state.backtracking > 0) {
                                                                    state.failed = true;
                                                                    return current;
                                                                }
                                                                throw new FailedPredicateException(input, "ruleProvidedCapability", "getUnorderedGroupHelper().canSelect(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1(), 2)");
                                                            }
                                                            // InternalExBeeLangTestLanguageParser.g:727:118: ( ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) ) )
                                                            // InternalExBeeLangTestLanguageParser.g:728:7: ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) )
                                                            {
                                                                getUnorderedGroupHelper().select(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1(), 2);
                                                                // InternalExBeeLangTestLanguageParser.g:731:10: ({...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon ) )
                                                                // InternalExBeeLangTestLanguageParser.g:731:11: {...}? => (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon )
                                                                {
                                                                    if (!((true))) {
                                                                        if (state.backtracking > 0) {
                                                                            state.failed = true;
                                                                            return current;
                                                                        }
                                                                        throw new FailedPredicateException(input, "ruleProvidedCapability", "true");
                                                                    }
                                                                    // InternalExBeeLangTestLanguageParser.g:731:20: (otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon )
                                                                    // InternalExBeeLangTestLanguageParser.g:731:21: otherlv_13= Version otherlv_14= Colon ( (lv_version_15_0= RULE_ID ) ) otherlv_16= Semicolon
                                                                    {
                                                                        otherlv_13 = (Token) match(input, Version, FollowSets000.FOLLOW_12);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_13, grammarAccess.getProvidedCapabilityAccess().getVersionKeyword_2_1_2_0());
                                                                        }
                                                                        otherlv_14 = (Token) match(input, Colon, FollowSets000.FOLLOW_8);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_14, grammarAccess.getProvidedCapabilityAccess().getColonKeyword_2_1_2_1());
                                                                        }
                                                                        // InternalExBeeLangTestLanguageParser.g:739:10: ( (lv_version_15_0= RULE_ID ) )
                                                                        // InternalExBeeLangTestLanguageParser.g:740:11: (lv_version_15_0= RULE_ID )
                                                                        {
                                                                            // InternalExBeeLangTestLanguageParser.g:740:11: (lv_version_15_0= RULE_ID )
                                                                            // InternalExBeeLangTestLanguageParser.g:741:12: lv_version_15_0= RULE_ID
                                                                            {
                                                                                lv_version_15_0 = (Token) match(input, RULE_ID, FollowSets000.FOLLOW_14);
                                                                                if (state.failed)
                                                                                    return current;
                                                                                if (state.backtracking == 0) {
                                                                                    newLeafNode(lv_version_15_0, grammarAccess.getProvidedCapabilityAccess().getVersionIDTerminalRuleCall_2_1_2_2_0());
                                                                                }
                                                                                if (state.backtracking == 0) {
                                                                                    if (current == null) {
                                                                                        current = createModelElement(grammarAccess.getProvidedCapabilityRule());
                                                                                    }
                                                                                    setWithLastConsumed(current, "version", lv_version_15_0, "org.eclipse.xtext.common.Terminals.ID");
                                                                                }
                                                                            }
                                                                        }
                                                                        otherlv_16 = (Token) match(input, Semicolon, FollowSets000.FOLLOW_20);
                                                                        if (state.failed)
                                                                            return current;
                                                                        if (state.backtracking == 0) {
                                                                            newLeafNode(otherlv_16, grammarAccess.getProvidedCapabilityAccess().getSemicolonKeyword_2_1_2_3());
                                                                        }
                                                                    }
                                                                }
                                                                getUnorderedGroupHelper().returnFromSelection(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1());
                                                            }
                                                        }
                                                    }
                                                    break;
                                                default:
                                                    if (cnt15 >= 1)
                                                        break loop15;
                                                    if (state.backtracking > 0) {
                                                        state.failed = true;
                                                        return current;
                                                    }
                                                    EarlyExitException eee = new EarlyExitException(15, input);
                                                    throw eee;
                                            }
                                            cnt15++;
                                        } while (true);
                                        if (!getUnorderedGroupHelper().canLeave(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1())) {
                                            if (state.backtracking > 0) {
                                                state.failed = true;
                                                return current;
                                            }
                                            throw new FailedPredicateException(input, "ruleProvidedCapability", "getUnorderedGroupHelper().canLeave(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1())");
                                        }
                                    }
                                }
                                getUnorderedGroupHelper().leave(grammarAccess.getProvidedCapabilityAccess().getUnorderedGroup_2_1());
                            }
                            otherlv_17 = (Token) match(input, RightCurlyBracket, FollowSets000.FOLLOW_2);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                newLeafNode(otherlv_17, grammarAccess.getProvidedCapabilityAccess().getRightCurlyBracketKeyword_2_2());
                            }
                        }
                        break;
                }
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 8, ruleProvidedCapability_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 10 with UnorderedGroupState

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

the class InternalExBeeLangTestLanguageParser method entryRuleRequiredCapability.

// $ANTLR end "ruleAliasedRequiredCapability"
// $ANTLR start "entryRuleRequiredCapability"
// InternalExBeeLangTestLanguageParser.g:1104:1: entryRuleRequiredCapability returns [EObject current=null] : iv_ruleRequiredCapability= ruleRequiredCapability EOF ;
public final EObject entryRuleRequiredCapability() throws RecognitionException {
    EObject current = null;
    int entryRuleRequiredCapability_StartIndex = input.index();
    EObject iv_ruleRequiredCapability = null;
    UnorderedGroupState myUnorderedGroupState = getUnorderedGroupHelper().snapShot(grammarAccess.getRequiredCapabilityAccess().getUnorderedGroup_3_1());
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 11)) {
            return current;
        }
        // InternalExBeeLangTestLanguageParser.g:1108:2: (iv_ruleRequiredCapability= ruleRequiredCapability EOF )
        // InternalExBeeLangTestLanguageParser.g:1109:2: iv_ruleRequiredCapability= ruleRequiredCapability EOF
        {
            if (state.backtracking == 0) {
                newCompositeNode(grammarAccess.getRequiredCapabilityRule());
            }
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleRequiredCapability = ruleRequiredCapability();
            state._fsp--;
            if (state.failed)
                return current;
            if (state.backtracking == 0) {
                current = iv_ruleRequiredCapability;
            }
            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, 11, entryRuleRequiredCapability_StartIndex);
        }
        myUnorderedGroupState.restore();
    }
    return current;
}
Also used : UnorderedGroupState(org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState) EObject(org.eclipse.emf.ecore.EObject)

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