Search in sources :

Example 51 with AntlrDatatypeRuleToken

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

the class InternalTwoParametersTestLanguageParser method norm6_IdOrKeyword2.

// $ANTLR end "norm5_IdOrKeyword2"
// $ANTLR start "norm6_IdOrKeyword2"
// InternalTwoParametersTestLanguage.g:996:1: norm6_IdOrKeyword2 returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (kw= 'keyword' | this_ID_1= RULE_ID ) ;
public final AntlrDatatypeRuleToken norm6_IdOrKeyword2() throws RecognitionException {
    AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
    Token kw = null;
    Token this_ID_1 = null;
    enterRule();
    try {
        // InternalTwoParametersTestLanguage.g:1002:2: ( (kw= 'keyword' | this_ID_1= RULE_ID ) )
        // InternalTwoParametersTestLanguage.g:1003:2: (kw= 'keyword' | this_ID_1= RULE_ID )
        {
            // InternalTwoParametersTestLanguage.g:1003:2: (kw= 'keyword' | this_ID_1= RULE_ID )
            int alt13 = 2;
            int LA13_0 = input.LA(1);
            if ((LA13_0 == 20)) {
                alt13 = 1;
            } else if ((LA13_0 == RULE_ID)) {
                alt13 = 2;
            } else {
                if (state.backtracking > 0) {
                    state.failed = true;
                    return current;
                }
                NoViableAltException nvae = new NoViableAltException("", 13, 0, input);
                throw nvae;
            }
            switch(alt13) {
                case 1:
                    // InternalTwoParametersTestLanguage.g:1004:3: kw= 'keyword'
                    {
                        kw = (Token) match(input, 20, FollowSets000.FOLLOW_2);
                        if (state.failed)
                            return current;
                        if (state.backtracking == 0) {
                            current.merge(kw);
                            newLeafNode(kw, grammarAccess.getIdOrKeyword2Access().getKeywordKeyword_0_0());
                        }
                    }
                    break;
                case 2:
                    // InternalTwoParametersTestLanguage.g:1010:3: this_ID_1= RULE_ID
                    {
                        this_ID_1 = (Token) match(input, RULE_ID, FollowSets000.FOLLOW_2);
                        if (state.failed)
                            return current;
                        if (state.backtracking == 0) {
                            current.merge(this_ID_1);
                        }
                        if (state.backtracking == 0) {
                            newLeafNode(this_ID_1, grammarAccess.getIdOrKeyword2Access().getIDTerminalRuleCall_1());
                        }
                    }
                    break;
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Example 52 with AntlrDatatypeRuleToken

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

the class InternalTwoParametersTestLanguageParser method norm2_Scenario7.

// $ANTLR end "norm3_Scenario6"
// $ANTLR start "norm2_Scenario7"
// InternalTwoParametersTestLanguage.g:722:1: norm2_Scenario7 returns [EObject current=null] : ( ( ( ( norm2_IdOrKeyword2 ) )=> (lv_first_0_0= norm2_IdOrKeyword2 ) ) | ( (lv_second_1_0= 'keyword' ) ) ) ;
public final EObject norm2_Scenario7() throws RecognitionException {
    EObject current = null;
    Token lv_second_1_0 = null;
    AntlrDatatypeRuleToken lv_first_0_0 = null;
    enterRule();
    try {
        // InternalTwoParametersTestLanguage.g:728:2: ( ( ( ( ( norm2_IdOrKeyword2 ) )=> (lv_first_0_0= norm2_IdOrKeyword2 ) ) | ( (lv_second_1_0= 'keyword' ) ) ) )
        // InternalTwoParametersTestLanguage.g:729:2: ( ( ( ( norm2_IdOrKeyword2 ) )=> (lv_first_0_0= norm2_IdOrKeyword2 ) ) | ( (lv_second_1_0= 'keyword' ) ) )
        {
            // InternalTwoParametersTestLanguage.g:729:2: ( ( ( ( norm2_IdOrKeyword2 ) )=> (lv_first_0_0= norm2_IdOrKeyword2 ) ) | ( (lv_second_1_0= 'keyword' ) ) )
            int alt10 = 2;
            int LA10_0 = input.LA(1);
            if ((LA10_0 == RULE_ID) && (synpred7_InternalTwoParametersTestLanguage())) {
                alt10 = 1;
            } else if ((LA10_0 == 20)) {
                alt10 = 2;
            } else {
                if (state.backtracking > 0) {
                    state.failed = true;
                    return current;
                }
                NoViableAltException nvae = new NoViableAltException("", 10, 0, input);
                throw nvae;
            }
            switch(alt10) {
                case 1:
                    // InternalTwoParametersTestLanguage.g:730:3: ( ( ( norm2_IdOrKeyword2 ) )=> (lv_first_0_0= norm2_IdOrKeyword2 ) )
                    {
                        // InternalTwoParametersTestLanguage.g:730:3: ( ( ( norm2_IdOrKeyword2 ) )=> (lv_first_0_0= norm2_IdOrKeyword2 ) )
                        // InternalTwoParametersTestLanguage.g:731:4: ( ( norm2_IdOrKeyword2 ) )=> (lv_first_0_0= norm2_IdOrKeyword2 )
                        {
                            // InternalTwoParametersTestLanguage.g:735:4: (lv_first_0_0= norm2_IdOrKeyword2 )
                            // InternalTwoParametersTestLanguage.g:736:5: lv_first_0_0= norm2_IdOrKeyword2
                            {
                                if (state.backtracking == 0) {
                                    newCompositeNode(grammarAccess.getScenario7Access().getFirstIdOrKeyword2ParserRuleCall_0_0());
                                }
                                pushFollow(FollowSets000.FOLLOW_2);
                                lv_first_0_0 = norm2_IdOrKeyword2();
                                state._fsp--;
                                if (state.failed)
                                    return current;
                                if (state.backtracking == 0) {
                                    if (current == null) {
                                        current = createModelElementForParent(grammarAccess.getScenario7Rule());
                                    }
                                    set(current, "first", lv_first_0_0, "org.eclipse.xtext.parser.parameters.TwoParametersTestLanguage.IdOrKeyword2");
                                    afterParserOrEnumRuleCall();
                                }
                            }
                        }
                    }
                    break;
                case 2:
                    // InternalTwoParametersTestLanguage.g:754:3: ( (lv_second_1_0= 'keyword' ) )
                    {
                        // InternalTwoParametersTestLanguage.g:754:3: ( (lv_second_1_0= 'keyword' ) )
                        // InternalTwoParametersTestLanguage.g:755:4: (lv_second_1_0= 'keyword' )
                        {
                            // InternalTwoParametersTestLanguage.g:755:4: (lv_second_1_0= 'keyword' )
                            // InternalTwoParametersTestLanguage.g:756:5: lv_second_1_0= 'keyword'
                            {
                                lv_second_1_0 = (Token) match(input, 20, FollowSets000.FOLLOW_2);
                                if (state.failed)
                                    return current;
                                if (state.backtracking == 0) {
                                    newLeafNode(lv_second_1_0, grammarAccess.getScenario7Access().getSecondKeywordKeyword_1_0());
                                }
                                if (state.backtracking == 0) {
                                    if (current == null) {
                                        current = createModelElement(grammarAccess.getScenario7Rule());
                                    }
                                    setWithLastConsumed(current, "second", lv_second_1_0, "keyword");
                                }
                            }
                        }
                    }
                    break;
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Example 53 with AntlrDatatypeRuleToken

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

the class InternalTwoParametersTestLanguageParser method norm3_Scenario7.

// $ANTLR end "norm2_Scenario7"
// $ANTLR start "norm3_Scenario7"
// InternalTwoParametersTestLanguage.g:773:1: norm3_Scenario7 returns [EObject current=null] : ( ( ( ( norm7_IdOrKeyword2 ) )=> (lv_first_0_0= norm7_IdOrKeyword2 ) ) | ( (lv_second_1_0= 'keyword' ) ) ) ;
public final EObject norm3_Scenario7() throws RecognitionException {
    EObject current = null;
    Token lv_second_1_0 = null;
    AntlrDatatypeRuleToken lv_first_0_0 = null;
    enterRule();
    try {
        // InternalTwoParametersTestLanguage.g:779:2: ( ( ( ( ( norm7_IdOrKeyword2 ) )=> (lv_first_0_0= norm7_IdOrKeyword2 ) ) | ( (lv_second_1_0= 'keyword' ) ) ) )
        // InternalTwoParametersTestLanguage.g:780:2: ( ( ( ( norm7_IdOrKeyword2 ) )=> (lv_first_0_0= norm7_IdOrKeyword2 ) ) | ( (lv_second_1_0= 'keyword' ) ) )
        {
            // InternalTwoParametersTestLanguage.g:780:2: ( ( ( ( norm7_IdOrKeyword2 ) )=> (lv_first_0_0= norm7_IdOrKeyword2 ) ) | ( (lv_second_1_0= 'keyword' ) ) )
            int alt11 = 2;
            int LA11_0 = input.LA(1);
            if ((LA11_0 == 20)) {
                int LA11_1 = input.LA(2);
                if ((synpred8_InternalTwoParametersTestLanguage())) {
                    alt11 = 1;
                } else if ((true)) {
                    alt11 = 2;
                } else {
                    if (state.backtracking > 0) {
                        state.failed = true;
                        return current;
                    }
                    NoViableAltException nvae = new NoViableAltException("", 11, 1, input);
                    throw nvae;
                }
            } else if ((LA11_0 == RULE_ID) && (synpred8_InternalTwoParametersTestLanguage())) {
                alt11 = 1;
            } else {
                if (state.backtracking > 0) {
                    state.failed = true;
                    return current;
                }
                NoViableAltException nvae = new NoViableAltException("", 11, 0, input);
                throw nvae;
            }
            switch(alt11) {
                case 1:
                    // InternalTwoParametersTestLanguage.g:781:3: ( ( ( norm7_IdOrKeyword2 ) )=> (lv_first_0_0= norm7_IdOrKeyword2 ) )
                    {
                        // InternalTwoParametersTestLanguage.g:781:3: ( ( ( norm7_IdOrKeyword2 ) )=> (lv_first_0_0= norm7_IdOrKeyword2 ) )
                        // InternalTwoParametersTestLanguage.g:782:4: ( ( norm7_IdOrKeyword2 ) )=> (lv_first_0_0= norm7_IdOrKeyword2 )
                        {
                            // InternalTwoParametersTestLanguage.g:786:4: (lv_first_0_0= norm7_IdOrKeyword2 )
                            // InternalTwoParametersTestLanguage.g:787:5: lv_first_0_0= norm7_IdOrKeyword2
                            {
                                if (state.backtracking == 0) {
                                    newCompositeNode(grammarAccess.getScenario7Access().getFirstIdOrKeyword2ParserRuleCall_0_0());
                                }
                                pushFollow(FollowSets000.FOLLOW_2);
                                lv_first_0_0 = norm7_IdOrKeyword2();
                                state._fsp--;
                                if (state.failed)
                                    return current;
                                if (state.backtracking == 0) {
                                    if (current == null) {
                                        current = createModelElementForParent(grammarAccess.getScenario7Rule());
                                    }
                                    set(current, "first", lv_first_0_0, "org.eclipse.xtext.parser.parameters.TwoParametersTestLanguage.IdOrKeyword2");
                                    afterParserOrEnumRuleCall();
                                }
                            }
                        }
                    }
                    break;
                case 2:
                    // InternalTwoParametersTestLanguage.g:805:3: ( (lv_second_1_0= 'keyword' ) )
                    {
                        // InternalTwoParametersTestLanguage.g:805:3: ( (lv_second_1_0= 'keyword' ) )
                        // InternalTwoParametersTestLanguage.g:806:4: (lv_second_1_0= 'keyword' )
                        {
                            // InternalTwoParametersTestLanguage.g:806:4: (lv_second_1_0= 'keyword' )
                            // InternalTwoParametersTestLanguage.g:807:5: lv_second_1_0= 'keyword'
                            {
                                lv_second_1_0 = (Token) match(input, 20, FollowSets000.FOLLOW_2);
                                if (state.failed)
                                    return current;
                                if (state.backtracking == 0) {
                                    newLeafNode(lv_second_1_0, grammarAccess.getScenario7Access().getSecondKeywordKeyword_1_0());
                                }
                                if (state.backtracking == 0) {
                                    if (current == null) {
                                        current = createModelElement(grammarAccess.getScenario7Rule());
                                    }
                                    setWithLastConsumed(current, "second", lv_second_1_0, "keyword");
                                }
                            }
                        }
                    }
                    break;
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Example 54 with AntlrDatatypeRuleToken

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

the class InternalTwoParametersTestLanguageParser method entryRuleIdOrKeyword2.

// $ANTLR end "norm3_Scenario8"
// $ANTLR start "entryRuleIdOrKeyword2"
// InternalTwoParametersTestLanguage.g:909:1: entryRuleIdOrKeyword2 returns [String current=null] : iv_ruleIdOrKeyword2= ruleIdOrKeyword2 EOF ;
public final String entryRuleIdOrKeyword2() throws RecognitionException {
    String current = null;
    AntlrDatatypeRuleToken iv_ruleIdOrKeyword2 = null;
    try {
        // InternalTwoParametersTestLanguage.g:909:52: (iv_ruleIdOrKeyword2= ruleIdOrKeyword2 EOF )
        // InternalTwoParametersTestLanguage.g:910:2: iv_ruleIdOrKeyword2= ruleIdOrKeyword2 EOF
        {
            if (state.backtracking == 0) {
                newCompositeNode(grammarAccess.getIdOrKeyword2Rule());
            }
            pushFollow(FollowSets000.FOLLOW_1);
            iv_ruleIdOrKeyword2 = ruleIdOrKeyword2();
            state._fsp--;
            if (state.failed)
                return current;
            if (state.backtracking == 0) {
                current = iv_ruleIdOrKeyword2.getText();
            }
            match(input, EOF, FollowSets000.FOLLOW_2);
            if (state.failed)
                return current;
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Example 55 with AntlrDatatypeRuleToken

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

the class InternalTwoParametersTestLanguageParser method ruleScenario6.

// $ANTLR end "entryRuleScenario6"
// $ANTLR start "ruleScenario6"
// InternalTwoParametersTestLanguage.g:632:1: ruleScenario6 returns [EObject current=null] : ( (lv_first_0_0= ruleIdOrKeyword2 ) ) ;
public final EObject ruleScenario6() throws RecognitionException {
    EObject current = null;
    AntlrDatatypeRuleToken lv_first_0_0 = null;
    enterRule();
    try {
        // InternalTwoParametersTestLanguage.g:638:2: ( ( (lv_first_0_0= ruleIdOrKeyword2 ) ) )
        // InternalTwoParametersTestLanguage.g:639:2: ( (lv_first_0_0= ruleIdOrKeyword2 ) )
        {
            // InternalTwoParametersTestLanguage.g:639:2: ( (lv_first_0_0= ruleIdOrKeyword2 ) )
            // InternalTwoParametersTestLanguage.g:640:3: (lv_first_0_0= ruleIdOrKeyword2 )
            {
                // InternalTwoParametersTestLanguage.g:640:3: (lv_first_0_0= ruleIdOrKeyword2 )
                // InternalTwoParametersTestLanguage.g:641:4: lv_first_0_0= ruleIdOrKeyword2
                {
                    if (state.backtracking == 0) {
                        newCompositeNode(grammarAccess.getScenario6Access().getFirstIdOrKeyword2ParserRuleCall_0());
                    }
                    pushFollow(FollowSets000.FOLLOW_2);
                    lv_first_0_0 = ruleIdOrKeyword2();
                    state._fsp--;
                    if (state.failed)
                        return current;
                    if (state.backtracking == 0) {
                        if (current == null) {
                            current = createModelElementForParent(grammarAccess.getScenario6Rule());
                        }
                        set(current, "first", lv_first_0_0, "org.eclipse.xtext.parser.parameters.TwoParametersTestLanguage.IdOrKeyword2");
                        afterParserOrEnumRuleCall();
                    }
                }
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Aggregations

AntlrDatatypeRuleToken (org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)350 EObject (org.eclipse.emf.ecore.EObject)105 XtextTokenStream (org.eclipse.xtext.parser.antlr.XtextTokenStream)27 HiddenTokens (org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens)27 Test (org.junit.Test)10 Enumerator (org.eclipse.emf.common.util.Enumerator)4 CommonToken (org.antlr.runtime.CommonToken)3 UnorderedGroupState (org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper.UnorderedGroupState)3 DatatypeRuleToken (org.eclipse.xtext.parser.impl.DatatypeRuleToken)2